From 628611fb5c701365c3b2fcbf705448a1af635cc7 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 6 Jun 2015 02:00:51 +0200 Subject: inst: provide gpt/mbr choice when disk is blank, format esp --- rc/bin/inst/partdisk | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'rc/bin/inst/partdisk') 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' -- cgit v1.2.3