Customize the init scripts

The baselayout-lite creates a directory named /etc/init.d/ That directory contains the script used to start/stop services. It also contains two script: rcK and rcS. rcS is responsible of starting, in the proper order, all the executable files into /etc/init.d/ that start with the character 'S'. rcK the same, but it kills the filea that start with K. BusyBox init doesn't support runlevels. The runlevels field into the file /etc/inittabis completely ingored by the Busybox init. In case you want userleves you need to use sysvinit. The file /etc/inittab controls what happens during the bootstrap. Here an example:

# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels.  The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id        == tty to run on, or empty for /dev/console
# runlevels == ignored
# action    == one of sysinit, respawn, askfirst, wait, and once
# process   == program to run

# Startup the system

# peforms check fot the hda1 filesystem
console::sysinit:/sbin/fsck.ext2 -y /dev/hda1

# peforms check fot the hda2 filesystem
console::sysinit:/sbin/fsck.ext2 -y /dev/hda2

# remount the / filesystem in read-only mode
null::sysinit:/bin/mount -o remount,ro /

# mount /proc filesystem
null::sysinit:/bin/mount -t proc proc /proc

# mount all other file systems
null::sysinit:/bin/mount -a

# set the hostname taking it from /etc/hostname
null::sysinit:/bin/hostname -F /etc/hostname

# configure the loop back interface
null::sysinit:/sbin/ifconfig lo 127.0.0.1 up

# set route for the loopback interface
null::sysinit:/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# configure the eth0 interface taking information from the /etc/net.eth0 file 
null::sysinit:/sbin/ifconfig eth0 $(cat /etc/net.eth0) up

# set the default gateway taking its ip address from /etc/gateway
null::sysinit:/sbin/route add default gw $(cat /etc/gateway)

# create some temporary directories
null::sysinit:/bin/mkdir -p /tmp/var/log
null::sysinit:/bin/mkdir -p /tmp/var/run
null::sysinit:/bin/mkdir -p /tmp/var/tmp

# set the keyboard layout to italian
null::sysinit:/bin/loadkeys it

# load some kernel modules, in this case a kernel module for the touchscreen
null::sysinit:/sbin/modprobe touch

# now run any rc scripts
::sysinit:/etc/init.d/rcS

# Set up a couple of getty's
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2

# Put a getty on the first serial port with 115200 baudrate
ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100

# Logging junk
null::sysinit:/bin/touch /var/log/messages

# run syslogd
null::respawn:/sbin/syslogd -n -m 0
null::respawn:/sbin/klogd -n
#tty3::respawn:/bin/tail -f /var/log/messages

# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting

null::shutdown:/etc/init.d/rcK
null::shutdown:/bin/killall klogd
null::shutdown:/bin/killall syslogd
null::shutdown:/bin/umount -a -r
#null::shutdown:/sbin/swapoff -a
That file above is the standard inittab of busybox plus some customisation i did. The file /etc/net.eth0 contains this line
   <youripaddress> netmask <yournetmask>
The file /etc/gateway must only contain one line with the IP address of the gateway.