update installer for 9bootfat

This commit is contained in:
cinap_lenrek 2011-04-12 16:32:51 +00:00
parent 67e93d6a0a
commit cef6cf06eb
4 changed files with 5 additions and 191 deletions

View file

@ -1,47 +0,0 @@
#!/bin/rc
rfork e
echo
echo 'Insert a disk other than your installation boot disk'
echo 'into your floppy drive; it will be erased to create'
echo 'the boot floppy.'
echo
echo -n 'Press enter when ready.'
read >/dev/null >[2]/dev/null
if(~ $#adisk 1)
; # do nothing
if not if(~ $#bootfile 0)
adisk=/dev/fd0disk
if not {
switch($bootfile) {
case sd*
adisk=`{echo $bootfile | sed 's#(sd..).*#/dev/\1/data#'}
case fd*
adisk=`{echo $bootfile | sed 's#(fd.).*#/dev/\1disk#'}
case *
echo 'unknown bootfile '^$bootfile^'; mail 9trouble@plan9.bell-labs.com'
exit oops
}
}
if(! ~ `{ls -l $adisk | awk '{print $6}'} 1474560){
echo 'Will not format non-floppy disk '^$"adisk. >[1=2]
exit 'bad adisk'
}
log Formatting boot floppy
if (test -e /n/newfs/386/9loadnousb)
bind /n/newfs/386/9loadnousb /n/newfs/386/9load # cater to old bioses
disk/format -b /386/pbs \
-fd $adisk /n/newfs/386/9load /n/newfs/386/9pcdisk.gz \
/tmp/plan9ini.bak
x=$status
if(~ $x ''){
echo
echo 'Done!'
echo
}
exit $x

View file

@ -55,34 +55,15 @@ case go
if not if(! test -f /n/9fat/plan9.ini)
need9fatformat=yes
if (test -e /n/newfs/386/9loadnousb)
bind /n/newfs/386/9loadnousb /n/newfs/386/9load # cater to old bioses
if(~ $need9fatformat yes){
log Initializing Plan 9 FAT partition.
disk/format -r 2 -d -b /386/pbs \
/dev/$disk/9fat /n/newfs/386/9load
# silently install pbslba if the partition is way into the disk.
# it''s our only hope. only need this for >8.5GB into the disk.
# but...
# there are so few non-LBA bioses out
# there anymore that we'll do this even if we're only 2GB into
# the disk. it's just not worth the headaches of dealing with
# crappy bioses that don't address the whole 8.5GB properly
9fatoffset=`{grep '^part 9fat ' /dev/$disk/ctl | awk '{print $4}'}
if(! ~ $#9fatoffset 1) {
echo 'could not find plan 9 partition.'
echo 'cannot happen'
exit bad
}
if(test $9fatoffset -gt 2097152) # 2GB
disk/format -b /386/pbslba /dev/$disk/9fat
/dev/$disk/9fat /n/newfs/386/9bootfat
mount -c /srv/dos /n/9fat /dev/$disk/9fat
}
if(! test -f /n/9fat/4e){
logprog cp /n/newfs/386/9load /n/9fat/9load
logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
if(test -f /n/9fat/plan9.ini && ! test -f /n/9fat/plan9-3e.ini)
logprog mv /n/9fat/plan9.ini /n/9fat/plan9-3e.ini
@ -97,9 +78,7 @@ case go
echo 'There are myriad ways to boot a Plan 9 system.'
echo 'You can use any of the following.'
echo
echo ' floppy - create a boot floppy'
echo ' plan9 - make the plan 9 disk partition the default for booting'
echo ' win9x - add a plan 9 option to windows 9x boot menu'
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'
@ -109,7 +88,7 @@ case go
oldbootsetup=$didbootsetup
didbootsetup=1
export didbootsetup
prompt 'Enable boot method' floppy plan9 win9x winnt
prompt 'Enable boot method' plan9 winnt
if(! boot$rd){
didbootsetup=$oldbootsetup

View file

@ -1,117 +0,0 @@
#!/bin/rc
dosdisk=`{ls /dev/sd??/dos >[2]/dev/null | sed 1q | sed 's!.*/(.*)/dos!\1!'}
if(~ $#dosdisk 0 || ! c: || ! test -f /n/c:/autoexec.bat || ! test -f /n/c:/config.sys) {
echo 'Could not find autoexec.bat or config.sys on the first FAT disk.'
exit bad
}
for (i in autoexec config msdos)
if(test -f /n/c:/$i.p9) {
echo 'A Plan 9 backup already exists; will not edit system files again.'
exit bad
}
for (i in autoexec.bat config.sys msdos.sys)
if(! cp /n/c:/$i /n/c:/^`{echo $i | sed 's/\.(bat|sys)$/.p9/'}) {
echo 'Could not back up '^$i^'; will not continue.'
exit bad
}
if(! test -d /n/c:/plan9 && ! mkdir /n/c:/plan9) {
echo 'Could not create directory /n/c:/plan9.'
exit bad
}
if(! cp /n/newfs/386/^(9load ld.com 9pcdisk) /tmp/plan9ini.bak /n/c:/plan9) {
echo 'Could not copy Plan 9 boot files into /n/c:/plan9.'
exit bad
}
chmod +w /n/c:/autoexec.bat /n/c:/config.sys /n/c:/msdos.sys
if(grep -si 'Plan ?9' /n/c:/config.sys || grep -si 'Plan ?9' /n/c:/autoexec.bat) {
echo 'Plan 9 entries already in config.sys or autoexec.bat.'
echo 'Not changing them; refer to Plan 9 install documentation'
echo 'to configure manually.'
exit bad
}
if(! grep -si '\[menu\]' /n/c:/config.sys) {
{
echo 1
echo i
echo '[menu] '
echo 'menuitem=windows, Windows '
echo 'menudefault=windows '
echo ' '
echo '[common] '
echo ' '
echo '[windows] '
echo .
echo w
echo q
} | ed /n/c:/config.sys >/dev/null >[2]/dev/null
}
{
echo 1
echo '/\[[Mm][Ee][Nn][Uu]\]'
echo '?^[Mm][Ee][Nn][Uu][Ii][Tt][Ee][Mm]='
echo a
echo 'menuitem=plan9, Plan 9 from Bell Labs '
echo .
echo '$'
echo a
echo ' '
echo '[plan9] '
echo ' '
echo .
echo w
echo q
} | ed /n/c:/config.sys >/dev/null>[2]/dev/null
{
echo 1
echo i
echo '@echo off '
echo 'if %config%==plan9 goto plan9 '
echo 'goto notplan9 '
echo ':plan9 '
echo 'plan9\ld '^$dosdisk^'!dos!plan9/9load '
echo ':notplan9 '
echo .
echo w
echo q
} | ed /n/c:/autoexec.bat >/dev/null>[2]/dev/null
fn zeroopt {
if(grep -s '^'^$1^'=1' /n/c:/msdos.sys) {
{
echo '/^'^$1^'=1/s/=1/=0/'
echo w
echo q
} | ed /n/c:/msdos.sys>/dev/null>[2]/dev/null
}
if not if (grep -s '^'^$1^'=0' /n/c:/msdos.sys)
;
if not {
{
echo 1
echo i
echo '[Options] '
echo 'Logo=0 '
echo .
echo w
echo q
} | ed /n/c:/msdos.sys>/dev/null>[2]/dev/null
}
}
if(grep -si '^\[paths\]' /n/c:/msdos.sys){ # Windows 9x rather than DOS
zeroopt Logo
# zeroopt BootGUI
}
echo 'Plan 9 added to Windows 9X boot menu.'
exit ''

View file

@ -7,9 +7,8 @@ cd /bin/inst
textinst=1
export textinst
tailfsrv &
while(! test -f /srv/log)
sleep 1
# use stderr as logfile
echo 2 >/srv/log
log `{date} Installation process started
inst/mainloop