Skip to content

Instantly share code, notes, and snippets.

@kpengboy
Created November 8, 2021 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpengboy/c1f871d9bfbf59f26aecb03a7860438c to your computer and use it in GitHub Desktop.
Save kpengboy/c1f871d9bfbf59f26aecb03a7860438c to your computer and use it in GitHub Desktop.
Pin kernel series as default in GRUB
Add these functions to 10_linux (example for series 4.9):
my_version_test_gt ()
{
case "$1:$2" in
*-4.9.*:*-4.9.*)
version_test_gt "$1" "$2"
return "$?"
;;
*-4.9.*:*)
return 0
;;
*:*-4.9.*)
return 1
;;
*:*)
version_test_gt "$1" "$2"
return "$?"
;;
esac
}
my_version_find_latest ()
{
version_find_latest_a=""
for i in "$@" ; do
if my_version_test_gt "$i" "$version_find_latest_a" ; then
version_find_latest_a="$i"
fi
done
echo "$version_find_latest_a"
}
Then modify the main loop which generates entries to use my_version_find_latest instead of version_find_latest.
==
Copyright 2021 Google LLC
SPDX-License-Identifier: Apache-2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment