From c71b35e61a32141c613b0fc2bfa7a8f564841683 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 9 Jan 2023 10:00:43 +0100 Subject: [PATCH] doc: document recommended filesystem layout + automounter Signed-off-by: Joachim Wiberg --- doc/config.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/doc/config.md b/doc/config.md index f9c037e8..9eddfffa 100644 --- a/doc/config.md +++ b/doc/config.md @@ -79,6 +79,58 @@ files. > top-level configuration directive `rcsd /path/to/finit.d`. +### Filesystem Layout + +Finit is most comfortable with a traditional style Linux filesystem +layout, as specified in the [FHS][]: + + /. + |- bin/ + |- dev/ # Mounted automatically if devtmpfs is available + | |- pts/ # Mounted automatically by Finit if it exists + | `- shm/ # Mounted automatically by Finit if it exists + |- etc/ + |- home/ + |- lib/ + |- libexec/ + |- mnt/ + |- proc/ # Mounted automatically by Finit if it exists + |- root/ + |- run/ # Mounted automatically by Finit if it exists + | `- lock/ # Created automatically if Finit mounts /run + |- sbin/ + |- sys/ # Mounted automatically by Finit if it exists + |- tmp/ # Mounted automatically by Finit if it exists + |- usr/ + `- var/ + |- cache/ + |- db/ + |- lib/ + | `- misc/ + |- lock/ + |- log/ + |- run -> ../run + |- spool/ + `- tmp/ + +Finit starts (very early) by mounting `/dev`, `/proc/`, and `/sys`, +unless they (i.e., `/dev`) are already mounted. When all plugins and +other, core Finit functions, have been set up, all relevant filesystems +(`PASS > 0`) are checked and mounted from the selected `fstab`, either +the default `/etc/fstab`, or any custom one selected from the command +line, or at build time. + +Any file system not listed `fstab` are automatically mounted by Finit, +as listed above, provided their respective mount point exists. + +With all filesystems mounted, Finit calls `swapon`. + +At shutdown, and after having stopped all services and other lingering +processes killed, filesystems are unmounted in the reverse order, and +`swapoff` is called. + +[FHS]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html + ### Runlevels - ` S`: bootStrap