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/bootplan9 | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'rc/bin/inst/bootplan9') diff --git a/rc/bin/inst/bootplan9 b/rc/bin/inst/bootplan9 index c7eb185b4..702d5d5a6 100755 --- a/rc/bin/inst/bootplan9 +++ b/rc/bin/inst/bootplan9 @@ -1,5 +1,20 @@ #!/bin/rc +# look for esp and format it when not already done +esp=`{ls /dev/$disk/esp >[2]/dev/null} +if(~ $#esp 1 && ! ~ fstype $esp dos){ + echo + echo 'Here appears to be a unformated EFI system partition:' + echo ' ' $esp + echo + prompt 'Initialize FAT on EFI system partition' yes no + switch($rd) { + case yes + # 4k clusters to force FAT32 + disk/format -d -c 8 -l ESP $esp + } +} + # look for plan9 partition in the DOS partition table (if any) p9part=`{disk/fdisk /dev/$disk/data >[2]/dev/null [2]/dev/null >/dev/null x=$status if(~ $x '' '|'){ -- cgit v1.2.3