From 8a74d28ac85dff8c6c66ccb9b5d09479406eada4 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Thu, 17 Feb 2022 11:53:21 -0500 Subject: [PATCH] Life is pain, but especially when it's gnulib Signed-off-by: Robbie Harwood --- ...p-all-the-places-Wsign-compare-error.patch | 208 +---- 0121-Do-better-in-bootstrap.conf.patch | 28 - ...g-Update-comment-about-running-as-ro.patch | 0 0122-Use-git-to-apply-gnulib-patches.patch | 631 ------------- ...g-Write-new-env-to-tmpfile-and-then-.patch | 0 ...indeterminate-getting-set-on-boot_su.patch | 0 ... => 0124-Add-start-symbol-for-RISC-V.patch | 0 ...conf-Force-autogen.sh-to-use-python3.patch | 4 +- ...fw-http-_path-variables-to-make-them.patch | 0 ...-literal-IPv6-addresses-in-square-br.patch | 0 ...o-specify-a-port-number-in-addresses.patch | 0 ...mprove-check-to-detect-literal-IPv6-.patch | 0 ...debug-message-if-parsing-the-address.patch | 0 ...so-accept-F8-as-a-user-interrupt-key.patch | 0 ...se-address-before-jumping-to-the-PE-.patch | 0 ...ate-TPM-measurement-errors-to-the-ve.patch | 0 ...maximum-bounce-buffer-size-to-16-MiB.patch | 0 ...fix-when-the-HTTP-path-is-relative-a.patch | 0 ...turn-in-efi-export-env-and-efi-load-.patch | 0 ...p-fix-some-allocation-error-checking.patch | 0 ...p-fix-some-allocation-error-checking.patch | 0 ...g.c-fix-some-potential-allocation-ov.patch | 0 ...integer-overflows-in-grub_cmd_initrd.patch | 0 ...rnel-validation-without-shim-protoco.patch | 0 ...ar-pointers-in-grub-core-net-bootp.c.patch | 0 ...ointers-in-grub-core-net-efi-ip4_con.patch | 0 ...ointers-in-grub-core-net-efi-ip6_con.patch | 0 ...-pointers-in-grub-core-net-efi-net.c.patch | 0 ...-pointers-in-grub-core-net-efi-pxe.c.patch | 0 ...gration-scripts-to-make-systemctl-re.patch | 0 ...ion.sh-Also-set-old-menu_show_once-g.patch | 0 ...set-1-when-keyboard-is-in-Translate-.patch | 0 ...ll-disable-support-for-EFI-platforms.patch | 0 ...imestamps-configure-flag-to-prepend-.patch | 0 ...ements-to-grub_disk_open-and-grub_di.patch | 0 ...on-grub_debug_is_enabled-void-return.patch | 0 ...ear-screen-when-debugging-is-enabled.patch | 0 ..._-instrumentation-new-file-debug-tag.patch | 0 ...-Avoiding-many-unecessary-open-close.patch | 0 ...-implements-fibre-channel-discovery-.patch | 0 ...erpc-enables-device-mapper-discovery.patch | 0 ...fallback_set-var-to-force-the-set-ma.patch | 0 ...igning-grub-with-an-appended-signatu.patch | 0 ...rub-Document-signing-grub-under-UEFI.patch | 0 ...nt-signing-grub-with-an-appended-sig.patch | 0 ...e-grub_dl_set_persistent-for-the-emu.patch | 0 ...patch => 0164-pgp-factor-out-rsa_pad.patch | 0 ...rage-for-grub_crypto_pk_-to-crypto.c.patch | 0 ...p-tweaks-in-preparation-for-libtasn1.patch | 0 ...0167-libtasn1-import-libtasn1-4.16.0.patch | 0 ...asn1-disable-code-not-needed-in-grub.patch | 0 ...tasn1-changes-for-grub-compatibility.patch | 0 ...70-libtasn1-compile-into-asn1-module.patch | 0 ...1-test_asn1-test-module-for-libtasn1.patch | 0 ...-support-embedding-x509-certificates.patch | 0 ...res-import-GNUTLS-s-ASN.1-descriptio.patch | 0 ...res-parse-PKCS-7-signedData-and-X.50.patch | 0 ...res-support-verifying-appended-signa.patch | 0 ...pended-signatures-verification-tests.patch | 0 ...77-appended-signatures-documentation.patch | 0 ...er-lockdown-based-on-ibm-secure-boot.patch | 0 ...275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch | 0 ...h => 0180-ieee1275-claim-more-memory.patch | 0 ...-memory-with-ibm-client-architecture.patch | 0 ...-Also-handle-the-Extended-Key-Usage-.patch | 0 ...eee1275-ofdisk-retry-on-open-failure.patch | 0 ...ainloading-EFI-apps-from-loop-mounts.patch | 0 ...> 0185-efinet-Add-DHCP-proxy-support.patch | 0 ...gnore-checksum-seed-incompat-feature.patch | 0 ...-cmdline-when-generating-legacy-menu.patch | 0 ... 0188-Suppress-gettext-error-message.patch | 0 ...d-Always-use-boot-grub2-user.cfg-as-.patch | 0 ...for-EFI-at-runtime-instead-of-config.patch | 0 ...or-if-boot-to-firmware-setup-is-not-.patch | 0 ...x-EFI-loader-kernel-image-allocation.patch | 0 ...over-the-device-to-read-the-config-f.patch | 0 ...etting-of-prefix-for-signed-binary-c.patch | 0 ...adable-filesystem-with-v4-superblock.patch | 0 ...module-name-on-license-check-failure.patch | 0 ...pc-ieee1275-load-grub-at-4MB-not-2MB.patch | 0 ...-mkconfig-restore-umask-for-grub.cfg.patch | 0 ...btrfs-Use-full-btrfs-bootloader-area.patch | 0 ...-Fedora-location-of-DejaVu-SANS-font.patch | 0 ...t-show-Booting-s-msg-when-auto-booti.patch | 90 ++ ...-Welcome-to-GRUB-message-in-EFI-buil.patch | 41 + ...ot-set-colorstate-until-the-first-te.patch | 51 ++ ...ot-set-cursor-until-the-first-text-o.patch | 71 ++ ...se-visual-indentation-in-config.h.in.patch | 93 ++ ...sure-config-util.h-precedes-config.h.patch | 275 ++++++ 0207-Drop-gnulib-fix-base64.patch.patch | 140 +++ 0208-Drop-gnulib-no-abort.patch.patch | 97 ++ ...version-and-drop-most-gnulib-patches.patch | 832 ++++++++++++++++++ do-rebase | 14 - grub.macros | 10 +- grub.patches | 171 ++-- grub2.spec | 9 +- 96 files changed, 1806 insertions(+), 959 deletions(-) delete mode 100644 0121-Do-better-in-bootstrap.conf.patch rename 0123-grub-set-bootflag-Update-comment-about-running-as-ro.patch => 0121-grub-set-bootflag-Update-comment-about-running-as-ro.patch (100%) delete mode 100644 0122-Use-git-to-apply-gnulib-patches.patch rename 0124-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch => 0122-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch (100%) rename 0125-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch => 0123-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch (100%) rename 0126-Add-start-symbol-for-RISC-V.patch => 0124-Add-start-symbol-for-RISC-V.patch (100%) rename 0127-bootstrap.conf-Force-autogen.sh-to-use-python3.patch => 0125-bootstrap.conf-Force-autogen.sh-to-use-python3.patch (92%) rename 0128-efi-http-Export-fw-http-_path-variables-to-make-them.patch => 0126-efi-http-Export-fw-http-_path-variables-to-make-them.patch (100%) rename 0129-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch => 0127-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch (100%) rename 0130-efi-net-Allow-to-specify-a-port-number-in-addresses.patch => 0128-efi-net-Allow-to-specify-a-port-number-in-addresses.patch (100%) rename 0131-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch => 0129-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch (100%) rename 0132-efi-net-Print-a-debug-message-if-parsing-the-address.patch => 0130-efi-net-Print-a-debug-message-if-parsing-the-address.patch (100%) rename 0133-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch => 0131-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch (100%) rename 0134-efi-Set-image-base-address-before-jumping-to-the-PE-.patch => 0132-efi-Set-image-base-address-before-jumping-to-the-PE-.patch (100%) rename 0135-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch => 0133-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch (100%) rename 0136-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch => 0134-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch (100%) rename 0137-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch => 0135-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch (100%) rename 0138-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch => 0136-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch (100%) rename 0139-efi-dhcp-fix-some-allocation-error-checking.patch => 0137-efi-dhcp-fix-some-allocation-error-checking.patch (100%) rename 0140-efi-http-fix-some-allocation-error-checking.patch => 0138-efi-http-fix-some-allocation-error-checking.patch (100%) rename 0141-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch => 0139-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch (100%) rename 0142-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch => 0140-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch (100%) rename 0143-linuxefi-fail-kernel-validation-without-shim-protoco.patch => 0141-linuxefi-fail-kernel-validation-without-shim-protoco.patch (100%) rename 0144-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch => 0142-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch (100%) rename 0145-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch => 0143-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch (100%) rename 0146-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch => 0144-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch (100%) rename 0147-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch => 0145-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch (100%) rename 0148-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch => 0146-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch (100%) rename 0149-Add-systemd-integration-scripts-to-make-systemctl-re.patch => 0147-Add-systemd-integration-scripts-to-make-systemctl-re.patch (100%) rename 0150-systemd-integration.sh-Also-set-old-menu_show_once-g.patch => 0148-systemd-integration.sh-Also-set-old-menu_show_once-g.patch (100%) rename 0151-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch => 0149-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch (100%) rename 0152-grub-install-disable-support-for-EFI-platforms.patch => 0150-grub-install-disable-support-for-EFI-platforms.patch (100%) rename 0153-New-with-debug-timestamps-configure-flag-to-prepend-.patch => 0151-New-with-debug-timestamps-configure-flag-to-prepend-.patch (100%) rename 0154-Added-debug-statements-to-grub_disk_open-and-grub_di.patch => 0152-Added-debug-statements-to-grub_disk_open-and-grub_di.patch (100%) rename 0155-Introduce-function-grub_debug_is_enabled-void-return.patch => 0153-Introduce-function-grub_debug_is_enabled-void-return.patch (100%) rename 0156-Don-t-clear-screen-when-debugging-is-enabled.patch => 0154-Don-t-clear-screen-when-debugging-is-enabled.patch (100%) rename 0157-grub_file_-instrumentation-new-file-debug-tag.patch => 0155-grub_file_-instrumentation-new-file-debug-tag.patch (100%) rename 0158-ieee1275-Avoiding-many-unecessary-open-close.patch => 0156-ieee1275-Avoiding-many-unecessary-open-close.patch (100%) rename 0159-ieee1275-powerpc-implements-fibre-channel-discovery-.patch => 0157-ieee1275-powerpc-implements-fibre-channel-discovery-.patch (100%) rename 0160-ieee1275-powerpc-enables-device-mapper-discovery.patch => 0158-ieee1275-powerpc-enables-device-mapper-discovery.patch (100%) rename 0161-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch => 0159-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch (100%) rename 0162-Add-suport-for-signing-grub-with-an-appended-signatu.patch => 0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch (100%) rename 0163-docs-grub-Document-signing-grub-under-UEFI.patch => 0161-docs-grub-Document-signing-grub-under-UEFI.patch (100%) rename 0164-docs-grub-Document-signing-grub-with-an-appended-sig.patch => 0162-docs-grub-Document-signing-grub-with-an-appended-sig.patch (100%) rename 0165-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch => 0163-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch (100%) rename 0166-pgp-factor-out-rsa_pad.patch => 0164-pgp-factor-out-rsa_pad.patch (100%) rename 0167-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch => 0165-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch (100%) rename 0168-posix_wrap-tweaks-in-preparation-for-libtasn1.patch => 0166-posix_wrap-tweaks-in-preparation-for-libtasn1.patch (100%) rename 0169-libtasn1-import-libtasn1-4.16.0.patch => 0167-libtasn1-import-libtasn1-4.16.0.patch (100%) rename 0170-libtasn1-disable-code-not-needed-in-grub.patch => 0168-libtasn1-disable-code-not-needed-in-grub.patch (100%) rename 0171-libtasn1-changes-for-grub-compatibility.patch => 0169-libtasn1-changes-for-grub-compatibility.patch (100%) rename 0172-libtasn1-compile-into-asn1-module.patch => 0170-libtasn1-compile-into-asn1-module.patch (100%) rename 0173-test_asn1-test-module-for-libtasn1.patch => 0171-test_asn1-test-module-for-libtasn1.patch (100%) rename 0174-grub-install-support-embedding-x509-certificates.patch => 0172-grub-install-support-embedding-x509-certificates.patch (100%) rename 0175-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch => 0173-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch (100%) rename 0176-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch => 0174-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch (100%) rename 0177-appended-signatures-support-verifying-appended-signa.patch => 0175-appended-signatures-support-verifying-appended-signa.patch (100%) rename 0178-appended-signatures-verification-tests.patch => 0176-appended-signatures-verification-tests.patch (100%) rename 0179-appended-signatures-documentation.patch => 0177-appended-signatures-documentation.patch (100%) rename 0180-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch => 0178-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch (100%) rename 0181-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch => 0179-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch (100%) rename 0182-ieee1275-claim-more-memory.patch => 0180-ieee1275-claim-more-memory.patch (100%) rename 0183-ieee1275-request-memory-with-ibm-client-architecture.patch => 0181-ieee1275-request-memory-with-ibm-client-architecture.patch (100%) rename 0184-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch => 0182-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch (100%) rename 0185-ieee1275-ofdisk-retry-on-open-failure.patch => 0183-ieee1275-ofdisk-retry-on-open-failure.patch (100%) rename 0186-Allow-chainloading-EFI-apps-from-loop-mounts.patch => 0184-Allow-chainloading-EFI-apps-from-loop-mounts.patch (100%) rename 0187-efinet-Add-DHCP-proxy-support.patch => 0185-efinet-Add-DHCP-proxy-support.patch (100%) rename 0188-fs-ext2-Ignore-checksum-seed-incompat-feature.patch => 0186-fs-ext2-Ignore-checksum-seed-incompat-feature.patch (100%) rename 0189-Don-t-update-the-cmdline-when-generating-legacy-menu.patch => 0187-Don-t-update-the-cmdline-when-generating-legacy-menu.patch (100%) rename 0190-Suppress-gettext-error-message.patch => 0188-Suppress-gettext-error-message.patch (100%) rename 0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch => 0189-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch (100%) rename 0192-templates-Check-for-EFI-at-runtime-instead-of-config.patch => 0190-templates-Check-for-EFI-at-runtime-instead-of-config.patch (100%) rename 0193-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch => 0191-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch (100%) rename 0194-arm64-Fix-EFI-loader-kernel-image-allocation.patch => 0192-arm64-Fix-EFI-loader-kernel-image-allocation.patch (100%) rename 0195-normal-main-Discover-the-device-to-read-the-config-f.patch => 0193-normal-main-Discover-the-device-to-read-the-config-f.patch (100%) rename 0196-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch => 0194-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch (100%) rename 0197-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch => 0195-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch (100%) rename 0198-Print-module-name-on-license-check-failure.patch => 0196-Print-module-name-on-license-check-failure.patch (100%) rename 0199-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch => 0197-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch (100%) rename 0200-grub-mkconfig-restore-umask-for-grub.cfg.patch => 0198-grub-mkconfig-restore-umask-for-grub.cfg.patch (100%) rename 0201-fs-btrfs-Use-full-btrfs-bootloader-area.patch => 0199-fs-btrfs-Use-full-btrfs-bootloader-area.patch (100%) rename 0202-Add-Fedora-location-of-DejaVu-SANS-font.patch => 0200-Add-Fedora-location-of-DejaVu-SANS-font.patch (100%) create mode 100644 0201-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch create mode 100644 0202-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch create mode 100644 0203-EFI-console-Do-not-set-colorstate-until-the-first-te.patch create mode 100644 0204-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch create mode 100644 0205-Use-visual-indentation-in-config.h.in.patch create mode 100644 0206-Where-present-ensure-config-util.h-precedes-config.h.patch create mode 100644 0207-Drop-gnulib-fix-base64.patch.patch create mode 100644 0208-Drop-gnulib-no-abort.patch.patch create mode 100644 0209-Update-gnulib-version-and-drop-most-gnulib-patches.patch diff --git a/0103-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch b/0103-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch index c2f2a59..e6cd8b4 100644 --- a/0103-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch +++ b/0103-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch @@ -5,21 +5,18 @@ Subject: [PATCH] Attempt to fix up all the places -Wsign-compare=error finds. Signed-off-by: Peter Jones --- - grub-core/kern/emu/misc.c | 2 +- - grub-core/lib/reed_solomon.c | 4 +- - grub-core/osdep/linux/blocklist.c | 2 +- - grub-core/osdep/linux/getroot.c | 2 +- - grub-core/osdep/linux/hostdisk.c | 2 +- - util/grub-fstest.c | 2 +- - util/grub-menulst2cfg.c | 2 +- - util/grub-mkfont.c | 13 +- - util/grub-probe.c | 2 +- - util/grub-rpm-sort.c | 2 +- - util/setup.c | 2 +- - bootstrap.conf | 3 +- - .../gnulib-patches/fix-sign-compare-errors.patch | 161 +++++++++++++++++++++ - 13 files changed, 181 insertions(+), 18 deletions(-) - create mode 100644 grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch + grub-core/kern/emu/misc.c | 2 +- + grub-core/lib/reed_solomon.c | 4 ++-- + grub-core/osdep/linux/blocklist.c | 2 +- + grub-core/osdep/linux/getroot.c | 2 +- + grub-core/osdep/linux/hostdisk.c | 2 +- + util/grub-fstest.c | 2 +- + util/grub-menulst2cfg.c | 2 +- + util/grub-mkfont.c | 13 +++++++------ + util/grub-probe.c | 2 +- + util/grub-rpm-sort.c | 2 +- + util/setup.c | 2 +- + 11 files changed, 18 insertions(+), 17 deletions(-) diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index eeea092752d..f08a1bb8415 100644 @@ -214,184 +211,3 @@ index da5f2c07f50..8b22bb8ccac 100644 grub_fs_t fs; unsigned int nsec, maxsec; -diff --git a/bootstrap.conf b/bootstrap.conf -index 6b043fc354c..186be9c48ce 100644 ---- a/bootstrap.conf -+++ b/bootstrap.conf -@@ -80,7 +80,8 @@ cp -a INSTALL INSTALL.grub - bootstrap_post_import_hook () { - set -e - for patchname in fix-base64 fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ -- fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort; do -+ fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort \ -+ fix-sign-compare-errors; do - patch -d grub-core/lib/gnulib -p2 \ - < "grub-core/lib/gnulib-patches/$patchname.patch" - done -diff --git a/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch b/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch -new file mode 100644 -index 00000000000..479029c0565 ---- /dev/null -+++ b/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch -@@ -0,0 +1,161 @@ -+diff --git a/lib/regcomp.c b/lib/regcomp.c -+index cc85f35ac58..361079d82d6 100644 -+--- a/lib/regcomp.c -++++ b/lib/regcomp.c -+@@ -322,7 +322,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, -+ *p++ = dfa->nodes[node].opr.c; -+ memset (&state, '\0', sizeof (state)); -+ if (__mbrtowc (&wc, (const char *) buf, p - buf, -+- &state) == p - buf -++ &state) == (size_t)(p - buf) -+ && (__wcrtomb ((char *) buf, __towlower (wc), &state) -+ != (size_t) -1)) -+ re_set_fastmap (fastmap, false, buf[0]); -+@@ -3778,7 +3778,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) -+ num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2) -+ ? -2 -+ : num == -1 -+- ? c - '0' -++ ? (Idx)(c - '0') -+ : MIN (RE_DUP_MAX + 1, num * 10 + c - '0')); -+ } -+ return num; -+diff --git a/lib/regex_internal.c b/lib/regex_internal.c -+index 9004ce809eb..193a1e3d332 100644 -+--- a/lib/regex_internal.c -++++ b/lib/regex_internal.c -+@@ -233,7 +233,7 @@ build_wcs_buffer (re_string_t *pstr) -+ /* Apply the translation if we need. */ -+ if (__glibc_unlikely (pstr->trans != NULL)) -+ { -+- int i, ch; -++ unsigned int i, ch; -+ -+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) -+ { -+@@ -376,7 +376,7 @@ build_wcs_upper_buffer (re_string_t *pstr) -+ prev_st = pstr->cur_state; -+ if (__glibc_unlikely (pstr->trans != NULL)) -+ { -+- int i, ch; -++ unsigned int i, ch; -+ -+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) -+ { -+@@ -754,7 +754,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) -+ memset (&cur_state, 0, sizeof (cur_state)); -+ mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, -+ &cur_state); -+- if (raw + offset - p <= mbclen -++ if ((size_t)(raw + offset - p) <= mbclen -+ && mbclen < (size_t) -2) -+ { -+ memset (&pstr->cur_state, '\0', -+diff --git a/lib/regex_internal.h b/lib/regex_internal.h -+index 5462419b787..e0f8292395d 100644 -+--- a/lib/regex_internal.h -++++ b/lib/regex_internal.h -+@@ -425,7 +425,7 @@ struct re_string_t -+ unsigned char offsets_needed; -+ unsigned char newline_anchor; -+ unsigned char word_ops_used; -+- int mb_cur_max; -++ unsigned int mb_cur_max; -+ }; -+ typedef struct re_string_t re_string_t; -+ -+@@ -702,7 +702,7 @@ struct re_dfa_t -+ unsigned int is_utf8 : 1; -+ unsigned int map_notascii : 1; -+ unsigned int word_ops_used : 1; -+- int mb_cur_max; -++ unsigned int mb_cur_max; -+ bitset_t word_char; -+ reg_syntax_t syntax; -+ Idx *subexp_map; -+diff --git a/lib/regexec.c b/lib/regexec.c -+index 0a7a27b772e..b57d4f9141d 100644 -+--- a/lib/regexec.c -++++ b/lib/regexec.c -+@@ -443,7 +443,7 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, -+ { -+ if (ret_len) -+ { -+- assert (pmatch[0].rm_so == start); -++ assert (pmatch[0].rm_so == (long)start); -+ rval = pmatch[0].rm_eo - start; -+ } -+ else -+@@ -877,11 +877,11 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, -+ if (__glibc_unlikely (mctx.input.offsets_needed != 0)) -+ { -+ pmatch[reg_idx].rm_so = -+- (pmatch[reg_idx].rm_so == mctx.input.valid_len -++ (pmatch[reg_idx].rm_so == (long)mctx.input.valid_len -+ ? mctx.input.valid_raw_len -+ : mctx.input.offsets[pmatch[reg_idx].rm_so]); -+ pmatch[reg_idx].rm_eo = -+- (pmatch[reg_idx].rm_eo == mctx.input.valid_len -++ (pmatch[reg_idx].rm_eo == (long)mctx.input.valid_len -+ ? mctx.input.valid_raw_len -+ : mctx.input.offsets[pmatch[reg_idx].rm_eo]); -+ } -+@@ -1418,11 +1418,11 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, -+ } -+ memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); -+ -+- for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;) -++ for (idx = pmatch[0].rm_so; idx <= (long)pmatch[0].rm_eo ;) -+ { -+ update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch); -+ -+- if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) -++ if (idx == (long)pmatch[0].rm_eo && cur_node == mctx->last_node) -+ { -+ Idx reg_idx; -+ if (fs) -+@@ -1519,7 +1519,7 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, -+ if (reg_num < nmatch) -+ { -+ /* We are at the last node of this sub expression. */ -+- if (pmatch[reg_num].rm_so < cur_idx) -++ if (pmatch[reg_num].rm_so < (long)cur_idx) -+ { -+ pmatch[reg_num].rm_eo = cur_idx; -+ /* This is a non-empty match or we are not inside an optional -+@@ -2938,7 +2938,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node, -+ mctx->state_log[str_idx] = cur_state; -+ } -+ -+- for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) -++ for (null_cnt = 0; str_idx < last_str && null_cnt <= (long)mctx->max_mb_elem_len;) -+ { -+ re_node_set_empty (&next_nodes); -+ if (mctx->state_log[str_idx + 1]) -+@@ -3718,7 +3718,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, -+ const re_string_t *input, Idx str_idx) -+ { -+ const re_token_t *node = dfa->nodes + node_idx; -+- int char_len, elem_len; -++ unsigned int char_len, elem_len; -+ Idx i; -+ -+ if (__glibc_unlikely (node->type == OP_UTF8_PERIOD)) -+@@ -4066,7 +4066,7 @@ extend_buffers (re_match_context_t *mctx, int min_len) -+ /* Double the lengths of the buffers, but allocate at least MIN_LEN. */ -+ ret = re_string_realloc_buffers (pstr, -+ MAX (min_len, -+- MIN (pstr->len, pstr->bufs_len * 2))); -++ MIN ((long)pstr->len, pstr->bufs_len * 2))); -+ if (__glibc_unlikely (ret != REG_NOERROR)) -+ return ret; -+ -+@@ -4236,7 +4236,7 @@ match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from, -+ = (from == to ? -1 : 0); -+ -+ mctx->bkref_ents[mctx->nbkref_ents++].more = 0; -+- if (mctx->max_mb_elem_len < to - from) -++ if (mctx->max_mb_elem_len < (long)(to - from)) -+ mctx->max_mb_elem_len = to - from; -+ return REG_NOERROR; -+ } diff --git a/0121-Do-better-in-bootstrap.conf.patch b/0121-Do-better-in-bootstrap.conf.patch deleted file mode 100644 index ec9d8ec..0000000 --- a/0121-Do-better-in-bootstrap.conf.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 29 Jul 2019 10:58:52 -0400 -Subject: [PATCH] Do better in bootstrap.conf - ---- - bootstrap.conf | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/bootstrap.conf b/bootstrap.conf -index 186be9c48ce..9259526e891 100644 ---- a/bootstrap.conf -+++ b/bootstrap.conf -@@ -16,7 +16,13 @@ - # along with this program. If not, see . - - --GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 -+# GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 -+if [[ -z "${GNULIB_REVISION}" ]] ;then -+ GNULIB_REVISION=fixes -+fi -+if [[ -z "${GNULIB_URL}" ]] ;then -+ GNULIB_URL=https://github.com/rhboot/gnulib.git -+fi - - # gnulib modules used by this package. - # mbswidth is used by gnulib-fix-width.diff's changes to argp rather than diff --git a/0123-grub-set-bootflag-Update-comment-about-running-as-ro.patch b/0121-grub-set-bootflag-Update-comment-about-running-as-ro.patch similarity index 100% rename from 0123-grub-set-bootflag-Update-comment-about-running-as-ro.patch rename to 0121-grub-set-bootflag-Update-comment-about-running-as-ro.patch diff --git a/0122-Use-git-to-apply-gnulib-patches.patch b/0122-Use-git-to-apply-gnulib-patches.patch deleted file mode 100644 index 7654648..0000000 --- a/0122-Use-git-to-apply-gnulib-patches.patch +++ /dev/null @@ -1,631 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 29 Jul 2019 11:21:27 -0400 -Subject: [PATCH] Use git to apply gnulib patches. - -Signed-off-by: Peter Jones ---- - bootstrap.conf | 6 - - conf/Makefile.extra-dist | 10 - - grub-core/lib/gnulib-patches/fix-base64.patch | 21 -- - grub-core/lib/gnulib-patches/fix-null-deref.patch | 13 -- - .../lib/gnulib-patches/fix-null-state-deref.patch | 12 -- - .../gnulib-patches/fix-regcomp-uninit-token.patch | 15 -- - .../gnulib-patches/fix-regexec-null-deref.patch | 12 -- - .../gnulib-patches/fix-sign-compare-errors.patch | 161 --------------- - .../lib/gnulib-patches/fix-uninit-structure.patch | 11 -- - .../lib/gnulib-patches/fix-unused-value.patch | 14 -- - grub-core/lib/gnulib-patches/fix-width.patch | 217 --------------------- - grub-core/lib/gnulib-patches/no-abort.patch | 26 --- - 12 files changed, 518 deletions(-) - delete mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-null-deref.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch - delete mode 100644 grub-core/lib/gnulib-patches/fix-width.patch - delete mode 100644 grub-core/lib/gnulib-patches/no-abort.patch - -diff --git a/bootstrap.conf b/bootstrap.conf -index 9259526e891..452f4d79b0d 100644 ---- a/bootstrap.conf -+++ b/bootstrap.conf -@@ -85,12 +85,6 @@ cp -a INSTALL INSTALL.grub - - bootstrap_post_import_hook () { - set -e -- for patchname in fix-base64 fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ -- fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort \ -- fix-sign-compare-errors; do -- patch -d grub-core/lib/gnulib -p2 \ -- < "grub-core/lib/gnulib-patches/$patchname.patch" -- done - for patchname in \ - 0001-Support-POTFILES-shell \ - 0002-Handle-gettext_printf-shell-function \ -diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index ea58362b555..8ddf22e6c99 100644 ---- a/conf/Makefile.extra-dist -+++ b/conf/Makefile.extra-dist -@@ -30,16 +30,6 @@ EXTRA_DIST += grub-core/gensymlist.sh - EXTRA_DIST += grub-core/genemuinit.sh - EXTRA_DIST += grub-core/genemuinitheader.sh - --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-base64.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch --EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch -- - EXTRA_DIST += grub-core/lib/libgcrypt - EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic - EXTRA_DIST += $(shell find $(top_srcdir)/include -name '*.h') -diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/lib/gnulib-patches/fix-base64.patch -deleted file mode 100644 -index 985db127971..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-base64.patch -+++ /dev/null -@@ -1,21 +0,0 @@ --diff --git a/lib/base64.h b/lib/base64.h --index 9cd0183b8..185a2afa1 100644 ----- a/lib/base64.h --+++ b/lib/base64.h --@@ -21,8 +21,14 @@ -- /* Get size_t. */ -- # include -- ---/* Get bool. */ ---# include --+#ifndef GRUB_POSIX_BOOL_DEFINED --+typedef enum { false = 0, true = 1 } bool; --+#define GRUB_POSIX_BOOL_DEFINED 1 --+#endif --+ --+#ifndef _GL_ATTRIBUTE_CONST --+# define _GL_ATTRIBUTE_CONST /* empty */ --+#endif -- -- # ifdef __cplusplus -- extern "C" { -diff --git a/grub-core/lib/gnulib-patches/fix-null-deref.patch b/grub-core/lib/gnulib-patches/fix-null-deref.patch -deleted file mode 100644 -index 8fafa153a47..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-null-deref.patch -+++ /dev/null -@@ -1,13 +0,0 @@ --diff --git a/lib/argp-parse.c b/lib/argp-parse.c --index 6dec57310..900adad54 100644 ----- a/lib/argp-parse.c --+++ b/lib/argp-parse.c --@@ -940,7 +940,7 @@ weak_alias (__argp_parse, argp_parse) -- void * -- __argp_input (const struct argp *argp, const struct argp_state *state) -- { --- if (state) --+ if (state && state->pstate) -- { -- struct group *group; -- struct parser *parser = state->pstate; -diff --git a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch -deleted file mode 100644 -index 813ec09c8a1..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch -+++ /dev/null -@@ -1,12 +0,0 @@ ----- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000 --+++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000 --@@ -145,7 +145,8 @@ -- if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) -- { -- __argp_failure (state, 0, 0, --- dgettext (state->root_argp->argp_domain, --+ dgettext (state == NULL ? NULL --+ : state->root_argp->argp_domain, -- "\ -- ARGP_HELP_FMT: %s value is less than or equal to %s"), -- "rmargin", up->name); -diff --git a/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch b/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch -deleted file mode 100644 -index 02e06315dff..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch -+++ /dev/null -@@ -1,15 +0,0 @@ ----- a/lib/regcomp.c 2020-11-24 17:06:08.159223858 +0000 --+++ b/lib/regcomp.c 2020-11-24 17:06:15.630253923 +0000 --@@ -3808,11 +3808,7 @@ -- create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, -- re_token_type_t type) -- { --- re_token_t t; ---#if defined GCC_LINT || defined lint --- memset (&t, 0, sizeof t); ---#endif --- t.type = type; --+ re_token_t t = { .type = type }; -- return create_token_tree (dfa, left, right, &t); -- } -- -diff --git a/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch b/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch -deleted file mode 100644 -index db6dac9c9e3..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch -+++ /dev/null -@@ -1,12 +0,0 @@ ----- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 --+++ b/lib/regexec.c 2020-11-05 10:55:09.621542984 +0000 --@@ -1692,6 +1692,9 @@ -- { -- Idx top = mctx->state_log_top; -- --+ if (mctx->state_log == NULL) --+ return REG_NOERROR; --+ -- if ((next_state_log_idx >= mctx->input.bufs_len -- && mctx->input.bufs_len < mctx->input.len) -- || (next_state_log_idx >= mctx->input.valid_len -diff --git a/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch b/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch -deleted file mode 100644 -index 479029c0565..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-sign-compare-errors.patch -+++ /dev/null -@@ -1,161 +0,0 @@ --diff --git a/lib/regcomp.c b/lib/regcomp.c --index cc85f35ac58..361079d82d6 100644 ----- a/lib/regcomp.c --+++ b/lib/regcomp.c --@@ -322,7 +322,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, -- *p++ = dfa->nodes[node].opr.c; -- memset (&state, '\0', sizeof (state)); -- if (__mbrtowc (&wc, (const char *) buf, p - buf, --- &state) == p - buf --+ &state) == (size_t)(p - buf) -- && (__wcrtomb ((char *) buf, __towlower (wc), &state) -- != (size_t) -1)) -- re_set_fastmap (fastmap, false, buf[0]); --@@ -3778,7 +3778,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) -- num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2) -- ? -2 -- : num == -1 --- ? c - '0' --+ ? (Idx)(c - '0') -- : MIN (RE_DUP_MAX + 1, num * 10 + c - '0')); -- } -- return num; --diff --git a/lib/regex_internal.c b/lib/regex_internal.c --index 9004ce809eb..193a1e3d332 100644 ----- a/lib/regex_internal.c --+++ b/lib/regex_internal.c --@@ -233,7 +233,7 @@ build_wcs_buffer (re_string_t *pstr) -- /* Apply the translation if we need. */ -- if (__glibc_unlikely (pstr->trans != NULL)) -- { --- int i, ch; --+ unsigned int i, ch; -- -- for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) -- { --@@ -376,7 +376,7 @@ build_wcs_upper_buffer (re_string_t *pstr) -- prev_st = pstr->cur_state; -- if (__glibc_unlikely (pstr->trans != NULL)) -- { --- int i, ch; --+ unsigned int i, ch; -- -- for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) -- { --@@ -754,7 +754,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) -- memset (&cur_state, 0, sizeof (cur_state)); -- mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, -- &cur_state); --- if (raw + offset - p <= mbclen --+ if ((size_t)(raw + offset - p) <= mbclen -- && mbclen < (size_t) -2) -- { -- memset (&pstr->cur_state, '\0', --diff --git a/lib/regex_internal.h b/lib/regex_internal.h --index 5462419b787..e0f8292395d 100644 ----- a/lib/regex_internal.h --+++ b/lib/regex_internal.h --@@ -425,7 +425,7 @@ struct re_string_t -- unsigned char offsets_needed; -- unsigned char newline_anchor; -- unsigned char word_ops_used; --- int mb_cur_max; --+ unsigned int mb_cur_max; -- }; -- typedef struct re_string_t re_string_t; -- --@@ -702,7 +702,7 @@ struct re_dfa_t -- unsigned int is_utf8 : 1; -- unsigned int map_notascii : 1; -- unsigned int word_ops_used : 1; --- int mb_cur_max; --+ unsigned int mb_cur_max; -- bitset_t word_char; -- reg_syntax_t syntax; -- Idx *subexp_map; --diff --git a/lib/regexec.c b/lib/regexec.c --index 0a7a27b772e..b57d4f9141d 100644 ----- a/lib/regexec.c --+++ b/lib/regexec.c --@@ -443,7 +443,7 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, -- { -- if (ret_len) -- { --- assert (pmatch[0].rm_so == start); --+ assert (pmatch[0].rm_so == (long)start); -- rval = pmatch[0].rm_eo - start; -- } -- else --@@ -877,11 +877,11 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, -- if (__glibc_unlikely (mctx.input.offsets_needed != 0)) -- { -- pmatch[reg_idx].rm_so = --- (pmatch[reg_idx].rm_so == mctx.input.valid_len --+ (pmatch[reg_idx].rm_so == (long)mctx.input.valid_len -- ? mctx.input.valid_raw_len -- : mctx.input.offsets[pmatch[reg_idx].rm_so]); -- pmatch[reg_idx].rm_eo = --- (pmatch[reg_idx].rm_eo == mctx.input.valid_len --+ (pmatch[reg_idx].rm_eo == (long)mctx.input.valid_len -- ? mctx.input.valid_raw_len -- : mctx.input.offsets[pmatch[reg_idx].rm_eo]); -- } --@@ -1418,11 +1418,11 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, -- } -- memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); -- --- for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;) --+ for (idx = pmatch[0].rm_so; idx <= (long)pmatch[0].rm_eo ;) -- { -- update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch); -- --- if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) --+ if (idx == (long)pmatch[0].rm_eo && cur_node == mctx->last_node) -- { -- Idx reg_idx; -- if (fs) --@@ -1519,7 +1519,7 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, -- if (reg_num < nmatch) -- { -- /* We are at the last node of this sub expression. */ --- if (pmatch[reg_num].rm_so < cur_idx) --+ if (pmatch[reg_num].rm_so < (long)cur_idx) -- { -- pmatch[reg_num].rm_eo = cur_idx; -- /* This is a non-empty match or we are not inside an optional --@@ -2938,7 +2938,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node, -- mctx->state_log[str_idx] = cur_state; -- } -- --- for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) --+ for (null_cnt = 0; str_idx < last_str && null_cnt <= (long)mctx->max_mb_elem_len;) -- { -- re_node_set_empty (&next_nodes); -- if (mctx->state_log[str_idx + 1]) --@@ -3718,7 +3718,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, -- const re_string_t *input, Idx str_idx) -- { -- const re_token_t *node = dfa->nodes + node_idx; --- int char_len, elem_len; --+ unsigned int char_len, elem_len; -- Idx i; -- -- if (__glibc_unlikely (node->type == OP_UTF8_PERIOD)) --@@ -4066,7 +4066,7 @@ extend_buffers (re_match_context_t *mctx, int min_len) -- /* Double the lengths of the buffers, but allocate at least MIN_LEN. */ -- ret = re_string_realloc_buffers (pstr, -- MAX (min_len, --- MIN (pstr->len, pstr->bufs_len * 2))); --+ MIN ((long)pstr->len, pstr->bufs_len * 2))); -- if (__glibc_unlikely (ret != REG_NOERROR)) -- return ret; -- --@@ -4236,7 +4236,7 @@ match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from, -- = (from == to ? -1 : 0); -- -- mctx->bkref_ents[mctx->nbkref_ents++].more = 0; --- if (mctx->max_mb_elem_len < to - from) --+ if (mctx->max_mb_elem_len < (long)(to - from)) -- mctx->max_mb_elem_len = to - from; -- return REG_NOERROR; -- } -diff --git a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch -deleted file mode 100644 -index 7b4d9f67af4..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch -+++ /dev/null -@@ -1,11 +0,0 @@ ----- a/lib/regcomp.c 2020-10-22 13:49:06.770168928 +0000 --+++ b/lib/regcomp.c 2020-10-22 13:50:37.026528298 +0000 --@@ -3662,7 +3662,7 @@ -- Idx alloc = 0; -- #endif /* not RE_ENABLE_I18N */ -- reg_errcode_t ret; --- re_token_t br_token; --+ re_token_t br_token = {0}; -- bin_tree_t *tree; -- -- sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); -diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch -deleted file mode 100644 -index ba51f1bf223..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-unused-value.patch -+++ /dev/null -@@ -1,14 +0,0 @@ ----- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 --+++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000 --@@ -828,7 +828,11 @@ -- break; -- if (__glibc_unlikely (err != REG_NOMATCH)) -- goto free_return; --+#ifdef DEBUG --+ /* Only used for assertion below when DEBUG is set, otherwise --+ it will be over-written when we loop around. */ -- match_last = -1; --+#endif -- } -- else -- break; /* We found a match. */ -diff --git a/grub-core/lib/gnulib-patches/fix-width.patch b/grub-core/lib/gnulib-patches/fix-width.patch -deleted file mode 100644 -index 0a208ad08b5..00000000000 ---- a/grub-core/lib/gnulib-patches/fix-width.patch -+++ /dev/null -@@ -1,217 +0,0 @@ --diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c --index ba6a407f7..d0685b3d4 100644 ----- a/lib/argp-fmtstream.c --+++ b/lib/argp-fmtstream.c --@@ -28,9 +28,11 @@ -- #include -- #include -- #include --+#include -- -- #include "argp-fmtstream.h" -- #include "argp-namefrob.h" --+#include "mbswidth.h" -- -- #ifndef ARGP_FMTSTREAM_USE_LINEWRAP -- --@@ -115,6 +117,51 @@ weak_alias (__argp_fmtstream_free, argp_fmtstream_free) -- #endif -- #endif -- --+ --+/* Return the pointer to the first character that doesn't fit in l columns. */ --+static inline const ptrdiff_t --+add_width (const char *ptr, const char *end, size_t l) --+{ --+ mbstate_t ps; --+ const char *ptr0 = ptr; --+ --+ memset (&ps, 0, sizeof (ps)); --+ --+ while (ptr < end) --+ { --+ wchar_t wc; --+ size_t s, k; --+ --+ s = mbrtowc (&wc, ptr, end - ptr, &ps); --+ if (s == (size_t) -1) --+ break; --+ if (s == (size_t) -2) --+ { --+ if (1 >= l) --+ break; --+ l--; --+ ptr++; --+ continue; --+ } --+ --+ if (wc == '\e' && ptr + 3 < end --+ && ptr[1] == '[' && (ptr[2] == '0' || ptr[2] == '1') --+ && ptr[3] == 'm') --+ { --+ ptr += 4; --+ continue; --+ } --+ --+ k = wcwidth (wc); --+ --+ if (k >= l) --+ break; --+ l -= k; --+ ptr += s; --+ } --+ return ptr - ptr0; --+} --+ -- /* Process FS's buffer so that line wrapping is done from POINT_OFFS to the -- end of its buffer. This code is mostly from glibc stdio/linewrap.c. */ -- void --@@ -168,13 +215,15 @@ __argp_fmtstream_update (argp_fmtstream_t fs) -- if (!nl) -- { -- /* The buffer ends in a partial line. */ --+ size_t display_width = mbsnwidth (buf, fs->p - buf, --+ MBSW_STOP_AT_NUL); -- --- if (fs->point_col + len < fs->rmargin) --+ if (fs->point_col + display_width < fs->rmargin) -- { -- /* The remaining buffer text is a partial line and fits -- within the maximum line width. Advance point for the -- characters to be written and stop scanning. */ --- fs->point_col += len; --+ fs->point_col += display_width; -- break; -- } -- else --@@ -182,14 +231,18 @@ __argp_fmtstream_update (argp_fmtstream_t fs) -- the end of the buffer. */ -- nl = fs->p; -- } --- else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin) --- { --- /* The buffer contains a full line that fits within the maximum --- line width. Reset point and scan the next line. */ --- fs->point_col = 0; --- buf = nl + 1; --- continue; --- } --+ else --+ { --+ size_t display_width = mbsnwidth (buf, nl - buf, MBSW_STOP_AT_NUL); --+ if (display_width < (ssize_t) fs->rmargin) --+ { --+ /* The buffer contains a full line that fits within the maximum --+ line width. Reset point and scan the next line. */ --+ fs->point_col = 0; --+ buf = nl + 1; --+ continue; --+ } --+ } -- -- /* This line is too long. */ -- r = fs->rmargin - 1; --@@ -225,7 +278,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) -- char *p, *nextline; -- int i; -- --- p = buf + (r + 1 - fs->point_col); --+ p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col)); -- while (p >= buf && !isblank ((unsigned char) *p)) -- --p; -- nextline = p + 1; /* This will begin the next line. */ --@@ -243,7 +296,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) -- { -- /* A single word that is greater than the maximum line width. -- Oh well. Put it on an overlong line by itself. */ --- p = buf + (r + 1 - fs->point_col); --+ p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col)); -- /* Find the end of the long word. */ -- if (p < nl) -- do --@@ -277,7 +330,8 @@ __argp_fmtstream_update (argp_fmtstream_t fs) -- && fs->p > nextline) -- { -- /* The margin needs more blanks than we removed. */ --- if (fs->end - fs->p > fs->wmargin + 1) --+ if (mbsnwidth (fs->p, fs->end - fs->p, MBSW_STOP_AT_NUL) --+ > fs->wmargin + 1) -- /* Make some space for them. */ -- { -- size_t mv = fs->p - nextline; --diff --git a/lib/argp-help.c b/lib/argp-help.c --index e5375a0f0..5d8f451ec 100644 ----- a/lib/argp-help.c --+++ b/lib/argp-help.c --@@ -51,6 +51,7 @@ -- #include "argp.h" -- #include "argp-fmtstream.h" -- #include "argp-namefrob.h" --+#include "mbswidth.h" -- -- #ifndef SIZE_MAX -- # define SIZE_MAX ((size_t) -1) --@@ -1432,7 +1433,7 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state, -- -- /* Manually do line wrapping so that it (probably) won't get wrapped at -- any embedded spaces. */ --- space (stream, 1 + nl - cp); --+ space (stream, 1 + mbsnwidth (cp, nl - cp, MBSW_STOP_AT_NUL)); -- -- __argp_fmtstream_write (stream, cp, nl - cp); -- } --diff --git a/lib/mbswidth.c b/lib/mbswidth.c --index 408a15e34..b3fb7f83a 100644 ----- a/lib/mbswidth.c --+++ b/lib/mbswidth.c --@@ -38,6 +38,14 @@ -- /* Get INT_MAX. */ -- #include -- --+#ifndef FALLTHROUGH --+# if __GNUC__ < 7 --+# define FALLTHROUGH ((void) 0) --+# else --+# define FALLTHROUGH __attribute__ ((__fallthrough__)) --+# endif --+#endif --+ -- /* Returns the number of columns needed to represent the multibyte -- character string pointed to by STRING. If a non-printable character -- occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. --@@ -90,6 +98,10 @@ mbsnwidth (const char *string, size_t nbytes, int flags) -- p++; -- width++; -- break; --+ case '\0': --+ if (flags & MBSW_STOP_AT_NUL) --+ return width; --+ FALLTHROUGH; -- default: -- /* If we have a multibyte sequence, scan it up to its end. */ -- { --@@ -168,6 +180,9 @@ mbsnwidth (const char *string, size_t nbytes, int flags) -- { -- unsigned char c = (unsigned char) *p++; -- --+ if (c == 0 && (flags & MBSW_STOP_AT_NUL)) --+ return width; --+ -- if (isprint (c)) -- { -- if (width == INT_MAX) --diff --git a/lib/mbswidth.h b/lib/mbswidth.h --index 2b5c53c37..45a123e63 100644 ----- a/lib/mbswidth.h --+++ b/lib/mbswidth.h --@@ -45,6 +45,10 @@ extern "C" { -- control characters and 1 otherwise. */ -- #define MBSW_REJECT_UNPRINTABLE 2 -- --+/* If this bit is set \0 is treated as the end of string. --+ Otherwise it's treated as a normal one column width character. */ --+#define MBSW_STOP_AT_NUL 4 --+ -- -- /* Returns the number of screen columns needed for STRING. */ -- #define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */ -diff --git a/grub-core/lib/gnulib-patches/no-abort.patch b/grub-core/lib/gnulib-patches/no-abort.patch -deleted file mode 100644 -index e469c4762eb..00000000000 ---- a/grub-core/lib/gnulib-patches/no-abort.patch -+++ /dev/null -@@ -1,26 +0,0 @@ --diff --git a/lib/regcomp.c b/lib/regcomp.c --index cc85f35ac..de45ebb5c 100644 ----- a/lib/regcomp.c --+++ b/lib/regcomp.c --@@ -528,9 +528,9 @@ regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, -- to this routine. If we are given anything else, or if other regex -- code generates an invalid error code, then the program has a bug. -- Dump core so we can fix it. */ --- abort (); --- --- msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); --+ msg = gettext ("unknown regexp error"); --+ else --+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); -- -- msg_size = strlen (msg) + 1; /* Includes the null. */ -- --@@ -1136,7 +1136,7 @@ optimize_utf8 (re_dfa_t *dfa) -- } -- break; -- default: --- abort (); --+ break; -- } -- -- if (mb_chars || has_period) diff --git a/0124-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch b/0122-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch similarity index 100% rename from 0124-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch rename to 0122-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch diff --git a/0125-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch b/0123-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch similarity index 100% rename from 0125-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch rename to 0123-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch diff --git a/0126-Add-start-symbol-for-RISC-V.patch b/0124-Add-start-symbol-for-RISC-V.patch similarity index 100% rename from 0126-Add-start-symbol-for-RISC-V.patch rename to 0124-Add-start-symbol-for-RISC-V.patch diff --git a/0127-bootstrap.conf-Force-autogen.sh-to-use-python3.patch b/0125-bootstrap.conf-Force-autogen.sh-to-use-python3.patch similarity index 92% rename from 0127-bootstrap.conf-Force-autogen.sh-to-use-python3.patch rename to 0125-bootstrap.conf-Force-autogen.sh-to-use-python3.patch index 5c3b968..49c92b9 100644 --- a/0127-bootstrap.conf-Force-autogen.sh-to-use-python3.patch +++ b/0125-bootstrap.conf-Force-autogen.sh-to-use-python3.patch @@ -19,10 +19,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf -index 452f4d79b0d..03f10930230 100644 +index 6b043fc354c..52d4af44bec 100644 --- a/bootstrap.conf +++ b/bootstrap.conf -@@ -93,7 +93,7 @@ bootstrap_post_import_hook () { +@@ -92,7 +92,7 @@ bootstrap_post_import_hook () { patch -d po -p3 \ < "po/gettext-patches/$patchname.patch" done diff --git a/0128-efi-http-Export-fw-http-_path-variables-to-make-them.patch b/0126-efi-http-Export-fw-http-_path-variables-to-make-them.patch similarity index 100% rename from 0128-efi-http-Export-fw-http-_path-variables-to-make-them.patch rename to 0126-efi-http-Export-fw-http-_path-variables-to-make-them.patch diff --git a/0129-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch b/0127-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch similarity index 100% rename from 0129-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch rename to 0127-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch diff --git a/0130-efi-net-Allow-to-specify-a-port-number-in-addresses.patch b/0128-efi-net-Allow-to-specify-a-port-number-in-addresses.patch similarity index 100% rename from 0130-efi-net-Allow-to-specify-a-port-number-in-addresses.patch rename to 0128-efi-net-Allow-to-specify-a-port-number-in-addresses.patch diff --git a/0131-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch b/0129-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch similarity index 100% rename from 0131-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch rename to 0129-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch diff --git a/0132-efi-net-Print-a-debug-message-if-parsing-the-address.patch b/0130-efi-net-Print-a-debug-message-if-parsing-the-address.patch similarity index 100% rename from 0132-efi-net-Print-a-debug-message-if-parsing-the-address.patch rename to 0130-efi-net-Print-a-debug-message-if-parsing-the-address.patch diff --git a/0133-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch b/0131-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch similarity index 100% rename from 0133-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch rename to 0131-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch diff --git a/0134-efi-Set-image-base-address-before-jumping-to-the-PE-.patch b/0132-efi-Set-image-base-address-before-jumping-to-the-PE-.patch similarity index 100% rename from 0134-efi-Set-image-base-address-before-jumping-to-the-PE-.patch rename to 0132-efi-Set-image-base-address-before-jumping-to-the-PE-.patch diff --git a/0135-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch b/0133-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch similarity index 100% rename from 0135-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch rename to 0133-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch diff --git a/0136-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch b/0134-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch similarity index 100% rename from 0136-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch rename to 0134-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch diff --git a/0137-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch b/0135-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch similarity index 100% rename from 0137-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch rename to 0135-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch diff --git a/0138-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch b/0136-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch similarity index 100% rename from 0138-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch rename to 0136-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch diff --git a/0139-efi-dhcp-fix-some-allocation-error-checking.patch b/0137-efi-dhcp-fix-some-allocation-error-checking.patch similarity index 100% rename from 0139-efi-dhcp-fix-some-allocation-error-checking.patch rename to 0137-efi-dhcp-fix-some-allocation-error-checking.patch diff --git a/0140-efi-http-fix-some-allocation-error-checking.patch b/0138-efi-http-fix-some-allocation-error-checking.patch similarity index 100% rename from 0140-efi-http-fix-some-allocation-error-checking.patch rename to 0138-efi-http-fix-some-allocation-error-checking.patch diff --git a/0141-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch b/0139-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch similarity index 100% rename from 0141-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch rename to 0139-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch diff --git a/0142-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch b/0140-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch similarity index 100% rename from 0142-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch rename to 0140-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch diff --git a/0143-linuxefi-fail-kernel-validation-without-shim-protoco.patch b/0141-linuxefi-fail-kernel-validation-without-shim-protoco.patch similarity index 100% rename from 0143-linuxefi-fail-kernel-validation-without-shim-protoco.patch rename to 0141-linuxefi-fail-kernel-validation-without-shim-protoco.patch diff --git a/0144-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch b/0142-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch similarity index 100% rename from 0144-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch rename to 0142-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch diff --git a/0145-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch b/0143-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch similarity index 100% rename from 0145-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch rename to 0143-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch diff --git a/0146-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch b/0144-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch similarity index 100% rename from 0146-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch rename to 0144-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch diff --git a/0147-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch b/0145-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch similarity index 100% rename from 0147-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch rename to 0145-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch diff --git a/0148-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch b/0146-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch similarity index 100% rename from 0148-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch rename to 0146-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch diff --git a/0149-Add-systemd-integration-scripts-to-make-systemctl-re.patch b/0147-Add-systemd-integration-scripts-to-make-systemctl-re.patch similarity index 100% rename from 0149-Add-systemd-integration-scripts-to-make-systemctl-re.patch rename to 0147-Add-systemd-integration-scripts-to-make-systemctl-re.patch diff --git a/0150-systemd-integration.sh-Also-set-old-menu_show_once-g.patch b/0148-systemd-integration.sh-Also-set-old-menu_show_once-g.patch similarity index 100% rename from 0150-systemd-integration.sh-Also-set-old-menu_show_once-g.patch rename to 0148-systemd-integration.sh-Also-set-old-menu_show_once-g.patch diff --git a/0151-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch b/0149-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch similarity index 100% rename from 0151-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch rename to 0149-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch diff --git a/0152-grub-install-disable-support-for-EFI-platforms.patch b/0150-grub-install-disable-support-for-EFI-platforms.patch similarity index 100% rename from 0152-grub-install-disable-support-for-EFI-platforms.patch rename to 0150-grub-install-disable-support-for-EFI-platforms.patch diff --git a/0153-New-with-debug-timestamps-configure-flag-to-prepend-.patch b/0151-New-with-debug-timestamps-configure-flag-to-prepend-.patch similarity index 100% rename from 0153-New-with-debug-timestamps-configure-flag-to-prepend-.patch rename to 0151-New-with-debug-timestamps-configure-flag-to-prepend-.patch diff --git a/0154-Added-debug-statements-to-grub_disk_open-and-grub_di.patch b/0152-Added-debug-statements-to-grub_disk_open-and-grub_di.patch similarity index 100% rename from 0154-Added-debug-statements-to-grub_disk_open-and-grub_di.patch rename to 0152-Added-debug-statements-to-grub_disk_open-and-grub_di.patch diff --git a/0155-Introduce-function-grub_debug_is_enabled-void-return.patch b/0153-Introduce-function-grub_debug_is_enabled-void-return.patch similarity index 100% rename from 0155-Introduce-function-grub_debug_is_enabled-void-return.patch rename to 0153-Introduce-function-grub_debug_is_enabled-void-return.patch diff --git a/0156-Don-t-clear-screen-when-debugging-is-enabled.patch b/0154-Don-t-clear-screen-when-debugging-is-enabled.patch similarity index 100% rename from 0156-Don-t-clear-screen-when-debugging-is-enabled.patch rename to 0154-Don-t-clear-screen-when-debugging-is-enabled.patch diff --git a/0157-grub_file_-instrumentation-new-file-debug-tag.patch b/0155-grub_file_-instrumentation-new-file-debug-tag.patch similarity index 100% rename from 0157-grub_file_-instrumentation-new-file-debug-tag.patch rename to 0155-grub_file_-instrumentation-new-file-debug-tag.patch diff --git a/0158-ieee1275-Avoiding-many-unecessary-open-close.patch b/0156-ieee1275-Avoiding-many-unecessary-open-close.patch similarity index 100% rename from 0158-ieee1275-Avoiding-many-unecessary-open-close.patch rename to 0156-ieee1275-Avoiding-many-unecessary-open-close.patch diff --git a/0159-ieee1275-powerpc-implements-fibre-channel-discovery-.patch b/0157-ieee1275-powerpc-implements-fibre-channel-discovery-.patch similarity index 100% rename from 0159-ieee1275-powerpc-implements-fibre-channel-discovery-.patch rename to 0157-ieee1275-powerpc-implements-fibre-channel-discovery-.patch diff --git a/0160-ieee1275-powerpc-enables-device-mapper-discovery.patch b/0158-ieee1275-powerpc-enables-device-mapper-discovery.patch similarity index 100% rename from 0160-ieee1275-powerpc-enables-device-mapper-discovery.patch rename to 0158-ieee1275-powerpc-enables-device-mapper-discovery.patch diff --git a/0161-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch b/0159-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch similarity index 100% rename from 0161-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch rename to 0159-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch diff --git a/0162-Add-suport-for-signing-grub-with-an-appended-signatu.patch b/0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch similarity index 100% rename from 0162-Add-suport-for-signing-grub-with-an-appended-signatu.patch rename to 0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch diff --git a/0163-docs-grub-Document-signing-grub-under-UEFI.patch b/0161-docs-grub-Document-signing-grub-under-UEFI.patch similarity index 100% rename from 0163-docs-grub-Document-signing-grub-under-UEFI.patch rename to 0161-docs-grub-Document-signing-grub-under-UEFI.patch diff --git a/0164-docs-grub-Document-signing-grub-with-an-appended-sig.patch b/0162-docs-grub-Document-signing-grub-with-an-appended-sig.patch similarity index 100% rename from 0164-docs-grub-Document-signing-grub-with-an-appended-sig.patch rename to 0162-docs-grub-Document-signing-grub-with-an-appended-sig.patch diff --git a/0165-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch b/0163-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch similarity index 100% rename from 0165-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch rename to 0163-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch diff --git a/0166-pgp-factor-out-rsa_pad.patch b/0164-pgp-factor-out-rsa_pad.patch similarity index 100% rename from 0166-pgp-factor-out-rsa_pad.patch rename to 0164-pgp-factor-out-rsa_pad.patch diff --git a/0167-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch b/0165-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch similarity index 100% rename from 0167-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch rename to 0165-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch diff --git a/0168-posix_wrap-tweaks-in-preparation-for-libtasn1.patch b/0166-posix_wrap-tweaks-in-preparation-for-libtasn1.patch similarity index 100% rename from 0168-posix_wrap-tweaks-in-preparation-for-libtasn1.patch rename to 0166-posix_wrap-tweaks-in-preparation-for-libtasn1.patch diff --git a/0169-libtasn1-import-libtasn1-4.16.0.patch b/0167-libtasn1-import-libtasn1-4.16.0.patch similarity index 100% rename from 0169-libtasn1-import-libtasn1-4.16.0.patch rename to 0167-libtasn1-import-libtasn1-4.16.0.patch diff --git a/0170-libtasn1-disable-code-not-needed-in-grub.patch b/0168-libtasn1-disable-code-not-needed-in-grub.patch similarity index 100% rename from 0170-libtasn1-disable-code-not-needed-in-grub.patch rename to 0168-libtasn1-disable-code-not-needed-in-grub.patch diff --git a/0171-libtasn1-changes-for-grub-compatibility.patch b/0169-libtasn1-changes-for-grub-compatibility.patch similarity index 100% rename from 0171-libtasn1-changes-for-grub-compatibility.patch rename to 0169-libtasn1-changes-for-grub-compatibility.patch diff --git a/0172-libtasn1-compile-into-asn1-module.patch b/0170-libtasn1-compile-into-asn1-module.patch similarity index 100% rename from 0172-libtasn1-compile-into-asn1-module.patch rename to 0170-libtasn1-compile-into-asn1-module.patch diff --git a/0173-test_asn1-test-module-for-libtasn1.patch b/0171-test_asn1-test-module-for-libtasn1.patch similarity index 100% rename from 0173-test_asn1-test-module-for-libtasn1.patch rename to 0171-test_asn1-test-module-for-libtasn1.patch diff --git a/0174-grub-install-support-embedding-x509-certificates.patch b/0172-grub-install-support-embedding-x509-certificates.patch similarity index 100% rename from 0174-grub-install-support-embedding-x509-certificates.patch rename to 0172-grub-install-support-embedding-x509-certificates.patch diff --git a/0175-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch b/0173-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch similarity index 100% rename from 0175-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch rename to 0173-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch diff --git a/0176-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch b/0174-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch similarity index 100% rename from 0176-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch rename to 0174-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch diff --git a/0177-appended-signatures-support-verifying-appended-signa.patch b/0175-appended-signatures-support-verifying-appended-signa.patch similarity index 100% rename from 0177-appended-signatures-support-verifying-appended-signa.patch rename to 0175-appended-signatures-support-verifying-appended-signa.patch diff --git a/0178-appended-signatures-verification-tests.patch b/0176-appended-signatures-verification-tests.patch similarity index 100% rename from 0178-appended-signatures-verification-tests.patch rename to 0176-appended-signatures-verification-tests.patch diff --git a/0179-appended-signatures-documentation.patch b/0177-appended-signatures-documentation.patch similarity index 100% rename from 0179-appended-signatures-documentation.patch rename to 0177-appended-signatures-documentation.patch diff --git a/0180-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch b/0178-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch similarity index 100% rename from 0180-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch rename to 0178-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch diff --git a/0181-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch b/0179-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch similarity index 100% rename from 0181-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch rename to 0179-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch diff --git a/0182-ieee1275-claim-more-memory.patch b/0180-ieee1275-claim-more-memory.patch similarity index 100% rename from 0182-ieee1275-claim-more-memory.patch rename to 0180-ieee1275-claim-more-memory.patch diff --git a/0183-ieee1275-request-memory-with-ibm-client-architecture.patch b/0181-ieee1275-request-memory-with-ibm-client-architecture.patch similarity index 100% rename from 0183-ieee1275-request-memory-with-ibm-client-architecture.patch rename to 0181-ieee1275-request-memory-with-ibm-client-architecture.patch diff --git a/0184-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch b/0182-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch similarity index 100% rename from 0184-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch rename to 0182-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch diff --git a/0185-ieee1275-ofdisk-retry-on-open-failure.patch b/0183-ieee1275-ofdisk-retry-on-open-failure.patch similarity index 100% rename from 0185-ieee1275-ofdisk-retry-on-open-failure.patch rename to 0183-ieee1275-ofdisk-retry-on-open-failure.patch diff --git a/0186-Allow-chainloading-EFI-apps-from-loop-mounts.patch b/0184-Allow-chainloading-EFI-apps-from-loop-mounts.patch similarity index 100% rename from 0186-Allow-chainloading-EFI-apps-from-loop-mounts.patch rename to 0184-Allow-chainloading-EFI-apps-from-loop-mounts.patch diff --git a/0187-efinet-Add-DHCP-proxy-support.patch b/0185-efinet-Add-DHCP-proxy-support.patch similarity index 100% rename from 0187-efinet-Add-DHCP-proxy-support.patch rename to 0185-efinet-Add-DHCP-proxy-support.patch diff --git a/0188-fs-ext2-Ignore-checksum-seed-incompat-feature.patch b/0186-fs-ext2-Ignore-checksum-seed-incompat-feature.patch similarity index 100% rename from 0188-fs-ext2-Ignore-checksum-seed-incompat-feature.patch rename to 0186-fs-ext2-Ignore-checksum-seed-incompat-feature.patch diff --git a/0189-Don-t-update-the-cmdline-when-generating-legacy-menu.patch b/0187-Don-t-update-the-cmdline-when-generating-legacy-menu.patch similarity index 100% rename from 0189-Don-t-update-the-cmdline-when-generating-legacy-menu.patch rename to 0187-Don-t-update-the-cmdline-when-generating-legacy-menu.patch diff --git a/0190-Suppress-gettext-error-message.patch b/0188-Suppress-gettext-error-message.patch similarity index 100% rename from 0190-Suppress-gettext-error-message.patch rename to 0188-Suppress-gettext-error-message.patch diff --git a/0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch b/0189-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch similarity index 100% rename from 0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch rename to 0189-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch diff --git a/0192-templates-Check-for-EFI-at-runtime-instead-of-config.patch b/0190-templates-Check-for-EFI-at-runtime-instead-of-config.patch similarity index 100% rename from 0192-templates-Check-for-EFI-at-runtime-instead-of-config.patch rename to 0190-templates-Check-for-EFI-at-runtime-instead-of-config.patch diff --git a/0193-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch b/0191-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch similarity index 100% rename from 0193-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch rename to 0191-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch diff --git a/0194-arm64-Fix-EFI-loader-kernel-image-allocation.patch b/0192-arm64-Fix-EFI-loader-kernel-image-allocation.patch similarity index 100% rename from 0194-arm64-Fix-EFI-loader-kernel-image-allocation.patch rename to 0192-arm64-Fix-EFI-loader-kernel-image-allocation.patch diff --git a/0195-normal-main-Discover-the-device-to-read-the-config-f.patch b/0193-normal-main-Discover-the-device-to-read-the-config-f.patch similarity index 100% rename from 0195-normal-main-Discover-the-device-to-read-the-config-f.patch rename to 0193-normal-main-Discover-the-device-to-read-the-config-f.patch diff --git a/0196-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch b/0194-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch similarity index 100% rename from 0196-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch rename to 0194-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch diff --git a/0197-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch b/0195-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch similarity index 100% rename from 0197-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch rename to 0195-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch diff --git a/0198-Print-module-name-on-license-check-failure.patch b/0196-Print-module-name-on-license-check-failure.patch similarity index 100% rename from 0198-Print-module-name-on-license-check-failure.patch rename to 0196-Print-module-name-on-license-check-failure.patch diff --git a/0199-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch b/0197-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch similarity index 100% rename from 0199-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch rename to 0197-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch diff --git a/0200-grub-mkconfig-restore-umask-for-grub.cfg.patch b/0198-grub-mkconfig-restore-umask-for-grub.cfg.patch similarity index 100% rename from 0200-grub-mkconfig-restore-umask-for-grub.cfg.patch rename to 0198-grub-mkconfig-restore-umask-for-grub.cfg.patch diff --git a/0201-fs-btrfs-Use-full-btrfs-bootloader-area.patch b/0199-fs-btrfs-Use-full-btrfs-bootloader-area.patch similarity index 100% rename from 0201-fs-btrfs-Use-full-btrfs-bootloader-area.patch rename to 0199-fs-btrfs-Use-full-btrfs-bootloader-area.patch diff --git a/0202-Add-Fedora-location-of-DejaVu-SANS-font.patch b/0200-Add-Fedora-location-of-DejaVu-SANS-font.patch similarity index 100% rename from 0202-Add-Fedora-location-of-DejaVu-SANS-font.patch rename to 0200-Add-Fedora-location-of-DejaVu-SANS-font.patch diff --git a/0201-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch b/0201-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch new file mode 100644 index 0000000..531c4f5 --- /dev/null +++ b/0201-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch @@ -0,0 +1,90 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 28 Jan 2022 11:30:32 +0100 +Subject: [PATCH] normal/menu: Don't show "Booting `%s'" msg when auto-booting + with TIMEOUT_STYLE_HIDDEN + +When the user has asked the menu code to be hidden/quiet and the current +entry is being autobooted because the timeout has expired don't show +the "Booting `%s'" msg. + +This is necessary to let flicker-free boots really be flicker free, +otherwise the "Booting `%s'" msg will kick the EFI fb into text mode +and show the msg, breaking the flicker-free experience. + +Signed-off-by: Hans de Goede +--- + grub-core/normal/menu.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index ec0c92bade0..c8516a5a080 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -606,13 +606,15 @@ print_countdown (struct grub_term_coordinate *pos, int n) + entry to be executed is a result of an automatic default selection because + of the timeout. */ + static int +-run_menu (grub_menu_t menu, int nested, int *auto_boot) ++run_menu (grub_menu_t menu, int nested, int *auto_boot, int *notify_boot) + { + grub_uint64_t saved_time; + int default_entry, current_entry; + int timeout; + enum timeout_style timeout_style; + ++ *notify_boot = 1; ++ + default_entry = get_entry_number (menu, "default"); + + /* If DEFAULT_ENTRY is not within the menu entries, fall back to +@@ -687,6 +689,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + if (timeout == 0) + { + *auto_boot = 1; ++ *notify_boot = timeout_style != TIMEOUT_STYLE_HIDDEN; + return default_entry; + } + +@@ -840,12 +843,16 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + + /* Callback invoked immediately before a menu entry is executed. */ + static void +-notify_booting (grub_menu_entry_t entry, +- void *userdata __attribute__((unused))) ++notify_booting (grub_menu_entry_t entry, void *userdata) + { +- grub_printf (" "); +- grub_printf_ (N_("Booting `%s'"), entry->title); +- grub_printf ("\n\n"); ++ int *notify_boot = userdata; ++ ++ if (*notify_boot) ++ { ++ grub_printf (" "); ++ grub_printf_ (N_("Booting `%s'"), entry->title); ++ grub_printf ("\n\n"); ++ } + } + + /* Callback invoked when a default menu entry executed because of a timeout +@@ -893,8 +900,9 @@ show_menu (grub_menu_t menu, int nested, int autobooted) + int boot_entry; + grub_menu_entry_t e; + int auto_boot; ++ int notify_boot; + +- boot_entry = run_menu (menu, nested, &auto_boot); ++ boot_entry = run_menu (menu, nested, &auto_boot, ¬ify_boot); + if (boot_entry < 0) + break; + +@@ -906,7 +914,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted) + + if (auto_boot) + grub_menu_execute_with_fallback (menu, e, autobooted, +- &execution_callback, 0); ++ &execution_callback, ¬ify_boot); + else + grub_menu_execute_entry (e, 0); + if (autobooted) diff --git a/0202-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch b/0202-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch new file mode 100644 index 0000000..8f34b74 --- /dev/null +++ b/0202-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 28 Jan 2022 11:30:33 +0100 +Subject: [PATCH] EFI: suppress the "Welcome to GRUB!" message in EFI builds + +Grub EFI builds are now often used in combination with flicker-free +boot, but this breaks with upstream grub because the "Welcome to GRUB!" +message will kick the EFI fb into text mode and show the msg, +breaking the flicker-free experience. + +EFI systems are so fast, that when the menu or the countdown are enabled +the message will be immediately overwritten, so in these cases not +printing the message does not matter. + +And in case when the timeout_style is set to TIMEOUT_STYLE_HIDDEN, +the user has asked grub to be quiet (for example to allow flickfree +boot) annd thus the message should not be printed. + +Signed-off-by: Hans de Goede +--- + grub-core/kern/main.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c +index 3fc34014726..993b8a8598e 100644 +--- a/grub-core/kern/main.c ++++ b/grub-core/kern/main.c +@@ -317,10 +317,13 @@ grub_main (void) + + grub_boot_time ("After machine init."); + ++ /* This breaks flicker-free boot on EFI systems, so disable it there. */ ++#ifndef GRUB_MACHINE_EFI + /* Hello. */ + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + grub_printf ("Welcome to GRUB!\n\n"); + grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); ++#endif + + /* Init verifiers API. */ + grub_verifiers_init (); diff --git a/0203-EFI-console-Do-not-set-colorstate-until-the-first-te.patch b/0203-EFI-console-Do-not-set-colorstate-until-the-first-te.patch new file mode 100644 index 0000000..cb430c0 --- /dev/null +++ b/0203-EFI-console-Do-not-set-colorstate-until-the-first-te.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 28 Jan 2022 12:43:48 +0100 +Subject: [PATCH] EFI: console: Do not set colorstate until the first text + output + +GRUB_MOD_INIT(normal) does an unconditional: + +grub_env_set ("color_normal", "light-gray/black"); + +which triggers a grub_term_setcolorstate() call. The original version +of the "efi/console: Do not set text-mode until we actually need it" patch: +https://lists.gnu.org/archive/html/grub-devel/2018-03/msg00125.html + +Protected against this by caching the requested state in +grub_console_setcolorstate () and then only applying it when the first +text output actually happens. During refactoring to move the +grub_console_setcolorstate () up higher in the grub-core/term/efi/console.c +file the code to cache the color-state + bail early was accidentally +dropped. + +Restore the cache the color-state + bail early behavior from the original. + +Cc: Javier Martinez Canillas +Fixes: 2d7c3abd871f ("efi/console: Do not set text-mode until we actually need it") +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index 2f1ae85ba7d..c44b2ac318c 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -82,6 +82,16 @@ grub_console_setcolorstate (struct grub_term_output *term + { + grub_efi_simple_text_output_interface_t *o; + ++ if (grub_efi_is_finished || text_mode != GRUB_TEXT_MODE_AVAILABLE) ++ { ++ /* ++ * Cache colorstate changes before the first text-output, this avoids ++ * "color_normal" environment writes causing a switch to textmode. ++ */ ++ text_colorstate = state; ++ return; ++ } ++ + if (grub_efi_is_finished) + return; + diff --git a/0204-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch b/0204-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch new file mode 100644 index 0000000..e33d1f3 --- /dev/null +++ b/0204-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 28 Jan 2022 12:43:49 +0100 +Subject: [PATCH] EFI: console: Do not set cursor until the first text output + +To allow flickerfree boot the EFI console code does not call +grub_efi_set_text_mode (1) until some text is actually output. + +Depending on if the output text is because of an error loading +e.g. the .cfg file; or because of showing the menu the cursor needs +to be on or off when the first text is shown. + +So far the cursor was hardcoded to being on, but this is causing +drawing artifacts + slow drawing of the menu as reported here: +https://bugzilla.redhat.com/show_bug.cgi?id=1946969 + +Handle the cursorstate in the same way as the colorstate to fix this, +when no text has been output yet, just cache the cursorstate and +then use the last set value when the first text is output. + +Fixes: 2d7c3abd871f ("efi/console: Do not set text-mode until we actually need it") +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index c44b2ac318c..a3622e4fe5f 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -31,7 +31,15 @@ typedef enum { + } + grub_text_mode; + ++typedef enum { ++ GRUB_CURSOR_MODE_UNDEFINED = -1, ++ GRUB_CURSOR_MODE_OFF = 0, ++ GRUB_CURSUR_MODE_ON ++} ++grub_cursor_mode; ++ + static grub_text_mode text_mode = GRUB_TEXT_MODE_UNDEFINED; ++static grub_cursor_mode cursor_mode = GRUB_CURSOR_MODE_UNDEFINED; + static grub_term_color_state text_colorstate = GRUB_TERM_COLOR_UNDEFINED; + + static grub_uint32_t +@@ -119,8 +127,12 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), + { + grub_efi_simple_text_output_interface_t *o; + +- if (grub_efi_is_finished) +- return; ++ if (grub_efi_is_finished || text_mode != GRUB_TEXT_MODE_AVAILABLE) ++ { ++ /* Cache cursor changes before the first text-output */ ++ cursor_mode = on; ++ return; ++ } + + o = grub_efi_system_table->con_out; + efi_call_2 (o->enable_cursor, o, on); +@@ -143,7 +155,8 @@ grub_prepare_for_text_output (struct grub_term_output *term) + return GRUB_ERR_BAD_DEVICE; + } + +- grub_console_setcursor (term, 1); ++ if (cursor_mode != GRUB_CURSOR_MODE_UNDEFINED) ++ grub_console_setcursor (term, cursor_mode); + if (text_colorstate != GRUB_TERM_COLOR_UNDEFINED) + grub_console_setcolorstate (term, text_colorstate); + text_mode = GRUB_TEXT_MODE_AVAILABLE; diff --git a/0205-Use-visual-indentation-in-config.h.in.patch b/0205-Use-visual-indentation-in-config.h.in.patch new file mode 100644 index 0000000..1acc333 --- /dev/null +++ b/0205-Use-visual-indentation-in-config.h.in.patch @@ -0,0 +1,93 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Wed, 15 Dec 2021 15:46:13 -0500 +Subject: [PATCH] Use visual indentation in config.h.in + +Signed-off-by: Robbie Harwood +(cherry picked from commit de8051f34de0aa55c921a510974e5bb27e39c17b) +[rharwood: GRUB_RPM_CONFIG presence] +--- + config.h.in | 58 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 29 insertions(+), 29 deletions(-) + +diff --git a/config.h.in b/config.h.in +index c80e3e0aba3..f2ed0066ec0 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -23,47 +23,47 @@ + #define MINILZO_CFG_SKIP_LZO1X_DECOMPRESS 1 + + #if defined (GRUB_BUILD) +-#undef ENABLE_NLS +-#define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ +-#define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@ +-#if defined __APPLE__ +-# if defined __BIG_ENDIAN__ +-# define BUILD_WORDS_BIGENDIAN 1 +-# else +-# define BUILD_WORDS_BIGENDIAN 0 +-# endif +-#else +-#define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@ +-#endif ++# undef ENABLE_NLS ++# define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ ++# define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@ ++# if defined __APPLE__ ++# if defined __BIG_ENDIAN__ ++# define BUILD_WORDS_BIGENDIAN 1 ++# else ++# define BUILD_WORDS_BIGENDIAN 0 ++# endif ++# else /* !defined __APPLE__ */ ++# define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@ ++# endif /* !defined __APPLE__ */ + #elif defined (GRUB_UTIL) || !defined (GRUB_MACHINE) +-#include +-#else +-#define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ ++# include ++#else /* !defined GRUB_UTIL && defined GRUB_MACHINE */ ++# define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ + /* Define if C symbols get an underscore after compilation. */ +-#define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ ++# define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ + /* Define it to one of __bss_start, edata and _edata. */ +-#define BSS_START_SYMBOL @BSS_START_SYMBOL@ ++# define BSS_START_SYMBOL @BSS_START_SYMBOL@ + /* Define it to either end or _end. */ +-#define END_SYMBOL @END_SYMBOL@ ++# define END_SYMBOL @END_SYMBOL@ + /* Name of package. */ +-#define PACKAGE "@PACKAGE@" ++# define PACKAGE "@PACKAGE@" + /* Version number of package. */ +-#define VERSION "@VERSION@" ++# define VERSION "@VERSION@" + /* Define to the full name and version of this package. */ +-#define PACKAGE_STRING "@PACKAGE_STRING@" ++# define PACKAGE_STRING "@PACKAGE_STRING@" + /* Define to the version of this package. */ +-#define PACKAGE_VERSION "@PACKAGE_VERSION@" ++# define PACKAGE_VERSION "@PACKAGE_VERSION@" + /* Define to the full name of this package. */ +-#define PACKAGE_NAME "@PACKAGE_NAME@" ++# define PACKAGE_NAME "@PACKAGE_NAME@" + /* Define to the address where bug reports for this package should be sent. */ +-#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" ++# define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +-#define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@" +-#define GRUB_PLATFORM "@GRUB_PLATFORM@" +-#define GRUB_RPM_VERSION "@GRUB_RPM_VERSION@" ++# define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@" ++# define GRUB_PLATFORM "@GRUB_PLATFORM@" ++# define GRUB_RPM_VERSION "@GRUB_RPM_VERSION@" + +-#define RE_ENABLE_I18N 1 ++# define RE_ENABLE_I18N 1 + +-#define _GNU_SOURCE 1 ++# define _GNU_SOURCE 1 + + #endif diff --git a/0206-Where-present-ensure-config-util.h-precedes-config.h.patch b/0206-Where-present-ensure-config-util.h-precedes-config.h.patch new file mode 100644 index 0000000..351d50f --- /dev/null +++ b/0206-Where-present-ensure-config-util.h-precedes-config.h.patch @@ -0,0 +1,275 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Tue, 22 Feb 2022 16:57:54 -0500 +Subject: [PATCH] Where present, ensure config-util.h precedes config.h + +gnulib defines go in config-util.h, and we need to know whether to +provide duplicates in config.h or not. + +Signed-off-by: Robbie Harwood +(cherry picked from commit 46e82b28e1a75703d0424c7e13d009171310c6cd) +[rharwood: gensymlist isn't part of tarballs] +--- + grub-core/disk/host.c | 2 +- + grub-core/kern/emu/argp_common.c | 2 +- + grub-core/kern/emu/main.c | 2 +- + grub-core/osdep/aros/config.c | 2 +- + grub-core/osdep/basic/emunet.c | 2 +- + grub-core/osdep/basic/init.c | 2 +- + grub-core/osdep/haiku/getroot.c | 2 +- + grub-core/osdep/linux/emunet.c | 2 +- + grub-core/osdep/unix/config.c | 2 +- + grub-core/osdep/unix/cputime.c | 2 +- + grub-core/osdep/unix/dl.c | 2 +- + grub-core/osdep/unix/emuconsole.c | 2 +- + grub-core/osdep/unix/getroot.c | 2 +- + grub-core/osdep/windows/config.c | 2 +- + grub-core/osdep/windows/cputime.c | 2 +- + grub-core/osdep/windows/dl.c | 2 +- + grub-core/osdep/windows/emuconsole.c | 2 +- + grub-core/osdep/windows/init.c | 2 +- + 18 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/grub-core/disk/host.c b/grub-core/disk/host.c +index c151d225df7..f34529f86ae 100644 +--- a/grub-core/disk/host.c ++++ b/grub-core/disk/host.c +@@ -20,8 +20,8 @@ + /* When using the disk, make a reference to this module. Otherwise + the user will end up with a useless module :-). */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/kern/emu/argp_common.c b/grub-core/kern/emu/argp_common.c +index 16688587037..8cb4608c3df 100644 +--- a/grub-core/kern/emu/argp_common.c ++++ b/grub-core/kern/emu/argp_common.c +@@ -17,8 +17,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #pragma GCC diagnostic ignored "-Wmissing-prototypes" + #pragma GCC diagnostic ignored "-Wmissing-declarations" +diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c +index 846fe9715ec..3e7929cc4af 100644 +--- a/grub-core/kern/emu/main.c ++++ b/grub-core/kern/emu/main.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/aros/config.c b/grub-core/osdep/aros/config.c +index c82d0ea8e76..55f5728efca 100644 +--- a/grub-core/osdep/aros/config.c ++++ b/grub-core/osdep/aros/config.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/basic/emunet.c b/grub-core/osdep/basic/emunet.c +index 6362e5cfbb3..dbfd316d613 100644 +--- a/grub-core/osdep/basic/emunet.c ++++ b/grub-core/osdep/basic/emunet.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/basic/init.c b/grub-core/osdep/basic/init.c +index c54c710dbcb..b104c7e162b 100644 +--- a/grub-core/osdep/basic/init.c ++++ b/grub-core/osdep/basic/init.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/haiku/getroot.c b/grub-core/osdep/haiku/getroot.c +index 4e123c0903a..927a1ebc941 100644 +--- a/grub-core/osdep/haiku/getroot.c ++++ b/grub-core/osdep/haiku/getroot.c +@@ -1,5 +1,5 @@ +-#include + #include ++#include + #include + #include + #include +diff --git a/grub-core/osdep/linux/emunet.c b/grub-core/osdep/linux/emunet.c +index 19b188f09ee..d5a6417355f 100644 +--- a/grub-core/osdep/linux/emunet.c ++++ b/grub-core/osdep/linux/emunet.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c +index 46a881530c0..0ce0e309ac0 100644 +--- a/grub-core/osdep/unix/config.c ++++ b/grub-core/osdep/unix/config.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/unix/cputime.c b/grub-core/osdep/unix/cputime.c +index cff359a3b94..fb6ff55a1a7 100644 +--- a/grub-core/osdep/unix/cputime.c ++++ b/grub-core/osdep/unix/cputime.c +@@ -1,5 +1,5 @@ +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/unix/dl.c b/grub-core/osdep/unix/dl.c +index 562b101a280..99b189bc1c9 100644 +--- a/grub-core/osdep/unix/dl.c ++++ b/grub-core/osdep/unix/dl.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/unix/emuconsole.c b/grub-core/osdep/unix/emuconsole.c +index 7308798efe9..cac159424d8 100644 +--- a/grub-core/osdep/unix/emuconsole.c ++++ b/grub-core/osdep/unix/emuconsole.c +@@ -17,8 +17,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c +index 46d7116c6e6..4f436284ce0 100644 +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/windows/config.c b/grub-core/osdep/windows/config.c +index 928ab1a49be..2bb8a2fd88e 100644 +--- a/grub-core/osdep/windows/config.c ++++ b/grub-core/osdep/windows/config.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/windows/cputime.c b/grub-core/osdep/windows/cputime.c +index 3568aa2d359..5d06d79dd53 100644 +--- a/grub-core/osdep/windows/cputime.c ++++ b/grub-core/osdep/windows/cputime.c +@@ -1,5 +1,5 @@ +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/windows/dl.c b/grub-core/osdep/windows/dl.c +index eec6a24ad7f..8eab7057e4d 100644 +--- a/grub-core/osdep/windows/dl.c ++++ b/grub-core/osdep/windows/dl.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/windows/emuconsole.c b/grub-core/osdep/windows/emuconsole.c +index 4fb3693cc01..17a44de4690 100644 +--- a/grub-core/osdep/windows/emuconsole.c ++++ b/grub-core/osdep/windows/emuconsole.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + + #include + #include +diff --git a/grub-core/osdep/windows/init.c b/grub-core/osdep/windows/init.c +index 6297de6326a..51a9647dde4 100644 +--- a/grub-core/osdep/windows/init.c ++++ b/grub-core/osdep/windows/init.c +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#include + #include ++#include + #include + #include + #include diff --git a/0207-Drop-gnulib-fix-base64.patch.patch b/0207-Drop-gnulib-fix-base64.patch.patch new file mode 100644 index 0000000..1d26c57 --- /dev/null +++ b/0207-Drop-gnulib-fix-base64.patch.patch @@ -0,0 +1,140 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 28 Oct 2021 15:07:50 -0400 +Subject: [PATCH] Drop gnulib fix-base64.patch + +Originally added in 9fbdec2f6b4fa8b549daa4d49134d1fe89d95ef9 and +subsequently modified in 552c9fd08122a3036c724ce96dfe68aa2f75705f, +fix-base64.patch handled two problems we have using gnulib, which are +exerciesd by the base64 module but not directly caused by it. + +First, grub2 defines its own bool type, while gnulib expects the +equivalent of stdbool.h to be present. Rather than patching gnulib, +instead use gnulib's stdbool module to provide a bool type if needed. +(Suggested by Simon Josefsson.) + +Second, our config.h doesn't always inherit config-util.h, which is +where gnulib-related options like _GL_ATTRIBUTE_CONST end up. +fix-base64.h worked around this by defining the attribute away, but this +workaround is better placed in config.h itself, not a gnulib patch. + +Signed-off-by: Robbie Harwood +(cherry picked from commit 54fd1c3301dd15f6b6212c12887265e8a6cbc076) +--- + grub-core/lib/posix_wrap/sys/types.h | 7 +++---- + grub-core/lib/xzembed/xz.h | 5 +---- + bootstrap.conf | 3 ++- + conf/Makefile.extra-dist | 1 - + config.h.in | 4 ++++ + grub-core/lib/gnulib-patches/fix-base64.patch | 21 --------------------- + 6 files changed, 10 insertions(+), 31 deletions(-) + delete mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch + +diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/sys/types.h +index f63412c8da0..2f3e865495a 100644 +--- a/grub-core/lib/posix_wrap/sys/types.h ++++ b/grub-core/lib/posix_wrap/sys/types.h +@@ -23,11 +23,10 @@ + + #include + ++/* Provided by gnulib if not present. */ ++#include ++ + typedef grub_ssize_t ssize_t; +-#ifndef GRUB_POSIX_BOOL_DEFINED +-typedef enum { false = 0, true = 1 } bool; +-#define GRUB_POSIX_BOOL_DEFINED 1 +-#endif + + typedef grub_uint8_t uint8_t; + typedef grub_uint16_t uint16_t; +diff --git a/grub-core/lib/xzembed/xz.h b/grub-core/lib/xzembed/xz.h +index f7b32d80032..d1417039aa4 100644 +--- a/grub-core/lib/xzembed/xz.h ++++ b/grub-core/lib/xzembed/xz.h +@@ -29,10 +29,7 @@ + #include + #include + #include +- +-#ifndef GRUB_POSIX_BOOL_DEFINED +-typedef enum { false = 0, true = 1 } bool; +-#endif ++#include + + /** + * enum xz_ret - Return codes +diff --git a/bootstrap.conf b/bootstrap.conf +index 52d4af44bec..645e3a459ce 100644 +--- a/bootstrap.conf ++++ b/bootstrap.conf +@@ -35,6 +35,7 @@ gnulib_modules=" + realloc-gnu + regex + save-cwd ++ stdbool + " + + gnulib_tool_option_extras="\ +@@ -79,7 +80,7 @@ cp -a INSTALL INSTALL.grub + + bootstrap_post_import_hook () { + set -e +- for patchname in fix-base64 fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ ++ for patchname in fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ + fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort; do + patch -d grub-core/lib/gnulib -p2 \ + < "grub-core/lib/gnulib-patches/$patchname.patch" +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index ea58362b555..ca6a50deca9 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -30,7 +30,6 @@ EXTRA_DIST += grub-core/gensymlist.sh + EXTRA_DIST += grub-core/genemuinit.sh + EXTRA_DIST += grub-core/genemuinitheader.sh + +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-base64.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch +diff --git a/config.h.in b/config.h.in +index f2ed0066ec0..9c7b4afaaad 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -66,4 +66,8 @@ + + # define _GNU_SOURCE 1 + ++# ifndef _GL_INLINE_HEADER_BEGIN ++# define _GL_ATTRIBUTE_CONST __attribute__ ((const)) ++# endif /* !_GL_INLINE_HEADER_BEGIN */ ++ + #endif +diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/lib/gnulib-patches/fix-base64.patch +deleted file mode 100644 +index 985db127971..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-base64.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-diff --git a/lib/base64.h b/lib/base64.h +-index 9cd0183b8..185a2afa1 100644 +---- a/lib/base64.h +-+++ b/lib/base64.h +-@@ -21,8 +21,14 @@ +- /* Get size_t. */ +- # include +- +--/* Get bool. */ +--# include +-+#ifndef GRUB_POSIX_BOOL_DEFINED +-+typedef enum { false = 0, true = 1 } bool; +-+#define GRUB_POSIX_BOOL_DEFINED 1 +-+#endif +-+ +-+#ifndef _GL_ATTRIBUTE_CONST +-+# define _GL_ATTRIBUTE_CONST /* empty */ +-+#endif +- +- # ifdef __cplusplus +- extern "C" { diff --git a/0208-Drop-gnulib-no-abort.patch.patch b/0208-Drop-gnulib-no-abort.patch.patch new file mode 100644 index 0000000..79bcb03 --- /dev/null +++ b/0208-Drop-gnulib-no-abort.patch.patch @@ -0,0 +1,97 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Wed, 5 Jan 2022 16:42:11 -0500 +Subject: [PATCH] Drop gnulib no-abort.patch + +Originally added in db7337a3d353a817ffe9eb4a3702120527100be9, this +patched out all relevant invocations of abort() in gnulib. While it was +not documented why at the time, testing suggests that there's no abort() +implementation available for gnulib to use. + +gnulib's position is that the use of abort() is correct here, since it +happens when input violates a "shall" from POSIX. Additionally, the +code in question is probably not reachable. Since abort() is more +friendly to user-space, they prefer to make no change, so we can just +carry a define instead. (Suggested by Paul Eggert.) + +Signed-off-by: Robbie Harwood +(cherry picked from commit 5137c8eb3ec11c3217acea1a93a3f88f3fa4cbca) +--- + bootstrap.conf | 2 +- + conf/Makefile.extra-dist | 1 - + config.h.in | 3 +++ + grub-core/lib/gnulib-patches/no-abort.patch | 26 -------------------------- + 4 files changed, 4 insertions(+), 28 deletions(-) + delete mode 100644 grub-core/lib/gnulib-patches/no-abort.patch + +diff --git a/bootstrap.conf b/bootstrap.conf +index 645e3a459ce..71ce943c7d4 100644 +--- a/bootstrap.conf ++++ b/bootstrap.conf +@@ -81,7 +81,7 @@ cp -a INSTALL INSTALL.grub + bootstrap_post_import_hook () { + set -e + for patchname in fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ +- fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort; do ++ fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width; do + patch -d grub-core/lib/gnulib -p2 \ + < "grub-core/lib/gnulib-patches/$patchname.patch" + done +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index ca6a50deca9..16248ccf032 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -37,7 +37,6 @@ EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch + + EXTRA_DIST += grub-core/lib/libgcrypt + EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic +diff --git a/config.h.in b/config.h.in +index 9c7b4afaaad..c3134309c63 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -68,6 +68,9 @@ + + # ifndef _GL_INLINE_HEADER_BEGIN + # define _GL_ATTRIBUTE_CONST __attribute__ ((const)) ++ ++/* We don't have an abort() for gnulib to call in regexp. */ ++# define abort __builtin_unreachable + # endif /* !_GL_INLINE_HEADER_BEGIN */ + + #endif +diff --git a/grub-core/lib/gnulib-patches/no-abort.patch b/grub-core/lib/gnulib-patches/no-abort.patch +deleted file mode 100644 +index e469c4762eb..00000000000 +--- a/grub-core/lib/gnulib-patches/no-abort.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-diff --git a/lib/regcomp.c b/lib/regcomp.c +-index cc85f35ac..de45ebb5c 100644 +---- a/lib/regcomp.c +-+++ b/lib/regcomp.c +-@@ -528,9 +528,9 @@ regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, +- to this routine. If we are given anything else, or if other regex +- code generates an invalid error code, then the program has a bug. +- Dump core so we can fix it. */ +-- abort (); +-- +-- msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); +-+ msg = gettext ("unknown regexp error"); +-+ else +-+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); +- +- msg_size = strlen (msg) + 1; /* Includes the null. */ +- +-@@ -1136,7 +1136,7 @@ optimize_utf8 (re_dfa_t *dfa) +- } +- break; +- default: +-- abort (); +-+ break; +- } +- +- if (mb_chars || has_period) diff --git a/0209-Update-gnulib-version-and-drop-most-gnulib-patches.patch b/0209-Update-gnulib-version-and-drop-most-gnulib-patches.patch new file mode 100644 index 0000000..4b5a44c --- /dev/null +++ b/0209-Update-gnulib-version-and-drop-most-gnulib-patches.patch @@ -0,0 +1,832 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Wed, 15 Dec 2021 15:07:50 -0500 +Subject: [PATCH] Update gnulib version and drop most gnulib patches + +In addition to the changes carried in our gnulib patches, several +Coverity and code hygiene fixes that were previously downstream are also +included in this 3-year gnulib increment. + +Unfortunately, fix-width.patch is retained. + +Bump minimum autoconf version from 2.63 to 2.64 and automake from 1.11 +to 1.14, as required by gnulib. + +Sync bootstrap script itself with gnulib. + +Update regexp module for new dynarray dependency. + +Fix various new warnings. + +Signed-off-by: Robbie Harwood +(cherry picked from commit deb18ff931c3133c2aa536a92bd92e50d6615303) +[rharwood: backport around requirements in INSTALL] +--- + configure.ac | 2 +- + grub-core/Makefile.core.def | 3 + + grub-core/disk/luks2.c | 4 +- + grub-core/lib/posix_wrap/limits.h | 6 +- + include/grub/compiler.h | 4 +- + include/grub/list.h | 2 +- + INSTALL | 2 +- + bootstrap | 291 ++++++++++++--------- + bootstrap.conf | 22 +- + conf/Makefile.extra-dist | 6 - + config.h.in | 68 +++++ + grub-core/lib/gnulib-patches/fix-null-deref.patch | 13 - + .../lib/gnulib-patches/fix-null-state-deref.patch | 12 - + .../gnulib-patches/fix-regcomp-uninit-token.patch | 15 -- + .../gnulib-patches/fix-regexec-null-deref.patch | 12 - + .../lib/gnulib-patches/fix-uninit-structure.patch | 11 - + .../lib/gnulib-patches/fix-unused-value.patch | 14 - + 17 files changed, 262 insertions(+), 225 deletions(-) + delete mode 100644 grub-core/lib/gnulib-patches/fix-null-deref.patch + delete mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch + delete mode 100644 grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch + delete mode 100644 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch + delete mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch + delete mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch + +diff --git a/configure.ac b/configure.ac +index 3527f069ab2..d04c94691ef 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -49,7 +49,7 @@ AC_CANONICAL_TARGET + program_prefix="${save_program_prefix}" + + AM_INIT_AUTOMAKE([1.11]) +-AC_PREREQ(2.63) ++AC_PREREQ(2.64) + AC_CONFIG_SRCDIR([include/grub/dl.h]) + AC_CONFIG_HEADER([config-util.h]) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 6b00eb55575..39233096f29 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -762,6 +762,9 @@ module = { + name = regexp; + common = commands/regexp.c; + common = commands/wildcard.c; ++ common = lib/gnulib/malloc/dynarray_finalize.c; ++ common = lib/gnulib/malloc/dynarray_emplace_enlarge.c; ++ common = lib/gnulib/malloc/dynarray_resize.c; + common = lib/gnulib/regex.c; + cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)'; + cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)'; +diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c +index 371a53b837d..c917a5f91e7 100644 +--- a/grub-core/disk/luks2.c ++++ b/grub-core/disk/luks2.c +@@ -389,7 +389,7 @@ luks2_verify_key (grub_luks2_digest_t *d, grub_uint8_t *candidate_key, + { + grub_uint8_t candidate_digest[GRUB_CRYPTODISK_MAX_KEYLEN]; + grub_uint8_t digest[GRUB_CRYPTODISK_MAX_KEYLEN], salt[GRUB_CRYPTODISK_MAX_KEYLEN]; +- grub_size_t saltlen = sizeof (salt), digestlen = sizeof (digest); ++ idx_t saltlen = sizeof (salt), digestlen = sizeof (digest); + const gcry_md_spec_t *hash; + gcry_err_code_t gcry_ret; + +@@ -428,7 +428,7 @@ luks2_decrypt_key (grub_uint8_t *out_key, + grub_uint8_t area_key[GRUB_CRYPTODISK_MAX_KEYLEN]; + grub_uint8_t salt[GRUB_CRYPTODISK_MAX_KEYLEN]; + grub_uint8_t *split_key = NULL; +- grub_size_t saltlen = sizeof (salt); ++ idx_t saltlen = sizeof (salt); + char cipher[32], *p; + const gcry_md_spec_t *hash; + gcry_err_code_t gcry_ret; +diff --git a/grub-core/lib/posix_wrap/limits.h b/grub-core/lib/posix_wrap/limits.h +index 591dbf3289d..4be7b408063 100644 +--- a/grub-core/lib/posix_wrap/limits.h ++++ b/grub-core/lib/posix_wrap/limits.h +@@ -25,7 +25,11 @@ + #define USHRT_MAX GRUB_USHRT_MAX + #define UINT_MAX GRUB_UINT_MAX + #define ULONG_MAX GRUB_ULONG_MAX +-#define SIZE_MAX GRUB_SIZE_MAX ++ ++/* gnulib also defines this type */ ++#ifndef SIZE_MAX ++# define SIZE_MAX GRUB_SIZE_MAX ++#endif + + #define SCHAR_MIN GRUB_SCHAR_MIN + #define SCHAR_MAX GRUB_SCHAR_MAX +diff --git a/include/grub/compiler.h b/include/grub/compiler.h +index ebafec68957..441a9eca07c 100644 +--- a/include/grub/compiler.h ++++ b/include/grub/compiler.h +@@ -30,10 +30,10 @@ + + /* Does this compiler support compile-time error attributes? */ + #if GNUC_PREREQ(4,3) +-# define ATTRIBUTE_ERROR(msg) \ ++# define GRUB_ATTRIBUTE_ERROR(msg) \ + __attribute__ ((__error__ (msg))) + #else +-# define ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn)) ++# define GRUB_ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn)) + #endif + + #if GNUC_PREREQ(4,4) +diff --git a/include/grub/list.h b/include/grub/list.h +index b13acb96243..21f4b4b44a1 100644 +--- a/include/grub/list.h ++++ b/include/grub/list.h +@@ -40,7 +40,7 @@ void EXPORT_FUNC(grub_list_remove) (grub_list_t item); + + static inline void * + grub_bad_type_cast_real (int line, const char *file) +- ATTRIBUTE_ERROR ("bad type cast between incompatible grub types"); ++ GRUB_ATTRIBUTE_ERROR ("bad type cast between incompatible grub types"); + + static inline void * + grub_bad_type_cast_real (int line, const char *file) +diff --git a/INSTALL b/INSTALL +index 79a0af7d937..ee9f536f760 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -42,7 +42,7 @@ If you use a development snapshot or want to hack on GRUB you may + need the following. + + * Python 2.6 or later +-* Autoconf 2.63 or later ++* Autoconf 2.64 or later + * Automake 1.11 or later + + Prerequisites for make-check: +diff --git a/bootstrap b/bootstrap +index 5b08e7e2d42..dc2238f4adf 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -1,10 +1,10 @@ + #! /bin/sh + # Print a version string. +-scriptversion=2019-01-04.17; # UTC ++scriptversion=2022-01-26.05; # UTC + + # Bootstrap this package from checked-out sources. + +-# Copyright (C) 2003-2019 Free Software Foundation, Inc. ++# Copyright (C) 2003-2022 Free Software Foundation, Inc. + + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -47,7 +47,7 @@ PERL="${PERL-perl}" + + me=$0 + +-default_gnulib_url=git://git.sv.gnu.org/gnulib ++default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git + + usage() { + cat </dev/null) ++if test -z "$package"; then ++ package=$(sed -n "$extract_package_name" configure.ac) \ ++ || die 'cannot find package name in configure.ac' ++fi + gnulib_name=lib$package + + build_aux=build-aux +@@ -290,6 +313,116 @@ find_tool () + eval "export $find_tool_envvar" + } + ++# Strip blank and comment lines to leave significant entries. ++gitignore_entries() { ++ sed '/^#/d; /^$/d' "$@" ++} ++ ++# If $STR is not already on a line by itself in $FILE, insert it at the start. ++# Entries are inserted at the start of the ignore list to ensure existing ++# entries starting with ! are not overridden. Such entries support ++# whitelisting exceptions after a more generic blacklist pattern. ++insert_if_absent() { ++ file=$1 ++ str=$2 ++ test -f $file || touch $file ++ test -r $file || die "Error: failed to read ignore file: $file" ++ duplicate_entries=$(gitignore_entries $file | sort | uniq -d) ++ if [ "$duplicate_entries" ] ; then ++ die "Error: Duplicate entries in $file: " $duplicate_entries ++ fi ++ linesold=$(gitignore_entries $file | wc -l) ++ linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l) ++ if [ $linesold != $linesnew ] ; then ++ { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \ ++ || die "insert_if_absent $file $str: failed" ++ fi ++} ++ ++# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with ++# insert_if_absent. ++insert_vc_ignore() { ++ vc_ignore_file="$1" ++ pattern="$2" ++ case $vc_ignore_file in ++ *.gitignore) ++ # A .gitignore entry that does not start with '/' applies ++ # recursively to subdirectories, so prepend '/' to every ++ # .gitignore entry. ++ pattern=$(echo "$pattern" | sed s,^,/,);; ++ esac ++ insert_if_absent "$vc_ignore_file" "$pattern" ++} ++ ++symlink_to_dir() ++{ ++ src=$1/$2 ++ dst=${3-$2} ++ ++ test -f "$src" && { ++ ++ # If the destination directory doesn't exist, create it. ++ # This is required at least for "lib/uniwidth/cjk.h". ++ dst_dir=$(dirname "$dst") ++ if ! test -d "$dst_dir"; then ++ mkdir -p "$dst_dir" ++ ++ # If we've just created a directory like lib/uniwidth, ++ # tell version control system(s) it's ignorable. ++ # FIXME: for now, this does only one level ++ parent=$(dirname "$dst_dir") ++ for dot_ig in x $vc_ignore; do ++ test $dot_ig = x && continue ++ ig=$parent/$dot_ig ++ insert_vc_ignore $ig "${dst_dir##*/}" ++ done ++ fi ++ ++ if $copy; then ++ { ++ test ! -h "$dst" || { ++ echo "$me: rm -f $dst" && ++ rm -f "$dst" ++ } ++ } && ++ test -f "$dst" && ++ cmp -s "$src" "$dst" || { ++ echo "$me: cp -fp $src $dst" && ++ cp -fp "$src" "$dst" ++ } ++ else ++ # Leave any existing symlink alone, if it already points to the source, ++ # so that broken build tools that care about symlink times ++ # aren't confused into doing unnecessary builds. Conversely, if the ++ # existing symlink's timestamp is older than the source, make it afresh, ++ # so that broken tools aren't confused into skipping needed builds. See ++ # . ++ test -h "$dst" && ++ src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && ++ dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && ++ test "$src_i" = "$dst_i" && ++ both_ls=$(ls -dt "$src" "$dst") && ++ test "X$both_ls" = "X$dst$nl$src" || { ++ dot_dots= ++ case $src in ++ /*) ;; ++ *) ++ case /$dst/ in ++ *//* | */../* | */./* | /*/*/*/*/*/) ++ die "invalid symlink calculation: $src -> $dst";; ++ /*/*/*/*/) dot_dots=../../../;; ++ /*/*/*/) dot_dots=../../;; ++ /*/*/) dot_dots=../;; ++ esac;; ++ esac ++ ++ echo "$me: ln -fs $dot_dots$src $dst" && ++ ln -fs "$dot_dots$src" "$dst" ++ } ++ fi ++ } ++} ++ + # Override the default configuration, if necessary. + # Make sure that bootstrap.conf is sourced from the current directory + # if we were invoked as "sh bootstrap". +@@ -320,6 +453,12 @@ do + --help) + usage + exit;; ++ --version) ++ set -e ++ echo "bootstrap $scriptversion" ++ echo "$copyright" ++ exit 0 ++ ;; + --gnulib-srcdir=*) + GNULIB_SRCDIR=${option#--gnulib-srcdir=};; + --skip-po) +@@ -335,7 +474,7 @@ do + --no-git) + use_git=false;; + *) +- die "$option: unknown option";; ++ bootstrap_option_hook $option || die "$option: unknown option";; + esac + done + +@@ -346,47 +485,6 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then + die "Bootstrapping from a non-checked-out distribution is risky." + fi + +-# Strip blank and comment lines to leave significant entries. +-gitignore_entries() { +- sed '/^#/d; /^$/d' "$@" +-} +- +-# If $STR is not already on a line by itself in $FILE, insert it at the start. +-# Entries are inserted at the start of the ignore list to ensure existing +-# entries starting with ! are not overridden. Such entries support +-# whitelisting exceptions after a more generic blacklist pattern. +-insert_if_absent() { +- file=$1 +- str=$2 +- test -f $file || touch $file +- test -r $file || die "Error: failed to read ignore file: $file" +- duplicate_entries=$(gitignore_entries $file | sort | uniq -d) +- if [ "$duplicate_entries" ] ; then +- die "Error: Duplicate entries in $file: " $duplicate_entries +- fi +- linesold=$(gitignore_entries $file | wc -l) +- linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l) +- if [ $linesold != $linesnew ] ; then +- { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \ +- || die "insert_if_absent $file $str: failed" +- fi +-} +- +-# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with +-# insert_if_absent. +-insert_vc_ignore() { +- vc_ignore_file="$1" +- pattern="$2" +- case $vc_ignore_file in +- *.gitignore) +- # A .gitignore entry that does not start with '/' applies +- # recursively to subdirectories, so prepend '/' to every +- # .gitignore entry. +- pattern=$(echo "$pattern" | sed s,^,/,);; +- esac +- insert_if_absent "$vc_ignore_file" "$pattern" +-} +- + # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac. + found_aux_dir=no + grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \ +@@ -665,9 +763,25 @@ if $use_gnulib; then + shallow= + if test -z "$GNULIB_REVISION"; then + git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2' ++ git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \ ++ || cleanup_gnulib ++ else ++ git fetch -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2' ++ mkdir -p "$gnulib_path" ++ # Only want a shallow checkout of $GNULIB_REVISION, but git does not ++ # support cloning by commit hash. So attempt a shallow fetch by commit ++ # hash to minimize the amount of data downloaded and changes needed to ++ # be processed, which can drastically reduce download and processing ++ # time for checkout. If the fetch by commit fails, a shallow fetch can ++ # not be performed because we do not know what the depth of the commit ++ # is without fetching all commits. So fallback to fetching all commits. ++ git -C "$gnulib_path" init ++ git -C "$gnulib_path" remote add origin ${GNULIB_URL:-$default_gnulib_url} ++ git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \ ++ || git -C "$gnulib_path" fetch origin \ ++ || cleanup_gnulib ++ git -C "$gnulib_path" reset --hard FETCH_HEAD + fi +- git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \ +- || cleanup_gnulib + + trap - 1 2 13 15 + fi +@@ -784,75 +898,6 @@ case $SKIP_PO in + fi;; + esac + +-symlink_to_dir() +-{ +- src=$1/$2 +- dst=${3-$2} +- +- test -f "$src" && { +- +- # If the destination directory doesn't exist, create it. +- # This is required at least for "lib/uniwidth/cjk.h". +- dst_dir=$(dirname "$dst") +- if ! test -d "$dst_dir"; then +- mkdir -p "$dst_dir" +- +- # If we've just created a directory like lib/uniwidth, +- # tell version control system(s) it's ignorable. +- # FIXME: for now, this does only one level +- parent=$(dirname "$dst_dir") +- for dot_ig in x $vc_ignore; do +- test $dot_ig = x && continue +- ig=$parent/$dot_ig +- insert_vc_ignore $ig "${dst_dir##*/}" +- done +- fi +- +- if $copy; then +- { +- test ! -h "$dst" || { +- echo "$me: rm -f $dst" && +- rm -f "$dst" +- } +- } && +- test -f "$dst" && +- cmp -s "$src" "$dst" || { +- echo "$me: cp -fp $src $dst" && +- cp -fp "$src" "$dst" +- } +- else +- # Leave any existing symlink alone, if it already points to the source, +- # so that broken build tools that care about symlink times +- # aren't confused into doing unnecessary builds. Conversely, if the +- # existing symlink's timestamp is older than the source, make it afresh, +- # so that broken tools aren't confused into skipping needed builds. See +- # . +- test -h "$dst" && +- src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && +- dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && +- test "$src_i" = "$dst_i" && +- both_ls=$(ls -dt "$src" "$dst") && +- test "X$both_ls" = "X$dst$nl$src" || { +- dot_dots= +- case $src in +- /*) ;; +- *) +- case /$dst/ in +- *//* | */../* | */./* | /*/*/*/*/*/) +- die "invalid symlink calculation: $src -> $dst";; +- /*/*/*/*/) dot_dots=../../../;; +- /*/*/*/) dot_dots=../../;; +- /*/*/) dot_dots=../;; +- esac;; +- esac +- +- echo "$me: ln -fs $dot_dots$src $dst" && +- ln -fs "$dot_dots$src" "$dst" +- } +- fi +- } +-} +- + version_controlled_file() { + parent=$1 + file=$2 +@@ -970,7 +1015,7 @@ bootstrap_post_import_hook \ + # Uninitialized submodules are listed with an initial dash. + if $use_git && git submodule | grep '^-' >/dev/null; then + die "some git submodules are not initialized. " \ +- "Run 'git submodule init' and bootstrap again." ++ "Run 'git submodule update --init' and bootstrap again." + fi + + # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +@@ -1064,7 +1109,7 @@ bootstrap_epilogue + + echo "$0: done. Now you can run './configure'." + +-# Local variables: ++# Local Variables: + # eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "scriptversion=" + # time-stamp-format: "%:y-%02m-%02d.%02H" +diff --git a/bootstrap.conf b/bootstrap.conf +index 71ce943c7d4..e4e5f3750ad 100644 +--- a/bootstrap.conf ++++ b/bootstrap.conf +@@ -1,6 +1,6 @@ + # Bootstrap configuration. + +-# Copyright (C) 2006-2019 Free Software Foundation, Inc. ++# Copyright (C) 2006-2022 Free Software Foundation, Inc. + + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -16,11 +16,10 @@ + # along with this program. If not, see . + + +-GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 ++GNULIB_REVISION=9f48fb992a3d7e96610c4ce8be969cff2d61a01b + + # gnulib modules used by this package. +-# mbswidth is used by gnulib-fix-width.diff's changes to argp rather than +-# directly. ++# mbswidth is used by fix-width.diff's changes to argp rather than directly. + gnulib_modules=" + argp + base64 +@@ -67,8 +66,8 @@ SKIP_PO=t + + # Build prerequisites + buildreq="\ +-autoconf 2.63 +-automake 1.11 ++autoconf 2.64 ++automake 1.14 + gettext 0.18.3 + git 1.5.5 + tar - +@@ -80,11 +79,12 @@ cp -a INSTALL INSTALL.grub + + bootstrap_post_import_hook () { + set -e +- for patchname in fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \ +- fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width; do +- patch -d grub-core/lib/gnulib -p2 \ +- < "grub-core/lib/gnulib-patches/$patchname.patch" +- done ++ ++ # Instead of patching our gnulib and therefore maintaining a fork, submit ++ # changes to gnulib and update the hash above when they've merged. Do not ++ # add new patches here. ++ patch -d grub-core/lib/gnulib -p2 < grub-core/lib/gnulib-patches/fix-width.patch ++ + for patchname in \ + 0001-Support-POTFILES-shell \ + 0002-Handle-gettext_printf-shell-function \ +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 16248ccf032..5b9fda752b6 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -30,12 +30,6 @@ EXTRA_DIST += grub-core/gensymlist.sh + EXTRA_DIST += grub-core/genemuinit.sh + EXTRA_DIST += grub-core/genemuinitheader.sh + +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch +-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch + EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch + + EXTRA_DIST += grub-core/lib/libgcrypt +diff --git a/config.h.in b/config.h.in +index c3134309c63..512d1bbe138 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -67,10 +67,78 @@ + # define _GNU_SOURCE 1 + + # ifndef _GL_INLINE_HEADER_BEGIN ++/* gnulib gets configured against the host, not the target, and the rest of ++ * our buildsystem works around that. This is difficult to avoid as gnulib's ++ * detection requires a more capable system than our target. Instead, we ++ * reach in and set values appropriately - intentionally setting more than the ++ * bare minimum. If, when updating gnulib, something breaks, there's probably ++ * a change needed here or in grub-core/Makefile.core.def. */ ++# define SIZE_MAX ((size_t) -1) ++# define _GL_ATTRIBUTE_ALLOC_SIZE(args) \ ++ __attribute__ ((__alloc_size__ args)) ++# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) ++# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) ++# define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) + # define _GL_ATTRIBUTE_CONST __attribute__ ((const)) ++# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute ((__malloc__ (f, i))) ++# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) ++# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) ++# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) ++# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE \ ++ __attribute__ ((externally_visible)) ++# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) ++# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) ++# define _GL_ATTRIBUTE_MALLOC __attribute__ ((malloc)) ++# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED ++# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) ++# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) ++# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) ++# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) ++# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) ++# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) ++# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) ++# define _GL_ATTRIBUTE_RETURNS_NONNULL \ ++ __attribute__ ((__returns_nonnull__)) ++# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) ++# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) ++# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) ++# define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2))) ++# define _GL_GNUC_PREREQ GNUC_PREREQ ++# define _GL_INLINE inline ++# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED ++ ++/* We can't use __has_attribute for these because gcc-5.1 is too old for ++ * that. Everything above is present in that version, though. */ ++# if __GNUC__ >= 7 ++# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((fallthrough)) ++# else ++# define _GL_ATTRIBUTE_FALLTHROUGH /* empty */ ++# endif ++ ++# ifndef ASM_FILE ++typedef __INT_FAST32_TYPE__ int_fast32_t; ++typedef __UINT_FAST32_TYPE__ uint_fast32_t; ++# endif ++ ++/* Ensure ialloc nests static/non-static inline properly. */ ++# define IALLOC_INLINE static inline ++ ++/* gnulib uses these for blocking out warnings they can't/won't fix. gnulib ++ * also makes the decision about whether to provide a declaration for ++ * reallocarray() at compile-time, so this is a convenient place to override - ++ * it's used by the ialloc module, which is used by base64. */ ++# define _GL_INLINE_HEADER_BEGIN _Pragma ("GCC diagnostic push") \ ++ void * \ ++ reallocarray (void *ptr, unsigned int nmemb, unsigned int size); ++# define _GL_INLINE_HEADER_END _Pragma ("GCC diagnostic pop") + + /* We don't have an abort() for gnulib to call in regexp. */ + # define abort __builtin_unreachable + # endif /* !_GL_INLINE_HEADER_BEGIN */ + ++/* gnulib doesn't build cleanly with older compilers. */ ++# if __GNUC__ < 11 ++_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"") ++# endif ++ + #endif +diff --git a/grub-core/lib/gnulib-patches/fix-null-deref.patch b/grub-core/lib/gnulib-patches/fix-null-deref.patch +deleted file mode 100644 +index 8fafa153a47..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-null-deref.patch ++++ /dev/null +@@ -1,13 +0,0 @@ +-diff --git a/lib/argp-parse.c b/lib/argp-parse.c +-index 6dec57310..900adad54 100644 +---- a/lib/argp-parse.c +-+++ b/lib/argp-parse.c +-@@ -940,7 +940,7 @@ weak_alias (__argp_parse, argp_parse) +- void * +- __argp_input (const struct argp *argp, const struct argp_state *state) +- { +-- if (state) +-+ if (state && state->pstate) +- { +- struct group *group; +- struct parser *parser = state->pstate; +diff --git a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch +deleted file mode 100644 +index 813ec09c8a1..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch ++++ /dev/null +@@ -1,12 +0,0 @@ +---- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000 +-+++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000 +-@@ -145,7 +145,8 @@ +- if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) +- { +- __argp_failure (state, 0, 0, +-- dgettext (state->root_argp->argp_domain, +-+ dgettext (state == NULL ? NULL +-+ : state->root_argp->argp_domain, +- "\ +- ARGP_HELP_FMT: %s value is less than or equal to %s"), +- "rmargin", up->name); +diff --git a/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch b/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch +deleted file mode 100644 +index 02e06315dff..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch ++++ /dev/null +@@ -1,15 +0,0 @@ +---- a/lib/regcomp.c 2020-11-24 17:06:08.159223858 +0000 +-+++ b/lib/regcomp.c 2020-11-24 17:06:15.630253923 +0000 +-@@ -3808,11 +3808,7 @@ +- create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, +- re_token_type_t type) +- { +-- re_token_t t; +--#if defined GCC_LINT || defined lint +-- memset (&t, 0, sizeof t); +--#endif +-- t.type = type; +-+ re_token_t t = { .type = type }; +- return create_token_tree (dfa, left, right, &t); +- } +- +diff --git a/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch b/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch +deleted file mode 100644 +index db6dac9c9e3..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch ++++ /dev/null +@@ -1,12 +0,0 @@ +---- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 +-+++ b/lib/regexec.c 2020-11-05 10:55:09.621542984 +0000 +-@@ -1692,6 +1692,9 @@ +- { +- Idx top = mctx->state_log_top; +- +-+ if (mctx->state_log == NULL) +-+ return REG_NOERROR; +-+ +- if ((next_state_log_idx >= mctx->input.bufs_len +- && mctx->input.bufs_len < mctx->input.len) +- || (next_state_log_idx >= mctx->input.valid_len +diff --git a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch +deleted file mode 100644 +index 7b4d9f67af4..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch ++++ /dev/null +@@ -1,11 +0,0 @@ +---- a/lib/regcomp.c 2020-10-22 13:49:06.770168928 +0000 +-+++ b/lib/regcomp.c 2020-10-22 13:50:37.026528298 +0000 +-@@ -3662,7 +3662,7 @@ +- Idx alloc = 0; +- #endif /* not RE_ENABLE_I18N */ +- reg_errcode_t ret; +-- re_token_t br_token; +-+ re_token_t br_token = {0}; +- bin_tree_t *tree; +- +- sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); +diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch +deleted file mode 100644 +index ba51f1bf223..00000000000 +--- a/grub-core/lib/gnulib-patches/fix-unused-value.patch ++++ /dev/null +@@ -1,14 +0,0 @@ +---- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 +-+++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000 +-@@ -828,7 +828,11 @@ +- break; +- if (__glibc_unlikely (err != REG_NOMATCH)) +- goto free_return; +-+#ifdef DEBUG +-+ /* Only used for assertion below when DEBUG is set, otherwise +-+ it will be over-written when we loop around. */ +- match_last = -1; +-+#endif +- } +- else +- break; /* We found a match. */ diff --git a/do-rebase b/do-rebase index 1f9b21c..685cef6 100755 --- a/do-rebase +++ b/do-rebase @@ -155,21 +155,7 @@ fi unset LC_ALL git rm -q 0*.patch -# No need for this patch anymore, the package is rebased on latest release now. -#> release-to-master.patch -#othergit diff --full-index --binary $diff_ops grub-2.04..refs/remotes/rhboot/master > release-to-master.patch -#git add release-to-master.patch - fedpkg sources -curl -L https://github.com/rhboot/gnulib/archive/fixes.tar.gz > gnulib-fixes.tar.gz.new -if cmp -s gnulib-fixes.tar.gz gnulib-fixes.tar.gz.new; then - rm gnulib-fixes.tar.gz.new -else - mv gnulib-fixes.tar.gz.new gnulib-fixes.tar.gz - sed -i -e '/gnulib-/d' sources - fedpkg upload gnulib-fixes.tar.gz - git add sources -fi > grub.patches patches=$(formatpatch refs/remotes/rhboot/master..refs/remotes/rhboot/${releasever}) diff --git a/grub.macros b/grub.macros index 0343626..a198b17 100644 --- a/grub.macros +++ b/grub.macros @@ -9,11 +9,14 @@ %global _configure ../configure %if %{?_with_ccache: 1}%{?!_with_ccache: 0} -%global cc_equals CC=/usr/%{_lib}/ccache/gcc +%global ccpath /usr/%{_lib}/ccache/gcc %else -%global cc_equals %{nil} +%global ccpath %{__cc} %endif +# gnulib actively ignores CFLAGS because it's terrible +%global cc_equals "CC=%{ccpath} -fPIE" + %global cflags_sed \\\ sed \\\ -e 's/-O. //g' \\\ @@ -330,9 +333,8 @@ git config gc.auto 0 \ rm -f configure \ git add . \ git commit -a -q -m "%{tarversion} baseline." \ -#git apply --index --whitespace=nowarn %{SOURCE3} \ -#git commit -a -q -m "%{tarversion} master." \ git am --whitespace=nowarn %%{patches} - 2.06-16 +- Suffer through updating gnulib + * Thu Jan 20 2022 Robbie Harwood - 2.06-15 - Skip machine ID check when updating BLS