Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
NAME
init — system initializationSYNOPSIS
init | [-qsv] [--prefix=prefix] [--static-prefix=static-prefix] [--target=default-daemon] [--] [chain-init ...] |
DESCRIPTION
init is the first program run after system startup and is responsible for initializing the operating system.- -p, --prefix=prefix
- Boot the system inside the prefix rather than the root directory. This option is not officially supported and does not chroot(2) and is not communicated to the descendant processes, which by default would continue to use many files such as the passwd(5) of the root directory. Use chroot(8) to as the supported way to spawn a recursive init.
- -P, --static-prefix=static-prefix
- Boot the operating system using the static data (programs, libraries, and default configuration) from the static-prefix rather than the --prefix. This option is supported and sets the PATH environment variable and others accordingly. It is designed for sysmerge(8) to run a new system with a new ABI using the local configuration files during the operating system upgrade.
- -q, --quiet
- Write status updates to the terminal only about failed daemons. This behavior is the default.
- -s, --silent
- Never write status updates about daemons to the terminal.
- -t, --target=default-daemon
- Boot default-daemon as the target. The default daemon configuration is changed to only require the default-daemon dependency with the exit-only flag.
- -v, --verbose
- Write all status updates about daemons starting and stopping to the terminal
Cleanup of /tmp and /var/run
init deletes everything inside of /tmp if it exists, otherwise it is created with mode 1777.Partition Creation
init will scan every block device for valid partition tables and create the corresponding partition devices in /dev.Chain Initialization
If the target is chain or chain-sysmerge, then the real operating system is chain initialized.Mountpoints
init mounts all the filesystems according to fstab(5). The filesystems are checked for consistency if necessary and mounted read-only if the check fails.Logging
Logging to /var/log begins once the filesystems are mounted and init writes the log entries from early boot to its /var/log/init.log.Random Seed
init will write 256 bytes of randomness to /boot/random.seed, which serves as the initial entropy for the kernel(7) on the next boot. The file is also written on system shutdown where the system has the most entropy.Configuration
Once the init of the real root filesystem runs, it will process basic configuration files and apply them:- /etc/hostname
- set hostname (see hostname(5))
- /etc/kblayout
- set keyboard layout (see kblayout(5))
- /etc/videomode
- set graphics resolution (see videomode(5))
Merge
If the target is merge, then a delayed system upgrade is completed by invoking sysmerge(8) at /sysmerge/sbin/sysmerge with the --booting option.Daemons
The default daemon(7) is started per its /etc/init/default init(5) configuration file, which constitutes the operating system, and once it exits then init exits with the same error code and the kernel shuts down the machine. The default daemon is meant to be a virtual daemon depending on a single top level daemon (the target), which provide the desired operating system functionality (e.g. booting to a single user shell or a multi user login screen).ENVIRONMENT
init sets the following environment variables.- HOME
- root's home directory
- LOGNAME
- root
- PATH
- /bin:/sbin
- SHELL
- root's shell
- TERM
- sortix
- USER
- root
FILES
- /boot/random.seed
- Initial kernel entropy
- /etc/init/
- Daemon configuration for the local system (first in search path) (see init(5))
- /etc/init/default
- Configuration for the default daemon (see init(5))
- /etc/fstab
- Filesystem table (see fstab(5))
- /etc/hostname
- Hostname (see hostname(5))
- /etc/kblayout
- Keyboard layout (see kblayout(5))
- /etc/videomode
- Graphics resolution (see videomode(5))
- /share/init/
- Default daemon configuration provided by the operating system (second in search path) (see init(5))
- /var/log/
- Daemon log files (see init(5))
- /var/log/init.log
- init's own log.
ASYNCHRONOUS EVENTS
- SIGTERM
- Request system poweroff, normally sent by poweroff(8).
- SIGINT
- Request system reboot, normally sent by reboot(8).
- SIGQUIT
- Request system halt, normally sent by halt(8).
- SIGHUP
- Request system reinitialization.