0

I wanna make an init, and so I'm gonna need to get a very basic system on a VM probably. What is the best way to go about doing that? I also saw that it might be possible doing this with a docker container?

sef sf
  • 72

1 Answers1

1

Set up a test VM/container with a working normal init, then work to replace that init with your custom one.

Basically, in a VM, you would place your custom init into e.g. /sbin/custominit, and then you could boot the VM with a kernel boot parameter init=/sbin/custominit to see how it works. By removing the boot parameter you could then compare the results with a standard init. Once you get it working acceptably like that, you could make a custom initramfs that'll use your custom init instead of the standard one (if applicable).

Eventually you could package your custom init so that your custom package will satisfy all the same package manager dependencies as the distribution's normal init package, and then install your custom one as a package, and remove the normal init package from the system.

telcoM
  • 96,466
  • yeah I was aware of this, but is there a distro that's better to use than another for this? does it even matter? – sef sf Dec 23 '22 at 08:26
  • You might want to choose a distro whose init is similar to the one you wish to develop (if possible), to minimize the work needed to change configuration files/start-up scripts to suit your new init. – telcoM Dec 24 '22 at 06:02