How do I replace mkinitcpio with dracut on a armv8 device?

Can anyone give me clear instructions on how to replace mkinitcpio with dracut on a armv8 device?
I have a Raspberry Pi 5 with a development version of Manjaro Linux installed (manjaro-rpi5 kernel with KDE desktop).

I have no problem using CLI in the terminal and I have a build environment up and running should I need to build packages locally.

  1. Install dracut and dracut-hook

  2. Create an alias in bash or zsh

$ alias dracut-update="sudo echo rebuild | sudo /usr/share/libalpm/scripts/dracut-install"
  1. Run dracut-update to rebuild initramfs manually.

  2. If it works, remove mkinitcpio

1 Like

Thank you Zesko for your reply!

Unfortunately, there is no dracut-hook package in the arm-stable, arm-testing and arm-unstable repos.

I looked at the PKGBUILD for dracut-hook in the manjaro x86_64 repos, which would be OK for building on aarch64, was it not for the fact that the files 90-dracut-install.hook dracut-install and dracut-remove all refer to vmlinuz which is what you do not have on an aarch64 system.

Before, I trash my Raspberry Pi 5 (which functions amazing well, except for the kernel updates - mkinitcpio also throws a lot of vmlinuz errors), has anyone written the files 60-dracut-remove.hook 90-dracut-install.hook dracut-install and dracut-remove, as installed by the dracut-hook package, to work with:

  • armv8 systems in general, or
  • Raspberry Pi 5 specifically (Broadcom 2712 processor)?

The new package got downgraded. Do a -Syy then install mkinitcpio.

Did you read the arch dracut wiki? Particularly this section creating hooks.

https://wiki.archlinux.org/title/Dracut#Generate_a_new_initramfs_on_kernel_upgrade

Synchronising the sources and installing mkinitcpio in konsole gives the following output:>

$ sudo pacman -Syy
[sudo] Passwort für xyz:
:: Paketdatenbanken werden synchronisiert …
core 265,7 KiB 1510 KiB/s 00:00 [####################################] 100%
extra 9,2 MiB 8,71 MiB/s 00:01 [####################################] 100%
community 29,0 B 278 B/s 00:00 [####################################] 100%
$ sudo pacman -S mkinitcpio
Warnung: Downgrade des Paketes mkinitcpio (37.2-1.3 => 37.2-1)
Abhängigkeiten werden aufgelöst …
Nach in Konflikt stehenden Paketen wird gesucht …

Pakete (1) mkinitcpio-37.2-1

Gesamtgröße des Downloads: 0,05 MiB
Gesamtgröße der installierten Pakete: 0,15 MiB
Größendifferenz der Aktualisierung: 0,00 MiB

:: Installation fortsetzen? [J/n]
:: Pakete werden empfangen …
mkinitcpio-37.2-1-any 52,4 KiB 569 KiB/s 00:00 [####################################] 100%
(1/1) Schlüssel im Schlüsselbund werden geprüft [####################################] 100%
(1/1) Paket-Integrität wird überprüft [####################################] 100%
(1/1) Paket-Dateien werden geladen [####################################] 100%
(1/1) Auf Dateikonflikte wird geprüft [####################################] 100%
(1/1) Verfügbarer Festplattenspeicher wird ermittelt [####################################] 100%
:: Paketänderungen werden verarbeitet …
(1/1) Herunterstufung läuft mkinitcpio [####################################] 100%
Warnung: /etc/mkinitcpio.conf wurde als /etc/mkinitcpio.conf.pacnew installiert
:: Post-transaction-Hooks werden gestartet …
(1/5) Reloading system manager configuration…
(2/5) Creating temporary files…
(3/5) Arming ConditionNeedsUpdate…
(4/5) Updating linux-rpi5 initcpios…
==> Building image from preset: /etc/mkinitcpio.d/linux-rpi5.preset: ‘default’
==> Using configuration file: ‘/etc/mkinitcpio.conf’
→ -k 6.6.11-1-MANJARO-RPI5 -c /etc/mkinitcpio.conf -g /boot/initramfs_2712
==> Starting build: ‘6.6.11-1-MANJARO-RPI5’
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [autodetect]
→ Running build hook: [modconf]
→ Running build hook: [kms]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [consolefont]
→ Running build hook: [block]
→ Running build hook: [filesystems]
→ Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: ‘/boot/initramfs_2712’
==> WARNING: errors were encountered during the build. The image may not be complete.
Fehler: Befehl konnte nicht korrekt ausgeführt werden
(5/5) Updating linux initcpios…
==> Building image from preset: /etc/mkinitcpio.d/linux-rpi5.preset: ‘default’
==> Using configuration file: ‘/etc/mkinitcpio.conf’
→ -k 6.6.11-1-MANJARO-RPI5 -c /etc/mkinitcpio.conf -g /boot/initramfs_2712
==> Starting build: ‘6.6.11-1-MANJARO-RPI5’
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [autodetect]
→ Running build hook: [modconf]
→ Running build hook: [kms]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [consolefont]
→ Running build hook: [block]
→ Running build hook: [filesystems]
→ Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: ‘/boot/initramfs_2712’
==> WARNING: errors were encountered during the build. The image may not be complete.
Fehler: Befehl konnte nicht korrekt ausgeführt werden
$

My questions are:

  • What is causing the image to be built twice?

  • Why am I getting the message “WARNING: errors were encountered during the build. The image may not be complete.”

  • Why are images being built when mkinitcpio is reinstalled or updated? Surely this should only occur when the kernel is reinstalled or updated? Or this is deliberately started from the command line when repairing the boot directory.

Not sure but some one mentioned it on the arch-arm forums the other day. It is happening here also.

This has been going on now for 2 months. It does not seem to be a priority getting fixed. This thread has grown to 5 pages now in the arch-arm forums.

https://archlinuxarm.org/forum/viewtopic.php?f=15&t=16672

I agree especially with the pi devices. RPi just started creating initramfs images. The pi kernels do not need it to boot. All of the needed modules are built into the kernel. But we need the image for the spinning circle to work at first boot with the pi devices. I am not familiar with the other arm-devices that do require an initramfs regardless. I am sure arch has their reasons to create the image post install. Their mkintcpio package covers a broad range of devices.

I noticed your kernel version and looks like you may be using linux-rpi5-mainline kernel if you are on the unstable branch. I have changed linux-rpi5 kernel to the 6.6.y tree and it’s current kernel is now 6.6.12-1-MANJARO-RPI5. I am moving linux-rpi5-mainline kernel to the 6.7.y tree when RPi upgrades their tree.

Many thanks for your prompt responses. My pacman.conf has the following entries, should this be changed?

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

I have since performed a full system upgrade using octopi. The currently installed kernel is:>

$ pacman -Q linux-rpi5 linux-rpi5-headers
linux-rpi5 6.6.12-1
linux-rpi5-headers 6.6.12-1
$ uname -a
Linux microc 6.6.12-1-MANJARO-RPI5 #1 SMP PREEMPT Wed Jan 17 15:07:29 UTC 2024 aarch64 GNU/Linux
$

Is there a reason why octopi is not included in the aarch64 repos? I have locally built and installed lxqt-build-tools qtermwidget alpm-octopi-utils octopi and octopi-notifier-frameworks. Octopi works just fine.

Thanks for the tip! I have now read this thread through twice - I understand that no one has identified the root cause. The proposed fixes have side-effects and do not tackle the root cause.

The fact that mkinitcpio is unreliably maintained prompted me to ask about dracut in the first place.