Update bootstrap.md to match Finit3 changes

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-10-15 13:09:26 +02:00
1 parent a32d3b0c87
commit 29357acf18
1 file changed
+37 -29
+37 -29
View File
@@ -1,42 +1,51 @@
Bootstrap Bootstrap
========= =========
1. Populate `/dev` 1. Prepare emergency shell, if enabled
2. Parse `/etc/finit.conf` and kernel command line 2. Set up initial signal handlers
Add `--debug` to kernel command line to enable Finit debug mode 3. Set up default $PATH early
3. Load all `.so` plugins 4. Mount `/proc` and `/sys`
4. Remount/Pivot `/` to get R+W 5. Check kernel command line for `--debug` to figure out log level
5. Call 1st level hooks, `HOOK_ROOTFS_UP` 6. Load all `.so` plugins
6. Mount `/etc/fstab` and swap, if available 7. Call `fsck` on file systems listed in `/etc/fstab`
7. Cleanup stale files from `/tmp/*` et al 8. Populate `/dev` using either udev or mdev, depending on system type
8. Enable SysV init signals 9. Parse `/etc/finit.conf` and all `/etc/finit.d/*.conf` files
9. Call 2nd level hooks, `HOOK_BASEFS_UP` 10. Start built-in watchdog, if enabled
10. Start all 'S' runlevel tasks and services 11. Set hostname
11. Load kernel params from `/etc/sysctl.d/*.conf`, `/etc/sysctl.conf` 12. Pivot root, or remount `/` read-write, depending on system type
et al. (Supports all locations that SysV init does.) 13. Call 1st level hooks, `HOOK_ROOTFS_UP`
12. Set hostname and bring up loopback interface 14. Mount all file systems listed in `/etc/fstab` and swap, if available
13. Call `network` script, if set in `/etc/finit.conf` 15. Enable SysV init signals
14. Call 3rd level hooks, `HOOK_NETWORK_UP` 16. Call 2nd level hooks, `HOOK_BASEFS_UP`
15. Switch to the configured runlevel from `/etc/finit.conf`, default 2. 17. Cleanup stale files from `/tmp/*` et al, handled by `bootmisc` plugin
18. Load kernel params from `/etc/sysctl.d/*.conf`, `/etc/sysctl.conf`
et al. (Supports all locations that SysV init does.), handled by
`procps` plugin
19. Start all 'S' runlevel tasks and services
20. Bring up loopback interface and all `/etc/network/interfaces`, if
the `.conf` setting `network <SCRIPT>` is set, it is called instead
21. Call 3rd level hooks, `HOOK_NETWORK_UP`
22. Switch to the configured runlevel from `/etc/finit.conf`, default 2.
At every runlevel change all `*.conf` files in `/etc/finit.d/` are At every runlevel change all `*.conf` files in `/etc/finit.d/` are
(re)loaded and new services, tasks, and blocking run commands are (re)loaded and new services, tasks, and blocking run commands are
started. Provided they are allowed in the new runlevel and all of started. Provided they are allowed in the new runlevel and all of
their conditions, if any, are set. their conditions, if any, are set.
16. Call 4th level hooks, `HOOK_SVC_UP` 23. Call 4th level hooks, `HOOK_SVC_UP`
17. If `runparts <DIR>` is set, [run-parts(8)][] is called on `<DIR>` 24. If `runparts <DIR>` is set, [run-parts(8)][] is called on `<DIR>`
18. Call `/etc/rc.local`, if it exists and is an executable shell script 25. Call `/etc/rc.local`, if it exists and is an executable shell script
19. Call 5th level (last) hooks, `HOOK_SYSTEM_UP` 26. Call 5th level (last) hooks, `HOOK_SYSTEM_UP`
20. Start all configured TTYs, or a rescue shell on `/dev/console` 27. Start all configured TTYs, or a fallback shell on `/dev/console`
In (10) and (15) tasks and services defined in `/etc/finit.conf` are In (19) and (22) tasks and services defined in `/etc/finit.conf` and
started. Remember, all `service` and `task` stanzas are started in `/etc/sysctl.d/*.conf` are started. Remember, all `service` and `task`
parallel and `run` in sequence, and in the order listed. Hence, to stanzas are started in parallel and `run` in sequence, and in the order
emulate a SysV `/etc/init.d/rcS` one could write a long file with only listed. Hence, to emulate a SysV `/etc/init.d/rcS` one could write a
`run` statements. long `finit.conf` with only `run` statements.
Notice the five hook points that are called at various point in the Notice the five hook points that are called at various point in the
bootstrap process. This is where plugins can extend the boot in any way bootstrap process. This is where plugins can extend the boot in any way
they please. they please. There are other hook points, e.g. `HOOK_MOUNT_ERROR`, for
more on this see [plugins.md](plugins.md).
For instance, at `HOOK_BASEFS_UP` a plugin could read an XML file from a 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, USB stick, convert/copy its contents to the system's `/etc/` directory,
@@ -44,5 +53,4 @@ 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 system images that are created read-only and all configuration is stored
on external media. on external media.
[run-parts(8)]: http://manpages.debian.org/cgi-bin/man.cgi?query=run-parts [run-parts(8)]: http://manpages.debian.org/cgi-bin/man.cgi?query=run-parts