User Tools

Site Tools


qLinux
… a distribution study


<< Prev
System Configuration

Next >>
Setup the Shutdown Process


Setup the Boot Process

Lets recover how the boot process works with sinit. The initramfs calls  /qlnx/bin/sinit  as the process with pid 1. Then sinit calls  /qlnx/bin/rc.init 1)

Create the file  /qlnx/bin/rc.init  to manage the boot process:

cat > /qlnx/bin/rc.init << EOF
#!/qlnx/bin/sh
 
PATH="/exec:/qlnx/bin"
printf "\033[1m%s\n\033[0m" "Running $0 ..."
 
mount -n -o remount,rw / &>/qlnx/dev/null
 
# disable console logging (sysctl: kernel.printk)
#echo "1" >/qlnx/prc/sys/kernel/printk
 
#mount -t proc proc /qlnx/prc
#mount -t tmpfs sys /qlnx/sys
mount -o remount devtmpfs
mount -t tmpfs none /qlnx/run
mkdir -p /qlnx/dev/pts
mount -t devpts devpts /qlnx/dev/pts
#mount -f /
 
[ ! -e /qlnx/dev/stdin ]  && ln -s /qlnx/prc/self/fd/0 /qlnx/dev/stdin
[ ! -e /qlnx/dev/stdout ] && ln -s /qlnx/prc/self/fd/1 /qlnx/dev/stdout
[ ! -e /qlnx/dev/stderr ] && ln -s /qlnx/prc/self/fd/2 /qlnx/dev/stderr
 
# Remove fsck-related file system watermarks.
rm -f /fastboot /forcefsck
 
loadkeys /qlnx/dat/keymaps/i386/qwertz/de-latin1-nodeadkeys.map.gz
hostname `head -1 /qlnx/etc/init.d/hostname`
 
# bring up loopback interface
ip addr add 127.0.0.1/8 label lo dev lo
ip link set lo up
 
echo Starting root console on tty7
/qlnx/bin/setsid /qlnx/bin/agetty tty7 38400 linux -a root &
 
#mkdir -pv /qlnx/run/service
#ln -sf /qlnx/etc/init.d/services/* /qlnx/run/service/
#ln -s /qlnx/etc/init.d/svc.boot /qlnx/run/service
echo Starting svboot
/qlnx/bin/svboot
EOF

Make the file executable:

chmode 0750 rc.init

<< Prev
System Configuration

Next >>
Setup the Shutdown Process

1)
or whatever name was configured during the installation of sinit