Package Details: dracut-hook-uefi 0.7.0-1

Git Clone URL: https://aur.archlinux.org/dracut-hook-uefi.git (read-only, click to copy)
Package Base: dracut-hook-uefi
Description: Install/remove hooks for dracut unified kernel images for systemd-boot
Upstream URL: https://dracut.wiki.kernel.org/index.php/Main_Page
Licenses: BSD
Conflicts: dracut-hook
Submitter: samcday
Maintainer: lunaryorn (whynothugo)
Last Packager: lunaryorn
Votes: 8
Popularity: 0.64
First Submitted: 2020-10-14 16:16
Last Updated: 2021-08-27 06:28

Latest Comments

deimosian commented on 2021-10-20 23:14

Incompatible with https://archlinux.org/packages/community/any/kernel-modules-hook/

:: Running post-transaction hooks...
(1/4) Triggering wallpaper regeneration...
(2/4) Arming ConditionNeedsUpdate...
(3/4) Updating module dependencies...
(4/4) Generating unified EFI kernel images...
/usr/share/libalpm/scripts/dracut-install: line 28: /usr/lib/modules/5.10.69-1-lts/pkgbase
/usr/lib/modules/5.10.72-1-lts/pkgbase
/usr/lib/modules/5.10.73-1-lts/pkgbase
/usr/lib/modules/5.10.75-1-lts/pkgbase: No such file or directory
error: command failed to execute correctly

lunaryorn commented on 2021-08-17 11:41

I'm sorry for this issue. I guess there's some issue with bash's loops and IFS etc. Shouldn't be too hard to fix I presume.

That said I don't have time to fix it myself, less so as I'm not affected by it myself. I'd appreciate a pull request at https://github.com/lunaryorn/pkgbuilds

whynothugo commented on 2021-08-17 11:05

This is failing to build images for me, but I can't make much sense of the error I'm getting:

/usr/share/libalpm/scripts/dracut-install: line 28: /usr/lib/modules/5.13.10-arch1-1/pkgbase
/usr/lib/modules/5.13.9-arch1-1/pkgbase: No such file or directory
error: command failed to execute correctly

I added set -x to this script to get better output:

(5/6) Generating unified EFI kernel images...
+ kernels=()
+ dracut_update=0
+ read -r line
+ [[ usr/lib/modules/5.13.10-arch1-1/pkgbase != \u\s\r\/\l\i\b\/\m\o\d\u\l\e\s\/+([^/])\/\p\k\g\b\a\s\e ]]
+ read -r pkgbase
+ kernels+=("${pkgbase}")
+ read -r line
+ (( dracut_update ))
+ for kernel in "${kernels[@]}"
++ grep -lE '^linux$' /usr/lib/modules/5.13.10-arch1-1/pkgbase /usr/lib/modules/5.13.9-arch1-1/pkgbase
+ path='/usr/lib/modules/5.13.10-arch1-1/pkgbase
/usr/lib/modules/5.13.9-arch1-1/pkgbase'
++ basename '/usr/lib/modules/5.13.10-arch1-1/pkgbase
/usr/lib/modules/5.13.9-arch1-1'
+ version=5.13.9-arch1-1
+ read -r pkgbase
/usr/share/libalpm/scripts/dracut-install: line 30: /usr/lib/modules/5.13.10-arch1-1/pkgbase
/usr/lib/modules/5.13.9-arch1-1/pkgbase: No such file or directory

Upon closer inspection, it seems that the it's trying to open the file /usr/lib/modules/5.13.10-arch1-1/pkgbase\n/usr/lib/modules/5.13.9-arch1-1/pkgbase, rather than treating those as two separate file.

I have kernel-modules-hook locally, which is the reason both kernels are present at the same time (this hooks keeps older modules around until reboot, otherwise you end up with a broken system after update).

lunaryorn commented on 2021-08-14 10:16

I don't really care to be honest. If you'd like to have these packages merged go ahead with whatever needs to be done to that end, but to me it's too much effort 20 lines of bash and a bit of configuration…

whynothugo commented on 2021-08-13 09:09

I see that dracut-hook-uefi and dracut-uefi-hook are essentially the same idea, but with subtle differences. Would you consider merging both packages into one?

There's only some very subtle differences between the two:

Improvements on the dracut-uefi-hook side:

Is triggered when the linux stub is updated too:

Target = usr/lib/systemd/boot/efi/linuxx64.efi.stub

Looks like the install script determines ESP_PATH and MACHINE_ID, but these are unused, so it should be safe to drop them.

Improvements on the dracut-hook-uefi side

The "Description" on the hooks is more appropriate for what's being done.

Specifices arch=('any'). This is correct, since there's nothing platform-specific in the package itself. Quite the contrary, these work on AARM64, and possibel other archs.


The rest of the differences are mostly cosmetic variations on messages or indentation. dracut-uefi-hook uses dracut -q, which seems to be the only variation.

whynothugo commented on 2021-08-13 09:09

I see that dracut-hook-uefi and dracut-uefi-hook are essentially the same idea, but with subtle differences. Would you consider merging both packages into one?

There's only some very subtle differences between the two:

Improvements on the dracut-uefi-hook side:

Is triggered when the linux stub is updated too:

Target = usr/lib/systemd/boot/efi/linuxx64.efi.stub

Looks like the install script determines ESP_PATH and MACHINE_ID, but these are unused, so it should be safe to drop them.

Improvements on the dracut-hook-uefi side

The "Description" on the hooks is more appropriate for what's being done.

Specifices arch=('any'). This is correct, since there's nothing platform-specific in the package itself. Quite the contrary, these work on AARM64, and possibel other archs.


The rest of the differences are mostly cosmetic variations on messages or indentation. dracut-uefi-hook uses dracut -q, which seems to be the only variation.

mrabe89 commented on 2021-04-09 19:04

Like lunaryorn said, dracut-remove is assuming the ESP is mounted at /boot. But that's only dracuts last fallback path, if neither /efi, nor /boot/efi exists. (details: https://git.kernel.org/pub/scm/boot/dracut/dracut.git/tree/dracut.sh?h=053#n851 )

I changed my dracut-remove to use the same mechanism.

--- dracut-remove   2021-04-09 20:54:04.985000688 +0200
+++ dracut-remove.new   2021-04-09 20:57:11.924297085 +0200
@@ -3,6 +3,16 @@
 while read -r line; do
    if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then
        kver=$(basename $(dirname ${line}))
-       rm -v /boot/EFI/Linux/linux-${kver}-$(cat /etc/machine-id)-*.efi
+
+       if [[ -d /efi ]] && mountpoint -q /efi; then
+           efidir=/efi/EFI
+       else
+           efidir=/boot/EFI
+           if [[ -d $dracutsysrootdir/boot/efi/EFI ]]; then
+               efidir=/boot/efi/EFI
+           fi
+       fi
+
+       rm -v ${efidir}/Linux/linux-${kver}-$(cat /etc/machine-id)-*.efi
    fi
 done

lunaryorn commented on 2021-03-08 17:14

dracut-remove assumes that the ESP is mounted at /boot, but that's not the case for me. According to the wiki (https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points) /efi is another common mount point, and in fact that's also what systemd uses by default (https://systemd.io/DISCOVERABLE_PARTITIONS/).

Would you mind to add support for /efi as well?

anonfunc commented on 2021-02-18 15:31

Just for reference, I had to comment line 28 of dracut-install to make it compatible with kernel-modules-hook.

I don't think that's the best or correct solution, but it seems to work for me.