]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/inst/bootsetup
add cpu server to the installer; add more files for cpu server; make sure they are...
[plan9front.git] / rc / bin / inst / bootsetup
1 #!/bin/rc
2
3 # desc: create a boot floppy or configure hard disk to boot plan 9
4 # prereq: systype copydist
5
6 switch($1) {
7 case go
8         echo
9         echo 'Initializing Plan 9 FAT configuration partition (9fat)'
10         echo
11         
12         fat=(/dev/sd*/9fat)
13         fat=$fat(1)
14         disk=`{echo $fat | sed 's:/dev/::;s:/9fat::'}
15         if(! test -f $fat) {
16                 echo 'You have no 9fat partition.  Can''t setup booting.'
17                 exit
18         }
19
20         if(! test -f /tmp/plan9.ini) {
21                 if(~ $syst cpu)
22                         bootfile=9pccpuf
23                 if not
24                         bootfile=9pcf
25                 {
26                         echo 'bootfile='^$bootfile
27                         echo 'bootargs=local!'^$fs
28                         echo 'sysname=cirno'
29                         echo 'mouseport='^$mouseport
30                         echo 'monitor='^$monitor
31                         echo 'vgasize='^$vgasize
32                         if(test -f '#ec/*nomp')
33                                 echo '*nomp='
34                 } >/tmp/plan9.ini
35         }
36
37         need9fatformat=no
38         if(! ~ `{fstype $fat} dos)
39                 need9fatformat=yes
40         if(! test -f /srv/dos)
41                 dossrv
42         if(! mount -c /srv/dos /n/9fat $fat >[2]/dev/null)
43                 need9fatformat=yes
44         if not if(! test -f /n/9fat/plan9.ini)
45                 need9fatformat=yes
46
47         if(~ $need9fatformat yes){
48                 log Initializing Plan 9 FAT partition.
49                 disk/format -r 2 -d -b /386/pbs $fat /n/newfs/386/9bootfat
50                 mount -c /srv/dos /n/9fat $fat
51         }
52         logprog cp /tmp/plan9.ini /n/9fat/plan9.ini
53         logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
54         logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
55         logprog cp /n/newfs/386/9pccpuf /n/9fat/9pccpuf
56
57         echo
58         echo 'There are myriad ways to boot a Plan 9 system.'
59         echo 'You can use any of the following.'
60         echo
61         echo '  plan9  - make the plan 9 disk partition the default for booting'
62         echo '  winnt  - add a plan 9 option to windows nt/2000/xp boot manager'
63         echo
64         echo 'If you are upgrading an extant third edition installation and booting'
65         echo 'from something other than a floppy, you needn''t run anything here.'
66         echo 'Just type ctl-d.'
67
68         oldbootsetup=$didbootsetup
69         didbootsetup=1
70         export didbootsetup
71         prompt 'Enable boot method' plan9 winnt
72         
73         if(! boot$rd){
74                 didbootsetup=$oldbootsetup
75                 export didbootsetup
76         }
77
78 case checkdone
79         xxxfat=(/dev/sd*/9fat)
80         xxxfat=$xxxfat(1)
81         if(! ~ `{fstype $xxxfat} dos || ! ~ $didbootsetup 1){
82                 bootsetup=ready
83                 export bootsetup
84         }
85 }