Closed tdaitx closed 7 years ago
Hmm, not sure what to do here. There's a reason it hijacked the dracut file - dracut does not support hooks.
But then I'm confused - how can you have both dracut and initramfs-tool installed? Both create a initramfs, and for dracut we hack around the missing hook, while for initramfs-tools it's done as an initramfs-tools hook.
Ah, I see, you probably don't have dracut - the dracut hack does not check if dracut is actually installed.
Indeed, I don't have it installed.
$ ls -l /etc/kernel/postinst.d/dracut*
-rwxr-xr-x 1 root root 262 Jul 5 16:45 /etc/kernel/postinst.d/dracut
$ dpkg -S /etc/kernel/postinst.d/dracut
diversion by sicherboot from: /etc/kernel/postinst.d/dracut
diversion by sicherboot to: /etc/kernel/postinst.d/dracut.SecureBoot
sicherboot: /etc/kernel/postinst.d/dracut
Then maybe the right way is to modify how sicherboot gets called from the dracut postinst script, how about this:
--- /etc/kernel/postinst.d/dracut.orig 2017-07-05 17:30:23.944058660 -0300
+++ /etc/kernel/postinst.d/dracut 2017-07-06 12:39:12.950788522 -0300
@@ -5,10 +5,11 @@
set -e
-# Run the real dracut first if it exists
-if [ -e /etc/kernel/postinst.d/dracut.SecureBoot ]; then
- /etc/kernel/postinst.d/dracut.SecureBoot "$@"
-fi
+# Do nothing if the diverted dracut does not exist
+[ -e /etc/kernel/postinst.d/dracut.SecureBoot ] || exit 0
+
+# Run the real dracut first
+/etc/kernel/postinst.d/dracut.SecureBoot "$@"
echo "sicherboot: Installing $1 to ESP"
No, that would be the wrong fix, it breaks on removed, but not purged dracut. I think I should divert /usr/bin/dracut, and not the kernel install hook, I'm not entirely sure why I did what I did.
A more correct fix is to look for /usr/bin/dracut, but there are some other cases where dracut does not generate the initramfs.
First of all thanks for this great tool! Unfortunately this issue isn't fixed.
The problem is scripts in /etc/kernel/postinst.d/
are executed in alphabetical order which means /etc/kernel/postinst.d/dracut
is executed before /etc/kernel/postinst.d/initramfs-tools
. That means sicherboot
will be executed before initramfs is created which obviously fail.
For solution dracut
hook should be renamed to zz-dracut
or something like that.
Sicherboot postinst script failed to run today with a new kernel in Ubuntu 17.10 (artful, the development release). This is a somewhat new install and this is the first kernel update I got since installing sicherboot.
The error was (see full log on the bottom)
This is caused by a missing initrd.img for the kernel. The initramfs update is postponed as it is called from the
/etc/kernel/postinst.d/initramfs-tools
script, which is called after dracut (alphabetical order).To solve it I had to remove the
sicherboot
call from the dracut script and moved it to azz-update-sicherboot
(following grub's naming)After that the new install was successful:
The full error log is