Mkinitcpio.conf.pacnew udev vs systemd style

Last year I found the file mkinitcpio.conf.pacnew.

I need luks, hybernate, encrypted separate partitions root, home and swap. My current mkinitcpio.conf contains the following:

MODULES=()
BINARIES=()
FILES=(/crypto_keyfile.bin)
HOOKS=(base udev autodetect microcode kms modconf block keyboard keymap consolefont plymouth encrypt openswap resume filesystems)

It works ok, boot every update I get messages that the system might be unbootable, etc

The pacnew suggest me the systemd style:

HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)

If I apply these changes, the system refuses to boot and is stuck on opening luks partitions. I change the only line with hooks, and run mkinitcpio -P and update-grub then reboot.

The questions are:

Should I switch to the systemd style ?

If yes, how to convert my config into the systemd style?

fstab

UUID=0410-386D                            /boot/efi      vfat    defaults,umask=0077 0 2
/dev/mapper/luks-ccbcfee1-7eb1-486d-867d-2c473ed99d3d /              btrfs   subvol=/@,defaults,compress=zstd:1 0 0
/dev/mapper/luks-ccbcfee1-7eb1-486d-867d-2c473ed99d3d /var/cache     btrfs   subvol=/@cache,defaults,compress=zstd:1 0 0
/dev/mapper/luks-ccbcfee1-7eb1-486d-867d-2c473ed99d3d /var/log       btrfs   subvol=/@log,defaults,compress=zstd:1 0 0
/dev/mapper/luks-ffd865c9-dbb0-4673-b8fd-1380e4782109 /home          btrfs   defaults,compress=zstd:1 0 0
/dev/mapper/luks-ae3aea6d-819f-4c8e-91f3-10e99685a6cd swap           swap    defaults   0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

grub:

GRUB_CMDLINE_LINUX_DEFAULT=‘cryptdevice=UUID=ccbcfee1-7eb1-486d-867d-2c473ed99d3d:luks-ccbcfee1-7eb1-486d-867d-2c473ed99d3d root=/dev/mapper/luks-ccbcfee1-7eb1-486d-867d-2c473ed99d3d resume=/dev/mapper/luks-ae3aea6d-819f-4c8e-91f3-10e99685a6cd udev.log_priority=3’

If you really want plymouth as indicated by your previous hooks, you will need the plymouth hook. Also add the splash argument to the kernel cmdline in /etc/default/grub

I will also suggest you keep the microcode hook as well.

I would also check the plymouth theme used, I like the spinfinity theme

plymouth-set-default-theme spinfinity

Needless to say that all of this requires rebuilding init and grub configuration.

Important!
in addition to what @linux-aarhus said

If you want to use systemd based HOOKS in /etc/mkinitcpio.conf
and you have an encrypted system (as you do)
you also need to adapt the file /etc/default/grub, specifically this line:

The syntax is quite different to what it is right now.
It will not work as it is right now.
Just changing /etc/mkinitcpio.conf isn’t enough.

There are posts here with examples - and there is the Arch wiki as well.

Have copies of the original files or comment out the current working option, so that you can easily go back to what was working
when you try to adapt to the new syntax.

It will keep working as it is for quite some time though.
It is not urgent to get this done right now.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.