Bug#1110914: removing systemd-boot breaks modprobe

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Aug 12 12:46:27 BST 2025


Package: systemd-boot
Version: 257.7-1
Severity: important
X-Debbugs-Cc: f.gruenbichler at proxmox.com

running `apt remove systemd-boot` breaks modprobe by calling `kernel-install
remove ..`.

in particular, the following sequence:

works (with systemd-boot installed and an ESP mounted):

root at debian:~# ls /lib/modules/$(uname -r)
kernel         modules.alias.bin  modules.builtin.alias.bin  modules.builtin.modinfo  modules.dep.bin  modules.order    modules.symbols      modules.weakdep
modules.alias  modules.builtin    modules.builtin.bin        modules.dep              modules.devname  modules.softdep  modules.symbols.bin
root at debian:~# modprobe veth

then I remove systemd-boot (while the ESP is mounted):

root at debian:~# apt remove systemd-boot
The following packages were automatically installed and are no longer required:
  systemd-boot-efi-amd64-signed  systemd-boot-tools
Use 'apt autoremove' to remove them.

REMOVING:
  systemd-boot

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
  Freed space: 199 kB

Continue? [Y/n]
(Reading database ... 34613 files and directories currently installed.)
Removing systemd-boot (257.7-1) ...
Removed "/boot/efi/EFI/BOOT/BOOTX64.EFI".
Removed "/boot/efi/loader/loader.conf".
Removed "/boot/efi/loader/random-seed".
Removed "/boot/efi/loader/entries.srel".
Removed "/boot/efi/loader/keys".
Removed "/boot/efi/EFI/BOOT".
Removed "/boot/efi/EFI/Linux".
Removed "/boot/efi/loader/entries".
Removed "/boot/efi/loader".
Removed EFI variable LoaderSystemToken-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
Processing triggers for man-db (2.13.1-1) ...

no indication above that this touched /lib/modules/.., but:

root at debian:~# ls /lib/modules/$(uname -r)
kernel  modules.builtin  modules.builtin.modinfo  modules.order
root at debian:~# modprobe veth
modprobe: FATAL: Module veth not found in directory /lib/modules/6.12.38+deb13-amd64

reinstalling systemd-boot doesn't help:

root at debian:~# apt install systemd-boot
Installing:
  systemd-boot

Suggested packages:
  systemd-ukify

Summary:
  Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0
  Download size: 97.8 kB
  Space needed: 199 kB / 28.0 GB available

Get:1 http://deb.debian.org/debian trixie/main amd64 systemd-boot amd64 257.7-1 [97.8 kB]
Fetched 97.8 kB in 0s (717 kB/s)
Selecting previously unselected package systemd-boot.
(Reading database ... 34587 files and directories currently installed.)
Preparing to unpack .../systemd-boot_257.7-1_amd64.deb ...
Unpacking systemd-boot (257.7-1) ...
Setting up systemd-boot (257.7-1) ...
Created "/boot/efi/EFI/systemd".
Created "/boot/efi/EFI/BOOT".
Created "/boot/efi/loader".
Created "/boot/efi/loader/keys".
Created "/boot/efi/loader/entries".
Created "/boot/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed" to "/boot/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed" to "/boot/efi/EFI/BOOT/BOOTX64.EFI".
Random seed file /boot/efi/loader/random-seed successfully written (32 bytes).
Successfully initialized system token in EFI variable with 32 bytes.
Created EFI boot entry "Linux Boot Manager".
Processing triggers for man-db (2.13.1-1) ...
root at debian:~# ls /lib/modules/$(uname -r)
kernel  modules.builtin  modules.builtin.modinfo  modules.order
root at debian:~# modprobe veth
modprobe: FATAL: Module veth not found in directory /lib/modules/6.12.38+deb13-amd64

reinstalling the running kernel does help:

root at debian:~# apt install --reinstall linux-image-$(uname -r)
Summary:
  Upgrading: 0, Installing: 0, Reinstalling: 1, Removing: 0, Not Upgrading: 0
  Download size: 109 MB
  Space needed: 0 B / 28.0 GB available

Get:1 http://deb.debian.org/debian trixie/main amd64 linux-image-6.12.38+deb13-amd64 amd64 6.12.38-1 [109 MB]
Fetched 109 MB in 5s (23.3 MB/s)
(Reading database ... 34613 files and directories currently installed.)
Preparing to unpack .../linux-image-6.12.38+deb13-amd64_6.12.38-1_amd64.deb ...
Unpacking linux-image-6.12.38+deb13-amd64 (6.12.38-1) over (6.12.38-1) ...
/etc/kernel/postrm.d/zz-systemd-boot:
Removing kernel version 6.12.38+deb13-amd64 from systemd-boot...
Setting up linux-image-6.12.38+deb13-amd64 (6.12.38-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.12.38+deb13-amd64
Updating kernel version 6.12.38+deb13-amd64 in systemd-boot...
/etc/kernel/postinst.d/zz-systemd-boot:
Installing kernel version 6.12.38+deb13-amd64 in systemd-boot...
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.12.38+deb13-amd64
Found initrd image: /boot/initrd.img-6.12.38+deb13-amd64
Found linux image: /boot/vmlinuz-6.12.27-amd64
Found initrd image: /boot/initrd.img-6.12.27-amd64
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

I suspect the culprit is the call to `kernel-install remove "$ver"` in the prerm:

https://sources.debian.org/src/systemd/257.7-1/debian/systemd-boot.prerm#L69

which is triggered on remove or purge as soon as an ESP is mounted. manually
running this command also causes the same symptoms.

root at debian:~# kernel-install remove $(uname -r)
root at debian:~# modprobe veth
modprobe: FATAL: Module veth not found in directory /lib/modules/6.12.38+deb13-amd64

the postinst would call `kernel-install add ..` which would also fix the issue,
but it is guarded by `$2` being zero, which is not the case for an install
after a non-purge removal.

running `update-initramfs` acting on the affected kernel versions also fixes
the issue, probably by virtue of running `depmod -a $ver` which also does.

root at debian:~# kernel-install add $(uname -r) /boot/vmlinuz-$(uname -r)
root at debian:~# modprobe veth

in any case I don't think systemd-boot being removed should break modprobe.

-- System Information:
Debian Release: 13.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.38+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemd-boot depends on:
ii  libc6                                                    2.41-11
ii  libsystemd-shared                                        257.7-1
ii  systemd                                                  257.7-1
ii  systemd-boot-efi-amd64-signed [systemd-boot-efi-signed]  257.7-1
ii  systemd-boot-tools                                       257.7-1

Versions of packages systemd-boot recommends:
ii  efibootmgr   18-2
ii  shim-signed  1.46+15.8-1

Versions of packages systemd-boot suggests:
pn  systemd-ukify  <none>

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list