From 752ceb1640e85151eb162414eda81a49dd689304 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 10 Jul 2018 15:08:14 -0400 Subject: [PATCH] Rebased to newer upstream for fedora-29 Signed-off-by: Peter Jones --- 0064-grub.texi-Fix-typo.patch | 23 + ...-hexdump-rather-than-having-a-second.patch | 22 + ...disentangle-multiboot-and-multiboot2.patch | 617 +++++++ ...ppearing-in-several-modules-in-linux.patch | 64 + ...that-no-modules-provide-the-same-sym.patch | 26 + ...ylex-Explicilty-cast-fprintf-to-void.patch | 23 + 0070-linux-fixup.patch | 29 + 0071-multiboot-fixup.patch | 40 + 0072-enforcing-fixup.patch | 22 + ...-y-on-cygwin-so-we-have-grub_mkrescu.patch | 23 + ...e-spurious-variable-grub_arc_memory_.patch | 22 + ...oid-atexit-handlers-when-child-exits.patch | 70 + ...empt-to-iterate-over-empty-directory.patch | 24 + ...ent-checksum-verification-for-gunzip.patch | 127 ++ ...ltiboot-Change-linking-address-to-0x.patch | 53 + ...-Disable-Wformat-truncation-on-GCC-7.patch | 25 + ...nerate-checksum.h-with-newer-unifont.patch | 274 +++ 0081-grub-fs-tester-Fix-bashism.patch | 22 + 0082-gzio-fix-unaligned-access.patch | 22 + ...-a-file-missing-in-multiboot2-commit.patch | 120 ++ ...xefi-and-initrdefi-where-appropriate.patch | 47 - 0084-Fix-compilation-for-x86_64-efi.patch | 38 + ...20_linux_xen.in-Add-xen_boot-command.patch | 35 +- ...-figure-out-whether-multiboot2-shoul.patch | 32 +- 0087-efi-Move-grub_reboot-into-kernel.patch | 115 ++ 0088-efi-Free-malloc-regions-on-exit.patch | 154 ++ ...lt-tsc-calibration-method-to-pmtimer.patch | 0 0090-ls-prevent-double-open.patch | 42 + 0091-grub-install-Fix-memory-leak.patch | 23 + ...1275-Fix-segfault-in-grub-ofpathname.patch | 26 + ...x-detecting-.sig-files-as-system-ima.patch | 27 + ...ssing-address-cells-and-size-cells-p.patch | 45 + ...terminal-active-when-enabling-gfxter.patch | 31 + 0096-ahci-Improve-error-handling.patch | 84 + ...-Add-blocklist-GPT-support-for-SPARC.patch | 94 + ...-fix-OF-path-names-for-sun4v-systems.patch | 220 +++ ...all-check-for-errors-from-efibootmgr.patch | 178 ++ ...reat-R_X86_64_PLT32-as-R_X86_64_PC32.patch | 70 + ...wrong-break-condition-must-be-AND-no.patch | 133 ++ ...e1275-add-nvme-support-within-ofpath.patch | 85 + ...pt-Import-replacement-CRC-operations.patch | 1373 +++++++++++++++ ...EFI_PAGE-definitions-to-efi-memory.h.patch | 87 + ...ic-linux.h-include-guards-architectu.patch | 80 + ...MAGIC_SIGNATURE-architecture-specifi.patch | 110 ++ ...-linux_kernel_header-architecture-sp.patch | 100 ++ ...x-kernel-header-struct-naming-with-i.patch | 82 + ...x-kernel-magic-macro-naming-with-i38.patch | 40 + ...-loader-to-linux_arm_kernel_header-s.patch | 79 + ...-safe-to-include-for-non-native-buil.patch | 39 + ...-build-regression-in-of_path_of_nvme.patch | 32 + 0113-aout.h-Fix-missing-include.patch | 27 + ...easier-to-run-syntax-checkers-on-gru.patch | 65 + ...-couple-of-things-to-be-less-confusi.patch | 100 ++ ...ate_sections-set-up-vaddresses-as-we.patch | 109 ++ ...-a-bunch-of-section-data-into-a-stru.patch | 566 +++++++ ...pying-relocations-for-sections-that-.patch | 160 ++ ...-annobin-annotations-and-.eh_frame-a.patch | 32 + ...sh-in-of_path_of_nvme-when-of_path-i.patch | 41 + ...t-nvme-of_path_of_nvme-to-just-SPARC.patch | 47 + ...de-unit-command-for-4-addr-cell-devs.patch | 94 + ...de-unit-command-for-4-addr-cell-devs.patch | 102 ++ ...1275-set-address-bus-specific-method.patch | 87 + ...-no-data-command-bus-specific-method.patch | 105 ++ ...-block-size-deblocker-support-method.patch | 67 + 0127-sparc64-blocks-disk-node-method.patch | 72 + 0128-sparc64-blocks64-disk-node-method.patch | 62 + ...native-terminal-active-when-enabling.patch | 33 + ...d-regression-in-grub_mkimage_load_im.patch | 36 + ..._linux-Support-multiple-early-initrd.patch | 174 ++ ...h-in-BPB-s-sectors_per_track-and-num.patch | 74 + ...lit-up-grub_machine_get_bootlocation.patch | 100 ++ ...inter-dereference-in-grub_machine_ge.patch | 28 + ...-LER-when-GRUB2-accesses-non-enabled.patch | 47 + ...ix-packed-not-aligned-error-on-GCC-8.patch | 69 + 0137-fs-Add-F2FS-support.patch | 1508 +++++++++++++++++ ...Trivial-correction-on-stale-comments.patch | 28 + 0139-grub-install-Locale-depends-on-nls.patch | 177 ++ 0140-grub-probe-Centralize-GUID-prints.patch | 63 + 0141-disk-Update-grub_gpt_partentry.patch | 95 ++ ...probe-Add-PARTUUID-detection-support.patch | 100 ++ ...es-Update-grub-script-template-files.patch | 243 +++ ...io-Round-up-block-size-to-power-of-2.patch | 32 + ...obe-Don-t-skip-dev-mapper-dm-devices.patch | 33 + ...Accept-filesystem-with-sparse-inodes.patch | 20 +- 0147-templates-Add-missing.patch | 27 + ...r-segment-a-separate-relocator-chunk.patch | 122 ++ 0149-grub-fs-tester-Fix-losetup-race.patch | 31 + 0150-fdt-Move-prop_entry_size-to-fdt.h.patch | 126 ++ ...dress-size-cells-to-2-for-empty-tree.patch | 65 + ...c-Fix-compilation-by-fixing-undeclar.patch | 38 + ...re.patch => 0153-re-write-.gitignore.patch | 2 +- ...ient-architecture-CAS-reboot-support.patch | 21 +- ...nsole-display-attr-when-clear-screen.patch | 2 +- ...video-support-for-IBM-power-machines.patch | 4 +- ...when-generating-configuration-by-gru.patch | 6 +- ...8-Move-bash-completion-script-922997.patch | 8 +- ...patch => 0159-Update-to-minilzo-2.08.patch | 2 +- ...o-include-entries-by-title-not-just-.patch | 6 +- ....patch => 0161-Add-GRUB_DISABLE_UUID.patch | 42 +- ...=> 0162-Make-exit-take-a-return-code.patch | 10 +- ...pot-as-binary-so-git-won-t-try-to-di.patch | 6 +- ...es-load-an-env-block-from-a-variable.patch | 6 +- ...HCP-client-ID-and-UUID-options-added.patch | 2 +- ...-trim-arp-packets-with-abnormal-size.patch | 2 +- ...Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch | 8 +- ...UEFI-operating-systems-returned-by-o.patch | 5 +- ...169-Migrate-PPC-from-Yaboot-to-Grub2.patch | 6 +- ...=> 0170-Add-fw_path-variable-revised.patch | 2 +- ...tch => 0171-Add-support-for-linuxefi.patch | 20 +- ...xefi-and-initrdefi-where-appropriate.patch | 40 + ...w-insmod-when-secure-boot-is-enabled.patch | 10 +- ...-hex-hex-straight-through-unmolested.patch | 5 +- ...175-Add-X-option-to-printf-functions.patch | 2 +- ...for-specific-config-file-for-netboot.patch | 2 +- ...g-module-to-parse-Boot-Loader-Specif.patch | 8 +- ...8-Don-t-write-messages-to-the-screen.patch | 42 +- ... => 0179-Don-t-print-GNU-GRUB-header.patch | 2 +- ...=> 0180-Don-t-add-to-highlighted-row.patch | 2 +- ...atch => 0181-Message-string-cleanups.patch | 2 +- ...ing-now-that-we-aren-t-displaying-it.patch | 2 +- ...t-indentation-for-the-term-help-text.patch | 2 +- ...es.patch => 0184-Indent-menu-entries.patch | 2 +- ...ix-margins.patch => 0185-Fix-margins.patch | 2 +- ...-1-for-our-right-hand-margin-so-line.patch | 2 +- ...-Use-linux16-when-appropriate-880840.patch | 31 +- ...0188-Enable-pager-by-default.-985860.patch | 2 +- ...-on-serial-so-don-t-tell-the-user-to.patch | 6 +- ...n-t-say-GNU-Linux-in-generated-menus.patch | 6 +- ...-Don-t-draw-a-border-around-the-menu.patch | 2 +- ...andard-margin-for-the-timeout-string.patch | 2 +- ...rame-to-list-of-relocations-stripped.patch | 2 +- ...rk-with-our-changes-for-linux16-and-.patch | 85 +- ...on-t-print-during-fdt-loading-method.patch | 8 +- ...spaces-when-we-re-doing-our-cmdline-.patch | 6 +- ...password-to-boot-entries-generated-b.patch | 4 +- ...=> 0198-Don-t-emit-Booting-.-message.patch | 2 +- ...f-man-pages-with-slightly-nicer-ones.patch | 4 +- ...ix-when-fallback-searching-for-grub-.patch | 5 +- ...-before-grub.cfg-on-tftp-config-file.patch | 5 +- ...ert-function-to-support-NVMe-devices.patch | 2 +- ...M-Mustang-device-tree-for-hardware-t.patch | 9 +- ...device-tree-from-the-grub-default-fi.patch | 13 +- ...P-protocol-for-exclusive-use-by-grub.patch | 2 +- ...P-protocol-for-exclusive-use-by-grub.patch | 5 +- ...patch => 0207-Add-grub_util_readlink.patch | 2 +- ...se-symlinks-including-those-across-d.patch | 9 +- ...CLASS-in-10_linux-from-etc-os-releas.patch | 7 +- ...t-ordering-for-.debug-and-rescue-ker.patch | 9 +- ...tch => 0211-Load-arm-with-SB-enabled.patch | 38 +- ...2-Try-prefix-if-fw_path-doesn-t-work.patch | 6 +- ...-grub.cfg-netboot-selection-order-11.patch | 9 +- ...-Package-Sort-for-grub2-mkconfig-112.patch | 19 +- ... => 0215-Handle-rssd-storage-devices.patch | 2 +- ...x16-initrd16-and-linuxefi-initrdefi-.patch | 6 +- ...fig-construct-titles-that-look-like-.patch | 12 +- ...ly-grub2-password-config-tool-985962.patch | 14 +- ...fig-construct-titles-that-look-like-.patch | 12 +- ...-configure.ac-and-grub-rpm-sort-play.patch | 13 +- ... 0221-tcp-add-window-scaling-support.patch | 2 +- ...net-retransmit-if-our-device-is-busy.patch | 2 +- ...out-actually-using-the-configured-ne.patch | 6 +- ...r-for-the-first-exclusive-reopen-of-.patch | 5 +- ...ue-when-reading-username-and-passwor.patch | 2 +- ...ub-password-will-not-be-read-1290803.patch | 2 +- ...ub-setpassword-documentation-1290799.patch | 2 +- ...le-issue-in-grub-setpassword-1294243.patch | 2 +- ...rsistent-RAM-and-unknown-possible-fu.patch | 6 +- ... 0230-efiemu-Fix-compilation-failure.patch | 2 +- ...P-protocol-for-exclusive-use-by-grub.patch | 5 +- ...arser.patch => 0232-Add-a-url-parser.patch | 8 +- ...net-and-bootp-add-support-for-dhcpv6.patch | 2 +- ...rnel-settings-and-use-it-in-10_linux.patch | 32 +- ...0235-Normalize-slashes-in-tftp-paths.patch | 2 +- ...h => 0236-Fix-malformed-tftp-packets.patch | 2 +- ...h => 0237-Fix-race-in-EFI-validation.patch | 2 +- ...1374141-fix-incorrect-mask-for-ppc64.patch | 2 +- ...art-of-chainloader-target-if-present.patch | 2 +- ...ecureboot-support-on-efi-chainloader.patch | 2 +- ...loaders-that-link-in-efi-mode-honor-.patch | 28 +- ... 0242-Make-grub_fatal-also-backtrace.patch | 4 +- ...d.patch => 0243-Rework-linux-command.patch | 6 +- ...patch => 0244-Rework-linux16-command.patch | 8 +- ...> 0245-Make-grub-editenv-build-again.patch | 6 +- ...ix-up-some-man-pages-rpmdiff-noticed.patch | 4 +- ...-work-some-intricacies-of-PE-loading.patch | 2 +- ...-of-efi-chainload-so-non-sb-cases-wo.patch | 13 +- ...-double-free-on-verification-failure.patch | 2 +- ...he-linux-and-initrd-names-of-command.patch | 95 -- ...machine-type-test-in-30_os-prober.in.patch | 2 +- ...fix-wrong-sanity-check-in-relocate_c.patch | 5 +- ...truncate-overlong-relocation-section.patch | 2 +- ...atch => 0253-linuxefi-minor-cleanups.patch | 2 +- ...rch-64-on-32-boot-in-linuxefi-loader.patch | 6 +- ...ch => 0255-Fix-up-linux-params-usage.patch | 33 +- ...=> 0256-Make-exit-take-a-return-code.patch | 2 +- ...fdt-has-address-cells-and-size-cells.patch | 10 +- ...rintf-in-the-secure-boot-verify-code.patch | 5 +- ...fo-pages-say-grub2-where-appropriate.patch | 134 +- ...more-debug-info-in-our-module-loader.patch | 6 +- ...-chainloader-entries-don-t-try-any-x.patch | 5 +- ...-Add-ability-to-boot-from-subvolumes.patch | 4 +- ...port-btrfs_subvol-and-btrfs_subvolid.patch | 4 +- ...> 0264-grub2-btrfs-03-follow_default.patch | 4 +- ...=> 0265-grub2-btrfs-04-grub2-install.patch | 4 +- ...> 0266-grub2-btrfs-05-grub2-mkconfig.patch | 16 +- ... => 0267-grub2-btrfs-06-subvol-mount.patch | 8 +- ...ootable-Snapshot-submenu-in-grub.cfg.patch | 2 +- ...subvol-name-scheme-to-support-old-sn.patch | 8 +- ...-correctly-with-btrfs-snapshots-bsc-.patch | 7 +- ...ocate_pool-and-grub_efi_free_pool-wr.patch | 10 +- ...fi_.-memory-helpers-where-reasonable.patch | 2 +- ...3-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch | 2 +- ...c-sized-arrays-since-we-don-t-build-.patch | 6 +- ...nst.patch => 0275-don-t-ignore-const.patch | 2 +- ...=> 0276-don-t-use-int-for-efi-status.patch | 6 +- ...INIT-declare-its-function-prototypes.patch | 2 +- ...p-some-errors-in-the-linuxefi-loader.patch | 10 +- ...279-editenv-handle-relative-symlinks.patch | 2 +- ...e-libgrub.pp-depend-on-config-util.h.patch | 2 +- ...-efi-as-HFS-on-ppc-machines-in-grub-.patch | 4 +- ...d-xen-or-multiboot-2-modules-as-need.patch | 11 +- ...-calibration-not-take-51-seconds-to-.patch | 5 +- ...284-align-struct-efi_variable-better.patch | 4 +- ...=> 0285-Add-quicksort-implementation.patch | 6 +- ...nd-support-to-parse-BootLoaderSpec-c.patch | 8 +- ...287-Add-BLS-support-to-grub-mkconfig.patch | 28 +- ...d-grub_exit-definition-for-grub-emu-.patch | 2 +- ...-backtrace-on-grub_abort-for-grub-em.patch | 5 +- ...-blscfg-command-for-the-emu-platform.patch | 4 +- ...nux-and-initrd-commands-for-grub-emu.patch | 6 +- ...2-Fix-the-efidir-in-grub-setpassword.patch | 2 +- ...h => 0293-Add-grub2-switch-to-blscfg.patch | 6 +- ...patch => 0294-Add-grub_debug_enabled.patch | 4 +- ...patch => 0295-make-better-backtraces.patch | 8 +- ...w-our-startup-message-if-debug-is-se.patch | 5 +- ...-some-minor-include-path-weirdnesses.patch | 2 +- ...it-possible-to-enabled-build-id-sha1.patch | 6 +- ...f-grub_dprintf-without-the-file-line.patch | 8 +- ...dprintf-that-tells-us-load-addresses.patch | 14 +- ...scan-different-BLS-directories-on-EF.patch | 2 +- ...pport.patch => 0302-Core-TPM-support.patch | 4 +- ....patch => 0303-Measure-kernel-initrd.patch | 4 +- ...ch => 0304-Add-BIOS-boot-measurement.patch | 4 +- ...re-kernel-and-initrd-on-BIOS-systems.patch | 6 +- ... 0306-Measure-the-kernel-commandline.patch | 2 +- ...mands.patch => 0307-Measure-commands.patch | 2 +- ...Measure-multiboot-images-and-modules.patch | 14 +- ...=> 0309-Fix-boot-when-there-s-no-TPM.patch | 2 +- ...atch => 0310-Rework-TPM-measurements.patch | 18 +- ...x.patch => 0311-Fix-event-log-prefix.patch | 2 +- ...ot-menu-entry-as-default-when-using-.patch | 10 +- ...-when-compiling-for-platforms-other-.patch | 6 +- ...h => 0314-Make-TPM-errors-less-fatal.patch | 18 +- ...cfg-handle-multiple-initramfs-images.patch | 2 +- ...switch-to-blscfg-on-non-EFI-machines.patch | 2 +- ...LS-Use-etcdefaultgrub-instead-of-etc.patch | 2 +- ...ons-to-grub2-switch-to-blscfg-man-pa.patch | 5 +- ...h-to-blscfg-to-generate-debug-BLS-wh.patch | 6 +- ...h-to-blscfg-to-generate-BLS-fragment.patch | 6 +- ...query-dev-mounted-in-boot-efi-as-boo.patch | 10 +- ...ath-when-searching-kernels-images-if.patch | 10 +- ...field-to-compare-entries-if-id-field.patch | 6 +- ...d-to-BLS-generated-by-grub2-switch-t.patch | 5 +- 0325-Fixup-for-newer-compiler.patch | 36 + ...-export-the-start-and-_start-symbols.patch | 42 + ...plify-BLS-entry-key-val-pairs-lookup.patch | 170 ++ ...h-to-the-kernel-and-initrds-BLS-fiel.patch | 73 + ...p-leading-spaces-on-BLS-field-values.patch | 56 + ...tch => 0330-Fixup-for-newer-compiler.patch | 34 +- ..._log_extend_event-function-prototype.patch | 50 + 0332-TPM-Fix-compiler-warnings.patch | 72 + ...lscfg.in-get-rid-of-a-bunch-of-bashi.patch | 113 ++ ...lscfg.in-Better-boot-prefix-checking.patch | 73 + ...entries-as-BLS-directory-path-also-o.patch | 152 ++ ...-filename-as-menu-entry-id-and-for-c.patch | 134 ++ ...witch-to-blscfg-boot-prefix-handling.patch | 58 + ...-trim-arp-packets-with-abnormal-size.patch | 27 + 0339-Use-xid-to-match-DHCP-replies.patch | 65 + ...pport-for-non-Ethernet-network-cards.patch | 764 +++++++++ ...lid-character-recongition-in-strto-l.patch | 37 + ...racketed-ipv6-addrs-and-port-numbers.patch | 51 +- ...ed-ipv6-addrs-and-port-numbers-pjone.patch | 105 ++ ...=> 0344-bootp-New-net_bootp6-command.patch | 112 +- ...t-back-our-code-to-add-a-local-route.patch | 35 + 0346-efinet-UEFI-IPv6-PXE-support.patch | 126 ++ ...347-grub.texi-Add-net_bootp6-doument.patch | 8 +- ...essing-DHCPACK-packet-from-HTTP-Boot.patch | 26 +- ...etting-network-from-UEFI-device-path.patch | 28 +- ...etting-DNS-server-from-UEFI-protocol.patch | 18 +- 0351-Fix-one-more-coverity-complaint.patch | 27 + ...ctory-specifiable-on-the-configure-c.patch | 98 ++ 0353-Fix-grub_net_hwaddr_to_str.patch | 41 + ...54-Support-UEFI-networking-protocols.patch | 265 +-- ...> 0355-AUDIT-0-http-boot-tracker-bug.patch | 4 +- ...efi_gop.c-Add-support-for-BLT_ONLY-a.patch | 5 +- 0357-efi-uga-use-64-bit-for-fb_base.patch | 105 ++ ...ot-set-text-mode-until-we-actually-n.patch | 184 ++ ...grub_console_read_key_stroke-helper-.patch | 102 ++ ...nsole-Implement-getkeystatus-support.patch | 72 + ...status-helper-funtion-available-ever.patch | 87 + ...d-holding-SHIFT-as-user-interrupt-ke.patch | 94 + ...-incr-command-to-increment-integer-v.patch | 93 + 0364-Add-auto-hide-menu-support.patch | 191 +++ ...try-for-firmware-setup-on-UEFI-FastB.patch | 93 + 0366-Add-grub-set-bootflag-utility.patch | 316 ++++ ...Fix-grub-setpassword-o-s-output-path.patch | 33 + ...ssword-be-named-like-all-the-other-g.patch | 88 + ...b-boot-indeterminate.service-example.patch | 33 + ...the-enter-key-not-working-on-X86-tab.patch | 42 + ...e-Use-a-timeout-of-60s-for-menu_show.patch | 31 + ...hide-Reduce-number-of-save_env-calls.patch | 41 + ...xes-to-make-armv7hl-build-as-arm-efi.patch | 55 + ...-fix-use-with-sys-firmware-efi-efiva.patch | 36 + grub.patches | 498 ++++-- grub2.spec | 5 +- 315 files changed, 15431 insertions(+), 1328 deletions(-) create mode 100644 0064-grub.texi-Fix-typo.patch create mode 100644 0065-hdparm-Depend-on-hexdump-rather-than-having-a-second.patch create mode 100644 0066-multiboot-disentangle-multiboot-and-multiboot2.patch create mode 100644 0067-Fix-symbols-appearing-in-several-modules-in-linux.patch create mode 100644 0068-genmoddep-Check-that-no-modules-provide-the-same-sym.patch create mode 100644 0069-yylex-Explicilty-cast-fprintf-to-void.patch create mode 100644 0070-linux-fixup.patch create mode 100644 0071-multiboot-fixup.patch create mode 100644 0072-enforcing-fixup.patch create mode 100644 0073-Set-have_exec-to-y-on-cygwin-so-we-have-grub_mkrescu.patch create mode 100644 0074-arc-Do-not-create-spurious-variable-grub_arc_memory_.patch create mode 100644 0075-unix-exec-avoid-atexit-handlers-when-child-exits.patch create mode 100644 0076-xfs-Don-t-attempt-to-iterate-over-empty-directory.patch create mode 100644 0077-Implement-checksum-verification-for-gunzip.patch create mode 100644 0078-qemu-coreboot-multiboot-Change-linking-address-to-0x.patch create mode 100644 0079-printf_unit_test-Disable-Wformat-truncation-on-GCC-7.patch create mode 100644 0080-Regenerate-checksum.h-with-newer-unifont.patch create mode 100644 0081-grub-fs-tester-Fix-bashism.patch create mode 100644 0082-gzio-fix-unaligned-access.patch create mode 100644 0083-Add-a-file-missing-in-multiboot2-commit.patch delete mode 100644 0083-Use-linuxefi-and-initrdefi-where-appropriate.patch create mode 100644 0084-Fix-compilation-for-x86_64-efi.patch rename 0193-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch => 0085-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch (59%) rename 0194-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch => 0086-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch (50%) create mode 100644 0087-efi-Move-grub_reboot-into-kernel.patch create mode 100644 0088-efi-Free-malloc-regions-on-exit.patch rename 0196-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch => 0089-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch (100%) create mode 100644 0090-ls-prevent-double-open.patch create mode 100644 0091-grub-install-Fix-memory-leak.patch create mode 100644 0092-ieee1275-Fix-segfault-in-grub-ofpathname.patch create mode 100644 0093-grub-mkconfig-Fix-detecting-.sig-files-as-system-ima.patch create mode 100644 0094-arm64-xen-Add-missing-address-cells-and-size-cells-p.patch create mode 100644 0095-Keep-the-native-terminal-active-when-enabling-gfxter.patch create mode 100644 0096-ahci-Improve-error-handling.patch create mode 100644 0097-sparc64-Add-blocklist-GPT-support-for-SPARC.patch create mode 100644 0098-sparc64-fix-OF-path-names-for-sun4v-systems.patch create mode 100644 0099-Make-grub-install-check-for-errors-from-efibootmgr.patch create mode 100644 0100-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch create mode 100644 0101-chainloader-Fix-wrong-break-condition-must-be-AND-no.patch create mode 100644 0102-ieee1275-add-nvme-support-within-ofpath.patch create mode 100644 0103-libgcrypt-Import-replacement-CRC-operations.patch create mode 100644 0104-arm64-efi-move-EFI_PAGE-definitions-to-efi-memory.h.patch create mode 100644 0105-Make-arch-specific-linux.h-include-guards-architectu.patch create mode 100644 0106-make-GRUB_LINUX_MAGIC_SIGNATURE-architecture-specifi.patch create mode 100644 0107-i386-make-struct-linux_kernel_header-architecture-sp.patch create mode 100644 0108-arm64-align-linux-kernel-header-struct-naming-with-i.patch create mode 100644 0109-arm64-align-linux-kernel-magic-macro-naming-with-i38.patch create mode 100644 0110-arm-switch-linux-loader-to-linux_arm_kernel_header-s.patch create mode 100644 0111-arm-make-linux.h-safe-to-include-for-non-native-buil.patch create mode 100644 0112-ieee1275-fix-build-regression-in-of_path_of_nvme.patch create mode 100644 0113-aout.h-Fix-missing-include.patch create mode 100644 0114-mkimage-make-it-easier-to-run-syntax-checkers-on-gru.patch create mode 100644 0115-mkimage-rename-a-couple-of-things-to-be-less-confusi.patch create mode 100644 0116-mkimage-make-locate_sections-set-up-vaddresses-as-we.patch create mode 100644 0117-mkimage-refactor-a-bunch-of-section-data-into-a-stru.patch create mode 100644 0118-mkimage-avoid-copying-relocations-for-sections-that-.patch create mode 100644 0119-.mod-files-Strip-annobin-annotations-and-.eh_frame-a.patch create mode 100644 0120-ieee1275-Fix-crash-in-of_path_of_nvme-when-of_path-i.patch create mode 100644 0121-sparc64-Limit-nvme-of_path_of_nvme-to-just-SPARC.patch create mode 100644 0122-ieee1275-decode-unit-command-for-4-addr-cell-devs.patch create mode 100644 0123-ieee1275-encode-unit-command-for-4-addr-cell-devs.patch create mode 100644 0124-ieee1275-set-address-bus-specific-method.patch create mode 100644 0125-ieee1275-no-data-command-bus-specific-method.patch create mode 100644 0126-ieee1275-block-size-deblocker-support-method.patch create mode 100644 0127-sparc64-blocks-disk-node-method.patch create mode 100644 0128-sparc64-blocks64-disk-node-method.patch create mode 100644 0129-Revert-Keep-the-native-terminal-active-when-enabling.patch create mode 100644 0130-mkimage-fix-build-regression-in-grub_mkimage_load_im.patch create mode 100644 0131-grub-mkconfig-10_linux-Support-multiple-early-initrd.patch create mode 100644 0132-chainloader-patch-in-BPB-s-sectors_per_track-and-num.patch create mode 100644 0133-ieee1275-split-up-grub_machine_get_bootlocation.patch create mode 100644 0134-ieee1275-NULL-pointer-dereference-in-grub_machine_ge.patch create mode 100644 0135-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch create mode 100644 0136-Fix-packed-not-aligned-error-on-GCC-8.patch create mode 100644 0137-fs-Add-F2FS-support.patch create mode 100644 0138-diskboot-Trivial-correction-on-stale-comments.patch create mode 100644 0139-grub-install-Locale-depends-on-nls.patch create mode 100644 0140-grub-probe-Centralize-GUID-prints.patch create mode 100644 0141-disk-Update-grub_gpt_partentry.patch create mode 100644 0142-grub-probe-Add-PARTUUID-detection-support.patch create mode 100644 0143-templates-Update-grub-script-template-files.patch create mode 100644 0144-bufio-Round-up-block-size-to-power-of-2.patch create mode 100644 0145-grub-probe-Don-t-skip-dev-mapper-dm-devices.patch rename 0250-xfs-accept-filesystem-with-sparse-inodes.patch => 0146-xfs-Accept-filesystem-with-sparse-inodes.patch (83%) create mode 100644 0147-templates-Add-missing.patch create mode 100644 0148-mbi-Use-per-segment-a-separate-relocator-chunk.patch create mode 100644 0149-grub-fs-tester-Fix-losetup-race.patch create mode 100644 0150-fdt-Move-prop_entry_size-to-fdt.h.patch create mode 100644 0151-efi-fdt-Set-address-size-cells-to-2-for-empty-tree.patch create mode 100644 0152-multiboot_elfxx.c-Fix-compilation-by-fixing-undeclar.patch rename 0064-re-write-.gitignore.patch => 0153-re-write-.gitignore.patch (99%) rename 0065-IBM-client-architecture-CAS-reboot-support.patch => 0154-IBM-client-architecture-CAS-reboot-support.patch (91%) rename 0066-for-ppc-reset-console-display-attr-when-clear-screen.patch => 0155-for-ppc-reset-console-display-attr-when-clear-screen.patch (95%) rename 0067-Disable-GRUB-video-support-for-IBM-power-machines.patch => 0156-Disable-GRUB-video-support-for-IBM-power-machines.patch (95%) rename 0068-Honor-a-symlink-when-generating-configuration-by-gru.patch => 0157-Honor-a-symlink-when-generating-configuration-by-gru.patch (81%) rename 0069-Move-bash-completion-script-922997.patch => 0158-Move-bash-completion-script-922997.patch (88%) rename 0070-Update-to-minilzo-2.08.patch => 0159-Update-to-minilzo-2.08.patch (99%) rename 0071-Allow-fallback-to-include-entries-by-title-not-just-.patch => 0160-Allow-fallback-to-include-entries-by-title-not-just-.patch (97%) rename 0072-Add-GRUB_DISABLE_UUID.patch => 0161-Add-GRUB_DISABLE_UUID.patch (73%) rename 0073-Make-exit-take-a-return-code.patch => 0162-Make-exit-take-a-return-code.patch (96%) rename 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch => 0163-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch (83%) rename 0075-Make-efi-machines-load-an-env-block-from-a-variable.patch => 0164-Make-efi-machines-load-an-env-block-from-a-variable.patch (93%) rename 0076-DHCP-client-ID-and-UUID-options-added.patch => 0165-DHCP-client-ID-and-UUID-options-added.patch (98%) rename 0077-trim-arp-packets-with-abnormal-size.patch => 0166-trim-arp-packets-with-abnormal-size.patch (94%) rename 0078-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch => 0167-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch (84%) rename 0079-Add-support-for-UEFI-operating-systems-returned-by-o.patch => 0168-Add-support-for-UEFI-operating-systems-returned-by-o.patch (94%) rename 0080-Migrate-PPC-from-Yaboot-to-Grub2.patch => 0169-Migrate-PPC-from-Yaboot-to-Grub2.patch (96%) rename 0081-Add-fw_path-variable-revised.patch => 0170-Add-fw_path-variable-revised.patch (97%) rename 0082-Add-support-for-linuxefi.patch => 0171-Add-support-for-linuxefi.patch (96%) create mode 100644 0172-Use-linuxefi-and-initrdefi-where-appropriate.patch rename 0084-Don-t-allow-insmod-when-secure-boot-is-enabled.patch => 0173-Don-t-allow-insmod-when-secure-boot-is-enabled.patch (92%) rename 0085-Pass-x-hex-hex-straight-through-unmolested.patch => 0174-Pass-x-hex-hex-straight-through-unmolested.patch (97%) rename 0086-Add-X-option-to-printf-functions.patch => 0175-Add-X-option-to-printf-functions.patch (95%) rename 0087-Search-for-specific-config-file-for-netboot.patch => 0176-Search-for-specific-config-file-for-netboot.patch (98%) rename 0088-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch => 0177-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch (96%) rename 0089-Don-t-write-messages-to-the-screen.patch => 0178-Don-t-write-messages-to-the-screen.patch (84%) rename 0090-Don-t-print-GNU-GRUB-header.patch => 0179-Don-t-print-GNU-GRUB-header.patch (94%) rename 0091-Don-t-add-to-highlighted-row.patch => 0180-Don-t-add-to-highlighted-row.patch (92%) rename 0092-Message-string-cleanups.patch => 0181-Message-string-cleanups.patch (97%) rename 0093-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch => 0182-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch (93%) rename 0094-Use-the-correct-indentation-for-the-term-help-text.patch => 0183-Use-the-correct-indentation-for-the-term-help-text.patch (93%) rename 0095-Indent-menu-entries.patch => 0184-Indent-menu-entries.patch (92%) rename 0096-Fix-margins.patch => 0185-Fix-margins.patch (94%) rename 0097-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch => 0186-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch (92%) rename 0098-Use-linux16-when-appropriate-880840.patch => 0187-Use-linux16-when-appropriate-880840.patch (54%) rename 0099-Enable-pager-by-default.-985860.patch => 0188-Enable-pager-by-default.-985860.patch (91%) rename 0100-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch => 0189-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch (91%) rename 0101-Don-t-say-GNU-Linux-in-generated-menus.patch => 0190-Don-t-say-GNU-Linux-in-generated-menus.patch (90%) rename 0102-Don-t-draw-a-border-around-the-menu.patch => 0191-Don-t-draw-a-border-around-the-menu.patch (97%) rename 0103-Use-the-standard-margin-for-the-timeout-string.patch => 0192-Use-the-standard-margin-for-the-timeout-string.patch (95%) rename 0104-Add-.eh_frame-to-list-of-relocations-stripped.patch => 0193-Add-.eh_frame-to-list-of-relocations-stripped.patch (94%) rename 0105-Make-10_linux-work-with-our-changes-for-linux16-and-.patch => 0194-Make-10_linux-work-with-our-changes-for-linux16-and-.patch (51%) rename 0106-Don-t-print-during-fdt-loading-method.patch => 0195-Don-t-print-during-fdt-loading-method.patch (81%) rename 0107-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch => 0196-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch (90%) rename 0108-Don-t-require-a-password-to-boot-entries-generated-b.patch => 0197-Don-t-require-a-password-to-boot-entries-generated-b.patch (89%) rename 0109-Don-t-emit-Booting-.-message.patch => 0198-Don-t-emit-Booting-.-message.patch (95%) rename 0110-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch => 0199-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch (99%) rename 0111-use-fw_path-prefix-when-fallback-searching-for-grub-.patch => 0200-use-fw_path-prefix-when-fallback-searching-for-grub-.patch (95%) rename 0112-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch => 0201-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch (97%) rename 0113-Fix-convert-function-to-support-NVMe-devices.patch => 0202-Fix-convert-function-to-support-NVMe-devices.patch (95%) rename 0114-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch => 0203-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch (80%) rename 0115-Use-the-default-device-tree-from-the-grub-default-fi.patch => 0204-Use-the-default-device-tree-from-the-grub-default-fi.patch (81%) rename 0116-reopen-SNP-protocol-for-exclusive-use-by-grub.patch => 0205-reopen-SNP-protocol-for-exclusive-use-by-grub.patch (95%) rename 0117-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch => 0206-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch (95%) rename 0118-Add-grub_util_readlink.patch => 0207-Add-grub_util_readlink.patch (99%) rename 0119-Make-editenv-chase-symlinks-including-those-across-d.patch => 0208-Make-editenv-chase-symlinks-including-those-across-d.patch (94%) rename 0120-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch => 0209-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch (85%) rename 0121-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch => 0210-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch (86%) rename 0122-Load-arm-with-SB-enabled.patch => 0211-Load-arm-with-SB-enabled.patch (93%) rename 0123-Try-prefix-if-fw_path-doesn-t-work.patch => 0212-Try-prefix-if-fw_path-doesn-t-work.patch (96%) rename 0124-Update-info-with-grub.cfg-netboot-selection-order-11.patch => 0213-Update-info-with-grub.cfg-netboot-selection-order-11.patch (91%) rename 0125-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch => 0214-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch (97%) rename 0126-Handle-rssd-storage-devices.patch => 0215-Handle-rssd-storage-devices.patch (93%) rename 0127-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch => 0216-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch (96%) rename 0128-Make-grub2-mkconfig-construct-titles-that-look-like-.patch => 0217-Make-grub2-mkconfig-construct-titles-that-look-like-.patch (90%) rename 0129-Add-friendly-grub2-password-config-tool-985962.patch => 0218-Add-friendly-grub2-password-config-tool-985962.patch (95%) rename 0130-Make-grub2-mkconfig-construct-titles-that-look-like-.patch => 0219-Make-grub2-mkconfig-construct-titles-that-look-like-.patch (90%) rename 0131-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch => 0220-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch (86%) rename 0132-tcp-add-window-scaling-support.patch => 0221-tcp-add-window-scaling-support.patch (97%) rename 0133-efinet-retransmit-if-our-device-is-busy.patch => 0222-efinet-retransmit-if-our-device-is-busy.patch (96%) rename 0134-Be-more-aggro-about-actually-using-the-configured-ne.patch => 0223-Be-more-aggro-about-actually-using-the-configured-ne.patch (98%) rename 0135-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch => 0224-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch (96%) rename 0136-Fix-security-issue-when-reading-username-and-passwor.patch => 0225-Fix-security-issue-when-reading-username-and-passwor.patch (95%) rename 0137-Warn-if-grub-password-will-not-be-read-1290803.patch => 0226-Warn-if-grub-password-will-not-be-read-1290803.patch (94%) rename 0138-Clean-up-grub-setpassword-documentation-1290799.patch => 0227-Clean-up-grub-setpassword-documentation-1290799.patch (96%) rename 0139-Fix-locale-issue-in-grub-setpassword-1294243.patch => 0228-Fix-locale-issue-in-grub-setpassword-1294243.patch (93%) rename 0140-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch => 0229-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch (91%) rename 0141-efiemu-Fix-compilation-failure.patch => 0230-efiemu-Fix-compilation-failure.patch (93%) rename 0142-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch => 0231-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch (97%) rename 0143-Add-a-url-parser.patch => 0232-Add-a-url-parser.patch (99%) rename 0144-efinet-and-bootp-add-support-for-dhcpv6.patch => 0233-efinet-and-bootp-add-support-for-dhcpv6.patch (99%) rename 0145-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch => 0234-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch (93%) rename 0146-Normalize-slashes-in-tftp-paths.patch => 0235-Normalize-slashes-in-tftp-paths.patch (96%) rename 0147-Fix-malformed-tftp-packets.patch => 0236-Fix-malformed-tftp-packets.patch (95%) rename 0148-Fix-race-in-EFI-validation.patch => 0237-Fix-race-in-EFI-validation.patch (97%) rename 0149-bz1374141-fix-incorrect-mask-for-ppc64.patch => 0238-bz1374141-fix-incorrect-mask-for-ppc64.patch (97%) rename 0150-Use-device-part-of-chainloader-target-if-present.patch => 0239-Use-device-part-of-chainloader-target-if-present.patch (94%) rename 0151-Add-secureboot-support-on-efi-chainloader.patch => 0240-Add-secureboot-support-on-efi-chainloader.patch (99%) rename 0152-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch => 0241-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch (96%) rename 0153-Make-grub_fatal-also-backtrace.patch => 0242-Make-grub_fatal-also-backtrace.patch (97%) rename 0154-Rework-linux-command.patch => 0243-Rework-linux-command.patch (96%) rename 0155-Rework-linux16-command.patch => 0244-Rework-linux16-command.patch (93%) rename 0156-Make-grub-editenv-build-again.patch => 0245-Make-grub-editenv-build-again.patch (86%) rename 0157-Fix-up-some-man-pages-rpmdiff-noticed.patch => 0246-Fix-up-some-man-pages-rpmdiff-noticed.patch (97%) rename 0158-Re-work-some-intricacies-of-PE-loading.patch => 0247-Re-work-some-intricacies-of-PE-loading.patch (99%) rename 0159-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch => 0248-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch (97%) rename 0160-linuxefi-fix-double-free-on-verification-failure.patch => 0249-linuxefi-fix-double-free-on-verification-failure.patch (91%) delete mode 100644 0249-linuxefi-honor-the-linux-and-initrd-names-of-command.patch rename 0161-fix-machine-type-test-in-30_os-prober.in.patch => 0250-fix-machine-type-test-in-30_os-prober.in.patch (90%) rename 0162-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch => 0251-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch (90%) rename 0163-efi-chainloader-truncate-overlong-relocation-section.patch => 0252-efi-chainloader-truncate-overlong-relocation-section.patch (98%) rename 0164-linuxefi-minor-cleanups.patch => 0253-linuxefi-minor-cleanups.patch (98%) rename 0165-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch => 0254-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch (98%) rename 0166-Fix-up-linux-params-usage.patch => 0255-Fix-up-linux-params-usage.patch (50%) rename 0167-Make-exit-take-a-return-code.patch => 0256-Make-exit-take-a-return-code.patch (95%) rename 0168-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch => 0257-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch (83%) rename 0169-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch => 0258-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch (94%) rename 0170-Make-our-info-pages-say-grub2-where-appropriate.patch => 0259-Make-our-info-pages-say-grub2-where-appropriate.patch (91%) rename 0171-print-more-debug-info-in-our-module-loader.patch => 0260-print-more-debug-info-in-our-module-loader.patch (88%) rename 0172-macos-just-build-chainloader-entries-don-t-try-any-x.patch => 0261-macos-just-build-chainloader-entries-don-t-try-any-x.patch (98%) rename 0173-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch => 0262-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch (99%) rename 0174-export-btrfs_subvol-and-btrfs_subvolid.patch => 0263-export-btrfs_subvol-and-btrfs_subvolid.patch (88%) rename 0175-grub2-btrfs-03-follow_default.patch => 0264-grub2-btrfs-03-follow_default.patch (98%) rename 0176-grub2-btrfs-04-grub2-install.patch => 0265-grub2-btrfs-04-grub2-install.patch (98%) rename 0177-grub2-btrfs-05-grub2-mkconfig.patch => 0266-grub2-btrfs-05-grub2-mkconfig.patch (92%) rename 0178-grub2-btrfs-06-subvol-mount.patch => 0267-grub2-btrfs-06-subvol-mount.patch (98%) rename 0179-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch => 0268-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch (93%) rename 0180-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch => 0269-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch (93%) rename 0181-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch => 0270-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch (98%) rename 0182-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch => 0271-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch (89%) rename 0183-Use-grub_efi_.-memory-helpers-where-reasonable.patch => 0272-Use-grub_efi_.-memory-helpers-where-reasonable.patch (98%) rename 0184-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch => 0273-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch (96%) rename 0185-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch => 0274-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch (94%) rename 0186-don-t-ignore-const.patch => 0275-don-t-ignore-const.patch (89%) rename 0187-don-t-use-int-for-efi-status.patch => 0276-don-t-use-int-for-efi-status.patch (73%) rename 0188-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch => 0277-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch (93%) rename 0189-Clean-up-some-errors-in-the-linuxefi-loader.patch => 0278-Clean-up-some-errors-in-the-linuxefi-loader.patch (90%) rename 0190-editenv-handle-relative-symlinks.patch => 0279-editenv-handle-relative-symlinks.patch (95%) rename 0191-Make-libgrub.pp-depend-on-config-util.h.patch => 0280-Make-libgrub.pp-depend-on-config-util.h.patch (98%) rename 0192-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch => 0281-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch (91%) rename 0195-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch => 0282-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch (85%) rename 0197-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch => 0283-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch (99%) rename 0198-align-struct-efi_variable-better.patch => 0284-align-struct-efi_variable-better.patch (90%) rename 0199-Add-quicksort-implementation.patch => 0285-Add-quicksort-implementation.patch (98%) rename 0200-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch => 0286-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch (99%) rename 0201-Add-BLS-support-to-grub-mkconfig.patch => 0287-Add-BLS-support-to-grub-mkconfig.patch (90%) rename 0202-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch => 0288-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch (93%) rename 0203-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch => 0289-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch (85%) rename 0204-Enable-blscfg-command-for-the-emu-platform.patch => 0290-Enable-blscfg-command-for-the-emu-platform.patch (97%) rename 0205-Add-linux-and-initrd-commands-for-grub-emu.patch => 0291-Add-linux-and-initrd-commands-for-grub-emu.patch (98%) rename 0206-Fix-the-efidir-in-grub-setpassword.patch => 0292-Fix-the-efidir-in-grub-setpassword.patch (92%) rename 0207-Add-grub2-switch-to-blscfg.patch => 0293-Add-grub2-switch-to-blscfg.patch (98%) rename 0208-Add-grub_debug_enabled.patch => 0294-Add-grub_debug_enabled.patch (94%) rename 0209-make-better-backtraces.patch => 0295-make-better-backtraces.patch (99%) rename 0210-normal-don-t-draw-our-startup-message-if-debug-is-se.patch => 0296-normal-don-t-draw-our-startup-message-if-debug-is-se.patch (91%) rename 0211-Work-around-some-minor-include-path-weirdnesses.patch => 0297-Work-around-some-minor-include-path-weirdnesses.patch (98%) rename 0212-Make-it-possible-to-enabled-build-id-sha1.patch => 0298-Make-it-possible-to-enabled-build-id-sha1.patch (92%) rename 0213-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch => 0299-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch (93%) rename 0214-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch => 0300-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch (93%) rename 0215-Only-attempt-to-scan-different-BLS-directories-on-EF.patch => 0301-Only-attempt-to-scan-different-BLS-directories-on-EF.patch (96%) rename 0216-Core-TPM-support.patch => 0302-Core-TPM-support.patch (99%) rename 0217-Measure-kernel-initrd.patch => 0303-Measure-kernel-initrd.patch (92%) rename 0218-Add-BIOS-boot-measurement.patch => 0304-Add-BIOS-boot-measurement.patch (97%) rename 0219-Measure-kernel-and-initrd-on-BIOS-systems.patch => 0305-Measure-kernel-and-initrd-on-BIOS-systems.patch (94%) rename 0220-Measure-the-kernel-commandline.patch => 0306-Measure-the-kernel-commandline.patch (94%) rename 0221-Measure-commands.patch => 0307-Measure-commands.patch (97%) rename 0222-Measure-multiboot-images-and-modules.patch => 0308-Measure-multiboot-images-and-modules.patch (85%) rename 0223-Fix-boot-when-there-s-no-TPM.patch => 0309-Fix-boot-when-there-s-no-TPM.patch (92%) rename 0224-Rework-TPM-measurements.patch => 0310-Rework-TPM-measurements.patch (94%) rename 0225-Fix-event-log-prefix.patch => 0311-Fix-event-log-prefix.patch (93%) rename 0226-Set-the-first-boot-menu-entry-as-default-when-using-.patch => 0312-Set-the-first-boot-menu-entry-as-default-when-using-.patch (81%) rename 0227-tpm-fix-warnings-when-compiling-for-platforms-other-.patch => 0313-tpm-fix-warnings-when-compiling-for-platforms-other-.patch (94%) rename 0228-Make-TPM-errors-less-fatal.patch => 0314-Make-TPM-errors-less-fatal.patch (93%) rename 0229-blscfg-handle-multiple-initramfs-images.patch => 0315-blscfg-handle-multiple-initramfs-images.patch (97%) rename 0230-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch => 0316-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch (93%) rename 0231-BLS-Use-etcdefaultgrub-instead-of-etc.patch => 0317-BLS-Use-etcdefaultgrub-instead-of-etc.patch (93%) rename 0232-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch => 0318-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch (94%) rename 0233-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch => 0319-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch (95%) rename 0234-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch => 0320-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch (91%) rename 0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch => 0321-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch (88%) rename 0236-Include-OSTree-path-when-searching-kernels-images-if.patch => 0322-Include-OSTree-path-when-searching-kernels-images-if.patch (87%) rename 0237-Use-BLS-version-field-to-compare-entries-if-id-field.patch => 0323-Use-BLS-version-field-to-compare-entries-if-id-field.patch (91%) rename 0238-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch => 0324-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch (89%) create mode 100644 0325-Fixup-for-newer-compiler.patch create mode 100644 0326-Don-t-attempt-to-export-the-start-and-_start-symbols.patch create mode 100644 0327-Simplify-BLS-entry-key-val-pairs-lookup.patch create mode 100644 0328-Add-relative-path-to-the-kernel-and-initrds-BLS-fiel.patch create mode 100644 0329-Skip-leading-spaces-on-BLS-field-values.patch rename 0239-Fixup-for-newer-compiler.patch => 0330-Fixup-for-newer-compiler.patch (50%) create mode 100644 0331-TPM-Fix-hash_log_extend_event-function-prototype.patch create mode 100644 0332-TPM-Fix-compiler-warnings.patch create mode 100644 0333-grub-switch-to-blscfg.in-get-rid-of-a-bunch-of-bashi.patch create mode 100644 0334-grub-switch-to-blscfg.in-Better-boot-prefix-checking.patch create mode 100644 0335-Use-boot-loader-entries-as-BLS-directory-path-also-o.patch create mode 100644 0336-Use-BLS-fragment-filename-as-menu-entry-id-and-for-c.patch create mode 100644 0337-Fix-grub-switch-to-blscfg-boot-prefix-handling.patch create mode 100644 0338-Revert-trim-arp-packets-with-abnormal-size.patch create mode 100644 0339-Use-xid-to-match-DHCP-replies.patch create mode 100644 0340-Add-support-for-non-Ethernet-network-cards.patch create mode 100644 0341-misc-fix-invalid-character-recongition-in-strto-l.patch rename 0240-net-read-bracketed-ipv6-addrs-and-port-numbers.patch => 0342-net-read-bracketed-ipv6-addrs-and-port-numbers.patch (82%) create mode 100644 0343-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch rename 0241-New-net_bootp6-command-and-UEFI-IPv6-PXE-support.patch => 0344-bootp-New-net_bootp6-command.patch (95%) create mode 100644 0345-Put-back-our-code-to-add-a-local-route.patch create mode 100644 0346-efinet-UEFI-IPv6-PXE-support.patch rename 0242-grub.texi-Add-net_bootp6-doument.patch => 0347-grub.texi-Add-net_bootp6-doument.patch (86%) rename 0243-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch => 0348-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch (85%) rename 0244-efinet-Setting-network-from-UEFI-device-path.patch => 0349-efinet-Setting-network-from-UEFI-device-path.patch (94%) rename 0245-efinet-Setting-DNS-server-from-UEFI-protocol.patch => 0350-efinet-Setting-DNS-server-from-UEFI-protocol.patch (95%) create mode 100644 0351-Fix-one-more-coverity-complaint.patch create mode 100644 0352-Make-module-directory-specifiable-on-the-configure-c.patch create mode 100644 0353-Fix-grub_net_hwaddr_to_str.patch rename 0247-Support-UEFI-networking-protocols.patch => 0354-Support-UEFI-networking-protocols.patch (96%) rename 0248-AUDIT-0-http-boot-tracker-bug.patch => 0355-AUDIT-0-http-boot-tracker-bug.patch (94%) rename 0246-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch => 0356-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch (95%) create mode 100644 0357-efi-uga-use-64-bit-for-fb_base.patch create mode 100644 0358-EFI-console-Do-not-set-text-mode-until-we-actually-n.patch create mode 100644 0359-EFI-console-Add-grub_console_read_key_stroke-helper-.patch create mode 100644 0360-EFI-console-Implement-getkeystatus-support.patch create mode 100644 0361-Make-grub_getkeystatus-helper-funtion-available-ever.patch create mode 100644 0362-Accept-ESC-F8-and-holding-SHIFT-as-user-interrupt-ke.patch create mode 100644 0363-grub-editenv-Add-incr-command-to-increment-integer-v.patch create mode 100644 0364-Add-auto-hide-menu-support.patch create mode 100644 0365-Output-a-menu-entry-for-firmware-setup-on-UEFI-FastB.patch create mode 100644 0366-Add-grub-set-bootflag-utility.patch create mode 100644 0367-Fix-grub-setpassword-o-s-output-path.patch create mode 100644 0368-Make-grub-set-password-be-named-like-all-the-other-g.patch create mode 100644 0369-docs-Add-grub-boot-indeterminate.service-example.patch create mode 100644 0370-EFI-console-Fix-the-enter-key-not-working-on-X86-tab.patch create mode 100644 0371-00_menu_auto_hide-Use-a-timeout-of-60s-for-menu_show.patch create mode 100644 0372-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch create mode 100644 0373-Minor-fixes-to-make-armv7hl-build-as-arm-efi.patch create mode 100644 0374-30_uefi-firmware-fix-use-with-sys-firmware-efi-efiva.patch diff --git a/0064-grub.texi-Fix-typo.patch b/0064-grub.texi-Fix-typo.patch new file mode 100644 index 00000000..df3a92da --- /dev/null +++ b/0064-grub.texi-Fix-typo.patch @@ -0,0 +1,23 @@ +From 7108c0c86ea26f75dfba4e21e78bf8464c433143 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 11:36:50 +0200 +Subject: [PATCH] grub.texi: Fix typo + +Reported by: Ori Avtalion +--- + docs/grub.texi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index a0c4b9e4e8e..137b894fa09 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -4643,7 +4643,7 @@ range 0-0xFF (prefix with @samp{0x} to enter it in hexadecimal). + When enabled, this hides the selected partition by setting the @dfn{hidden} + bit in its partition type code; when disabled, unhides the selected + partition by clearing this bit. This is useful only when booting DOS or +-Wwindows and multiple primary FAT partitions exist in one disk. See also ++Windows and multiple primary FAT partitions exist in one disk. See also + @ref{DOS/Windows}. + @end table + @end deffn diff --git a/0065-hdparm-Depend-on-hexdump-rather-than-having-a-second.patch b/0065-hdparm-Depend-on-hexdump-rather-than-having-a-second.patch new file mode 100644 index 00000000..8f38c0b0 --- /dev/null +++ b/0065-hdparm-Depend-on-hexdump-rather-than-having-a-second.patch @@ -0,0 +1,22 @@ +From 6662372053bb7f580cf1b6a56b11e1190d81a40c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 12:48:58 +0200 +Subject: [PATCH] hdparm: Depend on hexdump rather than having a second copy of + hexdump. + +--- + grub-core/Makefile.core.def | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index a65c27f7ff2..8d57a59a0e1 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -902,7 +902,6 @@ module = { + module = { + name = hdparm; + common = commands/hdparm.c; +- common = lib/hexdump.c; + enable = pci; + enable = mips_qemu_mips; + }; diff --git a/0066-multiboot-disentangle-multiboot-and-multiboot2.patch b/0066-multiboot-disentangle-multiboot-and-multiboot2.patch new file mode 100644 index 00000000..a173f946 --- /dev/null +++ b/0066-multiboot-disentangle-multiboot-and-multiboot2.patch @@ -0,0 +1,617 @@ +From 21e4a6fa039bb7dc6be42e1e4c171ddc398b8431 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 12:51:26 +0200 +Subject: [PATCH] multiboot: disentangle multiboot and multiboot2. + +Previously we had multiboot and multiboot2 declaring the same symbols. +This can potentially lead to aliasing and strange behaviours when e.g. +module instead of module2 is used with multiboot2. + +Bug: #51137 +--- + grub-core/loader/i386/multiboot_mbi.c | 4 +-- + grub-core/loader/multiboot.c | 66 ++++++++++++++++++++-------------- + grub-core/loader/multiboot_elfxx.c | 14 ++++---- + grub-core/loader/multiboot_mbi2.c | 68 +++++++++++++++++------------------ + include/grub/i386/multiboot.h | 9 ++++- + include/grub/mips/multiboot.h | 4 +-- + include/grub/multiboot.h | 11 +----- + include/multiboot2.h | 4 +-- + 8 files changed, 95 insertions(+), 85 deletions(-) + +diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c +index fd7b41b0cad..dc98dbcae25 100644 +--- a/grub-core/loader/i386/multiboot_mbi.c ++++ b/grub-core/loader/i386/multiboot_mbi.c +@@ -239,7 +239,7 @@ grub_multiboot_get_mbi_size (void) + ret = sizeof (struct multiboot_info) + ALIGN_UP (cmdline_size, 4) + + modcnt * sizeof (struct multiboot_mod_list) + total_modcmd + + ALIGN_UP (sizeof(PACKAGE_STRING), 4) +- + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry) ++ + grub_multiboot_get_mmap_count () * sizeof (struct multiboot_mmap_entry) + + elf_sec_entsize * elf_sec_num + + 256 * sizeof (struct multiboot_color) + #if GRUB_MACHINE_HAS_VBE || GRUB_MACHINE_HAS_VGA_TEXT +@@ -542,7 +542,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) + mbi->mods_count = 0; + } + +- mmap_size = grub_get_multiboot_mmap_count () ++ mmap_size = grub_multiboot_get_mmap_count () + * sizeof (struct multiboot_mmap_entry); + grub_fill_multiboot_mmap ((struct multiboot_mmap_entry *) ptrorig); + mbi->mmap_length = mmap_size; +diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c +index bd9d5b3e698..bd3dc1990e3 100644 +--- a/grub-core/loader/multiboot.c ++++ b/grub-core/loader/multiboot.c +@@ -28,7 +28,15 @@ + + #include + #include ++#ifdef GRUB_USE_MULTIBOOT2 ++#include ++#define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER GRUB_MULTIBOOT2_CONSOLE_FRAMEBUFFER ++#define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT ++#define GRUB_MULTIBOOT(x) grub_multiboot2_ ## x ++#else + #include ++#define GRUB_MULTIBOOT(x) grub_multiboot_ ## x ++#endif + #include + #include + #include +@@ -49,8 +57,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #include + #endif + +-struct grub_relocator *grub_multiboot_relocator = NULL; +-grub_uint32_t grub_multiboot_payload_eip; ++struct grub_relocator *GRUB_MULTIBOOT (relocator) = NULL; ++grub_uint32_t GRUB_MULTIBOOT (payload_eip); + #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) + #define DEFAULT_VIDEO_MODE "text" + #else +@@ -78,7 +86,7 @@ count_hook (grub_uint64_t addr __attribute__ ((unused)), + /* Return the length of the Multiboot mmap that will be needed to allocate + our platform's map. */ + grub_uint32_t +-grub_get_multiboot_mmap_count (void) ++GRUB_MULTIBOOT (get_mmap_count) (void) + { + grub_size_t count = 0; + +@@ -88,7 +96,7 @@ grub_get_multiboot_mmap_count (void) + } + + grub_err_t +-grub_multiboot_set_video_mode (void) ++GRUB_MULTIBOOT (set_video_mode) (void) + { + grub_err_t err; + const char *modevar; +@@ -164,19 +172,23 @@ static grub_err_t + grub_multiboot_boot (void) + { + grub_err_t err; ++ ++#ifdef GRUB_USE_MULTIBOOT2 ++ struct grub_relocator32_state state = MULTIBOOT2_INITIAL_STATE; ++#else + struct grub_relocator32_state state = MULTIBOOT_INITIAL_STATE; ++#endif ++ state.MULTIBOOT_ENTRY_REGISTER = GRUB_MULTIBOOT (payload_eip); + +- state.MULTIBOOT_ENTRY_REGISTER = grub_multiboot_payload_eip; +- +- err = grub_multiboot_make_mbi (&state.MULTIBOOT_MBI_REGISTER); ++ err = GRUB_MULTIBOOT (make_mbi) (&state.MULTIBOOT_MBI_REGISTER); + + if (err) + return err; + + if (grub_efi_is_finished) +- normal_boot (grub_multiboot_relocator, state); ++ normal_boot (GRUB_MULTIBOOT (relocator), state); + else +- efi_boot (grub_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER); ++ efi_boot (GRUB_MULTIBOOT (relocator), state.MULTIBOOT_MBI_REGISTER); + + /* Not reached. */ + return GRUB_ERR_NONE; +@@ -185,10 +197,10 @@ grub_multiboot_boot (void) + static grub_err_t + grub_multiboot_unload (void) + { +- grub_multiboot_free_mbi (); ++ GRUB_MULTIBOOT (free_mbi) (); + +- grub_relocator_unload (grub_multiboot_relocator); +- grub_multiboot_relocator = NULL; ++ grub_relocator_unload (GRUB_MULTIBOOT (relocator)); ++ GRUB_MULTIBOOT (relocator) = NULL; + + grub_dl_unref (my_mod); + +@@ -207,7 +219,7 @@ static grub_uint64_t highest_load; + + /* Load ELF32 or ELF64. */ + grub_err_t +-grub_multiboot_load_elf (mbi_load_data_t *mld) ++GRUB_MULTIBOOT (load_elf) (mbi_load_data_t *mld) + { + if (grub_multiboot_is_elf32 (mld->buffer)) + return grub_multiboot_load_elf32 (mld); +@@ -218,9 +230,9 @@ grub_multiboot_load_elf (mbi_load_data_t *mld) + } + + grub_err_t +-grub_multiboot_set_console (int console_type, int accepted_consoles, +- int width, int height, int depth, +- int console_req) ++GRUB_MULTIBOOT (set_console) (int console_type, int accepted_consoles, ++ int width, int height, int depth, ++ int console_req) + { + console_required = console_req; + if (!(accepted_consoles +@@ -313,19 +325,19 @@ grub_cmd_multiboot (grub_command_t cmd __attribute__ ((unused)), + grub_dl_ref (my_mod); + + /* Skip filename. */ +- grub_multiboot_init_mbi (argc - 1, argv + 1); ++ GRUB_MULTIBOOT (init_mbi) (argc - 1, argv + 1); + +- grub_relocator_unload (grub_multiboot_relocator); +- grub_multiboot_relocator = grub_relocator_new (); ++ grub_relocator_unload (GRUB_MULTIBOOT (relocator)); ++ GRUB_MULTIBOOT (relocator) = grub_relocator_new (); + +- if (!grub_multiboot_relocator) ++ if (!GRUB_MULTIBOOT (relocator)) + goto fail; + +- err = grub_multiboot_load (file, argv[0]); ++ err = GRUB_MULTIBOOT (load) (file, argv[0]); + if (err) + goto fail; + +- grub_multiboot_set_bootdev (); ++ GRUB_MULTIBOOT (set_bootdev) (); + + grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 0); + +@@ -335,8 +347,8 @@ grub_cmd_multiboot (grub_command_t cmd __attribute__ ((unused)), + + if (grub_errno != GRUB_ERR_NONE) + { +- grub_relocator_unload (grub_multiboot_relocator); +- grub_multiboot_relocator = NULL; ++ grub_relocator_unload (GRUB_MULTIBOOT (relocator)); ++ GRUB_MULTIBOOT (relocator) = NULL; + grub_dl_unref (my_mod); + } + +@@ -368,7 +380,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + +- if (!grub_multiboot_relocator) ++ if (!GRUB_MULTIBOOT (relocator)) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + +@@ -389,7 +401,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), + if (size) + { + grub_relocator_chunk_t ch; +- err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, ++ err = grub_relocator_alloc_chunk_align (GRUB_MULTIBOOT (relocator), &ch, + lowest_addr, (0xffffffff - size) + 1, + size, MULTIBOOT_MOD_ALIGN, + GRUB_RELOCATOR_PREFERENCE_NONE, 1); +@@ -407,7 +419,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), + target = 0; + } + +- err = grub_multiboot_add_module (target, size, argc - 1, argv + 1); ++ err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1); + if (err) + { + grub_file_close (file); +diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c +index 5e649ed2545..67daf5944b0 100644 +--- a/grub-core/loader/multiboot_elfxx.c ++++ b/grub-core/loader/multiboot_elfxx.c +@@ -104,13 +104,13 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size) + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + +- err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, ++ err = grub_relocator_alloc_chunk_align (GRUB_MULTIBOOT (relocator), &ch, + mld->min_addr, mld->max_addr - load_size, + load_size, mld->align ? mld->align : 1, + mld->preference, mld->avoid_efi_boot_services); + } + else +- err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch, ++ err = grub_relocator_alloc_chunk_addr (GRUB_MULTIBOOT (relocator), &ch, + mld->link_base_addr, load_size); + + if (err) +@@ -167,7 +167,7 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + if (phdr(i)->p_vaddr <= ehdr->e_entry + && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry) + { +- grub_multiboot_payload_eip = (ehdr->e_entry - phdr(i)->p_vaddr) ++ GRUB_MULTIBOOT (payload_eip) = (ehdr->e_entry - phdr(i)->p_vaddr) + + phdr(i)->p_paddr; + #ifdef MULTIBOOT_LOAD_ELF64 + # ifdef __mips +@@ -191,7 +191,7 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + #if defined (__i386__) || defined (__x86_64__) + + #elif defined (__mips) +- grub_multiboot_payload_eip |= 0x80000000; ++ GRUB_MULTIBOOT (payload_eip) |= 0x80000000; + #else + #error Please complete this + #endif +@@ -238,7 +238,7 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + if (sh->sh_size == 0) + continue; + +- err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0, ++ err = grub_relocator_alloc_chunk_align (GRUB_MULTIBOOT (relocator), &ch, 0, + (0xffffffff - sh->sh_size) + 1, + sh->sh_size, sh->sh_addralign, + GRUB_RELOCATOR_PREFERENCE_NONE, +@@ -264,8 +264,8 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + } + sh->sh_addr = target; + } +- grub_multiboot_add_elfsyms (ehdr->e_shnum, ehdr->e_shentsize, +- ehdr->e_shstrndx, shdr); ++ GRUB_MULTIBOOT (add_elfsyms) (ehdr->e_shnum, ehdr->e_shentsize, ++ ehdr->e_shstrndx, shdr); + } + + #undef phdr +diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c +index b0679a9f6c9..4df6595954d 100644 +--- a/grub-core/loader/multiboot_mbi2.c ++++ b/grub-core/loader/multiboot_mbi2.c +@@ -22,7 +22,7 @@ + #include + #include + #endif +-#include ++#include + #include + #include + #include +@@ -71,7 +71,7 @@ static int keep_bs = 0; + static grub_uint32_t load_base_addr; + + void +-grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, ++grub_multiboot2_add_elfsyms (grub_size_t num, grub_size_t entsize, + unsigned shndx, void *data) + { + elf_sec_num = num; +@@ -90,17 +90,17 @@ find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) + ((char *) header <= (char *) buffer + len - 12); + header = (struct multiboot_header *) ((grub_uint32_t *) header + MULTIBOOT_HEADER_ALIGN / 4)) + { +- if (header->magic == MULTIBOOT_HEADER_MAGIC ++ if (header->magic == MULTIBOOT2_HEADER_MAGIC + && !(header->magic + header->architecture + + header->header_length + header->checksum) +- && header->architecture == MULTIBOOT_ARCHITECTURE_CURRENT) ++ && header->architecture == MULTIBOOT2_ARCHITECTURE_CURRENT) + return header; + } + return NULL; + } + + grub_err_t +-grub_multiboot_load (grub_file_t file, const char *filename) ++grub_multiboot2_load (grub_file_t file, const char *filename) + { + grub_ssize_t len; + struct multiboot_header *header; +@@ -112,7 +112,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + grub_addr_t entry = 0, efi_entry = 0; + grub_uint32_t console_required = 0; + struct multiboot_header_tag_framebuffer *fbtag = NULL; +- int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; ++ int accepted_consoles = GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT; + mbi_load_data_t mld; + + mld.mbi_ver = 2; +@@ -210,7 +210,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + case MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS: + if (!(((struct multiboot_header_tag_console_flags *) tag)->console_flags + & MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED)) +- accepted_consoles &= ~GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; ++ accepted_consoles &= ~GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT; + if (((struct multiboot_header_tag_console_flags *) tag)->console_flags + & MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED) + console_required = 1; +@@ -218,7 +218,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + + case MULTIBOOT_HEADER_TAG_FRAMEBUFFER: + fbtag = (struct multiboot_header_tag_framebuffer *) tag; +- accepted_consoles |= GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER; ++ accepted_consoles |= GRUB_MULTIBOOT2_CONSOLE_FRAMEBUFFER; + break; + + case MULTIBOOT_HEADER_TAG_RELOCATABLE: +@@ -295,13 +295,13 @@ grub_multiboot_load (grub_file_t file, const char *filename) + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + } + +- err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, ++ err = grub_relocator_alloc_chunk_align (grub_multiboot2_relocator, &ch, + mld.min_addr, mld.max_addr - code_size, + code_size, mld.align ? mld.align : 1, + mld.preference, keep_bs); + } + else +- err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, ++ err = grub_relocator_alloc_chunk_addr (grub_multiboot2_relocator, + &ch, load_addr, code_size); + if (err) + { +@@ -343,7 +343,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + mld.file = file; + mld.filename = filename; + mld.avoid_efi_boot_services = keep_bs; +- err = grub_multiboot_load_elf (&mld); ++ err = grub_multiboot2_load_elf (&mld); + if (err) + { + grub_free (mld.buffer); +@@ -354,9 +354,9 @@ grub_multiboot_load (grub_file_t file, const char *filename) + load_base_addr = mld.load_base_addr; + + if (keep_bs && efi_entry_specified) +- grub_multiboot_payload_eip = efi_entry; ++ grub_multiboot2_payload_eip = efi_entry; + else if (entry_specified) +- grub_multiboot_payload_eip = entry; ++ grub_multiboot2_payload_eip = entry; + + if (mld.relocatable) + { +@@ -370,20 +370,20 @@ grub_multiboot_load (grub_file_t file, const char *filename) + * 64-bit int here. + */ + if (mld.load_base_addr >= mld.link_base_addr) +- grub_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr; ++ grub_multiboot2_payload_eip += mld.load_base_addr - mld.link_base_addr; + else +- grub_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr; ++ grub_multiboot2_payload_eip -= mld.link_base_addr - mld.load_base_addr; + } + + if (fbtag) +- err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, +- accepted_consoles, +- fbtag->width, fbtag->height, +- fbtag->depth, console_required); ++ err = grub_multiboot2_set_console (GRUB_MULTIBOOT2_CONSOLE_FRAMEBUFFER, ++ accepted_consoles, ++ fbtag->width, fbtag->height, ++ fbtag->depth, console_required); + else +- err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_EGA_TEXT, +- accepted_consoles, +- 0, 0, 0, console_required); ++ err = grub_multiboot2_set_console (GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT, ++ accepted_consoles, ++ 0, 0, 0, console_required); + return err; + } + +@@ -459,7 +459,7 @@ net_size (void) + } + + static grub_size_t +-grub_multiboot_get_mbi_size (void) ++grub_multiboot2_get_mbi_size (void) + { + #ifdef GRUB_MACHINE_EFI + if (!keep_bs && !efi_mmap_size) +@@ -478,7 +478,7 @@ grub_multiboot_get_mbi_size (void) + + ALIGN_UP (sizeof (struct multiboot_tag_elf_sections), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (elf_sec_entsize * elf_sec_num, MULTIBOOT_TAG_ALIGN) + + ALIGN_UP ((sizeof (struct multiboot_tag_mmap) +- + grub_get_multiboot_mmap_count () ++ + grub_multiboot2_get_mmap_count () + * sizeof (struct multiboot_mmap_entry)), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) +@@ -522,7 +522,7 @@ grub_fill_multiboot_mmap (struct multiboot_tag_mmap *tag) + + tag->type = MULTIBOOT_TAG_TYPE_MMAP; + tag->size = sizeof (struct multiboot_tag_mmap) +- + sizeof (struct multiboot_mmap_entry) * grub_get_multiboot_mmap_count (); ++ + sizeof (struct multiboot_mmap_entry) * grub_multiboot2_get_mmap_count (); + tag->entry_size = sizeof (struct multiboot_mmap_entry); + tag->entry_version = 0; + +@@ -588,7 +588,7 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) + struct multiboot_tag_framebuffer *tag + = (struct multiboot_tag_framebuffer *) *ptrorig; + +- err = grub_multiboot_set_video_mode (); ++ err = grub_multiboot2_set_video_mode (); + if (err) + { + grub_print_error (); +@@ -731,7 +731,7 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) + } + + grub_err_t +-grub_multiboot_make_mbi (grub_uint32_t *target) ++grub_multiboot2_make_mbi (grub_uint32_t *target) + { + grub_properly_aligned_t *ptrorig; + grub_properly_aligned_t *mbistart; +@@ -739,11 +739,11 @@ grub_multiboot_make_mbi (grub_uint32_t *target) + grub_size_t bufsize; + grub_relocator_chunk_t ch; + +- bufsize = grub_multiboot_get_mbi_size (); ++ bufsize = grub_multiboot2_get_mbi_size (); + + COMPILE_TIME_ASSERT (MULTIBOOT_TAG_ALIGN % sizeof (grub_properly_aligned_t) == 0); + +- err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, ++ err = grub_relocator_alloc_chunk_align (grub_multiboot2_relocator, &ch, + 0, 0xffffffff - bufsize, + bufsize, MULTIBOOT_TAG_ALIGN, + GRUB_RELOCATOR_PREFERENCE_NONE, 1); +@@ -1039,7 +1039,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) + } + + void +-grub_multiboot_free_mbi (void) ++grub_multiboot2_free_mbi (void) + { + struct module *cur, *next; + +@@ -1061,11 +1061,11 @@ grub_multiboot_free_mbi (void) + } + + grub_err_t +-grub_multiboot_init_mbi (int argc, char *argv[]) ++grub_multiboot2_init_mbi (int argc, char *argv[]) + { + grub_ssize_t len = 0; + +- grub_multiboot_free_mbi (); ++ grub_multiboot2_free_mbi (); + + len = grub_loader_cmdline_size (argc, argv); + +@@ -1081,7 +1081,7 @@ grub_multiboot_init_mbi (int argc, char *argv[]) + } + + grub_err_t +-grub_multiboot_add_module (grub_addr_t start, grub_size_t size, ++grub_multiboot2_add_module (grub_addr_t start, grub_size_t size, + int argc, char *argv[]) + { + struct module *newmod; +@@ -1119,7 +1119,7 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, + } + + void +-grub_multiboot_set_bootdev (void) ++grub_multiboot2_set_bootdev (void) + { + grub_device_t dev; + +diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h +index 807a1de27f9..9cd97dfced8 100644 +--- a/include/grub/i386/multiboot.h ++++ b/include/grub/i386/multiboot.h +@@ -19,6 +19,13 @@ + #ifndef GRUB_MULTIBOOT_CPU_HEADER + #define GRUB_MULTIBOOT_CPU_HEADER 1 + ++#define MULTIBOOT2_INITIAL_STATE { .eax = MULTIBOOT2_BOOTLOADER_MAGIC, \ ++ .ecx = 0, \ ++ .edx = 0, \ ++ /* Set esp to some random location in low memory to avoid breaking */ \ ++ /* non-compliant kernels. */ \ ++ .esp = 0x7ff00 \ ++ } + #define MULTIBOOT_INITIAL_STATE { .eax = MULTIBOOT_BOOTLOADER_MAGIC, \ + .ecx = 0, \ + .edx = 0, \ +@@ -28,7 +35,7 @@ + } + #define MULTIBOOT_ENTRY_REGISTER eip + #define MULTIBOOT_MBI_REGISTER ebx +-#define MULTIBOOT_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_I386 ++#define MULTIBOOT2_ARCHITECTURE_CURRENT MULTIBOOT2_ARCHITECTURE_I386 + + #ifdef GRUB_MACHINE_EFI + #ifdef __x86_64__ +diff --git a/include/grub/mips/multiboot.h b/include/grub/mips/multiboot.h +index 4aebf29e732..c4eee2dd01b 100644 +--- a/include/grub/mips/multiboot.h ++++ b/include/grub/mips/multiboot.h +@@ -19,11 +19,11 @@ + #ifndef GRUB_MULTIBOOT_CPU_HEADER + #define GRUB_MULTIBOOT_CPU_HEADER 1 + +-#define MULTIBOOT_INITIAL_STATE { .gpr[4] = MULTIBOOT_BOOTLOADER_MAGIC, \ ++#define MULTIBOOT2_INITIAL_STATE { .gpr[4] = MULTIBOOT2_BOOTLOADER_MAGIC, \ + .jumpreg = 1 } + #define MULTIBOOT_ENTRY_REGISTER gpr[1] + #define MULTIBOOT_MBI_REGISTER gpr[5] +-#define MULTIBOOT_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_MIPS32 ++#define MULTIBOOT2_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_MIPS32 + + #define MULTIBOOT_ELF32_MACHINE EM_MIPS + #define MULTIBOOT_ELF64_MACHINE EM_MIPS +diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h +index c96492bb5fa..bd0a9873e6c 100644 +--- a/include/grub/multiboot.h ++++ b/include/grub/multiboot.h +@@ -22,19 +22,11 @@ + + #include + +-#ifdef GRUB_USE_MULTIBOOT2 +-#include +-/* Same thing as far as our loader is concerned. */ +-#define MULTIBOOT_BOOTLOADER_MAGIC MULTIBOOT2_BOOTLOADER_MAGIC +-#define MULTIBOOT_HEADER_MAGIC MULTIBOOT2_HEADER_MAGIC +-#else + #include +-#endif + + #include + #include + +-#ifndef GRUB_USE_MULTIBOOT2 + typedef enum + { + GRUB_MULTIBOOT_QUIRKS_NONE = 0, +@@ -42,7 +34,6 @@ typedef enum + GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL = 2 + } grub_multiboot_quirks_t; + extern grub_multiboot_quirks_t grub_multiboot_quirks; +-#endif + + extern struct grub_relocator *grub_multiboot_relocator; + +@@ -60,7 +51,7 @@ void + grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, + unsigned shndx, void *data); + +-grub_uint32_t grub_get_multiboot_mmap_count (void); ++grub_uint32_t grub_multiboot_get_mmap_count (void); + grub_err_t grub_multiboot_set_video_mode (void); + + /* FIXME: support coreboot as well. */ +diff --git a/include/multiboot2.h b/include/multiboot2.h +index 5a3db5a7cae..5693923c014 100644 +--- a/include/multiboot2.h ++++ b/include/multiboot2.h +@@ -75,8 +75,8 @@ + #define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 + #define MULTIBOOT_HEADER_TAG_RELOCATABLE 10 + +-#define MULTIBOOT_ARCHITECTURE_I386 0 +-#define MULTIBOOT_ARCHITECTURE_MIPS32 4 ++#define MULTIBOOT2_ARCHITECTURE_I386 0 ++#define MULTIBOOT2_ARCHITECTURE_MIPS32 4 + #define MULTIBOOT_HEADER_TAG_OPTIONAL 1 + + #define MULTIBOOT_LOAD_PREFERENCE_NONE 0 diff --git a/0067-Fix-symbols-appearing-in-several-modules-in-linux.patch b/0067-Fix-symbols-appearing-in-several-modules-in-linux.patch new file mode 100644 index 00000000..1fc4cc6a --- /dev/null +++ b/0067-Fix-symbols-appearing-in-several-modules-in-linux.patch @@ -0,0 +1,64 @@ +From 26e5aea9418aab83df0debd0c672086fa9f2d9c8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 14:09:30 +0200 +Subject: [PATCH] Fix symbols appearing in several modules in linux*. + +If same symbol is provided by 2 modules its semantics are undefined. +Avoid this by depending rather than double-including files. +--- + grub-core/Makefile.core.def | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 8d57a59a0e1..66144222c5f 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -770,6 +770,7 @@ module = { + module = { + name = boot; + common = commands/boot.c; ++ common = lib/cmdline.c; + i386_pc = lib/i386/pc/biosnum.c; + enable = x86; + enable = emu; +@@ -1630,8 +1631,6 @@ module = { + module = { + name = linux16; + common = loader/i386/pc/linux.c; +- common = loader/linux.c; +- common = lib/cmdline.c; + enable = x86; + }; + +@@ -1666,7 +1665,6 @@ module = { + cppflags = "-DGRUB_USE_MULTIBOOT2"; + + common = loader/multiboot.c; +- common = lib/cmdline.c; + common = loader/multiboot_mbi2.c; + enable = x86; + enable = mips; +@@ -1675,7 +1673,6 @@ module = { + module = { + name = multiboot; + common = loader/multiboot.c; +- common = lib/cmdline.c; + x86 = loader/i386/multiboot_mbi.c; + extra_dist = loader/multiboot_elfxx.c; + enable = x86; +@@ -1683,7 +1680,6 @@ module = { + + module = { + name = xen_boot; +- common = lib/cmdline.c; + arm64 = loader/arm64/xen_boot.c; + enable = arm64; + }; +@@ -1700,7 +1696,6 @@ module = { + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; + common = loader/linux.c; +- common = lib/cmdline.c; + enable = noemu; + }; + diff --git a/0068-genmoddep-Check-that-no-modules-provide-the-same-sym.patch b/0068-genmoddep-Check-that-no-modules-provide-the-same-sym.patch new file mode 100644 index 00000000..b327d3c9 --- /dev/null +++ b/0068-genmoddep-Check-that-no-modules-provide-the-same-sym.patch @@ -0,0 +1,26 @@ +From 3732816bc08ef605ed3b6c016ff0ed562829f243 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 14:10:48 +0200 +Subject: [PATCH] genmoddep: Check that no modules provide the same symbol. + +The semantics of 2 modules providing the same symbol are undefined. So +ensure that it doesn't happen. +--- + grub-core/genmoddep.awk | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk +index bd98d84cdd7..8976beb91d0 100644 +--- a/grub-core/genmoddep.awk ++++ b/grub-core/genmoddep.awk +@@ -18,6 +18,10 @@ BEGIN { + + { + if ($1 == "defined") { ++ if ($3 in symtab) { ++ printf "%s in %s is duplicated in %s\n", $3, $2, symtab[$3] >"/dev/stderr"; ++ error++; ++ } + symtab[$3] = $2; + modtab[$2] = "" modtab[$2] + } else if ($1 == "undefined") { diff --git a/0069-yylex-Explicilty-cast-fprintf-to-void.patch b/0069-yylex-Explicilty-cast-fprintf-to-void.patch new file mode 100644 index 00000000..6e69c4fd --- /dev/null +++ b/0069-yylex-Explicilty-cast-fprintf-to-void.patch @@ -0,0 +1,23 @@ +From c36c2a86404f373100775305f532c09d46f3c6ce Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 14:11:43 +0200 +Subject: [PATCH] yylex: Explicilty cast fprintf to void. + +It's needed to avoid warning on recent GCC. +--- + grub-core/script/yylex.l | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/script/yylex.l b/grub-core/script/yylex.l +index 95b2191705a..7b44c37b76f 100644 +--- a/grub-core/script/yylex.l ++++ b/grub-core/script/yylex.l +@@ -91,7 +91,7 @@ typedef size_t yy_size_t; + #define stdin 0 + #define stdout 0 + +-#define fprintf(...) 0 ++#define fprintf(...) (void)0 + #define exit(...) grub_fatal("fatal error in lexer") + #endif + diff --git a/0070-linux-fixup.patch b/0070-linux-fixup.patch new file mode 100644 index 00000000..d884921b --- /dev/null +++ b/0070-linux-fixup.patch @@ -0,0 +1,29 @@ +From 6cc79ec10ccafc5935d776e4a396193b93d7e842 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 16:23:52 +0200 +Subject: [PATCH] linux fixup + +--- + grub-core/Makefile.core.def | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 66144222c5f..6edf68286c3 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -770,7 +770,6 @@ module = { + module = { + name = boot; + common = commands/boot.c; +- common = lib/cmdline.c; + i386_pc = lib/i386/pc/biosnum.c; + enable = x86; + enable = emu; +@@ -1696,6 +1695,7 @@ module = { + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; + common = loader/linux.c; ++ common = lib/cmdline.c; + enable = noemu; + }; + diff --git a/0071-multiboot-fixup.patch b/0071-multiboot-fixup.patch new file mode 100644 index 00000000..a3d7f969 --- /dev/null +++ b/0071-multiboot-fixup.patch @@ -0,0 +1,40 @@ +From 4bfd26623f590c8f19c516f4edd342ff18f07bc1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 16:24:05 +0200 +Subject: [PATCH] multiboot fixup + +--- + grub-core/loader/multiboot.c | 5 ++++- + include/grub/mips/multiboot.h | 2 +- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c +index bd3dc1990e3..3b57cb132a6 100644 +--- a/grub-core/loader/multiboot.c ++++ b/grub-core/loader/multiboot.c +@@ -138,8 +138,11 @@ static void + efi_boot (struct grub_relocator *rel, + grub_uint32_t target) + { ++#ifdef GRUB_USE_MULTIBOOT2 ++ struct grub_relocator_efi_state state_efi = MULTIBOOT2_EFI_INITIAL_STATE; ++#else + struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; +- ++#endif + state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip; + state_efi.MULTIBOOT_EFI_MBI_REGISTER = target; + +diff --git a/include/grub/mips/multiboot.h b/include/grub/mips/multiboot.h +index c4eee2dd01b..cdfb41e315a 100644 +--- a/include/grub/mips/multiboot.h ++++ b/include/grub/mips/multiboot.h +@@ -23,7 +23,7 @@ + .jumpreg = 1 } + #define MULTIBOOT_ENTRY_REGISTER gpr[1] + #define MULTIBOOT_MBI_REGISTER gpr[5] +-#define MULTIBOOT2_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_MIPS32 ++#define MULTIBOOT2_ARCHITECTURE_CURRENT MULTIBOOT2_ARCHITECTURE_MIPS32 + + #define MULTIBOOT_ELF32_MACHINE EM_MIPS + #define MULTIBOOT_ELF64_MACHINE EM_MIPS diff --git a/0072-enforcing-fixup.patch b/0072-enforcing-fixup.patch new file mode 100644 index 00000000..52908fcc --- /dev/null +++ b/0072-enforcing-fixup.patch @@ -0,0 +1,22 @@ +From 6ccb2d54bce2eef8e71b93b467c0f49253835c74 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 14 Aug 2017 16:27:10 +0200 +Subject: [PATCH] enforcing fixup + +--- + grub-core/genmoddep.awk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk +index 8976beb91d0..04c2863e5ab 100644 +--- a/grub-core/genmoddep.awk ++++ b/grub-core/genmoddep.awk +@@ -18,7 +18,7 @@ BEGIN { + + { + if ($1 == "defined") { +- if ($3 in symtab) { ++ if ($3 !~ /^\.refptr\./ && $3 in symtab) { + printf "%s in %s is duplicated in %s\n", $3, $2, symtab[$3] >"/dev/stderr"; + error++; + } diff --git a/0073-Set-have_exec-to-y-on-cygwin-so-we-have-grub_mkrescu.patch b/0073-Set-have_exec-to-y-on-cygwin-so-we-have-grub_mkrescu.patch new file mode 100644 index 00000000..0f5eaf6c --- /dev/null +++ b/0073-Set-have_exec-to-y-on-cygwin-so-we-have-grub_mkrescu.patch @@ -0,0 +1,23 @@ +From 5435aaac3c8bfb14bb01a826ec747b783947c86f Mon Sep 17 00:00:00 2001 +From: Xuan Guo +Date: Mon, 14 Aug 2017 16:27:53 +0200 +Subject: [PATCH] Set have_exec to y on cygwin so we have grub_mkrescue. + +--- + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 571f7a0b5aa..c7888e40f66 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -204,7 +204,8 @@ case "$host_os" in + esac + + case "$host_os" in +- cygwin | windows* | mingw32*) have_exec=n ;; ++ cygwin) have_exec=y ;; ++ windows* | mingw32*) have_exec=n ;; + aros*) have_exec=n ;; + *) have_exec=y;; + esac diff --git a/0074-arc-Do-not-create-spurious-variable-grub_arc_memory_.patch b/0074-arc-Do-not-create-spurious-variable-grub_arc_memory_.patch new file mode 100644 index 00000000..7195bf16 --- /dev/null +++ b/0074-arc-Do-not-create-spurious-variable-grub_arc_memory_.patch @@ -0,0 +1,22 @@ +From 3d86efda0074285fb86aa6ffe5d97327ebd134a4 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 15:18:24 +0200 +Subject: [PATCH] arc: Do not create spurious variable grub_arc_memory_type_t. + +--- + include/grub/arc/arc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/grub/arc/arc.h b/include/grub/arc/arc.h +index 7615a49a92c..999de719675 100644 +--- a/include/grub/arc/arc.h ++++ b/include/grub/arc/arc.h +@@ -53,7 +53,7 @@ enum grub_arc_memory_type + #ifndef GRUB_CPU_WORDS_BIGENDIAN + GRUB_ARC_MEMORY_FREE_CONTIGUOUS, + #endif +- } grub_arc_memory_type_t; ++ }; + + struct grub_arc_timeinfo + { diff --git a/0075-unix-exec-avoid-atexit-handlers-when-child-exits.patch b/0075-unix-exec-avoid-atexit-handlers-when-child-exits.patch new file mode 100644 index 00000000..2b91f3ea --- /dev/null +++ b/0075-unix-exec-avoid-atexit-handlers-when-child-exits.patch @@ -0,0 +1,70 @@ +From e75cf4a58b5eaf482804e5e1b2cc7d4399df350e Mon Sep 17 00:00:00 2001 +From: Patrick Steinhardt +Date: Mon, 28 Aug 2017 20:57:19 +0200 +Subject: [PATCH] unix exec: avoid atexit handlers when child exits + +The `grub_util_exec_redirect_all` helper function can be used to +spawn an executable and redirect its output to some files. After calling +`fork()`, the parent will wait for the child to terminate with +`waitpid()` while the child prepares its file descriptors, environment +and finally calls `execvp()`. If something in the children's setup +fails, it will stop by calling `exit(127)`. + +Calling `exit()` will cause any function registered via `atexit()` to be +executed, which is usually the wrong thing to do in a child. And +actually, one can easily observe faulty behaviour on musl-based systems +without modprobe(8) installed: executing `grub-install --help` will call +`grub_util_exec_redirect_all` with "modprobe", which obviously fails if +modprobe(8) is not installed. Due to the child now exiting and invoking +the `atexit()` handlers, it will clean up some data structures of the +parent and cause it to be deadlocked in the `waitpid()` syscall. + +The issue can easily be fixed by calling `_exit(127)` instead, which is +especially designed to be called when the atexit-handlers should not be +executed. + +Signed-off-by: Patrick Steinhardt +--- + grub-core/osdep/unix/exec.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/grub-core/osdep/unix/exec.c b/grub-core/osdep/unix/exec.c +index 935ff120ebe..db3259f6504 100644 +--- a/grub-core/osdep/unix/exec.c ++++ b/grub-core/osdep/unix/exec.c +@@ -99,7 +99,7 @@ grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + { + fd = open (stdin_file, O_RDONLY); + if (fd < 0) +- exit (127); ++ _exit (127); + dup2 (fd, STDIN_FILENO); + close (fd); + } +@@ -108,7 +108,7 @@ grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + { + fd = open (stdout_file, O_WRONLY | O_CREAT, 0700); + if (fd < 0) +- exit (127); ++ _exit (127); + dup2 (fd, STDOUT_FILENO); + close (fd); + } +@@ -117,7 +117,7 @@ grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + { + fd = open (stderr_file, O_WRONLY | O_CREAT, 0700); + if (fd < 0) +- exit (127); ++ _exit (127); + dup2 (fd, STDERR_FILENO); + close (fd); + } +@@ -126,7 +126,7 @@ grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + setenv ("LC_ALL", "C", 1); + + execvp ((char *) argv[0], (char **) argv); +- exit (127); ++ _exit (127); + } + waitpid (pid, &status, 0); + if (!WIFEXITED (status)) diff --git a/0076-xfs-Don-t-attempt-to-iterate-over-empty-directory.patch b/0076-xfs-Don-t-attempt-to-iterate-over-empty-directory.patch new file mode 100644 index 00000000..77ac0ee6 --- /dev/null +++ b/0076-xfs-Don-t-attempt-to-iterate-over-empty-directory.patch @@ -0,0 +1,24 @@ +From c42acc23ff91ea0170eab5f1e10499dcfc4e0c92 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 15:56:19 +0200 +Subject: [PATCH] xfs: Don't attempt to iterate over empty directory. + +Reported by: Tuomas Tynkkynen +--- + grub-core/fs/xfs.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index 9f66dd6e4c6..c6031bd3f71 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -828,6 +828,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + entries = (grub_be_to_cpu32 (tail->leaf_count) + - grub_be_to_cpu32 (tail->leaf_stale)); + ++ if (!entries) ++ continue; ++ + /* Iterate over all entries within this block. */ + while ((char *)direntry < (char *)tail) + { diff --git a/0077-Implement-checksum-verification-for-gunzip.patch b/0077-Implement-checksum-verification-for-gunzip.patch new file mode 100644 index 00000000..4080b1c3 --- /dev/null +++ b/0077-Implement-checksum-verification-for-gunzip.patch @@ -0,0 +1,127 @@ +From b18ce97c672615bb5ac44883676b37a9ec758d83 Mon Sep 17 00:00:00 2001 +From: Stefan Fritsch +Date: Sun, 1 May 2016 14:32:30 +0200 +Subject: [PATCH] Implement checksum verification for gunzip + +This implements the crc32 check for the gzip format. Support for zlib's +adler checksum is not included, yet. +--- + grub-core/io/gzio.c | 46 +++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 5 deletions(-) + +diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c +index a8e33033bf8..dcf3a870147 100644 +--- a/grub-core/io/gzio.c ++++ b/grub-core/io/gzio.c +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -94,6 +95,14 @@ struct grub_gzio + struct huft *tl; + /* The distance code table. */ + struct huft *td; ++ /* The checksum algorithm */ ++ const gcry_md_spec_t *hdesc; ++ /* The wanted checksum */ ++ grub_uint32_t orig_checksum; ++ /* The uncompressed length */ ++ grub_size_t orig_len; ++ /* Context for checksum calculation */ ++ grub_uint8_t *hcontext; + /* The lookup bits for the literal/length code table. */ + int bl; + /* The lookup bits for the distance code table. */ +@@ -180,7 +189,7 @@ test_gzip_header (grub_file_t file) + grub_uint8_t os_type; + } hdr; + grub_uint16_t extra_len; +- grub_uint32_t orig_len; ++ grub_uint32_t crc32; + grub_gzio_t gzio = file->data; + + if (grub_file_tell (gzio->file) != 0) +@@ -215,12 +224,15 @@ test_gzip_header (grub_file_t file) + + /* FIXME: don't do this on not easily seekable files. */ + { +- grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4); +- if (grub_file_read (gzio->file, &orig_len, 4) != 4) ++ grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8); ++ if (grub_file_read (gzio->file, &crc32, 4) != 4) ++ return 0; ++ gzio->orig_checksum = grub_le_to_cpu32 (crc32); ++ if (grub_file_read (gzio->file, &gzio->orig_len, 4) != 4) + return 0; + /* FIXME: this does not handle files whose original size is over 4GB. + But how can we know the real original size? */ +- file->size = grub_le_to_cpu32 (orig_len); ++ file->size = grub_le_to_cpu32 (gzio->orig_len); + } + + initialize_tables (gzio); +@@ -1095,7 +1107,23 @@ inflate_window (grub_gzio_t gzio) + + gzio->saved_offset += gzio->wp; + +- /* XXX do CRC calculation here! */ ++ if (gzio->hcontext) ++ { ++ gzio->hdesc->write (gzio->hcontext, gzio->slide, gzio->wp); ++ ++ if (gzio->saved_offset == gzio->orig_len) ++ { ++ grub_uint32_t csum; ++ ++ gzio->hdesc->final (gzio->hcontext); ++ csum = *(grub_uint32_t *)gzio->hdesc->read (gzio->hcontext); ++ csum = grub_be_to_cpu32 (csum); ++ if (csum != gzio->orig_checksum) ++ grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, ++ "checksum mismatch %08x/%08x", ++ gzio->orig_checksum, csum); ++ } ++ } + } + + +@@ -1118,6 +1146,9 @@ initialize_tables (grub_gzio_t gzio) + huft_free (gzio->td); + gzio->tl = NULL; + gzio->td = NULL; ++ ++ if (gzio->hcontext) ++ gzio->hdesc->init(gzio->hcontext); + } + + +@@ -1143,6 +1174,9 @@ grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) + + gzio->file = io; + ++ gzio->hdesc = GRUB_MD_CRC32; ++ gzio->hcontext = grub_malloc(gzio->hdesc->contextsize); ++ + file->device = io->device; + file->data = gzio; + file->fs = &grub_gzio_fs; +@@ -1151,6 +1185,7 @@ grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) + if (! test_gzip_header (file)) + { + grub_errno = GRUB_ERR_NONE; ++ grub_free (gzio->hcontext); + grub_free (gzio); + grub_free (file); + grub_file_seek (io, 0); +@@ -1287,6 +1322,7 @@ grub_gzio_close (grub_file_t file) + grub_file_close (gzio->file); + huft_free (gzio->tl); + huft_free (gzio->td); ++ grub_free (gzio->hcontext); + grub_free (gzio); + + /* No need to close the same device twice. */ diff --git a/0078-qemu-coreboot-multiboot-Change-linking-address-to-0x.patch b/0078-qemu-coreboot-multiboot-Change-linking-address-to-0x.patch new file mode 100644 index 00000000..b7adab66 --- /dev/null +++ b/0078-qemu-coreboot-multiboot-Change-linking-address-to-0x.patch @@ -0,0 +1,53 @@ +From ec763ed00ac55deb1c429bda5057bd5a147183d1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 16:29:59 +0200 +Subject: [PATCH] qemu, coreboot, multiboot: Change linking address to 0x9000. + +It's common for distros to use a defective ld which links at 0x9000. Instead +of fighting it, just move link target to 0x9000. +--- + grub-core/Makefile.core.def | 6 +++--- + include/grub/offsets.h | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 6edf68286c3..d90ad622082 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -68,11 +68,11 @@ kernel = { + i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; + i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; + i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)'; +- i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8200'; ++ i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; + i386_coreboot_ldflags = '$(TARGET_IMG_LDFLAGS)'; +- i386_coreboot_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8200'; ++ i386_coreboot_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; + i386_multiboot_ldflags = '$(TARGET_IMG_LDFLAGS)'; +- i386_multiboot_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8200'; ++ i386_multiboot_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; + i386_ieee1275_ldflags = '$(TARGET_IMG_LDFLAGS)'; + i386_ieee1275_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x10000'; + i386_xen_ldflags = '$(TARGET_IMG_LDFLAGS)'; +diff --git a/include/grub/offsets.h b/include/grub/offsets.h +index bf0689fc99a..330e4c70738 100644 +--- a/include/grub/offsets.h ++++ b/include/grub/offsets.h +@@ -50,7 +50,7 @@ + /* The offset of GRUB_CORE_ENTRY_ADDR. */ + #define GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8 + +-#define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200 ++#define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x9000 + + /* The offset of GRUB_TOTAL_MODULE_SIZE. */ + #define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8 +@@ -91,7 +91,7 @@ + + #define GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08 + +-#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200 ++#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x9000 + #define GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR 0x100000 + + #define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000 diff --git a/0079-printf_unit_test-Disable-Wformat-truncation-on-GCC-7.patch b/0079-printf_unit_test-Disable-Wformat-truncation-on-GCC-7.patch new file mode 100644 index 00000000..5bc2f82b --- /dev/null +++ b/0079-printf_unit_test-Disable-Wformat-truncation-on-GCC-7.patch @@ -0,0 +1,25 @@ +From 32099228e6ccf209f64d509cd7e13413ea10778e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 16:59:25 +0200 +Subject: [PATCH] printf_unit_test: Disable Wformat-truncation on GCC >= 7 + +We intentionally pass NULL as argument to format, hence disable the warning. +--- + tests/printf_unit_test.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/printf_unit_test.c b/tests/printf_unit_test.c +index d7b12c6dbee..098c29fd9ce 100644 +--- a/tests/printf_unit_test.c ++++ b/tests/printf_unit_test.c +@@ -23,6 +23,10 @@ + + #define MSG "printf test failed: %s, %s", real, expected + ++#if defined(__GNUC__) && __GNUC__ >= 7 ++#pragma GCC diagnostic ignored "-Wformat-truncation=" ++#endif ++ + static void + printf_test (void) + { diff --git a/0080-Regenerate-checksum.h-with-newer-unifont.patch b/0080-Regenerate-checksum.h-with-newer-unifont.patch new file mode 100644 index 00000000..b9756cd9 --- /dev/null +++ b/0080-Regenerate-checksum.h-with-newer-unifont.patch @@ -0,0 +1,274 @@ +From 061258a05edd7077f3cb15f51bda2823f513d261 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 17:12:04 +0200 +Subject: [PATCH] Regenerate checksum.h with newer unifont. + +Old link is broken. New unifont is +http://ftp.de.debian.org/debian/pool/main/u/unifont/xfonts-unifont_9.0.06-2_all.deb +--- + grub-core/tests/checksums.h | 258 ++++++++++++++++++++++---------------------- + 1 file changed, 129 insertions(+), 129 deletions(-) + +diff --git a/grub-core/tests/checksums.h b/grub-core/tests/checksums.h +index 921e57ff48d..8273bd105de 100644 +--- a/grub-core/tests/checksums.h ++++ b/grub-core/tests/checksums.h +@@ -1,129 +1,129 @@ +- { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x8851b0ee, 0x8851b0ee, 0xafb59f0b, 0xafb59f0b, 0x8c9b72f1, 0x8c9b72f1, 0x6eec5116, 0x6eec5116, 0xad82053e, 0xad82053e, 0x2eeae2ae, 0x2eeae2ae, 0x58cf8def, 0x58cf8def, 0x926f4d2f, 0x926f4d2f, 0xbd1c3236, 0xbd1c3236, 0x56012a95, 0x56012a95, 0x6d7c40ae, 0x6d7c40ae, 0xef750bc8, 0xef750bc8, 0x1080dd4a, 0x1080dd4a, 0xd7f9e5af, 0xd7f9e5af, 0x80b1b4a9, 0x80b1b4a9, 0x2c99415e, 0x2c99415e, 0x8d5761ff, 0x8d5761ff, 0xb964b489, 0xb964b489, 0x88a51f74, 0x88a51f74, 0x1da6c458, 0x1da6c458, 0x85e94025, 0x206ea54f, 0x7ee6c8fd, 0x7ee6c8fd, }, 45 }, +- { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x834b70a0, 0x834b70a0, 0xe7cc129f, 0xe7cc129f, 0x5ee2edc, 0x5ee2edc, 0xa1135cd7, 0xa1135cd7, 0xf7ce1f26, 0xf7ce1f26, 0xe9f803e8, 0xe9f803e8, 0x4b8f9724, 0x4b8f9724, 0x3fe3771a, 0x3fe3771a, 0x5584ee63, 0x5584ee63, 0xac193250, 0xac193250, 0x801f25f4, 0x801f25f4, 0x8d33aece, 0x8d33aece, 0xc6d95edc, 0xc6d95edc, 0xf121dee2, 0xf121dee2, 0x6ab10812, 0x6ab10812, 0x41a5b112, 0x41a5b112, 0xac6f712b, 0xac6f712b, 0x8aee7a19, 0x8aee7a19, 0xfe37c0ad, 0xfe37c0ad, 0x99c6a336, 0x99c6a336, 0x53b844c6, 0x73015447, 0x7a1a2254, 0x7a1a2254, }, 45 }, +- { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb121c912, 0xb121c912, 0x635a8739, 0x635a8739, 0x8288cba6, 0x8288cba6, 0xf5589d0, 0xf5589d0, 0x471642b3, 0x471642b3, 0xfb4826cf, 0xfb4826cf, 0x8b1083cf, 0x8b1083cf, 0x738b0c94, 0x738b0c94, 0x859c41b0, 0x859c41b0, 0x7c8d1be9, 0x7c8d1be9, 0x5b685e40, 0x5b685e40, 0x9cf80d95, 0x9cf80d95, 0x3541f915, 0x3541f915, 0x582b8557, 0x582b8557, 0x24cf88f7, 0x24cf88f7, 0x9e0af23, 0x9e0af23, 0x1033164b, 0x1033164b, 0x70ba51e2, 0x70ba51e2, 0xb051585c, 0xb051585c, 0xe1389f04, 0xe1389f04, 0x308bbb74, 0xdc9e6805, 0x4ddcff9f, 0x4ddcff9f, }, 45 }, +- { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xac16e832, 0xac16e832, 0xbf6ab9c6, 0xbf6ab9c6, 0x1063e15a, 0x1063e15a, 0xf908e3ff, 0xf908e3ff, 0xcb37d841, 0xcb37d841, 0x9b8ffa7d, 0x9b8ffa7d, 0x38d2a26c, 0x38d2a26c, 0x6989f09b, 0x6989f09b, 0x481451e, 0x481451e, 0x17b3177, 0x17b3177, 0x3ea52aeb, 0x3ea52aeb, 0xc24de674, 0xc24de674, 0x4ab163cc, 0x4ab163cc, 0xc482b092, 0xc482b092, 0x55ffc7e2, 0x55ffc7e2, 0x3b4b34dd, 0x3b4b34dd, 0x9b1f047f, 0x9b1f047f, 0x3d42e414, 0x3d42e414, 0x35b2fb06, 0x35b2fb06, 0xb813b35f, 0xb813b35f, 0xc3ede6e0, 0xc35214c3, 0x340f0107, 0x340f0107, }, 45 }, +- { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9c47caee, 0x9c47caee, 0x6c9c4f38, 0x6c9c4f38, 0x79c49615, 0x79c49615, 0x70fe9708, 0x70fe9708, 0x8e90c077, 0x8e90c077, 0xd8205b47, 0xd8205b47, 0xa34337e2, 0xa34337e2, 0xf4dffa53, 0xf4dffa53, 0x90a0779c, 0x90a0779c, 0x322820bb, 0x322820bb, 0x50e3383f, 0x50e3383f, 0x4a976e3e, 0x4a976e3e, 0x90b6f8d9, 0x90b6f8d9, 0x4058c301, 0x4058c301, 0x221a6810, 0x221a6810, 0x1f78a00e, 0x1f78a00e, 0x6a633d2c, 0x6a633d2c, 0xca177c65, 0xca177c65, 0xabb6c7f9, 0xabb6c7f9, 0x635a35e8, 0x635a35e8, 0x6da78f10, 0x53467ff8, 0xd037fdfa, 0xd037fdfa, }, 45 }, +- { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2b6b8225, 0x2b6b8225, 0x83df9995, 0x83df9995, 0x5165ad0b, 0x5165ad0b, 0xe5a6f96d, 0xe5a6f96d, 0x798df957, 0x798df957, 0x8c0567e2, 0x8c0567e2, 0x5e5d7389, 0x5e5d7389, 0x47a39dd, 0x47a39dd, 0x894f44af, 0x894f44af, 0x1dff0a6, 0x1dff0a6, 0xf496e67b, 0xf496e67b, 0x29cb5702, 0x29cb5702, 0xeaf1387d, 0xeaf1387d, 0x4a9bf7, 0x4a9bf7, 0x11d20bee, 0x11d20bee, 0xa103dc2d, 0xa103dc2d, 0xd0265db9, 0xd0265db9, 0x42267334, 0x42267334, 0x96f85e8c, 0x96f85e8c, 0xa28eac49, 0xa28eac49, 0x4e660ae7, 0x70741b3, 0x183f2f2e, 0x183f2f2e, }, 45 }, +- { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x77b51f44, 0x77b51f44, 0xc8097569, 0xc8097569, 0x769aee5f, 0x769aee5f, 0xa35e159, 0xa35e159, 0x87a6341f, 0x87a6341f, 0xb61d944b, 0xb61d944b, 0x8b109cb3, 0x8b109cb3, 0xed3fb3e, 0xed3fb3e, 0xd7cc6c3, 0xd7cc6c3, 0x52077f0d, 0x52077f0d, 0x9d86d17e, 0x9d86d17e, 0x5e487bb, 0x5e487bb, 0x3a00041b, 0x3a00041b, 0xcfdeaf9e, 0xcfdeaf9e, 0x3e40af89, 0x3e40af89, 0x5ec41ea9, 0x5ec41ea9, 0x6298e4e7, 0x6298e4e7, 0xfd67f90e, 0xfd67f90e, 0x5ab5dc32, 0x5ab5dc32, 0xdd3ad694, 0xdd3ad694, 0x391222b4, 0xd4a98b43, 0xeaa2f62, 0xeaa2f62, }, 45 }, +- { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x45b0713c, 0x237f9dbf, 0x45b0713c, 0x646bc7b, 0x59c36f00, 0x59c36f00, 0x7fd94135, 0x7fd94135, 0x7fd94135, 0x1592c53, 0x1592c53, 0x1592c53, 0x63af3981, 0x63af3981, 0x63af3981, 0x59c36f00, 0x646bc7b, 0x646bc7b, 0x59c36f00, }, 20 }, +- { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x84abc7db, 0x20814063, 0x84abc7db, 0xaaae42a4, 0xaa4593fe, 0xaa4593fe, 0x2e88732f, 0x2e88732f, 0x2e88732f, 0x887d7e48, 0x887d7e48, 0x887d7e48, 0xa545d530, 0xa545d530, 0xa545d530, 0xaa4593fe, 0xaaae42a4, 0xaaae42a4, 0xaa4593fe, }, 20 }, +- { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5b85371a, 0xe10968c2, 0x5b85371a, 0x6925a9e, 0xc9cbf769, 0xc9cbf769, 0xda1c9f17, 0xda1c9f17, 0xda1c9f17, 0x24c45edb, 0x24c45edb, 0x24c45edb, 0xcd8ee1d3, 0xcd8ee1d3, 0xcd8ee1d3, 0xc9cbf769, 0x6925a9e, 0x6925a9e, 0xc9cbf769, }, 20 }, +- { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x9130464d, 0x22904f7a, 0x9130464d, 0x3f660f95, 0x9813a416, 0x9813a416, 0xfb08d7cf, 0xfb08d7cf, 0xfb08d7cf, 0x6ad351fc, 0x6ad351fc, 0x6ad351fc, 0x73696c2c, 0x73696c2c, 0x73696c2c, 0x9813a416, 0x3f660f95, 0x3f660f95, 0x9813a416, }, 20 }, +- { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x5185b14e, 0x4173aa2f, 0x5185b14e, 0x272384fd, 0x5fcf013d, 0x5fcf013d, 0x9e56a9e0, 0x9e56a9e0, 0x9e56a9e0, 0x4c46b196, 0x4c46b196, 0x4c46b196, 0x5a358e09, 0x5a358e09, 0x5a358e09, 0x5fcf013d, 0x272384fd, 0x272384fd, 0x5fcf013d, }, 20 }, +- { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x5cc0d3ef, 0x8b87731, 0x5cc0d3ef, 0x47c509e8, 0xdd28f52b, 0xdd28f52b, 0xe1579057, 0xe1579057, 0xe1579057, 0xc06b69b3, 0xc06b69b3, 0xc06b69b3, 0xbdd3a23f, 0xbdd3a23f, 0xbdd3a23f, 0xdd28f52b, 0x47c509e8, 0x47c509e8, 0xdd28f52b, }, 20 }, +- { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xd1338a02, 0x7aa25dbf, 0xd1338a02, 0x2e8c9182, 0x43d1f34, 0x43d1f34, 0x6486f7c4, 0x6486f7c4, 0x6486f7c4, 0x1b8c5e6c, 0x1b8c5e6c, 0x1b8c5e6c, 0x82dd5bea, 0x82dd5bea, 0x82dd5bea, 0x43d1f34, 0x2e8c9182, 0x2e8c9182, 0x43d1f34, }, 20 }, +- { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x1027210c, 0x64e51c81, 0x1027210c, 0x45ca4a8a, 0x9a2e0d26, 0x2b88b6ce, 0x2b88b6ce, 0x2b88b6ce, 0x7750400e, 0x7750400e, 0x7750400e, 0x5ec88e9c, 0x5ec88e9c, 0x5ec88e9c, 0x59c36f00, 0x45ca4a8a, 0x45ca4a8a, }, 18 }, +- { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8d12f697, 0xc5b32248, 0x8d12f697, 0x56720aa4, 0xa9d58ccd, 0xa1b1a1b5, 0xa1b1a1b5, 0xa1b1a1b5, 0xf4ee0bbf, 0xf4ee0bbf, 0xf4ee0bbf, 0x9dddc3f6, 0x9dddc3f6, 0x9dddc3f6, 0xaa4593fe, 0x56720aa4, 0x56720aa4, }, 18 }, +- { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa5ec9f45, 0xdb7085d8, 0xa5ec9f45, 0x9caf1d3f, 0x5411be8b, 0xa07e74d3, 0xa07e74d3, 0xa07e74d3, 0xdfc0d247, 0xdfc0d247, 0xdfc0d247, 0x9db4b23f, 0x9db4b23f, 0x9db4b23f, 0xc9cbf769, 0x9caf1d3f, 0x9caf1d3f, }, 18 }, +- { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xce8e83bf, 0xeb96c838, 0xce8e83bf, 0x73cb3bc1, 0x740d78cf, 0x84312594, 0x84312594, 0x84312594, 0x6f94cfe8, 0x6f94cfe8, 0x6f94cfe8, 0x69dfcf18, 0x69dfcf18, 0x69dfcf18, 0x1c3742c9, 0x73cb3bc1, 0x73cb3bc1, }, 18 }, +- { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x56a03e51, 0xee7d8d4b, 0x56a03e51, 0x5bdf9413, 0xbcda144c, 0x131c0760, 0x131c0760, 0x131c0760, 0x7c55db71, 0x7c55db71, 0x7c55db71, 0x71a34572, 0x71a34572, 0x71a34572, 0xcc5a7bed, 0x5bdf9413, 0x5bdf9413, }, 18 }, +- { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0xea8a9cf0, 0x8929e522, 0xea8a9cf0, 0x78f3dfbc, 0x5d55a141, 0xb9092e0b, 0xb9092e0b, 0xb9092e0b, 0x7fbb6a15, 0x7fbb6a15, 0x7fbb6a15, 0x6bdebaaa, 0x6bdebaaa, 0x6bdebaaa, 0xef4a3312, 0x78f3dfbc, 0x78f3dfbc, }, 18 }, +- { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0x6dcf1d57, 0x925a4c8f, 0x6dcf1d57, 0x69005b38, 0x6d6bb4bc, 0x14f7c6b1, 0x14f7c6b1, 0x14f7c6b1, 0x95043060, 0x95043060, 0x95043060, 0x3a0890f, 0x3a0890f, 0x3a0890f, 0x54e48d80, 0x69005b38, 0x69005b38, }, 18 }, +- { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x77ff5efc, 0x791fe364, 0x77ff5efc, 0x340993bb, 0x59c36f00, 0x59c36f00, 0x3908ca1e, 0x3908ca1e, 0x3908ca1e, 0x4788a778, 0x4788a778, 0x4788a778, 0x257eb2aa, 0x257eb2aa, 0x257eb2aa, 0x59c36f00, 0x340993bb, 0x340993bb, 0x59c36f00, }, 20 }, +- { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb2d04b0f, 0x46cdbc23, 0xb2d04b0f, 0x9cd5ce70, 0xaa4593fe, 0xaa4593fe, 0x44bf6b37, 0x44bf6b37, 0x44bf6b37, 0xe24a6650, 0xe24a6650, 0xe24a6650, 0xcf72cd28, 0xcf72cd28, 0xcf72cd28, 0xaa4593fe, 0x9cd5ce70, 0x9cd5ce70, 0xaa4593fe, }, 20 }, +- { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x4bb823b8, 0x59349835, 0x4bb823b8, 0x16af4e3c, 0xc9cbf769, 0xc9cbf769, 0x2784b68e, 0x2784b68e, 0x2784b68e, 0xd95c7742, 0xd95c7742, 0xd95c7742, 0x3016c84a, 0x3016c84a, 0x3016c84a, 0xc9cbf769, 0x16af4e3c, 0x16af4e3c, 0xc9cbf769, }, 20 }, +- { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb821e44, 0x16b3ac05, 0xb821e44, 0xa5d4579c, 0x9813a416, 0x9813a416, 0xca80d730, 0xca80d730, 0xca80d730, 0x5b5b5103, 0x5b5b5103, 0x5b5b5103, 0x42e16cd3, 0x42e16cd3, 0x42e16cd3, 0x9813a416, 0xa5d4579c, 0xa5d4579c, 0x9813a416, }, 20 }, +- { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xbe0b9671, 0x7f6e98d0, 0xbe0b9671, 0xc8ada3c2, 0x5fcf013d, 0x5fcf013d, 0x57a0c67d, 0x57a0c67d, 0x57a0c67d, 0x85b0de0b, 0x85b0de0b, 0x85b0de0b, 0x93c3e194, 0x93c3e194, 0x93c3e194, 0x5fcf013d, 0xc8ada3c2, 0xc8ada3c2, 0x5fcf013d, }, 20 }, +- { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x9f18b29e, 0x50e7d383, 0x9f18b29e, 0x841d6899, 0xdd28f52b, 0xdd28f52b, 0xd12092dc, 0xd12092dc, 0xd12092dc, 0xf01c6b38, 0xf01c6b38, 0xf01c6b38, 0x8da4a0b4, 0x8da4a0b4, 0x8da4a0b4, 0xdd28f52b, 0x841d6899, 0x841d6899, 0xdd28f52b, }, 20 }, +- { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4e8d4d8c, 0x3f32cb90, 0x4e8d4d8c, 0xb132560c, 0x43d1f34, 0x43d1f34, 0x1e7f303c, 0x1e7f303c, 0x1e7f303c, 0x61759994, 0x61759994, 0x61759994, 0xf8249c12, 0xf8249c12, 0xf8249c12, 0x43d1f34, 0xb132560c, 0xb132560c, 0x43d1f34, }, 20 }, +- { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4f39b2c5, 0x37084023, 0x4f39b2c5, 0xccf7f82, 0x59c36f00, 0x59c36f00, 0xb5dad2e, 0xb5dad2e, 0xb5dad2e, 0x75ddc048, 0x75ddc048, 0x75ddc048, 0x172bd59a, 0x172bd59a, 0x172bd59a, 0x59c36f00, 0xccf7f82, 0xccf7f82, 0x59c36f00, }, 20 }, +- { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd5f24f8e, 0x76463f82, 0xd5f24f8e, 0xfbf7caf1, 0xaa4593fe, 0xaa4593fe, 0xb897c475, 0xb897c475, 0xb897c475, 0x1e62c912, 0x1e62c912, 0x1e62c912, 0x335a626a, 0x335a626a, 0x335a626a, 0xaa4593fe, 0xfbf7caf1, 0xfbf7caf1, 0xaa4593fe, }, 20 }, +- { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8aa7c8c3, 0x28620e7e, 0x8aa7c8c3, 0xd7b0a547, 0xc9cbf769, 0xc9cbf769, 0x860f1899, 0x860f1899, 0x860f1899, 0x78d7d955, 0x78d7d955, 0x78d7d955, 0x919d665d, 0x919d665d, 0x919d665d, 0xc9cbf769, 0xd7b0a547, 0xd7b0a547, 0xc9cbf769, }, 20 }, +- { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x89654b6, 0x26bab4dd, 0x89654b6, 0xa6c01d6e, 0x9813a416, 0x9813a416, 0xc67652d9, 0xc67652d9, 0xc67652d9, 0x57add4ea, 0x57add4ea, 0x57add4ea, 0x4e17e93a, 0x4e17e93a, 0x4e17e93a, 0x9813a416, 0xa6c01d6e, 0xa6c01d6e, 0x9813a416, }, 20 }, +- { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x77945f28, 0xec3ce845, 0x77945f28, 0x1326a9b, 0x5fcf013d, 0x5fcf013d, 0xc8e6e12c, 0xc8e6e12c, 0xc8e6e12c, 0x1af6f95a, 0x1af6f95a, 0x1af6f95a, 0xc85c6c5, 0xc85c6c5, 0xc85c6c5, 0x5fcf013d, 0x1326a9b, 0x1326a9b, 0x5fcf013d, }, 20 }, +- { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x4450a5dc, 0xda479f49, 0x4450a5dc, 0x5f557fdb, 0xdd28f52b, 0xdd28f52b, 0xddfe9197, 0xddfe9197, 0xddfe9197, 0xfcc26873, 0xfcc26873, 0xfcc26873, 0x817aa3ff, 0x817aa3ff, 0x817aa3ff, 0xdd28f52b, 0x5f557fdb, 0x5f557fdb, 0xdd28f52b, }, 20 }, +- { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x409098da, 0x2e0890e, 0x409098da, 0xbf2f835a, 0x43d1f34, 0x43d1f34, 0x253d050e, 0x253d050e, 0x253d050e, 0x5a37aca6, 0x5a37aca6, 0x5a37aca6, 0xc366a920, 0xc366a920, 0xc366a920, 0x43d1f34, 0xbf2f835a, 0xbf2f835a, 0x43d1f34, }, 20 }, +- { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x546aa9f1, 0x56bf26d0, 0x546aa9f1, 0x179c64b6, 0x59c36f00, 0x59c36f00, 0xa98ad4a1, 0xa98ad4a1, 0xa98ad4a1, 0xd70ab9c7, 0xd70ab9c7, 0xd70ab9c7, 0xb5fcac15, 0xb5fcac15, 0xb5fcac15, 0x59c36f00, 0x179c64b6, 0x179c64b6, 0x59c36f00, }, 20 }, +- { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x12592c97, 0xa10f7034, 0x12592c97, 0x3c5ca9e8, 0xaa4593fe, 0xaa4593fe, 0x2c3e194, 0x2c3e194, 0x2c3e194, 0xa436ecf3, 0xa436ecf3, 0xa436ecf3, 0x890e478b, 0x890e478b, 0x890e478b, 0xaa4593fe, 0x3c5ca9e8, 0x3c5ca9e8, 0xaa4593fe, }, 20 }, +- { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xed5de42a, 0x5cf94e51, 0xed5de42a, 0xb04a89ae, 0xc9cbf769, 0xc9cbf769, 0xdd578210, 0xdd578210, 0xdd578210, 0x238f43dc, 0x238f43dc, 0x238f43dc, 0xcac5fcd4, 0xcac5fcd4, 0xcac5fcd4, 0xc9cbf769, 0xb04a89ae, 0xb04a89ae, 0xc9cbf769, }, 20 }, +- { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbbc56f90, 0x4f643bbb, 0xbbc56f90, 0x15932648, 0x9813a416, 0x9813a416, 0x28aba4d1, 0x28aba4d1, 0x28aba4d1, 0xb97022e2, 0xb97022e2, 0xb97022e2, 0xa0ca1f32, 0xa0ca1f32, 0xa0ca1f32, 0x9813a416, 0x15932648, 0x15932648, 0x9813a416, }, 20 }, +- { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x43465d8c, 0x6399888a, 0x43465d8c, 0x35e0683f, 0x5fcf013d, 0x5fcf013d, 0x4895c207, 0x4895c207, 0x4895c207, 0x9a85da71, 0x9a85da71, 0x9a85da71, 0x8cf6e5ee, 0x8cf6e5ee, 0x8cf6e5ee, 0x5fcf013d, 0x35e0683f, 0x35e0683f, 0x5fcf013d, }, 20 }, +- { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd1e7f231, 0xe67e195e, 0xd1e7f231, 0xcae22836, 0xdd28f52b, 0xdd28f52b, 0xe7ae9f08, 0xe7ae9f08, 0xe7ae9f08, 0xc69266ec, 0xc69266ec, 0xc69266ec, 0xbb2aad60, 0xbb2aad60, 0xbb2aad60, 0xdd28f52b, 0xcae22836, 0xcae22836, 0xdd28f52b, }, 20 }, +- { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x793e58f4, 0x5f939386, 0x793e58f4, 0x86814374, 0x43d1f34, 0x43d1f34, 0x12b2b9c1, 0x12b2b9c1, 0x12b2b9c1, 0x6db81069, 0x6db81069, 0x6db81069, 0xf4e915ef, 0xf4e915ef, 0xf4e915ef, 0x43d1f34, 0x86814374, 0x86814374, 0x43d1f34, }, 20 }, +- { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x226c0d75, 0x9e291f4f, 0x226c0d75, 0x619ac032, 0x59c36f00, 0x59c36f00, 0x6fb6253, 0x6fb6253, 0x6fb6253, 0x787b0f35, 0x787b0f35, 0x787b0f35, 0x1a8d1ae7, 0x1a8d1ae7, 0x1a8d1ae7, 0x59c36f00, 0x619ac032, 0x619ac032, 0x59c36f00, }, 20 }, +- { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8355045, 0xfe058b68, 0x8355045, 0x2630d53a, 0xaa4593fe, 0xaa4593fe, 0x290a3822, 0x290a3822, 0x290a3822, 0x8fff3545, 0x8fff3545, 0x8fff3545, 0xa2c79e3d, 0xa2c79e3d, 0xa2c79e3d, 0xaa4593fe, 0x2630d53a, 0x2630d53a, 0xaa4593fe, }, 20 }, +- { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xc702fa59, 0x74086887, 0xc702fa59, 0x9a1597dd, 0xc9cbf769, 0xc9cbf769, 0x60295baa, 0x60295baa, 0x60295baa, 0x9ef19a66, 0x9ef19a66, 0x9ef19a66, 0x77bb256e, 0x77bb256e, 0x77bb256e, 0xc9cbf769, 0x9a1597dd, 0x9a1597dd, 0xc9cbf769, }, 20 }, +- { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x82385331, 0xf77eda42, 0x82385331, 0x2c6e1ae9, 0x9813a416, 0x9813a416, 0x140c0d1f, 0x140c0d1f, 0x140c0d1f, 0x85d78b2c, 0x85d78b2c, 0x85d78b2c, 0x9c6db6fc, 0x9c6db6fc, 0x9c6db6fc, 0x9813a416, 0x2c6e1ae9, 0x2c6e1ae9, 0x9813a416, }, 20 }, +- { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x565d2d38, 0x34f757ec, 0x565d2d38, 0x20fb188b, 0x5fcf013d, 0x5fcf013d, 0x230bf123, 0x230bf123, 0x230bf123, 0xf11be955, 0xf11be955, 0xf11be955, 0xe768d6ca, 0xe768d6ca, 0xe768d6ca, 0x5fcf013d, 0x20fb188b, 0x20fb188b, 0x5fcf013d, }, 20 }, +- { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x632132a4, 0x4a8c90b2, 0x632132a4, 0x7824e8a3, 0xdd28f52b, 0xdd28f52b, 0xef2bffce, 0xef2bffce, 0xef2bffce, 0xce17062a, 0xce17062a, 0xce17062a, 0xb3afcda6, 0xb3afcda6, 0xb3afcda6, 0xdd28f52b, 0x7824e8a3, 0x7824e8a3, 0xdd28f52b, }, 20 }, +- { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x461d4cfa, 0xfd3492c2, 0x461d4cfa, 0xb9a2577a, 0x43d1f34, 0x43d1f34, 0xfb72301f, 0xfb72301f, 0xfb72301f, 0x847899b7, 0x847899b7, 0x847899b7, 0x1d299c31, 0x1d299c31, 0x1d299c31, 0x43d1f34, 0xb9a2577a, 0xb9a2577a, 0x43d1f34, }, 20 }, +- { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x82758f66, 0xbac387fd, 0x82758f66, 0xc1834221, 0x59c36f00, 0x59c36f00, 0x4877befe, 0x4877befe, 0x4877befe, 0x36f7d398, 0x36f7d398, 0x36f7d398, 0x5401c64a, 0x5401c64a, 0x5401c64a, 0x59c36f00, 0xc1834221, 0xc1834221, 0x59c36f00, }, 20 }, +- { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x4500a591, 0x9a40cbd8, 0x4500a591, 0x6b0520ee, 0xaa4593fe, 0xaa4593fe, 0x16db2902, 0x16db2902, 0x16db2902, 0xb02e2465, 0xb02e2465, 0xb02e2465, 0x9d168f1d, 0x9d168f1d, 0x9d168f1d, 0xaa4593fe, 0x6b0520ee, 0x6b0520ee, 0xaa4593fe, }, 20 }, +- { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x3cd9ea11, 0x1244c852, 0x3cd9ea11, 0x61ce8795, 0xc9cbf769, 0xc9cbf769, 0x6b15d6f0, 0x6b15d6f0, 0x6b15d6f0, 0x95cd173c, 0x95cd173c, 0x95cd173c, 0x7c87a834, 0x7c87a834, 0x7c87a834, 0xc9cbf769, 0x61ce8795, 0x61ce8795, 0xc9cbf769, }, 20 }, +- { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc818f15f, 0xbaf13382, 0xc818f15f, 0x664eb887, 0x9813a416, 0x9813a416, 0x350fe990, 0x350fe990, 0x350fe990, 0xa4d46fa3, 0xa4d46fa3, 0xa4d46fa3, 0xbd6e5273, 0xbd6e5273, 0xbd6e5273, 0x9813a416, 0x664eb887, 0x664eb887, 0x9813a416, }, 20 }, +- { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xaa1dc81, 0x234341dd, 0xaa1dc81, 0x7c07e932, 0x5fcf013d, 0x5fcf013d, 0x969354c5, 0x969354c5, 0x969354c5, 0x44834cb3, 0x44834cb3, 0x44834cb3, 0x52f0732c, 0x52f0732c, 0x52f0732c, 0x5fcf013d, 0x7c07e932, 0x7c07e932, 0x5fcf013d, }, 20 }, +- { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd9aa4b29, 0x555fdda0, 0xd9aa4b29, 0xc2af912e, 0xdd28f52b, 0xdd28f52b, 0xe82cbfd, 0xe82cbfd, 0xe82cbfd, 0x2fbe3219, 0x2fbe3219, 0x2fbe3219, 0x5206f995, 0x5206f995, 0x5206f995, 0xdd28f52b, 0xc2af912e, 0xc2af912e, 0xdd28f52b, }, 20 }, +- { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfd4e19ff, 0x42807b86, 0xfd4e19ff, 0x2f1027f, 0x43d1f34, 0x43d1f34, 0x924dc5be, 0x924dc5be, 0x924dc5be, 0xed476c16, 0xed476c16, 0xed476c16, 0x74166990, 0x74166990, 0x74166990, 0x43d1f34, 0x2f1027f, 0x2f1027f, 0x43d1f34, }, 20 }, +- { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x3a63a2e6, 0x118487d4, 0x3a63a2e6, 0x79956fa1, 0x59c36f00, 0x59c36f00, 0x389f4d2d, 0x389f4d2d, 0x389f4d2d, 0x461f204b, 0x461f204b, 0x461f204b, 0x24e93599, 0x24e93599, 0x24e93599, 0x59c36f00, 0x79956fa1, 0x79956fa1, 0x59c36f00, }, 20 }, +- { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x62d33f4d, 0x9544a8f4, 0x62d33f4d, 0x4cd6ba32, 0xaa4593fe, 0xaa4593fe, 0xfb86a3a4, 0xfb86a3a4, 0xfb86a3a4, 0x5d73aec3, 0x5d73aec3, 0x5d73aec3, 0x704b05bb, 0x704b05bb, 0x704b05bb, 0xaa4593fe, 0x4cd6ba32, 0x4cd6ba32, 0xaa4593fe, }, 20 }, +- { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8cc4b6dc, 0x1042c383, 0x8cc4b6dc, 0xd1d3db58, 0xc9cbf769, 0xc9cbf769, 0xeba8a32b, 0xeba8a32b, 0xeba8a32b, 0x157062e7, 0x157062e7, 0x157062e7, 0xfc3addef, 0xfc3addef, 0xfc3addef, 0xc9cbf769, 0xd1d3db58, 0xd1d3db58, 0xc9cbf769, }, 20 }, +- { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x23f9afd, 0x465f5ecc, 0x23f9afd, 0xac69d325, 0x9813a416, 0x9813a416, 0xccf7a1e3, 0xccf7a1e3, 0xccf7a1e3, 0x5d2c27d0, 0x5d2c27d0, 0x5d2c27d0, 0x44961a00, 0x44961a00, 0x44961a00, 0x9813a416, 0xac69d325, 0xac69d325, 0x9813a416, }, 20 }, +- { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xed796a26, 0x3132d083, 0xed796a26, 0x9bdf5f95, 0x5fcf013d, 0x5fcf013d, 0x42f66a49, 0x42f66a49, 0x42f66a49, 0x90e6723f, 0x90e6723f, 0x90e6723f, 0x86954da0, 0x86954da0, 0x86954da0, 0x5fcf013d, 0x9bdf5f95, 0x9bdf5f95, 0x5fcf013d, }, 20 }, +- { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x54b28785, 0x7fbbe762, 0x54b28785, 0x4fb75d82, 0xdd28f52b, 0xdd28f52b, 0x14b1cf29, 0x14b1cf29, 0x14b1cf29, 0x358d36cd, 0x358d36cd, 0x358d36cd, 0x4835fd41, 0x4835fd41, 0x4835fd41, 0xdd28f52b, 0x4fb75d82, 0x4fb75d82, 0xdd28f52b, }, 20 }, +- { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x7acc2669, 0xbf1a1d96, 0x7acc2669, 0x85733de9, 0x43d1f34, 0x43d1f34, 0x2cc1e8f4, 0x2cc1e8f4, 0x2cc1e8f4, 0x53cb415c, 0x53cb415c, 0x53cb415c, 0xca9a44da, 0xca9a44da, 0xca9a44da, 0x43d1f34, 0x85733de9, 0x85733de9, 0x43d1f34, }, 20 }, +- { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xf9511593, 0x9f9ef910, 0xf9511593, 0xbaa7d8d4, 0x59c36f00, 0x59c36f00, 0x7fd94135, 0x7fd94135, 0x7fd94135, 0x1592c53, 0x1592c53, 0x1592c53, 0x63af3981, 0x63af3981, 0x63af3981, 0x59c36f00, 0xbaa7d8d4, 0xbaa7d8d4, 0x59c36f00, }, 20 }, +- { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3dcbe25f, 0x99e165e7, 0x3dcbe25f, 0x13ce6720, 0xaa4593fe, 0xaa4593fe, 0x2e88732f, 0x2e88732f, 0x2e88732f, 0x887d7e48, 0x887d7e48, 0x887d7e48, 0xa545d530, 0xa545d530, 0xa545d530, 0xaa4593fe, 0x13ce6720, 0x13ce6720, 0xaa4593fe, }, 20 }, +- { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xdbedc74c, 0x61619894, 0xdbedc74c, 0x86faaac8, 0xc9cbf769, 0xc9cbf769, 0xda1c9f17, 0xda1c9f17, 0xda1c9f17, 0x24c45edb, 0x24c45edb, 0x24c45edb, 0xcd8ee1d3, 0xcd8ee1d3, 0xcd8ee1d3, 0xc9cbf769, 0x86faaac8, 0x86faaac8, 0xc9cbf769, }, 20 }, +- { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2411f56f, 0x97b1fc58, 0x2411f56f, 0x8a47bcb7, 0x9813a416, 0x9813a416, 0xfb08d7cf, 0xfb08d7cf, 0xfb08d7cf, 0x6ad351fc, 0x6ad351fc, 0x6ad351fc, 0x73696c2c, 0x73696c2c, 0x73696c2c, 0x9813a416, 0x8a47bcb7, 0x8a47bcb7, 0x9813a416, }, 20 }, +- { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x13a65fb6, 0x35044d7, 0x13a65fb6, 0x65006a05, 0x5fcf013d, 0x5fcf013d, 0x9e56a9e0, 0x9e56a9e0, 0x9e56a9e0, 0x4c46b196, 0x4c46b196, 0x4c46b196, 0x5a358e09, 0x5a358e09, 0x5a358e09, 0x5fcf013d, 0x65006a05, 0x65006a05, 0x5fcf013d, }, 20 }, +- { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc8f05290, 0x9c88f64e, 0xc8f05290, 0xd3f58897, 0xdd28f52b, 0xdd28f52b, 0xe1579057, 0xe1579057, 0xe1579057, 0xc06b69b3, 0xc06b69b3, 0xc06b69b3, 0xbdd3a23f, 0xbdd3a23f, 0xbdd3a23f, 0xdd28f52b, 0xd3f58897, 0xd3f58897, 0xdd28f52b, }, 20 }, +- { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9cfbc80f, 0x376a1fb2, 0x9cfbc80f, 0x6344d38f, 0x43d1f34, 0x43d1f34, 0x6486f7c4, 0x6486f7c4, 0x6486f7c4, 0x1b8c5e6c, 0x1b8c5e6c, 0x1b8c5e6c, 0x82dd5bea, 0x82dd5bea, 0x82dd5bea, 0x43d1f34, 0x6344d38f, 0x6344d38f, 0x43d1f34, }, 20 }, +- { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd327ca68, 0x9c977e8c, 0xd327ca68, 0x90d1072f, 0x59c36f00, 0x59c36f00, 0x71c9d9, 0x71c9d9, 0x71c9d9, 0x7ef1a4bf, 0x7ef1a4bf, 0x7ef1a4bf, 0x1c07b16d, 0x1c07b16d, 0x1c07b16d, 0x59c36f00, 0x90d1072f, 0x90d1072f, 0x59c36f00, }, 20 }, +- { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2da3855b, 0x24c7b138, 0x2da3855b, 0x3a60024, 0xaa4593fe, 0xaa4593fe, 0x147ff249, 0x147ff249, 0x147ff249, 0xb28aff2e, 0xb28aff2e, 0xb28aff2e, 0x9fb25456, 0x9fb25456, 0x9fb25456, 0xaa4593fe, 0x3a60024, 0x3a60024, 0xaa4593fe, }, 20 }, +- { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x660ab3d9, 0xa75b45c4, 0x660ab3d9, 0x3b1dde5d, 0xc9cbf769, 0xc9cbf769, 0x5ff884f5, 0x5ff884f5, 0x5ff884f5, 0xa1204539, 0xa1204539, 0xa1204539, 0x486afa31, 0x486afa31, 0x486afa31, 0xc9cbf769, 0x3b1dde5d, 0x3b1dde5d, 0xc9cbf769, }, 20 }, +- { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x920957ee, 0xceebfd42, 0x920957ee, 0x3c5f1e36, 0x9813a416, 0x9813a416, 0xa917dbef, 0xa917dbef, 0xa917dbef, 0x38cc5ddc, 0x38cc5ddc, 0x38cc5ddc, 0x2176600c, 0x2176600c, 0x2176600c, 0x9813a416, 0x3c5f1e36, 0x3c5f1e36, 0x9813a416, }, 20 }, +- { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x8298cd03, 0xfb88293a, 0x8298cd03, 0xf43ef8b0, 0x5fcf013d, 0x5fcf013d, 0x8f57f36b, 0x8f57f36b, 0x8f57f36b, 0x5d47eb1d, 0x5d47eb1d, 0x5d47eb1d, 0x4b34d482, 0x4b34d482, 0x4b34d482, 0x5fcf013d, 0xf43ef8b0, 0xf43ef8b0, 0x5fcf013d, }, 20 }, +- { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd8bbc577, 0xb2c37549, 0xd8bbc577, 0xc3be1f70, 0xdd28f52b, 0xdd28f52b, 0xd8b598e, 0xd8b598e, 0xd8b598e, 0x2cb7a06a, 0x2cb7a06a, 0x2cb7a06a, 0x510f6be6, 0x510f6be6, 0x510f6be6, 0xdd28f52b, 0xc3be1f70, 0xc3be1f70, 0xdd28f52b, }, 20 }, +- { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4d7993a1, 0xbeefcd88, 0x4d7993a1, 0xb2c68821, 0x43d1f34, 0x43d1f34, 0x1dbc7020, 0x1dbc7020, 0x1dbc7020, 0x62b6d988, 0x62b6d988, 0x62b6d988, 0xfbe7dc0e, 0xfbe7dc0e, 0xfbe7dc0e, 0x43d1f34, 0xb2c68821, 0xb2c68821, 0x43d1f34, }, 20 }, +- { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x628b6f61, 0x50f94215, 0x628b6f61, 0x217da226, 0x59c36f00, 0x59c36f00, 0x5755be7f, 0x5755be7f, 0x5755be7f, 0x29d5d319, 0x29d5d319, 0x29d5d319, 0x4b23c6cb, 0x4b23c6cb, 0x4b23c6cb, 0x59c36f00, 0x217da226, 0x217da226, 0x59c36f00, }, 20 }, +- { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x9f82cd08, 0xbc67f78d, 0x9f82cd08, 0xb1874877, 0xaa4593fe, 0xaa4593fe, 0x4749512e, 0x4749512e, 0x4749512e, 0xe1bc5c49, 0xe1bc5c49, 0xe1bc5c49, 0xcc84f731, 0xcc84f731, 0xcc84f731, 0xaa4593fe, 0xb1874877, 0xb1874877, 0xaa4593fe, }, 20 }, +- { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xbee47cfb, 0x88e98534, 0xbee47cfb, 0xe3f3117f, 0xc9cbf769, 0xc9cbf769, 0xe2396b15, 0xe2396b15, 0xe2396b15, 0x1ce1aad9, 0x1ce1aad9, 0x1ce1aad9, 0xf5ab15d1, 0xf5ab15d1, 0xf5ab15d1, 0xc9cbf769, 0xe3f3117f, 0xe3f3117f, 0xc9cbf769, }, 20 }, +- { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2bfd5a83, 0xbe3c6f2f, 0x2bfd5a83, 0x85ab135b, 0x9813a416, 0x9813a416, 0xce30693b, 0xce30693b, 0xce30693b, 0x5febef08, 0x5febef08, 0x5febef08, 0x4651d2d8, 0x4651d2d8, 0x4651d2d8, 0x9813a416, 0x85ab135b, 0x85ab135b, 0x9813a416, }, 20 }, +- { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x1456f321, 0xc3a55992, 0x1456f321, 0x62f0c692, 0x5fcf013d, 0x5fcf013d, 0xbe3d534a, 0xbe3d534a, 0xbe3d534a, 0x6c2d4b3c, 0x6c2d4b3c, 0x6c2d4b3c, 0x7a5e74a3, 0x7a5e74a3, 0x7a5e74a3, 0x5fcf013d, 0x62f0c692, 0x62f0c692, 0x5fcf013d, }, 20 }, +- { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xdcac6945, 0x43fbdf5a, 0xdcac6945, 0xc7a9b342, 0xdd28f52b, 0xdd28f52b, 0x274da20b, 0x274da20b, 0x274da20b, 0x6715bef, 0x6715bef, 0x6715bef, 0x7bc99063, 0x7bc99063, 0x7bc99063, 0xdd28f52b, 0xc7a9b342, 0xc7a9b342, 0xdd28f52b, }, 20 }, +- { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x571e16b1, 0xb9f25c2, 0x571e16b1, 0xa8a10d31, 0x43d1f34, 0x43d1f34, 0x25dfb69d, 0x25dfb69d, 0x25dfb69d, 0x5ad51f35, 0x5ad51f35, 0x5ad51f35, 0xc3841ab3, 0xc3841ab3, 0xc3841ab3, 0x43d1f34, 0xa8a10d31, 0xa8a10d31, 0x43d1f34, }, 20 }, +- { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xec987771, 0x8a579bf2, 0xec987771, 0xbbb5c9af, 0x59c36f00, 0x59c36f00, 0x16780f43, 0x16780f43, 0x16780f43, 0x68f86225, 0x68f86225, 0x68f86225, 0xa0e77f7, 0xa0e77f7, 0xa0e77f7, 0x59c36f00, 0xbbb5c9af, 0xbbb5c9af, 0x59c36f00, }, 20 }, +- { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x97994d2c, 0x33b3ca94, 0x97994d2c, 0x273e977a, 0xaa4593fe, 0xaa4593fe, 0xa592c9d5, 0xa592c9d5, 0xa592c9d5, 0x367c4b2, 0x367c4b2, 0x367c4b2, 0x2e5f6fca, 0x2e5f6fca, 0x2e5f6fca, 0xaa4593fe, 0x273e977a, 0x273e977a, 0xaa4593fe, }, 20 }, +- { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5d2416aa, 0xe7a84972, 0x5d2416aa, 0x4d010804, 0xc9cbf769, 0xc9cbf769, 0x4e3a88a0, 0x4e3a88a0, 0x4e3a88a0, 0xb0e2496c, 0xb0e2496c, 0xb0e2496c, 0x59a8f664, 0x59a8f664, 0x59a8f664, 0xc9cbf769, 0x4d010804, 0x4d010804, 0xc9cbf769, }, 20 }, +- { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1da65b43, 0xae065274, 0x1da65b43, 0x2dd7a76c, 0x9813a416, 0x9813a416, 0xf81d19f, 0xf81d19f, 0xf81d19f, 0x9e5a57ac, 0x9e5a57ac, 0x9e5a57ac, 0x87e06a7c, 0x87e06a7c, 0x87e06a7c, 0x9813a416, 0x2dd7a76c, 0x2dd7a76c, 0x9813a416, }, 20 }, +- { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xea8a940e, 0xfa7c8f6f, 0xea8a940e, 0x448d7bfb, 0x5fcf013d, 0x5fcf013d, 0x47c22fa0, 0x47c22fa0, 0x47c22fa0, 0x95d237d6, 0x95d237d6, 0x95d237d6, 0x83a10849, 0x83a10849, 0x83a10849, 0x5fcf013d, 0x448d7bfb, 0x448d7bfb, 0x5fcf013d, }, 20 }, +- { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc0ac44fa, 0x94d4e024, 0xc0ac44fa, 0x4ec88f20, 0xdd28f52b, 0xdd28f52b, 0x2422f542, 0x2422f542, 0x2422f542, 0x51e0ca6, 0x51e0ca6, 0x51e0ca6, 0x78a6c72a, 0x78a6c72a, 0x78a6c72a, 0xdd28f52b, 0x4ec88f20, 0x4ec88f20, 0xdd28f52b, }, 20 }, +- { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x248f7655, 0x8f1ea1e8, 0x248f7655, 0xb3d7f0f5, 0x43d1f34, 0x43d1f34, 0x8c408c04, 0x8c408c04, 0x8c408c04, 0xf34a25ac, 0xf34a25ac, 0xf34a25ac, 0x6a1b202a, 0x6a1b202a, 0x6a1b202a, 0x43d1f34, 0xb3d7f0f5, 0xb3d7f0f5, 0x43d1f34, }, 20 }, +- { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd6ba8f78, 0xb07563fb, 0xd6ba8f78, 0x6ef020b2, 0x59c36f00, 0x59c36f00, 0x7fd94135, 0x7fd94135, 0x7fd94135, 0x1592c53, 0x1592c53, 0x1592c53, 0x63af3981, 0x63af3981, 0x63af3981, 0x59c36f00, 0x6ef020b2, 0x6ef020b2, 0x59c36f00, }, 20 }, +- { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf5257f70, 0x510ff8c8, 0xf5257f70, 0x36a3b7ff, 0xaa4593fe, 0xaa4593fe, 0x2e88732f, 0x2e88732f, 0x2e88732f, 0x887d7e48, 0x887d7e48, 0x887d7e48, 0xa545d530, 0xa545d530, 0xa545d530, 0xaa4593fe, 0x36a3b7ff, 0x36a3b7ff, 0xaa4593fe, }, 20 }, +- { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9f8effb3, 0x2502a06b, 0x9f8effb3, 0xddeb038e, 0xc9cbf769, 0xc9cbf769, 0xda1c9f17, 0xda1c9f17, 0xda1c9f17, 0x24c45edb, 0x24c45edb, 0x24c45edb, 0xcd8ee1d3, 0xcd8ee1d3, 0xcd8ee1d3, 0xc9cbf769, 0xddeb038e, 0xddeb038e, 0xc9cbf769, }, 20 }, +- { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6aa72774, 0xd9072e43, 0x6aa72774, 0x24b4853d, 0x9813a416, 0x9813a416, 0xfb08d7cf, 0xfb08d7cf, 0xfb08d7cf, 0x6ad351fc, 0x6ad351fc, 0x6ad351fc, 0x73696c2c, 0x73696c2c, 0x73696c2c, 0x9813a416, 0x24b4853d, 0x24b4853d, 0x9813a416, }, 20 }, +- { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x936eb1d8, 0x8398aab9, 0x936eb1d8, 0x8beef, 0x5fcf013d, 0x5fcf013d, 0x9e56a9e0, 0x9e56a9e0, 0x9e56a9e0, 0x4c46b196, 0x4c46b196, 0x4c46b196, 0x5a358e09, 0x5a358e09, 0x5a358e09, 0x5fcf013d, 0x8beef, 0x8beef, 0x5fcf013d, }, 20 }, +- { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xdd4b9ec3, 0x89333a1d, 0xdd4b9ec3, 0x3acd5a9d, 0xdd28f52b, 0xdd28f52b, 0xe1579057, 0xe1579057, 0xe1579057, 0xc06b69b3, 0xc06b69b3, 0xc06b69b3, 0xbdd3a23f, 0xbdd3a23f, 0xbdd3a23f, 0xdd28f52b, 0x3acd5a9d, 0x3acd5a9d, 0xdd28f52b, }, 20 }, +- { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x89f37601, 0x2262a1bc, 0x89f37601, 0xf17b28ae, 0x43d1f34, 0x43d1f34, 0x6486f7c4, 0x6486f7c4, 0x6486f7c4, 0x1b8c5e6c, 0x1b8c5e6c, 0x1b8c5e6c, 0x82dd5bea, 0x82dd5bea, 0x82dd5bea, 0x43d1f34, 0xf17b28ae, 0xf17b28ae, 0x43d1f34, }, 20 }, +- { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, +- { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, +- { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x4c2cef83, 0x1b215a88, 0xe2378595, 0xb53a309e, 0x15f64d5e, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x758f388c, 0xd4442397, 0x33f5784b, 0x923e6350, 0xf97bb902, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xb9f6f52a, 0x4e24e8b7, 0x53beb8e1, 0xa46ca57c, 0x688a184d, }, 5 }, +- { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x5bd98ce3, 0x15df7962, 0xc7d467e1, 0x89d29260, 0x662e2c16, }, 5 }, +- { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, }, 5 }, +- { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, }, 5 }, +- { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x335fadcb, 0x1f517b5c, 0x6b4200e5, 0x474cd672, 0x8364f797, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xcf9985f8, 0x1d92c7fc, 0x6e637701, 0xbc683505, 0x898016fb, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xdb824190, 0x378d05dc, 0x670bff9, 0xea7ffbb5, 0x658bcbb3, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x157232bd, 0x5e6bdacd, 0x8341e25d, 0xc8580a2d, 0x3cf9e58c, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0xbfafd7cd, 0x51650951, 0x67d61c04, 0x891cc298, 0xab036ae, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x760580c9, 0xdc6d8205, 0x2739f3a0, 0x8d51f16c, 0xd47d661b, }, 5 }, +- { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0xada3b5f, 0x24cd61a6, 0x56f48ead, 0x78e3d454, 0xb28750bb, }, 5 }, +- { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x827694e2, 0x9d97c3dd, 0xbdb43a9c, 0xa2556da3, 0xfdf3c81e, }, 5 }, +- { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0x664534a5, 0xcd0979a0, 0x3531d85e, 0x9e7d955b, 0xc0aced53, }, 5 }, ++ { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xc69be699, 0xc69be699, 0xe17fc97c, 0xe17fc97c, 0xc2512486, 0xc2512486, 0x20260761, 0x20260761, 0xe3485349, 0xe3485349, 0x6020b4d9, 0x6020b4d9, 0x1605db98, 0x1605db98, 0xdca51b58, 0xdca51b58, 0xf3d66441, 0xf3d66441, 0x18cb7ce2, 0x18cb7ce2, 0x23b616d9, 0x23b616d9, 0xa1bf5dbf, 0xa1bf5dbf, 0x5e4a8b3d, 0x5e4a8b3d, 0x9933b3d8, 0x9933b3d8, 0xce7be2de, 0xce7be2de, 0x62531729, 0x62531729, 0xc39d3788, 0xc39d3788, 0xf7aee2fe, 0xf7aee2fe, 0xc66f4903, 0xc66f4903, 0x536c922f, 0x536c922f, 0xcb231652, 0x4ae07b67, 0x146816d5, 0x146816d5, }, 45 }, ++ { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x29d0cfb7, 0x29d0cfb7, 0x4d57ad88, 0x4d57ad88, 0xaf7591cb, 0xaf7591cb, 0xb88e3c0, 0xb88e3c0, 0x5d55a031, 0x5d55a031, 0x4363bcff, 0x4363bcff, 0xe1142833, 0xe1142833, 0x9578c80d, 0x9578c80d, 0xff1f5174, 0xff1f5174, 0x6828d47, 0x6828d47, 0x2a849ae3, 0x2a849ae3, 0x27a811d9, 0x27a811d9, 0x6c42e1cb, 0x6c42e1cb, 0x5bba61f5, 0x5bba61f5, 0xc02ab705, 0xc02ab705, 0xeb3e0e05, 0xeb3e0e05, 0x6f4ce3c, 0x6f4ce3c, 0x2075c50e, 0x2075c50e, 0x54ac7fba, 0x54ac7fba, 0x335d1c21, 0x335d1c21, 0xf923fbd1, 0x1b489d4d, 0x1253eb5e, 0x1253eb5e, }, 45 }, ++ { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6ff92a98, 0x6ff92a98, 0xbd8264b3, 0xbd8264b3, 0x5c50282c, 0x5c50282c, 0xd18d6a5a, 0xd18d6a5a, 0x99cea139, 0x99cea139, 0x2590c545, 0x2590c545, 0x55c86045, 0x55c86045, 0xad53ef1e, 0xad53ef1e, 0x5b44a23a, 0x5b44a23a, 0xa255f863, 0xa255f863, 0x85b0bdca, 0x85b0bdca, 0x4220ee1f, 0x4220ee1f, 0xeb991a9f, 0xeb991a9f, 0x86f366dd, 0x86f366dd, 0xfa176b7d, 0xfa176b7d, 0xd7384ca9, 0xd7384ca9, 0xceebf5c1, 0xceebf5c1, 0xae62b268, 0xae62b268, 0x6e89bbd6, 0x6e89bbd6, 0x3fe07c8e, 0x3fe07c8e, 0xee5358fe, 0x162d1a8a, 0x876f8d10, 0x876f8d10, }, 45 }, ++ { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb96afaea, 0xb96afaea, 0xaa16ab1e, 0xaa16ab1e, 0x51ff382, 0x51ff382, 0xec74f127, 0xec74f127, 0xde4bca99, 0xde4bca99, 0x8ef3e8a5, 0x8ef3e8a5, 0x2daeb0b4, 0x2daeb0b4, 0x7cf5e243, 0x7cf5e243, 0x11fd57c6, 0x11fd57c6, 0x140723af, 0x140723af, 0x2bd93833, 0x2bd93833, 0xd731f4ac, 0xd731f4ac, 0x5fcd7114, 0x5fcd7114, 0xd1fea24a, 0xd1fea24a, 0x4083d53a, 0x4083d53a, 0x2e372605, 0x2e372605, 0x8e6316a7, 0x8e6316a7, 0x283ef6cc, 0x283ef6cc, 0x20cee9de, 0x20cee9de, 0xad6fa187, 0xad6fa187, 0xd691f438, 0xf3257e63, 0x4786ba7, 0x4786ba7, }, 45 }, ++ { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x48acf1bf, 0x48acf1bf, 0xb8777469, 0xb8777469, 0xad2fad44, 0xad2fad44, 0xa415ac59, 0xa415ac59, 0x5a7bfb26, 0x5a7bfb26, 0xccb6016, 0xccb6016, 0x77a80cb3, 0x77a80cb3, 0x2034c102, 0x2034c102, 0x444b4ccd, 0x444b4ccd, 0xe6c31bea, 0xe6c31bea, 0x8408036e, 0x8408036e, 0x9e7c556f, 0x9e7c556f, 0x445dc388, 0x445dc388, 0x94b3f850, 0x94b3f850, 0xf6f15341, 0xf6f15341, 0xcb939b5f, 0xcb939b5f, 0xbe88067d, 0xbe88067d, 0x1efc4734, 0x1efc4734, 0x7f5dfca8, 0x7f5dfca8, 0xb7b10eb9, 0xb7b10eb9, 0xb94cb441, 0x9571329, 0x8a26912b, 0x8a26912b, }, 45 }, ++ { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc508d04e, 0xc508d04e, 0x6dbccbfe, 0x6dbccbfe, 0xbf06ff60, 0xbf06ff60, 0xbc5ab06, 0xbc5ab06, 0x97eeab3c, 0x97eeab3c, 0x62663589, 0x62663589, 0xb03e21e2, 0xb03e21e2, 0xea196bb6, 0xea196bb6, 0x672c16c4, 0x672c16c4, 0xefbca2cd, 0xefbca2cd, 0x1af5b410, 0x1af5b410, 0xc7a80569, 0xc7a80569, 0x4926a16, 0x4926a16, 0xee29c99c, 0xee29c99c, 0xffb15985, 0xffb15985, 0x4f608e46, 0x4f608e46, 0x3e450fd2, 0x3e450fd2, 0xac45215f, 0xac45215f, 0x789b0ce7, 0x789b0ce7, 0x4cedfe22, 0x4cedfe22, 0xa005588c, 0x701da05c, 0x6f25cec1, 0x6f25cec1, }, 45 }, ++ { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x29e7a7f, 0x29e7a7f, 0xbd221052, 0xbd221052, 0x3b18b64, 0x3b18b64, 0x7f1e8462, 0x7f1e8462, 0xf28d5124, 0xf28d5124, 0xc336f170, 0xc336f170, 0xfe3bf988, 0xfe3bf988, 0x7bf89e05, 0x7bf89e05, 0x7857a3f8, 0x7857a3f8, 0x272c1a36, 0x272c1a36, 0xe8adb445, 0xe8adb445, 0x70cfe280, 0x70cfe280, 0x4f2b6120, 0x4f2b6120, 0xbaf5caa5, 0xbaf5caa5, 0x4b6bcab2, 0x4b6bcab2, 0x2bef7b92, 0x2bef7b92, 0x17b381dc, 0x17b381dc, 0x884c9c35, 0x884c9c35, 0x2f9eb909, 0x2f9eb909, 0xa811b3af, 0xa811b3af, 0x4c39478f, 0x5a72c3ab, 0x8071678a, 0x8071678a, }, 45 }, ++ { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd9f04953, 0xbf3fa5d0, 0xd9f04953, 0x9a068414, 0x59c36f00, 0x59c36f00, 0x620c0067, 0x620c0067, 0x620c0067, 0x1c8c6d01, 0x1c8c6d01, 0x1c8c6d01, 0xc3269013, 0xc3269013, 0xc3269013, 0x59c36f00, 0x9a068414, 0x9a068414, 0x59c36f00, }, 20 }, ++ { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x9254157f, 0x367e92c7, 0x9254157f, 0xbc519000, 0xaa4593fe, 0xaa4593fe, 0xa8a596c8, 0xa8a596c8, 0xa8a596c8, 0xe509baf, 0xe509baf, 0xe509baf, 0x16f0dc06, 0x16f0dc06, 0x16f0dc06, 0xaa4593fe, 0xbc519000, 0xbc519000, 0xaa4593fe, }, 20 }, ++ { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x354b1976, 0x8fc746ae, 0x354b1976, 0x685c74f2, 0xc9cbf769, 0xc9cbf769, 0x3ce35e1d, 0x3ce35e1d, 0x3ce35e1d, 0xc23b9fd1, 0xc23b9fd1, 0xc23b9fd1, 0x5b18528e, 0x5b18528e, 0x5b18528e, 0xc9cbf769, 0x685c74f2, 0x685c74f2, 0xc9cbf769, }, 20 }, ++ { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1c9ec014, 0xaf3ec923, 0x1c9ec014, 0x43f5296, 0x9813a416, 0x9813a416, 0x43fda3fa, 0x43fda3fa, 0x43fda3fa, 0xd22625c9, 0xd22625c9, 0xd22625c9, 0x76a62c0a, 0x76a62c0a, 0x76a62c0a, 0x9813a416, 0x43f5296, 0x43f5296, 0x9813a416, }, 20 }, ++ { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa704f7ea, 0xb7f2ec8b, 0xa704f7ea, 0xb279bf59, 0x5fcf013d, 0x5fcf013d, 0xf3582c48, 0xf3582c48, 0xf3582c48, 0x2148343e, 0x2148343e, 0x2148343e, 0x9c719024, 0x9c719024, 0x9c719024, 0x5fcf013d, 0xb279bf59, 0xb279bf59, 0x5fcf013d, }, 20 }, ++ { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xf293ce36, 0xa6eb6ae8, 0xf293ce36, 0xcd87647e, 0xdd28f52b, 0xdd28f52b, 0xb3c7ef80, 0xb3c7ef80, 0xb3c7ef80, 0x92fb1664, 0x92fb1664, 0x92fb1664, 0xd15b5e2e, 0xd15b5e2e, 0xd15b5e2e, 0xdd28f52b, 0xcd87647e, 0xcd87647e, 0xdd28f52b, }, 20 }, ++ { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x31e75bd7, 0x9a768c6a, 0x31e75bd7, 0xa8fc31a6, 0x43d1f34, 0x43d1f34, 0xa0717008, 0xa0717008, 0xa0717008, 0xdf7bd9a0, 0xdf7bd9a0, 0xdf7bd9a0, 0x8e5a9312, 0x8e5a9312, 0x8e5a9312, 0x43d1f34, 0xa8fc31a6, 0xa8fc31a6, 0x43d1f34, }, 20 }, ++ { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x1ce7bd78, 0x682580f5, 0x1ce7bd78, 0x490ad6fe, 0x9a2e0d26, 0x64eb71ba, 0x64eb71ba, 0x64eb71ba, 0x3833877a, 0x3833877a, 0x3833877a, 0xcfc14f0a, 0xcfc14f0a, 0xcfc14f0a, 0x59c36f00, 0x490ad6fe, 0x490ad6fe, }, 18 }, ++ { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2b6ff87d, 0x63ce2ca2, 0x2b6ff87d, 0xf00f044e, 0xa9d58ccd, 0xe2c46577, 0xe2c46577, 0xe2c46577, 0xb79bcf7d, 0xb79bcf7d, 0xb79bcf7d, 0xbc30ed71, 0xbc30ed71, 0xbc30ed71, 0xaa4593fe, 0xf00f044e, 0xf00f044e, }, 18 }, ++ { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe61cadba, 0x9880b727, 0xe61cadba, 0xdf5f2fc0, 0x5411be8b, 0x4449774e, 0x4449774e, 0x4449774e, 0x3bf7d1da, 0x3bf7d1da, 0x3bf7d1da, 0xd2ddee01, 0xd2ddee01, 0xd2ddee01, 0xc9cbf769, 0xdf5f2fc0, 0xdf5f2fc0, }, 18 }, ++ { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xbe54acf7, 0x9b4ce770, 0xbe54acf7, 0x3111489, 0x740d78cf, 0x314c4c59, 0x314c4c59, 0x314c4c59, 0xdae9a625, 0xdae9a625, 0xdae9a625, 0xcbf8af57, 0xcbf8af57, 0xcbf8af57, 0x1c3742c9, 0x3111489, 0x3111489, }, 18 }, ++ { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xee571de5, 0x568aaeff, 0xee571de5, 0xe328b7a7, 0xbcda144c, 0xf56e1b60, 0xf56e1b60, 0xf56e1b60, 0x9a27c771, 0x9a27c771, 0x9a27c771, 0xd6d05397, 0xd6d05397, 0xd6d05397, 0xcc5a7bed, 0xe328b7a7, 0xe328b7a7, }, 18 }, ++ { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x1db9877c, 0x7e1afeae, 0x1db9877c, 0x8fc0c430, 0x5d55a141, 0x96f335c6, 0x96f335c6, 0x96f335c6, 0x504171d8, 0x504171d8, 0x504171d8, 0x69f71c0, 0x69f71c0, 0x69f71c0, 0xef4a3312, 0x8fc0c430, 0x8fc0c430, }, 18 }, ++ { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0x151819bd, 0xea8d4865, 0x151819bd, 0x11d75fd2, 0x6d6bb4bc, 0x650ccd09, 0x650ccd09, 0x650ccd09, 0xe4ff3bd8, 0xe4ff3bd8, 0xe4ff3bd8, 0xc5308b73, 0xc5308b73, 0xc5308b73, 0x54e48d80, 0x11d75fd2, 0x11d75fd2, }, 18 }, ++ { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd0b06c3d, 0xde50d1a5, 0xd0b06c3d, 0x9346a17a, 0x59c36f00, 0x59c36f00, 0xacff5d47, 0xacff5d47, 0xacff5d47, 0xd27f3021, 0xd27f3021, 0xd27f3021, 0xdd5cd33, 0xdd5cd33, 0xdd5cd33, 0x59c36f00, 0x9346a17a, 0x9346a17a, 0x59c36f00, }, 20 }, ++ { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf32d50c1, 0x730a7ed, 0xf32d50c1, 0xdd28d5be, 0xaa4593fe, 0xaa4593fe, 0xba8a2d4c, 0xba8a2d4c, 0xba8a2d4c, 0x1c7f202b, 0x1c7f202b, 0x1c7f202b, 0x4df6782, 0x4df6782, 0x4df6782, 0xaa4593fe, 0xdd28d5be, 0xdd28d5be, 0xaa4593fe, }, 20 }, ++ { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x711a4ac1, 0x6396f14c, 0x711a4ac1, 0x2c0d2745, 0xc9cbf769, 0xc9cbf769, 0x6b6ccbb0, 0x6b6ccbb0, 0x6b6ccbb0, 0x95b40a7c, 0x95b40a7c, 0x95b40a7c, 0xc97c723, 0xc97c723, 0xc97c723, 0xc9cbf769, 0x2c0d2745, 0x2c0d2745, 0xc9cbf769, }, 20 }, ++ { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x29baad6a, 0x348b1f2b, 0x29baad6a, 0x311b3fe8, 0x9813a416, 0x9813a416, 0xe8e982cc, 0xe8e982cc, 0xe8e982cc, 0x793204ff, 0x793204ff, 0x793204ff, 0xddb20d3c, 0xddb20d3c, 0xddb20d3c, 0x9813a416, 0x311b3fe8, 0x311b3fe8, 0x9813a416, }, 20 }, ++ { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf834b3bb, 0x3951bd1a, 0xf834b3bb, 0xed49fb08, 0x5fcf013d, 0x5fcf013d, 0x5aefa2a7, 0x5aefa2a7, 0x5aefa2a7, 0x88ffbad1, 0x88ffbad1, 0x88ffbad1, 0x35c61ecb, 0x35c61ecb, 0x35c61ecb, 0x5fcf013d, 0xed49fb08, 0xed49fb08, 0x5fcf013d, }, 20 }, ++ { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7e9a7a47, 0xb1651b5a, 0x7e9a7a47, 0x418ed00f, 0xdd28f52b, 0xdd28f52b, 0x83f9db69, 0x83f9db69, 0x83f9db69, 0xa2c5228d, 0xa2c5228d, 0xa2c5228d, 0xe1656ac7, 0xe1656ac7, 0xe1656ac7, 0xdd28f52b, 0x418ed00f, 0x418ed00f, 0xdd28f52b, }, 20 }, ++ { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc6a0340, 0x7dd5855c, 0xc6a0340, 0x95716931, 0x43d1f34, 0x43d1f34, 0x5f1c24c0, 0x5f1c24c0, 0x5f1c24c0, 0x20168d68, 0x20168d68, 0x20168d68, 0x7137c7da, 0x7137c7da, 0x7137c7da, 0x43d1f34, 0x95716931, 0x95716931, 0x43d1f34, }, 20 }, ++ { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd3798aaa, 0xab48784c, 0xd3798aaa, 0x908f47ed, 0x59c36f00, 0x59c36f00, 0x1688ec7c, 0x1688ec7c, 0x1688ec7c, 0x6808811a, 0x6808811a, 0x6808811a, 0xb7a27c08, 0xb7a27c08, 0xb7a27c08, 0x59c36f00, 0x908f47ed, 0x908f47ed, 0x59c36f00, }, 20 }, ++ { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xc30d9d2a, 0x60b9ed26, 0xc30d9d2a, 0xed081855, 0xaa4593fe, 0xaa4593fe, 0x3eba2192, 0x3eba2192, 0x3eba2192, 0x984f2cf5, 0x984f2cf5, 0x984f2cf5, 0x80ef6b5c, 0x80ef6b5c, 0x80ef6b5c, 0xaa4593fe, 0xed081855, 0xed081855, 0xaa4593fe, }, 20 }, ++ { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe469e6af, 0x46ac2012, 0xe469e6af, 0xb97e8b2b, 0xc9cbf769, 0xc9cbf769, 0x60f0d993, 0x60f0d993, 0x60f0d993, 0x9e28185f, 0x9e28185f, 0x9e28185f, 0x70bd500, 0x70bd500, 0x70bd500, 0xc9cbf769, 0xb97e8b2b, 0xb97e8b2b, 0xc9cbf769, }, 20 }, ++ { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x8538d2ef, 0xab143284, 0x8538d2ef, 0x9d99406d, 0x9813a416, 0x9813a416, 0x7e8326ec, 0x7e8326ec, 0x7e8326ec, 0xef58a0df, 0xef58a0df, 0xef58a0df, 0x4bd8a91c, 0x4bd8a91c, 0x4bd8a91c, 0x9813a416, 0x9d99406d, 0x9d99406d, 0x9813a416, }, 20 }, ++ { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x8115198c, 0x1abdaee1, 0x8115198c, 0x9468513f, 0x5fcf013d, 0x5fcf013d, 0xa5e86484, 0xa5e86484, 0xa5e86484, 0x77f87cf2, 0x77f87cf2, 0x77f87cf2, 0xcac1d8e8, 0xcac1d8e8, 0xcac1d8e8, 0x5fcf013d, 0x9468513f, 0x9468513f, 0x5fcf013d, }, 20 }, ++ { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xea03b805, 0x74148290, 0xea03b805, 0xd517124d, 0xdd28f52b, 0xdd28f52b, 0x8f6eee40, 0x8f6eee40, 0x8f6eee40, 0xae5217a4, 0xae5217a4, 0xae5217a4, 0xedf25fee, 0xedf25fee, 0xedf25fee, 0xdd28f52b, 0xd517124d, 0xd517124d, 0xdd28f52b, }, 20 }, ++ { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xa044490f, 0xe23458db, 0xa044490f, 0x395f237e, 0x43d1f34, 0x43d1f34, 0xe1ca82c2, 0xe1ca82c2, 0xe1ca82c2, 0x9ec02b6a, 0x9ec02b6a, 0x9ec02b6a, 0xcfe161d8, 0xcfe161d8, 0xcfe161d8, 0x43d1f34, 0x395f237e, 0x395f237e, 0x43d1f34, }, 20 }, ++ { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xf3259b30, 0xf1f01411, 0xf3259b30, 0xb0d35677, 0x59c36f00, 0x59c36f00, 0x97895f8e, 0x97895f8e, 0x97895f8e, 0xe90932e8, 0xe90932e8, 0xe90932e8, 0x36a3cffa, 0x36a3cffa, 0x36a3cffa, 0x59c36f00, 0xb0d35677, 0xb0d35677, 0x59c36f00, }, 20 }, ++ { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x53a43759, 0xe0f26bfa, 0x53a43759, 0x7da1b226, 0xaa4593fe, 0xaa4593fe, 0xbf482a4e, 0xbf482a4e, 0xbf482a4e, 0x19bd2729, 0x19bd2729, 0x19bd2729, 0x11d6080, 0x11d6080, 0x11d6080, 0xaa4593fe, 0x7da1b226, 0x7da1b226, 0xaa4593fe, }, 20 }, ++ { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd7ff8d53, 0x665b2728, 0xd7ff8d53, 0x8ae8e0d7, 0xc9cbf769, 0xc9cbf769, 0x5a693e73, 0x5a693e73, 0x5a693e73, 0xa4b1ffbf, 0xa4b1ffbf, 0xa4b1ffbf, 0x3d9232e0, 0x3d9232e0, 0x3d9232e0, 0xc9cbf769, 0x8ae8e0d7, 0x8ae8e0d7, 0xc9cbf769, }, 20 }, ++ { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x99fddcbe, 0x6d5c8895, 0x99fddcbe, 0x815c4e3c, 0x9813a416, 0x9813a416, 0x9bcf9821, 0x9bcf9821, 0x9bcf9821, 0xa141e12, 0xa141e12, 0xa141e12, 0xae9417d1, 0xae9417d1, 0xae9417d1, 0x9813a416, 0x815c4e3c, 0x815c4e3c, 0x9813a416, }, 20 }, ++ { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x5797846, 0x25a6ad40, 0x5797846, 0x100430f5, 0x5fcf013d, 0x5fcf013d, 0xddc86daf, 0xddc86daf, 0xddc86daf, 0xfd875d9, 0xfd875d9, 0xfd875d9, 0xb2e1d1c3, 0xb2e1d1c3, 0xb2e1d1c3, 0x5fcf013d, 0x100430f5, 0x100430f5, 0x5fcf013d, }, 20 }, ++ { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x30653ae8, 0x7fcd187, 0x30653ae8, 0xf7190a0, 0xdd28f52b, 0xdd28f52b, 0x24c3d325, 0x24c3d325, 0x24c3d325, 0x5ff2ac1, 0x5ff2ac1, 0x5ff2ac1, 0x465f628b, 0x465f628b, 0x465f628b, 0xdd28f52b, 0xf7190a0, 0xf7190a0, 0xdd28f52b, }, 20 }, ++ { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x3bd91638, 0x1d74dd4a, 0x3bd91638, 0xa2c27c49, 0x43d1f34, 0x43d1f34, 0x53d1ad3d, 0x53d1ad3d, 0x53d1ad3d, 0x2cdb0495, 0x2cdb0495, 0x2cdb0495, 0x7dfa4e27, 0x7dfa4e27, 0x7dfa4e27, 0x43d1f34, 0xa2c27c49, 0xa2c27c49, 0x43d1f34, }, 20 }, ++ { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbe2c351a, 0x2692720, 0xbe2c351a, 0xfddaf85d, 0x59c36f00, 0x59c36f00, 0x1b2e2301, 0x1b2e2301, 0x1b2e2301, 0x65ae4e67, 0x65ae4e67, 0x65ae4e67, 0xba04b375, 0xba04b375, 0xba04b375, 0x59c36f00, 0xfddaf85d, 0xfddaf85d, 0x59c36f00, }, 20 }, ++ { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x1eca82e1, 0xe8fa59cc, 0x1eca82e1, 0x30cf079e, 0xaa4593fe, 0xaa4593fe, 0xaf27ddc5, 0xaf27ddc5, 0xaf27ddc5, 0x9d2d0a2, 0x9d2d0a2, 0x9d2d0a2, 0x1172970b, 0x1172970b, 0x1172970b, 0xaa4593fe, 0x30cf079e, 0x30cf079e, 0xaa4593fe, }, 20 }, ++ { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa9ccd435, 0x1ac646eb, 0xa9ccd435, 0xf4dbb9b1, 0xc9cbf769, 0xc9cbf769, 0x86d69aa0, 0x86d69aa0, 0x86d69aa0, 0x780e5b6c, 0x780e5b6c, 0x780e5b6c, 0xe12d9633, 0xe12d9633, 0xe12d9633, 0xc9cbf769, 0xf4dbb9b1, 0xf4dbb9b1, 0xc9cbf769, }, 20 }, ++ { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf96d568, 0x7ad05c1b, 0xf96d568, 0x173747ea, 0x9813a416, 0x9813a416, 0xacf9792a, 0xacf9792a, 0xacf9792a, 0x3d22ff19, 0x3d22ff19, 0x3d22ff19, 0x99a2f6da, 0x99a2f6da, 0x99a2f6da, 0x9813a416, 0x173747ea, 0x173747ea, 0x9813a416, }, 20 }, ++ { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa0dc6b9c, 0xc2761148, 0xa0dc6b9c, 0xb5a1232f, 0x5fcf013d, 0x5fcf013d, 0x4e05748b, 0x4e05748b, 0x4e05748b, 0x9c156cfd, 0x9c156cfd, 0x9c156cfd, 0x212cc8e7, 0x212cc8e7, 0x212cc8e7, 0x5fcf013d, 0xb5a1232f, 0xb5a1232f, 0x5fcf013d, }, 20 }, ++ { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xcd722f7d, 0xe4df8d6b, 0xcd722f7d, 0xf2668535, 0xdd28f52b, 0xdd28f52b, 0xbdbb8019, 0xbdbb8019, 0xbdbb8019, 0x9c8779fd, 0x9c8779fd, 0x9c8779fd, 0xdf2731b7, 0xdf2731b7, 0xdf2731b7, 0xdd28f52b, 0xf2668535, 0xf2668535, 0xdd28f52b, }, 20 }, ++ { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xa6c99d2f, 0x1de04317, 0xa6c99d2f, 0x3fd2f75e, 0x43d1f34, 0x43d1f34, 0x3f85b7d3, 0x3f85b7d3, 0x3f85b7d3, 0x408f1e7b, 0x408f1e7b, 0x408f1e7b, 0x11ae54c9, 0x11ae54c9, 0x11ae54c9, 0x43d1f34, 0x3fd2f75e, 0x3fd2f75e, 0x43d1f34, }, 20 }, ++ { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x1e35b709, 0x2683bf92, 0x1e35b709, 0x5dc37a4e, 0x59c36f00, 0x59c36f00, 0xd697967f, 0xd697967f, 0xd697967f, 0xa817fb19, 0xa817fb19, 0xa817fb19, 0x77bd060b, 0x77bd060b, 0x77bd060b, 0x59c36f00, 0x5dc37a4e, 0x5dc37a4e, 0x59c36f00, }, 20 }, ++ { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x53ff7735, 0x8cbf197c, 0x53ff7735, 0x7dfaf24a, 0xaa4593fe, 0xaa4593fe, 0x389a922, 0x389a922, 0x389a922, 0xa57ca445, 0xa57ca445, 0xa57ca445, 0xbddce3ec, 0xbddce3ec, 0xbddce3ec, 0xaa4593fe, 0x7dfaf24a, 0x7dfaf24a, 0xaa4593fe, }, 20 }, ++ { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5217c47d, 0x7c8ae63e, 0x5217c47d, 0xf00a9f9, 0xc9cbf769, 0xc9cbf769, 0x3995409, 0x3995409, 0x3995409, 0xfd4195c5, 0xfd4195c5, 0xfd4195c5, 0x6462589a, 0x6462589a, 0x6462589a, 0xc9cbf769, 0xf00a9f9, 0xf00a9f9, 0xc9cbf769, }, 20 }, ++ { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x45b67706, 0x375fb5db, 0x45b67706, 0x5d17e584, 0x9813a416, 0x9813a416, 0x8195719b, 0x8195719b, 0x8195719b, 0x104ef7a8, 0x104ef7a8, 0x104ef7a8, 0xb4cefe6b, 0xb4cefe6b, 0xb4cefe6b, 0x9813a416, 0x5d17e584, 0x5d17e584, 0x9813a416, }, 20 }, ++ { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xfc209a25, 0xd5c20779, 0xfc209a25, 0xe95dd296, 0x5fcf013d, 0x5fcf013d, 0xe5699efe, 0xe5699efe, 0xe5699efe, 0x37798688, 0x37798688, 0x37798688, 0x8a402292, 0x8a402292, 0x8a402292, 0x5fcf013d, 0xe95dd296, 0xe95dd296, 0x5fcf013d, }, 20 }, ++ { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x77f956f0, 0xfb0cc079, 0x77f956f0, 0x48edfcb8, 0xdd28f52b, 0xdd28f52b, 0xd51b1dc9, 0xd51b1dc9, 0xd51b1dc9, 0xf427e42d, 0xf427e42d, 0xf427e42d, 0xb787ac67, 0xb787ac67, 0xb787ac67, 0xdd28f52b, 0x48edfcb8, 0x48edfcb8, 0xdd28f52b, }, 20 }, ++ { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x1d9ac82a, 0xa254aa53, 0x1d9ac82a, 0x8481a25b, 0x43d1f34, 0x43d1f34, 0xc304df68, 0xc304df68, 0xc304df68, 0xbc0e76c0, 0xbc0e76c0, 0xbc0e76c0, 0xed2f3c72, 0xed2f3c72, 0xed2f3c72, 0x43d1f34, 0x8481a25b, 0x8481a25b, 0x43d1f34, }, 20 }, ++ { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa6239a89, 0x8dc4bfbb, 0xa6239a89, 0xe5d557ce, 0x59c36f00, 0x59c36f00, 0x244cf807, 0x244cf807, 0x244cf807, 0x5acc9561, 0x5acc9561, 0x5acc9561, 0x85666873, 0x85666873, 0x85666873, 0x59c36f00, 0xe5d557ce, 0xe5d557ce, 0x59c36f00, }, 20 }, ++ { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x742cede9, 0x83bb7a50, 0x742cede9, 0x5a296896, 0xaa4593fe, 0xaa4593fe, 0xd83f8aeb, 0xd83f8aeb, 0xd83f8aeb, 0x7eca878c, 0x7eca878c, 0x7eca878c, 0x666ac025, 0x666ac025, 0x666ac025, 0xaa4593fe, 0x5a296896, 0x5a296896, 0xaa4593fe, }, 20 }, ++ { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe20a98b0, 0x7e8cedef, 0xe20a98b0, 0xbf1df534, 0xc9cbf769, 0xc9cbf769, 0x2748b88c, 0x2748b88c, 0x2748b88c, 0xd9907940, 0xd9907940, 0xd9907940, 0x40b3b41f, 0x40b3b41f, 0x40b3b41f, 0xc9cbf769, 0xbf1df534, 0xbf1df534, 0xc9cbf769, }, 20 }, ++ { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x8f911ca4, 0xcbf1d895, 0x8f911ca4, 0x97308e26, 0x9813a416, 0x9813a416, 0x5b359bf4, 0x5b359bf4, 0x5b359bf4, 0xcaee1dc7, 0xcaee1dc7, 0xcaee1dc7, 0x6e6e1404, 0x6e6e1404, 0x6e6e1404, 0x9813a416, 0x97308e26, 0x97308e26, 0x9813a416, }, 20 }, ++ { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x1bf82c82, 0xc7b39627, 0x1bf82c82, 0xe856431, 0x5fcf013d, 0x5fcf013d, 0xa9dbae99, 0xa9dbae99, 0xa9dbae99, 0x7bcbb6ef, 0x7bcbb6ef, 0x7bcbb6ef, 0xc6f212f5, 0xc6f212f5, 0xc6f212f5, 0x5fcf013d, 0xe856431, 0xe856431, 0x5fcf013d, }, 20 }, ++ { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xfae19a5c, 0xd1e8fabb, 0xfae19a5c, 0xc5f53014, 0xdd28f52b, 0xdd28f52b, 0xfa2c5565, 0xfa2c5565, 0xfa2c5565, 0xdb10ac81, 0xdb10ac81, 0xdb10ac81, 0x98b0e4cb, 0x98b0e4cb, 0x98b0e4cb, 0xdd28f52b, 0xc5f53014, 0xc5f53014, 0xdd28f52b, }, 20 }, ++ { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9a18f7bc, 0x5fcecc43, 0x9a18f7bc, 0x3039dcd, 0x43d1f34, 0x43d1f34, 0x287a2b96, 0x287a2b96, 0x287a2b96, 0x5770823e, 0x5770823e, 0x5770823e, 0x651c88c, 0x651c88c, 0x651c88c, 0x43d1f34, 0x3039dcd, 0x3039dcd, 0x43d1f34, }, 20 }, ++ { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x65112dfc, 0x3dec17f, 0x65112dfc, 0x26e7e0bb, 0x59c36f00, 0x59c36f00, 0x620c0067, 0x620c0067, 0x620c0067, 0x1c8c6d01, 0x1c8c6d01, 0x1c8c6d01, 0xc3269013, 0xc3269013, 0xc3269013, 0x59c36f00, 0x26e7e0bb, 0x26e7e0bb, 0x59c36f00, }, 20 }, ++ { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2b3430fb, 0x8f1eb743, 0x2b3430fb, 0x531b584, 0xaa4593fe, 0xaa4593fe, 0xa8a596c8, 0xa8a596c8, 0xa8a596c8, 0xe509baf, 0xe509baf, 0xe509baf, 0x16f0dc06, 0x16f0dc06, 0x16f0dc06, 0xaa4593fe, 0x531b584, 0x531b584, 0xaa4593fe, }, 20 }, ++ { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb523e920, 0xfafb6f8, 0xb523e920, 0xe83484a4, 0xc9cbf769, 0xc9cbf769, 0x3ce35e1d, 0x3ce35e1d, 0x3ce35e1d, 0xc23b9fd1, 0xc23b9fd1, 0xc23b9fd1, 0x5b18528e, 0x5b18528e, 0x5b18528e, 0xc9cbf769, 0xe83484a4, 0xe83484a4, 0xc9cbf769, }, 20 }, ++ { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa9bf7336, 0x1a1f7a01, 0xa9bf7336, 0xb11ee1b4, 0x9813a416, 0x9813a416, 0x43fda3fa, 0x43fda3fa, 0x43fda3fa, 0xd22625c9, 0xd22625c9, 0xd22625c9, 0x76a62c0a, 0x76a62c0a, 0x76a62c0a, 0x9813a416, 0xb11ee1b4, 0xb11ee1b4, 0x9813a416, }, 20 }, ++ { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xe5271912, 0xf5d10273, 0xe5271912, 0xf05a51a1, 0x5fcf013d, 0x5fcf013d, 0xf3582c48, 0xf3582c48, 0xf3582c48, 0x2148343e, 0x2148343e, 0x2148343e, 0x9c719024, 0x9c719024, 0x9c719024, 0x5fcf013d, 0xf05a51a1, 0xf05a51a1, 0x5fcf013d, }, 20 }, ++ { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x66a34f49, 0x32dbeb97, 0x66a34f49, 0x59b7e501, 0xdd28f52b, 0xdd28f52b, 0xb3c7ef80, 0xb3c7ef80, 0xb3c7ef80, 0x92fb1664, 0x92fb1664, 0x92fb1664, 0xd15b5e2e, 0xd15b5e2e, 0xd15b5e2e, 0xdd28f52b, 0x59b7e501, 0x59b7e501, 0xdd28f52b, }, 20 }, ++ { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x7c2f19da, 0xd7bece67, 0x7c2f19da, 0xe53473ab, 0x43d1f34, 0x43d1f34, 0xa0717008, 0xa0717008, 0xa0717008, 0xdf7bd9a0, 0xdf7bd9a0, 0xdf7bd9a0, 0x8e5a9312, 0x8e5a9312, 0x8e5a9312, 0x43d1f34, 0xe53473ab, 0xe53473ab, 0x43d1f34, }, 20 }, ++ { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x37943894, 0x78248c70, 0x37943894, 0x7462f5d3, 0x59c36f00, 0x59c36f00, 0xf4be229a, 0xf4be229a, 0xf4be229a, 0x8a3e4ffc, 0x8a3e4ffc, 0x8a3e4ffc, 0x5594b2ee, 0x5594b2ee, 0x5594b2ee, 0x59c36f00, 0x7462f5d3, 0x7462f5d3, 0x59c36f00, }, 20 }, ++ { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd5158e6c, 0xdc71ba0f, 0xd5158e6c, 0xfb100b13, 0xaa4593fe, 0xaa4593fe, 0xd3ed72a3, 0xd3ed72a3, 0xd3ed72a3, 0x75187fc4, 0x75187fc4, 0x75187fc4, 0x6db8386d, 0x6db8386d, 0x6db8386d, 0xaa4593fe, 0xfb100b13, 0xfb100b13, 0xaa4593fe, }, 20 }, ++ { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6277a9e6, 0xa3265ffb, 0x6277a9e6, 0x3f60c462, 0xc9cbf769, 0xc9cbf769, 0x2dcf8a8d, 0x2dcf8a8d, 0x2dcf8a8d, 0xd3174b41, 0xd3174b41, 0xd3174b41, 0x4a34861e, 0x4a34861e, 0x4a34861e, 0xc9cbf769, 0x3f60c462, 0x3f60c462, 0xc9cbf769, }, 20 }, ++ { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x81115dc4, 0xddf3f768, 0x81115dc4, 0x99b0cf46, 0x9813a416, 0x9813a416, 0x9b9d96df, 0x9b9d96df, 0x9b9d96df, 0xa4610ec, 0xa4610ec, 0xa4610ec, 0xaec6192f, 0xaec6192f, 0xaec6192f, 0x9813a416, 0x99b0cf46, 0x99b0cf46, 0x9813a416, }, 20 }, ++ { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x5e96a904, 0x27864d3d, 0x5e96a904, 0x4bebe1b7, 0x5fcf013d, 0x5fcf013d, 0x18cae7f4, 0x18cae7f4, 0x18cae7f4, 0xcadaff82, 0xcadaff82, 0xcadaff82, 0x77e35b98, 0x77e35b98, 0x77e35b98, 0x5fcf013d, 0x4bebe1b7, 0x4bebe1b7, 0x5fcf013d, }, 20 }, ++ { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd00b19f8, 0xba73a9c6, 0xd00b19f8, 0xef1fb3b0, 0xdd28f52b, 0xdd28f52b, 0xb660046d, 0xb660046d, 0xb660046d, 0x975cfd89, 0x975cfd89, 0x975cfd89, 0xd4fcb5c3, 0xd4fcb5c3, 0xd4fcb5c3, 0xdd28f52b, 0xef1fb3b0, 0xef1fb3b0, 0xdd28f52b, }, 20 }, ++ { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8b4b98cd, 0x78ddc6e4, 0x8b4b98cd, 0x1250f2bc, 0x43d1f34, 0x43d1f34, 0x4889d3fd, 0x4889d3fd, 0x4889d3fd, 0x37837a55, 0x37837a55, 0x37837a55, 0x66a230e7, 0x66a230e7, 0x66a230e7, 0x43d1f34, 0x1250f2bc, 0x1250f2bc, 0x43d1f34, }, 20 }, ++ { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xfecb570e, 0xccb97a7a, 0xfecb570e, 0xbd3d9a49, 0x59c36f00, 0x59c36f00, 0x40281258, 0x40281258, 0x40281258, 0x3ea87f3e, 0x3ea87f3e, 0x3ea87f3e, 0xe102822c, 0xe102822c, 0xe102822c, 0x59c36f00, 0xbd3d9a49, 0xbd3d9a49, 0x59c36f00, }, 20 }, ++ { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x897d1fac, 0xaa982529, 0x897d1fac, 0xa7789ad3, 0xaa4593fe, 0xaa4593fe, 0xa482510, 0xa482510, 0xa482510, 0xacbd2877, 0xacbd2877, 0xacbd2877, 0xb41d6fde, 0xb41d6fde, 0xb41d6fde, 0xaa4593fe, 0xa7789ad3, 0xa7789ad3, 0xaa4593fe, }, 20 }, ++ { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd02a5297, 0xe627ab58, 0xd02a5297, 0x8d3d3f13, 0xc9cbf769, 0xc9cbf769, 0xbf0a8b7f, 0xbf0a8b7f, 0xbf0a8b7f, 0x41d24ab3, 0x41d24ab3, 0x41d24ab3, 0xd8f187ec, 0xd8f187ec, 0xd8f187ec, 0xc9cbf769, 0x8d3d3f13, 0x8d3d3f13, 0xc9cbf769, }, 20 }, ++ { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa653dcda, 0x3392e976, 0xa653dcda, 0xbef24e58, 0x9813a416, 0x9813a416, 0x4f2bc106, 0x4f2bc106, 0x4f2bc106, 0xdef04735, 0xdef04735, 0xdef04735, 0x7a704ef6, 0x7a704ef6, 0x7a704ef6, 0x9813a416, 0xbef24e58, 0xbef24e58, 0x9813a416, }, 20 }, ++ { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xe2d7b585, 0x35241f36, 0xe2d7b585, 0xf7aafd36, 0x5fcf013d, 0x5fcf013d, 0xf2bd04db, 0xf2bd04db, 0xf2bd04db, 0x20ad1cad, 0x20ad1cad, 0x20ad1cad, 0x9d94b8b7, 0x9d94b8b7, 0x9d94b8b7, 0x5fcf013d, 0xf7aafd36, 0xf7aafd36, 0x5fcf013d, }, 20 }, ++ { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x72ff749c, 0xeda8c283, 0x72ff749c, 0x4debded4, 0xdd28f52b, 0xdd28f52b, 0xb8c9cc22, 0xb8c9cc22, 0xb8c9cc22, 0x99f535c6, 0x99f535c6, 0x99f535c6, 0xda557d8c, 0xda557d8c, 0xda557d8c, 0xdd28f52b, 0x4debded4, 0x4debded4, 0xdd28f52b, }, 20 }, ++ { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xb7cac764, 0xeb4bf417, 0xb7cac764, 0x2ed1ad15, 0x43d1f34, 0x43d1f34, 0xce718801, 0xce718801, 0xce718801, 0xb17b21a9, 0xb17b21a9, 0xb17b21a9, 0xe05a6b1b, 0xe05a6b1b, 0xe05a6b1b, 0x43d1f34, 0x2ed1ad15, 0x2ed1ad15, 0x43d1f34, }, 20 }, ++ { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x930e8e13, 0xf5c16290, 0x930e8e13, 0x27f5f1c0, 0x59c36f00, 0x59c36f00, 0xbad4e11, 0xbad4e11, 0xbad4e11, 0x752d2377, 0x752d2377, 0x752d2377, 0xaa87de65, 0xaa87de65, 0xaa87de65, 0x59c36f00, 0x27f5f1c0, 0x27f5f1c0, 0x59c36f00, }, 20 }, ++ { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xff9301f2, 0x5bb9864a, 0xff9301f2, 0x31c145de, 0xaa4593fe, 0xaa4593fe, 0x23bf2c32, 0x23bf2c32, 0x23bf2c32, 0x854a2155, 0x854a2155, 0x854a2155, 0x9dea66fc, 0x9dea66fc, 0x9dea66fc, 0xaa4593fe, 0x31c145de, 0x31c145de, 0xaa4593fe, }, 20 }, ++ { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xfc5938ef, 0x46d56737, 0xfc5938ef, 0x23cf2668, 0xc9cbf769, 0xc9cbf769, 0xa8c549aa, 0xa8c549aa, 0xa8c549aa, 0x561d8866, 0x561d8866, 0x561d8866, 0xcf3e4539, 0xcf3e4539, 0xcf3e4539, 0xc9cbf769, 0x23cf2668, 0x23cf2668, 0xc9cbf769, }, 20 }, ++ { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xe7160822, 0x54b60115, 0xe7160822, 0x168efa6f, 0x9813a416, 0x9813a416, 0xb774a5aa, 0xb774a5aa, 0xb774a5aa, 0x26af2399, 0x26af2399, 0x26af2399, 0x822f2a5a, 0x822f2a5a, 0x822f2a5a, 0x9813a416, 0x168efa6f, 0x168efa6f, 0x9813a416, }, 20 }, ++ { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf655f9b2, 0xe6a3e2d3, 0xf655f9b2, 0xd1d7405f, 0x5fcf013d, 0x5fcf013d, 0x2accaa08, 0x2accaa08, 0x2accaa08, 0xf8dcb27e, 0xf8dcb27e, 0xf8dcb27e, 0x45e51664, 0x45e51664, 0x45e51664, 0x5fcf013d, 0xd1d7405f, 0xd1d7405f, 0x5fcf013d, }, 20 }, ++ { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2d85ebdc, 0x79fd4f02, 0x2d85ebdc, 0xc48ae2b6, 0xdd28f52b, 0xdd28f52b, 0x76b28a95, 0x76b28a95, 0x76b28a95, 0x578e7371, 0x578e7371, 0x578e7371, 0x142e3b3b, 0x142e3b3b, 0x142e3b3b, 0xdd28f52b, 0xc48ae2b6, 0xc48ae2b6, 0xdd28f52b, }, 20 }, ++ { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x29c00f98, 0x8251d825, 0x29c00f98, 0x35a750d1, 0x43d1f34, 0x43d1f34, 0x48b70bc8, 0x48b70bc8, 0x48b70bc8, 0x37bda260, 0x37bda260, 0x37bda260, 0x669ce8d2, 0x669ce8d2, 0x669ce8d2, 0x43d1f34, 0x35a750d1, 0x35a750d1, 0x43d1f34, }, 20 }, ++ { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4afab717, 0x2c355b94, 0x4afab717, 0x1166d9d0, 0x59c36f00, 0x59c36f00, 0x620c0067, 0x620c0067, 0x620c0067, 0x1c8c6d01, 0x1c8c6d01, 0x1c8c6d01, 0xc3269013, 0xc3269013, 0xc3269013, 0x59c36f00, 0x1166d9d0, 0x1166d9d0, 0x59c36f00, }, 20 }, ++ { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe3daadd4, 0x47f02a6c, 0xe3daadd4, 0x5ea9fb21, 0xaa4593fe, 0xaa4593fe, 0xa8a596c8, 0xa8a596c8, 0xa8a596c8, 0xe509baf, 0xe509baf, 0xe509baf, 0x16f0dc06, 0x16f0dc06, 0x16f0dc06, 0xaa4593fe, 0x5ea9fb21, 0x5ea9fb21, 0xaa4593fe, }, 20 }, ++ { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf140d1df, 0x4bcc8e07, 0xf140d1df, 0x7c962dcb, 0xc9cbf769, 0xc9cbf769, 0x3ce35e1d, 0x3ce35e1d, 0x3ce35e1d, 0xc23b9fd1, 0xc23b9fd1, 0xc23b9fd1, 0x5b18528e, 0x5b18528e, 0x5b18528e, 0xc9cbf769, 0x7c962dcb, 0x7c962dcb, 0xc9cbf769, }, 20 }, ++ { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xe709a12d, 0x54a9a81a, 0xe709a12d, 0xde04d65c, 0x9813a416, 0x9813a416, 0x43fda3fa, 0x43fda3fa, 0x43fda3fa, 0xd22625c9, 0xd22625c9, 0xd22625c9, 0x76a62c0a, 0x76a62c0a, 0x76a62c0a, 0x9813a416, 0xde04d65c, 0xde04d65c, 0x9813a416, }, 20 }, ++ { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x65eff77c, 0x7519ec1d, 0x65eff77c, 0x1cd7d353, 0x5fcf013d, 0x5fcf013d, 0xf3582c48, 0xf3582c48, 0xf3582c48, 0x2148343e, 0x2148343e, 0x2148343e, 0x9c719024, 0x9c719024, 0x9c719024, 0x5fcf013d, 0x1cd7d353, 0x1cd7d353, 0x5fcf013d, }, 20 }, ++ { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7318831a, 0x276027c4, 0x7318831a, 0xd7e4f5bb, 0xdd28f52b, 0xdd28f52b, 0xb3c7ef80, 0xb3c7ef80, 0xb3c7ef80, 0x92fb1664, 0x92fb1664, 0x92fb1664, 0xd15b5e2e, 0xd15b5e2e, 0xd15b5e2e, 0xdd28f52b, 0xd7e4f5bb, 0xd7e4f5bb, 0xdd28f52b, }, 20 }, ++ { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x6927a7d4, 0xc2b67069, 0x6927a7d4, 0xfc345163, 0x43d1f34, 0x43d1f34, 0xa0717008, 0xa0717008, 0xa0717008, 0xdf7bd9a0, 0xdf7bd9a0, 0xdf7bd9a0, 0x8e5a9312, 0x8e5a9312, 0x8e5a9312, 0x43d1f34, 0xfc345163, 0xfc345163, 0x43d1f34, }, 20 }, ++ { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0xe6012f70, 0xe6012f70, 0xe6012f70, 0xe6012f70, 0xe6012f70, }, 5 }, ++ { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xfb6be77b, 0xfb6be77b, 0xfb6be77b, 0xfb6be77b, 0xfb6be77b, }, 5 }, ++ { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0x67c0629f, 0x67c0629f, 0x67c0629f, 0x67c0629f, 0x67c0629f, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x8f20afbb, 0xd8f7abc, 0x8f937344, 0xd3ca643, 0x8e471645, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xdca764da, 0x9f76da9a, 0x5b04185a, 0x18d5a61a, 0xd60deb2b, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0x7b87af36, 0x7cb96093, 0x75fa307c, 0x72c4ffd9, 0x677c91a2, }, 5 }, ++ { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x72981c65, 0x50120635, 0x378c28c5, 0x15063295, 0xf8b07525, }, 5 }, ++ { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0xc8f64b58, 0xc8f64b58, 0xc8f64b58, 0xc8f64b58, 0xc8f64b58, }, 5 }, ++ { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0x2b499dfa, 0x2b499dfa, 0x2b499dfa, 0x2b499dfa, 0x2b499dfa, }, 5 }, ++ { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0x6156b420, 0x6156b420, 0x6156b420, 0x6156b420, 0x6156b420, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x363285ca, 0x363285ca, 0x363285ca, 0x363285ca, 0x363285ca, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x25bb37f4, 0x25bb37f4, 0x25bb37f4, 0x25bb37f4, 0x25bb37f4, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xeeab9e91, 0xeeab9e91, 0xeeab9e91, 0xeeab9e91, 0xeeab9e91, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x26a9a50b, 0x26a9a50b, 0x26a9a50b, 0x26a9a50b, 0x26a9a50b, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0x2c0f4fe7, 0x2c0f4fe7, 0x2c0f4fe7, 0x2c0f4fe7, 0x2c0f4fe7, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x46c11052, 0x46c11052, 0x46c11052, 0x46c11052, 0x46c11052, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0xe56cf615, 0xcd2be572, 0xb5e2d0db, 0x9da5c3bc, 0x4470bb89, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x2a25b871, 0x4bf85361, 0xe99e6e51, 0x88438541, 0xa8be62c0, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x81523037, 0xd8c0bfd3, 0x32772fff, 0x6be5a01b, 0xe2f47956, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x1833bb41, 0x1833bb41, 0x1833bb41, 0x1833bb41, 0x1833bb41, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2c39a0e8, 0x2c39a0e8, 0x2c39a0e8, 0x2c39a0e8, 0x2c39a0e8, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xf0d4c23, 0xf0d4c23, 0xf0d4c23, 0xf0d4c23, 0xf0d4c23, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x456d063c, 0x456d063c, 0x456d063c, 0x456d063c, 0x456d063c, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x47e15a2e, 0x47e15a2e, 0x47e15a2e, 0x47e15a2e, 0x47e15a2e, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x54d7300d, 0x54d7300d, 0x54d7300d, 0x54d7300d, 0x54d7300d, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x770da211, 0x8ef2528e, 0x811e35de, 0x78e1c541, 0x9ec6fb7e, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0xeb181fbc, 0xae648cc1, 0x61e13946, 0x249daa3b, 0xfb0624b9, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x2b6f64dc, 0xc25f8431, 0xfce2d3f7, 0x15d2331a, 0x81987c7b, }, 5 }, ++ { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0xa260f7dd, 0x3e2f4980, 0x9f13fd96, 0x35c43cb, 0xd886e34b, }, 5 }, ++ { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x41a9bff8, 0xa0d3f7c3, 0x86b1597f, 0x67cb1144, 0xca740407, }, 5 }, ++ { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0x8f7a3b6d, 0xcb84c6e3, 0x687c071, 0x42793dff, 0x996dbba4, }, 5 }, diff --git a/0081-grub-fs-tester-Fix-bashism.patch b/0081-grub-fs-tester-Fix-bashism.patch new file mode 100644 index 00000000..ed123779 --- /dev/null +++ b/0081-grub-fs-tester-Fix-bashism.patch @@ -0,0 +1,22 @@ +From 4f31bfe1d36e95ca3b1cdaf6a9d45d1e3722ad2f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 17:22:58 +0200 +Subject: [PATCH] grub-fs-tester: Fix bashism + +--- + tests/util/grub-fs-tester.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index fd7e0f14b68..15969d796a6 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -957,7 +957,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + esac + # Make sure file is not exact multiple of block size. This helps to force + # tail packing in case of squash4. +- : $((BLOCKCNT--)) ++ BLOCKCNT="$((BLOCKCNT-1))" + case x"$fs" in + x"ntfscomp") + setfattr -h -v 0x00000800 -n system.ntfs_attrib_be "$MNTPOINTRW/$OSDIR";; diff --git a/0082-gzio-fix-unaligned-access.patch b/0082-gzio-fix-unaligned-access.patch new file mode 100644 index 00000000..939c87a1 --- /dev/null +++ b/0082-gzio-fix-unaligned-access.patch @@ -0,0 +1,22 @@ +From 95acd4cbdac495c088fc3401fa365455f7039151 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 30 Aug 2017 20:46:14 +0200 +Subject: [PATCH] gzio: fix unaligned access + +--- + grub-core/io/gzio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c +index dcf3a870147..86ea8cfdea2 100644 +--- a/grub-core/io/gzio.c ++++ b/grub-core/io/gzio.c +@@ -1116,7 +1116,7 @@ inflate_window (grub_gzio_t gzio) + grub_uint32_t csum; + + gzio->hdesc->final (gzio->hcontext); +- csum = *(grub_uint32_t *)gzio->hdesc->read (gzio->hcontext); ++ csum = grub_get_unaligned32 (gzio->hdesc->read (gzio->hcontext)); + csum = grub_be_to_cpu32 (csum); + if (csum != gzio->orig_checksum) + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, diff --git a/0083-Add-a-file-missing-in-multiboot2-commit.patch b/0083-Add-a-file-missing-in-multiboot2-commit.patch new file mode 100644 index 00000000..7a55e18d --- /dev/null +++ b/0083-Add-a-file-missing-in-multiboot2-commit.patch @@ -0,0 +1,120 @@ +From 1b18d6b0d34872ced6b3dbfc3e7957c80efbcb7a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 5 Sep 2017 23:13:55 +0200 +Subject: [PATCH] Add a file missing in multiboot2 commit. + +--- + include/grub/multiboot2.h | 104 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 104 insertions(+) + create mode 100644 include/grub/multiboot2.h + +diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h +new file mode 100644 +index 00000000000..502d34ef180 +--- /dev/null ++++ b/include/grub/multiboot2.h +@@ -0,0 +1,104 @@ ++/* multiboot.h - multiboot header file with grub definitions. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2003,2007,2008,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 . ++ */ ++ ++#ifndef GRUB_MULTIBOOT2_HEADER ++#define GRUB_MULTIBOOT2_HEADER 1 ++ ++#include ++ ++#include ++ ++#include ++#include ++ ++extern struct grub_relocator *grub_multiboot2_relocator; ++ ++void grub_multiboot2 (int argc, char *argv[]); ++void grub_module2 (int argc, char *argv[]); ++ ++void grub_multiboot2_set_accepts_video (int val); ++grub_err_t grub_multiboot2_make_mbi (grub_uint32_t *target); ++void grub_multiboot2_free_mbi (void); ++grub_err_t grub_multiboot2_init_mbi (int argc, char *argv[]); ++grub_err_t grub_multiboot2_add_module (grub_addr_t start, grub_size_t size, ++ int argc, char *argv[]); ++void grub_multiboot2_set_bootdev (void); ++void ++grub_multiboot2_add_elfsyms (grub_size_t num, grub_size_t entsize, ++ unsigned shndx, void *data); ++ ++grub_uint32_t grub_multiboot2_get_mmap_count (void); ++grub_err_t grub_multiboot2_set_video_mode (void); ++ ++/* FIXME: support coreboot as well. */ ++#if defined (GRUB_MACHINE_PCBIOS) ++#define GRUB_MACHINE_HAS_VBE 1 ++#else ++#define GRUB_MACHINE_HAS_VBE 0 ++#endif ++ ++#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU) ++#define GRUB_MACHINE_HAS_VGA_TEXT 1 ++#else ++#define GRUB_MACHINE_HAS_VGA_TEXT 0 ++#endif ++ ++#if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) ++#define GRUB_MACHINE_HAS_ACPI 1 ++#else ++#define GRUB_MACHINE_HAS_ACPI 0 ++#endif ++ ++#define GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT 1 ++#define GRUB_MULTIBOOT2_CONSOLE_FRAMEBUFFER 2 ++ ++grub_err_t ++grub_multiboot2_set_console (int console_type, int accepted_consoles, ++ int width, int height, int depth, ++ int console_required); ++grub_err_t ++grub_multiboot2_load (grub_file_t file, const char *filename); ++ ++struct mbi_load_data ++{ ++ grub_file_t file; ++ const char *filename; ++ void *buffer; ++ unsigned int mbi_ver; ++ int relocatable; ++ grub_uint32_t min_addr; ++ grub_uint32_t max_addr; ++ grub_size_t align; ++ grub_uint32_t preference; ++ grub_uint32_t link_base_addr; ++ grub_uint32_t load_base_addr; ++ int avoid_efi_boot_services; ++}; ++typedef struct mbi_load_data mbi_load_data_t; ++ ++/* Load ELF32 or ELF64. */ ++grub_err_t ++grub_multiboot2_load_elf (mbi_load_data_t *mld); ++ ++extern grub_size_t grub_multiboot2_pure_size; ++extern grub_size_t grub_multiboot2_alloc_mbi; ++extern grub_uint32_t grub_multiboot2_payload_eip; ++ ++ ++#endif /* ! GRUB_MULTIBOOT_HEADER */ diff --git a/0083-Use-linuxefi-and-initrdefi-where-appropriate.patch b/0083-Use-linuxefi-and-initrdefi-where-appropriate.patch deleted file mode 100644 index 25f80331..00000000 --- a/0083-Use-linuxefi-and-initrdefi-where-appropriate.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 793d4270384ef3373bc0b3c956cab8a8cdb75bcf Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 16 Jul 2012 18:57:11 -0400 -Subject: [PATCH] Use "linuxefi" and "initrdefi" where appropriate. - ---- - util/grub.d/10_linux.in | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index cf6331f2a51..8ccf012f747 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -129,17 +129,31 @@ linux_entry () - printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" - fi - message="$(gettext_printf "Loading Linux %s ..." ${version})" -- sed "s/^/$submenu_indentation/" << EOF -+ if [ -d /sys/firmware/efi ]; then -+ sed "s/^/$submenu_indentation/" << EOF -+ echo '$(echo "$message" | grub_quote)' -+ linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} -+EOF -+ else -+ sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} - EOF -+ fi - if test -n "${initrd}" ; then - # TRANSLATORS: ramdisk isn't identifier. Should be translated. - message="$(gettext_printf "Loading initial ramdisk ...")" -- sed "s/^/$submenu_indentation/" << EOF -+ if [ -d /sys/firmware/efi ]; then -+ sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' -+ initrdefi ${rel_dirname}/${initrd} -+EOF -+ else -+ sed "s/^/$submenu_indentation/" << EOF -+ echo '$message' - initrd ${rel_dirname}/${initrd} - EOF -+ fi - fi - sed "s/^/$submenu_indentation/" << EOF - } diff --git a/0084-Fix-compilation-for-x86_64-efi.patch b/0084-Fix-compilation-for-x86_64-efi.patch new file mode 100644 index 00000000..6e38b9c7 --- /dev/null +++ b/0084-Fix-compilation-for-x86_64-efi.patch @@ -0,0 +1,38 @@ +From 78d2b81bd1af0a3a84d0c23c9ff4af3caa2df23b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 Sep 2017 13:55:22 +0200 +Subject: [PATCH] Fix compilation for x86_64-efi. + +--- + grub-core/loader/multiboot.c | 2 +- + include/grub/i386/multiboot.h | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c +index 3b57cb132a6..40c67e82489 100644 +--- a/grub-core/loader/multiboot.c ++++ b/grub-core/loader/multiboot.c +@@ -143,7 +143,7 @@ efi_boot (struct grub_relocator *rel, + #else + struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; + #endif +- state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip; ++ state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = GRUB_MULTIBOOT (payload_eip); + state_efi.MULTIBOOT_EFI_MBI_REGISTER = target; + + grub_relocator_efi_boot (rel, state_efi); +diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h +index 9cd97dfced8..0b596fc2060 100644 +--- a/include/grub/i386/multiboot.h ++++ b/include/grub/i386/multiboot.h +@@ -43,6 +43,10 @@ + .rcx = 0, \ + .rdx = 0, \ + } ++#define MULTIBOOT2_EFI_INITIAL_STATE { .rax = MULTIBOOT2_BOOTLOADER_MAGIC, \ ++ .rcx = 0, \ ++ .rdx = 0, \ ++ } + #define MULTIBOOT_EFI_ENTRY_REGISTER rip + #define MULTIBOOT_EFI_MBI_REGISTER rbx + #endif diff --git a/0193-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch b/0085-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch similarity index 59% rename from 0193-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch rename to 0085-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch index c9de84e4..3007fa0b 100644 --- a/0193-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch +++ b/0085-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch @@ -1,8 +1,8 @@ -From cba0322cd88baf136ac693f5ec1826f3314daeff Mon Sep 17 00:00:00 2001 +From a8e0f1adf7019238fff263111794c86f4eea79ac Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk -Date: Mon, 28 Aug 2017 13:51:14 -0400 -Subject: [PATCH] Fix util/grub.d/20_linux_xen.in: Add xen_boot command - support for aarch64 +Date: Tue, 29 Aug 2017 16:40:52 -0400 +Subject: [PATCH] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support + for aarch64 Commit d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe introduced the support for this, but it does not work under x86 (as it stops @@ -15,12 +15,29 @@ The 20_linux_xen is run under a shell and any exits from within it: [root@tst063 grub]# echo $? 1 -will result in 20_linux_xen exciting without continuing +will result in 20_linux_xen exiting without continuing and also causing grub2-mkconfig to stop processing. As in: -[root@tst063 ~]# + [root@tst063 grub]# ./grub-mkconfig | tail + Generating grub configuration file ... + Found linux image: /boot/vmlinuz-4.13.0-0.rc5.git1.1.fc27.x86_64 + Found initrd image: /boot/initramfs-4.13.0-0.rc5.git1.1.fc27.x86_64.img + Found linux image: /boot/vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 + Found initrd image: /boot/initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img + echo 'Loading Linux 0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 ...' + linux /vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 root=/dev/mapper/fedora_tst063-root ro single + echo 'Loading initial ramdisk ...' + initrd /initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img + } + } + + ### END /usr/local/etc/grub.d/10_linux ### + + ### BEGIN /usr/local/etc/grub.d/20_linux_xen ### + + root@tst063 grub]# And no more. @@ -29,17 +46,19 @@ and to process the return value in a conditional. That fixes the issue. RH-BZ 1486002: grub2-mkconfig does not work if xen.gz is installed. + CC: Fu Wei Signed-off-by: Konrad Rzeszutek Wilk +Reviewed-by: Daniel Kiper --- util/grub.d/20_linux_xen.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 462f8e1f819..9b1bd716965 100644 +index c002fc9f946..083bcef5d1b 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -210,13 +210,12 @@ while [ "x${xen_list}" != "x" ] ; do +@@ -206,13 +206,12 @@ while [ "x${xen_list}" != "x" ] ; do if [ "x$is_top_level" != xtrue ]; then echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" fi diff --git a/0194-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch b/0086-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch similarity index 50% rename from 0194-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch rename to 0086-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch index 8b84cd0a..eac3eb07 100644 --- a/0194-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch +++ b/0086-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch @@ -1,30 +1,36 @@ -From 87c089b6f1945ebcc690697d279c74284f1b4072 Mon Sep 17 00:00:00 2001 +From b4d709b6ee789cdaf3fa7a80fd90c721a16f48c2 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk -Date: Mon, 28 Aug 2017 13:59:12 -0400 -Subject: [PATCH] Use grub-file to figure out whether multiboot2 should - be used for Xen.gz +Date: Tue, 29 Aug 2017 16:40:53 -0400 +Subject: [PATCH] Use grub-file to figure out whether multiboot2 should be used + for Xen.gz The multiboot2 is much more preferable than multiboot. Especiall if booting under EFI where multiboot does not have the functionality to pass ImageHandler. Signed-off-by: Konrad Rzeszutek Wilk +Reviewed-by: Daniel Kiper --- - util/grub.d/20_linux_xen.in | 4 ++++ - 1 file changed, 4 insertions(+) + util/grub.d/20_linux_xen.in | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 9b1bd716965..fae1ffe9494 100644 +index 083bcef5d1b..0cb0f4e49b9 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -216,6 +216,10 @@ while [ "x${xen_list}" != "x" ] ; do +@@ -210,8 +210,13 @@ while [ "x${xen_list}" != "x" ] ; do + xen_loader="xen_hypervisor" + module_loader="xen_module" else - xen_loader="multiboot" - module_loader="module" +- xen_loader="multiboot" +- module_loader="module" + if ($grub_file --is-x86-multiboot2 $current_xen); then -+ xen_loader="multiboot2" -+ module_loader="module2" -+ fi ++ xen_loader="multiboot2" ++ module_loader="module2" ++ else ++ xen_loader="multiboot" ++ module_loader="module" ++ fi fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` diff --git a/0087-efi-Move-grub_reboot-into-kernel.patch b/0087-efi-Move-grub_reboot-into-kernel.patch new file mode 100644 index 00000000..6e2c9078 --- /dev/null +++ b/0087-efi-Move-grub_reboot-into-kernel.patch @@ -0,0 +1,115 @@ +From 0ba90a7f017889d32a47897d9107ef45cc50a049 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Thu, 31 Aug 2017 16:40:18 +0200 +Subject: [PATCH] efi: Move grub_reboot() into kernel + +The reboot function calls machine_fini() and then reboots the system. +Currently it lives in lib/ which means it gets compiled into the +reboot module which lives on the heap. + +In a following patch, I want to free the heap on machine_fini() +though, so we would free the memory that the code is running in. That +obviously breaks with smarter UEFI implementations. + +So this patch moves it into the core. That way we ensure that all +code running after machine_fini() in the UEFI case is running from +memory that got allocated (and gets deallocated) by the UEFI core. + +Signed-off-by: Alexander Graf +Reviewed-by: Daniel Kiper +--- + grub-core/Makefile.core.def | 4 ---- + grub-core/kern/efi/efi.c | 9 +++++++++ + grub-core/lib/efi/reboot.c | 33 --------------------------------- + include/grub/misc.h | 3 ++- + 4 files changed, 11 insertions(+), 38 deletions(-) + delete mode 100644 grub-core/lib/efi/reboot.c + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index d90ad622082..2c1d62ceea9 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -872,10 +872,6 @@ module = { + name = reboot; + i386 = lib/i386/reboot.c; + i386 = lib/i386/reboot_trampoline.S; +- ia64_efi = lib/efi/reboot.c; +- x86_64_efi = lib/efi/reboot.c; +- arm_efi = lib/efi/reboot.c; +- arm64_efi = lib/efi/reboot.c; + powerpc_ieee1275 = lib/ieee1275/reboot.c; + sparc64_ieee1275 = lib/ieee1275/reboot.c; + mips_arc = lib/mips/arc/reboot.c; +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index d467785fc6c..708581fcbde 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -154,6 +154,15 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + } + ++void ++grub_reboot (void) ++{ ++ grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); ++ efi_call_4 (grub_efi_system_table->runtime_services->reset_system, ++ GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); ++ for (;;) ; ++} ++ + void + grub_exit (void) + { +diff --git a/grub-core/lib/efi/reboot.c b/grub-core/lib/efi/reboot.c +deleted file mode 100644 +index 7de8bcb5d6e..00000000000 +--- a/grub-core/lib/efi/reboot.c ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * GRUB -- GRand Unified Bootloader +- * Copyright (C) 2011 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 +- +-void +-grub_reboot (void) +-{ +- grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); +- efi_call_4 (grub_efi_system_table->runtime_services->reset_system, +- GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); +- for (;;) ; +-} +diff --git a/include/grub/misc.h b/include/grub/misc.h +index 2a9f87cc255..372f009e84f 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -396,7 +396,8 @@ grub_abs (int x) + } + + /* Reboot the machine. */ +-#if defined (GRUB_MACHINE_EMU) || defined (GRUB_MACHINE_QEMU_MIPS) ++#if defined (GRUB_MACHINE_EMU) || defined (GRUB_MACHINE_QEMU_MIPS) || \ ++ defined (GRUB_MACHINE_EFI) + void EXPORT_FUNC(grub_reboot) (void) __attribute__ ((noreturn)); + #else + void grub_reboot (void) __attribute__ ((noreturn)); diff --git a/0088-efi-Free-malloc-regions-on-exit.patch b/0088-efi-Free-malloc-regions-on-exit.patch new file mode 100644 index 00000000..6ec011f8 --- /dev/null +++ b/0088-efi-Free-malloc-regions-on-exit.patch @@ -0,0 +1,154 @@ +From 92bfc33db984eec22966a163eed7b6f2ab0266bf Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Thu, 31 Aug 2017 16:40:19 +0200 +Subject: [PATCH] efi: Free malloc regions on exit + +When we exit grub, we don't free all the memory that we allocated earlier +for our heap region. This can cause problems with setups where you try +to descend the boot order using "exit" entries, such as PXE -> HD boot +scenarios. + +Signed-off-by: Alexander Graf +Reviewed-by: Daniel Kiper +--- + grub-core/kern/efi/init.c | 1 + + grub-core/kern/efi/mm.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++ + include/grub/efi/efi.h | 1 + + 3 files changed, 84 insertions(+) + +diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c +index 2c31847bf6d..3dfdf2d22b0 100644 +--- a/grub-core/kern/efi/init.c ++++ b/grub-core/kern/efi/init.c +@@ -80,4 +80,5 @@ grub_efi_fini (void) + { + grub_efidisk_fini (); + grub_console_fini (); ++ grub_efi_memory_fini (); + } +diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c +index ac2a4c556b8..c48e9b5c7c3 100644 +--- a/grub-core/kern/efi/mm.c ++++ b/grub-core/kern/efi/mm.c +@@ -49,6 +49,70 @@ static grub_efi_uintn_t finish_desc_size; + static grub_efi_uint32_t finish_desc_version; + int grub_efi_is_finished = 0; + ++/* ++ * We need to roll back EFI allocations on exit. Remember allocations that ++ * we'll free on exit. ++ */ ++struct efi_allocation; ++struct efi_allocation { ++ grub_efi_physical_address_t address; ++ grub_efi_uint64_t pages; ++ struct efi_allocation *next; ++}; ++static struct efi_allocation *efi_allocated_memory; ++ ++static void ++grub_efi_store_alloc (grub_efi_physical_address_t address, ++ grub_efi_uintn_t pages) ++{ ++ grub_efi_boot_services_t *b; ++ struct efi_allocation *alloc; ++ grub_efi_status_t status; ++ ++ b = grub_efi_system_table->boot_services; ++ status = efi_call_3 (b->allocate_pool, GRUB_EFI_LOADER_DATA, ++ sizeof(*alloc), (void**)&alloc); ++ ++ if (status == GRUB_EFI_SUCCESS) ++ { ++ alloc->next = efi_allocated_memory; ++ alloc->address = address; ++ alloc->pages = pages; ++ efi_allocated_memory = alloc; ++ } ++ else ++ grub_printf ("Could not malloc memory to remember EFI allocation. " ++ "Exiting GRUB won't free all memory.\n"); ++} ++ ++static void ++grub_efi_drop_alloc (grub_efi_physical_address_t address, ++ grub_efi_uintn_t pages) ++{ ++ struct efi_allocation *ea, *eap; ++ grub_efi_boot_services_t *b; ++ ++ b = grub_efi_system_table->boot_services; ++ ++ for (eap = NULL, ea = efi_allocated_memory; ea; eap = ea, ea = ea->next) ++ { ++ if (ea->address != address || ea->pages != pages) ++ continue; ++ ++ /* Remove the current entry from the list. */ ++ if (eap) ++ eap->next = ea->next; ++ else ++ efi_allocated_memory = ea->next; ++ ++ /* Then free the memory backing it. */ ++ efi_call_1 (b->free_pool, ea); ++ ++ /* And leave, we're done. */ ++ break; ++ } ++} ++ + /* Allocate pages. Return the pointer to the first of allocated pages. */ + void * + grub_efi_allocate_pages_real (grub_efi_physical_address_t address, +@@ -79,6 +143,8 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address, + return 0; + } + ++ grub_efi_store_alloc (address, pages); ++ + return (void *) ((grub_addr_t) address); + } + +@@ -108,6 +174,8 @@ grub_efi_free_pages (grub_efi_physical_address_t address, + + b = grub_efi_system_table->boot_services; + efi_call_2 (b->free_pages, address, pages); ++ ++ grub_efi_drop_alloc (address, pages); + } + + #if defined (__i386__) || defined (__x86_64__) +@@ -422,6 +490,20 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, + grub_fatal ("too little memory"); + } + ++void ++grub_efi_memory_fini (void) ++{ ++ /* ++ * Free all stale allocations. grub_efi_free_pages() will remove ++ * the found entry from the list and it will always find the first ++ * list entry (efi_allocated_memory is the list start). Hence we ++ * remove all entries from the list until none is left altogether. ++ */ ++ while (efi_allocated_memory) ++ grub_efi_free_pages (efi_allocated_memory->address, ++ efi_allocated_memory->pages); ++} ++ + #if 0 + /* Print the memory map. */ + static void +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index 3fa082816ca..c996913e5bc 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -55,6 +55,7 @@ EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *descriptor_size, + grub_efi_uint32_t *descriptor_version); ++void grub_efi_memory_fini (void); + grub_efi_loaded_image_t *EXPORT_FUNC(grub_efi_get_loaded_image) (grub_efi_handle_t image_handle); + void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp); + char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); diff --git a/0196-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch b/0089-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch similarity index 100% rename from 0196-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch rename to 0089-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch diff --git a/0090-ls-prevent-double-open.patch b/0090-ls-prevent-double-open.patch new file mode 100644 index 00000000..e634da35 --- /dev/null +++ b/0090-ls-prevent-double-open.patch @@ -0,0 +1,42 @@ +From 3d8df86d825ff07a8eeb202329b8731fd1a4a24e Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 13 Nov 2017 08:27:28 -0800 +Subject: [PATCH] ls: prevent double open + +Prevent a double open. This can cause problems with some ieee1275 +devices, causing the system to hang. The double open can occur +as follows: + +grub_ls_list_files (char *dirname, int longlist, int all, int human) + dev = grub_device_open (device_name); + dev remains open while: + grub_normal_print_device_info (device_name); + dev = grub_device_open (name); + +Signed-off-by: Eric Snowberg +Signed-off-by: Daniel Kiper +Reviewed-by: Daniel Kiper +--- + grub-core/commands/ls.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/grub-core/commands/ls.c b/grub-core/commands/ls.c +index 0eaf8365279..c25161cc4f2 100644 +--- a/grub-core/commands/ls.c ++++ b/grub-core/commands/ls.c +@@ -201,6 +201,15 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) + if (grub_errno == GRUB_ERR_UNKNOWN_FS) + grub_errno = GRUB_ERR_NONE; + ++#ifdef GRUB_MACHINE_IEEE1275 ++ /* ++ * Close device to prevent a double open in grub_normal_print_device_info(). ++ * Otherwise it may lead to hangs on some IEEE 1275 platforms. ++ */ ++ grub_device_close (dev); ++ dev = NULL; ++#endif ++ + grub_normal_print_device_info (device_name); + } + else if (fs) diff --git a/0091-grub-install-Fix-memory-leak.patch b/0091-grub-install-Fix-memory-leak.patch new file mode 100644 index 00000000..d3332be2 --- /dev/null +++ b/0091-grub-install-Fix-memory-leak.patch @@ -0,0 +1,23 @@ +From 2a8856401774d86ec78481e2188a54bbf689f25e Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 27 Nov 2017 09:12:49 -0800 +Subject: [PATCH] grub-install: Fix memory leak + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + util/grub-install.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-install.c b/util/grub-install.c +index 75e3e5ba6f0..5e4cdfd2b52 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -1472,6 +1472,7 @@ main (int argc, char *argv[]) + { + grub_util_fprint_full_disk_name (load_cfg_f, g, dev); + fprintf (load_cfg_f, " "); ++ free (g); + } + if (dev != grub_dev) + grub_device_close (dev); diff --git a/0092-ieee1275-Fix-segfault-in-grub-ofpathname.patch b/0092-ieee1275-Fix-segfault-in-grub-ofpathname.patch new file mode 100644 index 00000000..77dcc92a --- /dev/null +++ b/0092-ieee1275-Fix-segfault-in-grub-ofpathname.patch @@ -0,0 +1,26 @@ +From 2dc163bf692c18275de7b0d6716138c676e3bf92 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Tue, 28 Nov 2017 11:51:39 -0800 +Subject: [PATCH] ieee1275: Fix segfault in grub-ofpathname + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + util/ieee1275/grub-ofpathname.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/ieee1275/grub-ofpathname.c b/util/ieee1275/grub-ofpathname.c +index 8e5d766cb63..300fbddad7c 100644 +--- a/util/ieee1275/grub-ofpathname.c ++++ b/util/ieee1275/grub-ofpathname.c +@@ -46,7 +46,9 @@ int main(int argc, char **argv) + } + + of_path = grub_util_devname_to_ofpath (argv[1]); +- printf("%s\n", of_path); ++ ++ if (of_path) ++ printf ("%s\n", of_path); + + free (of_path); + diff --git a/0093-grub-mkconfig-Fix-detecting-.sig-files-as-system-ima.patch b/0093-grub-mkconfig-Fix-detecting-.sig-files-as-system-ima.patch new file mode 100644 index 00000000..033cd6c7 --- /dev/null +++ b/0093-grub-mkconfig-Fix-detecting-.sig-files-as-system-ima.patch @@ -0,0 +1,27 @@ +From 5033080eb6cb784a3d7f36b3d66b71f4603bf0aa Mon Sep 17 00:00:00 2001 +From: Jordan Glover +Date: Wed, 29 Nov 2017 08:35:37 -0500 +Subject: [PATCH] grub-mkconfig: Fix detecting .sig files as system images + +grub-mkconfig detects detached RSA signatures for kernel images used for +signature checking as valid images and adds them to grub.cfg as separate +menu entries. This patch adds .sig extension to common blacklist. + +Signed-off-by: Jordan Glover +Reviewed-by: Daniel Kiper +--- + util/grub-mkconfig_lib.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 60b31caddeb..0f801cab3e4 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -188,6 +188,7 @@ grub_file_is_not_garbage () + *.dpkg-*) return 1 ;; # debian dpkg + *.rpmsave|*.rpmnew) return 1 ;; + README*|*/README*) return 1 ;; # documentation ++ *.sig) return 1 ;; # signatures + esac + else + return 1 diff --git a/0094-arm64-xen-Add-missing-address-cells-and-size-cells-p.patch b/0094-arm64-xen-Add-missing-address-cells-and-size-cells-p.patch new file mode 100644 index 00000000..339a315a --- /dev/null +++ b/0094-arm64-xen-Add-missing-address-cells-and-size-cells-p.patch @@ -0,0 +1,45 @@ +From d34977cb662d9d3c74532dc175103758c47f552f Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Wed, 29 Nov 2017 17:08:12 +0000 +Subject: [PATCH] arm64/xen: Add missing #address-cells and #size-cells + properties + +The properties #address-cells and #size-cells are used to know the +number of cells for ranges provided by "regs". If they don't exist, the +value are resp. 2 and 1. + +Currently, when multiboot nodes are created it is assumed that #address-cells +and #size-cells are exactly 2. However, they are never set by GRUB and +will result to later failure when the device-tree is generated by GRUB +or contain different values. + +To prevent this failure, create the both properties in the chosen nodes. + +Signed-off-by: Julien Grall +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm64/xen_boot.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c +index c95d6c5a868..6780b1f0c4a 100644 +--- a/grub-core/loader/arm64/xen_boot.c ++++ b/grub-core/loader/arm64/xen_boot.c +@@ -115,6 +115,17 @@ prepare_xen_hypervisor_params (void *xen_boot_fdt) + if (chosen_node < 1) + return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); + ++ /* ++ * The address and size are always written using 64-bits value. Set ++ * #address-cells and #size-cells accordingly. ++ */ ++ retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#address-cells", 2); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to set #address-cells"); ++ retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#size-cells", 2); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to set #size-cells"); ++ + grub_dprintf ("xen_loader", + "Xen Hypervisor cmdline : %s @ %p size:%d\n", + xen_hypervisor->cmdline, xen_hypervisor->cmdline, diff --git a/0095-Keep-the-native-terminal-active-when-enabling-gfxter.patch b/0095-Keep-the-native-terminal-active-when-enabling-gfxter.patch new file mode 100644 index 00000000..559fdc61 --- /dev/null +++ b/0095-Keep-the-native-terminal-active-when-enabling-gfxter.patch @@ -0,0 +1,31 @@ +From 52ef7b23f528ce844716661d586497a177e80d5b Mon Sep 17 00:00:00 2001 +From: dann frazier +Date: Thu, 18 Jan 2018 11:57:26 -0700 +Subject: [PATCH] Keep the native terminal active when enabling gfxterm + +grub-mkconfig will set GRUB_TERMINAL_OUTPUT to "gfxterm" unless the user +has overridden it. On EFI systems, this will stop output from going to the +default "console" terminal. When the EFI fw console is configured to output to +both serial and video, this will cause GRUB to only display on video - while +continuing to accept input from both video and serial. + +Instead of switching from "console" to "gfxterm", let's output to both. + +Reviewed-by: Daniel Kiper +--- + util/grub.d/00_header.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in +index 93a90233ead..8d46fc973c1 100644 +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -221,7 +221,7 @@ case x${GRUB_TERMINAL_OUTPUT} in + ;; + x*) + cat << EOF +-terminal_output ${GRUB_TERMINAL_OUTPUT} ++terminal_output --append ${GRUB_TERMINAL_OUTPUT} + EOF + ;; + esac diff --git a/0096-ahci-Improve-error-handling.patch b/0096-ahci-Improve-error-handling.patch new file mode 100644 index 00000000..4836548c --- /dev/null +++ b/0096-ahci-Improve-error-handling.patch @@ -0,0 +1,84 @@ +From 566a03a623ca5ec07c815683625aecc410dc3095 Mon Sep 17 00:00:00 2001 +From: Stefan Fritsch +Date: Fri, 19 Jan 2018 14:13:29 +0100 +Subject: [PATCH] ahci: Improve error handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Check the error bits in the interrupt status register. According to the +AHCI 1.2 spec, "Interrupt sources that are disabled (‘0’) are still +reflected in the status registers.", so this should work even though +grub uses polling + +This fixes the following problem on a Fujitsu E744 laptop: + +Sometimes there is a very long delay (up to several minutes) when +booting from hard disk. It seems accessing the DVD drive (which has no +disk inserted) sometimes fails with some errors, which leads to each +access being stalled until the 20s timeout triggers. This seems to +happen when grub is trying to read filesystem/partition data. + +The problem is that the command_issue bit that is checked in the loop is +only reset if the "HBA receives a FIS which clears the BSY, DRQ, and ERR +bits for the command", but the ERR bit is never cleared. Therefore +command_issue is never reset and grub waits for the timeout. + +The relevant bit in our case is the Task File Error Status (TFES), which +is equivalent to the ERR bit 0 in tfd. But this patch also checks +the other error bits except for the "Interface non-fatal error status" +bit. + +Signed-off-by: Stefan Fritsch +Reviewed-by: Daniel Kiper +--- + grub-core/disk/ahci.c | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index 494a1b7734e..f2f606423ac 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -82,6 +82,20 @@ enum grub_ahci_hba_port_command + GRUB_AHCI_HBA_PORT_CMD_FR = 0x4000, + }; + ++enum grub_ahci_hba_port_int_status ++ { ++ GRUB_AHCI_HBA_PORT_IS_IFS = (1UL << 27), ++ GRUB_AHCI_HBA_PORT_IS_HBDS = (1UL << 28), ++ GRUB_AHCI_HBA_PORT_IS_HBFS = (1UL << 29), ++ GRUB_AHCI_HBA_PORT_IS_TFES = (1UL << 30), ++ }; ++ ++#define GRUB_AHCI_HBA_PORT_IS_FATAL_MASK ( \ ++ GRUB_AHCI_HBA_PORT_IS_IFS | \ ++ GRUB_AHCI_HBA_PORT_IS_HBDS | \ ++ GRUB_AHCI_HBA_PORT_IS_HBFS | \ ++ GRUB_AHCI_HBA_PORT_IS_TFES) ++ + struct grub_ahci_hba + { + grub_uint32_t cap; +@@ -1026,7 +1040,8 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, + + endtime = grub_get_time_ms () + (spinup ? 20000 : 20000); + while ((dev->hba->ports[dev->port].command_issue & 1)) +- if (grub_get_time_ms () > endtime) ++ if (grub_get_time_ms () > endtime || ++ (dev->hba->ports[dev->port].intstatus & GRUB_AHCI_HBA_PORT_IS_FATAL_MASK)) + { + grub_dprintf ("ahci", "AHCI status <%x %x %x %x>\n", + dev->hba->ports[dev->port].command_issue, +@@ -1034,7 +1049,10 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, + dev->hba->ports[dev->port].intstatus, + dev->hba->ports[dev->port].task_file_data); + dev->hba->ports[dev->port].command_issue = 0; +- err = grub_error (GRUB_ERR_IO, "AHCI transfer timed out"); ++ if (dev->hba->ports[dev->port].intstatus & GRUB_AHCI_HBA_PORT_IS_FATAL_MASK) ++ err = grub_error (GRUB_ERR_IO, "AHCI transfer error"); ++ else ++ err = grub_error (GRUB_ERR_IO, "AHCI transfer timed out"); + if (!reset) + grub_ahci_reset_port (dev, 1); + break; diff --git a/0097-sparc64-Add-blocklist-GPT-support-for-SPARC.patch b/0097-sparc64-Add-blocklist-GPT-support-for-SPARC.patch new file mode 100644 index 00000000..1e70636e --- /dev/null +++ b/0097-sparc64-Add-blocklist-GPT-support-for-SPARC.patch @@ -0,0 +1,94 @@ +From 69e0a67bfb419a8d6c905fb23330a8afc2435de6 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Thu, 11 May 2017 18:25:24 -0700 +Subject: [PATCH] sparc64: Add blocklist GPT support for SPARC + +Add block-list GPT support for SPARC. The OBP "load" and "boot" methods +are partition aware and neither command can see the partition table. Also +neither command can address the entire physical disk. When the install +happens, grub generates the block-list entries based on the beginning of the +physical disk, not the beginning of the partition. This patch fixes the +block-list entries so they match what OBP expects during boot for a GPT disk. + +T5 and above now supports GPT as well as VTOC. + +This patch has been tested on T5-2 and newer SPARC systems. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + util/setup.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/util/setup.c b/util/setup.c +index 8aa5a39a794..80363075d34 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -137,6 +137,9 @@ struct blocklists + struct grub_boot_blocklist *first_block, *block; + #ifdef GRUB_SETUP_BIOS + grub_uint16_t current_segment; ++#endif ++#ifdef GRUB_SETUP_SPARC64 ++ grub_uint64_t gpt_offset; + #endif + grub_uint16_t last_length; + grub_disk_addr_t first_sector; +@@ -151,6 +154,10 @@ save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length, + struct grub_boot_blocklist *prev = bl->block + 1; + grub_uint64_t seclen; + ++#ifdef GRUB_SETUP_SPARC64 ++ sector -= bl->gpt_offset; ++#endif ++ + grub_util_info ("saving <%" GRUB_HOST_PRIuLONG_LONG ",%u,%u>", + (unsigned long long) sector, offset, length); + +@@ -662,6 +669,16 @@ unable_to_embed: + + bl.block = bl.first_block; + ++#ifdef GRUB_SETUP_SPARC64 ++ { ++ grub_partition_t container = root_dev->disk->partition; ++ bl.gpt_offset = 0; ++ ++ if (grub_strstr (container->partmap->name, "gpt")) ++ bl.gpt_offset = grub_partition_get_start (container); ++ } ++#endif ++ + grub_install_get_blocklist (root_dev, core_path, core_img, core_size, + save_blocklists, &bl); + +@@ -721,15 +738,18 @@ unable_to_embed: + { + char *buf, *ptr = core_img; + size_t len = core_size; +- grub_uint64_t blk; ++ grub_uint64_t blk, offset = 0; + grub_partition_t container = core_dev->disk->partition; + grub_err_t err; + + core_dev->disk->partition = 0; ++#ifdef GRUB_SETUP_SPARC64 ++ offset = bl.gpt_offset; ++#endif + + buf = xmalloc (core_size); + blk = bl.first_sector; +- err = grub_disk_read (core_dev->disk, blk, 0, GRUB_DISK_SECTOR_SIZE, buf); ++ err = grub_disk_read (core_dev->disk, blk + offset, 0, GRUB_DISK_SECTOR_SIZE, buf); + if (err) + grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name, + grub_errmsg); +@@ -748,7 +768,7 @@ unable_to_embed: + if (cur > len) + cur = len; + +- err = grub_disk_read (core_dev->disk, blk, 0, cur, buf); ++ err = grub_disk_read (core_dev->disk, blk + offset, 0, cur, buf); + if (err) + grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name, + grub_errmsg); diff --git a/0098-sparc64-fix-OF-path-names-for-sun4v-systems.patch b/0098-sparc64-fix-OF-path-names-for-sun4v-systems.patch new file mode 100644 index 00000000..9ca82083 --- /dev/null +++ b/0098-sparc64-fix-OF-path-names-for-sun4v-systems.patch @@ -0,0 +1,220 @@ +From d85c76b501edda038b68bc23eee946e6cc600513 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Tue, 30 Jan 2018 20:49:48 -0800 +Subject: [PATCH] sparc64: fix OF path names for sun4v systems + +Fix the Open Firmware (OF) path property for sun4v SPARC systems. +These platforms do not have a /sas/ within their path. Over time +different OF addressing schemes have been supported. There +is no generic addressing scheme that works across every HBA. + +It looks that this functionality will not work if you try to cross-install +SPARC GRUB2 binary using e.g. x86 grub-install. By default it should work. +However, we will also have other issues here, like lack of access to OF +firmware/paths, which make such configs unusable anyway. So, let's leave +this patch as is for time being. If somebody cares then he/she should fix +the issue(s) at some point. + +Signed-off-by: Eric Snowberg +Signed-off-by: Daniel Kiper +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/linux/ofpath.c | 147 ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 144 insertions(+), 3 deletions(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index dce4e59d081..8d7d6837f26 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -38,6 +38,46 @@ + #include + #include + ++#ifdef __sparc__ ++typedef enum ++ { ++ GRUB_OFPATH_SPARC_WWN_ADDR = 1, ++ GRUB_OFPATH_SPARC_TGT_LUN, ++ } ofpath_sparc_addressing; ++ ++struct ofpath_sparc_hba ++{ ++ grub_uint32_t device_id; ++ ofpath_sparc_addressing addressing; ++}; ++ ++static struct ofpath_sparc_hba sparc_lsi_hba[] = { ++ /* Rhea, Jasper 320, LSI53C1020/1030. */ ++ {0x30, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* SAS-1068E. */ ++ {0x50, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* SAS-1064E. */ ++ {0x56, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* Pandora SAS-1068E. */ ++ {0x58, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* Aspen, Invader, LSI SAS-3108. */ ++ {0x5d, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* Niwot, SAS 2108. */ ++ {0x79, GRUB_OFPATH_SPARC_TGT_LUN}, ++ /* Erie, Falcon, LSI SAS 2008. */ ++ {0x72, GRUB_OFPATH_SPARC_WWN_ADDR}, ++ /* LSI WarpDrive 6203. */ ++ {0x7e, GRUB_OFPATH_SPARC_WWN_ADDR}, ++ /* LSI SAS 2308. */ ++ {0x87, GRUB_OFPATH_SPARC_WWN_ADDR}, ++ /* LSI SAS 3008. */ ++ {0x97, GRUB_OFPATH_SPARC_WWN_ADDR}, ++ {0, 0} ++}; ++ ++static const int LSI_VENDOR_ID = 0x1000; ++#endif ++ + #ifdef OFPATH_STANDALONE + #define xmalloc malloc + void +@@ -338,6 +378,64 @@ vendor_is_ATA(const char *path) + return (memcmp(bufcont, "ATA", 3) == 0); + } + ++#ifdef __sparc__ ++static void ++check_hba_identifiers (const char *sysfs_path, int *vendor, int *device_id) ++{ ++ char *ed = strstr (sysfs_path, "host"); ++ size_t path_size; ++ char *p, *path; ++ char buf[8]; ++ int fd; ++ ++ if (!ed) ++ return; ++ ++ p = xstrdup (sysfs_path); ++ ed = strstr (p, "host"); ++ ++ *ed = '\0'; ++ ++ path_size = (strlen (p) + sizeof ("vendor")); ++ path = xmalloc (path_size); ++ ++ if (!path) ++ goto out; ++ ++ snprintf (path, path_size, "%svendor", p); ++ fd = open (path, O_RDONLY); ++ ++ if (fd < 0) ++ goto out; ++ ++ memset (buf, 0, sizeof (buf)); ++ ++ if (read (fd, buf, sizeof (buf) - 1) < 0) ++ goto out; ++ ++ close (fd); ++ sscanf (buf, "%x", vendor); ++ ++ snprintf (path, path_size, "%sdevice", p); ++ fd = open (path, O_RDONLY); ++ ++ if (fd < 0) ++ goto out; ++ ++ memset (buf, 0, sizeof (buf)); ++ ++ if (read (fd, buf, sizeof (buf) - 1) < 0) ++ goto out; ++ ++ close (fd); ++ sscanf (buf, "%x", device_id); ++ ++ out: ++ free (path); ++ free (p); ++} ++#endif ++ + static void + check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address) + { +@@ -399,7 +497,7 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev + { + const char *p, *digit_string, *disk_name; + int host, bus, tgt, lun; +- unsigned long int sas_address; ++ unsigned long int sas_address = 0; + char *sysfs_path, disk[MAX_DISK_CAT - sizeof ("/fp@0,0")]; + char *of_path; + +@@ -416,9 +514,8 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev + } + + of_path = find_obppath(sysfs_path); +- free (sysfs_path); + if (!of_path) +- return NULL; ++ goto out; + + if (strstr (of_path, "qlc")) + strcat (of_path, "/fp@0,0"); +@@ -447,6 +544,46 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev + } + else + { ++#ifdef __sparc__ ++ ofpath_sparc_addressing addressing = GRUB_OFPATH_SPARC_TGT_LUN; ++ int vendor = 0, device_id = 0; ++ char *optr = disk; ++ ++ check_hba_identifiers (sysfs_path, &vendor, &device_id); ++ ++ if (vendor == LSI_VENDOR_ID) ++ { ++ struct ofpath_sparc_hba *lsi_hba; ++ ++ /* ++ * Over time different OF addressing schemes have been supported. ++ * There is no generic addressing scheme that works across ++ * every HBA. ++ */ ++ for (lsi_hba = sparc_lsi_hba; lsi_hba->device_id; lsi_hba++) ++ if (lsi_hba->device_id == device_id) ++ { ++ addressing = lsi_hba->addressing; ++ break; ++ } ++ } ++ ++ if (addressing == GRUB_OFPATH_SPARC_WWN_ADDR) ++ optr += snprintf (disk, sizeof (disk), "/%s@w%lx,%x", disk_name, ++ sas_address, lun); ++ else ++ optr += snprintf (disk, sizeof (disk), "/%s@%x,%x", disk_name, tgt, ++ lun); ++ ++ if (*digit_string != '\0') ++ { ++ int part; ++ ++ sscanf (digit_string, "%d", &part); ++ snprintf (optr, sizeof (disk) - (optr - disk - 1), ":%c", 'a' ++ + (part - 1)); ++ } ++#else + if (lun == 0) + { + int sas_id = 0; +@@ -494,8 +631,12 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev + } + free (lunstr); + } ++#endif + } + strcat(of_path, disk); ++ ++ out: ++ free (sysfs_path); + return of_path; + } + diff --git a/0099-Make-grub-install-check-for-errors-from-efibootmgr.patch b/0099-Make-grub-install-check-for-errors-from-efibootmgr.patch new file mode 100644 index 00000000..a7d44da6 --- /dev/null +++ b/0099-Make-grub-install-check-for-errors-from-efibootmgr.patch @@ -0,0 +1,178 @@ +From 6400613ad0b463abc93362086a491cd2a5e99b0d Mon Sep 17 00:00:00 2001 +From: Steve McIntyre +Date: Wed, 31 Jan 2018 21:49:36 +0000 +Subject: [PATCH] Make grub-install check for errors from efibootmgr + +Code is currently ignoring errors from efibootmgr, giving users +clearly bogus output like: + + Setting up grub-efi-amd64 (2.02~beta3-4) ... + Installing for x86_64-efi platform. + Could not delete variable: No space left on device + Could not prepare Boot variable: No space left on device + Installation finished. No error reported. + +and then potentially unbootable systems. If efibootmgr fails, grub-install +should know that and report it! + +We've been using similar patch in Debian now for some time, with no ill effects. + +Signed-off-by: Steve McIntyre <93sam@debian.org> +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/unix/platform.c | 24 +++++++++++++++--------- + util/grub-install.c | 18 +++++++++++++----- + include/grub/util/install.h | 2 +- + 3 files changed, 29 insertions(+), 15 deletions(-) + +diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c +index a3fcfcacaa8..ca448bc11a0 100644 +--- a/grub-core/osdep/unix/platform.c ++++ b/grub-core/osdep/unix/platform.c +@@ -78,19 +78,20 @@ get_ofpathname (const char *dev) + dev); + } + +-static void ++static int + grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) + { + int fd; + pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd); + char *line = NULL; + size_t len = 0; ++ int rc; + + if (!pid) + { + grub_util_warn (_("Unable to open stream from %s: %s"), + "efibootmgr", strerror (errno)); +- return; ++ return errno; + } + + FILE *fp = fdopen (fd, "r"); +@@ -98,7 +99,7 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) + { + grub_util_warn (_("Unable to open stream from %s: %s"), + "efibootmgr", strerror (errno)); +- return; ++ return errno; + } + + line = xmalloc (80); +@@ -119,23 +120,25 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) + bootnum = line + sizeof ("Boot") - 1; + bootnum[4] = '\0'; + if (!verbosity) +- grub_util_exec ((const char * []){ "efibootmgr", "-q", ++ rc = grub_util_exec ((const char * []){ "efibootmgr", "-q", + "-b", bootnum, "-B", NULL }); + else +- grub_util_exec ((const char * []){ "efibootmgr", ++ rc = grub_util_exec ((const char * []){ "efibootmgr", + "-b", bootnum, "-B", NULL }); + } + + free (line); ++ return rc; + } + +-void ++int + grub_install_register_efi (grub_device_t efidir_grub_dev, + const char *efifile_path, + const char *efi_distributor) + { + const char * efidir_disk; + int efidir_part; ++ int ret; + efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk); + efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1; + +@@ -151,23 +154,26 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, + grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL }); + #endif + /* Delete old entries from the same distributor. */ +- grub_install_remove_efi_entries_by_distributor (efi_distributor); ++ ret = grub_install_remove_efi_entries_by_distributor (efi_distributor); ++ if (ret) ++ return ret; + + char *efidir_part_str = xasprintf ("%d", efidir_part); + + if (!verbosity) +- grub_util_exec ((const char * []){ "efibootmgr", "-q", ++ ret = grub_util_exec ((const char * []){ "efibootmgr", "-q", + "-c", "-d", efidir_disk, + "-p", efidir_part_str, "-w", + "-L", efi_distributor, "-l", + efifile_path, NULL }); + else +- grub_util_exec ((const char * []){ "efibootmgr", ++ ret = grub_util_exec ((const char * []){ "efibootmgr", + "-c", "-d", efidir_disk, + "-p", efidir_part_str, "-w", + "-L", efi_distributor, "-l", + efifile_path, NULL }); + free (efidir_part_str); ++ return ret; + } + + void +diff --git a/util/grub-install.c b/util/grub-install.c +index 5e4cdfd2b52..690f180c5f6 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -1848,9 +1848,13 @@ main (int argc, char *argv[]) + if (!removable && update_nvram) + { + /* Try to make this image bootable using the EFI Boot Manager, if available. */ +- grub_install_register_efi (efidir_grub_dev, +- "\\System\\Library\\CoreServices", +- efi_distributor); ++ int ret; ++ ret = grub_install_register_efi (efidir_grub_dev, ++ "\\System\\Library\\CoreServices", ++ efi_distributor); ++ if (ret) ++ grub_util_error (_("efibootmgr failed to register the boot entry: %s"), ++ strerror (ret)); + } + + grub_device_close (ins_dev); +@@ -1871,6 +1875,7 @@ main (int argc, char *argv[]) + { + char * efifile_path; + char * part; ++ int ret; + + /* Try to make this image bootable using the EFI Boot Manager, if available. */ + if (!efi_distributor || efi_distributor[0] == '\0') +@@ -1887,8 +1892,11 @@ main (int argc, char *argv[]) + efidir_grub_dev->disk->name, + (part ? ",": ""), (part ? : "")); + grub_free (part); +- grub_install_register_efi (efidir_grub_dev, +- efifile_path, efi_distributor); ++ ret = grub_install_register_efi (efidir_grub_dev, ++ efifile_path, efi_distributor); ++ if (ret) ++ grub_util_error (_("efibootmgr failed to register the boot entry: %s"), ++ strerror (ret)); + } + break; + +diff --git a/include/grub/util/install.h b/include/grub/util/install.h +index 5910b0c09bc..0dba8b67f93 100644 +--- a/include/grub/util/install.h ++++ b/include/grub/util/install.h +@@ -210,7 +210,7 @@ grub_install_create_envblk_file (const char *name); + const char * + grub_install_get_default_x86_platform (void); + +-void ++int + grub_install_register_efi (grub_device_t efidir_grub_dev, + const char *efifile_path, + const char *efi_distributor); diff --git a/0100-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch b/0100-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch new file mode 100644 index 00000000..36e52b9c --- /dev/null +++ b/0100-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch @@ -0,0 +1,70 @@ +From 842c390469e2c2e10b5aa36700324cd3bde25875 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Sat, 17 Feb 2018 06:47:28 -0800 +Subject: [PATCH] x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 + +Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: + +https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a + +x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for +32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as +R_X86_64_PC32. + +Signed-off-by: H.J. Lu +Reviewed-by: Daniel Kiper +--- + grub-core/efiemu/i386/loadcore64.c | 1 + + grub-core/kern/x86_64/dl.c | 1 + + util/grub-mkimagexx.c | 1 + + util/grub-module-verifier.c | 1 + + 4 files changed, 4 insertions(+) + +diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c +index e49d0b6ff17..18facf47fd7 100644 +--- a/grub-core/efiemu/i386/loadcore64.c ++++ b/grub-core/efiemu/i386/loadcore64.c +@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + err = grub_efiemu_write_value (addr, + *addr32 + rel->r_addend + + sym.off +diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c +index 44069067312..3a73e6e6ce2 100644 +--- a/grub-core/kern/x86_64/dl.c ++++ b/grub-core/kern/x86_64/dl.c +@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + { + grub_int64_t value; + value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index a2bb05439f0..39d7efb914a 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + { + grub_uint32_t *t32 = (grub_uint32_t *) target; + *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) +diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c +index 9179285a5ff..a79271f6631 100644 +--- a/util/grub-module-verifier.c ++++ b/util/grub-module-verifier.c +@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { + -1 + }, (int[]){ + R_X86_64_PC32, ++ R_X86_64_PLT32, + -1 + } + }, diff --git a/0101-chainloader-Fix-wrong-break-condition-must-be-AND-no.patch b/0101-chainloader-Fix-wrong-break-condition-must-be-AND-no.patch new file mode 100644 index 00000000..7a3675b3 --- /dev/null +++ b/0101-chainloader-Fix-wrong-break-condition-must-be-AND-no.patch @@ -0,0 +1,133 @@ +From ae2a2745185c08d194775f28588f58ac90ae4351 Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Fri, 23 Feb 2018 22:32:55 +0100 +Subject: [PATCH] chainloader: Fix wrong break condition (must be AND not, OR) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The definition of bpb's num_total_sectors_16 and num_total_sectors_32 +is that either the 16-bit field is non-zero and is used (in which case +eg mkfs.fat sets the 32-bit field to zero), or it is zero and the +32-bit field is used. Therefore, a BPB is invalid only if *both* +fields are zero; having one field as zero and the other as non-zero is +the case to be expected. (Indeed, according to Microsoft's specification +one of the fields *must* be zero, and the other non-zero.) + +This affects all users of grub_chainloader_patch_bpb which are in +chainloader.c, freedos.c, and ntldr.c + +Some descriptions of the semantics of these two fields: + +https://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html + + The old 2-byte fields "total number of sectors" and "number of + sectors per FAT" are now zero; this information is now found in + the new 4-byte fields. + +(Here given in the FAT32 EBPB section but the total sectors 16/32 bit +fields semantic is true of FAT12 and FAT16 too.) + +https://wiki.osdev.org/FAT#BPB_.28BIOS_Parameter_Block.29 + + 19 | 2 | The total sectors in the logical volume. If this value is 0, + it means there are more than 65535 sectors in the volume, and the actual + count is stored in "Large Sectors (bytes 32-35). + + 32 | 4 | Large amount of sector on media. This field is set if there + are more than 65535 sectors in the volume. + +(Doesn't specify what the "large" field is set to when unused, but as +mentioned mkfs.fat sets it to zero then.) + +https://technet.microsoft.com/en-us/library/cc976796.aspx + + 0x13 | WORD | 0x0000 | + Small Sectors . The number of sectors on the volume represented in 16 + bits (< 65,536). For volumes larger than 65,536 sectors, this field + has a value of zero and the Large Sectors field is used instead. + + 0x20 | DWORD | 0x01F03E00 | + Large Sectors . If the value of the Small Sectors field is zero, this + field contains the total number of sectors in the FAT16 volume. If the + value of the Small Sectors field is not zero, the value of this field + is zero. + +https://staff.washington.edu/dittrich/misc/fatgen103.pdf page 10 + + BPB_TotSec16 | 19 | 2 | + This field is the old 16-bit total count of sectors on the volume. + This count includes the count of all sectors in all four regions of the + volume. This field can be 0; if it is 0, then BPB_TotSec32 must be + non-zero. For FAT32 volumes, this field must be 0. For FAT12 and + FAT16 volumes, this field contains the sector count, and + BPB_TotSec32 is 0 if the total sector count “fits” (is less than + 0x10000). + + BPB_TotSec32 | 32 | 4 | + This field is the new 32-bit total count of sectors on the volume. + This count includes the count of all sectors in all four regions of the + volume. This field can be 0; if it is 0, then BPB_TotSec16 must be + non-zero. For FAT32 volumes, this field must be non-zero. For + FAT12/FAT16 volumes, this field contains the sector count if + BPB_TotSec16 is 0 (count is greater than or equal to 0x10000). + +(This specifies that an unused BPB_TotSec32 field is set to zero.) + +By the way fix offsets in include/grub/fat.h. + +Tested with lDebug booted in qemu via grub2's +FreeDOS direct loading support, refer to +https://bitbucket.org/ecm/ldosboot + https://bitbucket.org/ecm/ldebug + +Signed-off-by: C. Masloch +Reviewed-by: Daniel Kiper +--- + grub-core/loader/i386/pc/chainloader.c | 2 +- + include/grub/fat.h | 17 ++++++----------- + 2 files changed, 7 insertions(+), 12 deletions(-) + +diff --git a/grub-core/loader/i386/pc/chainloader.c b/grub-core/loader/i386/pc/chainloader.c +index c79c4fe0fc9..18220b7aaab 100644 +--- a/grub-core/loader/i386/pc/chainloader.c ++++ b/grub-core/loader/i386/pc/chainloader.c +@@ -117,7 +117,7 @@ grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) + + if (bpb->num_reserved_sectors == 0) + break; +- if (bpb->num_total_sectors_16 == 0 || bpb->num_total_sectors_32 == 0) ++ if (bpb->num_total_sectors_16 == 0 && bpb->num_total_sectors_32 == 0) + break; + + if (bpb->num_fats == 0) +diff --git a/include/grub/fat.h b/include/grub/fat.h +index 4a5aab79346..8d7e4a1e54d 100644 +--- a/include/grub/fat.h ++++ b/include/grub/fat.h +@@ -28,20 +28,15 @@ struct grub_fat_bpb + grub_uint16_t bytes_per_sector; + grub_uint8_t sectors_per_cluster; + grub_uint16_t num_reserved_sectors; +- grub_uint8_t num_fats; +- /* 0x10 */ ++ grub_uint8_t num_fats; /* 0x10 */ + grub_uint16_t num_root_entries; + grub_uint16_t num_total_sectors_16; +- grub_uint8_t media; +- /*0 x15 */ ++ grub_uint8_t media; /* 0x15 */ + grub_uint16_t sectors_per_fat_16; +- grub_uint16_t sectors_per_track; +- /*0 x19 */ +- grub_uint16_t num_heads; +- /*0 x1b */ +- grub_uint32_t num_hidden_sectors; +- /* 0x1f */ +- grub_uint32_t num_total_sectors_32; ++ grub_uint16_t sectors_per_track; /* 0x18 */ ++ grub_uint16_t num_heads; /* 0x1A */ ++ grub_uint32_t num_hidden_sectors; /* 0x1C */ ++ grub_uint32_t num_total_sectors_32; /* 0x20 */ + union + { + struct diff --git a/0102-ieee1275-add-nvme-support-within-ofpath.patch b/0102-ieee1275-add-nvme-support-within-ofpath.patch new file mode 100644 index 00000000..60f2b74e --- /dev/null +++ b/0102-ieee1275-add-nvme-support-within-ofpath.patch @@ -0,0 +1,85 @@ +From 2391d579094cfab65a0fd89a3c617cb3a33fb715 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Tue, 20 Feb 2018 09:57:14 -0800 +Subject: [PATCH] ieee1275: add nvme support within ofpath + +Add NVMe support within ofpath. + +The Open Firmware text representation for a NVMe device contains the +Namespace ID. An invalid namespace ID is one whose value is zero or whose +value is greater than the value reported by the Number of Namespaces (NN) +field in the Identify Controller data structure. At the moment only a +single Namespace is supported, therefore the value is currently hard coded +to one. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/linux/ofpath.c | 47 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 8d7d6837f26..4308fceda35 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -350,6 +350,50 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi + return ret; + } + ++static char * ++of_path_of_nvme(const char *sys_devname __attribute__((unused)), ++ const char *device, ++ const char *devnode __attribute__((unused)), ++ const char *devicenode) ++{ ++ char *sysfs_path, *of_path, disk[MAX_DISK_CAT]; ++ const char *digit_string, *part_end; ++ ++ digit_string = trailing_digits (device); ++ part_end = devicenode + strlen (devicenode) - 1; ++ ++ if ((digit_string != '\0') && (*part_end == 'p')) ++ { ++ /* We have a partition number, strip it off. */ ++ int part; ++ char *nvmedev, *end; ++ ++ nvmedev = strdup (devicenode); ++ ++ if (!nvmedev) ++ return NULL; ++ ++ end = nvmedev + strlen (nvmedev) - 1; ++ /* Remove the p. */ ++ *end = '\0'; ++ sscanf (digit_string, "%d", &part); ++ snprintf (disk, sizeof (disk), "/disk@1:%c", 'a' + (part - 1)); ++ sysfs_path = block_device_get_sysfs_path_and_link (nvmedev); ++ free (nvmedev); ++ } ++ else ++ { ++ /* We do not have the parition. */ ++ snprintf (disk, sizeof (disk), "/disk@1"); ++ sysfs_path = block_device_get_sysfs_path_and_link (device); ++ } ++ ++ of_path = find_obppath (sysfs_path); ++ free (sysfs_path); ++ strcat (of_path, disk); ++ return of_path; ++} ++ + static int + vendor_is_ATA(const char *path) + { +@@ -681,6 +725,9 @@ grub_util_devname_to_ofpath (const char *sys_devname) + /* All the models I've seen have a devalias "floppy". + New models have no floppy at all. */ + ofpath = xstrdup ("floppy"); ++ else if (device[0] == 'n' && device[1] == 'v' && device[2] == 'm' ++ && device[3] == 'e') ++ ofpath = of_path_of_nvme (name_buf, device, devnode, devicenode); + else + { + grub_util_warn (_("unknown device type %s"), device); diff --git a/0103-libgcrypt-Import-replacement-CRC-operations.patch b/0103-libgcrypt-Import-replacement-CRC-operations.patch new file mode 100644 index 00000000..790cdac1 --- /dev/null +++ b/0103-libgcrypt-Import-replacement-CRC-operations.patch @@ -0,0 +1,1373 @@ +From e5ba6b26181b8e3ffb09232a935a60e3b733bfac Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Sun, 11 Feb 2018 00:18:12 +0000 +Subject: [PATCH] libgcrypt: Import replacement CRC operations + +The CRC implementation imported from libgcrypt 1.5.3 is arguably +non-free, due to being encumbered by the restrictive Internet Society +licence on RFCs (see e.g. https://wiki.debian.org/NonFreeIETFDocuments). +Fortunately, libgcrypt has since replaced it with a version that is both +reportedly better-optimised and doesn't suffer from this encumbrance. + +The ideal solution would be to update to a new version of libgcrypt, and +I spent some time trying to do that. However, util/import_gcry.py +requires complex modifications to cope with the new version, and I +stalled part-way through; furthermore, GRUB's libgcrypt tree already +contains some backports of upstream changes. Rather than allowing the +perfect to be the enemy of the good, I think it's best to backport this +single change to at least sort out the licensing situation. Doing so +won't make things any harder for a future wholesale upgrade. + +This commit is mostly a straightforward backport of +https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commitdiff;h=06e122baa3321483a47bbf82fd2a4540becfa0c9, +but I also imported bufhelp.h from libgcrypt 1.7.0 (newer versions +required further changes elsewhere). + +I've tested that "hashsum -h crc32" still produces correct output for a +variety of files on both i386-pc and x86_64-emu targets. + +Signed-off-by: Colin Watson +Reviewed-by: Daniel Kiper +--- + grub-core/lib/libgcrypt/cipher/crc.c | 821 +++++++++++++++++++++++++------ + grub-core/lib/libgcrypt/cipher/bufhelp.h | 432 ++++++++++++++++ + 2 files changed, 1091 insertions(+), 162 deletions(-) + create mode 100644 grub-core/lib/libgcrypt/cipher/bufhelp.h + +diff --git a/grub-core/lib/libgcrypt/cipher/crc.c b/grub-core/lib/libgcrypt/cipher/crc.c +index 9e406f1b19b..28454f8ab72 100644 +--- a/grub-core/lib/libgcrypt/cipher/crc.c ++++ b/grub-core/lib/libgcrypt/cipher/crc.c +@@ -28,116 +28,8 @@ + #include "cipher.h" + + #include "bithelp.h" ++#include "bufhelp.h" + +-/* Table of CRCs of all 8-bit messages. Generated by running code +- from RFC 1952 modified to print out the table. */ +-static u32 crc32_table[256] = { +- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, +- 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, +- 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, +- 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, +- 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, +- 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, +- 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, +- 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, +- 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, +- 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, +- 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, +- 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, +- 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, +- 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, +- 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, +- 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, +- 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, +- 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, +- 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, +- 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, +- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, +- 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, +- 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, +- 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, +- 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, +- 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, +- 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, +- 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, +- 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, +- 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, +- 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, +- 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, +- 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, +- 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, +- 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, +- 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, +- 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, +- 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, +- 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, +- 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, +- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, +- 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, +- 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +-}; +- +-/* +- * The following function was extracted from RFC 1952 by Simon +- * Josefsson, for the Shishi project, and modified to be compatible +- * with the modified CRC-32 used by RFC 1510, and subsequently +- * modified for GNU Libgcrypt to allow it to be used for calculating +- * both unmodified CRC-32 and modified CRC-32 values. Original +- * copyright and notice from the document follows: +- * +- * Copyright (c) 1996 L. Peter Deutsch +- * +- * Permission is granted to copy and distribute this document for +- * any purpose and without charge, including translations into +- * other languages and incorporation into compilations, provided +- * that the copyright notice and this notice are preserved, and +- * that any substantive changes or deletions from the original are +- * clearly marked. +- * +- * The copyright on RFCs, and consequently the function below, are +- * supposedly also retroactively claimed by the Internet Society +- * (according to rfc-editor@rfc-editor.org), with the following +- * copyright notice: +- * +- * Copyright (C) The Internet Society. All Rights Reserved. +- * +- * This document and translations of it may be copied and furnished +- * to others, and derivative works that comment on or otherwise +- * explain it or assist in its implementation may be prepared, +- * copied, published and distributed, in whole or in part, without +- * restriction of any kind, provided that the above copyright +- * notice and this paragraph are included on all such copies and +- * derivative works. However, this document itself may not be +- * modified in any way, such as by removing the copyright notice or +- * references to the Internet Society or other Internet +- * organizations, except as needed for the purpose of developing +- * Internet standards in which case the procedures for copyrights +- * defined in the Internet Standards process must be followed, or +- * as required to translate it into languages other than English. +- * +- * The limited permissions granted above are perpetual and will not be +- * revoked by the Internet Society or its successors or assigns. +- * +- * This document and the information contained herein is provided +- * on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET +- * ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE +- * OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY +- * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A +- * PARTICULAR PURPOSE. +- * +- */ +-static u32 +-update_crc32 (u32 crc, const void *buf_arg, size_t len) +-{ +- const char *buf = buf_arg; +- size_t n; +- +- for (n = 0; n < len; n++) +- crc = crc32_table[(crc ^ buf[n]) & 0xff] ^ (crc >> 8); +- +- return crc; +-} + + typedef struct + { +@@ -146,8 +38,302 @@ typedef struct + } + CRC_CONTEXT; + ++ ++/* ++ * Code generated by universal_crc by Danjel McGougan ++ * ++ * CRC parameters used: ++ * bits: 32 ++ * poly: 0x04c11db7 ++ * init: 0xffffffff ++ * xor: 0xffffffff ++ * reverse: true ++ * non-direct: false ++ * ++ * CRC of the string "123456789" is 0xcbf43926 ++ */ ++ ++static const u32 crc32_table[1024] = { ++ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, ++ 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, ++ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, ++ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, ++ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, ++ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, ++ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, ++ 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, ++ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, ++ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, ++ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, ++ 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, ++ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, ++ 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, ++ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, ++ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, ++ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, ++ 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, ++ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, ++ 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, ++ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, ++ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, ++ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, ++ 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, ++ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, ++ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, ++ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, ++ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, ++ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, ++ 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, ++ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, ++ 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, ++ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, ++ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, ++ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, ++ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, ++ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, ++ 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, ++ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, ++ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, ++ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, ++ 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, ++ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, ++ 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, ++ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, ++ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, ++ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, ++ 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, ++ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, ++ 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, ++ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, ++ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, ++ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, ++ 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, ++ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, ++ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, ++ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, ++ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, ++ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, ++ 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, ++ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, ++ 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, ++ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, ++ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, ++ 0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, ++ 0x646cc504, 0x7d77f445, 0x565aa786, 0x4f4196c7, ++ 0xc8d98a08, 0xd1c2bb49, 0xfaefe88a, 0xe3f4d9cb, ++ 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, 0x87981ccf, ++ 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, ++ 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, ++ 0x821b9859, 0x9b00a918, 0xb02dfadb, 0xa936cb9a, ++ 0xe6775d5d, 0xff6c6c1c, 0xd4413fdf, 0xcd5a0e9e, ++ 0x958424a2, 0x8c9f15e3, 0xa7b24620, 0xbea97761, ++ 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, ++ 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, ++ 0x39316bae, 0x202a5aef, 0x0b07092c, 0x121c386d, ++ 0xdf4636f3, 0xc65d07b2, 0xed705471, 0xf46b6530, ++ 0xbb2af3f7, 0xa231c2b6, 0x891c9175, 0x9007a034, ++ 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, ++ 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, ++ 0xf0794f05, 0xe9627e44, 0xc24f2d87, 0xdb541cc6, ++ 0x94158a01, 0x8d0ebb40, 0xa623e883, 0xbf38d9c2, ++ 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, 0x138d96ce, ++ 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, ++ 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, ++ 0xded79850, 0xc7cca911, 0xece1fad2, 0xf5facb93, ++ 0x7262d75c, 0x6b79e61d, 0x4054b5de, 0x594f849f, ++ 0x160e1258, 0x0f152319, 0x243870da, 0x3d23419b, ++ 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, ++ 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, ++ 0xad24e1af, 0xb43fd0ee, 0x9f12832d, 0x8609b26c, ++ 0xc94824ab, 0xd05315ea, 0xfb7e4629, 0xe2657768, ++ 0x2f3f79f6, 0x362448b7, 0x1d091b74, 0x04122a35, ++ 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, ++ 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, ++ 0x838a36fa, 0x9a9107bb, 0xb1bc5478, 0xa8a76539, ++ 0x3b83984b, 0x2298a90a, 0x09b5fac9, 0x10aecb88, ++ 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, 0x74c20e8c, ++ 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, ++ 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, ++ 0x71418a1a, 0x685abb5b, 0x4377e898, 0x5a6cd9d9, ++ 0x152d4f1e, 0x0c367e5f, 0x271b2d9c, 0x3e001cdd, ++ 0xb9980012, 0xa0833153, 0x8bae6290, 0x92b553d1, ++ 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, ++ 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, ++ 0xca6b79ed, 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, ++ 0x66de36e1, 0x7fc507a0, 0x54e85463, 0x4df36522, ++ 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, 0x299fa026, ++ 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, ++ 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, ++ 0x2c1c24b0, 0x350715f1, 0x1e2a4632, 0x07317773, ++ 0x4870e1b4, 0x516bd0f5, 0x7a468336, 0x635db277, ++ 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, 0xe0d7848d, ++ 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, ++ 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, ++ 0x674f9842, 0x7e54a903, 0x5579fac0, 0x4c62cb81, ++ 0x8138c51f, 0x9823f45e, 0xb30ea79d, 0xaa1596dc, ++ 0xe554001b, 0xfc4f315a, 0xd7626299, 0xce7953d8, ++ 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, ++ 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, ++ 0x5e7ef3ec, 0x4765c2ad, 0x6c48916e, 0x7553a02f, ++ 0x3a1236e8, 0x230907a9, 0x0824546a, 0x113f652b, ++ 0x96a779e4, 0x8fbc48a5, 0xa4911b66, 0xbd8a2a27, ++ 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, ++ 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, ++ 0x70d024b9, 0x69cb15f8, 0x42e6463b, 0x5bfd777a, ++ 0xdc656bb5, 0xc57e5af4, 0xee530937, 0xf7483876, ++ 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, 0x9324fd72, ++ 0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, ++ 0x0709a8dc, 0x06cbc2eb, 0x048d7cb2, 0x054f1685, ++ 0x0e1351b8, 0x0fd13b8f, 0x0d9785d6, 0x0c55efe1, ++ 0x091af964, 0x08d89353, 0x0a9e2d0a, 0x0b5c473d, ++ 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, ++ 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, ++ 0x1235f2c8, 0x13f798ff, 0x11b126a6, 0x10734c91, ++ 0x153c5a14, 0x14fe3023, 0x16b88e7a, 0x177ae44d, ++ 0x384d46e0, 0x398f2cd7, 0x3bc9928e, 0x3a0bf8b9, ++ 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, ++ 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, ++ 0x3157bf84, 0x3095d5b3, 0x32d36bea, 0x331101dd, ++ 0x246be590, 0x25a98fa7, 0x27ef31fe, 0x262d5bc9, ++ 0x23624d4c, 0x22a0277b, 0x20e69922, 0x2124f315, ++ 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, ++ 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, ++ 0x709a8dc0, 0x7158e7f7, 0x731e59ae, 0x72dc3399, ++ 0x7793251c, 0x76514f2b, 0x7417f172, 0x75d59b45, ++ 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, 0x7ccf6221, ++ 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, ++ 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, ++ 0x6bb5866c, 0x6a77ec5b, 0x68315202, 0x69f33835, ++ 0x62af7f08, 0x636d153f, 0x612bab66, 0x60e9c151, ++ 0x65a6d7d4, 0x6464bde3, 0x662203ba, 0x67e0698d, ++ 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, ++ 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, ++ 0x46c49a98, 0x4706f0af, 0x45404ef6, 0x448224c1, ++ 0x41cd3244, 0x400f5873, 0x4249e62a, 0x438b8c1d, ++ 0x54f16850, 0x55330267, 0x5775bc3e, 0x56b7d609, ++ 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, ++ 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, ++ 0x5deb9134, 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, ++ 0xe1351b80, 0xe0f771b7, 0xe2b1cfee, 0xe373a5d9, ++ 0xe63cb35c, 0xe7fed96b, 0xe5b86732, 0xe47a0d05, ++ 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, ++ 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, ++ 0xfd13b8f0, 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, ++ 0xfa1a102c, 0xfbd87a1b, 0xf99ec442, 0xf85cae75, ++ 0xf300e948, 0xf2c2837f, 0xf0843d26, 0xf1465711, ++ 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, ++ 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, ++ 0xde71f5bc, 0xdfb39f8b, 0xddf521d2, 0xdc374be5, ++ 0xd76b0cd8, 0xd6a966ef, 0xd4efd8b6, 0xd52db281, ++ 0xd062a404, 0xd1a0ce33, 0xd3e6706a, 0xd2241a5d, ++ 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, ++ 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, ++ 0xcb4dafa8, 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, ++ 0xcc440774, 0xcd866d43, 0xcfc0d31a, 0xce02b92d, ++ 0x91af9640, 0x906dfc77, 0x922b422e, 0x93e92819, ++ 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, ++ 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, ++ 0x98b56f24, 0x99770513, 0x9b31bb4a, 0x9af3d17d, ++ 0x8d893530, 0x8c4b5f07, 0x8e0de15e, 0x8fcf8b69, ++ 0x8a809dec, 0x8b42f7db, 0x89044982, 0x88c623b5, ++ 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, ++ 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, ++ 0xa9e2d0a0, 0xa820ba97, 0xaa6604ce, 0xaba46ef9, ++ 0xaeeb787c, 0xaf29124b, 0xad6fac12, 0xacadc625, ++ 0xa7f18118, 0xa633eb2f, 0xa4755576, 0xa5b73f41, ++ 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, ++ 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, ++ 0xb2cddb0c, 0xb30fb13b, 0xb1490f62, 0xb08b6555, ++ 0xbbd72268, 0xba15485f, 0xb853f606, 0xb9919c31, ++ 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, 0xbe9834ed, ++ 0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, ++ 0x8f629757, 0x37def032, 0x256b5fdc, 0x9dd738b9, ++ 0xc5b428ef, 0x7d084f8a, 0x6fbde064, 0xd7018701, ++ 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, 0x58631056, ++ 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, ++ 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, ++ 0x95ad7f70, 0x2d111815, 0x3fa4b7fb, 0x8718d09e, ++ 0x1acfe827, 0xa2738f42, 0xb0c620ac, 0x087a47c9, ++ 0xa032af3e, 0x188ec85b, 0x0a3b67b5, 0xb28700d0, ++ 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, ++ 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, ++ 0xeae41086, 0x525877e3, 0x40edd80d, 0xf851bf68, ++ 0xf02bf8a1, 0x48979fc4, 0x5a22302a, 0xe29e574f, ++ 0x7f496ff6, 0xc7f50893, 0xd540a77d, 0x6dfcc018, ++ 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, ++ 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, ++ 0x9b14583d, 0x23a83f58, 0x311d90b6, 0x89a1f7d3, ++ 0x1476cf6a, 0xaccaa80f, 0xbe7f07e1, 0x06c36084, ++ 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, 0x4c15df3c, ++ 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, ++ 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, ++ 0x446f98f5, 0xfcd3ff90, 0xee66507e, 0x56da371b, ++ 0x0eb9274d, 0xb6054028, 0xa4b0efc6, 0x1c0c88a3, ++ 0x81dbb01a, 0x3967d77f, 0x2bd27891, 0x936e1ff4, ++ 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, ++ 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, ++ 0xfe92dfec, 0x462eb889, 0x549b1767, 0xec277002, ++ 0x71f048bb, 0xc94c2fde, 0xdbf98030, 0x6345e755, ++ 0x6b3fa09c, 0xd383c7f9, 0xc1366817, 0x798a0f72, ++ 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, ++ 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, ++ 0x21e91f24, 0x99557841, 0x8be0d7af, 0x335cb0ca, ++ 0xed59b63b, 0x55e5d15e, 0x47507eb0, 0xffec19d5, ++ 0x623b216c, 0xda874609, 0xc832e9e7, 0x708e8e82, ++ 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, ++ 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, ++ 0xbd40e1a4, 0x05fc86c1, 0x1749292f, 0xaff54e4a, ++ 0x322276f3, 0x8a9e1196, 0x982bbe78, 0x2097d91d, ++ 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, 0x6a4166a5, ++ 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, ++ 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, ++ 0xc2098e52, 0x7ab5e937, 0x680046d9, 0xd0bc21bc, ++ 0x88df31ea, 0x3063568f, 0x22d6f961, 0x9a6a9e04, ++ 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, 0x15080953, ++ 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, ++ 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, ++ 0xd8c66675, 0x607a0110, 0x72cfaefe, 0xca73c99b, ++ 0x57a4f122, 0xef189647, 0xfdad39a9, 0x45115ecc, ++ 0x764dee06, 0xcef18963, 0xdc44268d, 0x64f841e8, ++ 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, ++ 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, ++ 0x3c9b51be, 0x842736db, 0x96929935, 0x2e2efe50, ++ 0x2654b999, 0x9ee8defc, 0x8c5d7112, 0x34e11677, ++ 0xa9362ece, 0x118a49ab, 0x033fe645, 0xbb838120, ++ 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, ++ 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, ++ 0xd67f4138, 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, ++ 0x591dd66f, 0xe1a1b10a, 0xf3141ee4, 0x4ba87981, ++ 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, 0x017ec639, ++ 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, ++ 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, ++ 0x090481f0, 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, ++ 0x43d23e48, 0xfb6e592d, 0xe9dbf6c3, 0x516791a6, ++ 0xccb0a91f, 0x740cce7a, 0x66b96194, 0xde0506f1 ++}; ++ + /* CRC32 */ + ++static inline u32 ++crc32_next (u32 crc, byte data) ++{ ++ return (crc >> 8) ^ crc32_table[(crc & 0xff) ^ data]; ++} ++ ++/* ++ * Process 4 bytes in one go ++ */ ++static inline u32 ++crc32_next4 (u32 crc, u32 data) ++{ ++ crc ^= data; ++ crc = crc32_table[(crc & 0xff) + 0x300] ^ ++ crc32_table[((crc >> 8) & 0xff) + 0x200] ^ ++ crc32_table[((crc >> 16) & 0xff) + 0x100] ^ ++ crc32_table[(crc >> 24) & 0xff]; ++ return crc; ++} ++ + static void + crc32_init (void *context) + { +@@ -156,12 +342,40 @@ crc32_init (void *context) + } + + static void +-crc32_write (void *context, const void *inbuf, size_t inlen) ++crc32_write (void *context, const void *inbuf_arg, size_t inlen) + { + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; +- if (!inbuf) ++ const byte *inbuf = inbuf_arg; ++ u32 crc; ++ ++ if (!inbuf || !inlen) + return; +- ctx->CRC = update_crc32 (ctx->CRC, inbuf, inlen); ++ ++ crc = ctx->CRC; ++ ++ while (inlen >= 16) ++ { ++ inlen -= 16; ++ crc = crc32_next4(crc, buf_get_le32(&inbuf[0])); ++ crc = crc32_next4(crc, buf_get_le32(&inbuf[4])); ++ crc = crc32_next4(crc, buf_get_le32(&inbuf[8])); ++ crc = crc32_next4(crc, buf_get_le32(&inbuf[12])); ++ inbuf += 16; ++ } ++ ++ while (inlen >= 4) ++ { ++ inlen -= 4; ++ crc = crc32_next4(crc, buf_get_le32(inbuf)); ++ inbuf += 4; ++ } ++ ++ while (inlen--) ++ { ++ crc = crc32_next(crc, *inbuf++); ++ } ++ ++ ctx->CRC = crc; + } + + static byte * +@@ -176,13 +390,12 @@ crc32_final (void *context) + { + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; + ctx->CRC ^= 0xffffffffL; +- ctx->buf[0] = (ctx->CRC >> 24) & 0xFF; +- ctx->buf[1] = (ctx->CRC >> 16) & 0xFF; +- ctx->buf[2] = (ctx->CRC >> 8) & 0xFF; +- ctx->buf[3] = (ctx->CRC ) & 0xFF; ++ buf_put_be32 (ctx->buf, ctx->CRC); + } + + /* CRC32 a'la RFC 1510 */ ++/* CRC of the string "123456789" is 0x2dfd2d88 */ ++ + static void + crc32rfc1510_init (void *context) + { +@@ -194,82 +407,366 @@ static void + crc32rfc1510_final (void *context) + { + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; +- ctx->buf[0] = (ctx->CRC >> 24) & 0xFF; +- ctx->buf[1] = (ctx->CRC >> 16) & 0xFF; +- ctx->buf[2] = (ctx->CRC >> 8) & 0xFF; +- ctx->buf[3] = (ctx->CRC ) & 0xFF; ++ buf_put_be32(ctx->buf, ctx->CRC); + } + + /* CRC24 a'la RFC 2440 */ + /* +- * The following CRC 24 routines are adapted from RFC 2440, which has +- * the following copyright notice: ++ * Code generated by universal_crc by Danjel McGougan + * +- * Copyright (C) The Internet Society (1998). All Rights Reserved. ++ * CRC parameters used: ++ * bits: 24 ++ * poly: 0x864cfb ++ * init: 0xb704ce ++ * xor: 0x000000 ++ * reverse: false ++ * non-direct: false + * +- * This document and translations of it may be copied and furnished +- * to others, and derivative works that comment on or otherwise +- * explain it or assist in its implementation may be prepared, +- * copied, published and distributed, in whole or in part, without +- * restriction of any kind, provided that the above copyright notice +- * and this paragraph are included on all such copies and derivative +- * works. However, this document itself may not be modified in any +- * way, such as by removing the copyright notice or references to +- * the Internet Society or other Internet organizations, except as +- * needed for the purpose of developing Internet standards in which +- * case the procedures for copyrights defined in the Internet +- * Standards process must be followed, or as required to translate +- * it into languages other than English. +- * +- * The limited permissions granted above are perpetual and will not be +- * revoked by the Internet Society or its successors or assigns. +- * +- * This document and the information contained herein is provided on +- * an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET +- * ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE +- * OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY +- * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR +- * PURPOSE. ++ * CRC of the string "123456789" is 0x21cf02 ++ */ ++ ++static const u32 crc24_table[1024] = ++{ ++ 0x00000000, 0x00fb4c86, 0x000dd58a, 0x00f6990c, ++ 0x00e1e693, 0x001aaa15, 0x00ec3319, 0x00177f9f, ++ 0x003981a1, 0x00c2cd27, 0x0034542b, 0x00cf18ad, ++ 0x00d86732, 0x00232bb4, 0x00d5b2b8, 0x002efe3e, ++ 0x00894ec5, 0x00720243, 0x00849b4f, 0x007fd7c9, ++ 0x0068a856, 0x0093e4d0, 0x00657ddc, 0x009e315a, ++ 0x00b0cf64, 0x004b83e2, 0x00bd1aee, 0x00465668, ++ 0x005129f7, 0x00aa6571, 0x005cfc7d, 0x00a7b0fb, ++ 0x00e9d10c, 0x00129d8a, 0x00e40486, 0x001f4800, ++ 0x0008379f, 0x00f37b19, 0x0005e215, 0x00feae93, ++ 0x00d050ad, 0x002b1c2b, 0x00dd8527, 0x0026c9a1, ++ 0x0031b63e, 0x00cafab8, 0x003c63b4, 0x00c72f32, ++ 0x00609fc9, 0x009bd34f, 0x006d4a43, 0x009606c5, ++ 0x0081795a, 0x007a35dc, 0x008cacd0, 0x0077e056, ++ 0x00591e68, 0x00a252ee, 0x0054cbe2, 0x00af8764, ++ 0x00b8f8fb, 0x0043b47d, 0x00b52d71, 0x004e61f7, ++ 0x00d2a319, 0x0029ef9f, 0x00df7693, 0x00243a15, ++ 0x0033458a, 0x00c8090c, 0x003e9000, 0x00c5dc86, ++ 0x00eb22b8, 0x00106e3e, 0x00e6f732, 0x001dbbb4, ++ 0x000ac42b, 0x00f188ad, 0x000711a1, 0x00fc5d27, ++ 0x005beddc, 0x00a0a15a, 0x00563856, 0x00ad74d0, ++ 0x00ba0b4f, 0x004147c9, 0x00b7dec5, 0x004c9243, ++ 0x00626c7d, 0x009920fb, 0x006fb9f7, 0x0094f571, ++ 0x00838aee, 0x0078c668, 0x008e5f64, 0x007513e2, ++ 0x003b7215, 0x00c03e93, 0x0036a79f, 0x00cdeb19, ++ 0x00da9486, 0x0021d800, 0x00d7410c, 0x002c0d8a, ++ 0x0002f3b4, 0x00f9bf32, 0x000f263e, 0x00f46ab8, ++ 0x00e31527, 0x001859a1, 0x00eec0ad, 0x00158c2b, ++ 0x00b23cd0, 0x00497056, 0x00bfe95a, 0x0044a5dc, ++ 0x0053da43, 0x00a896c5, 0x005e0fc9, 0x00a5434f, ++ 0x008bbd71, 0x0070f1f7, 0x008668fb, 0x007d247d, ++ 0x006a5be2, 0x00911764, 0x00678e68, 0x009cc2ee, ++ 0x00a44733, 0x005f0bb5, 0x00a992b9, 0x0052de3f, ++ 0x0045a1a0, 0x00beed26, 0x0048742a, 0x00b338ac, ++ 0x009dc692, 0x00668a14, 0x00901318, 0x006b5f9e, ++ 0x007c2001, 0x00876c87, 0x0071f58b, 0x008ab90d, ++ 0x002d09f6, 0x00d64570, 0x0020dc7c, 0x00db90fa, ++ 0x00ccef65, 0x0037a3e3, 0x00c13aef, 0x003a7669, ++ 0x00148857, 0x00efc4d1, 0x00195ddd, 0x00e2115b, ++ 0x00f56ec4, 0x000e2242, 0x00f8bb4e, 0x0003f7c8, ++ 0x004d963f, 0x00b6dab9, 0x004043b5, 0x00bb0f33, ++ 0x00ac70ac, 0x00573c2a, 0x00a1a526, 0x005ae9a0, ++ 0x0074179e, 0x008f5b18, 0x0079c214, 0x00828e92, ++ 0x0095f10d, 0x006ebd8b, 0x00982487, 0x00636801, ++ 0x00c4d8fa, 0x003f947c, 0x00c90d70, 0x003241f6, ++ 0x00253e69, 0x00de72ef, 0x0028ebe3, 0x00d3a765, ++ 0x00fd595b, 0x000615dd, 0x00f08cd1, 0x000bc057, ++ 0x001cbfc8, 0x00e7f34e, 0x00116a42, 0x00ea26c4, ++ 0x0076e42a, 0x008da8ac, 0x007b31a0, 0x00807d26, ++ 0x009702b9, 0x006c4e3f, 0x009ad733, 0x00619bb5, ++ 0x004f658b, 0x00b4290d, 0x0042b001, 0x00b9fc87, ++ 0x00ae8318, 0x0055cf9e, 0x00a35692, 0x00581a14, ++ 0x00ffaaef, 0x0004e669, 0x00f27f65, 0x000933e3, ++ 0x001e4c7c, 0x00e500fa, 0x001399f6, 0x00e8d570, ++ 0x00c62b4e, 0x003d67c8, 0x00cbfec4, 0x0030b242, ++ 0x0027cddd, 0x00dc815b, 0x002a1857, 0x00d154d1, ++ 0x009f3526, 0x006479a0, 0x0092e0ac, 0x0069ac2a, ++ 0x007ed3b5, 0x00859f33, 0x0073063f, 0x00884ab9, ++ 0x00a6b487, 0x005df801, 0x00ab610d, 0x00502d8b, ++ 0x00475214, 0x00bc1e92, 0x004a879e, 0x00b1cb18, ++ 0x00167be3, 0x00ed3765, 0x001bae69, 0x00e0e2ef, ++ 0x00f79d70, 0x000cd1f6, 0x00fa48fa, 0x0001047c, ++ 0x002ffa42, 0x00d4b6c4, 0x00222fc8, 0x00d9634e, ++ 0x00ce1cd1, 0x00355057, 0x00c3c95b, 0x003885dd, ++ 0x00000000, 0x00488f66, 0x00901ecd, 0x00d891ab, ++ 0x00db711c, 0x0093fe7a, 0x004b6fd1, 0x0003e0b7, ++ 0x00b6e338, 0x00fe6c5e, 0x0026fdf5, 0x006e7293, ++ 0x006d9224, 0x00251d42, 0x00fd8ce9, 0x00b5038f, ++ 0x006cc771, 0x00244817, 0x00fcd9bc, 0x00b456da, ++ 0x00b7b66d, 0x00ff390b, 0x0027a8a0, 0x006f27c6, ++ 0x00da2449, 0x0092ab2f, 0x004a3a84, 0x0002b5e2, ++ 0x00015555, 0x0049da33, 0x00914b98, 0x00d9c4fe, ++ 0x00d88ee3, 0x00900185, 0x0048902e, 0x00001f48, ++ 0x0003ffff, 0x004b7099, 0x0093e132, 0x00db6e54, ++ 0x006e6ddb, 0x0026e2bd, 0x00fe7316, 0x00b6fc70, ++ 0x00b51cc7, 0x00fd93a1, 0x0025020a, 0x006d8d6c, ++ 0x00b44992, 0x00fcc6f4, 0x0024575f, 0x006cd839, ++ 0x006f388e, 0x0027b7e8, 0x00ff2643, 0x00b7a925, ++ 0x0002aaaa, 0x004a25cc, 0x0092b467, 0x00da3b01, ++ 0x00d9dbb6, 0x009154d0, 0x0049c57b, 0x00014a1d, ++ 0x004b5141, 0x0003de27, 0x00db4f8c, 0x0093c0ea, ++ 0x0090205d, 0x00d8af3b, 0x00003e90, 0x0048b1f6, ++ 0x00fdb279, 0x00b53d1f, 0x006dacb4, 0x002523d2, ++ 0x0026c365, 0x006e4c03, 0x00b6dda8, 0x00fe52ce, ++ 0x00279630, 0x006f1956, 0x00b788fd, 0x00ff079b, ++ 0x00fce72c, 0x00b4684a, 0x006cf9e1, 0x00247687, ++ 0x00917508, 0x00d9fa6e, 0x00016bc5, 0x0049e4a3, ++ 0x004a0414, 0x00028b72, 0x00da1ad9, 0x009295bf, ++ 0x0093dfa2, 0x00db50c4, 0x0003c16f, 0x004b4e09, ++ 0x0048aebe, 0x000021d8, 0x00d8b073, 0x00903f15, ++ 0x00253c9a, 0x006db3fc, 0x00b52257, 0x00fdad31, ++ 0x00fe4d86, 0x00b6c2e0, 0x006e534b, 0x0026dc2d, ++ 0x00ff18d3, 0x00b797b5, 0x006f061e, 0x00278978, ++ 0x002469cf, 0x006ce6a9, 0x00b47702, 0x00fcf864, ++ 0x0049fbeb, 0x0001748d, 0x00d9e526, 0x00916a40, ++ 0x00928af7, 0x00da0591, 0x0002943a, 0x004a1b5c, ++ 0x0096a282, 0x00de2de4, 0x0006bc4f, 0x004e3329, ++ 0x004dd39e, 0x00055cf8, 0x00ddcd53, 0x00954235, ++ 0x002041ba, 0x0068cedc, 0x00b05f77, 0x00f8d011, ++ 0x00fb30a6, 0x00b3bfc0, 0x006b2e6b, 0x0023a10d, ++ 0x00fa65f3, 0x00b2ea95, 0x006a7b3e, 0x0022f458, ++ 0x002114ef, 0x00699b89, 0x00b10a22, 0x00f98544, ++ 0x004c86cb, 0x000409ad, 0x00dc9806, 0x00941760, ++ 0x0097f7d7, 0x00df78b1, 0x0007e91a, 0x004f667c, ++ 0x004e2c61, 0x0006a307, 0x00de32ac, 0x0096bdca, ++ 0x00955d7d, 0x00ddd21b, 0x000543b0, 0x004dccd6, ++ 0x00f8cf59, 0x00b0403f, 0x0068d194, 0x00205ef2, ++ 0x0023be45, 0x006b3123, 0x00b3a088, 0x00fb2fee, ++ 0x0022eb10, 0x006a6476, 0x00b2f5dd, 0x00fa7abb, ++ 0x00f99a0c, 0x00b1156a, 0x006984c1, 0x00210ba7, ++ 0x00940828, 0x00dc874e, 0x000416e5, 0x004c9983, ++ 0x004f7934, 0x0007f652, 0x00df67f9, 0x0097e89f, ++ 0x00ddf3c3, 0x00957ca5, 0x004ded0e, 0x00056268, ++ 0x000682df, 0x004e0db9, 0x00969c12, 0x00de1374, ++ 0x006b10fb, 0x00239f9d, 0x00fb0e36, 0x00b38150, ++ 0x00b061e7, 0x00f8ee81, 0x00207f2a, 0x0068f04c, ++ 0x00b134b2, 0x00f9bbd4, 0x00212a7f, 0x0069a519, ++ 0x006a45ae, 0x0022cac8, 0x00fa5b63, 0x00b2d405, ++ 0x0007d78a, 0x004f58ec, 0x0097c947, 0x00df4621, ++ 0x00dca696, 0x009429f0, 0x004cb85b, 0x0004373d, ++ 0x00057d20, 0x004df246, 0x009563ed, 0x00ddec8b, ++ 0x00de0c3c, 0x0096835a, 0x004e12f1, 0x00069d97, ++ 0x00b39e18, 0x00fb117e, 0x002380d5, 0x006b0fb3, ++ 0x0068ef04, 0x00206062, 0x00f8f1c9, 0x00b07eaf, ++ 0x0069ba51, 0x00213537, 0x00f9a49c, 0x00b12bfa, ++ 0x00b2cb4d, 0x00fa442b, 0x0022d580, 0x006a5ae6, ++ 0x00df5969, 0x0097d60f, 0x004f47a4, 0x0007c8c2, ++ 0x00042875, 0x004ca713, 0x009436b8, 0x00dcb9de, ++ 0x00000000, 0x00d70983, 0x00555f80, 0x00825603, ++ 0x0051f286, 0x0086fb05, 0x0004ad06, 0x00d3a485, ++ 0x0059a88b, 0x008ea108, 0x000cf70b, 0x00dbfe88, ++ 0x00085a0d, 0x00df538e, 0x005d058d, 0x008a0c0e, ++ 0x00491c91, 0x009e1512, 0x001c4311, 0x00cb4a92, ++ 0x0018ee17, 0x00cfe794, 0x004db197, 0x009ab814, ++ 0x0010b41a, 0x00c7bd99, 0x0045eb9a, 0x0092e219, ++ 0x0041469c, 0x00964f1f, 0x0014191c, 0x00c3109f, ++ 0x006974a4, 0x00be7d27, 0x003c2b24, 0x00eb22a7, ++ 0x00388622, 0x00ef8fa1, 0x006dd9a2, 0x00bad021, ++ 0x0030dc2f, 0x00e7d5ac, 0x006583af, 0x00b28a2c, ++ 0x00612ea9, 0x00b6272a, 0x00347129, 0x00e378aa, ++ 0x00206835, 0x00f761b6, 0x007537b5, 0x00a23e36, ++ 0x00719ab3, 0x00a69330, 0x0024c533, 0x00f3ccb0, ++ 0x0079c0be, 0x00aec93d, 0x002c9f3e, 0x00fb96bd, ++ 0x00283238, 0x00ff3bbb, 0x007d6db8, 0x00aa643b, ++ 0x0029a4ce, 0x00fead4d, 0x007cfb4e, 0x00abf2cd, ++ 0x00785648, 0x00af5fcb, 0x002d09c8, 0x00fa004b, ++ 0x00700c45, 0x00a705c6, 0x002553c5, 0x00f25a46, ++ 0x0021fec3, 0x00f6f740, 0x0074a143, 0x00a3a8c0, ++ 0x0060b85f, 0x00b7b1dc, 0x0035e7df, 0x00e2ee5c, ++ 0x00314ad9, 0x00e6435a, 0x00641559, 0x00b31cda, ++ 0x003910d4, 0x00ee1957, 0x006c4f54, 0x00bb46d7, ++ 0x0068e252, 0x00bfebd1, 0x003dbdd2, 0x00eab451, ++ 0x0040d06a, 0x0097d9e9, 0x00158fea, 0x00c28669, ++ 0x001122ec, 0x00c62b6f, 0x00447d6c, 0x009374ef, ++ 0x001978e1, 0x00ce7162, 0x004c2761, 0x009b2ee2, ++ 0x00488a67, 0x009f83e4, 0x001dd5e7, 0x00cadc64, ++ 0x0009ccfb, 0x00dec578, 0x005c937b, 0x008b9af8, ++ 0x00583e7d, 0x008f37fe, 0x000d61fd, 0x00da687e, ++ 0x00506470, 0x00876df3, 0x00053bf0, 0x00d23273, ++ 0x000196f6, 0x00d69f75, 0x0054c976, 0x0083c0f5, ++ 0x00a9041b, 0x007e0d98, 0x00fc5b9b, 0x002b5218, ++ 0x00f8f69d, 0x002fff1e, 0x00ada91d, 0x007aa09e, ++ 0x00f0ac90, 0x0027a513, 0x00a5f310, 0x0072fa93, ++ 0x00a15e16, 0x00765795, 0x00f40196, 0x00230815, ++ 0x00e0188a, 0x00371109, 0x00b5470a, 0x00624e89, ++ 0x00b1ea0c, 0x0066e38f, 0x00e4b58c, 0x0033bc0f, ++ 0x00b9b001, 0x006eb982, 0x00ecef81, 0x003be602, ++ 0x00e84287, 0x003f4b04, 0x00bd1d07, 0x006a1484, ++ 0x00c070bf, 0x0017793c, 0x00952f3f, 0x004226bc, ++ 0x00918239, 0x00468bba, 0x00c4ddb9, 0x0013d43a, ++ 0x0099d834, 0x004ed1b7, 0x00cc87b4, 0x001b8e37, ++ 0x00c82ab2, 0x001f2331, 0x009d7532, 0x004a7cb1, ++ 0x00896c2e, 0x005e65ad, 0x00dc33ae, 0x000b3a2d, ++ 0x00d89ea8, 0x000f972b, 0x008dc128, 0x005ac8ab, ++ 0x00d0c4a5, 0x0007cd26, 0x00859b25, 0x005292a6, ++ 0x00813623, 0x00563fa0, 0x00d469a3, 0x00036020, ++ 0x0080a0d5, 0x0057a956, 0x00d5ff55, 0x0002f6d6, ++ 0x00d15253, 0x00065bd0, 0x00840dd3, 0x00530450, ++ 0x00d9085e, 0x000e01dd, 0x008c57de, 0x005b5e5d, ++ 0x0088fad8, 0x005ff35b, 0x00dda558, 0x000aacdb, ++ 0x00c9bc44, 0x001eb5c7, 0x009ce3c4, 0x004bea47, ++ 0x00984ec2, 0x004f4741, 0x00cd1142, 0x001a18c1, ++ 0x009014cf, 0x00471d4c, 0x00c54b4f, 0x001242cc, ++ 0x00c1e649, 0x0016efca, 0x0094b9c9, 0x0043b04a, ++ 0x00e9d471, 0x003eddf2, 0x00bc8bf1, 0x006b8272, ++ 0x00b826f7, 0x006f2f74, 0x00ed7977, 0x003a70f4, ++ 0x00b07cfa, 0x00677579, 0x00e5237a, 0x00322af9, ++ 0x00e18e7c, 0x003687ff, 0x00b4d1fc, 0x0063d87f, ++ 0x00a0c8e0, 0x0077c163, 0x00f59760, 0x00229ee3, ++ 0x00f13a66, 0x002633e5, 0x00a465e6, 0x00736c65, ++ 0x00f9606b, 0x002e69e8, 0x00ac3feb, 0x007b3668, ++ 0x00a892ed, 0x007f9b6e, 0x00fdcd6d, 0x002ac4ee, ++ 0x00000000, 0x00520936, 0x00a4126c, 0x00f61b5a, ++ 0x004825d8, 0x001a2cee, 0x00ec37b4, 0x00be3e82, ++ 0x006b0636, 0x00390f00, 0x00cf145a, 0x009d1d6c, ++ 0x002323ee, 0x00712ad8, 0x00873182, 0x00d538b4, ++ 0x00d60c6c, 0x0084055a, 0x00721e00, 0x00201736, ++ 0x009e29b4, 0x00cc2082, 0x003a3bd8, 0x006832ee, ++ 0x00bd0a5a, 0x00ef036c, 0x00191836, 0x004b1100, ++ 0x00f52f82, 0x00a726b4, 0x00513dee, 0x000334d8, ++ 0x00ac19d8, 0x00fe10ee, 0x00080bb4, 0x005a0282, ++ 0x00e43c00, 0x00b63536, 0x00402e6c, 0x0012275a, ++ 0x00c71fee, 0x009516d8, 0x00630d82, 0x003104b4, ++ 0x008f3a36, 0x00dd3300, 0x002b285a, 0x0079216c, ++ 0x007a15b4, 0x00281c82, 0x00de07d8, 0x008c0eee, ++ 0x0032306c, 0x0060395a, 0x00962200, 0x00c42b36, ++ 0x00111382, 0x00431ab4, 0x00b501ee, 0x00e708d8, ++ 0x0059365a, 0x000b3f6c, 0x00fd2436, 0x00af2d00, ++ 0x00a37f36, 0x00f17600, 0x00076d5a, 0x0055646c, ++ 0x00eb5aee, 0x00b953d8, 0x004f4882, 0x001d41b4, ++ 0x00c87900, 0x009a7036, 0x006c6b6c, 0x003e625a, ++ 0x00805cd8, 0x00d255ee, 0x00244eb4, 0x00764782, ++ 0x0075735a, 0x00277a6c, 0x00d16136, 0x00836800, ++ 0x003d5682, 0x006f5fb4, 0x009944ee, 0x00cb4dd8, ++ 0x001e756c, 0x004c7c5a, 0x00ba6700, 0x00e86e36, ++ 0x005650b4, 0x00045982, 0x00f242d8, 0x00a04bee, ++ 0x000f66ee, 0x005d6fd8, 0x00ab7482, 0x00f97db4, ++ 0x00474336, 0x00154a00, 0x00e3515a, 0x00b1586c, ++ 0x006460d8, 0x003669ee, 0x00c072b4, 0x00927b82, ++ 0x002c4500, 0x007e4c36, 0x0088576c, 0x00da5e5a, ++ 0x00d96a82, 0x008b63b4, 0x007d78ee, 0x002f71d8, ++ 0x00914f5a, 0x00c3466c, 0x00355d36, 0x00675400, ++ 0x00b26cb4, 0x00e06582, 0x00167ed8, 0x004477ee, ++ 0x00fa496c, 0x00a8405a, 0x005e5b00, 0x000c5236, ++ 0x0046ff6c, 0x0014f65a, 0x00e2ed00, 0x00b0e436, ++ 0x000edab4, 0x005cd382, 0x00aac8d8, 0x00f8c1ee, ++ 0x002df95a, 0x007ff06c, 0x0089eb36, 0x00dbe200, ++ 0x0065dc82, 0x0037d5b4, 0x00c1ceee, 0x0093c7d8, ++ 0x0090f300, 0x00c2fa36, 0x0034e16c, 0x0066e85a, ++ 0x00d8d6d8, 0x008adfee, 0x007cc4b4, 0x002ecd82, ++ 0x00fbf536, 0x00a9fc00, 0x005fe75a, 0x000dee6c, ++ 0x00b3d0ee, 0x00e1d9d8, 0x0017c282, 0x0045cbb4, ++ 0x00eae6b4, 0x00b8ef82, 0x004ef4d8, 0x001cfdee, ++ 0x00a2c36c, 0x00f0ca5a, 0x0006d100, 0x0054d836, ++ 0x0081e082, 0x00d3e9b4, 0x0025f2ee, 0x0077fbd8, ++ 0x00c9c55a, 0x009bcc6c, 0x006dd736, 0x003fde00, ++ 0x003cead8, 0x006ee3ee, 0x0098f8b4, 0x00caf182, ++ 0x0074cf00, 0x0026c636, 0x00d0dd6c, 0x0082d45a, ++ 0x0057ecee, 0x0005e5d8, 0x00f3fe82, 0x00a1f7b4, ++ 0x001fc936, 0x004dc000, 0x00bbdb5a, 0x00e9d26c, ++ 0x00e5805a, 0x00b7896c, 0x00419236, 0x00139b00, ++ 0x00ada582, 0x00ffacb4, 0x0009b7ee, 0x005bbed8, ++ 0x008e866c, 0x00dc8f5a, 0x002a9400, 0x00789d36, ++ 0x00c6a3b4, 0x0094aa82, 0x0062b1d8, 0x0030b8ee, ++ 0x00338c36, 0x00618500, 0x00979e5a, 0x00c5976c, ++ 0x007ba9ee, 0x0029a0d8, 0x00dfbb82, 0x008db2b4, ++ 0x00588a00, 0x000a8336, 0x00fc986c, 0x00ae915a, ++ 0x0010afd8, 0x0042a6ee, 0x00b4bdb4, 0x00e6b482, ++ 0x00499982, 0x001b90b4, 0x00ed8bee, 0x00bf82d8, ++ 0x0001bc5a, 0x0053b56c, 0x00a5ae36, 0x00f7a700, ++ 0x00229fb4, 0x00709682, 0x00868dd8, 0x00d484ee, ++ 0x006aba6c, 0x0038b35a, 0x00cea800, 0x009ca136, ++ 0x009f95ee, 0x00cd9cd8, 0x003b8782, 0x00698eb4, ++ 0x00d7b036, 0x0085b900, 0x0073a25a, 0x0021ab6c, ++ 0x00f493d8, 0x00a69aee, 0x005081b4, 0x00028882, ++ 0x00bcb600, 0x00eebf36, 0x0018a46c, 0x004aad5a ++}; ++ ++static inline ++u32 crc24_init (void) ++{ ++ return 0xce04b7; ++} ++ ++static inline ++u32 crc24_next (u32 crc, byte data) ++{ ++ return (crc >> 8) ^ crc24_table[(crc & 0xff) ^ data]; ++} ++ ++/* ++ * Process 4 bytes in one go + */ ++static inline ++u32 crc24_next4 (u32 crc, u32 data) ++{ ++ crc ^= data; ++ crc = crc24_table[(crc & 0xff) + 0x300] ^ ++ crc24_table[((crc >> 8) & 0xff) + 0x200] ^ ++ crc24_table[((crc >> 16) & 0xff) + 0x100] ^ ++ crc24_table[(crc >> 24) & 0xff]; ++ return crc; ++} + +-#define CRC24_INIT 0xb704ceL +-#define CRC24_POLY 0x1864cfbL ++static inline ++u32 crc24_final (u32 crc) ++{ ++ return crc & 0xffffff; ++} + + static void + crc24rfc2440_init (void *context) + { + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; +- ctx->CRC = CRC24_INIT; ++ ctx->CRC = crc24_init(); + } + + static void + crc24rfc2440_write (void *context, const void *inbuf_arg, size_t inlen) + { + const unsigned char *inbuf = inbuf_arg; +- int i; + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; ++ u32 crc; + +- if (!inbuf) ++ if (!inbuf || !inlen) + return; + +- while (inlen--) { +- ctx->CRC ^= (*inbuf++) << 16; +- for (i = 0; i < 8; i++) { +- ctx->CRC <<= 1; +- if (ctx->CRC & 0x1000000) +- ctx->CRC ^= CRC24_POLY; ++ crc = ctx->CRC; ++ ++ while (inlen >= 16) ++ { ++ inlen -= 16; ++ crc = crc24_next4(crc, buf_get_le32(&inbuf[0])); ++ crc = crc24_next4(crc, buf_get_le32(&inbuf[4])); ++ crc = crc24_next4(crc, buf_get_le32(&inbuf[8])); ++ crc = crc24_next4(crc, buf_get_le32(&inbuf[12])); ++ inbuf += 16; + } +- } ++ ++ while (inlen >= 4) ++ { ++ inlen -= 4; ++ crc = crc24_next4(crc, buf_get_le32(inbuf)); ++ inbuf += 4; ++ } ++ ++ while (inlen--) ++ { ++ crc = crc24_next(crc, *inbuf++); ++ } ++ ++ ctx->CRC = crc; + } + + static void + crc24rfc2440_final (void *context) + { + CRC_CONTEXT *ctx = (CRC_CONTEXT *) context; +- ctx->buf[0] = (ctx->CRC >> 16) & 0xFF; +- ctx->buf[1] = (ctx->CRC >> 8) & 0xFF; +- ctx->buf[2] = (ctx->CRC ) & 0xFF; ++ ctx->CRC = crc24_final(ctx->CRC); ++ buf_put_le32 (ctx->buf, ctx->CRC); + } + + gcry_md_spec_t _gcry_digest_spec_crc32 = +diff --git a/grub-core/lib/libgcrypt/cipher/bufhelp.h b/grub-core/lib/libgcrypt/cipher/bufhelp.h +new file mode 100644 +index 00000000000..df355947231 +--- /dev/null ++++ b/grub-core/lib/libgcrypt/cipher/bufhelp.h +@@ -0,0 +1,432 @@ ++/* bufhelp.h - Some buffer manipulation helpers ++ * Copyright (C) 2012 Jussi Kivilinna ++ * ++ * This file is part of Libgcrypt. ++ * ++ * Libgcrypt is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * Libgcrypt 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 Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this program; if not, see . ++ */ ++#ifndef GCRYPT_BUFHELP_H ++#define GCRYPT_BUFHELP_H ++ ++ ++#include "bithelp.h" ++ ++ ++#undef BUFHELP_FAST_UNALIGNED_ACCESS ++#if defined(HAVE_GCC_ATTRIBUTE_PACKED) && \ ++ defined(HAVE_GCC_ATTRIBUTE_ALIGNED) && \ ++ (defined(__i386__) || defined(__x86_64__) || \ ++ (defined(__arm__) && defined(__ARM_FEATURE_UNALIGNED)) || \ ++ defined(__aarch64__)) ++/* These architectures are able of unaligned memory accesses and can ++ handle those fast. ++ */ ++# define BUFHELP_FAST_UNALIGNED_ACCESS 1 ++#endif ++ ++ ++#ifdef BUFHELP_FAST_UNALIGNED_ACCESS ++/* Define type with one-byte alignment on architectures with fast unaligned ++ memory accesses. ++ */ ++typedef struct bufhelp_int_s ++{ ++ uintptr_t a; ++} __attribute__((packed, aligned(1))) bufhelp_int_t; ++#else ++/* Define type with default alignment for other architectures (unaligned ++ accessed handled in per byte loops). ++ */ ++typedef struct bufhelp_int_s ++{ ++ uintptr_t a; ++} bufhelp_int_t; ++#endif ++ ++ ++/* Optimized function for small buffer copying */ ++static inline void ++buf_cpy(void *_dst, const void *_src, size_t len) ++{ ++#if __GNUC__ >= 4 && (defined(__x86_64__) || defined(__i386__)) ++ /* For AMD64 and i386, memcpy is faster. */ ++ memcpy(_dst, _src, len); ++#else ++ byte *dst = _dst; ++ const byte *src = _src; ++ bufhelp_int_t *ldst; ++ const bufhelp_int_t *lsrc; ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ const unsigned int longmask = sizeof(bufhelp_int_t) - 1; ++ ++ /* Skip fast processing if buffers are unaligned. */ ++ if (((uintptr_t)dst | (uintptr_t)src) & longmask) ++ goto do_bytes; ++#endif ++ ++ ldst = (bufhelp_int_t *)(void *)dst; ++ lsrc = (const bufhelp_int_t *)(const void *)src; ++ ++ for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) ++ (ldst++)->a = (lsrc++)->a; ++ ++ dst = (byte *)ldst; ++ src = (const byte *)lsrc; ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++do_bytes: ++#endif ++ /* Handle tail. */ ++ for (; len; len--) ++ *dst++ = *src++; ++#endif /*__GNUC__ >= 4 && (__x86_64__ || __i386__)*/ ++} ++ ++ ++/* Optimized function for buffer xoring */ ++static inline void ++buf_xor(void *_dst, const void *_src1, const void *_src2, size_t len) ++{ ++ byte *dst = _dst; ++ const byte *src1 = _src1; ++ const byte *src2 = _src2; ++ bufhelp_int_t *ldst; ++ const bufhelp_int_t *lsrc1, *lsrc2; ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ const unsigned int longmask = sizeof(bufhelp_int_t) - 1; ++ ++ /* Skip fast processing if buffers are unaligned. */ ++ if (((uintptr_t)dst | (uintptr_t)src1 | (uintptr_t)src2) & longmask) ++ goto do_bytes; ++#endif ++ ++ ldst = (bufhelp_int_t *)(void *)dst; ++ lsrc1 = (const bufhelp_int_t *)(const void *)src1; ++ lsrc2 = (const bufhelp_int_t *)(const void *)src2; ++ ++ for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) ++ (ldst++)->a = (lsrc1++)->a ^ (lsrc2++)->a; ++ ++ dst = (byte *)ldst; ++ src1 = (const byte *)lsrc1; ++ src2 = (const byte *)lsrc2; ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++do_bytes: ++#endif ++ /* Handle tail. */ ++ for (; len; len--) ++ *dst++ = *src1++ ^ *src2++; ++} ++ ++ ++/* Optimized function for in-place buffer xoring. */ ++static inline void ++buf_xor_1(void *_dst, const void *_src, size_t len) ++{ ++ byte *dst = _dst; ++ const byte *src = _src; ++ bufhelp_int_t *ldst; ++ const bufhelp_int_t *lsrc; ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ const unsigned int longmask = sizeof(bufhelp_int_t) - 1; ++ ++ /* Skip fast processing if buffers are unaligned. */ ++ if (((uintptr_t)dst | (uintptr_t)src) & longmask) ++ goto do_bytes; ++#endif ++ ++ ldst = (bufhelp_int_t *)(void *)dst; ++ lsrc = (const bufhelp_int_t *)(const void *)src; ++ ++ for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) ++ (ldst++)->a ^= (lsrc++)->a; ++ ++ dst = (byte *)ldst; ++ src = (const byte *)lsrc; ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++do_bytes: ++#endif ++ /* Handle tail. */ ++ for (; len; len--) ++ *dst++ ^= *src++; ++} ++ ++ ++/* Optimized function for buffer xoring with two destination buffers. Used ++ mainly by CFB mode encryption. */ ++static inline void ++buf_xor_2dst(void *_dst1, void *_dst2, const void *_src, size_t len) ++{ ++ byte *dst1 = _dst1; ++ byte *dst2 = _dst2; ++ const byte *src = _src; ++ bufhelp_int_t *ldst1, *ldst2; ++ const bufhelp_int_t *lsrc; ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ const unsigned int longmask = sizeof(bufhelp_int_t) - 1; ++ ++ /* Skip fast processing if buffers are unaligned. */ ++ if (((uintptr_t)src | (uintptr_t)dst1 | (uintptr_t)dst2) & longmask) ++ goto do_bytes; ++#endif ++ ++ ldst1 = (bufhelp_int_t *)(void *)dst1; ++ ldst2 = (bufhelp_int_t *)(void *)dst2; ++ lsrc = (const bufhelp_int_t *)(const void *)src; ++ ++ for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) ++ (ldst1++)->a = ((ldst2++)->a ^= (lsrc++)->a); ++ ++ dst1 = (byte *)ldst1; ++ dst2 = (byte *)ldst2; ++ src = (const byte *)lsrc; ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++do_bytes: ++#endif ++ /* Handle tail. */ ++ for (; len; len--) ++ *dst1++ = (*dst2++ ^= *src++); ++} ++ ++ ++/* Optimized function for combined buffer xoring and copying. Used by mainly ++ CBC mode decryption. */ ++static inline void ++buf_xor_n_copy_2(void *_dst_xor, const void *_src_xor, void *_srcdst_cpy, ++ const void *_src_cpy, size_t len) ++{ ++ byte *dst_xor = _dst_xor; ++ byte *srcdst_cpy = _srcdst_cpy; ++ const byte *src_xor = _src_xor; ++ const byte *src_cpy = _src_cpy; ++ byte temp; ++ bufhelp_int_t *ldst_xor, *lsrcdst_cpy; ++ const bufhelp_int_t *lsrc_cpy, *lsrc_xor; ++ uintptr_t ltemp; ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ const unsigned int longmask = sizeof(bufhelp_int_t) - 1; ++ ++ /* Skip fast processing if buffers are unaligned. */ ++ if (((uintptr_t)src_cpy | (uintptr_t)src_xor | (uintptr_t)dst_xor | ++ (uintptr_t)srcdst_cpy) & longmask) ++ goto do_bytes; ++#endif ++ ++ ldst_xor = (bufhelp_int_t *)(void *)dst_xor; ++ lsrc_xor = (const bufhelp_int_t *)(void *)src_xor; ++ lsrcdst_cpy = (bufhelp_int_t *)(void *)srcdst_cpy; ++ lsrc_cpy = (const bufhelp_int_t *)(const void *)src_cpy; ++ ++ for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) ++ { ++ ltemp = (lsrc_cpy++)->a; ++ (ldst_xor++)->a = (lsrcdst_cpy)->a ^ (lsrc_xor++)->a; ++ (lsrcdst_cpy++)->a = ltemp; ++ } ++ ++ dst_xor = (byte *)ldst_xor; ++ src_xor = (const byte *)lsrc_xor; ++ srcdst_cpy = (byte *)lsrcdst_cpy; ++ src_cpy = (const byte *)lsrc_cpy; ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++do_bytes: ++#endif ++ /* Handle tail. */ ++ for (; len; len--) ++ { ++ temp = *src_cpy++; ++ *dst_xor++ = *srcdst_cpy ^ *src_xor++; ++ *srcdst_cpy++ = temp; ++ } ++} ++ ++ ++/* Optimized function for combined buffer xoring and copying. Used by mainly ++ CFB mode decryption. */ ++static inline void ++buf_xor_n_copy(void *_dst_xor, void *_srcdst_cpy, const void *_src, size_t len) ++{ ++ buf_xor_n_copy_2(_dst_xor, _src, _srcdst_cpy, _src, len); ++} ++ ++ ++/* Constant-time compare of two buffers. Returns 1 if buffers are equal, ++ and 0 if buffers differ. */ ++static inline int ++buf_eq_const(const void *_a, const void *_b, size_t len) ++{ ++ const byte *a = _a; ++ const byte *b = _b; ++ size_t diff, i; ++ ++ /* Constant-time compare. */ ++ for (i = 0, diff = 0; i < len; i++) ++ diff -= !!(a[i] - b[i]); ++ ++ return !diff; ++} ++ ++ ++#ifndef BUFHELP_FAST_UNALIGNED_ACCESS ++ ++/* Functions for loading and storing unaligned u32 values of different ++ endianness. */ ++static inline u32 buf_get_be32(const void *_buf) ++{ ++ const byte *in = _buf; ++ return ((u32)in[0] << 24) | ((u32)in[1] << 16) | \ ++ ((u32)in[2] << 8) | (u32)in[3]; ++} ++ ++static inline u32 buf_get_le32(const void *_buf) ++{ ++ const byte *in = _buf; ++ return ((u32)in[3] << 24) | ((u32)in[2] << 16) | \ ++ ((u32)in[1] << 8) | (u32)in[0]; ++} ++ ++static inline void buf_put_be32(void *_buf, u32 val) ++{ ++ byte *out = _buf; ++ out[0] = val >> 24; ++ out[1] = val >> 16; ++ out[2] = val >> 8; ++ out[3] = val; ++} ++ ++static inline void buf_put_le32(void *_buf, u32 val) ++{ ++ byte *out = _buf; ++ out[3] = val >> 24; ++ out[2] = val >> 16; ++ out[1] = val >> 8; ++ out[0] = val; ++} ++ ++ ++/* Functions for loading and storing unaligned u64 values of different ++ endianness. */ ++static inline u64 buf_get_be64(const void *_buf) ++{ ++ const byte *in = _buf; ++ return ((u64)in[0] << 56) | ((u64)in[1] << 48) | \ ++ ((u64)in[2] << 40) | ((u64)in[3] << 32) | \ ++ ((u64)in[4] << 24) | ((u64)in[5] << 16) | \ ++ ((u64)in[6] << 8) | (u64)in[7]; ++} ++ ++static inline u64 buf_get_le64(const void *_buf) ++{ ++ const byte *in = _buf; ++ return ((u64)in[7] << 56) | ((u64)in[6] << 48) | \ ++ ((u64)in[5] << 40) | ((u64)in[4] << 32) | \ ++ ((u64)in[3] << 24) | ((u64)in[2] << 16) | \ ++ ((u64)in[1] << 8) | (u64)in[0]; ++} ++ ++static inline void buf_put_be64(void *_buf, u64 val) ++{ ++ byte *out = _buf; ++ out[0] = val >> 56; ++ out[1] = val >> 48; ++ out[2] = val >> 40; ++ out[3] = val >> 32; ++ out[4] = val >> 24; ++ out[5] = val >> 16; ++ out[6] = val >> 8; ++ out[7] = val; ++} ++ ++static inline void buf_put_le64(void *_buf, u64 val) ++{ ++ byte *out = _buf; ++ out[7] = val >> 56; ++ out[6] = val >> 48; ++ out[5] = val >> 40; ++ out[4] = val >> 32; ++ out[3] = val >> 24; ++ out[2] = val >> 16; ++ out[1] = val >> 8; ++ out[0] = val; ++} ++ ++#else /*BUFHELP_FAST_UNALIGNED_ACCESS*/ ++ ++typedef struct bufhelp_u32_s ++{ ++ u32 a; ++} __attribute__((packed, aligned(1))) bufhelp_u32_t; ++ ++/* Functions for loading and storing unaligned u32 values of different ++ endianness. */ ++static inline u32 buf_get_be32(const void *_buf) ++{ ++ return be_bswap32(((const bufhelp_u32_t *)_buf)->a); ++} ++ ++static inline u32 buf_get_le32(const void *_buf) ++{ ++ return le_bswap32(((const bufhelp_u32_t *)_buf)->a); ++} ++ ++static inline void buf_put_be32(void *_buf, u32 val) ++{ ++ bufhelp_u32_t *out = _buf; ++ out->a = be_bswap32(val); ++} ++ ++static inline void buf_put_le32(void *_buf, u32 val) ++{ ++ bufhelp_u32_t *out = _buf; ++ out->a = le_bswap32(val); ++} ++ ++ ++typedef struct bufhelp_u64_s ++{ ++ u64 a; ++} __attribute__((packed, aligned(1))) bufhelp_u64_t; ++ ++/* Functions for loading and storing unaligned u64 values of different ++ endianness. */ ++static inline u64 buf_get_be64(const void *_buf) ++{ ++ return be_bswap64(((const bufhelp_u64_t *)_buf)->a); ++} ++ ++static inline u64 buf_get_le64(const void *_buf) ++{ ++ return le_bswap64(((const bufhelp_u64_t *)_buf)->a); ++} ++ ++static inline void buf_put_be64(void *_buf, u64 val) ++{ ++ bufhelp_u64_t *out = _buf; ++ out->a = be_bswap64(val); ++} ++ ++static inline void buf_put_le64(void *_buf, u64 val) ++{ ++ bufhelp_u64_t *out = _buf; ++ out->a = le_bswap64(val); ++} ++ ++ ++#endif /*BUFHELP_FAST_UNALIGNED_ACCESS*/ ++ ++#endif /*GCRYPT_BUFHELP_H*/ diff --git a/0104-arm64-efi-move-EFI_PAGE-definitions-to-efi-memory.h.patch b/0104-arm64-efi-move-EFI_PAGE-definitions-to-efi-memory.h.patch new file mode 100644 index 00000000..0519ba9f --- /dev/null +++ b/0104-arm64-efi-move-EFI_PAGE-definitions-to-efi-memory.h.patch @@ -0,0 +1,87 @@ +From 083c6e2455dcd4aafb6062d89fd6029dd3adddb6 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:49 +0000 +Subject: [PATCH] arm64/efi: move EFI_PAGE definitions to efi/memory.h + +The EFI page definitions and macros are generic and should not be confined +to arm64 headers - so move to efi/memory.h. +Also add EFI_PAGE_SIZE macro. + +Update loader sources to reflect new header location. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm64/linux.c | 1 + + grub-core/loader/arm64/xen_boot.c | 1 + + grub-core/loader/efi/fdt.c | 1 + + include/grub/efi/fdtload.h | 3 --- + include/grub/efi/memory.h | 7 +++++++ + 5 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 746edd10415..ca01a234961 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c +index 6780b1f0c4a..0a40e16be33 100644 +--- a/grub-core/loader/arm64/xen_boot.c ++++ b/grub-core/loader/arm64/xen_boot.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include /* required by struct xen_hypervisor_header */ + #include + #include +diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c +index 17212c38d0b..c0c6800f79e 100644 +--- a/grub-core/loader/efi/fdt.c ++++ b/grub-core/loader/efi/fdt.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + static void *loaded_fdt; + static void *fdt; +diff --git a/include/grub/efi/fdtload.h b/include/grub/efi/fdtload.h +index 7b9ddba916d..713c9424d0a 100644 +--- a/include/grub/efi/fdtload.h ++++ b/include/grub/efi/fdtload.h +@@ -29,7 +29,4 @@ grub_fdt_unload (void); + grub_err_t + grub_fdt_install (void); + +-#define GRUB_EFI_PAGE_SHIFT 12 +-#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) +- + #endif +diff --git a/include/grub/efi/memory.h b/include/grub/efi/memory.h +index 20526b14676..08fe6227783 100644 +--- a/include/grub/efi/memory.h ++++ b/include/grub/efi/memory.h +@@ -22,6 +22,13 @@ + #include + #include + ++/* The term "page" in UEFI refers only to a 4 KiB-aligned 4 KiB size region of ++ memory. It is not concerned with underlying translation management concepts, ++ but only used as the granule for memory allocations. */ ++#define GRUB_EFI_PAGE_SHIFT 12 ++#define GRUB_EFI_PAGE_SIZE (1 << GRUB_EFI_PAGE_SHIFT) ++#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) ++ + #define GRUB_MMAP_REGISTER_BY_FIRMWARE 1 + + grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, diff --git a/0105-Make-arch-specific-linux.h-include-guards-architectu.patch b/0105-Make-arch-specific-linux.h-include-guards-architectu.patch new file mode 100644 index 00000000..02c3f61c --- /dev/null +++ b/0105-Make-arch-specific-linux.h-include-guards-architectu.patch @@ -0,0 +1,80 @@ +From 8776e5a942582adaadc67865ed74cdd199e56a16 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:50 +0000 +Subject: [PATCH] Make arch-specific linux.h include guards architecture unique + +Replace uses of GRUB_LINUX_MACHINE_HEADER and GRUB_LINUX_CPU_HEADER +with GRUB__LINUX_HEADER include guards to prevent issues when +including more than one of them. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + include/grub/arm/linux.h | 6 +++--- + include/grub/arm64/linux.h | 6 +++--- + include/grub/i386/linux.h | 6 +++--- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h +index f217f8281ad..3706c46c66f 100644 +--- a/include/grub/arm/linux.h ++++ b/include/grub/arm/linux.h +@@ -17,8 +17,8 @@ + * along with GRUB. If not, see . + */ + +-#ifndef GRUB_LINUX_CPU_HEADER +-#define GRUB_LINUX_CPU_HEADER 1 ++#ifndef GRUB_ARM_LINUX_HEADER ++#define GRUB_ARM_LINUX_HEADER 1 + + #define LINUX_ZIMAGE_OFFSET 0x24 + #define LINUX_ZIMAGE_MAGIC 0x016f2818 +@@ -66,4 +66,4 @@ grub_arm_firmware_get_machine_type (void) + + #define FDT_ADDITIONAL_ENTRIES_SIZE 0x300 + +-#endif /* ! GRUB_LINUX_CPU_HEADER */ ++#endif /* ! GRUB_ARM_LINUX_HEADER */ +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index a981df5d15f..a8edf50dc2c 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#ifndef GRUB_LINUX_CPU_HEADER +-#define GRUB_LINUX_CPU_HEADER 1 ++#ifndef GRUB_ARM64_LINUX_HEADER ++#define GRUB_ARM64_LINUX_HEADER 1 + + #include + +@@ -43,4 +43,4 @@ grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header + grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, + char *args); + +-#endif /* ! GRUB_LINUX_CPU_HEADER */ ++#endif /* ! GRUB_ARM64_LINUX_HEADER */ +diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h +index da0ca3b83cd..2ff1621a429 100644 +--- a/include/grub/i386/linux.h ++++ b/include/grub/i386/linux.h +@@ -16,8 +16,8 @@ + * along with GRUB. If not, see . + */ + +-#ifndef GRUB_LINUX_MACHINE_HEADER +-#define GRUB_LINUX_MACHINE_HEADER 1 ++#ifndef GRUB_I386_LINUX_HEADER ++#define GRUB_I386_LINUX_HEADER 1 + + #define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ + #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 +@@ -312,4 +312,4 @@ struct linux_kernel_params + } GRUB_PACKED; + #endif /* ! ASM_FILE */ + +-#endif /* ! GRUB_LINUX_MACHINE_HEADER */ ++#endif /* ! GRUB_I386_LINUX_HEADER */ diff --git a/0106-make-GRUB_LINUX_MAGIC_SIGNATURE-architecture-specifi.patch b/0106-make-GRUB_LINUX_MAGIC_SIGNATURE-architecture-specifi.patch new file mode 100644 index 00000000..ca124991 --- /dev/null +++ b/0106-make-GRUB_LINUX_MAGIC_SIGNATURE-architecture-specifi.patch @@ -0,0 +1,110 @@ +From 3245f02d9d7274e942426541cf73dc73e7298f02 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:51 +0000 +Subject: [PATCH] make GRUB_LINUX_MAGIC_SIGNATURE architecture-specific + +Rename GRUB_LINUX_MAGIC_SIGNATURE GRUB_LINUX_I386_MAGIC_SIGNATURE, +to be usable in code that supports more than one image type. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/commands/file.c | 4 ++-- + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 6 +++--- + grub-core/loader/i386/xen_file.c | 2 +- + include/grub/i386/linux.h | 2 +- + 5 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c +index 12fba99e06a..474666d3a98 100644 +--- a/grub-core/commands/file.c ++++ b/grub-core/commands/file.c +@@ -508,7 +508,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) + + /* FIXME: some really old kernels (< 1.3.73) will fail this. */ + if (lh.header != +- grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0200) + break; + +@@ -521,7 +521,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) + /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and + still not support 32-bit boot. */ + if (lh.header != +- grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0203) + break; + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 083f9417cb6..9bd5afb6561 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -721,7 +721,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and + still not support 32-bit boot. */ +- if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0203) + { + grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" +diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c +index a293b17aa10..31a68764465 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -169,7 +169,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + maximal_cmdline_size = 256; + +- if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + && grub_le_to_cpu16 (lh.version) >= 0x0200) + { + grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); +@@ -322,7 +322,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0200) + /* Clear the heap space. */ + grub_memset (grub_linux_real_chunk +@@ -407,7 +407,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + + lh = (struct linux_kernel_header *) grub_linux_real_chunk; + +- if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + && grub_le_to_cpu16 (lh->version) >= 0x0200)) + { + grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd"); +diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c +index 99fad4cadae..6e76e16aa11 100644 +--- a/grub-core/loader/i386/xen_file.c ++++ b/grub-core/loader/i386/xen_file.c +@@ -43,7 +43,7 @@ grub_xen_file (grub_file_t file) + goto fail; + + if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55) +- || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) ++ || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0208) + { + grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); +diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h +index 2ff1621a429..3ff432be9ad 100644 +--- a/include/grub/i386/linux.h ++++ b/include/grub/i386/linux.h +@@ -19,7 +19,7 @@ + #ifndef GRUB_I386_LINUX_HEADER + #define GRUB_I386_LINUX_HEADER 1 + +-#define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ ++#define GRUB_LINUX_I386_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ + #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 + #define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF + #define GRUB_LINUX_MAX_SETUP_SECTS 64 diff --git a/0107-i386-make-struct-linux_kernel_header-architecture-sp.patch b/0107-i386-make-struct-linux_kernel_header-architecture-sp.patch new file mode 100644 index 00000000..93990a74 --- /dev/null +++ b/0107-i386-make-struct-linux_kernel_header-architecture-sp.patch @@ -0,0 +1,100 @@ +From 7d36709d5e769eb49b41cca709bd64336b47ab4f Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:52 +0000 +Subject: [PATCH] i386: make struct linux_kernel_header architecture specific + +struct linux_kernel_header -> struct linux_i386_kernel_header + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/commands/file.c | 2 +- + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 6 +++--- + grub-core/loader/i386/xen_file.c | 2 +- + include/grub/i386/linux.h | 2 +- + 5 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c +index 474666d3a98..63c84499bab 100644 +--- a/grub-core/commands/file.c ++++ b/grub-core/commands/file.c +@@ -497,7 +497,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) + case IS_X86_LINUX32: + case IS_X86_LINUX: + { +- struct linux_kernel_header lh; ++ struct linux_i386_kernel_header lh; + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + break; + if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 9bd5afb6561..44301e12659 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -678,7 +678,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { + grub_file_t file = 0; +- struct linux_kernel_header lh; ++ struct linux_i386_kernel_header lh; + grub_uint8_t setup_sects; + grub_size_t real_size, prot_size, prot_file_size; + grub_ssize_t len; +diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c +index 31a68764465..b69cb7a3a7f 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -121,7 +121,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { + grub_file_t file = 0; +- struct linux_kernel_header lh; ++ struct linux_i386_kernel_header lh; + grub_uint8_t setup_sects; + grub_size_t real_size; + grub_ssize_t len; +@@ -387,7 +387,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_size_t size = 0; + grub_addr_t addr_max, addr_min; +- struct linux_kernel_header *lh; ++ struct linux_i386_kernel_header *lh; + grub_uint8_t *initrd_chunk; + grub_addr_t initrd_addr; + grub_err_t err; +@@ -405,7 +405,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- lh = (struct linux_kernel_header *) grub_linux_real_chunk; ++ lh = (struct linux_i386_kernel_header *) grub_linux_real_chunk; + + if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) + && grub_le_to_cpu16 (lh->version) >= 0x0200)) +diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c +index 6e76e16aa11..77a93e7b228 100644 +--- a/grub-core/loader/i386/xen_file.c ++++ b/grub-core/loader/i386/xen_file.c +@@ -26,7 +26,7 @@ grub_elf_t + grub_xen_file (grub_file_t file) + { + grub_elf_t elf; +- struct linux_kernel_header lh; ++ struct linux_i386_kernel_header lh; + grub_file_t off_file; + grub_uint32_t payload_offset, payload_length; + grub_uint8_t magic[6]; +diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h +index 3ff432be9ad..0bd75881708 100644 +--- a/include/grub/i386/linux.h ++++ b/include/grub/i386/linux.h +@@ -85,7 +85,7 @@ enum + }; + + /* For the Linux/i386 boot protocol version 2.10. */ +-struct linux_kernel_header ++struct linux_i386_kernel_header + { + grub_uint8_t code1[0x0020]; + grub_uint16_t cl_magic; /* Magic number 0xA33F */ diff --git a/0108-arm64-align-linux-kernel-header-struct-naming-with-i.patch b/0108-arm64-align-linux-kernel-header-struct-naming-with-i.patch new file mode 100644 index 00000000..cb3f548e --- /dev/null +++ b/0108-arm64-align-linux-kernel-header-struct-naming-with-i.patch @@ -0,0 +1,82 @@ +From ff1cf2548a3f33da19278829687d074ad746dd0a Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:53 +0000 +Subject: [PATCH] arm64: align linux kernel header struct naming with i386 + +Rename struct grub_arm64_linux_kernel_header -> linux_arm64_kernel_header. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm64/linux.c | 4 ++-- + grub-core/loader/arm64/xen_boot.c | 4 ++-- + include/grub/arm64/linux.h | 5 ++--- + 3 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index ca01a234961..79f25a71152 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -48,7 +48,7 @@ static grub_addr_t initrd_start; + static grub_addr_t initrd_end; + + grub_err_t +-grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) ++grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh) + { + if (lh->magic != GRUB_ARM64_LINUX_MAGIC) + return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); +@@ -249,7 +249,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { + grub_file_t file = 0; +- struct grub_arm64_linux_kernel_header lh; ++ struct linux_arm64_kernel_header lh; + + grub_dl_ref (my_mod); + +diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c +index 0a40e16be33..258264c79e8 100644 +--- a/grub-core/loader/arm64/xen_boot.c ++++ b/grub-core/loader/arm64/xen_boot.c +@@ -67,7 +67,7 @@ typedef enum module_type module_type_t; + + struct xen_hypervisor_header + { +- struct grub_arm64_linux_kernel_header efi_head; ++ struct linux_arm64_kernel_header efi_head; + + /* This is always PE\0\0. */ + grub_uint8_t signature[GRUB_PE32_SIGNATURE_SIZE]; +@@ -469,7 +469,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), + if (grub_file_read (file, &sh, sizeof (sh)) != (long) sizeof (sh)) + goto fail; + if (grub_arm64_uefi_check_image +- ((struct grub_arm64_linux_kernel_header *) &sh) != GRUB_ERR_NONE) ++ ((struct linux_arm64_kernel_header *) &sh) != GRUB_ERR_NONE) + goto fail; + grub_file_seek (file, 0); + +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index a8edf50dc2c..abe7e9cc3a6 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -24,7 +24,7 @@ + #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + + /* From linux/Documentation/arm64/booting.txt */ +-struct grub_arm64_linux_kernel_header ++struct linux_arm64_kernel_header + { + grub_uint32_t code0; /* Executable code */ + grub_uint32_t code1; /* Executable code */ +@@ -38,8 +38,7 @@ struct grub_arm64_linux_kernel_header + grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ + }; + +-grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header +- *lh); ++grub_err_t grub_arm64_uefi_check_image (struct linux_arm64_kernel_header *lh); + grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, + char *args); + diff --git a/0109-arm64-align-linux-kernel-magic-macro-naming-with-i38.patch b/0109-arm64-align-linux-kernel-magic-macro-naming-with-i38.patch new file mode 100644 index 00000000..c1ebf46e --- /dev/null +++ b/0109-arm64-align-linux-kernel-magic-macro-naming-with-i38.patch @@ -0,0 +1,40 @@ +From 7fd9722d0c5e9c5a85b782ef435c80085da308b2 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:54 +0000 +Subject: [PATCH] arm64: align linux kernel magic macro naming with i386 + +Change GRUB_ARM64_LINUX_MAGIC to GRUB_LINUX_ARM64_MAGIC_SIGNATURE. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm64/linux.c | 2 +- + include/grub/arm64/linux.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 79f25a71152..ebe1e730d63 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -50,7 +50,7 @@ static grub_addr_t initrd_end; + grub_err_t + grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh) + { +- if (lh->magic != GRUB_ARM64_LINUX_MAGIC) ++ if (lh->magic != GRUB_LINUX_ARM64_MAGIC_SIGNATURE) + return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); + + if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC) +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index abe7e9cc3a6..b0634762450 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -21,7 +21,7 @@ + + #include + +-#define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ ++#define GRUB_LINUX_ARM64_MAGIC_SIGNATURE 0x644d5241 /* 'ARM\x64' */ + + /* From linux/Documentation/arm64/booting.txt */ + struct linux_arm64_kernel_header diff --git a/0110-arm-switch-linux-loader-to-linux_arm_kernel_header-s.patch b/0110-arm-switch-linux-loader-to-linux_arm_kernel_header-s.patch new file mode 100644 index 00000000..91877bdc --- /dev/null +++ b/0110-arm-switch-linux-loader-to-linux_arm_kernel_header-s.patch @@ -0,0 +1,79 @@ +From cda033298680b6984044563b2ef6374a725b8aac Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:55 +0000 +Subject: [PATCH] arm: switch linux loader to linux_arm_kernel_header struct + +Use kernel header struct and magic definition to align (and coexist) with +i386/arm64 ports. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm/linux.c | 11 +++++------ + include/grub/arm/linux.h | 15 ++++++++++++--- + 2 files changed, 17 insertions(+), 9 deletions(-) + +diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c +index e64c79a9577..9f43e41bb55 100644 +--- a/grub-core/loader/arm/linux.c ++++ b/grub-core/loader/arm/linux.c +@@ -46,9 +46,6 @@ static const void *current_fdt; + + typedef void (*kernel_entry_t) (int, unsigned long, void *); + +-#define LINUX_ZIMAGE_OFFSET 0x24 +-#define LINUX_ZIMAGE_MAGIC 0x016f2818 +- + #define LINUX_PHYS_OFFSET (0x00008000) + #define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) + #define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) +@@ -315,6 +312,7 @@ linux_boot (void) + static grub_err_t + linux_load (const char *filename, grub_file_t file) + { ++ struct linux_arm_kernel_header *lh; + int size; + + size = grub_file_size (file); +@@ -337,9 +335,10 @@ linux_load (const char *filename, grub_file_t file) + return grub_errno; + } + +- if (size > LINUX_ZIMAGE_OFFSET + 4 +- && *(grub_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET) +- == LINUX_ZIMAGE_MAGIC) ++ lh = (void *) linux_addr; ++ ++ if ((grub_size_t) size > sizeof (*lh) && ++ lh->magic == GRUB_LINUX_ARM_MAGIC_SIGNATURE) + ; + else if (size > 0x8000 && *(grub_uint32_t *) (linux_addr) == 0xea000006 + && machine_type == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI) +diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h +index 3706c46c66f..64dd3173cf7 100644 +--- a/include/grub/arm/linux.h ++++ b/include/grub/arm/linux.h +@@ -20,11 +20,20 @@ + #ifndef GRUB_ARM_LINUX_HEADER + #define GRUB_ARM_LINUX_HEADER 1 + +-#define LINUX_ZIMAGE_OFFSET 0x24 +-#define LINUX_ZIMAGE_MAGIC 0x016f2818 +- + #include "system.h" + ++#define GRUB_LINUX_ARM_MAGIC_SIGNATURE 0x016f2818 ++ ++struct linux_arm_kernel_header { ++ grub_uint32_t code0; ++ grub_uint32_t reserved1[8]; ++ grub_uint32_t magic; ++ grub_uint32_t start; /* _start */ ++ grub_uint32_t end; /* _edata */ ++ grub_uint32_t reserved2[4]; ++ grub_uint32_t hdr_offset; ++}; ++ + #if defined GRUB_MACHINE_UBOOT + # include + # define LINUX_ADDRESS (start_of_ram + 0x8000) diff --git a/0111-arm-make-linux.h-safe-to-include-for-non-native-buil.patch b/0111-arm-make-linux.h-safe-to-include-for-non-native-buil.patch new file mode 100644 index 00000000..5e9f2f6d --- /dev/null +++ b/0111-arm-make-linux.h-safe-to-include-for-non-native-buil.patch @@ -0,0 +1,39 @@ +From a244d9ebc7547f7ed373d9796a3bf186e7c035a1 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Thu, 1 Feb 2018 18:18:56 +0000 +Subject: [PATCH] arm: make linux.h safe to include for non-native builds + + (for machine arm/efi) and + (for machine arm/coreboot) will not always +resolve (and will likely not be valid to) if pulled in when building +non-native commands, such as host tools or the "file" command. +So explicitly include them with their expanded pathnames. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + include/grub/arm/linux.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h +index 64dd3173cf7..cceb9c4a9cb 100644 +--- a/include/grub/arm/linux.h ++++ b/include/grub/arm/linux.h +@@ -43,7 +43,7 @@ struct linux_arm_kernel_header { + # define grub_arm_firmware_get_machine_type grub_uboot_get_machine_type + #elif defined GRUB_MACHINE_EFI + # include +-# include ++# include + /* On UEFI platforms - load the images at the lowest available address not + less than *_PHYS_OFFSET from the first available memory location. */ + # define LINUX_PHYS_OFFSET (0x00008000) +@@ -57,7 +57,7 @@ grub_arm_firmware_get_machine_type (void) + } + #elif defined (GRUB_MACHINE_COREBOOT) + #include +-#include ++#include + # define LINUX_ADDRESS (start_of_ram + 0x8000) + # define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000) + # define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000) diff --git a/0112-ieee1275-fix-build-regression-in-of_path_of_nvme.patch b/0112-ieee1275-fix-build-regression-in-of_path_of_nvme.patch new file mode 100644 index 00000000..5edc49a5 --- /dev/null +++ b/0112-ieee1275-fix-build-regression-in-of_path_of_nvme.patch @@ -0,0 +1,32 @@ +From 72b425b640f67ad7e6e0056a7a793bddc9997985 Mon Sep 17 00:00:00 2001 +From: Joakim Bech +Date: Mon, 26 Feb 2018 09:57:34 +0100 +Subject: [PATCH] ieee1275: fix build regression in of_path_of_nvme + +The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme +support within ofpath) introduced a build regression: + grub-core/osdep/linux/ofpath.c:365:21: error: comparison between pointer + and zero character constant [-Werror=pointer-compare] + if ((digit_string != '\0') && (*part_end == 'p')) + +Update digit_string to compare against the char instead of the pointer. + +Signed-off-by: Joakim Bech +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/linux/ofpath.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 4308fceda35..1c30e723305 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -362,7 +362,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), + digit_string = trailing_digits (device); + part_end = devicenode + strlen (devicenode) - 1; + +- if ((digit_string != '\0') && (*part_end == 'p')) ++ if ((*digit_string != '\0') && (*part_end == 'p')) + { + /* We have a partition number, strip it off. */ + int part; diff --git a/0113-aout.h-Fix-missing-include.patch b/0113-aout.h-Fix-missing-include.patch new file mode 100644 index 00000000..a3c37397 --- /dev/null +++ b/0113-aout.h-Fix-missing-include.patch @@ -0,0 +1,27 @@ +From e1ead149efadf420fe16d2ce0b109a6982b8a5f6 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:23 -0500 +Subject: [PATCH] aout.h: Fix missing include. + +grub_aout_load() has a grub_file_t parameter, and depending on what order +includes land in, it's sometimes not defined. This patch explicitly adds +file.h to aout.h so that it will always be defined. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + include/grub/aout.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/grub/aout.h b/include/grub/aout.h +index 10d7dde61ec..c8c1d94eca5 100644 +--- a/include/grub/aout.h ++++ b/include/grub/aout.h +@@ -52,6 +52,7 @@ + #define GRUB_AOUT_HEADER 1 + + #include ++#include + + struct grub_aout32_header + { diff --git a/0114-mkimage-make-it-easier-to-run-syntax-checkers-on-gru.patch b/0114-mkimage-make-it-easier-to-run-syntax-checkers-on-gru.patch new file mode 100644 index 00000000..22222e20 --- /dev/null +++ b/0114-mkimage-make-it-easier-to-run-syntax-checkers-on-gru.patch @@ -0,0 +1,65 @@ +From 352868d1234c94393e84871072372d73cb1166fa Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:24 -0500 +Subject: [PATCH] mkimage: make it easier to run syntax checkers on + grub-mkimagexx.c + +This makes it so you can treat grub-mkimagexx.c as a file you can build +directly, so syntax checkers like vim's "syntastic" plugin, which uses +"gcc -x c -fsyntax-only" to build it, will work. + +One still has to do whatever setup is required to make it pick the right +include dirs, which -W options we use, etc., but this makes it so you +can do the checking on the file you're editing, rather than on a +different file. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + util/grub-mkimage32.c | 2 ++ + util/grub-mkimage64.c | 2 ++ + util/grub-mkimagexx.c | 9 +++++++++ + 3 files changed, 13 insertions(+) + +diff --git a/util/grub-mkimage32.c b/util/grub-mkimage32.c +index 9b31397bc40..1f2ccccd225 100644 +--- a/util/grub-mkimage32.c ++++ b/util/grub-mkimage32.c +@@ -19,4 +19,6 @@ + # define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) + #define XEN_NOTE_SIZE 132 + ++#ifndef GRUB_MKIMAGEXX + #include "grub-mkimagexx.c" ++#endif +diff --git a/util/grub-mkimage64.c b/util/grub-mkimage64.c +index d8334592470..4ff72a625e0 100644 +--- a/util/grub-mkimage64.c ++++ b/util/grub-mkimage64.c +@@ -19,4 +19,6 @@ + # define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) + #define XEN_NOTE_SIZE 120 + ++#ifndef GRUB_MKIMAGEXX + #include "grub-mkimagexx.c" ++#endif +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 39d7efb914a..97ff599f073 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -50,6 +50,15 @@ + + #pragma GCC diagnostic ignored "-Wcast-align" + ++#define GRUB_MKIMAGEXX ++#if !defined(MKIMAGE_ELF32) && !defined(MKIMAGE_ELF64) ++#if __SIZEOF_POINTER__ == 8 ++#include "grub-mkimage64.c" ++#else ++#include "grub-mkimage32.c" ++#endif ++#endif ++ + /* These structures are defined according to the CHRP binding to IEEE1275, + "Client Program Format" section. */ + diff --git a/0115-mkimage-rename-a-couple-of-things-to-be-less-confusi.patch b/0115-mkimage-rename-a-couple-of-things-to-be-less-confusi.patch new file mode 100644 index 00000000..91c5e70d --- /dev/null +++ b/0115-mkimage-rename-a-couple-of-things-to-be-less-confusi.patch @@ -0,0 +1,100 @@ +From 594ac31571970611958b00284f9ca4c6f6c1286d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:25 -0500 +Subject: [PATCH] mkimage: rename a couple of things to be less confusing + later. + +This renames some things: + +- the "strtab" and "strtab_section" in relocate_symbols are changed to "symtab" + instead, so as to be less confusing when "strtab" is moved to a struct in a + later patch. + +- The places where we pass section_vaddresses to functions are changed to also + be called section_vaddresses"inside those functions, so I get less confused + when I put addresses and vaddresses in a struct in a later patch. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + util/grub-mkimagexx.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 97ff599f073..85753448ee1 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -509,7 +509,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc + Return the address of a start symbol. */ + static Elf_Addr + SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, +- Elf_Shdr *symtab_section, Elf_Addr *section_addresses, ++ Elf_Shdr *symtab_section, Elf_Addr *section_vaddresses, + Elf_Half section_entsize, Elf_Half num_sections, + void *jumpers, Elf_Addr jumpers_addr, + Elf_Addr bss_start, Elf_Addr end, +@@ -520,15 +520,15 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Addr start_address = (Elf_Addr) -1; + Elf_Sym *sym; + Elf_Word i; +- Elf_Shdr *strtab_section; +- const char *strtab; ++ Elf_Shdr *symtab_link_section; ++ const char *symtab; + grub_uint64_t *jptr = jumpers; + +- strtab_section ++ symtab_link_section + = (Elf_Shdr *) ((char *) sections + + (grub_target_to_host32 (symtab_section->sh_link) + * section_entsize)); +- strtab = (char *) e + grub_target_to_host (strtab_section->sh_offset); ++ symtab = (char *) e + grub_target_to_host (symtab_link_section->sh_offset); + + symtab_size = grub_target_to_host (symtab_section->sh_size); + sym_size = grub_target_to_host (symtab_section->sh_entsize); +@@ -542,7 +542,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Section cur_index; + const char *name; + +- name = strtab + grub_target_to_host32 (sym->st_name); ++ name = symtab + grub_target_to_host32 (sym->st_name); + + cur_index = grub_target_to_host16 (sym->st_shndx); + if (cur_index == STN_ABS) +@@ -565,7 +565,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + else + { + sym->st_value = (grub_target_to_host (sym->st_value) +- + section_addresses[cur_index]); ++ + section_vaddresses[cur_index]); + } + + if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) +@@ -580,7 +580,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + grub_util_info ("locating %s at 0x%" GRUB_HOST_PRIxLONG_LONG + " (0x%" GRUB_HOST_PRIxLONG_LONG ")", name, + (unsigned long long) sym->st_value, +- (unsigned long long) section_addresses[cur_index]); ++ (unsigned long long) section_vaddresses[cur_index]); + + if (start_address == (Elf_Addr)-1) + if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0) +@@ -1644,7 +1644,7 @@ create_u64_fixups (struct translate_context *ctx, + /* Make a .reloc section. */ + static void + make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, +- Elf_Addr *section_addresses, Elf_Shdr *sections, ++ Elf_Addr *section_vaddresses, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, + const char *strtab, + const struct grub_install_image_target_desc *image_target) +@@ -1674,7 +1674,7 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, + rtab_offset = grub_target_to_host (s->sh_offset); + num_rs = rtab_size / r_size; + +- section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)]; ++ section_address = section_vaddresses[grub_le_to_cpu32 (s->sh_info)]; + + for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); + j < num_rs; diff --git a/0116-mkimage-make-locate_sections-set-up-vaddresses-as-we.patch b/0116-mkimage-make-locate_sections-set-up-vaddresses-as-we.patch new file mode 100644 index 00000000..db8ed139 --- /dev/null +++ b/0116-mkimage-make-locate_sections-set-up-vaddresses-as-we.patch @@ -0,0 +1,109 @@ +From e30de94926ec5250d7a0a091aef38b9071c97f6a Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:26 -0500 +Subject: [PATCH] mkimage: make locate_sections() set up vaddresses as well. + +This puts both kinds of address initialization at the same place, and also lets +us iterate through the section list one time fewer. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + util/grub-mkimagexx.c | 49 ++++++++++++++++++++++++------------------------- + 1 file changed, 24 insertions(+), 25 deletions(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 85753448ee1..851339becd5 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -1784,18 +1784,19 @@ SUFFIX (put_section) (Elf_Shdr *s, int i, + return current_address; + } + +-/* Locate section addresses by merging code sections and data sections +- into .text and .data, respectively. Return the array of section +- addresses. */ +-static Elf_Addr * ++/* ++ * Locate section addresses by merging code sections and data sections ++ * into .text and .data, respectively. ++ */ ++static void + SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + Elf_Shdr *sections, Elf_Half section_entsize, +- Elf_Half num_sections, const char *strtab, ++ Elf_Half num_sections, Elf_Addr *section_addresses, ++ Elf_Addr *section_vaddresses, const char *strtab, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) + { + int i; +- Elf_Addr *section_addresses; + Elf_Shdr *s; + + layout->align = 1; +@@ -1803,8 +1804,6 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + if (image_target->elf_target == EM_AARCH64) + layout->align = 4096; + +- section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); +- memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); + + layout->kernel_size = 0; + +@@ -1880,12 +1879,16 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) +- if (SUFFIX (is_bss_section) (s, image_target)) +- layout->end = SUFFIX (put_section) (s, i, +- layout->end, +- section_addresses, +- strtab, +- image_target); ++ { ++ if (SUFFIX (is_bss_section) (s, image_target)) ++ layout->end = SUFFIX (put_section) (s, i, layout->end, ++ section_addresses, strtab, ++ image_target); ++ /* ++ * This must to be in the last time this function passes through the loop. ++ */ ++ section_vaddresses[i] = section_addresses[i] + image_target->vaddr_offset; ++ } + + layout->end = ALIGN_UP (layout->end + image_target->vaddr_offset, + image_target->section_align) - image_target->vaddr_offset; +@@ -1896,8 +1899,6 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + */ + if (image_target->id == IMAGE_EFI || !is_relocatable (image_target)) + layout->kernel_size = layout->end; +- +- return section_addresses; + } + + char * +@@ -1946,16 +1947,14 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + + grub_host_to_target16 (e->e_shstrndx) * section_entsize); + strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); + +- section_addresses = SUFFIX (locate_sections) (e, kernel_path, +- sections, section_entsize, +- num_sections, strtab, +- layout, +- image_target); ++ section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); ++ memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); ++ section_vaddresses = xmalloc (sizeof (*section_vaddresses) * num_sections); ++ memset (section_vaddresses, 0, sizeof (*section_vaddresses) * num_sections); + +- section_vaddresses = xmalloc (sizeof (*section_addresses) * num_sections); +- +- for (i = 0; i < num_sections; i++) +- section_vaddresses[i] = section_addresses[i] + image_target->vaddr_offset; ++ SUFFIX (locate_sections) (e, kernel_path, sections, section_entsize, num_sections, ++ section_addresses, section_vaddresses, strtab, layout, ++ image_target); + + if (!is_relocatable (image_target)) + { diff --git a/0117-mkimage-refactor-a-bunch-of-section-data-into-a-stru.patch b/0117-mkimage-refactor-a-bunch-of-section-data-into-a-stru.patch new file mode 100644 index 00000000..31ea8606 --- /dev/null +++ b/0117-mkimage-refactor-a-bunch-of-section-data-into-a-stru.patch @@ -0,0 +1,566 @@ +From 7542af695f338a2b5b86d8cab5cac0d235d47c38 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:27 -0500 +Subject: [PATCH] mkimage: refactor a bunch of section data into a struct. + +This basically moves a bunch of the section information we pass around a +lot into a struct, and passes a pointer to a single one of those +instead. + +This shouldn't change the binary file output or the "grub-mkimage -v" +output in any way. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + util/grub-mkimagexx.c | 261 ++++++++++++++++++++++---------------------------- + 1 file changed, 115 insertions(+), 146 deletions(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 851339becd5..5de34d53cb7 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -93,6 +93,17 @@ struct fixup_block_list + + #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) + ++struct section_metadata ++{ ++ Elf_Half num_sections; ++ Elf_Shdr *sections; ++ Elf_Addr *addrs; ++ Elf_Addr *vaddrs; ++ Elf_Half section_entsize; ++ Elf_Shdr *symtab; ++ const char *strtab; ++}; ++ + static int + is_relocatable (const struct grub_install_image_target_desc *image_target) + { +@@ -508,9 +519,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc + /* Relocate symbols; note that this function overwrites the symbol table. + Return the address of a start symbol. */ + static Elf_Addr +-SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, +- Elf_Shdr *symtab_section, Elf_Addr *section_vaddresses, +- Elf_Half section_entsize, Elf_Half num_sections, ++SUFFIX (relocate_symbols) (Elf_Ehdr *e, struct section_metadata *smd, + void *jumpers, Elf_Addr jumpers_addr, + Elf_Addr bss_start, Elf_Addr end, + const struct grub_install_image_target_desc *image_target) +@@ -520,19 +529,18 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Addr start_address = (Elf_Addr) -1; + Elf_Sym *sym; + Elf_Word i; +- Elf_Shdr *symtab_link_section; ++ Elf_Shdr *symtab_section; + const char *symtab; + grub_uint64_t *jptr = jumpers; + +- symtab_link_section +- = (Elf_Shdr *) ((char *) sections +- + (grub_target_to_host32 (symtab_section->sh_link) +- * section_entsize)); +- symtab = (char *) e + grub_target_to_host (symtab_link_section->sh_offset); ++ symtab_section = (Elf_Shdr *) ((char *) smd->sections ++ + grub_target_to_host32 (smd->symtab->sh_link) ++ * smd->section_entsize); ++ symtab = (char *) e + grub_target_to_host (symtab_section->sh_offset); + +- symtab_size = grub_target_to_host (symtab_section->sh_size); +- sym_size = grub_target_to_host (symtab_section->sh_entsize); +- symtab_offset = grub_target_to_host (symtab_section->sh_offset); ++ symtab_size = grub_target_to_host (smd->symtab->sh_size); ++ sym_size = grub_target_to_host (smd->symtab->sh_entsize); ++ symtab_offset = grub_target_to_host (smd->symtab->sh_offset); + num_syms = symtab_size / sym_size; + + for (i = 0, sym = (Elf_Sym *) ((char *) e + symtab_offset); +@@ -560,12 +568,12 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + else + continue; + } +- else if (cur_index >= num_sections) ++ else if (cur_index >= smd->num_sections) + grub_util_error ("section %d does not exist", cur_index); + else + { + sym->st_value = (grub_target_to_host (sym->st_value) +- + section_vaddresses[cur_index]); ++ + smd->vaddrs[cur_index]); + } + + if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) +@@ -580,7 +588,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, + grub_util_info ("locating %s at 0x%" GRUB_HOST_PRIxLONG_LONG + " (0x%" GRUB_HOST_PRIxLONG_LONG ")", name, + (unsigned long long) sym->st_value, +- (unsigned long long) section_vaddresses[cur_index]); ++ (unsigned long long) smd->vaddrs[cur_index]); + + if (start_address == (Elf_Addr)-1) + if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0) +@@ -722,12 +730,8 @@ arm_get_trampoline_size (Elf_Ehdr *e, + addresses can be fully resolved. Absolute addresses must be relocated + again by a PE32 relocator when loaded. */ + static void +-SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, +- Elf_Addr *section_addresses, +- Elf_Half section_entsize, Elf_Half num_sections, +- const char *strtab, +- char *pe_target, Elf_Addr tramp_off, +- Elf_Addr got_off, ++SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, ++ char *pe_target, Elf_Addr tramp_off, Elf_Addr got_off, + const struct grub_install_image_target_desc *image_target) + { + Elf_Half i; +@@ -741,33 +745,29 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + grub_uint32_t *tr = (void *) (pe_target + tramp_off); + #endif + +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd->sections; ++ i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) + if ((s->sh_type == grub_host_to_target32 (SHT_REL)) || + (s->sh_type == grub_host_to_target32 (SHT_RELA))) + { + Elf_Rela *r; + Elf_Word rtab_size, r_size, num_rs; + Elf_Off rtab_offset; +- Elf_Shdr *symtab_section; + Elf_Word target_section_index; + Elf_Addr target_section_addr; + Elf_Shdr *target_section; + Elf_Word j; + +- symtab_section = (Elf_Shdr *) ((char *) sections +- + (grub_target_to_host32 (s->sh_link) +- * section_entsize)); + target_section_index = grub_target_to_host32 (s->sh_info); +- target_section_addr = section_addresses[target_section_index]; +- target_section = (Elf_Shdr *) ((char *) sections ++ target_section_addr = smd->addrs[target_section_index]; ++ target_section = (Elf_Shdr *) ((char *) smd->sections + + (target_section_index +- * section_entsize)); ++ * smd->section_entsize)); + + grub_util_info ("dealing with the relocation section %s for %s", +- strtab + grub_target_to_host32 (s->sh_name), +- strtab + grub_target_to_host32 (target_section->sh_name)); ++ smd->strtab + grub_target_to_host32 (s->sh_name), ++ smd->strtab + grub_target_to_host32 (target_section->sh_name)); + + rtab_size = grub_target_to_host (s->sh_size); + r_size = grub_target_to_host (s->sh_entsize); +@@ -788,7 +788,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + target = SUFFIX (get_target_address) (e, target_section, + offset, image_target); + info = grub_target_to_host (r->r_info); +- sym_addr = SUFFIX (get_symbol_address) (e, symtab_section, ++ sym_addr = SUFFIX (get_symbol_address) (e, smd->symtab, + ELF_R_SYM (info), image_target); + + addend = (s->sh_type == grub_target_to_host32 (SHT_RELA)) ? +@@ -919,8 +919,8 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Sym *sym; + + sym = (Elf_Sym *) ((char *) e +- + grub_target_to_host (symtab_section->sh_offset) +- + ELF_R_SYM (info) * grub_target_to_host (symtab_section->sh_entsize)); ++ + grub_target_to_host (smd->symtab->sh_offset) ++ + ELF_R_SYM (info) * grub_target_to_host (smd->symtab->sh_entsize)); + if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) + sym_addr = grub_target_to_host64 (*(grub_uint64_t *) (pe_target + + sym->st_value +@@ -1105,8 +1105,8 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, + - (char *) e), + sym_addr); + sym = (Elf_Sym *) ((char *) e +- + grub_target_to_host (symtab_section->sh_offset) +- + ELF_R_SYM (info) * grub_target_to_host (symtab_section->sh_entsize)); ++ + grub_target_to_host (smd->symtab->sh_offset) ++ + ELF_R_SYM (info) * grub_target_to_host (smd->symtab->sh_entsize)); + if (ELF_ST_TYPE (sym->st_info) != STT_FUNC) + sym_addr |= 1; + if (!(sym_addr & 1)) +@@ -1644,9 +1644,7 @@ create_u64_fixups (struct translate_context *ctx, + /* Make a .reloc section. */ + static void + make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, +- Elf_Addr *section_vaddresses, Elf_Shdr *sections, +- Elf_Half section_entsize, Elf_Half num_sections, +- const char *strtab, ++ struct section_metadata *smd, + const struct grub_install_image_target_desc *image_target) + { + unsigned i; +@@ -1655,8 +1653,8 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, + + translate_reloc_start (&ctx, image_target); + +- for (i = 0, s = sections; i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd->sections; i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) + if ((grub_target_to_host32 (s->sh_type) == SHT_REL) || + (grub_target_to_host32 (s->sh_type) == SHT_RELA)) + { +@@ -1667,14 +1665,14 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, + Elf_Word j; + + grub_util_info ("translating the relocation section %s", +- strtab + grub_le_to_cpu32 (s->sh_name)); ++ smd->strtab + grub_le_to_cpu32 (s->sh_name)); + + rtab_size = grub_target_to_host (s->sh_size); + r_size = grub_target_to_host (s->sh_entsize); + rtab_offset = grub_target_to_host (s->sh_offset); + num_rs = rtab_size / r_size; + +- section_address = section_vaddresses[grub_le_to_cpu32 (s->sh_info)]; ++ section_address = smd->vaddrs[grub_le_to_cpu32 (s->sh_info)]; + + for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); + j < num_rs; +@@ -1761,12 +1759,11 @@ SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_i + static Elf_Addr + SUFFIX (put_section) (Elf_Shdr *s, int i, + Elf_Addr current_address, +- Elf_Addr *section_addresses, +- const char *strtab, ++ struct section_metadata *smd, + const struct grub_install_image_target_desc *image_target) + { + Elf_Word align = grub_host_to_target_addr (s->sh_addralign); +- const char *name = strtab + grub_host_to_target32 (s->sh_name); ++ const char *name = smd->strtab + grub_host_to_target32 (s->sh_name); + + if (align) + current_address = ALIGN_UP (current_address + image_target->vaddr_offset, +@@ -1778,8 +1775,8 @@ SUFFIX (put_section) (Elf_Shdr *s, int i, + name, (unsigned long long) current_address); + if (!is_relocatable (image_target)) + current_address = grub_host_to_target_addr (s->sh_addr) +- - image_target->link_addr; +- section_addresses[i] = current_address; ++ - image_target->link_addr; ++ smd->addrs[i] = current_address; + current_address += grub_host_to_target_addr (s->sh_size); + return current_address; + } +@@ -1790,9 +1787,7 @@ SUFFIX (put_section) (Elf_Shdr *s, int i, + */ + static void + SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, +- Elf_Shdr *sections, Elf_Half section_entsize, +- Elf_Half num_sections, Elf_Addr *section_addresses, +- Elf_Addr *section_vaddresses, const char *strtab, ++ struct section_metadata *smd, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) + { +@@ -1804,28 +1799,23 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + if (image_target->elf_target == EM_AARCH64) + layout->align = 4096; + +- + layout->kernel_size = 0; + +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) +- if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) ++ for (i = 0, s = smd->sections; ++ i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) ++ if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) + && grub_host_to_target32 (s->sh_addralign) > layout->align) + layout->align = grub_host_to_target32 (s->sh_addralign); + +- + /* .text */ +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd->sections; ++ i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) + if (SUFFIX (is_text_section) (s, image_target)) + { +- layout->kernel_size = SUFFIX (put_section) (s, i, +- layout->kernel_size, +- section_addresses, +- strtab, +- image_target); ++ layout->kernel_size = SUFFIX (put_section) (s, i, layout->kernel_size, ++ smd, image_target); + if (!is_relocatable (image_target) && + grub_host_to_target_addr (s->sh_addr) != image_target->link_addr) + { +@@ -1845,15 +1835,12 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + layout->exec_size = layout->kernel_size; + + /* .data */ +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd->sections; ++ i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) + if (SUFFIX (is_data_section) (s, image_target)) +- layout->kernel_size = SUFFIX (put_section) (s, i, +- layout->kernel_size, +- section_addresses, +- strtab, +- image_target); ++ layout->kernel_size = SUFFIX (put_section) (s, i, layout->kernel_size, smd, ++ image_target); + + #ifdef MKIMAGE_ELF32 + if (image_target->elf_target == EM_ARM) +@@ -1864,8 +1851,8 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); + +- tramp = arm_get_trampoline_size (e, sections, section_entsize, +- num_sections, image_target); ++ tramp = arm_get_trampoline_size (e, smd->sections, smd->section_entsize, ++ smd->num_sections, image_target); + + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); +@@ -1876,18 +1863,17 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + layout->end = layout->kernel_size; + + /* .bss */ +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd->sections; ++ i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) + { + if (SUFFIX (is_bss_section) (s, image_target)) +- layout->end = SUFFIX (put_section) (s, i, layout->end, +- section_addresses, strtab, +- image_target); ++ layout->end = SUFFIX (put_section) (s, i, layout->end, smd, image_target); ++ + /* + * This must to be in the last time this function passes through the loop. + */ +- section_vaddresses[i] = section_addresses[i] + image_target->vaddr_offset; ++ smd->vaddrs[i] = smd->addrs[i] + image_target->vaddr_offset; + } + + layout->end = ALIGN_UP (layout->end + image_target->vaddr_offset, +@@ -1908,18 +1894,12 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + const struct grub_install_image_target_desc *image_target) + { + char *kernel_img, *out_img; +- const char *strtab; ++ struct section_metadata smd = { 0, }; + Elf_Ehdr *e; +- Elf_Shdr *sections; +- Elf_Addr *section_addresses; +- Elf_Addr *section_vaddresses; + int i; + Elf_Shdr *s; +- Elf_Half num_sections; + Elf_Off section_offset; +- Elf_Half section_entsize; + grub_size_t kernel_size; +- Elf_Shdr *symtab_section = 0; + + grub_memset (layout, 0, sizeof (*layout)); + +@@ -1934,46 +1914,45 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + grub_util_error ("invalid ELF header"); + + section_offset = grub_target_to_host (e->e_shoff); +- section_entsize = grub_target_to_host16 (e->e_shentsize); +- num_sections = grub_target_to_host16 (e->e_shnum); ++ smd.section_entsize = grub_target_to_host16 (e->e_shentsize); ++ smd.num_sections = grub_target_to_host16 (e->e_shnum); + +- if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections) ++ if (kernel_size < section_offset ++ + (grub_uint32_t) smd.section_entsize * smd.num_sections) + grub_util_error (_("premature end of file %s"), kernel_path); + +- sections = (Elf_Shdr *) (kernel_img + section_offset); ++ smd.sections = (Elf_Shdr *) (kernel_img + section_offset); + + /* Relocate sections then symbols in the virtual address space. */ +- s = (Elf_Shdr *) ((char *) sections +- + grub_host_to_target16 (e->e_shstrndx) * section_entsize); +- strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); ++ s = (Elf_Shdr *) ((char *) smd.sections ++ + grub_host_to_target16 (e->e_shstrndx) * smd.section_entsize); ++ smd.strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); + +- section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); +- memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); +- section_vaddresses = xmalloc (sizeof (*section_vaddresses) * num_sections); +- memset (section_vaddresses, 0, sizeof (*section_vaddresses) * num_sections); ++ smd.addrs = xmalloc (sizeof (*smd.addrs) * smd.num_sections); ++ memset (smd.addrs, 0, sizeof (*smd.addrs) * smd.num_sections); ++ smd.vaddrs = xmalloc (sizeof (*smd.vaddrs) * smd.num_sections); ++ memset (smd.vaddrs, 0, sizeof (*smd.vaddrs) * smd.num_sections); + +- SUFFIX (locate_sections) (e, kernel_path, sections, section_entsize, num_sections, +- section_addresses, section_vaddresses, strtab, layout, +- image_target); ++ SUFFIX (locate_sections) (e, kernel_path, &smd, layout, image_target); + + if (!is_relocatable (image_target)) + { + Elf_Addr current_address = layout->kernel_size; + +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd.sections; ++ i < smd.num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd.section_entsize)) + if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) + { + Elf_Word sec_align = grub_host_to_target_addr (s->sh_addralign); +- const char *name = strtab + grub_host_to_target32 (s->sh_name); ++ const char *name = smd.strtab + grub_host_to_target32 (s->sh_name); + + if (sec_align) + current_address = ALIGN_UP (current_address + + image_target->vaddr_offset, + sec_align) + - image_target->vaddr_offset; +- ++ + grub_util_info ("locating the section %s at 0x%" + GRUB_HOST_PRIxLONG_LONG, + name, (unsigned long long) current_address); +@@ -1981,7 +1960,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + current_address = grub_host_to_target_addr (s->sh_addr) + - image_target->link_addr; + +- section_vaddresses[i] = current_address ++ smd.vaddrs[i] = current_address + + image_target->vaddr_offset; + current_address += grub_host_to_target_addr (s->sh_size); + } +@@ -2002,16 +1981,16 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + + if (is_relocatable (image_target)) + { +- symtab_section = NULL; +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ smd.symtab = NULL; ++ for (i = 0, s = smd.sections; ++ i < smd.num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd.section_entsize)) + if (s->sh_type == grub_host_to_target32 (SHT_SYMTAB)) + { +- symtab_section = s; ++ smd.symtab = s; + break; + } +- if (! symtab_section) ++ if (! smd.symtab) + grub_util_error ("%s", _("no symbol table")); + #ifdef MKIMAGE_ELF64 + if (image_target->elf_target == EM_IA_64) +@@ -2026,7 +2005,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + layout->kernel_size += ALIGN_UP (tramp, 16); + + layout->ia64jmp_off = layout->kernel_size; +- layout->ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, ++ layout->ia64jmpnum = SUFFIX (count_funcs) (e, smd.symtab, + image_target); + layout->kernel_size += 16 * layout->ia64jmpnum; + +@@ -2057,31 +2036,19 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + + if (is_relocatable (image_target)) + { +- layout->start_address = SUFFIX (relocate_symbols) (e, sections, symtab_section, +- section_vaddresses, section_entsize, +- num_sections, +- (char *) out_img + layout->ia64jmp_off, +- layout->ia64jmp_off +- + image_target->vaddr_offset, +- layout->bss_start, +- layout->end, +- image_target); ++ layout->start_address = SUFFIX (relocate_symbols) (e, &smd, ++ (char *) out_img + layout->ia64jmp_off, ++ layout->ia64jmp_off + image_target->vaddr_offset, ++ layout->bss_start, layout->end, image_target); ++ + if (layout->start_address == (Elf_Addr) -1) + grub_util_error ("start symbol is not defined"); + +- /* Resolve addresses in the virtual address space. */ +- SUFFIX (relocate_addresses) (e, sections, section_addresses, +- section_entsize, +- num_sections, strtab, +- out_img, layout->tramp_off, +- layout->got_off, +- image_target); ++ /* Resolve addrs in the virtual address space. */ ++ SUFFIX (relocate_addrs) (e, &smd, out_img, layout->tramp_off, ++ layout->got_off, image_target); + +- make_reloc_section (e, layout, +- section_vaddresses, sections, +- section_entsize, num_sections, +- strtab, +- image_target); ++ make_reloc_section (e, layout, &smd, image_target); + if (image_target->id != IMAGE_EFI) + { + out_img = xrealloc (out_img, layout->kernel_size + total_module_size +@@ -2093,9 +2060,9 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + } + } + +- for (i = 0, s = sections; +- i < num_sections; +- i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) ++ for (i = 0, s = smd.sections; ++ i < smd.num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd.section_entsize)) + if (SUFFIX (is_data_section) (s, image_target) + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. +@@ -2106,17 +2073,19 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + || SUFFIX (is_text_section) (s, image_target)) + { + if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) +- memset (out_img + section_addresses[i], 0, ++ memset (out_img + smd.addrs[i], 0, + grub_host_to_target_addr (s->sh_size)); + else +- memcpy (out_img + section_addresses[i], ++ memcpy (out_img + smd.addrs[i], + kernel_img + grub_host_to_target_addr (s->sh_offset), + grub_host_to_target_addr (s->sh_size)); + } + free (kernel_img); + +- free (section_vaddresses); +- free (section_addresses); ++ free (smd.vaddrs); ++ smd.vaddrs = NULL; ++ free (smd.addrs); ++ smd.addrs = NULL; + + return out_img; + } diff --git a/0118-mkimage-avoid-copying-relocations-for-sections-that-.patch b/0118-mkimage-avoid-copying-relocations-for-sections-that-.patch new file mode 100644 index 00000000..45617ee6 --- /dev/null +++ b/0118-mkimage-avoid-copying-relocations-for-sections-that-.patch @@ -0,0 +1,160 @@ +From ebc825b5491185b39ecd24b1674a76f60492dc60 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:28 -0500 +Subject: [PATCH] mkimage: avoid copying relocations for sections that won't be + copied. + +Some versions of gcc include a plugin called "annobin", and in some +build systems this is enabled by default. This plugin creates special +ELF note sections to track which ABI-breaking features are used by a +binary, as well as a series of relocations to annotate where. + +If grub is compiled with this feature, then when grub-mkimage translates +the binary to another file format which does not strongly associate +relocation data with sections (i.e. when platform is *-efi), these +relocations appear to be against the .text section rather than the +original note section. When the binary is loaded by the PE runtime +loader, hilarity ensues. + +This issue is not necessarily limited to the annobin, but could arise +any time there are relocations in sections that are not represented in +grub-mkimage's output. + +This patch seeks to avoid this issue by only including relocations that +refer to sections which will be included in the final binary. + +As an aside, this should also obviate the need to avoid -funwind-tables, +-fasynchronous-unwind-tables, and any sections similar to .eh_frame in +the future. I've tested it on x86-64-efi with the following gcc command +line options (as recorded by -grecord-gcc-flags), but I still need to +test the result on some other platforms that have been problematic in +the past (especially ARM Aarch64) before I feel comfortable making +changes to the configure.ac bits: + +GNU C11 7.2.1 20180116 (Red Hat 7.2.1-7) -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -msoft-float -mno-stack-arg-probe -mcmodel=large -mno-red-zone -m64 -mtune=generic -march=x86-64 -g3 -Os -freg-struct-return -fno-stack-protector -ffreestanding -funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing -fstack-clash-protection -fno-ident -fplugin=annobin + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + util/grub-mkimagexx.c | 80 +++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 72 insertions(+), 8 deletions(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 5de34d53cb7..11d05d7a8ec 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -725,6 +725,12 @@ arm_get_trampoline_size (Elf_Ehdr *e, + } + #endif + ++static int ++SUFFIX (is_kept_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target); ++static int ++SUFFIX (is_kept_reloc_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target, ++ struct section_metadata *smd); ++ + /* Deal with relocation information. This function relocates addresses + within the virtual address space starting from 0. So only relative + addresses can be fully resolved. Absolute addresses must be relocated +@@ -759,6 +765,14 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, + Elf_Shdr *target_section; + Elf_Word j; + ++ if (!SUFFIX (is_kept_section) (s, image_target) && ++ !SUFFIX (is_kept_reloc_section) (s, image_target, smd)) ++ { ++ grub_util_info ("not translating relocations for omitted section %s", ++ smd->strtab + grub_le_to_cpu32 (s->sh_name)); ++ continue; ++ } ++ + target_section_index = grub_target_to_host32 (s->sh_info); + target_section_addr = smd->addrs[target_section_index]; + target_section = (Elf_Shdr *) ((char *) smd->sections +@@ -1664,6 +1678,13 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, + Elf_Addr section_address; + Elf_Word j; + ++ if (!SUFFIX (is_kept_reloc_section) (s, image_target, smd)) ++ { ++ grub_util_info ("not translating the skipped relocation section %s", ++ smd->strtab + grub_le_to_cpu32 (s->sh_name)); ++ continue; ++ } ++ + grub_util_info ("translating the relocation section %s", + smd->strtab + grub_le_to_cpu32 (s->sh_name)); + +@@ -1739,6 +1760,56 @@ SUFFIX (is_bss_section) (Elf_Shdr *s, const struct grub_install_image_target_des + == SHF_ALLOC) && (grub_target_to_host32 (s->sh_type) == SHT_NOBITS); + } + ++/* Determine if a section is going to be in the final output */ ++static int ++SUFFIX (is_kept_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) ++{ ++ /* We keep .text and .data */ ++ if (SUFFIX (is_text_section) (s, image_target) ++ || SUFFIX (is_data_section) (s, image_target)) ++ return 1; ++ ++ /* ++ * And we keep .bss if we're producing PE binaries or the target doesn't ++ * have a relocating loader. Platforms other than EFI and U-boot shouldn't ++ * have .bss in their binaries as we build with -Wl,-Ttext. ++ */ ++ if (SUFFIX (is_bss_section) (s, image_target) ++ && (image_target->id == IMAGE_EFI || !is_relocatable (image_target))) ++ return 1; ++ ++ /* Otherwise this is not a section we're keeping in the final output. */ ++ return 0; ++} ++ ++static int ++SUFFIX (is_kept_reloc_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target, ++ struct section_metadata *smd) ++{ ++ int i; ++ int r = 0; ++ const char *name = smd->strtab + grub_host_to_target32 (s->sh_name); ++ ++ if (!strncmp (name, ".rela.", 6)) ++ name += 5; ++ else if (!strncmp (name, ".rel.", 5)) ++ name += 4; ++ else ++ return 1; ++ ++ for (i = 0, s = smd->sections; i < smd->num_sections; ++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize)) ++ { ++ const char *sname = smd->strtab + grub_host_to_target32 (s->sh_name); ++ if (strcmp (sname, name)) ++ continue; ++ ++ return SUFFIX (is_kept_section) (s, image_target); ++ } ++ ++ return r; ++} ++ + /* Return if the ELF header is valid. */ + static int + SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_image_target_desc *image_target) +@@ -2063,14 +2134,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + for (i = 0, s = smd.sections; + i < smd.num_sections; + i++, s = (Elf_Shdr *) ((char *) s + smd.section_entsize)) +- if (SUFFIX (is_data_section) (s, image_target) +- /* Explicitly initialize BSS +- when producing PE32 to avoid a bug in EFI implementations. +- Platforms other than EFI and U-boot shouldn't have .bss in +- their binaries as we build with -Wl,-Ttext. +- */ +- || (SUFFIX (is_bss_section) (s, image_target) && (image_target->id == IMAGE_EFI || !is_relocatable (image_target))) +- || SUFFIX (is_text_section) (s, image_target)) ++ if (SUFFIX (is_kept_section) (s, image_target)) + { + if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) + memset (out_img + smd.addrs[i], 0, diff --git a/0119-.mod-files-Strip-annobin-annotations-and-.eh_frame-a.patch b/0119-.mod-files-Strip-annobin-annotations-and-.eh_frame-a.patch new file mode 100644 index 00000000..dfd120c1 --- /dev/null +++ b/0119-.mod-files-Strip-annobin-annotations-and-.eh_frame-a.patch @@ -0,0 +1,32 @@ +From 413f1e13e69e1df130e9f39684fb7c0c216e5035 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 21 Feb 2018 15:20:29 -0500 +Subject: [PATCH] .mod files: Strip annobin annotations and .eh_frame, and + their relocations + +This way debuginfo built from the .module will still include this +information, but the final result won't have the data we don't actually +need in the modules, either on-disk, loaded at runtime, or in prebuilt +images. + +Signed-off-by: Peter Jones +Reviewed-by: Daniel Kiper +--- + grub-core/genmod.sh.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in +index 3de06ee018f..1250589b3f5 100644 +--- a/grub-core/genmod.sh.in ++++ b/grub-core/genmod.sh.in +@@ -58,6 +58,10 @@ if test x@TARGET_APPLE_LINKER@ != x1; then + -K grub_mod_init -K grub_mod_fini \ + -K _grub_mod_init -K _grub_mod_fini \ + -R .note.gnu.gold-version -R .note.GNU-stack \ ++ -R .gnu.build.attributes \ ++ -R .rel.gnu.build.attributes \ ++ -R .rela.gnu.build.attributes \ ++ -R .eh_frame -R .rela.eh_frame -R .rel.eh_frame \ + -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 + fi + if ! test -z "${TARGET_OBJ2ELF}"; then diff --git a/0120-ieee1275-Fix-crash-in-of_path_of_nvme-when-of_path-i.patch b/0120-ieee1275-Fix-crash-in-of_path_of_nvme-when-of_path-i.patch new file mode 100644 index 00000000..220166fb --- /dev/null +++ b/0120-ieee1275-Fix-crash-in-of_path_of_nvme-when-of_path-i.patch @@ -0,0 +1,41 @@ +From 25b2b22d5457b21ccd764c4e5af6ce37ba25b975 Mon Sep 17 00:00:00 2001 +From: John Paul Adrian Glaubitz +Date: Thu, 1 Mar 2018 23:34:53 +0100 +Subject: [PATCH] ieee1275: Fix crash in of_path_of_nvme when of_path is empty + +The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme +support within ofpath) introduced a functional regression: + +On systems which are not based on Open Firmware but have at +least one NVME device, find_obppath will return NULL and thus +trying to append the disk name to of_path will result in a +crash. + +The proper behavior of of_path_of_nvme is, however, to just +return NULL in such cases, like other users of find_obppath, +such as of_path_of_scsi. + +Signed-off-by: John Paul Adrian Glaubitz +Reviewed-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/linux/ofpath.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 1c30e723305..61806212e83 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -389,8 +389,11 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), + } + + of_path = find_obppath (sysfs_path); ++ ++ if (of_path) ++ strcat (of_path, disk); ++ + free (sysfs_path); +- strcat (of_path, disk); + return of_path; + } + diff --git a/0121-sparc64-Limit-nvme-of_path_of_nvme-to-just-SPARC.patch b/0121-sparc64-Limit-nvme-of_path_of_nvme-to-just-SPARC.patch new file mode 100644 index 00000000..e7c99974 --- /dev/null +++ b/0121-sparc64-Limit-nvme-of_path_of_nvme-to-just-SPARC.patch @@ -0,0 +1,47 @@ +From f35826423ed9e7618696c382e062de60bb655569 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Thu, 1 Mar 2018 19:25:09 -0800 +Subject: [PATCH] sparc64: Limit nvme of_path_of_nvme to just SPARC + +Limit NVMe of_path_of_nvme to just SPARC hardware for now. It has been +found that non-Open Firmware hardware platforms can some how access +this function. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/linux/ofpath.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 61806212e83..a6153d35954 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -350,6 +350,7 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi + return ret; + } + ++#ifdef __sparc__ + static char * + of_path_of_nvme(const char *sys_devname __attribute__((unused)), + const char *device, +@@ -396,6 +397,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), + free (sysfs_path); + return of_path; + } ++#endif + + static int + vendor_is_ATA(const char *path) +@@ -728,9 +730,11 @@ grub_util_devname_to_ofpath (const char *sys_devname) + /* All the models I've seen have a devalias "floppy". + New models have no floppy at all. */ + ofpath = xstrdup ("floppy"); ++#ifdef __sparc__ + else if (device[0] == 'n' && device[1] == 'v' && device[2] == 'm' + && device[3] == 'e') + ofpath = of_path_of_nvme (name_buf, device, devnode, devicenode); ++#endif + else + { + grub_util_warn (_("unknown device type %s"), device); diff --git a/0122-ieee1275-decode-unit-command-for-4-addr-cell-devs.patch b/0122-ieee1275-decode-unit-command-for-4-addr-cell-devs.patch new file mode 100644 index 00000000..3dcb3aea --- /dev/null +++ b/0122-ieee1275-decode-unit-command-for-4-addr-cell-devs.patch @@ -0,0 +1,94 @@ +From 6003eb2feabdae1a79b496c3d010b6d1363f1fac Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:14 -0800 +Subject: [PATCH] ieee1275: decode-unit command for 4 addr cell devs + +decode-unit ( addr len -- phys.lo ... phys.hi ) + +Convert text unit-string to physical address. + +Convert unit-string, the text string representation, to phys.lo ... phys.hi, +the numerical representation of a physical address within the address space +defined by this device node. The number of cells in the list +phys.lo ... phys.hi is determined by the value of the #address-cells +property of this node. + +This function is for devices with #address-cells == 4 + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/ieee1275.c | 41 ++++++++++++++++++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 7 ++++++- + 2 files changed, 47 insertions(+), 1 deletion(-) + +diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c +index 98217029f45..b0ac6f9f9a8 100644 +--- a/grub-core/kern/ieee1275/ieee1275.c ++++ b/grub-core/kern/ieee1275/ieee1275.c +@@ -482,6 +482,47 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) + return 0; + } + ++int ++grub_ieee1275_decode_unit4 (grub_ieee1275_ihandle_t ihandle, ++ void *addr, grub_size_t size, ++ grub_uint32_t *phy_lo, grub_uint32_t *phy_hi, ++ grub_uint32_t *lun_lo, grub_uint32_t *lun_hi) ++{ ++ struct decode_args ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t size; ++ grub_ieee1275_cell_t addr; ++ grub_ieee1275_cell_t catch_result; ++ grub_ieee1275_cell_t tgt_h; ++ grub_ieee1275_cell_t tgt_l; ++ grub_ieee1275_cell_t lun_h; ++ grub_ieee1275_cell_t lun_l; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 5); ++ args.method = (grub_ieee1275_cell_t) "decode-unit"; ++ args.ihandle = ihandle; ++ args.size = size; ++ args.addr = (grub_ieee1275_cell_t) addr; ++ args.catch_result = 1; ++ ++ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.catch_result)) ++ { ++ grub_error (GRUB_ERR_OUT_OF_RANGE, "decode-unit failed\n"); ++ return -1; ++ } ++ ++ *phy_lo = args.tgt_l; ++ *phy_hi = args.tgt_h; ++ *lun_lo = args.lun_l; ++ *lun_hi = args.lun_h; ++ return 0; ++} ++ + int + grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, + grub_addr_t *result) +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 8e425130327..534406458b2 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -210,7 +210,12 @@ int EXPORT_FUNC(grub_ieee1275_set_property) (grub_ieee1275_phandle_t phandle, + int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle, + int index, int r, int g, int b); + int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); +- ++int EXPORT_FUNC(grub_ieee1275_decode_unit4) (grub_ieee1275_ihandle_t ihandle, ++ void *addr, grub_size_t size, ++ grub_uint32_t *phy_lo, ++ grub_uint32_t *phy_hi, ++ grub_uint32_t *lun_lo, ++ grub_uint32_t *lun_hi); + + grub_err_t EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); + diff --git a/0123-ieee1275-encode-unit-command-for-4-addr-cell-devs.patch b/0123-ieee1275-encode-unit-command-for-4-addr-cell-devs.patch new file mode 100644 index 00000000..24d0990d --- /dev/null +++ b/0123-ieee1275-encode-unit-command-for-4-addr-cell-devs.patch @@ -0,0 +1,102 @@ +From 820c64e4c002090bcd9df10ab79d5851b28ac503 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:15 -0800 +Subject: [PATCH] ieee1275: encode-unit command for 4 addr cell devs + +Convert physical address to text unit-string. + +Convert phys.lo ... phys-high, the numerical representation, to unit-string, +the text string representation of a physical address within the address +space defined by this device node. The number of cells in the list +phys.lo ... phys.hi is determined by the value of the #address-cells property +of this node. + +This function is for devices with #address-cells == 4 + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/ieee1275.c | 45 ++++++++++++++++++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 6 +++++ + 2 files changed, 51 insertions(+) + +diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c +index b0ac6f9f9a8..41503ead090 100644 +--- a/grub-core/kern/ieee1275/ieee1275.c ++++ b/grub-core/kern/ieee1275/ieee1275.c +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_cell_t) -1) + #define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0) +@@ -523,6 +524,50 @@ grub_ieee1275_decode_unit4 (grub_ieee1275_ihandle_t ihandle, + return 0; + } + ++char * ++grub_ieee1275_encode_uint4 (grub_ieee1275_ihandle_t ihandle, ++ grub_uint32_t phy_lo, grub_uint32_t phy_hi, ++ grub_uint32_t lun_lo, grub_uint32_t lun_hi, ++ grub_size_t *size) ++{ ++ char *addr; ++ struct encode_args ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t tgt_h; ++ grub_ieee1275_cell_t tgt_l; ++ grub_ieee1275_cell_t lun_h; ++ grub_ieee1275_cell_t lun_l; ++ grub_ieee1275_cell_t catch_result; ++ grub_ieee1275_cell_t size; ++ grub_ieee1275_cell_t addr; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 3); ++ args.method = (grub_ieee1275_cell_t) "encode-unit"; ++ args.ihandle = ihandle; ++ ++ args.tgt_l = phy_lo; ++ args.tgt_h = phy_hi; ++ args.lun_l = lun_lo; ++ args.lun_h = lun_hi; ++ args.catch_result = 1; ++ ++ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.catch_result)) ++ { ++ grub_error (GRUB_ERR_OUT_OF_RANGE, "encode-unit failed\n"); ++ return 0; ++ } ++ ++ addr = (void *)args.addr; ++ *size = args.size; ++ addr = grub_strdup ((char *)args.addr); ++ return addr; ++} ++ + int + grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, + grub_addr_t *result) +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 534406458b2..c93a97e695e 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -216,6 +216,12 @@ int EXPORT_FUNC(grub_ieee1275_decode_unit4) (grub_ieee1275_ihandle_t ihandle, + grub_uint32_t *phy_hi, + grub_uint32_t *lun_lo, + grub_uint32_t *lun_hi); ++char *EXPORT_FUNC(grub_ieee1275_encode_uint4) (grub_ieee1275_ihandle_t ihandle, ++ grub_uint32_t phy_lo, ++ grub_uint32_t phy_hi, ++ grub_uint32_t lun_lo, ++ grub_uint32_t lun_hi, ++ grub_size_t *size); + + grub_err_t EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); + diff --git a/0124-ieee1275-set-address-bus-specific-method.patch b/0124-ieee1275-set-address-bus-specific-method.patch new file mode 100644 index 00000000..cb6800d5 --- /dev/null +++ b/0124-ieee1275-set-address-bus-specific-method.patch @@ -0,0 +1,87 @@ +From f02037afe363f31218b4e0c63ef3a1176f51c232 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:16 -0800 +Subject: [PATCH] ieee1275: set-address bus specific method + +IEEE 1275-1994 Standard for Boot (Initialization Configuration) +Firmware: Core Requirements and Practices +E.3.2.2 Bus-specific methods for bus nodes + +A package implementing the scsi-2 device type shall implement the +following bus-specific method: + + set-address ( unit# target# -- ) + Sets the SCSI target number (0x0..0xf) and unit number (0..7) to which + subsequent commands apply. + +This function is for devices with #address-cells == 2 + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/ieee1275.c | 40 ++++++++++++++++++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 3 +++ + 2 files changed, 43 insertions(+) + +diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c +index 41503ead090..497f170fb6b 100644 +--- a/grub-core/kern/ieee1275/ieee1275.c ++++ b/grub-core/kern/ieee1275/ieee1275.c +@@ -693,3 +693,43 @@ grub_ieee1275_milliseconds (grub_uint32_t *msecs) + *msecs = args.msecs; + return 0; + } ++ ++int ++grub_ieee1275_set_address (grub_ieee1275_ihandle_t ihandle, ++ grub_uint32_t target, grub_uint32_t lun) ++{ ++ struct set_address ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t tgt; ++ grub_ieee1275_cell_t lun; ++ grub_ieee1275_cell_t catch_result; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 1); ++ ++ /* ++ * IEEE 1275-1994 Standard for Boot (Initialization Configuration) ++ * Firmware: Core Requirements and Practices ++ * E.3.2.2 Bus-specific methods for bus nodes ++ * ++ * A package implementing the scsi-2 device type shall implement the ++ * following bus-specific method: ++ * ++ * set-address ( unit# target# -- ) ++ * Sets the SCSI target number (0x0..0xf) and unit number (0..7) to which ++ * subsequent commands apply. ++ */ ++ args.method = (grub_ieee1275_cell_t) "set-address"; ++ args.ihandle = ihandle; ++ args.tgt = target; ++ args.lun = lun; ++ ++ if (IEEE1275_CALL_ENTRY_FN (&args) == -1) ++ return -1; ++ ++ return args.catch_result; ++} +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index c93a97e695e..55e920e816f 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -210,6 +210,9 @@ int EXPORT_FUNC(grub_ieee1275_set_property) (grub_ieee1275_phandle_t phandle, + int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle, + int index, int r, int g, int b); + int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); ++int EXPORT_FUNC(grub_ieee1275_set_address) (grub_ieee1275_ihandle_t ihandle, ++ grub_uint32_t target, ++ grub_uint32_t lun); + int EXPORT_FUNC(grub_ieee1275_decode_unit4) (grub_ieee1275_ihandle_t ihandle, + void *addr, grub_size_t size, + grub_uint32_t *phy_lo, diff --git a/0125-ieee1275-no-data-command-bus-specific-method.patch b/0125-ieee1275-no-data-command-bus-specific-method.patch new file mode 100644 index 00000000..71a0cd73 --- /dev/null +++ b/0125-ieee1275-no-data-command-bus-specific-method.patch @@ -0,0 +1,105 @@ +From c422bb60193512663c4854ee1ac6c1217f5e3178 Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Mon, 5 Mar 2018 15:11:18 +0100 +Subject: [PATCH] ieee1275: no-data-command bus specific method + +IEEE 1275-1994 Standard for Boot (Initialization Configuration) +Firmware: Core Requirements and Practices + +E.3.2.2 Bus-specific methods for bus nodes + +A package implementing the scsi-2 device type shall implement the +following bus-specific method: + +no-data-command ( cmd-addr -- error? ) +Executes a simple SCSI command, automatically retrying under +certain conditions. cmd-addr is the address of a 6-byte command buffer +containing an SCSI command that does not have a data transfer phase. +Executes the command, retrying indefinitely with the same retry criteria +as retry-command. + +error? is nonzero if an error occurred, zero otherwise. +NOTE no-data-command is a convenience function. It provides +no capabilities that are not present in retry-command, but for +those commands that meet its restrictions, it is easier to use. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/ieee1275.c | 51 ++++++++++++++++++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 3 +++ + 2 files changed, 54 insertions(+) + +diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c +index 497f170fb6b..cd2dead832d 100644 +--- a/grub-core/kern/ieee1275/ieee1275.c ++++ b/grub-core/kern/ieee1275/ieee1275.c +@@ -733,3 +733,54 @@ grub_ieee1275_set_address (grub_ieee1275_ihandle_t ihandle, + + return args.catch_result; + } ++ ++int ++grub_ieee1275_no_data_command (grub_ieee1275_ihandle_t ihandle, ++ const void *cmd_addr, grub_ssize_t *result) ++{ ++ struct set_address ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t cmd_addr; ++ grub_ieee1275_cell_t error; ++ grub_ieee1275_cell_t catch_result; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); ++ ++ /* ++ * IEEE 1275-1994 Standard for Boot (Initialization Configuration) ++ * Firmware: Core Requirements and Practices ++ * ++ * E.3.2.2 Bus-specific methods for bus nodes ++ * ++ * A package implementing the scsi-2 device type shall implement the ++ * following bus-specific method: ++ * ++ * no-data-command ( cmd-addr -- error? ) ++ * Executes a simple SCSI command, automatically retrying under ++ * certain conditions. cmd-addr is the address of a 6-byte command buffer ++ * containing an SCSI command that does not have a data transfer phase. ++ * Executes the command, retrying indefinitely with the same retry criteria ++ * as retry-command. ++ * ++ * error? is nonzero if an error occurred, zero otherwise. ++ * NOTE no-data-command is a convenience function. It provides ++ * no capabilities that are not present in retry-command, but for ++ * those commands that meet its restrictions, it is easier to use. ++ */ ++ args.method = (grub_ieee1275_cell_t) "no-data-command"; ++ args.ihandle = ihandle; ++ args.cmd_addr = (grub_ieee1275_cell_t) cmd_addr; ++ ++ if (IEEE1275_CALL_ENTRY_FN (&args) == -1) ++ return -1; ++ ++ if (result) ++ *result = args.error; ++ ++ return args.catch_result; ++} +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 55e920e816f..6dfb57b8bf8 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -213,6 +213,9 @@ int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); + int EXPORT_FUNC(grub_ieee1275_set_address) (grub_ieee1275_ihandle_t ihandle, + grub_uint32_t target, + grub_uint32_t lun); ++int EXPORT_FUNC(grub_ieee1275_no_data_command) (grub_ieee1275_ihandle_t ihandle, ++ const void *cmd_addr, ++ grub_ssize_t *result); + int EXPORT_FUNC(grub_ieee1275_decode_unit4) (grub_ieee1275_ihandle_t ihandle, + void *addr, grub_size_t size, + grub_uint32_t *phy_lo, diff --git a/0126-ieee1275-block-size-deblocker-support-method.patch b/0126-ieee1275-block-size-deblocker-support-method.patch new file mode 100644 index 00000000..d3b6c3f0 --- /dev/null +++ b/0126-ieee1275-block-size-deblocker-support-method.patch @@ -0,0 +1,67 @@ +From ad6d8f5063a272e2f1e4857751db70058b977239 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:18 -0800 +Subject: [PATCH] ieee1275: block-size deblocker support method + +IEEE Std 1275-1994 Standard for Boot (Initialization Configuration) +Firmware: Core Requirements and Practices + +3.8.3 deblocker support package + +Any package that uses the "deblocker" support package must define +the following method, which the deblocker uses as a low-level +interface to the device + +block-size ( -- block-len ) Return "granularity" for accesses to this +device. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/ieee1275.c | 23 +++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 1 + + 2 files changed, 24 insertions(+) + +diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c +index cd2dead832d..86f81a3c467 100644 +--- a/grub-core/kern/ieee1275/ieee1275.c ++++ b/grub-core/kern/ieee1275/ieee1275.c +@@ -784,3 +784,26 @@ grub_ieee1275_no_data_command (grub_ieee1275_ihandle_t ihandle, + + return args.catch_result; + } ++ ++int ++grub_ieee1275_get_block_size (grub_ieee1275_ihandle_t ihandle) ++{ ++ struct size_args_ieee1275 ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t result; ++ grub_ieee1275_cell_t size; ++ } args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2); ++ args.method = (grub_ieee1275_cell_t) "block-size"; ++ args.ihandle = ihandle; ++ args.result = 1; ++ ++ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) ++ return 0; ++ ++ return args.size; ++} +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 6dfb57b8bf8..d0dc2746ead 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -228,6 +228,7 @@ char *EXPORT_FUNC(grub_ieee1275_encode_uint4) (grub_ieee1275_ihandle_t ihandle, + grub_uint32_t lun_lo, + grub_uint32_t lun_hi, + grub_size_t *size); ++int EXPORT_FUNC(grub_ieee1275_get_block_size) (grub_ieee1275_ihandle_t ihandle); + + grub_err_t EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); + diff --git a/0127-sparc64-blocks-disk-node-method.patch b/0127-sparc64-blocks-disk-node-method.patch new file mode 100644 index 00000000..c15900ad --- /dev/null +++ b/0127-sparc64-blocks-disk-node-method.patch @@ -0,0 +1,72 @@ +From ab4c93cb4bb443620e141cc70f274b89a51a1d05 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:19 -0800 +Subject: [PATCH] sparc64: #blocks disk node method + +Return the number of blocks of storage associated with the device or +instance. Where a "block" is a unit of storage consisting of the number +of bytes returned by the package's "block-size" method. If the size cannot +be determined, the #blocks method returns the maximum unsigned integer +(which, because of Open Firmware's assumption of two's complement arithmetic, +is equivalent to the signed number -1). If the number of blocks exceeds +the range of an unsigned number, return 0 to alert the caller to try +the #blocks64 command. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/sparc64/ieee1275/ieee1275.c | 31 ++++++++++++++++++++++++++++++ + include/grub/sparc64/ieee1275/ieee1275.h | 1 + + 2 files changed, 32 insertions(+) + +diff --git a/grub-core/kern/sparc64/ieee1275/ieee1275.c b/grub-core/kern/sparc64/ieee1275/ieee1275.c +index 53be692c3d8..67933a45b35 100644 +--- a/grub-core/kern/sparc64/ieee1275/ieee1275.c ++++ b/grub-core/kern/sparc64/ieee1275/ieee1275.c +@@ -89,3 +89,34 @@ grub_ieee1275_alloc_physmem (grub_addr_t *paddr, grub_size_t size, + + return args.catch_result; + } ++ ++grub_uint64_t ++grub_ieee1275_num_blocks (grub_ieee1275_ihandle_t ihandle) ++{ ++ struct nblocks_args_ieee1275 ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t catch_result; ++ grub_ieee1275_cell_t blocks; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2); ++ args.method = (grub_ieee1275_cell_t) "#blocks"; ++ args.ihandle = ihandle; ++ args.catch_result = 1; ++ ++ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.catch_result != 0)) ++ return -1; ++ ++ /* ++ * If the number of blocks exceeds the range of an unsigned number, ++ * return 0 to alert the caller to try the #blocks64 command. ++ */ ++ if (args.blocks >= 0xffffffffULL) ++ return 0; ++ ++ return args.blocks; ++} +diff --git a/include/grub/sparc64/ieee1275/ieee1275.h b/include/grub/sparc64/ieee1275/ieee1275.h +index 32c77f80f1a..2ddf44d41df 100644 +--- a/include/grub/sparc64/ieee1275/ieee1275.h ++++ b/include/grub/sparc64/ieee1275/ieee1275.h +@@ -42,6 +42,7 @@ extern int EXPORT_FUNC(grub_ieee1275_claim_vaddr) (grub_addr_t vaddr, + extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr, + grub_size_t size, + grub_uint32_t align); ++extern grub_uint64_t EXPORT_FUNC(grub_ieee1275_num_blocks) (grub_uint32_t ihandle); + + extern grub_addr_t EXPORT_VAR (grub_ieee1275_original_stack); + diff --git a/0128-sparc64-blocks64-disk-node-method.patch b/0128-sparc64-blocks64-disk-node-method.patch new file mode 100644 index 00000000..a92a9398 --- /dev/null +++ b/0128-sparc64-blocks64-disk-node-method.patch @@ -0,0 +1,62 @@ +From 599efeb6220d01e0b9788ba796849f945ec0d4c1 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Mon, 26 Feb 2018 17:34:20 -0800 +Subject: [PATCH] sparc64: #blocks64 disk node method + +Return the 64bit number of blocks of storage associated with the device or +instance. Where a "block" is a unit of storage consisting of the number of +bytes returned by the package's "block-size" method. If the size cannot be +determined, or if the number of blocks exceeds the range return -1. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/sparc64/ieee1275/ieee1275.c | 25 +++++++++++++++++++++++++ + include/grub/sparc64/ieee1275/ieee1275.h | 1 + + 2 files changed, 26 insertions(+) + +diff --git a/grub-core/kern/sparc64/ieee1275/ieee1275.c b/grub-core/kern/sparc64/ieee1275/ieee1275.c +index 67933a45b35..5a59aaf0619 100644 +--- a/grub-core/kern/sparc64/ieee1275/ieee1275.c ++++ b/grub-core/kern/sparc64/ieee1275/ieee1275.c +@@ -120,3 +120,28 @@ grub_ieee1275_num_blocks (grub_ieee1275_ihandle_t ihandle) + + return args.blocks; + } ++ ++grub_uint64_t ++grub_ieee1275_num_blocks64 (grub_ieee1275_ihandle_t ihandle) ++{ ++ struct nblocks_args_ieee1275 ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_cell_t ihandle; ++ grub_ieee1275_cell_t catch_result; ++ grub_ieee1275_cell_t hi_blocks; ++ grub_ieee1275_cell_t lo_blocks; ++ } ++ args; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); ++ args.method = (grub_ieee1275_cell_t) "#blocks64"; ++ args.ihandle = ihandle; ++ args.catch_result = 1; ++ ++ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.catch_result != 0)) ++ return -1; ++ ++ return ((args.hi_blocks << 32) | (args.lo_blocks)); ++} +diff --git a/include/grub/sparc64/ieee1275/ieee1275.h b/include/grub/sparc64/ieee1275/ieee1275.h +index 2ddf44d41df..4b18468d8d6 100644 +--- a/include/grub/sparc64/ieee1275/ieee1275.h ++++ b/include/grub/sparc64/ieee1275/ieee1275.h +@@ -43,6 +43,7 @@ extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr, + grub_size_t size, + grub_uint32_t align); + extern grub_uint64_t EXPORT_FUNC(grub_ieee1275_num_blocks) (grub_uint32_t ihandle); ++extern grub_uint64_t EXPORT_FUNC(grub_ieee1275_num_blocks64) (grub_uint32_t ihandle); + + extern grub_addr_t EXPORT_VAR (grub_ieee1275_original_stack); + diff --git a/0129-Revert-Keep-the-native-terminal-active-when-enabling.patch b/0129-Revert-Keep-the-native-terminal-active-when-enabling.patch new file mode 100644 index 00000000..fd7a909c --- /dev/null +++ b/0129-Revert-Keep-the-native-terminal-active-when-enabling.patch @@ -0,0 +1,33 @@ +From d73badfd0aa6683212136e8d6ef439070176722b Mon Sep 17 00:00:00 2001 +From: dann frazier +Date: Fri, 2 Mar 2018 10:02:19 -0700 +Subject: [PATCH] Revert "Keep the native terminal active when enabling + gfxterm" + +This can cause an issue where GRUB is trying to display both a text and +graphical menu on the display at the same time, resulting in a flickering +effect when e.g. scrolling quickly through a menu (LP: #1752767). + +Revert for now while we look for a better solution for the original issue. + +This reverts commit 52ef7b23f528ce844716661d586497a177e80d5b. + +Signed-off-by: dann frazier +Reviewed-by: Daniel Kiper +--- + util/grub.d/00_header.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in +index 8d46fc973c1..93a90233ead 100644 +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -221,7 +221,7 @@ case x${GRUB_TERMINAL_OUTPUT} in + ;; + x*) + cat << EOF +-terminal_output --append ${GRUB_TERMINAL_OUTPUT} ++terminal_output ${GRUB_TERMINAL_OUTPUT} + EOF + ;; + esac diff --git a/0130-mkimage-fix-build-regression-in-grub_mkimage_load_im.patch b/0130-mkimage-fix-build-regression-in-grub_mkimage_load_im.patch new file mode 100644 index 00000000..dc5105a6 --- /dev/null +++ b/0130-mkimage-fix-build-regression-in-grub_mkimage_load_im.patch @@ -0,0 +1,36 @@ +From 28b0d19061d66e3633148ac8e44decda914bf266 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Tue, 6 Mar 2018 13:38:58 -0800 +Subject: [PATCH] mkimage: fix build regression in grub_mkimage_load_image + +The grub_mkimage_load_image function (commit 7542af6, mkimage: refactor a bunch +of section data into a struct.) introduces a build regression on SPARC: + + cc1: warnings being treated as errors + In file included from util/grub-mkimage32.c:23: + util/grub-mkimagexx.c: In function 'grub_mkimage_load_image32': + util/grub-mkimagexx.c:1968: error: missing initializer + util/grub-mkimagexx.c:1968: error: (near initialization for 'smd.sections') + make[2]: *** [util/grub_mkimage-grub-mkimage32.o] Error 1 + +Initialize the entire section_metadata structure. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + util/grub-mkimagexx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 11d05d7a8ec..a483c674c49 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -1965,7 +1965,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + const struct grub_install_image_target_desc *image_target) + { + char *kernel_img, *out_img; +- struct section_metadata smd = { 0, }; ++ struct section_metadata smd = { 0, 0, 0, 0, 0, 0, 0 }; + Elf_Ehdr *e; + int i; + Elf_Shdr *s; diff --git a/0131-grub-mkconfig-10_linux-Support-multiple-early-initrd.patch b/0131-grub-mkconfig-10_linux-Support-multiple-early-initrd.patch new file mode 100644 index 00000000..febe3e97 --- /dev/null +++ b/0131-grub-mkconfig-10_linux-Support-multiple-early-initrd.patch @@ -0,0 +1,174 @@ +From a698240df0c43278b2d1d7259c8e7a6926c63112 Mon Sep 17 00:00:00 2001 +From: "Matthew S. Turnbull" +Date: Sat, 24 Feb 2018 17:44:58 -0500 +Subject: [PATCH] grub-mkconfig/10_linux: Support multiple early initrd images + +Add support for multiple, shared, early initrd images. These early +images will be loaded in the order declared, and all will be loaded +before the initrd image. + +While many classes of data can be provided by early images, the +immediate use case would be for distributions to provide CPU +microcode to mitigate the Meltdown and Spectre vulnerabilities. + +There are two environment variables provided for declaring the early +images. + +* GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare + images that are provided by the distribution or installed packages. + If undeclared, this will default to a set of common microcode image + names. + +* GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User + images will be loaded after the stock images. + +These separate configurations allow the distribution and user to +declare different image sets without clobbering each other. + +This also makes a minor update to ensure that UUID partition labels +stay disabled when no initrd image is found, even if early images are +present. + +This is a continuation of a previous patch published by Christian +Hesse in 2016: +http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00025.html + +Down stream Gentoo bug: +https://bugs.gentoo.org/645088 + +Signed-off-by: Robin H. Johnson +Signed-off-by: Matthew S. Turnbull +Reviewed-by: Daniel Kiper +--- + docs/grub.texi | 19 +++++++++++++++++++ + util/grub-mkconfig.in | 8 ++++++++ + util/grub.d/10_linux.in | 33 +++++++++++++++++++++++++++------ + 3 files changed, 54 insertions(+), 6 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 137b894fa09..65b4bbeda18 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1398,6 +1398,25 @@ for all respectively normal entries. + The values of these options replace the values of @samp{GRUB_CMDLINE_LINUX} + and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. + ++@item GRUB_EARLY_INITRD_LINUX_CUSTOM ++@itemx GRUB_EARLY_INITRD_LINUX_STOCK ++List of space-separated early initrd images to be loaded from @samp{/boot}. ++This is for loading things like CPU microcode, firmware, ACPI tables, crypto ++keys, and so on. These early images will be loaded in the order declared, ++and all will be loaded before the actual functional initrd image. ++ ++@samp{GRUB_EARLY_INITRD_LINUX_STOCK} is for your distribution to declare ++images that are provided by the distribution. It should not be modified ++without understanding the consequences. They will be loaded first. ++ ++@samp{GRUB_EARLY_INITRD_LINUX_CUSTOM} is for your custom created images. ++ ++The default stock images are as follows, though they may be overridden by ++your distribution: ++@example ++intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio ++@end example ++ + @item GRUB_DISABLE_LINUX_UUID + Normally, @command{grub-mkconfig} will generate menu entries that use + universally-unique identifiers (UUIDs) to identify the root filesystem to +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index f8496d28bdf..35ef583b05f 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -147,6 +147,12 @@ if [ x"$GRUB_FS" = xunknown ]; then + GRUB_FS="$(stat -f --printf=%T / || echo unknown)" + fi + ++# Provide a default set of stock linux early initrd images. ++# Define here so the list can be modified in the sourced config file. ++if [ "x${GRUB_EARLY_INITRD_LINUX_STOCK}" = "x" ]; then ++ GRUB_EARLY_INITRD_LINUX_STOCK="intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio" ++fi ++ + if test -f ${sysconfdir}/default/grub ; then + . ${sysconfdir}/default/grub + fi +@@ -211,6 +217,8 @@ export GRUB_DEFAULT \ + GRUB_CMDLINE_NETBSD \ + GRUB_CMDLINE_NETBSD_DEFAULT \ + GRUB_CMDLINE_GNUMACH \ ++ GRUB_EARLY_INITRD_LINUX_CUSTOM \ ++ GRUB_EARLY_INITRD_LINUX_STOCK \ + GRUB_TERMINAL_INPUT \ + GRUB_TERMINAL_OUTPUT \ + GRUB_SERIAL_COMMAND \ +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index de9044c7f28..faedf74e14e 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -136,9 +136,13 @@ 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 ${rel_dirname}/${initrd} ++ initrd $(echo $initrd_path) + EOF + fi + sed "s/^/$submenu_indentation/" << EOF +@@ -188,7 +192,15 @@ while [ "x$list" != "x" ] ; do + alt_version=`echo $version | sed -e "s,\.old$,,g"` + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + +- initrd= ++ initrd_early= ++ for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \ ++ ${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do ++ if test -e "${dirname}/${i}" ; then ++ initrd_early="${initrd_early} ${i}" ++ fi ++ done ++ ++ initrd_real= + for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ + "initrd-${version}" "initramfs-${version}.img" \ + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ +@@ -198,11 +210,22 @@ while [ "x$list" != "x" ] ; do + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ + "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do + if test -e "${dirname}/${i}" ; then +- initrd="$i" ++ initrd_real="${i}" + break + fi + done + ++ initrd= ++ if test -n "${initrd_early}" || test -n "${initrd_real}"; then ++ initrd="${initrd_early} ${initrd_real}" ++ ++ initrd_display= ++ for i in ${initrd}; do ++ initrd_display="${initrd_display} ${dirname}/${i}" ++ done ++ gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2 ++ fi ++ + config= + for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do + if test -e "${i}" ; then +@@ -216,9 +239,7 @@ while [ "x$list" != "x" ] ; do + initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"` + fi + +- if test -n "${initrd}" ; then +- gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +- elif test -z "${initramfs}" ; then ++ if test -z "${initramfs}" && test -z "${initrd_real}" ; then + # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's + # no initrd or builtin initramfs, it can't work here. + linux_root_device_thisversion=${GRUB_DEVICE} diff --git a/0132-chainloader-patch-in-BPB-s-sectors_per_track-and-num.patch b/0132-chainloader-patch-in-BPB-s-sectors_per_track-and-num.patch new file mode 100644 index 00000000..89422625 --- /dev/null +++ b/0132-chainloader-patch-in-BPB-s-sectors_per_track-and-num.patch @@ -0,0 +1,74 @@ +From c225298038f0e7e7ec2d783776fba880d9965f16 Mon Sep 17 00:00:00 2001 +From: "C. Masloch" +Date: Thu, 1 Feb 2018 15:51:55 +0100 +Subject: [PATCH] chainloader: patch in BPB's sectors_per_track and num_heads + +These fields must reflect the ROM-BIOS's geometry for CHS-based +loaders to correctly load their next stage. Most loaders do not +query the ROM-BIOS (Int13.08), relying on the BPB fields to hold +the correct values already. + +Tested with lDebug booted in qemu via grub2's +FreeDOS direct loading support, refer to +https://bitbucket.org/ecm/ldosboot + https://bitbucket.org/ecm/ldebug +(For this test, lDebug's iniload.asm must be assembled with +-D_QUERY_GEOMETRY=0 to leave the BPB values provided by grub.) + +Signed-off-by: C. Masloch +Reviewed-by: Daniel Kiper +--- + grub-core/loader/i386/pc/chainloader.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/i386/pc/chainloader.c b/grub-core/loader/i386/pc/chainloader.c +index 18220b7aaab..ef3a322b78c 100644 +--- a/grub-core/loader/i386/pc/chainloader.c ++++ b/grub-core/loader/i386/pc/chainloader.c +@@ -19,6 +19,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -86,9 +87,16 @@ grub_chainloader_unload (void) + void + grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) + { +- grub_uint32_t part_start = 0; ++ grub_uint32_t part_start = 0, heads = 0, sectors = 0; + if (dev && dev->disk) +- part_start = grub_partition_get_start (dev->disk->partition); ++ { ++ part_start = grub_partition_get_start (dev->disk->partition); ++ if (dev->disk->data) ++ { ++ heads = ((struct grub_biosdisk_data *)(dev->disk->data))->heads; ++ sectors = ((struct grub_biosdisk_data *)(dev->disk->data))->sectors; ++ } ++ } + if (grub_memcmp ((char *) &((struct grub_ntfs_bpb *) bs)->oem_name, + "NTFS", 4) == 0) + { +@@ -127,12 +135,20 @@ grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) + { + bpb->num_hidden_sectors = grub_cpu_to_le32 (part_start); + bpb->version_specific.fat12_or_fat16.num_ph_drive = dl; ++ if (sectors) ++ bpb->sectors_per_track = grub_cpu_to_le16 (sectors); ++ if (heads) ++ bpb->num_heads = grub_cpu_to_le16 (heads); + return; + } + if (bpb->version_specific.fat32.sectors_per_fat_32) + { + bpb->num_hidden_sectors = grub_cpu_to_le32 (part_start); + bpb->version_specific.fat32.num_ph_drive = dl; ++ if (sectors) ++ bpb->sectors_per_track = grub_cpu_to_le16 (sectors); ++ if (heads) ++ bpb->num_heads = grub_cpu_to_le16 (heads); + return; + } + break; diff --git a/0133-ieee1275-split-up-grub_machine_get_bootlocation.patch b/0133-ieee1275-split-up-grub_machine_get_bootlocation.patch new file mode 100644 index 00000000..e17ce80c --- /dev/null +++ b/0133-ieee1275-split-up-grub_machine_get_bootlocation.patch @@ -0,0 +1,100 @@ +From e2faabacff9eccb80a75d7e00d810cdc26b5e866 Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Thu, 8 Mar 2018 20:42:22 -0800 +Subject: [PATCH] ieee1275: split up grub_machine_get_bootlocation + +Split up some of the functionality in grub_machine_get_bootlocation into +grub_ieee1275_get_boot_dev. This will allow for code reuse in a follow on +patch. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/init.c | 20 ++------------------ + grub-core/kern/ieee1275/openfw.c | 27 +++++++++++++++++++++++++++ + include/grub/ieee1275/ieee1275.h | 2 ++ + 3 files changed, 31 insertions(+), 18 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 12590225eca..62dfb8a3bad 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -94,28 +94,12 @@ void + grub_machine_get_bootlocation (char **device, char **path) + { + char *bootpath; +- grub_ssize_t bootpath_size; + char *filename; + char *type; + +- if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath", +- &bootpath_size) +- || bootpath_size <= 0) +- { +- /* Should never happen. */ +- grub_printf ("/chosen/bootpath property missing!\n"); +- return; +- } +- +- bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64); ++ bootpath = grub_ieee1275_get_boot_dev (); + if (! bootpath) +- { +- grub_print_error (); +- return; +- } +- grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, +- (grub_size_t) bootpath_size + 1, 0); +- bootpath[bootpath_size] = '\0'; ++ return; + + /* Transform an OF device path to a GRUB path. */ + +diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c +index ddb778340e4..62929d983bf 100644 +--- a/grub-core/kern/ieee1275/openfw.c ++++ b/grub-core/kern/ieee1275/openfw.c +@@ -561,3 +561,30 @@ grub_ieee1275_canonicalise_devname (const char *path) + return NULL; + } + ++char * ++grub_ieee1275_get_boot_dev (void) ++{ ++ char *bootpath; ++ grub_ssize_t bootpath_size; ++ ++ if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath", ++ &bootpath_size) ++ || bootpath_size <= 0) ++ { ++ /* Should never happen. */ ++ grub_printf ("/chosen/bootpath property missing!\n"); ++ return NULL; ++ } ++ ++ bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64); ++ if (! bootpath) ++ { ++ grub_print_error (); ++ return NULL; ++ } ++ grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, ++ (grub_size_t) bootpath_size + 1, 0); ++ bootpath[bootpath_size] = '\0'; ++ ++ return bootpath; ++} +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index d0dc2746ead..8868f3a756f 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -253,6 +253,8 @@ void EXPORT_FUNC(grub_ieee1275_children_peer) (struct grub_ieee1275_devalias *al + void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath, + struct grub_ieee1275_devalias *alias); + ++char *EXPORT_FUNC(grub_ieee1275_get_boot_dev) (void); ++ + #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) + + #define FOR_IEEE1275_DEVCHILDREN(devpath, alias) for (grub_ieee1275_children_first ((devpath), &(alias)); \ diff --git a/0134-ieee1275-NULL-pointer-dereference-in-grub_machine_ge.patch b/0134-ieee1275-NULL-pointer-dereference-in-grub_machine_ge.patch new file mode 100644 index 00000000..f0fcb9dd --- /dev/null +++ b/0134-ieee1275-NULL-pointer-dereference-in-grub_machine_ge.patch @@ -0,0 +1,28 @@ +From 5ceb55b7a079cdaa61437f652e90bf2d1011ad0e Mon Sep 17 00:00:00 2001 +From: Eric Snowberg +Date: Wed, 14 Mar 2018 08:51:17 -0700 +Subject: [PATCH] ieee1275: NULL pointer dereference in + grub_machine_get_bootlocation() + +Read from NULL pointer canon in function grub_machine_get_bootlocation(). +Function grub_ieee1275_canonicalise_devname() may return NULL. + +Signed-off-by: Eric Snowberg +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/init.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 62dfb8a3bad..0d8ebf58b95 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -110,6 +110,8 @@ grub_machine_get_bootlocation (char **device, char **path) + char *ptr; + dev = grub_ieee1275_get_aliasdevname (bootpath); + canon = grub_ieee1275_canonicalise_devname (dev); ++ if (! canon) ++ return; + ptr = canon + grub_strlen (canon) - 1; + while (ptr > canon && (*ptr == ',' || *ptr == ':')) + ptr--; diff --git a/0135-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch b/0135-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch new file mode 100644 index 00000000..640ca2be --- /dev/null +++ b/0135-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch @@ -0,0 +1,47 @@ +From a537d6501871c17a7e09289ab86aeda122138a91 Mon Sep 17 00:00:00 2001 +From: "mike.travis@hpe.com" +Date: Wed, 28 Mar 2018 11:42:18 -0500 +Subject: [PATCH] efi/uga: Fix PCIe LER when GRUB2 accesses non-enabled MMIO + data from VGA + +A GPU inserted into a PCIe I/O slot disappears during system startup. +The problem centers around GRUB and a specific VGA init function in +efi_uga.c. This causes an LER (Link Error Recorvery) because the MMIO +memory has not been enabled before attempting access. + +The fix is to add the same coding used in other VGA drivers, specifically +to add a check to insure that it is indeed a VGA controller. And then +enable the MMIO address space with the specific bits. + +Signed-off-by: Mike Travis +Reviewed-by: Daniel Kiper +--- + grub-core/video/efi_uga.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c +index 464ede874da..044af1d20d3 100644 +--- a/grub-core/video/efi_uga.c ++++ b/grub-core/video/efi_uga.c +@@ -94,10 +94,19 @@ static int + find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) + { + struct find_framebuf_ctx *ctx = data; +- grub_pci_address_t addr; ++ grub_pci_address_t addr, rcaddr; ++ grub_uint32_t subclass; + + addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); +- if (grub_pci_read (addr) >> 24 == 0x3) ++ subclass = (grub_pci_read (addr) >> 16) & 0xffff; ++ ++ if (subclass != GRUB_PCI_CLASS_SUBCLASS_VGA) ++ return 0; ++ ++ /* Enable MEM address spaces */ ++ rcaddr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); ++ grub_pci_write_word (rcaddr, grub_pci_read_word (rcaddr) | GRUB_PCI_COMMAND_MEM_ENABLED); ++ + { + int i; + diff --git a/0136-Fix-packed-not-aligned-error-on-GCC-8.patch b/0136-Fix-packed-not-aligned-error-on-GCC-8.patch new file mode 100644 index 00000000..328aea5c --- /dev/null +++ b/0136-Fix-packed-not-aligned-error-on-GCC-8.patch @@ -0,0 +1,69 @@ +From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Mon, 26 Mar 2018 16:52:34 +0800 +Subject: [PATCH] Fix packed-not-aligned error on GCC 8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When building with GCC 8, there are several errors regarding packed-not-aligned. + +./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] + +This patch fixes the build error by cleaning up the ambiguity of placing +aligned structure in a packed one. In "struct grub_btrfs_time" and "struct +grub_gpt_part_type", the aligned attribute seems to be superfluous, and also +has to be packed, to ensure the structure is bit-to-bit mapped to the format +laid on disk. I think we could blame to copy and paste error here for the +mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as +the name suggests. :) + +Signed-off-by: Michael Chang +Tested-by: Michael Chang +Tested-by: Paul Menzel +Reviewed-by: Daniel Kiper +--- + grub-core/fs/btrfs.c | 2 +- + include/grub/efiemu/runtime.h | 2 +- + include/grub/gpt_partition.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 4849c1ceb65..be195448dbe 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -175,7 +175,7 @@ struct grub_btrfs_time + { + grub_int64_t sec; + grub_uint32_t nanosec; +-} __attribute__ ((aligned (4))); ++} GRUB_PACKED; + + struct grub_btrfs_inode + { +diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h +index 9b6b729f4cc..36d2dedf47e 100644 +--- a/include/grub/efiemu/runtime.h ++++ b/include/grub/efiemu/runtime.h +@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel + + struct efi_variable + { +- grub_efi_guid_t guid; ++ grub_efi_packed_guid_t guid; + grub_uint32_t namelen; + grub_uint32_t size; + grub_efi_uint32_t attributes; +diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h +index 1b32f6725a4..9668a68c30a 100644 +--- a/include/grub/gpt_partition.h ++++ b/include/grub/gpt_partition.h +@@ -28,7 +28,7 @@ struct grub_gpt_part_type + grub_uint16_t data2; + grub_uint16_t data3; + grub_uint8_t data4[8]; +-} __attribute__ ((aligned(8))); ++} GRUB_PACKED; + typedef struct grub_gpt_part_type grub_gpt_part_type_t; + + #define GRUB_GPT_PARTITION_TYPE_EMPTY \ diff --git a/0137-fs-Add-F2FS-support.patch b/0137-fs-Add-F2FS-support.patch new file mode 100644 index 00000000..9afad7bf --- /dev/null +++ b/0137-fs-Add-F2FS-support.patch @@ -0,0 +1,1508 @@ +From 71f9e4ac44142af52c3fc1860436cf9e432bf764 Mon Sep 17 00:00:00 2001 +From: Jaegeuk Kim +Date: Thu, 29 Mar 2018 16:37:39 +0100 +Subject: [PATCH] fs: Add F2FS support + +"F2FS (Flash-Friendly File System) is flash-friendly file system which was merged +into Linux kernel v3.8 in 2013. + +The motive for F2FS was to build a file system that from the start, takes into +account the characteristics of NAND flash memory-based storage devices (such as +solid-state disks, eMMC, and SD cards). + +F2FS was designed on a basis of a log-structured file system approach, which +remedies some known issues of the older log structured file systems, such as +the snowball effect of wandering trees and high cleaning overhead. In addition, +since a NAND-based storage device shows different characteristics according to +its internal geometry or flash memory management scheme (such as the Flash +Translation Layer or FTL), it supports various parameters not only for +configuring on-disk layout, but also for selecting allocation and cleaning +algorithm.", quote by https://en.wikipedia.org/wiki/F2FS. + +The source codes for F2FS are available from: + +http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git +http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git + +This patch has been integrated in OpenMandriva Lx 3. + https://www.openmandriva.org/ + +Signed-off-by: Jaegeuk Kim +Signed-off-by: Pete Batard +Signed-off-by: Daniel Kiper +Reviewed-by: Daniel Kiper +--- + Makefile.util.def | 7 + + grub-core/Makefile.core.def | 5 + + grub-core/fs/f2fs.c | 1314 ++++++++++++++++++++++++++++++++++++++++++ + docs/grub.texi | 7 +- + po/exclude.pot | Bin 140903 -> 140931 bytes + tests/f2fs_test.in | 19 + + tests/util/grub-fs-tester.in | 10 +- + 7 files changed, 1357 insertions(+), 5 deletions(-) + create mode 100644 grub-core/fs/f2fs.c + create mode 100644 tests/f2fs_test.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index f9caccb9780..3180ac880a9 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -99,6 +99,7 @@ library = { + common = grub-core/fs/ext2.c; + common = grub-core/fs/fat.c; + common = grub-core/fs/exfat.c; ++ common = grub-core/fs/f2fs.c; + common = grub-core/fs/fshelp.c; + common = grub-core/fs/hfs.c; + common = grub-core/fs/hfsplus.c; +@@ -774,6 +775,12 @@ script = { + common = tests/xfs_test.in; + }; + ++script = { ++ testcase; ++ name = f2fs_test; ++ common = tests/f2fs_test.in; ++}; ++ + script = { + testcase; + name = nilfs2_test; +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 2c1d62ceea9..fc4767f1985 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1314,6 +1314,11 @@ module = { + common = fs/exfat.c; + }; + ++module = { ++ name = f2fs; ++ common = fs/f2fs.c; ++}; ++ + module = { + name = fshelp; + common = fs/fshelp.c; +diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c +new file mode 100644 +index 00000000000..1cad2615f3c +--- /dev/null ++++ b/grub-core/fs/f2fs.c +@@ -0,0 +1,1314 @@ ++/* ++ * f2fs.c - Flash-Friendly File System ++ * ++ * Written by Jaegeuk Kim ++ * ++ * Copyright (C) 2015 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 ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++/* F2FS Magic Number. */ ++#define F2FS_SUPER_MAGIC 0xf2f52010 ++ ++#define CHECKSUM_OFFSET 4092 /* Must be aligned 4 bytes. */ ++#define U32_CHECKSUM_OFFSET (CHECKSUM_OFFSET >> 2) ++#define CRCPOLY_LE 0xedb88320 ++ ++/* Byte-size offset. */ ++#define F2FS_SUPER_OFFSET ((grub_disk_addr_t)1024) ++#define F2FS_SUPER_OFFSET0 (F2FS_SUPER_OFFSET >> GRUB_DISK_SECTOR_BITS) ++#define F2FS_SUPER_OFFSET1 ((F2FS_SUPER_OFFSET + F2FS_BLKSIZE) >> \ ++ GRUB_DISK_SECTOR_BITS) ++ ++/* 9 bits for 512 bytes. */ ++#define F2FS_MIN_LOG_SECTOR_SIZE 9 ++ ++/* Support only 4KB block. */ ++#define F2FS_BLK_BITS 12 ++#define F2FS_BLKSIZE (1 << F2FS_BLK_BITS) ++#define F2FS_BLK_SEC_BITS (F2FS_BLK_BITS - GRUB_DISK_SECTOR_BITS) ++ ++#define VERSION_LEN 256 ++#define F2FS_MAX_EXTENSION 64 ++ ++#define CP_COMPACT_SUM_FLAG 0x00000004 ++#define CP_UMOUNT_FLAG 0x00000001 ++ ++#define MAX_ACTIVE_LOGS 16 ++#define MAX_ACTIVE_NODE_LOGS 8 ++#define MAX_ACTIVE_DATA_LOGS 8 ++#define NR_CURSEG_DATA_TYPE 3 ++#define NR_CURSEG_NODE_TYPE 3 ++#define NR_CURSEG_TYPE (NR_CURSEG_DATA_TYPE + NR_CURSEG_NODE_TYPE) ++ ++#define ENTRIES_IN_SUM 512 ++#define SUMMARY_SIZE 7 ++#define SUM_FOOTER_SIZE 5 ++#define JENTRY_SIZE (sizeof(struct grub_f2fs_nat_jent)) ++#define SUM_ENTRIES_SIZE (SUMMARY_SIZE * ENTRIES_IN_SUM) ++#define SUM_JOURNAL_SIZE (F2FS_BLKSIZE - SUM_FOOTER_SIZE - SUM_ENTRIES_SIZE) ++#define NAT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) / JENTRY_SIZE) ++#define NAT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) % JENTRY_SIZE) ++ ++#define NAT_ENTRY_SIZE (sizeof(struct grub_f2fs_nat_entry)) ++#define NAT_ENTRY_PER_BLOCK (F2FS_BLKSIZE / NAT_ENTRY_SIZE) ++ ++#define F2FS_NAME_LEN 255 ++#define F2FS_SLOT_LEN 8 ++#define NR_DENTRY_IN_BLOCK 214 ++#define SIZE_OF_DIR_ENTRY 11 /* By byte. */ ++#define BITS_PER_BYTE 8 ++#define SIZE_OF_DENTRY_BITMAP ((NR_DENTRY_IN_BLOCK + BITS_PER_BYTE - 1) / \ ++ BITS_PER_BYTE) ++#define SIZE_OF_RESERVED (F2FS_BLKSIZE - \ ++ ((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \ ++ NR_DENTRY_IN_BLOCK + SIZE_OF_DENTRY_BITMAP)) ++ ++#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs. */ ++#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode. */ ++ ++#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block. */ ++#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block. */ ++#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) ++#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) ++#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3) ++#define NODE_IND2_BLOCK (DEF_ADDRS_PER_INODE + 4) ++#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) ++ ++#define MAX_INLINE_DATA (4 * (DEF_ADDRS_PER_INODE - \ ++ F2FS_INLINE_XATTR_ADDRS - 1)) ++#define NR_INLINE_DENTRY (MAX_INLINE_DATA * BITS_PER_BYTE / \ ++ ((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \ ++ BITS_PER_BYTE + 1)) ++#define INLINE_DENTRY_BITMAP_SIZE ((NR_INLINE_DENTRY + BITS_PER_BYTE - 1) / \ ++ BITS_PER_BYTE) ++#define INLINE_RESERVED_SIZE (MAX_INLINE_DATA - \ ++ ((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \ ++ NR_INLINE_DENTRY + \ ++ INLINE_DENTRY_BITMAP_SIZE)) ++#define CURSEG_HOT_DATA 0 ++ ++#define CKPT_FLAG_SET(ckpt, f) (ckpt)->ckpt_flags & \ ++ grub_cpu_to_le32_compile_time (f) ++ ++#define F2FS_INLINE_XATTR 0x01 /* File inline xattr flag. */ ++#define F2FS_INLINE_DATA 0x02 /* File inline data flag. */ ++#define F2FS_INLINE_DENTRY 0x04 /* File inline dentry flag. */ ++#define F2FS_DATA_EXIST 0x08 /* File inline data exist flag. */ ++#define F2FS_INLINE_DOTS 0x10 /* File having implicit dot dentries. */ ++ ++#define MAX_VOLUME_NAME 512 ++ ++enum FILE_TYPE ++{ ++ F2FS_FT_UNKNOWN, ++ F2FS_FT_REG_FILE = 1, ++ F2FS_FT_DIR = 2, ++ F2FS_FT_SYMLINK = 7 ++}; ++ ++struct grub_f2fs_superblock ++{ ++ grub_uint32_t magic; ++ grub_uint16_t dummy1[2]; ++ grub_uint32_t log_sectorsize; ++ grub_uint32_t log_sectors_per_block; ++ grub_uint32_t log_blocksize; ++ grub_uint32_t log_blocks_per_seg; ++ grub_uint32_t segs_per_sec; ++ grub_uint32_t secs_per_zone; ++ grub_uint32_t checksum_offset; ++ grub_uint8_t dummy2[40]; ++ grub_uint32_t cp_blkaddr; ++ grub_uint32_t sit_blkaddr; ++ grub_uint32_t nat_blkaddr; ++ grub_uint32_t ssa_blkaddr; ++ grub_uint32_t main_blkaddr; ++ grub_uint32_t root_ino; ++ grub_uint32_t node_ino; ++ grub_uint32_t meta_ino; ++ grub_uint8_t uuid[16]; ++ grub_uint16_t volume_name[MAX_VOLUME_NAME]; ++ grub_uint32_t extension_count; ++ grub_uint8_t extension_list[F2FS_MAX_EXTENSION][8]; ++ grub_uint32_t cp_payload; ++ grub_uint8_t version[VERSION_LEN]; ++ grub_uint8_t init_version[VERSION_LEN]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_checkpoint ++{ ++ grub_uint64_t checkpoint_ver; ++ grub_uint64_t user_block_count; ++ grub_uint64_t valid_block_count; ++ grub_uint32_t rsvd_segment_count; ++ grub_uint32_t overprov_segment_count; ++ grub_uint32_t free_segment_count; ++ grub_uint32_t cur_node_segno[MAX_ACTIVE_NODE_LOGS]; ++ grub_uint16_t cur_node_blkoff[MAX_ACTIVE_NODE_LOGS]; ++ grub_uint32_t cur_data_segno[MAX_ACTIVE_DATA_LOGS]; ++ grub_uint16_t cur_data_blkoff[MAX_ACTIVE_DATA_LOGS]; ++ grub_uint32_t ckpt_flags; ++ grub_uint32_t cp_pack_total_block_count; ++ grub_uint32_t cp_pack_start_sum; ++ grub_uint32_t valid_node_count; ++ grub_uint32_t valid_inode_count; ++ grub_uint32_t next_free_nid; ++ grub_uint32_t sit_ver_bitmap_bytesize; ++ grub_uint32_t nat_ver_bitmap_bytesize; ++ grub_uint32_t checksum_offset; ++ grub_uint64_t elapsed_time; ++ grub_uint8_t alloc_type[MAX_ACTIVE_LOGS]; ++ grub_uint8_t sit_nat_version_bitmap[3900]; ++ grub_uint32_t checksum; ++} GRUB_PACKED; ++ ++struct grub_f2fs_nat_entry { ++ grub_uint8_t version; ++ grub_uint32_t ino; ++ grub_uint32_t block_addr; ++} GRUB_PACKED; ++ ++struct grub_f2fs_nat_jent ++{ ++ grub_uint32_t nid; ++ struct grub_f2fs_nat_entry ne; ++} GRUB_PACKED; ++ ++struct grub_f2fs_nat_journal { ++ grub_uint16_t n_nats; ++ struct grub_f2fs_nat_jent entries[NAT_JOURNAL_ENTRIES]; ++ grub_uint8_t reserved[NAT_JOURNAL_RESERVED]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_nat_block { ++ struct grub_f2fs_nat_entry ne[NAT_ENTRY_PER_BLOCK]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_dir_entry ++{ ++ grub_uint32_t hash_code; ++ grub_uint32_t ino; ++ grub_uint16_t name_len; ++ grub_uint8_t file_type; ++} GRUB_PACKED; ++ ++struct grub_f2fs_inline_dentry ++{ ++ grub_uint8_t dentry_bitmap[INLINE_DENTRY_BITMAP_SIZE]; ++ grub_uint8_t reserved[INLINE_RESERVED_SIZE]; ++ struct grub_f2fs_dir_entry dentry[NR_INLINE_DENTRY]; ++ grub_uint8_t filename[NR_INLINE_DENTRY][F2FS_SLOT_LEN]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_dentry_block { ++ grub_uint8_t dentry_bitmap[SIZE_OF_DENTRY_BITMAP]; ++ grub_uint8_t reserved[SIZE_OF_RESERVED]; ++ struct grub_f2fs_dir_entry dentry[NR_DENTRY_IN_BLOCK]; ++ grub_uint8_t filename[NR_DENTRY_IN_BLOCK][F2FS_SLOT_LEN]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_inode ++{ ++ grub_uint16_t i_mode; ++ grub_uint8_t i_advise; ++ grub_uint8_t i_inline; ++ grub_uint32_t i_uid; ++ grub_uint32_t i_gid; ++ grub_uint32_t i_links; ++ grub_uint64_t i_size; ++ grub_uint64_t i_blocks; ++ grub_uint64_t i_atime; ++ grub_uint64_t i_ctime; ++ grub_uint64_t i_mtime; ++ grub_uint32_t i_atime_nsec; ++ grub_uint32_t i_ctime_nsec; ++ grub_uint32_t i_mtime_nsec; ++ grub_uint32_t i_generation; ++ grub_uint32_t i_current_depth; ++ grub_uint32_t i_xattr_nid; ++ grub_uint32_t i_flags; ++ grub_uint32_t i_pino; ++ grub_uint32_t i_namelen; ++ grub_uint8_t i_name[F2FS_NAME_LEN]; ++ grub_uint8_t i_dir_level; ++ grub_uint8_t i_ext[12]; ++ grub_uint32_t i_addr[DEF_ADDRS_PER_INODE]; ++ grub_uint32_t i_nid[5]; ++} GRUB_PACKED; ++ ++struct grub_direct_node { ++ grub_uint32_t addr[ADDRS_PER_BLOCK]; ++} GRUB_PACKED; ++ ++struct grub_indirect_node { ++ grub_uint32_t nid[NIDS_PER_BLOCK]; ++} GRUB_PACKED; ++ ++struct grub_f2fs_node ++{ ++ union ++ { ++ struct grub_f2fs_inode i; ++ struct grub_direct_node dn; ++ struct grub_indirect_node in; ++ /* Should occupy F2FS_BLKSIZE totally. */ ++ char buf[F2FS_BLKSIZE - 40]; ++ }; ++ grub_uint8_t dummy[40]; ++} GRUB_PACKED; ++ ++struct grub_fshelp_node ++{ ++ struct grub_f2fs_data *data; ++ struct grub_f2fs_node inode; ++ grub_uint32_t ino; ++ int inode_read; ++}; ++ ++struct grub_f2fs_data ++{ ++ struct grub_f2fs_superblock sblock; ++ struct grub_f2fs_checkpoint ckpt; ++ ++ grub_uint32_t root_ino; ++ grub_uint32_t blocks_per_seg; ++ grub_uint32_t cp_blkaddr; ++ grub_uint32_t nat_blkaddr; ++ ++ struct grub_f2fs_nat_journal nat_j; ++ char *nat_bitmap; ++ ++ grub_disk_t disk; ++ struct grub_f2fs_node *inode; ++ struct grub_fshelp_node diropen; ++}; ++ ++struct grub_f2fs_dir_iter_ctx ++{ ++ struct grub_f2fs_data *data; ++ grub_fshelp_iterate_dir_hook_t hook; ++ void *hook_data; ++ grub_uint8_t *bitmap; ++ grub_uint8_t (*filename)[F2FS_SLOT_LEN]; ++ struct grub_f2fs_dir_entry *dentry; ++ int max; ++}; ++ ++struct grub_f2fs_dir_ctx ++{ ++ grub_fs_dir_hook_t hook; ++ void *hook_data; ++ struct grub_f2fs_data *data; ++}; ++ ++static grub_dl_t my_mod; ++ ++static int ++grub_f2fs_test_bit_le (int nr, const grub_uint8_t *addr) ++{ ++ return addr[nr >> 3] & (1 << (nr & 7)); ++} ++ ++static char * ++get_inline_addr (struct grub_f2fs_inode *inode) ++{ ++ return (char *) &inode->i_addr[1]; ++} ++ ++static grub_uint64_t ++grub_f2fs_file_size (struct grub_f2fs_inode *inode) ++{ ++ return grub_le_to_cpu64 (inode->i_size); ++} ++ ++static grub_uint32_t ++start_cp_addr (struct grub_f2fs_data *data) ++{ ++ struct grub_f2fs_checkpoint *ckpt = &data->ckpt; ++ grub_uint32_t start_addr = data->cp_blkaddr; ++ ++ if (!(ckpt->checkpoint_ver & grub_cpu_to_le64_compile_time(1))) ++ return start_addr + data->blocks_per_seg; ++ ++ return start_addr; ++} ++ ++static grub_uint32_t ++start_sum_block (struct grub_f2fs_data *data) ++{ ++ struct grub_f2fs_checkpoint *ckpt = &data->ckpt; ++ ++ return start_cp_addr (data) + grub_le_to_cpu32 (ckpt->cp_pack_start_sum); ++} ++ ++static grub_uint32_t ++sum_blk_addr (struct grub_f2fs_data *data, int base, int type) ++{ ++ struct grub_f2fs_checkpoint *ckpt = &data->ckpt; ++ ++ return start_cp_addr (data) + ++ grub_le_to_cpu32 (ckpt->cp_pack_total_block_count) - ++ (base + 1) + type; ++} ++ ++static void * ++nat_bitmap_ptr (struct grub_f2fs_data *data) ++{ ++ struct grub_f2fs_checkpoint *ckpt = &data->ckpt; ++ grub_uint32_t offset; ++ ++ if (grub_le_to_cpu32 (data->sblock.cp_payload) > 0) ++ return ckpt->sit_nat_version_bitmap; ++ ++ offset = grub_le_to_cpu32 (ckpt->sit_ver_bitmap_bytesize); ++ ++ return ckpt->sit_nat_version_bitmap + offset; ++} ++ ++static grub_uint32_t ++get_node_id (struct grub_f2fs_node *rn, int off, int inode_block) ++{ ++ if (inode_block) ++ return grub_le_to_cpu32 (rn->i.i_nid[off - NODE_DIR1_BLOCK]); ++ ++ return grub_le_to_cpu32 (rn->in.nid[off]); ++} ++ ++static grub_err_t ++grub_f2fs_block_read (struct grub_f2fs_data *data, grub_uint32_t blkaddr, ++ void *buf) ++{ ++ return grub_disk_read (data->disk, ++ ((grub_disk_addr_t)blkaddr) << F2FS_BLK_SEC_BITS, ++ 0, F2FS_BLKSIZE, buf); ++} ++ ++/* CRC32 */ ++static grub_uint32_t ++grub_f2fs_cal_crc32 (const void *buf, const grub_uint32_t len) ++{ ++ grub_uint32_t crc = F2FS_SUPER_MAGIC; ++ unsigned char *p = (unsigned char *)buf; ++ grub_uint32_t tmp = len; ++ int i; ++ ++ while (tmp--) ++ { ++ crc ^= *p++; ++ for (i = 0; i < 8; i++) ++ crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); ++ } ++ ++ return crc; ++} ++ ++static int ++grub_f2fs_crc_valid (grub_uint32_t blk_crc, void *buf, const grub_uint32_t len) ++{ ++ grub_uint32_t cal_crc = 0; ++ ++ cal_crc = grub_f2fs_cal_crc32 (buf, len); ++ ++ return (cal_crc == blk_crc) ? 1 : 0; ++} ++ ++static int ++grub_f2fs_test_bit (grub_uint32_t nr, const char *p) ++{ ++ int mask; ++ ++ p += (nr >> 3); ++ mask = 1 << (7 - (nr & 0x07)); ++ ++ return mask & *p; ++} ++ ++static int ++grub_f2fs_sanity_check_sb (struct grub_f2fs_superblock *sb) ++{ ++ grub_uint32_t log_sectorsize, log_sectors_per_block; ++ ++ if (sb->magic != grub_cpu_to_le32_compile_time (F2FS_SUPER_MAGIC)) ++ return -1; ++ ++ if (sb->log_blocksize != grub_cpu_to_le32_compile_time (F2FS_BLK_BITS)) ++ return -1; ++ ++ log_sectorsize = grub_le_to_cpu32 (sb->log_sectorsize); ++ log_sectors_per_block = grub_le_to_cpu32 (sb->log_sectors_per_block); ++ ++ if (log_sectorsize > F2FS_BLK_BITS) ++ return -1; ++ ++ if (log_sectorsize < F2FS_MIN_LOG_SECTOR_SIZE) ++ return -1; ++ ++ if (log_sectors_per_block + log_sectorsize != F2FS_BLK_BITS) ++ return -1; ++ ++ return 0; ++} ++ ++static int ++grub_f2fs_read_sb (struct grub_f2fs_data *data, grub_disk_addr_t offset) ++{ ++ grub_disk_t disk = data->disk; ++ grub_err_t err; ++ ++ /* Read first super block. */ ++ err = grub_disk_read (disk, offset, 0, sizeof (data->sblock), &data->sblock); ++ if (err) ++ return -1; ++ ++ return grub_f2fs_sanity_check_sb (&data->sblock); ++} ++ ++static void * ++validate_checkpoint (struct grub_f2fs_data *data, grub_uint32_t cp_addr, ++ grub_uint64_t *version) ++{ ++ grub_uint32_t *cp_page_1, *cp_page_2; ++ struct grub_f2fs_checkpoint *cp_block; ++ grub_uint64_t cur_version = 0, pre_version = 0; ++ grub_uint32_t crc = 0; ++ grub_uint32_t crc_offset; ++ grub_err_t err; ++ ++ /* Read the 1st cp block in this CP pack. */ ++ cp_page_1 = grub_malloc (F2FS_BLKSIZE); ++ if (!cp_page_1) ++ return NULL; ++ ++ err = grub_f2fs_block_read (data, cp_addr, cp_page_1); ++ if (err) ++ goto invalid_cp1; ++ ++ cp_block = (struct grub_f2fs_checkpoint *)cp_page_1; ++ crc_offset = grub_le_to_cpu32 (cp_block->checksum_offset); ++ if (crc_offset != CHECKSUM_OFFSET) ++ goto invalid_cp1; ++ ++ crc = grub_le_to_cpu32 (*(cp_page_1 + U32_CHECKSUM_OFFSET)); ++ if (!grub_f2fs_crc_valid (crc, cp_block, crc_offset)) ++ goto invalid_cp1; ++ ++ pre_version = grub_le_to_cpu64 (cp_block->checkpoint_ver); ++ ++ /* Read the 2nd cp block in this CP pack. */ ++ cp_page_2 = grub_malloc (F2FS_BLKSIZE); ++ if (!cp_page_2) ++ goto invalid_cp1; ++ ++ cp_addr += grub_le_to_cpu32 (cp_block->cp_pack_total_block_count) - 1; ++ ++ err = grub_f2fs_block_read (data, cp_addr, cp_page_2); ++ if (err) ++ goto invalid_cp2; ++ ++ cp_block = (struct grub_f2fs_checkpoint *)cp_page_2; ++ crc_offset = grub_le_to_cpu32 (cp_block->checksum_offset); ++ if (crc_offset != CHECKSUM_OFFSET) ++ goto invalid_cp2; ++ ++ crc = grub_le_to_cpu32 (*(cp_page_2 + U32_CHECKSUM_OFFSET)); ++ if (!grub_f2fs_crc_valid (crc, cp_block, crc_offset)) ++ goto invalid_cp2; ++ ++ cur_version = grub_le_to_cpu64 (cp_block->checkpoint_ver); ++ if (cur_version == pre_version) ++ { ++ *version = cur_version; ++ grub_free (cp_page_2); ++ ++ return cp_page_1; ++ } ++ ++ invalid_cp2: ++ grub_free (cp_page_2); ++ ++ invalid_cp1: ++ grub_free (cp_page_1); ++ ++ return NULL; ++} ++ ++static grub_err_t ++grub_f2fs_read_cp (struct grub_f2fs_data *data) ++{ ++ void *cp1, *cp2, *cur_page; ++ grub_uint64_t cp1_version = 0, cp2_version = 0; ++ grub_uint64_t cp_start_blk_no; ++ ++ /* ++ * Finding out valid cp block involves read both ++ * sets (cp pack1 and cp pack 2). ++ */ ++ cp_start_blk_no = data->cp_blkaddr; ++ cp1 = validate_checkpoint (data, cp_start_blk_no, &cp1_version); ++ if (!cp1 && grub_errno) ++ return grub_errno; ++ ++ /* The second checkpoint pack should start at the next segment. */ ++ cp_start_blk_no += data->blocks_per_seg; ++ cp2 = validate_checkpoint (data, cp_start_blk_no, &cp2_version); ++ if (!cp2 && grub_errno) ++ { ++ grub_free (cp1); ++ return grub_errno; ++ } ++ ++ if (cp1 && cp2) ++ cur_page = (cp2_version > cp1_version) ? cp2 : cp1; ++ else if (cp1) ++ cur_page = cp1; ++ else if (cp2) ++ cur_page = cp2; ++ else ++ return grub_error (GRUB_ERR_BAD_FS, "no checkpoints"); ++ ++ grub_memcpy (&data->ckpt, cur_page, F2FS_BLKSIZE); ++ ++ grub_free (cp1); ++ grub_free (cp2); ++ ++ return 0; ++} ++ ++static grub_err_t ++get_nat_journal (struct grub_f2fs_data *data) ++{ ++ grub_uint32_t block; ++ char *buf; ++ grub_err_t err; ++ ++ buf = grub_malloc (F2FS_BLKSIZE); ++ if (!buf) ++ return grub_errno; ++ ++ if (CKPT_FLAG_SET(&data->ckpt, CP_COMPACT_SUM_FLAG)) ++ block = start_sum_block (data); ++ else if (CKPT_FLAG_SET (&data->ckpt, CP_UMOUNT_FLAG)) ++ block = sum_blk_addr (data, NR_CURSEG_TYPE, CURSEG_HOT_DATA); ++ else ++ block = sum_blk_addr (data, NR_CURSEG_DATA_TYPE, CURSEG_HOT_DATA); ++ ++ err = grub_f2fs_block_read (data, block, buf); ++ if (err) ++ goto fail; ++ ++ if (CKPT_FLAG_SET (&data->ckpt, CP_COMPACT_SUM_FLAG)) ++ grub_memcpy (&data->nat_j, buf, SUM_JOURNAL_SIZE); ++ else ++ grub_memcpy (&data->nat_j, buf + SUM_ENTRIES_SIZE, SUM_JOURNAL_SIZE); ++ ++ fail: ++ grub_free (buf); ++ ++ return err; ++} ++ ++static grub_uint32_t ++get_blkaddr_from_nat_journal (struct grub_f2fs_data *data, grub_uint32_t nid) ++{ ++ grub_uint16_t n = grub_le_to_cpu16 (data->nat_j.n_nats); ++ grub_uint32_t blkaddr = 0; ++ grub_uint16_t i; ++ ++ for (i = 0; i < n; i++) ++ { ++ if (grub_le_to_cpu32 (data->nat_j.entries[i].nid) == nid) ++ { ++ blkaddr = grub_le_to_cpu32 (data->nat_j.entries[i].ne.block_addr); ++ break; ++ } ++ } ++ ++ return blkaddr; ++} ++ ++static grub_uint32_t ++get_node_blkaddr (struct grub_f2fs_data *data, grub_uint32_t nid) ++{ ++ struct grub_f2fs_nat_block *nat_block; ++ grub_uint32_t seg_off, block_off, entry_off, block_addr; ++ grub_uint32_t blkaddr; ++ grub_err_t err; ++ ++ blkaddr = get_blkaddr_from_nat_journal (data, nid); ++ if (blkaddr) ++ return blkaddr; ++ ++ nat_block = grub_malloc (F2FS_BLKSIZE); ++ if (!nat_block) ++ return 0; ++ ++ block_off = nid / NAT_ENTRY_PER_BLOCK; ++ entry_off = nid % NAT_ENTRY_PER_BLOCK; ++ ++ seg_off = block_off / data->blocks_per_seg; ++ block_addr = data->nat_blkaddr + ++ ((seg_off * data->blocks_per_seg) << 1) + ++ (block_off & (data->blocks_per_seg - 1)); ++ ++ if (grub_f2fs_test_bit (block_off, data->nat_bitmap)) ++ block_addr += data->blocks_per_seg; ++ ++ err = grub_f2fs_block_read (data, block_addr, nat_block); ++ if (err) ++ { ++ grub_free (nat_block); ++ return 0; ++ } ++ ++ blkaddr = grub_le_to_cpu32 (nat_block->ne[entry_off].block_addr); ++ ++ grub_free (nat_block); ++ ++ return blkaddr; ++} ++ ++static int ++grub_get_node_path (struct grub_f2fs_inode *inode, grub_uint32_t block, ++ grub_uint32_t offset[4], grub_uint32_t noffset[4]) ++{ ++ grub_uint32_t direct_blks = ADDRS_PER_BLOCK; ++ grub_uint32_t dptrs_per_blk = NIDS_PER_BLOCK; ++ grub_uint32_t indirect_blks = ADDRS_PER_BLOCK * NIDS_PER_BLOCK; ++ grub_uint32_t dindirect_blks = indirect_blks * NIDS_PER_BLOCK; ++ grub_uint32_t direct_index = DEF_ADDRS_PER_INODE; ++ int n = 0; ++ int level = 0; ++ ++ if (inode->i_inline & F2FS_INLINE_XATTR) ++ direct_index -= F2FS_INLINE_XATTR_ADDRS; ++ ++ noffset[0] = 0; ++ ++ if (block < direct_index) ++ { ++ offset[n] = block; ++ goto got; ++ } ++ ++ block -= direct_index; ++ if (block < direct_blks) ++ { ++ offset[n++] = NODE_DIR1_BLOCK; ++ noffset[n] = 1; ++ offset[n] = block; ++ level = 1; ++ goto got; ++ } ++ ++ block -= direct_blks; ++ if (block < direct_blks) ++ { ++ offset[n++] = NODE_DIR2_BLOCK; ++ noffset[n] = 2; ++ offset[n] = block; ++ level = 1; ++ goto got; ++ } ++ ++ block -= direct_blks; ++ if (block < indirect_blks) ++ { ++ offset[n++] = NODE_IND1_BLOCK; ++ noffset[n] = 3; ++ offset[n++] = block / direct_blks; ++ noffset[n] = 4 + offset[n - 1]; ++ offset[n] = block % direct_blks; ++ level = 2; ++ goto got; ++ } ++ ++ block -= indirect_blks; ++ if (block < indirect_blks) ++ { ++ offset[n++] = NODE_IND2_BLOCK; ++ noffset[n] = 4 + dptrs_per_blk; ++ offset[n++] = block / direct_blks; ++ noffset[n] = 5 + dptrs_per_blk + offset[n - 1]; ++ offset[n] = block % direct_blks; ++ level = 2; ++ goto got; ++ } ++ ++ block -= indirect_blks; ++ if (block < dindirect_blks) ++ { ++ offset[n++] = NODE_DIND_BLOCK; ++ noffset[n] = 5 + (dptrs_per_blk * 2); ++ offset[n++] = block / indirect_blks; ++ noffset[n] = 6 + (dptrs_per_blk * 2) + ++ offset[n - 1] * (dptrs_per_blk + 1); ++ offset[n++] = (block / direct_blks) % dptrs_per_blk; ++ noffset[n] = 7 + (dptrs_per_blk * 2) + ++ offset[n - 2] * (dptrs_per_blk + 1) + offset[n - 1]; ++ offset[n] = block % direct_blks; ++ level = 3; ++ goto got; ++ } ++ ++ got: ++ return level; ++} ++ ++static grub_err_t ++grub_f2fs_read_node (struct grub_f2fs_data *data, ++ grub_uint32_t nid, struct grub_f2fs_node *np) ++{ ++ grub_uint32_t blkaddr; ++ ++ blkaddr = get_node_blkaddr (data, nid); ++ if (!blkaddr) ++ return grub_errno; ++ ++ return grub_f2fs_block_read (data, blkaddr, np); ++} ++ ++static struct grub_f2fs_data * ++grub_f2fs_mount (grub_disk_t disk) ++{ ++ struct grub_f2fs_data *data; ++ grub_err_t err; ++ ++ data = grub_malloc (sizeof (*data)); ++ if (!data) ++ return NULL; ++ ++ data->disk = disk; ++ ++ if (grub_f2fs_read_sb (data, F2FS_SUPER_OFFSET0)) ++ { ++ if (grub_f2fs_read_sb (data, F2FS_SUPER_OFFSET1)) ++ { ++ if (grub_errno == GRUB_ERR_NONE) ++ grub_error (GRUB_ERR_BAD_FS, ++ "not a F2FS filesystem (no superblock)"); ++ goto fail; ++ } ++ } ++ ++ data->root_ino = grub_le_to_cpu32 (data->sblock.root_ino); ++ data->cp_blkaddr = grub_le_to_cpu32 (data->sblock.cp_blkaddr); ++ data->nat_blkaddr = grub_le_to_cpu32 (data->sblock.nat_blkaddr); ++ data->blocks_per_seg = 1 << ++ grub_le_to_cpu32 (data->sblock.log_blocks_per_seg); ++ ++ err = grub_f2fs_read_cp (data); ++ if (err) ++ goto fail; ++ ++ data->nat_bitmap = nat_bitmap_ptr (data); ++ ++ err = get_nat_journal (data); ++ if (err) ++ goto fail; ++ ++ data->diropen.data = data; ++ data->diropen.ino = data->root_ino; ++ data->diropen.inode_read = 1; ++ data->inode = &data->diropen.inode; ++ ++ err = grub_f2fs_read_node (data, data->root_ino, data->inode); ++ if (err) ++ goto fail; ++ ++ return data; ++ ++ fail: ++ grub_free (data); ++ ++ return NULL; ++} ++ ++/* Guarantee inline_data was handled by caller. */ ++static grub_disk_addr_t ++grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs) ++{ ++ struct grub_f2fs_data *data = node->data; ++ struct grub_f2fs_inode *inode = &node->inode.i; ++ grub_uint32_t offset[4], noffset[4], nids[4]; ++ struct grub_f2fs_node *node_block; ++ grub_uint32_t block_addr = -1; ++ int level, i; ++ ++ level = grub_get_node_path (inode, block_ofs, offset, noffset); ++ if (level == 0) ++ return grub_le_to_cpu32 (inode->i_addr[offset[0]]); ++ ++ node_block = grub_malloc (F2FS_BLKSIZE); ++ if (!node_block) ++ return -1; ++ ++ nids[1] = get_node_id (&node->inode, offset[0], 1); ++ ++ /* Get indirect or direct nodes. */ ++ for (i = 1; i <= level; i++) ++ { ++ grub_f2fs_read_node (data, nids[i], node_block); ++ if (grub_errno) ++ goto fail; ++ ++ if (i < level) ++ nids[i + 1] = get_node_id (node_block, offset[i], 0); ++ } ++ ++ block_addr = grub_le_to_cpu32 (node_block->dn.addr[offset[level]]); ++ ++ fail: ++ grub_free (node_block); ++ ++ return block_addr; ++} ++ ++static grub_ssize_t ++grub_f2fs_read_file (grub_fshelp_node_t node, ++ grub_disk_read_hook_t read_hook, void *read_hook_data, ++ grub_off_t pos, grub_size_t len, char *buf) ++{ ++ struct grub_f2fs_inode *inode = &node->inode.i; ++ grub_off_t filesize = grub_f2fs_file_size (inode); ++ char *inline_addr = get_inline_addr (inode); ++ ++ if (inode->i_inline & F2FS_INLINE_DATA) ++ { ++ if (filesize > MAX_INLINE_DATA) ++ return -1; ++ ++ if (len > filesize - pos) ++ len = filesize - pos; ++ ++ grub_memcpy (buf, inline_addr + pos, len); ++ return len; ++ } ++ ++ return grub_fshelp_read_file (node->data->disk, node, ++ read_hook, read_hook_data, ++ pos, len, buf, grub_f2fs_get_block, ++ filesize, ++ F2FS_BLK_SEC_BITS, 0); ++} ++ ++static char * ++grub_f2fs_read_symlink (grub_fshelp_node_t node) ++{ ++ char *symlink; ++ struct grub_fshelp_node *diro = node; ++ grub_uint64_t filesize; ++ ++ if (!diro->inode_read) ++ { ++ grub_f2fs_read_node (diro->data, diro->ino, &diro->inode); ++ if (grub_errno) ++ return 0; ++ } ++ ++ filesize = grub_f2fs_file_size(&diro->inode.i); ++ ++ symlink = grub_malloc (filesize + 1); ++ if (!symlink) ++ return 0; ++ ++ grub_f2fs_read_file (diro, 0, 0, 0, filesize, symlink); ++ if (grub_errno) ++ { ++ grub_free (symlink); ++ return 0; ++ } ++ ++ symlink[filesize] = '\0'; ++ ++ return symlink; ++} ++ ++static int ++grub_f2fs_check_dentries (struct grub_f2fs_dir_iter_ctx *ctx) ++{ ++ struct grub_fshelp_node *fdiro; ++ int i; ++ ++ for (i = 0; i < ctx->max;) ++ { ++ char *filename; ++ enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; ++ enum FILE_TYPE ftype; ++ int name_len; ++ int ret; ++ ++ if (grub_f2fs_test_bit_le (i, ctx->bitmap) == 0) ++ { ++ i++; ++ continue; ++ } ++ ++ ftype = ctx->dentry[i].file_type; ++ name_len = grub_le_to_cpu16 (ctx->dentry[i].name_len); ++ filename = grub_malloc (name_len + 1); ++ if (!filename) ++ return 0; ++ ++ grub_memcpy (filename, ctx->filename[i], name_len); ++ filename[name_len] = 0; ++ ++ fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); ++ if (!fdiro) ++ { ++ grub_free(filename); ++ return 0; ++ } ++ ++ if (ftype == F2FS_FT_DIR) ++ type = GRUB_FSHELP_DIR; ++ else if (ftype == F2FS_FT_SYMLINK) ++ type = GRUB_FSHELP_SYMLINK; ++ else if (ftype == F2FS_FT_REG_FILE) ++ type = GRUB_FSHELP_REG; ++ ++ fdiro->data = ctx->data; ++ fdiro->ino = grub_le_to_cpu32 (ctx->dentry[i].ino); ++ fdiro->inode_read = 0; ++ ++ ret = ctx->hook (filename, type, fdiro, ctx->hook_data); ++ grub_free(filename); ++ if (ret) ++ return 1; ++ ++ i += (name_len + F2FS_SLOT_LEN - 1) / F2FS_SLOT_LEN; ++ } ++ ++ return 0; ++} ++ ++static int ++grub_f2fs_iterate_inline_dir (struct grub_f2fs_inode *dir, ++ struct grub_f2fs_dir_iter_ctx *ctx) ++{ ++ struct grub_f2fs_inline_dentry *de_blk; ++ ++ de_blk = (struct grub_f2fs_inline_dentry *) get_inline_addr (dir); ++ ++ ctx->bitmap = de_blk->dentry_bitmap; ++ ctx->dentry = de_blk->dentry; ++ ctx->filename = de_blk->filename; ++ ctx->max = NR_INLINE_DENTRY; ++ ++ return grub_f2fs_check_dentries (ctx); ++} ++ ++static int ++grub_f2fs_iterate_dir (grub_fshelp_node_t dir, ++ grub_fshelp_iterate_dir_hook_t hook, void *hook_data) ++{ ++ struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; ++ struct grub_f2fs_inode *inode; ++ struct grub_f2fs_dir_iter_ctx ctx = { ++ .data = diro->data, ++ .hook = hook, ++ .hook_data = hook_data ++ }; ++ grub_off_t fpos = 0; ++ ++ if (!diro->inode_read) ++ { ++ grub_f2fs_read_node (diro->data, diro->ino, &diro->inode); ++ if (grub_errno) ++ return 0; ++ } ++ ++ inode = &diro->inode.i; ++ ++ if (inode->i_inline & F2FS_INLINE_DENTRY) ++ return grub_f2fs_iterate_inline_dir (inode, &ctx); ++ ++ while (fpos < grub_f2fs_file_size (inode)) ++ { ++ struct grub_f2fs_dentry_block *de_blk; ++ char *buf; ++ int ret; ++ ++ buf = grub_zalloc (F2FS_BLKSIZE); ++ if (!buf) ++ return 0; ++ ++ grub_f2fs_read_file (diro, 0, 0, fpos, F2FS_BLKSIZE, buf); ++ if (grub_errno) ++ { ++ grub_free (buf); ++ return 0; ++ } ++ ++ de_blk = (struct grub_f2fs_dentry_block *) buf; ++ ++ ctx.bitmap = de_blk->dentry_bitmap; ++ ctx.dentry = de_blk->dentry; ++ ctx.filename = de_blk->filename; ++ ctx.max = NR_DENTRY_IN_BLOCK; ++ ++ ret = grub_f2fs_check_dentries (&ctx); ++ grub_free (buf); ++ if (ret) ++ return 1; ++ ++ fpos += F2FS_BLKSIZE; ++ } ++ ++ return 0; ++} ++ ++static int ++grub_f2fs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, ++ grub_fshelp_node_t node, void *data) ++{ ++ struct grub_f2fs_dir_ctx *ctx = data; ++ struct grub_dirhook_info info; ++ ++ grub_memset (&info, 0, sizeof (info)); ++ if (!node->inode_read) ++ { ++ grub_f2fs_read_node (ctx->data, node->ino, &node->inode); ++ if (!grub_errno) ++ node->inode_read = 1; ++ grub_errno = GRUB_ERR_NONE; ++ } ++ if (node->inode_read) ++ { ++ info.mtimeset = 1; ++ info.mtime = grub_le_to_cpu64 (node->inode.i.i_mtime); ++ } ++ ++ info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); ++ grub_free (node); ++ ++ return ctx->hook (filename, &info, ctx->hook_data); ++} ++ ++static grub_err_t ++grub_f2fs_dir (grub_device_t device, const char *path, ++ grub_fs_dir_hook_t hook, void *hook_data) ++{ ++ struct grub_f2fs_dir_ctx ctx = { ++ .hook = hook, ++ .hook_data = hook_data ++ }; ++ struct grub_fshelp_node *fdiro = 0; ++ ++ grub_dl_ref (my_mod); ++ ++ ctx.data = grub_f2fs_mount (device->disk); ++ if (!ctx.data) ++ goto fail; ++ ++ grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro, ++ grub_f2fs_iterate_dir, grub_f2fs_read_symlink, ++ GRUB_FSHELP_DIR); ++ if (grub_errno) ++ goto fail; ++ ++ grub_f2fs_iterate_dir (fdiro, grub_f2fs_dir_iter, &ctx); ++ ++ fail: ++ if (fdiro != &ctx.data->diropen) ++ grub_free (fdiro); ++ grub_free (ctx.data); ++ grub_dl_unref (my_mod); ++ ++ return grub_errno; ++} ++ ++/* Open a file named NAME and initialize FILE. */ ++static grub_err_t ++grub_f2fs_open (struct grub_file *file, const char *name) ++{ ++ struct grub_f2fs_data *data = NULL; ++ struct grub_fshelp_node *fdiro = 0; ++ struct grub_f2fs_inode *inode; ++ ++ grub_dl_ref (my_mod); ++ ++ data = grub_f2fs_mount (file->device->disk); ++ if (!data) ++ goto fail; ++ ++ grub_fshelp_find_file (name, &data->diropen, &fdiro, ++ grub_f2fs_iterate_dir, grub_f2fs_read_symlink, ++ GRUB_FSHELP_REG); ++ if (grub_errno) ++ goto fail; ++ ++ if (!fdiro->inode_read) ++ { ++ grub_f2fs_read_node (data, fdiro->ino, &fdiro->inode); ++ if (grub_errno) ++ goto fail; ++ } ++ ++ grub_memcpy (data->inode, &fdiro->inode, sizeof (*data->inode)); ++ grub_free (fdiro); ++ ++ inode = &(data->inode->i); ++ file->size = grub_f2fs_file_size (inode); ++ file->data = data; ++ file->offset = 0; ++ ++ if (inode->i_inline & F2FS_INLINE_DATA && file->size > MAX_INLINE_DATA) ++ grub_error (GRUB_ERR_BAD_FS, "corrupted inline_data: need fsck"); ++ ++ return 0; ++ ++ fail: ++ if (fdiro != &data->diropen) ++ grub_free (fdiro); ++ grub_free (data); ++ ++ grub_dl_unref (my_mod); ++ ++ return grub_errno; ++} ++ ++static grub_ssize_t ++grub_f2fs_read (grub_file_t file, char *buf, grub_size_t len) ++{ ++ struct grub_f2fs_data *data = (struct grub_f2fs_data *) file->data; ++ ++ return grub_f2fs_read_file (&data->diropen, ++ file->read_hook, file->read_hook_data, ++ file->offset, len, buf); ++} ++ ++static grub_err_t ++grub_f2fs_close (grub_file_t file) ++{ ++ struct grub_f2fs_data *data = (struct grub_f2fs_data *) file->data; ++ ++ grub_free (data); ++ ++ grub_dl_unref (my_mod); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_uint8_t * ++grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) ++{ ++ grub_uint16_t in_buf[MAX_VOLUME_NAME]; ++ grub_uint8_t *out_buf; ++ int len = 0; ++ ++ out_buf = grub_malloc (MAX_VOLUME_NAME * GRUB_MAX_UTF8_PER_UTF16 + 1); ++ if (!out_buf) ++ return NULL; ++ ++ while (*in_buf_le != 0 && len < MAX_VOLUME_NAME) { ++ in_buf[len] = grub_le_to_cpu16 (in_buf_le[len]); ++ len++; ++ } ++ ++ *grub_utf16_to_utf8 (out_buf, in_buf, len) = '\0'; ++ ++ return out_buf; ++} ++ ++static grub_err_t ++grub_f2fs_label (grub_device_t device, char **label) ++{ ++ struct grub_f2fs_data *data; ++ grub_disk_t disk = device->disk; ++ ++ grub_dl_ref (my_mod); ++ ++ data = grub_f2fs_mount (disk); ++ if (data) ++ *label = (char *) grub_f2fs_utf16_to_utf8 (data->sblock.volume_name); ++ else ++ *label = NULL; ++ ++ grub_free (data); ++ grub_dl_unref (my_mod); ++ ++ return grub_errno; ++} ++ ++static grub_err_t ++grub_f2fs_uuid (grub_device_t device, char **uuid) ++{ ++ struct grub_f2fs_data *data; ++ grub_disk_t disk = device->disk; ++ ++ grub_dl_ref (my_mod); ++ ++ data = grub_f2fs_mount (disk); ++ if (data) ++ { ++ *uuid = ++ grub_xasprintf ++ ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", ++ data->sblock.uuid[0], data->sblock.uuid[1], ++ data->sblock.uuid[2], data->sblock.uuid[3], ++ data->sblock.uuid[4], data->sblock.uuid[5], ++ data->sblock.uuid[6], data->sblock.uuid[7], ++ data->sblock.uuid[8], data->sblock.uuid[9], ++ data->sblock.uuid[10], data->sblock.uuid[11], ++ data->sblock.uuid[12], data->sblock.uuid[13], ++ data->sblock.uuid[14], data->sblock.uuid[15]); ++ } ++ else ++ *uuid = NULL; ++ ++ grub_free (data); ++ grub_dl_unref (my_mod); ++ ++ return grub_errno; ++} ++ ++static struct grub_fs grub_f2fs_fs = { ++ .name = "f2fs", ++ .dir = grub_f2fs_dir, ++ .open = grub_f2fs_open, ++ .read = grub_f2fs_read, ++ .close = grub_f2fs_close, ++ .label = grub_f2fs_label, ++ .uuid = grub_f2fs_uuid, ++#ifdef GRUB_UTIL ++ .reserved_first_sector = 1, ++ .blocklist_install = 0, ++#endif ++ .next = 0 ++}; ++ ++GRUB_MOD_INIT (f2fs) ++{ ++ grub_fs_register (&grub_f2fs_fs); ++ my_mod = mod; ++} ++ ++GRUB_MOD_FINI (f2fs) ++{ ++ grub_fs_unregister (&grub_f2fs_fs); ++} +diff --git a/docs/grub.texi b/docs/grub.texi +index 65b4bbeda18..0f2ab91fc69 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -360,8 +360,9 @@ blocklist notation. The currently supported filesystem types are @dfn{Amiga + Fast FileSystem (AFFS)}, @dfn{AtheOS fs}, @dfn{BeFS}, + @dfn{BtrFS} (including raid0, raid1, raid10, gzip and lzo), + @dfn{cpio} (little- and big-endian bin, odc and newc variants), +-@dfn{Linux ext2/ext3/ext4}, @dfn{DOS FAT12/FAT16/FAT32}, @dfn{exFAT}, @dfn{HFS}, +-@dfn{HFS+}, @dfn{ISO9660} (including Joliet, Rock-ridge and multi-chunk files), ++@dfn{Linux ext2/ext3/ext4}, @dfn{DOS FAT12/FAT16/FAT32}, ++@dfn{exFAT}, @dfn{F2FS}, @dfn{HFS}, @dfn{HFS+}, ++@dfn{ISO9660} (including Joliet, Rock-ridge and multi-chunk files), + @dfn{JFS}, @dfn{Minix fs} (versions 1, 2 and 3), @dfn{nilfs2}, + @dfn{NTFS} (including compression), @dfn{ReiserFS}, @dfn{ROMFS}, + @dfn{Amiga Smart FileSystem (SFS)}, @dfn{Squash4}, @dfn{tar}, @dfn{UDF}, +@@ -5375,7 +5376,7 @@ NTFS, JFS, UDF, HFS+, exFAT, long filenames in FAT, Joliet part of + ISO9660 are treated as UTF-16 as per specification. AFS and BFS are read + as UTF-8, again according to specification. BtrFS, cpio, tar, squash4, minix, + minix2, minix3, ROMFS, ReiserFS, XFS, ext2, ext3, ext4, FAT (short names), +-RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed ++F2FS, RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed + to be UTF-8. This might be false on systems configured with legacy charset + but as long as the charset used is superset of ASCII you should be able to + access ASCII-named files. And it's recommended to configure your system to use +diff --git a/po/exclude.pot b/po/exclude.pot +index 0a9b215eaf1971bf2a2af8a36e9605043de38e36..816089c30cbd36939b2a72724b3d591a0ac8a290 100644 +GIT binary patch +delta 49 +zcmaEUhNJl`#|G_WNh^i)qS7SY?UJ|KB{OOs +F1^~&~5lR36 + +delta 27 +jcmZoZ%klgS#|G`>=`Ng%LX#(mur$XeZ;wr8R67g+m_Q0B + +diff --git a/tests/f2fs_test.in b/tests/f2fs_test.in +new file mode 100644 +index 00000000000..1ea77c826d3 +--- /dev/null ++++ b/tests/f2fs_test.in +@@ -0,0 +1,19 @@ ++#!/bin/sh ++ ++set -e ++ ++if [ "x$EUID" = "x" ] ; then ++ EUID=`id -u` ++fi ++ ++if [ "$EUID" != 0 ] ; then ++ exit 77 ++fi ++ ++if ! which mkfs.f2fs >/dev/null 2>&1; then ++ echo "mkfs.f2fs not installed; cannot test f2fs." ++ exit 77 ++fi ++ ++ ++"@builddir@/grub-fs-tester" f2fs +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 15969d796a6..26bd57a8027 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -172,7 +172,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + xsquash*) + MINBLKSIZE=4096 + MAXBLKSIZE=1048576;; +- xxfs) ++ xxfs|xf2fs) + MINBLKSIZE=$SECSIZE + # OS Limitation: GNU/Linux doesn't accept > 4096 + MAXBLKSIZE=4096;; +@@ -299,6 +299,10 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + x"btrfs"*) + FSLABEL="grub_;/testé莭莽😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoi";; + ++ # FS LIMITATION: f2fs label is at most 512 UTF-16 chars ++ x"f2fs") ++ FSLABEL="grub_;/testé䏌䐓䏕киритiurewfceniuewruewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoirvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoircreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoiq";; ++ + # FS LIMITATION: exfat is at most 15 UTF-16 chars + x"exfat") + FSLABEL="géт ;/莭莽😁кир";; +@@ -508,7 +512,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + # FIXME: Not sure about BtrFS, NTFS, JFS, AFS, UDF and SFS. Check it. + # FS LIMITATION: as far as I know those FS don't store their last modification date. + x"jfs_caseins" | x"jfs" | x"xfs" | x"xfs_crc" | x"btrfs"* | x"reiserfs_old" | x"reiserfs" \ +- | x"bfs" | x"afs" \ ++ | x"bfs" | x"afs" | x"f2fs" \ + | x"tarfs" | x"cpio_"* | x"minix" | x"minix2" \ + | x"minix3" | x"ntfs"* | x"udf" | x"sfs"*) + NOFSTIME=y;; +@@ -792,6 +796,8 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + MOUNTDEVICE="/dev/mapper/grub_test-testvol" + MOUNTFS=ext2 + "mkfs.ext2" -L "$FSLABEL" -q "${MOUNTDEVICE}" ;; ++ xf2fs) ++ "mkfs.f2fs" -l "$FSLABEL" -q "${LODEVICES[0]}" ;; + xnilfs2) + "mkfs.nilfs2" -L "$FSLABEL" -b $BLKSIZE -q "${MOUNTDEVICE}" ;; + xext2_old) diff --git a/0138-diskboot-Trivial-correction-on-stale-comments.patch b/0138-diskboot-Trivial-correction-on-stale-comments.patch new file mode 100644 index 00000000..5b456437 --- /dev/null +++ b/0138-diskboot-Trivial-correction-on-stale-comments.patch @@ -0,0 +1,28 @@ +From 9dcac673ed08e874d883c6dc5af2017fb28eb3d5 Mon Sep 17 00:00:00 2001 +From: Cao jin +Date: Wed, 11 Apr 2018 11:23:10 +0800 +Subject: [PATCH] diskboot: Trivial correction on stale comments + +diskboot.img now is loaded at 0x8000 and is jumped to with 0:0x8000. + +Signed-off-by: Cao jin +Reviewed-by: Daniel Kiper +--- + grub-core/boot/i386/pc/diskboot.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S +index 1ee4cf5b2e0..c1addc0df29 100644 +--- a/grub-core/boot/i386/pc/diskboot.S ++++ b/grub-core/boot/i386/pc/diskboot.S +@@ -37,8 +37,8 @@ + start: + _start: + /* +- * _start is loaded at 0x2000 and is jumped to with +- * CS:IP 0:0x2000 in kernel. ++ * _start is loaded at 0x8000 and is jumped to with ++ * CS:IP 0:0x8000 in kernel. + */ + + /* diff --git a/0139-grub-install-Locale-depends-on-nls.patch b/0139-grub-install-Locale-depends-on-nls.patch new file mode 100644 index 00000000..806c1df1 --- /dev/null +++ b/0139-grub-install-Locale-depends-on-nls.patch @@ -0,0 +1,177 @@ +From 3d8439da8c9a4acf9bc1c41b364ec6e1680ef052 Mon Sep 17 00:00:00 2001 +From: Olaf Hering +Date: Fri, 13 Apr 2018 23:36:49 +0200 +Subject: [PATCH] grub-install: Locale depends on nls + +With --disable-nls no locales exist. + +Avoid runtime error by moving code that copies locales into its own +function. Return early in case nls was disabled. That way the compiler +will throw away unreachable code, no need to put preprocessor +conditionals everywhere to avoid warnings about unused code. + +Fix memleak by freeing srcf and dstf. +Convert tabs to spaces in moved code. + +Signed-off-by: Olaf Hering +Reviewed-by: Daniel Kiper +--- + util/grub-install-common.c | 106 ++++++++++++++++++++++++--------------------- + 1 file changed, 57 insertions(+), 49 deletions(-) + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index 9e3e358c96a..0a2e24a79f1 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -592,6 +592,7 @@ copy_all (const char *srcd, + grub_util_fd_closedir (d); + } + ++#if !(defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) + static const char * + get_localedir (void) + { +@@ -646,6 +647,59 @@ copy_locales (const char *dstd) + } + grub_util_fd_closedir (d); + } ++#endif ++ ++static void ++grub_install_copy_nls(const char *src __attribute__ ((unused)), ++ const char *dst __attribute__ ((unused))) ++{ ++#if !(defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) ++ char *dst_locale; ++ ++ dst_locale = grub_util_path_concat (2, dst, "locale"); ++ grub_install_mkdir_p (dst_locale); ++ clean_grub_dir (dst_locale); ++ ++ if (install_locales.is_default) ++ { ++ char *srcd = grub_util_path_concat (2, src, "po"); ++ copy_by_ext (srcd, dst_locale, ".mo", 0); ++ copy_locales (dst_locale); ++ free (srcd); ++ } ++ else ++ { ++ size_t i; ++ const char *locale_dir = get_localedir (); ++ ++ for (i = 0; i < install_locales.n_entries; i++) ++ { ++ char *srcf = grub_util_path_concat_ext (3, src, "po", ++ install_locales.entries[i], ++ ".mo"); ++ char *dstf = grub_util_path_concat_ext (2, dst_locale, ++ install_locales.entries[i], ++ ".mo"); ++ if (grub_install_compress_file (srcf, dstf, 0)) ++ { ++ free (srcf); ++ free (dstf); ++ continue; ++ } ++ free (srcf); ++ srcf = grub_util_path_concat_ext (4, locale_dir, ++ install_locales.entries[i], ++ "LC_MESSAGES", PACKAGE, ".mo"); ++ if (grub_install_compress_file (srcf, dstf, 0) == 0) ++ grub_util_error (_("cannot find locale `%s'"), ++ install_locales.entries[i]); ++ free (srcf); ++ free (dstf); ++ } ++ } ++ free (dst_locale); ++#endif ++} + + static struct + { +@@ -731,7 +785,7 @@ grub_install_copy_files (const char *src, + const char *dst, + enum grub_install_plat platid) + { +- char *dst_platform, *dst_locale, *dst_fonts; ++ char *dst_platform, *dst_fonts; + const char *pkgdatadir = grub_util_get_pkgdatadir (); + char *themes_dir; + +@@ -742,13 +796,12 @@ grub_install_copy_files (const char *src, + dst_platform = grub_util_path_concat (2, dst, platform); + free (platform); + } +- dst_locale = grub_util_path_concat (2, dst, "locale"); + dst_fonts = grub_util_path_concat (2, dst, "fonts"); + grub_install_mkdir_p (dst_platform); +- grub_install_mkdir_p (dst_locale); + clean_grub_dir (dst); + clean_grub_dir (dst_platform); +- clean_grub_dir (dst_locale); ++ ++ grub_install_copy_nls(src, dst); + + if (install_modules.is_default) + copy_by_ext (src, dst_platform, ".mod", 1); +@@ -797,50 +850,6 @@ grub_install_copy_files (const char *src, + free (dstf); + } + +- if (install_locales.is_default) +- { +- char *srcd = grub_util_path_concat (2, src, "po"); +- copy_by_ext (srcd, dst_locale, ".mo", 0); +- copy_locales (dst_locale); +- free (srcd); +- } +- else +- { +- const char *locale_dir = get_localedir (); +- +- for (i = 0; i < install_locales.n_entries; i++) +- { +- char *srcf = grub_util_path_concat_ext (3, src, +- "po", +- install_locales.entries[i], +- ".mo"); +- char *dstf = grub_util_path_concat_ext (2, dst_locale, +- install_locales.entries[i], +- ".mo"); +- if (grub_install_compress_file (srcf, dstf, 0)) +- { +- free (srcf); +- free (dstf); +- continue; +- } +- free (srcf); +- srcf = grub_util_path_concat_ext (4, +- locale_dir, +- install_locales.entries[i], +- "LC_MESSAGES", +- PACKAGE, +- ".mo"); +- if (grub_install_compress_file (srcf, dstf, 0)) +- { +- free (srcf); +- free (dstf); +- continue; +- } +- grub_util_error (_("cannot find locale `%s'"), +- install_locales.entries[i]); +- } +- } +- + if (install_themes.is_default) + { + install_themes.is_default = 0; +@@ -903,7 +912,6 @@ grub_install_copy_files (const char *src, + } + + free (dst_platform); +- free (dst_locale); + free (dst_fonts); + } + diff --git a/0140-grub-probe-Centralize-GUID-prints.patch b/0140-grub-probe-Centralize-GUID-prints.patch new file mode 100644 index 00000000..ba321f86 --- /dev/null +++ b/0140-grub-probe-Centralize-GUID-prints.patch @@ -0,0 +1,63 @@ +From c2b86ae1fcd22d6d5d275306795c0645ca6cad3d Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Mon, 16 Apr 2018 22:36:23 -0700 +Subject: [PATCH] grub-probe: Centralize GUID prints + +Define print_gpt_guid(), so there is a central function for printing +GUID strings. This change is a precursor for later patches which rely +on this logic. + +Signed-off-by: Nicholas Vinson +Reviewed-by: Daniel Kiper +--- + util/grub-probe.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 8ac527d2f2a..21cb80fbe15 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -129,6 +129,20 @@ get_targets_string (void) + return str; + } + ++static int ++print_gpt_guid (grub_gpt_part_guid_t guid) ++{ ++ guid.data1 = grub_le_to_cpu32 (guid.data1); ++ guid.data2 = grub_le_to_cpu16 (guid.data2); ++ guid.data3 = grub_le_to_cpu16 (guid.data3); ++ ++ return grub_printf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", ++ guid.data1, guid.data2, guid.data3, guid.data4[0], ++ guid.data4[1], guid.data4[2], guid.data4[3], ++ guid.data4[4], guid.data4[5], guid.data4[6], ++ guid.data4[7]); ++} ++ + static void + do_print (const char *x, void *data) + { +@@ -641,21 +655,7 @@ probe (const char *path, char **device_names, char delim) + + if (grub_disk_read (dev->disk, p->offset, p->index, + sizeof (gptdata), &gptdata) == 0) +- { +- grub_gpt_part_type_t gpttype; +- gpttype.data1 = grub_le_to_cpu32 (gptdata.type.data1); +- gpttype.data2 = grub_le_to_cpu16 (gptdata.type.data2); +- gpttype.data3 = grub_le_to_cpu16 (gptdata.type.data3); +- grub_memcpy (gpttype.data4, gptdata.type.data4, 8); +- +- grub_printf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", +- gpttype.data1, gpttype.data2, +- gpttype.data3, gpttype.data4[0], +- gpttype.data4[1], gpttype.data4[2], +- gpttype.data4[3], gpttype.data4[4], +- gpttype.data4[5], gpttype.data4[6], +- gpttype.data4[7]); +- } ++ print_gpt_guid(gptdata.type); + dev->disk->partition = p; + } + putchar (delim); diff --git a/0141-disk-Update-grub_gpt_partentry.patch b/0141-disk-Update-grub_gpt_partentry.patch new file mode 100644 index 00000000..21028476 --- /dev/null +++ b/0141-disk-Update-grub_gpt_partentry.patch @@ -0,0 +1,95 @@ +From a16f4a822fb528944b5dd008f97e37e0ed19a515 Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Mon, 16 Apr 2018 22:36:24 -0700 +Subject: [PATCH] disk: Update grub_gpt_partentry + +Rename grub_gpt_part_type to grub_gpt_part_guid and update grub_gpt_partentry +to use this type for both the partition type GUID string and the partition GUID +string entries. This change ensures that the two GUID fields are handled more +consistently and helps to simplify the changes needed to add Linux partition +GUID support. + +Signed-off-by: Nicholas Vinson +Reviewed-by: Daniel Kiper +--- + grub-core/disk/ldm.c | 2 +- + grub-core/partmap/gpt.c | 4 ++-- + util/grub-install.c | 2 +- + include/grub/gpt_partition.h | 8 ++++---- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c +index 0f978ad0507..2a22d2d6c1c 100644 +--- a/grub-core/disk/ldm.c ++++ b/grub-core/disk/ldm.c +@@ -135,7 +135,7 @@ msdos_has_ldm_partition (grub_disk_t dsk) + return has_ldm; + } + +-static const grub_gpt_part_type_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM; ++static const grub_gpt_part_guid_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM; + + /* Helper for gpt_ldm_sector. */ + static int +diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c +index 83bcba77914..103f6796f39 100644 +--- a/grub-core/partmap/gpt.c ++++ b/grub-core/partmap/gpt.c +@@ -33,10 +33,10 @@ static grub_uint8_t grub_gpt_magic[8] = + 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 + }; + +-static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; ++static const grub_gpt_part_guid_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; + + #ifdef GRUB_UTIL +-static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; ++static const grub_gpt_part_guid_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; + #endif + + /* 512 << 7 = 65536 byte sectors. */ +diff --git a/util/grub-install.c b/util/grub-install.c +index 690f180c5f6..78d0138cb0a 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -714,7 +714,7 @@ is_prep_partition (grub_device_t dev) + if (grub_disk_read (dev->disk, p->offset, p->index, + sizeof (gptdata), &gptdata) == 0) + { +- const grub_gpt_part_type_t template = { ++ const grub_gpt_part_guid_t template = { + grub_cpu_to_le32_compile_time (0x9e1a2d38), + grub_cpu_to_le16_compile_time (0xc612), + grub_cpu_to_le16_compile_time (0x4316), +diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h +index 9668a68c30a..7a93f43291c 100644 +--- a/include/grub/gpt_partition.h ++++ b/include/grub/gpt_partition.h +@@ -22,14 +22,14 @@ + #include + #include + +-struct grub_gpt_part_type ++struct grub_gpt_part_guid + { + grub_uint32_t data1; + grub_uint16_t data2; + grub_uint16_t data3; + grub_uint8_t data4[8]; + } GRUB_PACKED; +-typedef struct grub_gpt_part_type grub_gpt_part_type_t; ++typedef struct grub_gpt_part_guid grub_gpt_part_guid_t; + + #define GRUB_GPT_PARTITION_TYPE_EMPTY \ + { 0x0, 0x0, 0x0, \ +@@ -70,8 +70,8 @@ struct grub_gpt_header + + struct grub_gpt_partentry + { +- grub_gpt_part_type_t type; +- grub_uint8_t guid[16]; ++ grub_gpt_part_guid_t type; ++ grub_gpt_part_guid_t guid; + grub_uint64_t start; + grub_uint64_t end; + grub_uint64_t attrib; diff --git a/0142-grub-probe-Add-PARTUUID-detection-support.patch b/0142-grub-probe-Add-PARTUUID-detection-support.patch new file mode 100644 index 00000000..5b93c953 --- /dev/null +++ b/0142-grub-probe-Add-PARTUUID-detection-support.patch @@ -0,0 +1,100 @@ +From 0c0bcffc2378f7427f14f7f878b08ba8f1a1f508 Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Mon, 16 Apr 2018 22:36:25 -0700 +Subject: [PATCH] grub-probe: Add PARTUUID detection support + +Add PARTUUID detection support grub-probe for MBR and GPT partition schemes. + +Signed-off-by: Nicholas Vinson +Reviewed-by: Daniel Kiper +--- + util/grub-probe.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 21cb80fbe15..e45dbf9e049 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -62,6 +63,7 @@ enum { + PRINT_DRIVE, + PRINT_DEVICE, + PRINT_PARTMAP, ++ PRINT_PARTUUID, + PRINT_ABSTRACTION, + PRINT_CRYPTODISK_UUID, + PRINT_HINT_STR, +@@ -85,6 +87,7 @@ static const char *targets[] = + [PRINT_DRIVE] = "drive", + [PRINT_DEVICE] = "device", + [PRINT_PARTMAP] = "partmap", ++ [PRINT_PARTUUID] = "partuuid", + [PRINT_ABSTRACTION] = "abstraction", + [PRINT_CRYPTODISK_UUID] = "cryptodisk_uuid", + [PRINT_HINT_STR] = "hints_string", +@@ -181,6 +184,45 @@ probe_partmap (grub_disk_t disk, char delim) + } + } + ++static void ++probe_partuuid (grub_disk_t disk, char delim) ++{ ++ grub_partition_t p = disk->partition; ++ ++ /* ++ * Nested partitions not supported for now. ++ * Non-nested partitions must have disk->partition->parent == NULL ++ */ ++ if (p && p->parent == NULL) ++ { ++ disk->partition = p->parent; ++ ++ if (strcmp(p->partmap->name, "msdos") == 0) ++ { ++ /* ++ * The partition GUID for MSDOS is the partition number (starting ++ * with 1) prepended with the NT disk signature. ++ */ ++ grub_uint32_t nt_disk_sig; ++ ++ if (grub_disk_read (disk, 0, GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC, ++ sizeof(nt_disk_sig), &nt_disk_sig) == 0) ++ grub_printf ("%08x-%02x", ++ grub_le_to_cpu32(nt_disk_sig), 1 + p->number); ++ } ++ else if (strcmp(p->partmap->name, "gpt") == 0) ++ { ++ struct grub_gpt_partentry gptdata; ++ ++ if (grub_disk_read (disk, p->offset, p->index, ++ sizeof(gptdata), &gptdata) == 0) ++ print_gpt_guid(gptdata.guid); ++ } ++ ++ disk->partition = p; ++ } ++} ++ + static void + probe_cryptodisk_uuid (grub_disk_t disk, char delim) + { +@@ -635,6 +677,12 @@ probe (const char *path, char **device_names, char delim) + /* Check if dev->disk itself is contained in a partmap. */ + probe_partmap (dev->disk, delim); + ++ else if (print == PRINT_PARTUUID) ++ { ++ probe_partuuid (dev->disk, delim); ++ putchar (delim); ++ } ++ + else if (print == PRINT_MSDOS_PARTTYPE) + { + if (dev->disk->partition diff --git a/0143-templates-Update-grub-script-template-files.patch b/0143-templates-Update-grub-script-template-files.patch new file mode 100644 index 00000000..5eee1524 --- /dev/null +++ b/0143-templates-Update-grub-script-template-files.patch @@ -0,0 +1,243 @@ +From 51be3372ec8ba07ef68a409956ea0eefa89fe7c5 Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Mon, 16 Apr 2018 22:36:26 -0700 +Subject: [PATCH] templates: Update grub script template files + +Update grub-mkconfig.in and 10_linux.in to support grub-probe's new +partuuid target. Update grub.texi documentation. The following table +shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and +initramfs detection interact: + +Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root +detected Set Set ID Method + +false false false part UUID +false false true part UUID +false true false dev name +false true true dev name +true false false fs UUID +true false true part UUID +true true false fs UUID +true true true dev name + +Note: GRUB_DISABLE_LINUX_PARTUUID and GRUB_DISABLE_LINUX_UUID equate to + 'false' when unset or set to any value other than 'true'. + GRUB_DISABLE_LINUX_PARTUUID defaults to 'true'. + +Signed-off-by: Nicholas Vinson +Reviewed-by: Daniel Kiper +--- + docs/grub.texi | 67 ++++++++++++++++++++++++++++++++++++++++++--- + util/grub-mkconfig.in | 3 ++ + util/grub.d/10_linux.in | 22 +++++++++++++-- + util/grub.d/20_linux_xen.in | 22 +++++++++++++-- + 4 files changed, 104 insertions(+), 10 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 0f2ab91fc69..2adfa97bee8 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1214,10 +1214,11 @@ GRUB is configured using @file{grub.cfg}, usually located under + need to write the whole thing by hand. + + @menu +-* Simple configuration:: Recommended for most users +-* Shell-like scripting:: For power users and developers +-* Multi-boot manual config:: For non-standard multi-OS scenarios +-* Embedded configuration:: Embedding a configuration file into GRUB ++* Simple configuration:: Recommended for most users ++* Root Identifcation Heuristics:: Summary on how the root file system is identified. ++* Shell-like scripting:: For power users and developers ++* Multi-boot manual config:: For non-standard multi-OS scenarios ++* Embedded configuration:: Embedding a configuration file into GRUB + @end menu + + +@@ -1425,6 +1426,17 @@ the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is + usually more reliable, but in some cases it may not be appropriate. To + disable the use of UUIDs, set this option to @samp{true}. + ++@item GRUB_DISABLE_LINUX_PARTUUID ++If @command{grub-mkconfig} cannot identify the root filesystem via its ++universally-unique indentifier (UUID), @command{grub-mkconfig} can use the UUID ++of the partition containing the filesystem to identify the root filesystem to ++the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This is not ++as reliable as using the filesystem UUID, but is more reliable than using the ++Linux device names. When @samp{GRUB_DISABLE_LINUX_PARTUUID} is set to ++@samp{false}, the Linux kernel version must be 2.6.37 (3.10 for systems using ++the MSDOS partition scheme) or newer. This option defaults to @samp{true}. To ++enable the use of partition UUIDs, set this option to @samp{false}. ++ + @item GRUB_DISABLE_RECOVERY + If this option is set to @samp{true}, disable the generation of recovery + mode menu entries. +@@ -1556,6 +1568,53 @@ edit the scripts in @file{/etc/grub.d} directly. + menu entries; simply type the menu entries you want to add at the end of + that file, making sure to leave at least the first two lines intact. + ++@node Root Identifcation Heuristics ++@section Root Identifcation Heuristics ++If the target operating system uses the Linux kernel, @command{grub-mkconfig} ++attempts to identify the root file system via a heuristic algoirthm. This ++algorithm selects the identification method of the root file system by ++considering three factors. The first is if an initrd for the target operating ++system is also present. The second is @samp{GRUB_DISABLE_LINUX_UUID} and if set ++to @samp{true}, prevents @command{grub-mkconfig} from identifying the root file ++system by its UUID. The third is @samp{GRUB_DISABLE_LINUX_PARTUUID} and if set ++to @samp{true}, prevents @command{grub-mkconfig} from identifying the root file ++system via the UUID of its enclosing partition. If the variables are assigned ++any other value, that value is considered equivalent to @samp{false}. The ++variables are also considered to be set to @samp{false} if they are not set. ++ ++When booting, the Linux kernel will delegate the task of mounting the root ++filesystem to the initrd. Most initrd images determine the root file system by ++checking the Linux kernel's command-line for the @samp{root} key and use its ++value as the identification method of the root file system. To improve the ++reliability of booting, most initrd images also allow the root file system to be ++identified by its UUID. Because of this behavior, the @command{grub-mkconfig} ++command will set @samp{root} to @samp{root=UUID=...} to provide the initrd with ++the filesystem UUID of the root file system. ++ ++If no initrd is detected or @samp{GRUB_DISABLE_LINUX_UUID} is set to @samp{true} ++then @command{grub-command} will identify the root filesystem by setting the ++kernel command-line variable @samp{root} to @samp{root=PARTUUID=...} unless ++@samp{GRUB_DISABLE_LINUX_PARTUUID} is also set to @samp{true}. If ++@samp{GRUB_DISABLE_LINUX_PARTUUID} is also set to @samp{true}, ++@command{grub-command} will identify by its Linux device name. ++ ++The following table summarizes the behavior of the @command{grub-mkconfig} ++command. ++ ++@multitable {detected} {GRUB_DISABLE_LINUX_PARTUUID} {GRUB_DISABLE_LINUX_UUID} {Linux Root} ++@headitem Initrd detected @tab GRUB_DISABLE_LINUX_PARTUUID Set To @tab GRUB_DISABLE_LINUX_UUID Set To @tab Linux Root ID Method ++@item false @tab false @tab false @tab part UUID ++@item false @tab false @tab true @tab part UUID ++@item false @tab true @tab false @tab dev name ++@item false @tab true @tab true @tab dev name ++@item true @tab false @tab false @tab fs UUID ++@item true @tab false @tab true @tab part UUID ++@item true @tab true @tab false @tab fs UUID ++@item true @tab true @tab true @tab dev name ++@end multitable ++ ++Remember, @samp{GRUB_DISABLE_LINUX_PARTUUID} and @samp{GRUB_DISABLE_LINUX_UUID} ++are also considered to be set to @samp{false} when they are unset. + + @node Shell-like scripting + @section Writing full configuration files directly +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 35ef583b05f..33332360eec 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -134,6 +134,7 @@ fi + # Device containing our userland. Typically used for root= parameter. + GRUB_DEVICE="`${grub_probe} --target=device /`" + GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true ++GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true + + # Device containing our /boot partition. Usually the same as GRUB_DEVICE. + GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" +@@ -188,6 +189,7 @@ if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub + # override them. + export GRUB_DEVICE \ + GRUB_DEVICE_UUID \ ++ GRUB_DEVICE_PARTUUID \ + GRUB_DEVICE_BOOT \ + GRUB_DEVICE_BOOT_UUID \ + GRUB_FS \ +@@ -223,6 +225,7 @@ export GRUB_DEFAULT \ + GRUB_TERMINAL_OUTPUT \ + GRUB_SERIAL_COMMAND \ + GRUB_DISABLE_LINUX_UUID \ ++ GRUB_DISABLE_LINUX_PARTUUID \ + GRUB_DISABLE_RECOVERY \ + GRUB_VIDEO_BACKEND \ + GRUB_GFXMODE \ +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index faedf74e14e..146499f22fd 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -43,12 +43,22 @@ case ${GRUB_DEVICE} in + ;; + esac + ++# Default to disabling partition uuid support to maintian compatibility with ++# older kernels. ++GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true} ++ + # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter + # and mounting btrfs requires user space scanning, so force UUID in this case. +-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ +- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ ++if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ) \ ++ || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ ++ && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ ++ || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ ++ && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} ++elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \ ++ || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then ++ LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} + else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + fi +@@ -242,7 +252,13 @@ while [ "x$list" != "x" ] ; do + if test -z "${initramfs}" && test -z "${initrd_real}" ; then + # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's + # no initrd or builtin initramfs, it can't work here. +- linux_root_device_thisversion=${GRUB_DEVICE} ++ if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ ++ || [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then ++ ++ linux_root_device_thisversion=${GRUB_DEVICE} ++ else ++ linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID} ++ fi + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index 0cb0f4e49b9..e8143b079dc 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -43,12 +43,22 @@ case ${GRUB_DEVICE} in + ;; + esac + ++# Default to disabling partition uuid support to maintian compatibility with ++# older kernels. ++GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true} ++ + # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter + # and mounting btrfs requires user space scanning, so force UUID in this case. +-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ +- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ ++if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \ ++ || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ ++ && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ ++ || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ ++ && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} ++elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \ ++ || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then ++ LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} + else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + fi +@@ -246,7 +256,13 @@ while [ "x${xen_list}" != "x" ] ; do + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + else + # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. +- linux_root_device_thisversion=${GRUB_DEVICE} ++ if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ ++ || [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then ++ ++ linux_root_device_thisversion=${GRUB_DEVICE} ++ else ++ linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID} ++ fi + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then diff --git a/0144-bufio-Round-up-block-size-to-power-of-2.patch b/0144-bufio-Round-up-block-size-to-power-of-2.patch new file mode 100644 index 00000000..4622214d --- /dev/null +++ b/0144-bufio-Round-up-block-size-to-power-of-2.patch @@ -0,0 +1,32 @@ +From b66e364f131228f4215ff8f0b8173f14931d9b6c Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 24 Apr 2018 14:13:04 +0800 +Subject: [PATCH] bufio: Round up block size to power of 2 + +Rounding up the bufio->block_size to meet power of 2 to facilitate next_buf +calculation in grub_bufio_read(). + +Signed-off-by: Michael Chang +Reviewed-by: Daniel Kiper +--- + grub-core/io/bufio.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c +index 22438277d74..dbed6474431 100644 +--- a/grub-core/io/bufio.c ++++ b/grub-core/io/bufio.c +@@ -61,6 +61,13 @@ grub_bufio_open (grub_file_t io, int size) + size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE : + io->size); + ++ /* ++ * Round up size to power of 2 which the binary math to ++ * calculate next_buf in grub_bufio_read() requires. ++ */ ++ while (size & (size - 1)) ++ size = (size | (size - 1)) + 1; ++ + bufio = grub_zalloc (sizeof (struct grub_bufio) + size); + if (! bufio) + { diff --git a/0145-grub-probe-Don-t-skip-dev-mapper-dm-devices.patch b/0145-grub-probe-Don-t-skip-dev-mapper-dm-devices.patch new file mode 100644 index 00000000..7eb17507 --- /dev/null +++ b/0145-grub-probe-Don-t-skip-dev-mapper-dm-devices.patch @@ -0,0 +1,33 @@ +From 6d28b3bd266e1d935de5916860645ea8cabf2335 Mon Sep 17 00:00:00 2001 +From: Oleg Solovyov +Date: Fri, 11 May 2018 13:55:46 +0300 +Subject: [PATCH] grub-probe: Don't skip /dev/mapper/dm-* devices + +This patch ensures that grub-probe will find the root device placed in +/dev/mapper/dm-[0-9]+-.* e.g. device named /dev/mapper/dm-0-luks will be +found and grub.cfg will be updated properly, enabling the system to boot. + +Signed-off-by: Oleg Solovyov +Reviewed-by: Daniel Kiper +--- + grub-core/osdep/unix/getroot.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c +index 4bf37b027be..3046e22cc01 100644 +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -428,8 +428,11 @@ grub_find_device (const char *dir, dev_t dev) + { + #ifdef __linux__ + /* Skip device names like /dev/dm-0, which are short-hand aliases +- to more descriptive device names, e.g. those under /dev/mapper */ +- if (ent->d_name[0] == 'd' && ++ to more descriptive device names, e.g. those under /dev/mapper. ++ Also, don't skip devices which names start with dm-[0-9] in ++ directories below /dev, e.g. /dev/mapper/dm-0-luks. */ ++ if (strcmp (dir, "/dev") == 0 && ++ ent->d_name[0] == 'd' && + ent->d_name[1] == 'm' && + ent->d_name[2] == '-' && + ent->d_name[3] >= '0' && diff --git a/0250-xfs-accept-filesystem-with-sparse-inodes.patch b/0146-xfs-Accept-filesystem-with-sparse-inodes.patch similarity index 83% rename from 0250-xfs-accept-filesystem-with-sparse-inodes.patch rename to 0146-xfs-Accept-filesystem-with-sparse-inodes.patch index 201b56ac..8777627d 100644 --- a/0250-xfs-accept-filesystem-with-sparse-inodes.patch +++ b/0146-xfs-Accept-filesystem-with-sparse-inodes.patch @@ -1,7 +1,7 @@ -From d0a896275ec2969f507e6b60c75a4b24c7fd5bd5 Mon Sep 17 00:00:00 2001 -From: Eric Sandeen -Date: Tue, 15 May 2018 14:55:55 -0500 -Subject: [PATCH] xfs: accept filesystem with sparse inodes +From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Tue, 29 May 2018 16:16:02 +0200 +Subject: [PATCH] xfs: Accept filesystem with sparse inodes The sparse inode metadata format became a mkfs.xfs default in xfsprogs-4.16.0, and such filesystems are now rejected by grub as @@ -25,12 +25,14 @@ traverse would be in such a fragmented inode allocation. Tests passed, but I'm not sure how to cleanly integrate that into the test harness. Signed-off-by: Eric Sandeen +Reviewed-by: Daniel Kiper +Tested-by: Chris Murphy --- grub-core/fs/xfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 9f66dd6e4c6..d7222b529f5 100644 +index c6031bd3f71..3b00c744e23 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -79,9 +79,18 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -39,13 +41,13 @@ index 9f66dd6e4c6..d7222b529f5 100644 -/* We do not currently verify metadata UUID so it is safe to read such filesystem */ +/* -+ * Directory entries with ftype are explicitly handled by grub code. -+ * -+ * We do not currently verify metadata UUID, so it is safe to read filesystems -+ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature. ++ * Directory entries with ftype are explicitly handled by GRUB code. + * + * We do not currently read the inode btrees, so it is safe to read filesystems + * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature. ++ * ++ * We do not currently verify metadata UUID, so it is safe to read filesystems ++ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature. + */ #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ (XFS_SB_FEAT_INCOMPAT_FTYPE | \ diff --git a/0147-templates-Add-missing.patch b/0147-templates-Add-missing.patch new file mode 100644 index 00000000..9ffd1a8e --- /dev/null +++ b/0147-templates-Add-missing.patch @@ -0,0 +1,27 @@ +From ba474d531a63850bf2e8e8c225ccd6f5e2a594e9 Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Tue, 5 Jun 2018 13:04:04 +0200 +Subject: [PATCH] templates: Add missing "]" + +Commit 51be337 (templates: Update grub script template files) +lacked one "]", so, add it. + +Reported-by: Philip +Signed-off-by: Daniel Kiper +--- + 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 146499f22fd..61ebd7dc714 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -49,7 +49,7 @@ GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true} + + # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter + # and mounting btrfs requires user space scanning, so force UUID in this case. +-if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ) \ ++if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \ + || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ + || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ diff --git a/0148-mbi-Use-per-segment-a-separate-relocator-chunk.patch b/0148-mbi-Use-per-segment-a-separate-relocator-chunk.patch new file mode 100644 index 00000000..7fa99582 --- /dev/null +++ b/0148-mbi-Use-per-segment-a-separate-relocator-chunk.patch @@ -0,0 +1,122 @@ +From 14ec665c3f36d0614cacaa757907551c5c2e6adb Mon Sep 17 00:00:00 2001 +From: Alexander Boettcher +Date: Tue, 12 Jun 2018 20:04:09 +0200 +Subject: [PATCH] mbi: Use per segment a separate relocator chunk + +Instead of setting up a all comprising relocator chunk for all segments, +use per segment a separate relocator chunk. + +Currently, if the ELF is non-relocatable, a single relocator chunk will +comprise memory (between the segments) which gets overridden by the relst() +invocation of the movers code in grub_relocator16/32/64_boot(). + +The overridden memory may contain reserved ranges like VGA memory or ACPI +tables, which may lead to crashes or at least to strange boot behaviour. + +Signed-off-by: Alexander Boettcher +Reviewed-by: Daniel Kiper +--- + grub-core/loader/multiboot_elfxx.c | 63 ++++++++++++++++++++++++-------------- + 1 file changed, 40 insertions(+), 23 deletions(-) + +diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c +index 67daf5944b0..ae36d9d49da 100644 +--- a/grub-core/loader/multiboot_elfxx.c ++++ b/grub-core/loader/multiboot_elfxx.c +@@ -57,9 +57,9 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + char *phdr_base; + grub_err_t err; + grub_relocator_chunk_t ch; +- grub_uint32_t load_offset, load_size; ++ grub_uint32_t load_offset = 0, load_size; + int i; +- void *source; ++ void *source = NULL; + + if (ehdr->e_ident[EI_MAG0] != ELFMAG0 + || ehdr->e_ident[EI_MAG1] != ELFMAG1 +@@ -97,10 +97,15 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border"); + #endif + +- load_size = highest_load - mld->link_base_addr; +- + if (mld->relocatable) + { ++ load_size = highest_load - mld->link_base_addr; ++ ++ grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, " ++ "load_size=0x%x, avoid_efi_boot_services=%d\n", ++ (long) mld->align, mld->preference, load_size, ++ mld->avoid_efi_boot_services); ++ + if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size) + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + +@@ -108,27 +113,22 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + mld->min_addr, mld->max_addr - load_size, + load_size, mld->align ? mld->align : 1, + mld->preference, mld->avoid_efi_boot_services); ++ ++ if (err) ++ { ++ grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); ++ return err; ++ } ++ ++ mld->load_base_addr = get_physical_target_address (ch); ++ source = get_virtual_current_address (ch); + } + else +- err = grub_relocator_alloc_chunk_addr (GRUB_MULTIBOOT (relocator), &ch, +- mld->link_base_addr, load_size); ++ mld->load_base_addr = mld->link_base_addr; + +- if (err) +- { +- grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); +- return err; +- } +- +- mld->load_base_addr = get_physical_target_address (ch); +- source = get_virtual_current_address (ch); +- +- grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " +- "load_size=0x%x, relocatable=%d\n", mld->link_base_addr, +- mld->load_base_addr, load_size, mld->relocatable); +- +- if (mld->relocatable) +- grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", +- (long) mld->align, mld->preference, mld->avoid_efi_boot_services); ++ grub_dprintf ("multiboot_loader", "relocatable=%d, link_base_addr=0x%x, " ++ "load_base_addr=0x%x\n", relocatable, ++ mld->link_base_addr, mld->load_base_addr); + + /* Load every loadable segment in memory. */ + for (i = 0; i < ehdr->e_phnum; i++) +@@ -139,7 +139,24 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", + i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr); + +- load_offset = phdr(i)->p_paddr - mld->link_base_addr; ++ if (mld->relocatable) ++ { ++ load_offset = phdr(i)->p_paddr - mld->link_base_addr; ++ grub_dprintf ("multiboot_loader", "segment %d: load_offset=0x%x\n", i, load_offset); ++ } ++ else ++ { ++ err = grub_relocator_alloc_chunk_addr (GRUB_MULTIBOOT (relocator), &ch, ++ phdr(i)->p_paddr, phdr(i)->p_memsz); ++ ++ if (err) ++ { ++ grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); ++ return err; ++ } ++ ++ source = get_virtual_current_address (ch); ++ } + + if (phdr(i)->p_filesz != 0) + { diff --git a/0149-grub-fs-tester-Fix-losetup-race.patch b/0149-grub-fs-tester-Fix-losetup-race.patch new file mode 100644 index 00000000..28a1c653 --- /dev/null +++ b/0149-grub-fs-tester-Fix-losetup-race.patch @@ -0,0 +1,31 @@ +From 0083541593e05704961db229aefea0542446c07c Mon Sep 17 00:00:00 2001 +From: Will Thompson +Date: Fri, 15 Jun 2018 18:34:04 +0100 +Subject: [PATCH] grub-fs-tester: Fix losetup race + +If something else on the system is using loopback devices, then the +device that's free at the call to `losetup -f` may not be free in the +following call to try to use it. Instead, find and use the first free +loopback device in a single call to losetup. + +Signed-off-by: Will Thompson +Reviewed-by: Daniel Kiper +--- + tests/util/grub-fs-tester.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 26bd57a8027..ef65fbc9341 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -616,9 +616,8 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + mkdir -p "$MNTPOINTRO" + for i in $(range 0 $((NDEVICES-1)) 1); do + dd if=/dev/zero of="$FSIMAGEP${i}.img" count=1 bs=1 seek=$((DISKSIZE-1)) &> /dev/null +- LODEVICE="$(losetup -f)" ++ LODEVICE=$(losetup --find --show "$FSIMAGEP${i}.img") + LODEVICES="$LODEVICES $LODEVICE" +- losetup "$LODEVICE" "$FSIMAGEP${i}.img" + if test "$i" = 0; then + MOUNTDEVICE="$LODEVICE" + fi diff --git a/0150-fdt-Move-prop_entry_size-to-fdt.h.patch b/0150-fdt-Move-prop_entry_size-to-fdt.h.patch new file mode 100644 index 00000000..22f52d5b --- /dev/null +++ b/0150-fdt-Move-prop_entry_size-to-fdt.h.patch @@ -0,0 +1,126 @@ +From e93fd6b776a7e6cef36c445d00436e5a23cfeba5 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Mon, 11 Jun 2018 17:24:58 +0100 +Subject: [PATCH] fdt: Move prop_entry_size to fdt.h + +To be able to resuse the prop_entry_size macro, move it to + and rename it grub_fdt_prop_entry_size. + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/lib/fdt.c | 25 ++++++++++--------------- + include/grub/fdt.h | 5 +++++ + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c +index 2705f2629b9..0d371c5633e 100644 +--- a/grub-core/lib/fdt.c ++++ b/grub-core/lib/fdt.c +@@ -41,11 +41,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); + (2 * sizeof(grub_uint32_t) \ + + ALIGN_UP (grub_strlen (name) + 1, sizeof(grub_uint32_t))) + +-/* Size needed by a property entry: 1 token (FDT_PROPERTY), plus len and nameoff +- fields, plus the property value, plus padding if needed. */ +-#define prop_entry_size(prop_len) \ +- (3 * sizeof(grub_uint32_t) + ALIGN_UP(prop_len, sizeof(grub_uint32_t))) +- + #define SKIP_NODE_NAME(name, token, end) \ + name = (char *) ((token) + 1); \ + while (name < (char *) end) \ +@@ -86,7 +81,7 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name) + case FDT_PROP: + /* Skip property token and following data (len, nameoff and property + value). */ +- token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) ++ token += grub_fdt_prop_entry_size(grub_be_to_cpu32(*(token + 1))) + / sizeof(*token); + break; + case FDT_NOP: +@@ -150,7 +145,7 @@ static int add_subnode (void *fdt, int parentoffset, const char *name) + { + case FDT_PROP: + /* Skip len, nameoff and property value. */ +- token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) ++ token += grub_fdt_prop_entry_size(grub_be_to_cpu32(*(token + 1))) + / sizeof(*token); + break; + case FDT_BEGIN_NODE: +@@ -249,12 +244,12 @@ static grub_uint32_t *find_prop (const void *fdt, unsigned int nodeoffset, + && !grub_strcmp (name, (char *) fdt + + grub_fdt_get_off_dt_strings (fdt) + nameoff)) + { +- if (prop + prop_entry_size(grub_be_to_cpu32(*(prop + 1))) ++ if (prop + grub_fdt_prop_entry_size(grub_be_to_cpu32(*(prop + 1))) + / sizeof (*prop) >= end) + return NULL; + return prop; + } +- prop += prop_entry_size(grub_be_to_cpu32(*(prop + 1))) / sizeof (*prop); ++ prop += grub_fdt_prop_entry_size(grub_be_to_cpu32(*(prop + 1))) / sizeof (*prop); + } + else if (grub_be_to_cpu32(*prop) == FDT_NOP) + prop++; +@@ -319,7 +314,7 @@ advance_token (const void *fdt, const grub_uint32_t *token, const grub_uint32_t + value). */ + if (token >= end - 1) + return 0; +- token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) ++ token += grub_fdt_prop_entry_size(grub_be_to_cpu32(*(token + 1))) + / sizeof(*token); + break; + case FDT_NOP: +@@ -467,12 +462,12 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + unsigned int needed_space = 0; + + if (!prop) +- needed_space = prop_entry_size(len); ++ needed_space = grub_fdt_prop_entry_size(len); + if (!prop_name_present) + needed_space += grub_strlen (name) + 1; + if (needed_space > get_free_space (fdt)) + return -1; +- if (rearrange_blocks (fdt, !prop ? prop_entry_size(len) : 0) < 0) ++ if (rearrange_blocks (fdt, !prop ? grub_fdt_prop_entry_size(len) : 0) < 0) + return -1; + } + if (!prop_name_present) { +@@ -489,10 +484,10 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + + sizeof(grub_uint32_t)); + + prop = (void *) (node_name + ALIGN_UP(grub_strlen(node_name) + 1, 4)); +- grub_memmove (prop + prop_entry_size(len) / sizeof(*prop), prop, ++ grub_memmove (prop + grub_fdt_prop_entry_size(len) / sizeof(*prop), prop, + struct_end(fdt) - (grub_addr_t) prop); + grub_fdt_set_size_dt_struct (fdt, grub_fdt_get_size_dt_struct (fdt) +- + prop_entry_size(len)); ++ + grub_fdt_prop_entry_size(len)); + *prop = grub_cpu_to_be32_compile_time (FDT_PROP); + *(prop + 2) = grub_cpu_to_be32 (nameoff); + } +@@ -500,7 +495,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + + /* Insert padding bytes at the end of the value; if they are not needed, they + will be overwritten by the following memcpy. */ +- *(prop + prop_entry_size(len) / sizeof(grub_uint32_t) - 1) = 0; ++ *(prop + grub_fdt_prop_entry_size(len) / sizeof(grub_uint32_t) - 1) = 0; + + grub_memcpy (prop + 3, val, len); + return 0; +diff --git a/include/grub/fdt.h b/include/grub/fdt.h +index 75525fa317c..158b1bc4b3a 100644 +--- a/include/grub/fdt.h ++++ b/include/grub/fdt.h +@@ -50,6 +50,11 @@ struct grub_fdt_empty_tree { + + #define GRUB_FDT_EMPTY_TREE_SZ sizeof (struct grub_fdt_empty_tree) + ++/* Size needed by a property entry: 1 token (FDT_PROPERTY), plus len and nameoff ++ fields, plus the property value, plus padding if needed. */ ++#define grub_fdt_prop_entry_size(prop_len) \ ++ (3 * sizeof(grub_uint32_t) + ALIGN_UP(prop_len, sizeof(grub_uint32_t))) ++ + #define grub_fdt_get_header(fdt, field) \ + grub_be_to_cpu32(((const grub_fdt_header_t *)(fdt))->field) + #define grub_fdt_set_header(fdt, field, value) \ diff --git a/0151-efi-fdt-Set-address-size-cells-to-2-for-empty-tree.patch b/0151-efi-fdt-Set-address-size-cells-to-2-for-empty-tree.patch new file mode 100644 index 00000000..8edfc481 --- /dev/null +++ b/0151-efi-fdt-Set-address-size-cells-to-2-for-empty-tree.patch @@ -0,0 +1,65 @@ +From 347210a5d5ce655b95315f320faa515afb723c11 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Mon, 11 Jun 2018 17:24:59 +0100 +Subject: [PATCH] efi/fdt: Set address/size cells to 2 for empty tree + +When booting an arm* system on UEFI with an empty device tree (currently +only when hardware description comes from ACPI), we don't currently set +default to 1 cell (32 bits). + +Set both of these properties, to 2 cells (64 bits), to resolve issues +with kexec on some platforms. + +This change corresponds with linux kernel commit ae8a442dfdc4 +("efi/libstub/arm*: Set default address and size cells values for an empty dtb") +and ensures booting through grub does not behave differently from booting +the stub loader directly. + +See also https://patchwork.kernel.org/patch/9561201/ + +Signed-off-by: Leif Lindholm +Reviewed-by: Daniel Kiper +--- + grub-core/loader/efi/fdt.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c +index c0c6800f79e..a4c6e803645 100644 +--- a/grub-core/loader/efi/fdt.c ++++ b/grub-core/loader/efi/fdt.c +@@ -29,6 +29,12 @@ + static void *loaded_fdt; + static void *fdt; + ++#define FDT_ADDR_CELLS_STRING "#address-cells" ++#define FDT_SIZE_CELLS_STRING "#size-cells" ++#define FDT_ADDR_SIZE_EXTRA ((2 * grub_fdt_prop_entry_size (sizeof(grub_uint32_t))) + \ ++ sizeof (FDT_ADDR_CELLS_STRING) + \ ++ sizeof (FDT_SIZE_CELLS_STRING)) ++ + void * + grub_fdt_load (grub_size_t additional_size) + { +@@ -46,8 +52,11 @@ grub_fdt_load (grub_size_t additional_size) + else + raw_fdt = grub_efi_get_firmware_fdt(); + +- size = +- raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; ++ if (raw_fdt) ++ size = grub_fdt_get_totalsize (raw_fdt); ++ else ++ size = GRUB_FDT_EMPTY_TREE_SZ + FDT_ADDR_SIZE_EXTRA; ++ + size += additional_size; + + grub_dprintf ("linux", "allocating %d bytes for fdt\n", size); +@@ -63,6 +72,8 @@ grub_fdt_load (grub_size_t additional_size) + else + { + grub_fdt_create_empty_tree (fdt, size); ++ grub_fdt_set_prop32 (fdt, 0, FDT_ADDR_CELLS_STRING, 2); ++ grub_fdt_set_prop32 (fdt, 0, FDT_SIZE_CELLS_STRING, 2); + } + return fdt; + } diff --git a/0152-multiboot_elfxx.c-Fix-compilation-by-fixing-undeclar.patch b/0152-multiboot_elfxx.c-Fix-compilation-by-fixing-undeclar.patch new file mode 100644 index 00000000..6cc32a10 --- /dev/null +++ b/0152-multiboot_elfxx.c-Fix-compilation-by-fixing-undeclar.patch @@ -0,0 +1,38 @@ +From ec2de93f8d96b914af5834137bffdc9759c362b8 Mon Sep 17 00:00:00 2001 +From: Denis 'GNUtoo' Carikli +Date: Fri, 29 Jun 2018 14:15:11 +0200 +Subject: [PATCH] multiboot_elfxx.c: Fix compilation by fixing undeclared + variable + +Without that fix we have: + In file included from ../../include/grub/command.h:25:0, + from ../../grub-core/loader/multiboot.c:30: + ../../grub-core/loader/multiboot_elfxx.c: In function 'grub_multiboot_load_elf64': + ../../grub-core/loader/multiboot_elfxx.c:130:28: error: 'relocatable' undeclared (first use in this function) + "load_base_addr=0x%x\n", relocatable, + +This happens due to mistake in the commit 14ec665 +(mbi: Use per segment a separate relocator chunk). + +So, let's fix it. + +Signed-off-by: Ignat Korchagin +Signed-off-by: Denis 'GNUtoo' Carikli +Signed-off-by: Daniel Kiper +--- + grub-core/loader/multiboot_elfxx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c +index ae36d9d49da..70cd1db513e 100644 +--- a/grub-core/loader/multiboot_elfxx.c ++++ b/grub-core/loader/multiboot_elfxx.c +@@ -127,7 +127,7 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) + mld->load_base_addr = mld->link_base_addr; + + grub_dprintf ("multiboot_loader", "relocatable=%d, link_base_addr=0x%x, " +- "load_base_addr=0x%x\n", relocatable, ++ "load_base_addr=0x%x\n", mld->relocatable, + mld->link_base_addr, mld->load_base_addr); + + /* Load every loadable segment in memory. */ diff --git a/0064-re-write-.gitignore.patch b/0153-re-write-.gitignore.patch similarity index 99% rename from 0064-re-write-.gitignore.patch rename to 0153-re-write-.gitignore.patch index 6ec159ca..d78e2f82 100644 --- a/0064-re-write-.gitignore.patch +++ b/0153-re-write-.gitignore.patch @@ -1,4 +1,4 @@ -From 38bfcd3054c28aa40234840c12d900f1d18a217d Mon Sep 17 00:00:00 2001 +From 9bb01748b4e2eb13dee87c4595f378afbfaadb3f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 8 Aug 2017 12:48:04 -0400 Subject: [PATCH] re-write .gitignore diff --git a/0065-IBM-client-architecture-CAS-reboot-support.patch b/0154-IBM-client-architecture-CAS-reboot-support.patch similarity index 91% rename from 0065-IBM-client-architecture-CAS-reboot-support.patch rename to 0154-IBM-client-architecture-CAS-reboot-support.patch index 0979a52c..167cb0bc 100644 --- a/0065-IBM-client-architecture-CAS-reboot-support.patch +++ b/0154-IBM-client-architecture-CAS-reboot-support.patch @@ -1,4 +1,4 @@ -From bf1fd830091fff49e26f39027e0db8fd4b688624 Mon Sep 17 00:00:00 2001 +From 2b4fd2084bd3a3b75ee06cd4e670c0675078f6ab Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Thu, 20 Sep 2012 18:07:39 -0300 Subject: [PATCH] IBM client architecture (CAS) reboot support @@ -18,20 +18,21 @@ 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 --- - grub-core/kern/ieee1275/openfw.c | 62 ++++++++++++++++++++++++++++++++++++++++ + grub-core/kern/ieee1275/openfw.c | 63 ++++++++++++++++++++++++++++++++++++++++ grub-core/normal/main.c | 19 ++++++++++++ grub-core/script/execute.c | 7 +++++ include/grub/ieee1275/ieee1275.h | 2 ++ - 4 files changed, 90 insertions(+) + 4 files changed, 91 insertions(+) diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index ddb778340e4..6db8b986551 100644 +index 62929d983bf..2d53c0e8608 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c -@@ -561,3 +561,65 @@ grub_ieee1275_canonicalise_devname (const char *path) - return NULL; - } +@@ -588,3 +588,66 @@ grub_ieee1275_get_boot_dev (void) + return bootpath; + } ++ +/* Check if it's a CAS reboot. If so, set the script to be executed. */ +int +grub_ieee1275_cas_reboot (char *script) @@ -157,15 +158,15 @@ index a8502d90711..ab78ca87f90 100644 { char *line; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 8e425130327..9f26c69a2df 100644 +index 8868f3a756f..2310f33dbc2 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h -@@ -234,6 +234,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali +@@ -252,6 +252,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali void EXPORT_FUNC(grub_ieee1275_children_peer) (struct grub_ieee1275_devalias *alias); void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath, struct grub_ieee1275_devalias *alias); +int EXPORT_FUNC(grub_ieee1275_cas_reboot) (char *script); +int EXPORT_FUNC(grub_ieee1275_set_boot_last_label) (const char *text); - #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) + char *EXPORT_FUNC(grub_ieee1275_get_boot_dev) (void); diff --git a/0066-for-ppc-reset-console-display-attr-when-clear-screen.patch b/0155-for-ppc-reset-console-display-attr-when-clear-screen.patch similarity index 95% rename from 0066-for-ppc-reset-console-display-attr-when-clear-screen.patch rename to 0155-for-ppc-reset-console-display-attr-when-clear-screen.patch index 07ab3e3f..9d23b2c3 100644 --- a/0066-for-ppc-reset-console-display-attr-when-clear-screen.patch +++ b/0155-for-ppc-reset-console-display-attr-when-clear-screen.patch @@ -1,4 +1,4 @@ -From 8b30fab3c07a9fc8549e404c411b747b960c57b2 Mon Sep 17 00:00:00 2001 +From e2458170bea7bf0a98364111b023eab6cdc39aae Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 24 Apr 2013 10:51:48 -0300 Subject: [PATCH] for ppc, reset console display attr when clear screen diff --git a/0067-Disable-GRUB-video-support-for-IBM-power-machines.patch b/0156-Disable-GRUB-video-support-for-IBM-power-machines.patch similarity index 95% rename from 0067-Disable-GRUB-video-support-for-IBM-power-machines.patch rename to 0156-Disable-GRUB-video-support-for-IBM-power-machines.patch index fc928e09..a21b2904 100644 --- a/0067-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/0156-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -1,4 +1,4 @@ -From 45322cbc9402639a431fc0f33bd76e387e6f02bf Mon Sep 17 00:00:00 2001 +From afae8b229bd1b7e2dd8b92bdcee4dc89224bf32d Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 11 Jun 2013 15:14:05 -0300 Subject: [PATCH] Disable GRUB video support for IBM power machines @@ -48,7 +48,7 @@ index 17a3dbbb575..b8e4b3feb32 100644 GRUB_MOD_FINI(ieee1275_fb) diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 9f26c69a2df..ab4f284c341 100644 +index 2310f33dbc2..ca08bd96681 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -146,6 +146,8 @@ enum grub_ieee1275_flag diff --git a/0068-Honor-a-symlink-when-generating-configuration-by-gru.patch b/0157-Honor-a-symlink-when-generating-configuration-by-gru.patch similarity index 81% rename from 0068-Honor-a-symlink-when-generating-configuration-by-gru.patch rename to 0157-Honor-a-symlink-when-generating-configuration-by-gru.patch index a0f3402f..65f94a8f 100644 --- a/0068-Honor-a-symlink-when-generating-configuration-by-gru.patch +++ b/0157-Honor-a-symlink-when-generating-configuration-by-gru.patch @@ -1,4 +1,4 @@ -From c29e260c9f41f4f802fa852b6c46fb2e5d912cb6 Mon Sep 17 00:00:00 2001 +From 95da0629418b268bce357954f63e3d11564ec8d9 Mon Sep 17 00:00:00 2001 From: Marcel Kolaja Date: Tue, 21 Jan 2014 10:57:08 -0500 Subject: [PATCH] Honor a symlink when generating configuration by @@ -11,10 +11,10 @@ the -o option follows it rather than overwriting it with a regular file. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index f8496d28bdf..3b070fd7632 100644 +index 33332360eec..bc5a3f17541 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -276,7 +276,8 @@ and /etc/grub.d/* files or please file a bug report with +@@ -287,7 +287,8 @@ and /etc/grub.d/* files or please file a bug report with exit 1 else # none of the children aborted with error, install the new grub.cfg diff --git a/0069-Move-bash-completion-script-922997.patch b/0158-Move-bash-completion-script-922997.patch similarity index 88% rename from 0069-Move-bash-completion-script-922997.patch rename to 0158-Move-bash-completion-script-922997.patch index cb2f9e1a..07800b2e 100644 --- a/0069-Move-bash-completion-script-922997.patch +++ b/0158-Move-bash-completion-script-922997.patch @@ -1,4 +1,4 @@ -From 8eaf2f497a6bcffc5554509533940ac2b764b981 Mon Sep 17 00:00:00 2001 +From a5376ff36a34dae179f3d47e1af8937b2738e29e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Apr 2013 14:35:34 -0400 Subject: [PATCH] Move bash completion script (#922997) @@ -10,10 +10,10 @@ Apparently these go in a new place now. 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 571f7a0b5aa..9ae97f026ab 100644 +index c7888e40f66..783118ccdcd 100644 --- a/configure.ac +++ b/configure.ac -@@ -288,6 +288,14 @@ AC_SUBST(grubdirname) +@@ -289,6 +289,14 @@ AC_SUBST(grubdirname) AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname", [Default grub directory name]) @@ -28,7 +28,7 @@ index 571f7a0b5aa..9ae97f026ab 100644 # # Checks for build programs. # -@@ -497,6 +505,9 @@ HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags" +@@ -498,6 +506,9 @@ HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags" # Check for target programs. # diff --git a/0070-Update-to-minilzo-2.08.patch b/0159-Update-to-minilzo-2.08.patch similarity index 99% rename from 0070-Update-to-minilzo-2.08.patch rename to 0159-Update-to-minilzo-2.08.patch index 6e000cf3..11553195 100644 --- a/0070-Update-to-minilzo-2.08.patch +++ b/0159-Update-to-minilzo-2.08.patch @@ -1,4 +1,4 @@ -From 9a1e99c5628bafa9e3970a5317b721da704bec6a Mon Sep 17 00:00:00 2001 +From 7c86181c3906def2e7f2eff9dd9b6e08cfbe72b3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Dec 2014 15:36:09 -0500 Subject: [PATCH] Update to minilzo-2.08 diff --git a/0071-Allow-fallback-to-include-entries-by-title-not-just-.patch b/0160-Allow-fallback-to-include-entries-by-title-not-just-.patch similarity index 97% rename from 0071-Allow-fallback-to-include-entries-by-title-not-just-.patch rename to 0160-Allow-fallback-to-include-entries-by-title-not-just-.patch index 2a7585fc..71dea6c7 100644 --- a/0071-Allow-fallback-to-include-entries-by-title-not-just-.patch +++ b/0160-Allow-fallback-to-include-entries-by-title-not-just-.patch @@ -1,8 +1,8 @@ -From 27845fb323de35e9dcaad8c738eb1a2a2bc316f8 Mon Sep 17 00:00:00 2001 +From 8b0e6304860a8d0684e8887028f62add7e7620d3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 5 Sep 2014 10:07:04 -0400 -Subject: [PATCH] Allow "fallback" to include entries by title, not - just number. +Subject: [PATCH] Allow "fallback" to include entries by title, not just + number. Resolves: rhbz#1026084 diff --git a/0072-Add-GRUB_DISABLE_UUID.patch b/0161-Add-GRUB_DISABLE_UUID.patch similarity index 73% rename from 0072-Add-GRUB_DISABLE_UUID.patch rename to 0161-Add-GRUB_DISABLE_UUID.patch index 884ae637..784773c0 100644 --- a/0072-Add-GRUB_DISABLE_UUID.patch +++ b/0161-Add-GRUB_DISABLE_UUID.patch @@ -1,4 +1,4 @@ -From 7f7429e93fa791ac2c002beaafab9b9d9bd86b89 Mon Sep 17 00:00:00 2001 +From e944dc0c0a5b414873c3149e008130f14bdb9af4 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 16:49:25 -0400 Subject: [PATCH] Add GRUB_DISABLE_UUID. @@ -10,15 +10,15 @@ as it understands it. Signed-off-by: Peter Jones --- docs/grub.texi | 7 +++++++ - util/grub-mkconfig.in | 12 ++++++++++-- + util/grub-mkconfig.in | 22 +++++++++++++++++++--- util/grub-mkconfig_lib.in | 4 ++-- - 3 files changed, 19 insertions(+), 4 deletions(-) + 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index a0c4b9e4e8e..6fdd2a041f7 100644 +index 2adfa97bee8..2fd32608c01 100644 --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. +@@ -1441,6 +1441,13 @@ enable the use of partition UUIDs, set this option to @samp{false}. If this option is set to @samp{true}, disable the generation of recovery mode menu entries. @@ -33,15 +33,17 @@ index a0c4b9e4e8e..6fdd2a041f7 100644 If graphical video support is required, either because the @samp{gfxterm} graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 3b070fd7632..c088b705442 100644 +index bc5a3f17541..b0a8626dd1c 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -133,11 +133,11 @@ fi +@@ -133,12 +133,12 @@ fi # Device containing our userland. Typically used for root= parameter. GRUB_DEVICE="`${grub_probe} --target=device /`" -GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true +-GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true +GRUB_DEVICE_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true ++GRUB_DEVICE_PARTUUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true # Device containing our /boot partition. Usually the same as GRUB_DEVICE. GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" @@ -50,30 +52,38 @@ index 3b070fd7632..c088b705442 100644 # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. -@@ -151,6 +151,13 @@ if test -f ${sysconfdir}/default/grub ; then +@@ -158,6 +158,21 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi -+if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then -+ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" -+fi -+if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_BOOT_UUID" ]; then -+ GRUB_DEVICE_BOOT_UUID="$GRUB_DEVICE_BOOT_UUID_GENERATED" ++if [ "x$GRUB_DISABLE_UUID" != "xtrue" ]; then ++ if [ -z "$GRUB_DEVICE_UUID" ]; then ++ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" ++ fi ++ if [ -z "$GRUB_DEVICE_BOOT_UUID" ]; then ++ GRUB_DEVICE_BOOT_UUID="$GRUB_DEVICE_BOOT_UUID_GENERATED" ++ fi ++ if [ -z "$GRUB_DEVICE_UUID" ]; then ++ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" ++ fi ++ if [ -z "$GRUB_DEVICE_PART_UUID" ]; then ++ GRUB_DEVICE_PART_UUID="$GRUB_DEVICE_PART_UUID_GENERATED" ++ fi +fi + # XXX: should this be deprecated at some point? if [ "x${GRUB_TERMINAL}" != "x" ] ; then GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" -@@ -216,6 +223,7 @@ export GRUB_DEFAULT \ - GRUB_SERIAL_COMMAND \ +@@ -227,6 +242,7 @@ export GRUB_DEFAULT \ GRUB_DISABLE_LINUX_UUID \ + GRUB_DISABLE_LINUX_PARTUUID \ GRUB_DISABLE_RECOVERY \ + GRUB_DISABLE_UUID \ GRUB_VIDEO_BACKEND \ GRUB_GFXMODE \ GRUB_BACKGROUND \ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 60b31caddeb..cf35e417470 100644 +index 0f801cab3e4..1001a12232b 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -156,7 +156,7 @@ prepare_grub_to_access_device () diff --git a/0073-Make-exit-take-a-return-code.patch b/0162-Make-exit-take-a-return-code.patch similarity index 96% rename from 0073-Make-exit-take-a-return-code.patch rename to 0162-Make-exit-take-a-return-code.patch index 1fa61668..0aff3db6 100644 --- a/0073-Make-exit-take-a-return-code.patch +++ b/0162-Make-exit-take-a-return-code.patch @@ -1,4 +1,4 @@ -From 384ccb1b44fc23514a59529f58f984dcc4a75cc9 Mon Sep 17 00:00:00 2001 +From 567b25844138fe8179ed99a42adf46d4e3130c22 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 26 Feb 2014 21:49:12 -0500 Subject: [PATCH] Make "exit" take a return code. @@ -60,10 +60,10 @@ index a3a11824172..b25ca4b9f17 100644 } diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index d467785fc6c..684ca93f8f4 100644 +index 708581fcbde..e339f264b3a 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -155,11 +155,16 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) +@@ -164,11 +164,16 @@ grub_reboot (void) } void @@ -139,7 +139,7 @@ index 271b6fbfabd..9fafe98f015 100644 /* We can't use grub_fatal() in this function. This would create an infinite loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 12590225eca..e69c0133e69 100644 +index 0d8ebf58b95..f5423ce27d9 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -68,7 +68,7 @@ grub_addr_t grub_ieee1275_original_stack; @@ -242,7 +242,7 @@ index 0559c033c3d..fce526d417b 100644 struct sched_shutdown arg; diff --git a/include/grub/misc.h b/include/grub/misc.h -index 2a9f87cc255..06208143779 100644 +index 372f009e84f..83fd69f4ada 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -334,7 +334,7 @@ int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt, diff --git a/0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch b/0163-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch similarity index 83% rename from 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch rename to 0163-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch index 9e3fae16..8abe4040 100644 --- a/0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch +++ b/0163-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch @@ -1,8 +1,8 @@ -From 939f3dfcfacde13bd7ebfe411c0dceee9e5ed0ae Mon Sep 17 00:00:00 2001 +From 7097ef3bc5499126f38f6bab06c3ff1cf376ecec Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 22 Jul 2015 11:21:01 -0400 -Subject: [PATCH] Mark po/exclude.pot as binary so git won't try to - diff nonprintables. +Subject: [PATCH] Mark po/exclude.pot as binary so git won't try to diff + nonprintables. Signed-off-by: Peter Jones --- diff --git a/0075-Make-efi-machines-load-an-env-block-from-a-variable.patch b/0164-Make-efi-machines-load-an-env-block-from-a-variable.patch similarity index 93% rename from 0075-Make-efi-machines-load-an-env-block-from-a-variable.patch rename to 0164-Make-efi-machines-load-an-env-block-from-a-variable.patch index 20969b85..c4243b25 100644 --- a/0075-Make-efi-machines-load-an-env-block-from-a-variable.patch +++ b/0164-Make-efi-machines-load-an-env-block-from-a-variable.patch @@ -1,4 +1,4 @@ -From 805220eb48a8cabcc83628d90aa40f3204b21a71 Mon Sep 17 00:00:00 2001 +From 6494d2b08ea9a24118631438a69e238367565008 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 7 Dec 2015 14:20:49 -0500 Subject: [PATCH] Make efi machines load an env block from a variable @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index a65c27f7ff2..1eb86bed33b 100644 +index fc4767f1985..a6e257f946a 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -191,6 +191,7 @@ kernel = { @@ -22,7 +22,7 @@ index a65c27f7ff2..1eb86bed33b 100644 i386_multiboot = kern/i386/pc/acpi.c; i386_coreboot = kern/acpi.c; diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index 2c31847bf6d..f7782b6e114 100644 +index 3dfdf2d22b0..71d2279a0c1 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -25,9 +25,40 @@ diff --git a/0076-DHCP-client-ID-and-UUID-options-added.patch b/0165-DHCP-client-ID-and-UUID-options-added.patch similarity index 98% rename from 0076-DHCP-client-ID-and-UUID-options-added.patch rename to 0165-DHCP-client-ID-and-UUID-options-added.patch index 95c29669..4959228a 100644 --- a/0076-DHCP-client-ID-and-UUID-options-added.patch +++ b/0165-DHCP-client-ID-and-UUID-options-added.patch @@ -1,4 +1,4 @@ -From cefc164d655fb7709efbc37a317952ff3ec4aeb3 Mon Sep 17 00:00:00 2001 +From 8fd0604ff665948ea0ac9bc316d19f40e7aae166 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:18:53 -0200 Subject: [PATCH] DHCP client ID and UUID options added. diff --git a/0077-trim-arp-packets-with-abnormal-size.patch b/0166-trim-arp-packets-with-abnormal-size.patch similarity index 94% rename from 0077-trim-arp-packets-with-abnormal-size.patch rename to 0166-trim-arp-packets-with-abnormal-size.patch index 07ad01d9..90f547fa 100644 --- a/0077-trim-arp-packets-with-abnormal-size.patch +++ b/0166-trim-arp-packets-with-abnormal-size.patch @@ -1,4 +1,4 @@ -From 571a6cce3b0d4c8abf11efc320e2de6ff9188d60 Mon Sep 17 00:00:00 2001 +From 36e4cdbca69dba054c98eaaa56c6b0fb5003a9b1 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 5 Feb 2014 09:42:42 -0200 Subject: [PATCH] trim arp packets with abnormal size diff --git a/0078-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch b/0167-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch similarity index 84% rename from 0078-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch rename to 0167-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch index 14eeebf7..e5fee19b 100644 --- a/0078-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +++ b/0167-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch @@ -1,4 +1,4 @@ -From 6cd959a64f588e256f0ba17e31bf2720b9cdec88 Mon Sep 17 00:00:00 2001 +From 1164ef4fbd4c09056e3e5da42a251cb5b5ce7b64 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 12 Mar 2014 10:58:16 -0400 Subject: [PATCH] Fix bad test on GRUB_DISABLE_SUBMENU. @@ -20,11 +20,11 @@ Resolves: rhbz#1063414 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index de9044c7f28..cf6331f2a51 100644 +index 61ebd7dc714..87a7da34982 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -224,7 +224,11 @@ while [ "x$list" != "x" ] ; do - linux_root_device_thisversion=${GRUB_DEVICE} +@@ -261,7 +261,11 @@ while [ "x$list" != "x" ] ; do + fi fi - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then diff --git a/0079-Add-support-for-UEFI-operating-systems-returned-by-o.patch b/0168-Add-support-for-UEFI-operating-systems-returned-by-o.patch similarity index 94% rename from 0079-Add-support-for-UEFI-operating-systems-returned-by-o.patch rename to 0168-Add-support-for-UEFI-operating-systems-returned-by-o.patch index 78c955ec..99146af8 100644 --- a/0079-Add-support-for-UEFI-operating-systems-returned-by-o.patch +++ b/0168-Add-support-for-UEFI-operating-systems-returned-by-o.patch @@ -1,8 +1,7 @@ -From 0254265409f80b369c35fb474c7371feb6f9ae1d Mon Sep 17 00:00:00 2001 +From 8da102c764dfa6c7e83dba33d0cf3be4e8c4d658 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 12 Jun 2013 11:51:49 -0400 -Subject: [PATCH] Add support for UEFI operating systems returned by - os-prober +Subject: [PATCH] Add support for UEFI operating systems returned by os-prober os-prober returns UEFI operating systems in the form: diff --git a/0080-Migrate-PPC-from-Yaboot-to-Grub2.patch b/0169-Migrate-PPC-from-Yaboot-to-Grub2.patch similarity index 96% rename from 0080-Migrate-PPC-from-Yaboot-to-Grub2.patch rename to 0169-Migrate-PPC-from-Yaboot-to-Grub2.patch index d811c2c4..88ee0eff 100644 --- a/0080-Migrate-PPC-from-Yaboot-to-Grub2.patch +++ b/0169-Migrate-PPC-from-Yaboot-to-Grub2.patch @@ -1,4 +1,4 @@ -From f2b4c105e3657cc32ed0f7aefa713f161cdf64f1 Mon Sep 17 00:00:00 2001 +From 21e499e4636764dcd4ac605e89620bb543819350 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 28 Mar 2012 14:46:41 -0500 Subject: [PATCH] Migrate PPC from Yaboot to Grub2 @@ -12,10 +12,10 @@ 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 f9caccb9780..6d452da029f 100644 +index 3180ac880a9..c7b775bce73 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -486,6 +486,13 @@ script = { +@@ -487,6 +487,13 @@ script = { condition = COND_HOST_LINUX; }; diff --git a/0081-Add-fw_path-variable-revised.patch b/0170-Add-fw_path-variable-revised.patch similarity index 97% rename from 0081-Add-fw_path-variable-revised.patch rename to 0170-Add-fw_path-variable-revised.patch index c130f500..7244306f 100644 --- a/0081-Add-fw_path-variable-revised.patch +++ b/0170-Add-fw_path-variable-revised.patch @@ -1,4 +1,4 @@ -From 7f021a05a5ed7c97432abbc1762f40e36a4915e3 Mon Sep 17 00:00:00 2001 +From e279dadcc73d8e23ccb43517bbf2cf16145e8444 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 19 Sep 2012 21:22:55 -0300 Subject: [PATCH] Add fw_path variable (revised) diff --git a/0082-Add-support-for-linuxefi.patch b/0171-Add-support-for-linuxefi.patch similarity index 96% rename from 0082-Add-support-for-linuxefi.patch rename to 0171-Add-support-for-linuxefi.patch index 6a55b6ef..7f0e934f 100644 --- a/0082-Add-support-for-linuxefi.patch +++ b/0171-Add-support-for-linuxefi.patch @@ -1,4 +1,4 @@ -From 778385965798ac2711f0d07d5cf521a6e999ca8b Mon Sep 17 00:00:00 2001 +From 69ee71058e03bbdd7ad74591ab1b9bc4830c0c24 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 10 Jul 2012 11:58:52 -0400 Subject: [PATCH] Add support for linuxefi @@ -13,10 +13,10 @@ Subject: [PATCH] Add support for linuxefi create mode 100644 grub-core/loader/i386/efi/linux.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 1eb86bed33b..c653c71c594 100644 +index a6e257f946a..aacad137b36 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1764,6 +1764,14 @@ module = { +@@ -1759,6 +1759,14 @@ module = { enable = x86_64_efi; }; @@ -32,12 +32,12 @@ index 1eb86bed33b..c653c71c594 100644 name = chain; efi = loader/efi/chainloader.c; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index ac2a4c556b8..f5440cb1df9 100644 +index c48e9b5c7c3..775daed16e6 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c -@@ -49,6 +49,38 @@ static grub_efi_uintn_t finish_desc_size; - static grub_efi_uint32_t finish_desc_version; - int grub_efi_is_finished = 0; +@@ -113,6 +113,38 @@ grub_efi_drop_alloc (grub_efi_physical_address_t address, + } + } +/* Allocate pages below a specified address */ +void * @@ -452,7 +452,7 @@ index 00000000000..b79e6320ba9 + grub_unregister_command (cmd_initrd); +} diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 3fa082816ca..91e29ce66f1 100644 +index c996913e5bc..3efbafbb418 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -47,6 +47,9 @@ EXPORT_FUNC(grub_efi_allocate_fixed) (grub_efi_physical_address_t address, @@ -466,10 +466,10 @@ index 3fa082816ca..91e29ce66f1 100644 grub_efi_uintn_t pages); int diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index da0ca3b83cd..fc36bdaf367 100644 +index 0bd75881708..5d8282a7db6 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h -@@ -139,6 +139,7 @@ struct linux_kernel_header +@@ -139,6 +139,7 @@ struct linux_i386_kernel_header grub_uint64_t setup_data; grub_uint64_t pref_address; grub_uint32_t init_size; diff --git a/0172-Use-linuxefi-and-initrdefi-where-appropriate.patch b/0172-Use-linuxefi-and-initrdefi-where-appropriate.patch new file mode 100644 index 00000000..83b57fad --- /dev/null +++ b/0172-Use-linuxefi-and-initrdefi-where-appropriate.patch @@ -0,0 +1,40 @@ +From c2b051c8a5daac6cf874e6cc7eb79878e2203153 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 16 Jul 2012 18:57:11 -0400 +Subject: [PATCH] Use "linuxefi" and "initrdefi" where appropriate. + +--- + util/grub.d/10_linux.in | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 87a7da34982..37d539fcf93 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -139,9 +139,16 @@ linux_entry () + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + message="$(gettext_printf "Loading Linux %s ..." ${version})" ++ if [ -d /sys/firmware/efi ]; then ++ linuxcmd=linuxefi ++ initrdcmd=initrdefi ++ else ++ linuxcmd=linux ++ initrdcmd=initrd ++ fi + sed "s/^/$submenu_indentation/" << EOF + echo '$(echo "$message" | grub_quote)' +- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} ++ ${linuxcmd} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + EOF + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. +@@ -152,7 +159,7 @@ EOF + done + sed "s/^/$submenu_indentation/" << EOF + echo '$(echo "$message" | grub_quote)' +- initrd $(echo $initrd_path) ++ ${initrdcmd} $(echo $initrd_path) + EOF + fi + sed "s/^/$submenu_indentation/" << EOF diff --git a/0084-Don-t-allow-insmod-when-secure-boot-is-enabled.patch b/0173-Don-t-allow-insmod-when-secure-boot-is-enabled.patch similarity index 92% rename from 0084-Don-t-allow-insmod-when-secure-boot-is-enabled.patch rename to 0173-Don-t-allow-insmod-when-secure-boot-is-enabled.patch index 28b21dc6..9c49bfa8 100644 --- a/0084-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +++ b/0173-Don-t-allow-insmod-when-secure-boot-is-enabled.patch @@ -1,4 +1,4 @@ -From eb8fd62e887e624f5c6e7c2ee8512981e8b5be97 Mon Sep 17 00:00:00 2001 +From 03107c1c375938f29e9cda832b64db57cb30bb94 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Oct 2012 10:40:49 -0400 Subject: [PATCH] Don't allow insmod when secure boot is enabled. @@ -69,10 +69,10 @@ index e394cd96f8c..621070918d4 100644 file = grub_file_open (filename); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 684ca93f8f4..2588b481e76 100644 +index e339f264b3a..92e1583b37d 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -269,6 +269,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, +@@ -278,6 +278,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, return NULL; } @@ -108,10 +108,10 @@ index 684ca93f8f4..2588b481e76 100644 /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 91e29ce66f1..bb3ab7dfdeb 100644 +index 3efbafbb418..f68a19de442 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h -@@ -83,6 +83,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, +@@ -84,6 +84,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, const grub_efi_guid_t *guid, void *data, grub_size_t datasize); diff --git a/0085-Pass-x-hex-hex-straight-through-unmolested.patch b/0174-Pass-x-hex-hex-straight-through-unmolested.patch similarity index 97% rename from 0085-Pass-x-hex-hex-straight-through-unmolested.patch rename to 0174-Pass-x-hex-hex-straight-through-unmolested.patch index bb7845aa..02a9a799 100644 --- a/0085-Pass-x-hex-hex-straight-through-unmolested.patch +++ b/0174-Pass-x-hex-hex-straight-through-unmolested.patch @@ -1,8 +1,7 @@ -From 0d54ed89090fc1bdcb75de474024b2b81dbf644f Mon Sep 17 00:00:00 2001 +From bf43c6f1b92a5c97edbd2541b67cf2e794fff074 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 Oct 2012 13:24:37 -0400 -Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through - unmolested. +Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. --- grub-core/commands/wildcard.c | 16 +++++++++++++++- diff --git a/0086-Add-X-option-to-printf-functions.patch b/0175-Add-X-option-to-printf-functions.patch similarity index 95% rename from 0086-Add-X-option-to-printf-functions.patch rename to 0175-Add-X-option-to-printf-functions.patch index fa0405b6..2b6b16d0 100644 --- a/0086-Add-X-option-to-printf-functions.patch +++ b/0175-Add-X-option-to-printf-functions.patch @@ -1,4 +1,4 @@ -From 6237b1688124d6a72250b296e758ef2d59fde26f Mon Sep 17 00:00:00 2001 +From 5e975fd52229bbbc6e9e09566216e90977ba75b4 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 16:58:39 -0200 Subject: [PATCH] Add %X option to printf functions. diff --git a/0087-Search-for-specific-config-file-for-netboot.patch b/0176-Search-for-specific-config-file-for-netboot.patch similarity index 98% rename from 0087-Search-for-specific-config-file-for-netboot.patch rename to 0176-Search-for-specific-config-file-for-netboot.patch index 9cee6e6b..a204c6e1 100644 --- a/0087-Search-for-specific-config-file-for-netboot.patch +++ b/0176-Search-for-specific-config-file-for-netboot.patch @@ -1,4 +1,4 @@ -From 9491cbfdab951e38f096bd9705a76b382f54c9be Mon Sep 17 00:00:00 2001 +From e560fbd93be355c5eeb756ae46592716d5e5a209 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:22:07 -0200 Subject: [PATCH] Search for specific config file for netboot diff --git a/0088-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch b/0177-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch similarity index 96% rename from 0088-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch rename to 0177-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch index 0b039c8b..cf7c40e7 100644 --- a/0088-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +++ b/0177-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch @@ -1,8 +1,8 @@ -From 5fcdebdc36cc84c772754b7f5bdb87aed2b42853 Mon Sep 17 00:00:00 2001 +From 5857f0023c2bd3eb57159597518461b1e1f0bf5e Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Tue, 22 Jan 2013 06:31:38 +0100 -Subject: [PATCH] blscfg: add blscfg module to parse Boot Loader - Specification snippets +Subject: [PATCH] blscfg: add blscfg module to parse Boot Loader Specification + snippets http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec @@ -21,7 +21,7 @@ Signed-off-by: Peter Jones create mode 100644 grub-core/commands/blscfg.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index c653c71c594..7f3d5a2bfe6 100644 +index aacad137b36..3f42ce16fad 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -768,6 +768,14 @@ module = { diff --git a/0089-Don-t-write-messages-to-the-screen.patch b/0178-Don-t-write-messages-to-the-screen.patch similarity index 84% rename from 0089-Don-t-write-messages-to-the-screen.patch rename to 0178-Don-t-write-messages-to-the-screen.patch index d9eb35b2..0798429c 100644 --- a/0089-Don-t-write-messages-to-the-screen.patch +++ b/0178-Don-t-write-messages-to-the-screen.patch @@ -1,4 +1,4 @@ -From fc390be631e93744c6a3a2f42849c9edf2614a36 Mon Sep 17 00:00:00 2001 +From 03163e0b1df429ae707d5e166f1668133ce615fb 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 @@ -11,8 +11,8 @@ very appealing. 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(-) + util/grub.d/10_linux.in | 3 --- + 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c index 4880cefe3f8..b22e1bcc94b 100644 @@ -127,7 +127,7 @@ index 2bd0b2d2866..ea167fe1206 100644 movw $disk_address_packet, %si diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S -index 1ee4cf5b2e0..c8b87ed293c 100644 +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: @@ -143,36 +143,30 @@ index 1ee4cf5b2e0..c8b87ed293c 100644 movw $LOCAL(firstlist), %di diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 8ccf012f747..a3d9711d607 100644 +index 37d539fcf93..3c290f65403 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -128,29 +128,22 @@ linux_entry () +@@ -138,7 +138,6 @@ linux_entry () fi printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" fi - message="$(gettext_printf "Loading Linux %s ..." ${version})" if [ -d /sys/firmware/efi ]; then - sed "s/^/$submenu_indentation/" << EOF + linuxcmd=linuxefi + initrdcmd=initrdefi +@@ -147,7 +146,6 @@ linux_entry () + initrdcmd=initrd + fi + sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' - linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + ${linuxcmd} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} EOF - else + if test -n "${initrd}" ; then +@@ -158,7 +156,6 @@ EOF + initrd_path="${initrd_path} ${rel_dirname}/${i}" + done sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + ${initrdcmd} $(echo $initrd_path) EOF fi - if test -n "${initrd}" ; then -- # TRANSLATORS: ramdisk isn't identifier. Should be translated. -- message="$(gettext_printf "Loading initial ramdisk ...")" - if [ -d /sys/firmware/efi ]; then - sed "s/^/$submenu_indentation/" << EOF -- echo '$(echo "$message" | grub_quote)' - initrdefi ${rel_dirname}/${initrd} - EOF - else - sed "s/^/$submenu_indentation/" << EOF -- echo '$message' - initrd ${rel_dirname}/${initrd} - EOF - fi diff --git a/0090-Don-t-print-GNU-GRUB-header.patch b/0179-Don-t-print-GNU-GRUB-header.patch similarity index 94% rename from 0090-Don-t-print-GNU-GRUB-header.patch rename to 0179-Don-t-print-GNU-GRUB-header.patch index e55c3d92..7c3d834b 100644 --- a/0090-Don-t-print-GNU-GRUB-header.patch +++ b/0179-Don-t-print-GNU-GRUB-header.patch @@ -1,4 +1,4 @@ -From 806c26ae73bc86e305c39c955d86480fad8985df Mon Sep 17 00:00:00 2001 +From e1c8193f46a43545315b6c0fa47d92916b206ef4 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 diff --git a/0091-Don-t-add-to-highlighted-row.patch b/0180-Don-t-add-to-highlighted-row.patch similarity index 92% rename from 0091-Don-t-add-to-highlighted-row.patch rename to 0180-Don-t-add-to-highlighted-row.patch index 70a2666f..fbd1f809 100644 --- a/0091-Don-t-add-to-highlighted-row.patch +++ b/0180-Don-t-add-to-highlighted-row.patch @@ -1,4 +1,4 @@ -From 5ae2484f263365351a2891be6c056eeb96b3924b Mon Sep 17 00:00:00 2001 +From 38bab91cc61eb9a233c4c735ec733072acbc306d 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 diff --git a/0092-Message-string-cleanups.patch b/0181-Message-string-cleanups.patch similarity index 97% rename from 0092-Message-string-cleanups.patch rename to 0181-Message-string-cleanups.patch index 09f2a835..ca86dc7c 100644 --- a/0092-Message-string-cleanups.patch +++ b/0181-Message-string-cleanups.patch @@ -1,4 +1,4 @@ -From 622b238ecb927d331dc38083584a7323013b5f21 Mon Sep 17 00:00:00 2001 +From 1124b1699af1fafef4ce75d1018de8912c90818e 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 diff --git a/0093-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch b/0182-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch similarity index 93% rename from 0093-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch rename to 0182-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch index a04fb3ed..b3c90d61 100644 --- a/0093-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +++ b/0182-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch @@ -1,4 +1,4 @@ -From c7dac08ab344638afabf579e03bedfac729e1944 Mon Sep 17 00:00:00 2001 +From a5a6538390446ca1f52652480e91934736bcc0e6 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 diff --git a/0094-Use-the-correct-indentation-for-the-term-help-text.patch b/0183-Use-the-correct-indentation-for-the-term-help-text.patch similarity index 93% rename from 0094-Use-the-correct-indentation-for-the-term-help-text.patch rename to 0183-Use-the-correct-indentation-for-the-term-help-text.patch index 7b22a92e..82b98dc2 100644 --- a/0094-Use-the-correct-indentation-for-the-term-help-text.patch +++ b/0183-Use-the-correct-indentation-for-the-term-help-text.patch @@ -1,4 +1,4 @@ -From 8a59d6c44d946eac70ecbb7a9418c5d6801add8b Mon Sep 17 00:00:00 2001 +From 57db40fb428695a1e076bc5d2bed433fffdb626e 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 diff --git a/0095-Indent-menu-entries.patch b/0184-Indent-menu-entries.patch similarity index 92% rename from 0095-Indent-menu-entries.patch rename to 0184-Indent-menu-entries.patch index 2e089049..2d5318a3 100644 --- a/0095-Indent-menu-entries.patch +++ b/0184-Indent-menu-entries.patch @@ -1,4 +1,4 @@ -From 018439ecfda2bc5049ccbfb0d6ab7fa047411a3b Mon Sep 17 00:00:00 2001 +From 5f5410a5f6a4ac90ef5ca149bddec332650e9b0f 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 diff --git a/0096-Fix-margins.patch b/0185-Fix-margins.patch similarity index 94% rename from 0096-Fix-margins.patch rename to 0185-Fix-margins.patch index 8a4f6fc5..487b18c2 100644 --- a/0096-Fix-margins.patch +++ b/0185-Fix-margins.patch @@ -1,4 +1,4 @@ -From 33481aa0e7897465ffd386101d6f3eda6e3bbac0 Mon Sep 17 00:00:00 2001 +From 46071266a57e1b6fbcda8ba7a280cb7e0fda5f63 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:59:36 -0400 Subject: [PATCH] Fix margins diff --git a/0097-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch b/0186-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch similarity index 92% rename from 0097-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch rename to 0186-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch index 718e6ad2..10a3cf9d 100644 --- a/0097-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +++ b/0186-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch @@ -1,4 +1,4 @@ -From ea032bd4a6cb66929da61477b1759e136c975189 Mon Sep 17 00:00:00 2001 +From 9d90c71c213ce1f7ccbd052b882778c4059c82d6 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 diff --git a/0098-Use-linux16-when-appropriate-880840.patch b/0187-Use-linux16-when-appropriate-880840.patch similarity index 54% rename from 0098-Use-linux16-when-appropriate-880840.patch rename to 0187-Use-linux16-when-appropriate-880840.patch index 327717bc..1b0fa0f1 100644 --- a/0098-Use-linux16-when-appropriate-880840.patch +++ b/0187-Use-linux16-when-appropriate-880840.patch @@ -1,4 +1,4 @@ -From 8e1957d59e7e72850cbac7e779ddf22ca23c250d Mon Sep 17 00:00:00 2001 +From d23b0a97c175f6f356eaeff02d0d3cb61b0272df Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:05:07 -0400 Subject: [PATCH] Use linux16 when appropriate (#880840) @@ -14,10 +14,10 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index a3d9711d607..f3bf6acd856 100644 +index 3c290f65403..c8376a5189c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -76,6 +76,11 @@ linux_entry () +@@ -86,6 +86,11 @@ linux_entry () type="$3" args="$4" @@ -29,21 +29,14 @@ index a3d9711d607..f3bf6acd856 100644 if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi -@@ -134,7 +139,7 @@ linux_entry () - EOF +@@ -142,8 +147,8 @@ linux_entry () + linuxcmd=linuxefi + initrdcmd=initrdefi else - sed "s/^/$submenu_indentation/" << EOF -- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} -+ linux${sixteenbit} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} - EOF - fi - if test -n "${initrd}" ; then -@@ -144,7 +149,7 @@ EOF - EOF - else - sed "s/^/$submenu_indentation/" << EOF -- initrd ${rel_dirname}/${initrd} -+ initrd${sixteenbit} ${rel_dirname}/${initrd} - EOF - fi +- linuxcmd=linux +- initrdcmd=initrd ++ linuxcmd=linux${sixteenbit} ++ initrdcmd=initrd${sixteenbit} fi + sed "s/^/$submenu_indentation/" << EOF + ${linuxcmd} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} diff --git a/0099-Enable-pager-by-default.-985860.patch b/0188-Enable-pager-by-default.-985860.patch similarity index 91% rename from 0099-Enable-pager-by-default.-985860.patch rename to 0188-Enable-pager-by-default.-985860.patch index 02e87091..ef979327 100644 --- a/0099-Enable-pager-by-default.-985860.patch +++ b/0188-Enable-pager-by-default.-985860.patch @@ -1,4 +1,4 @@ -From 7466f51a0012ebdd8be07cfc0e63d50e0e79560d Mon Sep 17 00:00:00 2001 +From 4deef17317b24ea814ed3982ebbaca979324dee6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:09:27 -0400 Subject: [PATCH] Enable pager by default. (#985860) diff --git a/0100-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch b/0189-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch similarity index 91% rename from 0100-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch rename to 0189-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch index a3f7d05a..2027e030 100644 --- a/0100-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +++ b/0189-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch @@ -1,8 +1,8 @@ -From 7a97d9621a145cbd04111970fea04c34433f900c Mon Sep 17 00:00:00 2001 +From 835aac81e84afef7114948dbd0a37554d38bae77 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) +Subject: [PATCH] F10 doesn't work on serial, so don't tell the user to hit it + (#987443) Signed-off-by: Peter Jones --- diff --git a/0101-Don-t-say-GNU-Linux-in-generated-menus.patch b/0190-Don-t-say-GNU-Linux-in-generated-menus.patch similarity index 90% rename from 0101-Don-t-say-GNU-Linux-in-generated-menus.patch rename to 0190-Don-t-say-GNU-Linux-in-generated-menus.patch index 7f637136..a635f6a9 100644 --- a/0101-Don-t-say-GNU-Linux-in-generated-menus.patch +++ b/0190-Don-t-say-GNU-Linux-in-generated-menus.patch @@ -1,4 +1,4 @@ -From 45877a77f50eecd0b7fd3ba1aec0d4398a3b6a20 Mon Sep 17 00:00:00 2001 +From 04999ca2777e45a00a76aa0aa535eeda337f48ae 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. @@ -9,7 +9,7 @@ Subject: [PATCH] Don't say "GNU/Linux" in generated menus. 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index f3bf6acd856..ef52cf3dbbb 100644 +index c8376a5189c..11f50d5730b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -25,7 +25,7 @@ index f3bf6acd856..ef52cf3dbbb 100644 fi diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index c002fc9f946..54f1ec8a2fd 100644 +index e8143b079dc..972a4b5a03d 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" diff --git a/0102-Don-t-draw-a-border-around-the-menu.patch b/0191-Don-t-draw-a-border-around-the-menu.patch similarity index 97% rename from 0102-Don-t-draw-a-border-around-the-menu.patch rename to 0191-Don-t-draw-a-border-around-the-menu.patch index 3f0b39ff..fc19f2e2 100644 --- a/0102-Don-t-draw-a-border-around-the-menu.patch +++ b/0191-Don-t-draw-a-border-around-the-menu.patch @@ -1,4 +1,4 @@ -From c28a3053e96859000df5ff1d48c9a560d47c0470 Mon Sep 17 00:00:00 2001 +From 2796581ffc968157ab01926ae7a229a8920f0193 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 diff --git a/0103-Use-the-standard-margin-for-the-timeout-string.patch b/0192-Use-the-standard-margin-for-the-timeout-string.patch similarity index 95% rename from 0103-Use-the-standard-margin-for-the-timeout-string.patch rename to 0192-Use-the-standard-margin-for-the-timeout-string.patch index e442ef06..1cc533d7 100644 --- a/0103-Use-the-standard-margin-for-the-timeout-string.patch +++ b/0192-Use-the-standard-margin-for-the-timeout-string.patch @@ -1,4 +1,4 @@ -From 93018f5d1727eb58dead129f150a36080c22530a Mon Sep 17 00:00:00 2001 +From bc02c1f43c8238c09ad5d51d98a53f3d0425b25e 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 diff --git a/0104-Add-.eh_frame-to-list-of-relocations-stripped.patch b/0193-Add-.eh_frame-to-list-of-relocations-stripped.patch similarity index 94% rename from 0104-Add-.eh_frame-to-list-of-relocations-stripped.patch rename to 0193-Add-.eh_frame-to-list-of-relocations-stripped.patch index 62faad2c..8e2974e7 100644 --- a/0104-Add-.eh_frame-to-list-of-relocations-stripped.patch +++ b/0193-Add-.eh_frame-to-list-of-relocations-stripped.patch @@ -1,4 +1,4 @@ -From c626121f38adf6fcd39a5f69249c650b4b52c10d Mon Sep 17 00:00:00 2001 +From ddd8c2df98b86c252bca06172d8de755c378a52e Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 13 Jan 2014 21:50:59 -0500 Subject: [PATCH] Add .eh_frame to list of relocations stripped diff --git a/0105-Make-10_linux-work-with-our-changes-for-linux16-and-.patch b/0194-Make-10_linux-work-with-our-changes-for-linux16-and-.patch similarity index 51% rename from 0105-Make-10_linux-work-with-our-changes-for-linux16-and-.patch rename to 0194-Make-10_linux-work-with-our-changes-for-linux16-and-.patch index ba7295d1..c2332793 100644 --- a/0105-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +++ b/0194-Make-10_linux-work-with-our-changes-for-linux16-and-.patch @@ -1,73 +1,70 @@ -From 59275c83e7a303c63379d37ba21aa39a3c3b7203 Mon Sep 17 00:00:00 2001 +From fe622e360501517a111917300ce545de3928c4b0 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 13:12:23 -0500 -Subject: [PATCH] Make 10_linux work with our changes for linux16 and - linuxefi on aarch64 +Subject: [PATCH] Make 10_linux work with our changes for linux16 and linuxefi + on aarch64 Signed-off-by: Peter Jones --- - util/grub.d/10_linux.in | 31 ++++++++++++++++++++++++++++--- - 1 file changed, 28 insertions(+), 3 deletions(-) + util/grub.d/10_linux.in | 35 ++++++++++++++++++++++++++--------- + 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ef52cf3dbbb..191aebe80bb 100644 +index 11f50d5730b..c889b47db59 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -77,8 +77,18 @@ linux_entry () +@@ -86,9 +86,18 @@ linux_entry () + type="$3" args="$4" - sixteenbit="" -+ linuxefi="linux" -+ initrdefi="initrd" +- sixteenbit="" ++ linuxcmd=linux ++ initrdcmd=initrd case "$machine" in - i?86|x86_64) sixteenbit="16" ;; + i?86|x86_64) -+ sixteenbit="16" -+ linuxefi="linuxefi" -+ initrdefi="initrdefi" -+ ;; -+ aarch64) -+ linuxefi="linux" -+ initrdefi="initrd" ++ if [ -d /sys/firmware/efi ]; then ++ linuxcmd=linuxefi ++ initrdcmd=initrdefi ++ else ++ linuxcmd=linux16 ++ initrdcmd=linux16 ++ fi + ;; esac if [ -z "$boot_device_id" ]; then -@@ -135,7 +145,7 @@ linux_entry () - fi - if [ -d /sys/firmware/efi ]; then - sed "s/^/$submenu_indentation/" << EOF -- linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} -+ ${linuxefi} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} - EOF - else - sed "s/^/$submenu_indentation/" << EOF -@@ -145,7 +155,7 @@ EOF - if test -n "${initrd}" ; then - if [ -d /sys/firmware/efi ]; then - sed "s/^/$submenu_indentation/" << EOF -- initrdefi ${rel_dirname}/${initrd} -+ ${initrdefi} ${rel_dirname}/${initrd} - EOF - else - sed "s/^/$submenu_indentation/" << EOF -@@ -153,6 +163,13 @@ EOF - EOF +@@ -143,13 +152,6 @@ linux_entry () fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" fi +- if [ -d /sys/firmware/efi ]; then +- linuxcmd=linuxefi +- initrdcmd=initrdefi +- else +- linuxcmd=linux${sixteenbit} +- initrdcmd=initrd${sixteenbit} +- fi + sed "s/^/$submenu_indentation/" << EOF + ${linuxcmd} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + EOF +@@ -162,6 +164,13 @@ EOF + done + sed "s/^/$submenu_indentation/" << EOF + ${initrdcmd} $(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 - sed "s/^/$submenu_indentation/" << EOF - } EOF -@@ -215,6 +232,14 @@ while [ "x$list" != "x" ] ; do - fi - done + fi + sed "s/^/$submenu_indentation/" << EOF +@@ -245,6 +254,14 @@ while [ "x$list" != "x" ] ; do + gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2 + fi + fdt= + for i in "dtb-${version}" "dtb-${alt_version}"; do diff --git a/0106-Don-t-print-during-fdt-loading-method.patch b/0195-Don-t-print-during-fdt-loading-method.patch similarity index 81% rename from 0106-Don-t-print-during-fdt-loading-method.patch rename to 0195-Don-t-print-during-fdt-loading-method.patch index 923c9d75..f0ecc5a6 100644 --- a/0106-Don-t-print-during-fdt-loading-method.patch +++ b/0195-Don-t-print-during-fdt-loading-method.patch @@ -1,4 +1,4 @@ -From aedf2aceb354ab7bf28bbf70d0a4b505c0adcfdf Mon Sep 17 00:00:00 2001 +From c22d8b839bd9e609a3fa69cb7a42d0c7d2f71a55 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 16:15:46 -0500 Subject: [PATCH] Don't print during fdt loading method. @@ -9,11 +9,11 @@ Signed-off-by: Peter Jones 1 file changed, 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 191aebe80bb..452a9f69d28 100644 +index c889b47db59..c0c822c7147 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -164,9 +164,7 @@ EOF - fi +@@ -167,9 +167,7 @@ EOF + EOF fi if test -n "${fdt}" ; then - message="$(gettext_printf "Loading fdt ...")" diff --git a/0107-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch b/0196-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch similarity index 90% rename from 0107-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch rename to 0196-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch index 8cc75f90..db3a16a3 100644 --- a/0107-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +++ b/0196-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch @@ -1,8 +1,8 @@ -From f2790b1f7c8efcd5589c8fcdaca51b548ab9825c Mon Sep 17 00:00:00 2001 +From 4fd66df9601a7a259edd1cdda0d864e4d9d8f7e5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 30 Jun 2014 14:16:46 -0400 -Subject: [PATCH] Don't munge raw spaces when we're doing our cmdline - escaping (#923374) +Subject: [PATCH] Don't munge raw spaces when we're doing our cmdline escaping + (#923374) Signed-off-by: Peter Jones --- diff --git a/0108-Don-t-require-a-password-to-boot-entries-generated-b.patch b/0197-Don-t-require-a-password-to-boot-entries-generated-b.patch similarity index 89% rename from 0108-Don-t-require-a-password-to-boot-entries-generated-b.patch rename to 0197-Don-t-require-a-password-to-boot-entries-generated-b.patch index 119b96d0..a2bf78d0 100644 --- a/0108-Don-t-require-a-password-to-boot-entries-generated-b.patch +++ b/0197-Don-t-require-a-password-to-boot-entries-generated-b.patch @@ -1,4 +1,4 @@ -From 205a7844bea4d849dc24f24b5fc96f6040d5e2b9 Mon Sep 17 00:00:00 2001 +From 9069f3a7af05b7150a2b5fe08e2f503f115e7421 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 11 Feb 2014 11:14:50 -0500 Subject: [PATCH] Don't require a password to boot entries generated by @@ -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 452a9f69d28..79a747ebd4d 100644 +index c0c822c7147..2e533ffd8aa 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" diff --git a/0109-Don-t-emit-Booting-.-message.patch b/0198-Don-t-emit-Booting-.-message.patch similarity index 95% rename from 0109-Don-t-emit-Booting-.-message.patch rename to 0198-Don-t-emit-Booting-.-message.patch index 9cff2e4c..18b1fb3e 100644 --- a/0109-Don-t-emit-Booting-.-message.patch +++ b/0198-Don-t-emit-Booting-.-message.patch @@ -1,4 +1,4 @@ -From c986c38f790881be0b9c5b0acd8d3b106412a5f1 Mon Sep 17 00:00:00 2001 +From aa1ca267489b5650e38beb075d28be673af6c804 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. diff --git a/0110-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch b/0199-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch similarity index 99% rename from 0110-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch rename to 0199-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch index 89ecc94b..661224e1 100644 --- a/0110-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch +++ b/0199-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch @@ -1,4 +1,4 @@ -From dcf3b9c590f00e33f773de68ac4ebd55ca4f6e90 Mon Sep 17 00:00:00 2001 +From 3c3a2f5ad9505a0a8b87a6582576ff59832f60be 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. @@ -122,7 +122,7 @@ Replace a bunch of machine generated ones with ones that look nicer. create mode 100644 util/grub-sparc64-setup.8 diff --git a/configure.ac b/configure.ac -index 9ae97f026ab..0cb971a92c5 100644 +index 783118ccdcd..d5db2803ec4 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,29 @@ grub_TRANSFORM([grub-set-default]) diff --git a/0111-use-fw_path-prefix-when-fallback-searching-for-grub-.patch b/0200-use-fw_path-prefix-when-fallback-searching-for-grub-.patch similarity index 95% rename from 0111-use-fw_path-prefix-when-fallback-searching-for-grub-.patch rename to 0200-use-fw_path-prefix-when-fallback-searching-for-grub-.patch index 318cb2e1..4b06a0a0 100644 --- a/0111-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +++ b/0200-use-fw_path-prefix-when-fallback-searching-for-grub-.patch @@ -1,8 +1,7 @@ -From 24865a88781aef2a6a54433b5b383219108f54fa Mon Sep 17 00:00:00 2001 +From ea4352b9673c0f8db665307bbd668192d3f679ce Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 19 Feb 2014 15:58:43 -0500 -Subject: [PATCH] use fw_path prefix when fallback searching for grub - config +Subject: [PATCH] use fw_path prefix when fallback searching for grub config When PXE booting via UEFI firmware, grub was searching for grub.cfg in the fw_path directory where the grub application was found. If diff --git a/0112-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch b/0201-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch similarity index 97% rename from 0112-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch rename to 0201-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch index 51926338..a67061f7 100644 --- a/0112-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +++ b/0201-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch @@ -1,8 +1,7 @@ -From d4cd9aa8695ab9448da41f756553beb75bffee46 Mon Sep 17 00:00:00 2001 +From 91452eea80cd33c8f82a6abc8f6ba681894f3481 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 6 Mar 2014 11:51:33 -0500 -Subject: [PATCH] Try mac/guid/etc before grub.cfg on tftp config - files. +Subject: [PATCH] Try mac/guid/etc before grub.cfg on tftp config files. Signed-off-by: Peter Jones --- diff --git a/0113-Fix-convert-function-to-support-NVMe-devices.patch b/0202-Fix-convert-function-to-support-NVMe-devices.patch similarity index 95% rename from 0113-Fix-convert-function-to-support-NVMe-devices.patch rename to 0202-Fix-convert-function-to-support-NVMe-devices.patch index 4c2f9602..0ce12882 100644 --- a/0113-Fix-convert-function-to-support-NVMe-devices.patch +++ b/0202-Fix-convert-function-to-support-NVMe-devices.patch @@ -1,4 +1,4 @@ -From 397f179c26aeddf3fe452c62aa404459889835fc Mon Sep 17 00:00:00 2001 +From 13138c79ad110cf651c78dd81c36f3adc23fa254 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 11:34:00 -0500 Subject: [PATCH] Fix convert function to support NVMe devices diff --git a/0114-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch b/0203-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch similarity index 80% rename from 0114-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch rename to 0203-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch index 231c994f..e5be7cff 100644 --- a/0114-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +++ b/0203-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch @@ -1,8 +1,7 @@ -From 4291f418c3304f0f379467e87ce5892853cc16c7 Mon Sep 17 00:00:00 2001 +From 6d27dc11763cde510d9e8cd2bae9800df704fc32 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 10 Feb 2014 16:13:10 -0500 -Subject: [PATCH] Switch to use APM Mustang device tree, for hardware - testing. +Subject: [PATCH] Switch to use APM Mustang device tree, for hardware testing. Signed-off-by: David A. Marlin --- @@ -10,10 +9,10 @@ Signed-off-by: David A. Marlin 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 79a747ebd4d..462b461ff49 100644 +index 2e533ffd8aa..4e9a6308b3c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -232,8 +232,8 @@ while [ "x$list" != "x" ] ; do +@@ -254,8 +254,8 @@ while [ "x$list" != "x" ] ; do fdt= for i in "dtb-${version}" "dtb-${alt_version}"; do diff --git a/0115-Use-the-default-device-tree-from-the-grub-default-fi.patch b/0204-Use-the-default-device-tree-from-the-grub-default-fi.patch similarity index 81% rename from 0115-Use-the-default-device-tree-from-the-grub-default-fi.patch rename to 0204-Use-the-default-device-tree-from-the-grub-default-fi.patch index d8bad033..2f612e0f 100644 --- a/0115-Use-the-default-device-tree-from-the-grub-default-fi.patch +++ b/0204-Use-the-default-device-tree-from-the-grub-default-fi.patch @@ -1,8 +1,7 @@ -From 5111bdda0d0a21ab02f6c9aa441a32cd02c6bc3f Mon Sep 17 00:00:00 2001 +From 226c5f786b48c5fc7692f18c99f526e8ac9a3702 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 12 Feb 2014 14:54:04 -0500 -Subject: [PATCH] Use the default device tree from the grub default - file +Subject: [PATCH] Use the default device tree from the grub default file instead of hardcoding a value. @@ -13,10 +12,10 @@ Signed-off-by: David A. Marlin 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index c088b705442..9d595ac058a 100644 +index b0a8626dd1c..f68d4925ee6 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -235,7 +235,8 @@ export GRUB_DEFAULT \ +@@ -254,7 +254,8 @@ export GRUB_DEFAULT \ GRUB_ENABLE_CRYPTODISK \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ @@ -27,10 +26,10 @@ index c088b705442..9d595ac058a 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 462b461ff49..a9692a0c2a2 100644 +index 4e9a6308b3c..c548d989b2e 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -232,8 +232,8 @@ while [ "x$list" != "x" ] ; do +@@ -254,8 +254,8 @@ while [ "x$list" != "x" ] ; do fdt= for i in "dtb-${version}" "dtb-${alt_version}"; do diff --git a/0116-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0205-reopen-SNP-protocol-for-exclusive-use-by-grub.patch similarity index 95% rename from 0116-reopen-SNP-protocol-for-exclusive-use-by-grub.patch rename to 0205-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 42f406e5..1a1ae574 100644 --- a/0116-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0205-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,4 +1,4 @@ -From 0ff5bf3deefdb17dbadb51a11acc50b96e2ed797 Mon Sep 17 00:00:00 2001 +From 203727d71eac6c8442c91001341190fae62311cf Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Sat, 15 Feb 2014 15:10:22 -0500 Subject: [PATCH] reopen SNP protocol for exclusive use by grub diff --git a/0117-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0206-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch similarity index 95% rename from 0117-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch rename to 0206-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 5d1ce100..b96e2e21 100644 --- a/0117-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0206-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,8 +1,7 @@ -From 58fba65b7e339d4c7279e4ca88937d9501275169 Mon Sep 17 00:00:00 2001 +From b400fc7f726144daf0dbab1a80ed14ddbcb8bda8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Mar 2016 15:13:59 -0500 -Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by - grub" +Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by grub" This reverts commit a3f2c756ce34c9666bddef35e3b3b85ccecdcffc , which is obsoleted by these: diff --git a/0118-Add-grub_util_readlink.patch b/0207-Add-grub_util_readlink.patch similarity index 99% rename from 0118-Add-grub_util_readlink.patch rename to 0207-Add-grub_util_readlink.patch index 89fd4261..8cb2d3cc 100644 --- a/0118-Add-grub_util_readlink.patch +++ b/0207-Add-grub_util_readlink.patch @@ -1,4 +1,4 @@ -From 76baa996f73eea47f7bdc41461efeee204626e2d Mon Sep 17 00:00:00 2001 +From f1ea165f74702a74bd5aa4a3006a8dcebc3b21aa Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:01:03 -0400 Subject: [PATCH] Add grub_util_readlink() diff --git a/0119-Make-editenv-chase-symlinks-including-those-across-d.patch b/0208-Make-editenv-chase-symlinks-including-those-across-d.patch similarity index 94% rename from 0119-Make-editenv-chase-symlinks-including-those-across-d.patch rename to 0208-Make-editenv-chase-symlinks-including-those-across-d.patch index a3784ef2..5bd389a2 100644 --- a/0119-Make-editenv-chase-symlinks-including-those-across-d.patch +++ b/0208-Make-editenv-chase-symlinks-including-those-across-d.patch @@ -1,8 +1,7 @@ -From fd1a89c8bef603ec33937f122ae25013a724601a Mon Sep 17 00:00:00 2001 +From f6bb86ffc313bee137859714bd0376bea33d85f8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:38:00 -0400 -Subject: [PATCH] Make editenv chase symlinks including those across - devices. +Subject: [PATCH] Make editenv chase symlinks including those across devices. This lets us make /boot/grub2/grubenv a symlink to /boot/efi/EFI/fedora/grubenv even though they're different mount points, @@ -17,10 +16,10 @@ Reviewed-by: Adam Jackson 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Makefile.util.def b/Makefile.util.def -index 6d452da029f..20611045893 100644 +index c7b775bce73..d08713b5500 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -230,8 +230,17 @@ program = { +@@ -231,8 +231,17 @@ program = { common = util/grub-editenv.c; common = util/editenv.c; diff --git a/0120-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/0209-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch similarity index 85% rename from 0120-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch rename to 0209-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch index ec8c12b7..78f3e2ab 100644 --- a/0120-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +++ b/0209-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch @@ -1,8 +1,7 @@ -From c8d93b9e27e9cbf51e91f6cc99abbcb7b68189ce Mon Sep 17 00:00:00 2001 +From 04f4a4abaadd10777aaa2958a34f1824a257a93f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 14:23:23 -0400 -Subject: [PATCH] Generate OS and CLASS in 10_linux from - /etc/os-release +Subject: [PATCH] Generate OS and CLASS in 10_linux from /etc/os-release This makes us use pretty names in the titles we generate in grub2-mkconfig when GRUB_DISTRIBUTOR isn't set. @@ -15,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 a9692a0c2a2..c6627268cca 100644 +index c548d989b2e..03ea8460bfd 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/0121-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/0210-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch similarity index 86% rename from 0121-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch rename to 0210-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch index 612b3360..177024d4 100644 --- a/0121-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +++ b/0210-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch @@ -1,8 +1,7 @@ -From 974241c42b03f3ccb6a5d0eb453283e370da9848 Mon Sep 17 00:00:00 2001 +From 799c61af332124497809ce468f88aa359f7079e7 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 15:52:08 -0400 -Subject: [PATCH] Minimize the sort ordering for .debug and -rescue- - kernels. +Subject: [PATCH] Minimize the sort ordering for .debug and -rescue- kernels. Resolves: rhbz#1065360 Signed-off-by: Peter Jones @@ -11,10 +10,10 @@ 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 cf35e417470..10fabee5e14 100644 +index 1001a12232b..1a4a57898f9 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in -@@ -248,6 +248,14 @@ version_test_gt () +@@ -249,6 +249,14 @@ version_test_gt () *.old:*.old) ;; *.old:*) version_test_gt_a="`echo "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; *:*.old) version_test_gt_b="`echo "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; diff --git a/0122-Load-arm-with-SB-enabled.patch b/0211-Load-arm-with-SB-enabled.patch similarity index 93% rename from 0122-Load-arm-with-SB-enabled.patch rename to 0211-Load-arm-with-SB-enabled.patch index 0c94cbcf..366b6413 100644 --- a/0122-Load-arm-with-SB-enabled.patch +++ b/0211-Load-arm-with-SB-enabled.patch @@ -1,4 +1,4 @@ -From edfc2b0952b1eacf95188e53167cc038e5ea0129 Mon Sep 17 00:00:00 2001 +From d61ff8a2e5f0938527ff0102c733e2f6c1fd3610 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 18 Sep 2014 11:26:14 -0400 Subject: [PATCH] Load arm with SB enabled. @@ -21,10 +21,10 @@ is enabled. create mode 100644 include/grub/efi/linux.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 7f3d5a2bfe6..5ae70204cd2 100644 +index 3f42ce16fad..e675ab2da01 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1709,6 +1709,8 @@ module = { +@@ -1704,6 +1704,8 @@ module = { ia64_efi = loader/ia64/efi/linux.c; arm = loader/arm/linux.c; arm64 = loader/arm64/linux.c; @@ -33,7 +33,7 @@ index 7f3d5a2bfe6..5ae70204cd2 100644 common = loader/linux.c; common = lib/cmdline.c; enable = noemu; -@@ -1776,6 +1778,7 @@ module = { +@@ -1771,6 +1773,7 @@ module = { name = linuxefi; efi = loader/i386/efi/linux.c; efi = lib/cmdline.c; @@ -42,18 +42,18 @@ index 7f3d5a2bfe6..5ae70204cd2 100644 enable = x86_64_efi; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 746edd10415..33345d37534 100644 +index ebe1e730d63..ab0d27ee4df 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -28,6 +28,7 @@ - #include +@@ -29,6 +29,7 @@ #include #include + #include +#include #include #include #include -@@ -39,6 +40,7 @@ static int loaded; +@@ -40,6 +41,7 @@ static int loaded; static void *kernel_addr; static grub_uint64_t kernel_size; @@ -61,7 +61,7 @@ index 746edd10415..33345d37534 100644 static char *linux_args; static grub_uint32_t cmdline_size; -@@ -65,7 +67,8 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) +@@ -66,7 +68,8 @@ grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh) static grub_err_t finalize_params_linux (void) { @@ -71,7 +71,7 @@ index 746edd10415..33345d37534 100644 void *fdt; -@@ -100,79 +103,73 @@ finalize_params_linux (void) +@@ -101,79 +104,73 @@ finalize_params_linux (void) if (grub_fdt_install() != GRUB_ERR_NONE) goto failure; @@ -201,15 +201,15 @@ index 746edd10415..33345d37534 100644 } static grub_err_t -@@ -249,6 +246,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -250,6 +247,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), { grub_file_t file = 0; - struct grub_arm64_linux_kernel_header lh; + struct linux_arm64_kernel_header lh; + struct grub_arm64_linux_pe_header *pe; grub_dl_ref (my_mod); -@@ -293,6 +291,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -294,6 +292,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); @@ -364,19 +364,19 @@ index b79e6320ba9..e5b778577f9 100644 static grub_err_t diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index a981df5d15f..0df38413338 100644 +index b0634762450..6ea38bd95ab 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -20,6 +20,7 @@ - #define GRUB_LINUX_CPU_HEADER 1 + #define GRUB_ARM64_LINUX_HEADER 1 #include +#include - #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + #define GRUB_LINUX_ARM64_MAGIC_SIGNATURE 0x644d5241 /* 'ARM\x64' */ -@@ -42,5 +43,11 @@ grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header - *lh); +@@ -41,5 +42,11 @@ struct linux_arm64_kernel_header + grub_err_t grub_arm64_uefi_check_image (struct linux_arm64_kernel_header *lh); grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args); +struct grub_arm64_linux_pe_header @@ -386,7 +386,7 @@ index a981df5d15f..0df38413338 100644 + struct grub_pe64_optional_header opt; +}; - #endif /* ! GRUB_LINUX_CPU_HEADER */ + #endif /* ! GRUB_ARM64_LINUX_HEADER */ diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h new file mode 100644 index 00000000000..d9ede36773b diff --git a/0123-Try-prefix-if-fw_path-doesn-t-work.patch b/0212-Try-prefix-if-fw_path-doesn-t-work.patch similarity index 96% rename from 0123-Try-prefix-if-fw_path-doesn-t-work.patch rename to 0212-Try-prefix-if-fw_path-doesn-t-work.patch index 1a00158d..4f0bc526 100644 --- a/0123-Try-prefix-if-fw_path-doesn-t-work.patch +++ b/0212-Try-prefix-if-fw_path-doesn-t-work.patch @@ -1,4 +1,4 @@ -From 3846b040f1050f246e1e975ee88f22c687ae04bf Mon Sep 17 00:00:00 2001 +From 0f6db57cca75a0dde618429d3b3edff56c6a71a4 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 3 Oct 2014 11:08:03 -0400 Subject: [PATCH] Try $prefix if $fw_path doesn't work. @@ -13,10 +13,10 @@ Signed-off-by: Peter Jones 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index e69c0133e69..4dfa41a37d5 100644 +index f5423ce27d9..e01bc6eab19 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c -@@ -138,23 +138,25 @@ grub_machine_get_bootlocation (char **device, char **path) +@@ -124,23 +124,25 @@ grub_machine_get_bootlocation (char **device, char **path) grub_free (canon); } else diff --git a/0124-Update-info-with-grub.cfg-netboot-selection-order-11.patch b/0213-Update-info-with-grub.cfg-netboot-selection-order-11.patch similarity index 91% rename from 0124-Update-info-with-grub.cfg-netboot-selection-order-11.patch rename to 0213-Update-info-with-grub.cfg-netboot-selection-order-11.patch index 501243ae..cd861d59 100644 --- a/0124-Update-info-with-grub.cfg-netboot-selection-order-11.patch +++ b/0213-Update-info-with-grub.cfg-netboot-selection-order-11.patch @@ -1,8 +1,7 @@ -From d4b4184078610a3639fa1e0e463679c424496c3b Mon Sep 17 00:00:00 2001 +From f09c2755eee9ece0c0d45ed6e12906635e4aae36 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 16 Mar 2015 16:34:51 -0400 -Subject: [PATCH] Update info with grub.cfg netboot selection order - (#1148650) +Subject: [PATCH] Update info with grub.cfg netboot selection order (#1148650) Added documentation to the grub info page that specifies the order netboot clients will use to select a grub configuration file. @@ -13,10 +12,10 @@ Resolves rhbz#1148650 1 file changed, 42 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index 6fdd2a041f7..15a90b26e4d 100644 +index 2fd32608c01..a7155c22ffe 100644 --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -2414,6 +2414,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 +@@ -2493,6 +2493,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 Then follow instructions printed out by grub-mknetdir on configuring your DHCP server. diff --git a/0125-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/0214-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch similarity index 97% rename from 0125-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch rename to 0214-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch index c107e6c4..5305c776 100644 --- a/0125-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +++ b/0214-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch @@ -1,8 +1,7 @@ -From ce125cafc1e94bf70f2a3dbb545960bd8dd23a2f Mon Sep 17 00:00:00 2001 +From 4f2512d8cf86908327923d9ab188d9041ee80936 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) +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 @@ -22,7 +21,7 @@ Resolves rhbz#1124074 create mode 100644 util/grub-rpm-sort.8 diff --git a/configure.ac b/configure.ac -index 0cb971a92c5..49427cbf989 100644 +index d5db2803ec4..056df1cbaf9 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -41,7 +40,7 @@ index 0cb971a92c5..49427cbf989 100644 grub_TRANSFORM([grub-reboot.3]) grub_TRANSFORM([grub-render-label.3]) grub_TRANSFORM([grub-script-check.3]) -@@ -1789,6 +1791,33 @@ fi +@@ -1790,6 +1792,33 @@ fi AC_SUBST([LIBDEVMAPPER]) @@ -76,10 +75,10 @@ index 0cb971a92c5..49427cbf989 100644 if test x$host_kernel = xkfreebsd; then AC_CHECK_LIB([geom], [geom_gettree], [], diff --git a/Makefile.util.def b/Makefile.util.def -index 20611045893..d846b81b5f9 100644 +index d08713b5500..406d96861b6 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -684,6 +684,22 @@ program = { +@@ -685,6 +685,22 @@ program = { ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -403,10 +402,10 @@ index d95fac5789c..1c85371298c 100644 /grub*-script-check.1 /grub*-set-default diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 10fabee5e14..954844d2d95 100644 +index 1a4a57898f9..7fe3598435c 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in -@@ -213,6 +213,12 @@ version_sort () +@@ -214,6 +214,12 @@ version_sort () esac } @@ -419,7 +418,7 @@ index 10fabee5e14..954844d2d95 100644 version_test_numeric () { version_test_numeric_a="$1" -@@ -229,7 +235,7 @@ version_test_numeric () +@@ -230,7 +236,7 @@ version_test_numeric () version_test_numeric_a="$version_test_numeric_b" version_test_numeric_b="$version_test_numeric_c" fi diff --git a/0126-Handle-rssd-storage-devices.patch b/0215-Handle-rssd-storage-devices.patch similarity index 93% rename from 0126-Handle-rssd-storage-devices.patch rename to 0215-Handle-rssd-storage-devices.patch index ed4eaad1..313375dd 100644 --- a/0126-Handle-rssd-storage-devices.patch +++ b/0215-Handle-rssd-storage-devices.patch @@ -1,4 +1,4 @@ -From 1956a2192ac0a8421ee83bf77fdf223f2be0bdfb Mon Sep 17 00:00:00 2001 +From 4435cfb4a3666abf615d51eaaf0aa70ddc08a70c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 Jun 2015 15:50:41 -0400 Subject: [PATCH] Handle rssd storage devices. diff --git a/0127-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch b/0216-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch similarity index 96% rename from 0127-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch rename to 0216-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch index 0306a93b..1e34b924 100644 --- a/0127-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch +++ b/0216-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch @@ -1,8 +1,8 @@ -From 5f89c77c7cff17c931f1ea52af0c39df8ab28ac9 Mon Sep 17 00:00:00 2001 +From 6cb89a7f64e4a5b1bd39d4fa9f588c8ecf3ea1f5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 27 Oct 2014 09:22:55 -0400 -Subject: [PATCH] Try to emit linux16/initrd16 and linuxefi/initrdefi - in 30-os_prober. +Subject: [PATCH] Try to emit linux16/initrd16 and linuxefi/initrdefi in + 30-os_prober. Resolves: rhbz#1108296 diff --git a/0128-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0217-Make-grub2-mkconfig-construct-titles-that-look-like-.patch similarity index 90% rename from 0128-Make-grub2-mkconfig-construct-titles-that-look-like-.patch rename to 0217-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index 50059310..50f4ce9b 100644 --- a/0128-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0217-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,8 +1,8 @@ -From c7ae420d095ccec20481c25b14773ab2fce658b5 Mon Sep 17 00:00:00 2001 +From 3b4b6c83c08487f8f063d877c8ed7f03f28ba3d8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH] Make grub2-mkconfig construct titles that look like - the ones we want elsewhere. +Subject: [PATCH] Make grub2-mkconfig construct titles that look like the ones + we want elsewhere. Resolves: rhbz#1215839 @@ -12,10 +12,10 @@ Signed-off-by: Peter Jones 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c6627268cca..1215241859b 100644 +index 03ea8460bfd..a05be9d3047 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -68,6 +68,15 @@ case x"$GRUB_FS" in +@@ -78,6 +78,15 @@ case x"$GRUB_FS" in ;; esac @@ -31,7 +31,7 @@ index c6627268cca..1215241859b 100644 title_correction_code= linux_entry () -@@ -98,15 +107,14 @@ linux_entry () +@@ -107,15 +116,14 @@ linux_entry () if [ x$type != xsimple ] ; then case $type in recovery) diff --git a/0129-Add-friendly-grub2-password-config-tool-985962.patch b/0218-Add-friendly-grub2-password-config-tool-985962.patch similarity index 95% rename from 0129-Add-friendly-grub2-password-config-tool-985962.patch rename to 0218-Add-friendly-grub2-password-config-tool-985962.patch index fa1b9bbb..356dafa1 100644 --- a/0129-Add-friendly-grub2-password-config-tool-985962.patch +++ b/0218-Add-friendly-grub2-password-config-tool-985962.patch @@ -1,4 +1,4 @@ -From 68f21f5ebebc23a6d8512631f2a1d474afcccd43 Mon Sep 17 00:00:00 2001 +From 8c21b0b89abcfc387ca1b17a43e1d27cd5dddf37 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 25 Jun 2015 11:13:11 -0400 Subject: [PATCH] Add friendly grub2 password config tool (#985962) @@ -22,7 +22,7 @@ Resolves: rhbz#985962 create mode 100644 util/grub.d/01_users.in diff --git a/configure.ac b/configure.ac -index 49427cbf989..1960840048f 100644 +index 056df1cbaf9..679f634ce4c 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -34,10 +34,10 @@ index 49427cbf989..1960840048f 100644 grub_TRANSFORM([grub-script-check]) grub_TRANSFORM([grub-set-default]) diff --git a/Makefile.util.def b/Makefile.util.def -index d846b81b5f9..226c46b2d79 100644 +index 406d96861b6..fd91045bd6d 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -439,6 +439,12 @@ script = { +@@ -440,6 +440,12 @@ script = { installdir = grubconf; }; @@ -50,7 +50,7 @@ index d846b81b5f9..226c46b2d79 100644 script = { name = '10_windows'; common = util/grub.d/10_windows.in; -@@ -721,6 +727,13 @@ script = { +@@ -722,6 +728,13 @@ script = { installdir = sbin; }; @@ -78,10 +78,10 @@ index 1c85371298c..387e3554cd5 100644 /grub*-shell-tester /grub*-sparc64-setup diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 9d595ac058a..fb8724708b5 100644 +index f68d4925ee6..bdb9982aefb 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -263,6 +263,8 @@ for i in "${grub_mkconfig_dir}"/* ; do +@@ -282,6 +282,8 @@ for i in "${grub_mkconfig_dir}"/* ; do *~) ;; # emacsen autosave files. FIXME: support other editors */\#*\#) ;; diff --git a/0130-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0219-Make-grub2-mkconfig-construct-titles-that-look-like-.patch similarity index 90% rename from 0130-Make-grub2-mkconfig-construct-titles-that-look-like-.patch rename to 0219-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index c1e2bbcc..33453747 100644 --- a/0130-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0219-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,8 +1,8 @@ -From 7a7644507e4d953ea8f8d1d7133622a72a2168f5 Mon Sep 17 00:00:00 2001 +From 7108f48dcff0484d3b54e2a8ac971f45fdbc02ab Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH] Make grub2-mkconfig construct titles that look like - the ones we want elsewhere. +Subject: [PATCH] Make grub2-mkconfig construct titles that look like the ones + we want elsewhere. Resolves: rhbz#1215839 @@ -12,10 +12,10 @@ Signed-off-by: Peter Jones 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 1215241859b..584ad1f4639 100644 +index a05be9d3047..4ad98fbd767 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -70,11 +70,28 @@ esac +@@ -80,11 +80,28 @@ esac mktitle () { @@ -48,7 +48,7 @@ index 1215241859b..584ad1f4639 100644 } title_correction_code= -@@ -105,12 +122,7 @@ linux_entry () +@@ -114,12 +131,7 @@ linux_entry () boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi if [ x$type != xsimple ] ; then diff --git a/0131-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch b/0220-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch similarity index 86% rename from 0131-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch rename to 0220-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch index 854db64e..4cf704e9 100644 --- a/0131-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch +++ b/0220-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch @@ -1,8 +1,7 @@ -From 6f892038567f1706fdde819f5f226ec4cacbea47 Mon Sep 17 00:00:00 2001 +From 86e21b75aee82e1cec2087e1d1754677b251d1ce Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Aug 2015 11:46:42 -0400 -Subject: [PATCH] Try to make sure configure.ac and grub-rpm-sort play - nice. +Subject: [PATCH] Try to make sure configure.ac and grub-rpm-sort play nice. Apparently the test for whether to use grub-rpm-sort and also the renaming of it to grub2-rpm-sort on the runtime side weren't right. @@ -16,10 +15,10 @@ Signed-off-by: Peter Jones 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index 1960840048f..3c4b9a19b10 100644 +index 679f634ce4c..71d1056969e 100644 --- a/configure.ac +++ b/configure.ac -@@ -1795,7 +1795,7 @@ AC_SUBST([LIBDEVMAPPER]) +@@ -1796,7 +1796,7 @@ AC_SUBST([LIBDEVMAPPER]) AC_ARG_ENABLE([rpm-sort], [AS_HELP_STRING([--enable-rpm-sort], [enable native rpm sorting of kernels in grub (default=guessed)])]) @@ -29,7 +28,7 @@ index 1960840048f..3c4b9a19b10 100644 fi diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 954844d2d95..9c410eae493 100644 +index 7fe3598435c..113a41f9409 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -33,6 +33,9 @@ fi @@ -42,7 +41,7 @@ index 954844d2d95..9c410eae493 100644 if which gettext >/dev/null 2>/dev/null; then : -@@ -213,10 +216,10 @@ version_sort () +@@ -214,10 +217,10 @@ version_sort () esac } diff --git a/0132-tcp-add-window-scaling-support.patch b/0221-tcp-add-window-scaling-support.patch similarity index 97% rename from 0132-tcp-add-window-scaling-support.patch rename to 0221-tcp-add-window-scaling-support.patch index f451a67f..70fe9896 100644 --- a/0132-tcp-add-window-scaling-support.patch +++ b/0221-tcp-add-window-scaling-support.patch @@ -1,4 +1,4 @@ -From 71e31c279c07f9f51f2a482b70b40b7deed69a69 Mon Sep 17 00:00:00 2001 +From cb04e63baac6392b1c08c58305981d6cf59df988 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:57:55 -0700 Subject: [PATCH] tcp: add window scaling support diff --git a/0133-efinet-retransmit-if-our-device-is-busy.patch b/0222-efinet-retransmit-if-our-device-is-busy.patch similarity index 96% rename from 0133-efinet-retransmit-if-our-device-is-busy.patch rename to 0222-efinet-retransmit-if-our-device-is-busy.patch index da3b336a..fe1357d4 100644 --- a/0133-efinet-retransmit-if-our-device-is-busy.patch +++ b/0222-efinet-retransmit-if-our-device-is-busy.patch @@ -1,4 +1,4 @@ -From d09f32622f6fc247dd88f731c34be10395785d8d Mon Sep 17 00:00:00 2001 +From 5b575d6339e07e0992256b4a899bd886d2db2275 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 31 Aug 2015 13:34:35 -0400 Subject: [PATCH] efinet: retransmit if our device is busy diff --git a/0134-Be-more-aggro-about-actually-using-the-configured-ne.patch b/0223-Be-more-aggro-about-actually-using-the-configured-ne.patch similarity index 98% rename from 0134-Be-more-aggro-about-actually-using-the-configured-ne.patch rename to 0223-Be-more-aggro-about-actually-using-the-configured-ne.patch index 497fef7c..b6866e4f 100644 --- a/0134-Be-more-aggro-about-actually-using-the-configured-ne.patch +++ b/0223-Be-more-aggro-about-actually-using-the-configured-ne.patch @@ -1,8 +1,8 @@ -From 8ece44c2c8f88f531ac9a679f65a263e7b6d2dba Mon Sep 17 00:00:00 2001 +From e3859e9688f5dfed44386a5a852e4b24515be162 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 11 Sep 2015 17:30:49 -0400 -Subject: [PATCH] Be more aggro about actually using the *configured* - network device. +Subject: [PATCH] Be more aggro about actually using the *configured* network + device. Right now we use any SNP device with the same mac+IP block, but when it's discovered there will be more than one of them. We need to pick diff --git a/0135-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch b/0224-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch similarity index 96% rename from 0135-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch rename to 0224-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch index 2880a6a4..b2f3649e 100644 --- a/0135-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +++ b/0224-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch @@ -1,8 +1,7 @@ -From 82b9fdcbbc339c36842c625203fc2b1f22a86c9e Mon Sep 17 00:00:00 2001 +From 54766c756f1fbc941c25bda607810e11a675ba10 Mon Sep 17 00:00:00 2001 From: RHEL Ninjas Date: Fri, 25 Sep 2015 16:24:23 +0900 -Subject: [PATCH] efinet: add filter for the first exclusive reopen of - SNP +Subject: [PATCH] efinet: add filter for the first exclusive reopen of SNP --- grub-core/net/drivers/efi/efinet.c | 39 ++++++++++++++++++++++++++++++++++++++ diff --git a/0136-Fix-security-issue-when-reading-username-and-passwor.patch b/0225-Fix-security-issue-when-reading-username-and-passwor.patch similarity index 95% rename from 0136-Fix-security-issue-when-reading-username-and-passwor.patch rename to 0225-Fix-security-issue-when-reading-username-and-passwor.patch index f66528e5..589fc1ef 100644 --- a/0136-Fix-security-issue-when-reading-username-and-passwor.patch +++ b/0225-Fix-security-issue-when-reading-username-and-passwor.patch @@ -1,4 +1,4 @@ -From 9961e63642244617b697d93bbc49379e23b6839d Mon Sep 17 00:00:00 2001 +From 82bcdf5e9d9df6772e86ee59a54d735e21cec5a3 Mon Sep 17 00:00:00 2001 From: Hector Marco-Gisbert Date: Fri, 13 Nov 2015 16:21:09 +0100 Subject: [PATCH] Fix security issue when reading username and password diff --git a/0137-Warn-if-grub-password-will-not-be-read-1290803.patch b/0226-Warn-if-grub-password-will-not-be-read-1290803.patch similarity index 94% rename from 0137-Warn-if-grub-password-will-not-be-read-1290803.patch rename to 0226-Warn-if-grub-password-will-not-be-read-1290803.patch index 6c0a3f12..35d9ec54 100644 --- a/0137-Warn-if-grub-password-will-not-be-read-1290803.patch +++ b/0226-Warn-if-grub-password-will-not-be-read-1290803.patch @@ -1,4 +1,4 @@ -From 056a956aea898f9d3ee34ecad9660addc3f3108c Mon Sep 17 00:00:00 2001 +From 98caec0ccb7a73cf2ef18addaca7aebdb867dd2b Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 22 Feb 2016 15:30:05 -0500 Subject: [PATCH] Warn if grub password will not be read (#1290803) diff --git a/0138-Clean-up-grub-setpassword-documentation-1290799.patch b/0227-Clean-up-grub-setpassword-documentation-1290799.patch similarity index 96% rename from 0138-Clean-up-grub-setpassword-documentation-1290799.patch rename to 0227-Clean-up-grub-setpassword-documentation-1290799.patch index 7d2b8504..7536d407 100644 --- a/0138-Clean-up-grub-setpassword-documentation-1290799.patch +++ b/0227-Clean-up-grub-setpassword-documentation-1290799.patch @@ -1,4 +1,4 @@ -From 92af2b24adb7371d8234c0b32ae716adf0b80d42 Mon Sep 17 00:00:00 2001 +From d4e71055c42f37ca07b8a4cc98554d486d456b1a Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Tue, 26 Jan 2016 10:28:35 -0500 Subject: [PATCH] Clean up grub-setpassword documentation (#1290799) diff --git a/0139-Fix-locale-issue-in-grub-setpassword-1294243.patch b/0228-Fix-locale-issue-in-grub-setpassword-1294243.patch similarity index 93% rename from 0139-Fix-locale-issue-in-grub-setpassword-1294243.patch rename to 0228-Fix-locale-issue-in-grub-setpassword-1294243.patch index 1630d5c7..dd3eba65 100644 --- a/0139-Fix-locale-issue-in-grub-setpassword-1294243.patch +++ b/0228-Fix-locale-issue-in-grub-setpassword-1294243.patch @@ -1,4 +1,4 @@ -From 373adc50cf9f09015e40ffd1bf79ab9f291f4fc2 Mon Sep 17 00:00:00 2001 +From a53f966dc5c80272afde738d21032c325e259700 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Fri, 29 Jan 2016 16:56:11 -0500 Subject: [PATCH] Fix locale issue in grub-setpassword (#1294243) diff --git a/0140-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch b/0229-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch similarity index 91% rename from 0140-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch rename to 0229-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch index c3c876ac..1a8570c9 100644 --- a/0140-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch +++ b/0229-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch @@ -1,8 +1,8 @@ -From eab0520310030376f6295e0338e874bce10b0d5f Mon Sep 17 00:00:00 2001 +From ca812d9d37de5214c2e0153f761bed6b1a504ccd Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Fri, 22 Jan 2016 13:32:30 +0100 -Subject: [PATCH] efiemu: Handle persistent RAM and unknown possible - future additions. +Subject: [PATCH] efiemu: Handle persistent RAM and unknown possible future + additions. (cherry picked from commit ae3b83a4d4df75a01198a2fed7542391e7c449e0) diff --git a/0141-efiemu-Fix-compilation-failure.patch b/0230-efiemu-Fix-compilation-failure.patch similarity index 93% rename from 0141-efiemu-Fix-compilation-failure.patch rename to 0230-efiemu-Fix-compilation-failure.patch index 1e084410..fcc3e593 100644 --- a/0141-efiemu-Fix-compilation-failure.patch +++ b/0230-efiemu-Fix-compilation-failure.patch @@ -1,4 +1,4 @@ -From 68bdf29eb6e376a3b4a817bbe7481efd12b8f9de Mon Sep 17 00:00:00 2001 +From f0076955c970c2ec3a1af80cb7ce79ed34627368 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 14:10:30 +0100 Subject: [PATCH] efiemu: Fix compilation failure diff --git a/0142-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0231-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch similarity index 97% rename from 0142-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch rename to 0231-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index c376bd67..40676873 100644 --- a/0142-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0231-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,8 +1,7 @@ -From df19c5ff9c9e716df0383e39992466304053c99d Mon Sep 17 00:00:00 2001 +From f59970dae17765dd3f2e510284bb960e1c124808 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 7 Apr 2016 10:58:06 -0400 -Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by - grub" +Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by grub" I *think* this should have been replaced by upstream's 49426e9fd2e562c73a4f1206f32eff9e424a1a73, so I'm reverting for now. diff --git a/0143-Add-a-url-parser.patch b/0232-Add-a-url-parser.patch similarity index 99% rename from 0143-Add-a-url-parser.patch rename to 0232-Add-a-url-parser.patch index 56cae880..ba40ed64 100644 --- a/0143-Add-a-url-parser.patch +++ b/0232-Add-a-url-parser.patch @@ -1,4 +1,4 @@ -From 2f84b2e097ad9f6f7f06013f749251743eb32c2e Mon Sep 17 00:00:00 2001 +From 375387fa8910eebc484d8cd2ba16a5bae577aeb9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 16:18:44 -0400 Subject: [PATCH] Add a url parser. @@ -20,10 +20,10 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/net/url.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 5ae70204cd2..4857a1e5f61 100644 +index e675ab2da01..338244f6b47 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2199,6 +2199,7 @@ module = { +@@ -2194,6 +2194,7 @@ module = { common = net/ethernet.c; common = net/arp.c; common = net/netbuff.c; @@ -923,7 +923,7 @@ index 00000000000..146858284cd +} +#endif diff --git a/include/grub/misc.h b/include/grub/misc.h -index 06208143779..4737da1eaa9 100644 +index 83fd69f4ada..fcaf1201e39 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -85,6 +85,7 @@ int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); diff --git a/0144-efinet-and-bootp-add-support-for-dhcpv6.patch b/0233-efinet-and-bootp-add-support-for-dhcpv6.patch similarity index 99% rename from 0144-efinet-and-bootp-add-support-for-dhcpv6.patch rename to 0233-efinet-and-bootp-add-support-for-dhcpv6.patch index bc4eda5e..ff61572d 100644 --- a/0144-efinet-and-bootp-add-support-for-dhcpv6.patch +++ b/0233-efinet-and-bootp-add-support-for-dhcpv6.patch @@ -1,4 +1,4 @@ -From 48768b0295ad4d908cefd8e8fbee96a4dc2765f5 Mon Sep 17 00:00:00 2001 +From 1baa48c5cbeaccbeb09ab3289746996e0e4a2da3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 8 Jun 2016 21:03:37 -0400 Subject: [PATCH] efinet and bootp: add support for dhcpv6 diff --git a/0145-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch b/0234-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch similarity index 93% rename from 0145-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch rename to 0234-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch index e0f479bd..07588d00 100644 --- a/0145-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +++ b/0234-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch @@ -1,4 +1,4 @@ -From 764506b89942103c3a511d7933edef351fb594b8 Mon Sep 17 00:00:00 2001 +From b719c9816d5a234658da3c54218e8a30c73afeb3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 23 Jun 2016 11:01:39 -0400 Subject: [PATCH] Add grub-get-kernel-settings and use it in 10_linux @@ -24,7 +24,7 @@ Resolves: rhbz#1226325 create mode 100644 util/grub-get-kernel-settings.in diff --git a/configure.ac b/configure.ac -index 3c4b9a19b10..40be70019e2 100644 +index 71d1056969e..aa06ed59c8d 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ grub_TRANSFORM([grub-install]) @@ -44,10 +44,10 @@ index 3c4b9a19b10..40be70019e2 100644 grub_TRANSFORM([grub-install.1]) grub_TRANSFORM([grub-kbdcomp.3]) diff --git a/Makefile.util.def b/Makefile.util.def -index 226c46b2d79..ed27351eb47 100644 +index fd91045bd6d..2d032643de7 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -713,6 +713,13 @@ script = { +@@ -714,6 +714,13 @@ script = { installdir = sbin; }; @@ -218,7 +218,7 @@ index 00000000000..12046219878 + echo export GRUB_LINUX_DEBUG_TITLE_POSTFIX +fi diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index fb8724708b5..e32de5ef361 100644 +index bdb9982aefb..8218f3d477f 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -45,6 +45,7 @@ grub_probe="${sbindir}/@grub_probe@" @@ -229,20 +229,20 @@ index fb8724708b5..e32de5ef361 100644 export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -@@ -151,6 +152,8 @@ if test -f ${sysconfdir}/default/grub ; then +@@ -158,6 +159,8 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi +eval "$("${grub_get_kernel_settings}")" || true + - if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then - GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" - fi + if [ "x$GRUB_DISABLE_UUID" != "xtrue" ]; then + if [ -z "$GRUB_DEVICE_UUID" ]; then + GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 584ad1f4639..c9bf223f273 100644 +index 4ad98fbd767..24a10f95d2c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -101,7 +101,8 @@ linux_entry () +@@ -111,7 +111,8 @@ linux_entry () os="$1" version="$2" type="$3" @@ -250,9 +250,9 @@ index 584ad1f4639..c9bf223f273 100644 + isdebug="$4" + args="$5" - sixteenbit="" - linuxefi="linux" -@@ -128,6 +129,9 @@ linux_entry () + linuxcmd=linux + initrdcmd=initrd +@@ -137,6 +138,9 @@ linux_entry () quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" fi @@ -262,7 +262,7 @@ index 584ad1f4639..c9bf223f273 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/" -@@ -285,11 +289,15 @@ while [ "x$list" != "x" ] ; do +@@ -311,11 +315,15 @@ while [ "x$list" != "x" ] ; do fi if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then @@ -280,7 +280,7 @@ index 584ad1f4639..c9bf223f273 100644 if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi -@@ -298,10 +306,15 @@ while [ "x$list" != "x" ] ; do +@@ -324,10 +332,15 @@ while [ "x$list" != "x" ] ; do is_top_level=false fi diff --git a/0146-Normalize-slashes-in-tftp-paths.patch b/0235-Normalize-slashes-in-tftp-paths.patch similarity index 96% rename from 0146-Normalize-slashes-in-tftp-paths.patch rename to 0235-Normalize-slashes-in-tftp-paths.patch index 1e3261b4..acb43fb5 100644 --- a/0146-Normalize-slashes-in-tftp-paths.patch +++ b/0235-Normalize-slashes-in-tftp-paths.patch @@ -1,4 +1,4 @@ -From 406402dfaecc62ede346793c9c7a0568dc71c131 Mon Sep 17 00:00:00 2001 +From e0d64d3dfcb4f8c8930c59aafad4accae30e6ef4 Mon Sep 17 00:00:00 2001 From: Lenny Szubowicz Date: Mon, 29 Aug 2016 11:04:48 -0400 Subject: [PATCH] Normalize slashes in tftp paths. diff --git a/0147-Fix-malformed-tftp-packets.patch b/0236-Fix-malformed-tftp-packets.patch similarity index 95% rename from 0147-Fix-malformed-tftp-packets.patch rename to 0236-Fix-malformed-tftp-packets.patch index e676a352..c3e09aa1 100644 --- a/0147-Fix-malformed-tftp-packets.patch +++ b/0236-Fix-malformed-tftp-packets.patch @@ -1,4 +1,4 @@ -From 7d05a8298e6a54bfae0038841462443f21da3535 Mon Sep 17 00:00:00 2001 +From 3b5388e0ac31e508c241ee9cec433a4bc318caa6 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Tue, 7 Mar 2017 18:26:17 -0500 Subject: [PATCH] Fix malformed tftp packets diff --git a/0148-Fix-race-in-EFI-validation.patch b/0237-Fix-race-in-EFI-validation.patch similarity index 97% rename from 0148-Fix-race-in-EFI-validation.patch rename to 0237-Fix-race-in-EFI-validation.patch index a7f5bdce..3c89dd21 100644 --- a/0148-Fix-race-in-EFI-validation.patch +++ b/0237-Fix-race-in-EFI-validation.patch @@ -1,4 +1,4 @@ -From bf59d76ca82eb4eaa20a747f5890d09632ba93d0 Mon Sep 17 00:00:00 2001 +From fa385eaa299d1af4a5501cab638e568a1c67b884 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 14 Jul 2015 16:58:51 -0700 Subject: [PATCH] Fix race in EFI validation diff --git a/0149-bz1374141-fix-incorrect-mask-for-ppc64.patch b/0238-bz1374141-fix-incorrect-mask-for-ppc64.patch similarity index 97% rename from 0149-bz1374141-fix-incorrect-mask-for-ppc64.patch rename to 0238-bz1374141-fix-incorrect-mask-for-ppc64.patch index 742d9472..d09eaaac 100644 --- a/0149-bz1374141-fix-incorrect-mask-for-ppc64.patch +++ b/0238-bz1374141-fix-incorrect-mask-for-ppc64.patch @@ -1,4 +1,4 @@ -From 84a5f535949f590a8976c64c3d1fde08fe0f7464 Mon Sep 17 00:00:00 2001 +From 7412918d8716fc10e8ba64aa2c97f3e09a9f4569 Mon Sep 17 00:00:00 2001 From: Masahiro Matsuya Date: Sat, 29 Oct 2016 08:35:26 +0900 Subject: [PATCH] bz1374141 fix incorrect mask for ppc64 diff --git a/0150-Use-device-part-of-chainloader-target-if-present.patch b/0239-Use-device-part-of-chainloader-target-if-present.patch similarity index 94% rename from 0150-Use-device-part-of-chainloader-target-if-present.patch rename to 0239-Use-device-part-of-chainloader-target-if-present.patch index 17cd3a46..30d05dbe 100644 --- a/0150-Use-device-part-of-chainloader-target-if-present.patch +++ b/0239-Use-device-part-of-chainloader-target-if-present.patch @@ -1,4 +1,4 @@ -From d426e20f8b41ebf114075dc4ffbcaf438ceb4b95 Mon Sep 17 00:00:00 2001 +From b7e9a84485658b29a2e0fff5150ebfacdfa9a1b6 Mon Sep 17 00:00:00 2001 From: Raymund Will Date: Fri, 10 Apr 2015 01:45:02 -0400 Subject: [PATCH] Use device part of chainloader target, if present. diff --git a/0151-Add-secureboot-support-on-efi-chainloader.patch b/0240-Add-secureboot-support-on-efi-chainloader.patch similarity index 99% rename from 0151-Add-secureboot-support-on-efi-chainloader.patch rename to 0240-Add-secureboot-support-on-efi-chainloader.patch index 99d70201..734569b4 100644 --- a/0151-Add-secureboot-support-on-efi-chainloader.patch +++ b/0240-Add-secureboot-support-on-efi-chainloader.patch @@ -1,4 +1,4 @@ -From bbf98517303e438cea398bb74306b6553c880ac3 Mon Sep 17 00:00:00 2001 +From c61b0b1d2351a514b8741b188eae009e93c705f9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 13:04:37 -0400 Subject: [PATCH] Add secureboot support on efi chainloader diff --git a/0152-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch b/0241-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch similarity index 96% rename from 0152-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch rename to 0241-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch index 05c5db43..87187a8b 100644 --- a/0152-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch +++ b/0241-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch @@ -1,8 +1,8 @@ -From 25ea5be888dcc92cd0b3cb7d34b381f5005f1e30 Mon Sep 17 00:00:00 2001 +From 0ef9d4fbab2b9f206ff911f005c2d2dc14e965cc Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 16:09:25 -0400 -Subject: [PATCH] Make any of the loaders that link in efi mode honor - secure boot. +Subject: [PATCH] Make any of the loaders that link in efi mode honor secure + boot. And in this case "honor" means "even if somebody does link this in, they won't register commands if SB is enabled." @@ -37,7 +37,7 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/sparc64/linux.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 4857a1e5f61..75a7ab3441d 100644 +index 338244f6b47..423def037c2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -196,6 +196,7 @@ kernel = { @@ -113,10 +113,10 @@ index 98769eadb34..088cbe9e2bc 100644 grub_unregister_extcmd (cmd_read_word); grub_unregister_extcmd (cmd_read_dword); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 2588b481e76..684ca93f8f4 100644 +index 92e1583b37d..e339f264b3a 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -269,34 +269,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, +@@ -278,34 +278,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, return NULL; } @@ -291,7 +291,7 @@ index 7f96515da65..87709aa23e8 100644 grub_unregister_extcmd (cmd_openbsd); grub_unregister_extcmd (cmd_netbsd); diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 083f9417cb6..b2438547dd0 100644 +index 44301e12659..930a90b1f32 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -35,6 +35,7 @@ @@ -323,7 +323,7 @@ index 083f9417cb6..b2438547dd0 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index a293b17aa10..91283157e30 100644 +index b69cb7a3a7f..ebe7630210b 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -35,6 +35,7 @@ @@ -355,10 +355,10 @@ index a293b17aa10..91283157e30 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index bd9d5b3e698..fb044a60c79 100644 +index 40c67e82489..26df46a4161 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c -@@ -42,6 +42,7 @@ +@@ -50,6 +50,7 @@ #include #include #include @@ -366,7 +366,7 @@ index bd9d5b3e698..fb044a60c79 100644 GRUB_MOD_LICENSE ("GPLv3+"); -@@ -431,6 +432,9 @@ static grub_command_t cmd_multiboot, cmd_module; +@@ -446,6 +447,9 @@ static grub_command_t cmd_multiboot, cmd_module; GRUB_MOD_INIT(multiboot) { @@ -376,7 +376,7 @@ index bd9d5b3e698..fb044a60c79 100644 cmd_multiboot = #ifdef GRUB_USE_MULTIBOOT2 grub_register_command ("multiboot2", grub_cmd_multiboot, -@@ -451,6 +455,9 @@ GRUB_MOD_INIT(multiboot) +@@ -466,6 +470,9 @@ GRUB_MOD_INIT(multiboot) GRUB_MOD_FINI(multiboot) { @@ -419,10 +419,10 @@ index c9885b1bcd7..df8dfdb4ba0 100644 grub_unregister_command (cmd_resume); #endif diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index bb3ab7dfdeb..91e29ce66f1 100644 +index f68a19de442..3efbafbb418 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h -@@ -83,7 +83,6 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, +@@ -84,7 +84,6 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, const grub_efi_guid_t *guid, void *data, grub_size_t datasize); diff --git a/0153-Make-grub_fatal-also-backtrace.patch b/0242-Make-grub_fatal-also-backtrace.patch similarity index 97% rename from 0153-Make-grub_fatal-also-backtrace.patch rename to 0242-Make-grub_fatal-also-backtrace.patch index cc29cab6..d2c18d6c 100644 --- a/0153-Make-grub_fatal-also-backtrace.patch +++ b/0242-Make-grub_fatal-also-backtrace.patch @@ -1,4 +1,4 @@ -From eb1a27144476324a22561383a0a2e61aa327d2f5 Mon Sep 17 00:00:00 2001 +From 7da9800b2d6ba57d8760da74c500341b6639a85c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 27 Jan 2016 09:22:42 -0500 Subject: [PATCH] Make grub_fatal() also backtrace. @@ -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 75a7ab3441d..3a5d450f3d0 100644 +index 423def037c2..edf249f0002 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -175,6 +175,9 @@ kernel = { diff --git a/0154-Rework-linux-command.patch b/0243-Rework-linux-command.patch similarity index 96% rename from 0154-Rework-linux-command.patch rename to 0243-Rework-linux-command.patch index 35f5e071..fc768753 100644 --- a/0154-Rework-linux-command.patch +++ b/0243-Rework-linux-command.patch @@ -1,4 +1,4 @@ -From 12312bfe1727a2992042436cb0f8c8ba1c69ee2f Mon Sep 17 00:00:00 2001 +From 83e67dd340c89f2577f2dc74d6be6ea3f534261f Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:12:39 -0700 Subject: [PATCH] Rework linux command @@ -11,12 +11,12 @@ before pulling out the individual blocks later on. 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index b2438547dd0..e4b8342f5d0 100644 +index 930a90b1f32..626ec9fef0c 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -681,12 +681,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_file_t file = 0; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; grub_uint8_t setup_sects; - grub_size_t real_size, prot_size, prot_file_size; + grub_size_t real_size, prot_size, prot_file_size, kernel_offset; diff --git a/0155-Rework-linux16-command.patch b/0244-Rework-linux16-command.patch similarity index 93% rename from 0155-Rework-linux16-command.patch rename to 0244-Rework-linux16-command.patch index 74d3312e..b7c5331d 100644 --- a/0155-Rework-linux16-command.patch +++ b/0244-Rework-linux16-command.patch @@ -1,4 +1,4 @@ -From 24250bbb84f8817462426c46b255d875de627bf1 Mon Sep 17 00:00:00 2001 +From 57f0882e429bdf60d9383d4edef3f360d5c07a74 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:20:58 -0700 Subject: [PATCH] Rework linux16 command @@ -11,12 +11,12 @@ before pulling out the individual blocks later on. 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 91283157e30..b864e540333 100644 +index ebe7630210b..e2bb1a99a74 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -124,13 +124,14 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_file_t file = 0; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; grub_uint8_t setup_sects; - grub_size_t real_size; + grub_size_t real_size, kernel_offset = 0; @@ -72,7 +72,7 @@ index 91283157e30..b864e540333 100644 + len); + kernel_offset += len; - if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0200) @@ -356,10 +364,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } diff --git a/0156-Make-grub-editenv-build-again.patch b/0245-Make-grub-editenv-build-again.patch similarity index 86% rename from 0156-Make-grub-editenv-build-again.patch rename to 0245-Make-grub-editenv-build-again.patch index cdb8322f..fb195b62 100644 --- a/0156-Make-grub-editenv-build-again.patch +++ b/0245-Make-grub-editenv-build-again.patch @@ -1,4 +1,4 @@ -From ebe69b2682b5b3029d8ea503f12134ee81c4b2ce Mon Sep 17 00:00:00 2001 +From a240dddb6daecc418ac8a7582e5f062ee3b71a3c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Mar 2016 16:29:13 -0500 Subject: [PATCH] Make grub-editenv build again. @@ -13,10 +13,10 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/Makefile.util.def b/Makefile.util.def -index ed27351eb47..38cdf4ccc09 100644 +index 2d032643de7..879e8eb98a4 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -236,6 +236,8 @@ program = { +@@ -237,6 +237,8 @@ program = { extra_dist = grub-core/osdep/unix/compress.c; extra_dist = grub-core/osdep/basic/compress.c; common = util/mkimage.c; diff --git a/0157-Fix-up-some-man-pages-rpmdiff-noticed.patch b/0246-Fix-up-some-man-pages-rpmdiff-noticed.patch similarity index 97% rename from 0157-Fix-up-some-man-pages-rpmdiff-noticed.patch rename to 0246-Fix-up-some-man-pages-rpmdiff-noticed.patch index 5297f3ea..608cd12f 100644 --- a/0157-Fix-up-some-man-pages-rpmdiff-noticed.patch +++ b/0246-Fix-up-some-man-pages-rpmdiff-noticed.patch @@ -1,4 +1,4 @@ -From c71e6152ea8e4e525a853441bb5f08808bae3afd Mon Sep 17 00:00:00 2001 +From cbdcd2a8963c0609ed4ba70ee25b30bb0acab163 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. @@ -13,7 +13,7 @@ Subject: [PATCH] Fix up some man pages rpmdiff noticed. create mode 100644 util/grub-syslinux2cfg.1 diff --git a/configure.ac b/configure.ac -index 40be70019e2..ae371a97d30 100644 +index aa06ed59c8d..f69f8986791 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ grub_TRANSFORM([grub-get-kernel-settings.3]) diff --git a/0158-Re-work-some-intricacies-of-PE-loading.patch b/0247-Re-work-some-intricacies-of-PE-loading.patch similarity index 99% rename from 0158-Re-work-some-intricacies-of-PE-loading.patch rename to 0247-Re-work-some-intricacies-of-PE-loading.patch index 96d8b35b..6b00c9cb 100644 --- a/0158-Re-work-some-intricacies-of-PE-loading.patch +++ b/0247-Re-work-some-intricacies-of-PE-loading.patch @@ -1,4 +1,4 @@ -From 145214ee7c411c7d600016f011dc11b213bce0b2 Mon Sep 17 00:00:00 2001 +From 8e8ee42a6d1d384c47c72fe430c7347e5ef587df Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jun 2016 12:22:29 -0400 Subject: [PATCH] Re-work some intricacies of PE loading. diff --git a/0159-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch b/0248-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch similarity index 97% rename from 0159-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch rename to 0248-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch index 26b55ee8..aca186d6 100644 --- a/0159-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch +++ b/0248-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch @@ -1,8 +1,7 @@ -From ef24bc601e11b96eefe06f477b5da1199d761b3d Mon Sep 17 00:00:00 2001 +From b4f97fae3f20b5ba3675a063196db399d14894b2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 10 Jun 2016 14:06:15 -0400 -Subject: [PATCH] Rework even more of efi chainload so non-sb cases - work right. +Subject: [PATCH] Rework even more of efi chainload so non-sb cases work right. This ensures that if shim protocol is not loaded, or is loaded but shim is disabled, we will fall back to a correct load method for the efi @@ -80,18 +79,18 @@ index a41b6c5b851..d74778b0cac 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 33345d37534..ad39a301527 100644 +index ab0d27ee4df..fcab2ed37e7 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -247,6 +247,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -248,6 +248,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_file_t file = 0; - struct grub_arm64_linux_kernel_header lh; + struct linux_arm64_kernel_header lh; struct grub_arm64_linux_pe_header *pe; + int rc; grub_dl_ref (my_mod); -@@ -291,7 +292,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -292,7 +293,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); diff --git a/0160-linuxefi-fix-double-free-on-verification-failure.patch b/0249-linuxefi-fix-double-free-on-verification-failure.patch similarity index 91% rename from 0160-linuxefi-fix-double-free-on-verification-failure.patch rename to 0249-linuxefi-fix-double-free-on-verification-failure.patch index f81ac00c..967e3d20 100644 --- a/0160-linuxefi-fix-double-free-on-verification-failure.patch +++ b/0249-linuxefi-fix-double-free-on-verification-failure.patch @@ -1,4 +1,4 @@ -From 5ef3f00e6be3033092453a66f456b8dac8cd4f7c Mon Sep 17 00:00:00 2001 +From 951d4021795726813d90eaf378078d1b73e40ff0 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 09:50:25 -0400 Subject: [PATCH] linuxefi: fix double free on verification failure. diff --git a/0249-linuxefi-honor-the-linux-and-initrd-names-of-command.patch b/0249-linuxefi-honor-the-linux-and-initrd-names-of-command.patch deleted file mode 100644 index 3d7b22a6..00000000 --- a/0249-linuxefi-honor-the-linux-and-initrd-names-of-command.patch +++ /dev/null @@ -1,95 +0,0 @@ -From d621b18f82c4fe2a903432c3fb811fb9281b0273 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Fri, 11 May 2018 10:58:34 -0400 -Subject: [PATCH] linuxefi: honor the "linux" and "initrd" names of - commands. - -Signed-off-by: Peter Jones ---- - grub-core/commands/blscfg.c | 14 +++----------- - grub-core/loader/i386/efi/linux.c | 14 +++++++++++--- - 2 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c -index 72ee497ea2d..f1f18fefbf2 100644 ---- a/grub-core/commands/blscfg.c -+++ b/grub-core/commands/blscfg.c -@@ -43,14 +43,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); - #define GRUB_BOOT_DEVICE "($root)" - #endif - --#ifdef GRUB_MACHINE_EFI --#define GRUB_LINUX_CMD "linuxefi" --#define GRUB_INITRD_CMD "initrdefi" --#else --#define GRUB_LINUX_CMD "linux" --#define GRUB_INITRD_CMD "initrd" --#endif -- - enum - { - PLATFORM_EFI, -@@ -631,7 +623,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) - grub_dprintf ("blscfg", "adding menu entry for \"%s\"\n", title); - if (initrds) - { -- int initrd_size = sizeof (GRUB_INITRD_CMD); -+ int initrd_size = sizeof ("linux"); - char *tmp; - - for (i = 0; initrds != NULL && initrds[i] != NULL; i++) -@@ -647,7 +639,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) - } - - -- tmp = grub_stpcpy(initrd, GRUB_INITRD_CMD); -+ tmp = grub_stpcpy(initrd, "linux"); - for (i = 0; initrds != NULL && initrds[i] != NULL; i++) - { - grub_dprintf ("blscfg", "adding initrd %s\n", initrds[i]); -@@ -660,7 +652,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) - src = grub_xasprintf ("load_video\n" - "set gfx_payload=keep\n" - "insmod gzio\n" -- GRUB_LINUX_CMD " %s%s%s%s\n" -+ "linux %s%s%s%s\n" - "%s", - GRUB_BOOT_DEVICE, clinux, options ? " " : "", options ? options : "", - initrd ? initrd : ""); -diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 6c9268f2ff5..2cdfa8f671c 100644 ---- a/grub-core/loader/i386/efi/linux.c -+++ b/grub-core/loader/i386/efi/linux.c -@@ -365,16 +365,22 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - return grub_errno; - } - --static grub_command_t cmd_linux, cmd_initrd; -+static grub_command_t cmd_linux, cmd_initrd, cmd_linuxefi, cmd_initrdefi; - - GRUB_MOD_INIT(linuxefi) - { -- cmd_linux = -+ cmd_linuxefi = - grub_register_command ("linuxefi", grub_cmd_linux, - 0, N_("Load Linux.")); -- cmd_initrd = -+ cmd_initrdefi = - grub_register_command ("initrdefi", grub_cmd_initrd, - 0, N_("Load initrd.")); -+ 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; - } - -@@ -382,4 +388,6 @@ GRUB_MOD_FINI(linuxefi) - { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); -+ grub_unregister_command (cmd_linuxefi); -+ grub_unregister_command (cmd_initrdefi); - } diff --git a/0161-fix-machine-type-test-in-30_os-prober.in.patch b/0250-fix-machine-type-test-in-30_os-prober.in.patch similarity index 90% rename from 0161-fix-machine-type-test-in-30_os-prober.in.patch rename to 0250-fix-machine-type-test-in-30_os-prober.in.patch index 7bd4d4ec..ff1967f9 100644 --- a/0161-fix-machine-type-test-in-30_os-prober.in.patch +++ b/0250-fix-machine-type-test-in-30_os-prober.in.patch @@ -1,4 +1,4 @@ -From 4139fdfdb64fd248a0d5f200b27c583159dbb190 Mon Sep 17 00:00:00 2001 +From 1318d9c6aca4cf6cccb9388694cb84df5d662c13 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 11 Jul 2016 13:36:45 -0400 Subject: [PATCH] fix machine type test in 30_os-prober.in diff --git a/0162-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch b/0251-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch similarity index 90% rename from 0162-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch rename to 0251-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch index 2e56d974..1b0a57aa 100644 --- a/0162-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch +++ b/0251-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch @@ -1,8 +1,7 @@ -From 671699a76fa6510a62c3a94acd698a31686cb8fa Mon Sep 17 00:00:00 2001 +From c43a523e3b257fbba68d7b67397c7ab64e89dd26 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 21 Nov 2016 15:34:00 +0100 -Subject: [PATCH] efi/chainloader: fix wrong sanity check in - relocate_coff() +Subject: [PATCH] efi/chainloader: fix wrong sanity check in relocate_coff() In relocate_coff(), the relocation entries are parsed from the original image (not the section-wise copied image). The original image is diff --git a/0163-efi-chainloader-truncate-overlong-relocation-section.patch b/0252-efi-chainloader-truncate-overlong-relocation-section.patch similarity index 98% rename from 0163-efi-chainloader-truncate-overlong-relocation-section.patch rename to 0252-efi-chainloader-truncate-overlong-relocation-section.patch index 8daedc6d..027b96bf 100644 --- a/0163-efi-chainloader-truncate-overlong-relocation-section.patch +++ b/0252-efi-chainloader-truncate-overlong-relocation-section.patch @@ -1,4 +1,4 @@ -From d081bd5f47235e3bfd256fd262a6f98fe8b0d0ff Mon Sep 17 00:00:00 2001 +From fb0a57047d243a68f3c604834ba52f20773098e6 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 23 Nov 2016 06:27:09 +0100 Subject: [PATCH] efi/chainloader: truncate overlong relocation section diff --git a/0164-linuxefi-minor-cleanups.patch b/0253-linuxefi-minor-cleanups.patch similarity index 98% rename from 0164-linuxefi-minor-cleanups.patch rename to 0253-linuxefi-minor-cleanups.patch index 4f583dc3..d64b51f4 100644 --- a/0164-linuxefi-minor-cleanups.patch +++ b/0253-linuxefi-minor-cleanups.patch @@ -1,4 +1,4 @@ -From 8dc21ff37f62f3d10fb3d708ffd33b7d723a23cf Mon Sep 17 00:00:00 2001 +From ca4270e242c0c4876e14555e1eee43ab05e19cac Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:31:52 -0500 Subject: [PATCH] linuxefi: minor cleanups diff --git a/0165-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch b/0254-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch similarity index 98% rename from 0165-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch rename to 0254-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch index 283ce124..0504cce4 100644 --- a/0165-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch +++ b/0254-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch @@ -1,4 +1,4 @@ -From 10d6d333de0aa7e390a22ebc4b308f7ad937d5bc Mon Sep 17 00:00:00 2001 +From f11cd1abcb3021759e1a72c17930b313b1f97664 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:18:54 -0500 Subject: [PATCH] Handle multi-arch (64-on-32) boot in linuxefi loader. @@ -254,10 +254,10 @@ index 8b5a817b9d1..bed5919cab3 100644 if (kernel_mem && !loaded) grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem, diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index fc36bdaf367..110ecf806fb 100644 +index 5d8282a7db6..2cfb364b85d 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h -@@ -130,7 +130,12 @@ struct linux_kernel_header +@@ -130,7 +130,12 @@ struct linux_i386_kernel_header grub_uint32_t kernel_alignment; grub_uint8_t relocatable; grub_uint8_t min_alignment; diff --git a/0166-Fix-up-linux-params-usage.patch b/0255-Fix-up-linux-params-usage.patch similarity index 50% rename from 0166-Fix-up-linux-params-usage.patch rename to 0255-Fix-up-linux-params-usage.patch index 229445d7..11838d58 100644 --- a/0166-Fix-up-linux-params-usage.patch +++ b/0255-Fix-up-linux-params-usage.patch @@ -1,21 +1,44 @@ -From 93be95c27b0ddb63c2e3a287a3ed92c0a5de93e5 Mon Sep 17 00:00:00 2001 +From 0bcd68876e531078880a7a4ddd15474f1ca81b68 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 May 2017 14:16:07 -0400 Subject: [PATCH] Fix up linux params usage... Signed-off-by: Peter Jones --- - grub-core/loader/i386/linux.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + grub-core/loader/i386/efi/linux.c | 4 ++-- + grub-core/loader/i386/linux.c | 5 ++++- + 2 files changed, 6 insertions(+), 3 deletions(-) +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +index bed5919cab3..6ff796f56ff 100644 +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -161,7 +161,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { + grub_file_t file = 0; +- struct linux_kernel_header *lh; ++ struct linux_i386_kernel_header *lh; + grub_ssize_t len, start, filelen; + void *kernel = NULL; + int setup_header_end_offset; +@@ -224,7 +224,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_memcpy ((grub_uint8_t *)params + 0x1f1, + (grub_uint8_t *)kernel + 0x1f1, + MIN(0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1); +- lh = (struct linux_kernel_header *)params; ++ lh = (struct linux_i386_kernel_header *)params; + grub_dprintf ("linuxefi", "lh is at %p\n", lh); + grub_dprintf ("linuxefi", "checking lh->boot_flag\n"); + if (lh->boot_flag != grub_cpu_to_le16 (0xaa55)) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index e4b8342f5d0..c9e89310bdd 100644 +index 626ec9fef0c..35055431247 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), { grub_file_t file = 0; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; + grub_uint8_t *linux_params_ptr; grub_uint8_t setup_sects; grub_size_t real_size, prot_size, prot_file_size, kernel_offset; diff --git a/0167-Make-exit-take-a-return-code.patch b/0256-Make-exit-take-a-return-code.patch similarity index 95% rename from 0167-Make-exit-take-a-return-code.patch rename to 0256-Make-exit-take-a-return-code.patch index 51687cad..fb41adee 100644 --- a/0167-Make-exit-take-a-return-code.patch +++ b/0256-Make-exit-take-a-return-code.patch @@ -1,4 +1,4 @@ -From 6b67d46c1764c86611939dc01267f9c70f413184 Mon Sep 17 00:00:00 2001 +From e83ab19f6cce7fba758d1cf447de37248925697a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 26 Feb 2014 21:49:12 -0500 Subject: [PATCH] Make "exit" take a return code. diff --git a/0168-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch b/0257-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch similarity index 83% rename from 0168-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch rename to 0257-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch index fb729661..6c9e5ee7 100644 --- a/0168-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch +++ b/0257-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch @@ -1,8 +1,8 @@ -From e48a4c0b9e475b16366ff6c375de5186432eb1f7 Mon Sep 17 00:00:00 2001 +From 5b96ea4e3ed516424ed82c2950a9d6f29693c66f Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Mon, 17 Apr 2017 08:44:29 -0400 -Subject: [PATCH] arm64: make sure fdt has #address-cells and - #size-cells properties +Subject: [PATCH] arm64: make sure fdt has #address-cells and #size-cells + properties Recent upstream changes to kexec-tools relies on #address-cells and #size-cells properties in the FDT. If grub2 needs to create @@ -14,10 +14,10 @@ make sure they exist. 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index ad39a301527..59ff9cc05b4 100644 +index fcab2ed37e7..84670a053b2 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -79,7 +79,21 @@ finalize_params_linux (void) +@@ -80,7 +80,21 @@ finalize_params_linux (void) node = grub_fdt_find_subnode (fdt, 0, "chosen"); if (node < 0) diff --git a/0169-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch b/0258-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch similarity index 94% rename from 0169-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch rename to 0258-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch index d91b7e48..efb2cc74 100644 --- a/0169-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch +++ b/0258-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch @@ -1,8 +1,7 @@ -From 755fa5ccf0834abdb7e50a1cb06fad618f6c9af6 Mon Sep 17 00:00:00 2001 +From 13a69d9c2a2a474ed8a433820370fa5e6a62e60c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 9 May 2016 14:15:17 -0400 -Subject: [PATCH] Add some grub_dprintf() in the secure boot verify - code. +Subject: [PATCH] Add some grub_dprintf() in the secure boot verify code. Signed-off-by: Peter Jones --- diff --git a/0170-Make-our-info-pages-say-grub2-where-appropriate.patch b/0259-Make-our-info-pages-say-grub2-where-appropriate.patch similarity index 91% rename from 0170-Make-our-info-pages-say-grub2-where-appropriate.patch rename to 0259-Make-our-info-pages-say-grub2-where-appropriate.patch index a1dc75db..d4ada317 100644 --- a/0170-Make-our-info-pages-say-grub2-where-appropriate.patch +++ b/0259-Make-our-info-pages-say-grub2-where-appropriate.patch @@ -1,4 +1,4 @@ -From 15c340acd845056ba259b9fffd6c7d083874cb82 Mon Sep 17 00:00:00 2001 +From 56598e6a330816e6f1c3867d455ff463f3e24f52 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 6 May 2016 18:43:08 -0400 Subject: [PATCH] Make our info pages say "grub2" where appropriate. @@ -35,7 +35,7 @@ index a9f4de6318c..3ce827ab726 100644 @setchapternewpage odd diff --git a/docs/grub.texi b/docs/grub.texi -index 15a90b26e4d..f28c4cd5247 100644 +index a7155c22ffe..2b7b7faf847 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1,7 +1,7 @@ @@ -114,7 +114,7 @@ index 15a90b26e4d..f28c4cd5247 100644 (@pxref{Environment block}). @item -@@ -548,7 +548,7 @@ On OS which have device nodes similar to Unix-like OS GRUB tools use the +@@ -549,7 +549,7 @@ On OS which have device nodes similar to Unix-like OS GRUB tools use the OS name. E.g. for GNU/Linux: @example @@ -123,7 +123,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example On AROS we use another syntax. For volumes: -@@ -571,7 +571,7 @@ For disks we use syntax: +@@ -572,7 +572,7 @@ For disks we use syntax: E.g. @example @@ -132,7 +132,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example On Windows we use UNC path. For volumes it's typically -@@ -598,7 +598,7 @@ For disks it's +@@ -599,7 +599,7 @@ For disks it's E.g. @example @@ -141,7 +141,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example Beware that you may need to further escape the backslashes depending on your -@@ -608,7 +608,7 @@ When compiled with cygwin support then cygwin drive names are automatically +@@ -609,7 +609,7 @@ When compiled with cygwin support then cygwin drive names are automatically when needed. E.g. @example @@ -150,7 +150,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example @node Installation -@@ -621,7 +621,7 @@ from the source tarball, or as a package for your OS. +@@ -622,7 +622,7 @@ from the source tarball, or as a package for your OS. After you have done that, you need to install the boot loader on a drive (floppy or hard disk) by using the utility @@ -159,7 +159,7 @@ index 15a90b26e4d..f28c4cd5247 100644 GRUB comes with boot images, which are normally put in the directory @file{/usr/lib/grub/-} (for BIOS-based machines -@@ -632,22 +632,22 @@ loader needs to find them (usually @file{/boot}) will be called +@@ -633,22 +633,22 @@ loader needs to find them (usually @file{/boot}) will be called the @dfn{boot directory}. @menu @@ -187,7 +187,7 @@ index 15a90b26e4d..f28c4cd5247 100644 The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The -@@ -656,13 +656,13 @@ For example, under Linux the following will install GRUB into the MBR +@@ -657,13 +657,13 @@ For example, under Linux the following will install GRUB into the MBR of the first IDE disk: @example @@ -203,7 +203,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example But all the above examples assume that GRUB should put images under -@@ -676,7 +676,7 @@ boot floppy with a filesystem. Here is an example: +@@ -677,7 +677,7 @@ boot floppy with a filesystem. Here is an example: # @kbd{mke2fs /dev/fd0} # @kbd{mount -t ext2 /dev/fd0 /mnt} # @kbd{mkdir /mnt/boot} @@ -212,7 +212,7 @@ index 15a90b26e4d..f28c4cd5247 100644 # @kbd{umount /mnt} @end group @end example -@@ -688,16 +688,16 @@ floppy instead of exposing the USB drive as a hard disk (they call it +@@ -689,16 +689,16 @@ floppy instead of exposing the USB drive as a hard disk (they call it @example # @kbd{losetup /dev/loop0 /dev/sdb1} # @kbd{mount /dev/loop0 /mnt/usb} @@ -233,7 +233,7 @@ index 15a90b26e4d..f28c4cd5247 100644 with the internals of GRUB. Installing a boot loader on a running OS may be extremely dangerous. -@@ -705,20 +705,20 @@ On EFI systems for fixed disk install you have to mount EFI System Partition. +@@ -706,20 +706,20 @@ On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at @file{/boot/efi} then you don't need any special arguments: @example @@ -257,7 +257,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example @node Making a GRUB bootable CD-ROM -@@ -738,10 +738,10 @@ usually also need to include a configuration file @file{grub.cfg} and some +@@ -739,10 +739,10 @@ usually also need to include a configuration file @file{grub.cfg} and some other GRUB modules. To make a simple generic GRUB rescue CD, you can use the @@ -270,7 +270,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example You will often need to include other files in your image. To do this, first -@@ -764,7 +764,7 @@ directory @file{iso/}. +@@ -765,7 +765,7 @@ directory @file{iso/}. Finally, make the image: @example @@ -279,7 +279,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example This produces a file named @file{grub.iso}, which then can be burned -@@ -780,7 +780,7 @@ storage devices. +@@ -781,7 +781,7 @@ storage devices. @node Device map @section The map between BIOS drives and OS devices @@ -288,7 +288,7 @@ index 15a90b26e4d..f28c4cd5247 100644 etc.) read it to map BIOS drives to OS devices. This file consists of lines like this: -@@ -1223,23 +1223,23 @@ need to write the whole thing by hand. +@@ -1225,23 +1225,23 @@ need to write the whole thing by hand. @node Simple configuration @section Simple configuration handling @@ -317,7 +317,7 @@ index 15a90b26e4d..f28c4cd5247 100644 valid POSIX shell input; normally, it will just be a sequence of @samp{KEY=value} lines, but if the value contains spaces or other special characters then it must be quoted. For example: -@@ -1277,7 +1277,7 @@ works it's not recommended since titles often contain unstable device names +@@ -1279,7 +1279,7 @@ works it's not recommended since titles often contain unstable device names and may be translated If you set this to @samp{saved}, then the default menu entry will be that @@ -326,7 +326,7 @@ index 15a90b26e4d..f28c4cd5247 100644 the environment block, which may not be available in all situations (@pxref{Environment block}). -@@ -1288,7 +1288,7 @@ If this option is set to @samp{true}, then, when an entry is selected, save +@@ -1290,7 +1290,7 @@ If this option is set to @samp{true}, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if @samp{GRUB_DEFAULT=saved}; it is a separate option because @samp{GRUB_DEFAULT=saved} is useful without this option, in conjunction with @@ -335,8 +335,8 @@ index 15a90b26e4d..f28c4cd5247 100644 This option relies on the environment block, which may not be available in all situations (@pxref{Environment block}). -@@ -1399,7 +1399,7 @@ The values of these options replace the values of @samp{GRUB_CMDLINE_LINUX} - and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. +@@ -1420,7 +1420,7 @@ intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode + @end example @item GRUB_DISABLE_LINUX_UUID -Normally, @command{grub-mkconfig} will generate menu entries that use @@ -344,7 +344,7 @@ index 15a90b26e4d..f28c4cd5247 100644 universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To -@@ -1410,7 +1410,7 @@ If this option is set to @samp{true}, disable the generation of recovery +@@ -1442,7 +1442,7 @@ If this option is set to @samp{true}, disable the generation of recovery mode menu entries. @item GRUB_DISABLE_UUID @@ -353,7 +353,7 @@ index 15a90b26e4d..f28c4cd5247 100644 universally-unique identifiers (UUIDs) to identify various filesystems to search for files. This is usually more reliable, but in some cases it may not be appropriate. To disable this use of UUIDs, set this option to -@@ -1419,12 +1419,12 @@ not be appropriate. To disable this use of UUIDs, set this option to +@@ -1451,12 +1451,12 @@ not be appropriate. To disable this use of UUIDs, set this option to @item GRUB_VIDEO_BACKEND If graphical video support is required, either because the @samp{gfxterm} graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, @@ -369,7 +369,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @item GRUB_GFXMODE Set the resolution used on the @samp{gfxterm} graphical terminal. Note that -@@ -1456,7 +1456,7 @@ boot sequence. If you have problems, set this option to @samp{text} and +@@ -1488,7 +1488,7 @@ boot sequence. If you have problems, set this option to @samp{text} and GRUB will tell Linux to boot in normal text mode. @item GRUB_DISABLE_OS_PROBER @@ -378,7 +378,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @command{os-prober} program, if installed, to discover other operating systems installed on the same system and generate appropriate menu entries for them. Set this option to @samp{true} to disable this. -@@ -1466,7 +1466,7 @@ List of space-separated FS UUIDs of filesystems to be ignored from os-prober +@@ -1498,7 +1498,7 @@ List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it's @@ @item GRUB_DISABLE_SUBMENU @@ -387,7 +387,7 @@ index 15a90b26e4d..f28c4cd5247 100644 the kernel with highest version number and put all other found kernels or alternative menu entries for recovery mode in submenu. For entries returned by @command{os-prober} first entry will be put on top level and all others -@@ -1474,11 +1474,11 @@ in submenu. If this option is set to @samp{y}, flat menu with all entries +@@ -1506,11 +1506,11 @@ in submenu. If this option is set to @samp{y}, flat menu with all entries on top level will be generated instead. Changing this option will require changing existing values of @samp{GRUB_DEFAULT}, @samp{fallback} (@pxref{fallback}) and @samp{default} (@pxref{default}) environment variables as well as saved @@ -402,7 +402,7 @@ index 15a90b26e4d..f28c4cd5247 100644 check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible because GRUB will wait for passphrase to unlock encrypted container. -@@ -1537,7 +1537,7 @@ confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or +@@ -1569,7 +1569,7 @@ confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or @end table @@ -411,7 +411,7 @@ index 15a90b26e4d..f28c4cd5247 100644 edit the scripts in @file{/etc/grub.d} directly. @file{/etc/grub.d/40_custom} is particularly useful for adding entire custom menu entries; simply type the menu entries you want to add at the end of -@@ -1752,7 +1752,7 @@ images as well. +@@ -1831,7 +1831,7 @@ images as well. Mount this partition on/mnt/boot and disable GRUB in all OSes and manually install self-compiled latest GRUB with: @@ -420,7 +420,7 @@ index 15a90b26e4d..f28c4cd5247 100644 In all the OSes install GRUB tools but disable installing GRUB in bootsector, so you'll have menu.lst and grub.cfg available for use. Also disable os-prober -@@ -1762,20 +1762,20 @@ use by setting: +@@ -1841,20 +1841,20 @@ use by setting: in /etc/default/grub @@ -444,7 +444,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @} menuentry "Windows XP" @{ -@@ -1838,15 +1838,15 @@ GRUB supports embedding a configuration file directly into the core image, +@@ -1917,15 +1917,15 @@ GRUB supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. @@ -463,7 +463,7 @@ index 15a90b26e4d..f28c4cd5247 100644 After the embedded configuration file (if any) is executed, GRUB will load the @samp{normal} module (@pxref{normal}), which will then read the real -@@ -1881,13 +1881,13 @@ included in the core image: +@@ -1960,13 +1960,13 @@ included in the core image: @example @group search.fs_label grub root @@ -481,7 +481,7 @@ index 15a90b26e4d..f28c4cd5247 100644 else echo "Could not find an example configuration file!" fi -@@ -2411,7 +2411,7 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 +@@ -2490,7 +2490,7 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 @end group @end example @@ -490,7 +490,7 @@ index 15a90b26e4d..f28c4cd5247 100644 server. The grub.cfg file is placed in the same directory as the path output by -@@ -2596,7 +2596,7 @@ team are: +@@ -2675,7 +2675,7 @@ team are: @end table To take full advantage of this function, install GRUB into the MBR @@ -499,7 +499,7 @@ index 15a90b26e4d..f28c4cd5247 100644 If you have a laptop which has a similar feature and not in the above list could you figure your address and contribute? -@@ -2657,7 +2657,7 @@ bytes. +@@ -2736,7 +2736,7 @@ bytes. The sole function of @file{boot.img} is to read the first sector of the core image from a local disk and jump to it. Because of the size restriction, @file{boot.img} cannot understand any file system structure, so @@ -508,7 +508,7 @@ index 15a90b26e4d..f28c4cd5247 100644 core image into @file{boot.img} when installing GRUB. @item diskboot.img -@@ -2687,7 +2687,7 @@ images. +@@ -2766,7 +2766,7 @@ images. @item core.img This is the core image of GRUB. It is built dynamically from the kernel @@ -517,7 +517,7 @@ index 15a90b26e4d..f28c4cd5247 100644 program. Usually, it contains enough modules to access @file{/boot/grub}, and loads everything else (including menu handling, the ability to load target operating systems, and so on) from the file system at run-time. The -@@ -2739,7 +2739,7 @@ GRUB 2 has no single Stage 2 image. Instead, it loads modules from +@@ -2818,7 +2818,7 @@ GRUB 2 has no single Stage 2 image. Instead, it loads modules from In GRUB 2, images for booting from CD-ROM drives are now constructed using @file{cdboot.img} and @file{core.img}, making sure that the core image contains the @samp{iso9660} module. It is usually best to use the @@ -526,7 +526,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @item nbgrub There is as yet no equivalent for @file{nbgrub} in GRUB 2; it was used by -@@ -2895,8 +2895,8 @@ There are two ways to specify files, by @dfn{absolute file name} and by +@@ -2974,8 +2974,8 @@ There are two ways to specify files, by @dfn{absolute file name} and by An absolute file name resembles a Unix absolute file name, using @samp{/} for the directory separator (not @samp{\} as in DOS). One @@ -537,7 +537,7 @@ index 15a90b26e4d..f28c4cd5247 100644 disk. If you omit the device name in an absolute file name, GRUB uses GRUB's @dfn{root device} implicitly. So if you set the root device to, say, @samp{(hd1,1)} by the command @samp{set root=(hd1,1)} (@pxref{set}), -@@ -2904,8 +2904,8 @@ then @code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}. +@@ -2983,8 +2983,8 @@ then @code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}. On ZFS filesystem the first path component must be @var{volume}@samp{@@}[@var{snapshot}]. @@ -548,7 +548,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @samp{snap-129}. Trailing @samp{@@} after volume name is mandatory even if snapshot name is omitted. -@@ -3308,7 +3308,7 @@ The more recent release of Minix would then be identified as +@@ -3387,7 +3387,7 @@ The more recent release of Minix would then be identified as @samp{other>minix>minix-3.4.0}. This variable is often set by @samp{GRUB_DEFAULT} (@pxref{Simple @@ -557,7 +557,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @node fallback -@@ -3398,7 +3398,7 @@ If this variable is set, it names the language code that the +@@ -3477,7 +3477,7 @@ If this variable is set, it names the language code that the example, French would be named as @samp{fr}, and Simplified Chinese as @samp{zh_CN}. @@ -566,7 +566,7 @@ index 15a90b26e4d..f28c4cd5247 100644 reasonable default for this variable based on the system locale. -@@ -3406,10 +3406,10 @@ reasonable default for this variable based on the system locale. +@@ -3485,10 +3485,10 @@ reasonable default for this variable based on the system locale. @subsection locale_dir If this variable is set, it names the directory where translation files may @@ -579,7 +579,7 @@ index 15a90b26e4d..f28c4cd5247 100644 default for this variable if internationalization is needed and any translation files are available. -@@ -3527,7 +3527,7 @@ input. The default is not to pause output. +@@ -3606,7 +3606,7 @@ input. The default is not to pause output. The location of the @samp{/boot/grub} directory as an absolute file name (@pxref{File name syntax}). This is normally set by GRUB at startup based @@ -588,7 +588,7 @@ index 15a90b26e4d..f28c4cd5247 100644 dynamically loaded from this directory, so it must be set correctly in order for many parts of GRUB to work. -@@ -3618,17 +3618,17 @@ GRUB provides an ``environment block'' which can be used to save a small +@@ -3697,17 +3697,17 @@ GRUB provides an ``environment block'' which can be used to save a small amount of state. The environment block is a preallocated 1024-byte file, which normally lives @@ -609,7 +609,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @samp{GRUB_SAVEDEFAULT} (@pxref{Simple configuration}). -@@ -4317,7 +4317,7 @@ Translate @var{string} into the current language. +@@ -4396,7 +4396,7 @@ Translate @var{string} into the current language. The current language code is stored in the @samp{lang} variable in GRUB's environment (@pxref{lang}). Translation files in MO format are read from @@ -618,7 +618,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end deffn -@@ -4712,7 +4712,7 @@ Define a user named @var{user} with password @var{clear-password}. +@@ -4791,7 +4791,7 @@ Define a user named @var{user} with password @var{clear-password}. @deffn Command password_pbkdf2 user hashed-password Define a user named @var{user} with password hash @var{hashed-password}. @@ -627,7 +627,7 @@ index 15a90b26e4d..f28c4cd5247 100644 to generate password hashes. @xref{Security}. @end deffn -@@ -5535,8 +5535,8 @@ The @samp{password} (@pxref{password}) and @samp{password_pbkdf2} +@@ -5614,8 +5614,8 @@ The @samp{password} (@pxref{password}) and @samp{password_pbkdf2} which has an associated password. @samp{password} sets the password in plain text, requiring @file{grub.cfg} to be secure; @samp{password_pbkdf2} sets the password hashed using the Password-Based Key Derivation Function @@ -638,7 +638,7 @@ index 15a90b26e4d..f28c4cd5247 100644 In order to enable authentication support, the @samp{superusers} environment variable must be set to a list of usernames, separated by any of spaces, -@@ -5580,7 +5580,7 @@ menuentry "May be run by user1 or a superuser" --users user1 @{ +@@ -5659,7 +5659,7 @@ menuentry "May be run by user1 or a superuser" --users user1 @{ @end group @end example @@ -647,7 +647,7 @@ index 15a90b26e4d..f28c4cd5247 100644 generating configuration files with authentication. You can use @file{/etc/grub.d/40_custom} to add simple superuser authentication, by adding @kbd{set superusers=} and @kbd{password} or @kbd{password_pbkdf2} -@@ -5605,15 +5605,15 @@ verified with a public key currently trusted by GRUB +@@ -5684,15 +5684,15 @@ verified with a public key currently trusted by GRUB validation fails, then file @file{foo} cannot be opened. This failure may halt or otherwise impact the boot process. @@ -668,7 +668,7 @@ index 15a90b26e4d..f28c4cd5247 100644 GRUB uses GPG-style detached signatures (meaning that a file @file{foo.sig} will be produced when file @file{foo} is signed), and -@@ -5633,8 +5633,8 @@ gpg --detach-sign /path/to/file +@@ -5712,8 +5712,8 @@ gpg --detach-sign /path/to/file For successful validation of all of GRUB's subcomponents and the loaded OS kernel, they must all be signed. One way to accomplish this is the following (after having already produced the desired @@ -679,7 +679,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @example @group -@@ -5656,7 +5656,7 @@ See also: @ref{check_signatures}, @ref{verify_detached}, @ref{trust}, +@@ -5735,7 +5735,7 @@ See also: @ref{check_signatures}, @ref{verify_detached}, @ref{trust}, Note that internally signature enforcement is controlled by setting the environment variable @code{check_signatures} equal to @code{enforce}. Passing one or more @code{--pubkey} options to @@ -688,7 +688,7 @@ index 15a90b26e4d..f28c4cd5247 100644 equal to @code{enforce} in @file{core.img} prior to processing any configuration files. -@@ -6013,10 +6013,10 @@ Required files are: +@@ -6092,10 +6092,10 @@ Required files are: GRUB's normal start-up procedure involves setting the @samp{prefix} environment variable to a value set in the core image by @@ -701,7 +701,7 @@ index 15a90b26e4d..f28c4cd5247 100644 things GRUB is supposed to do. If, instead, you only get a rescue shell, this usually means that GRUB -@@ -6042,8 +6042,8 @@ normal +@@ -6121,8 +6121,8 @@ normal However, any problem that leaves you in the rescue shell probably means that GRUB was not correctly installed. It may be more useful to try to reinstall @@ -712,7 +712,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @itemize @bullet{} @item -@@ -6055,7 +6055,7 @@ is usually better to use UUIDs or file system labels and avoid depending on +@@ -6134,7 +6134,7 @@ is usually better to use UUIDs or file system labels and avoid depending on drive ordering entirely. @item @@ -721,7 +721,7 @@ index 15a90b26e4d..f28c4cd5247 100644 to a partition but GRUB has already been installed in the master boot record, then the GRUB installation in the partition will be ignored. -@@ -6075,21 +6075,21 @@ support has not yet been added to GRUB. +@@ -6154,21 +6154,21 @@ support has not yet been added to GRUB. @end itemize @@ -749,7 +749,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @table @option @item --help -@@ -6105,13 +6105,13 @@ separate partition or a removable disk. +@@ -6184,13 +6184,13 @@ separate partition or a removable disk. If this option is not specified then it defaults to @file{/boot}, so @example @@ -765,7 +765,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @end example Here is an example in which you have a separate @dfn{boot} partition which is -@@ -6119,16 +6119,16 @@ mounted on +@@ -6198,16 +6198,16 @@ mounted on @file{/mnt/boot}: @example @@ -785,7 +785,7 @@ index 15a90b26e4d..f28c4cd5247 100644 extra space in the bootloader embedding area for Reed-Solomon error-correcting codes. This enables GRUB to still boot successfully if some blocks are corrupted. The exact amount of protection offered -@@ -6141,17 +6141,17 @@ installation}) where GRUB does not reside in any unpartitioned space +@@ -6220,17 +6220,17 @@ installation}) where GRUB does not reside in any unpartitioned space outside of the MBR. Disable the Reed-Solomon codes with this option. @end table @@ -808,7 +808,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @table @option @item --help -@@ -6167,17 +6167,17 @@ it to standard output. +@@ -6246,17 +6246,17 @@ it to standard output. @end table @@ -830,7 +830,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @table @option @item -c @var{number} -@@ -6195,23 +6195,23 @@ Length of the salt. Defaults to 64. +@@ -6274,23 +6274,23 @@ Length of the salt. Defaults to 64. @end table @@ -860,7 +860,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @table @option @item --help -@@ -6222,17 +6222,17 @@ Print the version number of GRUB and exit. +@@ -6301,17 +6301,17 @@ Print the version number of GRUB and exit. @end table @@ -882,7 +882,7 @@ index 15a90b26e4d..f28c4cd5247 100644 passed on directly to @command{xorriso} in @command{mkisofs} emulation mode. Options passed to @command{xorriso} will normally be interpreted as @command{mkisofs} options; if the option @samp{--} is used, then anything -@@ -6247,7 +6247,7 @@ mkdir -p disk/boot/grub +@@ -6326,7 +6326,7 @@ mkdir -p disk/boot/grub grub-mkrescue -o grub.iso disk @end example @@ -891,7 +891,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @table @option @item --help -@@ -6275,15 +6275,15 @@ Use @var{file} as the @command{xorriso} program, rather than the built-in +@@ -6354,15 +6354,15 @@ Use @var{file} as the @command{xorriso} program, rather than the built-in default. @item --grub-mkimage=@var{file} @@ -911,7 +911,7 @@ index 15a90b26e4d..f28c4cd5247 100644 system or file system image that GRUB understands, using GRUB's file system drivers via FUSE. (It is only available if FUSE development files were present when GRUB was built.) This has a number of uses: -@@ -6315,13 +6315,13 @@ even if nobody has yet written a FUSE module specifically for that file +@@ -6394,13 +6394,13 @@ even if nobody has yet written a FUSE module specifically for that file system type. @end itemize @@ -927,7 +927,7 @@ index 15a90b26e4d..f28c4cd5247 100644 non-option arguments (if it is given more than one image, it will treat them as a RAID set), and also accepts the following options: -@@ -6343,13 +6343,13 @@ Show debugging output for conditions matching @var{string}. +@@ -6422,13 +6422,13 @@ Show debugging output for conditions matching @var{string}. @item -K prompt|@var{file} @itemx --zfs-key=prompt|@var{file} Load a ZFS encryption key. If you use @samp{prompt} as the argument, @@ -943,7 +943,7 @@ index 15a90b26e4d..f28c4cd5247 100644 root of the supplied file system. If @var{device} is just a number, then it will be treated as a partition -@@ -6367,10 +6367,10 @@ Print verbose messages. +@@ -6446,10 +6446,10 @@ Print verbose messages. @end table @@ -957,7 +957,7 @@ index 15a90b26e4d..f28c4cd5247 100644 or device. @example -@@ -6378,7 +6378,7 @@ grub-probe --target=fs /boot/grub +@@ -6457,7 +6457,7 @@ grub-probe --target=fs /boot/grub grub-probe --target=drive --device /dev/sda1 @end example @@ -966,7 +966,7 @@ index 15a90b26e4d..f28c4cd5247 100644 argument, and also accepts the following options: @table @option -@@ -6391,16 +6391,16 @@ Print the version number of GRUB and exit. +@@ -6470,16 +6470,16 @@ Print the version number of GRUB and exit. @item -d @itemx --device If this option is given, then the non-option argument is a system device @@ -986,7 +986,7 @@ index 15a90b26e4d..f28c4cd5247 100644 @item -t @var{target} @itemx --target=@var{target} -@@ -6453,19 +6453,19 @@ Print verbose messages. +@@ -6532,19 +6532,19 @@ Print verbose messages. @end table diff --git a/0171-print-more-debug-info-in-our-module-loader.patch b/0260-print-more-debug-info-in-our-module-loader.patch similarity index 88% rename from 0171-print-more-debug-info-in-our-module-loader.patch rename to 0260-print-more-debug-info-in-our-module-loader.patch index 16c10348..db62188b 100644 --- a/0171-print-more-debug-info-in-our-module-loader.patch +++ b/0260-print-more-debug-info-in-our-module-loader.patch @@ -1,4 +1,4 @@ -From 0d0a7ebbed42b97fca63cbcaf85a469b77c76fda Mon Sep 17 00:00:00 2001 +From 983d40ddb1c4eaaaa0c3ff1c4feded9a20cde4e8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 May 2017 11:19:40 -0400 Subject: [PATCH] print more debug info in our module loader. @@ -9,10 +9,10 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 684ca93f8f4..866fc20e162 100644 +index e339f264b3a..562d6887e0e 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -304,13 +304,23 @@ grub_efi_modules_addr (void) +@@ -313,13 +313,23 @@ grub_efi_modules_addr (void) } if (i == coff_header->num_sections) diff --git a/0172-macos-just-build-chainloader-entries-don-t-try-any-x.patch b/0261-macos-just-build-chainloader-entries-don-t-try-any-x.patch similarity index 98% rename from 0172-macos-just-build-chainloader-entries-don-t-try-any-x.patch rename to 0261-macos-just-build-chainloader-entries-don-t-try-any-x.patch index f93c9c93..b839a99a 100644 --- a/0172-macos-just-build-chainloader-entries-don-t-try-any-x.patch +++ b/0261-macos-just-build-chainloader-entries-don-t-try-any-x.patch @@ -1,8 +1,7 @@ -From 4cb6b65d74966dfbe6e8463ee1e88d99ca7de5b1 Mon Sep 17 00:00:00 2001 +From 1493c58177ab5b3d17b94d9336ab3a50050a76f9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 24 May 2017 12:42:32 -0400 -Subject: [PATCH] macos: just build chainloader entries, don't try any - xnu xnu. +Subject: [PATCH] macos: just build chainloader entries, don't try any xnu xnu. Since our bugs tell us that the xnu boot entries really just don't work most of the time, and they create piles of extra boot entries, because diff --git a/0173-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch b/0262-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch similarity index 99% rename from 0173-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch rename to 0262-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch index 2087c219..9def802c 100644 --- a/0173-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch +++ b/0262-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch @@ -1,4 +1,4 @@ -From 396001716b7f8c7a6aee17f33fdb9e5d47424cbc Mon Sep 17 00:00:00 2001 +From 637758466cae6c64773682536e42d554b8a134fc Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 18 Dec 2013 09:57:04 +0000 Subject: [PATCH] grub2/btrfs: Add ability to boot from subvolumes @@ -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 4849c1ceb65..38facf3cb8b 100644 +index be195448dbe..51ed63d429b 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -29,6 +29,9 @@ diff --git a/0174-export-btrfs_subvol-and-btrfs_subvolid.patch b/0263-export-btrfs_subvol-and-btrfs_subvolid.patch similarity index 88% rename from 0174-export-btrfs_subvol-and-btrfs_subvolid.patch rename to 0263-export-btrfs_subvol-and-btrfs_subvolid.patch index 65983122..f47b5e62 100644 --- a/0174-export-btrfs_subvol-and-btrfs_subvolid.patch +++ b/0263-export-btrfs_subvol-and-btrfs_subvolid.patch @@ -1,4 +1,4 @@ -From 35c1015fc1a4313be34757eebb195547336e0edf Mon Sep 17 00:00:00 2001 +From 31090515d4b7c4d56074ea3eb8609a0d7aa6ed11 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Wed, 18 Dec 2013 09:57:04 +0000 Subject: [PATCH] export btrfs_subvol and btrfs_subvolid @@ -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 38facf3cb8b..3962961666e 100644 +index 51ed63d429b..88d727d161f 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2273,6 +2273,8 @@ GRUB_MOD_INIT (btrfs) diff --git a/0175-grub2-btrfs-03-follow_default.patch b/0264-grub2-btrfs-03-follow_default.patch similarity index 98% rename from 0175-grub2-btrfs-03-follow_default.patch rename to 0264-grub2-btrfs-03-follow_default.patch index a5f7e14e..eff8e4d4 100644 --- a/0175-grub2-btrfs-03-follow_default.patch +++ b/0264-grub2-btrfs-03-follow_default.patch @@ -1,4 +1,4 @@ -From 476a0251e8ca2850da7c383baf7fdbd810bc789f Mon Sep 17 00:00:00 2001 +From 86873f3dc10729eb4f682050c501aa8a8d717080 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 Subject: [PATCH] grub2-btrfs-03-follow_default @@ -8,7 +8,7 @@ Subject: [PATCH] grub2-btrfs-03-follow_default 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 3962961666e..2c462584e91 100644 +index 88d727d161f..a47d297567f 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -920,6 +920,7 @@ grub_btrfs_mount (grub_device_t dev) diff --git a/0176-grub2-btrfs-04-grub2-install.patch b/0265-grub2-btrfs-04-grub2-install.patch similarity index 98% rename from 0176-grub2-btrfs-04-grub2-install.patch rename to 0265-grub2-btrfs-04-grub2-install.patch index 9f5507ad..ea120c78 100644 --- a/0176-grub2-btrfs-04-grub2-install.patch +++ b/0265-grub2-btrfs-04-grub2-install.patch @@ -1,4 +1,4 @@ -From e03dd83cc804d70af0716d0a429715afbcdc7eae Mon Sep 17 00:00:00 2001 +From 853e1da4270964bc40f8e27b06b0566100d7af87 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 Subject: [PATCH] grub2-btrfs-04-grub2-install @@ -94,7 +94,7 @@ index ebcdd8f5e22..f044a880a76 100644 sizeof ("GRUB_DISTRIBUTOR=") - 1) == 0) { diff --git a/util/grub-install.c b/util/grub-install.c -index 75e3e5ba6f0..036fe1822e0 100644 +index 78d0138cb0a..4375c161955 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -816,6 +816,8 @@ fill_core_services (const char *core_services) diff --git a/0177-grub2-btrfs-05-grub2-mkconfig.patch b/0266-grub2-btrfs-05-grub2-mkconfig.patch similarity index 92% rename from 0177-grub2-btrfs-05-grub2-mkconfig.patch rename to 0266-grub2-btrfs-05-grub2-mkconfig.patch index 502f5b08..15ed217b 100644 --- a/0177-grub2-btrfs-05-grub2-mkconfig.patch +++ b/0266-grub2-btrfs-05-grub2-mkconfig.patch @@ -1,4 +1,4 @@ -From cb43e7a6c96127e72d6787c6063de8911284fe18 Mon Sep 17 00:00:00 2001 +From bcf4024d12d2a33ea07b1dce23153ea11c439b83 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 Subject: [PATCH] grub2-btrfs-05-grub2-mkconfig @@ -12,10 +12,10 @@ Subject: [PATCH] grub2-btrfs-05-grub2-mkconfig 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index e32de5ef361..3b0bfe40308 100644 +index 8218f3d477f..4248b9341ab 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -239,7 +239,8 @@ export GRUB_DEFAULT \ +@@ -258,7 +258,8 @@ export GRUB_DEFAULT \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ GRUB_DISABLE_SUBMENU \ @@ -26,7 +26,7 @@ index e32de5ef361..3b0bfe40308 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 9c410eae493..2fb4f4f8143 100644 +index 113a41f9409..b3aae534ddc 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -52,7 +52,11 @@ grub_warn () @@ -88,10 +88,10 @@ index 858b526c925..e2a53300126 100644 +EOF +fi diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c9bf223f273..7e78ad33636 100644 +index 24a10f95d2c..69415af69b2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -56,10 +56,14 @@ fi +@@ -66,10 +66,14 @@ fi case x"$GRUB_FS" in xbtrfs) @@ -107,10 +107,10 @@ index c9bf223f273..7e78ad33636 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 54f1ec8a2fd..462f8e1f819 100644 +index 972a4b5a03d..bcdc3ceac02 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -63,10 +63,14 @@ fi +@@ -73,10 +73,14 @@ fi case x"$GRUB_FS" in xbtrfs) diff --git a/0178-grub2-btrfs-06-subvol-mount.patch b/0267-grub2-btrfs-06-subvol-mount.patch similarity index 98% rename from 0178-grub2-btrfs-06-subvol-mount.patch rename to 0267-grub2-btrfs-06-subvol-mount.patch index 0c37866f..8c5133a0 100644 --- a/0178-grub2-btrfs-06-subvol-mount.patch +++ b/0267-grub2-btrfs-06-subvol-mount.patch @@ -1,4 +1,4 @@ -From 84d6a482c2c8d0677141bb888512a6a89daf9d8b Mon Sep 17 00:00:00 2001 +From de81ab552e77435f75222b7e06b9e3ffba98077b Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 22 May 2015 11:45:25 +0000 Subject: [PATCH] grub2-btrfs-06-subvol-mount @@ -11,7 +11,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 2c462584e91..d111147e836 100644 +index a47d297567f..2e36ac47e8a 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -32,6 +32,7 @@ @@ -460,10 +460,10 @@ index 5d50dd6f8dc..4c5a13022dc 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 036fe1822e0..cd84a72b97b 100644 +index 4375c161955..a0ad99729fd 100644 --- a/util/grub-install.c +++ b/util/grub-install.c -@@ -1534,6 +1534,55 @@ main (int argc, char *argv[]) +@@ -1535,6 +1535,55 @@ main (int argc, char *argv[]) prefix_drive = xasprintf ("(%s)", grub_drives[0]); } diff --git a/0179-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch b/0268-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch similarity index 93% rename from 0179-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch rename to 0268-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch index 2dfb6210..091d98b5 100644 --- a/0179-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch +++ b/0268-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch @@ -1,4 +1,4 @@ -From 741c0651cd54970c08e9c19a82f5805aafbfda23 Mon Sep 17 00:00:00 2001 +From e9729f3100b7ca0576a4b7359f857d0f526df0b5 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sat, 18 Jul 2015 15:38:08 +0000 Subject: [PATCH] No more "Bootable Snapshot" submenu in grub.cfg. diff --git a/0180-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch b/0269-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch similarity index 93% rename from 0180-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch rename to 0269-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch index 6d3a7f9c..60bf3070 100644 --- a/0180-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch +++ b/0269-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch @@ -1,8 +1,8 @@ -From ab8e0d4bf544b708f5afa4cc56e6bd16789f2f1e Mon Sep 17 00:00:00 2001 +From ed7ffeee89393dff28a058c3769d9bf4f35fe5e5 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 21 Jun 2016 16:44:17 +0000 -Subject: [PATCH] Fallback to old subvol name scheme to support old - snapshot config +Subject: [PATCH] Fallback to old subvol name scheme to support old snapshot + config Ref: bsc#953538 --- @@ -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 d111147e836..a5c000805a7 100644 +index 2e36ac47e8a..4a31d39ee74 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -924,11 +924,41 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path) diff --git a/0181-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch b/0270-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch similarity index 98% rename from 0181-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch rename to 0270-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch index c68d6272..ff2b1d7f 100644 --- a/0181-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch +++ b/0270-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch @@ -1,15 +1,14 @@ -From eb8535428a42c7099666ddb58ac900bb8ee745ba Mon Sep 17 00:00:00 2001 +From 6ecaa168ca522c9022545ca52c28233313d54279 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 11 May 2017 08:56:57 +0000 -Subject: [PATCH] Grub not working correctly with btrfs snapshots - (bsc#1026511) +Subject: [PATCH] Grub not working correctly with btrfs snapshots (bsc#1026511) --- 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 a5c000805a7..3cd9472197c 100644 +index 4a31d39ee74..7002ad81b7e 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2446,6 +2446,238 @@ out: diff --git a/0182-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch b/0271-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch similarity index 89% rename from 0182-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch rename to 0271-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch index 35496c08..2ba6dd3c 100644 --- a/0182-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch +++ b/0271-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch @@ -1,4 +1,4 @@ -From 2a6e1d2491b7334985ad25315faa22d26354d8b7 Mon Sep 17 00:00:00 2001 +From 77a5aafc52bd5755a35d971bc8f58f9cf34c3d8d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 09:59:56 -0400 Subject: [PATCH] Add grub_efi_allocate_pool() and grub_efi_free_pool() @@ -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 91e29ce66f1..68326d96f5a 100644 +index 3efbafbb418..1f31e09b78a 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -24,6 +24,10 @@ @@ -24,10 +24,10 @@ index 91e29ce66f1..68326d96f5a 100644 /* Functions. */ void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_efi_guid_t *protocol, void *registration); -@@ -58,6 +62,33 @@ EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size, - grub_efi_uintn_t *map_key, +@@ -59,6 +63,33 @@ EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size, grub_efi_uintn_t *descriptor_size, grub_efi_uint32_t *descriptor_version); + void grub_efi_memory_fini (void); + +static inline grub_efi_status_t +__attribute__((__unused__)) @@ -58,7 +58,7 @@ index 91e29ce66f1..68326d96f5a 100644 grub_efi_loaded_image_t *EXPORT_FUNC(grub_efi_get_loaded_image) (grub_efi_handle_t image_handle); void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp); char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); -@@ -103,10 +134,7 @@ void grub_efi_init (void); +@@ -104,10 +135,7 @@ void grub_efi_init (void); void grub_efi_fini (void); void grub_efi_set_prefix (void); diff --git a/0183-Use-grub_efi_.-memory-helpers-where-reasonable.patch b/0272-Use-grub_efi_.-memory-helpers-where-reasonable.patch similarity index 98% rename from 0183-Use-grub_efi_.-memory-helpers-where-reasonable.patch rename to 0272-Use-grub_efi_.-memory-helpers-where-reasonable.patch index fe13ef77..4fd31993 100644 --- a/0183-Use-grub_efi_.-memory-helpers-where-reasonable.patch +++ b/0272-Use-grub_efi_.-memory-helpers-where-reasonable.patch @@ -1,4 +1,4 @@ -From 6ea13cdb3f33da45d7a8042d85ad87e2a18fc946 Mon Sep 17 00:00:00 2001 +From 619a4b7d7aba279efa86ee0bf063f7fe0cd23760 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 10:06:38 -0400 Subject: [PATCH] Use grub_efi_...() memory helpers where reasonable. diff --git a/0184-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch b/0273-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch similarity index 96% rename from 0184-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch rename to 0273-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch index f64aa82c..76fe99e5 100644 --- a/0184-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch +++ b/0273-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch @@ -1,4 +1,4 @@ -From eae94a16a8ae350cdeab8b7742f9227d92001272 Mon Sep 17 00:00:00 2001 +From 9bb580e5956bbcbbd40812ac35de57dc45605487 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 10:07:50 -0400 Subject: [PATCH] Add PRIxGRUB_EFI_STATUS and use it. diff --git a/0185-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch b/0274-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch similarity index 94% rename from 0185-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch rename to 0274-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch index cdeb9412..81f1f425 100644 --- a/0185-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch +++ b/0274-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch @@ -1,8 +1,8 @@ -From 41a50aa2c275076caa2f9fe7a747eeb054abed16 Mon Sep 17 00:00:00 2001 +From 448b5622df98d26537b10f608817af94c01c1988 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:42:57 -0400 -Subject: [PATCH] Don't use dynamic sized arrays since we don't build - with -std=c99 +Subject: [PATCH] Don't use dynamic sized arrays since we don't build with + -std=c99 --- grub-core/net/net.c | 17 ++++++++++++++--- diff --git a/0186-don-t-ignore-const.patch b/0275-don-t-ignore-const.patch similarity index 89% rename from 0186-don-t-ignore-const.patch rename to 0275-don-t-ignore-const.patch index 138100a0..9060737b 100644 --- a/0186-don-t-ignore-const.patch +++ b/0275-don-t-ignore-const.patch @@ -1,4 +1,4 @@ -From d06e2578107f217d2bc8beee7fd0dc7f2645873d Mon Sep 17 00:00:00 2001 +From 737db141d6cebf096ccc4ba82a73b0fa9b8ab389 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:43:22 -0400 Subject: [PATCH] don't ignore const diff --git a/0187-don-t-use-int-for-efi-status.patch b/0276-don-t-use-int-for-efi-status.patch similarity index 73% rename from 0187-don-t-use-int-for-efi-status.patch rename to 0276-don-t-use-int-for-efi-status.patch index ce63f58d..27e3e9d6 100644 --- a/0187-don-t-use-int-for-efi-status.patch +++ b/0276-don-t-use-int-for-efi-status.patch @@ -1,4 +1,4 @@ -From 6d86c59c24e12c8e8471cdd2affca574fdee160d Mon Sep 17 00:00:00 2001 +From 4e97f04f715bc6e24e5e3b70ef6b4a247925dc3e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:44:59 -0400 Subject: [PATCH] don't use int for efi status @@ -8,10 +8,10 @@ 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 866fc20e162..91f75fdb89a 100644 +index 562d6887e0e..bcae7f4699d 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -157,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) +@@ -166,7 +166,7 @@ grub_reboot (void) void grub_exit (int retval) { diff --git a/0188-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch b/0277-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch similarity index 93% rename from 0188-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch rename to 0277-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch index 0c873ea9..71baaf11 100644 --- a/0188-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch +++ b/0277-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch @@ -1,4 +1,4 @@ -From ba6828d073bbda85eba59a9ce9220eada51a540b Mon Sep 17 00:00:00 2001 +From 3bc226b6606b734c166d2fe5e0d98291627426ef Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:46:23 -0400 Subject: [PATCH] make GRUB_MOD_INIT() declare its function prototypes. diff --git a/0189-Clean-up-some-errors-in-the-linuxefi-loader.patch b/0278-Clean-up-some-errors-in-the-linuxefi-loader.patch similarity index 90% rename from 0189-Clean-up-some-errors-in-the-linuxefi-loader.patch rename to 0278-Clean-up-some-errors-in-the-linuxefi-loader.patch index 06cecba9..b3620fc3 100644 --- a/0189-Clean-up-some-errors-in-the-linuxefi-loader.patch +++ b/0278-Clean-up-some-errors-in-the-linuxefi-loader.patch @@ -1,4 +1,4 @@ -From 8bdc0c77919ddb9bd588ac45e96c96497683f76c Mon Sep 17 00:00:00 2001 +From cdb51bfafecdf290a2f55ed1d12956ea5e39c21c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 24 May 2017 15:58:18 -0400 Subject: [PATCH] Clean up some errors in the linuxefi loader @@ -9,16 +9,16 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index bed5919cab3..6db5d0bf3a0 100644 +index 6ff796f56ff..cb9631c95e1 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -161,8 +161,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_file_t file = 0; -- struct linux_kernel_header *lh; +- struct linux_i386_kernel_header *lh; - grub_ssize_t len, start, filelen; -+ struct linux_kernel_header *lh = NULL; ++ struct linux_i386_kernel_header *lh = NULL; + grub_ssize_t start, filelen; void *kernel = NULL; int setup_header_end_offset; @@ -44,7 +44,7 @@ index bed5919cab3..6db5d0bf3a0 100644 (grub_uint8_t *)kernel + 0x1f1, - MIN(0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1); + MIN((grub_size_t)0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1); - lh = (struct linux_kernel_header *)params; + lh = (struct linux_i386_kernel_header *)params; grub_dprintf ("linuxefi", "lh is at %p\n", lh); grub_dprintf ("linuxefi", "checking lh->boot_flag\n"); @@ -297,7 +298,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), diff --git a/0190-editenv-handle-relative-symlinks.patch b/0279-editenv-handle-relative-symlinks.patch similarity index 95% rename from 0190-editenv-handle-relative-symlinks.patch rename to 0279-editenv-handle-relative-symlinks.patch index 7a772617..7c035c11 100644 --- a/0190-editenv-handle-relative-symlinks.patch +++ b/0279-editenv-handle-relative-symlinks.patch @@ -1,4 +1,4 @@ -From 098987b7b5fcc15a5ba3600fa132fcec36095c5a Mon Sep 17 00:00:00 2001 +From ac9408d85d219cd0d871b0507c32cdc653d55f28 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 14 Aug 2017 14:37:20 -0400 Subject: [PATCH] editenv: handle relative symlinks diff --git a/0191-Make-libgrub.pp-depend-on-config-util.h.patch b/0280-Make-libgrub.pp-depend-on-config-util.h.patch similarity index 98% rename from 0191-Make-libgrub.pp-depend-on-config-util.h.patch rename to 0280-Make-libgrub.pp-depend-on-config-util.h.patch index 7df011ad..58fb8fa2 100644 --- a/0191-Make-libgrub.pp-depend-on-config-util.h.patch +++ b/0280-Make-libgrub.pp-depend-on-config-util.h.patch @@ -1,4 +1,4 @@ -From c86299049c2cc0503728deee280d9f6bf50886f4 Mon Sep 17 00:00:00 2001 +From 01a32e6d379551b92358580da8084f25ab75bb1c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 23 Aug 2017 10:37:27 -0400 Subject: [PATCH] Make libgrub.pp depend on config-util.h diff --git a/0192-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch b/0281-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch similarity index 91% rename from 0192-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch rename to 0281-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch index 68c1cbb1..862a5d26 100644 --- a/0192-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch +++ b/0281-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch @@ -1,4 +1,4 @@ -From 351799d9310a4bec23ed4074444780c2a35435fd Mon Sep 17 00:00:00 2001 +From f51d40b664310c3f7b198dd5c1b87ce68905a172 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 20 Apr 2017 13:29:06 -0400 Subject: [PATCH] Don't guess /boot/efi/ as HFS+ on ppc machines in @@ -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 cd84a72b97b..48f2abc3ea5 100644 +index a0ad99729fd..16f137ca854 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1159,18 +1159,8 @@ main (int argc, char *argv[]) diff --git a/0195-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch b/0282-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch similarity index 85% rename from 0195-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch rename to 0282-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch index 2530b54b..6145179f 100644 --- a/0195-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch +++ b/0282-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch @@ -1,8 +1,7 @@ -From 92d3db585076d022521ab94a2ceed03eb05013fc Mon Sep 17 00:00:00 2001 +From b3743b26b4ba3acf7963d7362791b17440d28e54 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 19 Oct 2017 11:29:11 -0400 -Subject: [PATCH] 20_linux_xen: load xen or multiboot{,2} modules as - needed. +Subject: [PATCH] 20_linux_xen: load xen or multiboot{,2} modules as needed. Signed-off-by: Peter Jones --- @@ -10,10 +9,10 @@ Signed-off-by: Peter Jones 1 file changed, 3 insertions(+) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index fae1ffe9494..fc53bd54231 100644 +index bcdc3ceac02..2bc03fd36b9 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -126,6 +126,8 @@ linux_entry () +@@ -136,6 +136,8 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi @@ -22,7 +21,7 @@ index fae1ffe9494..fc53bd54231 100644 ${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} echo '$(echo "$lmessage" | grub_quote)' ${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} -@@ -135,6 +137,7 @@ EOF +@@ -145,6 +147,7 @@ EOF message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' diff --git a/0197-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch b/0283-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch similarity index 99% rename from 0197-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch rename to 0283-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch index 236d7970..b75b9632 100644 --- a/0197-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch +++ b/0283-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch @@ -1,8 +1,7 @@ -From 0b158c30810db86f549cabd6e6021ab15962370d Mon Sep 17 00:00:00 2001 +From 5aa188746a040b193e04f7e98b87c905c4c2854e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 7 Nov 2017 17:12:17 -0500 -Subject: [PATCH] Make pmtimer tsc calibration not take 51 seconds to - fail. +Subject: [PATCH] Make pmtimer tsc calibration not take 51 seconds to fail. On my laptop running at 2.4GHz, if I run a VM where tsc calibration using pmtimer will fail presuming a broken pmtimer, it takes ~51 seconds diff --git a/0198-align-struct-efi_variable-better.patch b/0284-align-struct-efi_variable-better.patch similarity index 90% rename from 0198-align-struct-efi_variable-better.patch rename to 0284-align-struct-efi_variable-better.patch index 2ad86512..05e82576 100644 --- a/0198-align-struct-efi_variable-better.patch +++ b/0284-align-struct-efi_variable-better.patch @@ -1,4 +1,4 @@ -From 2485633ada06c11c07a34a696a92b14e58f1e846 Mon Sep 17 00:00:00 2001 +From d4c21cd0f3dedd1d99c0a3acb7c6743138745f22 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 27 Feb 2018 13:55:35 -0500 Subject: [PATCH] align struct efi_variable better... @@ -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 9b6b729f4cc..856774a7c34 100644 +index 36d2dedf47e..9d93ba88bac 100644 --- a/include/grub/efiemu/runtime.h +++ b/include/grub/efiemu/runtime.h @@ -33,5 +33,5 @@ struct efi_variable diff --git a/0199-Add-quicksort-implementation.patch b/0285-Add-quicksort-implementation.patch similarity index 98% rename from 0199-Add-quicksort-implementation.patch rename to 0285-Add-quicksort-implementation.patch index d8db032d..ae720d60 100644 --- a/0199-Add-quicksort-implementation.patch +++ b/0285-Add-quicksort-implementation.patch @@ -1,4 +1,4 @@ -From a2cd100d71711b950beaf60ea7ddca4c77a70d59 Mon Sep 17 00:00:00 2001 +From 7c1816f96484ad413dab750a6a8d9b99749116d0 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 9 Dec 2016 15:39:47 -0500 Subject: [PATCH] Add quicksort implementation @@ -297,10 +297,10 @@ index 00000000000..7f3fc9ffdae + return NULL; +} diff --git a/include/grub/misc.h b/include/grub/misc.h -index 4737da1eaa9..3d55bafd64e 100644 +index fcaf1201e39..cbfae75a1b4 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h -@@ -506,4 +506,19 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file, +@@ -507,4 +507,19 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file, #define grub_max(a, b) (((a) > (b)) ? (a) : (b)) #define grub_min(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/0200-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch b/0286-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch similarity index 99% rename from 0200-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch rename to 0286-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch index a41a1829..f3153d55 100644 --- a/0200-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch +++ b/0286-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch @@ -1,8 +1,8 @@ -From ed595feeea2f7b7fd0158d42fa2fd39420eea683 Mon Sep 17 00:00:00 2001 +From 0ea2f92fef2c8a2d585698ed1039ce2a9a8d4ee5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 9 Dec 2016 15:40:58 -0500 -Subject: [PATCH] Add blscfg command support to parse BootLoaderSpec - config fragments +Subject: [PATCH] Add blscfg command support to parse BootLoaderSpec config + fragments The BootLoaderSpec (BLS) defines a scheme where different bootloaders can share a format for boot items and a configuration directory that accepts @@ -20,7 +20,7 @@ the bls_import command, change it to blscfg and improve the BLS support. create mode 100644 grub-core/commands/loadenv.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 3a5d450f3d0..0ca0bdad412 100644 +index edf249f0002..fb661b4abf8 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -129,6 +129,7 @@ kernel = { diff --git a/0201-Add-BLS-support-to-grub-mkconfig.patch b/0287-Add-BLS-support-to-grub-mkconfig.patch similarity index 90% rename from 0201-Add-BLS-support-to-grub-mkconfig.patch rename to 0287-Add-BLS-support-to-grub-mkconfig.patch index ccac5c22..035053c9 100644 --- a/0201-Add-BLS-support-to-grub-mkconfig.patch +++ b/0287-Add-BLS-support-to-grub-mkconfig.patch @@ -1,4 +1,4 @@ -From d847a4806bb7a4f3b457d0074d712e500fbd5e97 Mon Sep 17 00:00:00 2001 +From 7de48355c3f9494c2394aefa5e5ad88f53ea06ef Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 9 Dec 2016 15:40:29 -0500 Subject: [PATCH] Add BLS support to grub-mkconfig @@ -10,14 +10,14 @@ files are parsed by blscfg command and the entries created dynamically. --- util/grub-mkconfig.in | 3 ++- util/grub-mkconfig_lib.in | 29 +++++++++++++++++++---------- - util/grub.d/10_linux.in | 37 +++++++++++++++++++++++++++++++++++-- - 3 files changed, 56 insertions(+), 13 deletions(-) + util/grub.d/10_linux.in | 37 ++++++++++++++++++++++++++++++++++++- + 3 files changed, 57 insertions(+), 12 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 3b0bfe40308..760fe08727f 100644 +index 4248b9341ab..c20171919d9 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -240,7 +240,8 @@ export GRUB_DEFAULT \ +@@ -259,7 +259,8 @@ export GRUB_DEFAULT \ GRUB_OS_PROBER_SKIP_LIST \ GRUB_DISABLE_SUBMENU \ GRUB_DEFAULT_DTB \ @@ -28,7 +28,7 @@ index 3b0bfe40308..760fe08727f 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 2fb4f4f8143..70dc8d57e92 100644 +index b3aae534ddc..1acc1d01c39 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -30,6 +30,9 @@ fi @@ -104,10 +104,10 @@ index 2fb4f4f8143..70dc8d57e92 100644 fi IFS="$old_ifs" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 7e78ad33636..f5daefb9d24 100644 +index 69415af69b2..aec1ca3eba0 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -126,6 +126,34 @@ linux_entry () +@@ -135,6 +135,34 @@ linux_entry () if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi @@ -142,7 +142,7 @@ index 7e78ad33636..f5daefb9d24 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 -@@ -236,7 +264,10 @@ submenu_indentation="" +@@ -239,7 +267,10 @@ submenu_indentation="" is_top_level=true while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` @@ -154,14 +154,14 @@ index 7e78ad33636..f5daefb9d24 100644 basename=`basename $linux` dirname=`dirname $linux` rel_dirname=`make_system_path_relative_to_its_root $dirname` -@@ -281,7 +312,9 @@ while [ "x$list" != "x" ] ; do +@@ -303,6 +334,10 @@ while [ "x$list" != "x" ] ; do fi - if test -n "${initrd}" ; then -- gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + if test -z "${initramfs}" && test -z "${initrd_real}" ; then + if [ "x${GRUB_ENABLE_BLSCFG}" != "xtrue" ]; then -+ gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 ++ gettext_printf "Found initrd image: %s\n" "${dirname}/${initramfs}" >&2 + fi - elif test -z "${initramfs}" ; then ++ elif test -z "${initramfs}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's # no initrd or builtin initramfs, it can't work here. + if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ diff --git a/0202-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch b/0288-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch similarity index 93% rename from 0202-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch rename to 0288-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch index bc5324c8..7e93e49a 100644 --- a/0202-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch +++ b/0288-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch @@ -1,4 +1,4 @@ -From 2d7dabdbf322e8f679eeaefd48cb26b083cdeb1c Mon Sep 17 00:00:00 2001 +From 1cfe1e60cdc69648aaf9e05ae54733952a8936fc Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Tue, 6 Feb 2018 11:02:09 +0100 Subject: [PATCH] Remove duplicated grub_exit() definition for grub-emu diff --git a/0203-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch b/0289-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch similarity index 85% rename from 0203-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch rename to 0289-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch index 01fb11a6..dd062ef2 100644 --- a/0203-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch +++ b/0289-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch @@ -1,8 +1,7 @@ -From f45946a92377c83ffcad8dbc3298fc26072567d9 Mon Sep 17 00:00:00 2001 +From 4d108b640b3f3f46c1af6131375b38f1da2331d8 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Tue, 6 Feb 2018 11:16:28 +0100 -Subject: [PATCH] Don't attempt to backtrace on grub_abort() for - grub-emu +Subject: [PATCH] Don't attempt to backtrace on grub_abort() for grub-emu The emu platform doesn't have a grub_backtrace() implementation, so this causes a build error. Don't attempt to call this when building grub-emu. diff --git a/0204-Enable-blscfg-command-for-the-emu-platform.patch b/0290-Enable-blscfg-command-for-the-emu-platform.patch similarity index 97% rename from 0204-Enable-blscfg-command-for-the-emu-platform.patch rename to 0290-Enable-blscfg-command-for-the-emu-platform.patch index b2aafffe..b76e7054 100644 --- a/0204-Enable-blscfg-command-for-the-emu-platform.patch +++ b/0290-Enable-blscfg-command-for-the-emu-platform.patch @@ -1,4 +1,4 @@ -From 39bb86c661911f06ff40caa842a9babf18f27c8b Mon Sep 17 00:00:00 2001 +From 9fc6d75b2422788adebf187d338b8c988d5816e1 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 2 Feb 2018 11:36:29 +0100 Subject: [PATCH] Enable blscfg command for the emu platform @@ -14,7 +14,7 @@ Signed-off-by: Javier Martinez Canillas 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 0ca0bdad412..420cbf0a024 100644 +index fb661b4abf8..8e6110e4bb6 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -778,6 +778,7 @@ module = { diff --git a/0205-Add-linux-and-initrd-commands-for-grub-emu.patch b/0291-Add-linux-and-initrd-commands-for-grub-emu.patch similarity index 98% rename from 0205-Add-linux-and-initrd-commands-for-grub-emu.patch rename to 0291-Add-linux-and-initrd-commands-for-grub-emu.patch index 3b1208f4..a661ca8f 100644 --- a/0205-Add-linux-and-initrd-commands-for-grub-emu.patch +++ b/0291-Add-linux-and-initrd-commands-for-grub-emu.patch @@ -1,4 +1,4 @@ -From 49c719a6f6e223b95733e18720a48993ab6e5317 Mon Sep 17 00:00:00 2001 +From 66022d237950cdae4686ed2d2f82d1cee3bba481 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 @@ -18,10 +18,10 @@ to the kexec command line tool, to allow booting the selected menu entry. create mode 100644 grub-core/loader/emu/linux.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 420cbf0a024..533e1408f74 100644 +index 8e6110e4bb6..7edff60ccd4 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1715,10 +1715,10 @@ module = { +@@ -1710,10 +1710,10 @@ module = { arm = loader/arm/linux.c; arm64 = loader/arm64/linux.c; arm64 = loader/efi/linux.c; diff --git a/0206-Fix-the-efidir-in-grub-setpassword.patch b/0292-Fix-the-efidir-in-grub-setpassword.patch similarity index 92% rename from 0206-Fix-the-efidir-in-grub-setpassword.patch rename to 0292-Fix-the-efidir-in-grub-setpassword.patch index 36074fda..f664fa9d 100644 --- a/0206-Fix-the-efidir-in-grub-setpassword.patch +++ b/0292-Fix-the-efidir-in-grub-setpassword.patch @@ -1,4 +1,4 @@ -From c7c6cb4380f5bd85a2cbe747433657fdce89a802 Mon Sep 17 00:00:00 2001 +From 2f821923394d09a31f456c1e9d7023345e120013 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 15 Mar 2018 14:12:54 -0400 Subject: [PATCH] Fix the efidir in grub-setpassword diff --git a/0207-Add-grub2-switch-to-blscfg.patch b/0293-Add-grub2-switch-to-blscfg.patch similarity index 98% rename from 0207-Add-grub2-switch-to-blscfg.patch rename to 0293-Add-grub2-switch-to-blscfg.patch index 8a806c0f..211aabd2 100644 --- a/0207-Add-grub2-switch-to-blscfg.patch +++ b/0293-Add-grub2-switch-to-blscfg.patch @@ -1,4 +1,4 @@ -From 89b3a570de8b5e7ad19769983a87f6e10024f0ec Mon Sep 17 00:00:00 2001 +From 4656c44d4b0665b901401dac398f26ef2fede036 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 15 Mar 2018 14:12:40 -0400 Subject: [PATCH] Add grub2-switch-to-blscfg @@ -14,10 +14,10 @@ Signed-off-by: Peter Jones create mode 100644 util/grub-switch-to-blscfg.in diff --git a/Makefile.util.def b/Makefile.util.def -index 38cdf4ccc09..fe392c24351 100644 +index 879e8eb98a4..f4fbd250630 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -1341,6 +1341,13 @@ program = { +@@ -1348,6 +1348,13 @@ program = { ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; diff --git a/0208-Add-grub_debug_enabled.patch b/0294-Add-grub_debug_enabled.patch similarity index 94% rename from 0208-Add-grub_debug_enabled.patch rename to 0294-Add-grub_debug_enabled.patch index 8b3ac8f0..fab9cbb4 100644 --- a/0208-Add-grub_debug_enabled.patch +++ b/0294-Add-grub_debug_enabled.patch @@ -1,4 +1,4 @@ -From 6776773c89828c9b69c1552760ba6a4d9cd5589f Mon Sep 17 00:00:00 2001 +From 207ad8688667666661a9546a8409d4e312e98341 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 30 Nov 2017 15:11:39 -0500 Subject: [PATCH] Add grub_debug_enabled() @@ -47,7 +47,7 @@ index 636f97e1ba1..e758ab3416d 100644 grub_printf ("%s:%d: ", file, line); va_start (args, fmt); diff --git a/include/grub/misc.h b/include/grub/misc.h -index 3d55bafd64e..493e328d968 100644 +index cbfae75a1b4..f7473c154f0 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -367,6 +367,7 @@ grub_puts (const char *s) diff --git a/0209-make-better-backtraces.patch b/0295-make-better-backtraces.patch similarity index 99% rename from 0209-make-better-backtraces.patch rename to 0295-make-better-backtraces.patch index 473923d9..62990672 100644 --- a/0209-make-better-backtraces.patch +++ b/0295-make-better-backtraces.patch @@ -1,4 +1,4 @@ -From 318ee04aadcda40b779b2a5314dd23ead165f896 Mon Sep 17 00:00:00 2001 +From 2abe387d568cd015afc9cbf88f9f2099cdb93ccf Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 6 Nov 2017 18:31:56 -0500 Subject: [PATCH] make better backtraces @@ -37,7 +37,7 @@ Signed-off-by: Peter Jones delete mode 100644 grub-core/lib/i386/backtrace.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 533e1408f74..77f0f3d8f46 100644 +index 7edff60ccd4..1153ec4d2cf 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -130,6 +130,12 @@ kernel = { @@ -63,7 +63,7 @@ index 533e1408f74..77f0f3d8f46 100644 i386 = kern/i386/dl.c; i386_xen = kern/i386/dl.c; -@@ -2293,13 +2296,11 @@ module = { +@@ -2288,13 +2291,11 @@ module = { module = { name = backtrace; @@ -521,7 +521,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 4dfa41a37d5..6eda8c1f353 100644 +index e01bc6eab19..e731a57a47b 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -60,7 +60,6 @@ diff --git a/0210-normal-don-t-draw-our-startup-message-if-debug-is-se.patch b/0296-normal-don-t-draw-our-startup-message-if-debug-is-se.patch similarity index 91% rename from 0210-normal-don-t-draw-our-startup-message-if-debug-is-se.patch rename to 0296-normal-don-t-draw-our-startup-message-if-debug-is-se.patch index 8d279eef..9395e9a2 100644 --- a/0210-normal-don-t-draw-our-startup-message-if-debug-is-se.patch +++ b/0296-normal-don-t-draw-our-startup-message-if-debug-is-se.patch @@ -1,8 +1,7 @@ -From 81d0e079ea5aa6f43daf12f7a8698d0bcd1a36f8 Mon Sep 17 00:00:00 2001 +From 8bff1b9c5f561ff5add3dcd813dfbf7c79dd04a8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Nov 2017 15:58:52 -0500 -Subject: [PATCH] normal: don't draw our startup message if debug is - set +Subject: [PATCH] normal: don't draw our startup message if debug is set --- grub-core/normal/main.c | 3 +++ diff --git a/0211-Work-around-some-minor-include-path-weirdnesses.patch b/0297-Work-around-some-minor-include-path-weirdnesses.patch similarity index 98% rename from 0211-Work-around-some-minor-include-path-weirdnesses.patch rename to 0297-Work-around-some-minor-include-path-weirdnesses.patch index 1348d2f1..fc1813dd 100644 --- a/0211-Work-around-some-minor-include-path-weirdnesses.patch +++ b/0297-Work-around-some-minor-include-path-weirdnesses.patch @@ -1,4 +1,4 @@ -From e2bba0f7ee8e56c68e425853a21a8fdd766add70 Mon Sep 17 00:00:00 2001 +From 32aad065ce76974f25968b1d23846fcac3870e7b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 16 Mar 2018 13:28:57 -0400 Subject: [PATCH] Work around some minor include path weirdnesses diff --git a/0212-Make-it-possible-to-enabled-build-id-sha1.patch b/0298-Make-it-possible-to-enabled-build-id-sha1.patch similarity index 92% rename from 0212-Make-it-possible-to-enabled-build-id-sha1.patch rename to 0298-Make-it-possible-to-enabled-build-id-sha1.patch index 33c50e67..9f59ca89 100644 --- a/0212-Make-it-possible-to-enabled-build-id-sha1.patch +++ b/0298-Make-it-possible-to-enabled-build-id-sha1.patch @@ -1,4 +1,4 @@ -From 8521929bcf671b465d6450b969d11617b6aec608 Mon Sep 17 00:00:00 2001 +From e8c8329bf8336fe861640694559106011f384db6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 25 Jun 2015 15:41:06 -0400 Subject: [PATCH] Make it possible to enabled --build-id=sha1 @@ -10,10 +10,10 @@ Signed-off-by: Peter Jones 2 files changed, 27 insertions(+) diff --git a/configure.ac b/configure.ac -index ae371a97d30..498741dfeba 100644 +index f69f8986791..359cac3c26b 100644 --- a/configure.ac +++ b/configure.ac -@@ -1385,7 +1385,15 @@ grub_PROG_TARGET_CC +@@ -1386,7 +1386,15 @@ grub_PROG_TARGET_CC if test "x$TARGET_APPLE_LINKER" != x1 ; then grub_PROG_OBJCOPY_ABSOLUTE fi diff --git a/0213-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch b/0299-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch similarity index 93% rename from 0213-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch rename to 0299-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch index f4762c42..b3592fe6 100644 --- a/0213-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch +++ b/0299-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch @@ -1,8 +1,8 @@ -From 8c4b2eaa204f0ea0377ca4592d2be6029fdb9be7 Mon Sep 17 00:00:00 2001 +From e68712bfde21a61aa1ad269935318f7ddc1143a0 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Sun, 28 Jun 2015 13:09:58 -0400 -Subject: [PATCH] Add grub_qdprintf() - grub_dprintf() without the - file+line number. +Subject: [PATCH] Add grub_qdprintf() - grub_dprintf() without the file+line + number. This just makes copy+paste of our debug loading info easier. @@ -42,7 +42,7 @@ index 5c2d2039d0b..0e89c483d5e 100644 int diff --git a/include/grub/misc.h b/include/grub/misc.h -index 493e328d968..4607e8defa9 100644 +index f7473c154f0..5f1c1c1be4e 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -372,6 +372,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file, diff --git a/0214-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch b/0300-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch similarity index 93% rename from 0214-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch rename to 0300-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch index 18d4f7ba..30c548ca 100644 --- a/0214-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch +++ b/0300-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch @@ -1,4 +1,4 @@ -From 030095a01a205aba04a0849ac0c0329ac429a9ed Mon Sep 17 00:00:00 2001 +From 42ae171b4132b72b01d47416db44094341608641 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 25 Jun 2015 15:11:36 -0400 Subject: [PATCH] Make a "gdb" dprintf that tells us load addresses. @@ -95,10 +95,10 @@ index 5028d157c46..eb8b969cded 100644 { grub_dl_unload (mod); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 91f75fdb89a..621251242e1 100644 +index bcae7f4699d..a2a732ffc0d 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -274,7 +274,7 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, +@@ -283,7 +283,7 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, /* Search the mods section from the PE32/PE32+ image. This code uses a PE32 header, but should work with PE32+ as well. */ grub_addr_t @@ -107,7 +107,7 @@ index 91f75fdb89a..621251242e1 100644 { grub_efi_loaded_image_t *image; struct grub_pe32_header *header; -@@ -299,7 +299,7 @@ grub_efi_modules_addr (void) +@@ -308,7 +308,7 @@ grub_efi_modules_addr (void) i < coff_header->num_sections; i++, section++) { @@ -117,7 +117,7 @@ index 91f75fdb89a..621251242e1 100644 } diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index f7782b6e114..79243b364a1 100644 +index 71d2279a0c1..e6183a4c44d 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -59,10 +59,33 @@ grub_efi_env_init (void) @@ -164,10 +164,10 @@ index f7782b6e114..79243b364a1 100644 } diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 68326d96f5a..6702b312040 100644 +index 1f31e09b78a..29b4dbac1e4 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h -@@ -126,7 +126,7 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, +@@ -127,7 +127,7 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); #endif diff --git a/0215-Only-attempt-to-scan-different-BLS-directories-on-EF.patch b/0301-Only-attempt-to-scan-different-BLS-directories-on-EF.patch similarity index 96% rename from 0215-Only-attempt-to-scan-different-BLS-directories-on-EF.patch rename to 0301-Only-attempt-to-scan-different-BLS-directories-on-EF.patch index 43471585..ecdec3bc 100644 --- a/0215-Only-attempt-to-scan-different-BLS-directories-on-EF.patch +++ b/0301-Only-attempt-to-scan-different-BLS-directories-on-EF.patch @@ -1,4 +1,4 @@ -From 5f0417c63a4dd2252a5a801568f4369ac74a47e6 Mon Sep 17 00:00:00 2001 +From 7de678cfab12bfe4ceddc5a32e0bf18f884bfa17 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Tue, 3 Apr 2018 15:42:47 +0200 Subject: [PATCH] Only attempt to scan different BLS directories on EFI diff --git a/0216-Core-TPM-support.patch b/0302-Core-TPM-support.patch similarity index 99% rename from 0216-Core-TPM-support.patch rename to 0302-Core-TPM-support.patch index aa7d8fc4..7f6c81d8 100644 --- a/0216-Core-TPM-support.patch +++ b/0302-Core-TPM-support.patch @@ -1,4 +1,4 @@ -From 65be94a64a5608209561ba0914d29445d81bf4b2 Mon Sep 17 00:00:00 2001 +From 4279a43e3035f8e993e4756187504b30f92cd46e Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 14 Jul 2015 17:06:35 -0700 Subject: [PATCH] Core TPM support @@ -23,7 +23,7 @@ will measure all modules as they're loaded. create mode 100644 include/grub/tpm.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 77f0f3d8f46..51f07279d83 100644 +index 1153ec4d2cf..334ca3fcf46 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -131,6 +131,7 @@ kernel = { diff --git a/0217-Measure-kernel-initrd.patch b/0303-Measure-kernel-initrd.patch similarity index 92% rename from 0217-Measure-kernel-initrd.patch rename to 0303-Measure-kernel-initrd.patch index 7ced377d..7fd3824f 100644 --- a/0217-Measure-kernel-initrd.patch +++ b/0303-Measure-kernel-initrd.patch @@ -1,4 +1,4 @@ -From ffd305d09def6610ef96f928c0df8303c5529d63 Mon Sep 17 00:00:00 2001 +From 9e3a3bf6cf57af1205198f506110639ad059bd39 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Thu, 16 Jul 2015 15:22:34 -0700 Subject: [PATCH] Measure kernel + initrd @@ -9,7 +9,7 @@ Measure the kernel and initrd when loaded on UEFI systems 1 file changed, 4 insertions(+) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 6db5d0bf3a0..48febdc8100 100644 +index cb9631c95e1..95a197743a9 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -27,6 +27,7 @@ diff --git a/0218-Add-BIOS-boot-measurement.patch b/0304-Add-BIOS-boot-measurement.patch similarity index 97% rename from 0218-Add-BIOS-boot-measurement.patch rename to 0304-Add-BIOS-boot-measurement.patch index 3fff53ec..a4ec46b0 100644 --- a/0218-Add-BIOS-boot-measurement.patch +++ b/0304-Add-BIOS-boot-measurement.patch @@ -1,4 +1,4 @@ -From d8870587d46f8aa8d4f8db2cdcddecc829993447 Mon Sep 17 00:00:00 2001 +From 78278fb7d962eb5fcf9cecc514687207bc7f4dbe Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 15:48:51 -0700 Subject: [PATCH] Add BIOS boot measurement @@ -99,7 +99,7 @@ index ea167fe1206..c1df86dec0b 100644 jmp *(LOCAL(kernel_address)) diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S -index c8b87ed293c..05dd7fa701c 100644 +index 68d31de0c4c..f4744ec6fcb 100644 --- a/grub-core/boot/i386/pc/diskboot.S +++ b/grub-core/boot/i386/pc/diskboot.S @@ -19,6 +19,8 @@ diff --git a/0219-Measure-kernel-and-initrd-on-BIOS-systems.patch b/0305-Measure-kernel-and-initrd-on-BIOS-systems.patch similarity index 94% rename from 0219-Measure-kernel-and-initrd-on-BIOS-systems.patch rename to 0305-Measure-kernel-and-initrd-on-BIOS-systems.patch index 9ebc347b..e1bf5179 100644 --- a/0219-Measure-kernel-and-initrd-on-BIOS-systems.patch +++ b/0305-Measure-kernel-and-initrd-on-BIOS-systems.patch @@ -1,4 +1,4 @@ -From 5aee2444093cfc8006865766f89e5a775a940ab1 Mon Sep 17 00:00:00 2001 +From bb92a97abec5ea192b40b30ee1d481fe53590200 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:28:29 -0700 Subject: [PATCH] Measure kernel and initrd on BIOS systems @@ -11,7 +11,7 @@ Measure the kernel and initrd when loaded on BIOS systems 3 files changed, 10 insertions(+) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index c9e89310bdd..bc10add45a6 100644 +index 35055431247..24fb1084b25 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -36,6 +36,7 @@ @@ -42,7 +42,7 @@ index c9e89310bdd..bc10add45a6 100644 if (grub_errno == GRUB_ERR_NONE) { diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index b864e540333..6b8f365c9cf 100644 +index e2bb1a99a74..654e363e584 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -36,6 +36,7 @@ diff --git a/0220-Measure-the-kernel-commandline.patch b/0306-Measure-the-kernel-commandline.patch similarity index 94% rename from 0220-Measure-the-kernel-commandline.patch rename to 0306-Measure-the-kernel-commandline.patch index c17d8dc1..a8073994 100644 --- a/0220-Measure-the-kernel-commandline.patch +++ b/0306-Measure-the-kernel-commandline.patch @@ -1,4 +1,4 @@ -From c1694574d6eb287e6e181dd018fe54b718a613b3 Mon Sep 17 00:00:00 2001 +From a54f11cf0e31a5caa18d50a060ba130fd1980ec5 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:32:29 -0700 Subject: [PATCH] Measure the kernel commandline diff --git a/0221-Measure-commands.patch b/0307-Measure-commands.patch similarity index 97% rename from 0221-Measure-commands.patch rename to 0307-Measure-commands.patch index 9d5530fc..3b3a9ea2 100644 --- a/0221-Measure-commands.patch +++ b/0307-Measure-commands.patch @@ -1,4 +1,4 @@ -From c93a27f2e6a323a4985e6fe902eb5c6447fca572 Mon Sep 17 00:00:00 2001 +From 87a43361761b15b9b0b6658b2097f1b62a5953cb Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Mon, 10 Aug 2015 15:27:12 -0700 Subject: [PATCH] Measure commands diff --git a/0222-Measure-multiboot-images-and-modules.patch b/0308-Measure-multiboot-images-and-modules.patch similarity index 85% rename from 0222-Measure-multiboot-images-and-modules.patch rename to 0308-Measure-multiboot-images-and-modules.patch index 3332a464..c439bc76 100644 --- a/0222-Measure-multiboot-images-and-modules.patch +++ b/0308-Measure-multiboot-images-and-modules.patch @@ -1,4 +1,4 @@ -From b164ec560cd6373c0c5d8a189d70baeca2c3ef13 Mon Sep 17 00:00:00 2001 +From 2de9cf8dd4366058308997794235dbf463f8cdb3 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 1 Sep 2015 16:02:55 -0700 Subject: [PATCH] Measure multiboot images and modules @@ -10,7 +10,7 @@ Subject: [PATCH] Measure multiboot images and modules 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c -index fd7b41b0cad..5d00aed65ad 100644 +index dc98dbcae25..1c5b0ac25ce 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -36,6 +36,7 @@ @@ -31,10 +31,10 @@ index fd7b41b0cad..5d00aed65ad 100644 if (header == 0) diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index fb044a60c79..0ca525380c9 100644 +index 26df46a4161..93e026c53db 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c -@@ -43,6 +43,7 @@ +@@ -51,6 +51,7 @@ #include #include #include @@ -42,7 +42,7 @@ index fb044a60c79..0ca525380c9 100644 GRUB_MOD_LICENSE ("GPLv3+"); -@@ -425,6 +426,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), +@@ -440,6 +441,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), } grub_file_close (file); @@ -51,7 +51,7 @@ index fb044a60c79..0ca525380c9 100644 } diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c -index b0679a9f6c9..a7b4a57ec4f 100644 +index 4df6595954d..d5ad02a33a1 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -36,6 +36,7 @@ @@ -62,7 +62,7 @@ index b0679a9f6c9..a7b4a57ec4f 100644 #if defined (GRUB_MACHINE_EFI) #include -@@ -131,8 +132,9 @@ grub_multiboot_load (grub_file_t file, const char *filename) +@@ -131,8 +132,9 @@ grub_multiboot2_load (grub_file_t file, const char *filename) COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); diff --git a/0223-Fix-boot-when-there-s-no-TPM.patch b/0309-Fix-boot-when-there-s-no-TPM.patch similarity index 92% rename from 0223-Fix-boot-when-there-s-no-TPM.patch rename to 0309-Fix-boot-when-there-s-no-TPM.patch index 886cb577..07d1a4c3 100644 --- a/0223-Fix-boot-when-there-s-no-TPM.patch +++ b/0309-Fix-boot-when-there-s-no-TPM.patch @@ -1,4 +1,4 @@ -From 33fb6113d65a819496d0b67b8db071fedad845a7 Mon Sep 17 00:00:00 2001 +From 54444026651f712d55c1dbff142745283a18990c Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 23 Mar 2016 16:49:42 -0700 Subject: [PATCH] Fix boot when there's no TPM diff --git a/0224-Rework-TPM-measurements.patch b/0310-Rework-TPM-measurements.patch similarity index 94% rename from 0224-Rework-TPM-measurements.patch rename to 0310-Rework-TPM-measurements.patch index cc6bc38b..9d93a878 100644 --- a/0224-Rework-TPM-measurements.patch +++ b/0310-Rework-TPM-measurements.patch @@ -1,4 +1,4 @@ -From 415072bbda8b4de133c6dc6add230e41ee6d9579 Mon Sep 17 00:00:00 2001 +From cee5873d497daccb6f276f13e696383c108c5be4 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 23 Mar 2016 17:03:43 -0700 Subject: [PATCH] Rework TPM measurements @@ -73,7 +73,7 @@ index 6b56304d4a7..178f7382f07 100644 return i; } diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 48febdc8100..079e222e972 100644 +index 95a197743a9..8bb759d8a91 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -133,7 +133,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), @@ -95,7 +95,7 @@ index 48febdc8100..079e222e972 100644 rc = grub_linuxefi_secure_validate (kernel, filelen); if (rc < 0) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index bc10add45a6..32e3bb08e88 100644 +index 24fb1084b25..e052c5ddebc 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -719,7 +719,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -108,7 +108,7 @@ index bc10add45a6..32e3bb08e88 100644 grub_memcpy (&lh, kernel, sizeof (lh)); diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c -index 5d00aed65ad..0981a2cfd93 100644 +index 1c5b0ac25ce..2ce424a997b 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -174,7 +174,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) @@ -121,7 +121,7 @@ index 5d00aed65ad..0981a2cfd93 100644 header = find_header (buffer, len); diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 6b8f365c9cf..7edbc5ea6c4 100644 +index 654e363e584..547df29c213 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -162,7 +162,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -147,10 +147,10 @@ index 3005c0d19c9..78c41e33416 100644 } if (newc) diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index 0ca525380c9..cc53d429bca 100644 +index 93e026c53db..3b87dc4fab3 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c -@@ -426,7 +426,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), +@@ -441,7 +441,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), } grub_file_close (file); @@ -160,10 +160,10 @@ index 0ca525380c9..cc53d429bca 100644 } diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c -index a7b4a57ec4f..f7e333f56c1 100644 +index d5ad02a33a1..60ae4606fda 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c -@@ -132,7 +132,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) +@@ -132,7 +132,7 @@ grub_multiboot2_load (grub_file_t file, const char *filename) COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); diff --git a/0225-Fix-event-log-prefix.patch b/0311-Fix-event-log-prefix.patch similarity index 93% rename from 0225-Fix-event-log-prefix.patch rename to 0311-Fix-event-log-prefix.patch index af1b6591..23af23e4 100644 --- a/0225-Fix-event-log-prefix.patch +++ b/0311-Fix-event-log-prefix.patch @@ -1,4 +1,4 @@ -From 0816621235226952a5bd0cfd027eb97ff84df547 Mon Sep 17 00:00:00 2001 +From 08f7334af94d8eb29f115c21053a90169a75a264 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 29 Mar 2016 15:36:49 -0700 Subject: [PATCH] Fix event log prefix diff --git a/0226-Set-the-first-boot-menu-entry-as-default-when-using-.patch b/0312-Set-the-first-boot-menu-entry-as-default-when-using-.patch similarity index 81% rename from 0226-Set-the-first-boot-menu-entry-as-default-when-using-.patch rename to 0312-Set-the-first-boot-menu-entry-as-default-when-using-.patch index 3a26a6cb..b73aefd0 100644 --- a/0226-Set-the-first-boot-menu-entry-as-default-when-using-.patch +++ b/0312-Set-the-first-boot-menu-entry-as-default-when-using-.patch @@ -1,8 +1,8 @@ -From 8278e40fdc4a4db0865fc632cbe2dcf7c124ba7a Mon Sep 17 00:00:00 2001 +From e73ac6cf8f166b6a87a06a504af66730e5c37e22 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 6 Apr 2018 14:08:36 +0200 -Subject: [PATCH] Set the first boot menu entry as default when using - BLS fragments +Subject: [PATCH] Set the first boot menu entry as default when using BLS + fragments When BootLoaderSpec configuration files are used, the default boot menu entry is always set to the first entry as sorted by the blscfg command. @@ -14,10 +14,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index f5daefb9d24..b24bb410dc0 100644 +index aec1ca3eba0..1e7ec7071c3 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -149,6 +149,7 @@ if [ -s \$prefix/grubenv ]; then +@@ -158,6 +158,7 @@ if [ -s \$prefix/grubenv ]; then fi EOF diff --git a/0227-tpm-fix-warnings-when-compiling-for-platforms-other-.patch b/0313-tpm-fix-warnings-when-compiling-for-platforms-other-.patch similarity index 94% rename from 0227-tpm-fix-warnings-when-compiling-for-platforms-other-.patch rename to 0313-tpm-fix-warnings-when-compiling-for-platforms-other-.patch index 44a1b5d0..5dbf70b7 100644 --- a/0227-tpm-fix-warnings-when-compiling-for-platforms-other-.patch +++ b/0313-tpm-fix-warnings-when-compiling-for-platforms-other-.patch @@ -1,8 +1,8 @@ -From 4c53f61b1a889c0f55e76a763b05b6686ec613b8 Mon Sep 17 00:00:00 2001 +From 79bf745df763b79c6797fbe19e739aa1853530bc Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 21 Aug 2016 18:24:58 -0700 -Subject: [PATCH] tpm: fix warnings when compiling for platforms other - than pc and efi +Subject: [PATCH] tpm: fix warnings when compiling for platforms other than pc + and efi --- include/grub/tpm.h | 17 +++++++++++------ diff --git a/0228-Make-TPM-errors-less-fatal.patch b/0314-Make-TPM-errors-less-fatal.patch similarity index 93% rename from 0228-Make-TPM-errors-less-fatal.patch rename to 0314-Make-TPM-errors-less-fatal.patch index a3eaca18..6f26d7d6 100644 --- a/0228-Make-TPM-errors-less-fatal.patch +++ b/0314-Make-TPM-errors-less-fatal.patch @@ -1,4 +1,4 @@ -From 406f7dda0cc2689170f102341a546c87072d1ce5 Mon Sep 17 00:00:00 2001 +From f277e243380790a7bcf8ca16a7f93b72e70ea59d Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Thu, 13 Oct 2016 13:55:26 -0700 Subject: [PATCH] Make TPM errors less fatal @@ -102,7 +102,7 @@ index 178f7382f07..d5c12957cad 100644 return i; } diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 079e222e972..6c9268f2ff5 100644 +index 8bb759d8a91..66e58b71e22 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -134,6 +134,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), @@ -122,7 +122,7 @@ index 079e222e972..6c9268f2ff5 100644 rc = grub_linuxefi_secure_validate (kernel, filelen); if (rc < 0) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 32e3bb08e88..daebe0237ff 100644 +index e052c5ddebc..cec0a96c022 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -720,6 +720,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -134,7 +134,7 @@ index 32e3bb08e88..daebe0237ff 100644 grub_memcpy (&lh, kernel, sizeof (lh)); diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c -index 0981a2cfd93..42372bf058b 100644 +index 2ce424a997b..ca85358f771 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -175,6 +175,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) @@ -146,7 +146,7 @@ index 0981a2cfd93..42372bf058b 100644 header = find_header (buffer, len); diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 7edbc5ea6c4..5b6558c6340 100644 +index 547df29c213..1e369afcbad 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -163,6 +163,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -171,10 +171,10 @@ index 78c41e33416..c2c7cfcd0fd 100644 } if (newc) diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index cc53d429bca..ae308189200 100644 +index 3b87dc4fab3..9a8dae5565b 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c -@@ -427,6 +427,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), +@@ -442,6 +442,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), grub_file_close (file); grub_tpm_measure (module, size, GRUB_BINARY_PCR, "grub_multiboot", argv[0]); @@ -183,10 +183,10 @@ index cc53d429bca..ae308189200 100644 } diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c -index f7e333f56c1..49b8af3f1d8 100644 +index 60ae4606fda..54078455e2f 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c -@@ -133,6 +133,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) +@@ -133,6 +133,7 @@ grub_multiboot2_load (grub_file_t file, const char *filename) COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); grub_tpm_measure ((unsigned char *)mld.buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename); diff --git a/0229-blscfg-handle-multiple-initramfs-images.patch b/0315-blscfg-handle-multiple-initramfs-images.patch similarity index 97% rename from 0229-blscfg-handle-multiple-initramfs-images.patch rename to 0315-blscfg-handle-multiple-initramfs-images.patch index b3aad41b..db768451 100644 --- a/0229-blscfg-handle-multiple-initramfs-images.patch +++ b/0315-blscfg-handle-multiple-initramfs-images.patch @@ -1,4 +1,4 @@ -From a230ec5c31d818c2f046acf3592a5492d3e2ea69 Mon Sep 17 00:00:00 2001 +From 37524f9812e2d3db624830e5486c997b12f78e76 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 11 Apr 2018 13:44:29 -0400 Subject: [PATCH] blscfg: handle multiple initramfs images. diff --git a/0230-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch b/0316-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch similarity index 93% rename from 0230-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch rename to 0316-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch index 3afb880c..bd4a2109 100644 --- a/0230-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch +++ b/0316-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch @@ -1,4 +1,4 @@ -From f006df881d1b2b3ca7320ecfcd33181295ec1018 Mon Sep 17 00:00:00 2001 +From e7afe9e80f5cf9a2b542b8684595c9219189aa6c Mon Sep 17 00:00:00 2001 From: Jan Hlavac Date: Tue, 10 Apr 2018 16:07:36 +0200 Subject: [PATCH] BLS: Fix grub2-switch-to-blscfg on non-EFI machines diff --git a/0231-BLS-Use-etcdefaultgrub-instead-of-etc.patch b/0317-BLS-Use-etcdefaultgrub-instead-of-etc.patch similarity index 93% rename from 0231-BLS-Use-etcdefaultgrub-instead-of-etc.patch rename to 0317-BLS-Use-etcdefaultgrub-instead-of-etc.patch index 4054cdf3..5ea23bf2 100644 --- a/0231-BLS-Use-etcdefaultgrub-instead-of-etc.patch +++ b/0317-BLS-Use-etcdefaultgrub-instead-of-etc.patch @@ -1,4 +1,4 @@ -From 29b79fde633a43223ead7874ffd373603f129832 Mon Sep 17 00:00:00 2001 +From 6152b93a644b2c2cdf14e1ab836448eb8b7bde13 Mon Sep 17 00:00:00 2001 From: Jan Hlavac Date: Tue, 10 Apr 2018 16:56:28 +0200 Subject: [PATCH] BLS: Use ${etcdefaultgrub} instead of /etc/... diff --git a/0232-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch b/0318-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch similarity index 94% rename from 0232-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch rename to 0318-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch index 19cfe4ed..20247fb3 100644 --- a/0232-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch +++ b/0318-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch @@ -1,8 +1,7 @@ -From c3a05672a450fd9e95de5df2b0c27c24fe04cd83 Mon Sep 17 00:00:00 2001 +From 7970d7fc3eee5b9d4d064ef372e8574787a065b7 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 11 Apr 2018 11:36:43 +0200 -Subject: [PATCH] Add missing options to grub2-switch-to-blscfg man - page +Subject: [PATCH] Add missing options to grub2-switch-to-blscfg man page The script --bls-directory and --backup-suffix options were not documented in the man page, add them as well so users can know what these are about. diff --git a/0233-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch b/0319-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch similarity index 95% rename from 0233-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch rename to 0319-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch index cacb22c4..0219afba 100644 --- a/0233-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch +++ b/0319-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch @@ -1,8 +1,8 @@ -From 55b00d518e029a563653401c6908489924c07238 Mon Sep 17 00:00:00 2001 +From 8cf8b269718c39276a55d9ba7b455156b38118fd Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 11 Apr 2018 11:49:24 +0200 -Subject: [PATCH] Make grub2-switch-to-blscfg to generate debug BLS - when MAKEDEBUG is set +Subject: [PATCH] Make grub2-switch-to-blscfg to generate debug BLS when + MAKEDEBUG is set If MAKEDEBUG=yes in /etc/sysconfig/kernel, then a debug menu entry should be created. So for BLS, a debug configuration file has to be created that diff --git a/0234-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch b/0320-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch similarity index 91% rename from 0234-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch rename to 0320-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch index 2b2a9bc9..99635a1e 100644 --- a/0234-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch +++ b/0320-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch @@ -1,8 +1,8 @@ -From 60bddbc714c96ca05821d52bdd7dbad7eabd6dd5 Mon Sep 17 00:00:00 2001 +From 5e7cc0915b40456319601d0ecd4df4c56ca66090 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 11 Apr 2018 12:39:59 +0200 -Subject: [PATCH] Make grub2-switch-to-blscfg to generate BLS fragment - for rescue kernel +Subject: [PATCH] Make grub2-switch-to-blscfg to generate BLS fragment for + rescue kernel If a rescue image is available, it should have a BootLoaderSpec fragment. diff --git a/0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch b/0321-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch similarity index 88% rename from 0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch rename to 0321-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch index 51ef03f1..50a5f9cc 100644 --- a/0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch +++ b/0321-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch @@ -1,8 +1,8 @@ -From 8afe59812e83e78564697ef8241ed4f1b3527423 Mon Sep 17 00:00:00 2001 +From f6531c4888e80512c40ff144399f91919e4afff2 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Tue, 24 Apr 2018 02:16:38 +0200 -Subject: [PATCH] Only attempt to query dev mounted in /boot/efi as - boot dev on EFI machines +Subject: [PATCH] Only attempt to query dev mounted in /boot/efi as boot dev on + EFI machines The 10_linux script calls grub2-probe to probe the information for the dev mounted in /boot/efi, but this directory may not exist on non-EFI machines @@ -19,10 +19,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index b24bb410dc0..c2ffc77398f 100644 +index 1e7ec7071c3..13a6115056b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -138,8 +138,13 @@ linux_entry () +@@ -147,8 +147,13 @@ linux_entry () fi fi diff --git a/0236-Include-OSTree-path-when-searching-kernels-images-if.patch b/0322-Include-OSTree-path-when-searching-kernels-images-if.patch similarity index 87% rename from 0236-Include-OSTree-path-when-searching-kernels-images-if.patch rename to 0322-Include-OSTree-path-when-searching-kernels-images-if.patch index 25211d6e..e49c97b3 100644 --- a/0236-Include-OSTree-path-when-searching-kernels-images-if.patch +++ b/0322-Include-OSTree-path-when-searching-kernels-images-if.patch @@ -1,8 +1,8 @@ -From 459eaeacbb40116dcb501cf165c7816e70c66fb3 Mon Sep 17 00:00:00 2001 +From f962615901c9bf5775a27db5b42119f9e07df7a5 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Tue, 24 Apr 2018 02:28:04 +0200 -Subject: [PATCH] Include OSTree path when searching kernels images if - BLS config is enabled +Subject: [PATCH] Include OSTree path when searching kernels images if BLS + config is enabled The OSTree based distros (i.e: Fedora Atomic) don't install kernel images in the /boot directory, but in /boot/ostree. So the 10_linux script isn't @@ -20,10 +20,10 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 6 insertions(+) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c2ffc77398f..15ba8eff8a6 100644 +index 13a6115056b..bcb81943aa2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -250,6 +250,12 @@ case "x$machine" in +@@ -253,6 +253,12 @@ case "x$machine" in done ;; esac diff --git a/0237-Use-BLS-version-field-to-compare-entries-if-id-field.patch b/0323-Use-BLS-version-field-to-compare-entries-if-id-field.patch similarity index 91% rename from 0237-Use-BLS-version-field-to-compare-entries-if-id-field.patch rename to 0323-Use-BLS-version-field-to-compare-entries-if-id-field.patch index 0c94feea..387d116b 100644 --- a/0237-Use-BLS-version-field-to-compare-entries-if-id-field.patch +++ b/0323-Use-BLS-version-field-to-compare-entries-if-id-field.patch @@ -1,8 +1,8 @@ -From 689a48c76bee8049a50f962852f43f108c815450 Mon Sep 17 00:00:00 2001 +From 7db97ecd4fe7dfafe539094f92f2844307e920bd Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 27 Apr 2018 17:53:41 +0200 -Subject: [PATCH] Use BLS version field to compare entries if id field - isn't defined +Subject: [PATCH] Use BLS version field to compare entries if id field isn't + defined The BootLoaderSpec fragments generated by OSTree don't have the id field, so grub2 will attempt to sort the entries by using the title field which diff --git a/0238-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch b/0324-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch similarity index 89% rename from 0238-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch rename to 0324-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch index 70494b47..acce5d98 100644 --- a/0238-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch +++ b/0324-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch @@ -1,8 +1,7 @@ -From 0994be8d655420685d900a08443b4fd53f639e72 Mon Sep 17 00:00:00 2001 +From 347eafcd065088d3976ff4df3a202150b7704325 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 10 May 2018 10:52:11 +0200 -Subject: [PATCH] Add version field to BLS generated by - grub2-switch-to-blscfg +Subject: [PATCH] Add version field to BLS generated by grub2-switch-to-blscfg The version field is present in the BLS fragments that are shipped in the kernel packages, so add it to the BLS generated by grub2-switch-to-blscfg diff --git a/0325-Fixup-for-newer-compiler.patch b/0325-Fixup-for-newer-compiler.patch new file mode 100644 index 00000000..1c076ada --- /dev/null +++ b/0325-Fixup-for-newer-compiler.patch @@ -0,0 +1,36 @@ +From b305c85dcb8541dccd8d3970a1768ee05a5ff4e2 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 10 May 2018 13:40:19 -0400 +Subject: [PATCH] Fixup for newer compiler + +--- + grub-core/fs/btrfs.c | 2 +- + include/grub/gpt_partition.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 7002ad81b7e..dac73b2fa8b 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -198,7 +198,7 @@ struct grub_btrfs_inode + grub_uint64_t size; + grub_uint8_t dummy2[0x70]; + struct grub_btrfs_time mtime; +-} GRUB_PACKED; ++} GRUB_PACKED __attribute__ ((aligned(8))); + + struct grub_btrfs_extent_data + { +diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h +index 7a93f43291c..8212697bf6b 100644 +--- a/include/grub/gpt_partition.h ++++ b/include/grub/gpt_partition.h +@@ -76,7 +76,7 @@ struct grub_gpt_partentry + grub_uint64_t end; + grub_uint64_t attrib; + char name[72]; +-} GRUB_PACKED; ++} GRUB_PACKED __attribute__ ((aligned(8))); + + grub_err_t + grub_gpt_partition_map_iterate (grub_disk_t disk, diff --git a/0326-Don-t-attempt-to-export-the-start-and-_start-symbols.patch b/0326-Don-t-attempt-to-export-the-start-and-_start-symbols.patch new file mode 100644 index 00000000..519a5d01 --- /dev/null +++ b/0326-Don-t-attempt-to-export-the-start-and-_start-symbols.patch @@ -0,0 +1,42 @@ +From 8b5617835e6c1042493707d9f2174fef16872f71 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Sat, 12 May 2018 11:29:07 +0200 +Subject: [PATCH] Don't attempt to export the start and _start symbols for + grub-emu + +Commit 318ee04aadc ("make better backtraces") reworked the backtrace logic +but the changes lead to the following build error on the grub-emu platform: + +grub_emu_lite-symlist.o:(.data+0xf08): undefined reference to `start' +collect2: error: ld returned 1 exit status +make[3]: *** [Makefile:25959: grub-emu-lite] Error 1 +make[3]: *** Waiting for unfinished jobs.... +cat kernel_syms.input | grep -v '^#' | sed -n \ + -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \ + -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \ + | sort -u >kernel_syms.lst + +The problem is that start and _start symbols are exported unconditionally, +but these aren't defined for grub-emu since is an emultaed platform so it +doesn't have a startup logic. Don't attempt to export those for grub-emu. + +Signed-off-by: Javier Martinez Canillas +--- + include/grub/kernel.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/grub/kernel.h b/include/grub/kernel.h +index ae69218af20..9548d552aad 100644 +--- a/include/grub/kernel.h ++++ b/include/grub/kernel.h +@@ -108,8 +108,10 @@ grub_addr_t grub_modules_get_end (void); + + #endif + ++#if !defined(GRUB_MACHINE_EMU) + void EXPORT_FUNC(start) (void); + void EXPORT_FUNC(_start) (void); ++#endif + + /* The start point of the C code. */ + void grub_main (void) __attribute__ ((noreturn)); diff --git a/0327-Simplify-BLS-entry-key-val-pairs-lookup.patch b/0327-Simplify-BLS-entry-key-val-pairs-lookup.patch new file mode 100644 index 00000000..7c2de459 --- /dev/null +++ b/0327-Simplify-BLS-entry-key-val-pairs-lookup.patch @@ -0,0 +1,170 @@ +From 914002731bb90e7266f8fc53352ca5a9bb6aabf1 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 11 May 2018 23:47:31 +0200 +Subject: [PATCH] Simplify BLS entry key val pairs lookup + +The pairs found in the BLS are being sorted but this isn't +really needed and it makes the implementation complex and error prone. + +For example, the current implementation has the following issues: + +1) Fields not present in the grub2 menu entry + + linux /linuz + initrd /foo + initrd /bar + + load_video + set gfx_payload=keep + insmod gzio + linux /boot/linuz + initrd /boot/bar + +2) Fields present but in the wrong order + + title Fedora (4.16.6-300.fc28.x86_64-tuned) 28 (Twenty Eight) + version 4.16.6-300.fc28.x86_64 + linux /vmlinuz-4.16.6-300.fc28.x86_64 + initrd /foo.img + initrd /bar.img + options $kernelopts + id fedora-20180430150025-4.16.6-300.fc28.x86_64 + + load_video + set gfx_payload=keep + insmod gzio + linux /boot/vmlinuz-4.16.6-300.fc28.x86_64 $kernelopts + initrd /boot/bar.img /boot/foo.img + +It's important to preserve the order in which fields have been defined +in the BLS fragment since for some of the fields the order has meaning. +For example, initramfs images have to be passed to the kernel in order +that were defined in the BLS fragment. + +This patch simplifies the pairs storage and lookup. Rather +than sorting and attempt to later figure out what's the expected order, +just store it in the same order as they were defined in the BLS config +file and return in that same order to callers when these look them up. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 88 ++++++++++----------------------------------- + 1 file changed, 18 insertions(+), 70 deletions(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index 72ee497ea2d..111972d5f67 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -169,84 +169,35 @@ static void bls_free_entry(struct bls_entry *entry) + grub_free (entry); + } + +-static int keyval_cmp (const void *p0, const void *p1, +- void *state UNUSED) +-{ +- const struct keyval *kv0 = *(struct keyval * const *)p0; +- const struct keyval *kv1 = *(struct keyval * const *)p1; +- int rc; +- +- rc = grub_strcmp(kv0->key, kv1->key); +- +- return rc; +-} +- + /* Find they value of the key named by keyname. If there are allowed to be + * more than one, pass a pointer to an int set to -1 the first time, and pass + * the same pointer through each time after, and it'll return them in sorted +- * order. */ ++ * order as defined in the BLS fragment file */ + static char *bls_get_val(struct bls_entry *entry, const char *keyname, int *last) + { +- char *foo = (char *)""; +- struct keyval *kv = NULL, **kvp, key = {keyname, foo}, *keyp = &key; ++ int idx, start = 0; ++ struct keyval *kv = NULL; + +- /* if we've already found an entry that matches, just iterate */ +- if (last && *last >= 0) +- { +- int next = ++last[0]; ++ if (last) ++ start = *last + 1; + +- if (next == entry->nkeyvals) +- { +-done: +- *last = -1; +- return NULL; +- } ++ for (idx = start; idx < entry->nkeyvals; idx++) { ++ kv = entry->keyvals[idx]; + +- kv = entry->keyvals[next]; +- if (grub_strcmp (keyname, kv->key)) +- goto done; ++ if (!grub_strcmp (keyname, kv->key)) ++ break; ++ } + +- return kv->val; +- } ++ if (idx == entry->nkeyvals) { ++ if (last) ++ *last = -1; ++ return NULL; ++ } + +- kvp = grub_bsearch(&keyp, &entry->keyvals[0], entry->nkeyvals, +- sizeof (struct keyval *), keyval_cmp, NULL); +- if (kvp) +- kv = *kvp; ++ if (last) ++ *last = idx; + +- if (kv) +- { +- /* if we've got uninitialized but present state, track back until we find +- * the first match */ +- if (last) +- { +- grub_dprintf("blscfg", "%s trying to find another entry because last was set\n", __func__); +- /* figure out the position of this entry in the array */ +- int idx; +- for (idx = 0 ; idx < entry->nkeyvals; idx++) +- if (entry->keyvals[idx] == kv) +- break; +- *last = idx; +- +- while (idx > 0) +- { +- struct keyval *kvtmp = entry->keyvals[idx-1]; +- if (idx == 0 || grub_strcmp (keyname, kvtmp->key)) +- { +- /* if we're at the start, or if the previous entry doesn't +- * match, then we're done */ +- *last = idx; +- break; +- } +- else +- /* but if it does match, keep going backwards */ +- idx--; +- } +- } +- +- return kv->val; +- } +- return NULL; ++ return kv->val; + } + + #define goto_return(x) ({ ret = (x); goto finish; }) +@@ -503,9 +454,6 @@ static int read_entry ( + break; + } + +- grub_qsort(&entry->keyvals[0], entry->nkeyvals, sizeof (struct keyval *), +- keyval_cmp, NULL); +- + finish: + grub_free (p); + diff --git a/0328-Add-relative-path-to-the-kernel-and-initrds-BLS-fiel.patch b/0328-Add-relative-path-to-the-kernel-and-initrds-BLS-fiel.patch new file mode 100644 index 00000000..377d9623 --- /dev/null +++ b/0328-Add-relative-path-to-the-kernel-and-initrds-BLS-fiel.patch @@ -0,0 +1,73 @@ +From 9472d57fe22cfd2e03958940ece32bfe759765ea Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Mon, 4 Jun 2018 16:10:22 +0200 +Subject: [PATCH] Add relative path to the kernel and initrds BLS fields if + needed + +The static BLS config file shipped with the kernel package assumes that +the /boot directory is a mount point, and that the kernel and initramfs +images relative path is to the root of a boot partition. + +But there are cases in which this isn't true, for example if a user has +its /boot in a btrfs subvolume or if /boot isn't a mount point at all. + +So instead of always using the BLS fragment file as distributed by the +package, check the relative path that GRUB 2 has to use for the images. + +Signed-off-by: Javier Martinez Canillas +--- + util/grub-switch-to-blscfg.in | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index 89487ad611c..2482483a437 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -188,6 +188,7 @@ fi + mkbls() { + local kernelver=$1 && shift + local datetime=$1 && shift ++ local bootprefix=$1 && shift + + local debugname="" + local debugid="" +@@ -206,8 +207,8 @@ mkbls() { + cat <"${bls_target}" + fi + ++ linux="$(grep '^linux[ \t]' "${bls_target}" | sed -e 's,^linux[ \t]*,,')" ++ initrd="$(grep '^initrd[ \t]' "${bls_target}" | sed -e 's,^initrd[ \t]*,,')" ++ linux_relpath="$("${grub_mkrelpath}" /boot/$linux)" ++ initrd_relpath="$("${grub_mkrelpath}" /boot/$initrd)" ++ ++ if [[ $linux != $linux_relpath ]]; then ++ sed -i -e "s,^linux.*,linux ${linux_relpath},g" "${bls_target}" ++ sed -i -e "s,^initrd.*,initrd ${initrd_relpath},g" "${bls_target}" ++ fi ++ + if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then + arch="$(uname -m)" + bls_debug="$(echo ${bls_target} | sed -e "s/\.${arch}/-debug.${arch}/")" +@@ -247,7 +258,10 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + done + + if [[ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]]; then +- mkbls "0-rescue-${MACHINE_ID}" "0" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" ++ if [[ $linux != $linux_relpath ]]; then ++ bootprefix="$(dirname ${linux_relpath})" ++ fi ++ mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" + fi + + GENERATE=0 diff --git a/0329-Skip-leading-spaces-on-BLS-field-values.patch b/0329-Skip-leading-spaces-on-BLS-field-values.patch new file mode 100644 index 00000000..4893b059 --- /dev/null +++ b/0329-Skip-leading-spaces-on-BLS-field-values.patch @@ -0,0 +1,56 @@ +From e6fb0f244c109f42288203654db19f4f0af113ed Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Thu, 7 Jun 2018 00:44:51 +0200 +Subject: [PATCH] Skip leading spaces on BLS field values + +The GRUB 2 blscfg command doesn't parse correctly the BLS fields if these +have extra spaces before the field values. For example, the following BLS +fragment generates a wrong menu entry due using spaces to tabulate values: + +title Fedora 28 (Twenty Eight) +version 4.16.13-300.fc28.x86_64 +machine-id e5c131dfee3249cbb9891c2641d8e350 +linux /vmlinuz-4.16.13-300.fc28.x86_64 +initrd /initramfs-4.16.13-300.fc28.x86_64.img +options root=/dev/mapper/fedora-root ro + +Wrong generated menu entry: + +load_video +set gfx_payload=keep +insmod gzio +linux ($root) /vmlinuz-4.16.13-300.fc28.x86_64 root=/dev/mapper/fedora-root ro +initrd ($root) /initramfs-4.16.13-300.fc28.x86_64.img + +Correct menu entry after the fix: + +load_video +set gfx_payload=keep +insmod gzio +linux ($root)/vmlinuz-4.16.13-300.fc28.x86_64 root=/dev/mapper/fedora-root ro +initrd ($root)/initramfs-4.16.13-300.fc28.x86_64.img + +Resolves: rhbz#1588184 + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index 111972d5f67..cd5c29fdf74 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -448,7 +448,11 @@ static int read_entry ( + + separator[0] = '\0'; + +- rc = bls_add_keyval (entry, buf, separator+1); ++ do { ++ separator++; ++ } while (*separator == ' ' || *separator == '\t'); ++ ++ rc = bls_add_keyval (entry, buf, separator); + grub_free (buf); + if (rc < 0) + break; diff --git a/0239-Fixup-for-newer-compiler.patch b/0330-Fixup-for-newer-compiler.patch similarity index 50% rename from 0239-Fixup-for-newer-compiler.patch rename to 0330-Fixup-for-newer-compiler.patch index 74f6a2c8..3f3d294e 100644 --- a/0239-Fixup-for-newer-compiler.patch +++ b/0330-Fixup-for-newer-compiler.patch @@ -1,40 +1,12 @@ -From 0724038a6f554f688cfcd6e05d52329c384d8a6d Mon Sep 17 00:00:00 2001 +From b58159634e533163d126f2f6387680cf68c02333 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2018 13:40:19 -0400 Subject: [PATCH] Fixup for newer compiler --- - grub-core/fs/btrfs.c | 2 +- - include/grub/gpt_partition.h | 2 +- - conf/Makefile.common | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) + conf/Makefile.common | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 3cd9472197c..8d3f644e124 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -198,7 +198,7 @@ struct grub_btrfs_inode - grub_uint64_t size; - grub_uint8_t dummy2[0x70]; - struct grub_btrfs_time mtime; --} GRUB_PACKED; -+} GRUB_PACKED __attribute__ ((aligned(8))); - - struct grub_btrfs_extent_data - { -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f6725a4..8cddf997efc 100644 ---- a/include/grub/gpt_partition.h -+++ b/include/grub/gpt_partition.h -@@ -76,7 +76,7 @@ struct grub_gpt_partentry - grub_uint64_t end; - grub_uint64_t attrib; - char name[72]; --} GRUB_PACKED; -+} GRUB_PACKED __attribute__ ((aligned(8))); - - grub_err_t - grub_gpt_partition_map_iterate (grub_disk_t disk, diff --git a/conf/Makefile.common b/conf/Makefile.common index 044ab3abe88..c75848f5c06 100644 --- a/conf/Makefile.common diff --git a/0331-TPM-Fix-hash_log_extend_event-function-prototype.patch b/0331-TPM-Fix-hash_log_extend_event-function-prototype.patch new file mode 100644 index 00000000..07cfee03 --- /dev/null +++ b/0331-TPM-Fix-hash_log_extend_event-function-prototype.patch @@ -0,0 +1,50 @@ +From 04216b9900e47cd22e1f1c5108e028f55bb40ded Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 15 Jun 2018 09:25:00 +0200 +Subject: [PATCH] TPM: Fix hash_log_extend_event function prototype + +The DataToHash argument is a efi_physical_address, not a *pointer* to +a efi_physical_address. + +This distinction is important for 32 bits builds, where the pointer is +only 32 bits where as an efi_physical_address is 64 bits. + +Fixing this fixes the tpm code not working with 32 bits build and grub +showing multiple: + +error: Invalid parameter + +Messages during boot, followed by a "press any key to continue" message. + +Signed-off-by: Hans de Goede +--- + grub-core/kern/efi/tpm.c | 2 +- + include/grub/efi/tpm.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/efi/tpm.c b/grub-core/kern/efi/tpm.c +index c9fb3c133f3..36e1f69df16 100644 +--- a/grub-core/kern/efi/tpm.c ++++ b/grub-core/kern/efi/tpm.c +@@ -245,7 +245,7 @@ grub_tpm2_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf, + event->Size = sizeof(*event) - sizeof(event->Event) + grub_strlen(description) + 1; + grub_memcpy(event->Event, description, grub_strlen(description) + 1); + +- status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, buf, ++ status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (unsigned long) buf, + (grub_uint64_t) size, event); + + switch (status) { +diff --git a/include/grub/efi/tpm.h b/include/grub/efi/tpm.h +index e2aff4a3c22..63d8a0fe714 100644 +--- a/include/grub/efi/tpm.h ++++ b/include/grub/efi/tpm.h +@@ -129,7 +129,7 @@ struct grub_efi_tpm2_protocol + grub_efi_boolean_t *EventLogTruncated); + grub_efi_status_t (*hash_log_extend_event) (struct grub_efi_tpm2_protocol *this, + grub_efi_uint64_t Flags, +- grub_efi_physical_address_t *DataToHash, ++ grub_efi_physical_address_t DataToHash, + grub_efi_uint64_t DataToHashLen, + EFI_TCG2_EVENT *EfiTcgEvent); + grub_efi_status_t (*submit_command) (struct grub_efi_tpm2_protocol *this, diff --git a/0332-TPM-Fix-compiler-warnings.patch b/0332-TPM-Fix-compiler-warnings.patch new file mode 100644 index 00000000..5d03c5cf --- /dev/null +++ b/0332-TPM-Fix-compiler-warnings.patch @@ -0,0 +1,72 @@ +From fcff875198d2e85720fe7c29a8ad28cef61d611b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 15 Jun 2018 09:58:50 +0200 +Subject: [PATCH] TPM: Fix compiler warnings + +Stop defining our own Event type in tpm.c instead use the one from +the header, so that it matches the function prototype. +Note this requires some further code changes to go from all lowercaps +of the private Event type to the CamelCaps from the header. + +Also cast buf, which gets passed as a efi_physicall_address_t to an +integer, to avoid the compiler complaining about passing a pointer as +an integer. + +Signed-off-by: Hans de Goede +--- + grub-core/kern/efi/tpm.c | 24 ++++++++---------------- + 1 file changed, 8 insertions(+), 16 deletions(-) + +diff --git a/grub-core/kern/efi/tpm.c b/grub-core/kern/efi/tpm.c +index 36e1f69df16..0d3ebe22e57 100644 +--- a/grub-core/kern/efi/tpm.c ++++ b/grub-core/kern/efi/tpm.c +@@ -161,21 +161,12 @@ grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, + } + } + +-typedef struct { +- grub_uint32_t pcrindex; +- grub_uint32_t eventtype; +- grub_uint8_t digest[20]; +- grub_uint32_t eventsize; +- grub_uint8_t event[1]; +-} Event; +- +- + static grub_err_t + grub_tpm1_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf, + grub_size_t size, grub_uint8_t pcr, + const char *description) + { +- Event *event; ++ TCG_PCR_EVENT *event; + grub_efi_status_t status; + grub_efi_tpm_protocol_t *tpm; + grub_efi_physical_address_t lastevent; +@@ -188,18 +179,19 @@ grub_tpm1_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf, + if (!grub_tpm_present(tpm)) + return 0; + +- event = grub_zalloc(sizeof (Event) + grub_strlen(description) + 1); ++ event = grub_zalloc(sizeof (TCG_PCR_EVENT) + grub_strlen(description) + 1); + if (!event) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + N_("cannot allocate TPM event buffer")); + +- event->pcrindex = pcr; +- event->eventtype = EV_IPL; +- event->eventsize = grub_strlen(description) + 1; +- grub_memcpy(event->event, description, event->eventsize); ++ event->PCRIndex = pcr; ++ event->EventType = EV_IPL; ++ event->EventSize = grub_strlen(description) + 1; ++ grub_memcpy(event->Event, description, event->EventSize); + + algorithm = TCG_ALG_SHA; +- status = efi_call_7 (tpm->log_extend_event, tpm, buf, (grub_uint64_t) size, ++ status = efi_call_7 (tpm->log_extend_event, tpm, ++ (unsigned long) buf, (grub_uint64_t) size, + algorithm, event, &eventnum, &lastevent); + + switch (status) { diff --git a/0333-grub-switch-to-blscfg.in-get-rid-of-a-bunch-of-bashi.patch b/0333-grub-switch-to-blscfg.in-get-rid-of-a-bunch-of-bashi.patch new file mode 100644 index 00000000..f4615196 --- /dev/null +++ b/0333-grub-switch-to-blscfg.in-get-rid-of-a-bunch-of-bashi.patch @@ -0,0 +1,113 @@ +From b459fc6496dfe6defa8ced4eccdafa21b7999f94 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 22 Jun 2018 14:01:06 -0400 +Subject: [PATCH] grub-switch-to-blscfg.in: get rid of a bunch of bashisms + +Since this says /bin/sh at the top, it should work with dash. + +Signed-off-by: Peter Jones +--- + util/grub-switch-to-blscfg.in | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index 2482483a437..dac41e73836 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -151,18 +151,18 @@ done + + find_grub_cfg() { + local candidate="" +- while [[ -e "${candidate}" || $# -gt 0 ]] ++ while [ -e "${candidate}" -o $# -gt 0 ] + do +- if [[ ! -e "${candidate}" ]] ; then ++ if [ ! -e "${candidate}" ] ; then + candidate="$1" + shift + fi + +- if [[ -L "${candidate}" ]]; then ++ if [ -L "${candidate}" ]; then + candidate="$(realpath "${candidate}")" + fi + +- if [[ -f "${candidate}" ]]; then ++ if [ -f "${candidate}" ]; then + export GRUB_CONFIG_FILE="${candidate}" + return 0 + fi +@@ -175,11 +175,11 @@ if ! find_grub_cfg ${startlink} ${grubdir}/grub.cfg ; then + exit 1 + fi + +-if [[ ! -d "${blsdir}" ]]; then ++if [ ! -d "${blsdir}" ]; then + install -m 700 -d "${blsdir}" + fi + +-if [[ -f /etc/machine-id ]]; then ++if [ -f /etc/machine-id ]; then + MACHINE_ID=$(cat /etc/machine-id) + else + MACHINE_ID=$(dmesg | sha256sum) +@@ -194,9 +194,9 @@ mkbls() { + local debugid="" + local flavor="" + +- if [[ "$kernelver" == *\+* ]] ; then ++ if [ "$kernelver" == *\+* ] ; then + local flavor=-"${kernelver##*+}" +- if [[ "${flavor}" == "-debug" ]]; then ++ if [ "${flavor}" == "-debug" ]; then + local debugname=" with debugging" + local debugid="-debug" + fi +@@ -219,15 +219,15 @@ EOF + } + + for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do +- if [[ ! -d "/lib/modules/${kernelver}" ]] ; then ++ if [ ! -d "/lib/modules/${kernelver}" ] ; then + continue + fi +- if [[ ! -f "/boot/vmlinuz-${kernelver}" ]]; then ++ if [ ! -f "/boot/vmlinuz-${kernelver}" ]; then + continue + fi + bls_target="${blsdir}/${MACHINE_ID}-${kernelver}.conf" + kernel_dir="/lib/modules/${kernelver}" +- if [[ -f "${kernel_dir}/bls.conf" ]]; then ++ if [ -f "${kernel_dir}/bls.conf" ]; then + cp -af "${kernel_dir}/bls.conf" "${bls_target}" + else + mkbls "${kernelver}" \ +@@ -240,7 +240,7 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + linux_relpath="$("${grub_mkrelpath}" /boot/$linux)" + initrd_relpath="$("${grub_mkrelpath}" /boot/$initrd)" + +- if [[ $linux != $linux_relpath ]]; then ++ if [ $linux != $linux_relpath ] ; then + sed -i -e "s,^linux.*,linux ${linux_relpath},g" "${bls_target}" + sed -i -e "s,^initrd.*,initrd ${initrd_relpath},g" "${bls_target}" + fi +@@ -257,8 +257,8 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + fi + done + +-if [[ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]]; then +- if [[ $linux != $linux_relpath ]]; then ++if [ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then ++ if [ $linux != $linux_relpath ]; then + bootprefix="$(dirname ${linux_relpath})" + fi + mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" +@@ -282,7 +282,7 @@ elif ! grep -q '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" ; then + GENERATE=1 + fi + +-if [[ "${GENERATE}" -eq 1 ]] ; then ++if [ "${GENERATE}" -eq 1 ] ; then + cp -af "${GRUB_CONFIG_FILE}" "${GRUB_CONFIG_FILE}${backupsuffix}" + if ! grub2-mkconfig -o "${GRUB_CONFIG_FILE}" ; then + cp -af "${GRUB_CONFIG_FILE}${backupsuffix}" "${GRUB_CONFIG_FILE}" diff --git a/0334-grub-switch-to-blscfg.in-Better-boot-prefix-checking.patch b/0334-grub-switch-to-blscfg.in-Better-boot-prefix-checking.patch new file mode 100644 index 00000000..c2969449 --- /dev/null +++ b/0334-grub-switch-to-blscfg.in-Better-boot-prefix-checking.patch @@ -0,0 +1,73 @@ +From 74134119d1887609080be805438e7a7777aa2cf2 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 22 Jun 2018 14:04:28 -0400 +Subject: [PATCH] grub-switch-to-blscfg.in: Better boot prefix checking + +Signed-off-by: Peter Jones +--- + util/grub-switch-to-blscfg.in | 36 +++++++++++++++++------------------- + 1 file changed, 17 insertions(+), 19 deletions(-) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index dac41e73836..884cf45b1e1 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -219,30 +219,31 @@ EOF + } + + for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do +- if [ ! -d "/lib/modules/${kernelver}" ] ; then +- continue +- fi +- if [ ! -f "/boot/vmlinuz-${kernelver}" ]; then +- continue +- fi + bls_target="${blsdir}/${MACHINE_ID}-${kernelver}.conf" ++ linux="$(grep '^linux[ \t]' "${bls_target}" | sed -e 's,^linux[ \t]+,,')" + kernel_dir="/lib/modules/${kernelver}" +- if [ -f "${kernel_dir}/bls.conf" ]; then ++ ++ if [ ! -d "${kernel_dir}" ] ; then ++ continue ++ fi ++ if [ ! -f "${linux_path}" ]; then ++ continue ++ fi ++ ++ linux_relpath="$("${grub_mkrelpath}" "${linux}")" ++ bootprefix="${linux%%"${linux_relpath}"}" ++ ++ if [ -f "${kernel_dir}/bls.conf" ] ; then + cp -af "${kernel_dir}/bls.conf" "${bls_target}" + else + mkbls "${kernelver}" \ + "$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" \ ++ "${bootprefix}" \ + >"${bls_target}" + fi + +- linux="$(grep '^linux[ \t]' "${bls_target}" | sed -e 's,^linux[ \t]*,,')" +- initrd="$(grep '^initrd[ \t]' "${bls_target}" | sed -e 's,^initrd[ \t]*,,')" +- linux_relpath="$("${grub_mkrelpath}" /boot/$linux)" +- initrd_relpath="$("${grub_mkrelpath}" /boot/$initrd)" +- +- if [ $linux != $linux_relpath ] ; then +- sed -i -e "s,^linux.*,linux ${linux_relpath},g" "${bls_target}" +- sed -i -e "s,^initrd.*,initrd ${initrd_relpath},g" "${bls_target}" ++ if [ -n "${bootprefix}" ]; then ++ sed -i -e "s,\([ \t]\)${bootprefix},\1,g" "${bls_target}" + fi + + if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then +@@ -257,10 +258,7 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + fi + done + +-if [ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then +- if [ $linux != $linux_relpath ]; then +- bootprefix="$(dirname ${linux_relpath})" +- fi ++if [ -n "${bootprefix}" -a -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then + mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" + fi + diff --git a/0335-Use-boot-loader-entries-as-BLS-directory-path-also-o.patch b/0335-Use-boot-loader-entries-as-BLS-directory-path-also-o.patch new file mode 100644 index 00000000..ff998871 --- /dev/null +++ b/0335-Use-boot-loader-entries-as-BLS-directory-path-also-o.patch @@ -0,0 +1,152 @@ +From 11f7d8759ba2f116f8b516836ff2b40189159fa3 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Mon, 25 Jun 2018 11:45:33 +0200 +Subject: [PATCH] Use /boot/loader/entries as BLS directory path also on EFI + systems + +For EFI systems, the BLS fragments were stored in the EFI System Partition +(ESP) while in non-EFI systems it was stored in /boot. + +For consistency, it's better to always store the BLS fragments in the same +path regardless of the firmware interface used. + +Also change the grub2-switch-to-blscfg script default BLS directory. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 48 ++++++++++++++++++++++++++++++++----------- + util/grub-switch-to-blscfg.in | 4 ++-- + 2 files changed, 38 insertions(+), 14 deletions(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index cd5c29fdf74..11fe6e2c29f 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -381,9 +381,14 @@ static int bls_cmp(const void *p0, const void *p1, void *state UNUSED) + return rc; + } + ++struct read_entry_info { ++ const char *devid; ++ const char *dirname; ++}; ++ + static int read_entry ( + const char *filename, +- const struct grub_dirhook_info *info UNUSED, ++ const struct grub_dirhook_info *dirhook_info UNUSED, + void *data) + { + grub_size_t n; +@@ -391,8 +396,7 @@ static int read_entry ( + grub_file_t f = NULL; + grub_off_t sz; + struct bls_entry *entry; +- const char *dirname= (const char *)data; +- const char *devid = grub_env_get ("boot"); ++ struct read_entry_info *info = (struct read_entry_info *)data; + + grub_dprintf ("blscfg", "filename: \"%s\"\n", filename); + +@@ -406,7 +410,7 @@ static int read_entry ( + if (grub_strcmp (filename + n - 5, ".conf") != 0) + return 0; + +- p = grub_xasprintf ("(%s)%s/%s", devid, dirname, filename); ++ p = grub_xasprintf ("(%s)%s/%s", info->devid, info->dirname, filename); + + f = grub_file_open (p); + if (!f) +@@ -655,10 +659,13 @@ static int find_entry (const char *filename, + void *data) + { + struct find_entry_info *info = (struct find_entry_info *)data; ++ struct read_entry_info read_entry_info; + grub_file_t f = NULL; + char *grubenv_path = NULL; + grub_envblk_t env = NULL; + char *default_blsdir = NULL; ++ grub_fs_t blsdir_fs = NULL; ++ grub_device_t blsdir_dev = NULL; + const char *blsdir = NULL; + char *saved_env_buf = NULL; + int r = 0; +@@ -678,9 +685,6 @@ static int find_entry (const char *filename, + if (info->platform == PLATFORM_EMU) + default_blsdir = grub_xasprintf ("%s%s", GRUB_BOOT_DEVICE, + GRUB_BLS_CONFIG_PATH); +- else if (info->platform == PLATFORM_EFI) +- default_blsdir = grub_xasprintf ("/EFI/%s%s", filename, +- GRUB_BLS_CONFIG_PATH); + else + default_blsdir = grub_xasprintf ("%s", GRUB_BLS_CONFIG_PATH); + +@@ -744,16 +748,33 @@ static int find_entry (const char *filename, + goto finish; + + grub_dprintf ("blscfg", "blsdir: \"%s\"\n", blsdir); +- if (blsdir[0] != '/' && info->platform == PLATFORM_EFI) +- blsdir = grub_xasprintf ("/EFI/%s/%s/", filename, blsdir); +- else +- blsdir = grub_strdup (blsdir); ++ blsdir = grub_strdup (blsdir); + + if (!blsdir) + goto finish; + + grub_dprintf ("blscfg", "blsdir: \"%s\"\n", blsdir); +- r = info->fs->dir (info->dev, blsdir, read_entry, (char *)blsdir); ++ if (info->platform == PLATFORM_EFI) { ++ read_entry_info.devid = grub_env_get ("root"); ++ if (!read_entry_info.devid) ++ goto finish; ++ ++ blsdir_dev = grub_device_open (read_entry_info.devid); ++ if (!blsdir_dev) ++ goto finish; ++ ++ blsdir_fs = grub_fs_probe (blsdir_dev); ++ if (!blsdir_fs) ++ goto finish; ++ ++ } else { ++ read_entry_info.devid = devid; ++ blsdir_dev = info->dev; ++ blsdir_fs = info->fs; ++ } ++ read_entry_info.dirname = blsdir; ++ ++ r = blsdir_fs->dir (blsdir_dev, blsdir, read_entry, &read_entry_info); + if (r != 0) { + grub_dprintf ("blscfg", "read_entry returned error\n"); + grub_err_t e; +@@ -773,6 +794,9 @@ static int find_entry (const char *filename, + for (r = 0; r < nentries; r++) + bls_free_entry (entries[r]); + finish: ++ if (info->platform == PLATFORM_EFI && blsdir_dev) ++ grub_device_close (blsdir_dev); ++ + nentries = 0; + + grub_free (entries); +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index 884cf45b1e1..2f37a1f740b 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -44,13 +44,13 @@ EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/') + if [ -d /sys/firmware/efi/efivars/ ]; then + startlink=/etc/grub2-efi.cfg + grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'` +- blsdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/loader/entries" | sed 's,//*,/,g'` + else + startlink=/etc/grub2.cfg + grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` +- blsdir=`echo "/@bootdirname@/loader/entries" | sed 's,//*,/,g'` + fi + ++blsdir=`echo "/@bootdirname@/loader/entries" | sed 's,//*,/,g'` ++ + backupsuffix=.bak + + export TEXTDOMAIN=@PACKAGE@ diff --git a/0336-Use-BLS-fragment-filename-as-menu-entry-id-and-for-c.patch b/0336-Use-BLS-fragment-filename-as-menu-entry-id-and-for-c.patch new file mode 100644 index 00000000..d833413e --- /dev/null +++ b/0336-Use-BLS-fragment-filename-as-menu-entry-id-and-for-c.patch @@ -0,0 +1,134 @@ +From 0f397d70eb49555316cbe08f883ffbd0724d4cd6 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 26 Jun 2018 14:01:26 +0200 +Subject: [PATCH] Use BLS fragment filename as menu entry id and for criteria + to sort + +The BLS config filenames are guaranteed to be unique, so they can be +used as GRUB2 entry id and can also be used to sort the menu entries. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 62 +++++++++------------------------------------ + 1 file changed, 12 insertions(+), 50 deletions(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index 11fe6e2c29f..23d15adfadc 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -70,6 +70,7 @@ struct bls_entry + { + struct keyval **keyvals; + int nkeyvals; ++ char *filename; + }; + + static struct bls_entry **entries; +@@ -166,6 +167,7 @@ static void bls_free_entry(struct bls_entry *entry) + + grub_free (entry->keyvals); + grub_memset (entry, 0, sizeof (*entry)); ++ grub_free (entry->filename); + grub_free (entry); + } + +@@ -327,58 +329,12 @@ finish: + + typedef int (*void_cmp_t)(void *, void *); + +-static int nulcmp(char *s0, char *s1, void_cmp_t cmp) +-{ +- grub_dprintf("blscfg", "%s got here\n", __func__); +- if (s1 && !s0) +- return 1; +- if (s0 && !s1) +- return -1; +- if (!s0 && !s1) +- return 0; +- if (cmp) +- return cmp(s0, s1); +- return grub_strcmp(s0, s1); +-} +- +-static int +-bls_keyval_cmp(struct bls_entry *e0, struct bls_entry *e1, const char *keyname) +-{ +- char *val0, *val1; +- +- val0 = bls_get_val (e0, keyname, NULL); +- val1 = bls_get_val (e1, keyname, NULL); +- +- if (val1 && !val0) +- return 1; +- +- if (val0 && !val1) +- return -1; +- +- if (!val0 && !val1) +- return 0; +- +- return nulcmp(val0, val1, (void_cmp_t)vercmp); +-} +- + static int bls_cmp(const void *p0, const void *p1, void *state UNUSED) + { + struct bls_entry * e0 = *(struct bls_entry **)p0; + struct bls_entry * e1 = *(struct bls_entry **)p1; +- int rc = 0; + +- rc = bls_keyval_cmp (e0, e1, "id"); +- +- if (rc == 0) +- rc = bls_keyval_cmp (e0, e1, "version"); +- +- if (rc == 0) +- rc = bls_keyval_cmp (e0, e1, "title"); +- +- if (rc == 0) +- rc = bls_keyval_cmp (e0, e1, "linux"); +- +- return rc; ++ return vercmp(e0->filename, e1->filename); + } + + struct read_entry_info { +@@ -424,6 +380,12 @@ static int read_entry ( + if (!entry) + goto finish; + ++ entry->filename = grub_strndup(filename, n - 5); ++ if (!entry->filename) ++ goto finish; ++ ++ entry->filename[n - 5] = '\0'; ++ + for (;;) + { + char *buf; +@@ -548,7 +510,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) + char *options = NULL; + char **initrds = NULL; + char *initrd = NULL; +- char *id = NULL; ++ char *id = entry->filename; + char *hotkey = NULL; + + char *users = NULL; +@@ -570,7 +532,6 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) + title = bls_get_val (entry, "title", NULL); + options = bls_get_val (entry, "options", NULL); + initrds = bls_make_list (entry, "initrd", NULL); +- id = bls_get_val (entry, "id", NULL); + + hotkey = bls_get_val (entry, "grub_hotkey", NULL); + users = bls_get_val (entry, "grub_users", NULL); +@@ -584,7 +545,8 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile) + argv[i] = args[i-1]; + argv[argc] = NULL; + +- grub_dprintf ("blscfg", "adding menu entry for \"%s\"\n", title); ++ grub_dprintf ("blscfg", "adding menu entry for \"%s\" with id \"%s\"\n", ++ title, id); + if (initrds) + { + int initrd_size = sizeof (GRUB_INITRD_CMD); diff --git a/0337-Fix-grub-switch-to-blscfg-boot-prefix-handling.patch b/0337-Fix-grub-switch-to-blscfg-boot-prefix-handling.patch new file mode 100644 index 00000000..41237e25 --- /dev/null +++ b/0337-Fix-grub-switch-to-blscfg-boot-prefix-handling.patch @@ -0,0 +1,58 @@ +From a0453398e525b89f1d7e381a63c3b4d09dc89046 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Mon, 9 Jul 2018 12:19:03 +0200 +Subject: [PATCH] Fix grub-switch-to-blscfg boot prefix handling + +Commit b3ac18e3265f ("grub-switch-to-blscfg.in: Better boot prefix checking") +simplified the boot prefix checking, but unfortunately introduced a couple of +regressions on the script. Fix them. + +Signed-off-by: Javier Martinez Canillas +--- + util/grub-switch-to-blscfg.in | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index 2f37a1f740b..40612e00686 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -220,7 +220,8 @@ EOF + + for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + bls_target="${blsdir}/${MACHINE_ID}-${kernelver}.conf" +- linux="$(grep '^linux[ \t]' "${bls_target}" | sed -e 's,^linux[ \t]+,,')" ++ linux="/vmlinuz-${kernelver}" ++ linux_path="/boot${linux}" + kernel_dir="/lib/modules/${kernelver}" + + if [ ! -d "${kernel_dir}" ] ; then +@@ -230,8 +231,8 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + continue + fi + +- linux_relpath="$("${grub_mkrelpath}" "${linux}")" +- bootprefix="${linux%%"${linux_relpath}"}" ++ linux_relpath="$("${grub_mkrelpath}" "${linux_path}")" ++ bootprefix="${linux_relpath%%"${linux}"}" + + if [ -f "${kernel_dir}/bls.conf" ] ; then + cp -af "${kernel_dir}/bls.conf" "${bls_target}" +@@ -243,7 +244,8 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + fi + + if [ -n "${bootprefix}" ]; then +- sed -i -e "s,\([ \t]\)${bootprefix},\1,g" "${bls_target}" ++ sed -i -e "s,^\(linux[^ \t]*[ \t]\+\).*,\1${bootprefix}${linux},g" "${bls_target}" ++ sed -i -e "/^initrd/ s,\([ \t]\+\)\([^ \t]\+\),\1${bootprefix}\2,g" "${bls_target}" + fi + + if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then +@@ -258,7 +260,7 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do + fi + done + +-if [ -n "${bootprefix}" -a -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then ++if [ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then + mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" + fi + diff --git a/0338-Revert-trim-arp-packets-with-abnormal-size.patch b/0338-Revert-trim-arp-packets-with-abnormal-size.patch new file mode 100644 index 00000000..6b8e6c0b --- /dev/null +++ b/0338-Revert-trim-arp-packets-with-abnormal-size.patch @@ -0,0 +1,27 @@ +From 45540e20eb3bcbd46ce13e7ac3f28b1ab7508b04 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 18 May 2017 14:25:45 -0400 +Subject: [PATCH] Revert "trim arp packets with abnormal size" + +This reverts commit d11b2eb425d2125f67dd8d8e9b11d9be7d6f3f11. +--- + grub-core/net/arp.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c +index d1c69ed2b55..54306e3b16d 100644 +--- a/grub-core/net/arp.c ++++ b/grub-core/net/arp.c +@@ -150,12 +150,6 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card, + if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 + && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) + { +- if ((nb->tail - nb->data) > 50) +- { +- grub_dprintf ("net", "arp packet with abnormal size (%ld bytes).\n", +- nb->tail - nb->data); +- nb->tail = nb->data + 50; +- } + grub_net_link_level_address_t target; + struct grub_net_buff nb_reply; + struct arppkt *arp_reply; diff --git a/0339-Use-xid-to-match-DHCP-replies.patch b/0339-Use-xid-to-match-DHCP-replies.patch new file mode 100644 index 00000000..95a541e3 --- /dev/null +++ b/0339-Use-xid-to-match-DHCP-replies.patch @@ -0,0 +1,65 @@ +From 799084dd0953cbe2fb016f97f0a354b78c581a9f Mon Sep 17 00:00:00 2001 +From: Andrzej Kacprowski +Date: Fri, 21 Apr 2017 09:20:38 +0200 +Subject: [PATCH] Use xid to match DHCP replies + +Transaction identifier (xid) from DHCP request +packet is stored in network level interface and used +to match request with the responses it generates. + +Resolves: rhbz#1370642 + +Signed-off-by: Andrzej Kacprowski +--- + grub-core/net/bootp.c | 3 ++- + grub-core/net/ip.c | 1 + + include/grub/net.h | 3 ++- + 3 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index da3e454466b..2869482fe06 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -777,7 +777,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), + grub_errno = GRUB_ERR_NONE; + t = 0; + } +- pack->ident = grub_cpu_to_be32 (t); ++ pack->xid = grub_cpu_to_be32 (t); ++ ifaces[j].dhcp_xid = pack->xid; + pack->seconds = grub_cpu_to_be16 (t); + + grub_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, 6); +diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c +index 7c95cc7464a..8411e0ecca3 100644 +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -275,6 +275,7 @@ handle_dgram (struct grub_net_buff *nb, + FOR_NET_NETWORK_LEVEL_INTERFACES (inf) + if (inf->card == card + && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV ++ && inf->dhcp_xid == bootp->xid + && inf->hwaddress.type == GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET + && grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr, + sizeof (inf->hwaddress.mac)) == 0) +diff --git a/include/grub/net.h b/include/grub/net.h +index f8f3ec13acc..de51894cbbf 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -292,6 +292,7 @@ struct grub_net_network_level_interface + struct grub_net_bootp_packet *dhcp_ack; + grub_size_t dhcp_acklen; + grub_uint16_t vlantag; ++ grub_uint32_t dhcp_xid; + void *data; + }; + +@@ -429,7 +430,7 @@ struct grub_net_bootp_packet + grub_uint8_t hw_type; /* hardware type. */ + grub_uint8_t hw_len; /* hardware addr len. */ + grub_uint8_t gate_hops; /* zero it. */ +- grub_uint32_t ident; /* random number chosen by client. */ ++ grub_uint32_t xid; /* transaction id chosen by client. */ + grub_uint16_t seconds; /* seconds since did initial bootstrap. */ + grub_uint16_t flags; + grub_uint32_t client_ip; diff --git a/0340-Add-support-for-non-Ethernet-network-cards.patch b/0340-Add-support-for-non-Ethernet-network-cards.patch new file mode 100644 index 00000000..e93de5cc --- /dev/null +++ b/0340-Add-support-for-non-Ethernet-network-cards.patch @@ -0,0 +1,764 @@ +From 412098fed27a315ee0c8d3ca659eeea509a907a6 Mon Sep 17 00:00:00 2001 +From: Andrzej Kacprowski +Date: Fri, 21 Apr 2017 10:06:20 +0200 +Subject: [PATCH] Add support for non-Ethernet network cards + +This patch replaces fixed 6-byte link layer address with +up to 32-byte variable sized address. +This allows supporting Infiniband and Omni-Path fabric +which use 20-byte address, but other network card types +can also take advantage of this change. +The network card driver is responsible for replacing L2 +header provided by grub2 if needed. +This approach is compatible with UEFI network stack which +also allows up to 32-byte variable size link address. + +The BOOTP/DHCP packet format is limited to 16 byte client +hardware address, if link address is more that 16-bytes +then chaddr field in BOOTP it will be set to 0 as per rfc4390. + +Resolves: rhbz#1370642 + +Signed-off-by: Andrzej Kacprowski + +Conflicts: + grub-core/net/ip.c +--- + grub-core/net/arp.c | 155 ++++++++++++++++++++++----------- + grub-core/net/bootp.c | 14 ++- + grub-core/net/drivers/efi/efinet.c | 8 +- + grub-core/net/drivers/emu/emunet.c | 1 + + grub-core/net/drivers/i386/pc/pxe.c | 13 +-- + grub-core/net/drivers/ieee1275/ofnet.c | 2 + + grub-core/net/drivers/uboot/ubootnet.c | 1 + + grub-core/net/ethernet.c | 88 +++++++++---------- + grub-core/net/icmp6.c | 15 ++-- + grub-core/net/ip.c | 4 +- + grub-core/net/net.c | 48 +++++----- + include/grub/net.h | 19 ++-- + 12 files changed, 216 insertions(+), 152 deletions(-) + +diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c +index 54306e3b16d..67b409a8acc 100644 +--- a/grub-core/net/arp.c ++++ b/grub-core/net/arp.c +@@ -31,22 +31,12 @@ enum + ARP_REPLY = 2 + }; + +-enum +- { +- /* IANA ARP constant to define hardware type as ethernet. */ +- GRUB_NET_ARPHRD_ETHERNET = 1 +- }; +- +-struct arppkt { ++struct arphdr { + grub_uint16_t hrd; + grub_uint16_t pro; + grub_uint8_t hln; + grub_uint8_t pln; + grub_uint16_t op; +- grub_uint8_t sender_mac[6]; +- grub_uint32_t sender_ip; +- grub_uint8_t recv_mac[6]; +- grub_uint32_t recv_ip; + } GRUB_PACKED; + + static int have_pending; +@@ -57,12 +47,16 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, + const grub_net_network_level_address_t *proto_addr) + { + struct grub_net_buff nb; +- struct arppkt *arp_packet; ++ struct arphdr *arp_header; + grub_net_link_level_address_t target_mac_addr; + grub_err_t err; + int i; + grub_uint8_t *nbd; + grub_uint8_t arp_data[128]; ++ grub_uint8_t hln; ++ grub_uint8_t pln; ++ grub_uint8_t arp_packet_len; ++ grub_uint8_t *tmp_ptr; + + if (proto_addr->type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) + return grub_error (GRUB_ERR_BUG, "unsupported address family"); +@@ -73,23 +67,39 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, + grub_netbuff_clear (&nb); + grub_netbuff_reserve (&nb, 128); + +- err = grub_netbuff_push (&nb, sizeof (*arp_packet)); ++ hln = inf->card->default_address.len; ++ pln = sizeof (proto_addr->ipv4); ++ arp_packet_len = sizeof (*arp_header) + 2 * (hln + pln); ++ ++ err = grub_netbuff_push (&nb, arp_packet_len); + if (err) + return err; + +- arp_packet = (struct arppkt *) nb.data; +- arp_packet->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); +- arp_packet->hln = 6; +- arp_packet->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); +- arp_packet->pln = 4; +- arp_packet->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); +- /* Sender hardware address. */ +- grub_memcpy (arp_packet->sender_mac, &inf->hwaddress.mac, 6); +- arp_packet->sender_ip = inf->address.ipv4; +- grub_memset (arp_packet->recv_mac, 0, 6); +- arp_packet->recv_ip = proto_addr->ipv4; +- /* Target protocol address */ +- grub_memset (&target_mac_addr.mac, 0xff, 6); ++ arp_header = (struct arphdr *) nb.data; ++ arp_header->hrd = grub_cpu_to_be16 (inf->card->default_address.type); ++ arp_header->hln = hln; ++ arp_header->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); ++ arp_header->pln = pln; ++ arp_header->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); ++ tmp_ptr = nb.data + sizeof (*arp_header); ++ ++ /* The source hardware address. */ ++ grub_memcpy (tmp_ptr, inf->hwaddress.mac, hln); ++ tmp_ptr += hln; ++ ++ /* The source protocol address. */ ++ grub_memcpy (tmp_ptr, &inf->address.ipv4, pln); ++ tmp_ptr += pln; ++ ++ /* The target hardware address. */ ++ grub_memset (tmp_ptr, 0, hln); ++ tmp_ptr += hln; ++ ++ /* The target protocol address */ ++ grub_memcpy (tmp_ptr, &proto_addr->ipv4, pln); ++ tmp_ptr += pln; ++ ++ grub_memset (&target_mac_addr.mac, 0xff, hln); + + nbd = nb.data; + send_ethernet_packet (inf, &nb, target_mac_addr, GRUB_NET_ETHERTYPE_ARP); +@@ -114,28 +124,53 @@ grub_err_t + grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card, + grub_uint16_t *vlantag) + { +- struct arppkt *arp_packet = (struct arppkt *) nb->data; ++ struct arphdr *arp_header = (struct arphdr *) nb->data; + grub_net_network_level_address_t sender_addr, target_addr; + grub_net_link_level_address_t sender_mac_addr; + struct grub_net_network_level_interface *inf; ++ grub_uint16_t hw_type; ++ grub_uint8_t hln; ++ grub_uint8_t pln; ++ grub_uint8_t arp_packet_len; ++ grub_uint8_t *tmp_ptr; + +- if (arp_packet->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) +- || arp_packet->pln != 4 || arp_packet->hln != 6 +- || nb->tail - nb->data < (int) sizeof (*arp_packet)) ++ hw_type = card->default_address.type; ++ hln = card->default_address.len; ++ pln = sizeof(sender_addr.ipv4); ++ arp_packet_len = sizeof (*arp_header) + 2 * (pln + hln); ++ ++ if (arp_header->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) ++ || arp_header->hrd != grub_cpu_to_be16 (hw_type) ++ || arp_header->hln != hln || arp_header->pln != pln ++ || nb->tail - nb->data < (int) arp_packet_len) { + return GRUB_ERR_NONE; ++ } + ++ tmp_ptr = nb->data + sizeof (*arp_header); ++ ++ /* The source hardware address. */ ++ sender_mac_addr.type = hw_type; ++ sender_mac_addr.len = hln; ++ grub_memcpy (sender_mac_addr.mac, tmp_ptr, hln); ++ tmp_ptr += hln; ++ ++ /* The source protocol address. */ + sender_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; ++ grub_memcpy(&sender_addr.ipv4, tmp_ptr, pln); ++ tmp_ptr += pln; ++ ++ grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); ++ ++ /* The target hardware address. */ ++ tmp_ptr += hln; ++ ++ /* The target protocol address. */ + target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +- sender_addr.ipv4 = arp_packet->sender_ip; +- target_addr.ipv4 = arp_packet->recv_ip; +- if (arp_packet->sender_ip == pending_req) ++ grub_memcpy(&target_addr.ipv4, tmp_ptr, pln); ++ ++ if (sender_addr.ipv4 == pending_req) + have_pending = 1; + +- sender_mac_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (sender_mac_addr.mac, arp_packet->sender_mac, +- sizeof (sender_mac_addr.mac)); +- grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); +- + FOR_NET_NETWORK_LEVEL_INTERFACES (inf) + { + /* Verify vlantag id */ +@@ -148,11 +183,11 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card, + + /* Am I the protocol address target? */ + if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 +- && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) ++ && arp_header->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) + { + grub_net_link_level_address_t target; + struct grub_net_buff nb_reply; +- struct arppkt *arp_reply; ++ struct arphdr *arp_reply; + grub_uint8_t arp_data[128]; + grub_err_t err; + +@@ -161,25 +196,39 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card, + grub_netbuff_clear (&nb_reply); + grub_netbuff_reserve (&nb_reply, 128); + +- err = grub_netbuff_push (&nb_reply, sizeof (*arp_packet)); ++ err = grub_netbuff_push (&nb_reply, arp_packet_len); + if (err) + return err; + +- arp_reply = (struct arppkt *) nb_reply.data; ++ arp_reply = (struct arphdr *) nb_reply.data; + +- arp_reply->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); ++ arp_reply->hrd = grub_cpu_to_be16 (hw_type); + arp_reply->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); +- arp_reply->pln = 4; +- arp_reply->hln = 6; ++ arp_reply->pln = pln; ++ arp_reply->hln = hln; + arp_reply->op = grub_cpu_to_be16_compile_time (ARP_REPLY); +- arp_reply->sender_ip = arp_packet->recv_ip; +- arp_reply->recv_ip = arp_packet->sender_ip; +- arp_reply->hln = 6; +- +- target.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (target.mac, arp_packet->sender_mac, 6); +- grub_memcpy (arp_reply->sender_mac, inf->hwaddress.mac, 6); +- grub_memcpy (arp_reply->recv_mac, arp_packet->sender_mac, 6); ++ ++ tmp_ptr = nb_reply.data + sizeof (*arp_reply); ++ ++ /* The source hardware address. */ ++ grub_memcpy (tmp_ptr, inf->hwaddress.mac, hln); ++ tmp_ptr += hln; ++ ++ /* The source protocol address. */ ++ grub_memcpy (tmp_ptr, &target_addr.ipv4, pln); ++ tmp_ptr += pln; ++ ++ /* The target hardware address. */ ++ grub_memcpy (tmp_ptr, sender_mac_addr.mac, hln); ++ tmp_ptr += hln; ++ ++ /* The target protocol address */ ++ grub_memcpy (tmp_ptr, &sender_addr.ipv4, pln); ++ tmp_ptr += pln; ++ ++ target.type = hw_type; ++ target.len = hln; ++ grub_memcpy (target.mac, sender_mac_addr.mac, hln); + + /* 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 2869482fe06..4e55adc557b 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -219,7 +219,6 @@ grub_net_configure_by_dhcp_ack (const char *name, + int is_def, char **device, char **path) + { + grub_net_network_level_address_t addr; +- grub_net_link_level_address_t hwaddr; + struct grub_net_network_level_interface *inter; + int mask = -1; + char server_ip[sizeof ("xxx.xxx.xxx.xxx")]; +@@ -232,12 +231,8 @@ grub_net_configure_by_dhcp_ack (const char *name, + if (path) + *path = 0; + +- grub_memcpy (hwaddr.mac, bp->mac_addr, +- bp->hw_len < sizeof (hwaddr.mac) ? bp->hw_len +- : sizeof (hwaddr.mac)); +- hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- +- inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); ++ grub_dprintf("dhcp", "configuring dhcp for %s\n", name); ++ inter = grub_net_add_addr (name, card, &addr, &card->default_address, flags); + if (!inter) + return 0; + +@@ -770,7 +765,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), + grub_memset (pack, 0, sizeof (*pack) + 64); + pack->opcode = 1; + pack->hw_type = 1; +- pack->hw_len = 6; ++ pack->hw_len = ifaces[j].hwaddress.len > 16 ? 0 ++ : ifaces[j].hwaddress.len; + err = grub_get_datetime (&date); + if (err || !grub_datetime2unixtime (&date, &t)) + { +@@ -781,7 +777,7 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), + ifaces[j].dhcp_xid = pack->xid; + pack->seconds = grub_cpu_to_be16 (t); + +- grub_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, 6); ++ grub_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, pack->hw_len); + + 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 329024b6f2c..bf36b446dc4 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -329,6 +329,9 @@ grub_efinet_find_snp_cards (int preferred_only, grub_efi_handle_t preferred, + /* This should not happen... Why? */ + continue; + ++ if (net->mode->hwaddr_size > GRUB_NET_MAX_LINK_ADDRESS_SIZE) ++ continue; ++ + if (net->mode->state == GRUB_EFI_NETWORK_STOPPED + && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS) + continue; +@@ -366,10 +369,11 @@ grub_efinet_find_snp_cards (int preferred_only, grub_efi_handle_t preferred, + *i = (*i)+1; + card->driver = &efidriver; + card->flags = 0; +- card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ card->default_address.type = net->mode->if_type; ++ card->default_address.len = net->mode->hwaddr_size; + grub_memcpy (card->default_address.mac, + net->mode->current_address, +- sizeof (card->default_address.mac)); ++ net->mode->hwaddr_size); + card->efi_net = net; + 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 +--- 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 = + .mtu = 1500, + .default_address = { + .type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET, ++ . len = 6, + {.mac = {0, 1, 2, 3, 4, 5}} + }, + .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 +--- 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) + grub_memset (ui, 0, sizeof (*ui)); + grub_pxe_call (GRUB_PXENV_UNDI_GET_INFORMATION, ui, pxe_rm_entry); + ++ grub_pxe_card.default_address.len = 6; + grub_memcpy (grub_pxe_card.default_address.mac, ui->current_addr, +- sizeof (grub_pxe_card.default_address.mac)); +- for (i = 0; i < sizeof (grub_pxe_card.default_address.mac); i++) ++ grub_pxe_card.default_address.len); ++ for (i = 0; i < grub_pxe_card.default_address.len; i++) + if (grub_pxe_card.default_address.mac[i] != 0) + break; +- if (i != sizeof (grub_pxe_card.default_address.mac)) ++ if (i != grub_pxe_card.default_address.len) + { +- for (i = 0; i < sizeof (grub_pxe_card.default_address.mac); i++) ++ for (i = 0; i < grub_pxe_card.default_address.len; i++) + if (grub_pxe_card.default_address.mac[i] != 0xff) + break; + } +- if (i == sizeof (grub_pxe_card.default_address.mac)) ++ if (i == grub_pxe_card.default_address.len) + grub_memcpy (grub_pxe_card.default_address.mac, ui->permanent_addr, +- sizeof (grub_pxe_card.default_address.mac)); ++ grub_pxe_card.default_address.len); + grub_pxe_card.mtu = ui->mtu; + + 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 3df75357a70..ba50415f5f6 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, + grub_uint16_t vlantag = 0; + + hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ hw_addr.len = 6; + + args = bootpath + grub_strlen (devpath) + 1; + do +@@ -503,6 +504,7 @@ search_net_devices (struct grub_ieee1275_devalias *alias) + grub_memcpy (&lla.mac, pprop, 6); + + lla.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ lla.len = 6; + card->default_address = lla; + + 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 +--- a/grub-core/net/drivers/uboot/ubootnet.c ++++ b/grub-core/net/drivers/uboot/ubootnet.c +@@ -131,6 +131,7 @@ GRUB_MOD_INIT (ubootnet) + + grub_memcpy (&(card->default_address.mac), &devinfo->di_net.hwaddr, 6); + card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ card->default_address.len = 6; + + 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 +--- a/grub-core/net/ethernet.c ++++ b/grub-core/net/ethernet.c +@@ -29,13 +29,6 @@ + + #define LLCADDRMASK 0x7f + +-struct etherhdr +-{ +- grub_uint8_t dst[6]; +- grub_uint8_t src[6]; +- grub_uint16_t type; +-} GRUB_PACKED; +- + struct llchdr + { + grub_uint8_t dsap; +@@ -55,13 +48,15 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, + grub_net_link_level_address_t target_addr, + grub_net_ethertype_t ethertype) + { +- struct etherhdr *eth; ++ grub_uint8_t *eth; + grub_err_t err; +- grub_uint8_t etherhdr_size; +- grub_uint16_t vlantag_id = VLANTAG_IDENTIFIER; ++ grub_uint32_t vlantag = 0; ++ grub_uint8_t hw_addr_len = inf->card->default_address.len; ++ grub_uint8_t etherhdr_size = 2 * hw_addr_len + 2; + +- etherhdr_size = sizeof (*eth); +- COMPILE_TIME_ASSERT (sizeof (*eth) + 4 < GRUB_NET_MAX_LINK_HEADER_SIZE); ++ /* Source and destination link addresses + ethertype + vlan tag */ ++ COMPILE_TIME_ASSERT ((GRUB_NET_MAX_LINK_ADDRESS_SIZE * 2 + 2 + 4) < ++ GRUB_NET_MAX_LINK_HEADER_SIZE); + + /* Increase ethernet header in case of vlantag */ + if (inf->vlantag != 0) +@@ -70,11 +65,22 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, + err = grub_netbuff_push (nb, etherhdr_size); + if (err) + return err; +- eth = (struct etherhdr *) nb->data; +- grub_memcpy (eth->dst, target_addr.mac, 6); +- grub_memcpy (eth->src, inf->hwaddress.mac, 6); ++ eth = nb->data; ++ grub_memcpy (eth, target_addr.mac, hw_addr_len); ++ eth += hw_addr_len; ++ grub_memcpy (eth, inf->hwaddress.mac, hw_addr_len); ++ eth += hw_addr_len; ++ ++ /* Check if a vlan-tag is present. */ ++ if (vlantag != 0) ++ { ++ *((grub_uint32_t *)eth) = grub_cpu_to_be32 (vlantag); ++ eth += sizeof (vlantag); ++ } ++ ++ /* Write ethertype */ ++ *((grub_uint16_t*) eth) = grub_cpu_to_be16 (ethertype); + +- eth->type = grub_cpu_to_be16 (ethertype); + if (!inf->card->opened) + { + err = GRUB_ERR_NONE; +@@ -85,18 +91,6 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, + inf->card->opened = 1; + } + +- /* Check and add a vlan-tag if needed. */ +- if (inf->vlantag != 0) +- { +- /* Move eth type to the right */ +- grub_memcpy ((char *) nb->data + etherhdr_size - 2, +- (char *) nb->data + etherhdr_size - 6, 2); +- +- /* Add the tag in the middle */ +- grub_memcpy ((char *) nb->data + etherhdr_size - 6, &vlantag_id, 2); +- grub_memcpy ((char *) nb->data + etherhdr_size - 4, (char *) &(inf->vlantag), 2); +- } +- + return inf->card->driver->send (inf->card, nb); + } + +@@ -104,31 +98,40 @@ grub_err_t + grub_net_recv_ethernet_packet (struct grub_net_buff *nb, + struct grub_net_card *card) + { +- struct etherhdr *eth; ++ grub_uint8_t *eth; + struct llchdr *llch; + struct snaphdr *snaph; + grub_net_ethertype_t type; + grub_net_link_level_address_t hwaddress; + grub_net_link_level_address_t src_hwaddress; + grub_err_t err; +- grub_uint8_t etherhdr_size = sizeof (*eth); ++ grub_uint8_t hw_addr_len = card->default_address.len; ++ grub_uint8_t etherhdr_size = 2 * hw_addr_len + 2; + grub_uint16_t vlantag = 0; + ++ eth = nb->data; + +- /* Check if a vlan-tag is present. If so, the ethernet header is 4 bytes */ +- /* longer than the original one. The vlantag id is extracted and the header */ +- /* is reseted to the original size. */ +- if (grub_get_unaligned16 (nb->data + etherhdr_size - 2) == VLANTAG_IDENTIFIER) ++ hwaddress.type = card->default_address.type; ++ hwaddress.len = hw_addr_len; ++ grub_memcpy (hwaddress.mac, eth, hw_addr_len); ++ eth += hw_addr_len; ++ ++ src_hwaddress.type = card->default_address.type; ++ src_hwaddress.len = hw_addr_len; ++ grub_memcpy (src_hwaddress.mac, eth, hw_addr_len); ++ eth += hw_addr_len; ++ ++ type = grub_be_to_cpu16 (*(grub_uint16_t*)(eth)); ++ if (type == VLANTAG_IDENTIFIER) + { +- vlantag = grub_get_unaligned16 (nb->data + etherhdr_size); ++ /* Skip vlan tag */ ++ eth += 2; ++ vlantag = grub_be_to_cpu16 (*(grub_uint16_t*)(eth)); + etherhdr_size += 4; +- /* Move eth type to the original position */ +- grub_memcpy((char *) nb->data + etherhdr_size - 6, +- (char *) nb->data + etherhdr_size - 2, 2); ++ eth += 2; ++ type = grub_be_to_cpu16 (*(grub_uint16_t*)(eth)); + } + +- eth = (struct etherhdr *) nb->data; +- type = grub_be_to_cpu16 (eth->type); + err = grub_netbuff_pull (nb, etherhdr_size); + if (err) + return err; +@@ -148,11 +151,6 @@ grub_net_recv_ethernet_packet (struct grub_net_buff *nb, + } + } + +- hwaddress.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (hwaddress.mac, eth->dst, sizeof (hwaddress.mac)); +- src_hwaddress.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (src_hwaddress.mac, eth->src, sizeof (src_hwaddress.mac)); +- + switch (type) + { + /* ARP packet. */ +diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c +index 2cbd95dce25..56a3ec5c8e8 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, + && ohdr->len == 1) + { + grub_net_link_level_address_t ll_address; +- ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); ++ ll_address.type = card->default_address.type; ++ ll_address.len = card->default_address.len; ++ grub_memcpy (ll_address.mac, ohdr + 1, ll_address.len); + grub_net_link_layer_add_address (card, source, &ll_address, 0); + } + } +@@ -335,8 +336,9 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, + && ohdr->len == 1) + { + grub_net_link_level_address_t ll_address; +- ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); ++ ll_address.type = card->default_address.type; ++ ll_address.len = card->default_address.len; ++ grub_memcpy (ll_address.mac, ohdr + 1, ll_address.len); + grub_net_link_layer_add_address (card, source, &ll_address, 0); + } + } +@@ -384,8 +386,9 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, + && ohdr->len == 1) + { + grub_net_link_level_address_t ll_address; +- ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); ++ ll_address.type = card->default_address.type; ++ ll_address.len = card->default_address.len; ++ grub_memcpy (ll_address.mac, ohdr + 1, ll_address.len); + grub_net_link_layer_add_address (card, source, &ll_address, 0); + } + if (ohdr->type == OPTION_PREFIX && ohdr->len == 4) +diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c +index 8411e0ecca3..b2ca74b6eb1 100644 +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -277,8 +277,8 @@ handle_dgram (struct grub_net_buff *nb, + && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV + && inf->dhcp_xid == bootp->xid + && inf->hwaddress.type == GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET +- && grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr, +- sizeof (inf->hwaddress.mac)) == 0) ++ && (grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr, ++ bootp->hw_len) == 0 || bootp->hw_len == 0)) + { + grub_net_process_dhcp (nb, inf->card); + grub_netbuff_free (nb); +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index fa3e2912643..9b8944292c7 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -128,8 +128,9 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, + << 48) + && proto_addr->ipv6[1] == (grub_be_to_cpu64_compile_time (1)))) + { +- hw_addr->type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memset (hw_addr->mac, -1, 6); ++ hw_addr->type = inf->card->default_address.type; ++ hw_addr->len = inf->card->default_address.len; ++ grub_memset (hw_addr->mac, -1, hw_addr->len); + return GRUB_ERR_NONE; + } + +@@ -137,6 +138,7 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, + && ((grub_be_to_cpu64 (proto_addr->ipv6[0]) >> 56) == 0xff)) + { + hw_addr->type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ hw_addr->len = inf->card->default_address.len; + hw_addr->mac[0] = 0x33; + hw_addr->mac[1] = 0x33; + hw_addr->mac[2] = ((grub_be_to_cpu64 (proto_addr->ipv6[1]) >> 24) & 0xff); +@@ -757,23 +759,21 @@ grub_net_addr_to_str (const grub_net_network_level_address_t *target, char *buf) + void + grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) + { +- str[0] = 0; +- switch (addr->type) ++ char *ptr; ++ unsigned i; ++ ++ if (addr->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE) + { +- case GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET: +- { +- char *ptr; +- unsigned i; +- for (ptr = str, i = 0; i < ARRAY_SIZE (addr->mac); i++) +- { +- grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), +- "%02x:", addr->mac[i] & 0xff); +- ptr += (sizeof ("XX:") - 1); +- } +- return; +- } ++ str[0] = 0; ++ grub_printf (_("Unsupported hw address type %d len %d\n"), ++ addr->type, addr->len); ++ return; ++ } ++ for (ptr = str, i = 0; i < addr->len; i++) ++ { ++ ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), ++ "%02x:", addr->mac[i] & 0xff); + } +- grub_printf (_("Unsupported hw address type %d\n"), addr->type); + } + + int +@@ -784,13 +784,17 @@ grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, + return -1; + if (a->type > b->type) + return +1; +- switch (a->type) ++ if (a->len < b->len) ++ return -1; ++ if (a->len > b->len) ++ return +1; ++ if (a->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE) + { +- case GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET: +- return grub_memcmp (a->mac, b->mac, sizeof (a->mac)); ++ grub_printf (_("Unsupported hw address type %d len %d\n"), ++ a->type, a->len); ++ return + 1; + } +- grub_printf (_("Unsupported hw address type %d\n"), a->type); +- return 1; ++ return grub_memcmp (a->mac, b->mac, a->len); + } + + int +diff --git a/include/grub/net.h b/include/grub/net.h +index de51894cbbf..e9ebc6a1b4f 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -29,7 +29,8 @@ + + enum + { +- GRUB_NET_MAX_LINK_HEADER_SIZE = 64, ++ GRUB_NET_MAX_LINK_HEADER_SIZE = 96, ++ GRUB_NET_MAX_LINK_ADDRESS_SIZE = 32, + GRUB_NET_UDP_HEADER_SIZE = 8, + GRUB_NET_TCP_HEADER_SIZE = 20, + GRUB_NET_OUR_IPV4_HEADER_SIZE = 20, +@@ -42,15 +43,17 @@ enum + + typedef enum grub_link_level_protocol_id + { +- GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET ++ /* IANA ARP constant to define hardware type. */ ++ GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET = 1, + } grub_link_level_protocol_id_t; + + typedef struct grub_net_link_level_address + { + grub_link_level_protocol_id_t type; ++ grub_uint8_t len; + union + { +- grub_uint8_t mac[6]; ++ grub_uint8_t mac[GRUB_NET_MAX_LINK_ADDRESS_SIZE]; + }; + } grub_net_link_level_address_t; + +@@ -555,11 +558,13 @@ grub_net_addr_cmp (const grub_net_network_level_address_t *a, + #define GRUB_NET_MAX_STR_ADDR_LEN sizeof ("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX") + + /* +- Currently suppoerted adresses: +- ethernet: XX:XX:XX:XX:XX:XX ++ Up to 32 byte hardware address supported, see GRUB_NET_MAX_LINK_ADDRESS_SIZE + */ +- +-#define GRUB_NET_MAX_STR_HWADDR_LEN (sizeof ("XX:XX:XX:XX:XX:XX")) ++#define GRUB_NET_MAX_STR_HWADDR_LEN (sizeof (\ ++ "XX:XX:XX:XX:XX:XX:XX:XX:"\ ++ "XX:XX:XX:XX:XX:XX:XX:XX:"\ ++ "XX:XX:XX:XX:XX:XX:XX:XX:"\ ++ "XX:XX:XX:XX:XX:XX:XX:XX")) + + void + grub_net_addr_to_str (const grub_net_network_level_address_t *target, diff --git a/0341-misc-fix-invalid-character-recongition-in-strto-l.patch b/0341-misc-fix-invalid-character-recongition-in-strto-l.patch new file mode 100644 index 00000000..070d0ee6 --- /dev/null +++ b/0341-misc-fix-invalid-character-recongition-in-strto-l.patch @@ -0,0 +1,37 @@ +From 8cdcba9fcba746542a53b9302c695c9b2b49117a Mon Sep 17 00:00:00 2001 +From: Aaron Miller +Date: Fri, 29 Jul 2016 17:41:27 +0800 +Subject: [PATCH] misc: fix invalid character recongition in strto*l + +Would previously allow digits larger than the base and didn't check that +subtracting the difference from 0-9 to lowercase letters for characters +larger than 9 didn't result in a value lower than 9, which allowed the +parses: ` = 9, _ = 8, ^ = 7, ] = 6, \ = 5, and [ = 4 +--- + grub-core/kern/misc.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 0e89c483d5e..5c3899f0e5b 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -434,11 +434,14 @@ grub_strtoull (const char *str, char **end, int base) + unsigned long digit; + + digit = grub_tolower (*str) - '0'; +- if (digit >= 'a' - '0') +- digit += '0' - 'a' + 10; +- else if (digit > 9) +- break; +- ++ if (digit > 9) ++ { ++ digit += '0' - 'a' + 10; ++ /* digit <= 9 check is needed to keep chars larger than ++ '9' but less than 'a' from being read as numbers */ ++ if (digit >= (unsigned long) base || digit <= 9) ++ break; ++ } + if (digit >= (unsigned long) base) + break; + diff --git a/0240-net-read-bracketed-ipv6-addrs-and-port-numbers.patch b/0342-net-read-bracketed-ipv6-addrs-and-port-numbers.patch similarity index 82% rename from 0240-net-read-bracketed-ipv6-addrs-and-port-numbers.patch rename to 0342-net-read-bracketed-ipv6-addrs-and-port-numbers.patch index 273ebc1f..2f564401 100644 --- a/0240-net-read-bracketed-ipv6-addrs-and-port-numbers.patch +++ b/0342-net-read-bracketed-ipv6-addrs-and-port-numbers.patch @@ -1,4 +1,4 @@ -From 360588a02da16caf45c639dde159ae55dbdf651e Mon Sep 17 00:00:00 2001 +From 1226836d0674b05d9a3ef477cce24c9b70d24f79 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Fri, 29 Jul 2016 17:41:38 +0800 Subject: [PATCH] net: read bracketed ipv6 addrs and port numbers @@ -7,11 +7,11 @@ Allow specifying port numbers for http and tftp paths, and allow ipv6 addresses to be recognized with brackets around them, which is required to specify a port number --- - grub-core/net/http.c | 21 ++++++++++--- - grub-core/net/net.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++--- - grub-core/net/tftp.c | 6 +++- + grub-core/net/http.c | 21 +++++++++++--- + grub-core/net/net.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + grub-core/net/tftp.c | 8 ++++-- include/grub/net.h | 1 + - 4 files changed, 104 insertions(+), 10 deletions(-) + 4 files changed, 101 insertions(+), 6 deletions(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c index 5aa4ad3befc..f182d7b871d 100644 @@ -72,10 +72,10 @@ index 5aa4ad3befc..f182d7b871d 100644 file); if (!data->sock) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index fa3e2912643..c84b435e8a5 100644 +index 9b8944292c7..1f887d44b32 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c -@@ -437,6 +437,12 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) +@@ -439,6 +439,12 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) grub_uint16_t newip[8]; const char *ptr = val; int word, quaddot = -1; @@ -88,7 +88,7 @@ index fa3e2912643..c84b435e8a5 100644 if (ptr[0] == ':' && ptr[1] != ':') return 0; -@@ -475,6 +481,9 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) +@@ -477,6 +483,9 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); } grub_memcpy (ip, newip, 16); @@ -98,7 +98,7 @@ index fa3e2912643..c84b435e8a5 100644 if (rest) *rest = ptr; return 1; -@@ -1332,8 +1341,10 @@ grub_net_open_real (const char *name) +@@ -1336,8 +1345,10 @@ grub_net_open_real (const char *name) { grub_net_app_level_t proto; const char *protname, *server; @@ -109,7 +109,7 @@ index fa3e2912643..c84b435e8a5 100644 if (grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0) { -@@ -1371,6 +1382,72 @@ grub_net_open_real (const char *name) +@@ -1375,6 +1386,72 @@ grub_net_open_real (const char *name) return NULL; } @@ -182,27 +182,8 @@ index fa3e2912643..c84b435e8a5 100644 for (try = 0; try < 2; try++) { FOR_NET_APP_LEVEL (proto) -@@ -1380,14 +1457,13 @@ grub_net_open_real (const char *name) - { - grub_net_t ret = grub_zalloc (sizeof (*ret)); - if (!ret) -- return NULL; -- ret->protocol = proto; -- ret->server = grub_strdup (server); -- if (!ret->server) - { -- grub_free (ret); -+ grub_free (host); - return NULL; - } -+ ret->protocol = proto; -+ ret->port = port; -+ ret->server = host; - ret->fs = &grub_net_fs; - return ret; - } diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index f90071353ad..4fd7d24dbed 100644 +index f90071353ad..e267af354f4 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -333,6 +333,7 @@ tftp_open (struct grub_file *file, const char *filename) @@ -213,10 +194,12 @@ index f90071353ad..4fd7d24dbed 100644 data = grub_zalloc (sizeof (*data)); if (!data) -@@ -406,6 +407,9 @@ tftp_open (struct grub_file *file, const char *filename) +@@ -405,7 +406,10 @@ tftp_open (struct grub_file *file, const char *filename) + err = grub_net_resolve_address (file->device->net->server, &addr); if (err) { - grub_dprintf("tftp", "Address resolution failed: %d\n", err); +- grub_dprintf("tftp", "Address resolution failed: %d\n", err); ++ grub_dprintf ("tftp", "Address resolution failed: %d\n", err); + grub_dprintf ("tftp", "file_size is %llu, block_size is %llu\n", + (unsigned long long)data->file_size, + (unsigned long long)data->block_size); @@ -233,10 +216,10 @@ index f90071353ad..4fd7d24dbed 100644 if (!data->sock) { diff --git a/include/grub/net.h b/include/grub/net.h -index f8f3ec13acc..24232ec71fc 100644 +index e9ebc6a1b4f..f4cd86e582f 100644 --- a/include/grub/net.h +++ b/include/grub/net.h -@@ -270,6 +270,7 @@ typedef struct grub_net +@@ -273,6 +273,7 @@ typedef struct grub_net { char *server; char *name; diff --git a/0343-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch b/0343-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch new file mode 100644 index 00000000..6b2ee71a --- /dev/null +++ b/0343-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch @@ -0,0 +1,105 @@ +From 7be725d0ff77d8ebd0a7e3e3fccf193334c5c319 Mon Sep 17 00:00:00 2001 +From: Aaron Miller +Date: Fri, 29 Jul 2016 17:41:38 +0800 +Subject: [PATCH] net: read bracketed ipv6 addrs and port numbers (pjones + fixup) + +Various bug fixes related to previous patch. + +Signed-off-by: Peter Jones +--- + grub-core/net/http.c | 6 ++++-- + grub-core/net/net.c | 24 ++++++++++++------------ + 2 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/grub-core/net/http.c b/grub-core/net/http.c +index f182d7b871d..00737c52750 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)), + nb2 = grub_netbuff_alloc (data->chunk_rem); + if (!nb2) + return grub_errno; +- grub_netbuff_put (nb2, data->chunk_rem); ++ err = grub_netbuff_put (nb2, data->chunk_rem); ++ if (err) ++ return grub_errno; + grub_memcpy (nb2->data, nb->data, data->chunk_rem); + if (file->device->net->packs.count >= 20) + { +@@ -405,7 +407,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) + data->filename, server, port ? port : HTTP_PORT); + data->sock = grub_net_tcp_open (server, + port ? port : HTTP_PORT, http_receive, +- http_err, http_err, ++ http_err, NULL, + file); + if (!data->sock) + { +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 1f887d44b32..a0f4d00f0be 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -441,10 +441,11 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) + int word, quaddot = -1; + int bracketed = 0; + +- if (ptr[0] == '[') { +- bracketed = 1; +- ptr++; +- } ++ if (ptr[0] == '[') ++ { ++ bracketed = 1; ++ ptr++; ++ } + + if (ptr[0] == ':' && ptr[1] != ':') + return 0; +@@ -483,9 +484,8 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) + grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); + } + grub_memcpy (ip, newip, 16); +- if (bracketed && *ptr == ']') { ++ if (bracketed && *ptr == ']') + ptr++; +- } + if (rest) + *rest = ptr; + return 1; +@@ -1389,7 +1389,7 @@ grub_net_open_real (const char *name) + char* port_start; + /* ipv6 or port specified? */ + if ((port_start = grub_strchr (server, ':'))) +- { ++ { + char* ipv6_begin; + if((ipv6_begin = grub_strchr (server, '['))) + { +@@ -1461,14 +1461,13 @@ grub_net_open_real (const char *name) + { + grub_net_t ret = grub_zalloc (sizeof (*ret)); + if (!ret) +- return NULL; +- ret->protocol = proto; +- ret->server = grub_strdup (server); +- if (!ret->server) + { +- grub_free (ret); ++ grub_free (host); + return NULL; + } ++ ret->protocol = proto; ++ ret->port = port; ++ ret->server = host; + ret->fs = &grub_net_fs; + return ret; + } +@@ -1543,6 +1542,7 @@ grub_net_open_real (const char *name) + grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), + name); + ++ grub_free (host); + return NULL; + } + diff --git a/0241-New-net_bootp6-command-and-UEFI-IPv6-PXE-support.patch b/0344-bootp-New-net_bootp6-command.patch similarity index 95% rename from 0241-New-net_bootp6-command-and-UEFI-IPv6-PXE-support.patch rename to 0344-bootp-New-net_bootp6-command.patch index 39eb0940..53499073 100644 --- a/0241-New-net_bootp6-command-and-UEFI-IPv6-PXE-support.patch +++ b/0344-bootp-New-net_bootp6-command.patch @@ -1,11 +1,7 @@ -From 77e75c900368ef656c00d4c485eff7b1d66d58eb Mon Sep 17 00:00:00 2001 +From 22c78cf8e46b6e7355a2f6e099b0f581fb192253 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Sun, 10 Jul 2016 23:46:06 +0800 -Subject: [PATCH] New net_bootp6 command and UEFI IPv6 PXE support - -When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is -cached in firmware buffer which can be obtained by PXE Base Code protocol. The -network interface can be setup through the parameters in that obtained packet. +Subject: [PATCH] bootp: New net_bootp6 command Implement new net_bootp6 command for IPv6 network auto configuration via the DHCPv6 protocol (RFC3315). @@ -13,15 +9,15 @@ DHCPv6 protocol (RFC3315). Signed-off-by: Michael Chang Signed-off-by: Ken Lin --- - grub-core/net/bootp.c | 1047 ++++++++++++++++++++++++++++++------ + grub-core/net/bootp.c | 1048 ++++++++++++++++++++++++++++++------ grub-core/net/drivers/efi/efinet.c | 20 +- grub-core/net/ip.c | 39 ++ include/grub/efi/api.h | 2 +- - include/grub/net.h | 80 +-- - 5 files changed, 988 insertions(+), 200 deletions(-) + include/grub/net.h | 91 ++-- + 5 files changed, 994 insertions(+), 206 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index da3e454466b..6995f986744 100644 +index 4e55adc557b..ff1d7776e7f 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -25,6 +25,98 @@ @@ -123,7 +119,7 @@ index da3e454466b..6995f986744 100644 static char * grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), -@@ -350,178 +442,577 @@ grub_net_configure_by_dhcp_ack (const char *name, +@@ -345,178 +437,578 @@ grub_net_configure_by_dhcp_ack (const char *name, return inter; } @@ -399,6 +395,7 @@ index da3e454466b..6995f986744 100644 +} + +static grub_dhcp6_session_t grub_dhcp6_sessions; ++#define FOR_DHCP6_SESSIONS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE (var, next, grub_dhcp6_sessions) +#define FOR_DHCP6_SESSIONS(var) FOR_LIST_ELEMENTS (var, grub_dhcp6_sessions) + +static void @@ -618,13 +615,13 @@ index da3e454466b..6995f986744 100644 +static void +grub_dhcp6_session_remove_all (void) +{ -+ grub_dhcp6_session_t se; ++ grub_dhcp6_session_t se, next; + -+ FOR_DHCP6_SESSIONS (se) ++ FOR_DHCP6_SESSIONS_SAFE (se, next) + { + grub_dhcp6_session_remove (se); -+ se = grub_dhcp6_sessions; + } ++ grub_dhcp6_sessions = NULL; +} + +static grub_err_t @@ -857,7 +854,7 @@ index da3e454466b..6995f986744 100644 void grub_net_process_dhcp (struct grub_net_buff *nb, -@@ -555,6 +1046,77 @@ grub_net_process_dhcp (struct grub_net_buff *nb, +@@ -550,6 +1042,77 @@ grub_net_process_dhcp (struct grub_net_buff *nb, } } @@ -935,7 +932,7 @@ index da3e454466b..6995f986744 100644 static grub_err_t grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), int argc, char **args) -@@ -827,7 +1389,174 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), +@@ -824,7 +1387,174 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), return err; } @@ -1111,7 +1108,7 @@ index da3e454466b..6995f986744 100644 void grub_bootp_init (void) -@@ -838,6 +1567,9 @@ grub_bootp_init (void) +@@ -835,6 +1565,9 @@ grub_bootp_init (void) cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt, N_("VAR INTERFACE NUMBER DESCRIPTION"), N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value.")); @@ -1121,17 +1118,17 @@ index da3e454466b..6995f986744 100644 } void -@@ -845,4 +1577,5 @@ grub_bootp_fini (void) +@@ -842,4 +1575,5 @@ grub_bootp_fini (void) { grub_unregister_command (cmd_getdhcp); grub_unregister_command (cmd_bootp); + grub_unregister_command (cmd_bootp6); } diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 329024b6f2c..6cc139fb8fc 100644 +index bf36b446dc4..da90f0f40ce 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c -@@ -473,9 +473,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -477,9 +477,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, pxe_mode = pxe->mode; if (pxe_mode->using_ipv6) { @@ -1141,7 +1138,7 @@ index 329024b6f2c..6cc139fb8fc 100644 grub_dprintf ("efinet", "using ipv6 and dhcpv6\n"); grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n", pxe_mode->dhcp_ack_received ? "yes" : "no", -@@ -483,15 +480,14 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -487,15 +484,14 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, if (!pxe_mode->dhcp_ack_received) continue; @@ -1166,7 +1163,7 @@ index 329024b6f2c..6cc139fb8fc 100644 } else diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index 7c95cc7464a..fd641b2410d 100644 +index b2ca74b6eb1..9a4e589aa39 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -239,6 +239,45 @@ handle_dgram (struct grub_net_buff *nb, @@ -1229,35 +1226,29 @@ index ddc5ecfb03d..6a545cc6d5d 100644 } grub_efi_pxe_ip_filter_t; diff --git a/include/grub/net.h b/include/grub/net.h -index 24232ec71fc..373ad1080cf 100644 +index f4cd86e582f..5f78b22e109 100644 --- a/include/grub/net.h +++ b/include/grub/net.h -@@ -445,46 +445,62 @@ struct grub_net_bootp_packet +@@ -447,50 +447,65 @@ struct grub_net_bootp_packet + grub_uint8_t vendor[0]; + } GRUB_PACKED; - enum - { +-enum +- { - GRUB_NET_DHCP6_IA_NA = 3, - GRUB_NET_DHCP6_IA_ADDRESS = 5, - GRUB_NET_DHCP6_BOOTFILE_URL = 59, -+ GRUB_NET_DHCP6_OPTION_CLIENTID = 1, -+ GRUB_NET_DHCP6_OPTION_SERVERID = 2, -+ GRUB_NET_DHCP6_OPTION_IA_NA = 3, -+ GRUB_NET_DHCP6_OPTION_IAADDR = 5, -+ GRUB_NET_DHCP6_OPTION_ORO = 6, -+ GRUB_NET_DHCP6_OPTION_ELAPSED_TIME = 8, -+ GRUB_NET_DHCP6_OPTION_DNS_SERVERS = 23, -+ GRUB_NET_DHCP6_OPTION_BOOTFILE_URL = 59 - }; - +- }; +- -struct grub_net_dhcpv6_option --{ ++struct grub_net_dhcp6_packet + { - grub_uint16_t option_num; - grub_uint16_t option_len; - grub_uint8_t option_data[]; -+struct grub_net_dhcp6_option { -+ grub_uint16_t code; -+ grub_uint16_t len; -+ grub_uint8_t data[0]; ++ grub_uint32_t message_type:8; ++ grub_uint32_t transaction_id:24; ++ grub_uint8_t dhcp_options[0]; } GRUB_PACKED; -typedef struct grub_net_dhcpv6_option grub_net_dhcpv6_option_t; @@ -1265,6 +1256,12 @@ index 24232ec71fc..373ad1080cf 100644 -{ - grub_uint16_t option_num; - grub_uint16_t option_len; ++struct grub_net_dhcp6_option { ++ grub_uint16_t code; ++ grub_uint16_t len; ++ grub_uint8_t data[0]; ++} GRUB_PACKED; ++ +struct grub_net_dhcp6_option_iana { grub_uint32_t iaid; grub_uint32_t t1; @@ -1290,11 +1287,15 @@ index 24232ec71fc..373ad1080cf 100644 -struct grub_net_dhcpv6_packet +struct grub_net_dhcp6_option_duid_ll -+{ + { +- grub_uint32_t message_type:8; +- grub_uint32_t transaction_id:24; +- grub_uint8_t dhcp_options[1024]; + grub_uint16_t type; + grub_uint16_t hw_type; + grub_uint8_t hwaddr[6]; -+} GRUB_PACKED; + } GRUB_PACKED; +-typedef struct grub_net_dhcpv6_packet grub_net_dhcpv6_packet_t; + +enum + { @@ -1310,16 +1311,21 @@ index 24232ec71fc..373ad1080cf 100644 + DHCP6_SERVER_PORT = 547 + }; + -+struct grub_net_dhcp6_packet - { - grub_uint32_t message_type:8; - grub_uint32_t transaction_id:24; -- grub_uint8_t dhcp_options[1024]; -+ grub_uint8_t dhcp_options[0]; - } GRUB_PACKED; - typedef struct grub_net_dhcpv6_packet grub_net_dhcpv6_packet_t; ++enum ++ { ++ GRUB_NET_DHCP6_OPTION_CLIENTID = 1, ++ GRUB_NET_DHCP6_OPTION_SERVERID = 2, ++ GRUB_NET_DHCP6_OPTION_IA_NA = 3, ++ GRUB_NET_DHCP6_OPTION_IAADDR = 5, ++ GRUB_NET_DHCP6_OPTION_ORO = 6, ++ GRUB_NET_DHCP6_OPTION_ELAPSED_TIME = 8, ++ GRUB_NET_DHCP6_OPTION_DNS_SERVERS = 23, ++ GRUB_NET_DHCP6_OPTION_BOOTFILE_URL = 59 ++ }; -@@ -517,12 +533,12 @@ grub_net_configure_by_dhcp_ack (const char *name, + #define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63 + #define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82 +@@ -521,12 +536,12 @@ grub_net_configure_by_dhcp_ack (const char *name, int is_def, char **device, char **path); struct grub_net_network_level_interface * @@ -1338,7 +1344,7 @@ index 24232ec71fc..373ad1080cf 100644 int grub_ipv6_get_masksize(grub_uint16_t *mask); -@@ -539,6 +555,10 @@ void +@@ -543,6 +558,10 @@ void grub_net_process_dhcp (struct grub_net_buff *nb, struct grub_net_card *card); diff --git a/0345-Put-back-our-code-to-add-a-local-route.patch b/0345-Put-back-our-code-to-add-a-local-route.patch new file mode 100644 index 00000000..2a2b507a --- /dev/null +++ b/0345-Put-back-our-code-to-add-a-local-route.patch @@ -0,0 +1,35 @@ +From fd3d24758c60d491c61a27947d3e566dc7875306 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 21 Jun 2018 18:32:26 -0400 +Subject: [PATCH] Put back our code to add a local route. + +This was removed by the previous patch. + +Signed-off-by: Peter Jones +--- + grub-core/net/bootp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index ff1d7776e7f..242cd1f4cbd 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -976,6 +976,7 @@ grub_net_configure_by_dhcpv6_reply (const char *name, + { + struct grub_net_network_level_interface *inf; + grub_dhcp6_options_t dhcp6; ++ int mask = -1; + + dhcp6 = grub_dhcp6_options_get (v6h, size); + if (!dhcp6) +@@ -1007,6 +1008,10 @@ grub_net_configure_by_dhcpv6_reply (const char *name, + } + + grub_dhcp6_options_free (dhcp6); ++ ++ if (inf) ++ grub_net_add_ipv6_local (inf, mask); ++ + return inf; + } + diff --git a/0346-efinet-UEFI-IPv6-PXE-support.patch b/0346-efinet-UEFI-IPv6-PXE-support.patch new file mode 100644 index 00000000..b396a5a7 --- /dev/null +++ b/0346-efinet-UEFI-IPv6-PXE-support.patch @@ -0,0 +1,126 @@ +From 608d6ca050b5b68e96ac2528fe7bc4f8bf322e17 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Wed, 15 Apr 2015 14:48:30 +0800 +Subject: [PATCH] efinet: UEFI IPv6 PXE support + +When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is +cached in firmware buffer which can be obtained by PXE Base Code protocol. The +network interface can be setup through the parameters in that obtained packet. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 2 ++ + include/grub/efi/api.h | 71 +++++++++++++++++++++++--------------- + 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 da90f0f40ce..ac58e3e82cf 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -493,6 +493,8 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + grub_print_error (); + if (device && path) + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); ++ if (grub_errno) ++ grub_print_error (); + } + else + { +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index 6a545cc6d5d..7dbd8807b80 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -1503,31 +1503,6 @@ typedef union + grub_efi_pxe_dhcpv6_packet_t dhcpv6; + } grub_efi_pxe_packet_t; + +-#define GRUB_EFI_PXE_MAX_IPCNT 8 +-#define GRUB_EFI_PXE_MAX_ARP_ENTRIES 8 +-#define GRUB_EFI_PXE_MAX_ROUTE_ENTRIES 8 +- +-typedef struct grub_efi_pxe_ip_filter +-{ +- grub_efi_uint8_t filters; +- grub_efi_uint8_t ip_count; +- grub_efi_uint16_t reserved; +- grub_efi_ip_address_t ip_list[GRUB_EFI_PXE_MAX_IPCNT]; +-} grub_efi_pxe_ip_filter_t; +- +-typedef struct grub_efi_pxe_arp_entry +-{ +- grub_efi_ip_address_t ip_addr; +- grub_efi_mac_address_t mac_addr; +-} grub_efi_pxe_arp_entry_t; +- +-typedef struct grub_efi_pxe_route_entry +-{ +- grub_efi_ip_address_t ip_addr; +- grub_efi_ip_address_t subnet_mask; +- grub_efi_ip_address_t gateway_addr; +-} grub_efi_pxe_route_entry_t; +- + typedef struct grub_efi_pxe_icmp_error + { + grub_efi_uint8_t type; +@@ -1553,6 +1528,48 @@ typedef struct grub_efi_pxe_tftp_error + grub_efi_char8_t error_string[127]; + } grub_efi_pxe_tftp_error_t; + ++typedef struct { ++ grub_uint8_t addr[4]; ++} grub_efi_pxe_ipv4_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[16]; ++} grub_efi_pxe_ipv6_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[32]; ++} grub_efi_pxe_mac_address_t; ++ ++typedef union { ++ grub_uint32_t addr[4]; ++ grub_efi_pxe_ipv4_address_t v4; ++ grub_efi_pxe_ipv6_address_t v6; ++} grub_efi_pxe_ip_address_t; ++ ++#define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8 ++typedef struct grub_efi_pxe_ip_filter ++{ ++ grub_efi_uint8_t filters; ++ grub_efi_uint8_t ip_count; ++ grub_efi_uint16_t reserved; ++ grub_efi_ip_address_t ip_list[GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT]; ++} grub_efi_pxe_ip_filter_t; ++ ++typedef struct { ++ grub_efi_pxe_ip_address_t ip_addr; ++ grub_efi_pxe_mac_address_t mac_addr; ++} grub_efi_pxe_arp_entry_t; ++ ++typedef struct { ++ grub_efi_pxe_ip_address_t ip_addr; ++ grub_efi_pxe_ip_address_t subnet_mask; ++ grub_efi_pxe_ip_address_t gw_addr; ++} grub_efi_pxe_route_entry_t; ++ ++ ++#define GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8 ++#define GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8 ++ + typedef struct grub_efi_pxe_mode + { + grub_efi_boolean_t started; +@@ -1584,9 +1601,9 @@ typedef struct grub_efi_pxe_mode + grub_efi_pxe_packet_t pxe_bis_reply; + grub_efi_pxe_ip_filter_t ip_filter; + grub_efi_uint32_t arp_cache_entries; +- grub_efi_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_MAX_ARP_ENTRIES]; ++ grub_efi_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES]; + grub_efi_uint32_t route_table_entries; +- grub_efi_pxe_route_entry_t route_table[GRUB_EFI_PXE_MAX_ROUTE_ENTRIES]; ++ grub_efi_pxe_route_entry_t route_table[GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES]; + grub_efi_pxe_icmp_error_t icmp_error; + grub_efi_pxe_tftp_error_t tftp_error; + } grub_efi_pxe_mode_t; diff --git a/0242-grub.texi-Add-net_bootp6-doument.patch b/0347-grub.texi-Add-net_bootp6-doument.patch similarity index 86% rename from 0242-grub.texi-Add-net_bootp6-doument.patch rename to 0347-grub.texi-Add-net_bootp6-doument.patch index 37fad226..1eaa7cf9 100644 --- a/0242-grub.texi-Add-net_bootp6-doument.patch +++ b/0347-grub.texi-Add-net_bootp6-doument.patch @@ -1,4 +1,4 @@ -From a0c969d3c591c21eeeb0ba032ec8ea1257efb898 Mon Sep 17 00:00:00 2001 +From a314663766dd526d60aade60bb06a4b597bb759a Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 5 May 2015 14:19:24 +0800 Subject: [PATCH] grub.texi: Add net_bootp6 doument @@ -12,10 +12,10 @@ Signed-off-by: Ken Lin 1 file changed, 17 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index f28c4cd5247..0e14a78ceaa 100644 +index 2b7b7faf847..c54bee31679 100644 --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -5224,6 +5224,7 @@ This command is only available on AArch64 systems. +@@ -5303,6 +5303,7 @@ This command is only available on AArch64 systems. * net_add_dns:: Add a DNS server * net_add_route:: Add routing entry * net_bootp:: Perform a bootp autoconfiguration @@ -23,7 +23,7 @@ index f28c4cd5247..0e14a78ceaa 100644 * net_del_addr:: Remove IP address from interface * net_del_dns:: Remove a DNS server * net_del_route:: Remove a route entry -@@ -5305,6 +5306,22 @@ Sets environment variable @samp{net_}@var{}@samp{_dhcp_extensionspath} +@@ -5384,6 +5385,22 @@ Sets environment variable @samp{net_}@var{}@samp{_dhcp_extensionspath} @end deffn diff --git a/0243-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch b/0348-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch similarity index 85% rename from 0243-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch rename to 0348-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch index 396808b9..4f98e54a 100644 --- a/0243-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch +++ b/0348-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch @@ -1,4 +1,4 @@ -From 7b6d6e50bea268456d55806cb21d49cbc01c10d1 Mon Sep 17 00:00:00 2001 +From 96b8c9d4e3920c5d0b47c578924fe1467a30a3d9 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 14 Jul 2016 18:45:14 +0800 Subject: [PATCH] bootp: Add processing DHCPACK packet from HTTP Boot @@ -17,15 +17,23 @@ packet by treating it as HTTP format, not as the PXE format. Signed-off-by: Michael Chang Signed-off-by: Ken Lin --- - grub-core/net/bootp.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++-- + grub-core/net/bootp.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-- include/grub/net.h | 1 + - 2 files changed, 66 insertions(+), 2 deletions(-) + 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 6995f986744..902e5a60154 100644 +index 242cd1f4cbd..8b6fc9f2411 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c -@@ -254,6 +254,11 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -254,6 +255,11 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) taglength); break; @@ -37,7 +45,7 @@ index 6995f986744..902e5a60154 100644 case GRUB_NET_BOOTP_EXTENSIONS_PATH: grub_env_set_net_property (name, "extensionspath", (const char *) ptr, taglength); -@@ -362,6 +367,66 @@ grub_net_configure_by_dhcp_ack (const char *name, +@@ -357,6 +363,66 @@ grub_net_configure_by_dhcp_ack (const char *name, } #endif @@ -104,7 +112,7 @@ index 6995f986744..902e5a60154 100644 if (size > OFFSET_OF (boot_file, bp)) grub_env_set_net_property (name, "boot_file", bp->boot_file, sizeof (bp->boot_file)); -@@ -426,8 +491,6 @@ grub_net_configure_by_dhcp_ack (const char *name, +@@ -421,8 +487,6 @@ grub_net_configure_by_dhcp_ack (const char *name, **path = 0; } } @@ -114,10 +122,10 @@ index 6995f986744..902e5a60154 100644 inter->dhcp_ack = grub_malloc (size); diff --git a/include/grub/net.h b/include/grub/net.h -index 373ad1080cf..1c7c3ecb6ab 100644 +index 5f78b22e109..9cf6da68973 100644 --- a/include/grub/net.h +++ b/include/grub/net.h -@@ -519,6 +519,7 @@ enum +@@ -522,6 +522,7 @@ enum GRUB_NET_BOOTP_DOMAIN = 0x0f, GRUB_NET_BOOTP_ROOT_PATH = 0x11, GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12, diff --git a/0244-efinet-Setting-network-from-UEFI-device-path.patch b/0349-efinet-Setting-network-from-UEFI-device-path.patch similarity index 94% rename from 0244-efinet-Setting-network-from-UEFI-device-path.patch rename to 0349-efinet-Setting-network-from-UEFI-device-path.patch index e460193e..c430ce5c 100644 --- a/0244-efinet-Setting-network-from-UEFI-device-path.patch +++ b/0349-efinet-Setting-network-from-UEFI-device-path.patch @@ -1,4 +1,4 @@ -From da2f323f72641219714b2ae448c62db6a7f64898 Mon Sep 17 00:00:00 2001 +From 497aca1e6167bc7ee725a0f6a8167d4bceb483d1 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Sun, 10 Jul 2016 23:46:31 +0800 Subject: [PATCH] efinet: Setting network from UEFI device path @@ -27,12 +27,12 @@ the same way it used to be. Signed-off-by: Michael Chang Signed-off-by: Ken Lin --- - grub-core/net/drivers/efi/efinet.c | 278 +++++++++++++++++++++++++++++++++++-- + grub-core/net/drivers/efi/efinet.c | 284 +++++++++++++++++++++++++++++++++++-- include/grub/efi/api.h | 11 ++ - 2 files changed, 274 insertions(+), 15 deletions(-) + 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 6cc139fb8fc..2890e72e87a 100644 +index ac58e3e82cf..431b72916b6 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -27,6 +27,7 @@ @@ -43,7 +43,7 @@ index 6cc139fb8fc..2890e72e87a 100644 GRUB_MOD_LICENSE ("GPLv3+"); -@@ -408,6 +409,221 @@ grub_efinet_findcards (void) +@@ -412,6 +413,227 @@ grub_efinet_findcards (void) } } @@ -57,6 +57,9 @@ index 6cc139fb8fc..2890e72e87a 100644 + grub_err_t err; + + ddp = grub_efi_duplicate_device_path (dp); ++ if (!ddp) ++ return NULL; ++ + ldp = grub_efi_find_last_device_path (ddp); + + if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE @@ -92,7 +95,10 @@ index 6cc139fb8fc..2890e72e87a 100644 + + nb = grub_netbuff_alloc (512); + if (!nb) -+ return NULL; ++ { ++ grub_free (ddp); ++ return NULL; ++ } + + if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE) + { @@ -265,7 +271,7 @@ index 6cc139fb8fc..2890e72e87a 100644 static void grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, char **path) -@@ -423,7 +639,11 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -427,7 +649,11 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, { grub_efi_device_path_t *cdp; struct grub_efi_pxe *pxe; @@ -278,7 +284,7 @@ index 6cc139fb8fc..2890e72e87a 100644 if (card->driver != &efidriver) continue; -@@ -450,11 +670,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -454,11 +680,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, */ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE || (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE @@ -301,7 +307,7 @@ index 6cc139fb8fc..2890e72e87a 100644 dup_ldp = grub_efi_find_last_device_path (dup_dp); dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -@@ -467,23 +697,37 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -471,23 +707,37 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); @@ -350,7 +356,7 @@ index 6cc139fb8fc..2890e72e87a 100644 1, device, path); if (grub_errno) grub_print_error (); -@@ -495,11 +739,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -501,11 +751,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, grub_dprintf ("efinet", "using ipv4 and dhcp\n"); grub_net_configure_by_dhcp_ack (card->name, card, 0, (struct grub_net_bootp_packet *) @@ -369,7 +375,7 @@ index 6cc139fb8fc..2890e72e87a 100644 } } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 6a545cc6d5d..eba987de00a 100644 +index 7dbd8807b80..0b61f791850 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -843,6 +843,8 @@ struct grub_efi_ipv4_device_path diff --git a/0245-efinet-Setting-DNS-server-from-UEFI-protocol.patch b/0350-efinet-Setting-DNS-server-from-UEFI-protocol.patch similarity index 95% rename from 0245-efinet-Setting-DNS-server-from-UEFI-protocol.patch rename to 0350-efinet-Setting-DNS-server-from-UEFI-protocol.patch index 894ca84b..fb23b057 100644 --- a/0245-efinet-Setting-DNS-server-from-UEFI-protocol.patch +++ b/0350-efinet-Setting-DNS-server-from-UEFI-protocol.patch @@ -1,4 +1,4 @@ -From bb5acb2cc50c1fbd6e214ca66268e04733a906eb Mon Sep 17 00:00:00 2001 +From 347ab564463e788d31944e2ad06c0420c01fdf2d Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 14 Jul 2016 17:48:45 +0800 Subject: [PATCH] efinet: Setting DNS server from UEFI protocol @@ -33,7 +33,7 @@ Signed-off-by: Ken Lin 2 files changed, 239 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 2890e72e87a..64d3019af67 100644 +index 431b72916b6..c25a68161b8 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -34,6 +34,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -45,7 +45,7 @@ index 2890e72e87a..64d3019af67 100644 static grub_err_t send_card_buffer (struct grub_net_card *dev, -@@ -409,6 +411,125 @@ grub_efinet_findcards (void) +@@ -413,6 +415,125 @@ grub_efinet_findcards (void) } } @@ -171,7 +171,7 @@ index 2890e72e87a..64d3019af67 100644 static struct grub_net_buff * grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6) { -@@ -461,6 +582,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u +@@ -471,6 +592,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp; struct grub_net_bootp_packet *bp; grub_uint8_t *ptr; @@ -180,7 +180,7 @@ index 2890e72e87a..64d3019af67 100644 bp = (struct grub_net_bootp_packet *) nb->tail; err = grub_netbuff_put (nb, sizeof (*bp) + 4); -@@ -522,6 +645,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u +@@ -532,6 +655,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u *ptr++ = sizeof ("HTTPClient") - 1; grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1); @@ -206,7 +206,7 @@ index 2890e72e87a..64d3019af67 100644 ptr = nb->tail; err = grub_netbuff_put (nb, 1); if (err) -@@ -554,6 +696,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u +@@ -564,6 +706,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u struct grub_net_dhcp6_option *opt; struct grub_net_dhcp6_option_iana *iana; struct grub_net_dhcp6_option_iaaddr *iaaddr; @@ -215,7 +215,7 @@ index 2890e72e87a..64d3019af67 100644 d6p = (struct grub_net_dhcp6_packet *)nb->tail; err = grub_netbuff_put (nb, sizeof(*d6p)); -@@ -617,6 +761,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u +@@ -627,6 +771,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u opt->len = grub_cpu_to_be16 (uri_len); grub_memcpy (opt->data, uri_dp->uri, uri_len); @@ -242,7 +242,7 @@ index 2890e72e87a..64d3019af67 100644 } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index eba987de00a..48302449170 100644 +index 0b61f791850..80f6d79cfaf 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -334,6 +334,16 @@ @@ -262,7 +262,7 @@ index eba987de00a..48302449170 100644 struct grub_efi_sal_system_table { grub_uint32_t signature; -@@ -1825,6 +1835,72 @@ struct grub_efi_block_io +@@ -1842,6 +1852,72 @@ struct grub_efi_block_io }; typedef struct grub_efi_block_io grub_efi_block_io_t; diff --git a/0351-Fix-one-more-coverity-complaint.patch b/0351-Fix-one-more-coverity-complaint.patch new file mode 100644 index 00000000..4393db71 --- /dev/null +++ b/0351-Fix-one-more-coverity-complaint.patch @@ -0,0 +1,27 @@ +From 998c3f2d8291e796d956b20ef215985aea51d3e1 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 25 May 2017 11:27:40 -0400 +Subject: [PATCH] Fix one more coverity complaint + +No idea why covscan thinks this is an "added" bug, since the file hasn't +changed in 3 years, but... yeah. + +Signed-off-by: Peter Jones +--- + grub-core/normal/completion.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c +index 2c9b9e9312a..93aa0d8eda8 100644 +--- a/grub-core/normal/completion.c ++++ b/grub-core/normal/completion.c +@@ -284,7 +284,8 @@ complete_file (void) + + /* Cut away the filename part. */ + dirfile = grub_strrchr (dir, '/'); +- dirfile[1] = '\0'; ++ if (dirfile) ++ dirfile[1] = '\0'; + + /* Iterate the directory. */ + (fs->dir) (dev, dir, iterate_dir, NULL); diff --git a/0352-Make-module-directory-specifiable-on-the-configure-c.patch b/0352-Make-module-directory-specifiable-on-the-configure-c.patch new file mode 100644 index 00000000..ac42afeb --- /dev/null +++ b/0352-Make-module-directory-specifiable-on-the-configure-c.patch @@ -0,0 +1,98 @@ +From 658da7bd0ff62b35395012ccfb10aef13756eb2b Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 25 May 2017 13:45:01 -0400 +Subject: [PATCH] Make module directory specifiable on the configure command + line. + +Currently ppc, ppc64, and ppc64le all wind up with modules in +/usr/lib/grub/powerpc-ieee1275, because powerpc is the target cpu in +grub's eyes. This causes file conflicts between "noarch" module +packages. + +This patch allows --with-moduledir=%{arch} to be specified on the +configure command line to override the directory name for a specific +build, to disambiguate the various ppc directories. + +Resolves: rhbz#1455243 + +Signed-off-by: Peter Jones +--- + configure.ac | 9 +++++++++ + grub-core/osdep/aros/config.c | 2 +- + grub-core/osdep/unix/config.c | 2 +- + conf/Makefile.common | 2 +- + config.h.in | 2 ++ + 5 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 359cac3c26b..aef90611168 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -327,6 +327,15 @@ AS_IF([$($PKG_CONFIG --exists bash-completion)], [ + ]) + AC_SUBST(bashcompletiondir) + ++AC_ARG_WITH([moduledir], ++ AS_HELP_STRING([--with-moduledir=NAME], ++ [set the name of the module directory [[guessed]]]), ++ [moduledirname="$with_moduledir"], ++ [moduledirname="$target_cpu-$platform"]) ++AC_SUBST(moduledirname) ++AC_DEFINE_UNQUOTED(MODULE_DIR_NAME, "$moduledirname", ++ [Default module directory name]) ++ + # + # Checks for build programs. + # +diff --git a/grub-core/osdep/aros/config.c b/grub-core/osdep/aros/config.c +index c82d0ea8e76..bf3593d9743 100644 +--- a/grub-core/osdep/aros/config.c ++++ b/grub-core/osdep/aros/config.c +@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void) + const char * + grub_util_get_pkglibdir (void) + { +- return GRUB_LIBDIR "/" PACKAGE; ++ return GRUB_LIBDIR "/" MODULE_DIR_NAME; + } + + const char * +diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c +index b637c58efb7..403eee565cd 100644 +--- a/grub-core/osdep/unix/config.c ++++ b/grub-core/osdep/unix/config.c +@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void) + const char * + grub_util_get_pkglibdir (void) + { +- return GRUB_LIBDIR "/" PACKAGE; ++ return GRUB_LIBDIR "/" MODULE_DIR_NAME; + } + + const char * +diff --git a/conf/Makefile.common b/conf/Makefile.common +index c75848f5c06..d2fedeaa3a5 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -62,7 +62,7 @@ CCASFLAGS_LIBRARY = + # Other variables + + grubconfdir = $(sysconfdir)/grub.d +-platformdir = $(pkglibdir)/$(target_cpu)-$(platform) ++platformdir = $(pkglibdir)/$(moduledirname) + starfielddir = $(pkgdatadir)/themes/starfield + + CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion +diff --git a/config.h.in b/config.h.in +index 9e8f9911b18..c7fc6efa1fa 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -46,6 +46,8 @@ + #define END_SYMBOL @END_SYMBOL@ + /* Name of package. */ + #define PACKAGE "@PACKAGE@" ++/* Name of the default module directory. */ ++#define MODULE_DIR_NAME "@MODULE_DIR_NAME@" + /* Version number of package. */ + #define VERSION "@VERSION@" + /* Define to the full name and version of this package. */ diff --git a/0353-Fix-grub_net_hwaddr_to_str.patch b/0353-Fix-grub_net_hwaddr_to_str.patch new file mode 100644 index 00000000..18d6bea2 --- /dev/null +++ b/0353-Fix-grub_net_hwaddr_to_str.patch @@ -0,0 +1,41 @@ +From 94b34bfe8f2ca2a3d9bd9cb6f40faaaf605cfa12 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Tue, 22 Aug 2017 12:21:12 -0400 +Subject: [PATCH] Fix grub_net_hwaddr_to_str + +commit 5c3b78c92f8 introduced support for larger network hw addresses. +However, grub_net_hwaddr_to_str() relies on GRUB_NET_MAX_STR_ADDRESS_SIZE +to prevent a spurious ':' at the end of the string. So now, if actual +hwaddr size is less than max, an extra ':' appears at the end of the +string. So calculate max string size based on actual hwaddr length to +fix the problem. + +Signed-off-by: Mark Salter +--- + grub-core/net/net.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index a0f4d00f0be..191e8e41bd6 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -770,6 +770,7 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) + { + char *ptr; + unsigned i; ++ int maxstr; + + if (addr->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE) + { +@@ -778,9 +779,10 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) + addr->type, addr->len); + return; + } ++ maxstr = addr->len * grub_strlen ("XX:"); + for (ptr = str, i = 0; i < addr->len; i++) + { +- ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), ++ ptr += grub_snprintf (ptr, maxstr - (ptr - str), + "%02x:", addr->mac[i] & 0xff); + } + } diff --git a/0247-Support-UEFI-networking-protocols.patch b/0354-Support-UEFI-networking-protocols.patch similarity index 96% rename from 0247-Support-UEFI-networking-protocols.patch rename to 0354-Support-UEFI-networking-protocols.patch index 90cc31d4..85a2064e 100644 --- a/0247-Support-UEFI-networking-protocols.patch +++ b/0354-Support-UEFI-networking-protocols.patch @@ -1,4 +1,4 @@ -From 2ba7c6d3c99c669ce20d26fdc9ed7851fc10b6b4 Mon Sep 17 00:00:00 2001 +From 43067144cfaade754e61a73dc2057807fb668a8f Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Wed, 22 Feb 2017 14:27:50 +0800 Subject: [PATCH] Support UEFI networking protocols @@ -36,11 +36,11 @@ V3: grub-core/net/efi/pxe.c | 424 +++++++++++ grub-core/net/net.c | 74 ++ util/grub-mknetdir.c | 23 +- - include/grub/efi/api.h | 161 +++- + include/grub/efi/api.h | 180 ++++- include/grub/efi/dhcp.h | 343 +++++++++ include/grub/efi/http.h | 215 ++++++ include/grub/net/efi.h | 144 ++++ - 17 files changed, 4621 insertions(+), 27 deletions(-) + 17 files changed, 4626 insertions(+), 41 deletions(-) create mode 100644 grub-core/net/efi/dhcp.c create mode 100644 grub-core/net/efi/efi_netfs.c create mode 100644 grub-core/net/efi/http.c @@ -53,10 +53,10 @@ V3: create mode 100644 include/grub/net/efi.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 51f07279d83..95f17b9e310 100644 +index 334ca3fcf46..cdafd91c677 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -2197,6 +2197,18 @@ module = { +@@ -2192,6 +2192,18 @@ module = { common = hook/datehook.c; }; @@ -75,7 +75,7 @@ index 51f07279d83..95f17b9e310 100644 module = { name = net; common = net/net.c; -@@ -2211,6 +2223,12 @@ module = { +@@ -2206,6 +2218,12 @@ module = { common = net/arp.c; common = net/netbuff.c; common = net/url.c; @@ -89,10 +89,10 @@ index 51f07279d83..95f17b9e310 100644 module = { diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c -index 22438277d74..d0b0f71b6ed 100644 +index dbed6474431..6118bade50d 100644 --- a/grub-core/io/bufio.c +++ b/grub-core/io/bufio.c -@@ -132,7 +132,7 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) +@@ -139,7 +139,7 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) return res; /* Need to read some more. */ @@ -102,10 +102,10 @@ index 22438277d74..d0b0f71b6ed 100644 if (file->offset + res < next_buf) { diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 621251242e1..d765b5881b9 100644 +index a2a732ffc0d..4d36fe31177 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -687,7 +687,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) +@@ -696,7 +696,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) { grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) dp; @@ -114,7 +114,7 @@ index 621251242e1..d765b5881b9 100644 (unsigned) ipv4->local_ip_address[0], (unsigned) ipv4->local_ip_address[1], (unsigned) ipv4->local_ip_address[2], -@@ -700,33 +700,60 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) +@@ -709,33 +709,60 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) ipv4->remote_port, (unsigned) ipv4->protocol, (unsigned) ipv4->static_ip_address); @@ -192,7 +192,7 @@ index 621251242e1..d765b5881b9 100644 } break; case GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE: -@@ -766,6 +793,39 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) +@@ -775,6 +802,39 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) dump_vendor_path ("Messaging", (grub_efi_vendor_device_path_t *) dp); break; @@ -210,22 +210,22 @@ index 621251242e1..d765b5881b9 100644 + if (dns->is_ipv6) + { + grub_printf ("/DNS(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x)", -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[0]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[0])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[1]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[1])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[2]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[2])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[3]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].v4[3]))); ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[0]) >> 16), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[0])), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[1]) >> 16), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[1])), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[2]) >> 16), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[2])), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[3]) >> 16), ++ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[3]))); + } + else + { + grub_printf ("/DNS(%d.%d.%d.%d)", -+ dns->dns_server_ip[0].v4[0], -+ dns->dns_server_ip[0].v4[1], -+ dns->dns_server_ip[0].v4[2], -+ dns->dns_server_ip[0].v4[3]); ++ dns->dns_server_ip[0].v4.addr[0], ++ dns->dns_server_ip[0].v4.addr[1], ++ dns->dns_server_ip[0].v4.addr[2], ++ dns->dns_server_ip[0].v4.addr[3]); + } + } + break; @@ -233,7 +233,7 @@ index 621251242e1..d765b5881b9 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 64d3019af67..eed6f587ae3 100644 +index c25a68161b8..56305f46a3d 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -28,6 +28,7 @@ @@ -244,7 +244,7 @@ index 64d3019af67..eed6f587ae3 100644 GRUB_MOD_LICENSE ("GPLv3+"); -@@ -565,6 +566,17 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u +@@ -572,6 +573,17 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u ldp = grub_efi_find_last_device_path (ddp); @@ -262,7 +262,7 @@ index 64d3019af67..eed6f587ae3 100644 if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE || (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE)) -@@ -834,6 +846,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -844,6 +856,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE || (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE @@ -270,7 +270,7 @@ index 64d3019af67..eed6f587ae3 100644 && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) continue; dup_dp = grub_efi_duplicate_device_path (dp); -@@ -848,6 +861,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -858,6 +871,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, dup_ldp->length = sizeof (*dup_ldp); } @@ -286,7 +286,7 @@ index 64d3019af67..eed6f587ae3 100644 dup_ldp = grub_efi_find_last_device_path (dup_dp); dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -@@ -917,6 +939,9 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -929,6 +951,9 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, GRUB_MOD_INIT(efinet) { @@ -296,7 +296,7 @@ index 64d3019af67..eed6f587ae3 100644 grub_efinet_findcards (); grub_efi_net_config = grub_efi_net_config_real; } -@@ -928,5 +953,7 @@ GRUB_MOD_FINI(efinet) +@@ -940,5 +965,7 @@ GRUB_MOD_FINI(efinet) FOR_NET_CARDS_SAFE (card, next) if (card->driver == &efidriver) grub_net_card_unregister (card); @@ -1601,7 +1601,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..c0d920fa44c +index 00000000000..017c4d05bc7 --- /dev/null +++ b/grub-core/net/efi/ip6_config.c @@ -0,0 +1,422 @@ @@ -1631,7 +1631,7 @@ index 00000000000..c0d920fa44c + if (i == 7) + squash = 2; + -+ addr = grub_get_unaligned16 (address + i * 2); ++ addr = grub_get_unaligned16 (address->addr + i * 2); + + if (grub_be_to_cpu16 (addr)) + { @@ -1862,10 +1862,10 @@ index 00000000000..c0d920fa44c + gateway = grub_efi_ip6_address_to_string (&route_table->gateway); + destination = grub_efi_ip6_address_to_string (&route_table->destination); + -+ u64_gateway[0] = grub_get_unaligned64 (route_table->gateway); -+ u64_gateway[1] = grub_get_unaligned64 (route_table->gateway + 8); -+ u64_destination[0] = grub_get_unaligned64 (route_table->destination); -+ u64_destination[1] = grub_get_unaligned64 (route_table->destination + 8); ++ u64_gateway[0] = grub_get_unaligned64 (route_table->gateway.addr); ++ u64_gateway[1] = grub_get_unaligned64 (route_table->gateway.addr + 8); ++ u64_destination[0] = grub_get_unaligned64 (route_table->destination.addr); ++ u64_destination[1] = grub_get_unaligned64 (route_table->destination.addr + 8); + + for (inf = dev->net_interfaces; inf; inf = inf->next) + if (inf->prefer_ip6) @@ -1926,8 +1926,8 @@ index 00000000000..c0d920fa44c + + u64_addr[0] = grub_get_unaligned64 (address); + u64_addr[1] = grub_get_unaligned64 (address + 4); -+ u64_subnet[0] = grub_get_unaligned64 (route_table->destination); -+ u64_subnet[1] = grub_get_unaligned64 (route_table->destination + 8); ++ u64_subnet[0] = grub_get_unaligned64 (route_table->destination.addr); ++ u64_subnet[1] = grub_get_unaligned64 (route_table->destination.addr + 8); + u64_mask[0] = (route_table->prefix_length <= 64) ? + 0xffffffffffffffffULL << (64 - route_table->prefix_length) : + 0xffffffffffffffffULL; @@ -3463,7 +3463,7 @@ index 00000000000..9e0078ac1c6 +} diff --git a/grub-core/net/efi/pxe.c b/grub-core/net/efi/pxe.c new file mode 100644 -index 00000000000..d9febf12e5b +index 00000000000..531949cba5c --- /dev/null +++ b/grub-core/net/efi/pxe.c @@ -0,0 +1,424 @@ @@ -3556,7 +3556,7 @@ index 00000000000..d9febf12e5b + grub_efi_status_t status; + grub_efi_pxe_ip_address_t station_ip; + -+ grub_memcpy (station_ip.v6, manual_address->address, sizeof (station_ip.v6)); ++ grub_memcpy (station_ip.v6.addr, manual_address->address, sizeof (station_ip.v6.addr)); + status = efi_call_3 (pxe->set_station_ip, pxe, &station_ip, NULL); + + if (status != GRUB_EFI_SUCCESS) @@ -3577,8 +3577,8 @@ index 00000000000..d9febf12e5b + grub_efi_pxe_ip_address_t station_ip; + grub_efi_pxe_ip_address_t subnet_mask; + -+ grub_memcpy (station_ip.v4, manual_address->address, sizeof (station_ip.v4)); -+ grub_memcpy (subnet_mask.v4, manual_address->subnet_mask, sizeof (subnet_mask.v4)); ++ grub_memcpy (station_ip.v4.addr, manual_address->address, sizeof (station_ip.v4.addr)); ++ grub_memcpy (subnet_mask.v4.addr, manual_address->subnet_mask, sizeof (subnet_mask.v4.addr)); + + status = efi_call_3 (pxe->set_station_ip, pxe, &station_ip, &subnet_mask); + @@ -3593,35 +3593,35 @@ index 00000000000..d9febf12e5b + if (mode->using_ipv6) + { + grub_printf ("PXE STATION IP: %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", -+ mode->station_ip.v6[0], -+ mode->station_ip.v6[1], -+ mode->station_ip.v6[2], -+ mode->station_ip.v6[3], -+ mode->station_ip.v6[4], -+ mode->station_ip.v6[5], -+ mode->station_ip.v6[6], -+ mode->station_ip.v6[7], -+ mode->station_ip.v6[8], -+ mode->station_ip.v6[9], -+ mode->station_ip.v6[10], -+ mode->station_ip.v6[11], -+ mode->station_ip.v6[12], -+ mode->station_ip.v6[13], -+ mode->station_ip.v6[14], -+ mode->station_ip.v6[15]); ++ mode->station_ip.v6.addr[0], ++ mode->station_ip.v6.addr[1], ++ mode->station_ip.v6.addr[2], ++ mode->station_ip.v6.addr[3], ++ mode->station_ip.v6.addr[4], ++ mode->station_ip.v6.addr[5], ++ mode->station_ip.v6.addr[6], ++ mode->station_ip.v6.addr[7], ++ mode->station_ip.v6.addr[8], ++ mode->station_ip.v6.addr[9], ++ mode->station_ip.v6.addr[10], ++ mode->station_ip.v6.addr[11], ++ mode->station_ip.v6.addr[12], ++ mode->station_ip.v6.addr[13], ++ mode->station_ip.v6.addr[14], ++ mode->station_ip.v6.addr[15]); + } + else + { + grub_printf ("PXE STATION IP: %d.%d.%d.%d\n", -+ mode->station_ip.v4[0], -+ mode->station_ip.v4[1], -+ mode->station_ip.v4[2], -+ mode->station_ip.v4[3]); ++ mode->station_ip.v4.addr[0], ++ mode->station_ip.v4.addr[1], ++ mode->station_ip.v4.addr[2], ++ mode->station_ip.v4.addr[3]); + grub_printf ("PXE SUBNET MASK: %d.%d.%d.%d\n", -+ mode->subnet_mask.v4[0], -+ mode->subnet_mask.v4[1], -+ mode->subnet_mask.v4[2], -+ mode->subnet_mask.v4[3]); ++ mode->subnet_mask.v4.addr[0], ++ mode->subnet_mask.v4.addr[1], ++ mode->subnet_mask.v4.addr[2], ++ mode->subnet_mask.v4.addr[3]); + } +#endif + @@ -3705,32 +3705,32 @@ index 00000000000..d9febf12e5b + const char *rest; + grub_uint64_t ip6[2]; + if (parse_ip6 (file->device->net->server, ip6, &rest) && *rest == 0) -+ grub_memcpy (server_ip.v6, ip6, sizeof (server_ip.v6)); ++ grub_memcpy (server_ip.v6.addr, ip6, sizeof (server_ip.v6.addr)); + /* TODO: ERROR Handling Here */ +#if 0 + grub_printf ("PXE SERVER IP: %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", -+ server_ip.v6[0], -+ server_ip.v6[1], -+ server_ip.v6[2], -+ server_ip.v6[3], -+ server_ip.v6[4], -+ server_ip.v6[5], -+ server_ip.v6[6], -+ server_ip.v6[7], -+ server_ip.v6[8], -+ server_ip.v6[9], -+ server_ip.v6[10], -+ server_ip.v6[11], -+ server_ip.v6[12], -+ server_ip.v6[13], -+ server_ip.v6[14], -+ server_ip.v6[15]); ++ server_ip.v6.addr[0], ++ server_ip.v6.addr[1], ++ server_ip.v6.addr[2], ++ server_ip.v6.addr[3], ++ server_ip.v6.addr[4], ++ server_ip.v6.addr[5], ++ server_ip.v6.addr[6], ++ server_ip.v6.addr[7], ++ server_ip.v6.addr[8], ++ server_ip.v6.addr[9], ++ server_ip.v6.addr[10], ++ server_ip.v6.addr[11], ++ server_ip.v6.addr[12], ++ server_ip.v6.addr[13], ++ server_ip.v6.addr[14], ++ server_ip.v6.addr[15]); +#endif + } + else + { + for (i = 0, p = file->device->net->server; i < 4; ++i, ++p) -+ server_ip.v4[i] = grub_strtoul (p, &p, 10); ++ server_ip.v4.addr[i] = grub_strtoul (p, &p, 10); + } + + status = efi_call_10 (pxe->mtftp, @@ -3809,13 +3809,13 @@ index 00000000000..d9febf12e5b + const char *rest; + grub_uint64_t ip6[2]; + if (parse_ip6 (file->device->net->server, ip6, &rest) && *rest == 0) -+ grub_memcpy (server_ip.v6, ip6, sizeof (server_ip.v6)); ++ grub_memcpy (server_ip.v6.addr, ip6, sizeof (server_ip.v6.addr)); + /* TODO: ERROR Handling Here */ + } + else + { + for (i = 0, p = file->device->net->server; i < 4; ++i, ++p) -+ server_ip.v4[i] = grub_strtoul (p, &p, 10); ++ server_ip.v4.addr[i] = grub_strtoul (p, &p, 10); + } + + status = efi_call_10 (pxe->mtftp, @@ -3892,7 +3892,7 @@ index 00000000000..d9febf12e5b + }; + diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index c84b435e8a5..ca51ae1bd94 100644 +index 191e8e41bd6..a571ee92efa 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -32,6 +32,9 @@ @@ -3905,7 +3905,7 @@ index c84b435e8a5..ca51ae1bd94 100644 GRUB_MOD_LICENSE ("GPLv3+"); -@@ -2018,8 +2021,49 @@ static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; +@@ -2025,8 +2028,49 @@ static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; static grub_command_t cmd_lsroutes, cmd_lscards; static grub_command_t cmd_lsaddr, cmd_slaac; @@ -3955,7 +3955,7 @@ index c84b435e8a5..ca51ae1bd94 100644 grub_register_variable_hook ("net_default_server", defserver_get_env, defserver_set_env); grub_env_export ("net_default_server"); -@@ -2067,10 +2111,37 @@ GRUB_MOD_INIT(net) +@@ -2074,10 +2118,37 @@ GRUB_MOD_INIT(net) grub_net_restore_hw, GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; @@ -3993,7 +3993,7 @@ index c84b435e8a5..ca51ae1bd94 100644 grub_register_variable_hook ("net_default_server", 0, 0); grub_register_variable_hook ("pxe_default_server", 0, 0); -@@ -2089,4 +2160,7 @@ GRUB_MOD_FINI(net) +@@ -2096,4 +2167,7 @@ GRUB_MOD_FINI(net) grub_net_fini_hw (0); grub_loader_unregister_preboot_hook (fini_hnd); grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; @@ -4084,31 +4084,34 @@ index 82073d5cc94..ae31271bbc0 100644 if (!grub_install_source_directory) { diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 48302449170..2af2ae9873d 100644 +index 80f6d79cfaf..5f62a2d4292 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h -@@ -593,6 +593,11 @@ typedef grub_efi_uintn_t grub_efi_tpl_t; - typedef grub_efi_uint8_t grub_efi_mac_address_t[32]; - typedef grub_efi_uint8_t grub_efi_ipv4_address_t[4]; - typedef grub_efi_uint8_t grub_efi_ipv6_address_t[16]; -+ -+typedef grub_efi_mac_address_t grub_efi_pxe_mac_address_t; -+typedef grub_efi_ipv4_address_t grub_efi_pxe_ipv4_address_t; -+typedef grub_efi_ipv6_address_t grub_efi_pxe_ipv6_address_t; -+ - typedef union - { - grub_efi_uint32_t addr[4]; -@@ -600,6 +605,8 @@ typedef union - grub_efi_ipv6_address_t v6; - } grub_efi_ip_address_t __attribute__ ((aligned(4))); +@@ -602,6 +602,23 @@ typedef union -+typedef grub_efi_ip_address_t grub_efi_pxe_ip_address_t; -+ typedef grub_efi_uint64_t grub_efi_physical_address_t; typedef grub_efi_uint64_t grub_efi_virtual_address_t; ++typedef struct { ++ grub_uint8_t addr[4]; ++} grub_efi_pxe_ipv4_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[16]; ++} grub_efi_pxe_ipv6_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[32]; ++} grub_efi_pxe_mac_address_t; ++ ++typedef union { ++ grub_uint32_t addr[4]; ++ grub_efi_pxe_ipv4_address_t v4; ++ grub_efi_pxe_ipv6_address_t v6; ++} grub_efi_pxe_ip_address_t; -@@ -869,6 +876,8 @@ struct grub_efi_ipv6_device_path + struct grub_efi_guid + { +@@ -869,6 +886,8 @@ struct grub_efi_ipv6_device_path grub_efi_uint16_t remote_port; grub_efi_uint16_t protocol; grub_efi_uint8_t static_ip_address; @@ -4117,7 +4120,7 @@ index 48302449170..2af2ae9873d 100644 } GRUB_PACKED; typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t; -@@ -918,6 +927,15 @@ struct grub_efi_uri_device_path +@@ -918,6 +937,15 @@ struct grub_efi_uri_device_path } GRUB_PACKED; typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t; @@ -4133,7 +4136,7 @@ index 48302449170..2af2ae9873d 100644 #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 /* Media Device Path. */ -@@ -1000,6 +1018,23 @@ struct grub_efi_bios_device_path +@@ -1000,6 +1028,23 @@ struct grub_efi_bios_device_path } GRUB_PACKED; typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t; @@ -4157,12 +4160,18 @@ index 48302449170..2af2ae9873d 100644 struct grub_efi_open_protocol_information_entry { grub_efi_handle_t agent_handle; -@@ -1542,6 +1577,29 @@ typedef struct grub_efi_pxe_arp_entry - grub_efi_mac_address_t mac_addr; - } grub_efi_pxe_arp_entry_t; +@@ -1549,23 +1594,27 @@ typedef struct grub_efi_pxe_tftp_error + grub_efi_char8_t error_string[127]; + } grub_efi_pxe_tftp_error_t; +-typedef struct { +- grub_uint8_t addr[4]; +-} grub_efi_pxe_ipv4_address_t; +typedef grub_efi_uint16_t grub_efi_pxe_base_code_udp_port_t; -+ + +-typedef struct { +- grub_uint8_t addr[16]; +-} grub_efi_pxe_ipv6_address_t; +typedef enum { + GRUB_EFI_PXE_BASE_CODE_TFTP_FIRST, + GRUB_EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE, @@ -4174,20 +4183,26 @@ index 48302449170..2af2ae9873d 100644 + GRUB_EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY, + GRUB_EFI_PXE_BASE_CODE_MTFTP_LAST +} grub_efi_pxe_base_code_tftp_opcode_t; -+ -+ -+typedef struct { + + typedef struct { +- grub_uint8_t addr[32]; +-} grub_efi_pxe_mac_address_t; +- +-typedef union { +- grub_uint32_t addr[4]; +- grub_efi_pxe_ipv4_address_t v4; +- grub_efi_pxe_ipv6_address_t v6; +-} grub_efi_pxe_ip_address_t; + grub_efi_ip_address_t mcast_ip; + grub_efi_pxe_base_code_udp_port_t c_port; + grub_efi_pxe_base_code_udp_port_t s_port; + grub_efi_uint16_t listen_timeout; + grub_efi_uint16_t transmit_timeout; +} grub_efi_pxe_base_code_mtftp_info_t; -+ - typedef struct grub_efi_pxe_route_entry - { - grub_efi_ip_address_t ip_addr; -@@ -1615,17 +1673,31 @@ typedef struct grub_efi_pxe_mode + + #define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8 + typedef struct grub_efi_pxe_ip_filter +@@ -1632,17 +1681,31 @@ typedef struct grub_efi_pxe_mode typedef struct grub_efi_pxe { grub_uint64_t rev; @@ -4223,7 +4238,7 @@ index 48302449170..2af2ae9873d 100644 void (*setpackets) (void); struct grub_efi_pxe_mode *mode; } grub_efi_pxe_t; -@@ -1867,6 +1939,44 @@ struct grub_efi_ip4_config2_protocol +@@ -1884,6 +1947,44 @@ struct grub_efi_ip4_config2_protocol }; typedef struct grub_efi_ip4_config2_protocol grub_efi_ip4_config2_protocol_t; @@ -4268,7 +4283,7 @@ index 48302449170..2af2ae9873d 100644 enum grub_efi_ip6_config_data_type { GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, GRUB_EFI_IP6_CONFIG_DATA_TYPE_ALT_INTERFACEID, -@@ -1901,6 +2011,49 @@ struct grub_efi_ip6_config_protocol +@@ -1918,6 +2019,49 @@ struct grub_efi_ip6_config_protocol }; typedef struct grub_efi_ip6_config_protocol grub_efi_ip6_config_protocol_t; diff --git a/0248-AUDIT-0-http-boot-tracker-bug.patch b/0355-AUDIT-0-http-boot-tracker-bug.patch similarity index 94% rename from 0248-AUDIT-0-http-boot-tracker-bug.patch rename to 0355-AUDIT-0-http-boot-tracker-bug.patch index efd1c978..0b50b51c 100644 --- a/0248-AUDIT-0-http-boot-tracker-bug.patch +++ b/0355-AUDIT-0-http-boot-tracker-bug.patch @@ -1,4 +1,4 @@ -From d7e857c8a02ae15a940faacc6e8b688cc590c4d7 Mon Sep 17 00:00:00 2001 +From fbf7e38ebae25ad21cc6c2100ad79ba83d2ed9f9 Mon Sep 17 00:00:00 2001 From: Sebastian Krahmer Date: Tue, 28 Nov 2017 17:24:38 +0800 Subject: [PATCH] AUDIT-0: http boot tracker bug @@ -38,7 +38,7 @@ index 9e0078ac1c6..2bf15447fd5 100644 if (buf) { diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index f182d7b871d..5004ecfee42 100644 +index 00737c52750..c9c59690a98 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -31,7 +31,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/0246-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch b/0356-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch similarity index 95% rename from 0246-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch rename to 0356-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch index 8824a789..81d59f52 100644 --- a/0246-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch +++ b/0356-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch @@ -1,8 +1,7 @@ -From f332a348642ef45df2445c4ec04a629a234e04fd Mon Sep 17 00:00:00 2001 +From e0984418abb27979b7813722594b31ba89e134e6 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 1 Feb 2017 23:10:45 +0100 -Subject: [PATCH] grub-core/video/efi_gop.c: Add support for BLT_ONLY - adapters +Subject: [PATCH] grub-core/video/efi_gop.c: Add support for BLT_ONLY adapters EFI GOP has support for multiple different bitness types of frame buffers and for a special "BLT only" type which is always defined to be RGBx. diff --git a/0357-efi-uga-use-64-bit-for-fb_base.patch b/0357-efi-uga-use-64-bit-for-fb_base.patch new file mode 100644 index 00000000..3ccf26e9 --- /dev/null +++ b/0357-efi-uga-use-64-bit-for-fb_base.patch @@ -0,0 +1,105 @@ +From 57c68ef5851da2e350372a5a845b623ef9773ad9 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Wed, 16 May 2018 13:06:04 -0400 +Subject: [PATCH] efi/uga: use 64 bit for fb_base + +We get 64 bit from PCI BAR but then truncate by assigning to 32 bit. +Make sure to check that pointer does not overflow on 32 bit platform. + +Closes: 50931 +--- + grub-core/video/efi_uga.c | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) + +diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c +index 044af1d20d3..97a607c01a5 100644 +--- a/grub-core/video/efi_uga.c ++++ b/grub-core/video/efi_uga.c +@@ -34,7 +34,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + + static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; + static struct grub_efi_uga_draw_protocol *uga; +-static grub_uint32_t uga_fb; ++static grub_uint64_t uga_fb; + static grub_uint32_t uga_pitch; + + static struct +@@ -52,7 +52,7 @@ static struct + #define FBTEST_COUNT 8 + + static int +-find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) ++find_line_len (grub_uint64_t *fb_base, grub_uint32_t *line_len) + { + grub_uint32_t *base = (grub_uint32_t *) (grub_addr_t) *fb_base; + int i; +@@ -67,7 +67,7 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) + { + if ((base[j] & RGB_MASK) == RGB_MAGIC) + { +- *fb_base = (grub_uint32_t) (grub_addr_t) base; ++ *fb_base = (grub_uint64_t) (grub_addr_t) base; + *line_len = j << 2; + + return 1; +@@ -84,7 +84,7 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) + /* Context for find_framebuf. */ + struct find_framebuf_ctx + { +- grub_uint32_t *fb_base; ++ grub_uint64_t *fb_base; + grub_uint32_t *line_len; + int found; + }; +@@ -129,7 +129,9 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) + if (i == 5) + break; + +- old_bar2 = grub_pci_read (addr + 4); ++ i++; ++ addr += 4; ++ old_bar2 = grub_pci_read (addr); + } + else + old_bar2 = 0; +@@ -138,10 +140,15 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) + base64 <<= 32; + base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); + +- grub_dprintf ("fb", "%s(%d): 0x%llx\n", ++ grub_dprintf ("fb", "%s(%d): 0x%" PRIxGRUB_UINT64_T "\n", + ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? +- "VMEM" : "MMIO"), i, +- (unsigned long long) base64); ++ "VMEM" : "MMIO"), type == GRUB_PCI_ADDR_MEM_TYPE_64 ? i - 1 : i, ++ base64); ++ ++#if GRUB_CPU_SIZEOF_VOID_P == 4 ++ if (old_bar2) ++ continue; ++#endif + + if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! ctx->found)) + { +@@ -149,12 +156,6 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) + if (find_line_len (ctx->fb_base, ctx->line_len)) + ctx->found++; + } +- +- if (type == GRUB_PCI_ADDR_MEM_TYPE_64) +- { +- i++; +- addr += 4; +- } + } + } + +@@ -162,7 +163,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) + } + + static int +-find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) ++find_framebuf (grub_uint64_t *fb_base, grub_uint32_t *line_len) + { + struct find_framebuf_ctx ctx = { + .fb_base = fb_base, diff --git a/0358-EFI-console-Do-not-set-text-mode-until-we-actually-n.patch b/0358-EFI-console-Do-not-set-text-mode-until-we-actually-n.patch new file mode 100644 index 00000000..90eb1489 --- /dev/null +++ b/0358-EFI-console-Do-not-set-text-mode-until-we-actually-n.patch @@ -0,0 +1,184 @@ +From c56e633bdb9d92c5293cee2c72ac346cd34d5ec7 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 6 Mar 2018 17:11:15 +0100 +Subject: [PATCH] EFI: console: Do not set text-mode until we actually need it + +If we're running with a hidden menu we may never need text mode, so do not +change the video-mode to text until we actually need it. + +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 65 ++++++++++++++++++++++++++++++-------------- + 1 file changed, 44 insertions(+), 21 deletions(-) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index 02f64ea7441..6772feaa2f9 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -24,6 +24,11 @@ + #include + #include + ++static grub_err_t grub_prepare_for_text_output(struct grub_term_output *term); ++ ++static int text_mode_available = -1; ++static int text_colorstate = -1; ++ + static grub_uint32_t + map_char (grub_uint32_t c) + { +@@ -66,14 +71,14 @@ map_char (grub_uint32_t c) + } + + static void +-grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), ++grub_console_putchar (struct grub_term_output *term, + const struct grub_unicode_glyph *c) + { + grub_efi_char16_t str[2 + 30]; + grub_efi_simple_text_output_interface_t *o; + unsigned i, j; + +- if (grub_efi_is_finished) ++ if (grub_prepare_for_text_output (term)) + return; + + o = grub_efi_system_table->con_out; +@@ -220,14 +225,15 @@ grub_console_getkey (struct grub_term_input *term) + } + + static struct grub_term_coordinate +-grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) ++grub_console_getwh (struct grub_term_output *term) + { + grub_efi_simple_text_output_interface_t *o; + grub_efi_uintn_t columns, rows; + + o = grub_efi_system_table->con_out; +- if (grub_efi_is_finished || efi_call_4 (o->query_mode, o, o->mode->mode, +- &columns, &rows) != GRUB_EFI_SUCCESS) ++ if (grub_prepare_for_text_output (term) != GRUB_ERR_NONE || ++ efi_call_4 (o->query_mode, o, o->mode->mode, ++ &columns, &rows) != GRUB_EFI_SUCCESS) + { + /* Why does this fail? */ + columns = 80; +@@ -242,7 +248,7 @@ grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) + { + grub_efi_simple_text_output_interface_t *o; + +- if (grub_efi_is_finished) ++ if (grub_efi_is_finished || text_mode_available != 1) + return (struct grub_term_coordinate) { 0, 0 }; + + o = grub_efi_system_table->con_out; +@@ -250,12 +256,12 @@ grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) + } + + static void +-grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), ++grub_console_gotoxy (struct grub_term_output *term, + struct grub_term_coordinate pos) + { + grub_efi_simple_text_output_interface_t *o; + +- if (grub_efi_is_finished) ++ if (grub_prepare_for_text_output (term)) + return; + + o = grub_efi_system_table->con_out; +@@ -268,7 +274,7 @@ grub_console_cls (struct grub_term_output *term __attribute__ ((unused))) + grub_efi_simple_text_output_interface_t *o; + grub_efi_int32_t orig_attr; + +- if (grub_efi_is_finished) ++ if (grub_efi_is_finished || text_mode_available != 1) + return; + + o = grub_efi_system_table->con_out; +@@ -288,6 +294,12 @@ grub_console_setcolorstate (struct grub_term_output *term + if (grub_efi_is_finished) + return; + ++ if (text_mode_available != 1) { ++ /* Avoid "color_normal" environment writes causing a switch to textmode */ ++ text_colorstate = state; ++ return; ++ } ++ + o = grub_efi_system_table->con_out; + + switch (state) { +@@ -312,7 +324,7 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), + { + grub_efi_simple_text_output_interface_t *o; + +- if (grub_efi_is_finished) ++ if (grub_efi_is_finished || text_mode_available != 1) + return; + + o = grub_efi_system_table->con_out; +@@ -320,18 +332,38 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), + } + + static grub_err_t +-grub_efi_console_output_init (struct grub_term_output *term) ++grub_prepare_for_text_output(struct grub_term_output *term) + { +- grub_efi_set_text_mode (1); ++ if (grub_efi_is_finished) ++ return GRUB_ERR_BAD_DEVICE; ++ ++ if (text_mode_available != -1) ++ return text_mode_available ? 0 : GRUB_ERR_BAD_DEVICE; ++ ++ if (! grub_efi_set_text_mode (1)) ++ { ++ /* This really should never happen */ ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot set text mode"); ++ text_mode_available = 0; ++ return GRUB_ERR_BAD_DEVICE; ++ } ++ + grub_console_setcursor (term, 1); ++ if (text_colorstate != -1) ++ grub_console_setcolorstate (term, text_colorstate); ++ text_mode_available = 1; + return 0; + } + + static grub_err_t + grub_efi_console_output_fini (struct grub_term_output *term) + { ++ if (text_mode_available != 1) ++ return 0; ++ + grub_console_setcursor (term, 0); + grub_efi_set_text_mode (0); ++ text_mode_available = -1; + return 0; + } + +@@ -345,7 +377,6 @@ static struct grub_term_input grub_console_term_input = + static struct grub_term_output grub_console_term_output = + { + .name = "console", +- .init = grub_efi_console_output_init, + .fini = grub_efi_console_output_fini, + .putchar = grub_console_putchar, + .getwh = grub_console_getwh, +@@ -361,14 +392,6 @@ static struct grub_term_output grub_console_term_output = + void + grub_console_init (void) + { +- /* FIXME: it is necessary to consider the case where no console control +- is present but the default is already in text mode. */ +- if (! grub_efi_set_text_mode (1)) +- { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot set text mode"); +- return; +- } +- + grub_term_register_output ("console", &grub_console_term_output); + grub_term_register_input ("console", &grub_console_term_input); + } diff --git a/0359-EFI-console-Add-grub_console_read_key_stroke-helper-.patch b/0359-EFI-console-Add-grub_console_read_key_stroke-helper-.patch new file mode 100644 index 00000000..df73f8cd --- /dev/null +++ b/0359-EFI-console-Add-grub_console_read_key_stroke-helper-.patch @@ -0,0 +1,102 @@ +From 42372b0aeaa7a80c77bbab336678d07f46447cc7 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 6 Jun 2018 15:54:44 +0200 +Subject: [PATCH] EFI: console: Add grub_console_read_key_stroke() helper + function + +This is a preparation patch for adding getkeystatus() support to the +EFI console terminal input driver. + +We can get modifier status through the simple_text_input read_key_stroke +method, but if a non-modifier key is (also) pressed the read_key_stroke +call will consume that key from the firmware's queue. + +The new grub_console_read_key_stroke() helper buffers upto 1 key-stroke. +If it has a non-modifier key buffered, it will return that one, if its +buffer is empty, it will fills its buffer by getting a new key-stroke. + +If called with consume=1 it will empty its buffer after copying the +key-data to the callers buffer, this is how getkey() will use it. + +If called with consume=0 it will keep the last key-stroke buffered, this +is how getkeystatus() will call it. This means that if a non-modifier +key gets pressed, repeated getkeystatus() calls will return the modifiers +of that key-press until it is consumed by a getkey() call. + +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 51 ++++++++++++++++++++++++++++++++++---------- + 1 file changed, 40 insertions(+), 11 deletions(-) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index 6772feaa2f9..bc74b04a368 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -154,27 +154,56 @@ grub_console_getkey_con (struct grub_term_input *term __attribute__ ((unused))) + return grub_efi_translate_key(key); + } + ++/* ++ * When more then just modifiers are pressed, our getkeystatus() consumes a ++ * press from the queue, this function buffers the press for the regular ++ * getkey() so that it does not get lost. ++ */ ++static int ++grub_console_read_key_stroke ( ++ grub_efi_simple_text_input_ex_interface_t *text_input, ++ grub_efi_key_data_t *key_data_ret, int *key_ret, ++ int consume) ++{ ++ static grub_efi_key_data_t key_data; ++ grub_efi_status_t status; ++ int key; ++ ++ if (!text_input) ++ return GRUB_ERR_EOF; ++ ++ key = grub_efi_translate_key (key_data.key); ++ if (key == GRUB_TERM_NO_KEY) { ++ status = efi_call_2 (text_input->read_key_stroke, text_input, &key_data); ++ if (status != GRUB_EFI_SUCCESS) ++ return GRUB_ERR_EOF; ++ ++ key = grub_efi_translate_key (key_data.key); ++ } ++ ++ *key_data_ret = key_data; ++ *key_ret = key; ++ ++ if (consume) { ++ key_data.key.scan_code = 0; ++ key_data.key.unicode_char = 0; ++ } ++ ++ return 0; ++} ++ + static int + grub_console_getkey_ex(struct grub_term_input *term) + { + grub_efi_key_data_t key_data; +- grub_efi_status_t status; + grub_efi_uint32_t kss; + int key = -1; + +- grub_efi_simple_text_input_ex_interface_t *text_input = term->data; +- +- status = efi_call_2 (text_input->read_key_stroke, text_input, &key_data); +- +- if (status != GRUB_EFI_SUCCESS) ++ if (grub_console_read_key_stroke (term->data, &key_data, &key, 1) || ++ key == GRUB_TERM_NO_KEY) + return GRUB_TERM_NO_KEY; + + kss = key_data.key_state.key_shift_state; +- key = grub_efi_translate_key(key_data.key); +- +- if (key == GRUB_TERM_NO_KEY) +- return GRUB_TERM_NO_KEY; +- + if (kss & GRUB_EFI_SHIFT_STATE_VALID) + { + if ((kss & GRUB_EFI_LEFT_SHIFT_PRESSED diff --git a/0360-EFI-console-Implement-getkeystatus-support.patch b/0360-EFI-console-Implement-getkeystatus-support.patch new file mode 100644 index 00000000..57757550 --- /dev/null +++ b/0360-EFI-console-Implement-getkeystatus-support.patch @@ -0,0 +1,72 @@ +From f66a8009366b6f32049f499def7087d1eb1c61e1 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 6 Jun 2018 16:16:47 +0200 +Subject: [PATCH] EFI: console: Implement getkeystatus() support + +Implement getkeystatus() support. + +Note that if a non-modifier key gets pressed and repeated calls to +getkeystatus() are made then it will return the modifier status at the +time of the non-modifier key, until that key-press gets consumed by a +getkey() call. + +This is a side-effect of how the EFI simple-text-input protocol works +and cannot be avoided. + +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index bc74b04a368..a5abaf8e722 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -220,6 +220,39 @@ grub_console_getkey_ex(struct grub_term_input *term) + return key; + } + ++static int ++grub_console_getkeystatus(struct grub_term_input *term) ++{ ++ grub_efi_key_data_t key_data; ++ grub_efi_uint32_t kss; ++ int key, mods = 0; ++ ++ if (grub_efi_is_finished) ++ return 0; ++ ++ if (grub_console_read_key_stroke (term->data, &key_data, &key, 0)) ++ return 0; ++ ++ kss = key_data.key_state.key_shift_state; ++ if (kss & GRUB_EFI_SHIFT_STATE_VALID) ++ { ++ if (kss & GRUB_EFI_LEFT_SHIFT_PRESSED) ++ mods |= GRUB_TERM_STATUS_LSHIFT; ++ if (kss & GRUB_EFI_RIGHT_SHIFT_PRESSED) ++ mods |= GRUB_TERM_STATUS_RSHIFT; ++ if (kss & GRUB_EFI_LEFT_ALT_PRESSED) ++ mods |= GRUB_TERM_STATUS_LALT; ++ if (kss & GRUB_EFI_RIGHT_ALT_PRESSED) ++ mods |= GRUB_TERM_STATUS_RALT; ++ if (kss & GRUB_EFI_LEFT_CONTROL_PRESSED) ++ mods |= GRUB_TERM_STATUS_LCTRL; ++ if (kss & GRUB_EFI_RIGHT_CONTROL_PRESSED) ++ mods |= GRUB_TERM_STATUS_RCTRL; ++ } ++ ++ return mods; ++} ++ + static grub_err_t + grub_efi_console_input_init (struct grub_term_input *term) + { +@@ -400,6 +433,7 @@ static struct grub_term_input grub_console_term_input = + { + .name = "console", + .getkey = grub_console_getkey, ++ .getkeystatus = grub_console_getkeystatus, + .init = grub_efi_console_input_init, + }; + diff --git a/0361-Make-grub_getkeystatus-helper-funtion-available-ever.patch b/0361-Make-grub_getkeystatus-helper-funtion-available-ever.patch new file mode 100644 index 00000000..5c4df47a --- /dev/null +++ b/0361-Make-grub_getkeystatus-helper-funtion-available-ever.patch @@ -0,0 +1,87 @@ +From 1b670f37f3b1fafd40db2c01c1fdd14215728274 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 6 Jun 2018 16:47:11 +0200 +Subject: [PATCH] Make grub_getkeystatus helper funtion available everywhere + +Move the grub_getkeystatus helper function from +grub-core/commands/keystatus.c to grub-core/kern/term.c +and export it so that it can be used outside of the +keystatus command code too. + +Signed-off-by: Hans de Goede +--- + grub-core/commands/keystatus.c | 18 ------------------ + grub-core/kern/term.c | 18 ++++++++++++++++++ + include/grub/term.h | 1 + + 3 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/grub-core/commands/keystatus.c b/grub-core/commands/keystatus.c +index 460cf4e7e50..ff3f5878163 100644 +--- a/grub-core/commands/keystatus.c ++++ b/grub-core/commands/keystatus.c +@@ -35,24 +35,6 @@ static const struct grub_arg_option options[] = + {0, 0, 0, 0, 0, 0} + }; + +-static int +-grub_getkeystatus (void) +-{ +- int status = 0; +- grub_term_input_t term; +- +- if (grub_term_poll_usb) +- grub_term_poll_usb (0); +- +- FOR_ACTIVE_TERM_INPUTS(term) +- { +- if (term->getkeystatus) +- status |= term->getkeystatus (term); +- } +- +- return status; +-} +- + static grub_err_t + grub_cmd_keystatus (grub_extcmd_context_t ctxt, + int argc __attribute__ ((unused)), +diff --git a/grub-core/kern/term.c b/grub-core/kern/term.c +index 07720ee6746..93bd3378d18 100644 +--- a/grub-core/kern/term.c ++++ b/grub-core/kern/term.c +@@ -120,6 +120,24 @@ grub_getkey (void) + } + } + ++int ++grub_getkeystatus (void) ++{ ++ int status = 0; ++ grub_term_input_t term; ++ ++ if (grub_term_poll_usb) ++ grub_term_poll_usb (0); ++ ++ FOR_ACTIVE_TERM_INPUTS(term) ++ { ++ if (term->getkeystatus) ++ status |= term->getkeystatus (term); ++ } ++ ++ return status; ++} ++ + void + grub_refresh (void) + { +diff --git a/include/grub/term.h b/include/grub/term.h +index 8117e2a24da..c215133383f 100644 +--- a/include/grub/term.h ++++ b/include/grub/term.h +@@ -327,6 +327,7 @@ grub_term_unregister_output (grub_term_output_t term) + void grub_putcode (grub_uint32_t code, struct grub_term_output *term); + int EXPORT_FUNC(grub_getkey) (void); + int EXPORT_FUNC(grub_getkey_noblock) (void); ++int EXPORT_FUNC(grub_getkeystatus) (void); + void grub_cls (void); + void EXPORT_FUNC(grub_refresh) (void); + void grub_puts_terminal (const char *str, struct grub_term_output *term); diff --git a/0362-Accept-ESC-F8-and-holding-SHIFT-as-user-interrupt-ke.patch b/0362-Accept-ESC-F8-and-holding-SHIFT-as-user-interrupt-ke.patch new file mode 100644 index 00000000..2603bcd4 --- /dev/null +++ b/0362-Accept-ESC-F8-and-holding-SHIFT-as-user-interrupt-ke.patch @@ -0,0 +1,94 @@ +From f4fe7a729b2426d4d29a728b44b2570d93345975 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 26 Mar 2018 16:15:53 +0200 +Subject: [PATCH] Accept ESC, F8 and holding SHIFT as user interrupt keys + +On some devices the ESC key is the hotkey to enter the BIOS/EFI setup +screen, making it really hard to time pressing it right. Besides that +ESC is also pretty hard to discover for a user who does not know it +will unhide the menu. + +This commit makes F8, which used to be the hotkey to show the Windows +boot menu during boot for a long long time, also interrupt sleeps / +stop the menu countdown. + +This solves the ESC gets into the BIOS setup and also somewhat solves +the discoverability issue, but leaves the timing issue unresolved. + +This commit fixes the timing issue by also adding support for keeping +SHIFT pressed during boot to stop the menu countdown. This matches +what Ubuntu is doing, which should also help with discoverability. + +Signed-off-by: Hans de Goede +--- + grub-core/commands/sleep.c | 2 +- + grub-core/kern/term.c | 16 ++++++++++++++++ + grub-core/normal/menu.c | 2 +- + include/grub/term.h | 1 + + 4 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/sleep.c b/grub-core/commands/sleep.c +index e77e7900fac..a1370b710c9 100644 +--- a/grub-core/commands/sleep.c ++++ b/grub-core/commands/sleep.c +@@ -55,7 +55,7 @@ grub_interruptible_millisleep (grub_uint32_t ms) + start = grub_get_time_ms (); + + while (grub_get_time_ms () - start < ms) +- if (grub_getkey_noblock () == GRUB_TERM_ESC) ++ if (grub_key_is_interrupt (grub_getkey_noblock ())) + return 1; + + return 0; +diff --git a/grub-core/kern/term.c b/grub-core/kern/term.c +index 93bd3378d18..6cae4c23e7a 100644 +--- a/grub-core/kern/term.c ++++ b/grub-core/kern/term.c +@@ -138,6 +138,22 @@ grub_getkeystatus (void) + return status; + } + ++int ++grub_key_is_interrupt (int key) ++{ ++ /* ESC sometimes is the BIOS setup hotkey and may be hard to discover, also ++ check F8, which was the key to get the Windows bootmenu for a long time. */ ++ if (key == GRUB_TERM_ESC || key == GRUB_TERM_KEY_F8) ++ return 1; ++ ++ /* Pressing keys at the right time during boot is hard to time, also allow ++ interrupting sleeps / the menu countdown by keeping shift pressed. */ ++ if (grub_getkeystatus() & (GRUB_TERM_STATUS_LSHIFT|GRUB_TERM_STATUS_RSHIFT)) ++ return 1; ++ ++ return 0; ++} ++ + void + grub_refresh (void) + { +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index 5e2f5283d3d..6cb2a071490 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -655,7 +655,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + if (entry >= 0) + break; + } +- if (key == GRUB_TERM_ESC) ++ if (grub_key_is_interrupt (key)) + { + timeout = -1; + break; +diff --git a/include/grub/term.h b/include/grub/term.h +index c215133383f..2b079c29b80 100644 +--- a/include/grub/term.h ++++ b/include/grub/term.h +@@ -328,6 +328,7 @@ void grub_putcode (grub_uint32_t code, struct grub_term_output *term); + int EXPORT_FUNC(grub_getkey) (void); + int EXPORT_FUNC(grub_getkey_noblock) (void); + int EXPORT_FUNC(grub_getkeystatus) (void); ++int EXPORT_FUNC(grub_key_is_interrupt) (int key); + void grub_cls (void); + void EXPORT_FUNC(grub_refresh) (void); + void grub_puts_terminal (const char *str, struct grub_term_output *term); diff --git a/0363-grub-editenv-Add-incr-command-to-increment-integer-v.patch b/0363-grub-editenv-Add-incr-command-to-increment-integer-v.patch new file mode 100644 index 00000000..a4741e0c --- /dev/null +++ b/0363-grub-editenv-Add-incr-command-to-increment-integer-v.patch @@ -0,0 +1,93 @@ +From 14b2ca58f7fc8bc3b1a6d9ada3e084a629daf189 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 4 Jun 2018 19:49:47 +0200 +Subject: [PATCH] grub-editenv: Add "incr" command to increment integer value + env. variables + +To be able to automatically detect if the last boot was successful, +We want to keep count of succesful / failed boots in some integer +environment variable. + +This commit adds a grub-editenvt "incr" command to increment such +integer value env. variables by 1 for use from various boot scripts. + +Signed-off-by: Hans de Goede +--- + util/grub-editenv.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +diff --git a/util/grub-editenv.c b/util/grub-editenv.c +index 118e89fe57f..2918bb71cfe 100644 +--- a/util/grub-editenv.c ++++ b/util/grub-editenv.c +@@ -53,6 +53,9 @@ static struct argp_option options[] = { + /* TRANSLATORS: "unset" is a keyword. It's a summary of "unset" subcommand. */ + {N_("unset [NAME ...]"), 0, 0, OPTION_DOC|OPTION_NO_USAGE, + N_("Delete variables."), 0}, ++ /* TRANSLATORS: "incr" is a keyword. It's a summary of "incr" subcommand. */ ++ {N_("incr [NAME ...]"), 0, 0, OPTION_DOC|OPTION_NO_USAGE, ++ N_("Increase value of integer variables."), 0}, + + {0, 0, 0, OPTION_DOC, N_("Options:"), -1}, + {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, +@@ -246,6 +249,51 @@ unset_variables (const char *name, int argc, char *argv[]) + grub_envblk_close (envblk); + } + ++struct get_int_value_params { ++ char *varname; ++ int value; ++}; ++ ++static int ++get_int_value (const char *varname, const char *value, void *hook_data) ++{ ++ struct get_int_value_params *params = hook_data; ++ ++ if (strcmp (varname, params->varname) == 0) { ++ params->value = strtol (value, NULL, 10); ++ return 1; ++ } ++ return 0; ++} ++ ++static void ++incr_variables (const char *name, int argc, char *argv[]) ++{ ++ grub_envblk_t envblk; ++ char buf[16]; ++ ++ envblk = open_envblk_file (name); ++ while (argc) ++ { ++ struct get_int_value_params params = { ++ .varname = argv[0], ++ .value = 0, /* Consider unset variables 0 */ ++ }; ++ ++ grub_envblk_iterate (envblk, ¶ms, get_int_value); ++ snprintf(buf, sizeof(buf), "%d", params.value + 1); ++ ++ if (! grub_envblk_set (envblk, argv[0], buf)) ++ grub_util_error ("%s", _("environment block too small")); ++ ++ argc--; ++ argv++; ++ } ++ ++ write_envblk (name, envblk); ++ grub_envblk_close (envblk); ++} ++ + int + main (int argc, char *argv[]) + { +@@ -285,6 +333,8 @@ main (int argc, char *argv[]) + set_variables (filename, argc - curindex, argv + curindex); + else if (strcmp (command, "unset") == 0) + unset_variables (filename, argc - curindex, argv + curindex); ++ else if (strcmp (command, "incr") == 0) ++ incr_variables (filename, argc - curindex, argv + curindex); + else + { + char *program = xstrdup(program_name); diff --git a/0364-Add-auto-hide-menu-support.patch b/0364-Add-auto-hide-menu-support.patch new file mode 100644 index 00000000..f0be202d --- /dev/null +++ b/0364-Add-auto-hide-menu-support.patch @@ -0,0 +1,191 @@ +From 1040fa6b94822cdf56ee0cf992fdbab7dedb53db Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 6 Jun 2018 08:44:11 +0200 +Subject: [PATCH] Add auto-hide menu support + +On single-os systems we do not want to show the menu, unless something +went wrong with the previous boot, in which case the user may need the +menu to debug/fix the problem. + +This commit adds a new grub.d/00_menu_auto_hide file which emits a +config snippet implementing this. I've chosen to do this in a separate +grub.d file because chances of this going upstream are small and this way +it will be easier to rebase. + +Since auto-hiding the menu requires detecting the previous boot was ok, +we get fastboot support (where we don't check for a key at all) for free +so this commit also adds support for this. + +The new config-file code uses the following variables: + +menu_auto_hide Set this to "1" to activate the new auto-hide feature + Set this to "2" to auto-hide the menu even when multiple + operating systems are installed. Note the menu will still + auto show after booting an other os as that won't set + boot_success. +menu_show_once Set this to "1" to force showing the menu once. +boot_success The OS sets this to "1" to indicate a successful boot. +boot_indeterminate The OS increments this integer when rebooting after e.g. + installing updates or a selinux relabel. +fastboot If set to "1" and the conditions for auto-hiding the menu + are met, the menu is not shown and all checks for keypresses + are skipped, booting the default immediately. + +30_os-prober.in changes somewhat inspired by: +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/00_menu_auto_hide.in | 50 ++++++++++++++++++++++++++++++++++++++++ + util/grub.d/30_os-prober.in | 18 +++++++++++++++ + 3 files changed, 74 insertions(+) + create mode 100644 util/grub.d/00_menu_auto_hide.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index f4fbd250630..4091d0a1078 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -442,6 +442,12 @@ script = { + installdir = grubconf; + }; + ++script = { ++ name = '00_menu_auto_hide'; ++ common = util/grub.d/00_menu_auto_hide.in; ++ installdir = grubconf; ++}; ++ + script = { + name = '01_users'; + common = util/grub.d/01_users.in; +diff --git a/util/grub.d/00_menu_auto_hide.in b/util/grub.d/00_menu_auto_hide.in +new file mode 100644 +index 00000000000..a10fe45bb2c +--- /dev/null ++++ b/util/grub.d/00_menu_auto_hide.in +@@ -0,0 +1,50 @@ ++#! /bin/sh ++ ++# Disable / skip generating menu-auto-hide config parts on serial terminals ++for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do ++ case "$x" in ++ serial*) ++ exit 0 ++ ;; ++ esac ++done ++ ++cat << EOF ++if [ "\${boot_success}" = "1" -o "\${boot_indeterminate}" = "1" ]; then ++ set last_boot_ok=1 ++else ++ set last_boot_ok=0 ++fi ++ ++# Reset boot_indeterminate after a successful boot ++if [ "\${boot_success}" = "1" ] ; then ++ set boot_indeterminate=0 ++ save_env boot_indeterminate ++# Avoid boot_indeterminate causing the menu to be hidden more then once ++elif [ "\${boot_indeterminate}" = "1" ]; then ++ set boot_indeterminate=2 ++ save_env boot_indeterminate ++fi ++set boot_success=0 ++save_env boot_success ++ ++if [ x\$feature_timeout_style = xy ] ; then ++ if [ "\${menu_show_once}" ]; then ++ unset menu_show_once ++ save_env menu_show_once ++ set timeout_style=menu ++ unset timeout ++ elif [ "\${menu_auto_hide}" -a "\${last_boot_ok}" = "1" ]; then ++ set orig_timeout_style=\${timeout_style} ++ set orig_timeout=\${timeout} ++ if [ "\${fastboot}" = "1" ]; then ++ # timeout_style=menu + timeout=0 avoids the countdown code keypress check ++ set timeout_style=menu ++ set timeout=0 ++ else ++ set timeout_style=hidden ++ set timeout=1 ++ fi ++ fi ++fi ++EOF +diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in +index d979de1982a..4aeca88f5b7 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 + fi + + osx_entry() { ++ found_other_os=1 + # TRANSLATORS: it refers on the OS residing on device %s + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" + hints="" +@@ -125,6 +126,7 @@ for OS in ${OSPROBED} ; do + + case ${BOOT} in + chain) ++ found_other_os=1 + + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" + cat << EOF +@@ -155,6 +157,7 @@ EOF + EOF + ;; + efi) ++ found_other_os=1 + + EFIPATH=${DEVICE#*@} + DEVICE=${DEVICE%@*} +@@ -199,6 +202,7 @@ EOF + LINITRD="${LINITRD#/boot}" + fi + ++ found_other_os=1 + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" + recovery_params="$(echo "${LPARAMS}" | grep single)" || true + counter=1 +@@ -272,6 +276,7 @@ EOF + done + ;; + hurd) ++ found_other_os=1 + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" + cat << EOF + menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' { +@@ -298,6 +303,7 @@ EOF + EOF + ;; + minix) ++ found_other_os=1 + cat << EOF + menuentry "${LONGNAME} (on ${DEVICE}, Multiboot)" { + EOF +@@ -329,3 +335,15 @@ EOF + esac + esac + done ++ ++# We override the results of the menu_auto_hide code here, this is a bit ugly, ++# but grub-mkconfig writes out the file linearly, so this is the only way ++if [ "${found_other_os}" = "1" ]; then ++ cat << EOF ++# Other OS found, undo autohiding of menu unless menu_auto_hide=2 ++if [ "\${orig_timeout_style}" -a "\${menu_auto_hide}" != "2" ]; then ++ set timeout_style=\${orig_timeout_style} ++ set timeout=\${orig_timeout} ++fi ++EOF ++fi diff --git a/0365-Output-a-menu-entry-for-firmware-setup-on-UEFI-FastB.patch b/0365-Output-a-menu-entry-for-firmware-setup-on-UEFI-FastB.patch new file mode 100644 index 00000000..ffe05bc9 --- /dev/null +++ b/0365-Output-a-menu-entry-for-firmware-setup-on-UEFI-FastB.patch @@ -0,0 +1,93 @@ +From 0db5529fe1aae29971a51e48013f6b15f179c900 Mon Sep 17 00:00:00 2001 +From: Steve Langasek +Date: Mon, 13 Jan 2014 12:13:12 +0000 +Subject: [PATCH] Output a menu entry for firmware setup on UEFI FastBoot + systems + +If fastboot is enabled in the BIOS then often it is not possible to +enter the firmware setup menu, add a menu entry for this. + +hdegoede: Cherry picked the Ubuntu patch from: +https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/uefi_firmware_setup.patch +Into the Fedora / RH grub version + +According to: +https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/copyright +The patch is licensed under GPL-3+ + +Signed-off-by: Hans de Goede +--- + Makefile.util.def | 6 ++++++ + util/grub.d/30_uefi-firmware.in | 46 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 52 insertions(+) + create mode 100644 util/grub.d/30_uefi-firmware.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index 4091d0a1078..57c51a27bc4 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -523,6 +523,12 @@ script = { + installdir = grubconf; + }; + ++script = { ++ name = '30_uefi-firmware'; ++ common = util/grub.d/30_uefi-firmware.in; ++ installdir = grubconf; ++}; ++ + script = { + name = '40_custom'; + common = util/grub.d/40_custom.in; +diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in +new file mode 100644 +index 00000000000..3c9f533d8c6 +--- /dev/null ++++ b/util/grub.d/30_uefi-firmware.in +@@ -0,0 +1,46 @@ ++#! /bin/sh ++set -e ++ ++# grub-mkconfig helper script. ++# Copyright (C) 2012 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 . ++ ++prefix="@prefix@" ++exec_prefix="@exec_prefix@" ++datarootdir="@datarootdir@" ++ ++export TEXTDOMAIN=@PACKAGE@ ++export TEXTDOMAINDIR="@localedir@" ++ ++. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++ ++efi_vars_dir=/sys/firmware/efi/vars ++EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c ++OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data" ++ ++if [ -e "$OsIndications" ] && \ ++ [ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then ++ LABEL="System setup" ++ ++ gettext_printf "Adding boot menu entry for EFI firmware configuration\n" >&2 ++ ++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")" ++ ++ cat << EOF ++menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { ++ fwsetup ++} ++EOF ++fi diff --git a/0366-Add-grub-set-bootflag-utility.patch b/0366-Add-grub-set-bootflag-utility.patch new file mode 100644 index 00000000..66b8d265 --- /dev/null +++ b/0366-Add-grub-set-bootflag-utility.patch @@ -0,0 +1,316 @@ +From e5fd6fcb30e673e29576be205e80e7bf8cbb135c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 12 Jun 2018 13:25:16 +0200 +Subject: [PATCH] Add grub-set-bootflag utility + +This commit adds a new grub-set-bootflag utility, which can be used +to set known bootflags in the grubenv: boot_success or menu_show_once. + +grub-set-bootflag is different from grub-editenv in 2 ways: + +1) It is intended to be executed by regular users through pkexec, so +running as root if the polkit policy allows this. As such it is written +to not use any existing grubenv related code for easy auditing. + +2) Since it can be executed by regular users it only allows setting +(assigning a value of 1 to) bootflags which it knows about. Currently +those are just boot_success and menu_show_once. + +This commit also adds a couple of example systemd and polkit files which +show how this can be used to set boot_success from a user-session: + +docs/grub-boot-success.service +docs/grub-boot-success.timer +docs/org.gnu.grub.policy + +The 2 grub-boot-success.systemd files should be placed in /lib/systemd/user +and a symlink to grub-boot-success.timer should be added to +/lib/systemd/user/timers.target.wants. + +The org.gnu.grub.policy polkit file should be placed in +/usr/share/polkit-1/actions. + +Signed-off-by: Hans de Goede +--- + Makefile.util.def | 7 ++ + util/grub-set-bootflag.c | 158 +++++++++++++++++++++++++++++++++++++++++ + conf/Makefile.extra-dist | 3 + + docs/grub-boot-success.service | 6 ++ + docs/grub-boot-success.timer | 5 ++ + docs/org.gnu.grub.policy | 20 ++++++ + util/grub-set-bootflag.1 | 20 ++++++ + 7 files changed, 219 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 docs/org.gnu.grub.policy + create mode 100644 util/grub-set-bootflag.1 + +diff --git a/Makefile.util.def b/Makefile.util.def +index 57c51a27bc4..72be14449c5 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -1429,3 +1429,10 @@ program = { + ldadd = grub-core/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; ++ ++program = { ++ name = grub-set-bootflag; ++ installdir = sbin; ++ mansection = 1; ++ common = util/grub-set-bootflag.c; ++}; +diff --git a/util/grub-set-bootflag.c b/util/grub-set-bootflag.c +new file mode 100644 +index 00000000000..f8dc310909a +--- /dev/null ++++ b/util/grub-set-bootflag.c +@@ -0,0 +1,158 @@ ++/* grub-set-bootflag.c - tool to set boot-flags in the grubenv. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2018 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 . ++ */ ++ ++/* ++ * NOTE this gets run by users as root (through pkexec), so this does not ++ * use any grub library / util functions to allow for easy auditing. ++ * The grub headers are only included to get certain defines. ++ */ ++ ++#include /* For *_DIR_NAME defines */ ++#include ++#include /* For GRUB_ENVBLK_DEFCFG define */ ++#include ++#include ++#include ++ ++#define GRUBENV "/" GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME "/" GRUB_ENVBLK_DEFCFG ++#define GRUBENV_SIZE 1024 ++ ++const char *bootflags[] = { ++ "boot_success", ++ "menu_show_once", ++ NULL ++}; ++ ++static void usage(void) ++{ ++ int i; ++ ++ fprintf (stderr, "Usage: 'grub-set-bootflag ', where is one of:\n"); ++ for (i = 0; bootflags[i]; i++) ++ fprintf (stderr, " %s\n", bootflags[i]); ++} ++ ++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; ++ const char *bootflag; ++ int i, len, ret; ++ FILE *f; ++ ++ if (argc != 2) ++ { ++ usage(); ++ return 1; ++ } ++ ++ for (i = 0; bootflags[i]; i++) ++ if (!strcmp (argv[1], bootflags[i])) ++ break; ++ if (!bootflags[i]) ++ { ++ fprintf (stderr, "Invalid bootflag: '%s'\n", argv[1]); ++ usage(); ++ return 1; ++ } ++ ++ bootflag = bootflags[i]; ++ len = strlen (bootflag); ++ ++ f = fopen (GRUBENV, "r"); ++ if (!f) ++ { ++ perror ("Error opening " GRUBENV " for reading"); ++ return 1; ++ } ++ ++ ret = fread (env, 1, GRUBENV_SIZE, f); ++ fclose (f); ++ if (ret != GRUBENV_SIZE) ++ { ++ perror ("Error reading from " GRUBENV); ++ return 1; ++ } ++ ++ /* 0 terminate env */ ++ env[GRUBENV_SIZE] = 0; ++ ++ if (strncmp (env, GRUB_ENVBLK_SIGNATURE, strlen (GRUB_ENVBLK_SIGNATURE))) ++ { ++ fprintf (stderr, "Error invalid environment block\n"); ++ return 1; ++ } ++ ++ /* Find a pre-existing definition of the bootflag */ ++ s = strstr (env, bootflag); ++ while (s && s[len] != '=') ++ s = strstr (s + len, bootflag); ++ ++ if (s && ((s[len + 1] != '0' && s[len + 1] != '1') || s[len + 2] != '\n')) ++ { ++ fprintf (stderr, "Pre-existing bootflag '%s' has unexpected value\n", bootflag); ++ return 1; ++ } ++ ++ /* No pre-existing bootflag? -> find free space */ ++ if (!s) ++ { ++ for (i = 0; i < (len + 3); i++) ++ buf[i] = '#'; ++ buf[i] = 0; ++ s = strstr (env, buf); ++ } ++ ++ if (!s) ++ { ++ fprintf (stderr, "No space in grubenv to store bootflag '%s'\n", bootflag); ++ return 1; ++ } ++ ++ /* The grubenv is not 0 terminated, so memcpy the name + '=' , '1', '\n' */ ++ snprintf(buf, sizeof(buf), "%s=1\n", bootflag); ++ memcpy(s, buf, len + 3); ++ ++ /* "r+", don't truncate so that the diskspace stays reserved */ ++ f = fopen (GRUBENV, "r+"); ++ if (!f) ++ { ++ perror ("Error opening " GRUBENV " for writing"); ++ return 1; ++ } ++ ++ ret = fwrite (env, 1, GRUBENV_SIZE, f); ++ if (ret != GRUBENV_SIZE) ++ { ++ perror ("Error writing to " GRUBENV); ++ return 1; ++ } ++ ++ ret = fflush (f); ++ if (ret) ++ { ++ perror ("Error flushing " GRUBENV); ++ return 1; ++ } ++ ++ fsync (fileno (f)); ++ fclose (f); ++ ++ return 0; ++} +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 39eb94bded6..5946ec24a65 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -14,6 +14,9 @@ EXTRA_DIST += util/import_unicode.py + EXTRA_DIST += docs/autoiso.cfg + EXTRA_DIST += docs/grub.cfg + EXTRA_DIST += docs/osdetect.cfg ++EXTRA_DIST += docs/org.gnu.grub.policy ++EXTRA_DIST += docs/grub-boot-success.service ++EXTRA_DIST += docs/grub-boot-success.timer + + EXTRA_DIST += conf/i386-cygwin-img-ld.sc + +diff --git a/docs/grub-boot-success.service b/docs/grub-boot-success.service +new file mode 100644 +index 00000000000..c8c91c34d49 +--- /dev/null ++++ b/docs/grub-boot-success.service +@@ -0,0 +1,6 @@ ++[Unit] ++Description=Mark boot as successful ++ ++[Service] ++Type=oneshot ++ExecStart=/usr/bin/pkexec /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..221b532781b +--- /dev/null ++++ b/docs/grub-boot-success.timer +@@ -0,0 +1,5 @@ ++[Unit] ++Description=Mark boot as successful after the user session has run 2 minutes ++ ++[Timer] ++OnActiveSec=2min +diff --git a/docs/org.gnu.grub.policy b/docs/org.gnu.grub.policy +new file mode 100644 +index 00000000000..18391efc8e7 +--- /dev/null ++++ b/docs/org.gnu.grub.policy +@@ -0,0 +1,20 @@ ++ ++ ++ ++ GNU GRUB ++ https://www.gnu.org/software/grub/ ++ ++ ++ Set GRUB bootflags ++ Authentication is required to modify the bootloaders bootflags ++ ++ no ++ no ++ yes ++ ++ /usr/sbin/grub2-set-bootflag ++ ++ +diff --git a/util/grub-set-bootflag.1 b/util/grub-set-bootflag.1 +new file mode 100644 +index 00000000000..57801da22a0 +--- /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" diff --git a/0367-Fix-grub-setpassword-o-s-output-path.patch b/0367-Fix-grub-setpassword-o-s-output-path.patch new file mode 100644 index 00000000..2aff63ed --- /dev/null +++ b/0367-Fix-grub-setpassword-o-s-output-path.patch @@ -0,0 +1,33 @@ +From d9b7a40d460a520c369e98dfdcd57ce1eadb0ba3 Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Sun, 11 Jun 2017 19:17:40 -0400 +Subject: [PATCH] Fix grub-setpassword -o's output path + +The output path is set up in the command line parsing, but completely ignored +in the code that actually writes the files. This patch fixes that. + +Signed-off-by: Peter Jones +--- + util/grub-setpassword.in | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in +index cf70257eed6..5ebf50576d6 100644 +--- a/util/grub-setpassword.in ++++ b/util/grub-setpassword.in +@@ -118,11 +118,11 @@ fi + + # on the ESP, these will fail to set the permissions, but it's okay because + # the directory is protected. +-install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || : +-chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || : +-echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg" ++install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : ++chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : ++echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg" + +-if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then ++if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${OUTPUT_PATH}/grub.cfg"; then + echo "WARNING: The current configuration lacks password support!" + echo "Update your configuration with @grub_mkconfig@ to support this feature." + fi diff --git a/0368-Make-grub-set-password-be-named-like-all-the-other-g.patch b/0368-Make-grub-set-password-be-named-like-all-the-other-g.patch new file mode 100644 index 00000000..58c14e7b --- /dev/null +++ b/0368-Make-grub-set-password-be-named-like-all-the-other-g.patch @@ -0,0 +1,88 @@ +From 89e886b7fe0dd22d1fb7f54963b0a74e6e0784a2 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Sat, 23 Jun 2018 13:19:15 -0400 +Subject: [PATCH] Make grub-set-password be named like all the other grub + utilities + +Signed-off-by: Peter Jones +--- + configure.ac | 2 +- + Makefile.util.def | 4 ++-- + .gitignore | 4 ++-- + util/{grub-setpassword.8 => grub-set-password.8} | 8 ++++---- + util/{grub-setpassword.in => grub-set-password.in} | 0 + 5 files changed, 9 insertions(+), 9 deletions(-) + rename util/{grub-setpassword.8 => grub-set-password.8} (50%) + rename util/{grub-setpassword.in => grub-set-password.in} (100%) + +diff --git a/configure.ac b/configure.ac +index aef90611168..aa7632b56c3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -66,7 +66,7 @@ grub_TRANSFORM([grub-mkrelpath]) + grub_TRANSFORM([grub-mkrescue]) + grub_TRANSFORM([grub-probe]) + grub_TRANSFORM([grub-reboot]) +-grub_TRANSFORM([grub-setpassword]) ++grub_TRANSFORM([grub-set-password]) + grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) +diff --git a/Makefile.util.def b/Makefile.util.def +index 72be14449c5..c81801cdacf 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -750,8 +750,8 @@ script = { + }; + + script = { +- name = grub-setpassword; +- common = util/grub-setpassword.in; ++ name = grub-set-password; ++ common = util/grub-set-password.in; + mansection = 8; + installdir = sbin; + }; +diff --git a/.gitignore b/.gitignore +index 4a945596fea..5c09a474ba9 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -109,8 +109,8 @@ grub-*.tar.* + /grub*-script-check.1 + /grub*-set-default + /grub*-set-default.8 +-/grub*-setsetpassword +-/grub*-setsetpassword.8 ++/grub*-set-password ++/grub*-set-password.8 + /grub*-shell + /grub*-shell-tester + /grub*-sparc64-setup +diff --git a/util/grub-setpassword.8 b/util/grub-set-password.8 +similarity index 50% +rename from util/grub-setpassword.8 +rename to util/grub-set-password.8 +index dc91dd6697b..9646546e43d 100644 +--- a/util/grub-setpassword.8 ++++ b/util/grub-set-password.8 +@@ -1,12 +1,12 @@ +-.TH GRUB-SETPASSWORD 3 "Thu Jun 25 2015" ++.TH GRUB-SET-PASSWORD 3 "Thu Jun 25 2015" + .SH NAME +-\fBgrub-setpassword\fR \(em Generate the user.cfg file containing the hashed grub bootloader password. ++\fBgrub-set-password\fR \(em Generate the user.cfg file containing the hashed grub bootloader password. + + .SH SYNOPSIS +-\fBgrub-setpassword\fR [OPTION] ++\fBgrub-set-password\fR [OPTION] + + .SH DESCRIPTION +-\fBgrub-setpassword\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. ++\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>. +diff --git a/util/grub-setpassword.in b/util/grub-set-password.in +similarity index 100% +rename from util/grub-setpassword.in +rename to util/grub-set-password.in diff --git a/0369-docs-Add-grub-boot-indeterminate.service-example.patch b/0369-docs-Add-grub-boot-indeterminate.service-example.patch new file mode 100644 index 00000000..beb220e2 --- /dev/null +++ b/0369-docs-Add-grub-boot-indeterminate.service-example.patch @@ -0,0 +1,33 @@ +From acf0963284d23476b94306bfe8d16d0934a59653 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 19 Jun 2018 15:20:54 +0200 +Subject: [PATCH] docs: Add grub-boot-indeterminate.service example + +This is an example service file, for use from +/lib/systemd/system/system-update.target.wants +to increment the boot_indeterminate variable when +doing offline updates. + +Signed-off-by: Hans de Goede +--- + docs/grub-boot-indeterminate.service | 11 +++++++++++ + 1 file changed, 11 insertions(+) + create mode 100644 docs/grub-boot-indeterminate.service + +diff --git a/docs/grub-boot-indeterminate.service b/docs/grub-boot-indeterminate.service +new file mode 100644 +index 00000000000..6c8dcb186b6 +--- /dev/null ++++ b/docs/grub-boot-indeterminate.service +@@ -0,0 +1,11 @@ ++[Unit] ++Description=Mark boot as indeterminate ++DefaultDependencies=false ++Requires=sysinit.target ++After=sysinit.target ++Wants=system-update-pre.target ++Before=system-update-pre.target ++ ++[Service] ++Type=oneshot ++ExecStart=/usr/bin/grub2-editenv - incr boot_indeterminate diff --git a/0370-EFI-console-Fix-the-enter-key-not-working-on-X86-tab.patch b/0370-EFI-console-Fix-the-enter-key-not-working-on-X86-tab.patch new file mode 100644 index 00000000..e412b50a --- /dev/null +++ b/0370-EFI-console-Fix-the-enter-key-not-working-on-X86-tab.patch @@ -0,0 +1,42 @@ +From 48565c3ac763f71918f75c1f22c10a119a05f1a8 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 26 Jun 2018 20:05:32 +0200 +Subject: [PATCH] EFI: console: Fix the "enter" key not working on X86 tablets + +Most 8" or 7" x86 Windows 10 tablets come with volume up/down buttons and +a power-button. In their UEFI these are almost always mapped to arrow +up/down and enter. + +Pressing the volume buttons (sometimes by accident) will stop the +menu countdown, but the power-button / "enter" key was not being recognized +as enter, so the user would be stuck at the grub menu. + +The problem is that these tablets send scan_code 13 or 0x0d for the +power-button, which officialy maps to the F3 key. They also set +unicode_char to 0x0d. + +This commit recognizes the special case of both scan_code and unicode_char +being set to 0x0d and treats this as an enter key press. + +This fixes things getting stuck at the grub-menu and allows the user +to choice a grub-menu entry using the buttons on the tablet. + +Signed-off-by: Hans de Goede +--- + grub-core/term/efi/console.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index a5abaf8e722..59786e30d66 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -127,6 +127,9 @@ grub_efi_translate_key (grub_efi_input_key_t key) + else + return key.unicode_char; + } ++ /* Some devices send enter with scan_code 0x0d (F3) and unicode_char 0x0d */ ++ else if (key.scan_code == '\r' && key.unicode_char == '\r') ++ return key.unicode_char; + else if (key.scan_code < ARRAY_SIZE (efi_codes)) + return efi_codes[key.scan_code]; + diff --git a/0371-00_menu_auto_hide-Use-a-timeout-of-60s-for-menu_show.patch b/0371-00_menu_auto_hide-Use-a-timeout-of-60s-for-menu_show.patch new file mode 100644 index 00000000..1dded25e --- /dev/null +++ b/0371-00_menu_auto_hide-Use-a-timeout-of-60s-for-menu_show.patch @@ -0,0 +1,31 @@ +From f92d2a62582a8f5982044a556366ebcd7f7c961d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 26 Jun 2018 12:44:29 +0200 +Subject: [PATCH] 00_menu_auto_hide: Use a timeout of 60s for menu_show_once, + rather then no timeout + +On some UEFI systems with fastboot enabled (USB) keyboards don't work at +all, not even when explictly asking for keyboard input. + +So lets change the timeout from not set (no timeout) to 60 seconds, so +that on such systems if the menu was requested we continue with the +default choice after 60 seconds. + +Signed-off-by: Hans de Goede +--- + util/grub.d/00_menu_auto_hide.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub.d/00_menu_auto_hide.in b/util/grub.d/00_menu_auto_hide.in +index a10fe45bb2c..ca95c0d1c9f 100644 +--- a/util/grub.d/00_menu_auto_hide.in ++++ b/util/grub.d/00_menu_auto_hide.in +@@ -33,7 +33,7 @@ if [ x\$feature_timeout_style = xy ] ; then + unset menu_show_once + save_env menu_show_once + set timeout_style=menu +- unset timeout ++ set timeout=60 + elif [ "\${menu_auto_hide}" -a "\${last_boot_ok}" = "1" ]; then + set orig_timeout_style=\${timeout_style} + set orig_timeout=\${timeout} diff --git a/0372-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch b/0372-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch new file mode 100644 index 00000000..9a307a1a --- /dev/null +++ b/0372-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch @@ -0,0 +1,41 @@ +From 2797a740bf1e241d2df9869f311b3bf460e3aef9 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 27 Jun 2018 13:33:43 +0200 +Subject: [PATCH] 00_menu_auto_hide: Reduce number of save_env calls + +Normally boot_success will be 1 on every boot (as normally the +previous boot will have been successful). This means that we end +up in the code-path to set boot_indeterminate to 0 every boot. + +So we do 2 separate save_env calls each boot, one for boot_indeterminate +and one for boot_success. This results in 2 writes to the disk. + +This commit makes us save both boot_success and boot_indeterminate +in a single call, reducing the number of writes, this reducing wear +and tear on the underlying storage. + +Signed-off-by: Hans de Goede +--- + util/grub.d/00_menu_auto_hide.in | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/util/grub.d/00_menu_auto_hide.in b/util/grub.d/00_menu_auto_hide.in +index ca95c0d1c9f..ad175870a54 100644 +--- a/util/grub.d/00_menu_auto_hide.in ++++ b/util/grub.d/00_menu_auto_hide.in +@@ -19,14 +19,12 @@ fi + # Reset boot_indeterminate after a successful boot + if [ "\${boot_success}" = "1" ] ; then + set boot_indeterminate=0 +- save_env boot_indeterminate + # Avoid boot_indeterminate causing the menu to be hidden more then once + elif [ "\${boot_indeterminate}" = "1" ]; then + set boot_indeterminate=2 +- save_env boot_indeterminate + fi + set boot_success=0 +-save_env boot_success ++save_env boot_success boot_indeterminate + + if [ x\$feature_timeout_style = xy ] ; then + if [ "\${menu_show_once}" ]; then diff --git a/0373-Minor-fixes-to-make-armv7hl-build-as-arm-efi.patch b/0373-Minor-fixes-to-make-armv7hl-build-as-arm-efi.patch new file mode 100644 index 00000000..0eba5348 --- /dev/null +++ b/0373-Minor-fixes-to-make-armv7hl-build-as-arm-efi.patch @@ -0,0 +1,55 @@ +From 2cdd22ab9b7d938249ff6e84ac3b4657b2f43b99 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 26 Jun 2018 17:16:06 -0400 +Subject: [PATCH] Minor fixes to make armv7hl build as arm-efi + +- /remove/ the code to use use softfloat unconditionally on arm + (I can't get our arm bins to build with it for whatever reason...) +- Fix one type error +- build the secure boot loader code on arm + +Signed-off-by: Peter Jones +--- + configure.ac | 2 +- + grub-core/Makefile.core.def | 1 + + grub-core/loader/efi/linux.c | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index aa7632b56c3..997ac051449 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -863,7 +863,7 @@ fi + # that floats are a good fit to run instead of what's written in the code. + # Given that floating point unit is disabled (if present to begin with) + # when GRUB is running which may result in various hard crashes. +-if test x"$platform" != xemu ; then ++if test x"$platform" != xemu -a "x$target_cpu" != xarm ; then + 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 +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index cdafd91c677..a656930800e 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1714,6 +1714,7 @@ module = { + sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c; + ia64_efi = loader/ia64/efi/linux.c; + arm = loader/arm/linux.c; ++ arm = loader/efi/linux.c; + arm64 = loader/arm64/linux.c; + arm64 = loader/efi/linux.c; + emu = loader/emu/linux.c; +diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c +index 7fe7201a388..8453b5c8017 100644 +--- a/grub-core/loader/efi/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -50,7 +50,7 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) + + grub_dprintf ("secureboot", "Asking shim to verify kernel signature\n"); + status = shim_lock->verify (data, size); +- grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", status); ++ grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", (long int)status); + if (status == GRUB_EFI_SUCCESS) + { + grub_dprintf ("secureboot", "Kernel signature verification passed\n"); diff --git a/0374-30_uefi-firmware-fix-use-with-sys-firmware-efi-efiva.patch b/0374-30_uefi-firmware-fix-use-with-sys-firmware-efi-efiva.patch new file mode 100644 index 00000000..587a91d1 --- /dev/null +++ b/0374-30_uefi-firmware-fix-use-with-sys-firmware-efi-efiva.patch @@ -0,0 +1,36 @@ +From 9975710681e407c26e70510ea01b4652b6883f29 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 29 Jun 2018 10:08:22 +0200 +Subject: [PATCH] 30_uefi-firmware: fix use with /sys/firmware/efi/efivars + +Fix 30_uefi-firmware checking for the obsolete /sys/firmware/efi/vars +instead of for the new efivarfs mounted at /sys/firmware/efi/efivars. + +Which goes to show that I really should have tested this before blindly +importing it from Ubuntu. + +Signed-off-by: Hans de Goede +--- + util/grub.d/30_uefi-firmware.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in +index 3c9f533d8c6..93ececffea7 100644 +--- a/util/grub.d/30_uefi-firmware.in ++++ b/util/grub.d/30_uefi-firmware.in +@@ -26,12 +26,12 @@ export TEXTDOMAINDIR="@localedir@" + + . "@datadir@/@PACKAGE@/grub-mkconfig_lib" + +-efi_vars_dir=/sys/firmware/efi/vars ++efi_vars_dir=/sys/firmware/efi/efivars + EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c +-OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data" ++OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE" + + if [ -e "$OsIndications" ] && \ +- [ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then ++ [ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b5)") & 1 ))" = 1 ]; then + LABEL="System setup" + + gettext_printf "Adding boot menu entry for EFI firmware configuration\n" >&2 diff --git a/grub.patches b/grub.patches index 605f2c6b..0c8f7238 100644 --- a/grub.patches +++ b/grub.patches @@ -61,190 +61,314 @@ Patch0060: 0060-arm64-linux-loader-improve-type-portability.patch Patch0061: 0061-efi-change-heap-allocation-type-to-GRUB_EFI_LOADER_C.patch Patch0062: 0062-core-use-GRUB_TERM_-definitions-when-handling-term-c.patch Patch0063: 0063-io-add-a-GRUB_GZ-prefix-to-gzio-specific-defines.patch -Patch0064: 0064-re-write-.gitignore.patch -Patch0065: 0065-IBM-client-architecture-CAS-reboot-support.patch -Patch0066: 0066-for-ppc-reset-console-display-attr-when-clear-screen.patch -Patch0067: 0067-Disable-GRUB-video-support-for-IBM-power-machines.patch -Patch0068: 0068-Honor-a-symlink-when-generating-configuration-by-gru.patch -Patch0069: 0069-Move-bash-completion-script-922997.patch -Patch0070: 0070-Update-to-minilzo-2.08.patch -Patch0071: 0071-Allow-fallback-to-include-entries-by-title-not-just-.patch -Patch0072: 0072-Add-GRUB_DISABLE_UUID.patch -Patch0073: 0073-Make-exit-take-a-return-code.patch -Patch0074: 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch -Patch0075: 0075-Make-efi-machines-load-an-env-block-from-a-variable.patch -Patch0076: 0076-DHCP-client-ID-and-UUID-options-added.patch -Patch0077: 0077-trim-arp-packets-with-abnormal-size.patch -Patch0078: 0078-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch -Patch0079: 0079-Add-support-for-UEFI-operating-systems-returned-by-o.patch -Patch0080: 0080-Migrate-PPC-from-Yaboot-to-Grub2.patch -Patch0081: 0081-Add-fw_path-variable-revised.patch -Patch0082: 0082-Add-support-for-linuxefi.patch -Patch0083: 0083-Use-linuxefi-and-initrdefi-where-appropriate.patch -Patch0084: 0084-Don-t-allow-insmod-when-secure-boot-is-enabled.patch -Patch0085: 0085-Pass-x-hex-hex-straight-through-unmolested.patch -Patch0086: 0086-Add-X-option-to-printf-functions.patch -Patch0087: 0087-Search-for-specific-config-file-for-netboot.patch -Patch0088: 0088-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch -Patch0089: 0089-Don-t-write-messages-to-the-screen.patch -Patch0090: 0090-Don-t-print-GNU-GRUB-header.patch -Patch0091: 0091-Don-t-add-to-highlighted-row.patch -Patch0092: 0092-Message-string-cleanups.patch -Patch0093: 0093-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch -Patch0094: 0094-Use-the-correct-indentation-for-the-term-help-text.patch -Patch0095: 0095-Indent-menu-entries.patch -Patch0096: 0096-Fix-margins.patch -Patch0097: 0097-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch -Patch0098: 0098-Use-linux16-when-appropriate-880840.patch -Patch0099: 0099-Enable-pager-by-default.-985860.patch -Patch0100: 0100-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch -Patch0101: 0101-Don-t-say-GNU-Linux-in-generated-menus.patch -Patch0102: 0102-Don-t-draw-a-border-around-the-menu.patch -Patch0103: 0103-Use-the-standard-margin-for-the-timeout-string.patch -Patch0104: 0104-Add-.eh_frame-to-list-of-relocations-stripped.patch -Patch0105: 0105-Make-10_linux-work-with-our-changes-for-linux16-and-.patch -Patch0106: 0106-Don-t-print-during-fdt-loading-method.patch -Patch0107: 0107-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch -Patch0108: 0108-Don-t-require-a-password-to-boot-entries-generated-b.patch -Patch0109: 0109-Don-t-emit-Booting-.-message.patch -Patch0110: 0110-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch -Patch0111: 0111-use-fw_path-prefix-when-fallback-searching-for-grub-.patch -Patch0112: 0112-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch -Patch0113: 0113-Fix-convert-function-to-support-NVMe-devices.patch -Patch0114: 0114-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch -Patch0115: 0115-Use-the-default-device-tree-from-the-grub-default-fi.patch -Patch0116: 0116-reopen-SNP-protocol-for-exclusive-use-by-grub.patch -Patch0117: 0117-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch -Patch0118: 0118-Add-grub_util_readlink.patch -Patch0119: 0119-Make-editenv-chase-symlinks-including-those-across-d.patch -Patch0120: 0120-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch -Patch0121: 0121-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch -Patch0122: 0122-Load-arm-with-SB-enabled.patch -Patch0123: 0123-Try-prefix-if-fw_path-doesn-t-work.patch -Patch0124: 0124-Update-info-with-grub.cfg-netboot-selection-order-11.patch -Patch0125: 0125-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch -Patch0126: 0126-Handle-rssd-storage-devices.patch -Patch0127: 0127-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch -Patch0128: 0128-Make-grub2-mkconfig-construct-titles-that-look-like-.patch -Patch0129: 0129-Add-friendly-grub2-password-config-tool-985962.patch -Patch0130: 0130-Make-grub2-mkconfig-construct-titles-that-look-like-.patch -Patch0131: 0131-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch -Patch0132: 0132-tcp-add-window-scaling-support.patch -Patch0133: 0133-efinet-retransmit-if-our-device-is-busy.patch -Patch0134: 0134-Be-more-aggro-about-actually-using-the-configured-ne.patch -Patch0135: 0135-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch -Patch0136: 0136-Fix-security-issue-when-reading-username-and-passwor.patch -Patch0137: 0137-Warn-if-grub-password-will-not-be-read-1290803.patch -Patch0138: 0138-Clean-up-grub-setpassword-documentation-1290799.patch -Patch0139: 0139-Fix-locale-issue-in-grub-setpassword-1294243.patch -Patch0140: 0140-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch -Patch0141: 0141-efiemu-Fix-compilation-failure.patch -Patch0142: 0142-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch -Patch0143: 0143-Add-a-url-parser.patch -Patch0144: 0144-efinet-and-bootp-add-support-for-dhcpv6.patch -Patch0145: 0145-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch -Patch0146: 0146-Normalize-slashes-in-tftp-paths.patch -Patch0147: 0147-Fix-malformed-tftp-packets.patch -Patch0148: 0148-Fix-race-in-EFI-validation.patch -Patch0149: 0149-bz1374141-fix-incorrect-mask-for-ppc64.patch -Patch0150: 0150-Use-device-part-of-chainloader-target-if-present.patch -Patch0151: 0151-Add-secureboot-support-on-efi-chainloader.patch -Patch0152: 0152-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch -Patch0153: 0153-Make-grub_fatal-also-backtrace.patch -Patch0154: 0154-Rework-linux-command.patch -Patch0155: 0155-Rework-linux16-command.patch -Patch0156: 0156-Make-grub-editenv-build-again.patch -Patch0157: 0157-Fix-up-some-man-pages-rpmdiff-noticed.patch -Patch0158: 0158-Re-work-some-intricacies-of-PE-loading.patch -Patch0159: 0159-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch -Patch0160: 0160-linuxefi-fix-double-free-on-verification-failure.patch -Patch0161: 0161-fix-machine-type-test-in-30_os-prober.in.patch -Patch0162: 0162-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch -Patch0163: 0163-efi-chainloader-truncate-overlong-relocation-section.patch -Patch0164: 0164-linuxefi-minor-cleanups.patch -Patch0165: 0165-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch -Patch0166: 0166-Fix-up-linux-params-usage.patch -Patch0167: 0167-Make-exit-take-a-return-code.patch -Patch0168: 0168-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch -Patch0169: 0169-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch -Patch0170: 0170-Make-our-info-pages-say-grub2-where-appropriate.patch -Patch0171: 0171-print-more-debug-info-in-our-module-loader.patch -Patch0172: 0172-macos-just-build-chainloader-entries-don-t-try-any-x.patch -Patch0173: 0173-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch -Patch0174: 0174-export-btrfs_subvol-and-btrfs_subvolid.patch -Patch0175: 0175-grub2-btrfs-03-follow_default.patch -Patch0176: 0176-grub2-btrfs-04-grub2-install.patch -Patch0177: 0177-grub2-btrfs-05-grub2-mkconfig.patch -Patch0178: 0178-grub2-btrfs-06-subvol-mount.patch -Patch0179: 0179-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch -Patch0180: 0180-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch -Patch0181: 0181-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch -Patch0182: 0182-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch -Patch0183: 0183-Use-grub_efi_.-memory-helpers-where-reasonable.patch -Patch0184: 0184-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch -Patch0185: 0185-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch -Patch0186: 0186-don-t-ignore-const.patch -Patch0187: 0187-don-t-use-int-for-efi-status.patch -Patch0188: 0188-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch -Patch0189: 0189-Clean-up-some-errors-in-the-linuxefi-loader.patch -Patch0190: 0190-editenv-handle-relative-symlinks.patch -Patch0191: 0191-Make-libgrub.pp-depend-on-config-util.h.patch -Patch0192: 0192-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch -Patch0193: 0193-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch -Patch0194: 0194-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch -Patch0195: 0195-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch -Patch0196: 0196-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch -Patch0197: 0197-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch -Patch0198: 0198-align-struct-efi_variable-better.patch -Patch0199: 0199-Add-quicksort-implementation.patch -Patch0200: 0200-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch -Patch0201: 0201-Add-BLS-support-to-grub-mkconfig.patch -Patch0202: 0202-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch -Patch0203: 0203-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch -Patch0204: 0204-Enable-blscfg-command-for-the-emu-platform.patch -Patch0205: 0205-Add-linux-and-initrd-commands-for-grub-emu.patch -Patch0206: 0206-Fix-the-efidir-in-grub-setpassword.patch -Patch0207: 0207-Add-grub2-switch-to-blscfg.patch -Patch0208: 0208-Add-grub_debug_enabled.patch -Patch0209: 0209-make-better-backtraces.patch -Patch0210: 0210-normal-don-t-draw-our-startup-message-if-debug-is-se.patch -Patch0211: 0211-Work-around-some-minor-include-path-weirdnesses.patch -Patch0212: 0212-Make-it-possible-to-enabled-build-id-sha1.patch -Patch0213: 0213-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch -Patch0214: 0214-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch -Patch0215: 0215-Only-attempt-to-scan-different-BLS-directories-on-EF.patch -Patch0216: 0216-Core-TPM-support.patch -Patch0217: 0217-Measure-kernel-initrd.patch -Patch0218: 0218-Add-BIOS-boot-measurement.patch -Patch0219: 0219-Measure-kernel-and-initrd-on-BIOS-systems.patch -Patch0220: 0220-Measure-the-kernel-commandline.patch -Patch0221: 0221-Measure-commands.patch -Patch0222: 0222-Measure-multiboot-images-and-modules.patch -Patch0223: 0223-Fix-boot-when-there-s-no-TPM.patch -Patch0224: 0224-Rework-TPM-measurements.patch -Patch0225: 0225-Fix-event-log-prefix.patch -Patch0226: 0226-Set-the-first-boot-menu-entry-as-default-when-using-.patch -Patch0227: 0227-tpm-fix-warnings-when-compiling-for-platforms-other-.patch -Patch0228: 0228-Make-TPM-errors-less-fatal.patch -Patch0229: 0229-blscfg-handle-multiple-initramfs-images.patch -Patch0230: 0230-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch -Patch0231: 0231-BLS-Use-etcdefaultgrub-instead-of-etc.patch -Patch0232: 0232-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch -Patch0233: 0233-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch -Patch0234: 0234-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch -Patch0235: 0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch -Patch0236: 0236-Include-OSTree-path-when-searching-kernels-images-if.patch -Patch0237: 0237-Use-BLS-version-field-to-compare-entries-if-id-field.patch -Patch0238: 0238-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch -Patch0239: 0239-Fixup-for-newer-compiler.patch -Patch0240: 0240-net-read-bracketed-ipv6-addrs-and-port-numbers.patch -Patch0241: 0241-New-net_bootp6-command-and-UEFI-IPv6-PXE-support.patch -Patch0242: 0242-grub.texi-Add-net_bootp6-doument.patch -Patch0243: 0243-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch -Patch0244: 0244-efinet-Setting-network-from-UEFI-device-path.patch -Patch0245: 0245-efinet-Setting-DNS-server-from-UEFI-protocol.patch -Patch0246: 0246-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch -Patch0247: 0247-Support-UEFI-networking-protocols.patch -Patch0248: 0248-AUDIT-0-http-boot-tracker-bug.patch -Patch0249: 0249-linuxefi-honor-the-linux-and-initrd-names-of-command.patch -Patch0250: 0250-xfs-accept-filesystem-with-sparse-inodes.patch +Patch0064: 0064-grub.texi-Fix-typo.patch +Patch0065: 0065-hdparm-Depend-on-hexdump-rather-than-having-a-second.patch +Patch0066: 0066-multiboot-disentangle-multiboot-and-multiboot2.patch +Patch0067: 0067-Fix-symbols-appearing-in-several-modules-in-linux.patch +Patch0068: 0068-genmoddep-Check-that-no-modules-provide-the-same-sym.patch +Patch0069: 0069-yylex-Explicilty-cast-fprintf-to-void.patch +Patch0070: 0070-linux-fixup.patch +Patch0071: 0071-multiboot-fixup.patch +Patch0072: 0072-enforcing-fixup.patch +Patch0073: 0073-Set-have_exec-to-y-on-cygwin-so-we-have-grub_mkrescu.patch +Patch0074: 0074-arc-Do-not-create-spurious-variable-grub_arc_memory_.patch +Patch0075: 0075-unix-exec-avoid-atexit-handlers-when-child-exits.patch +Patch0076: 0076-xfs-Don-t-attempt-to-iterate-over-empty-directory.patch +Patch0077: 0077-Implement-checksum-verification-for-gunzip.patch +Patch0078: 0078-qemu-coreboot-multiboot-Change-linking-address-to-0x.patch +Patch0079: 0079-printf_unit_test-Disable-Wformat-truncation-on-GCC-7.patch +Patch0080: 0080-Regenerate-checksum.h-with-newer-unifont.patch +Patch0081: 0081-grub-fs-tester-Fix-bashism.patch +Patch0082: 0082-gzio-fix-unaligned-access.patch +Patch0083: 0083-Add-a-file-missing-in-multiboot2-commit.patch +Patch0084: 0084-Fix-compilation-for-x86_64-efi.patch +Patch0085: 0085-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch +Patch0086: 0086-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch +Patch0087: 0087-efi-Move-grub_reboot-into-kernel.patch +Patch0088: 0088-efi-Free-malloc-regions-on-exit.patch +Patch0089: 0089-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch +Patch0090: 0090-ls-prevent-double-open.patch +Patch0091: 0091-grub-install-Fix-memory-leak.patch +Patch0092: 0092-ieee1275-Fix-segfault-in-grub-ofpathname.patch +Patch0093: 0093-grub-mkconfig-Fix-detecting-.sig-files-as-system-ima.patch +Patch0094: 0094-arm64-xen-Add-missing-address-cells-and-size-cells-p.patch +Patch0095: 0095-Keep-the-native-terminal-active-when-enabling-gfxter.patch +Patch0096: 0096-ahci-Improve-error-handling.patch +Patch0097: 0097-sparc64-Add-blocklist-GPT-support-for-SPARC.patch +Patch0098: 0098-sparc64-fix-OF-path-names-for-sun4v-systems.patch +Patch0099: 0099-Make-grub-install-check-for-errors-from-efibootmgr.patch +Patch0100: 0100-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch +Patch0101: 0101-chainloader-Fix-wrong-break-condition-must-be-AND-no.patch +Patch0102: 0102-ieee1275-add-nvme-support-within-ofpath.patch +Patch0103: 0103-libgcrypt-Import-replacement-CRC-operations.patch +Patch0104: 0104-arm64-efi-move-EFI_PAGE-definitions-to-efi-memory.h.patch +Patch0105: 0105-Make-arch-specific-linux.h-include-guards-architectu.patch +Patch0106: 0106-make-GRUB_LINUX_MAGIC_SIGNATURE-architecture-specifi.patch +Patch0107: 0107-i386-make-struct-linux_kernel_header-architecture-sp.patch +Patch0108: 0108-arm64-align-linux-kernel-header-struct-naming-with-i.patch +Patch0109: 0109-arm64-align-linux-kernel-magic-macro-naming-with-i38.patch +Patch0110: 0110-arm-switch-linux-loader-to-linux_arm_kernel_header-s.patch +Patch0111: 0111-arm-make-linux.h-safe-to-include-for-non-native-buil.patch +Patch0112: 0112-ieee1275-fix-build-regression-in-of_path_of_nvme.patch +Patch0113: 0113-aout.h-Fix-missing-include.patch +Patch0114: 0114-mkimage-make-it-easier-to-run-syntax-checkers-on-gru.patch +Patch0115: 0115-mkimage-rename-a-couple-of-things-to-be-less-confusi.patch +Patch0116: 0116-mkimage-make-locate_sections-set-up-vaddresses-as-we.patch +Patch0117: 0117-mkimage-refactor-a-bunch-of-section-data-into-a-stru.patch +Patch0118: 0118-mkimage-avoid-copying-relocations-for-sections-that-.patch +Patch0119: 0119-.mod-files-Strip-annobin-annotations-and-.eh_frame-a.patch +Patch0120: 0120-ieee1275-Fix-crash-in-of_path_of_nvme-when-of_path-i.patch +Patch0121: 0121-sparc64-Limit-nvme-of_path_of_nvme-to-just-SPARC.patch +Patch0122: 0122-ieee1275-decode-unit-command-for-4-addr-cell-devs.patch +Patch0123: 0123-ieee1275-encode-unit-command-for-4-addr-cell-devs.patch +Patch0124: 0124-ieee1275-set-address-bus-specific-method.patch +Patch0125: 0125-ieee1275-no-data-command-bus-specific-method.patch +Patch0126: 0126-ieee1275-block-size-deblocker-support-method.patch +Patch0127: 0127-sparc64-blocks-disk-node-method.patch +Patch0128: 0128-sparc64-blocks64-disk-node-method.patch +Patch0129: 0129-Revert-Keep-the-native-terminal-active-when-enabling.patch +Patch0130: 0130-mkimage-fix-build-regression-in-grub_mkimage_load_im.patch +Patch0131: 0131-grub-mkconfig-10_linux-Support-multiple-early-initrd.patch +Patch0132: 0132-chainloader-patch-in-BPB-s-sectors_per_track-and-num.patch +Patch0133: 0133-ieee1275-split-up-grub_machine_get_bootlocation.patch +Patch0134: 0134-ieee1275-NULL-pointer-dereference-in-grub_machine_ge.patch +Patch0135: 0135-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch +Patch0136: 0136-Fix-packed-not-aligned-error-on-GCC-8.patch +Patch0137: 0137-fs-Add-F2FS-support.patch +Patch0138: 0138-diskboot-Trivial-correction-on-stale-comments.patch +Patch0139: 0139-grub-install-Locale-depends-on-nls.patch +Patch0140: 0140-grub-probe-Centralize-GUID-prints.patch +Patch0141: 0141-disk-Update-grub_gpt_partentry.patch +Patch0142: 0142-grub-probe-Add-PARTUUID-detection-support.patch +Patch0143: 0143-templates-Update-grub-script-template-files.patch +Patch0144: 0144-bufio-Round-up-block-size-to-power-of-2.patch +Patch0145: 0145-grub-probe-Don-t-skip-dev-mapper-dm-devices.patch +Patch0146: 0146-xfs-Accept-filesystem-with-sparse-inodes.patch +Patch0147: 0147-templates-Add-missing.patch +Patch0148: 0148-mbi-Use-per-segment-a-separate-relocator-chunk.patch +Patch0149: 0149-grub-fs-tester-Fix-losetup-race.patch +Patch0150: 0150-fdt-Move-prop_entry_size-to-fdt.h.patch +Patch0151: 0151-efi-fdt-Set-address-size-cells-to-2-for-empty-tree.patch +Patch0152: 0152-multiboot_elfxx.c-Fix-compilation-by-fixing-undeclar.patch +Patch0153: 0153-re-write-.gitignore.patch +Patch0154: 0154-IBM-client-architecture-CAS-reboot-support.patch +Patch0155: 0155-for-ppc-reset-console-display-attr-when-clear-screen.patch +Patch0156: 0156-Disable-GRUB-video-support-for-IBM-power-machines.patch +Patch0157: 0157-Honor-a-symlink-when-generating-configuration-by-gru.patch +Patch0158: 0158-Move-bash-completion-script-922997.patch +Patch0159: 0159-Update-to-minilzo-2.08.patch +Patch0160: 0160-Allow-fallback-to-include-entries-by-title-not-just-.patch +Patch0161: 0161-Add-GRUB_DISABLE_UUID.patch +Patch0162: 0162-Make-exit-take-a-return-code.patch +Patch0163: 0163-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch +Patch0164: 0164-Make-efi-machines-load-an-env-block-from-a-variable.patch +Patch0165: 0165-DHCP-client-ID-and-UUID-options-added.patch +Patch0166: 0166-trim-arp-packets-with-abnormal-size.patch +Patch0167: 0167-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +Patch0168: 0168-Add-support-for-UEFI-operating-systems-returned-by-o.patch +Patch0169: 0169-Migrate-PPC-from-Yaboot-to-Grub2.patch +Patch0170: 0170-Add-fw_path-variable-revised.patch +Patch0171: 0171-Add-support-for-linuxefi.patch +Patch0172: 0172-Use-linuxefi-and-initrdefi-where-appropriate.patch +Patch0173: 0173-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +Patch0174: 0174-Pass-x-hex-hex-straight-through-unmolested.patch +Patch0175: 0175-Add-X-option-to-printf-functions.patch +Patch0176: 0176-Search-for-specific-config-file-for-netboot.patch +Patch0177: 0177-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +Patch0178: 0178-Don-t-write-messages-to-the-screen.patch +Patch0179: 0179-Don-t-print-GNU-GRUB-header.patch +Patch0180: 0180-Don-t-add-to-highlighted-row.patch +Patch0181: 0181-Message-string-cleanups.patch +Patch0182: 0182-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +Patch0183: 0183-Use-the-correct-indentation-for-the-term-help-text.patch +Patch0184: 0184-Indent-menu-entries.patch +Patch0185: 0185-Fix-margins.patch +Patch0186: 0186-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +Patch0187: 0187-Use-linux16-when-appropriate-880840.patch +Patch0188: 0188-Enable-pager-by-default.-985860.patch +Patch0189: 0189-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +Patch0190: 0190-Don-t-say-GNU-Linux-in-generated-menus.patch +Patch0191: 0191-Don-t-draw-a-border-around-the-menu.patch +Patch0192: 0192-Use-the-standard-margin-for-the-timeout-string.patch +Patch0193: 0193-Add-.eh_frame-to-list-of-relocations-stripped.patch +Patch0194: 0194-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +Patch0195: 0195-Don-t-print-during-fdt-loading-method.patch +Patch0196: 0196-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +Patch0197: 0197-Don-t-require-a-password-to-boot-entries-generated-b.patch +Patch0198: 0198-Don-t-emit-Booting-.-message.patch +Patch0199: 0199-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch +Patch0200: 0200-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +Patch0201: 0201-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +Patch0202: 0202-Fix-convert-function-to-support-NVMe-devices.patch +Patch0203: 0203-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +Patch0204: 0204-Use-the-default-device-tree-from-the-grub-default-fi.patch +Patch0205: 0205-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0206: 0206-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0207: 0207-Add-grub_util_readlink.patch +Patch0208: 0208-Make-editenv-chase-symlinks-including-those-across-d.patch +Patch0209: 0209-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +Patch0210: 0210-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +Patch0211: 0211-Load-arm-with-SB-enabled.patch +Patch0212: 0212-Try-prefix-if-fw_path-doesn-t-work.patch +Patch0213: 0213-Update-info-with-grub.cfg-netboot-selection-order-11.patch +Patch0214: 0214-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +Patch0215: 0215-Handle-rssd-storage-devices.patch +Patch0216: 0216-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch +Patch0217: 0217-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +Patch0218: 0218-Add-friendly-grub2-password-config-tool-985962.patch +Patch0219: 0219-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +Patch0220: 0220-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch +Patch0221: 0221-tcp-add-window-scaling-support.patch +Patch0222: 0222-efinet-retransmit-if-our-device-is-busy.patch +Patch0223: 0223-Be-more-aggro-about-actually-using-the-configured-ne.patch +Patch0224: 0224-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +Patch0225: 0225-Fix-security-issue-when-reading-username-and-passwor.patch +Patch0226: 0226-Warn-if-grub-password-will-not-be-read-1290803.patch +Patch0227: 0227-Clean-up-grub-setpassword-documentation-1290799.patch +Patch0228: 0228-Fix-locale-issue-in-grub-setpassword-1294243.patch +Patch0229: 0229-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch +Patch0230: 0230-efiemu-Fix-compilation-failure.patch +Patch0231: 0231-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0232: 0232-Add-a-url-parser.patch +Patch0233: 0233-efinet-and-bootp-add-support-for-dhcpv6.patch +Patch0234: 0234-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +Patch0235: 0235-Normalize-slashes-in-tftp-paths.patch +Patch0236: 0236-Fix-malformed-tftp-packets.patch +Patch0237: 0237-Fix-race-in-EFI-validation.patch +Patch0238: 0238-bz1374141-fix-incorrect-mask-for-ppc64.patch +Patch0239: 0239-Use-device-part-of-chainloader-target-if-present.patch +Patch0240: 0240-Add-secureboot-support-on-efi-chainloader.patch +Patch0241: 0241-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch +Patch0242: 0242-Make-grub_fatal-also-backtrace.patch +Patch0243: 0243-Rework-linux-command.patch +Patch0244: 0244-Rework-linux16-command.patch +Patch0245: 0245-Make-grub-editenv-build-again.patch +Patch0246: 0246-Fix-up-some-man-pages-rpmdiff-noticed.patch +Patch0247: 0247-Re-work-some-intricacies-of-PE-loading.patch +Patch0248: 0248-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch +Patch0249: 0249-linuxefi-fix-double-free-on-verification-failure.patch +Patch0250: 0250-fix-machine-type-test-in-30_os-prober.in.patch +Patch0251: 0251-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch +Patch0252: 0252-efi-chainloader-truncate-overlong-relocation-section.patch +Patch0253: 0253-linuxefi-minor-cleanups.patch +Patch0254: 0254-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch +Patch0255: 0255-Fix-up-linux-params-usage.patch +Patch0256: 0256-Make-exit-take-a-return-code.patch +Patch0257: 0257-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch +Patch0258: 0258-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch +Patch0259: 0259-Make-our-info-pages-say-grub2-where-appropriate.patch +Patch0260: 0260-print-more-debug-info-in-our-module-loader.patch +Patch0261: 0261-macos-just-build-chainloader-entries-don-t-try-any-x.patch +Patch0262: 0262-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch +Patch0263: 0263-export-btrfs_subvol-and-btrfs_subvolid.patch +Patch0264: 0264-grub2-btrfs-03-follow_default.patch +Patch0265: 0265-grub2-btrfs-04-grub2-install.patch +Patch0266: 0266-grub2-btrfs-05-grub2-mkconfig.patch +Patch0267: 0267-grub2-btrfs-06-subvol-mount.patch +Patch0268: 0268-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch +Patch0269: 0269-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch +Patch0270: 0270-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch +Patch0271: 0271-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch +Patch0272: 0272-Use-grub_efi_.-memory-helpers-where-reasonable.patch +Patch0273: 0273-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch +Patch0274: 0274-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch +Patch0275: 0275-don-t-ignore-const.patch +Patch0276: 0276-don-t-use-int-for-efi-status.patch +Patch0277: 0277-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch +Patch0278: 0278-Clean-up-some-errors-in-the-linuxefi-loader.patch +Patch0279: 0279-editenv-handle-relative-symlinks.patch +Patch0280: 0280-Make-libgrub.pp-depend-on-config-util.h.patch +Patch0281: 0281-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch +Patch0282: 0282-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch +Patch0283: 0283-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch +Patch0284: 0284-align-struct-efi_variable-better.patch +Patch0285: 0285-Add-quicksort-implementation.patch +Patch0286: 0286-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch +Patch0287: 0287-Add-BLS-support-to-grub-mkconfig.patch +Patch0288: 0288-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch +Patch0289: 0289-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch +Patch0290: 0290-Enable-blscfg-command-for-the-emu-platform.patch +Patch0291: 0291-Add-linux-and-initrd-commands-for-grub-emu.patch +Patch0292: 0292-Fix-the-efidir-in-grub-setpassword.patch +Patch0293: 0293-Add-grub2-switch-to-blscfg.patch +Patch0294: 0294-Add-grub_debug_enabled.patch +Patch0295: 0295-make-better-backtraces.patch +Patch0296: 0296-normal-don-t-draw-our-startup-message-if-debug-is-se.patch +Patch0297: 0297-Work-around-some-minor-include-path-weirdnesses.patch +Patch0298: 0298-Make-it-possible-to-enabled-build-id-sha1.patch +Patch0299: 0299-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch +Patch0300: 0300-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch +Patch0301: 0301-Only-attempt-to-scan-different-BLS-directories-on-EF.patch +Patch0302: 0302-Core-TPM-support.patch +Patch0303: 0303-Measure-kernel-initrd.patch +Patch0304: 0304-Add-BIOS-boot-measurement.patch +Patch0305: 0305-Measure-kernel-and-initrd-on-BIOS-systems.patch +Patch0306: 0306-Measure-the-kernel-commandline.patch +Patch0307: 0307-Measure-commands.patch +Patch0308: 0308-Measure-multiboot-images-and-modules.patch +Patch0309: 0309-Fix-boot-when-there-s-no-TPM.patch +Patch0310: 0310-Rework-TPM-measurements.patch +Patch0311: 0311-Fix-event-log-prefix.patch +Patch0312: 0312-Set-the-first-boot-menu-entry-as-default-when-using-.patch +Patch0313: 0313-tpm-fix-warnings-when-compiling-for-platforms-other-.patch +Patch0314: 0314-Make-TPM-errors-less-fatal.patch +Patch0315: 0315-blscfg-handle-multiple-initramfs-images.patch +Patch0316: 0316-BLS-Fix-grub2-switch-to-blscfg-on-non-EFI-machines.patch +Patch0317: 0317-BLS-Use-etcdefaultgrub-instead-of-etc.patch +Patch0318: 0318-Add-missing-options-to-grub2-switch-to-blscfg-man-pa.patch +Patch0319: 0319-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch +Patch0320: 0320-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch +Patch0321: 0321-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch +Patch0322: 0322-Include-OSTree-path-when-searching-kernels-images-if.patch +Patch0323: 0323-Use-BLS-version-field-to-compare-entries-if-id-field.patch +Patch0324: 0324-Add-version-field-to-BLS-generated-by-grub2-switch-t.patch +Patch0325: 0325-Fixup-for-newer-compiler.patch +Patch0326: 0326-Don-t-attempt-to-export-the-start-and-_start-symbols.patch +Patch0327: 0327-Simplify-BLS-entry-key-val-pairs-lookup.patch +Patch0328: 0328-Add-relative-path-to-the-kernel-and-initrds-BLS-fiel.patch +Patch0329: 0329-Skip-leading-spaces-on-BLS-field-values.patch +Patch0330: 0330-Fixup-for-newer-compiler.patch +Patch0331: 0331-TPM-Fix-hash_log_extend_event-function-prototype.patch +Patch0332: 0332-TPM-Fix-compiler-warnings.patch +Patch0333: 0333-grub-switch-to-blscfg.in-get-rid-of-a-bunch-of-bashi.patch +Patch0334: 0334-grub-switch-to-blscfg.in-Better-boot-prefix-checking.patch +Patch0335: 0335-Use-boot-loader-entries-as-BLS-directory-path-also-o.patch +Patch0336: 0336-Use-BLS-fragment-filename-as-menu-entry-id-and-for-c.patch +Patch0337: 0337-Fix-grub-switch-to-blscfg-boot-prefix-handling.patch +Patch0338: 0338-Revert-trim-arp-packets-with-abnormal-size.patch +Patch0339: 0339-Use-xid-to-match-DHCP-replies.patch +Patch0340: 0340-Add-support-for-non-Ethernet-network-cards.patch +Patch0341: 0341-misc-fix-invalid-character-recongition-in-strto-l.patch +Patch0342: 0342-net-read-bracketed-ipv6-addrs-and-port-numbers.patch +Patch0343: 0343-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch +Patch0344: 0344-bootp-New-net_bootp6-command.patch +Patch0345: 0345-Put-back-our-code-to-add-a-local-route.patch +Patch0346: 0346-efinet-UEFI-IPv6-PXE-support.patch +Patch0347: 0347-grub.texi-Add-net_bootp6-doument.patch +Patch0348: 0348-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch +Patch0349: 0349-efinet-Setting-network-from-UEFI-device-path.patch +Patch0350: 0350-efinet-Setting-DNS-server-from-UEFI-protocol.patch +Patch0351: 0351-Fix-one-more-coverity-complaint.patch +Patch0352: 0352-Make-module-directory-specifiable-on-the-configure-c.patch +Patch0353: 0353-Fix-grub_net_hwaddr_to_str.patch +Patch0354: 0354-Support-UEFI-networking-protocols.patch +Patch0355: 0355-AUDIT-0-http-boot-tracker-bug.patch +Patch0356: 0356-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch +Patch0357: 0357-efi-uga-use-64-bit-for-fb_base.patch +Patch0358: 0358-EFI-console-Do-not-set-text-mode-until-we-actually-n.patch +Patch0359: 0359-EFI-console-Add-grub_console_read_key_stroke-helper-.patch +Patch0360: 0360-EFI-console-Implement-getkeystatus-support.patch +Patch0361: 0361-Make-grub_getkeystatus-helper-funtion-available-ever.patch +Patch0362: 0362-Accept-ESC-F8-and-holding-SHIFT-as-user-interrupt-ke.patch +Patch0363: 0363-grub-editenv-Add-incr-command-to-increment-integer-v.patch +Patch0364: 0364-Add-auto-hide-menu-support.patch +Patch0365: 0365-Output-a-menu-entry-for-firmware-setup-on-UEFI-FastB.patch +Patch0366: 0366-Add-grub-set-bootflag-utility.patch +Patch0367: 0367-Fix-grub-setpassword-o-s-output-path.patch +Patch0368: 0368-Make-grub-set-password-be-named-like-all-the-other-g.patch +Patch0369: 0369-docs-Add-grub-boot-indeterminate.service-example.patch +Patch0370: 0370-EFI-console-Fix-the-enter-key-not-working-on-X86-tab.patch +Patch0371: 0371-00_menu_auto_hide-Use-a-timeout-of-60s-for-menu_show.patch +Patch0372: 0372-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch +Patch0373: 0373-Minor-fixes-to-make-armv7hl-build-as-arm-efi.patch +Patch0374: 0374-30_uefi-firmware-fix-use-with-sys-firmware-efi-efiva.patch diff --git a/grub2.spec b/grub2.spec index 3fde80ca..4b0a663b 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 37%{?dist} +Release: 38%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -454,6 +454,9 @@ fi %endif %changelog +* Tue Jul 10 2018 pjones - 1:2.02-38 +- Rebased to newer upstream for fedora-29 + * Wed May 16 2018 Peter Jones - 2.02-37 - Fixups to work with gcc 8 - Experimental https boot support on UEFI