anatol / booster

Fast and secure initramfs generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling the init parameter

roland-5 opened this issue · comments

Hi,

I tried experimenting with booting system with init=/usr/lib/systemd/systemd parameter. I uninstalled systemd-sysvcompat to be sure, and I use systemd-boot. With mkinitcpio it's working, but with booster don't. On reddit user rickycoolkid point me to this information:

Booster has init binary hardcoded to /sbin/init
https://github.com/anatol/booster/blob/0.7/init/main.go#L26

I was doing it for teaching myself only, and it is nothing that I very need, but I'm curious why it's hardcoded? If someone wanted to change init parameter, he need to change booster code?

Indeed it is currently hardcoded. It is not that difficult to add support for init parameter. But before doing it I would like to understand the usecase better. Why do you need to use non-sysv init binary?

I did it out of curiosity and education (to teach myself). When installing the system, I saw a message that this parameter can be added and I was curious if in practice it would significantly change the management of the system.

commented

Why do you need to use non-sysv init binary?

init=/bin/bash is used in some case. https://wiki.archlinux.org/title/Reset_lost_root_password#Using_bash_as_init

Pushed this feature to wip branch. Please try and let me know if it works for you as expected.

@anatol I confirm, that commit in WIP branch works ideally.
cat /boot/loader/entries/arch.conf

title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /booster-linux.img
options root=UUID=a52a687e-bb55-49b9-96ba-638a28b3d86d init=/usr/lib/systemd/systemd rw rootflags=relatime,compress-force=zstd:2,subvol=arch

Boots without problem. Thank you so much for you hard work!