Created
November 8, 2021 04:18
-
-
Save kpengboy/c1f871d9bfbf59f26aecb03a7860438c to your computer and use it in GitHub Desktop.
Pin kernel series as default in GRUB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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