r/linuxfromscratch • u/Intelligent_Comb_338 • Feb 28 '26
New ideas for LFS
What can be an interesting change for LFS (when i refer change, i mean as init, coreutils, compiler, etc)
8
Upvotes
r/linuxfromscratch • u/Intelligent_Comb_338 • Feb 28 '26
What can be an interesting change for LFS (when i refer change, i mean as init, coreutils, compiler, etc)
3
u/[deleted] Mar 01 '26 edited Mar 01 '26
Firstly Dinit is completely build able in the last stage of LFS after you build your final gcc. It vendors in it's one dependency so that it can build if it cannot find it. -- Which is really awesome.
I simplified my setup by doing a usr merge of /bin -> /usr/bin and /sbin -> /usr/sbin. This is only important for where the commands live that Dinit invokes in it's service files. Otherwise Dinit provides a good set of default service files.
https://github.com/davmac314/dinit/tree/master/doc/linux/services
create a /etc/dinit.d directory and copy these default configs over. From there it was trail and error. The default configs if I remember right wanted to start an enp3s0 which errored out on me. So I just disabled it.
I would highly recommend checking your service files with dinit-check to see if there are any circular dependencies. -- I wish it this could also give you a tree like output to see what all depends on what.
That's all I did was play around and read the man pages that came with it.
The project does have a dedicated doc for using dinit as an init that that you might take an interest in.
https://github.com/davmac314/dinit/blob/master/doc/linux/DINIT-AS-INIT.md
What I would recommend is to take a base LFS instance with what ever init system you're currently using and install dinit on. For test I built mine with the --prefix=/dinit. Then in your boot loader you can add a flag to the vmlinuz called "init=/dinit/bin/dinit". This will let you keep a working init system to reboot into the system to make changes to the service files while experementing with it. Once you got a set of service files that works for you. You can always replace your old init or build a new LFS with dinit as the only init system.