cpurc: remove obsolete device binds, run diskparts after $sysname is known. remove /env/boottime. document.
parent
780c5dfd1a
commit
4354c401c1
27
rc/bin/cpurc
27
rc/bin/cpurc
|
@ -1,10 +1,13 @@
|
|||
#!/bin/rc
|
||||
# this file is run if service=cpu
|
||||
|
||||
date > /env/boottime
|
||||
# parallelism for mk
|
||||
NPROC=`{wc -l </dev/sysstat}
|
||||
|
||||
for(i in m i P S t u '$')
|
||||
# bind all likely devices
|
||||
for(i in t S P '$')
|
||||
bind -a '#'^$i /dev >/dev/null >[2=1]
|
||||
rm -f /env/i
|
||||
|
||||
mount -qb /srv/cons /dev
|
||||
|
||||
|
@ -23,22 +26,28 @@ unmount /mnt/temp
|
|||
# usb listener
|
||||
nusbrc
|
||||
|
||||
# name translation, cs sets /dev/sysname
|
||||
ndb/cs
|
||||
sysname=`{cat /dev/sysname}
|
||||
|
||||
# site-specific startup
|
||||
if(test -e /rc/bin/cpurc.local)
|
||||
. /rc/bin/cpurc.local
|
||||
|
||||
if (~ $#sysname 0 || ~ $sysname ''){
|
||||
# cs sets sysname (cpurc.local may already have started it so check)
|
||||
if(! test -e /srv/cs && ! test -e /net/cs)
|
||||
ndb/cs
|
||||
sysname=`{cat /dev/sysname}
|
||||
if(~ $#sysname 0 || ~ $sysname ''){
|
||||
sysname=cirno # default
|
||||
echo -n $sysname >/dev/sysname
|
||||
}
|
||||
prompt=($sysname^'# ' ' ')
|
||||
|
||||
# parallelism for mk
|
||||
NPROC=`{wc -l </dev/sysstat}
|
||||
# set up any partitions
|
||||
diskparts
|
||||
|
||||
# start up local swapping
|
||||
disk=`{ls /dev/sd*/swap >[2]/dev/null}
|
||||
if (! ~ $#disk 0)
|
||||
swap $disk(1) >/dev/null >[2=1]
|
||||
rm -f /env/disk
|
||||
|
||||
# cpu-specific startup
|
||||
if(test -e /cfg/$sysname/cpurc)
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
# this file is run if service=terminal
|
||||
TIMESYNCARGS=(-rLa1000000)
|
||||
|
||||
# parallelism for mk
|
||||
NPROC=`{wc -l </dev/sysstat}
|
||||
|
||||
# bind all likely devices
|
||||
for(i in S f k t m i v L P u U A '$' Σ κ)
|
||||
for(i in v t m i f S P L A '$')
|
||||
bind -a '#'^$i /dev >/dev/null >[2=1]
|
||||
rm -f /env/i
|
||||
|
||||
|
@ -24,15 +27,6 @@ unmount /mnt/temp
|
|||
# usb listener
|
||||
nusbrc
|
||||
|
||||
# set up any partitions
|
||||
diskparts
|
||||
|
||||
# start up local swapping
|
||||
disk=`{ls /dev/sd*/swap >[2]/dev/null}
|
||||
if (! ~ $#disk 0)
|
||||
swap $disk(1) >/dev/null >[2=1]
|
||||
rm -f /env/disk
|
||||
|
||||
# we do this before we have a name. we may need to do network
|
||||
# setup so that we can get a name.
|
||||
if(test -e /rc/bin/termrc.local)
|
||||
|
@ -47,8 +41,14 @@ if(~ $#sysname 0 || ~ $sysname ''){
|
|||
echo -n $sysname >/dev/sysname
|
||||
}
|
||||
|
||||
# parallelism for mk
|
||||
NPROC=`{wc -l </dev/sysstat}
|
||||
# set up any partitions
|
||||
diskparts
|
||||
|
||||
# start up local swapping
|
||||
disk=`{ls /dev/sd*/swap >[2]/dev/null}
|
||||
if (! ~ $#disk 0)
|
||||
swap $disk(1) >/dev/null >[2=1]
|
||||
rm -f /env/disk
|
||||
|
||||
# machine specific startup (e.g., for devices not probed)
|
||||
if(test -e /cfg/$sysname/termrc)
|
||||
|
|
|
@ -33,12 +33,8 @@ and
|
|||
.B $terminal
|
||||
these scripts start appropriate network processes and
|
||||
administrative daemons and enable swapping.
|
||||
.I Cpurc
|
||||
.I Termrc
|
||||
sets
|
||||
.B /env/boottime
|
||||
to the time
|
||||
.I cpurc
|
||||
was executed and
|
||||
.B /env/NPROC
|
||||
to a value suitable for parallel compilation in
|
||||
.IR mk (1).
|
||||
|
@ -54,9 +50,6 @@ exists for the machine named
|
|||
.BR $sysname ,
|
||||
.I termrc
|
||||
will execute it next.
|
||||
Automatic initialization of the mouse and
|
||||
VGA on a PC is suppressed, if the user is
|
||||
.BR none .
|
||||
These files should be edited by local installations
|
||||
to reflect the configuration of their systems.
|
||||
.PP
|
||||
|
|
Loading…
Reference in New Issue