March 2012 Indigo Initialization
As of the 2012.03.19 Indigo release in March 2012, the initialization sequence was changed to use the runit services framework provided by busybox.
On Pronto platforms, the start-up sequence is now as follows:
- /etc/inittab has an "sv" entry that calls the /sbin/runsvdir-start shell script.
- /sbin/runsvdir-start invokes runsvdir on the /service directory.
- /etc/rc.sh is invoked, which performs the following:
- Kernel drivers are loaded.
- indigo-preinit.sh is sourced if it exists.
- /etc/system_init is run if it exists.
On GSM73xxSO platforms, the start-up sequence is now as follows:
- /etc/preinit is run, which starts up /sbin/init.
- /etc/inittab has an "sv" entry that calls the /sbin/runsvdir-start shell script.
- /sbin/runsvdir-start invokes runsvdir on the /service directory.
- /etc/init.d/rcS is invoked, which performs the following:
- Kernel drivers are loaded.
- indigo-preinit.sh is sourced if it exists.
- /etc/system_init is run if it exists.
Regardless of platform, /etc/system_init performs the following:
- /etc/find-env is sourced to set environment variables; these determine what gets executed next.
- $config_var is set to persistent configuration directory:
- /local/sfs on GSM73xxSO and Pronto 3240 platforms
- /local on other Pronto platforms
- The following files are searched for in $config_dir, and if not found, those in /etc are used:
- rc.soc: initialization script for BCM driver
- config.bcm: configuration file for BCM driver
- sysenv: may set any of the configuration variables
- $config_var is set to persistent configuration directory:
- Overlay is applied (persistent overlay directory is copied to root file system) if it exists.
- Additional kernel drivers are loaded.
- For out-of-band management, the management interface is configured.
- Symlinks to the services in /etc/sv that are to be started are added to /service.
- indigo-postinit.sh is sourced if it exists.
Because runsvdir invokes only those services in /service, the presence or absence of symlinks within /service allows us to control which services are started.
For each service in /service, runsvdir invokes runsv, which in turn invokes /service/<service_name>/run. Â Because runsvdir uses readdir() to walk the /service directory, services are not started in any explicit order.
Each service is invoked from its respective "run" script. As required by runsv, each service is configured run in the foreground and log to stdout.
For each service that requires logging, the /service/<service_name> directory contains a "log" subdirectory:
- /service/<service_name>/log/config is the log configuration file that controls the number of log files and their size
- /service/<service_name>/log/run is a shell script that takes care of copying the log configuration file from /etc/sv/<service_name>/log and starting up the actual logging process svlogd.
On both Pronto and GSM73xxSO platforms, the following services are started:
- dropbear, for ssh access
- telnetd
- httpd
- ofprotocol
- ofswd
On Pronto platforms only, the fand service is also started to control the fans.
On GSM73xxSO platforms only:
- the inband-network-cfg service is also started to invoke tap0 configuration after ofswd has been started.
- the ofswd service is modified with a "finish" script to restart the in band-network-cfg service if necessary.