What is eos-grub-fix-initrd-generation.hook?

So, it seems like using noextract might not be the best option for this use case. Honestly, even it had worked the way you wanted, the hook would have still run against it because it is a package hook meaning it is looking for package changes not file changes.

It would be relatively simple for you to create your own hook that updated the file the way you prefer.

Yes, the hook would get triggered, but the script that it runs would have no effect.

Reading man pacman.conf I found the option NoUpgrade.

       NoUpgrade = file ...
           All files listed with a NoUpgrade directive will never be touched during a package install/upgrade, and the
           new files will be installed with a .pacnew extension. These files refer to files in the package archive, so do
           not include the leading slash (the RootDir) when specifying them. Shell-style glob patterns are allowed. It is
           possible to invert matches by prepending a file with an exclamation mark. Inverted files will result in
           previously blacklisted files being whitelisted again. Subsequent matches will override previous ones. A
           leading literal exclamation mark or backslash needs to be escaped.

I used that option instead of NoExtract and it worked. Now the file 10_linux that comes with grub gets installed as 10_linux.pacnew and my file is kept as 10_linux. When the hook eos-grub-fix-initrd-generation gets executed, the file isn’t modified by it.

$ sudo pacman -S grub
...
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Fix 'grub' and 'os-prober' after upgrading either of them.
===> INFO: grub-tools / grub-fix-initrd-generation:
===> INFO: /etc/grub.d/30_os-prober changed. See file /var/log/grub-fix-initrd-generation.log.
Generating grub configuration file ...
Found theme: /boot/grub/themes/dark-matter/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
...

Thank you everyone for all your help. It pushed me in the right direction. I consider this solved.

1 Like

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