Why is rcS required after file system is mounted by the kernel

.rckernelraspberry pisysvinit

I using embedded Linux, I have compiled the kernel without initramfs and kernel is booting fine. But It shows me rcS file is not found I have put it in /etc/init.d/rcS and my rcS file look like

#!/bin/sh
echo "Hello world"

After the file system is mounted by the kernel it prints Hello world.

Can any one tell/explain me why this file is require and how could I start those start up scripts in particular order?

I am using Raspberry Pi with busybox and it works fine but get I got stuck in the startup.

Best Answer

/etc/init.d/rcS allows you to run additional programs at boot time. Its typical use is to mount additional filesystems (only the root filesystem is mounted at that point) and launch some daemons.

Usually rcS is a shell script, which can easily be customized on the fly. Typical distributions make rcS a simple script that executes further scripts in /etc/rcS.d (the exact location is distribution-dependent); this allows each daemon to be package with its own init script. The file /etc/rc.local is also executed by rcS if present; it is intended for commands written by the system administrator.

With the traditional SysVinit implementation of init, /etc/init.d/rcS is listed in /etc/inittab (the sysinit setting). With BusyBox, you can also supply an inittab (if the feature is compiled in) but there is a built-in default that makes it read /etc/init.d/rcS (among other things).

Related Question