anatol / booster

Fast and secure initramfs generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to boot without switching root?

iwinux opened this issue · comments

At the end of bootster's init process, it will always switch root, assuming there is one. Is it possible to stay (spawn busybox shell maybe) without doing the switch?

Booster has a support of emergency shell.

If you have extra_files: busybox in your config it will add busybox binary into the initramfs generated by booster. And then if booster init fails for some reason (e.g. experience some error or was not able to find the root partition in time) then it will run busybox and will allow you to inspect state of the system.

Hope this information helps.

Yeah, I've tried out this feature, but as you said, it's intended for emergency. What I'm curious about: can we skip the switch_root step, exec /sbin/init (e.g.: runit-init or something) that is packaged inside initramfs and get a full running system? Is there any downside of doing this?

Could you please describe the use-case you are trying to solve?

It sounds like you are using initramfs as you primary root filesystem, and booster as primary init. What is the reason for doing it?

Here's what I think:

  • "traditional" boot process require a rootfs to switch to
  • if the vmlinuz + initramfs pair is self-contained, there's no need for rootfs, making the system "diskless" (well, still need a place to put vmlinuz + initramfs)

Use case: easy drop-in live boot on (almost) any machine, be it bare metal, VM or cloud servers. For example:

  • iPXE netboot from HTTP sources - it would be more complicated if I need to provide a rootfs image
  • quick install of customized system on cloud server: put vmlinuz + initramfs into /boot, update grub.cfg, reboot!

If your intent to make a diskless system then using vmlinuz+initramfs loaded over iPXE sounds like reasonable idea [1].

But I am pretty sure you do not even need booster here. booster is just a special init that is created as a middleman and focused on detection/unlocking and mounting the real root filesystem. But if you do not need such middleman then I think you can just get an OS image (say Alpine Linux) and pack it as CPIO. That image will contain simpler /bin/init with shell and other tools needed for you.

[1] You need to think carefully about security here. Ideally if the images are signed with a public key and the host checks the signature with its private key.

Thanks for clarification :)