Skip to content

Commit

Permalink
debian: fix broken grub config with grub 2.12
Browse files Browse the repository at this point in the history
`version_find_latest` is removed in grub 2.12, replace it with
`sort -V -r` for maximum compatibility.

Tracked-On: #8576
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
  • Loading branch information
jiaqingz-intel authored and acrnsi-robot committed May 9, 2024
1 parent 98e546e commit 40d6172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion debian/grub/20_acrn-board-inspector
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ prepare_root_cache=
boot_device_id=

while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
linux=$(echo ${list} | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | LC_ALL=C sort -V -r | sed -e 's/ 1$/.old/; s/ 2$//' | head -n 1)
case $linux in
*.efi.signed)
# We handle these in linux_entry.
Expand Down
4 changes: 2 additions & 2 deletions debian/grub/25_linux_acrn
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ boot_device_id=
acrn_first_entry=

while [ "x${acrn_list}" != "x" ] ; do
current_acrn=$(version_find_latest $acrn_list)
current_acrn=$(echo ${acrn_list} | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | LC_ALL=C sort -V -r | sed -e 's/ 1$/.old/; s/ 2$//' | head -n 1)
acrn_basename=$(basename ${current_acrn})
acrn_dirname=$(dirname ${current_acrn})
rel_acrn_dirname=$(make_system_path_relative_to_its_root $acrn_dirname)
Expand Down Expand Up @@ -342,7 +342,7 @@ EOF

# only if we have at least one ACRN capable kernel and a Service VM entry defined
while [ "x$list" != "x" ] && [ "x${ACRN_SERVICE_VM_ID}" != "x" ] ; do
linux=$(version_find_latest $list)
linux=$(echo ${list} | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | LC_ALL=C sort -V -r | sed -e 's/ 1$/.old/; s/ 2$//' | head -n 1)
gettext_printf "Found ACRN linux image: %s\n" "$linux" >&2
basename=$(basename $linux)
dirname=$(dirname $linux)
Expand Down

0 comments on commit 40d6172

Please sign in to comment.