3 # desc: create a boot floppy or configure hard disk to boot plan 9
9 echo 'Initializing Plan 9 FAT configuration partition (9fat)'
14 disk=`{echo $fat | sed 's:/dev/::;s:/9fat::'}
15 bootfs=`{echo $fs | sed 's:/dev/(sd..)/(.*):\1!\2:'}
16 bootfat=`{echo $fs | sed 's:/dev/(sd..)/(.*):\1!9fat:'}
17 if(! test -f /dev/$disk/9fat) {
18 echo 'You have no 9fat partition. Can''t setup booting.'
22 if(! test -f /tmp/plan9.ini) {
24 sfs=`{echo $fs | sed 's;/dev;#S;'}
25 if(~ $fstype fossil fossil+venti){
26 echo bootfile'='$bootfat!9pcf
27 echo 'bootargs=local!'^$sfs
28 echo 'bootdisk=local!'^$sfs
31 echo bootfile'='$bootfs!/386/9pcdisk
32 echo 'bootdisk=local!'^$sfs
34 if(~ $fstype fossil+venti){
35 venti=`{echo $ventiarena | sed 's;/dev;#S;'}
38 # sort -u avoids dups which could otherwise trigger
39 # pointless boot menus.
40 grep -v '(^\[)|menuitem|adisk|bootfile|bootdisk|bootargs|nobootprompt|mouseport|vgasize|monitor|cdboot' /tmp/plan9.orig |
42 echo 'mouseport='^$mouseport
43 echo 'monitor='^$monitor
44 echo 'vgasize='^$vgasize
47 if(! test -f /tmp/plan9ini.bak)
48 cp /tmp/plan9.ini /tmp/plan9ini.bak
51 if(! isfat /dev/$disk/9fat)
53 if not if(! mount -c /srv/dos /n/9fat /dev/$disk/9fat >[2]/dev/null)
55 if not if(! test -f /n/9fat/plan9.ini)
58 if(~ $need9fatformat yes){
59 log Initializing Plan 9 FAT partition.
60 disk/format -r 2 -d -b /386/pbs \
61 /dev/$disk/9fat /n/newfs/386/9bootfat
62 mount -c /srv/dos /n/9fat /dev/$disk/9fat
65 if(! test -f /n/9fat/4e){
66 logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
67 logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
68 if(test -f /n/9fat/plan9.ini && ! test -f /n/9fat/plan9-3e.ini)
69 logprog mv /n/9fat/plan9.ini /n/9fat/plan9-3e.ini
70 if(test -f /n/9fat/9pcdisk && ! test -f /n/9fat/9pc3e)
71 logprog mv /n/9fat/9pcdisk /n/9fat/9pc3e
73 awk -f /bin/inst/mkini.awk >/n/9fat/plan9.ini
78 echo 'There are myriad ways to boot a Plan 9 system.'
79 echo 'You can use any of the following.'
81 echo ' plan9 - make the plan 9 disk partition the default for booting'
82 echo ' winnt - add a plan 9 option to windows nt/2000/xp boot manager'
84 echo 'If you are upgrading an extant third edition installation and booting'
85 echo 'from something other than a floppy, you needn''t run anything here.'
86 echo 'Just type ctl-d.'
88 oldbootsetup=$didbootsetup
91 prompt 'Enable boot method' plan9 winnt
94 didbootsetup=$oldbootsetup
99 xxxfat=(/dev/sd*/9fat)
100 if(! isfat $xxxfat(1) || ! ~ $didbootsetup 1){