You need the Sysvinit package again for this section.
Create the necessary directories by issuing these commands:
cd /etc mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d rcS.d
debian/etc/init.d/rc
file to: /etc/init.drcS
containing the following:
#!/bin/sh # Begin /etc/init.d/rcS runlevel=S prevlevel=N umask 022 export runlevel prevlevel trap ":" INT QUIT TSTP for i in /etc/rcS.d/S??* do [ ! -f "$i" ] && continue; $i start done # End /etc/init.d/rcS
reboot
containing the following:
#!/bin/sh # Begin /etc/init.d/reboot echo -n "System reboot in progress..." /sbin/reboot -d -f -i # End /etc/init.d/reboot
halt
containing the following:
#!/bin/sh # Begin /etc/init.d/halt /sbin/halt -d -f -i -p # End /etc/init.d/halt
mountfs
containing the following:
#!/bin/sh # Begin /etc/init.d/mountfs check_status() { if [ $? = 0 ] then echo "OK" else echo "FAILED" fi } echo -n "Remounting root file system in read-write mode..." /sbin/mount -n -o remount,rw / check_status > /etc/mtab /sbin/mount -f -o remount,rw / echo -n "Mounting proc file system..." /sbin/mount proc check_status # End /etc/init.d/mountfs
umountfs
containing the following:
#!/bin/sh # Begin /etc/init.d/umountfs check_status() { if [ $? = 0 ] then echo "OK" else echo "FAILED" fi } echo -n "Unmounting file systems..." /sbin/umount -a -r check_status echo -n "Remounting root file system in read-only mode..." /sbin/mount -o remount,ro / check_status # End /etc/init.d/umountfs
sendsignals
containing the following:
#!/bin/sh # Begin /etc/init.d/sendsignals check_status() { if [ $? = 0 ] then echo "OK" else echo "FAILED" fi } echo -n "Sending all processes the TERM signal..." /sbin/killall5 -15 check_status echo -n "Sending all processes the KILL signal..." /sbin/killall5 -9 check_status
chmod 755 reboot halt mountfs
umountfs sendsignals
cd ../rc6.d; ln -s ../init.d/umountfs S90umountfs ln -s ../init.d/reboot S99reboot ln -s ../init.d/sendsignals S80sendsignals cd ../rc0.d; ln -s ../init.d/umountfs S90umountfs ln -s ../init.d/halt S99halt ln -s ../init.d/sendsignals S80sendsignals cd ../rcS.d; ln -s ../init.d/mountfs S10mountfs
/etc/fstab
containing the following:
/dev/<LFS-partition device> / ext2 defaults 0 1 /dev/<swap-partition device> none swap sw 0 0 proc /proc proc defaults 0 0
You can test the system by restarting your computer and boot into LFS again. Any errors should be gone now and your root partition should be mounted in read-write mode automatically.
You can now finally restart your computer with a command like shutdown
-r now