The Sysvinit package contains programs for controlling the startup,
running, and shutdown of the system.
6.48.1. Environment Settings
This package requires compiler variables to be set for the target in the environment.
export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"6.48.2. Installation of Sysvinit
The following patch contains a number of updates to the
2.86:
patch -Np1 -i ../sysvinit-2.86-fixes-1.patch
The following sed makes changes in the Makefile required for cross-compiling:
cp -v src/Makefile src/Makefile.orig
sed -e 's@/dev/initctl@$(ROOT)&@g' \
-e 's@\(mknod \)-m \([0-9]* \)\(.* \)p@\1\3p; chmod \2\3@g' \
-e '/^ifeq/s/$(ROOT)//' \
-e 's@/usr/lib@$(ROOT)&@' \
src/Makefile.orig > src/MakefileCompile the package:
make -C src clobber
make -C src ROOT=${CLFS} CC="${CC}"Install the package:
make -C src ROOT=${CLFS} INSTALL="install" install6.48.3. Configuring Sysvinit
Create a new file /etc/inittab by running the
following:
cat > ${CLFS}/etc/inittab << "EOF"
# Begin /etc/inittab
id:3:initdefault:
si::sysinit:/etc/rc.d/init.d/rc sysinit
l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
su:S016:once:/sbin/sulogin
EOFThe following command adds the standard virtual terminals to
/etc/inittab. If your system only has a serial
console skip the following command:
cat >> ${CLFS}/etc/inittab << "EOF"
1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
EOFIf your system has a serial console run the following command to add
the entry to /etc/inittab:
cat >> ${CLFS}/etc/inittab << "EOF"
c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100
EOFFinally, Add the end line to /etc/inittab:
cat >> ${CLFS}/etc/inittab << "EOF"
# End /etc/inittab
EOFThe -I '\033(K' option tells
agetty to send this escape sequence to the terminal
before doing anything else. This escape sequence switches the console
character set to a user-defined one, which can be modified by running
the setfont program. The console
initscript from the CLFS-Bootscripts package calls the
setfont program during system startup. Sending this
escape sequence is necessary for people who use non-ISO 8859-1 screen
fonts, but it does not affect native English speakers.