im building a linux distro as my college project. i started with LFS and now i built my own shell. and i thought of replacing systemd now. i need to write a minimal init system which does mounting, service mgmt, resource mgmt, runlevels, graceful shutdown nd reboot. please share your suggestions on how to complete this. (i have only a week of time)
Huh? A complete distro?
>>106565016yeah
>>106564888i have no idea
>>106565116shittt.
>>106564888Seeing as you only have a week, I suggest you use AI.
>>106564888Just use existing rootfs like alpine, then do whatever you want. After you do it then make it bootable. For initrd don't bother to do it from scratch, use dinit.
>>106564888only a week sounds tough. but if you managed to do a shell already, an init service manager doesn't seem too far off.
>>106564888GNU Shepherd is relatively small I've heard. And it's written in Scheme, so it's very readable. Just read the source code and take notes.
>>106564888I would just build upon a chroot from skarnet (lh-build) which is a minimal s6 based system (init, networking etc).Your distro will be more unique than classic Sysv like system and it will actually make sense to build upon that, because s6 is modern efficient init while not being bloated cancerware like systemd.If you want declarative configuration you can look at Obarun and use their 66 which is a declarative frontend for s6 init which kinda allows you to write services like for systemd if you want such thing.You can then make your own package manager or maybe try to adopt pkgsrc from netbsd or use a linux like port utils like in CRUX. For some reason I can't find the source for pkgutils, but I've found some fork that is actually quite interesting: https://github.com/Vifon/pkgutils. You can try that or fork it. It looks quite simple so you can check it out.I've used CRUX for years and it's solid simple system. The pkgutils are very easy to use and you have basically full control of how your packages are going to be installed. You don't need to adhere to some standards imposed by the package manager from major distros. If you wanted to use LFS then you can just write the ports when you are at it. You will not only have a nice ports system, but also a reproducible environment which is fast to iterate on. Alternatively you might try nix/guix for the package management as an exotic alternative but it has steep learning curve. There are also pet packages from puppylinux which would be another viable option, you would be able to simply use their packages.