From 861fb30b3e05546cf7950ba5333db66c967d2283 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 15 Feb 2023 16:54:38 +0000 Subject: [PATCH] Sync patches with Fedora Resolves: #2007427 Signed-off-by: Robbie Harwood --- ...ecureboot-support-on-efi-chainloader.patch | 53 +- 0010-re-write-.gitignore.patch | 22 +- ...ient-architecture-CAS-reboot-support.patch | 22 +- ...nsole-display-attr-when-clear-screen.patch | 4 +- ...video-support-for-IBM-power-machines.patch | 7 +- 0018-Migrate-PPC-from-Yaboot-to-Grub2.patch | 11 +- 0019-Add-fw_path-variable-revised.patch | 7 +- 0023-Don-t-write-messages-to-the-screen.patch | 176 -- ...0023-Enable-pager-by-default.-985860.patch | 2 +- 0024-Don-t-print-GNU-GRUB-header.patch | 42 - ...n-t-say-GNU-Linux-in-generated-menus.patch | 85 + ...rame-to-list-of-relocations-stripped.patch | 2 +- 0025-Don-t-add-to-highlighted-row.patch | 23 - ...password-to-boot-entries-generated-b.patch | 2 +- 0026-Message-string-cleanups.patch | 68 - ...ing-now-that-we-aren-t-displaying-it.patch | 29 - ...ix-when-fallback-searching-for-grub-.patch | 6 +- ...-before-grub.cfg-on-tftp-config-file.patch | 4 +- ...t-indentation-for-the-term-help-text.patch | 25 - ...CLASS-in-10_linux-from-etc-os-releas.patch | 2 +- 0029-Indent-menu-entries.patch | 23 - 0030-Fix-margins.patch | 34 - ...t-ordering-for-.debug-and-rescue-ker.patch | 2 +- ...1-Try-prefix-if-fw_path-doesn-t-work.patch | 8 +- ...-1-for-our-right-hand-margin-so-line.patch | 24 - ...fig-construct-titles-that-look-like-.patch | 2 +- ...ly-grub2-password-config-tool-985962.patch | 76 +- ...-on-serial-so-don-t-tell-the-user-to.patch | 24 - ...n-t-say-GNU-Linux-in-generated-menus.patch | 42 - ... 0034-tcp-add-window-scaling-support.patch | 2 +- ...-Don-t-draw-a-border-around-the-menu.patch | 71 - ...net-and-bootp-add-support-for-dhcpv6.patch | 12 +- ...rnel-settings-and-use-it-in-10_linux.patch | 69 +- ...andard-margin-for-the-timeout-string.patch | 40 - ...1374141-fix-incorrect-mask-for-ppc64.patch | 5 +- ... 0038-Make-grub_fatal-also-backtrace.patch | 10 +- 0039-Don-t-emit-Booting-.-message.patch | 49 - ...fo-pages-say-grub2-where-appropriate.patch | 4 +- ...f-man-pages-with-slightly-nicer-ones.patch | 1959 ----------------- ...-chainloader-entries-don-t-try-any-x.patch | 2 +- ...-Add-ability-to-boot-from-subvolumes.patch | 4 +- ...port-btrfs_subvol-and-btrfs_subvolid.patch | 2 +- ...> 0043-grub2-btrfs-03-follow_default.patch | 4 +- ...=> 0044-grub2-btrfs-04-grub2-install.patch | 14 +- ...> 0045-grub2-btrfs-05-grub2-mkconfig.patch | 12 +- ...-Package-Sort-for-grub2-mkconfig-112.patch | 458 ---- ... => 0046-grub2-btrfs-06-subvol-mount.patch | 10 +- ...subvol-name-scheme-to-support-old-sn.patch | 2 +- ...-correctly-with-btrfs-snapshots-bsc-.patch | 4 +- ...ocate_pool-and-grub_efi_free_pool-wr.patch | 2 +- ...fi_.-memory-helpers-where-reasonable.patch | 14 +- ...1-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch | 6 +- ...=> 0052-don-t-use-int-for-efi-status.patch | 2 +- ...INIT-declare-its-function-prototypes.patch | 2 +- ...-efi-as-HFS-on-ppc-machines-in-grub-.patch | 2 +- ...ix-up-some-man-pages-rpmdiff-noticed.patch | 150 -- ...d-xen-or-multiboot-2-modules-as-need.patch | 2 +- ...-calibration-not-take-51-seconds-to-.patch | 2 +- ...057-align-struct-efi_variable-better.patch | 4 +- ...058-Add-BLS-support-to-grub-mkconfig.patch | 57 +- ...-backtrace-on-grub_abort-for-grub-em.patch | 2 +- ...h => 0060-Add-grub2-switch-to-blscfg.patch | 83 +- ...patch => 0061-make-better-backtraces.patch | 50 +- ...w-our-startup-message-if-debug-is-se.patch | 4 +- ...-some-minor-include-path-weirdnesses.patch | 8 +- ...it-possible-to-enabled-build-id-sha1.patch | 6 +- ...f-grub_dprintf-without-the-file-line.patch | 4 +- ...dprintf-that-tells-us-load-addresses.patch | 8 +- ...tch => 0067-Fixup-for-newer-compiler.patch | 4 +- ...-export-the-start-and-_start-symbols.patch | 2 +- ...tch => 0069-Fixup-for-newer-compiler.patch | 2 +- ...pport-for-non-Ethernet-network-cards.patch | 24 +- ...racketed-ipv6-addrs-and-port-numbers.patch | 8 +- ...=> 0072-bootp-New-net_bootp6-command.patch | 10 +- ...=> 0073-efinet-UEFI-IPv6-PXE-support.patch | 4 +- ...074-grub.texi-Add-net_bootp6-doument.patch | 2 +- ...essing-DHCPACK-packet-from-HTTP-Boot.patch | 4 +- ...nux-and-initrd-commands-for-grub-emu.patch | 347 --- ...etting-network-from-UEFI-device-path.patch | 4 +- ...etting-DNS-server-from-UEFI-protocol.patch | 4 +- ...78-Support-UEFI-networking-protocols.patch | 38 +- ...> 0079-AUDIT-0-http-boot-tracker-bug.patch | 4 +- ...-incr-command-to-increment-integer-v.patch | 2 +- ...h => 0081-Add-auto-hide-menu-support.patch | 12 +- ...> 0082-Add-grub-set-bootflag-utility.patch | 85 +- ...b-boot-indeterminate.service-example.patch | 2 +- ...h => 0084-gentpl-add-disable-support.patch | 2 +- ... => 0085-gentpl-add-pc-firmware-type.patch | 2 +- ...e-the-firmware-acceleration-for-http.patch | 2 +- ...ot_url-reflect-the-protocol-hostname.patch | 2 +- ...n-tell-configure-which-cflags-utils-.patch | 10 +- ...make-it-possible-to-run-checkers-on-.patch | 6 +- ...90-Rework-how-the-fdt-command-builds.patch | 29 +- ...able-non-wordsize-allocations-on-arm.patch | 4 +- ...nd-prefix-when-HTTP-path-is-relative.patch | 6 +- ...=> 0093-Make-grub_error-more-verbose.patch | 4 +- ...eset-an-alias-for-the-reboot-command.patch | 2 +- ....patch => 0095-Add-a-version-command.patch | 20 +- ...dprintf-and-nerf-dprintf-in-script.c.patch | 8 +- ...-Better-memory-allocation-and-error-.patch | 4 +- ...tter-locations-for-kernel-and-initrd.patch | 31 +- ...p-all-the-places-Wsign-compare-error.patch | 199 ++ ...gn-compare-Wno-conversion-Wno-error-.patch | 8 +- ...ce-buffers-for-reading-to-addresses-.patch | 2 +- ...-arrange-grub_cmd_linux-a-little-bit.patch | 2 +- ...e-our-own-allocator-for-kernel-stuff.patch | 2 +- ...itrd-params-cmdline-allocations-abov.patch | 4 +- ... => 0105-Fix-getroot.c-s-trampolines.patch | 2 +- ...not-allow-stack-trampolines-anywhere.patch | 6 +- ...tch => 0107-Reimplement-boot_counter.patch | 8 +- ...ntry-selection-based-on-ID-and-title.patch | 2 +- ...try-users-option-argument-to-be-opti.patch | 2 +- ...export-env-and-efi-load-env-commands.patch | 16 +- ...le-to-subtract-conditions-from-debug.patch | 2 +- ...bles-from-the-initial-context-when-c.patch | 4 +- ...-boot-success-reset-from-menu-auto-h.patch | 11 +- ...t-boot-commands-will-only-return-on-.patch | 2 +- ...g-Update-comment-about-running-as-ro.patch | 2 +- ...p-all-the-places-Wsign-compare-error.patch | 397 ---- ...g-Write-new-env-to-tmpfile-and-then-.patch | 8 +- ...indeterminate-getting-set-on-boot_su.patch | 10 +- ... => 0118-Add-start-symbol-for-RISC-V.patch | 2 +- ...conf-Force-autogen.sh-to-use-python3.patch | 4 +- ...fw-http-_path-variables-to-make-them.patch | 4 +- ...-literal-IPv6-addresses-in-square-br.patch | 2 +- ...o-specify-a-port-number-in-addresses.patch | 2 +- ...mprove-check-to-detect-literal-IPv6-.patch | 2 +- ...debug-message-if-parsing-the-address.patch | 2 +- ...so-accept-F8-as-a-user-interrupt-key.patch | 2 +- ...se-address-before-jumping-to-the-PE-.patch | 2 +- ...ate-TPM-measurement-errors-to-the-ve.patch | 2 +- ...maximum-bounce-buffer-size-to-16-MiB.patch | 2 +- ...fix-when-the-HTTP-path-is-relative-a.patch | 2 +- ...turn-in-efi-export-env-and-efi-load-.patch | 2 +- ...ix-systemctl-kexec-exit-status-check.patch | 37 - ...p-fix-some-allocation-error-checking.patch | 2 +- ...b-emu-linux-loader-messages-as-debug.patch | 34 - ...p-fix-some-allocation-error-checking.patch | 2 +- ...g.c-fix-some-potential-allocation-ov.patch | 4 +- ...ferences-for-fdt-when-building-with-.patch | 41 - ...integer-overflows-in-grub_cmd_initrd.patch | 2 +- 0135-Do-better-in-bootstrap.conf.patch | 28 - ...rnel-validation-without-shim-protoco.patch | 8 +- ...ar-pointers-in-grub-core-net-bootp.c.patch | 2 +- 0136-Use-git-to-apply-gnulib-patches.patch | 631 ------ ...-error-with-the-fdt-module-on-risc-v.patch | 40 - ...ointers-in-grub-core-net-efi-ip4_con.patch | 2 +- ...ointers-in-grub-core-net-efi-ip6_con.patch | 2 +- ...-pointers-in-grub-core-net-efi-net.c.patch | 2 +- ...-pointers-in-grub-core-net-efi-pxe.c.patch | 2 +- ...gration-scripts-to-make-systemctl-re.patch | 12 +- ..._EFI_MAX_ALLOCATION_ADDRESS-for-RISC.patch | 24 - ...ader-Define-machine-types-for-RISC-V.patch | 31 - ...ion.sh-Also-set-old-menu_show_once-g.patch | 2 +- ...set-1-when-keyboard-is-in-Translate-.patch | 4 +- ...ll-disable-support-for-EFI-platforms.patch | 27 +- ...imestamps-configure-flag-to-prepend-.patch | 12 +- ...ements-to-grub_disk_open-and-grub_di.patch | 2 +- ...on-grub_debug_is_enabled-void-return.patch | 4 +- ...ear-screen-when-debugging-is-enabled.patch | 22 +- ...Fix-error-handling-in-grub_file_open.patch | 34 + ..._-instrumentation-new-file-debug-tag.patch | 16 +- ...-Avoiding-many-unecessary-open-close.patch | 2 +- ...-implements-fibre-channel-discovery-.patch | 2 +- ...erpc-enables-device-mapper-discovery.patch | 2 +- ...fallback_set-var-to-force-the-set-ma.patch | 8 +- ...igning-grub-with-an-appended-signatu.patch | 43 +- ...rub-Document-signing-grub-under-UEFI.patch | 2 +- ...nt-signing-grub-with-an-appended-sig.patch | 2 +- ...e-grub_dl_set_persistent-for-the-emu.patch | 2 +- ...patch => 0159-pgp-factor-out-rsa_pad.patch | 10 +- ...rage-for-grub_crypto_pk_-to-crypto.c.patch | 4 +- ...p-tweaks-in-preparation-for-libtasn1.patch | 6 +- ...0162-libtasn1-import-libtasn1-4.16.0.patch | 30 +- ...asn1-disable-code-not-needed-in-grub.patch | 12 +- ...tasn1-changes-for-grub-compatibility.patch | 12 +- ...65-libtasn1-compile-into-asn1-module.patch | 6 +- ...6-test_asn1-test-module-for-libtasn1.patch | 36 +- ...-support-embedding-x509-certificates.patch | 29 +- ...res-import-GNUTLS-s-ASN.1-descriptio.patch | 4 +- ...res-parse-PKCS-7-signedData-and-X.50.patch | 8 +- ...res-support-verifying-appended-signa.patch | 10 +- ...pended-signatures-verification-tests.patch | 10 +- ...72-appended-signatures-documentation.patch | 2 +- ...er-lockdown-based-on-ibm-secure-boot.patch | 8 +- ...275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch | 2 +- ...-Also-handle-the-Extended-Key-Usage-.patch | 0 ...eee1275-ofdisk-retry-on-open-failure.patch | 0 ...ainloading-EFI-apps-from-loop-mounts.patch | 2 + ...> 0178-efinet-Add-DHCP-proxy-support.patch | 3 + ...gnore-checksum-seed-incompat-feature.patch | 0 ...-cmdline-when-generating-legacy-menu.patch | 4 +- ... 0181-Suppress-gettext-error-message.patch | 2 +- ...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 | 35 +- ...over-the-device-to-read-the-config-f.patch | 10 +- ...etting-of-prefix-for-signed-binary-c.patch | 25 +- ...adable-filesystem-with-v4-superblock.patch | 0 ...module-name-on-license-check-failure.patch | 0 ...pc-ieee1275-load-grub-at-4MB-not-2MB.patch | 2 +- ...-mkconfig-restore-umask-for-grub.cfg.patch | 1 - ...btrfs-Use-full-btrfs-bootloader-area.patch | 160 ++ ...-Fedora-location-of-DejaVu-SANS-font.patch | 30 + ...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 +++ 0200-Drop-gnulib-fix-base64.patch.patch | 140 ++ ...nu_auto_hide.in-fix-a-then-than-typo.patch | 26 - 0201-Drop-gnulib-no-abort.patch.patch | 97 + 0202-Fix-disabling-grub-rpm-sort.patch | 59 - ...version-and-drop-most-gnulib-patches.patch | 832 +++++++ ...-Don-t-check-for-rpmvercmp-in-librpm.patch | 57 - ...Fix-bug-stopping-iteration-when-no-f.patch | 1 - ...w-efidisk-only-option-on-EFI-systems.patch | 1 - ...h => 0205-efi-new-connectefi-command.patch | 5 +- ...-i386-efi-linux.c-do-not-validate-ke.patch | 73 + ...-arm64-linux.c-do-not-validate-kerne.patch | 58 + ...-efi-chainloader.c-do-not-validate-c.patch | 80 + ...s.timer-Only-run-if-not-in-a-contain.patch | 32 - ...-efi-linux.c-drop-now-unused-grub_li.patch | 83 + ...etection-support-device-names-with-c.patch | 3 +- ...Remove-outdated-URL-for-BLS-document.patch | 28 - ...=> 0211-make-ofdisk_retries-optional.patch | 2 - ...loader-grub_load_and_start_image-doe.patch | 7 +- ...hainloader-simplify-the-loader-state.patch | 20 +- ...ot-Add-API-to-pass-context-to-loader.patch | 1 - ...i-chainloader-Use-grub_loader_set_ex.patch | 15 +- ...linux-Avoid-a-use-after-free-in-the-.patch | 7 +- ...386-efi-linux-Use-grub_loader_set_ex.patch | 26 +- ...ix-signed-grub-special-case-for-Powe.patch | 43 - ...r-the-PE-magic-for-the-compiled-arch.patch | 63 - ...linux-Fix-a-memory-leak-in-the-initr.patch | 11 +- ...ct-non-kernel-files-in-the-shim_lock.patch | 1 - ...-leak-device_name-on-error-in-grub_f.patch | 7 +- ...g-Abort-sooner-if-a-read-operation-f.patch | 1 - ...g-Refuse-to-handle-multiple-image-he.patch | 1 - ...g-Drop-greyscale-support-to-fix-heap.patch | 1 - ...g-Avoid-heap-OOB-R-W-inserting-huff-.patch | 1 - ...-png-Sanity-check-some-huffman-codes.patch | 1 - ...eg-Abort-sooner-if-a-read-operation-.patch | 1 - ...eg-Do-not-reallocate-a-given-huff-ta.patch | 1 - ...eg-Refuse-to-handle-multiple-start-o.patch | 1 - ...eg-Block-int-underflow-wild-pointer-.patch | 1 - ...ix-array-out-of-bounds-formatting-un.patch | 1 - ...ff-Block-overly-large-netbuff-allocs.patch | 1 - ...2-net-ip-Do-IP-fragment-maths-safely.patch | 1 - ...le-free-addresses-on-corrupt-DNS-res.patch | 1 - ...ad-past-the-end-of-the-string-we-re-.patch | 1 - ...-a-UAF-and-double-free-from-a-failed.patch | 1 - ...=> 0236-net-tftp-Avoid-a-trivial-UAF.patch | 1 - ...tear-down-socket-if-it-s-already-bee.patch | 1 - ...Fix-OOB-write-for-split-http-headers.patch | 1 - ...or-out-on-headers-with-LF-without-CR.patch | 1 - ...ead-past-the-end-of-nat-journal-entr.patch | 1 - ...-not-read-past-the-end-of-nat-bitmap.patch | 1 - ...ot-copy-file-names-that-are-too-long.patch | 1 - ...eral-fuzz-issues-with-invalid-dir-it.patch | 3 +- ...e-ASAN-and-SEGV-issues-found-with-fu.patch | 3 +- ...x-more-fuzz-issues-related-to-chunks.patch | 3 +- ...grub_min-and-grub_max-more-resilient.patch | 1 - ...FS-switch-to-using-grub_min-grub_max.patch | 1 - ...oot_time-also-call-grub_dprintf-boot.patch | 1 - ...dules-make-.module_license-read-only.patch | 1 - ...p-.llvm_addrsig-sections-and-similar.patch | 1 - ...locate-space-for-non-allocable-secti.patch | 1 - ...eader-struct-and-fix-some-bad-naming.patch | 5 +- ...nel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch | 15 +- ...ule-sections-at-page-aligned-address.patch | 1 - ...-nx-add-memory-attribute-get-set-API.patch | 1 - ...-page-permissions-for-loaded-modules.patch | 1 - ...7-nx-set-attrs-in-our-kernel-loaders.patch | 64 +- ...x-compatible-flag-in-EFI-grub-images.patch | 1 - ...-document-the-behavior-of-multiple-v.patch | 25 + ...probe-dprint-errors-from-filesystems.patch | 43 + 0261-fs-fat-don-t-error-when-mtime-is-0.patch | 64 + ...file-show-which-file-filters-get-run.patch | 7 +- ...ed-array-positions-for-our-allocatio.patch | 9 +- ...tion-policy-for-kernel-vs-initrd-mem.patch | 21 +- ...-initrd-within-the-bounds-expressed-.patch | 9 +- ...ER_-CODE-DATA-for-kernel-and-initrd-.patch | 11 +- ...e-etc-kernel-cmdline-during-mkconfig.patch | 5 +- ...sh-don-t-dup-rhgb-quiet-check-mtimes.patch | 5 +- ...=> 0269-squish-give-up-on-rhgb-quiet.patch | 5 +- ...write-etc-kernel-cmdline-if-writable.patch | 5 +- ...scfg-Don-t-root-device-in-emu-builds.patch | 27 + ...ux-Remove-magic-number-header-field-.patch | 43 + 0273-Correct-BSS-zeroing-on-aarch64.patch | 95 + ...ate-i-cache-before-starting-the-kern.patch | 39 + ...ncorrect-array-size-in-kernel-alloca.patch | 5 +- ...i-tpm-Refine-the-status-of-log-event.patch | 1 - ...-Use-grub_strcpy-instead-of-grub_mem.patch | 1 - ...-EFI_CC_MEASUREMENT_PROTOCOL-support.patch | 1 - ...hs-exceeds-font-max_glyph_width-or-f.patch | 1 - ...erflow-in-grub_font_get_glyph_intern.patch | 1 - ...-integer-overflows-in-grub_font_cons.patch | 1 - ...0282-font-Remove-grub_font_dup_glyph.patch | 1 - ...nteger-overflow-in-ensure_comb_space.patch | 1 - ...nt-Fix-integer-overflow-in-BMP-index.patch | 1 - ...-underflow-in-binary-search-of-char-.patch | 1 - ...b-Enforce-verification-of-font-files.patch | 1 - ... => 0287-fbutil-Fix-integer-overflow.patch | 1 - ...ix-an-integer-underflow-in-blit_comb.patch | 1 - ..._font_blit_glyph-and-grub_font_blit_.patch | 1 - ...l_font-to-glyphs-in-ascii_font_glyph.patch | 1 - ...ix-an-integer-overflow-in-grub_unico.patch | 1 - ...ening-fonts-from-the-bundled-memdisk.patch | 78 + ... => 0293-mm-Clarify-grub_real_malloc.patch | 1 - ...loc-Make-small-allocs-comment-match-.patch | 1 - ....patch => 0295-mm-Document-grub_free.patch | 1 - ...0296-mm-Document-grub_mm_init_region.patch | 1 - ...-internal-memory-management-structur.patch | 1 - ...e-preserve-header-vs-region-alignmen.patch | 1 - ...-region-merge-with-region-after-as-w.patch | 1 - ...-Debug-support-for-region-operations.patch | 1 - ...p-unused-unloading-of-modules-on-OOM.patch | 1 - ...ally-requesting-additional-memory-re.patch | 1 - ...ys-request-a-fixed-number-of-pages-o.patch | 7 +- ...tract-function-to-add-memory-regions.patch | 13 +- ...ss-up-errors-from-add_memory_regions.patch | 7 +- ...-Implement-runtime-addition-of-pages.patch | 9 +- ...-default-memory-allocation-to-32-MiB.patch | 3 +- ...e-disk-caches-last-when-out-of-memor.patch | 1 - ...09-ppc64le-signed-boot-media-changes.patch | 8 +- ...veral-implicit-function-declarations.patch | 54 + ...rt-for-grub-emu-to-kexec-Linux-menu-.patch | 431 ++++ ...n-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch | 2 +- ...-memory-with-ibm-client-architecture.patch | 13 +- ...ee1275-drop-len-1-quirk-in-heap_init.patch | 0 ...1275-support-runtime-memory-claiming.patch | 0 ...5-implement-vec5-for-cas-negotiation.patch | 0 ...ort-for-trusted-boot-using-a-vTPM-2..patch | 8 +- ... => 0318-powerpc-Drop-Open-Hack-Ware.patch | 0 grub.macros | 8 +- grub.patches | 598 +++-- grub2.spec | 11 +- rpminspect.yaml | 9 - sources | 2 +- 342 files changed, 4656 insertions(+), 6506 deletions(-) delete mode 100644 0023-Don-t-write-messages-to-the-screen.patch rename 0032-Enable-pager-by-default.-985860.patch => 0023-Enable-pager-by-default.-985860.patch (94%) delete mode 100644 0024-Don-t-print-GNU-GRUB-header.patch create mode 100644 0024-Don-t-say-GNU-Linux-in-generated-menus.patch rename 0037-Add-.eh_frame-to-list-of-relocations-stripped.patch => 0025-Add-.eh_frame-to-list-of-relocations-stripped.patch (96%) delete mode 100644 0025-Don-t-add-to-highlighted-row.patch rename 0038-Don-t-require-a-password-to-boot-entries-generated-b.patch => 0026-Don-t-require-a-password-to-boot-entries-generated-b.patch (96%) delete mode 100644 0026-Message-string-cleanups.patch delete mode 100644 0027-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch rename 0041-use-fw_path-prefix-when-fallback-searching-for-grub-.patch => 0027-use-fw_path-prefix-when-fallback-searching-for-grub-.patch (89%) rename 0042-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch => 0028-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch (97%) delete mode 100644 0028-Use-the-correct-indentation-for-the-term-help-text.patch rename 0043-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch => 0029-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch (96%) delete mode 100644 0029-Indent-menu-entries.patch delete mode 100644 0030-Fix-margins.patch rename 0044-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch => 0030-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch (96%) rename 0045-Try-prefix-if-fw_path-doesn-t-work.patch => 0031-Try-prefix-if-fw_path-doesn-t-work.patch (97%) delete mode 100644 0031-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch rename 0047-Make-grub2-mkconfig-construct-titles-that-look-like-.patch => 0032-Make-grub2-mkconfig-construct-titles-that-look-like-.patch (98%) rename 0048-Add-friendly-grub2-password-config-tool-985962.patch => 0033-Add-friendly-grub2-password-config-tool-985962.patch (79%) delete mode 100644 0033-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch delete mode 100644 0034-Don-t-say-GNU-Linux-in-generated-menus.patch rename 0049-tcp-add-window-scaling-support.patch => 0034-tcp-add-window-scaling-support.patch (98%) delete mode 100644 0035-Don-t-draw-a-border-around-the-menu.patch rename 0050-efinet-and-bootp-add-support-for-dhcpv6.patch => 0035-efinet-and-bootp-add-support-for-dhcpv6.patch (98%) rename 0051-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch => 0036-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch (83%) delete mode 100644 0036-Use-the-standard-margin-for-the-timeout-string.patch rename 0052-bz1374141-fix-incorrect-mask-for-ppc64.patch => 0037-bz1374141-fix-incorrect-mask-for-ppc64.patch (94%) rename 0053-Make-grub_fatal-also-backtrace.patch => 0038-Make-grub_fatal-also-backtrace.patch (96%) delete mode 100644 0039-Don-t-emit-Booting-.-message.patch rename 0055-Make-our-info-pages-say-grub2-where-appropriate.patch => 0039-Make-our-info-pages-say-grub2-where-appropriate.patch (99%) delete mode 100644 0040-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch rename 0056-macos-just-build-chainloader-entries-don-t-try-any-x.patch => 0040-macos-just-build-chainloader-entries-don-t-try-any-x.patch (99%) rename 0057-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch => 0041-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch (99%) rename 0058-export-btrfs_subvol-and-btrfs_subvolid.patch => 0042-export-btrfs_subvol-and-btrfs_subvolid.patch (95%) rename 0059-grub2-btrfs-03-follow_default.patch => 0043-grub2-btrfs-03-follow_default.patch (97%) rename 0060-grub2-btrfs-04-grub2-install.patch => 0044-grub2-btrfs-04-grub2-install.patch (94%) rename 0061-grub2-btrfs-05-grub2-mkconfig.patch => 0045-grub2-btrfs-05-grub2-mkconfig.patch (94%) delete mode 100644 0046-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch rename 0062-grub2-btrfs-06-subvol-mount.patch => 0046-grub2-btrfs-06-subvol-mount.patch (98%) rename 0063-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch => 0047-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch (97%) rename 0064-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch => 0048-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch (98%) rename 0065-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch => 0049-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch (98%) rename 0066-Use-grub_efi_.-memory-helpers-where-reasonable.patch => 0050-Use-grub_efi_.-memory-helpers-where-reasonable.patch (89%) rename 0067-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch => 0051-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch (92%) rename 0068-don-t-use-int-for-efi-status.patch => 0052-don-t-use-int-for-efi-status.patch (94%) rename 0069-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch => 0053-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch (96%) rename 0070-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch => 0054-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch (96%) delete mode 100644 0054-Fix-up-some-man-pages-rpmdiff-noticed.patch rename 0071-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch => 0055-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch (97%) rename 0072-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch => 0056-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch (99%) rename 0073-align-struct-efi_variable-better.patch => 0057-align-struct-efi_variable-better.patch (92%) rename 0074-Add-BLS-support-to-grub-mkconfig.patch => 0058-Add-BLS-support-to-grub-mkconfig.patch (89%) rename 0075-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch => 0059-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch (95%) rename 0077-Add-grub2-switch-to-blscfg.patch => 0060-Add-grub2-switch-to-blscfg.patch (86%) rename 0078-make-better-backtraces.patch => 0061-make-better-backtraces.patch (96%) rename 0079-normal-don-t-draw-our-startup-message-if-debug-is-se.patch => 0062-normal-don-t-draw-our-startup-message-if-debug-is-se.patch (89%) rename 0080-Work-around-some-minor-include-path-weirdnesses.patch => 0063-Work-around-some-minor-include-path-weirdnesses.patch (97%) rename 0081-Make-it-possible-to-enabled-build-id-sha1.patch => 0064-Make-it-possible-to-enabled-build-id-sha1.patch (93%) rename 0082-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch => 0065-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch (95%) rename 0083-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch => 0066-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch (97%) rename 0084-Fixup-for-newer-compiler.patch => 0067-Fixup-for-newer-compiler.patch (93%) rename 0085-Don-t-attempt-to-export-the-start-and-_start-symbols.patch => 0068-Don-t-attempt-to-export-the-start-and-_start-symbols.patch (97%) rename 0086-Fixup-for-newer-compiler.patch => 0069-Fixup-for-newer-compiler.patch (96%) rename 0087-Add-support-for-non-Ethernet-network-cards.patch => 0070-Add-support-for-non-Ethernet-network-cards.patch (98%) rename 0088-net-read-bracketed-ipv6-addrs-and-port-numbers.patch => 0071-net-read-bracketed-ipv6-addrs-and-port-numbers.patch (98%) rename 0089-bootp-New-net_bootp6-command.patch => 0072-bootp-New-net_bootp6-command.patch (99%) rename 0090-efinet-UEFI-IPv6-PXE-support.patch => 0073-efinet-UEFI-IPv6-PXE-support.patch (98%) rename 0091-grub.texi-Add-net_bootp6-doument.patch => 0074-grub.texi-Add-net_bootp6-doument.patch (97%) rename 0092-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch => 0075-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch (98%) delete mode 100644 0076-Add-linux-and-initrd-commands-for-grub-emu.patch rename 0093-efinet-Setting-network-from-UEFI-device-path.patch => 0076-efinet-Setting-network-from-UEFI-device-path.patch (99%) rename 0094-efinet-Setting-DNS-server-from-UEFI-protocol.patch => 0077-efinet-Setting-DNS-server-from-UEFI-protocol.patch (99%) rename 0095-Support-UEFI-networking-protocols.patch => 0078-Support-UEFI-networking-protocols.patch (99%) rename 0096-AUDIT-0-http-boot-tracker-bug.patch => 0079-AUDIT-0-http-boot-tracker-bug.patch (96%) rename 0097-grub-editenv-Add-incr-command-to-increment-integer-v.patch => 0080-grub-editenv-Add-incr-command-to-increment-integer-v.patch (98%) rename 0098-Add-auto-hide-menu-support.patch => 0081-Add-auto-hide-menu-support.patch (93%) rename 0099-Add-grub-set-bootflag-utility.patch => 0082-Add-grub-set-bootflag-utility.patch (83%) rename 0100-docs-Add-grub-boot-indeterminate.service-example.patch => 0083-docs-Add-grub-boot-indeterminate.service-example.patch (97%) rename 0101-gentpl-add-disable-support.patch => 0084-gentpl-add-disable-support.patch (97%) rename 0102-gentpl-add-pc-firmware-type.patch => 0085-gentpl-add-pc-firmware-type.patch (95%) rename 0103-efinet-also-use-the-firmware-acceleration-for-http.patch => 0086-efinet-also-use-the-firmware-acceleration-for-http.patch (96%) rename 0104-efi-http-Make-root_url-reflect-the-protocol-hostname.patch => 0087-efi-http-Make-root_url-reflect-the-protocol-hostname.patch (97%) rename 0105-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch => 0088-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch (96%) rename 0106-module-verifier-make-it-possible-to-run-checkers-on-.patch => 0089-module-verifier-make-it-possible-to-run-checkers-on-.patch (94%) rename 0107-Rework-how-the-fdt-command-builds.patch => 0090-Rework-how-the-fdt-command-builds.patch (80%) rename 0108-Disable-non-wordsize-allocations-on-arm.patch => 0091-Disable-non-wordsize-allocations-on-arm.patch (93%) rename 0109-Prepend-prefix-when-HTTP-path-is-relative.patch => 0092-Prepend-prefix-when-HTTP-path-is-relative.patch (96%) rename 0110-Make-grub_error-more-verbose.patch => 0093-Make-grub_error-more-verbose.patch (96%) rename 0111-Make-reset-an-alias-for-the-reboot-command.patch => 0094-Make-reset-an-alias-for-the-reboot-command.patch (97%) rename 0112-Add-a-version-command.patch => 0095-Add-a-version-command.patch (89%) rename 0113-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch => 0096-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch (94%) rename 0114-arm-arm64-loader-Better-memory-allocation-and-error-.patch => 0097-arm-arm64-loader-Better-memory-allocation-and-error-.patch (99%) rename 0115-Try-to-pick-better-locations-for-kernel-and-initrd.patch => 0098-Try-to-pick-better-locations-for-kernel-and-initrd.patch (88%) create mode 100644 0099-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch rename 0117-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch => 0100-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch (92%) rename 0118-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch => 0101-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch (98%) rename 0119-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch => 0102-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch (99%) rename 0120-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch => 0103-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch (99%) rename 0121-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch => 0104-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch (98%) rename 0122-Fix-getroot.c-s-trampolines.patch => 0105-Fix-getroot.c-s-trampolines.patch (97%) rename 0123-Do-not-allow-stack-trampolines-anywhere.patch => 0106-Do-not-allow-stack-trampolines-anywhere.patch (90%) rename 0124-Reimplement-boot_counter.patch => 0107-Reimplement-boot_counter.patch (97%) rename 0125-Fix-menu-entry-selection-based-on-ID-and-title.patch => 0108-Fix-menu-entry-selection-based-on-ID-and-title.patch (99%) rename 0126-Make-the-menu-entry-users-option-argument-to-be-opti.patch => 0109-Make-the-menu-entry-users-option-argument-to-be-opti.patch (97%) rename 0127-Add-efi-export-env-and-efi-load-env-commands.patch => 0110-Add-efi-export-env-and-efi-load-env-commands.patch (97%) rename 0128-Make-it-possible-to-subtract-conditions-from-debug.patch => 0111-Make-it-possible-to-subtract-conditions-from-debug.patch (97%) rename 0129-Export-all-variables-from-the-initial-context-when-c.patch => 0112-Export-all-variables-from-the-initial-context-when-c.patch (95%) rename 0130-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch => 0113-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch (95%) rename 0133-Don-t-assume-that-boot-commands-will-only-return-on-.patch => 0114-Don-t-assume-that-boot-commands-will-only-return-on-.patch (98%) rename 0138-grub-set-bootflag-Update-comment-about-running-as-ro.patch => 0115-grub-set-bootflag-Update-comment-about-running-as-ro.patch (96%) delete mode 100644 0116-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch rename 0139-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch => 0116-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch (95%) rename 0140-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch => 0117-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch (91%) rename 0143-Add-start-symbol-for-RISC-V.patch => 0118-Add-start-symbol-for-RISC-V.patch (95%) rename 0144-bootstrap.conf-Force-autogen.sh-to-use-python3.patch => 0119-bootstrap.conf-Force-autogen.sh-to-use-python3.patch (92%) rename 0145-efi-http-Export-fw-http-_path-variables-to-make-them.patch => 0120-efi-http-Export-fw-http-_path-variables-to-make-them.patch (95%) rename 0146-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch => 0121-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch (99%) rename 0147-efi-net-Allow-to-specify-a-port-number-in-addresses.patch => 0122-efi-net-Allow-to-specify-a-port-number-in-addresses.patch (97%) rename 0148-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch => 0123-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch (97%) rename 0149-efi-net-Print-a-debug-message-if-parsing-the-address.patch => 0124-efi-net-Print-a-debug-message-if-parsing-the-address.patch (98%) rename 0150-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch => 0125-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch (96%) rename 0151-efi-Set-image-base-address-before-jumping-to-the-PE-.patch => 0126-efi-Set-image-base-address-before-jumping-to-the-PE-.patch (98%) rename 0152-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch => 0127-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch (98%) rename 0153-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch => 0128-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch (97%) rename 0154-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch => 0129-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch (97%) rename 0155-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch => 0130-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch (95%) delete mode 100644 0131-Fix-systemctl-kexec-exit-status-check.patch rename 0156-efi-dhcp-fix-some-allocation-error-checking.patch => 0131-efi-dhcp-fix-some-allocation-error-checking.patch (97%) delete mode 100644 0132-Print-grub-emu-linux-loader-messages-as-debug.patch rename 0157-efi-http-fix-some-allocation-error-checking.patch => 0132-efi-http-fix-some-allocation-error-checking.patch (96%) rename 0158-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch => 0133-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch (98%) delete mode 100644 0134-Fix-undefined-references-for-fdt-when-building-with-.patch rename 0159-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch => 0134-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch (97%) delete mode 100644 0135-Do-better-in-bootstrap.conf.patch rename 0160-linuxefi-fail-kernel-validation-without-shim-protoco.patch => 0135-linuxefi-fail-kernel-validation-without-shim-protoco.patch (96%) rename 0161-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch => 0136-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch (97%) delete mode 100644 0136-Use-git-to-apply-gnulib-patches.patch delete mode 100644 0137-Fix-build-error-with-the-fdt-module-on-risc-v.patch rename 0162-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch => 0137-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch (97%) rename 0163-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch => 0138-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch (96%) rename 0164-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch => 0139-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch (97%) rename 0165-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch => 0140-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch (97%) rename 0166-Add-systemd-integration-scripts-to-make-systemctl-re.patch => 0141-Add-systemd-integration-scripts-to-make-systemctl-re.patch (97%) delete mode 100644 0141-Also-define-GRUB_EFI_MAX_ALLOCATION_ADDRESS-for-RISC.patch delete mode 100644 0142-chainloader-Define-machine-types-for-RISC-V.patch rename 0167-systemd-integration.sh-Also-set-old-menu_show_once-g.patch => 0142-systemd-integration.sh-Also-set-old-menu_show_once-g.patch (97%) rename 0168-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch => 0143-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch (98%) rename 0169-grub-install-disable-support-for-EFI-platforms.patch => 0144-grub-install-disable-support-for-EFI-platforms.patch (74%) rename 0170-New-with-debug-timestamps-configure-flag-to-prepend-.patch => 0145-New-with-debug-timestamps-configure-flag-to-prepend-.patch (93%) rename 0171-Added-debug-statements-to-grub_disk_open-and-grub_di.patch => 0146-Added-debug-statements-to-grub_disk_open-and-grub_di.patch (97%) rename 0172-Introduce-function-grub_debug_is_enabled-void-return.patch => 0147-Introduce-function-grub_debug_is_enabled-void-return.patch (95%) rename 0173-Don-t-clear-screen-when-debugging-is-enabled.patch => 0148-Don-t-clear-screen-when-debugging-is-enabled.patch (55%) create mode 100644 0149-kern-file-Fix-error-handling-in-grub_file_open.patch rename 0174-grub_file_-instrumentation-new-file-debug-tag.patch => 0150-grub_file_-instrumentation-new-file-debug-tag.patch (81%) rename 0175-ieee1275-Avoiding-many-unecessary-open-close.patch => 0151-ieee1275-Avoiding-many-unecessary-open-close.patch (99%) rename 0176-ieee1275-powerpc-implements-fibre-channel-discovery-.patch => 0152-ieee1275-powerpc-implements-fibre-channel-discovery-.patch (98%) rename 0177-ieee1275-powerpc-enables-device-mapper-discovery.patch => 0153-ieee1275-powerpc-enables-device-mapper-discovery.patch (98%) rename 0178-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch => 0154-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch (97%) rename 0179-Add-suport-for-signing-grub-with-an-appended-signatu.patch => 0155-Add-suport-for-signing-grub-with-an-appended-signatu.patch (92%) rename 0180-docs-grub-Document-signing-grub-under-UEFI.patch => 0156-docs-grub-Document-signing-grub-under-UEFI.patch (98%) rename 0181-docs-grub-Document-signing-grub-with-an-appended-sig.patch => 0157-docs-grub-Document-signing-grub-with-an-appended-sig.patch (98%) rename 0182-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch => 0158-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch (96%) rename 0183-pgp-factor-out-rsa_pad.patch => 0159-pgp-factor-out-rsa_pad.patch (97%) rename 0184-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch => 0160-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch (96%) rename 0185-posix_wrap-tweaks-in-preparation-for-libtasn1.patch => 0161-posix_wrap-tweaks-in-preparation-for-libtasn1.patch (94%) rename 0186-libtasn1-import-libtasn1-4.16.0.patch => 0162-libtasn1-import-libtasn1-4.16.0.patch (99%) rename 0187-libtasn1-disable-code-not-needed-in-grub.patch => 0163-libtasn1-disable-code-not-needed-in-grub.patch (97%) rename 0188-libtasn1-changes-for-grub-compatibility.patch => 0164-libtasn1-changes-for-grub-compatibility.patch (96%) rename 0189-libtasn1-compile-into-asn1-module.patch => 0165-libtasn1-compile-into-asn1-module.patch (95%) rename 0190-test_asn1-test-module-for-libtasn1.patch => 0166-test_asn1-test-module-for-libtasn1.patch (99%) rename 0191-grub-install-support-embedding-x509-certificates.patch => 0167-grub-install-support-embedding-x509-certificates.patch (93%) rename 0192-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch => 0168-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch (99%) rename 0193-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch => 0169-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch (99%) rename 0194-appended-signatures-support-verifying-appended-signa.patch => 0170-appended-signatures-support-verifying-appended-signa.patch (98%) rename 0195-appended-signatures-verification-tests.patch => 0171-appended-signatures-verification-tests.patch (99%) rename 0196-appended-signatures-documentation.patch => 0172-appended-signatures-documentation.patch (99%) rename 0197-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch => 0173-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch (95%) rename 0198-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch => 0174-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch (98%) rename 0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch => 0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch (100%) rename 0200-ieee1275-ofdisk-retry-on-open-failure.patch => 0176-ieee1275-ofdisk-retry-on-open-failure.patch (100%) rename 0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch => 0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch (97%) rename 0205-efinet-Add-DHCP-proxy-support.patch => 0178-efinet-Add-DHCP-proxy-support.patch (95%) rename 0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch => 0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch (100%) rename 0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch => 0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch (92%) rename 0208-Suppress-gettext-error-message.patch => 0181-Suppress-gettext-error-message.patch (96%) rename 0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch => 0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch (100%) rename 0212-templates-Check-for-EFI-at-runtime-instead-of-config.patch => 0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch (100%) rename 0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch => 0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch (100%) rename 0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch => 0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch (82%) rename 0215-normal-main-Discover-the-device-to-read-the-config-f.patch => 0186-normal-main-Discover-the-device-to-read-the-config-f.patch (92%) rename 0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch => 0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch (71%) rename 0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch => 0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch (100%) rename 0220-Print-module-name-on-license-check-failure.patch => 0189-Print-module-name-on-license-check-failure.patch (100%) rename 0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch => 0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch (99%) rename 0222-grub-mkconfig-restore-umask-for-grub.cfg.patch => 0191-grub-mkconfig-restore-umask-for-grub.cfg.patch (95%) create mode 100644 0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch create mode 100644 0193-Add-Fedora-location-of-DejaVu-SANS-font.patch create mode 100644 0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch create mode 100644 0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch create mode 100644 0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch create mode 100644 0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch create mode 100644 0198-Use-visual-indentation-in-config.h.in.patch create mode 100644 0199-Where-present-ensure-config-util.h-precedes-config.h.patch create mode 100644 0200-Drop-gnulib-fix-base64.patch.patch delete mode 100644 0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch create mode 100644 0201-Drop-gnulib-no-abort.patch.patch delete mode 100644 0202-Fix-disabling-grub-rpm-sort.patch create mode 100644 0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch delete mode 100644 0203-Don-t-check-for-rpmvercmp-in-librpm.patch rename 0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch => 0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch (94%) rename 0224-search-new-efidisk-only-option-on-EFI-systems.patch => 0204-search-new-efidisk-only-option-on-EFI-systems.patch (98%) rename 0225-efi-new-connectefi-command.patch => 0205-efi-new-connectefi-command.patch (98%) create mode 100644 0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch create mode 100644 0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch create mode 100644 0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch delete mode 100644 0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch create mode 100644 0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch rename 0226-powerpc-prefix-detection-support-device-names-with-c.patch => 0210-powerpc-prefix-detection-support-device-names-with-c.patch (97%) delete mode 100644 0211-Remove-outdated-URL-for-BLS-document.patch rename 0227-make-ofdisk_retries-optional.patch => 0211-make-ofdisk_retries-optional.patch (96%) rename 0228-loader-efi-chainloader-grub_load_and_start_image-doe.patch => 0212-loader-efi-chainloader-grub_load_and_start_image-doe.patch (92%) rename 0229-loader-efi-chainloader-simplify-the-loader-state.patch => 0213-loader-efi-chainloader-simplify-the-loader-state.patch (95%) rename 0230-commands-boot-Add-API-to-pass-context-to-loader.patch => 0214-commands-boot-Add-API-to-pass-context-to-loader.patch (98%) rename 0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch => 0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch (91%) rename 0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch => 0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch (88%) rename 0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch => 0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch (92%) delete mode 100644 0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch delete mode 100644 0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch rename 0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch => 0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch (86%) rename 0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch => 0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch (98%) rename 0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch => 0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch (81%) rename 0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch => 0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch (98%) rename 0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch => 0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch (94%) rename 0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch => 0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch (98%) rename 0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch => 0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch (95%) rename 0241-video-readers-png-Sanity-check-some-huffman-codes.patch => 0225-video-readers-png-Sanity-check-some-huffman-codes.patch (95%) rename 0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch => 0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch (99%) rename 0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch => 0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch (94%) rename 0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch => 0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch (96%) rename 0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch => 0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch (96%) rename 0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch => 0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch (94%) rename 0247-net-netbuff-Block-overly-large-netbuff-allocs.patch => 0231-net-netbuff-Block-overly-large-netbuff-allocs.patch (95%) rename 0248-net-ip-Do-IP-fragment-maths-safely.patch => 0232-net-ip-Do-IP-fragment-maths-safely.patch (95%) rename 0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch => 0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch (96%) rename 0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch => 0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch (97%) rename 0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch => 0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch (98%) rename 0252-net-tftp-Avoid-a-trivial-UAF.patch => 0236-net-tftp-Avoid-a-trivial-UAF.patch (95%) rename 0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch => 0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch (95%) rename 0254-net-http-Fix-OOB-write-for-split-http-headers.patch => 0238-net-http-Fix-OOB-write-for-split-http-headers.patch (96%) rename 0255-net-http-Error-out-on-headers-with-LF-without-CR.patch => 0239-net-http-Error-out-on-headers-with-LF-without-CR.patch (95%) rename 0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch => 0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch (97%) rename 0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch => 0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch (98%) rename 0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch => 0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch (95%) rename 0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch => 0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch (96%) rename 0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch => 0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch (97%) rename 0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch => 0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch (96%) rename 0262-misc-Make-grub_min-and-grub_max-more-resilient.patch => 0246-misc-Make-grub_min-and-grub_max-more-resilient.patch (97%) rename 0263-ReiserFS-switch-to-using-grub_min-grub_max.patch => 0247-ReiserFS-switch-to-using-grub_min-grub_max.patch (98%) rename 0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch => 0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch (95%) rename 0265-modules-make-.module_license-read-only.patch => 0249-modules-make-.module_license-read-only.patch (94%) rename 0266-modules-strip-.llvm_addrsig-sections-and-similar.patch => 0250-modules-strip-.llvm_addrsig-sections-and-similar.patch (95%) rename 0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch => 0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch (95%) rename 0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch => 0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch (93%) rename 0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch => 0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch (85%) rename 0270-modules-load-module-sections-at-page-aligned-address.patch => 0254-modules-load-module-sections-at-page-aligned-address.patch (99%) rename 0271-nx-add-memory-attribute-get-set-API.patch => 0255-nx-add-memory-attribute-get-set-API.patch (99%) rename 0272-nx-set-page-permissions-for-loaded-modules.patch => 0256-nx-set-page-permissions-for-loaded-modules.patch (99%) rename 0273-nx-set-attrs-in-our-kernel-loaders.patch => 0257-nx-set-attrs-in-our-kernel-loaders.patch (91%) rename 0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch => 0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch (95%) create mode 100644 0259-grub-probe-document-the-behavior-of-multiple-v.patch create mode 100644 0260-grub_fs_probe-dprint-errors-from-filesystems.patch create mode 100644 0261-fs-fat-don-t-error-when-mtime-is-0.patch rename 0275-Make-debug-file-show-which-file-filters-get-run.patch => 0262-Make-debug-file-show-which-file-filters-get-run.patch (88%) rename 0276-efi-use-enumerated-array-positions-for-our-allocatio.patch => 0263-efi-use-enumerated-array-positions-for-our-allocatio.patch (92%) rename 0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch => 0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch (87%) rename 0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch => 0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch (87%) rename 0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch => 0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch (85%) rename 0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch => 0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch (86%) rename 0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch => 0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch (90%) rename 0282-squish-give-up-on-rhgb-quiet.patch => 0269-squish-give-up-on-rhgb-quiet.patch (84%) rename 0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch => 0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch (94%) create mode 100644 0271-blscfg-Don-t-root-device-in-emu-builds.patch create mode 100644 0272-loader-arm64-linux-Remove-magic-number-header-field-.patch create mode 100644 0273-Correct-BSS-zeroing-on-aarch64.patch create mode 100644 0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch rename 0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch => 0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch (90%) rename 0285-commands-efi-tpm-Refine-the-status-of-log-event.patch => 0276-commands-efi-tpm-Refine-the-status-of-log-event.patch (96%) rename 0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch => 0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch (96%) rename 0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch => 0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch (99%) rename 0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch => 0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch (94%) rename 0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch => 0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch (98%) rename 0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch => 0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch (97%) rename 0291-font-Remove-grub_font_dup_glyph.patch => 0282-font-Remove-grub_font_dup_glyph.patch (95%) rename 0292-font-Fix-integer-overflow-in-ensure_comb_space.patch => 0283-font-Fix-integer-overflow-in-ensure_comb_space.patch (96%) rename 0293-font-Fix-integer-overflow-in-BMP-index.patch => 0284-font-Fix-integer-overflow-in-BMP-index.patch (97%) rename 0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch => 0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch (97%) rename 0295-kern-efi-sb-Enforce-verification-of-font-files.patch => 0286-kern-efi-sb-Enforce-verification-of-font-files.patch (96%) rename 0296-fbutil-Fix-integer-overflow.patch => 0287-fbutil-Fix-integer-overflow.patch (98%) rename 0297-font-Fix-an-integer-underflow-in-blit_comb.patch => 0288-font-Fix-an-integer-underflow-in-blit_comb.patch (98%) rename 0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch => 0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch (97%) rename 0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch => 0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch (95%) rename 0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch => 0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch (96%) create mode 100644 0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch rename 0302-mm-Clarify-grub_real_malloc.patch => 0293-mm-Clarify-grub_real_malloc.patch (98%) rename 0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch => 0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch (95%) rename 0304-mm-Document-grub_free.patch => 0295-mm-Document-grub_free.patch (97%) rename 0305-mm-Document-grub_mm_init_region.patch => 0296-mm-Document-grub_mm_init_region.patch (97%) rename 0306-mm-Document-GRUB-internal-memory-management-structur.patch => 0297-mm-Document-GRUB-internal-memory-management-structur.patch (97%) rename 0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch => 0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch (96%) rename 0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch => 0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch (99%) rename 0309-mm-Debug-support-for-region-operations.patch => 0300-mm-Debug-support-for-region-operations.patch (97%) rename 0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch => 0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch (97%) rename 0311-mm-Allow-dynamically-requesting-additional-memory-re.patch => 0302-mm-Allow-dynamically-requesting-additional-memory-re.patch (98%) rename 0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch => 0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch (95%) rename 0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch => 0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch (89%) rename 0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch => 0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch (93%) rename 0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch => 0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch (90%) rename 0316-efi-Increase-default-memory-allocation-to-32-MiB.patch => 0307-efi-Increase-default-memory-allocation-to-32-MiB.patch (91%) rename 0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch => 0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch (96%) rename 0301-ppc64le-signed-boot-media-changes.patch => 0309-ppc64le-signed-boot-media-changes.patch (95%) create mode 100644 0310-core-Fix-several-implicit-function-declarations.patch create mode 100644 0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch rename 0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch => 0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch (99%) rename 0319-ieee1275-request-memory-with-ibm-client-architecture.patch => 0313-ieee1275-request-memory-with-ibm-client-architecture.patch (97%) rename 0320-ieee1275-drop-len-1-quirk-in-heap_init.patch => 0314-ieee1275-drop-len-1-quirk-in-heap_init.patch (100%) rename 0321-ieee1275-support-runtime-memory-claiming.patch => 0315-ieee1275-support-runtime-memory-claiming.patch (100%) rename 0322-ieee1275-implement-vec5-for-cas-negotiation.patch => 0316-ieee1275-implement-vec5-for-cas-negotiation.patch (100%) rename 0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch => 0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch (97%) rename 0324-powerpc-Drop-Open-Hack-Ware.patch => 0318-powerpc-Drop-Open-Hack-Ware.patch (100%) diff --git a/0007-Add-secureboot-support-on-efi-chainloader.patch b/0007-Add-secureboot-support-on-efi-chainloader.patch index bfb5a9b..34ead63 100644 --- a/0007-Add-secureboot-support-on-efi-chainloader.patch +++ b/0007-Add-secureboot-support-on-efi-chainloader.patch @@ -164,18 +164,33 @@ following branches: Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1347291 Signed-off-by: Laszlo Ersek + +Also: + +commit cc06f149fbd2d8c1da1e83173d21629ba97e0d92 +Author: Raymund Will + +chainloader: Define machine types for RISC-V + +The commit "Add secureboot support on efi chainloader" didn't add machine +types for RISC-V, so this patch adds them. + +Note, that grub-core/loader/riscv/linux.c is skipped because Linux is not +supported yet. This patch might need a new revision once that's the case. + +Signed-off-by: David Abdurachmanov --- grub-core/kern/efi/efi.c | 14 +- grub-core/loader/arm64/linux.c | 4 +- - grub-core/loader/efi/chainloader.c | 816 +++++++++++++++++++++++++++++++++---- + grub-core/loader/efi/chainloader.c | 820 +++++++++++++++++++++++++++++++++---- grub-core/loader/efi/linux.c | 25 +- grub-core/loader/i386/efi/linux.c | 17 +- include/grub/efi/linux.h | 2 +- include/grub/efi/pe32.h | 52 ++- - 7 files changed, 840 insertions(+), 90 deletions(-) + 7 files changed, 844 insertions(+), 90 deletions(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 35b8f670602..4a2259aa1c7 100644 +index 35b8f67060..4a2259aa1c 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -296,14 +296,20 @@ grub_efi_secure_boot (void) @@ -204,7 +219,7 @@ index 35b8f670602..4a2259aa1c7 100644 if (*secure_boot && !*setup_mode) ret = 1; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index a312c668685..04994d5c67d 100644 +index a312c66868..04994d5c67 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -284,6 +284,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -226,7 +241,7 @@ index a312c668685..04994d5c67d 100644 grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); goto fail; diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 2bd80f4db3d..b54cf6986fc 100644 +index 2bd80f4db3..e6a8d4ad0e 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -32,6 +32,8 @@ @@ -261,7 +276,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 grub_dl_unref (my_mod); return GRUB_ERR_NONE; -@@ -213,20 +221,690 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) +@@ -213,20 +221,694 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) return file_path; } @@ -376,6 +391,10 @@ index 2bd80f4db3d..b54cf6986fc 100644 + GRUB_PE32_MACHINE_I386; +#elif defined(__ia64__) + GRUB_PE32_MACHINE_IA64; ++#elif defined(__riscv) && (__riscv_xlen == 32) ++ GRUB_PE32_MACHINE_RISCV32; ++#elif defined(__riscv) && (__riscv_xlen == 64) ++ GRUB_PE32_MACHINE_RISCV64; +#else +#error this architecture is not supported by grub2 +#endif @@ -955,7 +974,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -@@ -238,15 +916,45 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -238,15 +920,45 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), address = 0; image_handle = 0; file_path = 0; @@ -1003,7 +1022,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 if (! dev) goto fail; -@@ -283,17 +991,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -283,17 +995,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (! file_path) goto fail; @@ -1024,7 +1043,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES, GRUB_EFI_LOADER_CODE, -@@ -307,7 +1012,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -307,7 +1016,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), } boot_image = (void *) ((grub_addr_t) address); @@ -1033,7 +1052,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 { if (grub_errno == GRUB_ERR_NONE) grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), -@@ -317,7 +1022,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -317,7 +1026,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), } #if defined (__i386__) || defined (__x86_64__) @@ -1042,7 +1061,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 { struct grub_macho_fat_header *head = boot_image; if (head->magic -@@ -326,6 +1031,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -326,6 +1035,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_uint32_t i; struct grub_macho_fat_arch *archs = (struct grub_macho_fat_arch *) (head + 1); @@ -1057,7 +1076,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 for (i = 0; i < grub_cpu_to_le32 (head->nfat_arch); i++) { if (GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT (archs[i].cputype)) -@@ -340,79 +1053,39 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -340,79 +1057,39 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), > ~grub_cpu_to_le32 (archs[i].size) || grub_cpu_to_le32 (archs[i].offset) + grub_cpu_to_le32 (archs[i].size) @@ -1154,7 +1173,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 if (dev) grub_device_close (dev); -@@ -424,6 +1097,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -424,6 +1101,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (address) efi_call_2 (b->free_pages, address, pages); @@ -1165,7 +1184,7 @@ index 2bd80f4db3d..b54cf6986fc 100644 return grub_errno; diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index c24202a5dd1..c8ecce6dfd0 100644 +index c24202a5dd..c8ecce6dfd 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -33,21 +33,34 @@ struct grub_efi_shim_lock @@ -1210,7 +1229,7 @@ index c24202a5dd1..c8ecce6dfd0 100644 #pragma GCC diagnostic push diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index bb2616a8092..6b24cbb9483 100644 +index bb2616a809..6b24cbb948 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -117,6 +117,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), @@ -1278,7 +1297,7 @@ index bb2616a8092..6b24cbb9483 100644 grub_file_close (file); diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h -index d9ede36773b..0033d9305a9 100644 +index d9ede36773..0033d9305a 100644 --- a/include/grub/efi/linux.h +++ b/include/grub/efi/linux.h @@ -22,7 +22,7 @@ @@ -1291,7 +1310,7 @@ index d9ede36773b..0033d9305a9 100644 grub_err_t EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index 0ed8781f037..a43adf27464 100644 +index 0ed8781f03..a43adf2746 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -223,7 +223,11 @@ struct grub_pe64_optional_header diff --git a/0010-re-write-.gitignore.patch b/0010-re-write-.gitignore.patch index 74cb0da..b6fa0be 100644 --- a/0010-re-write-.gitignore.patch +++ b/0010-re-write-.gitignore.patch @@ -4,14 +4,14 @@ Date: Mon, 8 Jul 2019 12:55:29 +0200 Subject: [PATCH] re-write .gitignore --- - .gitignore | 152 ++++++++++++++++++++++++++++++++++++++ + .gitignore | 150 ++++++++++++++++++++++++++++++++++++++ docs/.gitignore | 5 ++ grub-core/.gitignore | 16 ++++ grub-core/lib/.gitignore | 1 + include/grub/gcrypt/.gitignore | 2 + po/.gitignore | 5 ++ util/bash-completion.d/.gitignore | 2 + - 7 files changed, 183 insertions(+) + 7 files changed, 181 insertions(+) create mode 100644 docs/.gitignore create mode 100644 grub-core/.gitignore create mode 100644 grub-core/lib/.gitignore @@ -20,10 +20,10 @@ Subject: [PATCH] re-write .gitignore create mode 100644 util/bash-completion.d/.gitignore diff --git a/.gitignore b/.gitignore -index f6a1bd05175..594d0134d33 100644 +index f6a1bd0517..208d1d2325 100644 --- a/.gitignore +++ b/.gitignore -@@ -275,3 +275,155 @@ widthspec.bin +@@ -275,3 +275,153 @@ widthspec.bin /xfs_test /xzcompress_test /zfs_test @@ -152,8 +152,6 @@ index f6a1bd05175..594d0134d33 100644 +/grub*-reboot.8 +/grub*-render-label +/grub*-render-label.1 -+/grub*-rpm-sort -+/grub*-rpm-sort.8 +/grub*-script-check +/grub*-script-check.1 +/grub*-set-bootflag @@ -181,7 +179,7 @@ index f6a1bd05175..594d0134d33 100644 +/widthspec.h diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 -index 00000000000..e1d849ef95b +index 0000000000..e1d849ef95 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,5 @@ @@ -192,7 +190,7 @@ index 00000000000..e1d849ef95b +/version*.texi diff --git a/grub-core/.gitignore b/grub-core/.gitignore new file mode 100644 -index 00000000000..2acce281159 +index 0000000000..2acce28115 --- /dev/null +++ b/grub-core/.gitignore @@ -0,0 +1,16 @@ @@ -214,14 +212,14 @@ index 00000000000..2acce281159 +/trigtables.c diff --git a/grub-core/lib/.gitignore b/grub-core/lib/.gitignore new file mode 100644 -index 00000000000..68154591404 +index 0000000000..6815459140 --- /dev/null +++ b/grub-core/lib/.gitignore @@ -0,0 +1 @@ +/libgcrypt-grub/ diff --git a/include/grub/gcrypt/.gitignore b/include/grub/gcrypt/.gitignore new file mode 100644 -index 00000000000..8fbf5646246 +index 0000000000..8fbf564624 --- /dev/null +++ b/include/grub/gcrypt/.gitignore @@ -0,0 +1,2 @@ @@ -229,7 +227,7 @@ index 00000000000..8fbf5646246 +gcrypt.h diff --git a/po/.gitignore b/po/.gitignore new file mode 100644 -index 00000000000..f507e7741e3 +index 0000000000..f507e7741e --- /dev/null +++ b/po/.gitignore @@ -0,0 +1,5 @@ @@ -240,7 +238,7 @@ index 00000000000..f507e7741e3 +/stamp-po diff --git a/util/bash-completion.d/.gitignore b/util/bash-completion.d/.gitignore new file mode 100644 -index 00000000000..6813a527ad3 +index 0000000000..6813a527ad --- /dev/null +++ b/util/bash-completion.d/.gitignore @@ -0,0 +1,2 @@ diff --git a/0011-IBM-client-architecture-CAS-reboot-support.patch b/0011-IBM-client-architecture-CAS-reboot-support.patch index eaaf9a4..316b9eb 100644 --- a/0011-IBM-client-architecture-CAS-reboot-support.patch +++ b/0011-IBM-client-architecture-CAS-reboot-support.patch @@ -7,16 +7,20 @@ This is an implementation of IBM client architecture (CAS) reboot for GRUB. There are cases where the POWER firmware must reboot in order to support specific features requested by a kernel. The kernel calls -ibm,client-architecture-support and it may either return or reboot with the new -feature set. eg: +ibm,client-architecture-support and it may either return or reboot with +the new feature set. eg: Calling ibm,client-architecture-support.../ Elapsed time since release of system processors: 70959 mins 50 secs Welcome to GRUB! -Instead of return to the GRUB menu, it will check if the flag for CAS reboot is -set. If so, grub will automatically boot the last booted kernel using the same -parameters +Instead of return to the GRUB menu, it will check if the flag for CAS +reboot is set. If so, grub will automatically boot the last booted +kernel using the same parameters + +Signed-off-by: Paulo Flabiano Smorigo +[rharwood@redhat.com: commit message rewrap] +Signed-off-by: Robbie Harwood --- grub-core/kern/ieee1275/openfw.c | 63 ++++++++++++++++++++++++++++++++++++++++ grub-core/normal/main.c | 19 ++++++++++++ @@ -25,7 +29,7 @@ parameters 4 files changed, 91 insertions(+) diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index 4d493ab7661..3a6689abb11 100644 +index 4d493ab766..3a6689abb1 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c @@ -591,3 +591,66 @@ grub_ieee1275_get_boot_dev (void) @@ -96,7 +100,7 @@ index 4d493ab7661..3a6689abb11 100644 + return 0; +} diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index c4ebe9e22ad..70614de1565 100644 +index c4ebe9e22a..70614de156 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -34,6 +34,9 @@ @@ -133,7 +137,7 @@ index c4ebe9e22ad..70614de1565 100644 grub_errno = GRUB_ERR_NONE; } diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index 25158407dd8..ad80399246a 100644 +index 25158407dd..ad80399246 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -28,6 +28,9 @@ @@ -158,7 +162,7 @@ index 25158407dd8..ad80399246a 100644 { char *line; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 73e2f464475..0a599607f31 100644 +index 73e2f46447..0a599607f3 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -254,6 +254,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali diff --git a/0012-for-ppc-reset-console-display-attr-when-clear-screen.patch b/0012-for-ppc-reset-console-display-attr-when-clear-screen.patch index c8bb9d3..121af84 100644 --- a/0012-for-ppc-reset-console-display-attr-when-clear-screen.patch +++ b/0012-for-ppc-reset-console-display-attr-when-clear-screen.patch @@ -10,12 +10,14 @@ This should fix this bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=908519 Signed-off-by: Peter Jones +Signed-off-by: Paulo Flabiano Smorigo +Signed-off-by: Robbie Harwood --- grub-core/term/terminfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c -index 85ecf06b4df..05c88dcf49e 100644 +index 85ecf06b4d..05c88dcf49 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -151,7 +151,7 @@ grub_terminfo_set_current (struct grub_term_output *term, diff --git a/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch b/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch index 1d1ad1d..917943f 100644 --- a/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -5,6 +5,9 @@ Subject: [PATCH] Disable GRUB video support for IBM power machines Should fix the problem in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=973205 + +Signed-off-by: Paulo Flabiano Smorigo +Signed-off-by: Robbie Harwood --- grub-core/kern/ieee1275/cmain.c | 5 ++++- grub-core/video/ieee1275.c | 9 ++++++--- @@ -48,7 +51,7 @@ index 17a3dbbb57..b8e4b3feb3 100644 GRUB_MOD_FINI(ieee1275_fb) diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 0a599607f3..49dbd2ebfb 100644 +index 0a599607f3..b5a1d49bbc 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -148,6 +148,8 @@ enum grub_ieee1275_flag @@ -56,7 +59,7 @@ index 0a599607f3..49dbd2ebfb 100644 GRUB_IEEE1275_FLAG_RAW_DEVNAMES, + -+ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, ++ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT }; extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); diff --git a/0018-Migrate-PPC-from-Yaboot-to-Grub2.patch b/0018-Migrate-PPC-from-Yaboot-to-Grub2.patch index ee8c7ab..1e310e9 100644 --- a/0018-Migrate-PPC-from-Yaboot-to-Grub2.patch +++ b/0018-Migrate-PPC-from-Yaboot-to-Grub2.patch @@ -3,8 +3,11 @@ From: Mark Hamzy Date: Wed, 28 Mar 2012 14:46:41 -0500 Subject: [PATCH] Migrate PPC from Yaboot to Grub2 -Add configuration support for serial terminal consoles. This will set the -maximum screen size so that text is not overwritten. +Add configuration support for serial terminal consoles. This will set +the maximum screen size so that text is not overwritten. + +Signed-off-by: Mark Hamzy +Signed-off-by: Robbie Harwood --- Makefile.util.def | 7 +++ util/grub.d/20_ppc_terminfo.in | 114 +++++++++++++++++++++++++++++++++++++++++ @@ -12,7 +15,7 @@ maximum screen size so that text is not overwritten. create mode 100644 util/grub.d/20_ppc_terminfo.in diff --git a/Makefile.util.def b/Makefile.util.def -index f8b356cc1fa..2c9b283a230 100644 +index f8b356cc1f..2c9b283a23 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -508,6 +508,13 @@ script = { @@ -31,7 +34,7 @@ index f8b356cc1fa..2c9b283a230 100644 common = util/grub.d/30_os-prober.in; diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in new file mode 100644 -index 00000000000..10d66586820 +index 0000000000..10d6658682 --- /dev/null +++ b/util/grub.d/20_ppc_terminfo.in @@ -0,0 +1,114 @@ diff --git a/0019-Add-fw_path-variable-revised.patch b/0019-Add-fw_path-variable-revised.patch index df9ef83..804938b 100644 --- a/0019-Add-fw_path-variable-revised.patch +++ b/0019-Add-fw_path-variable-revised.patch @@ -8,13 +8,16 @@ found. It was originally written by Matthew Garrett, and adapted to fix the "No modules are loaded on grub2 network boot" issue: https://bugzilla.redhat.com/show_bug.cgi?id=857936 + +Signed-off-by: Paulo Flabiano Smorigo +Signed-off-by: Robbie Harwood --- grub-core/kern/main.c | 13 ++++++------- grub-core/normal/main.c | 25 ++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 73967e2f5b0..d1de9fa6873 100644 +index 73967e2f5b..d1de9fa687 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -128,16 +128,15 @@ grub_set_prefix_and_root (void) @@ -41,7 +44,7 @@ index 73967e2f5b0..d1de9fa6873 100644 } diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 70614de1565..62571e6dfcc 100644 +index 70614de156..62571e6dfc 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -339,7 +339,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), diff --git a/0023-Don-t-write-messages-to-the-screen.patch b/0023-Don-t-write-messages-to-the-screen.patch deleted file mode 100644 index 01d0264..0000000 --- a/0023-Don-t-write-messages-to-the-screen.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Wed, 15 May 2013 13:30:20 -0400 -Subject: [PATCH] Don't write messages to the screen - -Writing messages to the screen before the menus or boot splash -happens so quickly it looks like something is wrong and isn't -very appealing. ---- - grub-core/gettext/gettext.c | 25 +++++-------------------- - grub-core/kern/main.c | 5 ----- - grub-core/boot/i386/pc/boot.S | 3 --- - grub-core/boot/i386/pc/diskboot.S | 5 ----- - util/grub.d/10_linux.in | 7 ------- - 5 files changed, 5 insertions(+), 40 deletions(-) - -diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c -index 4d02e62c109..84d520cd494 100644 ---- a/grub-core/gettext/gettext.c -+++ b/grub-core/gettext/gettext.c -@@ -434,16 +434,12 @@ static char * - grub_gettext_env_write_lang (struct grub_env_var *var - __attribute__ ((unused)), const char *val) - { -- grub_err_t err; -+ grub_err_t __attribute__((__unused__)) err; - err = grub_gettext_init_ext (&main_context, val, grub_env_get ("locale_dir"), - grub_env_get ("prefix")); -- if (err) -- grub_print_error (); - - err = grub_gettext_init_ext (&secondary_context, val, - grub_env_get ("secondary_locale_dir"), 0); -- if (err) -- grub_print_error (); - - return grub_strdup (val); - } -@@ -451,23 +447,19 @@ grub_gettext_env_write_lang (struct grub_env_var *var - void - grub_gettext_reread_prefix (const char *val) - { -- grub_err_t err; -+ grub_err_t __attribute__((__unused__)) err; - err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), - grub_env_get ("locale_dir"), - val); -- if (err) -- grub_print_error (); - } - - static char * - read_main (struct grub_env_var *var - __attribute__ ((unused)), const char *val) - { -- grub_err_t err; -+ grub_err_t __attribute__((__unused__)) err; - err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), val, - grub_env_get ("prefix")); -- if (err) -- grub_print_error (); - return grub_strdup (val); - } - -@@ -475,12 +467,9 @@ static char * - read_secondary (struct grub_env_var *var - __attribute__ ((unused)), const char *val) - { -- grub_err_t err; -+ grub_err_t __attribute__((__unused__)) err; - err = grub_gettext_init_ext (&secondary_context, grub_env_get ("lang"), val, - 0); -- if (err) -- grub_print_error (); -- - return grub_strdup (val); - } - -@@ -500,18 +489,14 @@ grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)), - GRUB_MOD_INIT (gettext) - { - const char *lang; -- grub_err_t err; -+ grub_err_t __attribute__((__unused__)) err; - - lang = grub_env_get ("lang"); - - err = grub_gettext_init_ext (&main_context, lang, grub_env_get ("locale_dir"), - grub_env_get ("prefix")); -- if (err) -- grub_print_error (); - err = grub_gettext_init_ext (&secondary_context, lang, - grub_env_get ("secondary_locale_dir"), 0); -- if (err) -- grub_print_error (); - - grub_register_variable_hook ("locale_dir", NULL, read_main); - grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); -diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index d1de9fa6873..48058d983ce 100644 ---- a/grub-core/kern/main.c -+++ b/grub-core/kern/main.c -@@ -269,11 +269,6 @@ grub_main (void) - - grub_boot_time ("After machine init."); - -- /* Hello. */ -- grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); -- grub_printf ("Welcome to GRUB!\n\n"); -- grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); -- - /* Init verifiers API. */ - grub_verifiers_init (); - -diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S -index 2bd0b2d2866..ea167fe1206 100644 ---- a/grub-core/boot/i386/pc/boot.S -+++ b/grub-core/boot/i386/pc/boot.S -@@ -249,9 +249,6 @@ real_start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- MSG(notification_string) -- - /* set %si to the disk address packet */ - movw $disk_address_packet, %si - -diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S -index c1addc0df29..68d31de0c4c 100644 ---- a/grub-core/boot/i386/pc/diskboot.S -+++ b/grub-core/boot/i386/pc/diskboot.S -@@ -50,11 +50,6 @@ _start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- pushw %si -- MSG(notification_string) -- popw %si -- - /* this sets up for the first run through "bootloop" */ - movw $LOCAL(firstlist), %di - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index dc75a1c30bf..ad2ac4b078d 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -138,27 +138,20 @@ linux_entry () - fi - printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" - fi -- message="$(gettext_printf "Loading Linux %s ..." ${version})" - sed "s/^/$submenu_indentation/" << EOF -- echo '$(echo "$message" | grub_quote)' - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} - EOF - if test -n "${initrd}" ; then -- # TRANSLATORS: ramdisk isn't identifier. Should be translated. -- message="$(gettext_printf "Loading initial ramdisk ...")" - initrd_path= - for i in ${initrd}; do - initrd_path="${initrd_path} ${rel_dirname}/${i}" - done - sed "s/^/$submenu_indentation/" << EOF -- echo '$(echo "$message" | grub_quote)' - initrd $(echo $initrd_path) - EOF - fi - if test -n "${fdt}" ; then -- message="$(gettext_printf "Loading fdt ...")" - sed "s/^/$submenu_indentation/" << EOF -- echo '$(echo "$message" | grub_quote)' - devicetree ${rel_dirname}/${fdt} - EOF - fi diff --git a/0032-Enable-pager-by-default.-985860.patch b/0023-Enable-pager-by-default.-985860.patch similarity index 94% rename from 0032-Enable-pager-by-default.-985860.patch rename to 0023-Enable-pager-by-default.-985860.patch index d92fbcc..63cf787 100644 --- a/0032-Enable-pager-by-default.-985860.patch +++ b/0023-Enable-pager-by-default.-985860.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 93a90233ead..858b526c925 100644 +index 93a90233ea..858b526c92 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -43,6 +43,8 @@ if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_ diff --git a/0024-Don-t-print-GNU-GRUB-header.patch b/0024-Don-t-print-GNU-GRUB-header.patch deleted file mode 100644 index c903fd4..0000000 --- a/0024-Don-t-print-GNU-GRUB-header.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Wed, 15 May 2013 13:53:48 -0400 -Subject: [PATCH] Don't print GNU GRUB header - -No one cares. ---- - grub-core/normal/main.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 7ca2e5400b1..5d5f7b539f5 100644 ---- a/grub-core/normal/main.c -+++ b/grub-core/normal/main.c -@@ -208,15 +208,16 @@ read_config_file (const char *config) - /* Initialize the screen. */ - void - grub_normal_init_page (struct grub_term_output *term, -- int y) -+ int y __attribute__((__unused__))) - { -+ grub_term_cls (term); -+ -+#if 0 - grub_ssize_t msg_len; - int posx; - char *msg_formatted; - grub_uint32_t *unicode_msg; - grub_uint32_t *last_position; -- -- grub_term_cls (term); - - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); - if (!msg_formatted) -@@ -241,6 +242,7 @@ grub_normal_init_page (struct grub_term_output *term, - grub_putcode ('\n', term); - grub_putcode ('\n', term); - grub_free (unicode_msg); -+#endif - } - - static void diff --git a/0024-Don-t-say-GNU-Linux-in-generated-menus.patch b/0024-Don-t-say-GNU-Linux-in-generated-menus.patch new file mode 100644 index 0000000..5b96784 --- /dev/null +++ b/0024-Don-t-say-GNU-Linux-in-generated-menus.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 14 Mar 2011 14:27:42 -0400 +Subject: [PATCH] Don't say "GNU/Linux" in generated menus. + +[rharwood: say it even less] +--- + grub-core/normal/main.c | 2 +- + tests/util/grub-shell-tester.in | 2 +- + tests/util/grub-shell.in | 2 +- + util/grub.d/10_linux.in | 4 ++-- + util/grub.d/20_linux_xen.in | 4 ++-- + 5 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 7ca2e5400b..98372217ad 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -218,7 +218,7 @@ grub_normal_init_page (struct grub_term_output *term, + + grub_term_cls (term); + +- msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); ++ msg_formatted = grub_xasprintf (_("GRUB version %s"), PACKAGE_VERSION); + if (!msg_formatted) + return; + +diff --git a/tests/util/grub-shell-tester.in b/tests/util/grub-shell-tester.in +index 8a87109b15..9a4319d4f4 100644 +--- a/tests/util/grub-shell-tester.in ++++ b/tests/util/grub-shell-tester.in +@@ -56,7 +56,7 @@ for option in "$@"; do + usage + exit 0 ;; + -v | --version) +- echo "$0 (GNU GRUB ${PACKAGE_VERSION})" ++ echo "$0 (GRUB ${PACKAGE_VERSION})" + exit 0 ;; + --modules=*) + ms=`echo "$option" | sed -e 's/--modules=//'` +diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in +index 93e9f51484..ec1182bf93 100644 +--- a/tests/util/grub-shell.in ++++ b/tests/util/grub-shell.in +@@ -209,7 +209,7 @@ for option in "$@"; do + usage + exit 0 ;; + -v | --version) +- echo "$0 (GNU GRUB ${PACKAGE_VERSION})" ++ echo "$0 (GRUB ${PACKAGE_VERSION})" + exit 0 ;; + --trim) + trim=1 +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index dc75a1c30b..4a499c53a6 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" + CLASS="--class gnu-linux --class gnu --class os" + + if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then +- OS=GNU/Linux ++ OS="$(sed 's, release .*$,,g' /etc/system-release)" + else +- OS="${GRUB_DISTRIBUTOR} GNU/Linux" ++ OS="${GRUB_DISTRIBUTOR}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" + fi + +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index 3b1f470492..ada20775a1 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" + CLASS="--class gnu-linux --class gnu --class os --class xen" + + if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then +- OS=GNU/Linux ++ OS="$(sed 's, release .*$,,g' /etc/system-release)" + else +- OS="${GRUB_DISTRIBUTOR} GNU/Linux" ++ OS="${GRUB_DISTRIBUTOR}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" + fi + diff --git a/0037-Add-.eh_frame-to-list-of-relocations-stripped.patch b/0025-Add-.eh_frame-to-list-of-relocations-stripped.patch similarity index 96% rename from 0037-Add-.eh_frame-to-list-of-relocations-stripped.patch rename to 0025-Add-.eh_frame-to-list-of-relocations-stripped.patch index ed48c5c..0532a04 100644 --- a/0037-Add-.eh_frame-to-list-of-relocations-stripped.patch +++ b/0025-Add-.eh_frame-to-list-of-relocations-stripped.patch @@ -8,7 +8,7 @@ Subject: [PATCH] Add .eh_frame to list of relocations stripped 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Makefile.common b/conf/Makefile.common -index 2a1a886f6d5..191b1a70c6b 100644 +index 2a1a886f6d..191b1a70c6 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding diff --git a/0025-Don-t-add-to-highlighted-row.patch b/0025-Don-t-add-to-highlighted-row.patch deleted file mode 100644 index b83f543..0000000 --- a/0025-Don-t-add-to-highlighted-row.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Wed, 15 May 2013 17:49:45 -0400 -Subject: [PATCH] Don't add '*' to highlighted row - -It is already highlighted. ---- - grub-core/normal/menu_text.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 18240e76cea..65deafda531 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -242,7 +242,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, - unicode_title[i] = ' '; - - if (data->geo.num_entries > 1) -- grub_putcode (highlight ? '*' : ' ', data->term); -+ grub_putcode (' ', data->term); - - grub_print_ucs4_menu (unicode_title, - unicode_title + len, diff --git a/0038-Don-t-require-a-password-to-boot-entries-generated-b.patch b/0026-Don-t-require-a-password-to-boot-entries-generated-b.patch similarity index 96% rename from 0038-Don-t-require-a-password-to-boot-entries-generated-b.patch rename to 0026-Don-t-require-a-password-to-boot-entries-generated-b.patch index fb0e197..89887c1 100644 --- a/0038-Don-t-require-a-password-to-boot-entries-generated-b.patch +++ b/0026-Don-t-require-a-password-to-boot-entries-generated-b.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 4fc58c83304..635d2fe0cd3 100644 +index 4a499c53a6..cf8d118698 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" diff --git a/0026-Message-string-cleanups.patch b/0026-Message-string-cleanups.patch deleted file mode 100644 index e23ee1a..0000000 --- a/0026-Message-string-cleanups.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 11:09:04 -0400 -Subject: [PATCH] Message string cleanups - -Make use of terminology consistent. Remove jargon. ---- - grub-core/normal/menu_text.c | 21 +++++++++------------ - 1 file changed, 9 insertions(+), 12 deletions(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 65deafda531..cc5837ed2b8 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -157,9 +157,8 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) - - if (edit) - { -- ret += grub_print_message_indented_real (_("Minimum Emacs-like screen editing is \ --supported. TAB lists completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a \ --command-line or ESC to discard edits and return to the GRUB menu."), -+ ret += grub_print_message_indented_real (_("Press Ctrl-x or F10 to start, Ctrl-c or F2 for a \ -+command prompt or Escape to discard edits and return to the menu. Pressing Tab lists possible completions."), - STANDARD_MARGIN, STANDARD_MARGIN, - term, dry_run); - } -@@ -167,8 +166,8 @@ command-line or ESC to discard edits and return to the GRUB menu."), - { - char *msg_translated; - -- msg_translated = grub_xasprintf (_("Use the %C and %C keys to select which " -- "entry is highlighted."), -+ msg_translated = grub_xasprintf (_("Use the %C and %C keys to change the " -+ "selection."), - GRUB_UNICODE_UPARROW, - GRUB_UNICODE_DOWNARROW); - if (!msg_translated) -@@ -181,17 +180,15 @@ command-line or ESC to discard edits and return to the GRUB menu."), - if (nested) - { - ret += grub_print_message_indented_real -- (_("Press enter to boot the selected OS, " -- "`e' to edit the commands before booting " -- "or `c' for a command-line. ESC to return previous menu."), -+ (_("Press 'e' to edit the selected item, " -+ "or 'c' for a command prompt. Press Escape to return to the previous menu."), - STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); - } - else - { - ret += grub_print_message_indented_real -- (_("Press enter to boot the selected OS, " -- "`e' to edit the commands before booting " -- "or `c' for a command-line."), -+ (_("Press 'e' to edit the selected item, " -+ "or 'c' for a command prompt."), - STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); - } - } -@@ -443,7 +440,7 @@ menu_text_print_timeout (int timeout, void *dataptr) - || data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN) - msg_translated = grub_xasprintf (_("%ds"), timeout); - else -- msg_translated = grub_xasprintf (_("The highlighted entry will be executed automatically in %ds."), timeout); -+ msg_translated = grub_xasprintf (_("The selected entry will be started automatically in %ds."), timeout); - if (!msg_translated) - { - grub_print_error (); diff --git a/0027-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch b/0027-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch deleted file mode 100644 index 920ef79..0000000 --- a/0027-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 14:08:23 -0400 -Subject: [PATCH] Fix border spacing now that we aren't displaying it - ---- - grub-core/normal/menu_text.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index cc5837ed2b8..b49835a9af7 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -331,12 +331,12 @@ grub_menu_init_page (int nested, int edit, - int empty_lines = 1; - int version_msg = 1; - -- geo->border = 1; -- geo->first_entry_x = 1 /* margin */ + 1 /* border */; -+ geo->border = 0; -+ geo->first_entry_x = 0 /* margin */ + 0 /* border */; - geo->entry_width = grub_term_width (term) - 5; - - geo->first_entry_y = 2 /* two empty lines*/ -- + 1 /* GNU GRUB version text */ + 1 /* top border */; -+ + 0 /* GNU GRUB version text */ + 1 /* top border */; - - geo->timeout_lines = 2; - diff --git a/0041-use-fw_path-prefix-when-fallback-searching-for-grub-.patch b/0027-use-fw_path-prefix-when-fallback-searching-for-grub-.patch similarity index 89% rename from 0041-use-fw_path-prefix-when-fallback-searching-for-grub-.patch rename to 0027-use-fw_path-prefix-when-fallback-searching-for-grub-.patch index 985205c..1da91e1 100644 --- a/0041-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +++ b/0027-use-fw_path-prefix-when-fallback-searching-for-grub-.patch @@ -17,10 +17,10 @@ Signed-off-by: Mark Salter 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index ec1cd257397..d85f7598d23 100644 +index 98372217ad..bf24e65713 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -349,7 +349,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +@@ -347,7 +347,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), char *config; const char *prefix, *fw_path; @@ -29,7 +29,7 @@ index ec1cd257397..d85f7598d23 100644 if (fw_path) { config = grub_xasprintf ("%s/grub.cfg", fw_path); -@@ -372,7 +372,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +@@ -370,7 +370,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), } } diff --git a/0042-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch b/0028-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch similarity index 97% rename from 0042-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch rename to 0028-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch index 61dd5ca..0d77281 100644 --- a/0042-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +++ b/0028-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch @@ -9,10 +9,10 @@ Signed-off-by: Peter Jones 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index d85f7598d23..1e509fceb91 100644 +index bf24e65713..0a99768f75 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -347,61 +347,66 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +@@ -345,61 +345,66 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), /* Guess the config filename. It is necessary to make CONFIG static, so that it won't get broken by longjmp. */ char *config; diff --git a/0028-Use-the-correct-indentation-for-the-term-help-text.patch b/0028-Use-the-correct-indentation-for-the-term-help-text.patch deleted file mode 100644 index 0ce3b04..0000000 --- a/0028-Use-the-correct-indentation-for-the-term-help-text.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 14:08:49 -0400 -Subject: [PATCH] Use the correct indentation for the term help text - -That is consistent with the menu help text ---- - grub-core/normal/main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 5d5f7b539f5..ec1cd257397 100644 ---- a/grub-core/normal/main.c -+++ b/grub-core/normal/main.c -@@ -440,8 +440,8 @@ grub_normal_reader_init (int nested) - grub_normal_init_page (term, 1); - grub_term_setcursor (term, 1); - -- if (grub_term_width (term) > 3 + STANDARD_MARGIN + 20) -- grub_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term); -+ if (grub_term_width (term) > 2 * STANDARD_MARGIN + 20) -+ grub_print_message_indented (msg_formatted, STANDARD_MARGIN, STANDARD_MARGIN, term); - else - grub_print_message_indented (msg_formatted, 0, 0, term); - grub_putcode ('\n', term); diff --git a/0043-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/0029-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch similarity index 96% rename from 0043-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch rename to 0029-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch index ef0b0f4..f22e6f9 100644 --- a/0043-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +++ b/0029-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 635d2fe0cd3..fed73271478 100644 +index cf8d118698..5f6d3c8d52 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" diff --git a/0029-Indent-menu-entries.patch b/0029-Indent-menu-entries.patch deleted file mode 100644 index 7e588fd..0000000 --- a/0029-Indent-menu-entries.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 14:30:55 -0400 -Subject: [PATCH] Indent menu entries - ---- - grub-core/normal/menu_text.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index b49835a9af7..6a57376fa80 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -239,7 +239,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, - unicode_title[i] = ' '; - - if (data->geo.num_entries > 1) -- grub_putcode (' ', data->term); -+ for (i = 0; i < STANDARD_MARGIN; i++) -+ grub_putcode (' ', data->term); - - grub_print_ucs4_menu (unicode_title, - unicode_title + len, diff --git a/0030-Fix-margins.patch b/0030-Fix-margins.patch deleted file mode 100644 index baa10ed..0000000 --- a/0030-Fix-margins.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 14:59:36 -0400 -Subject: [PATCH] Fix margins - ---- - grub-core/normal/menu_text.c | 8 +++----- - 1 file changed, 3 insertions(+), 5 deletions(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 6a57376fa80..cbd62f714cb 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -333,17 +333,15 @@ grub_menu_init_page (int nested, int edit, - int version_msg = 1; - - geo->border = 0; -- geo->first_entry_x = 0 /* margin */ + 0 /* border */; -- geo->entry_width = grub_term_width (term) - 5; -+ geo->first_entry_x = 0; /* no margin */ -+ geo->entry_width = grub_term_width (term) - 1; - -- geo->first_entry_y = 2 /* two empty lines*/ -- + 0 /* GNU GRUB version text */ + 1 /* top border */; -+ geo->first_entry_y = 3; /* three empty lines*/ - - geo->timeout_lines = 2; - - /* 3 lines for timeout message and bottom margin. 2 lines for the border. */ - geo->num_entries = grub_term_height (term) - geo->first_entry_y -- - 1 /* bottom border */ - - 1 /* empty line before info message*/ - - geo->timeout_lines /* timeout */ - - 1 /* empty final line */; diff --git a/0044-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/0030-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch similarity index 96% rename from 0044-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch rename to 0030-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch index 3e2d3ae..f4d83da 100644 --- a/0044-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +++ b/0030-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 301d1ac229a..0f6505bf3b6 100644 +index 301d1ac229..0f6505bf3b 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -253,6 +253,14 @@ version_test_gt () diff --git a/0045-Try-prefix-if-fw_path-doesn-t-work.patch b/0031-Try-prefix-if-fw_path-doesn-t-work.patch similarity index 97% rename from 0045-Try-prefix-if-fw_path-doesn-t-work.patch rename to 0031-Try-prefix-if-fw_path-doesn-t-work.patch index 59489bd..a1c0d9e 100644 --- a/0045-Try-prefix-if-fw_path-doesn-t-work.patch +++ b/0031-Try-prefix-if-fw_path-doesn-t-work.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 3 files changed, 82 insertions(+), 82 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index e71d1584164..0cd2a627231 100644 +index e71d158416..0cd2a62723 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -127,23 +127,25 @@ grub_machine_get_bootlocation (char **device, char **path) @@ -56,7 +56,7 @@ index e71d1584164..0cd2a627231 100644 } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 4d3eb5c1a52..0ef148f4adc 100644 +index 4d3eb5c1a5..0ef148f4ad 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1869,7 +1869,7 @@ grub_net_search_config_file (char *config) @@ -69,10 +69,10 @@ index 4d3eb5c1a52..0ef148f4adc 100644 static struct grub_preboot *fini_hnd; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 1e509fceb91..d5968797f4f 100644 +index 0a99768f75..55558cc0b9 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -337,81 +337,79 @@ grub_enter_normal_mode (const char *config) +@@ -335,81 +335,79 @@ grub_enter_normal_mode (const char *config) grub_boot_time ("Exiting normal mode"); } diff --git a/0031-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch b/0031-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch deleted file mode 100644 index 7932180..0000000 --- a/0031-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Fri, 21 Jun 2013 14:44:08 -0400 -Subject: [PATCH] Use -2 instead of -1 for our right-hand margin, so - linewrapping works (#976643). - -Signed-off-by: Peter Jones ---- - grub-core/normal/menu_text.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index cbd62f714cb..26e9e82042a 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -334,7 +334,7 @@ grub_menu_init_page (int nested, int edit, - - geo->border = 0; - geo->first_entry_x = 0; /* no margin */ -- geo->entry_width = grub_term_width (term) - 1; -+ geo->entry_width = grub_term_width (term) - 2; - - geo->first_entry_y = 3; /* three empty lines*/ - diff --git a/0047-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0032-Make-grub2-mkconfig-construct-titles-that-look-like-.patch similarity index 98% rename from 0047-Make-grub2-mkconfig-construct-titles-that-look-like-.patch rename to 0032-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index 4c474e4..db101c0 100644 --- a/0047-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0032-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index fed73271478..2e59f3b4197 100644 +index 5f6d3c8d52..786dbabb4a 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -78,6 +78,32 @@ case x"$GRUB_FS" in diff --git a/0048-Add-friendly-grub2-password-config-tool-985962.patch b/0033-Add-friendly-grub2-password-config-tool-985962.patch similarity index 79% rename from 0048-Add-friendly-grub2-password-config-tool-985962.patch rename to 0033-Add-friendly-grub2-password-config-tool-985962.patch index 9807d0e..f430e96 100644 --- a/0048-Add-friendly-grub2-password-config-tool-985962.patch +++ b/0033-Add-friendly-grub2-password-config-tool-985962.patch @@ -13,21 +13,23 @@ Signed-off-by: Robert Marshall [pjones: fix the efidir in grub-setpassword and rename tool] Signed-off-by: Peter Jones [luto: fix grub-setpassword -o's output path] -Andy Lutomirski +Signed-off-by: Andy Lutomirski +[rharwood: migrate man page to h2m, context] +Signed-off-by: Robbie Harwood --- - configure.ac | 1 + - Makefile.util.def | 13 +++++ - util/grub-mkconfig.in | 2 + - util/grub-set-password.8 | 28 ++++++++++ - util/grub-set-password.in | 128 ++++++++++++++++++++++++++++++++++++++++++++++ - util/grub.d/01_users.in | 11 ++++ - 6 files changed, 183 insertions(+) - create mode 100644 util/grub-set-password.8 + configure.ac | 1 + + Makefile.util.def | 13 +++++ + docs/man/grub-set-password.h2m | 2 + + util/grub-mkconfig.in | 2 + + util/grub-set-password.in | 128 +++++++++++++++++++++++++++++++++++++++++ + util/grub.d/01_users.in | 11 ++++ + 6 files changed, 157 insertions(+) + create mode 100644 docs/man/grub-set-password.h2m create mode 100644 util/grub-set-password.in create mode 100644 util/grub.d/01_users.in diff --git a/configure.ac b/configure.ac -index fdcb452581c..30fd84d8067 100644 +index 8331f95b64..7f59ad788f 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -35,11 +37,11 @@ index fdcb452581c..30fd84d8067 100644 grub_TRANSFORM([grub-probe]) grub_TRANSFORM([grub-reboot]) +grub_TRANSFORM([grub-set-password]) - grub_TRANSFORM([grub-rpm-sort]) grub_TRANSFORM([grub-script-check]) grub_TRANSFORM([grub-set-default]) + grub_TRANSFORM([grub-sparc64-setup]) diff --git a/Makefile.util.def b/Makefile.util.def -index ba4cf4b29b0..1a7dd433e33 100644 +index 2c9b283a23..4ee22c5daa 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -452,6 +452,12 @@ script = { @@ -55,7 +57,7 @@ index ba4cf4b29b0..1a7dd433e33 100644 script = { name = '10_windows'; common = util/grub.d/10_windows.in; -@@ -740,6 +746,13 @@ script = { +@@ -724,6 +730,13 @@ script = { installdir = sbin; }; @@ -69,8 +71,16 @@ index ba4cf4b29b0..1a7dd433e33 100644 script = { name = grub-mkconfig_lib; common = util/grub-mkconfig_lib.in; +diff --git a/docs/man/grub-set-password.h2m b/docs/man/grub-set-password.h2m +new file mode 100644 +index 0000000000..10ee82f4d5 +--- /dev/null ++++ b/docs/man/grub-set-password.h2m +@@ -0,0 +1,2 @@ ++[NAME] ++grub-set-password \- generate the user.cfg file containing the hashed grub bootloader password diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 8ea2315ebc2..ba14cf6261c 100644 +index 8ea2315ebc..ba14cf6261 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -276,6 +276,8 @@ for i in "${grub_mkconfig_dir}"/* ; do @@ -82,43 +92,9 @@ index 8ea2315ebc2..ba14cf6261c 100644 *) if grub_file_is_not_garbage "$i" && test -x "$i" ; then echo -diff --git a/util/grub-set-password.8 b/util/grub-set-password.8 -new file mode 100644 -index 00000000000..9646546e43d ---- /dev/null -+++ b/util/grub-set-password.8 -@@ -0,0 +1,28 @@ -+.TH GRUB-SET-PASSWORD 3 "Thu Jun 25 2015" -+.SH NAME -+\fBgrub-set-password\fR \(em Generate the user.cfg file containing the hashed grub bootloader password. -+ -+.SH SYNOPSIS -+\fBgrub-set-password\fR [OPTION] -+ -+.SH DESCRIPTION -+\fBgrub-set-password\fR outputs the user.cfg file which contains the hashed GRUB bootloader password. This utility only supports configurations where there is a single root user. -+ -+The file has the format: -+GRUB2_PASSWORD=<\fIhashed password\fR>. -+ -+.SH OPTIONS -+.TP -+-h, --help -+Display program usage and exit. -+.TP -+-v, --version -+Display the current version. -+.TP -+-o, --output=<\fIDIRECTORY\fR> -+Choose the file path to which user.cfg will be written. -+ -+.SH SEE ALSO -+.BR "info grub" -+ -+.BR "info grub2-mkpasswd-pbkdf2" diff --git a/util/grub-set-password.in b/util/grub-set-password.in new file mode 100644 -index 00000000000..5ebf50576d6 +index 0000000000..5ebf50576d --- /dev/null +++ b/util/grub-set-password.in @@ -0,0 +1,128 @@ @@ -252,7 +228,7 @@ index 00000000000..5ebf50576d6 +fi diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in new file mode 100644 -index 00000000000..db2f44bfb78 +index 0000000000..db2f44bfb7 --- /dev/null +++ b/util/grub.d/01_users.in @@ -0,0 +1,11 @@ diff --git a/0033-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch b/0033-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch deleted file mode 100644 index 7e9e829..0000000 --- a/0033-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 28 Oct 2013 10:13:27 -0400 -Subject: [PATCH] F10 doesn't work on serial, so don't tell the user to hit it - (#987443) - -Signed-off-by: Peter Jones ---- - grub-core/normal/menu_text.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 26e9e82042a..4895ffe7d1d 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -157,7 +157,7 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) - - if (edit) - { -- ret += grub_print_message_indented_real (_("Press Ctrl-x or F10 to start, Ctrl-c or F2 for a \ -+ ret += grub_print_message_indented_real (_("Press Ctrl-x to start, Ctrl-c for a \ - command prompt or Escape to discard edits and return to the menu. Pressing Tab lists possible completions."), - STANDARD_MARGIN, STANDARD_MARGIN, - term, dry_run); diff --git a/0034-Don-t-say-GNU-Linux-in-generated-menus.patch b/0034-Don-t-say-GNU-Linux-in-generated-menus.patch deleted file mode 100644 index db2a8b5..0000000 --- a/0034-Don-t-say-GNU-Linux-in-generated-menus.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 14 Mar 2011 14:27:42 -0400 -Subject: [PATCH] Don't say "GNU/Linux" in generated menus. - ---- - util/grub.d/10_linux.in | 4 ++-- - util/grub.d/20_linux_xen.in | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ad2ac4b078d..4fc58c83304 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" - CLASS="--class gnu-linux --class gnu --class os" - - if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then -- OS=GNU/Linux -+ OS="$(sed 's, release .*$,,g' /etc/system-release)" - else -- OS="${GRUB_DISTRIBUTOR} GNU/Linux" -+ OS="${GRUB_DISTRIBUTOR}" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" - fi - -diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 3b1f4704921..ada20775a14 100644 ---- a/util/grub.d/20_linux_xen.in -+++ b/util/grub.d/20_linux_xen.in -@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" - CLASS="--class gnu-linux --class gnu --class os --class xen" - - if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then -- OS=GNU/Linux -+ OS="$(sed 's, release .*$,,g' /etc/system-release)" - else -- OS="${GRUB_DISTRIBUTOR} GNU/Linux" -+ OS="${GRUB_DISTRIBUTOR}" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" - fi - diff --git a/0049-tcp-add-window-scaling-support.patch b/0034-tcp-add-window-scaling-support.patch similarity index 98% rename from 0049-tcp-add-window-scaling-support.patch rename to 0034-tcp-add-window-scaling-support.patch index 7d1996c..61b5a67 100644 --- a/0049-tcp-add-window-scaling-support.patch +++ b/0034-tcp-add-window-scaling-support.patch @@ -17,7 +17,7 @@ Signed-off-by: Josef Bacik 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c -index e8ad34b84d4..7d4b822626d 100644 +index e8ad34b84d..7d4b822626 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -106,6 +106,18 @@ struct tcphdr diff --git a/0035-Don-t-draw-a-border-around-the-menu.patch b/0035-Don-t-draw-a-border-around-the-menu.patch deleted file mode 100644 index 31a973e..0000000 --- a/0035-Don-t-draw-a-border-around-the-menu.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Wed, 15 May 2013 16:47:33 -0400 -Subject: [PATCH] Don't draw a border around the menu - -It looks cleaner without it. ---- - grub-core/normal/menu_text.c | 43 ------------------------------------------- - 1 file changed, 43 deletions(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 4895ffe7d1d..e72ed438ba3 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right, - grub_print_message_indented_real (msg, margin_left, margin_right, term, 0); - } - --static void --draw_border (struct grub_term_output *term, const struct grub_term_screen_geometry *geo) --{ -- int i; -- -- grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); -- -- grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1, -- geo->first_entry_y - 1 }); -- grub_putcode (GRUB_UNICODE_CORNER_UL, term); -- for (i = 0; i < geo->entry_width + 1; i++) -- grub_putcode (GRUB_UNICODE_HLINE, term); -- grub_putcode (GRUB_UNICODE_CORNER_UR, term); -- -- for (i = 0; i < geo->num_entries; i++) -- { -- grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1, -- geo->first_entry_y + i }); -- grub_putcode (GRUB_UNICODE_VLINE, term); -- grub_term_gotoxy (term, -- (struct grub_term_coordinate) { geo->first_entry_x + geo->entry_width + 1, -- geo->first_entry_y + i }); -- grub_putcode (GRUB_UNICODE_VLINE, term); -- } -- -- grub_term_gotoxy (term, -- (struct grub_term_coordinate) { geo->first_entry_x - 1, -- geo->first_entry_y - 1 + geo->num_entries + 1 }); -- grub_putcode (GRUB_UNICODE_CORNER_LL, term); -- for (i = 0; i < geo->entry_width + 1; i++) -- grub_putcode (GRUB_UNICODE_HLINE, term); -- grub_putcode (GRUB_UNICODE_CORNER_LR, term); -- -- grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); -- -- grub_term_gotoxy (term, -- (struct grub_term_coordinate) { geo->first_entry_x - 1, -- (geo->first_entry_y - 1 + geo->num_entries -- + GRUB_TERM_MARGIN + 1) }); --} -- - static int - print_message (int nested, int edit, struct grub_term_output *term, int dry_run) - { -@@ -406,8 +365,6 @@ grub_menu_init_page (int nested, int edit, - - grub_term_normal_color = grub_color_menu_normal; - grub_term_highlight_color = grub_color_menu_highlight; -- if (geo->border) -- draw_border (term, geo); - grub_term_normal_color = old_color_normal; - grub_term_highlight_color = old_color_highlight; - geo->timeout_y = geo->first_entry_y + geo->num_entries diff --git a/0050-efinet-and-bootp-add-support-for-dhcpv6.patch b/0035-efinet-and-bootp-add-support-for-dhcpv6.patch similarity index 98% rename from 0050-efinet-and-bootp-add-support-for-dhcpv6.patch rename to 0035-efinet-and-bootp-add-support-for-dhcpv6.patch index a9844b8..efeeee0 100644 --- a/0050-efinet-and-bootp-add-support-for-dhcpv6.patch +++ b/0035-efinet-and-bootp-add-support-for-dhcpv6.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 6 files changed, 477 insertions(+), 14 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 6fb5627025d..e28fb6a09f9 100644 +index 6fb5627025..e28fb6a09f 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -902,6 +902,179 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), @@ -198,7 +198,7 @@ index 6fb5627025d..e28fb6a09f9 100644 grub_bootp_init (void) { diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 5388f952ba9..173fb63153c 100644 +index 5388f952ba..173fb63153 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -18,11 +18,14 @@ @@ -307,7 +307,7 @@ index 5388f952ba9..173fb63153c 100644 } } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 0ef148f4adc..22f2689aaeb 100644 +index 0ef148f4ad..22f2689aae 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -960,6 +960,78 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa @@ -390,7 +390,7 @@ index 0ef148f4adc..22f2689aaeb 100644 grub_err_t grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter, diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 7f44b30f521..4ab2f5c7357 100644 +index 7f44b30f52..4ab2f5c735 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -358,18 +358,22 @@ tftp_open (struct grub_file *file, const char *filename) @@ -417,7 +417,7 @@ index 7f44b30f521..4ab2f5c7357 100644 return grub_errno; } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index f1a52210c0c..117469450d3 100644 +index f1a52210c0..117469450d 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -592,10 +592,16 @@ typedef void *grub_efi_handle_t; @@ -572,7 +572,7 @@ index f1a52210c0c..117469450d3 100644 typedef struct grub_efi_pxe diff --git a/include/grub/net.h b/include/grub/net.h -index 7ae4b6bd805..8a05ec4fe7a 100644 +index 7ae4b6bd80..8a05ec4fe7 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -447,6 +447,51 @@ struct grub_net_bootp_packet diff --git a/0051-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch b/0036-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch similarity index 83% rename from 0051-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch rename to 0036-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch index e799ac1..95490cd 100644 --- a/0051-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +++ b/0036-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch @@ -10,20 +10,21 @@ variables are then used by 10_linux to choose whether or not to create debug stanzas. Resolves: rhbz#1226325 +[rharwood: migrate man page to h2m] --- - configure.ac | 2 + + configure.ac | 1 + Makefile.util.def | 7 ++ + docs/man/grub-get-kernel-settings.h2m | 2 + util/bash-completion.d/grub-completion.bash.in | 22 +++++++ - util/grub-get-kernel-settings.3 | 20 ++++++ util/grub-get-kernel-settings.in | 88 ++++++++++++++++++++++++++ util/grub-mkconfig.in | 3 + util/grub.d/10_linux.in | 23 +++++-- - 7 files changed, 160 insertions(+), 5 deletions(-) - create mode 100644 util/grub-get-kernel-settings.3 + 7 files changed, 141 insertions(+), 5 deletions(-) + create mode 100644 docs/man/grub-get-kernel-settings.h2m create mode 100644 util/grub-get-kernel-settings.in diff --git a/configure.ac b/configure.ac -index 30fd84d8067..ed31ea457d2 100644 +index 7f59ad788f..0d0e6782a1 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-install]) @@ -34,19 +35,11 @@ index 30fd84d8067..ed31ea457d2 100644 grub_TRANSFORM([grub-glue-efi]) grub_TRANSFORM([grub-mklayout]) grub_TRANSFORM([grub-mkpasswd-pbkdf2]) -@@ -82,6 +83,7 @@ grub_TRANSFORM([grub-file]) - grub_TRANSFORM([grub-bios-setup.3]) - grub_TRANSFORM([grub-editenv.1]) - grub_TRANSFORM([grub-fstest.3]) -+grub_TRANSFORM([grub-get-kernel-settings.3]) - grub_TRANSFORM([grub-glue-efi.3]) - grub_TRANSFORM([grub-install.1]) - grub_TRANSFORM([grub-kbdcomp.3]) diff --git a/Makefile.util.def b/Makefile.util.def -index 1a7dd433e33..cdd2f51fe4b 100644 +index 4ee22c5daa..18a9242776 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -732,6 +732,13 @@ script = { +@@ -716,6 +716,13 @@ script = { installdir = sbin; }; @@ -60,8 +53,16 @@ index 1a7dd433e33..cdd2f51fe4b 100644 script = { name = grub-set-default; common = util/grub-set-default.in; +diff --git a/docs/man/grub-get-kernel-settings.h2m b/docs/man/grub-get-kernel-settings.h2m +new file mode 100644 +index 0000000000..b8051f01f3 +--- /dev/null ++++ b/docs/man/grub-get-kernel-settings.h2m +@@ -0,0 +1,2 @@ ++[NAME] ++grub-get-kernel-settings \- Evaluate the system's kernel installation settings for use while making a grub configuration file diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in -index 44bf135b9f8..5c4acd496d4 100644 +index 44bf135b9f..5c4acd496d 100644 --- a/util/bash-completion.d/grub-completion.bash.in +++ b/util/bash-completion.d/grub-completion.bash.in @@ -264,6 +264,28 @@ have ${__grub_sparc64_setup_program} && \ @@ -93,35 +94,9 @@ index 44bf135b9f8..5c4acd496d4 100644 # # grub-install # -diff --git a/util/grub-get-kernel-settings.3 b/util/grub-get-kernel-settings.3 -new file mode 100644 -index 00000000000..ba33330e28d ---- /dev/null -+++ b/util/grub-get-kernel-settings.3 -@@ -0,0 +1,20 @@ -+.TH GRUB-GET-KERNEL-SETTINGS 3 "Thu Jun 25 2015" -+.SH NAME -+\fBgrub-get-kernel-settings\fR \(em Evaluate the system's kernel installation settings for use while making a grub configuration file. -+ -+.SH SYNOPSIS -+\fBgrub-get-kernel-settings\fR [OPTION] -+ -+.SH DESCRIPTION -+\fBgrub-get-kernel-settings\fR reads the kernel installation settings on the host system, and emits a set of grub settings suitable for use when creating a grub configuration file. -+ -+.SH OPTIONS -+.TP -+-h, --help -+Display program usage and exit. -+.TP -+-v, --version -+Display the current version. -+ -+.SH SEE ALSO -+.BR "info grub" diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in new file mode 100644 -index 00000000000..7e87dfccc0e +index 0000000000..7e87dfccc0 --- /dev/null +++ b/util/grub-get-kernel-settings.in @@ -0,0 +1,88 @@ @@ -214,7 +189,7 @@ index 00000000000..7e87dfccc0e + echo export GRUB_UPDATE_DEFAULT_KERNEL +fi diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index ba14cf6261c..005f093809b 100644 +index ba14cf6261..005f093809 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -45,6 +45,7 @@ grub_probe="${sbindir}/@grub_probe@" @@ -235,7 +210,7 @@ index ba14cf6261c..005f093809b 100644 if [ -z "${GRUB_DISABLE_LINUX_UUID}" ]; then GRUB_DISABLE_LINUX_UUID="true" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 2e59f3b4197..0f3c19e30cc 100644 +index 786dbabb4a..292e333324 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -111,7 +111,8 @@ linux_entry () @@ -258,7 +233,7 @@ index 2e59f3b4197..0f3c19e30cc 100644 echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" -@@ -299,11 +303,15 @@ while [ "x$list" != "x" ] ; do +@@ -306,11 +310,15 @@ while [ "x$list" != "x" ] ; do fi if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then @@ -276,7 +251,7 @@ index 2e59f3b4197..0f3c19e30cc 100644 if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi -@@ -312,10 +320,15 @@ while [ "x$list" != "x" ] ; do +@@ -319,10 +327,15 @@ while [ "x$list" != "x" ] ; do is_top_level=false fi diff --git a/0036-Use-the-standard-margin-for-the-timeout-string.patch b/0036-Use-the-standard-margin-for-the-timeout-string.patch deleted file mode 100644 index 49a382d..0000000 --- a/0036-Use-the-standard-margin-for-the-timeout-string.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Jon McCann -Date: Fri, 7 Jun 2013 10:52:32 -0400 -Subject: [PATCH] Use the standard margin for the timeout string - -So that it aligns with the other messages ---- - grub-core/normal/menu_text.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index e72ed438ba3..ca135624356 100644 ---- a/grub-core/normal/menu_text.c -+++ b/grub-core/normal/menu_text.c -@@ -372,7 +372,7 @@ grub_menu_init_page (int nested, int edit, - if (bottom_message) - { - grub_term_gotoxy (term, -- (struct grub_term_coordinate) { GRUB_TERM_MARGIN, -+ (struct grub_term_coordinate) { STANDARD_MARGIN, - geo->timeout_y }); - - print_message (nested, edit, term, 0); -@@ -407,14 +407,14 @@ menu_text_print_timeout (int timeout, void *dataptr) - if (data->timeout_msg == TIMEOUT_UNKNOWN) - { - data->timeout_msg = grub_print_message_indented_real (msg_translated, -- 3, 1, data->term, 1) -+ STANDARD_MARGIN, 1, data->term, 1) - <= data->geo.timeout_lines ? TIMEOUT_NORMAL : TIMEOUT_TERSE; - if (data->timeout_msg == TIMEOUT_TERSE) - { - grub_free (msg_translated); - msg_translated = grub_xasprintf (_("%ds"), timeout); - if (grub_term_width (data->term) < 10) -- data->timeout_msg = TIMEOUT_TERSE_NO_MARGIN; -+ data->timeout_msg = STANDARD_MARGIN; - } - } - diff --git a/0052-bz1374141-fix-incorrect-mask-for-ppc64.patch b/0037-bz1374141-fix-incorrect-mask-for-ppc64.patch similarity index 94% rename from 0052-bz1374141-fix-incorrect-mask-for-ppc64.patch rename to 0037-bz1374141-fix-incorrect-mask-for-ppc64.patch index 1bb2658..15b2111 100644 --- a/0052-bz1374141-fix-incorrect-mask-for-ppc64.patch +++ b/0037-bz1374141-fix-incorrect-mask-for-ppc64.patch @@ -25,12 +25,15 @@ This patch changes it as below. 0000 0000 0000 0000 0000 0011 1111 1111 # ~grub_swap_bytes32(grub_le_to_cpu32 (subnet_mask.ipv4)) The count of zero with __builtin_clz can be 22. (clz counts the number of one bits preceding the most significant zero bit) + +Signed-off-by: Masahiro Matsuya +Signed-off-by: Robbie Harwood --- grub-core/net/drivers/ieee1275/ofnet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index ac4e62a95c9..3860b6f78d8 100644 +index ac4e62a95c..3860b6f78d 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -220,8 +220,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, diff --git a/0053-Make-grub_fatal-also-backtrace.patch b/0038-Make-grub_fatal-also-backtrace.patch similarity index 96% rename from 0053-Make-grub_fatal-also-backtrace.patch rename to 0038-Make-grub_fatal-also-backtrace.patch index 3534b05..f876575 100644 --- a/0053-Make-grub_fatal-also-backtrace.patch +++ b/0038-Make-grub_fatal-also-backtrace.patch @@ -13,7 +13,7 @@ Subject: [PATCH] Make grub_fatal() also backtrace. create mode 100644 grub-core/lib/arm64/backtrace.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index c15e91943b9..058c88ac3af 100644 +index c15e91943b..058c88ac3a 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -188,6 +188,9 @@ kernel = { @@ -27,7 +27,7 @@ index c15e91943b9..058c88ac3af 100644 i386_xen = kern/i386/dl.c; i386_xen_pvh = kern/i386/dl.c; diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 63b586d09cb..a3e215155bd 100644 +index 63b586d09c..a3e215155b 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -24,6 +24,7 @@ @@ -55,7 +55,7 @@ index 63b586d09cb..a3e215155bd 100644 #endif diff --git a/grub-core/lib/arm64/backtrace.c b/grub-core/lib/arm64/backtrace.c new file mode 100644 -index 00000000000..1079b5380e1 +index 0000000000..1079b5380e --- /dev/null +++ b/grub-core/lib/arm64/backtrace.c @@ -0,0 +1,62 @@ @@ -122,7 +122,7 @@ index 00000000000..1079b5380e1 +} + diff --git a/grub-core/lib/backtrace.c b/grub-core/lib/backtrace.c -index 825a8800e25..c0ad6ab8be1 100644 +index 825a8800e2..c0ad6ab8be 100644 --- a/grub-core/lib/backtrace.c +++ b/grub-core/lib/backtrace.c @@ -29,6 +29,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -142,7 +142,7 @@ index 825a8800e25..c0ad6ab8be1 100644 } diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c -index c3e03c7275c..c67273db3ae 100644 +index c3e03c7275..c67273db3a 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -15,11 +15,23 @@ diff --git a/0039-Don-t-emit-Booting-.-message.patch b/0039-Don-t-emit-Booting-.-message.patch deleted file mode 100644 index 4133b52..0000000 --- a/0039-Don-t-emit-Booting-.-message.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 18 Feb 2014 09:37:49 -0500 -Subject: [PATCH] Don't emit "Booting ..." message. - -UI team still hates this stuff, so we're disabling it for RHEL 7. - -Resolves: rhbz#1023142 - -Signed-off-by: Peter Jones ---- - grub-core/normal/menu.c | 4 +++- - grub-core/normal/menu_entry.c | 3 --- - 2 files changed, 3 insertions(+), 4 deletions(-) - -diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index d7a222e681b..37d753d8081 100644 ---- a/grub-core/normal/menu.c -+++ b/grub-core/normal/menu.c -@@ -838,12 +838,14 @@ 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, -+notify_booting (grub_menu_entry_t __attribute__((unused)) entry, - void *userdata __attribute__((unused))) - { -+#if 0 - grub_printf (" "); - grub_printf_ (N_("Booting `%s'"), entry->title); - grub_printf ("\n\n"); -+#endif - } - - /* Callback invoked when a default menu entry executed because of a timeout -diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c -index 50eef918cf6..de64a367c4e 100644 ---- a/grub-core/normal/menu_entry.c -+++ b/grub-core/normal/menu_entry.c -@@ -1176,9 +1176,6 @@ run (struct screen *screen) - char *dummy[1] = { NULL }; - - grub_cls (); -- grub_printf (" "); -- grub_printf_ (N_("Booting a command list")); -- grub_printf ("\n\n"); - - errs_before = grub_err_printed_errors; - diff --git a/0055-Make-our-info-pages-say-grub2-where-appropriate.patch b/0039-Make-our-info-pages-say-grub2-where-appropriate.patch similarity index 99% rename from 0055-Make-our-info-pages-say-grub2-where-appropriate.patch rename to 0039-Make-our-info-pages-say-grub2-where-appropriate.patch index be28efd..afba285 100644 --- a/0055-Make-our-info-pages-say-grub2-where-appropriate.patch +++ b/0039-Make-our-info-pages-say-grub2-where-appropriate.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 2 files changed, 171 insertions(+), 154 deletions(-) diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi -index 6c629a23e2d..19f708ee662 100644 +index 6c629a23e2..19f708ee66 100644 --- a/docs/grub-dev.texi +++ b/docs/grub-dev.texi @@ -1,7 +1,7 @@ @@ -35,7 +35,7 @@ index 6c629a23e2d..19f708ee662 100644 @setchapternewpage odd diff --git a/docs/grub.texi b/docs/grub.texi -index 69f08d289f9..0615d0ed97e 100644 +index 69f08d289f..0615d0ed97 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1,7 +1,7 @@ diff --git a/0040-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch b/0040-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch deleted file mode 100644 index daa6fae..0000000 --- a/0040-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch +++ /dev/null @@ -1,1959 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 4 Mar 2014 11:00:23 -0500 -Subject: [PATCH] Replace a lot of man pages with slightly nicer ones. - -Replace a bunch of machine generated ones with ones that look nicer. ---- - configure.ac | 23 ++++++ - conf/Makefile.extra-dist | 1 - - docs/Makefile.am | 2 - - docs/man/grub-bios-setup.h2m | 6 -- - docs/man/grub-editenv.h2m | 5 -- - docs/man/grub-emu.h2m | 6 -- - docs/man/grub-file.h2m | 2 - - docs/man/grub-fstest.h2m | 4 - - docs/man/grub-glue-efi.h2m | 4 - - docs/man/grub-install.h2m | 6 -- - docs/man/grub-kbdcomp.h2m | 10 --- - docs/man/grub-macbless.h2m | 4 - - docs/man/grub-macho2img.h2m | 4 - - docs/man/grub-menulst2cfg.h2m | 4 - - docs/man/grub-mkconfig.h2m | 4 - - docs/man/grub-mkfont.h2m | 4 - - docs/man/grub-mkimage.h2m | 6 -- - docs/man/grub-mklayout.h2m | 10 --- - docs/man/grub-mknetdir.h2m | 4 - - docs/man/grub-mkpasswd-pbkdf2.h2m | 4 - - docs/man/grub-mkrelpath.h2m | 4 - - docs/man/grub-mkrescue.h2m | 4 - - docs/man/grub-mkstandalone.h2m | 4 - - docs/man/grub-mount.h2m | 2 - - docs/man/grub-ofpathname.h2m | 4 - - docs/man/grub-pe2elf.h2m | 4 - - docs/man/grub-probe.h2m | 4 - - docs/man/grub-reboot.h2m | 5 -- - docs/man/grub-render-label.h2m | 3 - - docs/man/grub-script-check.h2m | 4 - - docs/man/grub-set-default.h2m | 5 -- - docs/man/grub-sparc64-setup.h2m | 6 -- - docs/man/grub-syslinux2cfg.h2m | 4 - - gentpl.py | 5 +- - util/grub-bios-setup.8 | 54 +++++++++++++ - util/grub-editenv.1 | 46 +++++++++++ - util/grub-file.1 | 165 ++++++++++++++++++++++++++++++++++++++ - util/grub-fstest.1 | 99 +++++++++++++++++++++++ - util/grub-glue-efi.1 | 31 +++++++ - util/grub-install.8 | 128 +++++++++++++++++++++++++++++ - util/grub-kbdcomp.1 | 19 +++++ - util/grub-macbless.1 | 22 +++++ - util/grub-menulst2cfg.1 | 12 +++ - util/grub-mkconfig.8 | 17 ++++ - util/grub-mkfont.1 | 87 ++++++++++++++++++++ - util/grub-mkimage.1 | 95 ++++++++++++++++++++++ - util/grub-mklayout.1 | 27 +++++++ - util/grub-mknetdir.1 | 12 +++ - util/grub-mkpasswd-pbkdf2.1 | 27 +++++++ - util/grub-mkrelpath.1 | 12 +++ - util/grub-mkrescue.1 | 123 ++++++++++++++++++++++++++++ - util/grub-mkstandalone.1 | 100 +++++++++++++++++++++++ - util/grub-ofpathname.8 | 12 +++ - util/grub-probe.8 | 80 ++++++++++++++++++ - util/grub-reboot.8 | 21 +++++ - util/grub-render-label.1 | 51 ++++++++++++ - util/grub-script-check.1 | 21 +++++ - util/grub-set-default.8 | 21 +++++ - util/grub-sparc64-setup.8 | 12 +++ - 59 files changed, 1318 insertions(+), 147 deletions(-) - delete mode 100644 docs/man/grub-bios-setup.h2m - delete mode 100644 docs/man/grub-editenv.h2m - delete mode 100644 docs/man/grub-emu.h2m - delete mode 100644 docs/man/grub-file.h2m - delete mode 100644 docs/man/grub-fstest.h2m - delete mode 100644 docs/man/grub-glue-efi.h2m - delete mode 100644 docs/man/grub-install.h2m - delete mode 100644 docs/man/grub-kbdcomp.h2m - delete mode 100644 docs/man/grub-macbless.h2m - delete mode 100644 docs/man/grub-macho2img.h2m - delete mode 100644 docs/man/grub-menulst2cfg.h2m - delete mode 100644 docs/man/grub-mkconfig.h2m - delete mode 100644 docs/man/grub-mkfont.h2m - delete mode 100644 docs/man/grub-mkimage.h2m - delete mode 100644 docs/man/grub-mklayout.h2m - delete mode 100644 docs/man/grub-mknetdir.h2m - delete mode 100644 docs/man/grub-mkpasswd-pbkdf2.h2m - delete mode 100644 docs/man/grub-mkrelpath.h2m - delete mode 100644 docs/man/grub-mkrescue.h2m - delete mode 100644 docs/man/grub-mkstandalone.h2m - delete mode 100644 docs/man/grub-mount.h2m - delete mode 100644 docs/man/grub-ofpathname.h2m - delete mode 100644 docs/man/grub-pe2elf.h2m - delete mode 100644 docs/man/grub-probe.h2m - delete mode 100644 docs/man/grub-reboot.h2m - delete mode 100644 docs/man/grub-render-label.h2m - delete mode 100644 docs/man/grub-script-check.h2m - delete mode 100644 docs/man/grub-set-default.h2m - delete mode 100644 docs/man/grub-sparc64-setup.h2m - delete mode 100644 docs/man/grub-syslinux2cfg.h2m - create mode 100644 util/grub-bios-setup.8 - create mode 100644 util/grub-editenv.1 - create mode 100644 util/grub-file.1 - create mode 100644 util/grub-fstest.1 - create mode 100644 util/grub-glue-efi.1 - create mode 100644 util/grub-install.8 - create mode 100644 util/grub-kbdcomp.1 - create mode 100644 util/grub-macbless.1 - create mode 100644 util/grub-menulst2cfg.1 - create mode 100644 util/grub-mkconfig.8 - create mode 100644 util/grub-mkfont.1 - create mode 100644 util/grub-mkimage.1 - create mode 100644 util/grub-mklayout.1 - create mode 100644 util/grub-mknetdir.1 - create mode 100644 util/grub-mkpasswd-pbkdf2.1 - create mode 100644 util/grub-mkrelpath.1 - create mode 100644 util/grub-mkrescue.1 - create mode 100644 util/grub-mkstandalone.1 - create mode 100644 util/grub-ofpathname.8 - create mode 100644 util/grub-probe.8 - create mode 100644 util/grub-reboot.8 - create mode 100644 util/grub-render-label.1 - create mode 100644 util/grub-script-check.1 - create mode 100644 util/grub-set-default.8 - create mode 100644 util/grub-sparc64-setup.8 - -diff --git a/configure.ac b/configure.ac -index 8331f95b645..bec8535af70 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -77,6 +77,29 @@ grub_TRANSFORM([grub-set-default]) - grub_TRANSFORM([grub-sparc64-setup]) - grub_TRANSFORM([grub-render-label]) - grub_TRANSFORM([grub-file]) -+grub_TRANSFORM([grub-bios-setup.3]) -+grub_TRANSFORM([grub-editenv.1]) -+grub_TRANSFORM([grub-fstest.3]) -+grub_TRANSFORM([grub-glue-efi.3]) -+grub_TRANSFORM([grub-install.1]) -+grub_TRANSFORM([grub-kbdcomp.3]) -+grub_TRANSFORM([grub-menulst2cfg.1]) -+grub_TRANSFORM([grub-mkconfig.1]) -+grub_TRANSFORM([grub-mkfont.3]) -+grub_TRANSFORM([grub-mkimage.1]) -+grub_TRANSFORM([grub-mklayout.3]) -+grub_TRANSFORM([grub-mknetdir.3]) -+grub_TRANSFORM([grub-mkpasswd-pbkdf2.3]) -+grub_TRANSFORM([grub-mkrelpath.3]) -+grub_TRANSFORM([grub-mkrescue.1]) -+grub_TRANSFORM([grub-mkstandalone.3]) -+grub_TRANSFORM([grub-ofpathname.3]) -+grub_TRANSFORM([grub-probe.3]) -+grub_TRANSFORM([grub-reboot.3]) -+grub_TRANSFORM([grub-render-label.3]) -+grub_TRANSFORM([grub-script-check.3]) -+grub_TRANSFORM([grub-set-default.1]) -+grub_TRANSFORM([grub-sparc64-setup.3]) - - # Optimization flag. Allow user to override. - if test "x$TARGET_CFLAGS" = x; then -diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index 8f1485d52a5..b909f2c073a 100644 ---- a/conf/Makefile.extra-dist -+++ b/conf/Makefile.extra-dist -@@ -11,7 +11,6 @@ EXTRA_DIST += unicode - EXTRA_DIST += util/import_gcry.py - EXTRA_DIST += util/import_unicode.py - --EXTRA_DIST += docs/man - EXTRA_DIST += docs/autoiso.cfg - EXTRA_DIST += docs/grub.cfg - EXTRA_DIST += docs/osdetect.cfg -diff --git a/docs/Makefile.am b/docs/Makefile.am -index 93eb3962765..ab28f199694 100644 ---- a/docs/Makefile.am -+++ b/docs/Makefile.am -@@ -5,5 +5,3 @@ info_TEXINFOS = grub.texi grub-dev.texi - grub_TEXINFOS = fdl.texi - - EXTRA_DIST = font_char_metrics.png font_char_metrics.txt -- -- -diff --git a/docs/man/grub-bios-setup.h2m b/docs/man/grub-bios-setup.h2m -deleted file mode 100644 -index ac6ede36296..00000000000 ---- a/docs/man/grub-bios-setup.h2m -+++ /dev/null -@@ -1,6 +0,0 @@ --[NAME] --grub-bios-setup \- set up a device to boot using GRUB --[SEE ALSO] --.BR grub-install (8), --.BR grub-mkimage (1), --.BR grub-mkrescue (1) -diff --git a/docs/man/grub-editenv.h2m b/docs/man/grub-editenv.h2m -deleted file mode 100644 -index 3859d3d4c4f..00000000000 ---- a/docs/man/grub-editenv.h2m -+++ /dev/null -@@ -1,5 +0,0 @@ --[NAME] --grub-editenv \- edit GRUB environment block --[SEE ALSO] --.BR grub-reboot (8), --.BR grub-set-default (8) -diff --git a/docs/man/grub-emu.h2m b/docs/man/grub-emu.h2m -deleted file mode 100644 -index ef1c000656a..00000000000 ---- a/docs/man/grub-emu.h2m -+++ /dev/null -@@ -1,6 +0,0 @@ --[NAME] --grub-emu \- GRUB emulator --[SEE ALSO] --If you are trying to install GRUB, then you should use --.BR grub-install (8) --rather than this program. -diff --git a/docs/man/grub-file.h2m b/docs/man/grub-file.h2m -deleted file mode 100644 -index e09bb4d3101..00000000000 ---- a/docs/man/grub-file.h2m -+++ /dev/null -@@ -1,2 +0,0 @@ --[NAME] --grub-file \- check file type -diff --git a/docs/man/grub-fstest.h2m b/docs/man/grub-fstest.h2m -deleted file mode 100644 -index 9676b159afd..00000000000 ---- a/docs/man/grub-fstest.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-fstest \- debug tool for GRUB filesystem drivers --[SEE ALSO] --.BR grub-probe (8) -diff --git a/docs/man/grub-glue-efi.h2m b/docs/man/grub-glue-efi.h2m -deleted file mode 100644 -index c1c6ded49ff..00000000000 ---- a/docs/man/grub-glue-efi.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-glue-efi \- generate a fat binary for EFI --[DESCRIPTION] --grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format. -diff --git a/docs/man/grub-install.h2m b/docs/man/grub-install.h2m -deleted file mode 100644 -index 8cbbc87a0f2..00000000000 ---- a/docs/man/grub-install.h2m -+++ /dev/null -@@ -1,6 +0,0 @@ --[NAME] --grub-install \- install GRUB to a device --[SEE ALSO] --.BR grub-mkconfig (8), --.BR grub-mkimage (1), --.BR grub-mkrescue (1) -diff --git a/docs/man/grub-kbdcomp.h2m b/docs/man/grub-kbdcomp.h2m -deleted file mode 100644 -index d81f9157e01..00000000000 ---- a/docs/man/grub-kbdcomp.h2m -+++ /dev/null -@@ -1,10 +0,0 @@ --[NAME] --grub-kbdcomp \- generate a GRUB keyboard layout file --[DESCRIPTION] --grub-kbdcomp processes a X keyboard layout description in --.BR keymaps (5) --format into a format that can be used by GRUB's --.B keymap --command. --[SEE ALSO] --.BR grub-mklayout (8) -diff --git a/docs/man/grub-macbless.h2m b/docs/man/grub-macbless.h2m -deleted file mode 100644 -index 0197c0087d7..00000000000 ---- a/docs/man/grub-macbless.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-macbless \- bless a mac file/directory --[SEE ALSO] --.BR grub-install (1) -diff --git a/docs/man/grub-macho2img.h2m b/docs/man/grub-macho2img.h2m -deleted file mode 100644 -index d79aaeed8f9..00000000000 ---- a/docs/man/grub-macho2img.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-macho2img \- convert Mach-O to raw image --[SEE ALSO] --.BR grub-mkimage (1) -diff --git a/docs/man/grub-menulst2cfg.h2m b/docs/man/grub-menulst2cfg.h2m -deleted file mode 100644 -index c2e0055ed7e..00000000000 ---- a/docs/man/grub-menulst2cfg.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-menulst2cfg \- transform legacy menu.lst into grub.cfg --[SEE ALSO] --.BR grub-mkconfig (8) -diff --git a/docs/man/grub-mkconfig.h2m b/docs/man/grub-mkconfig.h2m -deleted file mode 100644 -index 9b42f813010..00000000000 ---- a/docs/man/grub-mkconfig.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkconfig \- generate a GRUB configuration file --[SEE ALSO] --.BR grub-install (8) -diff --git a/docs/man/grub-mkfont.h2m b/docs/man/grub-mkfont.h2m -deleted file mode 100644 -index d46fe600eca..00000000000 ---- a/docs/man/grub-mkfont.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkfont \- make GRUB font files --[SEE ALSO] --.BR grub-mkconfig (8) -diff --git a/docs/man/grub-mkimage.h2m b/docs/man/grub-mkimage.h2m -deleted file mode 100644 -index f0fbc2bb197..00000000000 ---- a/docs/man/grub-mkimage.h2m -+++ /dev/null -@@ -1,6 +0,0 @@ --[NAME] --grub-mkimage \- make a bootable image of GRUB --[SEE ALSO] --.BR grub-install (8), --.BR grub-mkrescue (1), --.BR grub-mknetdir (8) -diff --git a/docs/man/grub-mklayout.h2m b/docs/man/grub-mklayout.h2m -deleted file mode 100644 -index 1e43409c0ab..00000000000 ---- a/docs/man/grub-mklayout.h2m -+++ /dev/null -@@ -1,10 +0,0 @@ --[NAME] --grub-mklayout \- generate a GRUB keyboard layout file --[DESCRIPTION] --grub-mklayout processes a keyboard layout description in --.BR keymaps (5) --format into a format that can be used by GRUB's --.B keymap --command. --[SEE ALSO] --.BR grub-mkconfig (8) -diff --git a/docs/man/grub-mknetdir.h2m b/docs/man/grub-mknetdir.h2m -deleted file mode 100644 -index a2ef13ec111..00000000000 ---- a/docs/man/grub-mknetdir.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mknetdir \- prepare a GRUB netboot directory. --[SEE ALSO] --.BR grub-mkimage (1) -diff --git a/docs/man/grub-mkpasswd-pbkdf2.h2m b/docs/man/grub-mkpasswd-pbkdf2.h2m -deleted file mode 100644 -index 4d202f3da7e..00000000000 ---- a/docs/man/grub-mkpasswd-pbkdf2.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkpasswd-pbkdf2 \- generate hashed password for GRUB --[SEE ALSO] --.BR grub-mkconfig (8) -diff --git a/docs/man/grub-mkrelpath.h2m b/docs/man/grub-mkrelpath.h2m -deleted file mode 100644 -index d01f3961e3f..00000000000 ---- a/docs/man/grub-mkrelpath.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkrelpath \- make a system path relative to its root --[SEE ALSO] --.BR grub-probe (8) -diff --git a/docs/man/grub-mkrescue.h2m b/docs/man/grub-mkrescue.h2m -deleted file mode 100644 -index a427f02e3c6..00000000000 ---- a/docs/man/grub-mkrescue.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkrescue \- make a GRUB rescue image --[SEE ALSO] --.BR grub-mkimage (1) -diff --git a/docs/man/grub-mkstandalone.h2m b/docs/man/grub-mkstandalone.h2m -deleted file mode 100644 -index c77313978ad..00000000000 ---- a/docs/man/grub-mkstandalone.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-mkstandalone \- make a memdisk-based GRUB image --[SEE ALSO] --.BR grub-mkimage (1) -diff --git a/docs/man/grub-mount.h2m b/docs/man/grub-mount.h2m -deleted file mode 100644 -index 8d168982d72..00000000000 ---- a/docs/man/grub-mount.h2m -+++ /dev/null -@@ -1,2 +0,0 @@ --[NAME] --grub-mount \- export GRUB filesystem with FUSE -diff --git a/docs/man/grub-ofpathname.h2m b/docs/man/grub-ofpathname.h2m -deleted file mode 100644 -index 74b43eea039..00000000000 ---- a/docs/man/grub-ofpathname.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-ofpathname \- find OpenBOOT path for a device --[SEE ALSO] --.BR grub-probe (8) -diff --git a/docs/man/grub-pe2elf.h2m b/docs/man/grub-pe2elf.h2m -deleted file mode 100644 -index 7ca29bd703c..00000000000 ---- a/docs/man/grub-pe2elf.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-pe2elf \- convert PE image to ELF --[SEE ALSO] --.BR grub-mkimage (1) -diff --git a/docs/man/grub-probe.h2m b/docs/man/grub-probe.h2m -deleted file mode 100644 -index 6e1ffdcf937..00000000000 ---- a/docs/man/grub-probe.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-probe \- probe device information for GRUB --[SEE ALSO] --.BR grub-fstest (1) -diff --git a/docs/man/grub-reboot.h2m b/docs/man/grub-reboot.h2m -deleted file mode 100644 -index e4acace65ce..00000000000 ---- a/docs/man/grub-reboot.h2m -+++ /dev/null -@@ -1,5 +0,0 @@ --[NAME] --grub-reboot \- set the default boot entry for GRUB, for the next boot only --[SEE ALSO] --.BR grub-set-default (8), --.BR grub-editenv (1) -diff --git a/docs/man/grub-render-label.h2m b/docs/man/grub-render-label.h2m -deleted file mode 100644 -index 50ae5247c05..00000000000 ---- a/docs/man/grub-render-label.h2m -+++ /dev/null -@@ -1,3 +0,0 @@ --[NAME] --grub-render-label \- generate a .disk_label for Apple Macs. -- -diff --git a/docs/man/grub-script-check.h2m b/docs/man/grub-script-check.h2m -deleted file mode 100644 -index 3653682671a..00000000000 ---- a/docs/man/grub-script-check.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-script-check \- check grub.cfg for syntax errors --[SEE ALSO] --.BR grub-mkconfig (8) -diff --git a/docs/man/grub-set-default.h2m b/docs/man/grub-set-default.h2m -deleted file mode 100644 -index 7945001c154..00000000000 ---- a/docs/man/grub-set-default.h2m -+++ /dev/null -@@ -1,5 +0,0 @@ --[NAME] --grub-set-default \- set the saved default boot entry for GRUB --[SEE ALSO] --.BR grub-reboot (8), --.BR grub-editenv (1) -diff --git a/docs/man/grub-sparc64-setup.h2m b/docs/man/grub-sparc64-setup.h2m -deleted file mode 100644 -index 18f803a50db..00000000000 ---- a/docs/man/grub-sparc64-setup.h2m -+++ /dev/null -@@ -1,6 +0,0 @@ --[NAME] --grub-sparc64-setup \- set up a device to boot using GRUB --[SEE ALSO] --.BR grub-install (8), --.BR grub-mkimage (1), --.BR grub-mkrescue (1) -diff --git a/docs/man/grub-syslinux2cfg.h2m b/docs/man/grub-syslinux2cfg.h2m -deleted file mode 100644 -index ad25c8ab753..00000000000 ---- a/docs/man/grub-syslinux2cfg.h2m -+++ /dev/null -@@ -1,4 +0,0 @@ --[NAME] --grub-syslinux2cfg \- transform syslinux config into grub.cfg --[SEE ALSO] --.BR grub-menulst2cfg (8) -diff --git a/gentpl.py b/gentpl.py -index c86550d4f9e..2cba0bbbd6f 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -805,10 +805,7 @@ def manpage(defn, adddeps): - - output("if COND_MAN_PAGES\n") - gvar_add("man_MANS", name + "." + mansection) -- rule(name + "." + mansection, name + " " + adddeps, """ --chmod a+x """ + name + """ --PATH=$(builddir):$$PATH pkgdatadir=$(builddir) $(HELP2MAN) --section=""" + mansection + """ -i $(top_srcdir)/docs/man/""" + name + """.h2m -o $@ """ + name + """ --""") -+ rule(name + "." + mansection, name + " " + adddeps, "cat $(top_srcdir)/util/" + name + "." + mansection + " | $(top_builddir)/config.status --file=$@:-") - gvar_add("CLEANFILES", name + "." + mansection) - output("endif\n") - -diff --git a/util/grub-bios-setup.8 b/util/grub-bios-setup.8 -new file mode 100644 -index 00000000000..56f582b3d75 ---- /dev/null -+++ b/util/grub-bios-setup.8 -@@ -0,0 +1,54 @@ -+.TH GRUB-BIOS-SETUP 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-bios-setup\fR \(em Set up images to boot from a device. -+ -+.SH SYNOPSIS -+\fBgrub-bios-setup\fR [-a | --allow-floppy] [-b | --boot-image=\fIFILE\fR] -+.RS 17 -+[-c | --core-image=\fIFILE\fR] [-d | --directory=\fIDIR\fR] -+.RE -+.RS 17 -+[-f | --force] [-m | --device-map=\fIFILE\fR] -+.RE -+.RS 17 -+[-s | --skip-fs-probe] [-v | --verbose] \fIDEVICE\fR -+ -+.SH DESCRIPTION -+You should not normally run this program directly. Use grub-install instead. -+ -+.SH OPTIONS -+.TP -+\fB--allow-floppy\fR -+Make the device also bootable as a floppy. This option is the default for -+/dev/fdX devices. Some BIOSes will not boot images created with this option. -+ -+.TP -+\fB--boot-image\fR=\fIFILE\fR -+Use FILE as the boot image. The default value is \fBboot.img\fR. -+ -+.TP -+\fB--core-image\fR=\fIFILE\fR -+Use FILE as ther core image. The default value is \fBcore.img\fR. -+ -+.TP -+\fB--directory\fR=\fIDIR\fR -+Use GRUB files in the directory DIR. The default value is \fB/boot/grub\fR. -+ -+.TP -+\fB--force\fR -+Install even if problems are detected. -+ -+.TP -+\fB--device-map\fR=\fIFILE\fR -+Use FILE as the device map. The default value is /boot/grub/device.map . -+ -+.TP -+\fB--skip-fs-probe\fR -+Do not probe DEVICE for filesystems. -+ -+.TP -+\fB--verbose\fR -+Print verbose messages. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-editenv.1 b/util/grub-editenv.1 -new file mode 100644 -index 00000000000..d28ba03ba42 ---- /dev/null -+++ b/util/grub-editenv.1 -@@ -0,0 +1,46 @@ -+.TH GRUB-EDITENV 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-editenv\fR \(em Manage the GRUB environment block. -+ -+.SH SYNOPSIS -+\fBgrub-editenv\fR [-v | --verbose] [\fIFILE\fR] -+.RS 14 -+ -+ -+.SH DESCRIPTION -+\fBgrub-editenv\fR is a command line tool to manage GRUB's stored environment. -+ -+.SH OPTIONS -+.TP -+\fB--verbose\fR -+Print verbose messages. -+ -+.TP -+\fBFILE\fR -+.RS 7 -+File name to use for grub environment. Default is /boot/grub/grubenv . -+.RE -+ -+.SH COMMANDS -+.TP -+\fBcreate\fR -+.RS 7 -+Create a blank environment block file. -+.RE -+ -+.TP -+\fBlist\fR -+.RS 7 -+List the current variables. -+.RE -+ -+.TP -+\fBset\fR [\fINAME\fR=\fIVALUE\fR ...] -+Set variables. -+ -+.TP -+\fBunset [\fINAME\fR ...] -+Delete variables. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-file.1 b/util/grub-file.1 -new file mode 100644 -index 00000000000..b29cb327889 ---- /dev/null -+++ b/util/grub-file.1 -@@ -0,0 +1,165 @@ -+.TH GRUB-FILE 1 "Web Feb 26 2014" -+.SH NAME -+\fBgrub-file\fR \(em Check if FILE is of specified type. -+ -+.SH SYNOPSIS -+\fBgrub-file\fR (--is-i386-xen-pae-domu | --is-x86_64-xen-domu | -+.RS 11 -+--is-x86-xen-dom0 | --is-x86-multiboot | -+.RE -+.RS 11 -+--is-x86-multiboot2 | --is-arm-linux | --is-arm64-linux | -+.RE -+.RS 11 -+--is-ia64-linux | --is-mips-linux | --is-mipsel-linux | -+.RE -+.RS 11 -+--is-sparc64-linux | --is-powerpc-linux | --is-x86-linux | -+.RE -+.RS 11 -+--is-x86-linux32 | --is-x86-kfreebsd | --is-i386-kfreebsd | -+.RE -+.RS 11 -+--is-x86_64-kfreebsd | --is-x86-knetbsd | -+.RE -+.RS 11 -+--is-i386-knetbsd | --is-x86_64-knetbsd | --is-i386-efi | -+.RE -+.RS 11 -+--is-x86_64-efi | --is-ia64-efi | --is-arm64-efi | -+.RE -+.RS 11 -+--is-arm-efi | --is-hibernated-hiberfil | --is-x86_64-xnu | -+.RE -+.RS 11 -+--is-i386-xnu | --is-xnu-hibr | --is-x86-bios-bootsector) -+.RE -+.RS 11 -+\fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-file\fR is used to check if \fIFILE\fR is of a specified type. -+ -+.SH OPTIONS -+.TP -+--is-i386-xen-pae-domu -+Check if FILE can be booted as i386 PAE Xen unprivileged guest kernel -+ -+.TP -+--is-x86_64-xen-domu -+Check if FILE can be booted as x86_64 Xen unprivileged guest kernel -+ -+.TP -+--is-x86-xen-dom0 -+Check if FILE can be used as Xen x86 privileged guest kernel -+ -+.TP -+--is-x86-multiboot -+Check if FILE can be used as x86 multiboot kernel -+ -+.TP -+--is-x86-multiboot2 -+Check if FILE can be used as x86 multiboot2 kernel -+ -+.TP -+--is-arm-linux -+Check if FILE is ARM Linux -+ -+.TP -+--is-arm64-linux -+Check if FILE is ARM64 Linux -+ -+.TP -+--is-ia64-linux -+Check if FILE is IA64 Linux -+ -+.TP -+--is-mips-linux -+Check if FILE is MIPS Linux -+ -+.TP -+--is-mipsel-linux -+Check if FILE is MIPSEL Linux -+ -+.TP -+--is-sparc64-linux -+Check if FILE is SPARC64 Linux -+ -+.TP -+--is-powerpc-linux -+Check if FILE is POWERPC Linux -+ -+.TP -+--is-x86-linux -+Check if FILE is x86 Linux -+ -+.TP -+--is-x86-linux32 -+Check if FILE is x86 Linux supporting 32-bit protocol -+ -+.TP -+--is-x86-kfreebsd -+Check if FILE is x86 kFreeBSD -+ -+.TP -+--is-i386-kfreebsd -+Check if FILE is i386 kFreeBSD -+ -+.TP -+--is-x86_64-kfreebsd -+Check if FILE is x86_64 kFreeBSD -+ -+.TP -+--is-x86-knetbsd -+Check if FILE is x86 kNetBSD -+ -+.TP -+--is-i386-knetbsd -+Check if FILE is i386 kNetBSD -+ -+.TP -+--is-x86_64-knetbsd -+Check if FILE is x86_64 kNetBSD -+ -+.TP -+--is-i386-efi -+Check if FILE is i386 EFI file -+ -+.TP -+--is-x86_64-efi -+Check if FILE is x86_64 EFI file -+ -+.TP -+--is-ia64-efi -+Check if FILE is IA64 EFI file -+ -+.TP -+--is-arm64-efi -+Check if FILE is ARM64 EFI file -+ -+.TP -+--is-arm-efi -+Check if FILE is ARM EFI file -+ -+.TP -+--is-hibernated-hiberfil -+Check if FILE is hiberfil.sys in hibernated state -+ -+.TP -+--is-x86_64-xnu -+Check if FILE is x86_64 XNU (Mac OS X kernel) -+ -+.TP -+--is-i386-xnu -+Check if FILE is i386 XNU (Mac OS X kernel) -+ -+.TP -+--is-xnu-hibr -+Check if FILE is XNU (Mac OS X kernel) hibernated image -+ -+.TP -+--is-x86-bios-bootsector -+Check if FILE is BIOS bootsector -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-fstest.1 b/util/grub-fstest.1 -new file mode 100644 -index 00000000000..792fa78634c ---- /dev/null -+++ b/util/grub-fstest.1 -@@ -0,0 +1,99 @@ -+.TH GRUB-FSTEST 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-fstest\fR — Debug tool for GRUB's filesystem driver. -+ -+.SH SYNOPSIS -+\fBgrub-fstest\fR [-c | --diskcount=\fINUM\fR] [-C | --crypto] -+.RS 13 -+[-d | --debug=\fISTRING\fR] [-K | --zfs-key=\fIFILE\fR|\fIprompt\fR] -+.RE -+.RS 13 -+[-n | --length=\fINUM\fR] [-r | --root=\fIDEVICE_NAME\fR] -+.RE -+.RS 13 -+[-s | --skip=\fINUM\fR] [-u | --uncompress] [-v | --verbose] -+.RE -+.RS 13 -+\fIIMAGE_PATH\fR -+ -+.SH DESCRIPTION -+\fBgrub-fstest\fR is a tool for testing GRUB's filesystem drivers. You should not normally need to run this program. -+ -+.SH OPTIONS -+.TP -+\fB--diskcount\fR=\fINUM\fR -+Specify the number of input files. -+ -+.TP -+\fB--crypto\fR -+Mount cryptographic devices. -+ -+.TP -+\fB--debug\fR=\fISTRING\fR -+Set debug environment variable. -+ -+.TP -+\fB--zfs-key\fR=\fIFILE\fR|\fIprompt\fR -+Load ZFS cryptographic key. -+ -+.TP -+\fB--length\fR=\fINUM\fR -+Handle NUM bytes in output file. -+ -+.TP -+\fB--root\fR=\fIDEVICE_NAME\fR -+Set root device. -+ -+.TP -+\fB--skip\fR=\fINUM\fR -+Skip NUM bytes from output file. -+ -+.TP -+\fB--uncompress\fR -+Uncompress data. -+ -+.TP -+\fB--verbose\fR -+Print verbose messages. -+ -+.SH COMMANDS -+.TP -+\fBblocklist\fR \fIFILE\fR -+Display block list of \fIFILE\fR. -+ -+.TP -+\fBcat\fR \fIFILE\fR -+Display \fIFILE\fR on standard output. -+ -+.TP -+\fBcmp\fR \fIFILE\fR \fILOCAL\fR -+Compare \fIFILE\fR with local file \fILOCAL\fR. -+ -+.TP -+\fBcp\fR \fIFILE\fR \fILOCAL\fR -+Copy \fIFILE\fR to local file \fILOCAL\fR. -+ -+.TP -+\fBcrc\fR \fIFILE\fR -+Display the CRC-32 checksum of \fIFILE\fR. -+ -+.TP -+\fBhex\fR \fIFILE\fR -+Display contents of \fIFILE\fR in hexidecimal. -+ -+.TP -+\fBls\fR \fIPATH\fR -+List files at \fIPATH\fR. -+ -+.TP -+\fBxnu_uuid\fR \fIDEVICE\fR -+Display the XNU UUID of \fIDEVICE\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-glue-efi.1 b/util/grub-glue-efi.1 -new file mode 100644 -index 00000000000..72bd555d577 ---- /dev/null -+++ b/util/grub-glue-efi.1 -@@ -0,0 +1,31 @@ -+.TH GRUB-GLUE-EFI 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-glue-efi\fR \(em Create an Apple fat EFI binary. -+ -+.SH SYNOPSIS -+\fBgrub-glue-efi\fR <-3 | --input32=\fIFILE\fR> <-6 | --input64=\fIFILE\fR> -+.RS 15 -+<-o | --output=\fIFILE\fR> [-v | --verbose] -+ -+.SH DESCRIPTION -+\fBgrub-glue-efi\fR creates an Apple fat EFI binary from two EFI binaries. -+ -+.SH OPTIONS -+.TP -+\fB--input32\fR=\fIFILE\fR -+Read 32-bit binary from \fIFILE\fR. -+ -+.TP -+\fB--input64\fR=\fIFILE\fR -+Read 64-bit binary from \fIFILE\fR. -+ -+.TP -+\fB--output\fR=\fIFILE\fR -+Write resulting fat binary to \fIFILE\fR. -+ -+.TP -+\fB--verbose\fR -+Print verbose messages. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-install.8 b/util/grub-install.8 -new file mode 100644 -index 00000000000..1db89e94b3b ---- /dev/null -+++ b/util/grub-install.8 -@@ -0,0 +1,128 @@ -+.TH GRUB-INSTALL 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-install\fR \(em Install GRUB on a device. -+ -+.SH SYNOPSIS -+\fBgrub-install\fR [--modules=\fIMODULES\fR] [--install-modules=\fIMODULES\fR] -+.RS 14 -+[--themes=\fITHEMES\fR] [--fonts=\fIFONTS\fR] [--locales=\fILOCALES\fR] -+.RE -+.RS 14 -+[--compress[=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR]] [-d | --directory=\fIDIR\fR] -+.RE -+.RS 14 -+[--grub-mkimage=\fIFILE\fR] [--boot-directory=\fIDIR\fR] -+.RE -+.RS 14 -+[--target=\fITARGET\fR] [--grub-setup=\fIFILE\fR] -+.RE -+.RS 14 -+[--grub-mkrelpath=\fIFILE\fR] [--grub-probe=\fIFILE\fR] -+.RE -+.RS 14 -+[--allow-floppy] [--recheck] [--force] [--force-file-id] -+.RE -+.RS 14 -+[--disk-module=\fIMODULE\fR] [--no-nvram] [--removable] -+.RE -+.RS 14 -+[--bootloader-id=\fIID\fR] [--efi-directory=\fIDIR\fR] \fIINSTALL_DEVICE\fR -+ -+.SH DESCRIPTION -+\fBgrub-install\fR installs GRUB onto a device. This includes copying GRUB images into the target directory (generally \fI/boot/grub\fR), and on some platforms may also include installing GRUB onto a boot sector. -+ -+.SH OPTIONS -+.TP -+\fB--modules\fR=\fIMODULES\fR\! -+Pre-load modules specified by \fIMODULES\fR. -+ -+.TP -+\fB--install-modules\fR=\fIMODULES\fR -+Install only \fIMODULES\fR and their dependencies. The default is to install all available modules. -+ -+.TP -+\fB--themes\fR=\fITHEMES\fR -+Install \fITHEMES\fR. The default is to install the \fIstarfield\fR theme, if available. -+ -+.TP -+\fB--fonts\fR=\fIFONTS\fR -+Install \fIFONTS\fR. The default is to install the \fIunicode\fR font. -+ -+.TP -+\fB--locales\fR=\fILOCALES\fR -+Install only locales listed in \fILOCALES\fR. The default is to install all available locales. -+ -+.TP -+\fB--compress\fR=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR -+Compress GRUB files using the specified compression algorithm. -+ -+.TP -+\fB--directory\fR=\fIDIR\fR -+Use images and modules in \fIDIR\fR. -+ -+.TP -+\fB--grub-mkimage\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-mkimage\fR. The default is \fI/usr/bin/grub-mkimage\fR. -+ -+.TP -+\fB--boot-directory\fR=\fIDIR\fR -+Use \fIDIR\fR as the boot directory. The default is \fI/boot\fR. GRUB will put its files in a subdirectory of this directory named \fIgrub\fR. -+ -+.TP -+\fB--target\fR=\fITARGET\fR -+Install GRUB for \fITARGET\fR platform. The default is the platform \fBgrub-install\fR is running on. -+ -+.TP -+\fB--grub-setup\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-setup\fR. The default is \fI/usr/bin/grub-setup\fR. -+ -+.TP -+\fB--grub-mkrelpath\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-mkrelpath\fR. The default is \fI/usr/bin/grub-mkrelpath\fR. -+ -+.TP -+\fB--grub-probe\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-probe\fR. The default is \fI/usr/bin/grub-mkrelpath\fR. -+ -+.TP -+\fB--allow-floppy -+Make the device also bootable as a floppy. This option is the default for /dev/fdX devices. Some BIOSes will not boot images created with this option. -+ -+.TP -+\fB--recheck -+Delete any existing device map and create a new one if necessary. -+ -+.TP -+\fB--force -+Install even if problems are detected. -+ -+.TP -+\fB--force-file-id -+Use identifier file even if UUID is available. -+ -+.TP -+\fB--disk-module\fR=\fIMODULE\fR -+Use \fIMODULE\fR for disk access. This allows you to manually specify either \fIbiosdisk\fR or \fInative\fR disk access. This option is only available on the BIOS target platform. -+ -+.TP -+\fB--no-nvram -+Do not update the \fIboot-device\fR NVRAM variable. This option is only available on IEEE1275 target platforms. -+ -+.TP -+\fB--removable -+Treat the target device as if it is removeable. This option is only available on the EFI target platform. -+ -+.TP -+\fB--bootloader-id\fR=\fIID\fR -+Use \fIID\fR as the bootloader ID. This option is only available on the EFI target platform. -+ -+.TP -+\fB--efi-directory\fR=\fIDIR\fR -+Use \fIDIR\fR as the EFI System Partition root. This option is only available on the EFI target platform. -+ -+.TP -+\fIINSTALL_DEVICE\fR -+Install GRUB to the block device \fIINSTALL_DEVICE\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-kbdcomp.1 b/util/grub-kbdcomp.1 -new file mode 100644 -index 00000000000..0bb969a5b43 ---- /dev/null -+++ b/util/grub-kbdcomp.1 -@@ -0,0 +1,19 @@ -+.TH GRUB-KBDCOMP 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-kbdcomp\fR \(em Generate a GRUB keyboard layout file. -+ -+.SH SYNOPSIS -+\fBgrub-kbdcomp\fR <-o | --output=\fIFILE\fR> \fICKBMAP_ARGUMENTS\fR -+ -+.SH DESCRIPTION -+\fBgrub-kbdcomp\fR processes an X keyboard layout description in -+\fBkeymaps\fR(5) format into a format that can be used by GRUB's \fBkeymap\fR -+command. -+ -+.SH OPTIONS -+.TP -+\fB--output\fR=\fIFILE\fR -+Write output to \fIFILE\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-macbless.1 b/util/grub-macbless.1 -new file mode 100644 -index 00000000000..41a96186f70 ---- /dev/null -+++ b/util/grub-macbless.1 -@@ -0,0 +1,22 @@ -+.TH GRUB-MACBLESS 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-macbless\fR \(em Mac-style bless on HFS or HFS+ -+ -+.SH SYNOPSIS -+\fBgrub-macbless\fR [-v | --verbose] [-p | --ppc] \fIFILE\fR | [-x | --x86] \fIFILE\fR -+ -+.SH OPTIONS -+.TP -+--x86 -+Bless for x86 based Macs. -+ -+.TP -+--ppc -+Bless for PPC based Macs. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-menulst2cfg.1 b/util/grub-menulst2cfg.1 -new file mode 100644 -index 00000000000..91e2ef87113 ---- /dev/null -+++ b/util/grub-menulst2cfg.1 -@@ -0,0 +1,12 @@ -+.TH GRUB-MENULST2CFG 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-menulst2cfg\fR \(em Convert a configuration file from GRUB 0.xx to GRUB 2.xx format. -+ -+.SH SYNOPSIS -+\fBgrub-menulst2cfg\fR [\fIINFILE\fR [\fIOUTFILE\fR]] -+ -+.SH DESCRIPTION -+\fBgrub-menulst2cfg\fR converts a configuration file from GRUB 0.xx to the current format. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkconfig.8 b/util/grub-mkconfig.8 -new file mode 100644 -index 00000000000..a2d1f577b9b ---- /dev/null -+++ b/util/grub-mkconfig.8 -@@ -0,0 +1,17 @@ -+.TH GRUB-MKCONFIG 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkconfig\fR \(em Generate a GRUB configuration file. -+ -+.SH SYNOPSIS -+\fBgrub-mkconfig\fR [-o | --output=\fIFILE\fR] -+ -+.SH DESCRIPTION -+\fBgrub-mkconfig\fR generates a configuration file for GRUB. -+ -+.SH OPTIONS -+.TP -+\fB--output\fR=\fIFILE\fR -+Write generated output to \fIFILE\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkfont.1 b/util/grub-mkfont.1 -new file mode 100644 -index 00000000000..3494857987d ---- /dev/null -+++ b/util/grub-mkfont.1 -@@ -0,0 +1,87 @@ -+.TH GRUB-MKFONT 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkfont\fR \(em Convert common font file formats into the PF2 format. -+ -+.SH SYNOPSIS -+\fBgrub-mkfont\fR [--ascii-bitmaps] [-a | --force-autohint] -+.RS 13 -+[-b | --bold] [-c | --asce=\fINUM\fR] [-d | --desc=\fINUM\fR] -+.RE -+.RS 13 -+[-i | --index=\fINUM\fR] [-n | --name=\fINAME\fR] [--no-bitmap] -+.RE -+.RS 13 -+[--no-hinting] <-o | --output=\fIFILE\fR> -+.RE -+.RS 13 -+[-r | --range=\fIFROM-TO\fR[\fI,FROM-TO\fR]] [-s | --size=\fISIZE\fR] -+.RE -+.RS 13 -+[-v | --verbose] [--width-spec] \fIFONT_FILES\fR -+ -+.SH DESCRIPTION -+\fBgrub-mkfont\fR converts font files from common formats into the PF2 format used by GRUB. -+ -+.SH OPTIONS -+.TP -+--ascii-bitmaps -+Save only bitmaps for ASCII characters. -+ -+.TP -+--force-autohint -+Force generation of automatic hinting. -+ -+.TP -+--bold -+Convert font to bold. -+ -+.TP -+--asce=\fINUM\fR -+Set font ascent to \fINUM\fR. -+ -+.TP -+--desc=\fINUM\fR -+Set font descent to \fINUM\fR. -+ -+.TP -+--index=\fINUM\fR -+Select face index \fINUM\fR. -+ -+.TP -+--name=\fINAME\fR -+Set font family to \fINAME\fR. -+ -+.TP -+--no-bitmap -+Ignore bitmap strikes when loading. -+ -+.TP -+--no-hinting -+Disable hinting. -+ -+.TP -+--output=\fIFILE\fR -+Save ouptut to \fIFILE\fR. This argument is required. -+ -+.TP -+--range=\fIFROM-TO\fR\fI,FROM-TO\fR -+Set the font ranges to each pair of \fIFROM\fR,\fITO\fR. -+ -+.TP -+--size=\fISIZE\fR -+Set font size to \fISIZE\fR. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+--width-spec -+Create a width summary file. -+ -+.TP -+\fIFONT_FILES\fR -+The input files to be converted. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 -new file mode 100644 -index 00000000000..4dea4f54597 ---- /dev/null -+++ b/util/grub-mkimage.1 -@@ -0,0 +1,95 @@ -+.TH GRUB-MKIMAGE 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkimage\fR \(em Make a bootable GRUB image. -+ -+.SH SYNOPSIS -+\fBgrub-mkimage\fR [-c | --config=\fRFILE\fI] [-C | --compression=(\fIxz\fR,\fInone\fR,\fIauto\fR)] -+.RS 14 -+[-d | --directory=\fRDIR\fR] [-k | --pubkey=\fIFILE\fR] -+.RE -+.RS 14 -+[-m | --memdisk=\fIFILE\fR] [-n | --note] [-o | --output=\fIFILE\fR] -+.RE -+.RS 14 -+[-O | --format=\fIFORMAT\fR] [-p | --prefix=\fIDIR\fR] -+.RE -+.RS 14 -+[-v | --verbose] \fIMODULES\fR -+ -+.SH DESCRIPTION -+\fBgrub-mkimage\fI builds a bootable image of GRUB. -+ -+.SH OPTIONS -+.TP -+--config=\fIFILE\fR -+Embed \fIFILE\fR as the image's initial configuration file. -+ -+.TP -+--compression=(\fIxz\fR,\fInone\fR,\fIauto\fR) -+Use one of \fIxz\fR, \fInone\fR, or \fIauto\fR as the compression method for the core image. -+ -+.TP -+--directory=\fIDIR\fR -+Use images and modules from \fIDIR\fR. The default value is \fB/usr/lib/grub/\fR. -+ -+.TP -+--pubkey=\fIFILE\fR -+Embed the public key \fIFILE\fR for signature checking. -+ -+.TP -+--memdisk=\fIFILE\fR -+Embed the memdisk image \fIFILE\fR. If no \fB-p\fR option is also specified, this implies \fI-p (memdisk)/boot/grub\fR. -+ -+.TP -+--note -+Add a CHRP \fINOTE\fR section. This option is only valid on IEEE1275 platforms. -+ -+.TP -+--output=\fIFILE\fR -+Write the generated file to \fIFILE\fR. The default is to write to standard output. -+ -+.TP -+--format=\fIFORMAT\fR -+Generate an image in the specified \fIFORMAT\fR. Valid values are: -+.RS -+.RS 4 -+.P -+i386-coreboot, -+i386-multiboot, -+i386-pc, -+i386-pc-pxe, -+i386-efi, -+i386-ieee1275, -+i386-qemu, -+x86_64-efi, -+mipsel-yeeloong-flash, -+mipsel-fuloong2f-flash, -+mipself-loongson-elf, -+powerpc-ieee1275, -+sparc64-ieee1275-raw, -+sparc64-ieee1275-cdcore, -+sparc64-ieee1275-aout, -+ia64-efi, -+mips-arc, -+mipsel-arc, -+mipsel-qemu_mips-elf, -+mips-qemu_mips-flash, -+mipsel-qemu_mips-flash, -+mips-qemu_mips-elf -+.RE -+.RE -+ -+.TP -+--prefix=\fIDIR\fR -+Set prefix directory. The default value is \fI/boot/grub\fR. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+\fIMODULES\fR -+Include \fIMODULES\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mklayout.1 b/util/grub-mklayout.1 -new file mode 100644 -index 00000000000..d1bbc2ec515 ---- /dev/null -+++ b/util/grub-mklayout.1 -@@ -0,0 +1,27 @@ -+.TH GRUB-MKLAYOUT 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mklayout\fR \(em Generate a GRUB keyboard layout file. -+ -+.SH SYNOPSIS -+\fBgrub-mklayout\fR [-i | --input=\fIFILE\fR] [-o | --output=\fIFILE\fR] -+.RS 15 -+[-v | --verbose] -+ -+.SH DESCRIPTION -+\fBgrub-mklayout\fR generates a GRUB keyboard layout description which corresponds with the Linux console layout description given as input. -+ -+.SH OPTIONS -+.TP -+--input=\fIFILE\fR -+Use \fIFILE\fR as the input. The default value is the standard input device. -+ -+.TP -+--output=\fIFILE\fR -+Use \fIFILE\fR as the output. The default value is the standard output device. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mknetdir.1 b/util/grub-mknetdir.1 -new file mode 100644 -index 00000000000..fa7e8d4ef0d ---- /dev/null -+++ b/util/grub-mknetdir.1 -@@ -0,0 +1,12 @@ -+.TH GRUB-MKNETDIR 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mknetdir\fR \(em Prepare a GRUB netboot directory. -+ -+.SH SYNOPSIS -+\fBgrub-mknetdir\fR -+ -+.SH DESCRIPTION -+\fBgrub-mknetdir\fR prepares a directory for GRUB to be netbooted from. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkpasswd-pbkdf2.1 b/util/grub-mkpasswd-pbkdf2.1 -new file mode 100644 -index 00000000000..73c437c15d8 ---- /dev/null -+++ b/util/grub-mkpasswd-pbkdf2.1 -@@ -0,0 +1,27 @@ -+.TH GRUB-MKPASSWD-PBKDF2 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkpasswd-pbkdf2\fR \(em Generate a PBKDF2 password hash. -+ -+.SH SYNOPSIS -+\fBgrub-mkpasswd-pbkdf2\fR [-c | --iteration-count=\fINUM\fR] [-l | --buflen=\fINUM\fR] -+.RS 22 -+[-s | --salt=\fINUM\fR] -+ -+.SH DESCRIPTION -+\fBgrub-mkpasswd-pbkdf2\fR generates a PBKDF2 password string suitable for use in a GRUB configuration file. -+ -+.SH OPTIONS -+.TP -+--iteration-count=\fINUM\fR -+Number of PBKDF2 iterations. -+ -+.TP -+--buflen=\fINUM\fR -+Length of generated hash. -+ -+.TP -+--salt=\fINUM\fR -+Length of salt to use. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkrelpath.1 b/util/grub-mkrelpath.1 -new file mode 100644 -index 00000000000..85f1113621d ---- /dev/null -+++ b/util/grub-mkrelpath.1 -@@ -0,0 +1,12 @@ -+.TH GRUB-MKRELPATH 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkrelpath\fR \(em Generate a relative GRUB path given an OS path. -+ -+.SH SYNOPSIS -+\fBgrub-mkrelpath\fR \fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-mkrelpath\fR takes an OS filesystem path for \fIFILE\fR and returns a relative path suitable for use in a GRUB configuration file. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkrescue.1 b/util/grub-mkrescue.1 -new file mode 100644 -index 00000000000..4ed9fc723fd ---- /dev/null -+++ b/util/grub-mkrescue.1 -@@ -0,0 +1,123 @@ -+.TH GRUB-MKRESCUE 3 "Wed Feb 26 2014" -+.SH NAME -+grub-mkrescue \(em Generate a GRUB rescue image using GNU Xorriso. -+ -+.SH SYNOPSIS -+\fBgrub-mkrescue\fR [-o | --output=\fIFILE\fR] [--modules=\fIMODULES\fR] -+.RS 15 -+[--install-modules=\fIMODULES\fR] [--themes=\fITHEMES\fR] -+.RE -+.RS 15 -+[--fonts=\fIFONTS\fR] [--locales=\fILOCALES\fR] -+.RE -+.RS 15 -+[--compress[=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR]] [-d | --directory=\fIDIR\fR] -+.RE -+.RS 15 -+[--grub-mkimage=\fIFILE\fR] [--rom-directory=\fIDIR\fR] -+.RE -+.RS 15 -+[--xorriso=\fIFILE\fR] [--grub-glue-efi=\fIFILE\fR] -+.RE -+.RS 15 -+[--grub-render-label=\fIFILE\fR] [--label-font=\fIFILE\fR] -+.RE -+.RS 15 -+[--label-color=\fICOLOR\fR] [--label-bgcolor=\fIFILE\fR] -+.RE -+.RS 15 -+[--product-name=\fISTRING\fR] [--product-version=\fISTRING\fR] -+.RE -+.RS 15 -+[--sparc-boot] [--arcs-boot] -+ -+.SH DESCRIPTION -+\fBgrub-mkrescue\fR can be used to generate a rescue image with the GRUB bootloader. -+ -+.SH OPTIONS -+.TP -+\fB--output\fR=\fIFILE\fR -+Write the generated file to \fIFILE\fR. The default is to write to standard output. -+ -+.TP -+\fB--modules\fR=\fIMODULES\fR -+Pre-load modules specified by \fIMODULES\fR. -+ -+.TP -+\fB--install-modules\fR=\fIMODULES\fR -+Install only \fIMODULES\fR and their dependencies. The default is to install all available modules. -+ -+.TP -+\fB--themes\fR=\fITHEMES\fR -+Install \fITHEMES\fR. The default is to install the \fIstarfield\fR theme, if available. -+ -+.TP -+\fB--fonts\fR=\fIFONTS\fR -+Install \fIFONTS\fR. The default is to install the \fIunicode\fR font. -+ -+.TP -+\fB--locales\fR=\fILOCALES\fR -+Install only locales listed in \fILOCALES\fR. The default is to install all available locales. -+ -+.TP -+\fB--compress\fR[=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR] -+Compress GRUB files using the specified compression algorithm. -+ -+.TP -+\fB--directory\fR=\fIDIR\fR -+Use images and modules in \fIDIR\fR. -+ -+.TP -+\fB--grub-mkimage\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-mkimage\fR(1). The default is \fI/usr/bin/grub-mkimage\fR. -+ -+.TP -+\fB--rom-directory\fR=\fIDIR\fR -+Save ROM images in \fIDIR\fR. -+ -+.TP -+\fB--xorriso\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBxorriso\fI. -+ -+.TP -+\fB--grub-glue-efi\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-glue-efi\fR(3). -+ -+.TP -+\fB--grub-render-label\fR=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-render-label\fR(3). -+ -+.TP -+\fB--label-font\fR=\fIFILE\fR -+Use \fIFILE\fR as the font file for generated labels. -+ -+.TP -+\fB--label-color\fR=\fICOLOR\fR -+Use \fICOLOR\fI as the color for generated labels. -+ -+.TP -+\fB--label-bgcolor\fR=\fICOLOR\fR -+Use \fICOLOR\fR as the background color for generated labels. -+ -+.TP -+\fB--product-name\fR=\fISTRING\fR -+Use \fISTRING\fR as the product name in generated labels. -+ -+.TP -+\fB--product-version\fR=\fISTRING\fR -+Use \fISTRING\fR as the product version in generated labels. -+ -+.TP -+\fB--sparc-boot\fR -+Enable booting the SPARC platform. This disables HFS+, APM, ARCS, and "boot as disk image" on the \fIi386-pc\fR target platform. -+ -+.TP -+\fB--arcs-boot\fR -+Enable ARCS booting. This is typically for big-endian MIPS machines, and disables HFS+, APM, sparc64, and "boot as disk image" on the \fIi386-pc\fR target platform. -+ -+.TP -+\fB--\fR -+All options after a \fB--\fR will be passed directly to xorriso's command line when generating the image. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkstandalone.1 b/util/grub-mkstandalone.1 -new file mode 100644 -index 00000000000..ba2d2bdf279 ---- /dev/null -+++ b/util/grub-mkstandalone.1 -@@ -0,0 +1,100 @@ -+.TH GRUB-MKSTANDALONE 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-mkstandalone\fR \(em Generate a standalone image in the selected format. -+ -+.SH SYNOPSIS -+\fBgrub-mkstandalone\fR [-o | --output=\fIFILE\fR] [-O | --format=\fIFORMAT\fR] -+.RS 19 -+[-C | --compression=(\fIxz\fR|\fInone\fR|\fIauto\fR)] -+.RE -+.RS 19 -+[--modules=\fIMODULES\fR] [--install-modules=\fIMODULES\fR] -+.RE -+.RS 19 -+[--themes=\fITHEMES\fR] [--fonts=\fIFONTS\fR] -+.RE -+.RS 19 -+[--locales=\fILOCALES\fR] [--compress[=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR]] -+.RE -+.RS 19 -+[-d | --directory=\fIDIR\fR] [--grub-mkimage=\fIFILE\fR] -+.RE -+.RS 19 -+\fISOURCE...\fR -+ -+.SH DESCRIPTION -+ -+.SH OPTIONS -+.TP -+--output=\fIFILE\fR -+Write the generated file to \fIFILE\fR. The default is to write to standard output. -+ -+.TP -+--format=\fIFORMAT\fR -+Generate an image in the specified \fIFORMAT\fR. Valid values are: -+.RS -+.RS 4 -+.P -+i386-coreboot, -+i386-multiboot, -+i386-pc, -+i386-pc-pxe, -+i386-efi, -+i386-ieee1275, -+i386-qemu, -+x86_64-efi, -+mipsel-yeeloong-flash, -+mipsel-fuloong2f-flash, -+mipself-loongson-elf, -+powerpc-ieee1275, -+sparc64-ieee1275-raw, -+sparc64-ieee1275-cdcore, -+sparc64-ieee1275-aout, -+ia64-efi, -+mips-arc, -+mipsel-arc, -+mipsel-qemu_mips-elf, -+mips-qemu_mips-flash, -+mipsel-qemu_mips-flash, -+mips-qemu_mips-elf -+.RE -+.RE -+ -+.TP -+--compression=(\fIxz\fR|\fInone\fR|\fIauto\fR) -+Use one of \fIxz\fR, \fInone\fR, or \fIauto\fR as the compression method for the core image. -+ -+.TP -+--modules=\fIMODULES\fR -+Pre-load modules specified by \fIMODULES\fR. -+ -+.TP -+--install-modules=\fIMODULES\fR -+Install only \fIMODULES\fR and their dependencies. The default is to install all available modules. -+ -+.TP -+--themes=\fITHEMES\fR -+Install \fITHEMES\fR. The default is to install the \fIstarfield\fR theme, if available. -+ -+.TP -+--fonts=\fIFONTS\fR -+Install \fIFONTS\fR. The default is to install the \fIunicode\fR font. -+ -+.TP -+--locales=\fILOCALES\fR -+Install only locales listed in \fILOCALES\fR. The default is to install all available locales. -+ -+.TP -+--compress[=\fIno\fR,\fIxz\fR,\fIgz\fR,\fIlzo\fR] -+Compress GRUB files using the specified compression algorithm. -+ -+.TP -+--directory=\fIDIR\fR -+Use images and modules in \fIDIR\fR. -+ -+.TP -+--grub-mkimage=\fIFILE\fR -+Use \fIFILE\fR as \fBgrub-mkimage\fR. The default is \fI/usr/bin/grub-mkimage\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-ofpathname.8 b/util/grub-ofpathname.8 -new file mode 100644 -index 00000000000..bf3743aeba1 ---- /dev/null -+++ b/util/grub-ofpathname.8 -@@ -0,0 +1,12 @@ -+.TH GRUB-OFPATHNAME 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-ofpathname\fR \(em Generate an IEEE-1275 device path for a specified device. -+ -+.SH SYNOPSIS -+\fBgrub-ofpathname\fR \fIDEVICE\fR -+ -+.SH DESCRIPTION -+\fBgrub-ofpathname\fR generates an IEEE-1275 device path for the specified \fIDEVICE\fR. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-probe.8 b/util/grub-probe.8 -new file mode 100644 -index 00000000000..04e26c832bb ---- /dev/null -+++ b/util/grub-probe.8 -@@ -0,0 +1,80 @@ -+.TH GRUB-PROBE 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-probe\fR \(em Probe device information for a given path. -+ -+.SH SYNOPSIS -+\fBgrub-probe\fR \[-d | --device] [-m | --device-map=\fIFILE\fR] -+.RS 12 -+[-t | --target=(fs|fs_uuid|fs_label|drive|device|partmap| -+.RE -+.RS 28 -+abstraction|cryptodisk_uuid| -+.RE -+.RS 28 -+msdos_parttype)] -+.RE -+.RS 12 -+[-v | --verbose] (PATH|DEVICE) -+ -+.SH DESCRIPTION -+\fBgrub-probe\fR probes a path or device for filesystem and related information. -+ -+.SH OPTIONS -+.TP -+--device -+Final option represents a \fIDEVICE\fR, rather than a filesystem \fIPATH\fR. -+.TP -+--device-map=\fIFILE\fR -+Use \fIFILE\fR as the device map. The default value is \fI/boot/grub/device.map\fR. -+ -+.TP -+--target=(fs|fs_uuid|fs_label|drive|device|partmap|msdos_parttype) -+Select among various output definitions. The default is \fIfs\fR. -+.RS -+.TP -+\fIfs\fR -+filesystem module -+ -+.TP -+\fIfs_uuid\fR -+filesystem UUID -+ -+.TP -+\fIfs_label\fR -+filesystem label -+ -+.TP -+\fIdrive\fR -+GRUB drive name -+ -+.TP -+\fIdevice\fR -+System device -+ -+.TP -+\fIpartmap\fR -+partition map module -+ -+.TP -+\fIabstraction\fR -+abstraction module -+ -+.TP -+\fIcryptodisk_uuid\fR -+cryptographic container -+ -+.TP -+\fImsdos_partmap\fR -+MS-DOS partition map -+.RE -+ -+.TP -+--verbose -+Print verbose output. -+ -+.TP -+(\fIPATH\fR|\fIDEVICE\fR) -+If --device is passed, a block \fIDEVICE\fR. Otherwise, the \fIPATH\fR of a file on the filesystem. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-reboot.8 b/util/grub-reboot.8 -new file mode 100644 -index 00000000000..faa5e4eece2 ---- /dev/null -+++ b/util/grub-reboot.8 -@@ -0,0 +1,21 @@ -+.TH GRUB-REBOOT 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-reboot\fR \(em Set the default boot menu entry for the next boot only. -+ -+.SH SYNOPSIS -+\fBgrub-reboot\fR [--boot-directory=\fIDIR\fR] \fIMENU_ENTRY\fR -+ -+.SH DESCRIPTION -+\fBgrub-reboot\fR sets the default boot menu entry for the next boot, but not further boots after that. This command only works for GRUB configuration files created with \fIGRUB_DEFAULT=saved\fR in \fI/etc/default/grub\fR. -+ -+.SH OPTIONS -+.TP -+--boot-directory=\fIDIR\fR -+Find GRUB images under \fIDIR/grub\fR. The default value is \fI/boot\fR, resulting in grub images being search for at \fI/boot/grub\fR. -+ -+.TP -+\fIMENU_ENTRY\fR -+A number, a menu item title or a menu item identifier. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-render-label.1 b/util/grub-render-label.1 -new file mode 100644 -index 00000000000..4d51c8abf01 ---- /dev/null -+++ b/util/grub-render-label.1 -@@ -0,0 +1,51 @@ -+.TH GRUB-RENDER-LABEL 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-render-label\fR \(em Render an Apple disk label. -+ -+.SH SYNOPSIS -+\fBgrub-render-label\fR [-b | --bgcolor=\fICOLOR\fR] [-c | --color=\fICOLOR\fR] -+.RS 19 -+[-f | --font=\fIFILE\fR] [-i | --input=\fIFILE\fR] -+.RE -+.RS 19 -+[-o | --output=\fIFILE\fR] [-t | --text=\fISTRING\fR] -+.RE -+.RS 19 -+[-v | --verbose] -+ -+.SH DESCRIPTION -+\fBgrub-render-label\fR renders an Apple disk label (.disk_label) file. -+ -+ -+.SH OPTIONS -+.TP -+\fB--color\fR=\fICOLOR\fR -+Use \fICOLOR\fI as the color for generated labels. -+ -+.TP -+\fB--bgcolor\fR=\fICOLOR\fR -+Use \fICOLOR\fR as the background color for generated labels. -+ -+.TP -+\fB--font\fR=\fIFILE\fR -+Use \fIFILE\fR as the font file for generated labels. -+ -+.TP -+--input=\fIFILE\fR -+Read input text from \fIFILE\fR. -+ -+.TP -+--output=\fIFILE\fR -+Render output to \fIFILE\fR. -+ -+.TP -+--text=\fISTRING\fR -+Use \fISTRING\fR as input text. -+ -+.TP -+--verbose -+Print verbose output. -+ -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-script-check.1 b/util/grub-script-check.1 -new file mode 100644 -index 00000000000..0f1f625b05d ---- /dev/null -+++ b/util/grub-script-check.1 -@@ -0,0 +1,21 @@ -+.TH GRUB-SCRIPT-CHECK 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-script-check\fR \(em Check GRUB configuration file for syntax errors. -+ -+.SH SYNOPSIS -+\fBgrub-script-check\fR [-v | --verbose] \fIPATH\fR -+ -+.SH DESCRIPTION -+\fBgrub-script-check\fR verifies that a specified GRUB configuration file does not contain syntax errors. -+ -+.SH OPTIONS -+.TP -+--verbose -+Print verbose output. -+ -+.TP -+\fIPATH\fR -+Path of the file to use as input. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-set-default.8 b/util/grub-set-default.8 -new file mode 100644 -index 00000000000..a96265a1509 ---- /dev/null -+++ b/util/grub-set-default.8 -@@ -0,0 +1,21 @@ -+.TH GRUB-SET-DEFAULT 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-set-default\fR \(em Set the default boot menu entry for GRUB. -+ -+.SH SYNOPSIS -+\fBgrub-set-default\fR [--boot-directory=\fIDIR\fR] \fIMENU_ENTRY\fR -+ -+.SH DESCRIPTION -+\fBgrub-set-default\fR sets the default boot menu entry for all subsequent boots. This command only works for GRUB configuration files created with \fIGRUB_DEFAULT=saved\fR in \fI/etc/default/grub\fR. -+ -+.SH OPTIONS -+.TP -+--boot-directory=\fIDIR\fR -+Find GRUB images under \fIDIR/grub\fR. The default value is \fI/boot\fR, resulting in grub images being search for at \fI/boot/grub\fR. -+ -+.TP -+\fIMENU_ENTRY\fR -+A number, a menu item title or a menu item identifier. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-sparc64-setup.8 b/util/grub-sparc64-setup.8 -new file mode 100644 -index 00000000000..37ea2dd5eaa ---- /dev/null -+++ b/util/grub-sparc64-setup.8 -@@ -0,0 +1,12 @@ -+.TH GRUB-SPARC64-SETUP 3 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-sparc64-setup\fR \(em Set up a device to boot a sparc64 GRUB image. -+ -+.SH SYNOPSIS -+\fBgrub-sparc64-setup\fR [OPTIONS]. -+ -+.SH DESCRIPTION -+You should not normally run this program directly. Use grub-install instead. -+ -+.SH SEE ALSO -+.BR "info grub" diff --git a/0056-macos-just-build-chainloader-entries-don-t-try-any-x.patch b/0040-macos-just-build-chainloader-entries-don-t-try-any-x.patch similarity index 99% rename from 0056-macos-just-build-chainloader-entries-don-t-try-any-x.patch rename to 0040-macos-just-build-chainloader-entries-don-t-try-any-x.patch index 574d117..8d3139d 100644 --- a/0056-macos-just-build-chainloader-entries-don-t-try-any-x.patch +++ b/0040-macos-just-build-chainloader-entries-don-t-try-any-x.patch @@ -20,7 +20,7 @@ Signed-off-by: Peter Jones 1 file changed, 18 insertions(+), 60 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 1b91c102f35..4b27bd20153 100644 +index 1b91c102f3..4b27bd2015 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -42,68 +42,25 @@ if [ -z "${OSPROBED}" ] ; then diff --git a/0057-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch b/0041-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch similarity index 99% rename from 0057-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch rename to 0041-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch index 68dfc1d..57d2391 100644 --- a/0057-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch +++ b/0041-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch @@ -24,7 +24,7 @@ Signed-off-by: Jeff Mahoney 2 files changed, 533 insertions(+), 20 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 63203034dfc..f1fff7385b5 100644 +index 63203034df..f1fff7385b 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -38,6 +38,9 @@ @@ -690,7 +690,7 @@ index 63203034dfc..f1fff7385b5 100644 + +// vim: si et sw=2: diff --git a/include/grub/btrfs.h b/include/grub/btrfs.h -index 9d93fb6c182..234ad976771 100644 +index 9d93fb6c18..234ad97677 100644 --- a/include/grub/btrfs.h +++ b/include/grub/btrfs.h @@ -29,6 +29,7 @@ enum diff --git a/0058-export-btrfs_subvol-and-btrfs_subvolid.patch b/0042-export-btrfs_subvol-and-btrfs_subvolid.patch similarity index 95% rename from 0058-export-btrfs_subvol-and-btrfs_subvolid.patch rename to 0042-export-btrfs_subvol-and-btrfs_subvolid.patch index d38a6b8..719866e 100644 --- a/0058-export-btrfs_subvol-and-btrfs_subvolid.patch +++ b/0042-export-btrfs_subvol-and-btrfs_subvolid.patch @@ -12,7 +12,7 @@ Signed-off-by: Michael Chang 1 file changed, 2 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index f1fff7385b5..ad1b56b716d 100644 +index f1fff7385b..ad1b56b716 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2714,6 +2714,8 @@ GRUB_MOD_INIT (btrfs) diff --git a/0059-grub2-btrfs-03-follow_default.patch b/0043-grub2-btrfs-03-follow_default.patch similarity index 97% rename from 0059-grub2-btrfs-03-follow_default.patch rename to 0043-grub2-btrfs-03-follow_default.patch index 2b9a136..621f029 100644 --- a/0059-grub2-btrfs-03-follow_default.patch +++ b/0043-grub2-btrfs-03-follow_default.patch @@ -3,12 +3,14 @@ From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 Subject: [PATCH] grub2-btrfs-03-follow_default +Signed-off-by: Michael Chang +Signed-off-by: Robbie Harwood --- grub-core/fs/btrfs.c | 107 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index ad1b56b716d..113c1f746c9 100644 +index ad1b56b716..113c1f746c 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -1256,6 +1256,7 @@ grub_btrfs_mount (grub_device_t dev) diff --git a/0060-grub2-btrfs-04-grub2-install.patch b/0044-grub2-btrfs-04-grub2-install.patch similarity index 94% rename from 0060-grub2-btrfs-04-grub2-install.patch rename to 0044-grub2-btrfs-04-grub2-install.patch index f91c31a..6b2bc78 100644 --- a/0060-grub2-btrfs-04-grub2-install.patch +++ b/0044-grub2-btrfs-04-grub2-install.patch @@ -3,6 +3,8 @@ From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 Subject: [PATCH] grub2-btrfs-04-grub2-install +Signed-off-by: Michael Chang +Signed-off-by: Robbie Harwood --- grub-core/osdep/linux/getroot.c | 7 +++++++ grub-core/osdep/unix/config.c | 17 +++++++++++++++-- @@ -13,7 +15,7 @@ Subject: [PATCH] grub2-btrfs-04-grub2-install 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 001b818fe58..caf9b1ccd3f 100644 +index 001b818fe5..caf9b1ccd3 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -376,6 +376,7 @@ get_btrfs_fs_prefix (const char *mount_path) @@ -38,7 +40,7 @@ index 001b818fe58..caf9b1ccd3f 100644 else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0) { diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c -index 7d6325138ce..46a881530c0 100644 +index 7d6325138c..46a881530c 100644 --- a/grub-core/osdep/unix/config.c +++ b/grub-core/osdep/unix/config.c @@ -82,6 +82,19 @@ grub_util_load_config (struct grub_util_config *cfg) @@ -73,7 +75,7 @@ index 7d6325138ce..46a881530c0 100644 argv[2] = script; argv[3] = '\0'; diff --git a/util/config.c b/util/config.c -index ebcdd8f5e22..f044a880a76 100644 +index ebcdd8f5e2..f044a880a7 100644 --- a/util/config.c +++ b/util/config.c @@ -42,6 +42,16 @@ grub_util_parse_config (FILE *f, struct grub_util_config *cfg, int simple) @@ -94,7 +96,7 @@ index ebcdd8f5e22..f044a880a76 100644 sizeof ("GRUB_DISTRIBUTOR=") - 1) == 0) { diff --git a/util/grub-install.c b/util/grub-install.c -index 0fbe7f78c6d..0f66f36d23a 100644 +index 0fbe7f78c6..0f66f36d23 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -827,6 +827,8 @@ fill_core_services (const char *core_services) @@ -134,7 +136,7 @@ index 0fbe7f78c6d..0f66f36d23a 100644 char *install_drive = NULL; diff --git a/util/grub-mkrelpath.c b/util/grub-mkrelpath.c -index 47a241a391b..5db7a9a7d97 100644 +index 47a241a391..5db7a9a7d9 100644 --- a/util/grub-mkrelpath.c +++ b/util/grub-mkrelpath.c @@ -40,9 +40,12 @@ struct arguments @@ -161,7 +163,7 @@ index 47a241a391b..5db7a9a7d97 100644 if (state->arg_num == 0) arguments->pathname = xstrdup (arg); diff --git a/include/grub/emu/config.h b/include/grub/emu/config.h -index 875d5896ce1..c9a7e5f4ade 100644 +index 875d5896ce..c9a7e5f4ad 100644 --- a/include/grub/emu/config.h +++ b/include/grub/emu/config.h @@ -37,6 +37,7 @@ struct grub_util_config diff --git a/0061-grub2-btrfs-05-grub2-mkconfig.patch b/0045-grub2-btrfs-05-grub2-mkconfig.patch similarity index 94% rename from 0061-grub2-btrfs-05-grub2-mkconfig.patch rename to 0045-grub2-btrfs-05-grub2-mkconfig.patch index 8270505..ca3f86b 100644 --- a/0061-grub2-btrfs-05-grub2-mkconfig.patch +++ b/0045-grub2-btrfs-05-grub2-mkconfig.patch @@ -13,7 +13,7 @@ Signed-off-by: Michael Chang 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 005f093809b..535c0f02499 100644 +index 005f093809..535c0f0249 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -252,7 +252,8 @@ export GRUB_DEFAULT \ @@ -27,10 +27,10 @@ index 005f093809b..535c0f02499 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 42c2ea9ba50..fafeac95061 100644 +index 0f6505bf3b..5e96f6cc5d 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in -@@ -52,7 +52,11 @@ grub_warn () +@@ -49,7 +49,11 @@ grub_warn () make_system_path_relative_to_its_root () { @@ -43,7 +43,7 @@ index 42c2ea9ba50..fafeac95061 100644 is_path_readable_by_grub () diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 858b526c925..de727e6ee6b 100644 +index 858b526c92..de727e6ee6 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -27,6 +27,14 @@ export TEXTDOMAINDIR="@localedir@" @@ -90,7 +90,7 @@ index 858b526c925..de727e6ee6b 100644 +EOF +fi diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 0f3c19e30cc..cbfaca34cc7 100644 +index 292e333324..7bb3a211a7 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -66,10 +66,14 @@ fi @@ -109,7 +109,7 @@ index 0f3c19e30cc..cbfaca34cc7 100644 xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index ada20775a14..e9e73b815fb 100644 +index ada20775a1..e9e73b815f 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -73,10 +73,14 @@ fi diff --git a/0046-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/0046-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch deleted file mode 100644 index 78a6fa1..0000000 --- a/0046-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +++ /dev/null @@ -1,458 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Robert Marshall -Date: Mon, 16 Mar 2015 14:14:19 -0400 -Subject: [PATCH] Use Distribution Package Sort for grub2-mkconfig (#1124074) - -Users reported that newly installed kernels on their systems installed -with grub-mkconfig would not appear on the grub boot list in order -starting with the most recent. Added an option for rpm-based systems to -use the rpm-sort library to sort kernels instead. - -Resolves rhbz#1124074 - -Signed-off-by: Robert Marshall -[pjones: fix --enable-rpm-sort configure option] -Signed-off-by: Peter Jones -[thierry.vignaud: fix build with rpm-4.16] -Signed-off-by: Thierry Vignaud ---- - configure.ac | 38 +++++++ - Makefile.util.def | 16 +++ - util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ - util/grub-mkconfig_lib.in | 11 +- - util/grub-rpm-sort.8 | 12 ++ - 5 files changed, 357 insertions(+), 1 deletion(-) - create mode 100644 util/grub-rpm-sort.c - create mode 100644 util/grub-rpm-sort.8 - -diff --git a/configure.ac b/configure.ac -index bec8535af70..fdcb452581c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -72,6 +72,7 @@ grub_TRANSFORM([grub-mkrelpath]) - grub_TRANSFORM([grub-mkrescue]) - grub_TRANSFORM([grub-probe]) - grub_TRANSFORM([grub-reboot]) -+grub_TRANSFORM([grub-rpm-sort]) - grub_TRANSFORM([grub-script-check]) - grub_TRANSFORM([grub-set-default]) - grub_TRANSFORM([grub-sparc64-setup]) -@@ -95,6 +96,7 @@ grub_TRANSFORM([grub-mkrescue.1]) - grub_TRANSFORM([grub-mkstandalone.3]) - grub_TRANSFORM([grub-ofpathname.3]) - grub_TRANSFORM([grub-probe.3]) -+grub_TRANSFORM([grub-rpm-sort.8]) - grub_TRANSFORM([grub-reboot.3]) - grub_TRANSFORM([grub-render-label.3]) - grub_TRANSFORM([grub-script-check.3]) -@@ -1860,6 +1862,42 @@ fi - - AC_SUBST([LIBDEVMAPPER]) - -+AC_ARG_ENABLE([rpm-sort], -+ [AS_HELP_STRING([--enable-rpm-sort], -+ [enable native rpm sorting of kernels in grub (default=guessed)])]) -+if test x"$enable_rpm_sort" = xno ; then -+ rpm_sort_excuse="explicitly disabled" -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ # Check for rpmlib header. -+ AC_CHECK_HEADER([rpm/rpmlib.h], [], -+ [rpm_sort_excuse="need rpm/rpmlib header"]) -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ # Check for rpm library. -+ AC_CHECK_LIB([rpm], [rpmvercmp], [], -+ [rpm_sort_excuse="rpmlib missing rpmvercmp"]) -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ LIBRPM="-lrpm"; -+ AC_DEFINE([HAVE_RPM], [1], -+ [Define to 1 if you have the rpm library.]) -+fi -+ -+if test x"$LIBRPM" = x ; then -+ # Check for rpm library. -+ AC_CHECK_LIB([rpmio], [rpmvercmp], [], -+ [rpm_sort_excuse="rpmio missing rpmvercmp"]) -+ LIBRPM="-lrpmio"; -+ AC_DEFINE([HAVE_RPMIO], [1], -+ [Define to 1 if you have the rpm library.]) -+fi -+ -+AC_SUBST([LIBRPM]) -+ - LIBGEOM= - if test x$host_kernel = xkfreebsd; then - AC_CHECK_LIB([geom], [geom_gettree], [], -diff --git a/Makefile.util.def b/Makefile.util.def -index 2c9b283a230..ba4cf4b29b0 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -703,6 +703,22 @@ program = { - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - }; - -+program = { -+ name = grub-rpm-sort; -+ mansection = 8; -+ installdir = sbin; -+ -+ common = grub-core/kern/emu/misc.c; -+ common = grub-core/kern/emu/argp_common.c; -+ common = grub-core/osdep/init.c; -+ common = util/misc.c; -+ common = util/grub-rpm-sort.c; -+ -+ ldadd = libgrubkern.a; -+ ldadd = grub-core/lib/gnulib/libgnu.a; -+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; -+}; -+ - script = { - name = grub-mkconfig; - common = util/grub-mkconfig.in; -diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c -new file mode 100644 -index 00000000000..f33bd1ed568 ---- /dev/null -+++ b/util/grub-rpm-sort.c -@@ -0,0 +1,281 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static size_t -+read_file (const char *input, char **ret) -+{ -+ FILE *in; -+ size_t s; -+ size_t sz = 2048; -+ size_t offset = 0; -+ char *text; -+ -+ if (!strcmp(input, "-")) -+ in = stdin; -+ else -+ in = grub_util_fopen(input, "r"); -+ -+ text = xmalloc (sz); -+ -+ if (!in) -+ grub_util_error (_("cannot open `%s': %s"), input, strerror (errno)); -+ -+ while ((s = fread (text + offset, 1, sz - offset, in)) != 0) -+ { -+ offset += s; -+ if (sz - offset == 0) -+ { -+ sz += 2048; -+ text = xrealloc (text, sz); -+ } -+ } -+ -+ text[offset] = '\0'; -+ *ret = text; -+ -+ if (in != stdin) -+ fclose(in); -+ -+ return offset + 1; -+} -+ -+/* returns name/version/release */ -+/* NULL string pointer returned if nothing found */ -+static void -+split_package_string (char *package_string, char **name, -+ char **version, char **release) -+{ -+ char *package_version, *package_release; -+ -+ /* Release */ -+ package_release = strrchr (package_string, '-'); -+ -+ if (package_release != NULL) -+ *package_release++ = '\0'; -+ -+ *release = package_release; -+ -+ /* Version */ -+ package_version = strrchr(package_string, '-'); -+ -+ if (package_version != NULL) -+ *package_version++ = '\0'; -+ -+ *version = package_version; -+ /* Name */ -+ *name = package_string; -+ -+ /* Bubble up non-null values from release to name */ -+ if (*name == NULL) -+ { -+ *name = (*version == NULL ? *release : *version); -+ *version = *release; -+ *release = NULL; -+ } -+ if (*version == NULL) -+ { -+ *version = *release; -+ *release = NULL; -+ } -+} -+ -+/* -+ * package name-version-release comparator for qsort -+ * expects p, q which are pointers to character strings (char *) -+ * which will not be altered in this function -+ */ -+static int -+package_version_compare (const void *p, const void *q) -+{ -+ char *local_p, *local_q; -+ char *lhs_name, *lhs_version, *lhs_release; -+ char *rhs_name, *rhs_version, *rhs_release; -+ int vercmpflag = 0; -+ -+ local_p = alloca (strlen (*(char * const *)p) + 1); -+ local_q = alloca (strlen (*(char * const *)q) + 1); -+ -+ /* make sure these allocated */ -+ assert (local_p); -+ assert (local_q); -+ -+ strcpy (local_p, *(char * const *)p); -+ strcpy (local_q, *(char * const *)q); -+ -+ split_package_string (local_p, &lhs_name, &lhs_version, &lhs_release); -+ split_package_string (local_q, &rhs_name, &rhs_version, &rhs_release); -+ -+ /* Check Name and return if unequal */ -+ vercmpflag = rpmvercmp ((lhs_name == NULL ? "" : lhs_name), -+ (rhs_name == NULL ? "" : rhs_name)); -+ if (vercmpflag != 0) -+ return vercmpflag; -+ -+ /* Check version and return if unequal */ -+ vercmpflag = rpmvercmp ((lhs_version == NULL ? "" : lhs_version), -+ (rhs_version == NULL ? "" : rhs_version)); -+ if (vercmpflag != 0) -+ return vercmpflag; -+ -+ /* Check release and return the version compare value */ -+ vercmpflag = rpmvercmp ((lhs_release == NULL ? "" : lhs_release), -+ (rhs_release == NULL ? "" : rhs_release)); -+ -+ return vercmpflag; -+} -+ -+static void -+add_input (const char *filename, char ***package_names, size_t *n_package_names) -+{ -+ char *orig_input_buffer = NULL; -+ char *input_buffer; -+ char *position_of_newline; -+ char **names = *package_names; -+ char **new_names = NULL; -+ size_t n_names = *n_package_names; -+ -+ if (!*package_names) -+ new_names = names = xmalloc (sizeof (char *) * 2); -+ -+ if (read_file (filename, &orig_input_buffer) < 2) -+ { -+ if (new_names) -+ free (new_names); -+ if (orig_input_buffer) -+ free (orig_input_buffer); -+ return; -+ } -+ -+ input_buffer = orig_input_buffer; -+ while (input_buffer && *input_buffer && -+ (position_of_newline = strchrnul (input_buffer, '\n'))) -+ { -+ size_t sz = position_of_newline - input_buffer; -+ char *new; -+ -+ if (sz == 0) -+ { -+ input_buffer = position_of_newline + 1; -+ continue; -+ } -+ -+ new = xmalloc (sz+1); -+ strncpy (new, input_buffer, sz); -+ new[sz] = '\0'; -+ -+ names = xrealloc (names, sizeof (char *) * (n_names + 1)); -+ names[n_names] = new; -+ n_names++; -+ -+ /* move buffer ahead to next line */ -+ input_buffer = position_of_newline + 1; -+ if (*position_of_newline == '\0') -+ input_buffer = NULL; -+ } -+ -+ free (orig_input_buffer); -+ -+ *package_names = names; -+ *n_package_names = n_names; -+} -+ -+static char * -+help_filter (int key, const char *text, void *input __attribute__ ((unused))) -+{ -+ return (char *)text; -+} -+ -+static struct argp_option options[] = { -+ { 0, } -+}; -+ -+struct arguments -+{ -+ size_t ninputs; -+ size_t input_max; -+ char **inputs; -+}; -+ -+static error_t -+argp_parser (int key, char *arg, struct argp_state *state) -+{ -+ struct arguments *arguments = state->input; -+ switch (key) -+ { -+ case ARGP_KEY_ARG: -+ assert (arguments->ninputs < arguments->input_max); -+ arguments->inputs[arguments->ninputs++] = xstrdup (arg); -+ break; -+ default: -+ return ARGP_ERR_UNKNOWN; -+ } -+ return 0; -+} -+ -+static struct argp argp = { -+ options, argp_parser, N_("[INPUT_FILES]"), -+ N_("Sort a list of strings in RPM version sort order."), -+ NULL, help_filter, NULL -+}; -+ -+int -+main (int argc, char *argv[]) -+{ -+ struct arguments arguments; -+ char **package_names = NULL; -+ size_t n_package_names = 0; -+ int i; -+ -+ grub_util_host_init (&argc, &argv); -+ -+ memset (&arguments, 0, sizeof (struct arguments)); -+ arguments.input_max = argc+1; -+ arguments.inputs = xmalloc ((arguments.input_max + 1) -+ * sizeof (arguments.inputs[0])); -+ memset (arguments.inputs, 0, (arguments.input_max + 1) -+ * sizeof (arguments.inputs[0])); -+ -+ /* Parse our arguments */ -+ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) -+ grub_util_error ("%s", _("Error in parsing command line arguments\n")); -+ -+ /* If there's no inputs in argv, add one for stdin */ -+ if (!arguments.ninputs) -+ { -+ arguments.ninputs = 1; -+ arguments.inputs[0] = xmalloc (2); -+ strcpy(arguments.inputs[0], "-"); -+ } -+ -+ for (i = 0; i < arguments.ninputs; i++) -+ add_input(arguments.inputs[i], &package_names, &n_package_names); -+ -+ if (package_names == NULL || n_package_names < 1) -+ grub_util_error ("%s", _("Invalid input\n")); -+ -+ qsort (package_names, n_package_names, sizeof (char *), -+ package_version_compare); -+ -+ /* send sorted list to stdout */ -+ for (i = 0; i < n_package_names; i++) -+ { -+ fprintf (stdout, "%s\n", package_names[i]); -+ free (package_names[i]); -+ } -+ -+ free (package_names); -+ for (i = 0; i < arguments.ninputs; i++) -+ free (arguments.inputs[i]); -+ -+ free (arguments.inputs); -+ -+ return 0; -+} -diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 0f6505bf3b6..42c2ea9ba50 100644 ---- a/util/grub-mkconfig_lib.in -+++ b/util/grub-mkconfig_lib.in -@@ -33,6 +33,9 @@ fi - if test "x$grub_mkrelpath" = x; then - grub_mkrelpath="${bindir}/@grub_mkrelpath@" - fi -+if test "x$grub_rpm_sort" = x; then -+ grub_rpm_sort="${sbindir}/@grub_rpm_sort@" -+fi - - if command -v gettext >/dev/null; then - : -@@ -218,6 +221,12 @@ version_sort () - esac - } - -+if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then -+ kernel_sort="$grub_rpm_sort" -+else -+ kernel_sort=version_sort -+fi -+ - version_test_numeric () - { - version_test_numeric_a="$1" -@@ -234,7 +243,7 @@ version_test_numeric () - version_test_numeric_a="$version_test_numeric_b" - version_test_numeric_b="$version_test_numeric_c" - fi -- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then -+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then - return 0 - else - return 1 -diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 -new file mode 100644 -index 00000000000..8ce21488448 ---- /dev/null -+++ b/util/grub-rpm-sort.8 -@@ -0,0 +1,12 @@ -+.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. -+ -+.SH SYNOPSIS -+\fBgrub-rpm-sort\fR [OPTIONS]. -+ -+.SH DESCRIPTION -+You should not normally run this program directly. Use grub-mkconfig instead. -+ -+.SH SEE ALSO -+.BR "info grub" diff --git a/0062-grub2-btrfs-06-subvol-mount.patch b/0046-grub2-btrfs-06-subvol-mount.patch similarity index 98% rename from 0062-grub2-btrfs-06-subvol-mount.patch rename to 0046-grub2-btrfs-06-subvol-mount.patch index 9a51175..8cdf247 100644 --- a/0062-grub2-btrfs-06-subvol-mount.patch +++ b/0046-grub2-btrfs-06-subvol-mount.patch @@ -3,6 +3,8 @@ From: Michael Chang Date: Tue, 9 Jul 2019 13:56:16 +0200 Subject: [PATCH] grub2-btrfs-06-subvol-mount +Signed-off-by: Michael Chang +Signed-off-by: Robbie Harwood --- grub-core/fs/btrfs.c | 195 +++++++++++++++++++++++++++++++++++++++- grub-core/osdep/linux/getroot.c | 148 +++++++++++++++++++++++++++++- @@ -11,7 +13,7 @@ Subject: [PATCH] grub2-btrfs-06-subvol-mount 4 files changed, 392 insertions(+), 5 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 113c1f746c9..d323746ecfa 100644 +index 113c1f746c..d323746ecf 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -41,6 +41,7 @@ @@ -277,7 +279,7 @@ index 113c1f746c9..d323746ecfa 100644 grub_cmd_btrfs_list_subvols, 0, "[-p|-n] [-o var] DEVICE", diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index caf9b1ccd3f..28790307e00 100644 +index caf9b1ccd3..28790307e0 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -107,6 +107,14 @@ struct btrfs_ioctl_search_key @@ -460,7 +462,7 @@ index caf9b1ccd3f..28790307e00 100644 grub_make_system_path_relative_to_its_root_os (const char *path) { diff --git a/util/grub-install.c b/util/grub-install.c -index 0f66f36d23a..84ed6e88ecb 100644 +index 0f66f36d23..84ed6e88ec 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1569,6 +1569,55 @@ main (int argc, char *argv[]) @@ -520,7 +522,7 @@ index 0f66f36d23a..84ed6e88ecb 100644 const char *core_name = NULL; diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h -index 73fa2d34abb..9c642ae3fe3 100644 +index 73fa2d34ab..9c642ae3fe 100644 --- a/include/grub/emu/getroot.h +++ b/include/grub/emu/getroot.h @@ -53,6 +53,11 @@ char ** diff --git a/0063-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch b/0047-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch similarity index 97% rename from 0063-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch rename to 0047-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch index b02ab53..a5db09a 100644 --- a/0063-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch +++ b/0047-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch @@ -10,7 +10,7 @@ Ref: bsc#953538 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index d323746ecfa..673ded03522 100644 +index d323746ecf..673ded0352 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -1260,11 +1260,41 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path) diff --git a/0064-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch b/0048-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch similarity index 98% rename from 0064-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch rename to 0048-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch index d4e20cd..99c106d 100644 --- a/0064-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch +++ b/0048-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch @@ -3,12 +3,14 @@ From: Michael Chang Date: Thu, 11 May 2017 08:56:57 +0000 Subject: [PATCH] Grub not working correctly with btrfs snapshots (bsc#1026511) +Signed-off-by: Michael Chang +Signed-off-by: Robbie Harwood --- grub-core/fs/btrfs.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 238 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 673ded03522..2b21cbaa67e 100644 +index 673ded0352..2b21cbaa67 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2887,6 +2887,238 @@ out: diff --git a/0065-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch b/0049-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch similarity index 98% rename from 0065-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch rename to 0049-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch index bde7096..d07dd27 100644 --- a/0065-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch +++ b/0049-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 585fa6662b6..03f9a9d0118 100644 +index 585fa6662b..03f9a9d011 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -24,6 +24,10 @@ diff --git a/0066-Use-grub_efi_.-memory-helpers-where-reasonable.patch b/0050-Use-grub_efi_.-memory-helpers-where-reasonable.patch similarity index 89% rename from 0066-Use-grub_efi_.-memory-helpers-where-reasonable.patch rename to 0050-Use-grub_efi_.-memory-helpers-where-reasonable.patch index 4fa92c0..2a3d27b 100644 --- a/0066-Use-grub_efi_.-memory-helpers-where-reasonable.patch +++ b/0050-Use-grub_efi_.-memory-helpers-where-reasonable.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 3ff305b1d32..ba3d2930197 100644 +index 07c4937898..89ac84cc66 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -65,7 +65,7 @@ grub_chainloader_unload (void) @@ -34,7 +34,7 @@ index 3ff305b1d32..ba3d2930197 100644 grub_loader_unset (); -@@ -523,10 +523,9 @@ grub_efi_get_media_file_path (grub_efi_device_path_t *dp) +@@ -527,10 +527,9 @@ grub_efi_get_media_file_path (grub_efi_device_path_t *dp) static grub_efi_boolean_t handle_image (void *data, grub_efi_uint32_t datasize) { @@ -46,7 +46,7 @@ index 3ff305b1d32..ba3d2930197 100644 char *buffer_aligned = NULL; grub_efi_uint32_t i; struct grub_pe32_section_table *section; -@@ -537,8 +536,6 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -541,8 +540,6 @@ handle_image (void *data, grub_efi_uint32_t datasize) int found_entry_point = 0; int rc; @@ -55,7 +55,7 @@ index 3ff305b1d32..ba3d2930197 100644 rc = read_header (data, datasize, &context); if (rc < 0) { -@@ -578,8 +575,8 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -582,8 +579,8 @@ handle_image (void *data, grub_efi_uint32_t datasize) grub_dprintf ("chain", "image size is %08"PRIxGRUB_UINT64_T", datasize is %08x\n", context.image_size, datasize); @@ -66,7 +66,7 @@ index 3ff305b1d32..ba3d2930197 100644 if (efi_status != GRUB_EFI_SUCCESS) { -@@ -811,14 +808,14 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -815,14 +812,14 @@ handle_image (void *data, grub_efi_uint32_t datasize) grub_dprintf ("chain", "entry_point returned %ld\n", efi_status); grub_memcpy (li, &li_bak, sizeof (grub_efi_loaded_image_t)); @@ -83,7 +83,7 @@ index 3ff305b1d32..ba3d2930197 100644 return 0; } -@@ -826,10 +823,7 @@ error_exit: +@@ -830,10 +827,7 @@ error_exit: static grub_err_t grub_secureboot_chainloader_unload (void) { @@ -95,7 +95,7 @@ index 3ff305b1d32..ba3d2930197 100644 grub_free (file_path); grub_free (cmdline); cmdline = 0; -@@ -1096,7 +1090,7 @@ fail: +@@ -1100,7 +1094,7 @@ fail: grub_free (file_path); if (address) diff --git a/0067-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch b/0051-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch similarity index 92% rename from 0067-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch rename to 0051-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch index 1a96b43..f649c8c 100644 --- a/0067-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch +++ b/0051-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch @@ -12,10 +12,10 @@ Signed-off-by: Peter Jones 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index ba3d2930197..47f5aa14817 100644 +index 89ac84cc66..ac8dfd40c6 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c -@@ -806,7 +806,8 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -810,7 +810,8 @@ handle_image (void *data, grub_efi_uint32_t datasize) efi_status = efi_call_2 (entry_point, grub_efi_image_handle, grub_efi_system_table); @@ -26,7 +26,7 @@ index ba3d2930197..47f5aa14817 100644 efi_status = grub_efi_free_pool (buffer); diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 117469450d3..99628801478 100644 +index 117469450d..9962880147 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -546,7 +546,16 @@ typedef grub_uint64_t grub_efi_uint64_t; diff --git a/0068-don-t-use-int-for-efi-status.patch b/0052-don-t-use-int-for-efi-status.patch similarity index 94% rename from 0068-don-t-use-int-for-efi-status.patch rename to 0052-don-t-use-int-for-efi-status.patch index 44d3555..4d48e37 100644 --- a/0068-don-t-use-int-for-efi-status.patch +++ b/0052-don-t-use-int-for-efi-status.patch @@ -8,7 +8,7 @@ Subject: [PATCH] don't use int for efi status 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 05d8237a9b2..ae9885edb84 100644 +index 05d8237a9b..ae9885edb8 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -167,7 +167,7 @@ grub_reboot (void) diff --git a/0069-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch b/0053-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch similarity index 96% rename from 0069-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch rename to 0053-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch index 1014900..fb71ea5 100644 --- a/0069-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch +++ b/0053-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch @@ -8,7 +8,7 @@ Subject: [PATCH] make GRUB_MOD_INIT() declare its function prototypes. 1 file changed, 2 insertions(+) diff --git a/include/grub/dl.h b/include/grub/dl.h -index b3753c9ca26..91933b85f2c 100644 +index b3753c9ca2..91933b85f2 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -54,6 +54,7 @@ grub_mod_fini (void) diff --git a/0070-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch b/0054-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch similarity index 96% rename from 0070-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch rename to 0054-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch index 890aa34..ae8a8c6 100644 --- a/0070-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch +++ b/0054-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch @@ -16,7 +16,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/util/grub-install.c b/util/grub-install.c -index 84ed6e88ecb..a2bec7446cb 100644 +index 84ed6e88ec..a2bec7446c 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1190,18 +1190,8 @@ main (int argc, char *argv[]) diff --git a/0054-Fix-up-some-man-pages-rpmdiff-noticed.patch b/0054-Fix-up-some-man-pages-rpmdiff-noticed.patch deleted file mode 100644 index 8016a62..0000000 --- a/0054-Fix-up-some-man-pages-rpmdiff-noticed.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 23 Sep 2014 09:58:49 -0400 -Subject: [PATCH] Fix up some man pages rpmdiff noticed. - ---- - configure.ac | 2 ++ - util/grub-macbless.8 | 26 +++++++++++++++++++ - util/grub-mkimage.1 | 2 +- - util/grub-syslinux2cfg.1 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 94 insertions(+), 1 deletion(-) - create mode 100644 util/grub-macbless.8 - create mode 100644 util/grub-syslinux2cfg.1 - -diff --git a/configure.ac b/configure.ac -index ed31ea457d2..537ed411469 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -87,6 +87,7 @@ grub_TRANSFORM([grub-get-kernel-settings.3]) - grub_TRANSFORM([grub-glue-efi.3]) - grub_TRANSFORM([grub-install.1]) - grub_TRANSFORM([grub-kbdcomp.3]) -+grub_TRANSFORM([grub-macbless.8]) - grub_TRANSFORM([grub-menulst2cfg.1]) - grub_TRANSFORM([grub-mkconfig.1]) - grub_TRANSFORM([grub-mkfont.3]) -@@ -105,6 +106,7 @@ grub_TRANSFORM([grub-render-label.3]) - grub_TRANSFORM([grub-script-check.3]) - grub_TRANSFORM([grub-set-default.1]) - grub_TRANSFORM([grub-sparc64-setup.3]) -+grub_TRANSFORM([grub-syslinux2cfg.1]) - - # Optimization flag. Allow user to override. - if test "x$TARGET_CFLAGS" = x; then -diff --git a/util/grub-macbless.8 b/util/grub-macbless.8 -new file mode 100644 -index 00000000000..ae842f3a606 ---- /dev/null -+++ b/util/grub-macbless.8 -@@ -0,0 +1,26 @@ -+.TH GRUB-MACBLESS 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-macbless\fR \(em Mac-style bless utility for HFS or HFS+ -+ -+.SH SYNOPSIS -+\fBgrub-macbless\fR [-p | --ppc] [-v | --verbose] [-x | --x86] \fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-mkimage\fR blesses a file on an HFS or HFS+ file system, so that it -+can be used to boot a Mac. -+ -+.SH OPTIONS -+.TP -+--ppc -+Bless the file for use on PPC-based Macs. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+--x86 -+Bless the file for use on x86-based Macs. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 -index 4dea4f54597..0eaaafe505b 100644 ---- a/util/grub-mkimage.1 -+++ b/util/grub-mkimage.1 -@@ -17,7 +17,7 @@ - [-v | --verbose] \fIMODULES\fR - - .SH DESCRIPTION --\fBgrub-mkimage\fI builds a bootable image of GRUB. -+\fBgrub-mkimage\fR builds a bootable image of GRUB. - - .SH OPTIONS - .TP -diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1 -new file mode 100644 -index 00000000000..85309482718 ---- /dev/null -+++ b/util/grub-syslinux2cfg.1 -@@ -0,0 +1,65 @@ -+.TH GRUB-SYSLINUX2CFG 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-syslinux2cfg\fR \(em Transform a syslinux config file into a GRUB config. -+ -+.SH SYNOPSIS -+\fBgrub-syslinux2cfg\fR [-c | --cwd=\fRDIR\fI] [-r | --root=\fIDIR\fR] [-v | --verbose] -+.RE -+.RS 25 -+[-t | --target-root=\fIDIR\fR] [-T | --target-cwd=\fIDIR\fR] -+.RE -+.RS 25 -+[-o | --output=\fIFILE\fR] [[-i | --isolinux] | -+.RE -+.RS 46 -+ [-s | --syslinux] | -+.RE -+.RS 46 -+ [-p | --pxelinux]] \fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-syslinux2cfg\fR builds a GRUB configuration file out of an existing -+syslinux configuration file. -+ -+.SH OPTIONS -+.TP -+--cwd=\fIDIR\fR -+Set \fIDIR\fR as syslinux's working directory. The default is to use the -+parent directory of the input file. -+ -+.TP -+--root=\fIDIR\fR -+Set \fIDIR\fR as the root directory of the syslinux disk. The default value -+is "/". -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+--target-root=\fIDIR\fR -+Root directory as it will be seen at runtime. The default value is "/". -+ -+.TP -+--target-cwd=\fIDIR\fR -+Working directory of syslinux as it will be seen at runtime. The default -+value is the parent directory of the input file. -+ -+.TP -+--output=\fIFILE\fR -+Write the new config file to \fIFILE\fR. The default value is standard output. -+ -+.TP -+--isolinux -+Assume that the input file is an isolinux configuration file. -+ -+.TP -+--pxelinux -+Assume that the input file is a pxelinux configuration file. -+ -+.TP -+--syslinux -+Assume that the input file is a syslinux configuration file. -+ -+.SH SEE ALSO -+.BR "info grub" diff --git a/0071-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch b/0055-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch similarity index 97% rename from 0071-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch rename to 0055-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch index 3fd779f..cd58ff4 100644 --- a/0071-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch +++ b/0055-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 5 insertions(+) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index e9e73b815fb..c23b064be6c 100644 +index e9e73b815f..c23b064be6 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -153,6 +153,7 @@ linux_entry_xsm () diff --git a/0072-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch b/0056-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch similarity index 99% rename from 0072-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch rename to 0056-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch index acfb116..beef0f3 100644 --- a/0072-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch +++ b/0056-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch @@ -63,7 +63,7 @@ Signed-off-by: Peter Jones 1 file changed, 89 insertions(+), 20 deletions(-) diff --git a/grub-core/kern/i386/tsc_pmtimer.c b/grub-core/kern/i386/tsc_pmtimer.c -index c9c36169978..ca15c3aacd7 100644 +index c9c3616997..ca15c3aacd 100644 --- a/grub-core/kern/i386/tsc_pmtimer.c +++ b/grub-core/kern/i386/tsc_pmtimer.c @@ -28,40 +28,101 @@ diff --git a/0073-align-struct-efi_variable-better.patch b/0057-align-struct-efi_variable-better.patch similarity index 92% rename from 0073-align-struct-efi_variable-better.patch rename to 0057-align-struct-efi_variable-better.patch index ec26def..361cb13 100644 --- a/0073-align-struct-efi_variable-better.patch +++ b/0057-align-struct-efi_variable-better.patch @@ -9,7 +9,7 @@ Subject: [PATCH] align struct efi_variable better... 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h -index 36d2dedf47e..9d93ba88bac 100644 +index 36d2dedf47..9d93ba88ba 100644 --- a/include/grub/efiemu/runtime.h +++ b/include/grub/efiemu/runtime.h @@ -33,5 +33,5 @@ struct efi_variable @@ -20,7 +20,7 @@ index 36d2dedf47e..9d93ba88bac 100644 +} GRUB_PACKED GRUB_ALIGNED(8); #endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */ diff --git a/include/grub/types.h b/include/grub/types.h -index 0a3ff159136..ba446d99040 100644 +index 0a3ff15913..ba446d9904 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -29,6 +29,7 @@ diff --git a/0074-Add-BLS-support-to-grub-mkconfig.patch b/0058-Add-BLS-support-to-grub-mkconfig.patch similarity index 89% rename from 0074-Add-BLS-support-to-grub-mkconfig.patch rename to 0058-Add-BLS-support-to-grub-mkconfig.patch index 6c65440..3e5b230 100644 --- a/0074-Add-BLS-support-to-grub-mkconfig.patch +++ b/0058-Add-BLS-support-to-grub-mkconfig.patch @@ -20,30 +20,20 @@ kernels are found in the boot directory were proposed by Yclept Nemo and Tom Gundersen respectively. Signed-off-by: Peter Jones +[javierm: remove outdated URL for BLS document] Signed-off-by: Javier Martinez Canillas +[iwienand@redhat.com: skip machine ID check when updating entries] +Signed-off-by: Ian Wienand +[rharwood: use sort(1), commit message composits, drop man pages] +Signed-off-by: Robbie Harwood --- - util/grub-mkconfig.8 | 4 + util/grub-mkconfig.in | 9 +- util/grub-mkconfig_lib.in | 22 ++++- - util/grub.d/10_linux.in | 223 +++++++++++++++++++++++++++++++++++++++++++++- - 4 files changed, 252 insertions(+), 6 deletions(-) + util/grub.d/10_linux.in | 218 +++++++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 243 insertions(+), 6 deletions(-) -diff --git a/util/grub-mkconfig.8 b/util/grub-mkconfig.8 -index a2d1f577b9b..434fa4deda4 100644 ---- a/util/grub-mkconfig.8 -+++ b/util/grub-mkconfig.8 -@@ -13,5 +13,9 @@ - \fB--output\fR=\fIFILE\fR - Write generated output to \fIFILE\fR. - -+.TP -+\fB--no-grubenv-update\fR -+Do not update variables in the grubenv file. -+ - .SH SEE ALSO - .BR "info grub" diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 535c0f02499..f55339a3f64 100644 +index 535c0f0249..f55339a3f6 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -50,6 +50,8 @@ grub_get_kernel_settings="${sbindir}/@grub_get_kernel_settings@" @@ -84,7 +74,7 @@ index 535c0f02499..f55339a3f64 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index fafeac95061..d8bb4069360 100644 +index 5e96f6cc5d..301d8a8a1e 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -30,6 +30,9 @@ fi @@ -97,7 +87,7 @@ index fafeac95061..d8bb4069360 100644 if test "x$grub_mkrelpath" = x; then grub_mkrelpath="${bindir}/@grub_mkrelpath@" fi -@@ -125,8 +128,19 @@ EOF +@@ -122,8 +125,19 @@ EOF fi } @@ -117,7 +107,7 @@ index fafeac95061..d8bb4069360 100644 old_ifs="$IFS" IFS=' ' -@@ -161,18 +175,18 @@ prepare_grub_to_access_device () +@@ -158,18 +172,18 @@ prepare_grub_to_access_device () # otherwise set root as per value in device.map. fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`" if [ "x$fs_hint" != x ]; then @@ -141,10 +131,10 @@ index fafeac95061..d8bb4069360 100644 fi IFS="$old_ifs" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index cbfaca34cc7..68adb55d893 100644 +index 7bb3a211a7..2851952659 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -82,6 +82,223 @@ case x"$GRUB_FS" in +@@ -82,6 +82,218 @@ case x"$GRUB_FS" in ;; esac @@ -162,7 +152,7 @@ index cbfaca34cc7..68adb55d893 100644 +# +# The $bls_parser parses the BootLoaderSpec files stored in /boot/loader/entries and +# populates the boot menu. Please refer to the Boot Loader Specification documentation -+# for the files format: https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/. ++# for the files format: https://systemd.io/BOOT_LOADER_SPECIFICATION/. + +EOF +} @@ -204,25 +194,20 @@ index cbfaca34cc7..68adb55d893 100644 + +get_sorted_bls() +{ -+ if ! [ -d "${blsdir}" ] || ! [ -e /etc/machine-id ]; then -+ return -+ fi -+ -+ read machine_id < /etc/machine-id -+ if [ -z "${machine_id}" ]; then ++ if ! [ -d "${blsdir}" ]; then + return + fi + + local IFS=$'\n' + -+ files=($(for bls in ${blsdir}/${machine_id}-*.conf; do ++ files=($(for bls in ${blsdir}/*.conf; do + if ! [[ -e "${bls}" ]] ; then + continue + fi + bls="${bls%.conf}" + bls="${bls##*/}" + echo "${bls}" -+ done | ${kernel_sort} 2>/dev/null | tac)) || : ++ done | sort -Vr 2>/dev/null)) || : + + echo "${files[@]}" +} @@ -263,7 +248,7 @@ index cbfaca34cc7..68adb55d893 100644 +} + +# Make BLS the default if GRUB_ENABLE_BLSCFG was not set and grubby is not installed. -+if [ -z "${GRUB_ENABLE_BLSCFG}" ] && [ -z "$(which new-kernel-pkg 2> /dev/null)" ]; then ++if [ -z "${GRUB_ENABLE_BLSCFG}" ] && ! command -v new-kernel-pkg >/dev/null; then + GRUB_ENABLE_BLSCFG="true" +fi + @@ -368,7 +353,7 @@ index cbfaca34cc7..68adb55d893 100644 mktitle () { local title_type -@@ -121,6 +338,7 @@ linux_entry () +@@ -121,6 +333,7 @@ linux_entry () if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi @@ -376,7 +361,7 @@ index cbfaca34cc7..68adb55d893 100644 if [ x$type != xsimple ] ; then title=$(mktitle "$type" "$version") if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then -@@ -224,6 +442,7 @@ is_top_level=true +@@ -231,6 +444,7 @@ is_top_level=true while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` gettext_printf "Found linux image: %s\n" "$linux" >&2 @@ -384,7 +369,7 @@ index cbfaca34cc7..68adb55d893 100644 basename=`basename $linux` dirname=`dirname $linux` rel_dirname=`make_system_path_relative_to_its_root $dirname` -@@ -262,7 +481,9 @@ while [ "x$list" != "x" ] ; do +@@ -269,7 +483,9 @@ while [ "x$list" != "x" ] ; do for i in ${initrd}; do initrd_display="${initrd_display} ${dirname}/${i}" done diff --git a/0075-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch b/0059-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch similarity index 95% rename from 0075-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch rename to 0059-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch index 9ff4c8b..1ac900c 100644 --- a/0075-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch +++ b/0059-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch @@ -12,7 +12,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index a3e215155bd..c60601b699d 100644 +index a3e215155b..c60601b699 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1201,7 +1201,7 @@ static void __attribute__ ((noreturn)) diff --git a/0077-Add-grub2-switch-to-blscfg.patch b/0060-Add-grub2-switch-to-blscfg.patch similarity index 86% rename from 0077-Add-grub2-switch-to-blscfg.patch rename to 0060-Add-grub2-switch-to-blscfg.patch index ce40e90..e316116 100644 --- a/0077-Add-grub2-switch-to-blscfg.patch +++ b/0060-Add-grub2-switch-to-blscfg.patch @@ -7,20 +7,23 @@ Signed-off-by: Peter Jones Signed-off-by: Javier Martinez Canillas [jhlavac: Use ${etcdefaultgrub} instead of /etc/default/grub] Signed-off-by: Jan Hlavac +[rharwood: skip on ostree installations, migrate man to h2m] +Signed-off-by: Robbie Harwood --- - Makefile.util.def | 7 + - util/grub-set-password.in | 2 +- - util/grub-switch-to-blscfg.8 | 33 +++++ - util/grub-switch-to-blscfg.in | 317 ++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 358 insertions(+), 1 deletion(-) - create mode 100644 util/grub-switch-to-blscfg.8 + Makefile.util.def | 7 + + docs/man/grub-switch-to-blscfg.h2m | 2 + + util/grub-set-password.in | 2 +- + util/grub-switch-to-blscfg.in | 317 +++++++++++++++++++++++++++++++++++++ + util/grub.d/10_linux.in | 2 +- + 5 files changed, 328 insertions(+), 2 deletions(-) + create mode 100644 docs/man/grub-switch-to-blscfg.h2m create mode 100644 util/grub-switch-to-blscfg.in diff --git a/Makefile.util.def b/Makefile.util.def -index cdd2f51fe4b..afc4d7b0c3e 100644 +index 18a9242776..88f55e35c4 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -1364,6 +1364,13 @@ program = { +@@ -1348,6 +1348,13 @@ program = { ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -34,8 +37,16 @@ index cdd2f51fe4b..afc4d7b0c3e 100644 program = { name = grub-glue-efi; mansection = 1; +diff --git a/docs/man/grub-switch-to-blscfg.h2m b/docs/man/grub-switch-to-blscfg.h2m +new file mode 100644 +index 0000000000..fa341426a5 +--- /dev/null ++++ b/docs/man/grub-switch-to-blscfg.h2m +@@ -0,0 +1,2 @@ ++[NAME] ++grub-switch-to-blscfg \- switch to using BLS config files diff --git a/util/grub-set-password.in b/util/grub-set-password.in -index 5ebf50576d6..c0b5ebbfdc5 100644 +index 5ebf50576d..c0b5ebbfdc 100644 --- a/util/grub-set-password.in +++ b/util/grub-set-password.in @@ -1,6 +1,6 @@ @@ -46,48 +57,9 @@ index 5ebf50576d6..c0b5ebbfdc5 100644 if [ -d /sys/firmware/efi/efivars/ ]; then grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'` else -diff --git a/util/grub-switch-to-blscfg.8 b/util/grub-switch-to-blscfg.8 -new file mode 100644 -index 00000000000..9a886282976 ---- /dev/null -+++ b/util/grub-switch-to-blscfg.8 -@@ -0,0 +1,33 @@ -+.TH GRUB-SWITCH-TO-BLSCFG 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-switch-to-blscfg\fR \(em Switch to using BLS config files. -+ -+.SH SYNOPSIS -+\fBgrub-switch-to-blscfg\fR [--grub-directory=\fIDIR\fR] [--config-file=\fIFILE\fR] [--grub-defaults=\fIFILE\fR] -+ -+.SH DESCRIPTION -+\fBgrub-switch-to-blscfg\fR reconfigures grub-mkconfig to use BLS-style config files, and then regenerates the GRUB configuration. -+ -+.SH OPTIONS -+.TP -+--grub-directory=\fIDIR\fR -+Search for grub.cfg under \fIDIR\fR. The default value is \fI/boot/efi/EFI/\fBVENDOR\fR on UEFI machines and \fI/boot/grub2\fR elsewhere. -+ -+.TP -+--config-file=\fIFILE\fR -+The grub config file to use. The default value is \fI/etc/grub2-efi.cfg\fR on UEFI machines and \fI/etc/grub2.cfg\fR elsewhere. Symbolic links will be followed. -+ -+.TP -+--grub-defaults=\fIFILE\fR -+The defaults file for grub-mkconfig. The default value is \fI/etc/default/grub\fR. -+ -+.TP -+--bls-directory=\fIDIR\fR -+Create BootLoaderSpec fragments in \fIDIR\fR. The default value is \fI/boot/loader/entries\fR. -+ -+.TP -+--backup-suffix=\fSUFFIX\fR -+The suffix to use for saved backup files. The default value is \fI.bak\fR. -+ -+.SH SEE ALSO -+.BR "info grub" diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in new file mode 100644 -index 00000000000..a851424beb2 +index 0000000000..a851424beb --- /dev/null +++ b/util/grub-switch-to-blscfg.in @@ -0,0 +1,317 @@ @@ -408,3 +380,16 @@ index 00000000000..a851424beb2 + +# Bye. +exit 0 +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 2851952659..e490e1a43a 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -138,7 +138,7 @@ blsdir="/boot/loader/entries" + + get_sorted_bls() + { +- if ! [ -d "${blsdir}" ]; then ++ if ! [ -d "${blsdir}" ] || [ -f /run/ostree-booted ] || [ -d /ostree/repo ]; then + return + fi + diff --git a/0078-make-better-backtraces.patch b/0061-make-better-backtraces.patch similarity index 96% rename from 0078-make-better-backtraces.patch rename to 0061-make-better-backtraces.patch index a65af3d..7fdcaf7 100644 --- a/0078-make-better-backtraces.patch +++ b/0061-make-better-backtraces.patch @@ -38,7 +38,7 @@ Signed-off-by: Peter Jones delete mode 100644 grub-core/lib/i386/backtrace.c diff --git a/Makefile.util.def b/Makefile.util.def -index afc4d7b0c3e..41906486a71 100644 +index 88f55e35c4..bda9fd1211 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -51,6 +51,12 @@ library = { @@ -55,7 +55,7 @@ index afc4d7b0c3e..41906486a71 100644 library = { diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 5354f9613d3..4b7c45a7b06 100644 +index 058c88ac3a..52ec0fafcd 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -142,6 +142,12 @@ kernel = { @@ -81,7 +81,7 @@ index 5354f9613d3..4b7c45a7b06 100644 i386 = kern/i386/dl.c; i386_xen = kern/i386/dl.c; i386_xen_pvh = kern/i386/dl.c; -@@ -2398,15 +2401,12 @@ module = { +@@ -2399,15 +2402,12 @@ module = { module = { name = backtrace; @@ -103,7 +103,7 @@ diff --git a/grub-core/lib/backtrace.c b/grub-core/commands/backtrace.c similarity index 98% rename from grub-core/lib/backtrace.c rename to grub-core/commands/backtrace.c -index c0ad6ab8be1..8b5ec3913b5 100644 +index c0ad6ab8be..8b5ec3913b 100644 --- a/grub-core/lib/backtrace.c +++ b/grub-core/commands/backtrace.c @@ -54,7 +54,7 @@ grub_cmd_backtrace (grub_command_t cmd __attribute__ ((unused)), @@ -116,7 +116,7 @@ index c0ad6ab8be1..8b5ec3913b5 100644 } diff --git a/grub-core/gdb/cstub.c b/grub-core/gdb/cstub.c -index b64acd70fee..99281472d36 100644 +index b64acd70fe..99281472d3 100644 --- a/grub-core/gdb/cstub.c +++ b/grub-core/gdb/cstub.c @@ -215,7 +215,6 @@ grub_gdb_trap (int trap_no) @@ -129,7 +129,7 @@ index b64acd70fee..99281472d36 100644 diff --git a/grub-core/kern/arm64/backtrace.c b/grub-core/kern/arm64/backtrace.c new file mode 100644 -index 00000000000..019c6fdfef2 +index 0000000000..019c6fdfef --- /dev/null +++ b/grub-core/kern/arm64/backtrace.c @@ -0,0 +1,94 @@ @@ -229,7 +229,7 @@ index 00000000000..019c6fdfef2 +} diff --git a/grub-core/kern/backtrace.c b/grub-core/kern/backtrace.c new file mode 100644 -index 00000000000..4a82e865cc6 +index 0000000000..4a82e865cc --- /dev/null +++ b/grub-core/kern/backtrace.c @@ -0,0 +1,97 @@ @@ -331,7 +331,7 @@ index 00000000000..4a82e865cc6 + grub_backtrace (skip + 1); +} diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index 7afb9e6f724..88d2077709e 100644 +index 7afb9e6f72..88d2077709 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -124,6 +124,50 @@ grub_dl_resolve_symbol (const char *name) @@ -395,7 +395,7 @@ index 7afb9e6f724..88d2077709e 100644 i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) diff --git a/grub-core/kern/i386/backtrace.c b/grub-core/kern/i386/backtrace.c new file mode 100644 -index 00000000000..2413f9a57db +index 0000000000..2413f9a57d --- /dev/null +++ b/grub-core/kern/i386/backtrace.c @@ -0,0 +1,125 @@ @@ -525,7 +525,7 @@ index 00000000000..2413f9a57db +#endif +} diff --git a/grub-core/kern/i386/pc/init.c b/grub-core/kern/i386/pc/init.c -index 27bc68b8a53..b51d0abfa6e 100644 +index 27bc68b8a5..b51d0abfa6 100644 --- a/grub-core/kern/i386/pc/init.c +++ b/grub-core/kern/i386/pc/init.c @@ -153,7 +153,7 @@ compact_mem_regions (void) @@ -547,7 +547,7 @@ index 27bc68b8a53..b51d0abfa6e 100644 /* Initialize the console as early as possible. */ grub_console_init (); diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 0cd2a627231..937c1bc44cb 100644 +index 0cd2a62723..937c1bc44c 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -63,7 +63,6 @@ @@ -559,7 +559,7 @@ index 0cd2a627231..937c1bc44cb 100644 #ifdef __sparc__ diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index c60601b699d..a432a6be54a 100644 +index c60601b699..a432a6be54 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1197,15 +1197,15 @@ grub_printf_fmt_check (const char *fmt, const char *fmt_expected) @@ -593,7 +593,7 @@ index c60601b699d..a432a6be54a 100644 grub_vprintf (_(fmt), ap); va_end (ap); diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c -index c070afc621f..d8c8377578b 100644 +index c070afc621..d8c8377578 100644 --- a/grub-core/kern/mm.c +++ b/grub-core/kern/mm.c @@ -97,13 +97,13 @@ get_header_from_pointer (void *ptr, grub_mm_header_t *p, grub_mm_region_t *r) @@ -615,7 +615,7 @@ index c070afc621f..d8c8377578b 100644 diff --git a/grub-core/lib/arm64/backtrace.c b/grub-core/lib/arm64/backtrace.c deleted file mode 100644 -index 1079b5380e1..00000000000 +index 1079b5380e..0000000000 --- a/grub-core/lib/arm64/backtrace.c +++ /dev/null @@ -1,62 +0,0 @@ @@ -683,7 +683,7 @@ index 1079b5380e1..00000000000 - diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c deleted file mode 100644 -index c67273db3ae..00000000000 +index c67273db3a..0000000000 --- a/grub-core/lib/i386/backtrace.c +++ /dev/null @@ -1,78 +0,0 @@ @@ -766,7 +766,7 @@ index c67273db3ae..00000000000 -} - diff --git a/include/grub/backtrace.h b/include/grub/backtrace.h -index 395519762f0..275cf85e2d3 100644 +index 395519762f..275cf85e2d 100644 --- a/include/grub/backtrace.h +++ b/include/grub/backtrace.h @@ -19,8 +19,14 @@ @@ -787,7 +787,7 @@ index 395519762f0..275cf85e2d3 100644 #endif diff --git a/include/grub/dl.h b/include/grub/dl.h -index 91933b85f2c..2f76e6b0437 100644 +index 91933b85f2..2f76e6b043 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -259,6 +259,8 @@ grub_dl_is_persistent (grub_dl_t mod) @@ -800,7 +800,7 @@ index 91933b85f2c..2f76e6b0437 100644 int isfunc, grub_dl_t mod); diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index abbca5ea335..300a9766cda 100644 +index abbca5ea33..300a9766cd 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -111,6 +111,9 @@ grub_addr_t grub_modules_get_end (void); @@ -814,7 +814,7 @@ index abbca5ea335..300a9766cda 100644 void grub_main (void) __attribute__ ((noreturn)); diff --git a/grub-core/kern/arm/efi/startup.S b/grub-core/kern/arm/efi/startup.S -index 9f8265315a9..f3bc41f9d0f 100644 +index 9f8265315a..f3bc41f9d0 100644 --- a/grub-core/kern/arm/efi/startup.S +++ b/grub-core/kern/arm/efi/startup.S @@ -23,6 +23,8 @@ @@ -827,7 +827,7 @@ index 9f8265315a9..f3bc41f9d0f 100644 /* * EFI_SYSTEM_TABLE and EFI_HANDLE are passed in r1/r0. diff --git a/grub-core/kern/arm/startup.S b/grub-core/kern/arm/startup.S -index 3946fe8e183..5679a1d00ad 100644 +index 3946fe8e18..5679a1d00a 100644 --- a/grub-core/kern/arm/startup.S +++ b/grub-core/kern/arm/startup.S @@ -48,6 +48,8 @@ @@ -840,7 +840,7 @@ index 3946fe8e183..5679a1d00ad 100644 b codestart diff --git a/grub-core/kern/arm64/efi/startup.S b/grub-core/kern/arm64/efi/startup.S -index 666a7ee3c92..41676bdb2b8 100644 +index 666a7ee3c9..41676bdb2b 100644 --- a/grub-core/kern/arm64/efi/startup.S +++ b/grub-core/kern/arm64/efi/startup.S @@ -19,7 +19,9 @@ @@ -854,7 +854,7 @@ index 666a7ee3c92..41676bdb2b8 100644 /* * EFI_SYSTEM_TABLE and EFI_HANDLE are passed in x1/x0. diff --git a/grub-core/kern/i386/qemu/startup.S b/grub-core/kern/i386/qemu/startup.S -index 0d89858d9b3..939f182fc74 100644 +index 0d89858d9b..939f182fc7 100644 --- a/grub-core/kern/i386/qemu/startup.S +++ b/grub-core/kern/i386/qemu/startup.S @@ -24,7 +24,8 @@ @@ -868,7 +868,7 @@ index 0d89858d9b3..939f182fc74 100644 jmp codestart diff --git a/grub-core/kern/ia64/efi/startup.S b/grub-core/kern/ia64/efi/startup.S -index d75c6d7cc74..8f2a593e529 100644 +index d75c6d7cc7..8f2a593e52 100644 --- a/grub-core/kern/ia64/efi/startup.S +++ b/grub-core/kern/ia64/efi/startup.S @@ -24,8 +24,9 @@ @@ -883,7 +883,7 @@ index d75c6d7cc74..8f2a593e529 100644 alloc loc0=ar.pfs,2,4,0,0 mov loc1=rp diff --git a/grub-core/kern/sparc64/ieee1275/crt0.S b/grub-core/kern/sparc64/ieee1275/crt0.S -index 03b916f0534..701bf63abcf 100644 +index 03b916f053..701bf63abc 100644 --- a/grub-core/kern/sparc64/ieee1275/crt0.S +++ b/grub-core/kern/sparc64/ieee1275/crt0.S @@ -22,7 +22,8 @@ @@ -897,7 +897,7 @@ index 03b916f0534..701bf63abcf 100644 ba codestart mov %o4, %o0 diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 80e7a83edf9..f512573c0da 100644 +index ee88e44e97..bfd29a3bf0 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -66,6 +66,7 @@ CLEANFILES += grub_script.yy.c grub_script.yy.h diff --git a/0079-normal-don-t-draw-our-startup-message-if-debug-is-se.patch b/0062-normal-don-t-draw-our-startup-message-if-debug-is-se.patch similarity index 89% rename from 0079-normal-don-t-draw-our-startup-message-if-debug-is-se.patch rename to 0062-normal-don-t-draw-our-startup-message-if-debug-is-se.patch index 9922f2b..a916299 100644 --- a/0079-normal-don-t-draw-our-startup-message-if-debug-is-se.patch +++ b/0062-normal-don-t-draw-our-startup-message-if-debug-is-se.patch @@ -8,10 +8,10 @@ Subject: [PATCH] normal: don't draw our startup message if debug is set 1 file changed, 3 insertions(+) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index d5968797f4f..e349303c29b 100644 +index 55558cc0b9..af9792c963 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -432,6 +432,9 @@ grub_normal_reader_init (int nested) +@@ -430,6 +430,9 @@ grub_normal_reader_init (int nested) const char *msg_esc = _("ESC at any time exits."); char *msg_formatted; diff --git a/0080-Work-around-some-minor-include-path-weirdnesses.patch b/0063-Work-around-some-minor-include-path-weirdnesses.patch similarity index 97% rename from 0080-Work-around-some-minor-include-path-weirdnesses.patch rename to 0063-Work-around-some-minor-include-path-weirdnesses.patch index 460d792..c7ae8d0 100644 --- a/0080-Work-around-some-minor-include-path-weirdnesses.patch +++ b/0063-Work-around-some-minor-include-path-weirdnesses.patch @@ -17,7 +17,7 @@ Signed-off-by: Peter Jones diff --git a/include/grub/arm/efi/console.h b/include/grub/arm/efi/console.h new file mode 100644 -index 00000000000..1592f6f76b5 +index 0000000000..1592f6f76b --- /dev/null +++ b/include/grub/arm/efi/console.h @@ -0,0 +1,24 @@ @@ -47,7 +47,7 @@ index 00000000000..1592f6f76b5 +#endif /* ! GRUB_ARM_EFI_CONSOLE_H */ diff --git a/include/grub/arm64/efi/console.h b/include/grub/arm64/efi/console.h new file mode 100644 -index 00000000000..95689339384 +index 0000000000..9568933938 --- /dev/null +++ b/include/grub/arm64/efi/console.h @@ -0,0 +1,24 @@ @@ -77,7 +77,7 @@ index 00000000000..95689339384 +#endif /* ! GRUB_ARM64_EFI_CONSOLE_H */ diff --git a/include/grub/i386/efi/console.h b/include/grub/i386/efi/console.h new file mode 100644 -index 00000000000..9231375cb07 +index 0000000000..9231375cb0 --- /dev/null +++ b/include/grub/i386/efi/console.h @@ -0,0 +1,24 @@ @@ -107,7 +107,7 @@ index 00000000000..9231375cb07 +#endif /* ! GRUB_I386_EFI_CONSOLE_H */ diff --git a/include/grub/x86_64/efi/console.h b/include/grub/x86_64/efi/console.h new file mode 100644 -index 00000000000..dba9d8678d0 +index 0000000000..dba9d8678d --- /dev/null +++ b/include/grub/x86_64/efi/console.h @@ -0,0 +1,24 @@ diff --git a/0081-Make-it-possible-to-enabled-build-id-sha1.patch b/0064-Make-it-possible-to-enabled-build-id-sha1.patch similarity index 93% rename from 0081-Make-it-possible-to-enabled-build-id-sha1.patch rename to 0064-Make-it-possible-to-enabled-build-id-sha1.patch index 356a4d8..99d8055 100644 --- a/0081-Make-it-possible-to-enabled-build-id-sha1.patch +++ b/0064-Make-it-possible-to-enabled-build-id-sha1.patch @@ -10,10 +10,10 @@ Signed-off-by: Peter Jones 2 files changed, 27 insertions(+) diff --git a/configure.ac b/configure.ac -index 537ed411469..b4455e4732d 100644 +index 0d0e6782a1..302300711f 100644 --- a/configure.ac +++ b/configure.ac -@@ -1470,7 +1470,15 @@ grub_PROG_TARGET_CC +@@ -1442,7 +1442,15 @@ grub_PROG_TARGET_CC if test "x$TARGET_APPLE_LINKER" != x1 ; then grub_PROG_OBJCOPY_ABSOLUTE fi @@ -30,7 +30,7 @@ index 537ed411469..b4455e4732d 100644 if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then diff --git a/acinclude.m4 b/acinclude.m4 -index 6e14bb553c6..21238fcfd03 100644 +index 6e14bb553c..21238fcfd0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -136,6 +136,25 @@ if test "x$grub_cv_prog_ld_build_id_none" = xyes; then diff --git a/0082-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch b/0065-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch similarity index 95% rename from 0082-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch rename to 0065-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch index a8a757e..7658e9b 100644 --- a/0082-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch +++ b/0065-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 2 files changed, 20 insertions(+) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index a432a6be54a..9a2fae6398e 100644 +index a432a6be54..9a2fae6398 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -191,6 +191,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition, @@ -42,7 +42,7 @@ index a432a6be54a..9a2fae6398e 100644 int diff --git a/include/grub/misc.h b/include/grub/misc.h -index fd18e6320b8..3adc4036e3b 100644 +index fd18e6320b..3adc4036e3 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -345,6 +345,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file, diff --git a/0083-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch b/0066-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch similarity index 97% rename from 0083-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch rename to 0066-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch index 75de764..ccf34a5 100644 --- a/0083-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch +++ b/0066-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch @@ -20,7 +20,7 @@ Signed-off-by: Peter Jones 4 files changed, 78 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index 88d2077709e..9557254035e 100644 +index 88d2077709..9557254035 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -501,6 +501,23 @@ grub_dl_find_section (Elf_Ehdr *e, const char *name) @@ -95,7 +95,7 @@ index 88d2077709e..9557254035e 100644 { grub_dl_unload (mod); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index ae9885edb84..d6a2fb57789 100644 +index ae9885edb8..d6a2fb5778 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -296,7 +296,7 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -117,7 +117,7 @@ index ae9885edb84..d6a2fb57789 100644 } diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index 6d39bd3ad29..2d12e6188fd 100644 +index 6d39bd3ad2..2d12e6188f 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -115,10 +115,33 @@ grub_efi_env_init (void) @@ -164,7 +164,7 @@ index 6d39bd3ad29..2d12e6188fd 100644 } diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 03f9a9d0118..2e0691454b1 100644 +index 03f9a9d011..2e0691454b 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -138,7 +138,7 @@ grub_err_t grub_arch_efi_linux_check_image(struct linux_arch_kernel_header *lh); diff --git a/0084-Fixup-for-newer-compiler.patch b/0067-Fixup-for-newer-compiler.patch similarity index 93% rename from 0084-Fixup-for-newer-compiler.patch rename to 0067-Fixup-for-newer-compiler.patch index 12dd193..ed23271 100644 --- a/0084-Fixup-for-newer-compiler.patch +++ b/0067-Fixup-for-newer-compiler.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Fixup for newer compiler 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 2b21cbaa67e..4cc86e9b79e 100644 +index 2b21cbaa67..4cc86e9b79 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -218,7 +218,7 @@ struct grub_btrfs_inode @@ -22,7 +22,7 @@ index 2b21cbaa67e..4cc86e9b79e 100644 struct grub_btrfs_extent_data { diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 7a93f43291c..8212697bf6b 100644 +index 7a93f43291..8212697bf6 100644 --- a/include/grub/gpt_partition.h +++ b/include/grub/gpt_partition.h @@ -76,7 +76,7 @@ struct grub_gpt_partentry diff --git a/0085-Don-t-attempt-to-export-the-start-and-_start-symbols.patch b/0068-Don-t-attempt-to-export-the-start-and-_start-symbols.patch similarity index 97% rename from 0085-Don-t-attempt-to-export-the-start-and-_start-symbols.patch rename to 0068-Don-t-attempt-to-export-the-start-and-_start-symbols.patch index 0e925ee..9b78c00 100644 --- a/0085-Don-t-attempt-to-export-the-start-and-_start-symbols.patch +++ b/0068-Don-t-attempt-to-export-the-start-and-_start-symbols.patch @@ -26,7 +26,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 2 insertions(+) diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index 300a9766cda..55849777eaa 100644 +index 300a9766cd..55849777ea 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -111,8 +111,10 @@ grub_addr_t grub_modules_get_end (void); diff --git a/0086-Fixup-for-newer-compiler.patch b/0069-Fixup-for-newer-compiler.patch similarity index 96% rename from 0086-Fixup-for-newer-compiler.patch rename to 0069-Fixup-for-newer-compiler.patch index 11ed6e5..167dca1 100644 --- a/0086-Fixup-for-newer-compiler.patch +++ b/0069-Fixup-for-newer-compiler.patch @@ -8,7 +8,7 @@ Subject: [PATCH] Fixup for newer compiler 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Makefile.common b/conf/Makefile.common -index 191b1a70c6b..5f0ef969857 100644 +index 191b1a70c6..5f0ef96985 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding diff --git a/0087-Add-support-for-non-Ethernet-network-cards.patch b/0070-Add-support-for-non-Ethernet-network-cards.patch similarity index 98% rename from 0087-Add-support-for-non-Ethernet-network-cards.patch rename to 0070-Add-support-for-non-Ethernet-network-cards.patch index 02fb951..fb44628 100644 --- a/0087-Add-support-for-non-Ethernet-network-cards.patch +++ b/0070-Add-support-for-non-Ethernet-network-cards.patch @@ -38,7 +38,7 @@ Signed-off-by: Mark Salter 12 files changed, 219 insertions(+), 152 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 54306e3b16d..67b409a8acc 100644 +index 54306e3b16..67b409a8ac 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -31,22 +31,12 @@ enum @@ -271,7 +271,7 @@ index 54306e3b16d..67b409a8acc 100644 /* Change operation to REPLY and send packet */ send_ethernet_packet (inf, &nb_reply, target, GRUB_NET_ETHERTYPE_ARP); diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index e28fb6a09f9..08b6b2b5d6c 100644 +index e28fb6a09f..08b6b2b5d6 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -233,7 +233,6 @@ grub_net_configure_by_dhcp_ack (const char *name, @@ -318,7 +318,7 @@ index e28fb6a09f9..08b6b2b5d6c 100644 grub_netbuff_push (nb, sizeof (*udph)); diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 173fb63153c..a673bea807a 100644 +index 173fb63153..a673bea807 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -279,6 +279,9 @@ grub_efinet_findcards (void) @@ -346,7 +346,7 @@ index 173fb63153c..a673bea807a 100644 card->efi_handle = *handle; diff --git a/grub-core/net/drivers/emu/emunet.c b/grub-core/net/drivers/emu/emunet.c -index b194920861f..5b6c5e16a6d 100644 +index b194920861..5b6c5e16a6 100644 --- a/grub-core/net/drivers/emu/emunet.c +++ b/grub-core/net/drivers/emu/emunet.c @@ -46,6 +46,7 @@ static struct grub_net_card emucard = @@ -358,7 +358,7 @@ index b194920861f..5b6c5e16a6d 100644 }, .flags = 0 diff --git a/grub-core/net/drivers/i386/pc/pxe.c b/grub-core/net/drivers/i386/pc/pxe.c -index 3f4152d036c..9f8fb4b6d2b 100644 +index 3f4152d036..9f8fb4b6d2 100644 --- a/grub-core/net/drivers/i386/pc/pxe.c +++ b/grub-core/net/drivers/i386/pc/pxe.c @@ -386,20 +386,21 @@ GRUB_MOD_INIT(pxe) @@ -390,7 +390,7 @@ index 3f4152d036c..9f8fb4b6d2b 100644 grub_pxe_card.default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index 3860b6f78d8..bcb3f9ea02d 100644 +index 3860b6f78d..bcb3f9ea02 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -160,6 +160,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, @@ -410,7 +410,7 @@ index 3860b6f78d8..bcb3f9ea02d 100644 card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; diff --git a/grub-core/net/drivers/uboot/ubootnet.c b/grub-core/net/drivers/uboot/ubootnet.c -index 056052e40d5..22ebcbf211e 100644 +index 056052e40d..22ebcbf211 100644 --- a/grub-core/net/drivers/uboot/ubootnet.c +++ b/grub-core/net/drivers/uboot/ubootnet.c @@ -131,6 +131,7 @@ GRUB_MOD_INIT (ubootnet) @@ -422,7 +422,7 @@ index 056052e40d5..22ebcbf211e 100644 card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; card->txbuf = grub_zalloc (card->txbufsize); diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c -index 4d7ceed6f93..9aae83a5eb4 100644 +index 4d7ceed6f9..9aae83a5eb 100644 --- a/grub-core/net/ethernet.c +++ b/grub-core/net/ethernet.c @@ -29,13 +29,6 @@ @@ -572,7 +572,7 @@ index 4d7ceed6f93..9aae83a5eb4 100644 { /* ARP packet. */ diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index 2cbd95dce25..56a3ec5c8e8 100644 +index 2cbd95dce2..56a3ec5c8e 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -231,8 +231,9 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, @@ -612,7 +612,7 @@ index 2cbd95dce25..56a3ec5c8e8 100644 } if (ohdr->type == OPTION_PREFIX && ohdr->len == 4) diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index ea5edf8f1f6..a5896f6dc26 100644 +index ea5edf8f1f..a5896f6dc2 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -276,8 +276,8 @@ handle_dgram (struct grub_net_buff *nb, @@ -627,7 +627,7 @@ index ea5edf8f1f6..a5896f6dc26 100644 grub_net_process_dhcp (nb, inf); grub_netbuff_free (nb); diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 22f2689aaeb..a46f82362ed 100644 +index 22f2689aae..a46f82362e 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -133,8 +133,9 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, @@ -713,7 +713,7 @@ index 22f2689aaeb..a46f82362ed 100644 int diff --git a/include/grub/net.h b/include/grub/net.h -index 8a05ec4fe7a..af0404db7e3 100644 +index 8a05ec4fe7..af0404db7e 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -29,7 +29,8 @@ diff --git a/0088-net-read-bracketed-ipv6-addrs-and-port-numbers.patch b/0071-net-read-bracketed-ipv6-addrs-and-port-numbers.patch similarity index 98% rename from 0088-net-read-bracketed-ipv6-addrs-and-port-numbers.patch rename to 0071-net-read-bracketed-ipv6-addrs-and-port-numbers.patch index 834b96e..307e33c 100644 --- a/0088-net-read-bracketed-ipv6-addrs-and-port-numbers.patch +++ b/0071-net-read-bracketed-ipv6-addrs-and-port-numbers.patch @@ -18,7 +18,7 @@ Signed-off-by: Peter Jones 4 files changed, 109 insertions(+), 12 deletions(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index b616cf40b1e..12a2632ea55 100644 +index b616cf40b1..12a2632ea5 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -289,7 +289,9 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), @@ -87,7 +87,7 @@ index b616cf40b1e..12a2632ea55 100644 file); if (!data->sock) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index a46f82362ed..0ce5e675ed7 100644 +index a46f82362e..0ce5e675ed 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -444,6 +444,13 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) @@ -225,7 +225,7 @@ index a46f82362ed..0ce5e675ed7 100644 } diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 4ab2f5c7357..d54b13f09ff 100644 +index 4ab2f5c735..d54b13f09f 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -295,6 +295,7 @@ tftp_open (struct grub_file *file, const char *filename) @@ -257,7 +257,7 @@ index 4ab2f5c7357..d54b13f09ff 100644 if (!data->sock) { diff --git a/include/grub/net.h b/include/grub/net.h -index af0404db7e3..d55d505a03a 100644 +index af0404db7e..d55d505a03 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -273,6 +273,7 @@ typedef struct grub_net diff --git a/0089-bootp-New-net_bootp6-command.patch b/0072-bootp-New-net_bootp6-command.patch similarity index 99% rename from 0089-bootp-New-net_bootp6-command.patch rename to 0072-bootp-New-net_bootp6-command.patch index 21b3871..bef3acd 100644 --- a/0089-bootp-New-net_bootp6-command.patch +++ b/0072-bootp-New-net_bootp6-command.patch @@ -19,7 +19,7 @@ Signed-off-by: Peter Jones 5 files changed, 1002 insertions(+), 209 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 08b6b2b5d6c..fe93b80f1cf 100644 +index 08b6b2b5d6..fe93b80f1c 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -24,6 +24,98 @@ @@ -1136,7 +1136,7 @@ index 08b6b2b5d6c..fe93b80f1cf 100644 grub_unregister_command (cmd_bootp); grub_unregister_command (cmd_dhcp); diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index a673bea807a..8e25680db0c 100644 +index a673bea807..8e25680db0 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -393,9 +393,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -1174,7 +1174,7 @@ index a673bea807a..8e25680db0c 100644 } else diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index a5896f6dc26..ce6bdc75c6d 100644 +index a5896f6dc2..ce6bdc75c6 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -239,6 +239,45 @@ handle_dgram (struct grub_net_buff *nb, @@ -1224,7 +1224,7 @@ index a5896f6dc26..ce6bdc75c6d 100644 { const struct grub_net_bootp_packet *bootp; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 99628801478..7614b58dca8 100644 +index 9962880147..7614b58dca 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1532,7 +1532,7 @@ typedef struct grub_efi_pxe_ip_filter @@ -1237,7 +1237,7 @@ index 99628801478..7614b58dca8 100644 } grub_efi_pxe_ip_filter_t; diff --git a/include/grub/net.h b/include/grub/net.h -index d55d505a03a..543251f7273 100644 +index d55d505a03..543251f727 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -451,50 +451,65 @@ struct grub_net_bootp_packet diff --git a/0090-efinet-UEFI-IPv6-PXE-support.patch b/0073-efinet-UEFI-IPv6-PXE-support.patch similarity index 98% rename from 0090-efinet-UEFI-IPv6-PXE-support.patch rename to 0073-efinet-UEFI-IPv6-PXE-support.patch index d8b22b8..988c178 100644 --- a/0090-efinet-UEFI-IPv6-PXE-support.patch +++ b/0073-efinet-UEFI-IPv6-PXE-support.patch @@ -15,7 +15,7 @@ Signed-off-by: Ken Lin 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 8e25680db0c..014e5bf9802 100644 +index 8e25680db0..014e5bf980 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -409,6 +409,8 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -28,7 +28,7 @@ index 8e25680db0c..014e5bf9802 100644 else { diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 7614b58dca8..91ab528e4d0 100644 +index 7614b58dca..91ab528e4d 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1524,31 +1524,6 @@ typedef union diff --git a/0091-grub.texi-Add-net_bootp6-doument.patch b/0074-grub.texi-Add-net_bootp6-doument.patch similarity index 97% rename from 0091-grub.texi-Add-net_bootp6-doument.patch rename to 0074-grub.texi-Add-net_bootp6-doument.patch index 3f8ec97..b42e09b 100644 --- a/0091-grub.texi-Add-net_bootp6-doument.patch +++ b/0074-grub.texi-Add-net_bootp6-doument.patch @@ -12,7 +12,7 @@ Signed-off-by: Ken Lin 1 file changed, 17 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index 0615d0ed97e..04ed6ac1f07 100644 +index 0615d0ed97..04ed6ac1f0 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -5487,6 +5487,7 @@ This command is only available on AArch64 systems. diff --git a/0092-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch b/0075-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch similarity index 98% rename from 0092-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch rename to 0075-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch index e800dd2..abff9eb 100644 --- a/0092-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch +++ b/0075-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch @@ -22,7 +22,7 @@ Signed-off-by: Ken Lin 2 files changed, 56 insertions(+) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index fe93b80f1cf..8fb8918ae7e 100644 +index fe93b80f1c..8fb8918ae7 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -20,6 +20,7 @@ @@ -95,7 +95,7 @@ index fe93b80f1cf..8fb8918ae7e 100644 if (opt && opt_len) grub_env_set_net_property (name, "extensionspath", (const char *) opt, opt_len); diff --git a/include/grub/net.h b/include/grub/net.h -index 543251f7273..42af7de250a 100644 +index 543251f727..42af7de250 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -531,6 +531,7 @@ enum diff --git a/0076-Add-linux-and-initrd-commands-for-grub-emu.patch b/0076-Add-linux-and-initrd-commands-for-grub-emu.patch deleted file mode 100644 index dd69b13..0000000 --- a/0076-Add-linux-and-initrd-commands-for-grub-emu.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Tue, 6 Feb 2018 09:09:00 +0100 -Subject: [PATCH] Add linux and initrd commands for grub-emu - -When using grub-emu, the linux and initrd commands are used as arguments -to the kexec command line tool, to allow booting the selected menu entry. ---- - grub-core/Makefile.core.def | 1 - - grub-core/kern/emu/main.c | 4 + - grub-core/kern/emu/misc.c | 18 ++++- - grub-core/loader/emu/linux.c | 172 +++++++++++++++++++++++++++++++++++++++++++ - include/grub/emu/exec.h | 4 +- - include/grub/emu/hostfile.h | 3 +- - include/grub/emu/misc.h | 3 + - grub-core/Makefile.am | 1 + - 8 files changed, 202 insertions(+), 4 deletions(-) - create mode 100644 grub-core/loader/emu/linux.c - -diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 058c88ac3af..5354f9613d3 100644 ---- a/grub-core/Makefile.core.def -+++ b/grub-core/Makefile.core.def -@@ -1826,7 +1826,6 @@ module = { - - common = loader/linux.c; - common = lib/cmdline.c; -- enable = noemu; - - efi = loader/efi/linux.c; - }; -diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c -index 55ea5a11ccd..846fe9715ec 100644 ---- a/grub-core/kern/emu/main.c -+++ b/grub-core/kern/emu/main.c -@@ -107,6 +107,7 @@ static struct argp_option options[] = { - N_("use GRUB files in the directory DIR [default=%s]"), 0}, - {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, - {"hold", 'H', N_("SECS"), OPTION_ARG_OPTIONAL, N_("wait until a debugger will attach"), 0}, -+ {"kexec", 'X', 0, 0, N_("try the untryable."), 0}, - { 0, 0, 0, 0, 0, 0 } - }; - -@@ -164,6 +165,9 @@ argp_parser (int key, char *arg, struct argp_state *state) - case 'v': - verbosity++; - break; -+ case 'X': -+ grub_util_set_kexecute(); -+ break; - - case ARGP_KEY_ARG: - { -diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c -index 0ff13bcaf8c..eeea092752d 100644 ---- a/grub-core/kern/emu/misc.c -+++ b/grub-core/kern/emu/misc.c -@@ -39,6 +39,7 @@ - #include - - int verbosity; -+int kexecute; - - void - grub_util_warn (const char *fmt, ...) -@@ -82,7 +83,7 @@ grub_util_error (const char *fmt, ...) - vfprintf (stderr, fmt, ap); - va_end (ap); - fprintf (stderr, ".\n"); -- exit (1); -+ grub_exit (1); - } - - void * -@@ -154,6 +155,9 @@ void - __attribute__ ((noreturn)) - grub_exit (int rc) - { -+#if defined (GRUB_KERNEL) -+ grub_reboot(); -+#endif - exit (rc < 0 ? 1 : rc); - } - #endif -@@ -215,3 +219,15 @@ grub_util_load_image (const char *path, char *buf) - - fclose (fp); - } -+ -+void -+grub_util_set_kexecute(void) -+{ -+ kexecute++; -+} -+ -+int -+grub_util_get_kexecute(void) -+{ -+ return kexecute; -+} -diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c -new file mode 100644 -index 00000000000..fda9e00d24c ---- /dev/null -+++ b/grub-core/loader/emu/linux.c -@@ -0,0 +1,172 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. -+ * -+ * GRUB is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * GRUB is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with GRUB. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+GRUB_MOD_LICENSE ("GPLv3+"); -+ -+static grub_dl_t my_mod; -+ -+static char *kernel_path; -+static char *initrd_path; -+static char *boot_cmdline; -+ -+static grub_err_t -+grub_linux_boot (void) -+{ -+ grub_err_t rc = GRUB_ERR_NONE; -+ char *initrd_param; -+ const char *kexec[] = { "kexec", "-l", kernel_path, boot_cmdline, NULL, NULL }; -+ const char *systemctl[] = { "systemctl", "kexec", NULL }; -+ int kexecute = grub_util_get_kexecute(); -+ -+ if (initrd_path) { -+ initrd_param = grub_xasprintf("--initrd=%s", initrd_path); -+ kexec[3] = initrd_param; -+ kexec[4] = boot_cmdline; -+ } else { -+ initrd_param = grub_xasprintf("%s", ""); -+ } -+ -+ grub_printf("%serforming 'kexec -l %s %s %s'\n", -+ (kexecute) ? "P" : "Not p", -+ kernel_path, initrd_param, boot_cmdline); -+ -+ if (kexecute) -+ rc = grub_util_exec(kexec); -+ -+ grub_free(initrd_param); -+ -+ if (rc != GRUB_ERR_NONE) { -+ grub_error (rc, N_("Error trying to perform kexec load operation.")); -+ grub_sleep (3); -+ return rc; -+ } -+ if (kexecute < 1) -+ grub_fatal (N_("Use '"PACKAGE"-emu --kexec' to force a system restart.")); -+ -+ grub_printf("Performing 'systemctl kexec' (%s) ", -+ (kexecute==1) ? "do-or-die" : "just-in-case"); -+ rc = grub_util_exec (systemctl); -+ -+ if (kexecute == 1) -+ grub_fatal (N_("Error trying to perform 'systemctl kexec'")); -+ -+ /* need to check read-only root before resetting hard!? */ -+ grub_printf("Performing 'kexec -e'"); -+ kexec[1] = "-e"; -+ kexec[2] = NULL; -+ rc = grub_util_exec(kexec); -+ if ( rc != GRUB_ERR_NONE ) -+ grub_fatal (N_("Error trying to directly perform 'kexec -e'.")); -+ -+ return rc; -+} -+ -+static grub_err_t -+grub_linux_unload (void) -+{ -+ grub_dl_unref (my_mod); -+ if ( boot_cmdline != NULL ) -+ grub_free (boot_cmdline); -+ boot_cmdline = NULL; -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) -+{ -+ int i; -+ char *tempstr; -+ -+ grub_dl_ref (my_mod); -+ -+ if (argc == 0) -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -+ -+ if ( !grub_util_is_regular(argv[0]) ) -+ return grub_error(GRUB_ERR_FILE_NOT_FOUND, N_("Cannot find kernel file %s"), argv[0]); -+ -+ if ( kernel_path != NULL ) -+ grub_free(kernel_path); -+ -+ kernel_path = grub_xasprintf("%s", argv[0]); -+ -+ if ( boot_cmdline != NULL ) { -+ grub_free(boot_cmdline); -+ boot_cmdline = NULL; -+ } -+ -+ if ( argc > 1 ) -+ { -+ boot_cmdline = grub_xasprintf("--command-line=%s", argv[1]); -+ for ( i = 2; i < argc; i++ ) { -+ tempstr = grub_xasprintf("%s %s", boot_cmdline, argv[i]); -+ grub_free(boot_cmdline); -+ boot_cmdline = tempstr; -+ } -+ } -+ -+ grub_loader_set (grub_linux_boot, grub_linux_unload, 0); -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) -+{ -+ if (argc == 0) -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -+ -+ if ( !grub_util_is_regular(argv[0]) ) -+ return grub_error(GRUB_ERR_FILE_NOT_FOUND, N_("Cannot find initrd file %s"), argv[0]); -+ -+ if ( initrd_path != NULL ) -+ grub_free(initrd_path); -+ -+ initrd_path = grub_xasprintf("%s", argv[0]); -+ -+ grub_dl_unref (my_mod); -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_command_t cmd_linux, cmd_initrd; -+ -+GRUB_MOD_INIT(linux) -+{ -+ cmd_linux = grub_register_command ("linux", grub_cmd_linux, 0, N_("Load Linux.")); -+ cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0, N_("Load initrd.")); -+ my_mod = mod; -+ kernel_path = NULL; -+ initrd_path = NULL; -+ boot_cmdline = NULL; -+} -+ -+GRUB_MOD_FINI(linux) -+{ -+ grub_unregister_command (cmd_linux); -+ grub_unregister_command (cmd_initrd); -+} -diff --git a/include/grub/emu/exec.h b/include/grub/emu/exec.h -index d1073ef86af..1b61b4a2e5d 100644 ---- a/include/grub/emu/exec.h -+++ b/include/grub/emu/exec.h -@@ -23,6 +23,8 @@ - #include - - #include -+#include -+ - pid_t - grub_util_exec_pipe (const char *const *argv, int *fd); - pid_t -@@ -32,7 +34,7 @@ int - grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, - const char *stdout_file, const char *stderr_file); - int --grub_util_exec (const char *const *argv); -+EXPORT_FUNC(grub_util_exec) (const char *const *argv); - int - grub_util_exec_redirect (const char *const *argv, const char *stdin_file, - const char *stdout_file); -diff --git a/include/grub/emu/hostfile.h b/include/grub/emu/hostfile.h -index cfb1e2b5661..a61568e36e9 100644 ---- a/include/grub/emu/hostfile.h -+++ b/include/grub/emu/hostfile.h -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - - int -@@ -29,7 +30,7 @@ grub_util_is_directory (const char *path); - int - grub_util_is_special_file (const char *path); - int --grub_util_is_regular (const char *path); -+EXPORT_FUNC(grub_util_is_regular) (const char *path); - - char * - grub_util_path_concat (size_t n, ...); -diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h -index ff9c48a6490..01056954b96 100644 ---- a/include/grub/emu/misc.h -+++ b/include/grub/emu/misc.h -@@ -57,6 +57,9 @@ void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format ( - void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); - void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2), noreturn)); - -+void EXPORT_FUNC(grub_util_set_kexecute) (void); -+int EXPORT_FUNC(grub_util_get_kexecute) (void) WARN_UNUSED_RESULT; -+ - grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); - - #ifdef HAVE_DEVICE_MAPPER -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index ee88e44e97a..80e7a83edf9 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -307,6 +307,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/net.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostdisk.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostfile.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/exec.h - if COND_GRUB_EMU_SDL - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h - endif diff --git a/0093-efinet-Setting-network-from-UEFI-device-path.patch b/0076-efinet-Setting-network-from-UEFI-device-path.patch similarity index 99% rename from 0093-efinet-Setting-network-from-UEFI-device-path.patch rename to 0076-efinet-Setting-network-from-UEFI-device-path.patch index 11b2a72..f4faf27 100644 --- a/0093-efinet-Setting-network-from-UEFI-device-path.patch +++ b/0076-efinet-Setting-network-from-UEFI-device-path.patch @@ -32,7 +32,7 @@ Signed-off-by: Ken Lin 2 files changed, 280 insertions(+), 15 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 014e5bf9802..8171ecaa5e4 100644 +index 014e5bf980..8171ecaa5e 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -26,6 +26,7 @@ @@ -375,7 +375,7 @@ index 014e5bf9802..8171ecaa5e4 100644 } } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 91ab528e4d0..4a51667adb1 100644 +index 91ab528e4d..4a51667adb 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -864,6 +864,8 @@ struct grub_efi_ipv4_device_path diff --git a/0094-efinet-Setting-DNS-server-from-UEFI-protocol.patch b/0077-efinet-Setting-DNS-server-from-UEFI-protocol.patch similarity index 99% rename from 0094-efinet-Setting-DNS-server-from-UEFI-protocol.patch rename to 0077-efinet-Setting-DNS-server-from-UEFI-protocol.patch index 1460c8a..2d92ff0 100644 --- a/0094-efinet-Setting-DNS-server-from-UEFI-protocol.patch +++ b/0077-efinet-Setting-DNS-server-from-UEFI-protocol.patch @@ -33,7 +33,7 @@ Signed-off-by: Ken Lin 2 files changed, 238 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 8171ecaa5e4..715a6168d77 100644 +index 8171ecaa5e..715a6168d7 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -33,6 +33,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -242,7 +242,7 @@ index 8171ecaa5e4..715a6168d77 100644 } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 4a51667adb1..0b490195ad9 100644 +index 4a51667adb..0b490195ad 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -352,6 +352,15 @@ diff --git a/0095-Support-UEFI-networking-protocols.patch b/0078-Support-UEFI-networking-protocols.patch similarity index 99% rename from 0095-Support-UEFI-networking-protocols.patch rename to 0078-Support-UEFI-networking-protocols.patch index fb14386..145becf 100644 --- a/0095-Support-UEFI-networking-protocols.patch +++ b/0078-Support-UEFI-networking-protocols.patch @@ -57,10 +57,10 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/net/efi.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 4b7c45a7b06..c40170f2dd2 100644 +index 52ec0fafcd..12797336c9 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2299,6 +2299,12 @@ module = { +@@ -2300,6 +2300,12 @@ module = { common = hook/datehook.c; }; @@ -73,7 +73,7 @@ index 4b7c45a7b06..c40170f2dd2 100644 module = { name = net; common = net/net.c; -@@ -2312,6 +2318,12 @@ module = { +@@ -2313,6 +2319,12 @@ module = { common = net/ethernet.c; common = net/arp.c; common = net/netbuff.c; @@ -87,7 +87,7 @@ index 4b7c45a7b06..c40170f2dd2 100644 module = { diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c -index a458c3aca78..1637731535e 100644 +index a458c3aca7..1637731535 100644 --- a/grub-core/io/bufio.c +++ b/grub-core/io/bufio.c @@ -139,7 +139,7 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) @@ -100,7 +100,7 @@ index a458c3aca78..1637731535e 100644 if (file->offset + res < next_buf) { diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index d6a2fb57789..2a446f5031b 100644 +index d6a2fb5778..2a446f5031 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -755,7 +755,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) @@ -231,7 +231,7 @@ index d6a2fb57789..2a446f5031b 100644 grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype); break; diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 715a6168d77..e11d759f19a 100644 +index 715a6168d7..e11d759f19 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -27,6 +27,7 @@ @@ -304,7 +304,7 @@ index 715a6168d77..e11d759f19a 100644 diff --git a/grub-core/net/efi/dhcp.c b/grub-core/net/efi/dhcp.c new file mode 100644 -index 00000000000..dbef63d8c08 +index 0000000000..dbef63d8c0 --- /dev/null +++ b/grub-core/net/efi/dhcp.c @@ -0,0 +1,397 @@ @@ -707,7 +707,7 @@ index 00000000000..dbef63d8c08 +grub_command_func_t grub_efi_net_bootp6 = grub_cmd_efi_bootp6; diff --git a/grub-core/net/efi/efi_netfs.c b/grub-core/net/efi/efi_netfs.c new file mode 100644 -index 00000000000..ef371d885ea +index 0000000000..ef371d885e --- /dev/null +++ b/grub-core/net/efi/efi_netfs.c @@ -0,0 +1,57 @@ @@ -770,7 +770,7 @@ index 00000000000..ef371d885ea +} diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c new file mode 100644 -index 00000000000..3f61fd2fa5b +index 0000000000..3f61fd2fa5 --- /dev/null +++ b/grub-core/net/efi/http.c @@ -0,0 +1,419 @@ @@ -1195,7 +1195,7 @@ index 00000000000..3f61fd2fa5b + }; diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c new file mode 100644 -index 00000000000..b711a5d9457 +index 0000000000..b711a5d945 --- /dev/null +++ b/grub-core/net/efi/ip4_config.c @@ -0,0 +1,398 @@ @@ -1599,7 +1599,7 @@ index 00000000000..b711a5d9457 + }; diff --git a/grub-core/net/efi/ip6_config.c b/grub-core/net/efi/ip6_config.c new file mode 100644 -index 00000000000..017c4d05bc7 +index 0000000000..017c4d05bc --- /dev/null +++ b/grub-core/net/efi/ip6_config.c @@ -0,0 +1,422 @@ @@ -2027,7 +2027,7 @@ index 00000000000..017c4d05bc7 + }; diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c new file mode 100644 -index 00000000000..86bce6535d3 +index 0000000000..86bce6535d --- /dev/null +++ b/grub-core/net/efi/net.c @@ -0,0 +1,1428 @@ @@ -3461,7 +3461,7 @@ index 00000000000..86bce6535d3 +} diff --git a/grub-core/net/efi/pxe.c b/grub-core/net/efi/pxe.c new file mode 100644 -index 00000000000..531949cba5c +index 0000000000..531949cba5 --- /dev/null +++ b/grub-core/net/efi/pxe.c @@ -0,0 +1,424 @@ @@ -3890,7 +3890,7 @@ index 00000000000..531949cba5c + }; + diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 0ce5e675ed7..55aed92722c 100644 +index 0ce5e675ed..55aed92722 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -32,6 +32,9 @@ @@ -4000,7 +4000,7 @@ index 0ce5e675ed7..55aed92722c 100644 +#endif } diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c -index a2461cda1c4..77958dd9dd5 100644 +index a2461cda1c..77958dd9dd 100644 --- a/util/grub-mknetdir.c +++ b/util/grub-mknetdir.c @@ -32,13 +32,15 @@ @@ -4082,7 +4082,7 @@ index a2461cda1c4..77958dd9dd5 100644 if (!grub_install_source_directory) { diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 0b490195ad9..f431f49973e 100644 +index 0b490195ad..f431f49973 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -622,6 +622,23 @@ typedef union @@ -4333,7 +4333,7 @@ index 0b490195ad9..f431f49973e 100644 || defined(__riscv) diff --git a/include/grub/efi/dhcp.h b/include/grub/efi/dhcp.h new file mode 100644 -index 00000000000..fdb88eb810e +index 0000000000..fdb88eb810 --- /dev/null +++ b/include/grub/efi/dhcp.h @@ -0,0 +1,343 @@ @@ -4682,7 +4682,7 @@ index 00000000000..fdb88eb810e +#endif /* ! GRUB_EFI_DHCP_HEADER */ diff --git a/include/grub/efi/http.h b/include/grub/efi/http.h new file mode 100644 -index 00000000000..c5e9a89f505 +index 0000000000..c5e9a89f50 --- /dev/null +++ b/include/grub/efi/http.h @@ -0,0 +1,215 @@ @@ -4903,7 +4903,7 @@ index 00000000000..c5e9a89f505 +#endif /* !GRUB_EFI_HTTP_HEADER */ diff --git a/include/grub/net/efi.h b/include/grub/net/efi.h new file mode 100644 -index 00000000000..de90d223e8e +index 0000000000..de90d223e8 --- /dev/null +++ b/include/grub/net/efi.h @@ -0,0 +1,144 @@ diff --git a/0096-AUDIT-0-http-boot-tracker-bug.patch b/0079-AUDIT-0-http-boot-tracker-bug.patch similarity index 96% rename from 0096-AUDIT-0-http-boot-tracker-bug.patch rename to 0079-AUDIT-0-http-boot-tracker-bug.patch index ef3e67b..b487271 100644 --- a/0096-AUDIT-0-http-boot-tracker-bug.patch +++ b/0079-AUDIT-0-http-boot-tracker-bug.patch @@ -22,7 +22,7 @@ Signed-off-by: Michael Chang 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 86bce6535d3..4bb308026ce 100644 +index 86bce6535d..4bb308026c 100644 --- a/grub-core/net/efi/net.c +++ b/grub-core/net/efi/net.c @@ -645,8 +645,10 @@ grub_efihttp_chunk_read (grub_file_t file, char *buf, @@ -38,7 +38,7 @@ index 86bce6535d3..4bb308026ce 100644 if (buf) { diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index 12a2632ea55..b52b558d631 100644 +index 12a2632ea5..b52b558d63 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -31,7 +31,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/0097-grub-editenv-Add-incr-command-to-increment-integer-v.patch b/0080-grub-editenv-Add-incr-command-to-increment-integer-v.patch similarity index 98% rename from 0097-grub-editenv-Add-incr-command-to-increment-integer-v.patch rename to 0080-grub-editenv-Add-incr-command-to-increment-integer-v.patch index f8de42a..6e2e4e2 100644 --- a/0097-grub-editenv-Add-incr-command-to-increment-integer-v.patch +++ b/0080-grub-editenv-Add-incr-command-to-increment-integer-v.patch @@ -17,7 +17,7 @@ Signed-off-by: Hans de Goede 1 file changed, 50 insertions(+) diff --git a/util/grub-editenv.c b/util/grub-editenv.c -index db6f187cc63..948eec8a114 100644 +index db6f187cc6..948eec8a11 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -53,6 +53,9 @@ static struct argp_option options[] = { diff --git a/0098-Add-auto-hide-menu-support.patch b/0081-Add-auto-hide-menu-support.patch similarity index 93% rename from 0098-Add-auto-hide-menu-support.patch rename to 0081-Add-auto-hide-menu-support.patch index efb76c4..a4fbe4a 100644 --- a/0098-Add-auto-hide-menu-support.patch +++ b/0081-Add-auto-hide-menu-support.patch @@ -35,12 +35,6 @@ fastboot If set to "1" and the conditions for auto-hiding the menu https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/quick_boot.patch Signed-off-by: Hans de Goede ---- -Changes in v2: --Drop shutdown_success tests, there is no meaningful way for systemd to set - this flag (by the time it knows all filesystems are unmounted or read-only --Drop fwsetup_once support, systemd already supports booting directly into - the fwsetup by doing "systemctl reboot --firmware" --- Makefile.util.def | 6 +++++ util/grub.d/01_menu_auto_hide.in | 48 ++++++++++++++++++++++++++++++++++++++++ @@ -49,7 +43,7 @@ Changes in v2: create mode 100644 util/grub.d/01_menu_auto_hide.in diff --git a/Makefile.util.def b/Makefile.util.def -index 41906486a71..04551e095bd 100644 +index bda9fd1211..cb8e3c3270 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -458,6 +458,12 @@ script = { @@ -67,7 +61,7 @@ index 41906486a71..04551e095bd 100644 common = util/grub.d/01_users.in; diff --git a/util/grub.d/01_menu_auto_hide.in b/util/grub.d/01_menu_auto_hide.in new file mode 100644 -index 00000000000..ad175870a54 +index 0000000000..ad175870a5 --- /dev/null +++ b/util/grub.d/01_menu_auto_hide.in @@ -0,0 +1,48 @@ @@ -120,7 +114,7 @@ index 00000000000..ad175870a54 +fi +EOF diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 4b27bd20153..3c9431cfcfb 100644 +index 4b27bd2015..3c9431cfcf 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -42,6 +42,7 @@ if [ -z "${OSPROBED}" ] ; then diff --git a/0099-Add-grub-set-bootflag-utility.patch b/0082-Add-grub-set-bootflag-utility.patch similarity index 83% rename from 0099-Add-grub-set-bootflag-utility.patch rename to 0082-Add-grub-set-bootflag-utility.patch index f5ff7d3..495bb13 100644 --- a/0099-Add-grub-set-bootflag-utility.patch +++ b/0082-Add-grub-set-bootflag-utility.patch @@ -31,24 +31,28 @@ and a symlink to grub-boot-success.timer should be added to /lib/systemd/user/timers.target.wants. Signed-off-by: Hans de Goede +[makhomed: grub-boot-success.timer: Only run if not in a container] +Signed-off-by: Gena Makhomed +[rharwood: migrate to h2m] +Signed-off-by: Robbie Harwood --- Makefile.util.def | 7 ++ - util/grub-set-bootflag.c | 160 +++++++++++++++++++++++++++++++++++++++++ + util/grub-set-bootflag.c | 172 +++++++++++++++++++++++++++++++++++++++++ conf/Makefile.extra-dist | 3 + docs/grub-boot-success.service | 6 ++ - docs/grub-boot-success.timer | 6 ++ - util/grub-set-bootflag.1 | 20 ++++++ - 6 files changed, 202 insertions(+) + docs/grub-boot-success.timer | 7 ++ + docs/man/grub-set-bootflag.h2m | 2 + + 6 files changed, 197 insertions(+) create mode 100644 util/grub-set-bootflag.c create mode 100644 docs/grub-boot-success.service create mode 100644 docs/grub-boot-success.timer - create mode 100644 util/grub-set-bootflag.1 + create mode 100644 docs/man/grub-set-bootflag.h2m diff --git a/Makefile.util.def b/Makefile.util.def -index 04551e095bd..c6375933faa 100644 +index cb8e3c3270..d066652e9b 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -1445,3 +1445,10 @@ program = { +@@ -1429,3 +1429,10 @@ program = { ldadd = grub-core/lib/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -61,10 +65,10 @@ index 04551e095bd..c6375933faa 100644 +}; diff --git a/util/grub-set-bootflag.c b/util/grub-set-bootflag.c new file mode 100644 -index 00000000000..bb198f02351 +index 0000000000..d506f7e75b --- /dev/null +++ b/util/grub-set-bootflag.c -@@ -0,0 +1,160 @@ +@@ -0,0 +1,172 @@ +/* grub-set-bootflag.c - tool to set boot-flags in the grubenv. */ +/* + * GRUB -- GRand Unified Bootloader @@ -98,6 +102,8 @@ index 00000000000..bb198f02351 +#include +#include + ++#include "progname.h" ++ +#define GRUBENV "/" GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME "/" GRUB_ENVBLK_DEFCFG +#define GRUBENV_SIZE 1024 + @@ -107,13 +113,13 @@ index 00000000000..bb198f02351 + NULL +}; + -+static void usage(void) ++static void usage(FILE *out) +{ + int i; + -+ fprintf (stderr, "Usage: 'grub-set-bootflag ', where is one of:\n"); ++ fprintf (out, "Usage: 'grub-set-bootflag ', where is one of:\n"); + for (i = 0; bootflags[i]; i++) -+ fprintf (stderr, " %s\n", bootflags[i]); ++ fprintf (out, " %s\n", bootflags[i]); +} + +int main(int argc, char *argv[]) @@ -126,9 +132,19 @@ index 00000000000..bb198f02351 + + if (argc != 2) + { -+ usage(); ++ usage (stderr); + return 1; + } ++ else if (!strcmp (argv[1], "--help")) ++ { ++ usage (stdout); ++ return 0; ++ } ++ else if (!strcmp (argv[1], "--version")) ++ { ++ printf ("grub-set-bootflag (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); ++ return 0; ++ } + + for (i = 0; bootflags[i]; i++) + if (!strcmp (argv[1], bootflags[i])) @@ -136,7 +152,7 @@ index 00000000000..bb198f02351 + if (!bootflags[i]) + { + fprintf (stderr, "Invalid bootflag: '%s'\n", argv[1]); -+ usage(); ++ usage (stderr); + return 1; + } + @@ -226,10 +242,10 @@ index 00000000000..bb198f02351 + return 0; +} diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index b909f2c073a..ea58362b555 100644 +index 8f1485d52a..ad235de7fc 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist -@@ -14,6 +14,9 @@ EXTRA_DIST += util/import_unicode.py +@@ -15,6 +15,9 @@ EXTRA_DIST += docs/man EXTRA_DIST += docs/autoiso.cfg EXTRA_DIST += docs/grub.cfg EXTRA_DIST += docs/osdetect.cfg @@ -241,7 +257,7 @@ index b909f2c073a..ea58362b555 100644 diff --git a/docs/grub-boot-success.service b/docs/grub-boot-success.service new file mode 100644 -index 00000000000..80e79584c91 +index 0000000000..80e79584c9 --- /dev/null +++ b/docs/grub-boot-success.service @@ -0,0 +1,6 @@ @@ -253,39 +269,22 @@ index 00000000000..80e79584c91 +ExecStart=/usr/sbin/grub2-set-bootflag boot_success diff --git a/docs/grub-boot-success.timer b/docs/grub-boot-success.timer new file mode 100644 -index 00000000000..5d8fcba21aa +index 0000000000..406f172005 --- /dev/null +++ b/docs/grub-boot-success.timer -@@ -0,0 +1,6 @@ +@@ -0,0 +1,7 @@ +[Unit] +Description=Mark boot as successful after the user session has run 2 minutes +ConditionUser=!@system ++ConditionVirtualization=!container + +[Timer] +OnActiveSec=2min -diff --git a/util/grub-set-bootflag.1 b/util/grub-set-bootflag.1 +diff --git a/docs/man/grub-set-bootflag.h2m b/docs/man/grub-set-bootflag.h2m new file mode 100644 -index 00000000000..57801da22a0 +index 0000000000..94ec0b92ed --- /dev/null -+++ b/util/grub-set-bootflag.1 -@@ -0,0 +1,20 @@ -+.TH GRUB-SET-BOOTFLAG 1 "Tue Jun 12 2018" -+.SH NAME -+\fBgrub-set-bootflag\fR \(em Set a bootflag in the GRUB environment block. -+ -+.SH SYNOPSIS -+\fBgrub-set-bootflag\fR <\fIBOOTFLAG\fR> -+ -+.SH DESCRIPTION -+\fBgrub-set-bootflag\fR is a command line to set bootflags in GRUB's -+stored environment. -+ -+.SH COMMANDS -+.TP -+\fBBOOTFLAG\fR -+.RS 7 -+Bootflag to set, one of \fIboot_success\fR or \fIshow_menu_once\fR. -+.RE -+ -+.SH SEE ALSO -+.BR "info grub" ++++ b/docs/man/grub-set-bootflag.h2m +@@ -0,0 +1,2 @@ ++[NAME] ++grub-set-bootflag \- set a bootflag in the GRUB environment block diff --git a/0100-docs-Add-grub-boot-indeterminate.service-example.patch b/0083-docs-Add-grub-boot-indeterminate.service-example.patch similarity index 97% rename from 0100-docs-Add-grub-boot-indeterminate.service-example.patch rename to 0083-docs-Add-grub-boot-indeterminate.service-example.patch index 44f6ad3..96eff36 100644 --- a/0100-docs-Add-grub-boot-indeterminate.service-example.patch +++ b/0083-docs-Add-grub-boot-indeterminate.service-example.patch @@ -16,7 +16,7 @@ Signed-off-by: Hans de Goede diff --git a/docs/grub-boot-indeterminate.service b/docs/grub-boot-indeterminate.service new file mode 100644 -index 00000000000..6c8dcb186b6 +index 0000000000..6c8dcb186b --- /dev/null +++ b/docs/grub-boot-indeterminate.service @@ -0,0 +1,11 @@ diff --git a/0101-gentpl-add-disable-support.patch b/0084-gentpl-add-disable-support.patch similarity index 97% rename from 0101-gentpl-add-disable-support.patch rename to 0084-gentpl-add-disable-support.patch index 2c3c998..3b305e6 100644 --- a/0101-gentpl-add-disable-support.patch +++ b/0084-gentpl-add-disable-support.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gentpl.py b/gentpl.py -index 2cba0bbbd6f..628e8bec1d7 100644 +index c86550d4f9..f3c5f84f85 100644 --- a/gentpl.py +++ b/gentpl.py @@ -592,11 +592,21 @@ def platform_conditional(platform, closure): diff --git a/0102-gentpl-add-pc-firmware-type.patch b/0085-gentpl-add-pc-firmware-type.patch similarity index 95% rename from 0102-gentpl-add-pc-firmware-type.patch rename to 0085-gentpl-add-pc-firmware-type.patch index 96dd2b8..0bfd2ea 100644 --- a/0102-gentpl-add-pc-firmware-type.patch +++ b/0085-gentpl-add-pc-firmware-type.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+) diff --git a/gentpl.py b/gentpl.py -index 628e8bec1d7..34a4eba2b42 100644 +index f3c5f84f85..f09b336869 100644 --- a/gentpl.py +++ b/gentpl.py @@ -51,6 +51,7 @@ GROUPS["riscv32"] = [ "riscv32_efi" ] diff --git a/0103-efinet-also-use-the-firmware-acceleration-for-http.patch b/0086-efinet-also-use-the-firmware-acceleration-for-http.patch similarity index 96% rename from 0103-efinet-also-use-the-firmware-acceleration-for-http.patch rename to 0086-efinet-also-use-the-firmware-acceleration-for-http.patch index 915b5aa..a3a9400 100644 --- a/0103-efinet-also-use-the-firmware-acceleration-for-http.patch +++ b/0086-efinet-also-use-the-firmware-acceleration-for-http.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 4bb308026ce..6603cd83edc 100644 +index 4bb308026c..6603cd83ed 100644 --- a/grub-core/net/efi/net.c +++ b/grub-core/net/efi/net.c @@ -1324,7 +1324,9 @@ grub_efi_net_boot_from_https (void) diff --git a/0104-efi-http-Make-root_url-reflect-the-protocol-hostname.patch b/0087-efi-http-Make-root_url-reflect-the-protocol-hostname.patch similarity index 97% rename from 0104-efi-http-Make-root_url-reflect-the-protocol-hostname.patch rename to 0087-efi-http-Make-root_url-reflect-the-protocol-hostname.patch index 985a037..90d9777 100644 --- a/0104-efi-http-Make-root_url-reflect-the-protocol-hostname.patch +++ b/0087-efi-http-Make-root_url-reflect-the-protocol-hostname.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 19 insertions(+) diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index 3f61fd2fa5b..243acbaa35b 100644 +index 3f61fd2fa5..243acbaa35 100644 --- a/grub-core/net/efi/http.c +++ b/grub-core/net/efi/http.c @@ -4,6 +4,7 @@ diff --git a/0105-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch b/0088-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch similarity index 96% rename from 0105-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch rename to 0088-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch index b65eafc..6d2974f 100644 --- a/0105-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch +++ b/0088-Make-it-so-we-can-tell-configure-which-cflags-utils-.patch @@ -17,10 +17,10 @@ Signed-off-by: Peter Jones 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac -index b4455e4732d..3405348178a 100644 +index 302300711f..008f6c273b 100644 --- a/configure.ac +++ b/configure.ac -@@ -877,11 +877,23 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p +@@ -849,11 +849,23 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" fi @@ -45,7 +45,7 @@ index b4455e4732d..3405348178a 100644 AC_CACHE_CHECK([for options to get soft-float], grub_cv_target_cc_soft_float, [ grub_cv_target_cc_soft_float=no if test "x$target_cpu" = xarm64; then -@@ -2018,6 +2030,41 @@ HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" +@@ -1954,6 +1966,41 @@ HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" @@ -88,7 +88,7 @@ index b4455e4732d..3405348178a 100644 GRUB_PLATFORM="${platform}" diff --git a/conf/Makefile.common b/conf/Makefile.common -index 5f0ef969857..2ff9b39357c 100644 +index 5f0ef96985..2ff9b39357 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -40,24 +40,25 @@ CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 @@ -129,7 +129,7 @@ index 5f0ef969857..2ff9b39357c 100644 # Other variables diff --git a/gentpl.py b/gentpl.py -index 34a4eba2b42..59f62ef9522 100644 +index f09b336869..0e62e14666 100644 --- a/gentpl.py +++ b/gentpl.py @@ -697,10 +697,10 @@ def module(defn, platform): diff --git a/0106-module-verifier-make-it-possible-to-run-checkers-on-.patch b/0089-module-verifier-make-it-possible-to-run-checkers-on-.patch similarity index 94% rename from 0106-module-verifier-make-it-possible-to-run-checkers-on-.patch rename to 0089-module-verifier-make-it-possible-to-run-checkers-on-.patch index e31b38f..78c15d6 100644 --- a/0106-module-verifier-make-it-possible-to-run-checkers-on-.patch +++ b/0089-module-verifier-make-it-possible-to-run-checkers-on-.patch @@ -22,7 +22,7 @@ Signed-off-by: Peter Jones 3 files changed, 13 insertions(+) diff --git a/util/grub-module-verifier32.c b/util/grub-module-verifier32.c -index 257229f8f08..ba7d41aafea 100644 +index 257229f8f0..ba7d41aafe 100644 --- a/util/grub-module-verifier32.c +++ b/util/grub-module-verifier32.c @@ -1,2 +1,4 @@ @@ -31,7 +31,7 @@ index 257229f8f08..ba7d41aafea 100644 #include "grub-module-verifierXX.c" +#endif diff --git a/util/grub-module-verifier64.c b/util/grub-module-verifier64.c -index 4db6b4bedd1..fc23ef800b3 100644 +index 4db6b4bedd..fc23ef800b 100644 --- a/util/grub-module-verifier64.c +++ b/util/grub-module-verifier64.c @@ -1,2 +1,4 @@ @@ -40,7 +40,7 @@ index 4db6b4bedd1..fc23ef800b3 100644 #include "grub-module-verifierXX.c" +#endif diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c -index ceb24309aec..a98e2f9b1ac 100644 +index ceb24309ae..a98e2f9b1a 100644 --- a/util/grub-module-verifierXX.c +++ b/util/grub-module-verifierXX.c @@ -1,3 +1,12 @@ diff --git a/0107-Rework-how-the-fdt-command-builds.patch b/0090-Rework-how-the-fdt-command-builds.patch similarity index 80% rename from 0107-Rework-how-the-fdt-command-builds.patch rename to 0090-Rework-how-the-fdt-command-builds.patch index 71328da..8f41272 100644 --- a/0107-Rework-how-the-fdt-command-builds.patch +++ b/0090-Rework-how-the-fdt-command-builds.patch @@ -13,16 +13,19 @@ grub_fdt_load in xen_boot is not defined grub_fdt_unload in xen_boot is not defined Signed-off-by: Peter Jones +[javierm: Fix build with platform emu, aarch64, and risc-v] +Signed-off-by: Javier Martinez Canillas +Signed-off-by: Robbie Harwood --- grub-core/Makefile.core.def | 5 ++--- grub-core/lib/fdt.c | 2 -- grub-core/loader/efi/fdt.c | 2 ++ - include/grub/fdt.h | 4 ++++ + include/grub/fdt.h | 6 ++++++ grub-core/Makefile.am | 1 + - 5 files changed, 9 insertions(+), 5 deletions(-) + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index c40170f2dd2..84a3d89de9a 100644 +index 12797336c9..4e7d90da76 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -177,7 +177,6 @@ kernel = { @@ -50,7 +53,7 @@ index c40170f2dd2..84a3d89de9a 100644 common = loader/linux.c; common = lib/cmdline.c; -@@ -1836,7 +1836,6 @@ module = { +@@ -1837,7 +1837,6 @@ module = { module = { name = fdt; efi = loader/efi/fdt.c; @@ -59,7 +62,7 @@ index c40170f2dd2..84a3d89de9a 100644 }; diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c -index 0d371c5633e..37e04bd69e7 100644 +index 0d371c5633..37e04bd69e 100644 --- a/grub-core/lib/fdt.c +++ b/grub-core/lib/fdt.c @@ -21,8 +21,6 @@ @@ -72,7 +75,7 @@ index 0d371c5633e..37e04bd69e7 100644 #define FDT_BEGIN_NODE 0x00000001 diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c -index c86f283d756..c572415d38a 100644 +index c86f283d75..c572415d38 100644 --- a/grub-core/loader/efi/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -27,6 +27,8 @@ @@ -85,27 +88,29 @@ index c86f283d756..c572415d38a 100644 static void *fdt; diff --git a/include/grub/fdt.h b/include/grub/fdt.h -index e609c7e4111..22b7c5463fc 100644 +index e609c7e411..3514aa4a5b 100644 --- a/include/grub/fdt.h +++ b/include/grub/fdt.h -@@ -19,6 +19,8 @@ +@@ -19,6 +19,9 @@ #ifndef GRUB_FDT_HEADER #define GRUB_FDT_HEADER 1 -+#if defined(__arm__) || defined(__aarch64__) ++#if !defined(GRUB_MACHINE_EMU) && \ ++ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) + #include #include -@@ -144,4 +146,6 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch +@@ -144,4 +147,7 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ }) -+#endif /* defined(__arm__) || defined(__aarch64__) */ ++#endif /* !defined(GRUB_MACHINE_EMU) && \ ++ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) */ + #endif /* ! GRUB_FDT_HEADER */ diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index f512573c0da..dd49939aaa9 100644 +index bfd29a3bf0..c2e8a82bce 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -76,6 +76,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h diff --git a/0108-Disable-non-wordsize-allocations-on-arm.patch b/0091-Disable-non-wordsize-allocations-on-arm.patch similarity index 93% rename from 0108-Disable-non-wordsize-allocations-on-arm.patch rename to 0091-Disable-non-wordsize-allocations-on-arm.patch index f614c9e..ea09b65 100644 --- a/0108-Disable-non-wordsize-allocations-on-arm.patch +++ b/0091-Disable-non-wordsize-allocations-on-arm.patch @@ -9,10 +9,10 @@ Signed-off-by: Peter Jones 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac -index 3405348178a..152e7dba652 100644 +index 008f6c273b..54462e0892 100644 --- a/configure.ac +++ b/configure.ac -@@ -1288,6 +1288,26 @@ if test "x$target_cpu" = xarm; then +@@ -1260,6 +1260,26 @@ if test "x$target_cpu" = xarm; then done ]) diff --git a/0109-Prepend-prefix-when-HTTP-path-is-relative.patch b/0092-Prepend-prefix-when-HTTP-path-is-relative.patch similarity index 96% rename from 0109-Prepend-prefix-when-HTTP-path-is-relative.patch rename to 0092-Prepend-prefix-when-HTTP-path-is-relative.patch index fc861d9..30d8075 100644 --- a/0109-Prepend-prefix-when-HTTP-path-is-relative.patch +++ b/0092-Prepend-prefix-when-HTTP-path-is-relative.patch @@ -8,13 +8,15 @@ http_path: /foo/bar http_url: http://www.example.com/foo/bar Signed-off-by: Peter Jones +Signed-off-by: Stephen Benjamin +Signed-off-by: Robbie Harwood --- grub-core/kern/main.c | 10 +++++- grub-core/net/efi/http.c | 82 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 71 insertions(+), 21 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 48058d983ce..4ec3f5e4d33 100644 +index d1de9fa687..1c540fc8c2 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -131,11 +131,19 @@ grub_set_prefix_and_root (void) @@ -39,7 +41,7 @@ index 48058d983ce..4ec3f5e4d33 100644 } } diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index 243acbaa35b..de351b2cd03 100644 +index 243acbaa35..de351b2cd0 100644 --- a/grub-core/net/efi/http.c +++ b/grub-core/net/efi/http.c @@ -9,10 +9,52 @@ diff --git a/0110-Make-grub_error-more-verbose.patch b/0093-Make-grub_error-more-verbose.patch similarity index 96% rename from 0110-Make-grub_error-more-verbose.patch rename to 0093-Make-grub_error-more-verbose.patch index 2492e9f..306a3d3 100644 --- a/0110-Make-grub_error-more-verbose.patch +++ b/0093-Make-grub_error-more-verbose.patch @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/err.c b/grub-core/kern/err.c -index 53c734de70e..aebfe0cf839 100644 +index 53c734de70..aebfe0cf83 100644 --- a/grub-core/kern/err.c +++ b/grub-core/kern/err.c @@ -33,15 +33,24 @@ static struct grub_error_saved grub_error_stack_items[GRUB_ERROR_STACK_SIZE]; @@ -41,7 +41,7 @@ index 53c734de70e..aebfe0cf839 100644 return n; diff --git a/include/grub/err.h b/include/grub/err.h -index b08d5d0de4c..c0f90ef07c8 100644 +index b08d5d0de4..c0f90ef07c 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -85,8 +85,12 @@ struct grub_error_saved diff --git a/0111-Make-reset-an-alias-for-the-reboot-command.patch b/0094-Make-reset-an-alias-for-the-reboot-command.patch similarity index 97% rename from 0111-Make-reset-an-alias-for-the-reboot-command.patch rename to 0094-Make-reset-an-alias-for-the-reboot-command.patch index c86acf1..22475d6 100644 --- a/0111-Make-reset-an-alias-for-the-reboot-command.patch +++ b/0094-Make-reset-an-alias-for-the-reboot-command.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/grub-core/commands/reboot.c b/grub-core/commands/reboot.c -index 46d364c99a9..f5cc2283636 100644 +index 46d364c99a..f5cc228363 100644 --- a/grub-core/commands/reboot.c +++ b/grub-core/commands/reboot.c @@ -32,15 +32,18 @@ grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)), diff --git a/0112-Add-a-version-command.patch b/0095-Add-a-version-command.patch similarity index 89% rename from 0112-Add-a-version-command.patch rename to 0095-Add-a-version-command.patch index 30c8224..18c355c 100644 --- a/0112-Add-a-version-command.patch +++ b/0095-Add-a-version-command.patch @@ -1,13 +1,15 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 11 Sep 2018 14:20:37 -0400 -Subject: [PATCH] Add a "version" command. +Subject: [PATCH] Add a "version" command -This adds a command that shows you info about grub's version, the grub target -platform, the compiler version, and if you built with +This adds a command that shows you info about grub's version, the grub +target platform, the compiler version, and if you built with --with-rpm-version=, the rpm package version. Signed-off-by: Peter Jones +[rharwood: don't say GNU, commit message cleanup] +Signed-off-by: Robbie Harwood --- configure.ac | 13 ++++++++++ grub-core/Makefile.core.def | 5 ++++ @@ -17,10 +19,10 @@ Signed-off-by: Peter Jones create mode 100644 grub-core/commands/version.c diff --git a/configure.ac b/configure.ac -index 152e7dba652..cfdac6bed5a 100644 +index 54462e0892..7b4e1854d3 100644 --- a/configure.ac +++ b/configure.ac -@@ -312,6 +312,19 @@ AC_SUBST(target_cpu) +@@ -284,6 +284,19 @@ AC_SUBST(target_cpu) AC_SUBST(platform) # Define default variables @@ -41,7 +43,7 @@ index 152e7dba652..cfdac6bed5a 100644 have_with_bootdir=n AC_ARG_WITH([bootdir], diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 84a3d89de9a..498ca11762a 100644 +index 4e7d90da76..4f203533f5 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -579,6 +579,11 @@ image = { @@ -58,7 +60,7 @@ index 84a3d89de9a..498ca11762a 100644 common = lib/disk.c; diff --git a/grub-core/commands/version.c b/grub-core/commands/version.c new file mode 100644 -index 00000000000..f0966a518f7 +index 0000000000..de0acb07ba --- /dev/null +++ b/grub-core/commands/version.c @@ -0,0 +1,56 @@ @@ -97,7 +99,7 @@ index 00000000000..f0966a518f7 + if (argc != 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("no arguments expected")); + -+ grub_printf (_("GNU GRUB version %s\n"), PACKAGE_VERSION); ++ grub_printf (_("GRUB version %s\n"), PACKAGE_VERSION); + grub_printf (_("Platform %s-%s\n"), GRUB_TARGET_CPU, GRUB_PLATFORM); + if (grub_strlen(GRUB_RPM_VERSION) != 0) + grub_printf (_("RPM package version %s\n"), GRUB_RPM_VERSION); @@ -119,7 +121,7 @@ index 00000000000..f0966a518f7 + grub_unregister_command (cmd); +} diff --git a/config.h.in b/config.h.in -index 9e8f9911b18..c7e316f0f1f 100644 +index 9e8f9911b1..c7e316f0f1 100644 --- a/config.h.in +++ b/config.h.in @@ -59,6 +59,7 @@ diff --git a/0113-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch b/0096-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch similarity index 94% rename from 0113-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch rename to 0096-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch index 9afb315..72c8d30 100644 --- a/0113-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch +++ b/0096-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 4 files changed, 10 insertions(+) diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c -index 0320115662f..7cdffe3ebd5 100644 +index 0320115662..7cdffe3ebd 100644 --- a/grub-core/disk/diskfilter.c +++ b/grub-core/disk/diskfilter.c @@ -188,6 +188,8 @@ scan_disk (const char *name, int accept_diskfilter) @@ -33,7 +33,7 @@ index 0320115662f..7cdffe3ebd5 100644 if (!pv->disk) return grub_errno; diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index f077b5f5535..fe8ba6e6c93 100644 +index f077b5f553..fe8ba6e6c9 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -855,6 +855,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) @@ -45,7 +45,7 @@ index f077b5f5535..fe8ba6e6c93 100644 grub_free (dup_dp); diff --git a/grub-core/kern/device.c b/grub-core/kern/device.c -index 73b8ecc0c09..f58b58c89d5 100644 +index 73b8ecc0c0..f58b58c89d 100644 --- a/grub-core/kern/device.c +++ b/grub-core/kern/device.c @@ -34,6 +34,7 @@ grub_device_open (const char *name) @@ -57,7 +57,7 @@ index 73b8ecc0c09..f58b58c89d5 100644 { name = grub_env_get ("root"); diff --git a/grub-core/script/script.c b/grub-core/script/script.c -index ec4d4337c66..844e8343ca7 100644 +index ec4d4337c6..844e8343ca 100644 --- a/grub-core/script/script.c +++ b/grub-core/script/script.c @@ -22,6 +22,11 @@ diff --git a/0114-arm-arm64-loader-Better-memory-allocation-and-error-.patch b/0097-arm-arm64-loader-Better-memory-allocation-and-error-.patch similarity index 99% rename from 0114-arm-arm64-loader-Better-memory-allocation-and-error-.patch rename to 0097-arm-arm64-loader-Better-memory-allocation-and-error-.patch index 1fdc552..57d937c 100644 --- a/0114-arm-arm64-loader-Better-memory-allocation-and-error-.patch +++ b/0097-arm-arm64-loader-Better-memory-allocation-and-error-.patch @@ -71,7 +71,7 @@ Signed-off-by: Peter Jones 2 files changed, 76 insertions(+), 25 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index f6aef0ef649..85ad4b4494c 100644 +index f6aef0ef64..85ad4b4494 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -154,6 +154,7 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address, @@ -146,7 +146,7 @@ index f6aef0ef649..85ad4b4494c 100644 grub_free(memory_map); diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 04994d5c67d..70a0075ec5e 100644 +index 04994d5c67..70a0075ec5 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -71,20 +71,25 @@ finalize_params_linux (void) diff --git a/0115-Try-to-pick-better-locations-for-kernel-and-initrd.patch b/0098-Try-to-pick-better-locations-for-kernel-and-initrd.patch similarity index 88% rename from 0115-Try-to-pick-better-locations-for-kernel-and-initrd.patch rename to 0098-Try-to-pick-better-locations-for-kernel-and-initrd.patch index ba918ed..4f42ea5 100644 --- a/0115-Try-to-pick-better-locations-for-kernel-and-initrd.patch +++ b/0098-Try-to-pick-better-locations-for-kernel-and-initrd.patch @@ -23,6 +23,9 @@ Additionally, we now try to locate kernel+initrd+cmdline+etc below we try a higher address. Signed-off-by: Peter Jones +[david.abdurachmanov: fix macro for riscv64] +Signed-off-by: David Abdurachmanov +Signed-off-by: Robbie Harwood --- grub-core/kern/efi/mm.c | 8 ++++---- grub-core/loader/i386/efi/linux.c | 24 +++++++++++++++++------- @@ -30,11 +33,12 @@ Signed-off-by: Peter Jones include/grub/arm64/efi/memory.h | 1 + include/grub/i386/efi/memory.h | 1 + include/grub/ia64/efi/memory.h | 1 + + include/grub/riscv64/efi/memory.h | 1 + include/grub/x86_64/efi/memory.h | 4 +++- - 7 files changed, 28 insertions(+), 12 deletions(-) + 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 85ad4b4494c..e84961d078c 100644 +index 85ad4b4494..e84961d078 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -122,7 +122,7 @@ grub_efi_allocate_pages_max (grub_efi_physical_address_t max, @@ -68,7 +72,7 @@ index 85ad4b4494c..e84961d078c 100644 #endif diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 3017d0f3e52..33e981e76e7 100644 +index 3017d0f3e5..33e981e76e 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -27,6 +27,7 @@ @@ -134,7 +138,7 @@ index 3017d0f3e52..33e981e76e7 100644 { grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate kernel")); diff --git a/include/grub/arm/efi/memory.h b/include/grub/arm/efi/memory.h -index 2c64918e3f7..a4c2ec83502 100644 +index 2c64918e3f..a4c2ec8350 100644 --- a/include/grub/arm/efi/memory.h +++ b/include/grub/arm/efi/memory.h @@ -2,5 +2,6 @@ @@ -145,7 +149,7 @@ index 2c64918e3f7..a4c2ec83502 100644 #endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/include/grub/arm64/efi/memory.h b/include/grub/arm64/efi/memory.h -index c6cb3241714..acb61dca44b 100644 +index c6cb324171..acb61dca44 100644 --- a/include/grub/arm64/efi/memory.h +++ b/include/grub/arm64/efi/memory.h @@ -2,5 +2,6 @@ @@ -156,7 +160,7 @@ index c6cb3241714..acb61dca44b 100644 #endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/include/grub/i386/efi/memory.h b/include/grub/i386/efi/memory.h -index 2c64918e3f7..a4c2ec83502 100644 +index 2c64918e3f..a4c2ec8350 100644 --- a/include/grub/i386/efi/memory.h +++ b/include/grub/i386/efi/memory.h @@ -2,5 +2,6 @@ @@ -167,7 +171,7 @@ index 2c64918e3f7..a4c2ec83502 100644 #endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/include/grub/ia64/efi/memory.h b/include/grub/ia64/efi/memory.h -index 2c64918e3f7..a4c2ec83502 100644 +index 2c64918e3f..a4c2ec8350 100644 --- a/include/grub/ia64/efi/memory.h +++ b/include/grub/ia64/efi/memory.h @@ -2,5 +2,6 @@ @@ -176,9 +180,20 @@ index 2c64918e3f7..a4c2ec83502 100644 #define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffff +#define GRUB_EFI_MAX_ALLOCATION_ADDRESS GRUB_EFI_MAX_USABLE_ADDRESS + #endif /* ! GRUB_MEMORY_CPU_HEADER */ +diff --git a/include/grub/riscv64/efi/memory.h b/include/grub/riscv64/efi/memory.h +index c6cb324171..acb61dca44 100644 +--- a/include/grub/riscv64/efi/memory.h ++++ b/include/grub/riscv64/efi/memory.h +@@ -2,5 +2,6 @@ + #include + + #define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffffffffULL ++#define GRUB_EFI_MAX_ALLOCATION_ADDRESS GRUB_EFI_MAX_USABLE_ADDRESS + #endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/include/grub/x86_64/efi/memory.h b/include/grub/x86_64/efi/memory.h -index 46e9145a308..e81cfb32213 100644 +index 46e9145a30..e81cfb3221 100644 --- a/include/grub/x86_64/efi/memory.h +++ b/include/grub/x86_64/efi/memory.h @@ -2,9 +2,11 @@ diff --git a/0099-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch b/0099-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch new file mode 100644 index 0000000..77db523 --- /dev/null +++ b/0099-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch @@ -0,0 +1,199 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 11 Jul 2019 18:03:25 +0200 +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/setup.c | 2 +- + 10 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c +index 0ff13bcaf8..d278c2921f 100644 +--- a/grub-core/kern/emu/misc.c ++++ b/grub-core/kern/emu/misc.c +@@ -185,7 +185,7 @@ grub_util_get_image_size (const char *path) + sz = ftello (f); + if (sz < 0) + grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); +- if (sz != (size_t) sz) ++ if (sz > (off_t)(GRUB_SIZE_MAX >> 1)) + grub_util_error (_("file `%s' is too big"), path); + ret = (size_t) sz; + +diff --git a/grub-core/lib/reed_solomon.c b/grub-core/lib/reed_solomon.c +index 467305b46a..79037c093f 100644 +--- a/grub-core/lib/reed_solomon.c ++++ b/grub-core/lib/reed_solomon.c +@@ -157,7 +157,7 @@ static void + rs_encode (gf_single_t *data, grub_size_t s, grub_size_t rs) + { + gf_single_t *rs_polynomial; +- int i, j; ++ unsigned int i, j; + gf_single_t *m; + m = xcalloc (s + rs, sizeof (gf_single_t)); + grub_memcpy (m, data, s * sizeof (gf_single_t)); +@@ -324,7 +324,7 @@ static void + encode_block (gf_single_t *ptr, grub_size_t s, + gf_single_t *rptr, grub_size_t rs) + { +- int i, j; ++ unsigned int i, j; + for (i = 0; i < SECTOR_SIZE; i++) + { + grub_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; +diff --git a/grub-core/osdep/linux/blocklist.c b/grub-core/osdep/linux/blocklist.c +index c77d6085cc..42a315031f 100644 +--- a/grub-core/osdep/linux/blocklist.c ++++ b/grub-core/osdep/linux/blocklist.c +@@ -109,7 +109,7 @@ grub_install_get_blocklist (grub_device_t root_dev, + else + { + struct fiemap *fie2; +- int i; ++ unsigned int i; + fie2 = xmalloc (sizeof (*fie2) + + fie1.fm_mapped_extents + * sizeof (fie1.fm_extents[1])); +diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c +index 28790307e0..9f730b3518 100644 +--- a/grub-core/osdep/linux/getroot.c ++++ b/grub-core/osdep/linux/getroot.c +@@ -236,7 +236,7 @@ grub_find_root_devices_from_btrfs (const char *dir) + { + int fd; + struct btrfs_ioctl_fs_info_args fsi; +- int i, j = 0; ++ unsigned int i, j = 0; + char **ret; + + fd = open (dir, 0); +diff --git a/grub-core/osdep/linux/hostdisk.c b/grub-core/osdep/linux/hostdisk.c +index da62f924e3..7bc99ac1c1 100644 +--- a/grub-core/osdep/linux/hostdisk.c ++++ b/grub-core/osdep/linux/hostdisk.c +@@ -83,7 +83,7 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec + if (sector_size & (sector_size - 1) || !sector_size) + return -1; + for (log_sector_size = 0; +- (1 << log_sector_size) < sector_size; ++ (1U << log_sector_size) < sector_size; + log_sector_size++); + + if (log_secsize) +diff --git a/util/grub-fstest.c b/util/grub-fstest.c +index 8386564200..bfcef852d8 100644 +--- a/util/grub-fstest.c ++++ b/util/grub-fstest.c +@@ -323,7 +323,7 @@ cmd_cmp (char *src, char *dest) + read_file (src, cmp_hook, ff); + + { +- grub_uint64_t pre; ++ long long pre; + pre = ftell (ff); + fseek (ff, 0, SEEK_END); + if (pre != ftell (ff)) +diff --git a/util/grub-menulst2cfg.c b/util/grub-menulst2cfg.c +index a39f869394..358d604210 100644 +--- a/util/grub-menulst2cfg.c ++++ b/util/grub-menulst2cfg.c +@@ -34,7 +34,7 @@ main (int argc, char **argv) + char *buf = NULL; + size_t bufsize = 0; + char *suffix = xstrdup (""); +- int suffixlen = 0; ++ size_t suffixlen = 0; + const char *out_fname = 0; + + grub_util_host_init (&argc, &argv); +diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c +index 0fe45a6103..3e09240b99 100644 +--- a/util/grub-mkfont.c ++++ b/util/grub-mkfont.c +@@ -138,7 +138,8 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + int width, height; + int cuttop, cutbottom, cutleft, cutright; + grub_uint8_t *data; +- int mask, i, j, bitmap_size; ++ int mask, i, bitmap_size; ++ unsigned int j; + FT_GlyphSlot glyph; + int flag = FT_LOAD_RENDER | FT_LOAD_MONOCHROME; + FT_Error err; +@@ -183,7 +184,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + cuttop = cutbottom = cutleft = cutright = 0; + else + { +- for (cuttop = 0; cuttop < glyph->bitmap.rows; cuttop++) ++ for (cuttop = 0; cuttop < (long)glyph->bitmap.rows; cuttop++) + { + for (j = 0; j < glyph->bitmap.width; j++) + if (glyph->bitmap.buffer[j / 8 + cuttop * glyph->bitmap.pitch] +@@ -203,10 +204,10 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + break; + } + cutbottom = glyph->bitmap.rows - 1 - cutbottom; +- if (cutbottom + cuttop >= glyph->bitmap.rows) ++ if (cutbottom + cuttop >= (long)glyph->bitmap.rows) + cutbottom = 0; + +- for (cutleft = 0; cutleft < glyph->bitmap.width; cutleft++) ++ for (cutleft = 0; cutleft < (long)glyph->bitmap.width; cutleft++) + { + for (j = 0; j < glyph->bitmap.rows; j++) + if (glyph->bitmap.buffer[cutleft / 8 + j * glyph->bitmap.pitch] +@@ -225,7 +226,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + break; + } + cutright = glyph->bitmap.width - 1 - cutright; +- if (cutright + cutleft >= glyph->bitmap.width) ++ if (cutright + cutleft >= (long)glyph->bitmap.width) + cutright = 0; + } + +@@ -262,7 +263,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + + mask = 0; + data = &glyph_info->bitmap[0] - 1; +- for (j = cuttop; j < height + cuttop; j++) ++ for (j = cuttop; j < (long)height + cuttop; j++) + for (i = cutleft; i < width + cutleft; i++) + add_pixel (&data, &mask, + glyph->bitmap.buffer[i / 8 + j * glyph->bitmap.pitch] & +diff --git a/util/grub-probe.c b/util/grub-probe.c +index c08e46bbb4..c6fac732b4 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -798,7 +798,7 @@ argp_parser (int key, char *arg, struct argp_state *state) + + case 't': + { +- int i; ++ unsigned int i; + + for (i = PRINT_FS; i < ARRAY_SIZE (targets); i++) + if (strcmp (arg, targets[i]) == 0) +diff --git a/util/setup.c b/util/setup.c +index da5f2c07f5..8b22bb8cca 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -406,7 +406,7 @@ SETUP (const char *dir, + int is_ldm; + grub_err_t err; + grub_disk_addr_t *sectors; +- int i; ++ unsigned int i; + grub_fs_t fs; + unsigned int nsec, maxsec; + diff --git a/0117-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch b/0100-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch similarity index 92% rename from 0117-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch rename to 0100-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch index de71484..03b4bbf 100644 --- a/0117-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch +++ b/0100-Don-t-use-Wno-sign-compare-Wno-conversion-Wno-error-.patch @@ -11,10 +11,10 @@ Signed-off-by: Peter Jones 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index cfdac6bed5a..bd28edf3141 100644 +index 7b4e1854d3..490353713a 100644 --- a/configure.ac +++ b/configure.ac -@@ -1480,11 +1480,11 @@ fi +@@ -1452,11 +1452,11 @@ fi # Set them to their new values for the tests below. CC="$TARGET_CC" if test x"$platform" = xemu ; then @@ -29,7 +29,7 @@ index cfdac6bed5a..bd28edf3141 100644 fi CPPFLAGS="$TARGET_CPPFLAGS" -@@ -2054,6 +2054,14 @@ if test x"$enable_werror" != xno ; then +@@ -1990,6 +1990,14 @@ if test x"$enable_werror" != xno ; then HOST_CFLAGS="$HOST_CFLAGS -Werror" fi @@ -45,7 +45,7 @@ index cfdac6bed5a..bd28edf3141 100644 TARGET_CCAS=$TARGET_CC diff --git a/conf/Makefile.common b/conf/Makefile.common -index 2ff9b39357c..35e14ff017e 100644 +index 2ff9b39357..35e14ff017 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -66,7 +66,7 @@ grubconfdir = $(sysconfdir)/grub.d diff --git a/0118-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch b/0101-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch similarity index 98% rename from 0118-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch rename to 0101-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch index fdd3096..5a9c6f2 100644 --- a/0118-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch +++ b/0101-x86-efi-Use-bounce-buffers-for-reading-to-addresses-.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 33e981e76e7..2f0336809e7 100644 +index 33e981e76e..2f0336809e 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -35,11 +35,16 @@ static grub_dl_t my_mod; diff --git a/0119-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch b/0102-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch similarity index 99% rename from 0119-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch rename to 0102-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch index f8284ec..9b10d68 100644 --- a/0119-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch +++ b/0102-x86-efi-Re-arrange-grub_cmd_linux-a-little-bit.patch @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 2f0336809e7..5f48fa55619 100644 +index 2f0336809e..5f48fa5561 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -243,32 +243,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), diff --git a/0120-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch b/0103-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch similarity index 99% rename from 0120-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch rename to 0103-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch index 4ad0696..700c98b 100644 --- a/0120-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch +++ b/0103-x86-efi-Make-our-own-allocator-for-kernel-stuff.patch @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 94 insertions(+), 73 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 5f48fa55619..3e4f7ef39f4 100644 +index 5f48fa5561..3e4f7ef39f 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -47,6 +47,65 @@ static char *linux_cmdline; diff --git a/0121-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch b/0104-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch similarity index 98% rename from 0121-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch rename to 0104-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch index b1233ce..6ac11a1 100644 --- a/0121-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch +++ b/0104-x86-efi-Allow-initrd-params-cmdline-allocations-abov.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 3e4f7ef39f4..6bc18d5aef5 100644 +index 3e4f7ef39f..6bc18d5aef 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -52,13 +52,22 @@ struct allocation_choice { @@ -153,7 +153,7 @@ index 3e4f7ef39f4..6bc18d5aef5 100644 grub_memcpy (kernel_mem, (char *)kernel + start, filelen - start); diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index 25ef52c04eb..fac22476cc5 100644 +index 25ef52c04e..fac22476cc 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -236,7 +236,11 @@ struct linux_kernel_params diff --git a/0122-Fix-getroot.c-s-trampolines.patch b/0105-Fix-getroot.c-s-trampolines.patch similarity index 97% rename from 0122-Fix-getroot.c-s-trampolines.patch rename to 0105-Fix-getroot.c-s-trampolines.patch index 29ec44c..e744b77 100644 --- a/0122-Fix-getroot.c-s-trampolines.patch +++ b/0105-Fix-getroot.c-s-trampolines.patch @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 9f730b35189..f0c503f43d3 100644 +index 9f730b3518..f0c503f43d 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -1264,22 +1264,20 @@ grub_util_get_grub_dev_os (const char *os_dev) diff --git a/0123-Do-not-allow-stack-trampolines-anywhere.patch b/0106-Do-not-allow-stack-trampolines-anywhere.patch similarity index 90% rename from 0123-Do-not-allow-stack-trampolines-anywhere.patch rename to 0106-Do-not-allow-stack-trampolines-anywhere.patch index 4ee639d..658c7a4 100644 --- a/0123-Do-not-allow-stack-trampolines-anywhere.patch +++ b/0106-Do-not-allow-stack-trampolines-anywhere.patch @@ -10,10 +10,10 @@ Signed-off-by: Peter Jones 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index bd28edf3141..907477a585c 100644 +index 490353713a..a02d40a05b 100644 --- a/configure.ac +++ b/configure.ac -@@ -2062,6 +2062,9 @@ if test x"$enable_wextra" != xno ; then +@@ -1998,6 +1998,9 @@ if test x"$enable_wextra" != xno ; then HOST_CFLAGS="$HOST_CFLAGS -Wextra" fi @@ -24,7 +24,7 @@ index bd28edf3141..907477a585c 100644 TARGET_CCAS=$TARGET_CC diff --git a/conf/Makefile.common b/conf/Makefile.common -index 35e14ff017e..0647c53b916 100644 +index 35e14ff017..0647c53b91 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -66,7 +66,7 @@ grubconfdir = $(sysconfdir)/grub.d diff --git a/0124-Reimplement-boot_counter.patch b/0107-Reimplement-boot_counter.patch similarity index 97% rename from 0124-Reimplement-boot_counter.patch rename to 0107-Reimplement-boot_counter.patch index 164b229..d018de4 100644 --- a/0124-Reimplement-boot_counter.patch +++ b/0107-Reimplement-boot_counter.patch @@ -23,7 +23,7 @@ Signed-off-by: Christian Glombek create mode 100644 util/grub.d/01_fallback_counting.in diff --git a/Makefile.util.def b/Makefile.util.def -index c6375933faa..2e5e05b25f1 100644 +index d066652e9b..e10fe766d1 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -458,6 +458,12 @@ script = { @@ -40,7 +40,7 @@ index c6375933faa..2e5e05b25f1 100644 name = '01_menu_auto_hide'; common = util/grub.d/01_menu_auto_hide.in; diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 498ca11762a..1e15345107e 100644 +index 4f203533f5..ea4d59f51b 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -398,6 +398,11 @@ kernel = { @@ -57,7 +57,7 @@ index 498ca11762a..1e15345107e 100644 mansection = 1; diff --git a/grub-core/commands/increment.c b/grub-core/commands/increment.c new file mode 100644 -index 00000000000..79cf137656c +index 0000000000..79cf137656 --- /dev/null +++ b/grub-core/commands/increment.c @@ -0,0 +1,105 @@ @@ -168,7 +168,7 @@ index 00000000000..79cf137656c +} diff --git a/util/grub.d/01_fallback_counting.in b/util/grub.d/01_fallback_counting.in new file mode 100644 -index 00000000000..be0e770ea82 +index 0000000000..be0e770ea8 --- /dev/null +++ b/util/grub.d/01_fallback_counting.in @@ -0,0 +1,22 @@ diff --git a/0125-Fix-menu-entry-selection-based-on-ID-and-title.patch b/0108-Fix-menu-entry-selection-based-on-ID-and-title.patch similarity index 99% rename from 0125-Fix-menu-entry-selection-based-on-ID-and-title.patch rename to 0108-Fix-menu-entry-selection-based-on-ID-and-title.patch index 84c1370..af74901 100644 --- a/0125-Fix-menu-entry-selection-based-on-ID-and-title.patch +++ b/0108-Fix-menu-entry-selection-based-on-ID-and-title.patch @@ -24,7 +24,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index 37d753d8081..ea714d27176 100644 +index d7a222e681..4a02aadb01 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -164,12 +164,12 @@ grub_menu_set_timeout (int timeout) diff --git a/0126-Make-the-menu-entry-users-option-argument-to-be-opti.patch b/0109-Make-the-menu-entry-users-option-argument-to-be-opti.patch similarity index 97% rename from 0126-Make-the-menu-entry-users-option-argument-to-be-opti.patch rename to 0109-Make-the-menu-entry-users-option-argument-to-be-opti.patch index e0d36db..68779eb 100644 --- a/0126-Make-the-menu-entry-users-option-argument-to-be-opti.patch +++ b/0109-Make-the-menu-entry-users-option-argument-to-be-opti.patch @@ -23,7 +23,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c -index b194123eb67..b175a1b43b7 100644 +index b194123eb6..b175a1b43b 100644 --- a/grub-core/commands/menuentry.c +++ b/grub-core/commands/menuentry.c @@ -29,7 +29,7 @@ static const struct grub_arg_option options[] = diff --git a/0127-Add-efi-export-env-and-efi-load-env-commands.patch b/0110-Add-efi-export-env-and-efi-load-env-commands.patch similarity index 97% rename from 0127-Add-efi-export-env-and-efi-load-env-commands.patch rename to 0110-Add-efi-export-env-and-efi-load-env-commands.patch index 73456bc..33d2724 100644 --- a/0127-Add-efi-export-env-and-efi-load-env-commands.patch +++ b/0110-Add-efi-export-env-and-efi-load-env-commands.patch @@ -21,7 +21,7 @@ Signed-off-by: Peter Jones create mode 100644 grub-core/commands/efi/env.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 1e15345107e..81fc274148e 100644 +index ea4d59f51b..dc9fea6f44 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -820,6 +820,12 @@ module = { @@ -39,7 +39,7 @@ index 1e15345107e..81fc274148e 100644 efi = commands/efi/efifwsetup.c; diff --git a/grub-core/commands/efi/env.c b/grub-core/commands/efi/env.c new file mode 100644 -index 00000000000..cbd13e03e81 +index 0000000000..cbd13e03e8 --- /dev/null +++ b/grub-core/commands/efi/env.c @@ -0,0 +1,168 @@ @@ -212,7 +212,7 @@ index 00000000000..cbd13e03e81 + grub_unregister_command (loadenv_cmd); +} diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 2a446f5031b..14bc10eb564 100644 +index 2a446f5031..14bc10eb56 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -225,6 +225,9 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, @@ -226,7 +226,7 @@ index 2a446f5031b..14bc10eb564 100644 } diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index 2d12e6188fd..0574d8d6217 100644 +index 2d12e6188f..0574d8d621 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -85,11 +85,6 @@ stack_protector_init (void) @@ -242,7 +242,7 @@ index 2d12e6188fd..0574d8d6217 100644 static int set_var (const char *name, const char *value, diff --git a/grub-core/lib/envblk.c b/grub-core/lib/envblk.c -index 2e4e78b132d..874506da169 100644 +index 2e4e78b132..874506da16 100644 --- a/grub-core/lib/envblk.c +++ b/grub-core/lib/envblk.c @@ -223,6 +223,49 @@ grub_envblk_delete (grub_envblk_t envblk, const char *name) @@ -296,7 +296,7 @@ index 2e4e78b132d..874506da169 100644 grub_envblk_iterate (grub_envblk_t envblk, void *hook_data, diff --git a/util/grub-set-bootflag.c b/util/grub-set-bootflag.c -index bb198f02351..6a79ee67444 100644 +index d506f7e75b..a6ccc11383 100644 --- a/util/grub-set-bootflag.c +++ b/util/grub-set-bootflag.c @@ -25,6 +25,7 @@ @@ -308,7 +308,7 @@ index bb198f02351..6a79ee67444 100644 #include #include diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 2e0691454b1..8dfc89a33b9 100644 +index 2e0691454b..8dfc89a33b 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -24,6 +24,11 @@ @@ -324,7 +324,7 @@ index 2e0691454b1..8dfc89a33b9 100644 extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table); extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle); diff --git a/include/grub/lib/envblk.h b/include/grub/lib/envblk.h -index c3e65592170..ab969af2461 100644 +index c3e6559217..ab969af246 100644 --- a/include/grub/lib/envblk.h +++ b/include/grub/lib/envblk.h @@ -22,6 +22,8 @@ diff --git a/0128-Make-it-possible-to-subtract-conditions-from-debug.patch b/0111-Make-it-possible-to-subtract-conditions-from-debug.patch similarity index 97% rename from 0128-Make-it-possible-to-subtract-conditions-from-debug.patch rename to 0111-Make-it-possible-to-subtract-conditions-from-debug.patch index fce51ea..15305f8 100644 --- a/0128-Make-it-possible-to-subtract-conditions-from-debug.patch +++ b/0111-Make-it-possible-to-subtract-conditions-from-debug.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 9a2fae6398e..578bf51a5fc 100644 +index 9a2fae6398..578bf51a5f 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -164,12 +164,24 @@ int diff --git a/0129-Export-all-variables-from-the-initial-context-when-c.patch b/0112-Export-all-variables-from-the-initial-context-when-c.patch similarity index 95% rename from 0129-Export-all-variables-from-the-initial-context-when-c.patch rename to 0112-Export-all-variables-from-the-initial-context-when-c.patch index bfe3165..214fa4f 100644 --- a/0129-Export-all-variables-from-the-initial-context-when-c.patch +++ b/0112-Export-all-variables-from-the-initial-context-when-c.patch @@ -17,7 +17,7 @@ Signed-off-by: Javier Martinez Canillas 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/grub-core/normal/context.c b/grub-core/normal/context.c -index ee53d4a68e5..87edd254c44 100644 +index ee53d4a68e..87edd254c4 100644 --- a/grub-core/normal/context.c +++ b/grub-core/normal/context.c @@ -99,7 +99,7 @@ grub_env_new_context (int export_all) @@ -30,7 +30,7 @@ index ee53d4a68e5..87edd254c44 100644 int grub_extractor_level = 0; diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index ea714d27176..d4832f17699 100644 +index 4a02aadb01..fe2e77a43e 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -375,8 +375,6 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) diff --git a/0130-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch b/0113-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch similarity index 95% rename from 0130-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch rename to 0113-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch index 9788fd5..43e8d16 100644 --- a/0130-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch +++ b/0113-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch @@ -7,6 +7,9 @@ Subject: [PATCH] grub.d: Split out boot success reset from menu auto hide Also rename fallback and menu auto hide script to be executed before and after boot success reset script. In menu auto hide script, rename last_boot_ok var to menu_hide_ok + +Signed-off-by: Christian Glombek +Signed-off-by: Robbie Harwood --- Makefile.util.def | 14 ++++++++---- ...allback_counting.in => 08_fallback_counting.in} | 14 ++++++------ @@ -18,7 +21,7 @@ In menu auto hide script, rename last_boot_ok var to menu_hide_ok rename util/grub.d/{01_menu_auto_hide.in => 12_menu_auto_hide.in} (58%) diff --git a/Makefile.util.def b/Makefile.util.def -index 2e5e05b25f1..11ab2d6fad1 100644 +index e10fe766d1..b4ce5383b7 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -459,14 +459,14 @@ script = { @@ -57,7 +60,7 @@ diff --git a/util/grub.d/01_fallback_counting.in b/util/grub.d/08_fallback_count similarity index 65% rename from util/grub.d/01_fallback_counting.in rename to util/grub.d/08_fallback_counting.in -index be0e770ea82..2e2c3ff7d31 100644 +index be0e770ea8..2e2c3ff7d3 100644 --- a/util/grub.d/01_fallback_counting.in +++ b/util/grub.d/08_fallback_counting.in @@ -1,15 +1,17 @@ @@ -86,7 +89,7 @@ index be0e770ea82..2e2c3ff7d31 100644 set boot_counter=-1 diff --git a/util/grub.d/10_reset_boot_success.in b/util/grub.d/10_reset_boot_success.in new file mode 100644 -index 00000000000..6c88d933dde +index 0000000000..6c88d933dd --- /dev/null +++ b/util/grub.d/10_reset_boot_success.in @@ -0,0 +1,25 @@ @@ -119,7 +122,7 @@ diff --git a/util/grub.d/01_menu_auto_hide.in b/util/grub.d/12_menu_auto_hide.in similarity index 58% rename from util/grub.d/01_menu_auto_hide.in rename to util/grub.d/12_menu_auto_hide.in -index ad175870a54..6a7c0fa0d43 100644 +index ad175870a5..6a7c0fa0d4 100644 --- a/util/grub.d/01_menu_auto_hide.in +++ b/util/grub.d/12_menu_auto_hide.in @@ -1,5 +1,8 @@ diff --git a/0133-Don-t-assume-that-boot-commands-will-only-return-on-.patch b/0114-Don-t-assume-that-boot-commands-will-only-return-on-.patch similarity index 98% rename from 0133-Don-t-assume-that-boot-commands-will-only-return-on-.patch rename to 0114-Don-t-assume-that-boot-commands-will-only-return-on-.patch index 418a1ef..df36517 100644 --- a/0133-Don-t-assume-that-boot-commands-will-only-return-on-.patch +++ b/0114-Don-t-assume-that-boot-commands-will-only-return-on-.patch @@ -17,7 +17,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index d4832f17699..14ceb9bb060 100644 +index fe2e77a43e..ec0c92bade 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -285,7 +285,7 @@ get_and_remove_first_entry_number (grub_menu_t menu, const char *name) diff --git a/0138-grub-set-bootflag-Update-comment-about-running-as-ro.patch b/0115-grub-set-bootflag-Update-comment-about-running-as-ro.patch similarity index 96% rename from 0138-grub-set-bootflag-Update-comment-about-running-as-ro.patch rename to 0115-grub-set-bootflag-Update-comment-about-running-as-ro.patch index cd4ef77..9ffb3ae 100644 --- a/0138-grub-set-bootflag-Update-comment-about-running-as-ro.patch +++ b/0115-grub-set-bootflag-Update-comment-about-running-as-ro.patch @@ -13,7 +13,7 @@ Signed-off-by: Hans de Goede 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-set-bootflag.c b/util/grub-set-bootflag.c -index 6a79ee67444..65d74ce010f 100644 +index a6ccc11383..3eb04beb5e 100644 --- a/util/grub-set-bootflag.c +++ b/util/grub-set-bootflag.c @@ -18,7 +18,7 @@ diff --git a/0116-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch b/0116-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch deleted file mode 100644 index c2f2a59..0000000 --- a/0116-Attempt-to-fix-up-all-the-places-Wsign-compare-error.patch +++ /dev/null @@ -1,397 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 11 Jul 2019 18:03:25 +0200 -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 - -diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c -index eeea092752d..f08a1bb8415 100644 ---- a/grub-core/kern/emu/misc.c -+++ b/grub-core/kern/emu/misc.c -@@ -189,7 +189,7 @@ grub_util_get_image_size (const char *path) - sz = ftello (f); - if (sz < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); -- if (sz != (size_t) sz) -+ if (sz > (off_t)(GRUB_SIZE_MAX >> 1)) - grub_util_error (_("file `%s' is too big"), path); - ret = (size_t) sz; - -diff --git a/grub-core/lib/reed_solomon.c b/grub-core/lib/reed_solomon.c -index 467305b46ab..79037c093f7 100644 ---- a/grub-core/lib/reed_solomon.c -+++ b/grub-core/lib/reed_solomon.c -@@ -157,7 +157,7 @@ static void - rs_encode (gf_single_t *data, grub_size_t s, grub_size_t rs) - { - gf_single_t *rs_polynomial; -- int i, j; -+ unsigned int i, j; - gf_single_t *m; - m = xcalloc (s + rs, sizeof (gf_single_t)); - grub_memcpy (m, data, s * sizeof (gf_single_t)); -@@ -324,7 +324,7 @@ static void - encode_block (gf_single_t *ptr, grub_size_t s, - gf_single_t *rptr, grub_size_t rs) - { -- int i, j; -+ unsigned int i, j; - for (i = 0; i < SECTOR_SIZE; i++) - { - grub_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; -diff --git a/grub-core/osdep/linux/blocklist.c b/grub-core/osdep/linux/blocklist.c -index c77d6085ccb..42a315031ff 100644 ---- a/grub-core/osdep/linux/blocklist.c -+++ b/grub-core/osdep/linux/blocklist.c -@@ -109,7 +109,7 @@ grub_install_get_blocklist (grub_device_t root_dev, - else - { - struct fiemap *fie2; -- int i; -+ unsigned int i; - fie2 = xmalloc (sizeof (*fie2) - + fie1.fm_mapped_extents - * sizeof (fie1.fm_extents[1])); -diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 28790307e00..9f730b35189 100644 ---- a/grub-core/osdep/linux/getroot.c -+++ b/grub-core/osdep/linux/getroot.c -@@ -236,7 +236,7 @@ grub_find_root_devices_from_btrfs (const char *dir) - { - int fd; - struct btrfs_ioctl_fs_info_args fsi; -- int i, j = 0; -+ unsigned int i, j = 0; - char **ret; - - fd = open (dir, 0); -diff --git a/grub-core/osdep/linux/hostdisk.c b/grub-core/osdep/linux/hostdisk.c -index da62f924e35..7bc99ac1c1d 100644 ---- a/grub-core/osdep/linux/hostdisk.c -+++ b/grub-core/osdep/linux/hostdisk.c -@@ -83,7 +83,7 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec - if (sector_size & (sector_size - 1) || !sector_size) - return -1; - for (log_sector_size = 0; -- (1 << log_sector_size) < sector_size; -+ (1U << log_sector_size) < sector_size; - log_sector_size++); - - if (log_secsize) -diff --git a/util/grub-fstest.c b/util/grub-fstest.c -index 83865642009..bfcef852d83 100644 ---- a/util/grub-fstest.c -+++ b/util/grub-fstest.c -@@ -323,7 +323,7 @@ cmd_cmp (char *src, char *dest) - read_file (src, cmp_hook, ff); - - { -- grub_uint64_t pre; -+ long long pre; - pre = ftell (ff); - fseek (ff, 0, SEEK_END); - if (pre != ftell (ff)) -diff --git a/util/grub-menulst2cfg.c b/util/grub-menulst2cfg.c -index a39f8693947..358d604210b 100644 ---- a/util/grub-menulst2cfg.c -+++ b/util/grub-menulst2cfg.c -@@ -34,7 +34,7 @@ main (int argc, char **argv) - char *buf = NULL; - size_t bufsize = 0; - char *suffix = xstrdup (""); -- int suffixlen = 0; -+ size_t suffixlen = 0; - const char *out_fname = 0; - - grub_util_host_init (&argc, &argv); -diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c -index 0fe45a6103d..3e09240b99f 100644 ---- a/util/grub-mkfont.c -+++ b/util/grub-mkfont.c -@@ -138,7 +138,8 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - int width, height; - int cuttop, cutbottom, cutleft, cutright; - grub_uint8_t *data; -- int mask, i, j, bitmap_size; -+ int mask, i, bitmap_size; -+ unsigned int j; - FT_GlyphSlot glyph; - int flag = FT_LOAD_RENDER | FT_LOAD_MONOCHROME; - FT_Error err; -@@ -183,7 +184,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - cuttop = cutbottom = cutleft = cutright = 0; - else - { -- for (cuttop = 0; cuttop < glyph->bitmap.rows; cuttop++) -+ for (cuttop = 0; cuttop < (long)glyph->bitmap.rows; cuttop++) - { - for (j = 0; j < glyph->bitmap.width; j++) - if (glyph->bitmap.buffer[j / 8 + cuttop * glyph->bitmap.pitch] -@@ -203,10 +204,10 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - break; - } - cutbottom = glyph->bitmap.rows - 1 - cutbottom; -- if (cutbottom + cuttop >= glyph->bitmap.rows) -+ if (cutbottom + cuttop >= (long)glyph->bitmap.rows) - cutbottom = 0; - -- for (cutleft = 0; cutleft < glyph->bitmap.width; cutleft++) -+ for (cutleft = 0; cutleft < (long)glyph->bitmap.width; cutleft++) - { - for (j = 0; j < glyph->bitmap.rows; j++) - if (glyph->bitmap.buffer[cutleft / 8 + j * glyph->bitmap.pitch] -@@ -225,7 +226,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - break; - } - cutright = glyph->bitmap.width - 1 - cutright; -- if (cutright + cutleft >= glyph->bitmap.width) -+ if (cutright + cutleft >= (long)glyph->bitmap.width) - cutright = 0; - } - -@@ -262,7 +263,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - - mask = 0; - data = &glyph_info->bitmap[0] - 1; -- for (j = cuttop; j < height + cuttop; j++) -+ for (j = cuttop; j < (long)height + cuttop; j++) - for (i = cutleft; i < width + cutleft; i++) - add_pixel (&data, &mask, - glyph->bitmap.buffer[i / 8 + j * glyph->bitmap.pitch] & -diff --git a/util/grub-probe.c b/util/grub-probe.c -index c08e46bbb40..c6fac732b40 100644 ---- a/util/grub-probe.c -+++ b/util/grub-probe.c -@@ -798,7 +798,7 @@ argp_parser (int key, char *arg, struct argp_state *state) - - case 't': - { -- int i; -+ unsigned int i; - - for (i = PRINT_FS; i < ARRAY_SIZE (targets); i++) - if (strcmp (arg, targets[i]) == 0) -diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c -index f33bd1ed568..8345944105f 100644 ---- a/util/grub-rpm-sort.c -+++ b/util/grub-rpm-sort.c -@@ -232,7 +232,7 @@ main (int argc, char *argv[]) - struct arguments arguments; - char **package_names = NULL; - size_t n_package_names = 0; -- int i; -+ unsigned int i; - - grub_util_host_init (&argc, &argv); - -diff --git a/util/setup.c b/util/setup.c -index da5f2c07f50..8b22bb8ccac 100644 ---- a/util/setup.c -+++ b/util/setup.c -@@ -406,7 +406,7 @@ SETUP (const char *dir, - int is_ldm; - grub_err_t err; - grub_disk_addr_t *sectors; -- int i; -+ unsigned int i; - 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/0139-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch b/0116-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch similarity index 95% rename from 0139-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch rename to 0116-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch index 122bf68..11722d1 100644 --- a/0139-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch +++ b/0116-grub-set-bootflag-Write-new-env-to-tmpfile-and-then-.patch @@ -13,7 +13,7 @@ Signed-off-by: Hans de Goede 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/util/grub-set-bootflag.c b/util/grub-set-bootflag.c -index 65d74ce010f..d1c5e28862b 100644 +index 3eb04beb5e..3b4c25ca2a 100644 --- a/util/grub-set-bootflag.c +++ b/util/grub-set-bootflag.c @@ -28,7 +28,9 @@ @@ -26,7 +26,7 @@ index 65d74ce010f..d1c5e28862b 100644 #include #include -@@ -54,8 +56,10 @@ int main(int argc, char *argv[]) +@@ -56,8 +58,10 @@ int main(int argc, char *argv[]) { /* NOTE buf must be at least the longest bootflag length + 4 bytes */ char env[GRUBENV_SIZE + 1], buf[64], *s; @@ -38,7 +38,7 @@ index 65d74ce010f..d1c5e28862b 100644 FILE *f; if (argc != 2) -@@ -77,7 +81,32 @@ int main(int argc, char *argv[]) +@@ -89,7 +93,32 @@ int main(int argc, char *argv[]) bootflag = bootflags[i]; len = strlen (bootflag); @@ -72,7 +72,7 @@ index 65d74ce010f..d1c5e28862b 100644 if (!f) { perror ("Error opening " GRUBENV " for reading"); -@@ -132,30 +161,70 @@ int main(int argc, char *argv[]) +@@ -144,30 +173,70 @@ int main(int argc, char *argv[]) snprintf(buf, sizeof(buf), "%s=1\n", bootflag); memcpy(s, buf, len + 3); diff --git a/0140-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch b/0117-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch similarity index 91% rename from 0140-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch rename to 0117-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch index 54b73e6..948ff73 100644 --- a/0140-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch +++ b/0117-grub.d-Fix-boot_indeterminate-getting-set-on-boot_su.patch @@ -3,6 +3,9 @@ From: Hans de Goede Date: Tue, 26 Nov 2019 09:51:41 +0100 Subject: [PATCH] grub.d: Fix boot_indeterminate getting set on boot_success=0 boot +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit The "grub.d: Split out boot success reset from menu auto hide script" not only moved the code to clear boot_success and boot_indeterminate @@ -42,12 +45,15 @@ boot_indeterminate to 2 when it was 1 before. Fixes: "grub.d: Split out boot success reset from menu auto hide script" Signed-off-by: Hans de Goede +[jpokorny: 01_menu_auto_hide.in: fix a then/than typo] +Signed-off-by: Jan Pokorný +Signed-off-by: Robbie Harwood --- util/grub.d/10_reset_boot_success.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_reset_boot_success.in b/util/grub.d/10_reset_boot_success.in -index 6c88d933dde..737e1ae5b68 100644 +index 6c88d933dd..e73f4137b3 100644 --- a/util/grub.d/10_reset_boot_success.in +++ b/util/grub.d/10_reset_boot_success.in @@ -6,18 +6,18 @@ @@ -67,7 +73,7 @@ index 6c88d933dde..737e1ae5b68 100644 set boot_indeterminate=0 -else - increment boot_indeterminate -+# Avoid boot_indeterminate causing the menu to be hidden more then once ++# Avoid boot_indeterminate causing the menu to be hidden more than once +elif [ "\${boot_indeterminate}" = "1" ]; then + set boot_indeterminate=2 fi diff --git a/0143-Add-start-symbol-for-RISC-V.patch b/0118-Add-start-symbol-for-RISC-V.patch similarity index 95% rename from 0143-Add-start-symbol-for-RISC-V.patch rename to 0118-Add-start-symbol-for-RISC-V.patch index 677efae..2746fa2 100644 --- a/0143-Add-start-symbol-for-RISC-V.patch +++ b/0118-Add-start-symbol-for-RISC-V.patch @@ -15,7 +15,7 @@ Signed-off-by: David Abdurachmanov 1 file changed, 1 insertion(+) diff --git a/grub-core/kern/riscv/efi/startup.S b/grub-core/kern/riscv/efi/startup.S -index f2a7b2b1ede..781773136e8 100644 +index f2a7b2b1ed..781773136e 100644 --- a/grub-core/kern/riscv/efi/startup.S +++ b/grub-core/kern/riscv/efi/startup.S @@ -29,6 +29,7 @@ diff --git a/0144-bootstrap.conf-Force-autogen.sh-to-use-python3.patch b/0119-bootstrap.conf-Force-autogen.sh-to-use-python3.patch similarity index 92% rename from 0144-bootstrap.conf-Force-autogen.sh-to-use-python3.patch rename to 0119-bootstrap.conf-Force-autogen.sh-to-use-python3.patch index 5c3b968..8bfc964 100644 --- a/0144-bootstrap.conf-Force-autogen.sh-to-use-python3.patch +++ b/0119-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 6b043fc354..52d4af44be 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/0145-efi-http-Export-fw-http-_path-variables-to-make-them.patch b/0120-efi-http-Export-fw-http-_path-variables-to-make-them.patch similarity index 95% rename from 0145-efi-http-Export-fw-http-_path-variables-to-make-them.patch rename to 0120-efi-http-Export-fw-http-_path-variables-to-make-them.patch index 6f2e93d..f745782 100644 --- a/0145-efi-http-Export-fw-http-_path-variables-to-make-them.patch +++ b/0120-efi-http-Export-fw-http-_path-variables-to-make-them.patch @@ -25,7 +25,7 @@ Signed-off-by: Javier Martinez Canillas 2 files changed, 2 insertions(+) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 4ec3f5e4d33..0285e95a2bb 100644 +index 1c540fc8c2..b573be6650 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -143,6 +143,7 @@ grub_set_prefix_and_root (void) @@ -37,7 +37,7 @@ index 4ec3f5e4d33..0285e95a2bb 100644 grub_free (fw_path); } diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index de351b2cd03..755b7a6d054 100644 +index de351b2cd0..755b7a6d05 100644 --- a/grub-core/net/efi/http.c +++ b/grub-core/net/efi/http.c @@ -39,6 +39,7 @@ http_configure (struct grub_efi_net_device *dev, int prefer_ip6) diff --git a/0146-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch b/0121-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch similarity index 99% rename from 0146-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch rename to 0121-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch index c394549..03d85c2 100644 --- a/0146-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch +++ b/0121-efi-http-Enclose-literal-IPv6-addresses-in-square-br.patch @@ -43,7 +43,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index 755b7a6d054..fc8cb25ae0a 100644 +index 755b7a6d05..fc8cb25ae0 100644 --- a/grub-core/net/efi/http.c +++ b/grub-core/net/efi/http.c @@ -158,13 +158,7 @@ efihttp_request (grub_efi_http_t *http, char *server, char *name, int use_https, diff --git a/0147-efi-net-Allow-to-specify-a-port-number-in-addresses.patch b/0122-efi-net-Allow-to-specify-a-port-number-in-addresses.patch similarity index 97% rename from 0147-efi-net-Allow-to-specify-a-port-number-in-addresses.patch rename to 0122-efi-net-Allow-to-specify-a-port-number-in-addresses.patch index 209aed8..8fe26cd 100644 --- a/0147-efi-net-Allow-to-specify-a-port-number-in-addresses.patch +++ b/0122-efi-net-Allow-to-specify-a-port-number-in-addresses.patch @@ -25,7 +25,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 6603cd83edc..84573937b18 100644 +index 6603cd83ed..84573937b1 100644 --- a/grub-core/net/efi/net.c +++ b/grub-core/net/efi/net.c @@ -742,7 +742,7 @@ grub_efi_net_parse_address (const char *address, diff --git a/0148-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch b/0123-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch similarity index 97% rename from 0148-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch rename to 0123-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch index f92dee4..2dc7001 100644 --- a/0148-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch +++ b/0123-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch @@ -21,7 +21,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c -index b711a5d9457..313c818b184 100644 +index b711a5d945..313c818b18 100644 --- a/grub-core/net/efi/ip4_config.c +++ b/grub-core/net/efi/ip4_config.c @@ -56,9 +56,20 @@ int diff --git a/0149-efi-net-Print-a-debug-message-if-parsing-the-address.patch b/0124-efi-net-Print-a-debug-message-if-parsing-the-address.patch similarity index 98% rename from 0149-efi-net-Print-a-debug-message-if-parsing-the-address.patch rename to 0124-efi-net-Print-a-debug-message-if-parsing-the-address.patch index 33d8f88..da94e08 100644 --- a/0149-efi-net-Print-a-debug-message-if-parsing-the-address.patch +++ b/0124-efi-net-Print-a-debug-message-if-parsing-the-address.patch @@ -22,7 +22,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 84573937b18..a3f0535d43c 100644 +index 84573937b1..a3f0535d43 100644 --- a/grub-core/net/efi/net.c +++ b/grub-core/net/efi/net.c @@ -778,9 +778,9 @@ grub_efi_net_parse_address (const char *address, diff --git a/0150-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch b/0125-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch similarity index 96% rename from 0150-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch rename to 0125-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch index 3dd525a..8793b0d 100644 --- a/0150-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch +++ b/0125-kern-term-Also-accept-F8-as-a-user-interrupt-key.patch @@ -12,7 +12,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/term.c b/grub-core/kern/term.c -index 14d59649832..4d61f4e9790 100644 +index 14d5964983..4d61f4e979 100644 --- a/grub-core/kern/term.c +++ b/grub-core/kern/term.c @@ -144,9 +144,10 @@ grub_key_is_interrupt (int key) diff --git a/0151-efi-Set-image-base-address-before-jumping-to-the-PE-.patch b/0126-efi-Set-image-base-address-before-jumping-to-the-PE-.patch similarity index 98% rename from 0151-efi-Set-image-base-address-before-jumping-to-the-PE-.patch rename to 0126-efi-Set-image-base-address-before-jumping-to-the-PE-.patch index 336bcf1..6aa5013 100644 --- a/0151-efi-Set-image-base-address-before-jumping-to-the-PE-.patch +++ b/0126-efi-Set-image-base-address-before-jumping-to-the-PE-.patch @@ -29,7 +29,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 14 insertions(+) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index 0622dfa48d4..e8b9ecb17f6 100644 +index 0622dfa48d..e8b9ecb17f 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -72,6 +72,7 @@ grub_err_t diff --git a/0152-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch b/0127-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch similarity index 98% rename from 0152-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch rename to 0127-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch index 747773d..d1c7b17 100644 --- a/0152-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch +++ b/0127-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch @@ -18,7 +18,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grub-core/commands/tpm.c b/grub-core/commands/tpm.c -index 2052c36eaba..e287d042e6b 100644 +index 2052c36eab..e287d042e6 100644 --- a/grub-core/commands/tpm.c +++ b/grub-core/commands/tpm.c @@ -42,7 +42,8 @@ grub_tpm_verify_init (grub_file_t io, diff --git a/0153-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch b/0128-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch similarity index 97% rename from 0153-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch rename to 0128-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch index 825d0f7..7c41e87 100644 --- a/0153-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch +++ b/0128-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch @@ -26,7 +26,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 6bc18d5aef5..15d40d6e35b 100644 +index 6bc18d5aef..15d40d6e35 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -144,7 +144,7 @@ grub_linuxefi_unload (void) diff --git a/0154-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch b/0129-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch similarity index 97% rename from 0154-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch rename to 0129-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch index 97d2e06..7fef93e 100644 --- a/0154-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch +++ b/0129-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch @@ -20,7 +20,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index b52b558d631..7f878b56157 100644 +index b52b558d63..7f878b5615 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -501,13 +501,20 @@ http_open (struct grub_file *file, const char *filename) diff --git a/0155-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch b/0130-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch similarity index 95% rename from 0155-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch rename to 0130-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch index 1657d7a..f3b10c1 100644 --- a/0155-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch +++ b/0130-Fix-a-missing-return-in-efi-export-env-and-efi-load-.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/grub-core/commands/efi/env.c b/grub-core/commands/efi/env.c -index cbd13e03e81..977edb6b065 100644 +index cbd13e03e8..977edb6b06 100644 --- a/grub-core/commands/efi/env.c +++ b/grub-core/commands/efi/env.c @@ -149,6 +149,8 @@ grub_efi_load_env(grub_command_t cmd __attribute__ ((unused)), diff --git a/0131-Fix-systemctl-kexec-exit-status-check.patch b/0131-Fix-systemctl-kexec-exit-status-check.patch deleted file mode 100644 index 74ecedc..0000000 --- a/0131-Fix-systemctl-kexec-exit-status-check.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Tue, 9 Apr 2019 12:30:38 +0200 -Subject: [PATCH] Fix systemctl kexec exit status check - -There's always an error printed even when the systemctl kexec command does -succeed. That's because systemctl executes it asynchronously, but the emu -loader seems to expect it to be synchronous and that should never return. - -Also, it's wrong to test if kexecute == 1 since we already know that's the -case or otherwise the function wouldn't had called grub_fatal() earlier. - -Finally, systemctl kexec failing shouldn't be a fatal error since the emu -loader fallbacks to executing the kexec command in case of a failure. - -Signed-off-by: Javier Martinez Canillas ---- - grub-core/loader/emu/linux.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c -index fda9e00d24c..5b85b225eed 100644 ---- a/grub-core/loader/emu/linux.c -+++ b/grub-core/loader/emu/linux.c -@@ -71,8 +71,10 @@ grub_linux_boot (void) - (kexecute==1) ? "do-or-die" : "just-in-case"); - rc = grub_util_exec (systemctl); - -- if (kexecute == 1) -- grub_fatal (N_("Error trying to perform 'systemctl kexec'")); -+ if (rc == GRUB_ERR_NONE) -+ return rc; -+ -+ grub_error (rc, N_("Error trying to perform 'systemctl kexec'")); - - /* need to check read-only root before resetting hard!? */ - grub_printf("Performing 'kexec -e'"); diff --git a/0156-efi-dhcp-fix-some-allocation-error-checking.patch b/0131-efi-dhcp-fix-some-allocation-error-checking.patch similarity index 97% rename from 0156-efi-dhcp-fix-some-allocation-error-checking.patch rename to 0131-efi-dhcp-fix-some-allocation-error-checking.patch index 7549733..90e7a34 100644 --- a/0156-efi-dhcp-fix-some-allocation-error-checking.patch +++ b/0131-efi-dhcp-fix-some-allocation-error-checking.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/grub-core/net/efi/dhcp.c b/grub-core/net/efi/dhcp.c -index dbef63d8c08..e5c79b748b0 100644 +index dbef63d8c0..e5c79b748b 100644 --- a/grub-core/net/efi/dhcp.c +++ b/grub-core/net/efi/dhcp.c @@ -80,7 +80,7 @@ grub_efi_dhcp4_parse_dns (grub_efi_dhcp4_protocol_t *dhcp4, grub_efi_dhcp4_packe diff --git a/0132-Print-grub-emu-linux-loader-messages-as-debug.patch b/0132-Print-grub-emu-linux-loader-messages-as-debug.patch deleted file mode 100644 index a49ec44..0000000 --- a/0132-Print-grub-emu-linux-loader-messages-as-debug.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Tue, 9 Apr 2019 12:42:37 +0200 -Subject: [PATCH] Print grub-emu linux loader messages as debug - -They just polute the output and should better be debug messages instead. - -Signed-off-by: Javier Martinez Canillas ---- - grub-core/loader/emu/linux.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c -index 5b85b225eed..22ab6af1727 100644 ---- a/grub-core/loader/emu/linux.c -+++ b/grub-core/loader/emu/linux.c -@@ -50,7 +50,7 @@ grub_linux_boot (void) - initrd_param = grub_xasprintf("%s", ""); - } - -- grub_printf("%serforming 'kexec -l %s %s %s'\n", -+ grub_dprintf ("linux", "%serforming 'kexec -l %s %s %s'\n", - (kexecute) ? "P" : "Not p", - kernel_path, initrd_param, boot_cmdline); - -@@ -67,7 +67,7 @@ grub_linux_boot (void) - if (kexecute < 1) - grub_fatal (N_("Use '"PACKAGE"-emu --kexec' to force a system restart.")); - -- grub_printf("Performing 'systemctl kexec' (%s) ", -+ grub_dprintf ("linux", "Performing 'systemctl kexec' (%s) ", - (kexecute==1) ? "do-or-die" : "just-in-case"); - rc = grub_util_exec (systemctl); - diff --git a/0157-efi-http-fix-some-allocation-error-checking.patch b/0132-efi-http-fix-some-allocation-error-checking.patch similarity index 96% rename from 0157-efi-http-fix-some-allocation-error-checking.patch rename to 0132-efi-http-fix-some-allocation-error-checking.patch index 4dffab9..149ada8 100644 --- a/0157-efi-http-fix-some-allocation-error-checking.patch +++ b/0132-efi-http-fix-some-allocation-error-checking.patch @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index fc8cb25ae0a..26647a50fa4 100644 +index fc8cb25ae0..26647a50fa 100644 --- a/grub-core/net/efi/http.c +++ b/grub-core/net/efi/http.c @@ -412,8 +412,8 @@ grub_efihttp_open (struct grub_efi_net_device *dev, diff --git a/0158-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch b/0133-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch similarity index 98% rename from 0158-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch rename to 0133-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch index 30c21a5..6413eb6 100644 --- a/0158-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch +++ b/0133-efi-ip-46-_config.c-fix-some-potential-allocation-ov.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c -index 313c818b184..9725e928f7e 100644 +index 313c818b18..9725e928f7 100644 --- a/grub-core/net/efi/ip4_config.c +++ b/grub-core/net/efi/ip4_config.c @@ -4,15 +4,20 @@ @@ -82,7 +82,7 @@ index 313c818b184..9725e928f7e 100644 char *subnet, *gateway, *mask; grub_uint32_t u32_subnet, u32_gateway; diff --git a/grub-core/net/efi/ip6_config.c b/grub-core/net/efi/ip6_config.c -index 017c4d05bc7..a46f6f9b685 100644 +index 017c4d05bc..a46f6f9b68 100644 --- a/grub-core/net/efi/ip6_config.c +++ b/grub-core/net/efi/ip6_config.c @@ -3,6 +3,7 @@ diff --git a/0134-Fix-undefined-references-for-fdt-when-building-with-.patch b/0134-Fix-undefined-references-for-fdt-when-building-with-.patch deleted file mode 100644 index 9065da8..0000000 --- a/0134-Fix-undefined-references-for-fdt-when-building-with-.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Wed, 1 May 2019 00:36:19 +0200 -Subject: [PATCH] Fix undefined references for fdt when building with platform - emu - -The fdt module isn't build for this platform, so adding the declarations -with platform emu will lead to the following undefined reference errors: - -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x500): undefined reference to `grub_fdt_add_subnode' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x518): undefined reference to `grub_fdt_check_header' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x530): undefined reference to `grub_fdt_check_header_nosize' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x548): undefined reference to `grub_fdt_create_empty_tree' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x560): undefined reference to `grub_fdt_find_subnode' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x578): undefined reference to `grub_fdt_first_node' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x590): undefined reference to `grub_fdt_get_nodename' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x5a8): undefined reference to `grub_fdt_get_prop' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x5c0): undefined reference to `grub_fdt_next_node' -BUILDSTDERR: /usr/bin/ld: grub_emu_lite-symlist.o:(.data+0x5d8): undefined reference to `grub_fdt_set_prop' -BUILDSTDERR: collect2: error: ld returned 1 exit status -BUILDSTDERR: make[1]: *** [Makefile:27093: grub-emu-lite] Error 1 -BUILDSTDERR: make[1]: *** Waiting for unfinished jobs.... - -Signed-off-by: Javier Martinez Canillas ---- - include/grub/fdt.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/grub/fdt.h b/include/grub/fdt.h -index 22b7c5463fc..2041341fd68 100644 ---- a/include/grub/fdt.h -+++ b/include/grub/fdt.h -@@ -19,7 +19,7 @@ - #ifndef GRUB_FDT_HEADER - #define GRUB_FDT_HEADER 1 - --#if defined(__arm__) || defined(__aarch64__) -+#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__aarch64__)) - - #include - #include diff --git a/0159-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch b/0134-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch similarity index 97% rename from 0159-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch rename to 0134-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch index 95f7e20..8e63d1d 100644 --- a/0159-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch +++ b/0134-efilinux-Fix-integer-overflows-in-grub_cmd_initrd.patch @@ -13,7 +13,7 @@ Signed-off-by: Colin Watson 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 15d40d6e35b..f992ceeef20 100644 +index 15d40d6e35..f992ceeef2 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -28,6 +28,8 @@ diff --git a/0135-Do-better-in-bootstrap.conf.patch b/0135-Do-better-in-bootstrap.conf.patch deleted file mode 100644 index ec9d8ec..0000000 --- a/0135-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/0160-linuxefi-fail-kernel-validation-without-shim-protoco.patch b/0135-linuxefi-fail-kernel-validation-without-shim-protoco.patch similarity index 96% rename from 0160-linuxefi-fail-kernel-validation-without-shim-protoco.patch rename to 0135-linuxefi-fail-kernel-validation-without-shim-protoco.patch index 20fc786..828fe16 100644 --- a/0160-linuxefi-fail-kernel-validation-without-shim-protoco.patch +++ b/0135-linuxefi-fail-kernel-validation-without-shim-protoco.patch @@ -23,7 +23,7 @@ Signed-off-by: Dimitri John Ledkov 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 70a0075ec5e..47f8cf0d84b 100644 +index 70a0075ec5..47f8cf0d84 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -34,6 +34,7 @@ @@ -55,7 +55,7 @@ index 70a0075ec5e..47f8cf0d84b 100644 pe = (void *)((unsigned long)kernel_addr + lh.hdr_offset); diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index ac8dfd40c61..d41e8ea14a8 100644 +index ac8dfd40c6..d41e8ea14a 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -1084,6 +1084,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), @@ -67,7 +67,7 @@ index ac8dfd40c61..d41e8ea14a8 100644 fail: if (dev) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index e8b9ecb17f6..9260731c107 100644 +index e8b9ecb17f..9260731c10 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -33,6 +33,7 @@ struct grub_efi_shim_lock @@ -79,7 +79,7 @@ index e8b9ecb17f6..9260731c107 100644 grub_linuxefi_secure_validate (void *data, grub_uint32_t size) { diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index f992ceeef20..3cf0f9b330b 100644 +index f992ceeef2..3cf0f9b330 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -30,6 +30,7 @@ diff --git a/0161-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch b/0136-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch similarity index 97% rename from 0161-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch rename to 0136-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch index 9b0db5f..f20f5c7 100644 --- a/0161-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch +++ b/0136-Fix-const-char-pointers-in-grub-core-net-bootp.c.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 8fb8918ae7e..7baf3540c81 100644 +index 8fb8918ae7..7baf3540c8 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -329,7 +329,7 @@ grub_net_configure_by_dhcp_ack (const char *name, diff --git a/0136-Use-git-to-apply-gnulib-patches.patch b/0136-Use-git-to-apply-gnulib-patches.patch deleted file mode 100644 index 7654648..0000000 --- a/0136-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/0137-Fix-build-error-with-the-fdt-module-on-risc-v.patch b/0137-Fix-build-error-with-the-fdt-module-on-risc-v.patch deleted file mode 100644 index 35f2878..0000000 --- a/0137-Fix-build-error-with-the-fdt-module-on-risc-v.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Tue, 27 Aug 2019 10:34:24 +0200 -Subject: [PATCH] Fix build error with the fdt module on risc-v - -The risc-v architecture also uses Device Trees, but the symbols in the -fdt header aren't defined for this arch which lead to following error: - -BUILDSTDERR: ../../grub-core/loader/efi/fdt.c: In function 'grub_fdt_load': -BUILDSTDERR: ../../grub-core/loader/efi/fdt.c:48:39: warning: implicit declaration of function 'grub_fdt_get_totalsize' [-Wimplicit-function-declaration] -BUILDSTDERR: 48 | size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)); - -Signed-off-by: Javier Martinez Canillas ---- - include/grub/fdt.h | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/include/grub/fdt.h b/include/grub/fdt.h -index 2041341fd68..3514aa4a5b6 100644 ---- a/include/grub/fdt.h -+++ b/include/grub/fdt.h -@@ -19,7 +19,8 @@ - #ifndef GRUB_FDT_HEADER - #define GRUB_FDT_HEADER 1 - --#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__aarch64__)) -+#if !defined(GRUB_MACHINE_EMU) && \ -+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) - - #include - #include -@@ -146,6 +147,7 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch - grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ - }) - --#endif /* defined(__arm__) || defined(__aarch64__) */ -+#endif /* !defined(GRUB_MACHINE_EMU) && \ -+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) */ - - #endif /* ! GRUB_FDT_HEADER */ diff --git a/0162-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch b/0137-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch similarity index 97% rename from 0162-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch rename to 0137-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch index 6c16e9e..ea92110 100644 --- a/0162-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch +++ b/0137-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c -index 9725e928f7e..cb880fc3e8f 100644 +index 9725e928f7..cb880fc3e8 100644 --- a/grub-core/net/efi/ip4_config.c +++ b/grub-core/net/efi/ip4_config.c @@ -61,7 +61,8 @@ int diff --git a/0163-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch b/0138-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch similarity index 96% rename from 0163-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch rename to 0138-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch index 7c29683..915e6d7 100644 --- a/0163-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch +++ b/0138-Fix-const-char-pointers-in-grub-core-net-efi-ip6_con.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/efi/ip6_config.c b/grub-core/net/efi/ip6_config.c -index a46f6f9b685..1c5415d7185 100644 +index a46f6f9b68..1c5415d718 100644 --- a/grub-core/net/efi/ip6_config.c +++ b/grub-core/net/efi/ip6_config.c @@ -85,7 +85,7 @@ grub_efi_string_to_ip6_address (const char *val, grub_efi_ipv6_address_t *addres diff --git a/0164-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch b/0139-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch similarity index 97% rename from 0164-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch rename to 0139-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch index 0fe90c8..fbba65a 100644 --- a/0164-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch +++ b/0139-Fix-const-char-pointers-in-grub-core-net-efi-net.c.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index a3f0535d43c..78e5442fc52 100644 +index a3f0535d43..78e5442fc5 100644 --- a/grub-core/net/efi/net.c +++ b/grub-core/net/efi/net.c @@ -729,7 +729,7 @@ grub_efi_net_parse_address (const char *address, diff --git a/0165-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch b/0140-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch similarity index 97% rename from 0165-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch rename to 0140-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch index 59f29e4..9b9acfe 100644 --- a/0165-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch +++ b/0140-Fix-const-char-pointers-in-grub-core-net-efi-pxe.c.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/net/efi/pxe.c b/grub-core/net/efi/pxe.c -index 531949cba5c..73e2bb01c1b 100644 +index 531949cba5..73e2bb01c1 100644 --- a/grub-core/net/efi/pxe.c +++ b/grub-core/net/efi/pxe.c @@ -187,7 +187,7 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) diff --git a/0166-Add-systemd-integration-scripts-to-make-systemctl-re.patch b/0141-Add-systemd-integration-scripts-to-make-systemctl-re.patch similarity index 97% rename from 0166-Add-systemd-integration-scripts-to-make-systemctl-re.patch rename to 0141-Add-systemd-integration-scripts-to-make-systemctl-re.patch index 130dc77..8cf45c3 100644 --- a/0166-Add-systemd-integration-scripts-to-make-systemctl-re.patch +++ b/0141-Add-systemd-integration-scripts-to-make-systemctl-re.patch @@ -65,7 +65,7 @@ Signed-off-by: Hans de Goede create mode 100644 util/systemd/systemd-integration.sh.in diff --git a/Makefile.util.def b/Makefile.util.def -index 11ab2d6fad1..e1242f54022 100644 +index b4ce5383b7..6366442129 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -470,6 +470,12 @@ script = { @@ -110,7 +110,7 @@ index 11ab2d6fad1..e1242f54022 100644 mansection = 1; name = grub-mkrescue; diff --git a/conf/Makefile.common b/conf/Makefile.common -index 0647c53b916..9fe5863b2d9 100644 +index 0647c53b91..9fe5863b2d 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -63,8 +63,11 @@ CCASFLAGS_LIBRARY = $(UTILS_CCASFLAGS) @@ -137,7 +137,7 @@ index 0647c53b916..9fe5863b2d9 100644 EXTRA_DIST = diff --git a/util/grub.d/14_menu_show_once.in b/util/grub.d/14_menu_show_once.in new file mode 100755 -index 00000000000..1cd7f36142b +index 0000000000..1cd7f36142 --- /dev/null +++ b/util/grub.d/14_menu_show_once.in @@ -0,0 +1,13 @@ @@ -156,7 +156,7 @@ index 00000000000..1cd7f36142b +EOF diff --git a/util/systemd/10-grub-logind-service.conf.in b/util/systemd/10-grub-logind-service.conf.in new file mode 100644 -index 00000000000..f2d4ac00732 +index 0000000000..f2d4ac0073 --- /dev/null +++ b/util/systemd/10-grub-logind-service.conf.in @@ -0,0 +1,2 @@ @@ -164,7 +164,7 @@ index 00000000000..f2d4ac00732 +Environment=SYSTEMD_REBOOT_TO_BOOT_LOADER_MENU=true diff --git a/util/systemd/grub-systemd-integration.service.in b/util/systemd/grub-systemd-integration.service.in new file mode 100644 -index 00000000000..c81fb594ce1 +index 0000000000..c81fb594ce --- /dev/null +++ b/util/systemd/grub-systemd-integration.service.in @@ -0,0 +1,8 @@ @@ -178,7 +178,7 @@ index 00000000000..c81fb594ce1 +ExecStart=@libexecdir@/@grubdirname@/systemd-integration.sh diff --git a/util/systemd/systemd-integration.sh.in b/util/systemd/systemd-integration.sh.in new file mode 100644 -index 00000000000..dc1218597bc +index 0000000000..dc1218597b --- /dev/null +++ b/util/systemd/systemd-integration.sh.in @@ -0,0 +1,6 @@ diff --git a/0141-Also-define-GRUB_EFI_MAX_ALLOCATION_ADDRESS-for-RISC.patch b/0141-Also-define-GRUB_EFI_MAX_ALLOCATION_ADDRESS-for-RISC.patch deleted file mode 100644 index b694ec9..0000000 --- a/0141-Also-define-GRUB_EFI_MAX_ALLOCATION_ADDRESS-for-RISC.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Thu, 16 Jan 2020 13:10:10 +0100 -Subject: [PATCH] Also define GRUB_EFI_MAX_ALLOCATION_ADDRESS for RISC-V - -The commit "Try to pick better locations for kernel and initrd" missed to -define this macro for the RISC-V (riscv64) architecture, so add it there. - -Signed-off-by: David Abdurachmanov ---- - include/grub/riscv64/efi/memory.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/grub/riscv64/efi/memory.h b/include/grub/riscv64/efi/memory.h -index c6cb3241714..acb61dca44b 100644 ---- a/include/grub/riscv64/efi/memory.h -+++ b/include/grub/riscv64/efi/memory.h -@@ -2,5 +2,6 @@ - #include - - #define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffffffffULL -+#define GRUB_EFI_MAX_ALLOCATION_ADDRESS GRUB_EFI_MAX_USABLE_ADDRESS - - #endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/0142-chainloader-Define-machine-types-for-RISC-V.patch b/0142-chainloader-Define-machine-types-for-RISC-V.patch deleted file mode 100644 index 480db52..0000000 --- a/0142-chainloader-Define-machine-types-for-RISC-V.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Sat, 9 Nov 2019 18:06:32 +0000 -Subject: [PATCH] chainloader: Define machine types for RISC-V - -The commit "Add secureboot support on efi chainloader" didn't add machine -types for RISC-V, so this patch adds them. - -Note, that grub-core/loader/riscv/linux.c is skipped because Linux is not -supported yet. This patch might need a new revision once that's the case. - -Signed-off-by: David Abdurachmanov ---- - grub-core/loader/efi/chainloader.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 47f5aa14817..ac8dfd40c61 100644 ---- a/grub-core/loader/efi/chainloader.c -+++ b/grub-core/loader/efi/chainloader.c -@@ -333,6 +333,10 @@ static const grub_uint16_t machine_type __attribute__((__unused__)) = - GRUB_PE32_MACHINE_I386; - #elif defined(__ia64__) - GRUB_PE32_MACHINE_IA64; -+#elif defined(__riscv) && (__riscv_xlen == 32) -+ GRUB_PE32_MACHINE_RISCV32; -+#elif defined(__riscv) && (__riscv_xlen == 64) -+ GRUB_PE32_MACHINE_RISCV64; - #else - #error this architecture is not supported by grub2 - #endif diff --git a/0167-systemd-integration.sh-Also-set-old-menu_show_once-g.patch b/0142-systemd-integration.sh-Also-set-old-menu_show_once-g.patch similarity index 97% rename from 0167-systemd-integration.sh-Also-set-old-menu_show_once-g.patch rename to 0142-systemd-integration.sh-Also-set-old-menu_show_once-g.patch index 9021de5..a16ed68 100644 --- a/0167-systemd-integration.sh-Also-set-old-menu_show_once-g.patch +++ b/0142-systemd-integration.sh-Also-set-old-menu_show_once-g.patch @@ -18,7 +18,7 @@ Signed-off-by: Hans de Goede 1 file changed, 5 insertions(+) diff --git a/util/systemd/systemd-integration.sh.in b/util/systemd/systemd-integration.sh.in -index dc1218597bc..a4c071c5b0c 100644 +index dc1218597b..a4c071c5b0 100644 --- a/util/systemd/systemd-integration.sh.in +++ b/util/systemd/systemd-integration.sh.in @@ -4,3 +4,8 @@ TIMEOUT_USEC=$(cat /run/systemd/reboot-to-boot-loader-menu) diff --git a/0168-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch b/0143-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch similarity index 98% rename from 0168-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch rename to 0143-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch index c338840..f891a69 100644 --- a/0168-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch +++ b/0143-at_keyboard-use-set-1-when-keyboard-is-in-Translate-.patch @@ -29,7 +29,7 @@ Signed-off-by: Renaud Métrich 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c -index 597111077bd..26014382608 100644 +index 597111077b..2601438260 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -135,20 +135,28 @@ query_mode (void) @@ -105,7 +105,7 @@ index 597111077bd..26014382608 100644 } diff --git a/include/grub/at_keyboard.h b/include/grub/at_keyboard.h -index bcb4d9ba78f..9414dc1b996 100644 +index bcb4d9ba78..9414dc1b99 100644 --- a/include/grub/at_keyboard.h +++ b/include/grub/at_keyboard.h @@ -19,6 +19,10 @@ diff --git a/0169-grub-install-disable-support-for-EFI-platforms.patch b/0144-grub-install-disable-support-for-EFI-platforms.patch similarity index 74% rename from 0169-grub-install-disable-support-for-EFI-platforms.patch rename to 0144-grub-install-disable-support-for-EFI-platforms.patch index 41003e2..f6a7530 100644 --- a/0169-grub-install-disable-support-for-EFI-platforms.patch +++ b/0144-grub-install-disable-support-for-EFI-platforms.patch @@ -19,14 +19,14 @@ build-time option. Resolves: rhbz#1737444 Signed-off-by: Jan Hlavac +[rharwood: drop man page] --- util/grub-install.c | 37 ++++++++++++++++--------------------- docs/grub.texi | 7 +++++++ - util/grub-install.8 | 4 +++- - 3 files changed, 26 insertions(+), 22 deletions(-) + 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/util/grub-install.c b/util/grub-install.c -index a2bec7446cb..5babc7af551 100644 +index a2bec7446c..5babc7af55 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -899,6 +899,22 @@ main (int argc, char *argv[]) @@ -82,7 +82,7 @@ index a2bec7446cb..5babc7af551 100644 { grub_fs_t fs; diff --git a/docs/grub.texi b/docs/grub.texi -index 04ed6ac1f07..4870faaa00a 100644 +index 04ed6ac1f0..4870faaa00 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -6509,6 +6509,13 @@ grub2-install @var{install_device} @@ -99,22 +99,3 @@ index 04ed6ac1f07..4870faaa00a 100644 @command{grub2-install} accepts the following options: @table @option -diff --git a/util/grub-install.8 b/util/grub-install.8 -index 1db89e94b3b..811d441b16c 100644 ---- a/util/grub-install.8 -+++ b/util/grub-install.8 -@@ -1,4 +1,4 @@ --.TH GRUB-INSTALL 1 "Wed Feb 26 2014" -+.TH GRUB-INSTALL 1 "Fri Nov 20 2020" - .SH NAME - \fBgrub-install\fR \(em Install GRUB on a device. - -@@ -31,6 +31,8 @@ - .SH DESCRIPTION - \fBgrub-install\fR installs GRUB onto a device. This includes copying GRUB images into the target directory (generally \fI/boot/grub\fR), and on some platforms may also include installing GRUB onto a boot sector. - -+In order to support UEFI Secure Boot, the resulting GRUB EFI binary must be signed by a recognized private key. For this reason, for EFI platforms, most distributions also ship prebuilt GRUB EFI binaries signed by a distribution-specific private key. In this case, however, the \fBgrub-install\fR utility should not be used because it would overwrite the signed EFI binary. -+ - .SH OPTIONS - .TP - \fB--modules\fR=\fIMODULES\fR\! diff --git a/0170-New-with-debug-timestamps-configure-flag-to-prepend-.patch b/0145-New-with-debug-timestamps-configure-flag-to-prepend-.patch similarity index 93% rename from 0170-New-with-debug-timestamps-configure-flag-to-prepend-.patch rename to 0145-New-with-debug-timestamps-configure-flag-to-prepend-.patch index 3eb0d00..ec5b30b 100644 --- a/0170-New-with-debug-timestamps-configure-flag-to-prepend-.patch +++ b/0145-New-with-debug-timestamps-configure-flag-to-prepend-.patch @@ -15,10 +15,10 @@ Signed-off-by: Renaud Métrich 3 files changed, 39 insertions(+) diff --git a/configure.ac b/configure.ac -index 907477a585c..d5d2a28b4ef 100644 +index a02d40a05b..ab0d326f00 100644 --- a/configure.ac +++ b/configure.ac -@@ -1613,6 +1613,17 @@ else +@@ -1585,6 +1585,17 @@ else fi AC_SUBST([BOOT_TIME_STATS]) @@ -36,7 +36,7 @@ index 907477a585c..d5d2a28b4ef 100644 AC_ARG_ENABLE([grub-emu-sdl], [AS_HELP_STRING([--enable-grub-emu-sdl], [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) -@@ -2200,6 +2211,7 @@ AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1]) +@@ -2136,6 +2147,7 @@ AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1]) AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes]) AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1]) AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1]) @@ -44,7 +44,7 @@ index 907477a585c..d5d2a28b4ef 100644 AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes]) -@@ -2295,6 +2307,12 @@ else +@@ -2231,6 +2243,12 @@ else echo With boot time statistics: No fi @@ -58,7 +58,7 @@ index 907477a585c..d5d2a28b4ef 100644 echo efiemu runtime: Yes else diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 578bf51a5fc..9f54b6b7d2d 100644 +index 578bf51a5f..9f54b6b7d2 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -25,6 +25,9 @@ @@ -99,7 +99,7 @@ index 578bf51a5fc..9f54b6b7d2d 100644 va_start (args, fmt); grub_vprintf (fmt, args); diff --git a/config.h.in b/config.h.in -index c7e316f0f1f..c80e3e0aba3 100644 +index c7e316f0f1..c80e3e0aba 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,7 @@ diff --git a/0171-Added-debug-statements-to-grub_disk_open-and-grub_di.patch b/0146-Added-debug-statements-to-grub_disk_open-and-grub_di.patch similarity index 97% rename from 0171-Added-debug-statements-to-grub_disk_open-and-grub_di.patch rename to 0146-Added-debug-statements-to-grub_disk_open-and-grub_di.patch index cbb1a38..d26027c 100644 --- a/0171-Added-debug-statements-to-grub_disk_open-and-grub_di.patch +++ b/0146-Added-debug-statements-to-grub_disk_open-and-grub_di.patch @@ -13,7 +13,7 @@ Signed-off-by: Renaud Métrich 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c -index e1b0e073e09..05a28ab1429 100644 +index e1b0e073e0..05a28ab142 100644 --- a/grub-core/kern/disk.c +++ b/grub-core/kern/disk.c @@ -285,6 +285,8 @@ grub_disk_open (const char *name) diff --git a/0172-Introduce-function-grub_debug_is_enabled-void-return.patch b/0147-Introduce-function-grub_debug_is_enabled-void-return.patch similarity index 95% rename from 0172-Introduce-function-grub_debug_is_enabled-void-return.patch rename to 0147-Introduce-function-grub_debug_is_enabled-void-return.patch index 4e4718b..9ce5d9d 100644 --- a/0172-Introduce-function-grub_debug_is_enabled-void-return.patch +++ b/0147-Introduce-function-grub_debug_is_enabled-void-return.patch @@ -14,7 +14,7 @@ Signed-off-by: Renaud Métrich 2 files changed, 14 insertions(+) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 9f54b6b7d2d..a186ad3dd41 100644 +index 9f54b6b7d2..a186ad3dd4 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -163,6 +163,19 @@ int grub_err_printf (const char *fmt, ...) @@ -38,7 +38,7 @@ index 9f54b6b7d2d..a186ad3dd41 100644 grub_debug_enabled (const char * condition) { diff --git a/include/grub/misc.h b/include/grub/misc.h -index 3adc4036e3b..6c4aa85ac50 100644 +index 3adc4036e3..6c4aa85ac5 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -340,6 +340,7 @@ grub_puts (const char *s) diff --git a/0173-Don-t-clear-screen-when-debugging-is-enabled.patch b/0148-Don-t-clear-screen-when-debugging-is-enabled.patch similarity index 55% rename from 0173-Don-t-clear-screen-when-debugging-is-enabled.patch rename to 0148-Don-t-clear-screen-when-debugging-is-enabled.patch index d2a5988..c35d8a3 100644 --- a/0173-Don-t-clear-screen-when-debugging-is-enabled.patch +++ b/0148-Don-t-clear-screen-when-debugging-is-enabled.patch @@ -7,21 +7,25 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Renaud Métrich +[rharwood@redhat.com: rebase fuzz] +Signed-off-by: Robbie Harwood --- - grub-core/normal/main.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) + grub-core/normal/main.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index e349303c29b..155bf366da2 100644 +index af9792c963..7de9e4c36d 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -210,7 +210,8 @@ void - grub_normal_init_page (struct grub_term_output *term, - int y __attribute__((__unused__))) - { +@@ -215,8 +215,9 @@ grub_normal_init_page (struct grub_term_output *term, + char *msg_formatted; + grub_uint32_t *unicode_msg; + grub_uint32_t *last_position; +- - grub_term_cls (term); ++ + if (! grub_debug_is_enabled ()) + grub_term_cls (term); - #if 0 - grub_ssize_t msg_len; + msg_formatted = grub_xasprintf (_("GRUB version %s"), PACKAGE_VERSION); + if (!msg_formatted) diff --git a/0149-kern-file-Fix-error-handling-in-grub_file_open.patch b/0149-kern-file-Fix-error-handling-in-grub_file_open.patch new file mode 100644 index 0000000..e444325 --- /dev/null +++ b/0149-kern-file-Fix-error-handling-in-grub_file_open.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Steve McIntyre +Date: Tue, 6 Dec 2022 01:45:11 +0000 +Subject: [PATCH] kern/file: Fix error handling in grub_file_open() + +grub_file_open() calls grub_file_get_device_name(), but doesn't check +the return. Instead, it checks if grub_errno is set. + +However, nothing initialises grub_errno here when grub_file_open() +starts. This means that trying to open one file that doesn't exist and +then trying to open another file that does will (incorrectly) also +fail to open that second file. + +Let's fix that. + +Signed-off-by: Steve McIntyre +--- + grub-core/kern/file.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c +index 58454458c4..5b58f45cfd 100644 +--- a/grub-core/kern/file.c ++++ b/grub-core/kern/file.c +@@ -66,6 +66,9 @@ grub_file_open (const char *name, enum grub_file_type type) + const char *file_name; + grub_file_filter_id_t filter; + ++ /* Reset grub_errno before we start */ ++ grub_errno = GRUB_ERR_NONE; ++ + device_name = grub_file_get_device_name (name); + if (grub_errno) + goto fail; diff --git a/0174-grub_file_-instrumentation-new-file-debug-tag.patch b/0150-grub_file_-instrumentation-new-file-debug-tag.patch similarity index 81% rename from 0174-grub_file_-instrumentation-new-file-debug-tag.patch rename to 0150-grub_file_-instrumentation-new-file-debug-tag.patch index 0cc6b8c..6327899 100644 --- a/0174-grub_file_-instrumentation-new-file-debug-tag.patch +++ b/0150-grub_file_-instrumentation-new-file-debug-tag.patch @@ -12,7 +12,7 @@ Signed-off-by: Renaud Métrich 1 file changed, 14 insertions(+) diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c -index 58454458c47..e19aea3e514 100644 +index 5b58f45cfd..ec10e54fc0 100644 --- a/grub-core/kern/file.c +++ b/grub-core/kern/file.c @@ -66,6 +66,8 @@ grub_file_open (const char *name, enum grub_file_type type) @@ -21,10 +21,10 @@ index 58454458c47..e19aea3e514 100644 + grub_dprintf ("file", "Opening `%s' ...\n", name); + - device_name = grub_file_get_device_name (name); - if (grub_errno) - goto fail; -@@ -128,6 +130,8 @@ grub_file_open (const char *name, enum grub_file_type type) + /* Reset grub_errno before we start */ + grub_errno = GRUB_ERR_NONE; + +@@ -131,6 +133,8 @@ grub_file_open (const char *name, enum grub_file_type type) if (!file) grub_file_close (last_file); @@ -33,7 +33,7 @@ index 58454458c47..e19aea3e514 100644 return file; fail: -@@ -138,6 +142,8 @@ grub_file_open (const char *name, enum grub_file_type type) +@@ -141,6 +145,8 @@ grub_file_open (const char *name, enum grub_file_type type) grub_free (file); @@ -42,7 +42,7 @@ index 58454458c47..e19aea3e514 100644 return 0; } -@@ -169,6 +175,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) +@@ -172,6 +178,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) if (len == 0) return 0; @@ -50,7 +50,7 @@ index 58454458c47..e19aea3e514 100644 read_hook = file->read_hook; read_hook_data = file->read_hook_data; if (!file->read_hook) -@@ -189,11 +196,18 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) +@@ -192,11 +199,18 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) grub_err_t grub_file_close (grub_file_t file) { diff --git a/0175-ieee1275-Avoiding-many-unecessary-open-close.patch b/0151-ieee1275-Avoiding-many-unecessary-open-close.patch similarity index 99% rename from 0175-ieee1275-Avoiding-many-unecessary-open-close.patch rename to 0151-ieee1275-Avoiding-many-unecessary-open-close.patch index 6a0ad75..f6c5244 100644 --- a/0175-ieee1275-Avoiding-many-unecessary-open-close.patch +++ b/0151-ieee1275-Avoiding-many-unecessary-open-close.patch @@ -9,7 +9,7 @@ Signed-off-by: Diego Domingos 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c -index 03674cb477e..ea7f78ac7d8 100644 +index 03674cb477..ea7f78ac7d 100644 --- a/grub-core/disk/ieee1275/ofdisk.c +++ b/grub-core/disk/ieee1275/ofdisk.c @@ -44,7 +44,7 @@ struct ofdisk_hash_ent diff --git a/0176-ieee1275-powerpc-implements-fibre-channel-discovery-.patch b/0152-ieee1275-powerpc-implements-fibre-channel-discovery-.patch similarity index 98% rename from 0176-ieee1275-powerpc-implements-fibre-channel-discovery-.patch rename to 0152-ieee1275-powerpc-implements-fibre-channel-discovery-.patch index 9fa02bb..04c5c32 100644 --- a/0176-ieee1275-powerpc-implements-fibre-channel-discovery-.patch +++ b/0152-ieee1275-powerpc-implements-fibre-channel-discovery-.patch @@ -15,7 +15,7 @@ Signed-off-by: Diego Domingos 1 file changed, 49 insertions(+) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c -index a6153d35954..0f5d54e9f2d 100644 +index a6153d3595..0f5d54e9f2 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -350,6 +350,38 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi diff --git a/0177-ieee1275-powerpc-enables-device-mapper-discovery.patch b/0153-ieee1275-powerpc-enables-device-mapper-discovery.patch similarity index 98% rename from 0177-ieee1275-powerpc-enables-device-mapper-discovery.patch rename to 0153-ieee1275-powerpc-enables-device-mapper-discovery.patch index 6f1c21b..85dbde7 100644 --- a/0177-ieee1275-powerpc-enables-device-mapper-discovery.patch +++ b/0153-ieee1275-powerpc-enables-device-mapper-discovery.patch @@ -17,7 +17,7 @@ Signed-off-by: Diego Domingos 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c -index 0f5d54e9f2d..cc849d9c94c 100644 +index 0f5d54e9f2..cc849d9c94 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -37,6 +37,7 @@ diff --git a/0178-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch b/0154-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch similarity index 97% rename from 0178-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch rename to 0154-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch index 968a9c1..f938fd1 100644 --- a/0178-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch +++ b/0154-Add-at_keyboard_fallback_set-var-to-force-the-set-ma.patch @@ -2,6 +2,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renaud=20M=C3=A9trich?= Date: Fri, 18 Dec 2020 15:39:26 +0100 Subject: [PATCH] Add 'at_keyboard_fallback_set' var to force the set manually +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit This seems required with HP DL380p Gen 8 systems. Indeed, with this system, we can see the following sequence: @@ -24,12 +27,15 @@ solution": - https://wiki.osdev.org/%228042%22_PS/2_Controller - http://www-ug.eecg.toronto.edu/msl/nios_devices/datasheets/PS2%20Keyboard%20Protocol.htm - http://www.s100computers.com/My%20System%20Pages/MSDOS%20Board/PC%20Keyboard.pdf + +Signed-off-by: Renaud Métrich +Signed-off-by: Robbie Harwood --- grub-core/term/at_keyboard.c | 121 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 25 deletions(-) diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c -index 26014382608..dac0f946fe6 100644 +index 2601438260..dac0f946fe 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -31,6 +31,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/0179-Add-suport-for-signing-grub-with-an-appended-signatu.patch b/0155-Add-suport-for-signing-grub-with-an-appended-signatu.patch similarity index 92% rename from 0179-Add-suport-for-signing-grub-with-an-appended-signatu.patch rename to 0155-Add-suport-for-signing-grub-with-an-appended-signatu.patch index caab8d5..81660d4 100644 --- a/0179-Add-suport-for-signing-grub-with-an-appended-signatu.patch +++ b/0155-Add-suport-for-signing-grub-with-an-appended-signatu.patch @@ -33,26 +33,17 @@ under this scheme. Signed-off-by: Daniel Axtens Signed-off-by: Rashmica Gupta - --- - -You can experiment with this code with a patched version of SLOF -that verifies these signatures. You can find one at: - https://github.com/daxtens/SLOF - -I will be proposing this for inclusion in a future Power Architecture -Platform Reference (PAPR). ---- - util/grub-install-common.c | 18 ++++++++++++++++-- + util/grub-install-common.c | 18 ++++++++++++++---- util/grub-mkimage.c | 15 +++++++++++++-- util/grub-mkimagexx.c | 39 ++++++++++++++++++++++++++++++++++++++- util/mkimage.c | 13 +++++++------ include/grub/util/install.h | 8 ++++++-- include/grub/util/mkimage.h | 4 ++-- - 6 files changed, 82 insertions(+), 15 deletions(-) + 6 files changed, 80 insertions(+), 17 deletions(-) diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index 4e212e690c5..aab2a941f85 100644 +index 4e212e690c..a74fee16e2 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -461,10 +461,12 @@ static size_t npubkeys; @@ -81,22 +72,24 @@ index 4e212e690c5..aab2a941f85 100644 default: return 0; } -@@ -665,7 +673,13 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -661,11 +669,13 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + " --output '%s' " + " --dtb '%s' " + "--sbat '%s' " +- "--format '%s' --compression '%s' %s %s %s\n", ++ "--format '%s' --compression '%s' " ++ "--appended-signature-size %zu %s %s %s\n", dir, prefix, outname, dtb ? : "", sbat ? : "", mkimage_target, - compnames[compression], note ? "--note" : "", +- compnames[compression], note ? "--note" : "", - disable_shim_lock ? "--disable-shim-lock" : "", s); -+ disable_shim_lock ? "--disable-shim-lock" : "", -+ "--format '%s' --compression '%s' " -+ "--appended-signature-size %zu %s %s\n", -+ dir, prefix, -+ outname, dtb ? : "", mkimage_target, + compnames[compression], appsig_size, ++ disable_shim_lock ? "--disable-shim-lock" : "", + note ? "--note" : "", s); free (s); tgt = grub_install_get_image_target (mkimage_target); -@@ -675,7 +689,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -675,7 +685,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, grub_install_generate_image (dir, prefix, fp, outname, modules.entries, memdisk_path, pubkeys, npubkeys, config_path, tgt, @@ -106,7 +99,7 @@ index 4e212e690c5..aab2a941f85 100644 while (dc--) grub_install_pop_module (); diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c -index c0d55993702..8a53310548b 100644 +index c0d5599370..8a53310548 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -84,6 +84,7 @@ static struct argp_option options[] = { @@ -160,7 +153,7 @@ index c0d55993702..8a53310548b 100644 if (grub_util_file_sync (fp) < 0) grub_util_error (_("cannot sync `%s': %s"), arguments.output ? : "stdout", diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index d78fa3e5330..393119486d3 100644 +index d78fa3e533..393119486d 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -84,6 +84,15 @@ struct grub_ieee1275_note @@ -231,7 +224,7 @@ index d78fa3e5330..393119486d3 100644 char *str_start = (elf_img + sizeof (*ehdr) + phnum * sizeof (*phdr) + shnum * sizeof (*shdr)); diff --git a/util/mkimage.c b/util/mkimage.c -index a26cf76f72f..bab12276010 100644 +index a26cf76f72..bab1227601 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -869,8 +869,9 @@ grub_install_generate_image (const char *dir, const char *prefix, @@ -263,7 +256,7 @@ index a26cf76f72f..bab12276010 100644 break; } diff --git a/include/grub/util/install.h b/include/grub/util/install.h -index 7df3191f47e..cf4531e02b6 100644 +index 7df3191f47..cf4531e02b 100644 --- a/include/grub/util/install.h +++ b/include/grub/util/install.h @@ -67,6 +67,9 @@ @@ -296,7 +289,7 @@ index 7df3191f47e..cf4531e02b6 100644 const char *sbat_path, const int disable_shim_lock); diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h -index 3819a67441c..6f1da89b9b6 100644 +index 3819a67441..6f1da89b9b 100644 --- a/include/grub/util/mkimage.h +++ b/include/grub/util/mkimage.h @@ -51,12 +51,12 @@ grub_mkimage_load_image64 (const char *kernel_path, diff --git a/0180-docs-grub-Document-signing-grub-under-UEFI.patch b/0156-docs-grub-Document-signing-grub-under-UEFI.patch similarity index 98% rename from 0180-docs-grub-Document-signing-grub-under-UEFI.patch rename to 0156-docs-grub-Document-signing-grub-under-UEFI.patch index 9b9b19a..f2b5c17 100644 --- a/0180-docs-grub-Document-signing-grub-under-UEFI.patch +++ b/0156-docs-grub-Document-signing-grub-under-UEFI.patch @@ -13,7 +13,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/grub.texi b/docs/grub.texi -index 4870faaa00a..365d1d6931b 100644 +index 4870faaa00..365d1d6931 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -5817,6 +5817,7 @@ environment variables and commands are listed in the same order. diff --git a/0181-docs-grub-Document-signing-grub-with-an-appended-sig.patch b/0157-docs-grub-Document-signing-grub-with-an-appended-sig.patch similarity index 98% rename from 0181-docs-grub-Document-signing-grub-with-an-appended-sig.patch rename to 0157-docs-grub-Document-signing-grub-with-an-appended-sig.patch index 4d85d93..ee3d659 100644 --- a/0181-docs-grub-Document-signing-grub-with-an-appended-sig.patch +++ b/0157-docs-grub-Document-signing-grub-with-an-appended-sig.patch @@ -13,7 +13,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 42 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index 365d1d6931b..afbde7c1f7b 100644 +index 365d1d6931..afbde7c1f7 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -6087,6 +6087,48 @@ image works under UEFI secure boot and can maintain the secure-boot chain. It diff --git a/0182-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch b/0158-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch similarity index 96% rename from 0182-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch rename to 0158-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch index 6e46db0..b23ce49 100644 --- a/0182-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch +++ b/0158-dl-provide-a-fake-grub_dl_set_persistent-for-the-emu.patch @@ -16,7 +16,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 11 insertions(+) diff --git a/include/grub/dl.h b/include/grub/dl.h -index 2f76e6b0437..20d870f2a47 100644 +index 2f76e6b043..20d870f2a4 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -245,11 +245,22 @@ grub_dl_get (const char *name) diff --git a/0183-pgp-factor-out-rsa_pad.patch b/0159-pgp-factor-out-rsa_pad.patch similarity index 97% rename from 0183-pgp-factor-out-rsa_pad.patch rename to 0159-pgp-factor-out-rsa_pad.patch index a8154e7..43fd882 100644 --- a/0183-pgp-factor-out-rsa_pad.patch +++ b/0159-pgp-factor-out-rsa_pad.patch @@ -27,10 +27,10 @@ Signed-off-by: Daniel Axtens create mode 100644 include/grub/pkcs1_v15.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 81fc274148e..97347ae76f9 100644 +index dc9fea6f44..64cc758835 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2510,6 +2510,14 @@ module = { +@@ -2511,6 +2511,14 @@ module = { cppflags = '$(CPPFLAGS_GCRY)'; }; @@ -46,7 +46,7 @@ index 81fc274148e..97347ae76f9 100644 name = all_video; common = lib/fake_module.c; diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c -index 5daa1e9d00c..2408db4994f 100644 +index 5daa1e9d00..2408db4994 100644 --- a/grub-core/commands/pgp.c +++ b/grub-core/commands/pgp.c @@ -24,6 +24,7 @@ @@ -93,7 +93,7 @@ index 5daa1e9d00c..2408db4994f 100644 struct grub_pubkey_context diff --git a/grub-core/lib/pkcs1_v15.c b/grub-core/lib/pkcs1_v15.c new file mode 100644 -index 00000000000..dbacd563d01 +index 0000000000..dbacd563d0 --- /dev/null +++ b/grub-core/lib/pkcs1_v15.c @@ -0,0 +1,59 @@ @@ -158,7 +158,7 @@ index 00000000000..dbacd563d01 +} diff --git a/include/grub/pkcs1_v15.h b/include/grub/pkcs1_v15.h new file mode 100644 -index 00000000000..5c338c84a15 +index 0000000000..5c338c84a1 --- /dev/null +++ b/include/grub/pkcs1_v15.h @@ -0,0 +1,27 @@ diff --git a/0184-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch b/0160-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch similarity index 96% rename from 0184-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch rename to 0160-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch index 763cdc6..541474e 100644 --- a/0184-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch +++ b/0160-crypto-move-storage-for-grub_crypto_pk_-to-crypto.c.patch @@ -40,7 +40,7 @@ Signed-off-by: Daniel Axtens 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c -index 2408db4994f..355a43844ac 100644 +index 2408db4994..355a43844a 100644 --- a/grub-core/commands/pgp.c +++ b/grub-core/commands/pgp.c @@ -147,10 +147,6 @@ const char *hashes[] = { @@ -55,7 +55,7 @@ index 2408db4994f..355a43844ac 100644 dsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, const gcry_md_spec_t *hash, struct grub_public_subkey *sk); diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c -index ca334d5a40e..c578128a59d 100644 +index ca334d5a40..c578128a59 100644 --- a/grub-core/lib/crypto.c +++ b/grub-core/lib/crypto.c @@ -121,6 +121,10 @@ grub_md_unregister (gcry_md_spec_t *cipher) diff --git a/0185-posix_wrap-tweaks-in-preparation-for-libtasn1.patch b/0161-posix_wrap-tweaks-in-preparation-for-libtasn1.patch similarity index 94% rename from 0185-posix_wrap-tweaks-in-preparation-for-libtasn1.patch rename to 0161-posix_wrap-tweaks-in-preparation-for-libtasn1.patch index a09cab1..3176f1b 100644 --- a/0185-posix_wrap-tweaks-in-preparation-for-libtasn1.patch +++ b/0161-posix_wrap-tweaks-in-preparation-for-libtasn1.patch @@ -23,7 +23,7 @@ Signed-off-by: Daniel Axtens 3 files changed, 10 insertions(+) diff --git a/grub-core/lib/posix_wrap/limits.h b/grub-core/lib/posix_wrap/limits.h -index 7217138ffd6..591dbf3289d 100644 +index 7217138ffd..591dbf3289 100644 --- a/grub-core/lib/posix_wrap/limits.h +++ b/grub-core/lib/posix_wrap/limits.h @@ -37,5 +37,6 @@ @@ -34,7 +34,7 @@ index 7217138ffd6..591dbf3289d 100644 #endif diff --git a/grub-core/lib/posix_wrap/stdlib.h b/grub-core/lib/posix_wrap/stdlib.h -index 7a8d385e973..4634db09f29 100644 +index 7a8d385e97..4634db09f2 100644 --- a/grub-core/lib/posix_wrap/stdlib.h +++ b/grub-core/lib/posix_wrap/stdlib.h @@ -58,4 +58,12 @@ abs (int c) @@ -51,7 +51,7 @@ index 7a8d385e973..4634db09f29 100644 + #endif diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/sys/types.h -index 854eb0122ef..f63412c8da0 100644 +index 854eb0122e..f63412c8da 100644 --- a/grub-core/lib/posix_wrap/sys/types.h +++ b/grub-core/lib/posix_wrap/sys/types.h @@ -51,6 +51,7 @@ typedef grub_uint8_t byte; diff --git a/0186-libtasn1-import-libtasn1-4.16.0.patch b/0162-libtasn1-import-libtasn1-4.16.0.patch similarity index 99% rename from 0186-libtasn1-import-libtasn1-4.16.0.patch rename to 0162-libtasn1-import-libtasn1-4.16.0.patch index 89552c8..9587661 100644 --- a/0186-libtasn1-import-libtasn1-4.16.0.patch +++ b/0162-libtasn1-import-libtasn1-4.16.0.patch @@ -53,7 +53,7 @@ Signed-off-by: Daniel Axtens diff --git a/grub-core/lib/libtasn1/lib/coding.c b/grub-core/lib/libtasn1/lib/coding.c new file mode 100644 -index 00000000000..245ea64cf0a +index 0000000000..245ea64cf0 --- /dev/null +++ b/grub-core/lib/libtasn1/lib/coding.c @@ -0,0 +1,1415 @@ @@ -1474,7 +1474,7 @@ index 00000000000..245ea64cf0a +} diff --git a/grub-core/lib/libtasn1/lib/decoding.c b/grub-core/lib/libtasn1/lib/decoding.c new file mode 100644 -index 00000000000..ff04eb778cb +index 0000000000..ff04eb778c --- /dev/null +++ b/grub-core/lib/libtasn1/lib/decoding.c @@ -0,0 +1,2478 @@ @@ -3958,7 +3958,7 @@ index 00000000000..ff04eb778cb +} diff --git a/grub-core/lib/libtasn1/lib/element.c b/grub-core/lib/libtasn1/lib/element.c new file mode 100644 -index 00000000000..997eb2725dc +index 0000000000..997eb2725d --- /dev/null +++ b/grub-core/lib/libtasn1/lib/element.c @@ -0,0 +1,1111 @@ @@ -5075,7 +5075,7 @@ index 00000000000..997eb2725dc +} diff --git a/grub-core/lib/libtasn1/lib/errors.c b/grub-core/lib/libtasn1/lib/errors.c new file mode 100644 -index 00000000000..cee74daf795 +index 0000000000..cee74daf79 --- /dev/null +++ b/grub-core/lib/libtasn1/lib/errors.c @@ -0,0 +1,100 @@ @@ -5181,7 +5181,7 @@ index 00000000000..cee74daf795 +} diff --git a/grub-core/lib/libtasn1/lib/gstr.c b/grub-core/lib/libtasn1/lib/gstr.c new file mode 100644 -index 00000000000..e91a3a151c0 +index 0000000000..e91a3a151c --- /dev/null +++ b/grub-core/lib/libtasn1/lib/gstr.c @@ -0,0 +1,74 @@ @@ -5261,7 +5261,7 @@ index 00000000000..e91a3a151c0 +} diff --git a/grub-core/lib/libtasn1/lib/parser_aux.c b/grub-core/lib/libtasn1/lib/parser_aux.c new file mode 100644 -index 00000000000..d5dbbf8765d +index 0000000000..d5dbbf8765 --- /dev/null +++ b/grub-core/lib/libtasn1/lib/parser_aux.c @@ -0,0 +1,1173 @@ @@ -6440,7 +6440,7 @@ index 00000000000..d5dbbf8765d +} diff --git a/grub-core/lib/libtasn1/lib/structure.c b/grub-core/lib/libtasn1/lib/structure.c new file mode 100644 -index 00000000000..8189c56a4c9 +index 0000000000..8189c56a4c --- /dev/null +++ b/grub-core/lib/libtasn1/lib/structure.c @@ -0,0 +1,1220 @@ @@ -7666,7 +7666,7 @@ index 00000000000..8189c56a4c9 +} diff --git a/grub-core/lib/libtasn1/lib/element.h b/grub-core/lib/libtasn1/lib/element.h new file mode 100644 -index 00000000000..440a33f4bb1 +index 0000000000..440a33f4bb --- /dev/null +++ b/grub-core/lib/libtasn1/lib/element.h @@ -0,0 +1,40 @@ @@ -7712,7 +7712,7 @@ index 00000000000..440a33f4bb1 +#endif diff --git a/grub-core/lib/libtasn1/lib/gstr.h b/grub-core/lib/libtasn1/lib/gstr.h new file mode 100644 -index 00000000000..48229844ff3 +index 0000000000..48229844ff --- /dev/null +++ b/grub-core/lib/libtasn1/lib/gstr.h @@ -0,0 +1,47 @@ @@ -7765,7 +7765,7 @@ index 00000000000..48229844ff3 +#endif /* GSTR_H */ diff --git a/grub-core/lib/libtasn1/lib/int.h b/grub-core/lib/libtasn1/lib/int.h new file mode 100644 -index 00000000000..ea1625786c1 +index 0000000000..ea1625786c --- /dev/null +++ b/grub-core/lib/libtasn1/lib/int.h @@ -0,0 +1,221 @@ @@ -7992,7 +7992,7 @@ index 00000000000..ea1625786c1 +#endif /* INT_H */ diff --git a/grub-core/lib/libtasn1/lib/parser_aux.h b/grub-core/lib/libtasn1/lib/parser_aux.h new file mode 100644 -index 00000000000..598e684b355 +index 0000000000..598e684b35 --- /dev/null +++ b/grub-core/lib/libtasn1/lib/parser_aux.h @@ -0,0 +1,172 @@ @@ -8170,7 +8170,7 @@ index 00000000000..598e684b355 +#endif diff --git a/grub-core/lib/libtasn1/lib/structure.h b/grub-core/lib/libtasn1/lib/structure.h new file mode 100644 -index 00000000000..99e685da07a +index 0000000000..99e685da07 --- /dev/null +++ b/grub-core/lib/libtasn1/lib/structure.h @@ -0,0 +1,45 @@ @@ -8221,7 +8221,7 @@ index 00000000000..99e685da07a +#endif diff --git a/include/grub/libtasn1.h b/include/grub/libtasn1.h new file mode 100644 -index 00000000000..6fd7a30dc35 +index 0000000000..6fd7a30dc3 --- /dev/null +++ b/include/grub/libtasn1.h @@ -0,0 +1,588 @@ @@ -8815,7 +8815,7 @@ index 00000000000..6fd7a30dc35 +#endif /* LIBTASN1_H */ diff --git a/grub-core/lib/libtasn1/LICENSE b/grub-core/lib/libtasn1/LICENSE new file mode 100644 -index 00000000000..e8b3628db9b +index 0000000000..e8b3628db9 --- /dev/null +++ b/grub-core/lib/libtasn1/LICENSE @@ -0,0 +1,16 @@ @@ -8837,7 +8837,7 @@ index 00000000000..e8b3628db9b +note that the range specifies every single year in that closed interval. diff --git a/grub-core/lib/libtasn1/README.md b/grub-core/lib/libtasn1/README.md new file mode 100644 -index 00000000000..50a8642296c +index 0000000000..50a8642296 --- /dev/null +++ b/grub-core/lib/libtasn1/README.md @@ -0,0 +1,91 @@ diff --git a/0187-libtasn1-disable-code-not-needed-in-grub.patch b/0163-libtasn1-disable-code-not-needed-in-grub.patch similarity index 97% rename from 0187-libtasn1-disable-code-not-needed-in-grub.patch rename to 0163-libtasn1-disable-code-not-needed-in-grub.patch index 00f5588..84dcbf0 100644 --- a/0187-libtasn1-disable-code-not-needed-in-grub.patch +++ b/0163-libtasn1-disable-code-not-needed-in-grub.patch @@ -25,7 +25,7 @@ Signed-off-by: Daniel Axtens 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/grub-core/lib/libtasn1/lib/coding.c b/grub-core/lib/libtasn1/lib/coding.c -index 245ea64cf0a..52def598368 100644 +index 245ea64cf0..52def59836 100644 --- a/grub-core/lib/libtasn1/lib/coding.c +++ b/grub-core/lib/libtasn1/lib/coding.c @@ -30,11 +30,11 @@ @@ -99,7 +99,7 @@ index 245ea64cf0a..52def598368 100644 +#endif \ No newline at end of file diff --git a/grub-core/lib/libtasn1/lib/decoding.c b/grub-core/lib/libtasn1/lib/decoding.c -index ff04eb778cb..42f9a92b5d4 100644 +index ff04eb778c..42f9a92b5d 100644 --- a/grub-core/lib/libtasn1/lib/decoding.c +++ b/grub-core/lib/libtasn1/lib/decoding.c @@ -1613,6 +1613,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int ider_len, @@ -119,7 +119,7 @@ index ff04eb778cb..42f9a92b5d4 100644 /** * asn1_der_decoding_startEnd: diff --git a/grub-core/lib/libtasn1/lib/element.c b/grub-core/lib/libtasn1/lib/element.c -index 997eb2725dc..539008d8e94 100644 +index 997eb2725d..539008d8e9 100644 --- a/grub-core/lib/libtasn1/lib/element.c +++ b/grub-core/lib/libtasn1/lib/element.c @@ -191,7 +191,7 @@ _asn1_append_sequence_set (asn1_node node, struct node_tail_cache_st *pcache) @@ -141,7 +141,7 @@ index 997eb2725dc..539008d8e94 100644 #define PUT_VALUE( ptr, ptr_size, data, data_size) \ *len = data_size; \ diff --git a/grub-core/lib/libtasn1/lib/errors.c b/grub-core/lib/libtasn1/lib/errors.c -index cee74daf795..42785e8622b 100644 +index cee74daf79..42785e8622 100644 --- a/grub-core/lib/libtasn1/lib/errors.c +++ b/grub-core/lib/libtasn1/lib/errors.c @@ -57,6 +57,8 @@ static const libtasn1_error_entry error_algorithms[] = { @@ -162,7 +162,7 @@ index cee74daf795..42785e8622b 100644 /** * asn1_strerror: diff --git a/grub-core/lib/libtasn1/lib/structure.c b/grub-core/lib/libtasn1/lib/structure.c -index 8189c56a4c9..fcfde01a393 100644 +index 8189c56a4c..fcfde01a39 100644 --- a/grub-core/lib/libtasn1/lib/structure.c +++ b/grub-core/lib/libtasn1/lib/structure.c @@ -76,7 +76,7 @@ _asn1_find_left (asn1_node_const node) @@ -218,7 +218,7 @@ index 8189c56a4c9..fcfde01a393 100644 /** * asn1_dup_node: diff --git a/include/grub/libtasn1.h b/include/grub/libtasn1.h -index 6fd7a30dc35..785eda2ae3f 100644 +index 6fd7a30dc3..785eda2ae3 100644 --- a/include/grub/libtasn1.h +++ b/include/grub/libtasn1.h @@ -319,6 +319,8 @@ typedef struct asn1_data_node_st asn1_data_node_st; diff --git a/0188-libtasn1-changes-for-grub-compatibility.patch b/0164-libtasn1-changes-for-grub-compatibility.patch similarity index 96% rename from 0188-libtasn1-changes-for-grub-compatibility.patch rename to 0164-libtasn1-changes-for-grub-compatibility.patch index 9b2275c..7c756bd 100644 --- a/0188-libtasn1-changes-for-grub-compatibility.patch +++ b/0164-libtasn1-changes-for-grub-compatibility.patch @@ -35,7 +35,7 @@ Signed-off-by: Daniel Axtens 6 files changed, 22 insertions(+), 33 deletions(-) diff --git a/grub-core/lib/libtasn1/lib/decoding.c b/grub-core/lib/libtasn1/lib/decoding.c -index 42f9a92b5d4..7856858b272 100644 +index 42f9a92b5d..7856858b27 100644 --- a/grub-core/lib/libtasn1/lib/decoding.c +++ b/grub-core/lib/libtasn1/lib/decoding.c @@ -32,7 +32,8 @@ @@ -71,7 +71,7 @@ index 42f9a92b5d4..7856858b272 100644 result = asn1_create_element (definitions, name, &aux); if (result == ASN1_SUCCESS) diff --git a/grub-core/lib/libtasn1/lib/element.c b/grub-core/lib/libtasn1/lib/element.c -index 539008d8e94..ed761ff56bd 100644 +index 539008d8e9..ed761ff56b 100644 --- a/grub-core/lib/libtasn1/lib/element.c +++ b/grub-core/lib/libtasn1/lib/element.c @@ -30,9 +30,10 @@ @@ -87,7 +87,7 @@ index 539008d8e94..ed761ff56bd 100644 _asn1_hierarchical_name (asn1_node_const node, char *name, int name_size) { diff --git a/grub-core/lib/libtasn1/lib/gstr.c b/grub-core/lib/libtasn1/lib/gstr.c -index e91a3a151c0..e33875c2c7c 100644 +index e91a3a151c..e33875c2c7 100644 --- a/grub-core/lib/libtasn1/lib/gstr.c +++ b/grub-core/lib/libtasn1/lib/gstr.c @@ -36,13 +36,13 @@ _asn1_str_cat (char *dest, size_t dest_tot_size, const char *src) @@ -107,7 +107,7 @@ index e91a3a151c0..e33875c2c7c 100644 } } diff --git a/grub-core/lib/libtasn1/lib/parser_aux.c b/grub-core/lib/libtasn1/lib/parser_aux.c -index d5dbbf8765d..89c9be69dc2 100644 +index d5dbbf8765..89c9be69dc 100644 --- a/grub-core/lib/libtasn1/lib/parser_aux.c +++ b/grub-core/lib/libtasn1/lib/parser_aux.c @@ -26,7 +26,8 @@ @@ -139,7 +139,7 @@ index d5dbbf8765d..89c9be69dc2 100644 temp[start + count] = '0' + (char) r; count++; diff --git a/grub-core/lib/libtasn1/lib/int.h b/grub-core/lib/libtasn1/lib/int.h -index ea1625786c1..4a568efee9c 100644 +index ea1625786c..4a568efee9 100644 --- a/grub-core/lib/libtasn1/lib/int.h +++ b/grub-core/lib/libtasn1/lib/int.h @@ -35,7 +35,7 @@ @@ -161,7 +161,7 @@ index ea1625786c1..4a568efee9c 100644 #if SIZEOF_UNSIGNED_LONG_INT == 8 # define _asn1_strtou64(n,e,b) strtoul((const char *) n, e, b) diff --git a/include/grub/libtasn1.h b/include/grub/libtasn1.h -index 785eda2ae3f..28dbf16c4e0 100644 +index 785eda2ae3..28dbf16c4e 100644 --- a/include/grub/libtasn1.h +++ b/include/grub/libtasn1.h @@ -38,29 +38,15 @@ diff --git a/0189-libtasn1-compile-into-asn1-module.patch b/0165-libtasn1-compile-into-asn1-module.patch similarity index 95% rename from 0189-libtasn1-compile-into-asn1-module.patch rename to 0165-libtasn1-compile-into-asn1-module.patch index 67be4e8..0fb433f 100644 --- a/0189-libtasn1-compile-into-asn1-module.patch +++ b/0165-libtasn1-compile-into-asn1-module.patch @@ -14,10 +14,10 @@ Signed-off-by: Daniel Axtens create mode 100644 grub-core/lib/libtasn1_wrap/wrap.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 97347ae76f9..21d2c541850 100644 +index 64cc758835..ea92468fa2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2576,3 +2576,18 @@ module = { +@@ -2577,3 +2577,18 @@ module = { common = commands/i386/wrmsr.c; enable = x86; }; @@ -38,7 +38,7 @@ index 97347ae76f9..21d2c541850 100644 +}; diff --git a/grub-core/lib/libtasn1_wrap/wrap.c b/grub-core/lib/libtasn1_wrap/wrap.c new file mode 100644 -index 00000000000..622ba942e33 +index 0000000000..622ba942e3 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/wrap.c @@ -0,0 +1,26 @@ diff --git a/0190-test_asn1-test-module-for-libtasn1.patch b/0166-test_asn1-test-module-for-libtasn1.patch similarity index 99% rename from 0190-test_asn1-test-module-for-libtasn1.patch rename to 0166-test_asn1-test-module-for-libtasn1.patch index 3a02b24..6cc13bd 100644 --- a/0190-test_asn1-test-module-for-libtasn1.patch +++ b/0166-test_asn1-test-module-for-libtasn1.patch @@ -51,10 +51,10 @@ Signed-off-by: Daniel Axtens create mode 100644 tests/test_asn1.in diff --git a/Makefile.util.def b/Makefile.util.def -index e1242f54022..8cfbe69a76e 100644 +index 6366442129..d04b3fe68a 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -1305,6 +1305,12 @@ script = { +@@ -1289,6 +1289,12 @@ script = { common = tests/syslinux_test.in; }; @@ -68,10 +68,10 @@ index e1242f54022..8cfbe69a76e 100644 testcase; name = example_unit_test; diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 21d2c541850..b4aaccf7b57 100644 +index ea92468fa2..a32e6ada59 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2591,3 +2591,16 @@ module = { +@@ -2592,3 +2592,16 @@ module = { // -Wno-type-limits comes from libtasn1's configure.ac cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB) -I$(srcdir)/lib/libtasn1/lib -Wno-type-limits'; }; @@ -90,7 +90,7 @@ index 21d2c541850..b4aaccf7b57 100644 +}; diff --git a/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654.c b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654.c new file mode 100644 -index 00000000000..534e304521e +index 0000000000..534e304521 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654.c @@ -0,0 +1,61 @@ @@ -157,7 +157,7 @@ index 00000000000..534e304521e +} diff --git a/grub-core/lib/libtasn1_wrap/tests/Test_overflow.c b/grub-core/lib/libtasn1_wrap/tests/Test_overflow.c new file mode 100644 -index 00000000000..f48aea0ef8b +index 0000000000..f48aea0ef8 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/Test_overflow.c @@ -0,0 +1,138 @@ @@ -301,7 +301,7 @@ index 00000000000..f48aea0ef8b +} diff --git a/grub-core/lib/libtasn1_wrap/tests/Test_simple.c b/grub-core/lib/libtasn1_wrap/tests/Test_simple.c new file mode 100644 -index 00000000000..9f01006ddf4 +index 0000000000..9f01006ddf --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/Test_simple.c @@ -0,0 +1,207 @@ @@ -514,7 +514,7 @@ index 00000000000..9f01006ddf4 +} diff --git a/grub-core/lib/libtasn1_wrap/tests/Test_strings.c b/grub-core/lib/libtasn1_wrap/tests/Test_strings.c new file mode 100644 -index 00000000000..dbe1474b204 +index 0000000000..dbe1474b20 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/Test_strings.c @@ -0,0 +1,150 @@ @@ -670,7 +670,7 @@ index 00000000000..dbe1474b204 +} diff --git a/grub-core/lib/libtasn1_wrap/tests/object-id-decoding.c b/grub-core/lib/libtasn1_wrap/tests/object-id-decoding.c new file mode 100644 -index 00000000000..d367bbfb5a7 +index 0000000000..d367bbfb5a --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/object-id-decoding.c @@ -0,0 +1,116 @@ @@ -792,7 +792,7 @@ index 00000000000..d367bbfb5a7 +} diff --git a/grub-core/lib/libtasn1_wrap/tests/object-id-encoding.c b/grub-core/lib/libtasn1_wrap/tests/object-id-encoding.c new file mode 100644 -index 00000000000..3a83b58c59f +index 0000000000..3a83b58c59 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/object-id-encoding.c @@ -0,0 +1,120 @@ @@ -918,7 +918,7 @@ index 00000000000..3a83b58c59f +} diff --git a/grub-core/lib/libtasn1_wrap/tests/octet-string.c b/grub-core/lib/libtasn1_wrap/tests/octet-string.c new file mode 100644 -index 00000000000..d8a049e8df0 +index 0000000000..d8a049e8df --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/octet-string.c @@ -0,0 +1,211 @@ @@ -1135,7 +1135,7 @@ index 00000000000..d8a049e8df0 +} diff --git a/grub-core/lib/libtasn1_wrap/tests/reproducers.c b/grub-core/lib/libtasn1_wrap/tests/reproducers.c new file mode 100644 -index 00000000000..dc7268d4c6c +index 0000000000..dc7268d4c6 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/reproducers.c @@ -0,0 +1,81 @@ @@ -1222,7 +1222,7 @@ index 00000000000..dc7268d4c6c +} diff --git a/grub-core/lib/libtasn1_wrap/wrap_tests.c b/grub-core/lib/libtasn1_wrap/wrap_tests.c new file mode 100644 -index 00000000000..75fcd21f0d5 +index 0000000000..75fcd21f0d --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/wrap_tests.c @@ -0,0 +1,75 @@ @@ -1303,7 +1303,7 @@ index 00000000000..75fcd21f0d5 +} diff --git a/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-1_asn1_tab.h b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-1_asn1_tab.h new file mode 100644 -index 00000000000..1e7d3d64f55 +index 0000000000..1e7d3d64f5 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-1_asn1_tab.h @@ -0,0 +1,32 @@ @@ -1341,7 +1341,7 @@ index 00000000000..1e7d3d64f55 +}; diff --git a/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-2_asn1_tab.h b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-2_asn1_tab.h new file mode 100644 -index 00000000000..e2561e5ec6d +index 0000000000..e2561e5ec6 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/tests/CVE-2018-1000654-2_asn1_tab.h @@ -0,0 +1,36 @@ @@ -1383,7 +1383,7 @@ index 00000000000..e2561e5ec6d +}; diff --git a/grub-core/lib/libtasn1_wrap/wrap_tests.h b/grub-core/lib/libtasn1_wrap/wrap_tests.h new file mode 100644 -index 00000000000..555e56dd202 +index 0000000000..555e56dd20 --- /dev/null +++ b/grub-core/lib/libtasn1_wrap/wrap_tests.h @@ -0,0 +1,38 @@ @@ -1426,7 +1426,7 @@ index 00000000000..555e56dd202 + +#endif diff --git a/.gitignore b/.gitignore -index 594d0134d33..856e69bc5c1 100644 +index 208d1d2325..1d005887e7 100644 --- a/.gitignore +++ b/.gitignore @@ -264,6 +264,7 @@ widthspec.bin @@ -1439,7 +1439,7 @@ index 594d0134d33..856e69bc5c1 100644 /tests/syslinux/ubuntu10.04_grub.cfg diff --git a/tests/test_asn1.in b/tests/test_asn1.in new file mode 100644 -index 00000000000..8173c5c270e +index 0000000000..8173c5c270 --- /dev/null +++ b/tests/test_asn1.in @@ -0,0 +1,12 @@ diff --git a/0191-grub-install-support-embedding-x509-certificates.patch b/0167-grub-install-support-embedding-x509-certificates.patch similarity index 93% rename from 0191-grub-install-support-embedding-x509-certificates.patch rename to 0167-grub-install-support-embedding-x509-certificates.patch index bd02e6d..c4c35f4 100644 --- a/0191-grub-install-support-embedding-x509-certificates.patch +++ b/0167-grub-install-support-embedding-x509-certificates.patch @@ -12,15 +12,15 @@ Signed-off-by: Alastair D'Silva Signed-off-by: Daniel Axtens --- grub-core/commands/pgp.c | 2 +- - util/grub-install-common.c | 22 +++++++++++++++++++++- + util/grub-install-common.c | 23 ++++++++++++++++++++++- util/grub-mkimage.c | 15 +++++++++++++-- util/mkimage.c | 38 ++++++++++++++++++++++++++++++++++++-- include/grub/kernel.h | 4 +++- include/grub/util/install.h | 7 +++++-- - 6 files changed, 79 insertions(+), 9 deletions(-) + 6 files changed, 80 insertions(+), 9 deletions(-) diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c -index 355a43844ac..b81ac0ae46c 100644 +index 355a43844a..b81ac0ae46 100644 --- a/grub-core/commands/pgp.c +++ b/grub-core/commands/pgp.c @@ -944,7 +944,7 @@ GRUB_MOD_INIT(pgp) @@ -33,7 +33,7 @@ index 355a43844ac..b81ac0ae46c 100644 pseudo_file.fs = &pseudo_fs; diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index aab2a941f85..422f82362c7 100644 +index a74fee16e2..c603f5b308 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -460,6 +460,8 @@ static char **pubkeys; @@ -45,19 +45,20 @@ index aab2a941f85..422f82362c7 100644 static grub_compression_t compression; static size_t appsig_size; -@@ -500,6 +502,11 @@ grub_install_parse (int key, char *arg) - return 1; +@@ -501,6 +503,12 @@ grub_install_parse (int key, char *arg) case GRUB_INSTALL_OPTIONS_DISABLE_SHIM_LOCK: disable_shim_lock = 1; + return 1; + case 'x': + x509keys = xrealloc (x509keys, + sizeof (x509keys[0]) + * (nx509keys + 1)); + x509keys[nx509keys++] = xstrdup (arg); - return 1; ++ return 1; case GRUB_INSTALL_OPTIONS_VERBOSITY: -@@ -627,6 +634,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + verbosity++; +@@ -627,6 +635,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, for (pk = pubkeys; pk < pubkeys + npubkeys; pk++) slen += 20 + grub_strlen (*pk); @@ -67,7 +68,7 @@ index aab2a941f85..422f82362c7 100644 for (md = modules.entries; *md; md++) { slen += 10 + grub_strlen (*md); -@@ -655,6 +665,14 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -655,6 +666,14 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, *p++ = ' '; } @@ -82,7 +83,7 @@ index aab2a941f85..422f82362c7 100644 for (md = modules.entries; *md; md++) { *p++ = '\''; -@@ -688,7 +706,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -684,7 +703,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, grub_install_generate_image (dir, prefix, fp, outname, modules.entries, memdisk_path, @@ -94,7 +95,7 @@ index aab2a941f85..422f82362c7 100644 disable_shim_lock); while (dc--) diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c -index 8a53310548b..e1f1112784a 100644 +index 8a53310548..e1f1112784 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -75,7 +75,8 @@ static struct argp_option options[] = { @@ -141,7 +142,7 @@ index 8a53310548b..e1f1112784a 100644 arguments.appsig_size, arguments.comp, arguments.dtb, arguments.sbat, diff --git a/util/mkimage.c b/util/mkimage.c -index bab12276010..8319e8dfbde 100644 +index bab1227601..8319e8dfbd 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -867,7 +867,8 @@ void @@ -211,7 +212,7 @@ index bab12276010..8319e8dfbde 100644 { struct grub_module_header *header; diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index 55849777eaa..98edc0863f6 100644 +index 55849777ea..98edc0863f 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -30,7 +30,9 @@ enum @@ -226,7 +227,7 @@ index 55849777eaa..98edc0863f6 100644 /* The module header. */ diff --git a/include/grub/util/install.h b/include/grub/util/install.h -index cf4531e02b6..51f3b13ac13 100644 +index cf4531e02b..51f3b13ac1 100644 --- a/include/grub/util/install.h +++ b/include/grub/util/install.h @@ -67,6 +67,8 @@ diff --git a/0192-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch b/0168-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch similarity index 99% rename from 0192-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch rename to 0168-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch index 7b7d70c..0ebc6c7 100644 --- a/0192-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch +++ b/0168-appended-signatures-import-GNUTLS-s-ASN.1-descriptio.patch @@ -22,7 +22,7 @@ Signed-off-by: Daniel Axtens diff --git a/grub-core/commands/appendedsig/gnutls_asn1_tab.c b/grub-core/commands/appendedsig/gnutls_asn1_tab.c new file mode 100644 -index 00000000000..ddd1314e63b +index 0000000000..ddd1314e63 --- /dev/null +++ b/grub-core/commands/appendedsig/gnutls_asn1_tab.c @@ -0,0 +1,121 @@ @@ -149,7 +149,7 @@ index 00000000000..ddd1314e63b +}; diff --git a/grub-core/commands/appendedsig/pkix_asn1_tab.c b/grub-core/commands/appendedsig/pkix_asn1_tab.c new file mode 100644 -index 00000000000..adef69d95ce +index 0000000000..adef69d95c --- /dev/null +++ b/grub-core/commands/appendedsig/pkix_asn1_tab.c @@ -0,0 +1,484 @@ diff --git a/0193-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch b/0169-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch similarity index 99% rename from 0193-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch rename to 0169-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch index 04bf1df..5a13d5b 100644 --- a/0193-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch +++ b/0169-appended-signatures-parse-PKCS-7-signedData-and-X.50.patch @@ -29,7 +29,7 @@ Signed-off-by: Daniel Axtens diff --git a/grub-core/commands/appendedsig/asn1util.c b/grub-core/commands/appendedsig/asn1util.c new file mode 100644 -index 00000000000..eff095a9df2 +index 0000000000..eff095a9df --- /dev/null +++ b/grub-core/commands/appendedsig/asn1util.c @@ -0,0 +1,102 @@ @@ -137,7 +137,7 @@ index 00000000000..eff095a9df2 +} diff --git a/grub-core/commands/appendedsig/pkcs7.c b/grub-core/commands/appendedsig/pkcs7.c new file mode 100644 -index 00000000000..dc6afe203f7 +index 0000000000..dc6afe203f --- /dev/null +++ b/grub-core/commands/appendedsig/pkcs7.c @@ -0,0 +1,305 @@ @@ -448,7 +448,7 @@ index 00000000000..dc6afe203f7 +} diff --git a/grub-core/commands/appendedsig/x509.c b/grub-core/commands/appendedsig/x509.c new file mode 100644 -index 00000000000..2b38b3670a2 +index 0000000000..2b38b3670a --- /dev/null +++ b/grub-core/commands/appendedsig/x509.c @@ -0,0 +1,958 @@ @@ -1412,7 +1412,7 @@ index 00000000000..2b38b3670a2 +} diff --git a/grub-core/commands/appendedsig/appendedsig.h b/grub-core/commands/appendedsig/appendedsig.h new file mode 100644 -index 00000000000..9792ef3901e +index 0000000000..9792ef3901 --- /dev/null +++ b/grub-core/commands/appendedsig/appendedsig.h @@ -0,0 +1,110 @@ diff --git a/0194-appended-signatures-support-verifying-appended-signa.patch b/0170-appended-signatures-support-verifying-appended-signa.patch similarity index 98% rename from 0194-appended-signatures-support-verifying-appended-signa.patch rename to 0170-appended-signatures-support-verifying-appended-signa.patch index 262efc0..9e90d3b 100644 --- a/0194-appended-signatures-support-verifying-appended-signa.patch +++ b/0170-appended-signatures-support-verifying-appended-signa.patch @@ -20,6 +20,8 @@ other mechanisms, such as a password or lockdown, must be used to ensure that a user cannot drop to the grub shell and disable verification. Signed-off-by: Daniel Axtens +[pjones: fix missing format specifier] +Signed-off-by: Robbie Harwood --- grub-core/Makefile.core.def | 12 + grub-core/commands/appendedsig/appendedsig.c | 645 +++++++++++++++++++++++++++ @@ -28,7 +30,7 @@ Signed-off-by: Daniel Axtens create mode 100644 grub-core/commands/appendedsig/appendedsig.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index b4aaccf7b57..77321d218c8 100644 +index a32e6ada59..6404384d90 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -980,6 +980,18 @@ module = { @@ -52,7 +54,7 @@ index b4aaccf7b57..77321d218c8 100644 common = commands/hdparm.c; diff --git a/grub-core/commands/appendedsig/appendedsig.c b/grub-core/commands/appendedsig/appendedsig.c new file mode 100644 -index 00000000000..dc294cd339e +index 0000000000..bf8b18b620 --- /dev/null +++ b/grub-core/commands/appendedsig/appendedsig.c @@ -0,0 +1,645 @@ @@ -387,7 +389,7 @@ index 00000000000..dc294cd339e + data = grub_malloc (file_size); + if (!data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, -+ N_("Could not allocate data buffer size " ++ N_("Could not allocate data buffer size %" + PRIuGRUB_UINT64_T " for verification"), file_size); + + while (total_read_size < file_size) @@ -702,7 +704,7 @@ index 00000000000..dc294cd339e + grub_unregister_command (cmd_distrust); +} diff --git a/include/grub/file.h b/include/grub/file.h -index 31567483ccf..96827a4f896 100644 +index 31567483cc..96827a4f89 100644 --- a/include/grub/file.h +++ b/include/grub/file.h @@ -80,6 +80,8 @@ enum grub_file_type diff --git a/0195-appended-signatures-verification-tests.patch b/0171-appended-signatures-verification-tests.patch similarity index 99% rename from 0195-appended-signatures-verification-tests.patch rename to 0171-appended-signatures-verification-tests.patch index 9f6c3c6..b39a5af 100644 --- a/0195-appended-signatures-verification-tests.patch +++ b/0171-appended-signatures-verification-tests.patch @@ -17,10 +17,10 @@ Signed-off-by: Daniel Axtens create mode 100644 grub-core/tests/appended_signatures.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 77321d218c8..6bddc841b85 100644 +index 6404384d90..9ea5fb38f1 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2161,6 +2161,12 @@ module = { +@@ -2162,6 +2162,12 @@ module = { common = tests/setjmp_test.c; }; @@ -35,7 +35,7 @@ index 77321d218c8..6bddc841b85 100644 common = tests/signature_test.c; diff --git a/grub-core/tests/appended_signature_test.c b/grub-core/tests/appended_signature_test.c new file mode 100644 -index 00000000000..88a485200d8 +index 0000000000..88a485200d --- /dev/null +++ b/grub-core/tests/appended_signature_test.c @@ -0,0 +1,281 @@ @@ -321,7 +321,7 @@ index 00000000000..88a485200d8 + +GRUB_FUNCTIONAL_TEST (appended_signature_test, appended_signature_test); diff --git a/grub-core/tests/lib/functional_test.c b/grub-core/tests/lib/functional_test.c -index 96781fb39b5..403fa5c789a 100644 +index 96781fb39b..403fa5c789 100644 --- a/grub-core/tests/lib/functional_test.c +++ b/grub-core/tests/lib/functional_test.c @@ -73,6 +73,7 @@ grub_functional_all_tests (grub_extcmd_context_t ctxt __attribute__ ((unused)), @@ -334,7 +334,7 @@ index 96781fb39b5..403fa5c789a 100644 grub_dl_load ("ctz_test"); diff --git a/grub-core/tests/appended_signatures.h b/grub-core/tests/appended_signatures.h new file mode 100644 -index 00000000000..aa3dc6278e3 +index 0000000000..aa3dc6278e --- /dev/null +++ b/grub-core/tests/appended_signatures.h @@ -0,0 +1,557 @@ diff --git a/0196-appended-signatures-documentation.patch b/0172-appended-signatures-documentation.patch similarity index 99% rename from 0196-appended-signatures-documentation.patch rename to 0172-appended-signatures-documentation.patch index 864cfa3..eb58046 100644 --- a/0196-appended-signatures-documentation.patch +++ b/0172-appended-signatures-documentation.patch @@ -13,7 +13,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 182 insertions(+), 17 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index afbde7c1f7b..4816be85611 100644 +index afbde7c1f7..4816be8561 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -3214,6 +3214,7 @@ These variables have special meaning to GRUB. diff --git a/0197-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch b/0173-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch similarity index 95% rename from 0197-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch rename to 0173-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch index 40c3b3e..c90cc7e 100644 --- a/0197-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch +++ b/0173-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Axtens 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6bddc841b85..3f3459b2c70 100644 +index 9ea5fb38f1..4a57de975e 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -323,6 +323,7 @@ kernel = { @@ -27,7 +27,7 @@ index 6bddc841b85..3f3459b2c70 100644 sparc64_ieee1275 = kern/sparc64/cache.S; sparc64_ieee1275 = kern/sparc64/dl.c; diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 937c1bc44cb..fc7d9712729 100644 +index 937c1bc44c..fc7d971272 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -44,6 +44,7 @@ @@ -79,7 +79,7 @@ index 937c1bc44cb..fc7d9712729 100644 void diff --git a/include/grub/lockdown.h b/include/grub/lockdown.h -index 40531fa823b..ebfee4bf06e 100644 +index 40531fa823..ebfee4bf06 100644 --- a/include/grub/lockdown.h +++ b/include/grub/lockdown.h @@ -24,7 +24,8 @@ @@ -93,7 +93,7 @@ index 40531fa823b..ebfee4bf06e 100644 EXPORT_FUNC (grub_lockdown) (void); extern int diff --git a/docs/grub.texi b/docs/grub.texi -index 4816be85611..a4da9c2a1b9 100644 +index 4816be8561..a4da9c2a1b 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -6227,8 +6227,8 @@ Measured boot is currently only supported on EFI platforms. diff --git a/0198-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch b/0174-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch similarity index 98% rename from 0198-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch rename to 0174-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch index 52fa9d2..a40caea 100644 --- a/0198-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch +++ b/0174-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch @@ -32,7 +32,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 17 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index fc7d9712729..0dcd114ce54 100644 +index fc7d971272..0dcd114ce5 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -46,9 +46,6 @@ diff --git a/0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch b/0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch similarity index 100% rename from 0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch rename to 0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch diff --git a/0200-ieee1275-ofdisk-retry-on-open-failure.patch b/0176-ieee1275-ofdisk-retry-on-open-failure.patch similarity index 100% rename from 0200-ieee1275-ofdisk-retry-on-open-failure.patch rename to 0176-ieee1275-ofdisk-retry-on-open-failure.patch diff --git a/0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch b/0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch similarity index 97% rename from 0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch rename to 0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch index f485054..c3101e1 100644 --- a/0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch +++ b/0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch @@ -3,6 +3,8 @@ From: Dimitri John Ledkov Date: Fri, 11 Jun 2021 13:51:20 +0200 Subject: [PATCH] Allow chainloading EFI apps from loop mounts. +Signed-off-by: Dimitri John Ledkov +Signed-off-by: Robbie Harwood --- grub-core/disk/loopback.c | 9 +-------- grub-core/loader/efi/chainloader.c | 23 +++++++++++++++++++++++ diff --git a/0205-efinet-Add-DHCP-proxy-support.patch b/0178-efinet-Add-DHCP-proxy-support.patch similarity index 95% rename from 0205-efinet-Add-DHCP-proxy-support.patch rename to 0178-efinet-Add-DHCP-proxy-support.patch index 25065ad..eed2dbb 100644 --- a/0205-efinet-Add-DHCP-proxy-support.patch +++ b/0178-efinet-Add-DHCP-proxy-support.patch @@ -6,6 +6,9 @@ Subject: [PATCH] efinet: Add DHCP proxy support If a proxyDHCP configuration is used, the server name, server IP and boot file values should be taken from the DHCP proxy offer instead of the DHCP server ack packet. Currently that case is not handled, add support for it. + +Signed-off-by: Ian Page Hands +Signed-off-by: Robbie Harwood --- grub-core/net/drivers/efi/efinet.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch b/0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch similarity index 100% rename from 0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch rename to 0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch diff --git a/0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch b/0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch similarity index 92% rename from 0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch rename to 0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch index 8025271..b2783d1 100644 --- a/0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch +++ b/0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch @@ -20,10 +20,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 68adb55d89..c9296154f5 100644 +index e490e1a43a..865af3d6c4 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -261,7 +261,9 @@ if [ -z "\${kernelopts}" ]; then +@@ -256,7 +256,9 @@ if [ -z "\${kernelopts}" ]; then fi EOF diff --git a/0208-Suppress-gettext-error-message.patch b/0181-Suppress-gettext-error-message.patch similarity index 96% rename from 0208-Suppress-gettext-error-message.patch rename to 0181-Suppress-gettext-error-message.patch index dd87a98..64b219a 100644 --- a/0208-Suppress-gettext-error-message.patch +++ b/0181-Suppress-gettext-error-message.patch @@ -14,7 +14,7 @@ Signed-off-by: Paulo Flabiano Smorigo 1 file changed, 7 insertions(+) diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c -index 84d520cd49..87a912ac6e 100644 +index 4d02e62c10..7ec81ca0b4 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -424,6 +424,13 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx, diff --git a/0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch b/0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch similarity index 100% rename from 0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch rename to 0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch diff --git a/0212-templates-Check-for-EFI-at-runtime-instead-of-config.patch b/0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch similarity index 100% rename from 0212-templates-Check-for-EFI-at-runtime-instead-of-config.patch rename to 0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch diff --git a/0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch b/0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch similarity index 100% rename from 0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch rename to 0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch diff --git a/0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch b/0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch similarity index 82% rename from 0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch rename to 0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch index ce77c63..cc5458c 100644 --- a/0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch +++ b/0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch @@ -14,12 +14,17 @@ actual size it needs, including BSS, and make sure we clear it, and honors the specified alignment for the image. Signed-off-by: Benjamin Herrenschmidt +[pjones: arm: check for the PE magic for the compiled arch] +Signed-off-by: Peter Jones +Signed-off-by: Robbie Harwood --- grub-core/loader/arm64/linux.c | 100 +++++++++++++++++++++++++++-------------- - 1 file changed, 66 insertions(+), 34 deletions(-) + include/grub/arm/linux.h | 1 + + include/grub/arm64/linux.h | 1 + + 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 47f8cf0d84..4a252d5e7e 100644 +index 47f8cf0d84..f18d90bd74 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -41,6 +41,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -57,7 +62,7 @@ index 47f8cf0d84..4a252d5e7e 100644 + + pe = (void *)((unsigned long)kernel + lh->hdr_offset); + -+ if (pe->opt.magic != GRUB_PE32_PE64_MAGIC) ++ if (pe->opt.magic != GRUB_PE32_PEXX_MAGIC) + return grub_error(GRUB_ERR_BAD_OS, "Invalid PE optional header magic"); + + *total_size = pe->opt.image_size; @@ -187,3 +192,27 @@ index 47f8cf0d84..4a252d5e7e 100644 return grub_errno; } +diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h +index b582f67f66..966a5074f5 100644 +--- a/include/grub/arm/linux.h ++++ b/include/grub/arm/linux.h +@@ -44,6 +44,7 @@ struct grub_arm_linux_pe_header + + #if defined(__arm__) + # define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE ++# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE32_MAGIC + # define linux_arch_kernel_header linux_arm_kernel_header + # define grub_armxx_linux_pe_header grub_arm_linux_pe_header + #endif +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index ea030312df..422bf2bf24 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -48,6 +48,7 @@ struct grub_arm64_linux_pe_header + + #if defined(__aarch64__) + # define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE ++# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE64_MAGIC + # define linux_arch_kernel_header linux_arm64_kernel_header + # define grub_armxx_linux_pe_header grub_arm64_linux_pe_header + #endif diff --git a/0215-normal-main-Discover-the-device-to-read-the-config-f.patch b/0186-normal-main-Discover-the-device-to-read-the-config-f.patch similarity index 92% rename from 0215-normal-main-Discover-the-device-to-read-the-config-f.patch rename to 0186-normal-main-Discover-the-device-to-read-the-config-f.patch index 0f0c66c..2c9ca3a 100644 --- a/0215-normal-main-Discover-the-device-to-read-the-config-f.patch +++ b/0186-normal-main-Discover-the-device-to-read-the-config-f.patch @@ -26,10 +26,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 155bf366da..f9ccca502e 100644 +index 7de9e4c36d..8f5fd81003 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -339,18 +339,13 @@ grub_enter_normal_mode (const char *config) +@@ -337,18 +337,13 @@ grub_enter_normal_mode (const char *config) } static grub_err_t @@ -49,7 +49,7 @@ index 155bf366da..f9ccca502e 100644 net_search_cfg = grub_env_get ("feature_net_search_cfg"); if (net_search_cfg && net_search_cfg[0] == 'n') disable_net_search = 1; -@@ -364,7 +359,7 @@ grub_try_normal (const char *variable) +@@ -362,7 +357,7 @@ grub_try_normal (const char *variable) config = grub_malloc (config_len); if (! config) @@ -58,7 +58,7 @@ index 155bf366da..f9ccca502e 100644 grub_snprintf (config, config_len, "%s/grub.cfg", prefix); err = grub_net_search_config_file (config); -@@ -393,6 +388,53 @@ grub_try_normal (const char *variable) +@@ -391,6 +386,53 @@ grub_try_normal (const char *variable) return err; } @@ -112,7 +112,7 @@ index 155bf366da..f9ccca502e 100644 /* Enter normal mode from rescue mode. */ static grub_err_t grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), -@@ -407,6 +449,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +@@ -405,6 +447,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), err = grub_try_normal ("fw_path"); if (err == GRUB_ERR_FILE_NOT_FOUND) err = grub_try_normal ("prefix"); diff --git a/0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch b/0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch similarity index 71% rename from 0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch rename to 0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch index fe28e32..b9bc140 100644 --- a/0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch +++ b/0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch @@ -18,15 +18,17 @@ preserve a prefix of /path instead and hope the search later finds us. Related: rhbz#1899864 Signed-off-by: Daniel Axtens +[rharwood@redhat.com: squash in fixup commit] +Signed-off-by: Robbie Harwood --- - grub-core/kern/main.c | 38 +++++++++++++++++++++++++++++++++----- - 1 file changed, 33 insertions(+), 5 deletions(-) + grub-core/kern/main.c | 49 ++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 0285e95a2b..e809a5edec 100644 +index b573be6650..3fc3401472 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c -@@ -216,13 +216,41 @@ grub_set_prefix_and_root (void) +@@ -216,13 +216,52 @@ grub_set_prefix_and_root (void) if (device) { char *prefix_set; @@ -53,9 +55,20 @@ index 0285e95a2b..e809a5edec 100644 + which will have now been extended to device=$fwdisk,partition + and path=/path + -+ So we only need to act if device = ieee1275/disk exactly. ++ - PowerVM will give us device names like ++ ieee1275//vdevice/v-scsi@3000006c/disk@8100000000000000 ++ and we don't want to try to encode some sort of truth table about ++ what sorts of paths represent disks with partition tables and those ++ without partition tables. ++ ++ So we act unless there is a comma in the device, which would indicate ++ a partition has already been specified. ++ ++ (If we only have a path, the code in normal to discover config files ++ will try both without partitions and then with any partitions so we ++ will cover both CDs and HDs.) + */ -+ if (grub_strncmp (device, "ieee1275/disk", 14) == 0) ++ if (grub_strchr (device, ',') == NULL) + grub_env_set ("prefix", path); + else +#endif diff --git a/0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch b/0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch similarity index 100% rename from 0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch rename to 0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch diff --git a/0220-Print-module-name-on-license-check-failure.patch b/0189-Print-module-name-on-license-check-failure.patch similarity index 100% rename from 0220-Print-module-name-on-license-check-failure.patch rename to 0189-Print-module-name-on-license-check-failure.patch diff --git a/0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch b/0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch similarity index 99% rename from 0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch rename to 0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch index 05417ed..216418b 100644 --- a/0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch +++ b/0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch @@ -79,7 +79,7 @@ Signed-off-by: Robbie Harwood 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 3f3459b2c7..6b00eb5557 100644 +index 4a57de975e..08ac0fb15f 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -89,7 +89,7 @@ kernel = { diff --git a/0222-grub-mkconfig-restore-umask-for-grub.cfg.patch b/0191-grub-mkconfig-restore-umask-for-grub.cfg.patch similarity index 95% rename from 0222-grub-mkconfig-restore-umask-for-grub.cfg.patch rename to 0191-grub-mkconfig-restore-umask-for-grub.cfg.patch index f275ed4..76b73f5 100644 --- a/0222-grub-mkconfig-restore-umask-for-grub.cfg.patch +++ b/0191-grub-mkconfig-restore-umask-for-grub.cfg.patch @@ -20,7 +20,6 @@ to 0600 preventing unprivileged access. Fixes: CVE-2021-3981 Signed-off-by: Michael Chang -(cherry picked from commit 2acad06610da1488bfa387f56a847119ab758766) --- util/grub-mkconfig.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch b/0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch new file mode 100644 index 0000000..3f7198f --- /dev/null +++ b/0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch @@ -0,0 +1,160 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Mon, 13 Dec 2021 14:25:49 +0800 +Subject: [PATCH] fs/btrfs: Use full btrfs bootloader area + +Up to now GRUB can only embed to the first 64 KiB before primary +superblock of btrfs, effectively limiting the GRUB core size. That +could consequently pose restrictions to feature enablement like +advanced zstd compression. + +This patch attempts to utilize full unused area reserved by btrfs for +the bootloader outlined in the document [1]: + + The first 1MiB on each device is unused with the exception of primary + superblock that is on the offset 64KiB and spans 4KiB. + +Apart from that, adjacent sectors to superblock and first block group +are not used for embedding in case of overflow and logged access to +adjacent sectors could be useful for tracing it up. + +This patch has been tested to provide out of the box support for btrfs +zstd compression with which GRUB has been installed to the partition. + +[1] https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5)#BOOTLOADER_SUPPORT + +Signed-off-by: Michael Chang +Reviewed-by: Daniel Kiper +(cherry picked from commit b0f06a81c6f31b6fa20be67a96b6683bba8210c9) +--- + grub-core/fs/btrfs.c | 90 ++++++++++++++++++++++++++++++++++++++++++++-------- + include/grub/disk.h | 2 ++ + 2 files changed, 79 insertions(+), 13 deletions(-) + +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 4cc86e9b79..07c0ff874b 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -2476,6 +2476,33 @@ grub_btrfs_label (grub_device_t device, char **label) + } + + #ifdef GRUB_UTIL ++ ++struct embed_region { ++ unsigned int start; ++ unsigned int secs; ++}; ++ ++/* ++ * https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5)#BOOTLOADER_SUPPORT ++ * The first 1 MiB on each device is unused with the exception of primary ++ * superblock that is on the offset 64 KiB and spans 4 KiB. ++ */ ++ ++static const struct { ++ struct embed_region available; ++ struct embed_region used[6]; ++} btrfs_head = { ++ .available = {0, GRUB_DISK_KiB_TO_SECTORS (1024)}, /* The first 1 MiB. */ ++ .used = { ++ {0, 1}, /* boot.S. */ ++ {GRUB_DISK_KiB_TO_SECTORS (64) - 1, 1}, /* Overflow guard. */ ++ {GRUB_DISK_KiB_TO_SECTORS (64), GRUB_DISK_KiB_TO_SECTORS (4)}, /* 4 KiB superblock. */ ++ {GRUB_DISK_KiB_TO_SECTORS (68), 1}, /* Overflow guard. */ ++ {GRUB_DISK_KiB_TO_SECTORS (1024) - 1, 1}, /* Overflow guard. */ ++ {0, 0} /* Array terminator. */ ++ } ++}; ++ + static grub_err_t + grub_btrfs_embed (grub_device_t device __attribute__ ((unused)), + unsigned int *nsectors, +@@ -2483,25 +2510,62 @@ grub_btrfs_embed (grub_device_t device __attribute__ ((unused)), + grub_embed_type_t embed_type, + grub_disk_addr_t **sectors) + { +- unsigned i; ++ unsigned int i, j, n = 0; ++ const struct embed_region *u; ++ grub_disk_addr_t *map; + + if (embed_type != GRUB_EMBED_PCBIOS) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "BtrFS currently supports only PC-BIOS embedding"); + +- if (64 * 2 - 1 < *nsectors) +- return grub_error (GRUB_ERR_OUT_OF_RANGE, +- N_("your core.img is unusually large. " +- "It won't fit in the embedding area")); +- +- *nsectors = 64 * 2 - 1; +- if (*nsectors > max_nsectors) +- *nsectors = max_nsectors; +- *sectors = grub_calloc (*nsectors, sizeof (**sectors)); +- if (!*sectors) ++ map = grub_calloc (btrfs_head.available.secs, sizeof (*map)); ++ if (map == NULL) + return grub_errno; +- for (i = 0; i < *nsectors; i++) +- (*sectors)[i] = i + 1; ++ ++ /* ++ * Populating the map array so that it can be used to index if a disk ++ * address is available to embed: ++ * - 0: available, ++ * - 1: unavailable. ++ */ ++ for (u = btrfs_head.used; u->secs; ++u) ++ { ++ unsigned int end = u->start + u->secs; ++ ++ if (end > btrfs_head.available.secs) ++ end = btrfs_head.available.secs; ++ for (i = u->start; i < end; ++i) ++ map[i] = 1; ++ } ++ ++ /* Adding up n until it matches total size of available embedding area. */ ++ for (i = 0; i < btrfs_head.available.secs; ++i) ++ if (map[i] == 0) ++ n++; ++ ++ if (n < *nsectors) ++ { ++ grub_free (map); ++ return grub_error (GRUB_ERR_OUT_OF_RANGE, ++ N_("your core.img is unusually large. " ++ "It won't fit in the embedding area")); ++ } ++ ++ if (n > max_nsectors) ++ n = max_nsectors; ++ ++ /* ++ * Populating the array so that it can used to index disk block address for ++ * an image file's offset to be embedded on disk (the unit is in sectors): ++ * - i: The disk block address relative to btrfs_head.available.start, ++ * - j: The offset in image file. ++ */ ++ for (i = 0, j = 0; i < btrfs_head.available.secs && j < n; ++i) ++ if (map[i] == 0) ++ map[j++] = btrfs_head.available.start + i; ++ ++ *nsectors = n; ++ *sectors = map; + + return GRUB_ERR_NONE; + } +diff --git a/include/grub/disk.h b/include/grub/disk.h +index f95aca929a..06210a7049 100644 +--- a/include/grub/disk.h ++++ b/include/grub/disk.h +@@ -182,6 +182,8 @@ typedef struct grub_disk_memberlist *grub_disk_memberlist_t; + /* Return value of grub_disk_native_sectors() in case disk size is unknown. */ + #define GRUB_DISK_SIZE_UNKNOWN 0xffffffffffffffffULL + ++#define GRUB_DISK_KiB_TO_SECTORS(x) ((x) << (10 - GRUB_DISK_SECTOR_BITS)) ++ + /* Convert sector number from one sector size to another. */ + static inline grub_disk_addr_t + grub_convert_sector (grub_disk_addr_t sector, diff --git a/0193-Add-Fedora-location-of-DejaVu-SANS-font.patch b/0193-Add-Fedora-location-of-DejaVu-SANS-font.patch new file mode 100644 index 0000000..070fc24 --- /dev/null +++ b/0193-Add-Fedora-location-of-DejaVu-SANS-font.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fluteze +Date: Sat, 27 Nov 2021 10:54:44 -0600 +Subject: [PATCH] Add Fedora location of DejaVu SANS font + +In Fedora 35, and possibly earlier, grub would fail to configure with a +complaint about DejaVu being "not found" even though it was installed. +The DejaVu sans font search path is updated to reflect the +distribution's current install path. + +Signed-off-by: Erik Edwards +[rharwood@redhat.com: slight commit message edits] +Signed-off-by: Robbie Harwood +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index ab0d326f00..40c4338bce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1784,7 +1784,7 @@ fi + + if test x"$starfield_excuse" = x; then + for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do +- for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu /usr/share/fonts/truetype; do ++ for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu /usr/share/fonts/truetype /usr/share/fonts/dejavu-sans-fonts; do + if test -f "$dir/DejaVuSans.$ext"; then + DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" + break 2 diff --git a/0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch b/0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch new file mode 100644 index 0000000..200cd51 --- /dev/null +++ b/0194-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 ec0c92bade..c8516a5a08 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/0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch b/0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch new file mode 100644 index 0000000..0f99c22 --- /dev/null +++ b/0195-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 3fc3401472..993b8a8598 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/0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch b/0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch new file mode 100644 index 0000000..ade6aae --- /dev/null +++ b/0196-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 2f1ae85ba7..c44b2ac318 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/0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch b/0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch new file mode 100644 index 0000000..5fab5db --- /dev/null +++ b/0197-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 c44b2ac318..a3622e4fe5 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/0198-Use-visual-indentation-in-config.h.in.patch b/0198-Use-visual-indentation-in-config.h.in.patch new file mode 100644 index 0000000..978eb07 --- /dev/null +++ b/0198-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 c80e3e0aba..f2ed0066ec 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/0199-Where-present-ensure-config-util.h-precedes-config.h.patch b/0199-Where-present-ensure-config-util.h-precedes-config.h.patch new file mode 100644 index 0000000..22c2d9c --- /dev/null +++ b/0199-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 c151d225df..f34529f86a 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 1668858703..8cb4608c3d 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 55ea5a11cc..12277c34d2 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 c82d0ea8e7..55f5728efc 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 6362e5cfbb..dbfd316d61 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 c54c710dbc..b104c7e162 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 4e123c0903..927a1ebc94 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 19b188f09e..d5a6417355 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 46a881530c..0ce0e309ac 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 cff359a3b9..fb6ff55a1a 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 562b101a28..99b189bc1c 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 7308798efe..cac159424d 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 46d7116c6e..4f436284ce 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 928ab1a49b..2bb8a2fd88 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 3568aa2d35..5d06d79dd5 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 eec6a24ad7..8eab7057e4 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 4fb3693cc0..17a44de469 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 6297de6326..51a9647dde 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/0200-Drop-gnulib-fix-base64.patch.patch b/0200-Drop-gnulib-fix-base64.patch.patch new file mode 100644 index 0000000..054e476 --- /dev/null +++ b/0200-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 f63412c8da..2f3e865495 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 f7b32d8003..d1417039aa 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 52d4af44be..645e3a459c 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 ad235de7fc..f4791dc6ca 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -31,7 +31,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 f2ed0066ec..9c7b4afaaa 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 985db12797..0000000000 +--- 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/0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch b/0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch deleted file mode 100644 index d1b3f2e..0000000 --- a/0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= -Date: Fri, 11 Jun 2021 12:57:56 +0200 -Subject: [PATCH] 01_menu_auto_hide.in: fix a then/than typo -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Jan Pokorný ---- - util/grub.d/10_reset_boot_success.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub.d/10_reset_boot_success.in b/util/grub.d/10_reset_boot_success.in -index 737e1ae5b6..e73f4137b3 100644 ---- a/util/grub.d/10_reset_boot_success.in -+++ b/util/grub.d/10_reset_boot_success.in -@@ -15,7 +15,7 @@ fi - # Reset boot_indeterminate after a successful boot - if [ "\${boot_success}" = "1" ] ; then - set boot_indeterminate=0 --# Avoid boot_indeterminate causing the menu to be hidden more then once -+# Avoid boot_indeterminate causing the menu to be hidden more than once - elif [ "\${boot_indeterminate}" = "1" ]; then - set boot_indeterminate=2 - fi diff --git a/0201-Drop-gnulib-no-abort.patch.patch b/0201-Drop-gnulib-no-abort.patch.patch new file mode 100644 index 0000000..a12789f --- /dev/null +++ b/0201-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 645e3a459c..71ce943c7d 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 f4791dc6ca..5eef708338 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -38,7 +38,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 9c7b4afaaa..c3134309c6 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 e469c4762e..0000000000 +--- 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/0202-Fix-disabling-grub-rpm-sort.patch b/0202-Fix-disabling-grub-rpm-sort.patch deleted file mode 100644 index dd1bec0..0000000 --- a/0202-Fix-disabling-grub-rpm-sort.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Tim Landscheidt -Date: Fri, 11 Jun 2021 13:02:37 +0200 -Subject: [PATCH] Fix disabling grub-rpm-sort - -Currently, grub-rpm-sort is unconditionally compiled whether -./configure has been called with --disable-rpm-sort or not. This adds -the necessary logic to configure.ac and Makefile.util.def and some -debug output to ./configure and fixes #44. ---- - configure.ac | 8 ++++++++ - Makefile.util.def | 1 + - 2 files changed, 9 insertions(+) - -diff --git a/configure.ac b/configure.ac -index d5d2a28b4e..c7842ec29d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1936,6 +1936,8 @@ AC_ARG_ENABLE([rpm-sort], - [enable native rpm sorting of kernels in grub (default=guessed)])]) - if test x"$enable_rpm_sort" = xno ; then - rpm_sort_excuse="explicitly disabled" -+else -+ enable_rpm_sort=yes - fi - - if test x"$rpm_sort_excuse" = x ; then -@@ -2200,6 +2202,7 @@ AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) - AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) - AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) - AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes]) -+AM_CONDITIONAL([COND_GRUB_RPM_SORT], [test x$enable_rpm_sort = xyes]) - AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) - if test x$FONT_SOURCE != x ; then - HAVE_FONT_SOURCE=1 -@@ -2328,6 +2331,11 @@ echo grub-mount: Yes - else - echo grub-mount: No "($grub_mount_excuse)" - fi -+if [ x"$rpm_sort_excuse" = x ]; then -+echo grub-rpm-sort: Yes -+else -+echo grub-rpm-sort: No "($rpm_sort_excuse)" -+fi - if [ x"$starfield_excuse" = x ]; then - echo starfield theme: Yes - echo With DejaVuSans font from $DJVU_FONT_SOURCE -diff --git a/Makefile.util.def b/Makefile.util.def -index 8cfbe69a76..3f191aa809 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -774,6 +774,7 @@ program = { - ldadd = libgrubkern.a; - ldadd = grub-core/lib/gnulib/libgnu.a; - ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; -+ condition = COND_GRUB_RPM_SORT; - }; - - script = { diff --git a/0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch b/0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch new file mode 100644 index 0000000..c2c50f1 --- /dev/null +++ b/0202-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 40c4338bce..79f45ef1e1 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 08ac0fb15f..ec1ec5083b 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 371a53b837..c917a5f91e 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 591dbf3289..4be7b40806 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 ebafec6895..441a9eca07 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 b13acb9624..21f4b4b44a 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 79a0af7d93..ee9f536f76 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 5b08e7e2d4..dc2238f4ad 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 71ce943c7d..e4e5f3750a 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 5eef708338..26ac8765e3 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -31,12 +31,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 c3134309c6..512d1bbe13 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 8fafa153a4..0000000000 +--- 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 813ec09c8a..0000000000 +--- 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 02e06315df..0000000000 +--- 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 db6dac9c9e..0000000000 +--- 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 7b4d9f67af..0000000000 +--- 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 ba51f1bf22..0000000000 +--- 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/0203-Don-t-check-for-rpmvercmp-in-librpm.patch b/0203-Don-t-check-for-rpmvercmp-in-librpm.patch deleted file mode 100644 index 4cf5325..0000000 --- a/0203-Don-t-check-for-rpmvercmp-in-librpm.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Fri, 11 Jun 2021 13:13:27 +0200 -Subject: [PATCH] Don't check for rpmvercmp in librpm - -The rpmvercmp() function was moved from librpm to librpmio. The configure -option had some logic to first check if the symbol is in librpm and then -librpmio if this check didn't succeed. - -But the logic wasn't working and rpm sorting was always disabled. Instead -of trying to fix this logic, let's just remove since the function already -moved and there's no need to check librpm anymore. Now it's enabled again: - - GRUB2 will be compiled with following components: - ... - grub-rpm-sort: Yes - ... - -Signed-off-by: Javier Martinez Canillas ---- - configure.ac | 19 +++++-------------- - 1 file changed, 5 insertions(+), 14 deletions(-) - -diff --git a/configure.ac b/configure.ac -index c7842ec29d..3c808a7223 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1947,24 +1947,15 @@ if test x"$rpm_sort_excuse" = x ; then - fi - - if test x"$rpm_sort_excuse" = x ; then -- # Check for rpm library. -- AC_CHECK_LIB([rpm], [rpmvercmp], [], -- [rpm_sort_excuse="rpmlib missing rpmvercmp"]) --fi -- --if test x"$rpm_sort_excuse" = x ; then -- LIBRPM="-lrpm"; -- AC_DEFINE([HAVE_RPM], [1], -- [Define to 1 if you have the rpm library.]) --fi -- --if test x"$LIBRPM" = x ; then -- # Check for rpm library. -+ # Check for rpmio library. - AC_CHECK_LIB([rpmio], [rpmvercmp], [], - [rpm_sort_excuse="rpmio missing rpmvercmp"]) -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then - LIBRPM="-lrpmio"; - AC_DEFINE([HAVE_RPMIO], [1], -- [Define to 1 if you have the rpm library.]) -+ [Define to 1 if you have the rpmio library.]) - fi - - AC_SUBST([LIBRPM]) diff --git a/0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch b/0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch similarity index 94% rename from 0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch rename to 0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch index 8bdf8ae..4f7feb9 100644 --- a/0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch +++ b/0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch @@ -14,7 +14,6 @@ Signed-off-by: Renaud Métrich Reviewed-by: Daniel Kiper (cherry picked from commit 68ba54c2298604146be83cae144dafd1cfd1fe2d) Signed-off-by: Robbie Harwood -(cherry picked from commit 7ada55e3fcd16e00773d3918955b2b945b7f063a) --- grub-core/commands/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0224-search-new-efidisk-only-option-on-EFI-systems.patch b/0204-search-new-efidisk-only-option-on-EFI-systems.patch similarity index 98% rename from 0224-search-new-efidisk-only-option-on-EFI-systems.patch rename to 0204-search-new-efidisk-only-option-on-EFI-systems.patch index 0364677..3f6194a 100644 --- a/0224-search-new-efidisk-only-option-on-EFI-systems.patch +++ b/0204-search-new-efidisk-only-option-on-EFI-systems.patch @@ -19,7 +19,6 @@ This commit also refactors handling of --no-floppy option. Signed-off-by: Renaud Métrich [rharwood: apply rmetrich's flags initialization fix] Signed-off-by: Robbie Harwood -(cherry picked from commit fdd8396f4fa750bbbabd4298f2593942f2b84710) --- grub-core/commands/search.c | 27 +++++++++++++++++++++++---- grub-core/commands/search_wrap.c | 18 ++++++++++++------ diff --git a/0225-efi-new-connectefi-command.patch b/0205-efi-new-connectefi-command.patch similarity index 98% rename from 0225-efi-new-connectefi-command.patch rename to 0205-efi-new-connectefi-command.patch index 0d25478..f80de22 100644 --- a/0225-efi-new-connectefi-command.patch +++ b/0205-efi-new-connectefi-command.patch @@ -51,7 +51,6 @@ needed. Signed-off-by: Renaud Métrich Signed-off-by: Robbie Harwood -(cherry picked from commit cc972c27314c841f80ab0fe8318fae06f078c680) --- grub-core/Makefile.core.def | 6 ++ grub-core/commands/efi/connectefi.c | 205 ++++++++++++++++++++++++++++++++++++ @@ -65,10 +64,10 @@ Signed-off-by: Robbie Harwood create mode 100644 grub-core/commands/efi/connectefi.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6b00eb5557..97abc01f06 100644 +index ec1ec5083b..741a033978 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -833,6 +833,12 @@ module = { +@@ -836,6 +836,12 @@ module = { enable = efi; }; diff --git a/0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch b/0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch new file mode 100644 index 0000000..4fe8adf --- /dev/null +++ b/0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Thu, 3 Mar 2022 13:10:56 +0100 +Subject: [PATCH] grub-core/loader/i386/efi/linux.c: do not validate kernels + twice + +On codebases that have shim-lock-verifier built into the grub core +(like 2.06 upstream), shim-lock-verifier is in enforcing mode when +booted with secureboot. It means that grub_cmd_linux() command +attempts to perform shim validate upon opening linux kernel image, +including kernel measurement. And the verifier correctly returns file +open error when shim validate protocol is not present or shim fails to +validate the kernel. + +This makes the call to grub_linuxefi_secure_validate() redundant, but +also harmful. As validating the kernel image twice, extends the PCRs +with the same measurement twice. Which breaks existing sealing +policies when upgrading from grub2.04+rhboot+sb+linuxefi to +grub2.06+rhboot+sb+linuxefi builds. It is also incorrect to measure +the kernel twice. + +This patch must not be ported to older editions of grub code bases +that do not have verifiers framework, or it is not builtin, or +shim-lock-verifier is an optional module. + +This patch is tested to ensure that unsigned kernels are not possible +to boot in secureboot mode when shim rejects kernel, or shim protocol +is missing, and that the measurements become stable once again. The +above also ensures that CVE-2020-15705 is not reintroduced. + +Signed-off-by: Dimitri John Ledkov +--- + grub-core/loader/i386/efi/linux.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +index 3cf0f9b330..941df6400b 100644 +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -30,7 +30,6 @@ + #include + #include + #include +-#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -278,7 +277,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_ssize_t start, filelen; + void *kernel = NULL; + int setup_header_end_offset; +- int rc; + + grub_dl_ref (my_mod); + +@@ -308,17 +306,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (grub_efi_get_secureboot () == GRUB_EFI_SECUREBOOT_MODE_ENABLED) +- { +- rc = grub_linuxefi_secure_validate (kernel, filelen); +- if (rc <= 0) +- { +- grub_error (GRUB_ERR_INVALID_COMMAND, +- N_("%s has invalid signature"), argv[0]); +- goto fail; +- } +- } +- + lh = (struct linux_i386_kernel_header *)kernel; + grub_dprintf ("linux", "original lh is at %p\n", kernel); + diff --git a/0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch b/0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch new file mode 100644 index 0000000..5b450f9 --- /dev/null +++ b/0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Fri, 4 Mar 2022 11:29:31 +0100 +Subject: [PATCH] grub-core/loader/arm64/linux.c: do not validate kernel twice + +Call to grub_file_open(, GRUB_FILE_TYPE_LINUX_KERNEL) already passes +the kernel file through shim-lock verifier when secureboot is on. Thus +there is no need to validate the kernel image again. And when doing so +again, duplicate PCR measurement is performed, breaking measurements +compatibility with 2.04+linuxefi. + +This patch must not be ported to older editions of grub code bases +that do not have verifiers framework, or it is not builtin, or +shim-lock-verifier is an optional module. + +Signed-off-by: Dimitri John Ledkov +--- + grub-core/loader/arm64/linux.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index f18d90bd74..d2af47c2c0 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -34,7 +34,6 @@ + #include + #include + #include +-#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -341,7 +340,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_off_t filelen; + grub_uint32_t align; + void *kernel = NULL; +- int rc; + + grub_dl_ref (my_mod); + +@@ -370,17 +368,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (grub_efi_get_secureboot () == GRUB_EFI_SECUREBOOT_MODE_ENABLED) +- { +- rc = grub_linuxefi_secure_validate (kernel, filelen); +- if (rc <= 0) +- { +- grub_error (GRUB_ERR_INVALID_COMMAND, +- N_("%s has invalid signature"), argv[0]); +- goto fail; +- } +- } +- + if (grub_arch_efi_linux_check_image (kernel) != GRUB_ERR_NONE) + goto fail; + if (parse_pe_header (kernel, &kernel_size, &handover_offset, &align) != GRUB_ERR_NONE) diff --git a/0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch b/0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch new file mode 100644 index 0000000..4c56d60 --- /dev/null +++ b/0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch @@ -0,0 +1,80 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Fri, 4 Mar 2022 09:31:43 +0100 +Subject: [PATCH] grub-core/loader/efi/chainloader.c: do not validate + chainloader twice + +On secureboot systems, with shimlock verifier, call to +grub_file_open(, GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE) will already +pass the chainloader target through shim-lock protocol verify +call. And create a TPM measurement. If verification fails, +grub_cmd_chainloader will fail at file open time. + +This makes previous code paths for negative, and zero return codes +from grub_linuxefi_secure_validate unreachable under secureboot. But +also breaking measurements compatibility with 2.04+linuxefi codebases, +as the chainloader file is passed through shim_lock->verify() twice +(via verifier & direct call to grub_linuxefi_secure_validate) +extending the PCRs twice. + +This reduces grub_loader options to perform +grub_secureboot_chainloader when secureboot is on, and otherwise +attempt grub_chainloader_boot. + +It means that booting with secureboot off, yet still with shim (which +always verifies things successfully), will stop choosing +grub_secureboot_chainloader, and opting for a more regular +loadimage/startimage codepath. If we want to use the +grub_secureboot_chainloader codepath in such scenarios we should adapt +the code to simply check for shim_lock protocol presence / +shim_lock->context() success?! But I am not sure if that is necessary. + +This patch must not be ported to older editions of grub code bases +that do not have verifiers framework, or it is not builtin, or +shim-lock-verifier is an optional module. + +Signed-off-by: Dimitri John Ledkov +--- + grub-core/loader/efi/chainloader.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c +index 3af6b12292..644cd2e56f 100644 +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -906,7 +906,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + grub_efi_device_path_t *dp = 0; + char *filename; + void *boot_image = 0; +- int rc; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +@@ -1082,9 +1081,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + orig_dev = 0; + } + +- rc = grub_linuxefi_secure_validate((void *)(unsigned long)address, fsize); +- grub_dprintf ("chain", "linuxefi_secure_validate: %d\n", rc); +- if (rc > 0) ++ if (grub_efi_get_secureboot () == GRUB_EFI_SECUREBOOT_MODE_ENABLED) + { + grub_file_close (file); + grub_device_close (dev); +@@ -1092,7 +1089,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + grub_secureboot_chainloader_unload, 0); + return 0; + } +- else if (rc == 0) ++ else + { + grub_load_and_start_image(boot_image); + grub_file_close (file); +@@ -1101,7 +1098,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + + return 0; + } +- // -1 fall-through to fail + + fail: + if (orig_dev) diff --git a/0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch b/0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch deleted file mode 100644 index 017d4cb..0000000 --- a/0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Gena Makhomed -Date: Thu, 1 Jul 2021 01:07:46 +0200 -Subject: [PATCH] grub-boot-success.timer: Only run if not in a container - -The grub-boot-success.timer should be disabled inside a container since it -leads to the following error: - -Jan 09 22:56:38 test sshd[8786]: pam_unix(sshd:session): session opened for user www(uid=1000) by (uid=0) -Jan 09 22:58:39 test systemd[8857]: Starting Mark boot as successful... -Jan 09 22:58:39 test systemd[8857]: grub-boot-success.service: Main process exited, code=exited, status=1/FAILURE -Jan 09 22:58:39 test systemd[8857]: grub-boot-success.service: Failed with result 'exit-code'. -Jan 09 22:58:39 test systemd[8857]: Failed to start Mark boot as successful. -Jan 09 22:58:39 test grub2-set-bootflag[10034]: Error canonicalizing /boot/grub2/grubenv filename: No such file or directory - -Resolves: rhbz#1914571 ---- - docs/grub-boot-success.timer | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/docs/grub-boot-success.timer b/docs/grub-boot-success.timer -index 5d8fcba21a..406f172005 100644 ---- a/docs/grub-boot-success.timer -+++ b/docs/grub-boot-success.timer -@@ -1,6 +1,7 @@ - [Unit] - Description=Mark boot as successful after the user session has run 2 minutes - ConditionUser=!@system -+ConditionVirtualization=!container - - [Timer] - OnActiveSec=2min diff --git a/0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch b/0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch new file mode 100644 index 0000000..c683fcb --- /dev/null +++ b/0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch @@ -0,0 +1,83 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Fri, 4 Mar 2022 11:36:09 +0100 +Subject: [PATCH] grub-core/loader/efi/linux.c: drop now unused + grub_linuxefi_secure_validate + +Drop the now unused grub_linuxefi_secure_validate() as all prior users +of this API now rely on the shim-lock-verifier codepath instead. + +This patch must not be ported to older editions of grub code bases +that do not have verifiers framework, or it is not builtin, or +shim-lock-verifier is an optional module. + +Signed-off-by: Dimitri John Ledkov +--- + grub-core/loader/efi/linux.c | 40 ---------------------------------------- + include/grub/efi/linux.h | 2 -- + 2 files changed, 42 deletions(-) + +diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c +index 9260731c10..9265cf4200 100644 +--- a/grub-core/loader/efi/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -24,46 +24,6 @@ + #include + #include + +-#define SHIM_LOCK_GUID \ +- { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} } +- +-struct grub_efi_shim_lock +-{ +- grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size); +-}; +-typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; +- +-// Returns 1 on success, -1 on error, 0 when not available +-int +-grub_linuxefi_secure_validate (void *data, grub_uint32_t size) +-{ +- grub_efi_guid_t guid = SHIM_LOCK_GUID; +- grub_efi_shim_lock_t *shim_lock; +- grub_efi_status_t status; +- +- shim_lock = grub_efi_locate_protocol(&guid, NULL); +- grub_dprintf ("secureboot", "shim_lock: %p\n", shim_lock); +- if (!shim_lock) +- { +- grub_dprintf ("secureboot", "shim not available\n"); +- return 0; +- } +- +- grub_dprintf ("secureboot", "Asking shim to verify kernel signature\n"); +- status = shim_lock->verify (data, size); +- grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", (long int)status); +- if (status == GRUB_EFI_SUCCESS) +- { +- grub_dprintf ("secureboot", "Kernel signature verification passed\n"); +- return 1; +- } +- +- grub_dprintf ("secureboot", "Kernel signature verification failed (0x%lx)\n", +- (unsigned long) status); +- +- return -1; +-} +- + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + +diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h +index 0033d9305a..887b02fd9f 100644 +--- a/include/grub/efi/linux.h ++++ b/include/grub/efi/linux.h +@@ -22,8 +22,6 @@ + #include + #include + +-int +-EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); + grub_err_t + EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, + void *kernel_param); diff --git a/0226-powerpc-prefix-detection-support-device-names-with-c.patch b/0210-powerpc-prefix-detection-support-device-names-with-c.patch similarity index 97% rename from 0226-powerpc-prefix-detection-support-device-names-with-c.patch rename to 0210-powerpc-prefix-detection-support-device-names-with-c.patch index a0aeb10..1c16fd3 100644 --- a/0226-powerpc-prefix-detection-support-device-names-with-c.patch +++ b/0210-powerpc-prefix-detection-support-device-names-with-c.patch @@ -25,13 +25,12 @@ with a bare prefix like '/grub2', you're almost certainly going to build in search anyway, so this will do. Signed-off-by: Daniel Axtens -(cherry picked from commit 80b6eb5e55e6d1a4c9896361e61de31c29e6939d) --- grub-core/kern/main.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 2d0d2bbd4c..4c4e6912f9 100644 +index 993b8a8598..e94a2f78fb 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -242,14 +242,29 @@ grub_set_prefix_and_root (void) diff --git a/0211-Remove-outdated-URL-for-BLS-document.patch b/0211-Remove-outdated-URL-for-BLS-document.patch deleted file mode 100644 index 21af1fa..0000000 --- a/0211-Remove-outdated-URL-for-BLS-document.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Mon, 5 Jul 2021 19:00:25 +0200 -Subject: [PATCH] Remove outdated URL for BLS document - -The document was moved to https://systemd.io/BOOT_LOADER_SPECIFICATION/, -update the URL accordingly to point to the current location. - -Resolves: rhbz#1926453 - -Signed-off-by: Javier Martinez Canillas ---- - util/grub.d/10_linux.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c9296154f5..6ee0a2cf3d 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -96,7 +96,7 @@ cat < (cherry picked from commit b4d70820a65c00561045856b7b8355461a9545f6) -(cherry picked from commit 05b16a6be50b1910609740a66b561276fa490538) --- grub-core/loader/efi/chainloader.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 3af6b12292..39158e679e 100644 +index 644cd2e56f..d3bf02ed8a 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -841,7 +841,7 @@ grub_secureboot_chainloader_unload (void) @@ -59,9 +58,9 @@ index 3af6b12292..39158e679e 100644 grub_loader_unset (); return grub_errno; } -@@ -1094,7 +1104,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -1091,7 +1101,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), } - else if (rc == 0) + else { - grub_load_and_start_image(boot_image); + grub_load_image(boot_image); diff --git a/0229-loader-efi-chainloader-simplify-the-loader-state.patch b/0213-loader-efi-chainloader-simplify-the-loader-state.patch similarity index 95% rename from 0229-loader-efi-chainloader-simplify-the-loader-state.patch rename to 0213-loader-efi-chainloader-simplify-the-loader-state.patch index 76c3d58..205124e 100644 --- a/0229-loader-efi-chainloader-simplify-the-loader-state.patch +++ b/0213-loader-efi-chainloader-simplify-the-loader-state.patch @@ -15,15 +15,14 @@ inside a struct. Signed-off-by: Chris Coulson (cherry picked from commit fa39862933b3be1553a580a3a5c28073257d8046) -(cherry picked from commit 0333343ee99c4e88f062789263c94291c057251b) -[rharwood: double-frees and uninitialized, verifying twice] +[rharwood: fix unitialized handle and double-frees of file/dev] Signed-off-by: Robbie Harwood --- grub-core/loader/efi/chainloader.c | 160 +++++++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 58 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 39158e679e..0717ce0478 100644 +index d3bf02ed8a..3342492ff1 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -48,38 +48,21 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -249,7 +248,7 @@ index 39158e679e..0717ce0478 100644 grub_loader_unset (); return grub_errno; -@@ -913,10 +933,16 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -913,9 +933,15 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_efi_boot_services_t *b; grub_device_t dev = 0; grub_device_t orig_dev = 0; @@ -257,7 +256,6 @@ index 39158e679e..0717ce0478 100644 + grub_efi_device_path_t *dp = 0, *file_path = 0; char *filename; void *boot_image = 0; - int rc; + grub_efi_physical_address_t address = 0; + grub_ssize_t fsize; + grub_efi_uintn_t pages = 0; @@ -267,7 +265,7 @@ index 39158e679e..0717ce0478 100644 if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -@@ -924,12 +950,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -923,12 +949,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_dl_ref (my_mod); @@ -280,9 +278,9 @@ index 39158e679e..0717ce0478 100644 b = grub_efi_system_table->boot_services; if (argc > 1) -@@ -1096,17 +1116,35 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), - grub_dprintf ("chain", "linuxefi_secure_validate: %d\n", rc); - if (rc > 0) +@@ -1093,17 +1113,35 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + + if (grub_efi_get_secureboot () == GRUB_EFI_SECUREBOOT_MODE_ENABLED) { + sb_context = grub_malloc (sizeof (*sb_context)); + if (sb_context == NULL) @@ -302,7 +300,7 @@ index 39158e679e..0717ce0478 100644 grub_secureboot_chainloader_unload, 0); return 0; } - else if (rc == 0) + else { - grub_load_image(boot_image); + grub_load_image(file_path, boot_image, fsize, dev_handle, cmdline, @@ -317,7 +315,7 @@ index 39158e679e..0717ce0478 100644 grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); return 0; -@@ -1134,6 +1172,12 @@ fail: +@@ -1130,6 +1168,12 @@ fail: if (cmdline) grub_free (cmdline); diff --git a/0230-commands-boot-Add-API-to-pass-context-to-loader.patch b/0214-commands-boot-Add-API-to-pass-context-to-loader.patch similarity index 98% rename from 0230-commands-boot-Add-API-to-pass-context-to-loader.patch rename to 0214-commands-boot-Add-API-to-pass-context-to-loader.patch index 65aac76..63a2d76 100644 --- a/0230-commands-boot-Add-API-to-pass-context-to-loader.patch +++ b/0214-commands-boot-Add-API-to-pass-context-to-loader.patch @@ -18,7 +18,6 @@ global context. Signed-off-by: Chris Coulson (cherry picked from commit 4322a64dde7e8fedb58e50b79408667129d45dd3) -(cherry picked from commit 937ad0e2159b6b8cb0d2ce3515da3a8b797c7927) --- grub-core/commands/boot.c | 66 +++++++++++++++++++++++++++++++++++++++++------ include/grub/loader.h | 5 ++++ diff --git a/0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch b/0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch similarity index 91% rename from 0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch rename to 0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch index 6a41992..fc15b84 100644 --- a/0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch +++ b/0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch @@ -9,15 +9,14 @@ more than once before a boot attempt is performed. Signed-off-by: Chris Coulson (cherry picked from commit 4b7f0402b7cb0f67a93be736f2b75b818d7f44c9) -(cherry picked from commit fc1a79bf0e0bc019362ace46d908a92b48dcd55b) -[rharwood: context sludge from previous commit] +[rharwood: context sludge from other change] Signed-off-by: Robbie Harwood --- grub-core/loader/efi/chainloader.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 0717ce0478..8ef508beca 100644 +index 3342492ff1..fb874f1855 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -48,8 +48,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -105,7 +104,7 @@ index 0717ce0478..8ef508beca 100644 rc = handle_image (sb_context); if (rc == 0) { -@@ -943,6 +950,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -942,6 +949,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_efi_char16_t *cmdline = 0; grub_ssize_t cmdline_len = 0; grub_efi_handle_t dev_handle = 0; @@ -114,7 +113,7 @@ index 0717ce0478..8ef508beca 100644 if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -@@ -1130,8 +1139,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -1127,8 +1136,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_file_close (file); grub_device_close (dev); @@ -124,8 +123,8 @@ index 0717ce0478..8ef508beca 100644 + grub_secureboot_chainloader_unload, sb_context, 0); return 0; } - else if (rc == 0) -@@ -1145,7 +1154,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + else +@@ -1142,7 +1151,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), efi_call_2 (b->free_pages, address, pages); grub_free (file_path); @@ -134,7 +133,7 @@ index 0717ce0478..8ef508beca 100644 return 0; } -@@ -1173,10 +1182,7 @@ fail: +@@ -1169,10 +1178,7 @@ fail: grub_free (cmdline); if (image_handle != 0) diff --git a/0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch b/0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch similarity index 88% rename from 0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch rename to 0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch index 4be2008..b79c78c 100644 --- a/0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch +++ b/0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch @@ -12,16 +12,15 @@ dereferenced, but fix it anyway. Signed-off-by: Chris Coulson (cherry picked from commit 8224f5a71af94bec8697de17e7e579792db9f9e2) -(cherry picked from commit 4744b62e20d07674017213ac54d7442d679f9d1a) --- grub-core/loader/i386/efi/linux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 3cf0f9b330..08c9fe6b0e 100644 +index 941df6400b..27bc2aa161 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -478,9 +478,6 @@ fail: +@@ -465,9 +465,6 @@ fail: if (file) grub_file_close (file); @@ -31,7 +30,7 @@ index 3cf0f9b330..08c9fe6b0e 100644 if (grub_errno != GRUB_ERR_NONE) { grub_dl_unref (my_mod); -@@ -496,6 +493,8 @@ fail: +@@ -483,6 +480,8 @@ fail: kernel_free (params, sizeof(*params)); } diff --git a/0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch b/0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch similarity index 92% rename from 0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch rename to 0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch index 9f5c491..1a129db 100644 --- a/0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch +++ b/0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch @@ -16,18 +16,16 @@ priority that is passed the loader state. Signed-off-by: Chris Coulson (cherry picked from commit 7cf736436b4c934df5ddfa6f44b46a7e07d99fdc) [rharwood/pjones: set kernel_size in context] -(cherry picked from commit 9c056391f7a36ea480de9a759c12e55a90f2040a) -[rharwood: verifying twice] Signed-off-by: Robbie Harwood --- grub-core/loader/i386/efi/linux.c | 146 +++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 59 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 08c9fe6b0e..9e25e51ccf 100644 +index 27bc2aa161..e3c2d6fe0b 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -35,13 +35,19 @@ +@@ -34,13 +34,19 @@ GRUB_MOD_LICENSE ("GPLv3+"); static grub_dl_t my_mod; @@ -54,7 +52,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 #define MIN(a, b) \ ({ typeof (a) _a = (a); \ -@@ -124,25 +130,32 @@ kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) +@@ -123,25 +129,32 @@ kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) } static grub_err_t @@ -97,7 +95,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 return GRUB_ERR_NONE; } -@@ -189,13 +202,14 @@ read(grub_file_t file, grub_uint8_t *bufp, grub_size_t len) +@@ -188,13 +201,14 @@ read(grub_file_t file, grub_uint8_t *bufp, grub_size_t len) #define HIGH_U32(val) ((grub_uint32_t)(((grub_addr_t)(val) >> 32) & 0xffffffffull)) static grub_err_t @@ -114,7 +112,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 if (argc == 0) { -@@ -203,12 +217,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +@@ -202,12 +216,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } @@ -130,7 +128,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 files = grub_calloc (argc, sizeof (files[0])); if (!files) goto fail; -@@ -226,19 +242,19 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +@@ -225,19 +241,19 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), } } @@ -156,7 +154,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 for (i = 0; i < nfiles; i++) { -@@ -262,8 +278,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +@@ -261,8 +277,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_file_close (files[i]); grub_free (files); @@ -167,10 +165,10 @@ index 08c9fe6b0e..9e25e51ccf 100644 BYTES_TO_PAGES(size)); return grub_errno; -@@ -279,6 +295,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -277,6 +293,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_ssize_t start, filelen; void *kernel = NULL; int setup_header_end_offset; - int rc; + void *kernel_mem = 0; + grub_uint64_t kernel_size = 0; + grub_uint32_t handover_offset; @@ -180,7 +178,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 grub_dl_ref (my_mod); -@@ -403,27 +425,27 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -390,27 +412,27 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "new lh is at %p\n", lh); grub_dprintf ("linux", "setting up cmdline\n"); @@ -219,7 +217,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 } #endif -@@ -448,16 +470,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -435,16 +457,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } max_addresses[1].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; max_addresses[2].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; @@ -238,7 +236,7 @@ index 08c9fe6b0e..9e25e51ccf 100644 grub_dprintf ("linux", "setting lh->code32_start to 0x%08x\n", LOW_U32(kernel_mem)); lh->code32_start = LOW_U32(kernel_mem); -@@ -474,33 +493,42 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -461,33 +480,42 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), "setting lh->ext_loader_{type,ver} = {0x%02x,0x%02x}\n", params->ext_loader_type, params->ext_loader_ver); diff --git a/0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch b/0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch deleted file mode 100644 index 1bf9fa8..0000000 --- a/0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Daniel Axtens -Date: Mon, 16 Aug 2021 16:01:47 +1000 -Subject: [PATCH] powerpc: fix prefix + signed grub special case for PowerVM - -Mea culpa: when testing the PowerPC special case for signed grub, I -assumed qemu and PowerVM would behave identically. This was wrong, and -with hindsight a pretty dumb error. - -This fixes it. This time, I am actually testing on PowerVM. - -Signed-off-by: Daniel Axtens ---- - grub-core/kern/main.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index e809a5edec..2d0d2bbd4c 100644 ---- a/grub-core/kern/main.c -+++ b/grub-core/kern/main.c -@@ -236,9 +236,20 @@ grub_set_prefix_and_root (void) - which will have now been extended to device=$fwdisk,partition - and path=/path - -- So we only need to act if device = ieee1275/disk exactly. -+ - PowerVM will give us device names like -+ ieee1275//vdevice/v-scsi@3000006c/disk@8100000000000000 -+ and we don't want to try to encode some sort of truth table about -+ what sorts of paths represent disks with partition tables and those -+ without partition tables. -+ -+ So we act unless there is a comma in the device, which would indicate -+ a partition has already been specified. -+ -+ (If we only have a path, the code in normal to discover config files -+ will try both without partitions and then with any partitions so we -+ will cover both CDs and HDs.) - */ -- if (grub_strncmp (device, "ieee1275/disk", 14) == 0) -+ if (grub_strchr (device, ',') == NULL) - grub_env_set ("prefix", path); - else - #endif diff --git a/0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch b/0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch deleted file mode 100644 index a1a8254..0000000 --- a/0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 9 Sep 2021 10:59:28 -0400 -Subject: [PATCH] Arm: check for the PE magic for the compiled arch - -In "arm64: Fix EFI loader kernel image allocation", Ben fixed the kernel -alignment to match the alignment given in the PE header. In doing so, a -check for valid PE magic was added, which was hard-coded to the value -seen on Aarch64 (GRUB_PE32_PE64_MAGIC). - -Unfortunately, this code is shared between 64-bit and 32-bit, and so -that value broke 32-bit Arm systems. - -This patch adds a constant definition for GRUB_PE32_PEXX_MAGIC, which is -either GRUB_PE32_PE64_MAGIC or GRUB_PE32_PE32_MAGIC, depending on which -platform is being built, and uses it in the header magic check. - -Resolves: rhbz#2000756 - -Signed-off-by: Peter Jones ---- - grub-core/loader/arm64/linux.c | 2 +- - include/grub/arm/linux.h | 1 + - include/grub/arm64/linux.h | 1 + - 3 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 4a252d5e7e..f18d90bd74 100644 ---- a/grub-core/loader/arm64/linux.c -+++ b/grub-core/loader/arm64/linux.c -@@ -322,7 +322,7 @@ parse_pe_header (void *kernel, grub_uint64_t *total_size, - - pe = (void *)((unsigned long)kernel + lh->hdr_offset); - -- if (pe->opt.magic != GRUB_PE32_PE64_MAGIC) -+ if (pe->opt.magic != GRUB_PE32_PEXX_MAGIC) - return grub_error(GRUB_ERR_BAD_OS, "Invalid PE optional header magic"); - - *total_size = pe->opt.image_size; -diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h -index b582f67f66..966a5074f5 100644 ---- a/include/grub/arm/linux.h -+++ b/include/grub/arm/linux.h -@@ -44,6 +44,7 @@ struct grub_arm_linux_pe_header - - #if defined(__arm__) - # define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE -+# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE32_MAGIC - # define linux_arch_kernel_header linux_arm_kernel_header - # define grub_armxx_linux_pe_header grub_arm_linux_pe_header - #endif -diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index ea030312df..422bf2bf24 100644 ---- a/include/grub/arm64/linux.h -+++ b/include/grub/arm64/linux.h -@@ -48,6 +48,7 @@ struct grub_arm64_linux_pe_header - - #if defined(__aarch64__) - # define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE -+# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE64_MAGIC - # define linux_arch_kernel_header linux_arm64_kernel_header - # define grub_armxx_linux_pe_header grub_arm64_linux_pe_header - #endif diff --git a/0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch b/0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch similarity index 86% rename from 0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch rename to 0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch index fe329e6..51953fd 100644 --- a/0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch +++ b/0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch @@ -9,16 +9,15 @@ initrd being leaked, so fix that. Signed-off-by: Chris Coulson (cherry picked from commit d98af31ce1e31bb22163960d53f5eb28c66582a0) -(cherry picked from commit 62234d6a00e6d1dd8e017ff161d359feb5234082) --- grub-core/loader/i386/efi/linux.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 9e25e51ccf..d24553a79d 100644 +index e3c2d6fe0b..9e5c11ac69 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -210,6 +210,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -209,6 +209,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) grub_uint8_t *ptr; struct grub_linuxefi_context *context = (struct grub_linuxefi_context *) cmd->data; struct linux_kernel_params *params; @@ -26,7 +25,7 @@ index 9e25e51ccf..d24553a79d 100644 if (argc == 0) { -@@ -242,19 +243,19 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -241,19 +242,19 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) } } @@ -52,7 +51,7 @@ index 9e25e51ccf..d24553a79d 100644 for (i = 0; i < nfiles; i++) { -@@ -271,6 +272,9 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -270,6 +271,9 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) ptr += ALIGN_UP_OVERHEAD (cursize, 4); } @@ -62,7 +61,7 @@ index 9e25e51ccf..d24553a79d 100644 params->ramdisk_size = size; fail: -@@ -278,9 +282,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -277,9 +281,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) grub_file_close (files[i]); grub_free (files); diff --git a/0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch b/0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch similarity index 98% rename from 0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch rename to 0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch index 716d1f1..715e6e1 100644 --- a/0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch +++ b/0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch @@ -19,7 +19,6 @@ Fixes: CVE-2022-28735 Signed-off-by: Julian Andres Klode Reviewed-by: Daniel Kiper (cherry picked from commit fa61ad69861c1cb3f68bf853d78fae7fd93986a0) -(cherry picked from commit f418191e01b38a635319a26925cf345523d4440c) --- grub-core/kern/efi/sb.c | 39 ++++++++++++++++++++++++++++++++++++--- include/grub/verify.h | 1 + diff --git a/0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch b/0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch similarity index 81% rename from 0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch rename to 0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch index f75512c..59f9471 100644 --- a/0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch +++ b/0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch @@ -13,16 +13,15 @@ path once we free it there. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 1499a5068839fa37cb77ecef4b5bdacbd1ed12ea) -(cherry picked from commit 2ec50b289d8b24922433439533113087f111f110) --- grub-core/kern/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c -index e19aea3e51..ed69fc0f0f 100644 +index ec10e54fc0..db938e099d 100644 --- a/grub-core/kern/file.c +++ b/grub-core/kern/file.c -@@ -81,6 +81,7 @@ grub_file_open (const char *name, enum grub_file_type type) +@@ -84,6 +84,7 @@ grub_file_open (const char *name, enum grub_file_type type) device = grub_device_open (device_name); grub_free (device_name); @@ -30,7 +29,7 @@ index e19aea3e51..ed69fc0f0f 100644 if (! device) goto fail; -@@ -135,6 +136,7 @@ grub_file_open (const char *name, enum grub_file_type type) +@@ -138,6 +139,7 @@ grub_file_open (const char *name, enum grub_file_type type) return file; fail: diff --git a/0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch b/0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch similarity index 98% rename from 0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch rename to 0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch index 870f462..385d3ed 100644 --- a/0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch +++ b/0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch @@ -11,7 +11,6 @@ Try to catch I/O errors sooner and bail out. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 882be97d1df6449b9fd4d593f0cb70005fde3494) -(cherry picked from commit 3f6fc3ebfd58fcdb3fe6c2f7a5a4fa05772ae786) --- grub-core/video/readers/png.c | 55 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch b/0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch similarity index 94% rename from 0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch rename to 0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch index 52832da..9168fe5 100644 --- a/0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch +++ b/0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch @@ -8,7 +8,6 @@ This causes the bitmap to be leaked. Do not permit multiple image headers. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 8ce433557adeadbc46429aabb9f850b02ad2bdfb) -(cherry picked from commit 6e10bba6a4cbfd6c7bf116f41fd4e037465e19d8) --- grub-core/video/readers/png.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch b/0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch similarity index 98% rename from 0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch rename to 0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch index c639780..4529cb8 100644 --- a/0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch +++ b/0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch @@ -35,7 +35,6 @@ Reviewed-by: Daniel Kiper (cherry picked from commit 0e1d163382669bd734439d8864ee969616d971d9) [rharwood: context conflict] Signed-off-by: Robbie Harwood -(cherry picked from commit 4c631c8119206b3178912df2905434d967661c3d) --- grub-core/video/readers/png.c | 85 +++---------------------------------------- 1 file changed, 6 insertions(+), 79 deletions(-) diff --git a/0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch b/0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch similarity index 95% rename from 0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch rename to 0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch index c1e232e..51dddfe 100644 --- a/0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch +++ b/0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch @@ -16,7 +16,6 @@ Fixes: CVE-2021-3696 Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 1ae9a91d42cb40da8a6f11fac65541858e340afa) -(cherry picked from commit 132ccc681cf642ad748580f26b54c9259a7f43fd) --- grub-core/video/readers/png.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/0241-video-readers-png-Sanity-check-some-huffman-codes.patch b/0225-video-readers-png-Sanity-check-some-huffman-codes.patch similarity index 95% rename from 0241-video-readers-png-Sanity-check-some-huffman-codes.patch rename to 0225-video-readers-png-Sanity-check-some-huffman-codes.patch index 01d6333..c9cef25 100644 --- a/0241-video-readers-png-Sanity-check-some-huffman-codes.patch +++ b/0225-video-readers-png-Sanity-check-some-huffman-codes.patch @@ -10,7 +10,6 @@ if not. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit c3a8ab0cbd24153ec7b1f84a96ddfdd72ef8d117) -(cherry picked from commit 5d09addf58086aa11d5f9a91af5632ff87c2d2ee) --- grub-core/video/readers/png.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch b/0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch similarity index 99% rename from 0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch rename to 0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch index e03b6d9..5491816 100644 --- a/0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch +++ b/0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch @@ -11,7 +11,6 @@ Try to catch I/O errors sooner and bail out. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit ab2e5d2e4bff488bbb557ed435a61ae102ef9f0c) -(cherry picked from commit 1ff8df0d2dea8ec7c8575241d5e7d6622c204ec3) --- grub-core/video/readers/jpeg.c | 86 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch b/0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch similarity index 94% rename from 0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch rename to 0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch index 0ee92d5..199ec32 100644 --- a/0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch +++ b/0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch @@ -9,7 +9,6 @@ memory for a huffman table we had already allocated memory for. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit bc06e12b4de55cc6f926af9f064170c82b1403e9) -(cherry picked from commit 5298bf758ea39a90537f9a1c76541ff2f21b970b) --- grub-core/video/readers/jpeg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch b/0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch similarity index 96% rename from 0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch rename to 0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch index ed20cda..179238b 100644 --- a/0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch +++ b/0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch @@ -13,7 +13,6 @@ Additionally, fix a grub_error() call formatting. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit f3a854def3e281b7ad4bbea730cd3046de1da52f) -(cherry picked from commit db0154828989a0a52ee59a4dda8c3803752bc827) --- grub-core/video/readers/jpeg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch b/0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch similarity index 96% rename from 0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch rename to 0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch index ed39a71..99eeb62 100644 --- a/0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch +++ b/0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch @@ -32,7 +32,6 @@ Fixes: CVE-2021-3697 Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 41aeb2004db9924fecd9f2dd64bc2a5a5594a4b5) -(cherry picked from commit 5f9582490792108306d047379fed2371bee286f8) --- grub-core/video/readers/jpeg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch b/0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch similarity index 94% rename from 0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch rename to 0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch index e51d293..6e64ed8 100644 --- a/0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch +++ b/0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch @@ -15,7 +15,6 @@ an OOB read. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit fdf32abc7a3928852422c0f291d8cd1dd6b34a8d) -(cherry picked from commit f2c10aaf335b88a69885375c4d68ffab2429df77) --- grub-core/normal/charset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/0247-net-netbuff-Block-overly-large-netbuff-allocs.patch b/0231-net-netbuff-Block-overly-large-netbuff-allocs.patch similarity index 95% rename from 0247-net-netbuff-Block-overly-large-netbuff-allocs.patch rename to 0231-net-netbuff-Block-overly-large-netbuff-allocs.patch index e74df27..2e10d49 100644 --- a/0247-net-netbuff-Block-overly-large-netbuff-allocs.patch +++ b/0231-net-netbuff-Block-overly-large-netbuff-allocs.patch @@ -12,7 +12,6 @@ them at their source). Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit ee9591103004cd13b4efadda671536090ca7fd57) -(cherry picked from commit acde668bb9d9fa862a1a63e3bbd5fa47fdfa9183) --- grub-core/net/netbuff.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/0248-net-ip-Do-IP-fragment-maths-safely.patch b/0232-net-ip-Do-IP-fragment-maths-safely.patch similarity index 95% rename from 0248-net-ip-Do-IP-fragment-maths-safely.patch rename to 0232-net-ip-Do-IP-fragment-maths-safely.patch index 4ba8455..118448d 100644 --- a/0248-net-ip-Do-IP-fragment-maths-safely.patch +++ b/0232-net-ip-Do-IP-fragment-maths-safely.patch @@ -10,7 +10,6 @@ Fixes: CVE-2022-28733 Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit eb74e5743ca7e18a5e75c392fe0b21d1549a1936) -(cherry picked from commit 552ad34583e788542e9ca08524a0d4bc8f98c297) --- grub-core/net/ip.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch b/0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch similarity index 96% rename from 0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch rename to 0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch index 96c5361..19701b6 100644 --- a/0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch +++ b/0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch @@ -32,7 +32,6 @@ It looks like the other use of grub_net_dns_lookup() is not affected. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit eb2e69fcf51307757e43f55ee8c9354d1ee42dd1) -(cherry picked from commit d801a27e7acec6c1a83067fab0bb975877eaf704) --- grub-core/net/dns.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch b/0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch similarity index 97% rename from 0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch rename to 0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch index 8451c19..ab0d471 100644 --- a/0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch +++ b/0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch @@ -11,7 +11,6 @@ so use grub_strlen() to make sure we don't overread it. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 6a97b3f4b1d5173aa516edc6dedbc63de7306d21) -(cherry picked from commit e0589624e86bc96666cbdb62f6e55cafec2871b3) --- grub-core/net/dns.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch b/0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch similarity index 98% rename from 0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch rename to 0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch index dba4ca7..3ff7b6b 100644 --- a/0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch +++ b/0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch @@ -44,7 +44,6 @@ This may affect other protocols, I haven't checked. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit dada1dda695439bb55b2848dddc2d89843552f81) -(cherry picked from commit 352c5ae8a9fc715712e6ecbd7ccb6218122c748f) --- grub-core/net/net.c | 11 +++++++++-- grub-core/net/tftp.c | 1 + diff --git a/0252-net-tftp-Avoid-a-trivial-UAF.patch b/0236-net-tftp-Avoid-a-trivial-UAF.patch similarity index 95% rename from 0252-net-tftp-Avoid-a-trivial-UAF.patch rename to 0236-net-tftp-Avoid-a-trivial-UAF.patch index 09a583a..4ec3b56 100644 --- a/0252-net-tftp-Avoid-a-trivial-UAF.patch +++ b/0236-net-tftp-Avoid-a-trivial-UAF.patch @@ -14,7 +14,6 @@ it trips up fuzzers. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 956f4329cec23e4375182030ca9b2be631a61ba5) -(cherry picked from commit dbe9abcdee6ce796811111b67e3f24eefe2135d1) --- grub-core/net/tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch b/0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch similarity index 95% rename from 0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch rename to 0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch index cbc7162..186f0c3 100644 --- a/0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch +++ b/0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch @@ -13,7 +13,6 @@ Detect if it has been torn down and don't do it again. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit ec233d3ecf995293304de443579aab5c46c49e85) -(cherry picked from commit d39cf87ed701b9f0900daed7f672e07994d37ce8) --- grub-core/net/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/0254-net-http-Fix-OOB-write-for-split-http-headers.patch b/0238-net-http-Fix-OOB-write-for-split-http-headers.patch similarity index 96% rename from 0254-net-http-Fix-OOB-write-for-split-http-headers.patch rename to 0238-net-http-Fix-OOB-write-for-split-http-headers.patch index 367a827..f22960b 100644 --- a/0254-net-http-Fix-OOB-write-for-split-http-headers.patch +++ b/0238-net-http-Fix-OOB-write-for-split-http-headers.patch @@ -25,7 +25,6 @@ Fixes: CVE-2022-28734 Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit e9fb459638811c12b0989dbf64e3e124974ef617) -(cherry picked from commit b604916beb6c39e8ed27f72851eb16f3eaa293c5) --- grub-core/net/http.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/0255-net-http-Error-out-on-headers-with-LF-without-CR.patch b/0239-net-http-Error-out-on-headers-with-LF-without-CR.patch similarity index 95% rename from 0255-net-http-Error-out-on-headers-with-LF-without-CR.patch rename to 0239-net-http-Error-out-on-headers-with-LF-without-CR.patch index ea8ce37..b73c169 100644 --- a/0255-net-http-Error-out-on-headers-with-LF-without-CR.patch +++ b/0239-net-http-Error-out-on-headers-with-LF-without-CR.patch @@ -22,7 +22,6 @@ Fixes: CVE-2022-28734 Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit d232ad41ac4979a9de4d746e5fdff9caf0e303de) -(cherry picked from commit 8960e6d6137090a7e8c6592077da6e387a4ef972) --- grub-core/net/http.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch b/0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch similarity index 97% rename from 0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch rename to 0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch index f0292c5..79df1c2 100644 --- a/0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch +++ b/0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch @@ -13,7 +13,6 @@ Signed-off-by: Sudhakar Kuppusamy Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit a3988cb3f0a108dd67ac127a79a4c8479d23334e) -(cherry picked from commit 7125978aa7d6068812ef6da0ab38ce521ae7eba1) --- grub-core/fs/f2fs.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch b/0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch similarity index 98% rename from 0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch rename to 0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch index 1d59fb6..855e882 100644 --- a/0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch +++ b/0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch @@ -21,7 +21,6 @@ Signed-off-by: Sudhakar Kuppusamy Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 62d63d5e38c67a6e349148bf7cb87c560e935a7e) -(cherry picked from commit 92219e6d379b5b4d30b05361830b72ab1d95d281) --- grub-core/fs/f2fs.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch b/0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch similarity index 95% rename from 0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch rename to 0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch index c454897..0553d60 100644 --- a/0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch +++ b/0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch @@ -17,7 +17,6 @@ Signed-off-by: Sudhakar Kuppusamy Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 9a891f638509e031d322c94e3cbcf38d36f3993a) -(cherry picked from commit 13f9160ae0d2806baed459884999356817096cd7) --- grub-core/fs/f2fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch b/0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch similarity index 96% rename from 0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch rename to 0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch index 5e8cd4d..7ff5821 100644 --- a/0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch +++ b/0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch @@ -22,13 +22,12 @@ Reviewed-by: Daniel Kiper (cherry picked from commit 6d3f06c0b6a8992b9b1bb0e62af93ac5ff2781f0) [rharwood: we've an extra variable here] Signed-off-by: Robbie Harwood -(cherry picked from commit e3e21b9a81aea09dd43368cf097c1029a8380d82) --- grub-core/fs/btrfs.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4cc86e9b79..f3ab64e098 100644 +index 07c0ff874b..2fcfb738fe 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2254,6 +2254,7 @@ grub_btrfs_dir (grub_device_t device, const char *path, diff --git a/0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch b/0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch similarity index 97% rename from 0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch rename to 0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch index f2a8815..d638c11 100644 --- a/0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch +++ b/0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch @@ -27,13 +27,12 @@ comparison to the size of the chunk itself. Signed-off-by: Darren Kenny Reviewed-by: Daniel Kiper (cherry picked from commit 3849647b4b98a4419366708fc4b7f339c6f55ec7) -(cherry picked from commit fa5a02a8930bbd8a3b5ae6ed9612307611f18500) --- grub-core/fs/btrfs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index f3ab64e098..b104da085c 100644 +index 2fcfb738fe..0e9b450413 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -941,6 +941,12 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, diff --git a/0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch b/0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch similarity index 96% rename from 0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch rename to 0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch index 01294d6..2e5145f 100644 --- a/0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch +++ b/0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch @@ -20,13 +20,12 @@ obviously invalid too. Signed-off-by: Darren Kenny Reviewed-by: Daniel Kiper (cherry picked from commit e00cd76cbadcc897a9cc4087cb2fcb5dbe15e596) -(cherry picked from commit b74a6fc95b0839937acf4f2b7445ae9d179f49ec) --- grub-core/fs/btrfs.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index b104da085c..8ec885a93b 100644 +index 0e9b450413..47325f6ad7 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -947,6 +947,17 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, diff --git a/0262-misc-Make-grub_min-and-grub_max-more-resilient.patch b/0246-misc-Make-grub_min-and-grub_max-more-resilient.patch similarity index 97% rename from 0262-misc-Make-grub_min-and-grub_max-more-resilient.patch rename to 0246-misc-Make-grub_min-and-grub_max-more-resilient.patch index d34a0e3..eb2e8fd 100644 --- a/0262-misc-Make-grub_min-and-grub_max-more-resilient.patch +++ b/0246-misc-Make-grub_min-and-grub_max-more-resilient.patch @@ -18,7 +18,6 @@ variables with __COUNTER__ (A GNU C cpp extension) and token pasting to create uniquely named internal variables. Signed-off-by: Peter Jones -(cherry picked from commit 2d6800450fa731d7b3ef9893986806e88e819eb6) --- grub-core/loader/multiboot_elfxx.c | 4 +--- include/grub/misc.h | 25 +++++++++++++++++++++++-- diff --git a/0263-ReiserFS-switch-to-using-grub_min-grub_max.patch b/0247-ReiserFS-switch-to-using-grub_min-grub_max.patch similarity index 98% rename from 0263-ReiserFS-switch-to-using-grub_min-grub_max.patch rename to 0247-ReiserFS-switch-to-using-grub_min-grub_max.patch index e604215..0707af3 100644 --- a/0263-ReiserFS-switch-to-using-grub_min-grub_max.patch +++ b/0247-ReiserFS-switch-to-using-grub_min-grub_max.patch @@ -8,7 +8,6 @@ definitions from the reiserfs driver, and uses grub_min() / grub_max() instead. Signed-off-by: Peter Jones -(cherry picked from commit 5fc601574fce99b32fe4dfb55bd8f3ab0175fd6a) --- grub-core/fs/reiserfs.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch b/0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch similarity index 95% rename from 0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch rename to 0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch index 64bbe31..a7ac6f2 100644 --- a/0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch +++ b/0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch @@ -12,7 +12,6 @@ This patch changes grub_boot_time() to also log when "boot" is enabled in DEBUG, regardless of BOOT_TIME_STATS. Signed-off-by: Peter Jones -(cherry picked from commit 4fd282de00df05ce289467861deb7a0e186cfbd7) --- grub-core/kern/misc.c | 3 ++- include/grub/misc.h | 2 +- diff --git a/0265-modules-make-.module_license-read-only.patch b/0249-modules-make-.module_license-read-only.patch similarity index 94% rename from 0265-modules-make-.module_license-read-only.patch rename to 0249-modules-make-.module_license-read-only.patch index 51281a3..ba3b313 100644 --- a/0265-modules-make-.module_license-read-only.patch +++ b/0249-modules-make-.module_license-read-only.patch @@ -11,7 +11,6 @@ This patch sets that data as "const", which causes that flag not to be set. Signed-off-by: Peter Jones -(cherry picked from commit 2eff3e2c9d9e6b75daa81b840c96f112ef7d5de6) --- include/grub/dl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0266-modules-strip-.llvm_addrsig-sections-and-similar.patch b/0250-modules-strip-.llvm_addrsig-sections-and-similar.patch similarity index 95% rename from 0266-modules-strip-.llvm_addrsig-sections-and-similar.patch rename to 0250-modules-strip-.llvm_addrsig-sections-and-similar.patch index 16528e4..9f26115 100644 --- a/0266-modules-strip-.llvm_addrsig-sections-and-similar.patch +++ b/0250-modules-strip-.llvm_addrsig-sections-and-similar.patch @@ -16,7 +16,6 @@ Note that the glob there won't work without a new enough linker, but the failure is just reversion to the status quo, so that's not a big problem. Signed-off-by: Peter Jones -(cherry picked from commit e85d1c4d795f8135ad0acfa36d64760d12d6fed1) --- grub-core/genmod.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch b/0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch similarity index 95% rename from 0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch rename to 0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch index 6599406..d07d838 100644 --- a/0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch +++ b/0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch @@ -15,7 +15,6 @@ makes the allocation computation loop skip empty sections as the loading loop does. Signed-off-by: Peter Jones -(cherry picked from commit 03215e342f552396ab08125ea769b1e166417ec1) --- grub-core/kern/dl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch b/0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch similarity index 93% rename from 0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch rename to 0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch index c3f2e0f..ef51214 100644 --- a/0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch +++ b/0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch @@ -15,17 +15,16 @@ This patch adds the structure for the DOS header, renames the DOS magic define, and adds defines for the actual PE magic. Signed-off-by: Peter Jones -(cherry picked from commit 955f47aa8300387eecf18b0866d21dde7720593d) --- grub-core/loader/arm64/linux.c | 2 +- include/grub/efi/pe32.h | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index f18d90bd74..bcc6ef46e9 100644 +index d2af47c2c0..cc67f43906 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -59,7 +59,7 @@ grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh) +@@ -58,7 +58,7 @@ grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh) if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE) return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); diff --git a/0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch b/0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch similarity index 85% rename from 0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch rename to 0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch index b306f15..c6688cd 100644 --- a/0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch +++ b/0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch @@ -14,16 +14,15 @@ rather than EFI_LOADER_DATA. Signed-off-by: Peter Jones [rharwood: use kernel_size] Signed-off-by: Robbie Harwood -(cherry picked from commit 8b31058a12d3e85f0f0180ac90b98d6465fccbb7) --- grub-core/loader/i386/efi/linux.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index d24553a79d..b832c85728 100644 +index 9e5c11ac69..92b2fb5091 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -87,7 +87,9 @@ kernel_free(void *addr, grub_efi_uintn_t size) +@@ -86,7 +86,9 @@ kernel_free(void *addr, grub_efi_uintn_t size) } static void * @@ -34,7 +33,7 @@ index d24553a79d..b832c85728 100644 { void *addr = 0; unsigned int i; -@@ -113,7 +115,7 @@ kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) +@@ -112,7 +114,7 @@ kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) prev_max = max; addr = grub_efi_allocate_pages_real (max, pages, max_addresses[i].alloc_type, @@ -43,7 +42,7 @@ index d24553a79d..b832c85728 100644 if (addr) grub_dprintf ("linux", "Allocated at %p\n", addr); } -@@ -243,7 +245,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -242,7 +244,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) } } @@ -53,7 +52,7 @@ index d24553a79d..b832c85728 100644 if (initrd_mem == NULL) goto fail; grub_dprintf ("linux", "initrd_mem = %p\n", initrd_mem); -@@ -406,7 +409,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -393,7 +396,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } #endif @@ -63,7 +62,7 @@ index d24553a79d..b832c85728 100644 if (!params) goto fail; grub_dprintf ("linux", "params = %p\n", params); -@@ -428,7 +432,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -415,7 +419,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "new lh is at %p\n", lh); grub_dprintf ("linux", "setting up cmdline\n"); @@ -74,7 +73,7 @@ index d24553a79d..b832c85728 100644 if (!cmdline) goto fail; grub_dprintf ("linux", "cmdline = %p\n", cmdline); -@@ -474,7 +480,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -461,7 +467,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), max_addresses[1].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; max_addresses[2].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; kernel_size = lh->init_size; diff --git a/0270-modules-load-module-sections-at-page-aligned-address.patch b/0254-modules-load-module-sections-at-page-aligned-address.patch similarity index 99% rename from 0270-modules-load-module-sections-at-page-aligned-address.patch rename to 0254-modules-load-module-sections-at-page-aligned-address.patch index 0e76430..eb171f5 100644 --- a/0270-modules-load-module-sections-at-page-aligned-address.patch +++ b/0254-modules-load-module-sections-at-page-aligned-address.patch @@ -54,7 +54,6 @@ generally support NX with the memory attributes API will cause grub to fail. Signed-off-by: Peter Jones -(cherry picked from commit 31d52500b281619d92b03b2c2d30fe15aedaf326) --- grub-core/kern/arm/dl.c | 13 +++++++++++++ grub-core/kern/arm64/dl.c | 13 +++++++++++++ diff --git a/0271-nx-add-memory-attribute-get-set-API.patch b/0255-nx-add-memory-attribute-get-set-API.patch similarity index 99% rename from 0271-nx-add-memory-attribute-get-set-API.patch rename to 0255-nx-add-memory-attribute-get-set-API.patch index 9146ba1..91c9d2f 100644 --- a/0271-nx-add-memory-attribute-get-set-API.patch +++ b/0255-nx-add-memory-attribute-get-set-API.patch @@ -20,7 +20,6 @@ it. Signed-off-by: Peter Jones [rharwood: add pjones's none/nyi fixup] Signed-off-by: Robbie Harwood -(cherry picked from commit 35de78a8d32b9fad5291ec96fd3cbb9cf2f4a80b) --- grub-core/kern/efi/efi.c | 36 +++++++++++++ grub-core/kern/efi/mm.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/0272-nx-set-page-permissions-for-loaded-modules.patch b/0256-nx-set-page-permissions-for-loaded-modules.patch similarity index 99% rename from 0272-nx-set-page-permissions-for-loaded-modules.patch rename to 0256-nx-set-page-permissions-for-loaded-modules.patch index ad3c2aa..9e0aebb 100644 --- a/0272-nx-set-page-permissions-for-loaded-modules.patch +++ b/0256-nx-set-page-permissions-for-loaded-modules.patch @@ -15,7 +15,6 @@ cases it sets both flags. Signed-off-by: Peter Jones [rharwood: arm tgptr -> tgaddr] Signed-off-by: Robbie Harwood -(cherry-picked from commit ca74904ede0406b594cbedc52ce8e38a6633d2ae) --- grub-core/kern/dl.c | 120 +++++++++++++++++++++++++++++++++++++++------------- include/grub/dl.h | 44 +++++++++++++++++++ diff --git a/0273-nx-set-attrs-in-our-kernel-loaders.patch b/0257-nx-set-attrs-in-our-kernel-loaders.patch similarity index 91% rename from 0273-nx-set-attrs-in-our-kernel-loaders.patch rename to 0257-nx-set-attrs-in-our-kernel-loaders.patch index 9beee6a..514df1f 100644 --- a/0273-nx-set-attrs-in-our-kernel-loaders.patch +++ b/0257-nx-set-attrs-in-our-kernel-loaders.patch @@ -9,12 +9,10 @@ permissions on allocated pages and the stack. This patch adds those calls. Signed-off-by: Peter Jones -[rharwood: fix aarch64 callsites] -(cherry-picked from commit a9f79a997f01a83b36cdfa89ef2e72ac2a17c06c) -[rharwood: uninitialized stack_attrs, double verification] +[rharwood: fix stack_attrs undefined, fix aarch64 callsites] Signed-off-by: Robbie Harwood --- - grub-core/kern/efi/mm.c | 78 ++++++++++++++++++ + grub-core/kern/efi/mm.c | 77 +++++++++++++++++ grub-core/loader/arm64/linux.c | 16 +++- grub-core/loader/arm64/xen_boot.c | 4 +- grub-core/loader/efi/chainloader.c | 11 +++ @@ -22,15 +20,15 @@ Signed-off-by: Robbie Harwood grub-core/loader/i386/efi/linux.c | 26 +++++- grub-core/loader/i386/linux.c | 5 ++ include/grub/efi/efi.h | 6 +- - include/grub/efi/linux.h | 17 +++- + include/grub/efi/linux.h | 16 +++- include/grub/efi/pe32.h | 2 + - 10 files changed, 314 insertions(+), 15 deletions(-) + 10 files changed, 312 insertions(+), 15 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 2c33758ed7..88364d764c 100644 +index 2c33758ed7..e460b072e6 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c -@@ -610,6 +610,82 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map, +@@ -610,6 +610,81 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map, } #endif @@ -85,7 +83,6 @@ index 2c33758ed7..88364d764c 100644 + (attrs & GRUB_MEM_ATTR_R) ? 'w' : '-', + (attrs & GRUB_MEM_ATTR_R) ? 'x' : '-'); + } -+ + for (stack_end = stack_current + page_size ; + !(attrs & GRUB_MEM_ATTR_R); + stack_end += page_size) @@ -113,7 +110,7 @@ index 2c33758ed7..88364d764c 100644 void grub_efi_mm_init (void) { -@@ -623,6 +699,8 @@ grub_efi_mm_init (void) +@@ -623,6 +698,8 @@ grub_efi_mm_init (void) grub_efi_uint64_t required_pages; int mm_status; @@ -123,10 +120,10 @@ index 2c33758ed7..88364d764c 100644 memory_map = grub_efi_allocate_any_pages (2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); if (! memory_map) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index bcc6ef46e9..70db5a6e0b 100644 +index cc67f43906..de85583487 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -173,7 +173,8 @@ free_params (void) +@@ -172,7 +172,8 @@ free_params (void) } grub_err_t @@ -136,7 +133,7 @@ index bcc6ef46e9..70db5a6e0b 100644 { grub_err_t retval; -@@ -183,7 +184,8 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, char *args) +@@ -182,7 +183,8 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, char *args) grub_dprintf ("linux", "linux command line: '%s'\n", args); @@ -146,7 +143,7 @@ index bcc6ef46e9..70db5a6e0b 100644 /* Never reached... */ free_params(); -@@ -193,7 +195,10 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, char *args) +@@ -192,7 +194,10 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, char *args) static grub_err_t grub_linux_boot (void) { @@ -158,15 +155,15 @@ index bcc6ef46e9..70db5a6e0b 100644 } static grub_err_t -@@ -342,6 +347,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -340,6 +345,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_off_t filelen; grub_uint32_t align; void *kernel = NULL; - int rc; + int nx_supported = 1; grub_dl_ref (my_mod); -@@ -389,6 +395,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -376,6 +382,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "kernel entry offset : %d\n", handover_offset); grub_dprintf ("linux", "kernel alignment : 0x%x\n", align); @@ -193,10 +190,10 @@ index d9b7a9ba40..6e7e920416 100644 static void diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 8ef508beca..6ac69f0f59 100644 +index fb874f1855..dd31ac9bb3 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c -@@ -1071,6 +1071,17 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +@@ -1070,6 +1070,17 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), goto fail; } @@ -215,10 +212,10 @@ index 8ef508beca..6ac69f0f59 100644 if (fsize >= (grub_ssize_t) sizeof (struct grub_macho_fat_header)) { diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index 9260731c10..dcc9ea40ea 100644 +index 9265cf4200..277f352e0c 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c -@@ -66,16 +66,127 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) +@@ -26,16 +26,127 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" @@ -348,7 +345,7 @@ index 9260731c10..dcc9ea40ea 100644 #ifdef __x86_64__ offset = 512; -@@ -88,12 +199,57 @@ grub_efi_linux_boot (void *kernel_addr, grub_off_t handover_offset, +@@ -48,12 +159,57 @@ grub_efi_linux_boot (void *kernel_addr, grub_off_t handover_offset, */ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); if (loaded_image) @@ -409,10 +406,10 @@ index 9260731c10..dcc9ea40ea 100644 hf (grub_efi_image_handle, grub_efi_system_table, kernel_params); diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index b832c85728..dc98077378 100644 +index 92b2fb5091..91ae274299 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -45,7 +45,7 @@ struct grub_linuxefi_context { +@@ -44,7 +44,7 @@ struct grub_linuxefi_context { grub_uint32_t handover_offset; struct linux_kernel_params *params; char *cmdline; @@ -421,7 +418,7 @@ index b832c85728..dc98077378 100644 void *initrd_mem; }; -@@ -111,13 +111,19 @@ kernel_alloc(grub_efi_uintn_t size, +@@ -110,13 +110,19 @@ kernel_alloc(grub_efi_uintn_t size, pages = BYTES_TO_PAGES(size); grub_dprintf ("linux", "Trying to allocate %lu pages from %p\n", (unsigned long)pages, (void *)(unsigned long)max); @@ -442,7 +439,7 @@ index b832c85728..dc98077378 100644 } while (grub_error_pop ()) -@@ -138,9 +144,11 @@ grub_linuxefi_boot (void *data) +@@ -137,9 +143,11 @@ grub_linuxefi_boot (void *data) asm volatile ("cli"); @@ -456,7 +453,7 @@ index b832c85728..dc98077378 100644 } static grub_err_t -@@ -306,7 +314,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -304,7 +312,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_uint32_t handover_offset; struct linux_kernel_params *params = 0; char *cmdline = 0; @@ -466,8 +463,8 @@ index b832c85728..dc98077378 100644 grub_dl_ref (my_mod); -@@ -347,6 +357,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - } +@@ -334,6 +344,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; } + err = grub_efi_check_nx_image_support ((grub_addr_t)kernel, filelen, @@ -480,7 +477,7 @@ index b832c85728..dc98077378 100644 lh = (struct linux_i386_kernel_header *)kernel; grub_dprintf ("linux", "original lh is at %p\n", kernel); -@@ -511,6 +528,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -498,6 +515,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), context->handover_offset = handover_offset; context->params = params; context->cmdline = cmdline; @@ -527,17 +524,14 @@ index 34825c4adc..449e55269f 100644 grub_addr_t grub_efi_section_addr (const char *section); diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h -index 0033d9305a..8130b19590 100644 +index 887b02fd9f..b82f71006a 100644 --- a/include/grub/efi/linux.h +++ b/include/grub/efi/linux.h -@@ -22,10 +22,23 @@ +@@ -22,8 +22,20 @@ #include #include +#define GRUB_MOK_POLICY_NX_REQUIRED 0x1 -+ - int - EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); + grub_err_t -EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, diff --git a/0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch b/0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch similarity index 95% rename from 0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch rename to 0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch index 8b5075b..7da75a8 100644 --- a/0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch +++ b/0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch @@ -16,7 +16,6 @@ This patch adds a definition for the PE DLL Characteristics flag GRUB_PE32_NX_COMPAT, and changes grub-mkimage to set that flag. Signed-off-by: Peter Jones -(cherry picked from commit 0c7f1aed5a87f75051b421903a900ccb4bbd795a) --- util/mkimage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/0259-grub-probe-document-the-behavior-of-multiple-v.patch b/0259-grub-probe-document-the-behavior-of-multiple-v.patch new file mode 100644 index 0000000..4e9d7cc --- /dev/null +++ b/0259-grub-probe-document-the-behavior-of-multiple-v.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Fri, 15 Jul 2022 15:49:25 -0400 +Subject: [PATCH] grub-probe: document the behavior of multiple -v + +Signed-off-by: Robbie Harwood +(cherry picked from commit 51a55233eed08f7f12276afd6b3724b807a0b680) +--- + util/grub-probe.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index c6fac732b4..ba867319a7 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -732,7 +732,8 @@ static struct argp_option options[] = { + {"device-map", 'm', N_("FILE"), 0, + N_("use FILE as the device map [default=%s]"), 0}, + {"target", 't', N_("TARGET"), 0, 0, 0}, +- {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, ++ {"verbose", 'v', 0, 0, ++ N_("print verbose messages (pass twice to enable debug printing)."), 0}, + {0, '0', 0, 0, N_("separate items in output using ASCII NUL characters"), 0}, + { 0, 0, 0, 0, 0, 0 } + }; diff --git a/0260-grub_fs_probe-dprint-errors-from-filesystems.patch b/0260-grub_fs_probe-dprint-errors-from-filesystems.patch new file mode 100644 index 0000000..1455ae4 --- /dev/null +++ b/0260-grub_fs_probe-dprint-errors-from-filesystems.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Fri, 15 Jul 2022 15:39:41 -0400 +Subject: [PATCH] grub_fs_probe(): dprint errors from filesystems + +When filesystem detection fails, all that's currently debug-logged is a +series of messages like: + + grub-core/kern/fs.c:56:fs: Detecting ntfs... + grub-core/kern/fs.c:76:fs: ntfs detection failed. + +repeated for each filesystem. Any messages provided to grub_error() by +the filesystem are lost, and one has to break out gdb to figure out what +went wrong. + +With this change, one instead sees: + + grub-core/kern/fs.c:56:fs: Detecting fat... + grub-core/osdep/hostdisk.c:357:hostdisk: reusing open device + `/path/to/device' + grub-core/kern/fs.c:77:fs: error: invalid modification timestamp for /. + grub-core/kern/fs.c:79:fs: fat detection failed. + +in the debug prints. + +Signed-off-by: Robbie Harwood +(cherry picked from commit 838c79d658797d0662ee7f9e033e38ee88059e02) +--- + grub-core/kern/fs.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c +index c698295bcb..b58e2ae1d2 100644 +--- a/grub-core/kern/fs.c ++++ b/grub-core/kern/fs.c +@@ -74,6 +74,7 @@ grub_fs_probe (grub_device_t device) + if (grub_errno == GRUB_ERR_NONE) + return p; + ++ grub_dprintf ("fs", _("error: %s.\n"), grub_errmsg); + grub_error_push (); + grub_dprintf ("fs", "%s detection failed.\n", p->name); + grub_error_pop (); diff --git a/0261-fs-fat-don-t-error-when-mtime-is-0.patch b/0261-fs-fat-don-t-error-when-mtime-is-0.patch new file mode 100644 index 0000000..f014f6c --- /dev/null +++ b/0261-fs-fat-don-t-error-when-mtime-is-0.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Fri, 15 Jul 2022 15:42:41 -0400 +Subject: [PATCH] fs/fat: don't error when mtime is 0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In the wild, we occasionally see valid ESPs where some file modification times +are 0. For instance: + + ├── [Dec 31 1979] EFI + │ ├── [Dec 31 1979] BOOT + │ │ ├── [Dec 31 1979] BOOTX64.EFI + │ │ └── [Dec 31 1979] fbx64.efi + │ └── [Jun 27 02:41] fedora + │ ├── [Dec 31 1979] BOOTX64.CSV + │ ├── [Dec 31 1979] fonts + │ ├── [Mar 14 03:35] fw + │ │ ├── [Mar 14 03:35] fwupd-359c1169-abd6-4a0d-8bce-e4d4713335c1.cap + │ │ ├── [Mar 14 03:34] fwupd-9d255c4b-2d88-4861-860d-7ee52ade9463.cap + │ │ └── [Mar 14 03:34] fwupd-b36438d8-9128-49d2-b280-487be02d948b.cap + │ ├── [Dec 31 1979] fwupdx64.efi + │ ├── [May 10 10:47] grub.cfg + │ ├── [Jun 3 12:38] grub.cfg.new.new + │ ├── [May 10 10:41] grub.cfg.old + │ ├── [Jun 27 02:41] grubenv + │ ├── [Dec 31 1979] grubx64.efi + │ ├── [Dec 31 1979] mmx64.efi + │ ├── [Dec 31 1979] shim.efi + │ ├── [Dec 31 1979] shimx64.efi + │ └── [Dec 31 1979] shimx64-fedora.efi + └── [Dec 31 1979] FSCK0000.REC + + 5 directories, 17 files + +This causes grub-probe failure, which in turn causes grub-mkconfig +failure. They are valid filesystems that appear intact, and the Linux +FAT stack is able to mount and manipulate them without complaint. + +The check for mtime of 0 has been present since +20def1a3c3952982395cd7c3ea7e78638527962b ("fat: support file +modification times"). + +Signed-off-by: Robbie Harwood +(cherry picked from commit 0615c4887352e32d7bb7198e9ad0d695f9dc2c31) +--- + grub-core/fs/fat.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c +index dd82e4ee35..ff6200c5be 100644 +--- a/grub-core/fs/fat.c ++++ b/grub-core/fs/fat.c +@@ -1027,9 +1027,6 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, + grub_le_to_cpu16 (ctxt.dir.w_date), + &info.mtime); + #endif +- if (info.mtimeset == 0) +- grub_error (GRUB_ERR_OUT_OF_RANGE, +- "invalid modification timestamp for %s", path); + + if (hook (ctxt.filename, &info, hook_data)) + break; diff --git a/0275-Make-debug-file-show-which-file-filters-get-run.patch b/0262-Make-debug-file-show-which-file-filters-get-run.patch similarity index 88% rename from 0275-Make-debug-file-show-which-file-filters-get-run.patch rename to 0262-Make-debug-file-show-which-file-filters-get-run.patch index 475b3b4..78bc095 100644 --- a/0275-Make-debug-file-show-which-file-filters-get-run.patch +++ b/0262-Make-debug-file-show-which-file-filters-get-run.patch @@ -10,20 +10,19 @@ This makes grub log which filter is being run, which makes it easier to figure out where you are in the sequence of events. Signed-off-by: Peter Jones -(cherry picked from commit d3d6518a13b5440a3be6c66b0ae47447182f2891) --- grub-core/kern/file.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c -index ed69fc0f0f..3f175630ea 100644 +index db938e099d..868ce3b63e 100644 --- a/grub-core/kern/file.c +++ b/grub-core/kern/file.c @@ -30,6 +30,14 @@ void (*EXPORT_VAR (grub_grubnet_fini)) (void); grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX]; -+static char *filter_names[] = { ++static const char *filter_names[] = { + [GRUB_FILE_FILTER_VERIFY] = "GRUB_FILE_FILTER_VERIFY", + [GRUB_FILE_FILTER_GZIO] = "GRUB_FILE_FILTER_GZIO", + [GRUB_FILE_FILTER_XZIO] = "GRUB_FILE_FILTER_XZIO", @@ -34,7 +33,7 @@ index ed69fc0f0f..3f175630ea 100644 /* Get the device part of the filename NAME. It is enclosed by parentheses. */ char * grub_file_get_device_name (const char *name) -@@ -121,6 +129,9 @@ grub_file_open (const char *name, enum grub_file_type type) +@@ -124,6 +132,9 @@ grub_file_open (const char *name, enum grub_file_type type) if (grub_file_filters[filter]) { last_file = file; diff --git a/0276-efi-use-enumerated-array-positions-for-our-allocatio.patch b/0263-efi-use-enumerated-array-positions-for-our-allocatio.patch similarity index 92% rename from 0276-efi-use-enumerated-array-positions-for-our-allocatio.patch rename to 0263-efi-use-enumerated-array-positions-for-our-allocatio.patch index de5671c..206e3a6 100644 --- a/0276-efi-use-enumerated-array-positions-for-our-allocatio.patch +++ b/0263-efi-use-enumerated-array-positions-for-our-allocatio.patch @@ -13,16 +13,15 @@ This patch changes them to be enumerated, so they're easier to refer to farther along in the code without confusion. Signed-off-by: Peter Jones -(cherry picked from commit 6768026270cca015d7fef0ecc8a4119e9b3d3923) --- grub-core/loader/i386/efi/linux.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index dc98077378..781a333162 100644 +index 91ae274299..8daa070132 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -61,17 +61,26 @@ struct allocation_choice { +@@ -60,17 +60,26 @@ struct allocation_choice { grub_efi_allocate_type_t alloc_type; }; @@ -55,7 +54,7 @@ index dc98077378..781a333162 100644 }; static struct allocation_choice saved_addresses[4]; -@@ -418,7 +427,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -405,7 +414,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (lh->xloadflags & LINUX_XLF_CAN_BE_LOADED_ABOVE_4G) { grub_dprintf ("linux", "Loading kernel above 4GB is supported; enabling.\n"); @@ -64,7 +63,7 @@ index dc98077378..781a333162 100644 } else { -@@ -491,11 +500,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -478,11 +487,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "lh->pref_address: %p\n", (void *)(grub_addr_t)lh->pref_address); if (lh->pref_address < (grub_uint64_t)GRUB_EFI_MAX_ALLOCATION_ADDRESS) { diff --git a/0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch b/0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch similarity index 87% rename from 0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch rename to 0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch index 4eccd77..d25cf30 100644 --- a/0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch +++ b/0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch @@ -13,16 +13,15 @@ appropriately, but does not change any current policy decision. It also adds a few debug prints. Signed-off-by: Peter Jones -(cherry picked from commit 36307bed28cd838116fc4af26a30719660d62d4c) --- grub-core/loader/i386/efi/linux.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 781a333162..b9cd443a9a 100644 +index 8daa070132..e6b8998e5e 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -56,7 +56,14 @@ struct grub_linuxefi_context { +@@ -55,7 +55,14 @@ struct grub_linuxefi_context { #define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12) @@ -37,7 +36,7 @@ index 781a333162..b9cd443a9a 100644 grub_efi_physical_address_t addr; grub_efi_allocate_type_t alloc_type; }; -@@ -65,6 +72,7 @@ enum { +@@ -64,6 +71,7 @@ enum { KERNEL_PREF_ADDRESS, KERNEL_4G_LIMIT, KERNEL_NO_LIMIT, @@ -45,7 +44,7 @@ index 781a333162..b9cd443a9a 100644 }; static struct allocation_choice max_addresses[] = -@@ -72,14 +80,17 @@ static struct allocation_choice max_addresses[] = +@@ -71,14 +79,17 @@ static struct allocation_choice max_addresses[] = /* the kernel overrides this one with pref_address and * GRUB_EFI_ALLOCATE_ADDRESS */ [KERNEL_PREF_ADDRESS] = @@ -66,7 +65,7 @@ index 781a333162..b9cd443a9a 100644 { NO_MEM, 0, 0 } }; static struct allocation_choice saved_addresses[4]; -@@ -96,7 +107,8 @@ kernel_free(void *addr, grub_efi_uintn_t size) +@@ -95,7 +106,8 @@ kernel_free(void *addr, grub_efi_uintn_t size) } static void * @@ -76,7 +75,7 @@ index 781a333162..b9cd443a9a 100644 grub_efi_memory_type_t memtype, const char * const errmsg) { -@@ -109,6 +121,9 @@ kernel_alloc(grub_efi_uintn_t size, +@@ -108,6 +120,9 @@ kernel_alloc(grub_efi_uintn_t size, grub_uint64_t max = max_addresses[i].addr; grub_efi_uintn_t pages; @@ -86,7 +85,7 @@ index 781a333162..b9cd443a9a 100644 /* * When we're *not* loading the kernel, or >4GB allocations aren't * supported, these entries are basically all the same, so don't re-try -@@ -262,7 +277,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -261,7 +276,8 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) } } @@ -96,7 +95,7 @@ index 781a333162..b9cd443a9a 100644 N_("can't allocate initrd")); if (initrd_mem == NULL) goto fail; -@@ -435,7 +451,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -422,7 +438,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } #endif @@ -106,7 +105,7 @@ index 781a333162..b9cd443a9a 100644 "cannot allocate kernel parameters"); if (!params) goto fail; -@@ -458,7 +475,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -445,7 +462,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "new lh is at %p\n", lh); grub_dprintf ("linux", "setting up cmdline\n"); @@ -115,7 +114,7 @@ index 781a333162..b9cd443a9a 100644 GRUB_EFI_RUNTIME_SERVICES_DATA, N_("can't allocate cmdline")); if (!cmdline) -@@ -506,7 +523,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -493,7 +510,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), max_addresses[KERNEL_4G_LIMIT].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; max_addresses[KERNEL_NO_LIMIT].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; kernel_size = lh->init_size; diff --git a/0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch b/0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch similarity index 87% rename from 0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch rename to 0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch index a58a8b6..47e31e2 100644 --- a/0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch +++ b/0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch @@ -15,16 +15,15 @@ for quite some time. Resolves: rhbz#2112134 Signed-off-by: Peter Jones -(cherry picked from commit 3e08c35f316990913718a4457665e8f653ecaa52) --- grub-core/loader/i386/efi/linux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index b9cd443a9a..801e663fee 100644 +index e6b8998e5e..d003b474ee 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -191,6 +191,8 @@ grub_linuxefi_unload (void *data) +@@ -190,6 +190,8 @@ grub_linuxefi_unload (void *data) cmd_initrdefi->data = 0; grub_free (context); @@ -33,7 +32,7 @@ index b9cd443a9a..801e663fee 100644 return GRUB_ERR_NONE; } -@@ -439,11 +441,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -426,11 +428,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } #endif @@ -47,7 +46,7 @@ index b9cd443a9a..801e663fee 100644 } else { -@@ -573,6 +577,8 @@ fail: +@@ -560,6 +564,8 @@ fail: grub_dl_unref (my_mod); diff --git a/0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch b/0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch similarity index 85% rename from 0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch rename to 0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch index 5ae7c7e..8451dbf 100644 --- a/0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch +++ b/0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch @@ -15,16 +15,15 @@ allocations, respectively. Resolves: rhbz#2108456 Signed-off-by: Peter Jones -(cherry picked from commit 35b5d5fa47bc394c76022e6595b173e68f53225e) --- grub-core/loader/i386/efi/linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 801e663fee..f23b3f7b01 100644 +index d003b474ee..ac5ef50bdb 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -280,7 +280,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) +@@ -279,7 +279,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[]) } grub_dprintf ("linux", "Trying to allocate initrd mem\n"); @@ -33,7 +32,7 @@ index 801e663fee..f23b3f7b01 100644 N_("can't allocate initrd")); if (initrd_mem == NULL) goto fail; -@@ -456,7 +456,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -443,7 +443,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), #endif params = kernel_alloc (KERNEL_MEM, sizeof(*params), @@ -42,7 +41,7 @@ index 801e663fee..f23b3f7b01 100644 "cannot allocate kernel parameters"); if (!params) goto fail; -@@ -480,7 +480,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -467,7 +467,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "setting up cmdline\n"); cmdline = kernel_alloc (KERNEL_MEM, lh->cmdline_size + 1, @@ -51,7 +50,7 @@ index 801e663fee..f23b3f7b01 100644 N_("can't allocate cmdline")); if (!cmdline) goto fail; -@@ -529,7 +529,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -516,7 +516,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), kernel_size = lh->init_size; grub_dprintf ("linux", "Trying to allocate kernel mem\n"); kernel_mem = kernel_alloc (KERNEL_MEM, kernel_size, diff --git a/0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch b/0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch similarity index 86% rename from 0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch rename to 0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch index 8d7405e..50ba0fb 100644 --- a/0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch +++ b/0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch @@ -4,16 +4,15 @@ Date: Tue, 2 Aug 2022 15:56:28 -0400 Subject: [PATCH] BLS: create /etc/kernel/cmdline during mkconfig Signed-off-by: Robbie Harwood -(cherry picked from commit 0837dcdf17ac0429bafa4dbf063b2a94385c04ca) --- util/grub.d/10_linux.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 6ee0a2cf3d..ec529eb814 100644 +index 865af3d6c4..9ebff661a9 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -166,6 +166,12 @@ update_bls_cmdline() +@@ -161,6 +161,12 @@ update_bls_cmdline() local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" local -a files=($(get_sorted_bls)) diff --git a/0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch b/0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch similarity index 90% rename from 0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch rename to 0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch index 9498f71..67073ec 100644 --- a/0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch +++ b/0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch @@ -4,16 +4,15 @@ Date: Wed, 17 Aug 2022 10:26:07 -0400 Subject: [PATCH] squish: don't dup rhgb quiet, check mtimes Signed-off-by: Robbie Harwood -(cherry picked from commit 275a0487c74e309cfd0a8c670740f6c34e729c45) --- util/grub.d/10_linux.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ec529eb814..becf5ba9c6 100644 +index 9ebff661a9..41c6cb1dc2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -166,10 +166,16 @@ update_bls_cmdline() +@@ -161,10 +161,16 @@ update_bls_cmdline() local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" local -a files=($(get_sorted_bls)) diff --git a/0282-squish-give-up-on-rhgb-quiet.patch b/0269-squish-give-up-on-rhgb-quiet.patch similarity index 84% rename from 0282-squish-give-up-on-rhgb-quiet.patch rename to 0269-squish-give-up-on-rhgb-quiet.patch index 6e994ed..5858c91 100644 --- a/0282-squish-give-up-on-rhgb-quiet.patch +++ b/0269-squish-give-up-on-rhgb-quiet.patch @@ -4,16 +4,15 @@ Date: Wed, 17 Aug 2022 11:30:30 -0400 Subject: [PATCH] squish: give up on rhgb quiet Signed-off-by: Robbie Harwood -(cherry picked from commit 12354f586f0748efc5c016b7d2053330f784ab4e) --- util/grub.d/10_linux.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index becf5ba9c6..5a7e5326da 100644 +index 41c6cb1dc2..5d1fa072f2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -171,10 +171,6 @@ update_bls_cmdline() +@@ -166,10 +166,6 @@ update_bls_cmdline() # anaconda has the correct information to create this during install; # afterward, grubby will take care of syncing on updates. If the user # has modified /etc/default/grub, try to cope. diff --git a/0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch b/0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch similarity index 94% rename from 0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch rename to 0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch index e1e6a87..d5ac923 100644 --- a/0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch +++ b/0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch @@ -27,16 +27,15 @@ but ratcheting it into existing systems needs more careful thought. Signed-off-by: Jonathan Lebon Fixes: https://github.com/fedora-silverblue/issue-tracker/issues/322 -(cherry picked from commit 3c3d1a3c4a2dc4adfb38c2724618fefc913a63fc) --- util/grub.d/10_linux.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 5a7e5326da..b1b9255c32 100644 +index 5d1fa072f2..4795a63b4c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -166,12 +166,13 @@ update_bls_cmdline() +@@ -161,12 +161,13 @@ update_bls_cmdline() local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" local -a files=($(get_sorted_bls)) diff --git a/0271-blscfg-Don-t-root-device-in-emu-builds.patch b/0271-blscfg-Don-t-root-device-in-emu-builds.patch new file mode 100644 index 0000000..3fe8baf --- /dev/null +++ b/0271-blscfg-Don-t-root-device-in-emu-builds.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 25 Aug 2022 17:57:55 -0400 +Subject: [PATCH] blscfg: Don't root device in emu builds + +Otherwise, we end up looking for kernel/initrd in /boot/boot which +doesn't work at all. Non-emu builds need to be looking in +($root)/boot/, which is what this is for. + +Signed-off-by: Robbie Harwood +--- + grub-core/commands/blscfg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index e907a6a5d2..dbd0899acf 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -41,7 +41,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + + #define GRUB_BLS_CONFIG_PATH "/loader/entries/" + #ifdef GRUB_MACHINE_EMU +-#define GRUB_BOOT_DEVICE "/boot" ++#define GRUB_BOOT_DEVICE "" + #else + #define GRUB_BOOT_DEVICE "($root)" + #endif diff --git a/0272-loader-arm64-linux-Remove-magic-number-header-field-.patch b/0272-loader-arm64-linux-Remove-magic-number-header-field-.patch new file mode 100644 index 0000000..faaa071 --- /dev/null +++ b/0272-loader-arm64-linux-Remove-magic-number-header-field-.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Thu, 11 Aug 2022 16:51:57 +0200 +Subject: [PATCH] loader/arm64/linux: Remove magic number header field check + +The "ARM\x64" magic number in the file header identifies an image as one +that implements the bare metal boot protocol, allowing the loader to +simply move the file to a suitably aligned address in memory, with +sufficient headroom for the trailing .bss segment (the required memory +size is described in the header as well). + +Note of this matters for GRUB, as it only supports EFI boot. EFI does +not care about this magic number, and nor should GRUB: this prevents us +from booting other PE linux images, such as the generic EFI zboot +decompressor, which is a pure PE/COFF image, and does not implement the +bare metal boot protocol. + +So drop the magic number check. + +Signed-off-by: Ard Biesheuvel +Reviewed-by: Daniel Kiper +Resolves: rhbz#2125069 +Signed-off-by: Jeremy Linton +(cherry-picked from commit 69edb31205602c29293a8c6e67363bba2a4a1e66) +Signed-off-by: Robbie Harwood +--- + grub-core/loader/arm64/linux.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index de85583487..489d0c7173 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -55,9 +55,6 @@ static grub_addr_t initrd_end; + grub_err_t + grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh) + { +- if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE) +- return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); +- + if ((lh->code0 & 0xffff) != GRUB_DOS_MAGIC) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); diff --git a/0273-Correct-BSS-zeroing-on-aarch64.patch b/0273-Correct-BSS-zeroing-on-aarch64.patch new file mode 100644 index 0000000..4f9a2b7 --- /dev/null +++ b/0273-Correct-BSS-zeroing-on-aarch64.patch @@ -0,0 +1,95 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Linton +Date: Tue, 6 Sep 2022 15:33:03 -0500 +Subject: [PATCH] Correct BSS zeroing on aarch64 + +The aarch64 loader doesn't use efi bootservices, and +therefor it has a very minimal loader which makes a lot +of assumptions about the kernel layout. With the ZBOOT +changes, the layout has changed a bit and we not should +really be parsing the PE sections to determine how much +data to copy, otherwise the BSS won't be setup properly. + +This code still makes a lot of assumptions about the +the kernel layout, so its far from ideal, but it works. + +Resolves: rhbz#2125069 + +Signed-off-by: Jeremy Linton +--- + grub-core/loader/arm64/linux.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 489d0c7173..419f2201df 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -316,10 +316,12 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + static grub_err_t + parse_pe_header (void *kernel, grub_uint64_t *total_size, + grub_uint32_t *entry_offset, +- grub_uint32_t *alignment) ++ grub_uint32_t *alignment,grub_uint32_t *code_size) + { + struct linux_arch_kernel_header *lh = kernel; + struct grub_armxx_linux_pe_header *pe; ++ grub_uint16_t i; ++ struct grub_pe32_section_table *sections; + + pe = (void *)((unsigned long)kernel + lh->hdr_offset); + +@@ -329,6 +331,19 @@ parse_pe_header (void *kernel, grub_uint64_t *total_size, + *total_size = pe->opt.image_size; + *entry_offset = pe->opt.entry_addr; + *alignment = pe->opt.section_alignment; ++ *code_size = pe->opt.section_alignment; ++ ++ sections = (struct grub_pe32_section_table *) ((char *)&pe->opt + ++ pe->coff.optional_header_size); ++ grub_dprintf ("linux", "num_sections : %d\n", pe->coff.num_sections ); ++ for (i = 0 ; i < pe->coff.num_sections; i++) ++ { ++ grub_dprintf ("linux", "raw_size : %lld\n", ++ (long long) sections[i].raw_data_size); ++ grub_dprintf ("linux", "virt_size : %lld\n", ++ (long long) sections[i].virtual_size); ++ *code_size += sections[i].raw_data_size; ++ } + + return GRUB_ERR_NONE; + } +@@ -341,6 +356,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_err_t err; + grub_off_t filelen; + grub_uint32_t align; ++ grub_uint32_t code_size; + void *kernel = NULL; + int nx_supported = 1; + +@@ -373,11 +389,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + if (grub_arch_efi_linux_check_image (kernel) != GRUB_ERR_NONE) + goto fail; +- if (parse_pe_header (kernel, &kernel_size, &handover_offset, &align) != GRUB_ERR_NONE) ++ if (parse_pe_header (kernel, &kernel_size, &handover_offset, &align, &code_size) != GRUB_ERR_NONE) + goto fail; + grub_dprintf ("linux", "kernel mem size : %lld\n", (long long) kernel_size); + grub_dprintf ("linux", "kernel entry offset : %d\n", handover_offset); + grub_dprintf ("linux", "kernel alignment : 0x%x\n", align); ++ grub_dprintf ("linux", "kernel size : 0x%x\n", code_size); + + err = grub_efi_check_nx_image_support((grub_addr_t)kernel, filelen, &nx_supported); + if (err != GRUB_ERR_NONE) +@@ -396,9 +413,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + kernel_addr = (void *)ALIGN_UP((grub_uint64_t)kernel_alloc_addr, align); + + grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); +- grub_memcpy (kernel_addr, kernel, grub_min(filelen, kernel_size)); +- if (kernel_size > filelen) +- grub_memset ((char *)kernel_addr + filelen, 0, kernel_size - filelen); ++ grub_memcpy (kernel_addr, kernel, grub_min(code_size, kernel_size)); ++ if (kernel_size > code_size) ++ grub_memset ((char *)kernel_addr + code_size, 0, kernel_size - code_size); + grub_free(kernel); + kernel = NULL; + diff --git a/0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch b/0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch new file mode 100644 index 0000000..eff155d --- /dev/null +++ b/0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: dann frazier +Date: Thu, 25 Aug 2022 17:08:09 -0600 +Subject: [PATCH] linuxefi: Invalidate i-cache before starting the kernel + +We need to flush the memory range of the code we are about to execute +from the instruction cache before we can safely execute it. Not doing +so appears to be the source of rare synchronous exceptions a user +is seeing on a Cortex-A72-based platform while executing the Linux EFI +stub. Notably they seem to correlate with an instruction on a cache +line boundary. + +Signed-off-by: dann frazier +--- + grub-core/loader/efi/linux.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c +index 277f352e0c..e413bdcc23 100644 +--- a/grub-core/loader/efi/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -16,6 +16,7 @@ + * along with GRUB. If not, see . + */ + ++#include + #include + #include + #include +@@ -210,6 +211,9 @@ grub_efi_linux_boot (grub_addr_t kernel_addr, grub_size_t kernel_size, + asm volatile ("cli"); + #endif + ++ /* Invalidate the instruction cache */ ++ grub_arch_sync_caches((void *)kernel_addr, kernel_size); ++ + hf = (handover_func)((char *)kernel_addr + handover_offset + offset); + hf (grub_efi_image_handle, grub_efi_system_table, kernel_params); + diff --git a/0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch b/0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch similarity index 90% rename from 0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch rename to 0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch index 12c3525..0079750 100644 --- a/0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch +++ b/0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch @@ -17,16 +17,15 @@ This patch makes the size of the backup storage be based on the size of the initial policy data. Signed-off-by: Peter Jones -(cherry picked from commit 37747b22342499a798ca3a8895770cd93b6e1258) --- grub-core/loader/i386/efi/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index f23b3f7b01..18aadc3e07 100644 +index ac5ef50bdb..9854b0defa 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -93,7 +93,7 @@ static struct allocation_choice max_addresses[] = +@@ -92,7 +92,7 @@ static struct allocation_choice max_addresses[] = { INITRD_MEM, GRUB_EFI_MAX_ALLOCATION_ADDRESS, GRUB_EFI_ALLOCATE_MAX_ADDRESS }, { NO_MEM, 0, 0 } }; diff --git a/0285-commands-efi-tpm-Refine-the-status-of-log-event.patch b/0276-commands-efi-tpm-Refine-the-status-of-log-event.patch similarity index 96% rename from 0285-commands-efi-tpm-Refine-the-status-of-log-event.patch rename to 0276-commands-efi-tpm-Refine-the-status-of-log-event.patch index 12315fd..896e49b 100644 --- a/0285-commands-efi-tpm-Refine-the-status-of-log-event.patch +++ b/0276-commands-efi-tpm-Refine-the-status-of-log-event.patch @@ -9,7 +9,6 @@ Subject: [PATCH] commands/efi/tpm: Refine the status of log event Signed-off-by: Lu Ken Reviewed-by: Daniel Kiper (cherry picked from commit 922898573e37135f5dedc16f3e15a1d1d4c53f8a) -(cherry picked from commit a326f1247c4d3a1d1079eacbe7e58b35b9a287e2) --- grub-core/commands/efi/tpm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch b/0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch similarity index 96% rename from 0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch rename to 0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch index 3e8d899..e04dcbc 100644 --- a/0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch +++ b/0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch @@ -9,7 +9,6 @@ using grub_memcpy(). Signed-off-by: Lu Ken Reviewed-by: Daniel Kiper (cherry picked from commit ef8679b645a63eb9eb191bb9539d7d25a9d6ff3b) -(cherry picked from commit 6d0d478585c435cce50d4025d2301dc0413bc5c0) --- grub-core/commands/efi/tpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch b/0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch similarity index 99% rename from 0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch rename to 0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch index c8b703b..610c81a 100644 --- a/0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch +++ b/0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch @@ -13,7 +13,6 @@ The EDKII header file is available at https://github.com/tianocore/edk2/blob/mas Signed-off-by: Lu Ken Reviewed-by: Daniel Kiper (cherry picked from commit 4c76565b6cb885b7e144dc27f3612066844e2d19) -(cherry picked from commit cad2fc1ff659390a228efb474a72f7ed7ab21697) --- grub-core/commands/efi/tpm.c | 48 ++++++++++++++ include/grub/efi/cc.h | 151 +++++++++++++++++++++++++++++++++++++++++++ diff --git a/0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch b/0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch similarity index 94% rename from 0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch rename to 0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch index e264b09..e0dd347 100644 --- a/0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch +++ b/0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch @@ -10,7 +10,6 @@ metadata. Reject the glyph (and font) if such limits are exceeded. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 5760fcfd466cc757540ea0d591bad6a08caeaa16) -(cherry picked from commit 3b410ef4bb95e607cadeba2193fa90ae9bddb98d) --- grub-core/font/font.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch b/0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch similarity index 98% rename from 0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch rename to 0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch index 7ec23ab..b5f10f6 100644 --- a/0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch +++ b/0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch @@ -18,7 +18,6 @@ and return value are designed to be consistent with other safemath macros. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 941d10ad6f1dcbd12fb613002249e29ba035f985) -(cherry picked from commit 6bca9693878bdf61dd62b8c784862a48e75f569a) --- grub-core/font/font.c | 17 +++++++++++++---- include/grub/bitmap.h | 18 ++++++++++++++++++ diff --git a/0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch b/0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch similarity index 97% rename from 0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch rename to 0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch index fcc1d3c..3c76eb4 100644 --- a/0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch +++ b/0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch @@ -15,7 +15,6 @@ Reported-by: Zhang Boyang Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit b1805f251b31a9d3cfae5c3572ddfa630145dbbf) -(cherry picked from commit b91eb9bd6c724339b7d7bb4765b9d36f1ee88b84) --- grub-core/font/font.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/0291-font-Remove-grub_font_dup_glyph.patch b/0282-font-Remove-grub_font_dup_glyph.patch similarity index 95% rename from 0291-font-Remove-grub_font_dup_glyph.patch rename to 0282-font-Remove-grub_font_dup_glyph.patch index a3493f6..4c3db92 100644 --- a/0291-font-Remove-grub_font_dup_glyph.patch +++ b/0282-font-Remove-grub_font_dup_glyph.patch @@ -9,7 +9,6 @@ I'm too lazy to fix the integer overflow problem in it. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 25ad31c19c331aaa2dbd9bd2b2e2655de5766a9d) -(cherry picked from commit ad950e1e033318bb50222ed268a6dcfb97389035) --- grub-core/font/font.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/0292-font-Fix-integer-overflow-in-ensure_comb_space.patch b/0283-font-Fix-integer-overflow-in-ensure_comb_space.patch similarity index 96% rename from 0292-font-Fix-integer-overflow-in-ensure_comb_space.patch rename to 0283-font-Fix-integer-overflow-in-ensure_comb_space.patch index af5eedb..6b73038 100644 --- a/0292-font-Fix-integer-overflow-in-ensure_comb_space.patch +++ b/0283-font-Fix-integer-overflow-in-ensure_comb_space.patch @@ -12,7 +12,6 @@ returns NULL. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit b2740b7e4a03bb8331d48b54b119afea76bb9d5f) -(cherry picked from commit f66ea1e60c347408e92b6695d5105c7e0f24d568) --- grub-core/font/font.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/0293-font-Fix-integer-overflow-in-BMP-index.patch b/0284-font-Fix-integer-overflow-in-BMP-index.patch similarity index 97% rename from 0293-font-Fix-integer-overflow-in-BMP-index.patch rename to 0284-font-Fix-integer-overflow-in-BMP-index.patch index bb22749..5e10699 100644 --- a/0293-font-Fix-integer-overflow-in-BMP-index.patch +++ b/0284-font-Fix-integer-overflow-in-BMP-index.patch @@ -19,7 +19,6 @@ On the occasion add a comment about BMP index is initialized to 0xffff. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit afda8b60ba0712abe01ae1e64c5f7a067a0e6492) -(cherry picked from commit 6d90568929e11739b56f09ebbce9185ca9c23519) --- grub-core/font/font.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch b/0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch similarity index 97% rename from 0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch rename to 0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch index 5c25e09..e81824b 100644 --- a/0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch +++ b/0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch @@ -12,7 +12,6 @@ with the libstdc++'s std::lower_bound() implementation. Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit c140a086838e7c9af87842036f891b8393a8c4bc) -(cherry picked from commit e110997335b1744464ea232d57a7d86e16ca8dee) --- grub-core/font/font.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/0295-kern-efi-sb-Enforce-verification-of-font-files.patch b/0286-kern-efi-sb-Enforce-verification-of-font-files.patch similarity index 96% rename from 0295-kern-efi-sb-Enforce-verification-of-font-files.patch rename to 0286-kern-efi-sb-Enforce-verification-of-font-files.patch index 42fea35..1a381b0 100644 --- a/0295-kern-efi-sb-Enforce-verification-of-font-files.patch +++ b/0286-kern-efi-sb-Enforce-verification-of-font-files.patch @@ -21,7 +21,6 @@ Suggested-by: Daniel Kiper Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 630deb8c0d8b02b670ced4b7030414bcf17aa080) -(cherry picked from commit 37257e0ee45b9029b62f4046c983481d063b821d) --- grub-core/kern/efi/sb.c | 1 - grub-core/kern/lockdown.c | 1 + diff --git a/0296-fbutil-Fix-integer-overflow.patch b/0287-fbutil-Fix-integer-overflow.patch similarity index 98% rename from 0296-fbutil-Fix-integer-overflow.patch rename to 0287-fbutil-Fix-integer-overflow.patch index f8e82e5..4d32dbd 100644 --- a/0296-fbutil-Fix-integer-overflow.patch +++ b/0287-fbutil-Fix-integer-overflow.patch @@ -26,7 +26,6 @@ says it's arguments must be valid and no sanity check is performed Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 50a11a81bc842c58962244a2dc86bbd31a426e12) -(cherry picked from commit 8fa75d647362c938c4cc302cf5945b31fb92c078) --- grub-core/video/fb/fbutil.c | 4 ++-- include/grub/fbutil.h | 13 +++++++++---- diff --git a/0297-font-Fix-an-integer-underflow-in-blit_comb.patch b/0288-font-Fix-an-integer-underflow-in-blit_comb.patch similarity index 98% rename from 0297-font-Fix-an-integer-underflow-in-blit_comb.patch rename to 0288-font-Fix-an-integer-underflow-in-blit_comb.patch index b8a0e9e..72f4308 100644 --- a/0297-font-Fix-an-integer-underflow-in-blit_comb.patch +++ b/0288-font-Fix-an-integer-underflow-in-blit_comb.patch @@ -25,7 +25,6 @@ Reported-by: Daniel Axtens Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit 6d2668dea3774ed74c4cd1eadd146f1b846bc3d4) -(cherry picked from commit 05e532fb707bbf79aa4e1efbde4d208d7da89d6b) --- grub-core/font/font.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch b/0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch similarity index 97% rename from 0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch rename to 0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch index 307572c..5207c12 100644 --- a/0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch +++ b/0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch @@ -30,7 +30,6 @@ Reported-by: Daniel Axtens Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit fcd7aa0c278f7cf3fb9f93f1a3966e1792339eb6) -(cherry picked from commit 1d37ec63a1c76a14fdf70f548eada92667b42ddb) --- grub-core/font/font.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch b/0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch similarity index 95% rename from 0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch rename to 0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch index 368b9d0..c2bcc18 100644 --- a/0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch +++ b/0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch @@ -15,7 +15,6 @@ Reported-by: Daniel Axtens Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit dd539d695482069d28b40f2d3821f710cdcf6ee6) -(cherry picked from commit 87526376857eaceae474c9797e3cee5b50597332) --- grub-core/font/font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch b/0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch similarity index 96% rename from 0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch rename to 0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch index 96f2f94..ec2184f 100644 --- a/0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch +++ b/0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch @@ -18,7 +18,6 @@ Reported-by: Daniel Axtens Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper (cherry picked from commit da90d62316a3b105d2fbd7334d6521936bd6dcf6) -(cherry picked from commit 26fafec86000b5322837722a115279ef03922ca6) --- grub-core/normal/charset.c | 3 +++ include/grub/unicode.h | 2 ++ diff --git a/0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch b/0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch new file mode 100644 index 0000000..bad9d90 --- /dev/null +++ b/0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch @@ -0,0 +1,78 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Coulson +Date: Wed, 16 Nov 2022 14:40:04 +0000 +Subject: [PATCH] font: Try opening fonts from the bundled memdisk + +Signed-off-by: Robbie Harwood +--- + grub-core/font/font.c | 48 +++++++++++++++++++++++++++++++----------------- + 1 file changed, 31 insertions(+), 17 deletions(-) + +diff --git a/grub-core/font/font.c b/grub-core/font/font.c +index e6616e610c..e421d1ae6f 100644 +--- a/grub-core/font/font.c ++++ b/grub-core/font/font.c +@@ -409,6 +409,27 @@ read_section_as_short (struct font_file_section *section, + return 0; + } + ++static grub_file_t ++try_open_from_prefix (const char *prefix, const char *filename) ++{ ++ grub_file_t file; ++ char *fullname, *ptr; ++ ++ fullname = grub_malloc (grub_strlen (prefix) + grub_strlen (filename) + 1 ++ + sizeof ("/fonts/") + sizeof (".pf2")); ++ if (!fullname) ++ return 0; ++ ptr = grub_stpcpy (fullname, prefix); ++ ptr = grub_stpcpy (ptr, "/fonts/"); ++ ptr = grub_stpcpy (ptr, filename); ++ ptr = grub_stpcpy (ptr, ".pf2"); ++ *ptr = 0; ++ ++ file = grub_buffile_open (fullname, GRUB_FILE_TYPE_FONT, 1024); ++ grub_free (fullname); ++ return file; ++} ++ + /* Load a font and add it to the beginning of the global font list. + Returns 0 upon success, nonzero upon failure. */ + grub_font_t +@@ -427,25 +448,18 @@ grub_font_load (const char *filename) + file = grub_buffile_open (filename, GRUB_FILE_TYPE_FONT, 1024); + else + { +- const char *prefix = grub_env_get ("prefix"); +- char *fullname, *ptr; +- if (!prefix) ++ file = try_open_from_prefix ("(memdisk)", filename); ++ if (!file) + { +- grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), +- "prefix"); +- goto fail; ++ const char *prefix = grub_env_get ("prefix"); ++ if (!prefix) ++ { ++ grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), ++ "prefix"); ++ goto fail; ++ } ++ file = try_open_from_prefix (prefix, filename); + } +- fullname = grub_malloc (grub_strlen (prefix) + grub_strlen (filename) + 1 +- + sizeof ("/fonts/") + sizeof (".pf2")); +- if (!fullname) +- goto fail; +- ptr = grub_stpcpy (fullname, prefix); +- ptr = grub_stpcpy (ptr, "/fonts/"); +- ptr = grub_stpcpy (ptr, filename); +- ptr = grub_stpcpy (ptr, ".pf2"); +- *ptr = 0; +- file = grub_buffile_open (fullname, GRUB_FILE_TYPE_FONT, 1024); +- grub_free (fullname); + } + if (!file) + goto fail; diff --git a/0302-mm-Clarify-grub_real_malloc.patch b/0293-mm-Clarify-grub_real_malloc.patch similarity index 98% rename from 0302-mm-Clarify-grub_real_malloc.patch rename to 0293-mm-Clarify-grub_real_malloc.patch index 8bbe52f..0a99c08 100644 --- a/0302-mm-Clarify-grub_real_malloc.patch +++ b/0293-mm-Clarify-grub_real_malloc.patch @@ -26,7 +26,6 @@ Document that. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 246ad6a44c281bb13486ddea0a26bb661db73106) -(cherry picked from commit b590e0181a94b3d48ca0c537565c946fad8e6a4f) --- grub-core/kern/mm.c | 76 +++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch b/0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch similarity index 95% rename from 0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch rename to 0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch index 64a686c..a5601c9 100644 --- a/0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch +++ b/0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch @@ -13,7 +13,6 @@ Fixes: 45bf8b3a7549 (* grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit a847895a8d000bdf27ad4d4326f883a0eed769ca) -(cherry picked from commit 16f329218ced9302554bde95084e6a2ad308733b) --- grub-core/kern/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0304-mm-Document-grub_free.patch b/0295-mm-Document-grub_free.patch similarity index 97% rename from 0304-mm-Document-grub_free.patch rename to 0295-mm-Document-grub_free.patch index 238f410..6c9b7cc 100644 --- a/0304-mm-Document-grub_free.patch +++ b/0295-mm-Document-grub_free.patch @@ -14,7 +14,6 @@ Use prev and cur to iterate over the free list. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 1f8d0b01738e49767d662d6426af3570a64565f0) -(cherry picked from commit 6fd181e46a16f0219b586ce0bd44928a3f58dec8) --- grub-core/kern/mm.c | 63 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/0305-mm-Document-grub_mm_init_region.patch b/0296-mm-Document-grub_mm_init_region.patch similarity index 97% rename from 0305-mm-Document-grub_mm_init_region.patch rename to 0296-mm-Document-grub_mm_init_region.patch index d819fa3..0173f04 100644 --- a/0305-mm-Document-grub_mm_init_region.patch +++ b/0296-mm-Document-grub_mm_init_region.patch @@ -9,7 +9,6 @@ around region merging. Make it a bit clearer. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 246d69b7ea619fc1e77dcc5960e37aea45a9808c) -(cherry picked from commit 1eb53ad7659ee1d8141fe31138d0df9873b09182) --- grub-core/kern/mm.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/0306-mm-Document-GRUB-internal-memory-management-structur.patch b/0297-mm-Document-GRUB-internal-memory-management-structur.patch similarity index 97% rename from 0306-mm-Document-GRUB-internal-memory-management-structur.patch rename to 0297-mm-Document-GRUB-internal-memory-management-structur.patch index 657555b..c793926 100644 --- a/0306-mm-Document-GRUB-internal-memory-management-structur.patch +++ b/0297-mm-Document-GRUB-internal-memory-management-structur.patch @@ -12,7 +12,6 @@ has to figure it out! Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit a6c5c52ccffd2674d43db25fb4baa9c528526aa0) -(cherry picked from commit 222eb8897c25581e63a352633528fc130d151a64) --- include/grub/mm_private.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch b/0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch similarity index 96% rename from 0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch rename to 0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch index bff055a..2893784 100644 --- a/0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch +++ b/0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch @@ -20,7 +20,6 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 1df8fe66c57087eb33bd6dc69f786ed124615aa7) -(cherry picked from commit f4d39686e773274e690ada441f5e128ac3c4ac06) --- include/grub/mm_private.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch b/0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch similarity index 99% rename from 0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch rename to 0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch index e0e4b71..52cfeee 100644 --- a/0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch +++ b/0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch @@ -27,7 +27,6 @@ Tested-by: Stefan Berger Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 052e6068be622ff53f1238b449c300dbd0a8abcd) -(cherry picked from commit 9b7b9820e37b6828ea9b7da15f8da952a53a3df5) --- grub-core/kern/mm.c | 128 +++++++++++++++++++++++++++++----------------- include/grub/mm_private.h | 9 ++++ diff --git a/0309-mm-Debug-support-for-region-operations.patch b/0300-mm-Debug-support-for-region-operations.patch similarity index 97% rename from 0309-mm-Debug-support-for-region-operations.patch rename to 0300-mm-Debug-support-for-region-operations.patch index 86a6205..f434260 100644 --- a/0309-mm-Debug-support-for-region-operations.patch +++ b/0300-mm-Debug-support-for-region-operations.patch @@ -9,7 +9,6 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 8afa5ef45b797ba5d8147ceee85ac2c59dcc7f09) -(cherry picked from commit 4eb79abc52d35f40afc21e241561cf1dd8251a7b) --- grub-core/kern/mm.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch b/0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch similarity index 97% rename from 0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch rename to 0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch index f5357a8..a18d912 100644 --- a/0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch +++ b/0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch @@ -13,7 +13,6 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 139fd9b134a01e0b5fe0ebefafa7f48d1ffb6d60) -(cherry picked from commit 81267ca5387486ede52e0462a71555bc6d181085) --- grub-core/kern/dl.c | 20 -------------------- grub-core/kern/mm.c | 8 -------- diff --git a/0311-mm-Allow-dynamically-requesting-additional-memory-re.patch b/0302-mm-Allow-dynamically-requesting-additional-memory-re.patch similarity index 98% rename from 0311-mm-Allow-dynamically-requesting-additional-memory-re.patch rename to 0302-mm-Allow-dynamically-requesting-additional-memory-re.patch index cde9cba..d225c10 100644 --- a/0311-mm-Allow-dynamically-requesting-additional-memory-re.patch +++ b/0302-mm-Allow-dynamically-requesting-additional-memory-re.patch @@ -32,7 +32,6 @@ Tested-by: Stefan Berger Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 887f98f0db43e33fba4ec1f85e42fae1185700bc) -(cherry picked from commit 8f3238a7dc482497e76b5ef6fbeb04f84d9a9aaa) --- grub-core/kern/mm.c | 30 ++++++++++++++++++++++++++++++ include/grub/mm.h | 18 ++++++++++++++++++ diff --git a/0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch b/0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch similarity index 95% rename from 0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch rename to 0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch index 59ef18a..6fa378c 100644 --- a/0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch +++ b/0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch @@ -24,13 +24,12 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 938c3760b8c0fca759140be48307179b50107ff6) -(cherry picked from commit 90e793a2ef3bc35609cb1b605ebd1fae15dd4b2d) --- grub-core/kern/efi/mm.c | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 88364d764c..f574edabef 100644 +index e460b072e6..782a1365a1 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -38,9 +38,8 @@ @@ -69,7 +68,7 @@ index 88364d764c..f574edabef 100644 /* Add memory regions. */ static void add_memory_regions (grub_efi_memory_descriptor_t *memory_map, -@@ -695,8 +677,6 @@ grub_efi_mm_init (void) +@@ -694,8 +676,6 @@ grub_efi_mm_init (void) grub_efi_memory_descriptor_t *filtered_memory_map_end; grub_efi_uintn_t map_size; grub_efi_uintn_t desc_size; @@ -78,7 +77,7 @@ index 88364d764c..f574edabef 100644 int mm_status; grub_nx_init (); -@@ -738,22 +718,13 @@ grub_efi_mm_init (void) +@@ -737,22 +717,13 @@ grub_efi_mm_init (void) filtered_memory_map_end = filter_memory_map (memory_map, filtered_memory_map, desc_size, memory_map_end); diff --git a/0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch b/0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch similarity index 89% rename from 0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch rename to 0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch index 5d39c57..28cf2e7 100644 --- a/0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch +++ b/0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch @@ -13,16 +13,15 @@ Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 96a7ea29e3cb61b6c2302e260e8e6a6117e17fa3) [rharwood: backport around our nx] -(cherry picked from commit 4a85c48111f5e516cbc000bf4a7bc989b36d623c) --- grub-core/kern/efi/mm.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index f574edabef..9c9f9ac0c5 100644 +index 782a1365a1..a1d3b51fe6 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c -@@ -668,8 +668,8 @@ grub_nx_init (void) +@@ -667,8 +667,8 @@ grub_nx_init (void) } } @@ -33,7 +32,7 @@ index f574edabef..9c9f9ac0c5 100644 { grub_efi_memory_descriptor_t *memory_map; grub_efi_memory_descriptor_t *memory_map_end; -@@ -684,7 +684,7 @@ grub_efi_mm_init (void) +@@ -683,7 +683,7 @@ grub_efi_mm_init (void) /* Prepare a memory region to store two memory maps. */ memory_map = grub_efi_allocate_any_pages (2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); if (! memory_map) @@ -42,7 +41,7 @@ index f574edabef..9c9f9ac0c5 100644 /* Obtain descriptors for available memory. */ map_size = MEMORY_MAP_SIZE; -@@ -702,14 +702,14 @@ grub_efi_mm_init (void) +@@ -701,14 +701,14 @@ grub_efi_mm_init (void) memory_map = grub_efi_allocate_any_pages (2 * BYTES_TO_PAGES (map_size)); if (! memory_map) @@ -59,7 +58,7 @@ index f574edabef..9c9f9ac0c5 100644 memory_map_end = NEXT_MEMORY_DESCRIPTOR (memory_map, map_size); -@@ -724,7 +724,7 @@ grub_efi_mm_init (void) +@@ -723,7 +723,7 @@ grub_efi_mm_init (void) /* Allocate memory regions for GRUB's memory management. */ add_memory_regions (filtered_memory_map, desc_size, @@ -68,7 +67,7 @@ index f574edabef..9c9f9ac0c5 100644 #if 0 /* For debug. */ -@@ -742,6 +742,15 @@ grub_efi_mm_init (void) +@@ -741,6 +741,15 @@ grub_efi_mm_init (void) /* Release the memory maps. */ grub_efi_free_pages ((grub_addr_t) memory_map, 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); diff --git a/0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch b/0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch similarity index 93% rename from 0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch rename to 0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch index 82322aa..b4b7891 100644 --- a/0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch +++ b/0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch @@ -20,13 +20,12 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 15a015698921240adc1ac266a3b5bc5fcbd81521) -(cherry picked from commit c39acabc11d98ba18c6724eeb446508da7410c68) --- grub-core/kern/efi/mm.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 9c9f9ac0c5..29cf178aa9 100644 +index a1d3b51fe6..e0ebc65dba 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -514,7 +514,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, @@ -64,7 +63,7 @@ index 9c9f9ac0c5..29cf178aa9 100644 } void -@@ -677,6 +681,7 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) +@@ -676,6 +680,7 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) grub_efi_memory_descriptor_t *filtered_memory_map_end; grub_efi_uintn_t map_size; grub_efi_uintn_t desc_size; @@ -72,7 +71,7 @@ index 9c9f9ac0c5..29cf178aa9 100644 int mm_status; grub_nx_init (); -@@ -723,8 +728,11 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) +@@ -722,8 +727,11 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) sort_memory_map (filtered_memory_map, desc_size, filtered_memory_map_end); /* Allocate memory regions for GRUB's memory management. */ diff --git a/0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch b/0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch similarity index 90% rename from 0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch rename to 0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch index 45f4991..1f52581 100644 --- a/0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch +++ b/0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch @@ -14,13 +14,12 @@ Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Tested-by: Patrick Steinhardt (cherry picked from commit 1df2934822df4c1170dde069d97cfbf7a9572bba) -(cherry picked from commit d2c744833aafcd84485e7b1faebaade5bfe7db7a) --- grub-core/kern/efi/mm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 29cf178aa9..fc7561bbf7 100644 +index e0ebc65dba..016ba6cf2f 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -518,7 +518,8 @@ static grub_err_t @@ -44,7 +43,7 @@ index 29cf178aa9..fc7561bbf7 100644 if (pages > required_pages) { start += PAGES_TO_BYTES (pages - required_pages); -@@ -673,7 +678,7 @@ grub_nx_init (void) +@@ -672,7 +677,7 @@ grub_nx_init (void) } static grub_err_t @@ -53,7 +52,7 @@ index 29cf178aa9..fc7561bbf7 100644 { grub_efi_memory_descriptor_t *memory_map; grub_efi_memory_descriptor_t *memory_map_end; -@@ -730,7 +735,8 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) +@@ -729,7 +734,8 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) /* Allocate memory regions for GRUB's memory management. */ err = add_memory_regions (filtered_memory_map, desc_size, filtered_memory_map_end, @@ -63,7 +62,7 @@ index 29cf178aa9..fc7561bbf7 100644 if (err != GRUB_ERR_NONE) return err; -@@ -757,8 +763,9 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) +@@ -756,8 +762,9 @@ grub_efi_mm_add_regions (grub_size_t required_bytes) void grub_efi_mm_init (void) { diff --git a/0316-efi-Increase-default-memory-allocation-to-32-MiB.patch b/0307-efi-Increase-default-memory-allocation-to-32-MiB.patch similarity index 91% rename from 0316-efi-Increase-default-memory-allocation-to-32-MiB.patch rename to 0307-efi-Increase-default-memory-allocation-to-32-MiB.patch index dde9e90..b70c3cc 100644 --- a/0316-efi-Increase-default-memory-allocation-to-32-MiB.patch +++ b/0307-efi-Increase-default-memory-allocation-to-32-MiB.patch @@ -12,13 +12,12 @@ Make the initial memory allocation 32 MiB. Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper (cherry picked from commit 75e38e86e7d9202f050b093f20500d9ad4c6dad9) -(cherry picked from commit 7cae9dcf90a9db0cdfae144356fe97e5391862e9) --- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index fc7561bbf7..fde92ac9a5 100644 +index 016ba6cf2f..b27e966e1f 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -39,7 +39,7 @@ diff --git a/0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch b/0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch similarity index 96% rename from 0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch rename to 0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch index a9069f1..c919891 100644 --- a/0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch +++ b/0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch @@ -12,7 +12,6 @@ Signed-off-by: Zhang Boyang Reviewed-by: Daniel Kiper Reviewed-by: Patrick Steinhardt (cherry picked from commit 17975d10a80e2457e5237f87fa58a7943031983e) -(cherry picked from commit a048b2280ae6a2cf90fd5d2960823843e17e4d66) --- grub-core/kern/mm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/0301-ppc64le-signed-boot-media-changes.patch b/0309-ppc64le-signed-boot-media-changes.patch similarity index 95% rename from 0301-ppc64le-signed-boot-media-changes.patch rename to 0309-ppc64le-signed-boot-media-changes.patch index 40ec1e1..bd71437 100644 --- a/0301-ppc64le-signed-boot-media-changes.patch +++ b/0309-ppc64le-signed-boot-media-changes.patch @@ -45,8 +45,6 @@ built prefix doesn't work. Signed-off-by: Robbie Harwood wip - -(cherry picked from commit 8a96f14546f6b10f94dc6b9c67ce6a3201294d15) --- grub-core/disk/mdraid1x_linux.c | 8 +++++++- grub-core/disk/mdraid_linux.c | 5 +++++ @@ -103,10 +101,10 @@ index 3a6689abb1..0278054c61 100644 unsigned int partno = grub_strtoul (partition, 0, 0); diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f9ccca502e..c864f80093 100644 +index 8f5fd81003..d59145f861 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c -@@ -374,6 +374,7 @@ grub_try_normal_prefix (const char *prefix) +@@ -372,6 +372,7 @@ grub_try_normal_prefix (const char *prefix) file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG); if (file) { @@ -114,7 +112,7 @@ index f9ccca502e..c864f80093 100644 grub_file_close (file); err = GRUB_ERR_NONE; } -@@ -449,6 +450,10 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +@@ -447,6 +448,10 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), err = grub_try_normal ("fw_path"); if (err == GRUB_ERR_FILE_NOT_FOUND) err = grub_try_normal ("prefix"); diff --git a/0310-core-Fix-several-implicit-function-declarations.patch b/0310-core-Fix-several-implicit-function-declarations.patch new file mode 100644 index 0000000..48c5bb0 --- /dev/null +++ b/0310-core-Fix-several-implicit-function-declarations.patch @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Arjun Shankar +Date: Sun, 5 Feb 2023 11:13:55 +0100 +Subject: [PATCH] core: Fix several implicit function declarations + +These #include lines ensure that grub2 continues to build with C99 +where implicit function declarations are removed. + +Related to: + + + +--- + grub-core/commands/efi/connectefi.c | 1 + + grub-core/net/http.c | 1 + + grub-core/term/at_keyboard.c | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/grub-core/commands/efi/connectefi.c b/grub-core/commands/efi/connectefi.c +index 8ab75bd51b..3752ae17ed 100644 +--- a/grub-core/commands/efi/connectefi.c ++++ b/grub-core/commands/efi/connectefi.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/grub-core/net/http.c b/grub-core/net/http.c +index 57d2721719..5f956b743e 100644 +--- a/grub-core/net/http.c ++++ b/grub-core/net/http.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c +index dac0f946fe..de3e4abe44 100644 +--- a/grub-core/term/at_keyboard.c ++++ b/grub-core/term/at_keyboard.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + diff --git a/0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch b/0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch new file mode 100644 index 0000000..65834d8 --- /dev/null +++ b/0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch @@ -0,0 +1,431 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Raymund Will +Date: Mon, 24 Oct 2022 14:33:50 -0400 +Subject: [PATCH] loader: Add support for grub-emu to kexec Linux menu entries + +The GRUB emulator is used as a debugging utility but it could also be +used as a user-space bootloader if there is support to boot an operating +system. + +The Linux kernel is already able to (re)boot another kernel via the +kexec boot mechanism. So the grub-emu tool could rely on this feature +and have linux and initrd commands that are used to pass a kernel, +initramfs image and command line parameters to kexec for booting +a selected menu entry. + +By default the systemctl kexec option is used so systemd can shutdown +all of the running services before doing a reboot using kexec. But if +this is not present, it can fall back to executing the kexec user-space +tool directly. The ability to force a kexec-reboot when systemctl kexec +fails must only be used in controlled environments to avoid possible +filesystem corruption and data loss. + +Signed-off-by: Raymund Will +Signed-off-by: John Jolly +Signed-off-by: Javier Martinez Canillas +Signed-off-by: Robbie Harwood +Reviewed-by: Daniel Kiper +(cherry picked from commit e364307f6acc2f631b4c1fefda0791b9ce1f205f) +[rharwood: conflicts around makefile and grub_exit return code] +--- + grub-core/Makefile.core.def | 3 - + grub-core/kern/emu/main.c | 4 + + grub-core/kern/emu/misc.c | 18 ++++- + grub-core/loader/emu/linux.c | 178 +++++++++++++++++++++++++++++++++++++++++++ + include/grub/emu/exec.h | 4 +- + include/grub/emu/hostfile.h | 3 +- + include/grub/emu/misc.h | 3 + + docs/grub.texi | 30 ++++++-- + grub-core/Makefile.am | 1 + + 9 files changed, 230 insertions(+), 14 deletions(-) + create mode 100644 grub-core/loader/emu/linux.c + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 741a033978..f21da23213 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1864,11 +1864,8 @@ module = { + riscv32 = loader/riscv/linux.c; + riscv64 = loader/riscv/linux.c; + emu = loader/emu/linux.c; +- + common = loader/linux.c; + common = lib/cmdline.c; +- enable = noemu; +- + efi = loader/efi/linux.c; + }; + +diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c +index 12277c34d2..68e2b283bb 100644 +--- a/grub-core/kern/emu/main.c ++++ b/grub-core/kern/emu/main.c +@@ -107,6 +107,7 @@ static struct argp_option options[] = { + N_("use GRUB files in the directory DIR [default=%s]"), 0}, + {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, + {"hold", 'H', N_("SECS"), OPTION_ARG_OPTIONAL, N_("wait until a debugger will attach"), 0}, ++ {"kexec", 'X', 0, 0, N_("use kexec to boot Linux kernels via systemctl (pass twice to enable dangerous fallback to non-systemctl)."), 0}, + { 0, 0, 0, 0, 0, 0 } + }; + +@@ -164,6 +165,9 @@ argp_parser (int key, char *arg, struct argp_state *state) + case 'v': + verbosity++; + break; ++ case 'X': ++ grub_util_set_kexecute (); ++ break; + + case ARGP_KEY_ARG: + { +diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c +index d278c2921f..02d27c3440 100644 +--- a/grub-core/kern/emu/misc.c ++++ b/grub-core/kern/emu/misc.c +@@ -39,6 +39,7 @@ + #include + + int verbosity; ++int kexecute; + + void + grub_util_warn (const char *fmt, ...) +@@ -82,7 +83,7 @@ grub_util_error (const char *fmt, ...) + vfprintf (stderr, fmt, ap); + va_end (ap); + fprintf (stderr, ".\n"); +- exit (1); ++ grub_exit (1); + } + + void * +@@ -154,6 +155,9 @@ void + __attribute__ ((noreturn)) + grub_exit (int rc) + { ++#if defined (GRUB_KERNEL) ++ grub_reboot (); ++#endif + exit (rc < 0 ? 1 : rc); + } + #endif +@@ -215,3 +219,15 @@ grub_util_load_image (const char *path, char *buf) + + fclose (fp); + } ++ ++void ++grub_util_set_kexecute (void) ++{ ++ kexecute++; ++} ++ ++int ++grub_util_get_kexecute (void) ++{ ++ return kexecute; ++} +diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c +new file mode 100644 +index 0000000000..0cf378a376 +--- /dev/null ++++ b/grub-core/loader/emu/linux.c +@@ -0,0 +1,178 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2022 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_dl_t my_mod; ++ ++static char *kernel_path; ++static char *initrd_path; ++static char *boot_cmdline; ++ ++static grub_err_t ++grub_linux_boot (void) ++{ ++ grub_err_t rc = GRUB_ERR_NONE; ++ char *initrd_param; ++ const char *kexec[] = {"kexec", "-la", kernel_path, boot_cmdline, NULL, NULL}; ++ const char *systemctl[] = {"systemctl", "kexec", NULL}; ++ int kexecute = grub_util_get_kexecute (); ++ ++ if (initrd_path) ++ { ++ initrd_param = grub_xasprintf ("--initrd=%s", initrd_path); ++ kexec[3] = initrd_param; ++ kexec[4] = boot_cmdline; ++ } ++ else ++ initrd_param = grub_xasprintf ("%s", ""); ++ ++ grub_dprintf ("linux", "%serforming 'kexec -la %s %s %s'\n", ++ (kexecute) ? "P" : "Not p", ++ kernel_path, initrd_param, boot_cmdline); ++ ++ if (kexecute) ++ rc = grub_util_exec (kexec); ++ ++ grub_free (initrd_param); ++ ++ if (rc != GRUB_ERR_NONE) ++ { ++ grub_error (rc, N_("error trying to perform kexec load operation")); ++ grub_sleep (3); ++ return rc; ++ } ++ ++ if (kexecute < 1) ++ grub_fatal (N_("use '"PACKAGE"-emu --kexec' to force a system restart")); ++ ++ grub_dprintf ("linux", "Performing 'systemctl kexec' (%s) ", ++ (kexecute==1) ? "do-or-die" : "just-in-case"); ++ rc = grub_util_exec (systemctl); ++ ++ if (kexecute == 1) ++ grub_fatal (N_("error trying to perform 'systemctl kexec': %d"), rc); ++ ++ /* ++ * WARNING: forcible reset should only be used in read-only environments. ++ * grub-emu cannot check for these - users beware. ++ */ ++ grub_dprintf ("linux", "Performing 'kexec -ex'"); ++ kexec[1] = "-ex"; ++ kexec[2] = NULL; ++ rc = grub_util_exec (kexec); ++ if (rc != GRUB_ERR_NONE) ++ grub_fatal (N_("error trying to directly perform 'kexec -ex': %d"), rc); ++ ++ return rc; ++} ++ ++static grub_err_t ++grub_linux_unload (void) ++{ ++ /* Unloading: we're no longer in use. */ ++ grub_dl_unref (my_mod); ++ grub_free (boot_cmdline); ++ boot_cmdline = NULL; ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, ++ char *argv[]) ++{ ++ int i; ++ char *tempstr; ++ ++ /* Mark ourselves as in-use. */ ++ grub_dl_ref (my_mod); ++ ++ if (argc == 0) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ ++ if (!grub_util_is_regular (argv[0])) ++ return grub_error (GRUB_ERR_FILE_NOT_FOUND, ++ N_("cannot find kernel file %s"), argv[0]); ++ ++ grub_free (kernel_path); ++ kernel_path = grub_xasprintf ("%s", argv[0]); ++ ++ grub_free (boot_cmdline); ++ boot_cmdline = NULL; ++ ++ if (argc > 1) ++ { ++ boot_cmdline = grub_xasprintf ("--command-line=%s", argv[1]); ++ for (i = 2; i < argc; i++) ++ { ++ tempstr = grub_xasprintf ("%s %s", boot_cmdline, argv[i]); ++ grub_free (boot_cmdline); ++ boot_cmdline = tempstr; ++ } ++ } ++ ++ grub_loader_set (grub_linux_boot, grub_linux_unload, 0); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, ++ char *argv[]) ++{ ++ if (argc == 0) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ ++ if (!grub_util_is_regular (argv[0])) ++ return grub_error (GRUB_ERR_FILE_NOT_FOUND, ++ N_("Cannot find initrd file %s"), argv[0]); ++ ++ grub_free (initrd_path); ++ initrd_path = grub_xasprintf ("%s", argv[0]); ++ ++ /* We are done - mark ourselves as on longer in use. */ ++ grub_dl_unref (my_mod); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_command_t cmd_linux, cmd_initrd; ++ ++GRUB_MOD_INIT (linux) ++{ ++ cmd_linux = grub_register_command ("linux", grub_cmd_linux, 0, ++ N_("Load Linux.")); ++ cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0, ++ N_("Load initrd.")); ++ my_mod = mod; ++} ++ ++GRUB_MOD_FINI (linux) ++{ ++ grub_unregister_command (cmd_linux); ++ grub_unregister_command (cmd_initrd); ++} +diff --git a/include/grub/emu/exec.h b/include/grub/emu/exec.h +index d1073ef86a..1b61b4a2e5 100644 +--- a/include/grub/emu/exec.h ++++ b/include/grub/emu/exec.h +@@ -23,6 +23,8 @@ + #include + + #include ++#include ++ + pid_t + grub_util_exec_pipe (const char *const *argv, int *fd); + pid_t +@@ -32,7 +34,7 @@ int + grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + const char *stdout_file, const char *stderr_file); + int +-grub_util_exec (const char *const *argv); ++EXPORT_FUNC(grub_util_exec) (const char *const *argv); + int + grub_util_exec_redirect (const char *const *argv, const char *stdin_file, + const char *stdout_file); +diff --git a/include/grub/emu/hostfile.h b/include/grub/emu/hostfile.h +index cfb1e2b566..a61568e36e 100644 +--- a/include/grub/emu/hostfile.h ++++ b/include/grub/emu/hostfile.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + int +@@ -29,7 +30,7 @@ grub_util_is_directory (const char *path); + int + grub_util_is_special_file (const char *path); + int +-grub_util_is_regular (const char *path); ++EXPORT_FUNC(grub_util_is_regular) (const char *path); + + char * + grub_util_path_concat (size_t n, ...); +diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h +index ff9c48a649..01056954b9 100644 +--- a/include/grub/emu/misc.h ++++ b/include/grub/emu/misc.h +@@ -57,6 +57,9 @@ void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format ( + void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); + void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2), noreturn)); + ++void EXPORT_FUNC(grub_util_set_kexecute) (void); ++int EXPORT_FUNC(grub_util_get_kexecute) (void) WARN_UNUSED_RESULT; ++ + grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); + + #ifdef HAVE_DEVICE_MAPPER +diff --git a/docs/grub.texi b/docs/grub.texi +index a4da9c2a1b..1750b72ee9 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -923,17 +923,17 @@ magic. + @node General boot methods + @section How to boot operating systems + +-GRUB has two distinct boot methods. One of the two is to load an +-operating system directly, and the other is to chain-load another boot +-loader which then will load an operating system actually. Generally +-speaking, the former is more desirable, because you don't need to +-install or maintain other boot loaders and GRUB is flexible enough to +-load an operating system from an arbitrary disk/partition. However, +-the latter is sometimes required, since GRUB doesn't support all the +-existing operating systems natively. ++GRUB has three distinct boot methods: loading an operating system ++directly, using kexec from userspace, and chainloading another ++bootloader. Generally speaking, the first two are more desirable ++because you don't need to install or maintain other boot loaders and ++GRUB is flexible enough to load an operating system from an arbitrary ++disk/partition. However, chainloading is sometimes required, as GRUB ++doesn't support all existing operating systems natively. + + @menu + * Loading an operating system directly:: ++* Kexec:: + * Chain-loading:: + @end menu + +@@ -959,6 +959,20 @@ use more complicated instructions. @xref{DOS/Windows}, for more + information. + + ++@node Kexec ++@subsection Kexec with grub2-emu ++ ++GRUB can be run in userspace by invoking the grub2-emu tool. It will ++read all configuration scripts as if booting directly (see @xref{Loading ++an operating system directly}). With the @code{--kexec} flag, and ++kexec(8) support from the operating system, the @command{linux} command ++will directly boot the target image. For systems that lack working ++systemctl(1) support for kexec, passing the @code{--kexec} flag twice ++will fallback to invoking kexec(8) directly; note however that this ++fallback may be unsafe outside read-only environments, as it does not ++invoke shutdown machinery. ++ ++ + @node Chain-loading + @subsection Chain-loading an OS + +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index c2e8a82bce..dd49939aaa 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -309,6 +309,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/net.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostdisk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostfile.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/exec.h + if COND_GRUB_EMU_SDL + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h + endif diff --git a/0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch b/0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch similarity index 99% rename from 0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch rename to 0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch index c337cf0..735075a 100644 --- a/0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch +++ b/0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch @@ -81,7 +81,7 @@ index 818b2a86d1..6fdd863130 100644 return ctx.found_addr; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 49dbd2ebfb..a957a3074e 100644 +index b5a1d49bbc..6a1d3e5d70 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -85,14 +85,6 @@ extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu); diff --git a/0319-ieee1275-request-memory-with-ibm-client-architecture.patch b/0313-ieee1275-request-memory-with-ibm-client-architecture.patch similarity index 97% rename from 0319-ieee1275-request-memory-with-ibm-client-architecture.patch rename to 0313-ieee1275-request-memory-with-ibm-client-architecture.patch index f0fb08d..4e95630 100644 --- a/0319-ieee1275-request-memory-with-ibm-client-architecture.patch +++ b/0313-ieee1275-request-memory-with-ibm-client-architecture.patch @@ -79,12 +79,11 @@ Signed-off-by: Daniel Axtens Signed-off-by: Stefan Berger Reviewed-by: Daniel Kiper (cherry picked from commit d5571590b7de61887efac1c298901455697ba307) -[rharwood: whitespace, disable_video_support] --- grub-core/kern/ieee1275/cmain.c | 5 ++ grub-core/kern/ieee1275/init.c | 167 ++++++++++++++++++++++++++++++++++++++- - include/grub/ieee1275/ieee1275.h | 10 +++ - 3 files changed, 181 insertions(+), 1 deletion(-) + include/grub/ieee1275/ieee1275.h | 12 ++- + 3 files changed, 182 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c index 04df9d2c66..dce7b84922 100644 @@ -285,13 +284,15 @@ index 6581c2c996..8ae405bc79 100644 } #endif diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index a957a3074e..560c968460 100644 +index 6a1d3e5d70..560c968460 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h -@@ -139,6 +139,16 @@ enum grub_ieee1275_flag +@@ -138,7 +138,17 @@ enum grub_ieee1275_flag + GRUB_IEEE1275_FLAG_RAW_DEVNAMES, - GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, +- GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT ++ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, + +#if defined(__powerpc__) + /* diff --git a/0320-ieee1275-drop-len-1-quirk-in-heap_init.patch b/0314-ieee1275-drop-len-1-quirk-in-heap_init.patch similarity index 100% rename from 0320-ieee1275-drop-len-1-quirk-in-heap_init.patch rename to 0314-ieee1275-drop-len-1-quirk-in-heap_init.patch diff --git a/0321-ieee1275-support-runtime-memory-claiming.patch b/0315-ieee1275-support-runtime-memory-claiming.patch similarity index 100% rename from 0321-ieee1275-support-runtime-memory-claiming.patch rename to 0315-ieee1275-support-runtime-memory-claiming.patch diff --git a/0322-ieee1275-implement-vec5-for-cas-negotiation.patch b/0316-ieee1275-implement-vec5-for-cas-negotiation.patch similarity index 100% rename from 0322-ieee1275-implement-vec5-for-cas-negotiation.patch rename to 0316-ieee1275-implement-vec5-for-cas-negotiation.patch diff --git a/0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch b/0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch similarity index 97% rename from 0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch rename to 0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch index f1947ed..02c0282 100644 --- a/0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch +++ b/0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch @@ -38,10 +38,10 @@ Reviewed-by: Daniel Kiper create mode 100644 grub-core/commands/ieee1275/ibmvtpm.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 97abc01f06..407d68f917 100644 +index f21da23213..02ea718652 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1172,6 +1172,13 @@ module = { +@@ -1175,6 +1175,13 @@ module = { enable = powerpc_ieee1275; }; @@ -231,10 +231,10 @@ index 560c968460..27b9cf259b 100644 { unsigned int start; diff --git a/docs/grub.texi b/docs/grub.texi -index a4da9c2a1b..c433240f34 100644 +index 1750b72ee9..825278a7f3 100644 --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -6221,7 +6221,8 @@ tpm module is loaded. As such it is recommended that the tpm module be built +@@ -6235,7 +6235,8 @@ tpm module is loaded. As such it is recommended that the tpm module be built into @file{core.img} in order to avoid a potential gap in measurement between @file{core.img} being loaded and the tpm module being loaded. diff --git a/0324-powerpc-Drop-Open-Hack-Ware.patch b/0318-powerpc-Drop-Open-Hack-Ware.patch similarity index 100% rename from 0324-powerpc-Drop-Open-Hack-Ware.patch rename to 0318-powerpc-Drop-Open-Hack-Ware.patch diff --git a/grub.macros b/grub.macros index 4413ca4..4a2883d 100755 --- 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 -Wl,-z,noexecstack" + %global cflags_sed \\\ sed \\\ -e 's/-O. //g' \\\ @@ -322,6 +325,7 @@ 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-60 +- Sync patches with Fedora +- Resolves: #2007427 + * Wed Feb 08 2023 Robbie Harwood - 2.06-59 - ppc64le: sync cas/tpm patchset with upstream - Resolves: #2143420 diff --git a/rpminspect.yaml b/rpminspect.yaml index 51ab060..a047051 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -9,15 +9,6 @@ inspections: patches: off upstream: off - # https://bugzilla.redhat.com/show_bug.cgi?id=2007427 - manpage: off - - # https://bugzilla.redhat.com/show_bug.cgi?id=2007428 - elf: off - - # https://bugzilla.redhat.com/show_bug.cgi?id=1961250 - annocheck: off - # https://bugzilla.redhat.com/show_bug.cgi?id=2007431 permissions: off diff --git a/sources b/sources index 9a24a53..5f2ba31 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (unifont-13.0.06.pcf.gz) = 25f1ea4e316cd77b65cf4f60aa10ed054db6df2195be7344216673dee6628ab055ebcdeea186996d931fd1e9e4f519f4a2e4b4544b8a9ad2fe410aadc4eecd2d SHA512 (theme.tar.bz2) = 0f6f914d5f801509403094b28b8cfe5169cb56ae9bdd808ae21a6780a8236b434161a068351508dd78729c25ee2fed066c124c1eef9e15102750b409b4576a5c SHA512 (grub-2.06.tar.xz) = 4f11c648f3078567e53fc0c74d5026fdc6da4be27d188975e79d9a4df817ade0fe5ad2ddd694238a07edc45adfa02943d83c57767dd51548102b375e529e8efe -SHA512 (gnulib-fixes.tar.gz) = 7aa933812de10f54196c7ed02079d7edeb92672a528baf83201ca4c62aa3e6b119f61c45469d2c4623c4efc5d4a08d20b029403f1f2c6e35fb7cb15789ff54b2 +SHA512 (gnulib-9f48fb992a3d7e96610c4ce8be969cff2d61a01b.tar.gz) = 6887dede2d4a403422ea045329ee9bd7ca4c1561bcaf39e805e1d1ce8f4c050a65ce286e7d8362fb8e815b5fab0b405730a3f93194e343e2aedcf9b4411a285e