mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
225b2594b77ca97ca1438450fb5d62236c9b56da
There was no way to run the tmpfiles.d files of a root file system
that is not the running one, for example an image that is being put
together.
systemd-tmpfiles has --root=DIR for that. Add the same:
tmpfiles --create --root=/mnt/target
The tmpfiles.d files, users, and groups are those below DIR, and so is
every path, also what an absolute link there points to. A file on the
command line is opened before the root is changed, as systemd does.
It is done with chroot(2), so tmpfiles must be run as root. The new
root most likely has no /proc, which is needed to set the mode, ACL,
or attributes of a path opened with O_PATH. The work directory is
therefore left in the /proc/self/fd of the old root. Users and groups
are read from /etc/passwd and /etc/group, NSS would be that of the old
root.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Finit is a fast, simple alternative to SysV init and systemd, designed for small and embedded Linux systems. It can also run on desktop and server systems, like finix.
Reverse engineered from the EeePC fastinit
"gaps filled with frog DNA …"
— Claudio Matsuoka
For detailed information, explore our extensive documentation
📚 http://finit-project.github.io
For working examples, see the 🚀 contrib/ section or these tutorials:
- 🛠️ Buildroot embedded Linux,
- 📦 Debian GNU/Linux,
- ⛰️ Alpine Linux, and
- 🌌 Void Linux
Note
Finit can run on various Linux distributions, but the bundled install scripts are examples only. They have been tested on amd64 (x86_64) systems with standard configurations.
For embedded systems, see these Buildroot-based examples: myLinux, Infix, or br2-finit-demo.
Languages
C
82.5%
Shell
14%
Makefile
2%
M4
1.5%

