forked from pool/grub2
8ee92f5194
- 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
83 lines
2.7 KiB
Diff
83 lines
2.7 KiB
Diff
From b8457f2e271917c5c83a4fee286bafedf8c5790c Mon Sep 17 00:00:00 2001
|
|
From: Michael Chang <mchang@suse.com>
|
|
Date: Tue, 8 Aug 2023 17:57:24 +0800
|
|
Subject: [PATCH] Make grub.cfg compatible to old binaries
|
|
|
|
The new added fwsetup test in the topmost menu is always executed
|
|
regardless older grub may not be able to handle and thus trapped in a
|
|
boot loop between grub and fwsetup.
|
|
|
|
This in particular is to make sure a smooth transition if grub is rolled
|
|
back to older release and needs to boot newer snapshots.
|
|
|
|
Also removing dashes in the UUID that every version released in the wild
|
|
can handle.
|
|
|
|
Signed-off-by: Michael Chang <mchang@suse.com>
|
|
---
|
|
util/grub-probe.c | 20 +++++++++++++++++++-
|
|
util/grub.d/30_uefi-firmware.in | 16 ++++++++++------
|
|
2 files changed, 29 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/util/grub-probe.c b/util/grub-probe.c
|
|
index e7efcc268..99c738e44 100644
|
|
--- a/util/grub-probe.c
|
|
+++ b/util/grub-probe.c
|
|
@@ -290,8 +290,26 @@ probe_cryptodisk_uuid (grub_disk_t disk, char delim)
|
|
}
|
|
if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
|
|
{
|
|
+ grub_size_t i, j;
|
|
const char *uu = grub_util_cryptodisk_get_uuid (disk);
|
|
- grub_printf ("%s%c", uu, delim);
|
|
+ grub_size_t len = grub_strlen (uu);
|
|
+ char *p = grub_malloc (len + 1);
|
|
+
|
|
+ /* Removing dash in the UUID string
|
|
+ * This keeps old grub binary to work with newer config in a system,
|
|
+ * especially for snapshots. It is a temporary change to make sure smooth
|
|
+ * transition from 2.06 to 2.12-rc1 and this hunk can be removed
|
|
+ * after 2.12-rc1 release stablized.
|
|
+ */
|
|
+ for (i = 0, j = 0; i < len; i++)
|
|
+ {
|
|
+ if (uu[i] != '-')
|
|
+ p[j++] = uu[i];
|
|
+ }
|
|
+ p[j] = '\0';
|
|
+
|
|
+ grub_printf ("%s%c", p, delim);
|
|
+ grub_free (p);
|
|
}
|
|
}
|
|
|
|
diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in
|
|
index 1c2365ddb..96ff112e5 100644
|
|
--- a/util/grub.d/30_uefi-firmware.in
|
|
+++ b/util/grub.d/30_uefi-firmware.in
|
|
@@ -32,11 +32,15 @@ gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2
|
|
|
|
cat << EOF
|
|
if [ "\$grub_platform" = "efi" ]; then
|
|
- fwsetup --is-supported
|
|
- if [ "\$?" = 0 ]; then
|
|
- menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
|
|
- fwsetup
|
|
- }
|
|
- fi
|
|
+ menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
|
|
+ fwsetup --is-supported
|
|
+ if [ "\$?" = 0 ]; then
|
|
+ fwsetup
|
|
+ else
|
|
+ echo "Your firmware doesn't support setup menu entry from a boot loader"
|
|
+ echo "Press any key to return ..."
|
|
+ read
|
|
+ fi
|
|
+ }
|
|
fi
|
|
EOF
|
|
--
|
|
2.41.0
|
|
|