site  contact  subhomenews

Puppy Linux without an initrd

March 31, 2021 — BarryK

We know about the 'initrd' file, which is an initramfs that runs first at bootup. EasyOS has this, as do the puppies.

A traditional full installation, occupying an entire partition, may not need an initrd, and can be run directly from the kernel boot parameters. For example, if the full installation is in /dev/sda9, then boot parameters would include root=/dev/sda9, or the PARTUID could be specified.

If an initrd is used, the boot parameters would not have root=, instead would have something like initrd=initrd.gz, where initrd.gz is the name of the file, with perhaps a path.

One of the reasons we have a initrd is to setup the layered filesystem, using overlayfs or aufs, then a switch_root is performed onto the layered filesystem.

However, Dima, forum name 'dimkr' on github and the Puppy Forum, and 'iguleder' on the old Puppy Murga Forum, has come up with a way to load the layered filesystem without requiring an initrd.

It is achieved with a special 'init' executable, written in C and statically linked with musl. The boot parameters would be something like this: root=/dev/sda9 init=/init, which tells the kernel that there is a "full installation" at /dev/sda9 and to run /init.

Except that there isn't really a full installation, there are only SFS files. The init executable does what the initrd used to do, sets up the SFS layers and then switches onto the top of the layers.

Dima has created a new project "frugalify" which has this init executable:

https://github.com/dimkr/frugalify

He has also built a demo Puppy, dpupOS:

https://forum.puppylinux.com/viewtopic.php?f=33&t=2495

It must be emphasized that this is not for end users, only for those who want to play with something new and interesting and provide feedback. I tried it a few days ago, and there are too many issues to be considered as suitable for end users -- but they are details, the guts of it are sound.

A note about iguleder -- he goes way back, about 11 years I think, In the Murga Forum, and has been a fantastic contributor, as well as lots of projects on github. he is active developing woof-CE, which is great. I think that he is a young bloke, compared to me anyway.

If you are interested in compiling it yourself, I uploaded some musl chrootable root filesystems a few years ago, see a blog post here:

https://bkhome.org/news/201704/alpine-x8664-chrootable-rootfs.html

Downloadable from here, x86_64, x86, aarch64, armhf tarballs:

http://distro.ibiblio.org/quirky/alpine/

...I think there are instructions inside the tarballs.     

Tags: linux