mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
2.8 KiB
2.8 KiB
Bootstrap
- Prepare emergency shell, if enabled
- Set up initial signal handlers
- Set up default $PATH early
- Mount
/procand/sys - Check kernel command line for
debugto figure out log level - Load all
.soplugins - Call
fsckon file systems listed in/etc/fstab - Populate
/devusing either udev or mdev, depending on system type - Parse
/etc/finit.conf - Start built-in watchdog, if enabled and
WDT_DEVNODEexists. This means any WDT that requires a kernel module need to be either compiled into the kernel, or insmod'ed in/etc/finit.conf - Load all
/etc/finit.d/*.conffiles and set hostname - Remount
/read-write if/is listed in/etc/fstabwithoutro - Call 1st level hooks,
HOOK_ROOTFS_UP - Mount all file systems listed in
/etc/fstaband swap, if available. On mount errorHOOK_MOUNT_ERRORis called. After mount, regardless of error,HOOK_MOUNT_POSTis called - Enable SysV init signals
- Call 2nd level hooks,
HOOK_BASEFS_UP - Cleanup stale files from
/tmp/*et al, handled bybootmiscplugin - Load kernel params from
/etc/sysctl.d/*.conf,/etc/sysctl.confet al. (Supports all locations that SysV init does.), handled byprocpsplugin - Start all 'S' runlevel tasks and services
- Bring up loopback interface and all
/etc/network/interfaces, if the.confsettingnetwork <SCRIPT>is set, it is called instead - Call 3rd level hooks,
HOOK_NETWORK_UP - If
runparts <DIR>is set, run-parts(8) is called on<DIR> - Switch to the configured runlevel from
/etc/finit.conf, default 2. At every runlevel change all*.conffiles in/etc/finit.d/are (re)loaded and new services, tasks, and blocking run commands are started. Provided they are allowed in the new runlevel and all of their conditions, if any, are set. - Call 4th level hooks,
HOOK_SVC_UP - Call
/etc/rc.local, if it exists and is an executable shell script - Call 5th level (last) hooks,
HOOK_SYSTEM_UP - Start all configured TTYs
In (19) and (23) tasks and services defined in /etc/finit.conf and
/etc/finit.d/*.conf are started.
Notice the seven hook points that are called at various point in the bootstrap process. This is where plugins can extend the boot in any way they please. There are other hook points available, for more on this, see plugins.md.
For instance, at HOOK_BASEFS_UP a plugin could read an XML file from a
USB stick, convert/copy its contents to the system's /etc/ directory,
well before all 'S' runlevel tasks are started. This could be used with
system images that are created read-only and all configuration is stored
on external media.