Skip to content

Commit

Permalink
feat(install.d): add sort-key field to rescue BLS entries
Browse files Browse the repository at this point in the history
The `sort-key` field was added in systemd/systemd#22519
and is used by systemd-boot to sort boot entries. Without it, rescue entries
generated by this plugin are not sorted properly.

This patch mimics systemd/systemd@d23b3bfd
  • Loading branch information
aafeijoo-suse committed May 3, 2024
1 parent 4d59421 commit 33228c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install.d/51-dracut-rescue.install
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fi

[[ -n $PRETTY_NAME ]] || PRETTY_NAME="Linux $KERNEL_VERSION"

SORT_KEY="$IMAGE_ID"
[[ -z $SORT_KEY ]] && SORT_KEY="$ID"

if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]]; then
Expand Down Expand Up @@ -127,6 +130,7 @@ case "$COMMAND" in
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
[[ -n $SORT_KEY ]] && echo "sort-key $SORT_KEY"
echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
Expand Down

0 comments on commit 33228c7

Please sign in to comment.