What's the expected content of "/etc/initramfs/post-update.d/systemd-boot"?

Pickwick

New Member
Aug 6, 2024
12
1
3
Hi everyone,

a few minutes ago I accidently issued "apt update && apt upgrade && apt dist-upgrade" at my PVE host. Thought I was within some other host I don't care too much about instead and ran into a conflict by APT with the file mentioned in the subject. As I didn't care too much, I just kept it as is, but afterwards recognized that I was on the host, where I do care about how to properly solve those conflicts. The following is the output of APT I still have:

Code:
Setting up systemd-boot (257.8-1+pmx1) ...

Configuration file '/etc/initramfs/post-update.d/systemd-boot'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** systemd-boot (Y/I/N/O/D/Z) [default=N] ? d
--- /etc/initramfs/post-update.d/systemd-boot   2024-08-26 12:30:14.745235197 +0200
+++ /etc/initramfs/post-update.d/systemd-boot.dpkg-new  2025-08-04 22:43:18.000000000 +0200
@@ -1,15 +1,20 @@
 #!/bin/sh

-# This hookfile has been disabled by proxmox-boot-tool
-exit 0
-#!/bin/sh
-
 set -eu

 test -x /usr/bin/bootctl || exit 0

 bootctl is-installed --quiet || exit 0

+if [ -f "/boot/vmlinuz-$1" ]; then
+    k="/boot/vmlinuz-$1"
+elif [ -f "/boot/vmlinux-$1" ]; then
+    k="/boot/vmlinux-$1"
+else
+    echo "Kernel version $1 not found in /boot."
+    exit 0
+fi
+
 echo "Updating kernel version $1 in systemd-boot..."

-kernel-install add "$1" "/boot/vmlinuz-$1" "$2"
+kernel-install add "$1" "$k" "$2"

Configuration file '/etc/initramfs/post-update.d/systemd-boot'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** systemd-boot (Y/I/N/O/D/Z) [default=N] ? n
Processing triggers for dbus (1.16.2-2) ...

I can't remember to have ever executed proxmox-boot-tool in a way to trigger those changes. So I believe at some point some update or ... provided by the maintainer made that tool being called and changed that file. But then, the maintainer should have been aware of such a conflict most likely and would have addressed that already?!


Code:
root@srv01:/var/run# pveversion
pve-manager/9.0.6/49c767b70aeb6648 (running kernel: 6.14.11-1-pve)

I had a look at the file APT kept and if I understand the code correct, the new and old file have the same safety checks and should gracefully not do anything, because "bootctl is-installed" would end with an error, making the script abort. But there's a reason most likely why theyx even changed it to hard-coded "exit 0" in the old version already.

So, how does that file needs to look like right now? Can I just put the new file from the maintainer into place?

Thanks!
 
I don't have that file (anymore?) on PVE 9. This might be cause I uninstalled systemd-boot (after installing systemd-boot-efi and systemd-boot-tools) as prompted by pve8to9 (after upgrading to PVE 9).
 
  • Like
Reactions: Pickwick
I'm on PVE9 as well and am somewhat sure that pve8to9 didn't mention the problem before the upgrade. Does it really make sense to follow that advice for an outdated upgrade check? Or was the upgrade check enhanced in the meantime and following the advice is the better thing to do?

Do you use GPT and UEFI? Because I do. systemd-boot-efi targets that setup instead of e.g. legacy BIOS?
 
I'm on PVE9 as well and am somewhat sure that pve8to9 didn't mention the problem before the upgrade. Does it really make sense to follow that advice for an outdated upgrade check?
Yes, pve8to9 checks your current situation after the upgrade to PVE 9 as well.
Or was the upgrade check enhanced in the meantime and following the advice is the better thing to do?
pve8to9 has been updated several times because of feedback on this forum.
Do you use GPT and UEFI? Because I do.
Yes I do.
 
  • Like
Reactions: Pickwick
OK thanks, than I'm going to follow that suggestion as well and get rid of the conflict that way.
 
Hi everyone,

a few minutes ago I accidently issued "apt update && apt upgrade && apt dist-upgrade" at my PVE host. Thought I was within some other host I don't care too much about instead and ran into a conflict by APT with the file mentioned in the subject. As I didn't care too much, I just kept it as is, but afterwards recognized that I was on the host, where I do care about how to properly solve those conflicts. The following is the output of APT I still have:

Code:
Setting up systemd-boot (257.8-1+pmx1) ...

Configuration file '/etc/initramfs/post-update.d/systemd-boot'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** systemd-boot (Y/I/N/O/D/Z) [default=N] ? d
--- /etc/initramfs/post-update.d/systemd-boot   2024-08-26 12:30:14.745235197 +0200
+++ /etc/initramfs/post-update.d/systemd-boot.dpkg-new  2025-08-04 22:43:18.000000000 +0200
@@ -1,15 +1,20 @@
 #!/bin/sh

-# This hookfile has been disabled by proxmox-boot-tool
-exit 0
-#!/bin/sh
-
 set -eu

 test -x /usr/bin/bootctl || exit 0

 bootctl is-installed --quiet || exit 0

+if [ -f "/boot/vmlinuz-$1" ]; then
+    k="/boot/vmlinuz-$1"
+elif [ -f "/boot/vmlinux-$1" ]; then
+    k="/boot/vmlinux-$1"
+else
+    echo "Kernel version $1 not found in /boot."
+    exit 0
+fi
+
 echo "Updating kernel version $1 in systemd-boot..."

-kernel-install add "$1" "/boot/vmlinuz-$1" "$2"
+kernel-install add "$1" "$k" "$2"

Configuration file '/etc/initramfs/post-update.d/systemd-boot'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** systemd-boot (Y/I/N/O/D/Z) [default=N] ? n
Processing triggers for dbus (1.16.2-2) ...

I can't remember to have ever executed proxmox-boot-tool in a way to trigger those changes. So I believe at some point some update or ... provided by the maintainer made that tool being called and changed that file. But then, the maintainer should have been aware of such a conflict most likely and would have addressed that already?!


Code:
root@srv01:/var/run# pveversion
pve-manager/9.0.6/49c767b70aeb6648 (running kernel: 6.14.11-1-pve)

I had a look at the file APT kept and if I understand the code correct, the new and old file have the same safety checks and should gracefully not do anything, because "bootctl is-installed" would end with an error, making the script abort. But there's a reason most likely why theyx even changed it to hard-coded "exit 0" in the old version already.

So, how does that file needs to look like right now? Can I just put the new file from the maintainer into place?

Thanks!
Same here. What did you do?
 
Same here. What did you do?
What pve8to9 told me:

Code:
apt install systemd-boot-efi systemd-boot-tools
apt remove systemd-boot
apt purge  systemd-boot

Some of the installed packages seem to have been available anyway already, maybe because of "systemd-boot" being a meta-package. But didn't care too much in the end. What I found interesting is that no init/boot-related generation happened, so I guess if everythign works needs to be seen with the next kernel or something.
 
I also saw this warning during the proxmox 8 to 9 upgrade:
```
Configuration file '/etc/initramfs/post-update.d/systemd-boot'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** systemd-boot (Y/I/N/O/D/Z) [default=N] ?

```

Before, `pve8to9 --full` did not list this problem. I selected "Y" (package maintainer). My file changed from:
```
#!/bin/sh

# This hookfile has been disabled by proxmox-boot-tool
exit 0
#!/bin/sh

set -eu

test -x /usr/bin/bootctl || exit 0

bootctl is-installed --quiet || exit 0

echo "Updating kernel version $1 in systemd-boot..."

kernel-install add "$1" "/boot/vmlinuz-$1" "$2"
```

to:
```
#!/bin/sh

set -eu

test -x /usr/bin/bootctl || exit 0

bootctl is-installed --quiet || exit 0

if [ -f "/boot/vmlinuz-$1" ]; then
k="/boot/vmlinuz-$1"
elif [ -f "/boot/vmlinux-$1" ]; then
k="/boot/vmlinux-$1"
else
echo "Kernel version $1 not found in /boot."
exit 0
fi

echo "Updating kernel version $1 in systemd-boot..."

kernel-install add "$1" "$k" "$2"
```
 
 
it will be re-overridden on the next execution of proxmox-boot-tool. but note that as per the upgrade guide and pve8to9 - you should not have both proxmox-boot-tool active and systemd-boot installed anyway.
 
apt upgrade
This should NOT be run on PVE host, only apt dist-upgrade.

I am on PVE 9 & I have:

Code:
# ls /etc/initramfs/post-update.d/systemd-boot -lh
-rw-r--r-- 1 root root 271 Dec  1  2024 /etc/initramfs/post-update.d/systemd-boot

# cat /etc/initramfs/post-update.d/systemd-boot
#!/bin/sh

# This hookfile has been disabled by proxmox-boot-tool
exit 0
#!/bin/sh

set -eu

test -x /usr/bin/bootctl || exit 0

bootctl is-installed --quiet || exit 0

echo "Updating kernel version $1 in systemd-boot..."

kernel-install add "$1" "/boot/vmlinuz-$1" "$2"
I did not receive any warning/notification during PVE8to9.
 
I am on PVE 9 & I have:

Just for completeness (it does not matter, "exit 0" is the relevant command), the "no-subscription" version is different:
Code:
~# dpkg -S /etc/initramfs/post-update.d/systemd-boot
systemd-boot: /etc/initramfs/post-update.d/systemd-boot

~# apt policy systemd-boot
systemd-boot:
  Installed: 257.8-1+pmx1
  Candidate: 257.8-1+pmx1
  Version table:
 *** 257.8-1+pmx1 500
        500 http://download.proxmox.com/debian/pbs trixie/pbs-no-subscription amd64 Packages

Code:
~# cat /etc/initramfs/post-update.d/systemd-boot
#!/bin/sh

# This hookfile has been disabled by proxmox-boot-tool
exit 0
#!/bin/sh

set -eu

test -x /usr/bin/bootctl || exit 0

bootctl is-installed --quiet || exit 0

if [ -f "/boot/vmlinuz-$1" ]; then
    k="/boot/vmlinuz-$1"
elif [ -f "/boot/vmlinux-$1" ]; then
    k="/boot/vmlinux-$1"
else
    echo "Kernel version $1 not found in /boot."
    exit 0
fi

echo "Updating kernel version $1 in systemd-boot..."

kernel-install add "$1" "$k" "$2"
 
download.proxmox.com/debian/pbs
Interesting that you have "pbs" there.

Installed: 257.8-1+pmx1
Not on mine any more.
My output:
Code:
systemd-boot:
  Installed: (none)
  Candidate: 257.8-1+pmx1
  Version table:
     257.8-1+pmx1 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     257.8-1~deb13u1 500
        500 http://ftp.debian.org/debian trixie/main amd64 Packages
     257.7-1+pmx2 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
        100 /var/lib/dpkg/status
     257.7-1+pmx1 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages

# dpkg -S /etc/initramfs/post-update.d/systemd-boot
systemd-boot: /etc/initramfs/post-update.d/systemd-boot

# cat /etc/initramfs/post-update.d/systemd-boot
#!/bin/sh

# This hookfile has been disabled by proxmox-boot-tool
exit 0
#!/bin/sh

set -eu

test -x /usr/bin/bootctl || exit 0

bootctl is-installed --quiet || exit 0

echo "Updating kernel version $1 in systemd-boot..."

kernel-install add "$1" "/boot/vmlinuz-$1" "$2"
 
  • Like
Reactions: UdoB
Interesting that you have "pbs" there.
Yeah, that the one instance I have with PVE + PBS installed in parallel. I will try to not take that node as an example-generator anymore, as I could not exclude extraordinary behavior.

Glad you spotted it. That's why I usually copy-n-paste the actual command and the output :-)

For the record: while it works fine I will not recommend this combination.