New comment by prez on void-packages repository https://github.com/void-linux/void-packages/pull/42667#issuecomment-1493424924 Comment: I've been testing this on my system (x86_64 glibc) - systemd-boot works well. The hook could use some logic to check whether the configured kernel is newer than the current default one (always replacing the default with a potentially older kernel isn't expected behaviour, I think). And here's a suggestion for a post-remove hook: ```sh #!/bin/sh # # Kernel post-remove hook for systemd-boot. # # Arguments passed to this script: $1 pkgname, $2 version. # PKGNAME="$1" VERSION="$2" . "$ROOTDIR/etc/default/systemd-boot" if [ "$SYSTEMD_BOOT_DISABLE" ]; then exit 0 fi boot="$ROOTDIR/boot" entries="$boot/loader/entries" name="void-$VERSION" entry="$entries/$name.conf" loader="$boot/loader/loader.conf" [ -r "$loader" ] || exit 0 rm -f "$entry" if grep -q "^default ${name}" "$loader" 2>/dev/null; then # Replace removed default entry with another alternative="$(ls -r "$entries" | head -n 1)" [ -n "$alternative" ] || exit 0 sed -i "s/default.*/default ${alternative%.conf}/" "$loader" fi ```