diff --git a/rc/bin/inst/bootsetup b/rc/bin/inst/bootsetup index c1de3dce2..bce607476 100755 --- a/rc/bin/inst/bootsetup +++ b/rc/bin/inst/bootsetup @@ -4,7 +4,7 @@ # prereq: copydist fats=() -for(i in /dev/sd*/9fat){ +for(i in (/dev/sd*/9fat /dev/sd*/esp)){ if(test -f $i) fats=($fats $i) } diff --git a/rc/bin/inst/partdisk b/rc/bin/inst/partdisk index bbe33fbbf..ccb0489c4 100755 --- a/rc/bin/inst/partdisk +++ b/rc/bin/inst/partdisk @@ -67,14 +67,16 @@ case go } case checkdone - # we want at least one disk with both an mbr and a plan9 partition - mbrandplan9=0 + # we want at least one disk that is both bootable and contains a Plan 9 partition + bootandplan9=0 disks=`{ls /dev/sd*/plan9 >[2]/dev/null | sed 's!/dev/(sd.*)/plan9!\1!'} for(disk in $disks) { - if(./hasmbr /dev/$disk/data) - mbrandplan9=1 + if(test -f /dev/$disk/esp) + bootandplan9=1 + if not if(./hasmbr /dev/$disk/data) + bootandplan9=1 } - if(~ $mbrandplan9 0){ + if(~ $bootandplan9 0){ partdisk=notdone export partdisk } diff --git a/rc/bin/inst/prepdisk b/rc/bin/inst/prepdisk index c3c08cf78..80fbf2bfc 100755 --- a/rc/bin/inst/prepdisk +++ b/rc/bin/inst/prepdisk @@ -3,13 +3,20 @@ # desc: subdivide plan 9 disk partition # prereq: partdisk +useesp=no + fn autotype { + if(~ $useesp no) + parts=(9fat) + if not + parts=() switch($fstype){ case cwfs cwfs64 cwfs64x - echo -a 9fat -a nvram -a fscache -a fsworm -a other + parts=($parts nvram fscache fsworm other) case hjfs gefs - echo -a 9fat -a nvram -a fs + parts=($parts nvram fs) } + echo '-a '^$parts } switch($1) { @@ -36,6 +43,17 @@ case go prompt $default 'Plan 9 partition to subdivide' $disks disk=$rd + if(ls `{basename -d $disk}^/esp >[2]/dev/null){ + echo + echo 'By default 9front places its boot materials on its own 9fat partition.' + echo 'This requires the firmware be capable of booting from fat partitions other than the esp.' + echo 'You can also place all boot materials directly on the esp instead.' + echo 'This option works with a larger set of machines, but may disrupt existing configurations.' + echo + prompt -d no 'Use esp as 9fat?' no yes + useesp=$rd + } + echo 'This is disk/prep; use it to subdivide the Plan 9 partition.' echo 'If it is not yet subdivided, a sensible layout will be suggested;' echo 'you can probably just type ''w'' and then ''q''.' @@ -44,7 +62,7 @@ case go disk/prep -p $disk >`{basename -d $disk}^/ctl >[2]/dev/null case checkdone - disks=(/dev/sd*/9fat) + disks=(/dev/sd*/nvram) if(! test -f $disks(1)) prepdisk=ready if(! ~ $prepdisk ready)