Call for testers: Dracut

We’ve been working for some time to make dracut convenient to use with Manjaro system and now can share our work for testing.
Package is in unstable. dracut-hook is based on this AUR package and was adopted to follow Manjaro’s naming scheme.

How to use:

pamac install dracut dracut-hook
mhwd-kernel -i <some linux kernel you don't have installed>

dracut should generate the initramfs along with initramfs to /boot/.

Share your thoughts and results! :slight_smile:

8 Likes

Hi!

A bit pre-history, please: what are pros and cons to switch to dracut from mkinicpio?
Why that work was done? What caveats could the dracut bring?

Thanks!

2 Likes

Seems to have worked fine.

The hook did things once it was installed.

But I wanted to further configure some things and then rerun the creations…

Some configs for the interested

/etc/dracut.conf.d/earlykms.conf

force_drivers+=" sd_mod ahci amdgpu ext4 "

/etc/dracut.conf.d/myflags.conf

compress="lzop"
omit_dracutmodules+=" brltty plymouth btrfs "

But I realized that the hook uses some specialized options for creating the initramfs and different ones used for the fallback initramfs … so instead of just running dracut --regenerate-all I did:

sudo dracut --force --hostonly --no-hostonly-cmdline --early-microcode /usr/lib/modules/6.3.5-RAVEN/initrd 6.3.5-RAVEN
sudo install -Dm644 /usr/lib/modules/6.3.5-RAVEN/initrd "/boot/initramfs-6.3.5-RAVEN.img"
sudo dracut --force --no-hostonly "/boot/initramfs-6.3.5-RAVEN-fallback.img" "6.3.5-RAVEN"

(of course the KERNEL is system-dependent)

And no complaints upon reboot.

1 Like

With mkinitcpio you always have to maintain your config and specify which modules the initramfs image may need. Dracut on the other hand detects those automatically and applies them. So no need to maintain any configs in that regard. For example you add something new to your system like a filesystem and it ships with a hook, dracut may detect that and adds it automatically.

10 Likes

HI,

Dracut version 056 is in the repo, but this version was released in 2022-02-18 and is now more than 1 year old.
In my experience it has some bug for me. It doesn’t respect my custom udev-rules.script
For example: $ cat /etc/udev/rules.d/90-disable-mouse.rules

    1. line
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c539", ATTR{../power/wakeup}="disabled"

OR

    1. line
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c091", RUN+="/bin/sh -c 'echo disabled > /sys$env{DEVPATH}/../power/wakeup'"

Both lines did not work on Dracut 056.

I built current version 059 of Dracut from AUR. As a result, the 2. line works well, but the 1. line not.

mkinitcpio initramfs works fine with both lines.

Dracut 059 is okay for me after test

If you use grub-btrfs to boot a read-only snapshot with OverlayFS, Dracut wouldn’t be able to do that. However, you can manually copy two Dracut scripts:

  • Create a a shell script:
/usr/lib/dracut/modules.d/91btrfs-snapshot-overlay/module-setup.sh

Copy code from module-setup.sh

  • Create a shell script:
/usr/lib/dracut/modules.d/91btrfs-snapshot-overlay/snapshot-overlay.sh

Copy code from snapshot-overlay.sh, this is similar to part of grub-btrfs.

Do not forget to make both scripts executable, rebuild Dracut initramfs and then create a new root snapshot with the ability of boot overlayfs .

Or Manjaro creates a new package manjaro-dracut-support

If you use Systemd-boot or EFISTUB, you do not need them.

@LordTermor maybe check how Debian provides dracut. We can update to 059 and add their patches as needed. Else chedk Fedora too.

OK …
I put up a script to do this for me.
Everythings automated … but theres easily configurable variables near the top for settings flags for regular and fallback initramfs.

2 Likes

It worked for me on a very simple Manjaro Xfce VM. I wasn’t sure what option to choose upon installation, so I just chose Default (none). I set a .conf file to compress via .zstd , but upon execution it did not note a compression method, though I believe it did before I created the .conf file,( gzip maybe?). Both files were significantly larger than my .zstd compressed mkinitcpio files.

Please test dracut 059-0.1 in unstable.

1 Like

Seems to work … hooks engaged …

Though I have noticed that dracut seems to hang for a bit on creating the fallback images.

(this was occuring before the package upgrade)

And oh no I left mkinitcpio installed so its hooks ran after the dracut ones :sweat_smile:

EDIT…

@Yochanan @LordTermor

Well, after a reboot I faced no loading.
Resorted to usb>chroot>mkinitcpio

update again.

All clear. seems to work fine if you clean out mkinit images and dont select them …
and disregard the man reference to lzo which is unrecognized … lzop works if installed.

1 Like

I got the same amdgpu error at boot sometimes when using Kernel 6.4:

$ journalctl --no-pager -p 3 -b -1 --output=cat

amdgpu 0000:0b:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000000D SMN_C2PMSG_82:0x00000000
amdgpu 0000:0b:00.0: amdgpu: Failed to retrieve enabled ppfeatures!
amdgpu 0000:0b:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000000D SMN_C2PMSG_82:0x00000000
amdgpu 0000:0b:00.0: amdgpu: Failed to retrieve enabled ppfeatures!
amdgpu 0000:0b:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000000D SMN_C2PMSG_82:0x00000000

This issue is caused by the kernel module amdgpu being in wrong(random) time-order on startup.

The solution:

I added add_drivers+=" amdgpu " in the dracut config /etc/dracut.conf, then rebuild initramfs to fix this issue and other issue of my custom vconsole font.
I noticed a bit that boot with amdgpu starts faster than before.


Edit://

This issue appears randomly.

Until I got to the last part I was a bit confused being on amdgpu and using dracut … then ah, yes, added drivers…
Except I dont use the package-owned file (and i wanted early kms):

/etc/dracut.conf.d/myflags.conf

compress="zstd"
omit_dracutmodules+=" brltty plymouth btrfs dmraid mdraid "
ro_mnt="yes"
kernel_cmdline="rd.skipfsck rootfstype=ext4 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0"

/etc/dracut.conf.d/earlykms.conf

force_drivers+=" sd_mod ahci amdgpu ext4 "
1 Like

Oh, I think force_drivers is better choice for earlier loading amdgpu at boot. Thanks!

I know now, this issue is not caused by Dracut and Mkinitcpio, but by Kernel 6.4.x and lower power consumption, when using multiple monitors and AMD RX5000 series.

I applied a “revert” amdgpu-patch for Kernel 6.4.11 to fix this issue.

Sorry for the confusion.

1 Like

Hi,

I did a cli install 512 MB /boot/efi and the rest btrfs with subvols. installed the two packages dracut and dracut-hook and removed mkinitcpio. I used the unstable repo because of the updates. When updating the system dracut could’t find the new kernel.

error: file ‘/@/boot/vmlinuz-6.7.0.2-MANJARO’ not found
error: you need to load the kernel first.

Did the same thing on endeavouros and the system booted without any problems even with zfs pool.

3 posts were split to a new topic: How do I replace mkinitcpio with dracut on a armv8 device?