Hardware Reference
In-Depth Information
General Startup Sequence
Ignoring special events like power on demand and keyboard events, the general
/etc/inittab
processing follows this sequence:
1.
/etc/inittab
is searched for the
initdefault
action.
2.
The user is prompted at the console for a run level, if none is
found in
/etc/inittab
or the file is missing.
The
init
process sets the run level.
3.
The
sysinit
entries are performed.
4.
The
boot
and
bootwait
entries are performed.
5.
6.
All other entries that include the established run level are
performed.
Step 4: sysinit
The standard Raspbian image uses the following for step 4:
# Boot−time system configuration/initialization script.
# This is run first except when booting in emergency (−b) mode.
si::sysinit:/etc/init.d/rcS
The preceding
sysinit
entry specifies that script
/etc/init.d/rcS
is to be run.
This is a simple script that redirects the execution to yet another script:
#!/bin/sh
#
# rcS
#
# Call all S??
scripts in /etc/rcS.d/ in numerical/alphabetical order
∗
#
exec /etc/init.d/rc S
From this we see that execution continues with
/etc/init.d/rc
with argument
1 set to
S
. This script is responsible for starting and stopping services on run-level
changes. This particular
inittab
entry is used at initial boot-up and is used to invoke all
startup scripts in
/etc/rcS.d/S*
.
Each of the
/etc/rcS.d/S*
scripts get invoked with one argument,
start
. Normally,
the script would invoke
/etc/rcS.d/K*
scripts first (kill scripts that we will discuss later),
but upon initial boot, there is no prior run level.
Step 5: boot/bootwait
Under Raspbian Linux, there are no
boot
or
bootwait
entries to perform.