summaryrefslogtreecommitdiff
path: root/rc/bin/inst/partdisk
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-06-06 02:00:51 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-06-06 02:00:51 +0200
commit628611fb5c701365c3b2fcbf705448a1af635cc7 (patch)
tree36a97c5550f15776c8ba07c20a0d0250ee1534b4 /rc/bin/inst/partdisk
parent1613fd9f526dc5a5703bbeb1d84e59980db0845e (diff)
downloadplan9front-628611fb5c701365c3b2fcbf705448a1af635cc7.tar.xz
inst: provide gpt/mbr choice when disk is blank, format esp
Diffstat (limited to 'rc/bin/inst/partdisk')
-rwxr-xr-xrc/bin/inst/partdisk22
1 files changed, 12 insertions, 10 deletions
diff --git a/rc/bin/inst/partdisk b/rc/bin/inst/partdisk
index cea2136d8..bbe33fbbf 100755
--- a/rc/bin/inst/partdisk
+++ b/rc/bin/inst/partdisk
@@ -32,24 +32,26 @@ case go
prompt $default 'Disk to partition' $disks
disk=$rd
- if(! ./hasmbr /dev/$disk/data) {
+ diskedit=disk/fdisk
+ if(disk/edisk -p /dev/$disk/data >/dev/null >[2=1])
+ diskedit=disk/edisk
+
+ if(~ $diskedit disk/fdisk && ! ./hasmbr /dev/$disk/data) {
echo 'The disk you selected HAS NO master boot record on its first sector.'
echo '(Perhaps it is a completely blank disk.)'
- echo 'You need a master boot record to use the disk.'
- echo 'Should we install a default master boot record?'
+ echo 'Shall we create a blank EFI partition table (GPT)'
+ echo 'or install traditional DOS partition table (MBR)?'
echo
- prompt 'Install mbr' y n
+ prompt 'Install mbr or gpt' mbr gpt
switch($rd) {
- case y
+ case mbr
disk/mbr -m /386/mbr /dev/$disk/data
- pickdisk=done
+ case gpt
+ disk/edisk -bw /dev/$disk/data
+ diskedit=disk/edisk
}
}
- diskedit=disk/fdisk
- if(disk/edisk -p /dev/$disk/data >/dev/null >[2=1])
- diskedit=disk/edisk
-
echo
echo 'This is '$diskedit'; use it to create a Plan 9 partition.'
echo 'If there is enough room, a Plan 9 partition will be'