I’ve been using systemd-boot for a few months and recently upgrades are failing to create new boot entries due to failing to generate initrd. It generates lots of error messages ‘… Argument list too long’ in snapper.log or on the console when running a command such as sdbootutil add-kernel 6.10.7-1-default 211 -v --no-reuse-initrd
.
2024-09-05 21:11:57 MIL libsnapper(1815) SystemCmd.cc(SystemCmd):48 - constructor SystemCmd: /usr/lib/snapper/plugins/10-sdbootutil.snapper create-snapshot-post / btrfs 211
2024-09-05 21:12:05 MIL libsnapper(1815) SystemCmd.cc(addLine):394 - Adding Line 1 “/.snapshots/211/snapshot/usr/lib/dracut/dracut-init.sh: line 242: /.snapshots/211/snapshot/usr/lib/dracut/dracut-install: Argument list
too long”
2024-09-05 21:12:05 MIL libsnapper(1815) SystemCmd.cc(getUntilEOF):358 - pid:1837 added lines:1 stderr:true
2024-09-05 21:12:05 MIL libsnapper(1815) SystemCmd.cc(addLine):394 - Adding Line 2 “/.snapshots/211/snapshot/usr/lib/dracut/dracut-init.sh: line 1186: /usr/bin/ln: Argument list too long”
2024-09-05 21:12:05 MIL libsnapper(1815) SystemCmd.cc(getUntilEOF):358 - pid:1837 added lines:1 stderr:true
2024-09-05 21:12:05 MIL libsnapper(1815) SystemCmd.cc(addLine):394 - Adding Line 3 "/.snapshots/211/snapshot/usr/lib/dracut/dracut-init.sh: line 266: /.snapshots/211/snapshot/usr/lib/dracut/dracut-install: Argument list
…
The problem seems to be in the dracut file /usr/lib/dracut/dracut-init.sh lines 110-113 where it tries to add all sub-directories of /usr/lib64 into the LD_LIBRARY_PATH. Changing this to just add ‘$libdirs’ to the LD_LIBRARY_PATH will generate the initrd. Instead of adding the 3 needed dirs to the path it is trying to add over 6000 on my system.
There are also issues with sdbootutil and when using an XBOOTLDR partition for another post. (Or should I report those somewhere else?).