[arch-general] Can we talk about the systemd mkinitcpio hook for a minute?

Chris Bell cwbell at narmos.org
Fri Sep 4 14:37:33 UTC 2015

Hello all,

First off, apologies if this has been/is being discussed elsewhere, but 
this has been on my mind for quite some time.

The state of the systemd mkinitcpio hook has been bothering me recently. 
It seems that there is some confusion/ambiguity about what capabilities, 
precisely, said hook provides; particularly with regards to replacing 
the 'base' hook at some point. I think it's effectively ready now; I've 
been using the systemd hook without base and udev for some time now. The 
only sticking point seems to be with the rescue and emergency shells.

Of the 19 open systemd bugs [0], four of them [1-4] deal with systemd 
not providing an emergency/rescue shell and/or busybox/maintenance tools 
to the initrd image. Based on my understanding of the status quo, the 
systemd init hook is intended to simplify and streamline the boot 
process and the initrd image for systemd-based systems. The hook 
currently does this. It does not provide any functional rescue 
capabilities (you can get to an emergency shell, but it doesn't work), 
and I don't think it should. The use case for initrd-based rescue shells 
is very small and specific; many of these use cases can make do with a 
live image or something similar.

Basically, my view is this: the systemd hook should only provide boot 
functionality, and not contain rescue/emergency targets/shells by 
default. The problem with providing such functionality is that the 
dependencies and binary include requirements quickly spiral out of 
control when providing a full shell within the initrd (sulogin, busybox, 
any rescue tools, etc). Having so many dependencies goes against the 
simplicity that the systemd hook is trying to accomplish.

If anything, I propose a new hook, sd-rescue, which provides 
rescue.{target,service}, emergency.{target,service}, busybox, and 
minimal binaries useful for rescuing a system. This can be used in 
situations where live-image booting is not an option, or where the 
sysadmin prefers the option of initrd emergency/rescue functions. Also, 
we should maybe stop including emergency.target with the systemd hook, 
since it doesn't seem to work in most cases.

-- Chris

[0] https://bugs.archlinux.org/?project=1&cat%5B%5D=31&string=systemd

More information about the arch-general mailing list