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

Alain Kalker a.c.kalker at gmail.com
Sun Sep 20 15:03:52 UTC 2015


On 09/04/2015 04:37 PM, Chris Bell wrote:
> 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.

Please have a look at my mkinitcpio-systemd-ng-git package on the 
AUR[1], sources on GitHub[2].
It contains a collection of fixes I've made to the systemd hook over 
time, mostly to make it more maintainable, but it also adds better 
support for the emergency and rescue shells. I've been using this hook 
(without the 'base' hook) on all my boxes for a few months now, without 
any major issues.

I've created a topic on the BBS for discussing my hook[3], which may be 
more convenient for people who are not subscribed to this mailing list.
Any questions, suggestions and pull requests are very welcome.

-Alain

> 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.

While I oridinally intended my hook to be a possible update candidate to 
the official systemd hook (making sure the changes are minimal), my 
success at minimizing and organizing things in the script should make it 
very easy to split it into a main systemd hook and some other hooks 
adding functionality such as emergency/rescue shell support (I've 
already split off an optional package providing configuration of 
keyboard drivers for use with the emergency/rescue shell during early boot).

[1]: https://aur.archlinux.org/packages/mkinitcpio-systemd-ng-git/
[2]: https://github.com/ackalker/mkinitcpio-systemd-ng
[3]: https://bbs.archlinux.org/viewtopic.php?id=196755


More information about the arch-general mailing list