Bug#1014581: systemd-boot: kernel hook schould use conforming name

2022-08-28 Thread Victor Westerhuis

On Tue, 19 Jul 2022 21:29:06 +0200 Michael Biebl  wrote:

Am 12.07.22 um 18:16 schrieb Michael Biebl:
> Control: tags -1 + moreinfo
> 
> Am 08.07.22 um 11:14 schrieb Norbert Lange:

>> Package: systemd-boot
>> Version: 251.2-7
>> Severity: normal
>> X-Debbugs-Cc: nolang...@gmail.com
>>
>> Dear Maintainer,
>>
>> The kernel hook in /etc/kernel/{post,pre}inst.d should
>> be named correctly, to quote the kernel-handbook [1]:
>>
>>>    hook scripts for boot loaders must be named using
>>  the prefix zz- and no other packages may use this prefix
>>
>> so zz-systemd-boot whould be correct.
> 
> This looks super ugly :-/

> At the very least they should have picked numerical prefixes...
> 
> That said, why does the kernel hook need to run late/last? I.e., does 
> this actually cause any real issues? If so, can you elaborate.
> 

I looked into this a bit more and it is still not obvious/clear to me, 
why the kernel hook for systemd needs to use the zz prefix (i.e. run 
late/last). The systemd kernel hook copies the vmlinux-* binary to 
/boot/efi, but this file is available once the linux-image-* package has 
been unpacked.


That said, I could understand if the initramfs hook needs to run last, 
i.e. /etc/initramfs/post-update.d/systemd-boot. As this hook will copy 
the initrd to /boot/efi and initramfs hooks *do* modify the initrd image.
The kernel handbook doesn't mention anything in that regard though, so 
it seems to be incomplete/wrong for the purposes of systemd-boot?
I recently switched from initramfs-tools to tiny-initramfs to generate 
my initramfs. update-tirfs, contrary to the policy, does not run the 
hooks in /etc/initramfs/post-update.d. However, at least when a kernel 
is being installed, updated or removed these hooks are allowed to skip 
doing any work anyway, according to section 8.5 of the Debian kernel 
handbook.


This means that only step 3, running the hooks in 
/etc/kernel/post{inst,rm}.d are required to do anything.


The issue is that tiny-initramfs sorts after systemd-boot, so the initrd 
is only generated after systemd-boot has tried to copy it already, 
leading to a missing initrd on the first try.


I've solved the issue locally by moving systemd-boot's 
/etc/kernel/post{inst,rm}.d hooks to the name prescribed by policy.


I will also file a corresponding bug (with patch) against tiny-initramfs 
to fix the running of the hooks in /etc/initramfs/post-update.d.



I'm reluctant to blindly change anything without understanding why.
So would welcome further input from someone who is familiar with that topic.

Regards,
Michael



Regards,
--
Victor Westerhuis 


OpenPGP_signature
Description: OpenPGP digital signature


Bug#1014581: systemd-boot: kernel hook schould use conforming name

2022-07-19 Thread Michael Biebl

Am 12.07.22 um 18:16 schrieb Michael Biebl:

Control: tags -1 + moreinfo

Am 08.07.22 um 11:14 schrieb Norbert Lange:

Package: systemd-boot
Version: 251.2-7
Severity: normal
X-Debbugs-Cc: nolang...@gmail.com

Dear Maintainer,

The kernel hook in /etc/kernel/{post,pre}inst.d should
be named correctly, to quote the kernel-handbook [1]:


   hook scripts for boot loaders must be named using

 the prefix zz- and no other packages may use this prefix

so zz-systemd-boot whould be correct.


This looks super ugly :-/
At the very least they should have picked numerical prefixes...

That said, why does the kernel hook need to run late/last? I.e., does 
this actually cause any real issues? If so, can you elaborate.




I looked into this a bit more and it is still not obvious/clear to me, 
why the kernel hook for systemd needs to use the zz prefix (i.e. run 
late/last). The systemd kernel hook copies the vmlinux-* binary to 
/boot/efi, but this file is available once the linux-image-* package has 
been unpacked.


That said, I could understand if the initramfs hook needs to run last, 
i.e. /etc/initramfs/post-update.d/systemd-boot. As this hook will copy 
the initrd to /boot/efi and initramfs hooks *do* modify the initrd image.
The kernel handbook doesn't mention anything in that regard though, so 
it seems to be incomplete/wrong for the purposes of systemd-boot?



I'm reluctant to blindly change anything without understanding why.
So would welcome further input from someone who is familiar with that topic.

Regards,
Michael




OpenPGP_signature
Description: OpenPGP digital signature


Bug#1014581: systemd-boot: kernel hook schould use conforming name

2022-07-12 Thread Michael Biebl

Control: tags -1 + moreinfo

Am 08.07.22 um 11:14 schrieb Norbert Lange:

Package: systemd-boot
Version: 251.2-7
Severity: normal
X-Debbugs-Cc: nolang...@gmail.com

Dear Maintainer,

The kernel hook in /etc/kernel/{post,pre}inst.d should
be named correctly, to quote the kernel-handbook [1]:


   hook scripts for boot loaders must be named using

 the prefix zz- and no other packages may use this prefix

so zz-systemd-boot whould be correct.


This looks super ugly :-/
At the very least they should have picked numerical prefixes...

That said, why does the kernel hook need to run late/last? I.e., does 
this actually cause any real issues? If so, can you elaborate.


Michael


OpenPGP_signature
Description: OpenPGP digital signature


Bug#1014581: systemd-boot: kernel hook schould use conforming name

2022-07-08 Thread Norbert Lange
Package: systemd-boot
Version: 251.2-7
Severity: normal
X-Debbugs-Cc: nolang...@gmail.com

Dear Maintainer,

The kernel hook in /etc/kernel/{post,pre}inst.d should
be named correctly, to quote the kernel-handbook [1]:

>   hook scripts for boot loaders must be named using
the prefix zz- and no other packages may use this prefix

so zz-systemd-boot whould be correct.


[1] - https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.18.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd-boot depends on:
ii  libc6  2.33-7
ii  libsystemd-shared  251.2-7
ii  systemd-boot-efi   251.2-7

Versions of packages systemd-boot recommends:
pn  efibootmgr  

systemd-boot suggests no packages.

-- no debconf information