Skip to content

Commit d23b3bf

Browse files
committed
kernel-install: automatically generate "sort-key" field
Let's order by IMAGE_ID=/ID= by default.
1 parent cf5d959 commit d23b3bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/kernel-install/90-loaderentry.install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ fi
6262

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

65+
SORT_KEY="$IMAGE_ID"
66+
[ -z "$SORT_KEY" ] && SORT_KEY="$ID"
67+
6568
if [ -r /etc/kernel/cmdline ]; then
6669
BOOT_OPTIONS="$(tr -s "$IFS" ' ' </etc/kernel/cmdline)"
6770
elif [ -r /usr/lib/kernel/cmdline ]; then
@@ -130,6 +133,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
130133
# See similar logic above for the systemd.machine_id= kernel command line option
131134
echo "machine-id $MACHINE_ID"
132135
fi
136+
[ -n "$SORT_KEY" ] && echo "sort-key $SORT_KEY"
133137
echo "options $BOOT_OPTIONS"
134138
echo "linux $ENTRY_DIR/linux"
135139

0 commit comments

Comments
 (0)