3 # desc: create a boot floppy or configure hard disk to boot plan 9
4 # prereq: systype copydist
7 for(i in /dev/sd*/9fat){
13 case checkdone checkready
14 if(~ $#fats 0 || ~ $#9fat 1 && ~ `{fstype $9fat} dos && ~ $didbootsetup 1)
22 echo 'Setup Plan 9 FAT boot partition (9fat)'
29 prompt $default 'Plan 9 FAT partition' $fats
33 if(! test -f /tmp/plan9.ini) {
39 echo 'bootfile='^$bootfile
40 echo 'bootargs=local!'^$fs
43 echo 'mouseport='^$mouseport
44 echo 'monitor='^$monitor
45 echo 'vgasize='^$vgasize
46 if(test -f '#ec/*nomp')
52 if(! ~ `{fstype $9fat} dos)
54 if(! test -f /srv/dos)
56 if(! mount -c /srv/dos /n/9fat $9fat >[2]/dev/null)
58 if not if(! test -f /n/9fat/plan9.ini)
61 if(~ $need9fatformat yes){
62 log Initializing Plan 9 FAT partition.
63 disk/format -r 2 -d -b /386/pbs $9fat
64 mount -c /srv/dos /n/9fat $9fat
66 logprog rm -f /n/9fat/^(9bootfat plan9.ini 9pcf 9pccpuf)
67 logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
68 # make file continous on disk
69 logprog chmod +al /n/9fat/9bootfat
70 logprog cp /tmp/plan9.ini /n/9fat/plan9.ini
71 logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
72 logprog cp /n/newfs/386/9pccpuf /n/9fat/9pccpuf
75 echo 'There are myriad ways to boot a Plan 9 system.'
76 echo 'You can use any of the following.'
78 echo ' plan9 - make the plan 9 disk partition the default for booting'
79 echo ' winnt - add a plan 9 option to windows nt/2000/xp boot manager'
81 echo 'If you are upgrading an extant third edition installation and booting'
82 echo 'from something other than a floppy, you needn''t run anything here.'
83 echo 'Just type ctl-d.'
85 oldbootsetup=$didbootsetup
89 prompt 'Enable boot method' plan9 winnt
91 disk=`{basename `{basename -d $9fat}}
94 didbootsetup=$oldbootsetup