grub2/grub2-use-rpmsort-for-version-sorting.patch
Michael Chang 8ee92f5194 Accepting request 1105405 from home:michael-chang:grub:2.12rc1
- Implement NV index mode for TPM 2.0 key protector
  0001-protectors-Implement-NV-index.patch
- Fall back to passphrase mode when the key protector fails to
  unlock the disk
  0002-cryptodisk-Fallback-to-passphrase.patch
- Wipe out the cached key cleanly
  0003-cryptodisk-wipe-out-the-cached-keys-from-protectors.patch
- Make diskfiler to look up cryptodisk devices first
  0004-diskfilter-look-up-cryptodisk-devices-first.patch

- Version bump to 2.12~rc1
  * Added:
    - grub-2.12~rc1.tar.xz
  * Removed:
    - grub-2.06.tar.xz
  * Patch dropped merged by new version:
    - grub2-GRUB_CMDLINE_LINUX_RECOVERY-for-recovery-mode.patch
    - grub2-s390x-02-kexec-module-added-to-emu.patch
    - grub2-efi-chainloader-root.patch
    - grub2-Fix-incorrect-netmask-on-ppc64.patch
    - 0001-osdep-Introduce-include-grub-osdep-major.h-and-use-i.patch
    - 0002-osdep-linux-hostdisk-Use-stat-instead-of-udevadm-for.patch
    - 0002-net-read-bracketed-ipv6-addrs-and-port-numbers.patch
    - grub2-s390x-10-keep-network-at-kexec.patch
    - 0001-Fix-build-error-in-binutils-2.36.patch
    - 0001-emu-fix-executable-stack-marking.patch
    - 0046-squash-verifiers-Move-verifiers-API-to-kernel-image.patch
    - 0001-30_uefi-firmware-fix-printf-format-with-null-byte.patch
    - 0001-tpm-Pass-unknown-error-as-non-fatal-but-debug-print-.patch
    - 0001-Filter-out-POSIX-locale-for-translation.patch

OBS-URL: https://build.opensuse.org/request/show/1105405
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=458
2023-08-24 03:25:56 +00:00

144 lines
3.9 KiB
Diff

v2:
Fix wrong sorting order if version contains "-" delimiter
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -203,12 +203,17 @@
version_sort ()
{
case $version_sort_sort_has_v in
+ rpmsort)
+ LC_ALL=C /usr/lib/rpm/rpmsort "$@";;
yes)
LC_ALL=C sort -V "$@";;
no)
LC_ALL=C sort -n "$@";;
*)
- if sort -V </dev/null > /dev/null 2>&1; then
+ if test -x /usr/lib/rpm/rpmsort; then
+ version_sort_sort_has_v=rpmsort
+ LC_ALL=C /usr/lib/rpm/rpmsort "$@"
+ elif sort -V </dev/null > /dev/null 2>&1; then
version_sort_sort_has_v=yes
LC_ALL=C sort -V "$@"
else
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -229,12 +229,56 @@
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
+listvrf=""
+pre_sort () {
+ local l=""
+
+ for f in $list; do
+ vr="`echo $f | sed -e 's/[^-]*-//' -e 's/-\([^0-9]*\)$/\.\1/' -e 's/-/~/g' -e 's/~\([^~]*\)$/-\1/'`"
+ l="$l $vr"
+ listvrf="$listvrf $vr:$f"
+ done
+
+ list=$l
+}
+
+post_sort () {
+ local l=""
+ local vr=""
+ local f=""
+ local found=""
+
+ for i in $reverse_sorted_list; do
+ found=""
+ for vrf in $listvrf; do
+ vr=${vrf%%:*}
+ f=${vrf#*:}
+ if test x"$vr" = x"$i"; then
+ l="$l $f"
+ found=$vrf
+ break
+ fi
+ done
+ if test -n "$found"; then
+ listvrf="`echo $listvrf | (sed -e 's!'$found'!!' 2>/dev/null || echo $listvrf)`"
+ fi
+ done
+
+ for vrf in $listvrf; do
+ f=${vrf#*:}
+ l="$l $f"
+ done
+
+ reverse_sorted_list=$l
+}
+pre_sort
# Perform a reverse version sort on the entire list.
# Temporarily replace the '.old' suffix by ' 1' and append ' 2' for all
# other files to order the '.old' files after their non-old counterpart
# in reverse-sorted order.
reverse_sorted_list=$(echo $list | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -r | sed -e 's/ 1$/.old/; s/ 2$//')
+post_sort
if [ "x$GRUB_TOP_LEVEL" != x ]; then
reverse_sorted_list=$(grub_move_to_front "$GRUB_TOP_LEVEL" ${reverse_sorted_list})
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -255,13 +255,57 @@
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
+listvrf=""
+pre_sort () {
+ local l=""
+
+ for f in $linux_list; do
+ vr="`echo $f | sed -e 's/[^-]*-//' -e 's/-\([^0-9]*\)$/\.\1/' -e 's/-/~/g' -e 's/~\([^~]*\)$/-\1/'`"
+ l="$l $vr"
+ listvrf="$listvrf $vr:$f"
+ done
+
+ linux_list=$l
+}
+
+post_sort () {
+ local l=""
+ local vr=""
+ local f=""
+ local found=""
+
+ for i in $reverse_sorted_linux_list; do
+ found=""
+ for vrf in $listvrf; do
+ vr=${vrf%%:*}
+ f=${vrf#*:}
+ if test x"$vr" = x"$i"; then
+ l="$l $f"
+ found=$vrf
+ break
+ fi
+ done
+ if test -n "$found"; then
+ listvrf="`echo $listvrf | (sed -e 's!'$found'!!' 2>/dev/null || echo $listvrf)`"
+ fi
+ done
+
+ for vrf in $listvrf; do
+ f=${vrf#*:}
+ l="$l $f"
+ done
+
+ reverse_sorted_linux_list=$l
+}
# Perform a reverse version sort on the entire xen_list and linux_list.
# Temporarily replace the '.old' suffix by ' 1' and append ' 2' for all
# other files to order the '.old' files after their non-old counterpart
# in reverse-sorted order.
reverse_sorted_xen_list=$(echo ${xen_list} | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -r | sed -e 's/ 1$/.old/; s/ 2$//')
+pre_sort
reverse_sorted_linux_list=$(echo ${linux_list} | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -r | sed -e 's/ 1$/.old/; s/ 2$//')
+post_sort
if [ "x$GRUB_TOP_LEVEL_XEN" != x ]; then
reverse_sorted_xen_list=$(grub_move_to_front "$GRUB_TOP_LEVEL_XEN" ${reverse_sorted_xen_list})