3 #-----------------------------------------------------------------
4 # Submitted BY: Richard Downing <geek109 at hotmail dot com>
8 # Script Version: 1.1 (Changelog at end of file)
10 # Initial Package Version: applies to the Building LFS with runit
11 # version of 2004-03-29.
13 # Upstream Status: Not applicable.
15 # Origin: Richard Downing.
17 # Description: Execute to create required runit scripts. See Hint.
19 #------------------------------------------------------------------
25 cat > /etc
/runit
/1 << "EOF"
27 # System one time tasks
28 # The Stage 1 script for runit.
30 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
32 # mount the swap partition
33 /etc
/rc.d
/init.d
/swap start
35 # mount the /proc pseudo-partition
36 # N.B. ---------- Change to mountkernfs for LFS-Bootscripts-2.x
37 /etc
/rc.d
/init.d
/mountproc start
40 /etc
/rc.d
/init.d
/checkfs start
43 # and mount all other non-proc auto partitions
44 /etc
/rc.d
/init.d
/mountfs start
46 # clean up after the last boot session by
47 # removing stale /var/run and /var/lock files
48 # and setting up utmp etc.
49 /etc
/rc.d
/init.d
/cleanfs
51 # Initialise the random number generator
52 /etc
/rc.d
/init.d
/random start
54 # Set the system clock from the rtc
55 /etc
/rc.d
/init.d
/setclock start
57 # Load the keymap file
58 /etc
/rc.d
/init.d
/loadkeys
60 # Bring up the local loopback network
61 /etc
/rc.d
/init.d
/localnet start
63 # Bring up the NICs and network
64 # and set up the default gateway
65 /etc
/rc.d
/init.d
/network start
67 touch /etc
/runit
/stopit
68 chmod 0 /etc
/runit
/stopit
74 cat > /etc
/runit
/2 << "EOF"
77 PATH
=/bin
:/sbin
:/usr
/bin
:/usr
/sbin
79 exec env
- PATH
=$PATH \
80 runsvdir
/var
/service
'log: ............................................................
81 ........................................................................................
82 ........................................................................................
83 ........................................................................................
84 .......................................................................'
90 cat > /etc
/runit
/3 << "EOF"
94 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
97 test -x /etc
/runit
/reboot
&& LAST
=6
99 echo 'Waiting for getties to stop...'
100 svwaitdown
-xk -t10 /var
/service
/getty-
*
102 echo 'Waiting for services to stop...'
103 svwaitdown
-xk -t30 /var
/service
/*
105 # save the random number generator seed
106 /etc
/rc.d
/init.d
/random stop
109 /etc
/rc.d
/init.d
/swap stop
111 # Bring down the network
112 # and remove the default gateway
113 /etc
/rc.d
/init.d
/network stop
115 # Bring down the localnet
116 /etc
/rc.d
/init.d
/localnet stop
120 chmod +x
/etc
/runit
/3
122 cat > /etc
/runit
/ctrlaltdel
<< "EOF"
126 MSG
="System is going down in 14 seconds..."
128 # echo 'disabled.' ; exit
129 touch /etc
/runit
/stopit
130 chmod 100 /etc
/runit
/stopit
&& echo "$MSG" | wall
134 chmod +x
/etc
/runit
/ctrlaltdel
138 mkdir
-p /etc
/runit
/getty-
$N
139 echo "#!/bin/bash" > /etc
/runit
/getty-
$N/run
140 echo "exec /sbin/agetty 38400 tty$N linux" >> /etc
/runit
/getty-
$N/run
141 echo "#!/bin/bash" > /etc
/runit
/getty-
$N/finish
142 echo "exec utmpset -w tty$N" >> /etc
/runit
/getty-
$N/finish
143 chmod +x
/etc
/runit
/getty-
$N/*
144 mkdir
-p /var
/service
145 ln -s /etc
/runit
/getty-
$N /var
/service
148 #------------------------------------------------------------------#
150 # 2004-03-29 V1.0 First release. #
151 # 2004-04-05 V1.1 Fixed Getty creation script. #
152 # added N.B. for lfs-bootscripts-2.x.x #
153 #------------------------------------------------------------------#