From 5200f60359bf6a19476f6ad1ee8fd252dff9fa16 Mon Sep 17 00:00:00 2001 From: Tianyu Chen Date: Mon, 18 Mar 2024 11:23:14 +0800 Subject: [PATCH] Do not use fwsetup --is-supported --- debian/changelog | 7 +++ .../patches/revert-fwsetup-is-supported.patch | 50 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 58 insertions(+) create mode 100644 debian/patches/revert-fwsetup-is-supported.patch diff --git a/debian/changelog b/debian/changelog index a650773..4540f96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grub2 (2.12-1deepin4) unstable; urgency=medium + + * Do not use fwsetup --is-supported. + Ref: https://github.com/linuxdeepin/developer-center/issues/7523 + + -- Tianyu Chen Mon, 18 Mar 2024 11:02:22 +0800 + grub2 (2.12-1deepin3) unstable; urgency=medium * remove loongarch64 patch. diff --git a/debian/patches/revert-fwsetup-is-supported.patch b/debian/patches/revert-fwsetup-is-supported.patch new file mode 100644 index 0000000..04a4c60 --- /dev/null +++ b/debian/patches/revert-fwsetup-is-supported.patch @@ -0,0 +1,50 @@ +Description: Do not use fwsetup --is-supported + fwsetup --is-supported is new in grub 2.12 +Author: Tianyu Chen +Origin: vendor +Bug-Deepin: https://github.com/linuxdeepin/developer-center/issues/7523 +Forwarded: not-needed +Last-Update: 2024-03-18 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/util/grub.d/30_uefi-firmware.in ++++ b/util/grub.d/30_uefi-firmware.in +@@ -33,22 +33,26 @@ + + . "$pkgdatadir/grub-mkconfig_lib" + +-LABEL="System Setup" ++EFI_VARS_DIR=/sys/firmware/efi/efivars ++EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c ++OS_INDICATIONS="$EFI_VARS_DIR/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE" + +-gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 ++if [ -e "$OS_INDICATIONS" ] && \ ++ [ "$(( $(printf 0x%x \'"$(cat $OS_INDICATIONS | cut -b5)"\') & 1 ))" = 1 ]; then ++ LABEL="UEFI Firmware Settings" + +-gettext_printf "System Setup" >/dev/null 2>&1 +-gettext_printf "UnionTech OS Restore" >/dev/null 2>&1 ++ gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 + +-if [ "x$hw_support" != x"true" ];then +-cat << EOF ++ gettext_printf "System Setup" >/dev/null 2>&1 ++ gettext_printf "UnionTech OS Restore" >/dev/null 2>&1 ++ ++ if [ "x$hw_support" != x"true" ];then ++ cat << EOF + if [ "\$grub_platform" = "efi" ]; then +- fwsetup --is-supported +- if [ "\$?" = 0 ]; then +- menuentry '$(gettext_printf "System Setup")' \$menuentry_id_option 'uefi-firmware' { +- fwsetup +- } +- fi ++menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { ++ fwsetup ++} + fi + EOF ++ fi + fi diff --git a/debian/patches/series b/debian/patches/series index ad7bd3c..c25ca16 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -93,3 +93,4 @@ uniontech0029-make-users-parameter-work-2.patch uniontech0034-enable-os-prober.patch fix-remove-system-setup-on-huawei-pc.patch uniontech0033-enable-grub-background-on-huawei-2 +revert-fwsetup-is-supported.patch