2011-03-30 06:53:33 -07:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
# desc: create a boot floppy or configure hard disk to boot plan 9
|
|
|
|
# prereq: copydist
|
|
|
|
|
|
|
|
switch($1) {
|
|
|
|
case go
|
|
|
|
echo
|
|
|
|
echo 'Initializing Plan 9 FAT configuration partition (9fat)'
|
|
|
|
echo
|
|
|
|
|
|
|
|
fat=(/dev/sd*/9fat)
|
|
|
|
fat=$fat(1)
|
|
|
|
disk=`{echo $fat | sed 's:/dev/::;s:/9fat::'}
|
2011-04-21 17:50:41 -07:00
|
|
|
if(! test -f $fat) {
|
2011-03-30 06:53:33 -07:00
|
|
|
echo 'You have no 9fat partition. Can''t setup booting.'
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
if(! test -f /tmp/plan9.ini) {
|
|
|
|
{
|
2011-04-21 17:50:41 -07:00
|
|
|
echo bootfile'='9pcf
|
|
|
|
echo 'bootargs=local!'^$fs
|
2011-03-30 06:53:33 -07:00
|
|
|
echo 'mouseport='^$mouseport
|
|
|
|
echo 'monitor='^$monitor
|
|
|
|
echo 'vgasize='^$vgasize
|
2011-04-28 15:38:29 -07:00
|
|
|
echo '*nomp=1'
|
2011-03-30 06:53:33 -07:00
|
|
|
} >/tmp/plan9.ini
|
|
|
|
}
|
|
|
|
|
|
|
|
need9fatformat=no
|
2011-05-01 20:01:52 -07:00
|
|
|
if(! ~ `{fstype $fat} dos)
|
2011-03-30 06:53:33 -07:00
|
|
|
need9fatformat=yes
|
2011-04-21 17:50:41 -07:00
|
|
|
if(! test -f /srv/dos)
|
|
|
|
dossrv
|
2011-04-28 15:38:29 -07:00
|
|
|
if(! mount -c /srv/dos /n/9fat $fat >[2]/dev/null)
|
2011-03-30 06:53:33 -07:00
|
|
|
need9fatformat=yes
|
|
|
|
if not if(! test -f /n/9fat/plan9.ini)
|
|
|
|
need9fatformat=yes
|
|
|
|
|
|
|
|
if(~ $need9fatformat yes){
|
|
|
|
log Initializing Plan 9 FAT partition.
|
2011-04-21 17:50:41 -07:00
|
|
|
disk/format -r 2 -d -b /386/pbs $fat /n/newfs/386/9bootfat
|
|
|
|
mount -c /srv/dos /n/9fat $fat
|
2011-03-30 06:53:33 -07:00
|
|
|
}
|
2011-04-21 17:50:41 -07:00
|
|
|
logprog cp /tmp/plan9.ini /n/9fat/plan9.ini
|
|
|
|
logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
|
|
|
|
logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
|
2011-03-30 06:53:33 -07:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo 'There are myriad ways to boot a Plan 9 system.'
|
|
|
|
echo 'You can use any of the following.'
|
|
|
|
echo
|
|
|
|
echo ' plan9 - make the plan 9 disk partition the default for booting'
|
|
|
|
echo ' winnt - add a plan 9 option to windows nt/2000/xp boot manager'
|
|
|
|
echo
|
|
|
|
echo 'If you are upgrading an extant third edition installation and booting'
|
|
|
|
echo 'from something other than a floppy, you needn''t run anything here.'
|
|
|
|
echo 'Just type ctl-d.'
|
|
|
|
|
|
|
|
oldbootsetup=$didbootsetup
|
|
|
|
didbootsetup=1
|
|
|
|
export didbootsetup
|
2011-04-12 09:32:51 -07:00
|
|
|
prompt 'Enable boot method' plan9 winnt
|
2011-03-30 06:53:33 -07:00
|
|
|
|
|
|
|
if(! boot$rd){
|
|
|
|
didbootsetup=$oldbootsetup
|
|
|
|
export didbootsetup
|
|
|
|
}
|
|
|
|
|
|
|
|
case checkdone
|
|
|
|
xxxfat=(/dev/sd*/9fat)
|
2011-05-01 20:01:52 -07:00
|
|
|
xxxfat=$xxxfat(1)
|
|
|
|
if(! ~ `{fstype $xxxfat} dos || ! ~ $didbootsetup 1){
|
2011-03-30 06:53:33 -07:00
|
|
|
bootsetup=ready
|
|
|
|
export bootsetup
|
|
|
|
}
|
|
|
|
}
|