From 8c6b1ac71ef3d7dae4b4a6bbc313efdf45ec8050 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 22 Jul 2015 09:44:51 -0400 Subject: [PATCH] Reconcile with upstream once again. Also include some minor fixes for gcc 5.1.1 Signed-off-by: Peter Jones --- 0001-fix-EFI-detection-on-Windows.patch | 4 +- ...rm-cache_armv6.S-Remove-.arch-direct.patch | 4 +- ...mpiling-the-GRUB-Fix-some-spelling-m.patch | 12 +- 0004-NEWS-First-draft-of-2.02-entry.patch | 8 +- ...aster-of-git.sv.gnu.org-srv-git-grub.patch | 43 - ...an-command-in-fact-dates-back-to-1.9.patch | 6 +- ...-unused-error.h-from-kern-emu-misc.c.patch | 6 +- ...navailable-coreboot-tables-if-not-ru.patch | 6 +- ...ssing-entries.-Correct-existing-ones.patch | 6 +- ..._frame-section-from-arm64-efi-kernel.patch | 6 +- ...-aa64.efi-for-boot-images-on-AArch64.patch | 6 +- ...-fix-32-bit-compilation-on-MinGW-w64.patch | 6 +- ...rub-mkrescue-to-use-bootaa64.efi-too.patch | 6 +- ...rect-length-of-device-path-end-entry.patch | 6 +- ...f-grub-macbless-Change-mansection-to.patch | 6 +- ...o-EFI-rescue-image-to-fix-missing-pr.patch | 6 +- ...k.c-is-only-ever-compiled-on-FreeBSD.patch | 6 +- ...efer-more-portable-test-1-constructs.patch | 6 +- ...=> 0018-NEWS-Add-few-missing-entries.patch | 6 +- ...fi-efi.c-Ensure-that-the-result-star.patch | 6 +- ...c-Extend-GCC-warning-workaround-to-g.patch | 6 +- ...D_LDFLAGS-for-the-cross-compile-case.patch | 6 +- ...erm-terminfo.c-Recognize-keys-F1-F12.patch | 6 +- ...ate.patch => 0023-Fix-ChangeLog-date.patch | 6 +- ...ct-MinGW-W64-32-instead-of-_FILE_OFF.patch | 6 +- ...-support-to-fix-make-clean-on-Window.patch | 6 +- ...-on-MinGW-due-to-libintl.h-pulling-s.patch | 6 +- ...ds-macbless.c-Rename-FILE-and-DIR-to.patch | 6 +- ...f-Link-grub-ofpathname-with-zfs-libs.patch | 6 +- ...e.am-default_payload.elf-Add-modules.patch | 6 +- ...l-of-cpu-machine-links-on-mingw-msys.patch | 6 +- ...-main.c-read_config_file-Buffer-conf.patch | 6 +- ... 0032-util-grub-install.c-Fix-a-typo.patch | 6 +- ...-for-genemuinit-instead-of-MOD_FILES.patch | 6 +- ...-when-modifying-kern.geom.debugflags.patch | 6 +- ...op-condition-to-avoid-infinite-loops.patch | 6 +- ...rease-network-try-interval-gradually.patch | 6 +- ...aVu-also-in-usr-share-fonts-truetype.patch | 6 +- ...th-to-DejaVuSans-in-configure-summar.patch | 6 +- ..._EXTRA_DIST-to-allow-shipping-runtim.patch | 6 +- ...l.c-write_to_disk-Add-an-info-messag.patch | 6 +- ...rub-install.c-List-available-targets.patch | 6 +- ...042-Fix-several-translatable-strings.patch | 6 +- ...t-set-default-prefix-in-grub-mkimage.patch | 6 +- ...-cross-compile-failure-due-to-printf.patch | 6 +- ...erial.c-grub_serial_register-Fix-inv.patch | 6 +- ...port-for-partitioned-partx-loop-devi.patch | 6 +- ...t_keyboard.c-Tolerate-missing-keyboa.patch | 6 +- ...-add-missing-files-and-.exe-variants.patch | 14 +- ....c-Downgrade-warnings-about-unhandle.patch | 24 +- ...hci.c-Do-not-enable-I-O-decoding-and.patch | 8 +- ...hci.c-Allocate-and-clean-space-for-a.patch | 8 +- ...core-disk-ahci.c-Add-safety-cleanups.patch | 8 +- ...hci.c-Properly-handle-transactions-w.patch | 8 +- ...hci.c-Increase-timeout.-Some-SSDs-ta.patch | 8 +- ....c-Build-fix-for-argp.h-with-older-g.patch | 8 +- ...ue.c-Build-fix-for-argp.h-with-older.patch | 8 +- ...d-grub_env_set_net_property-function.patch | 8 +- ...dd-bootpath-parser-for-open-firmware.patch | 8 +- ...hci.c-Ignore-NPORTS-field-and-rely-o.patch | 8 +- ...386-coreboot-mmap.c-Filter-out-0xa00.patch | 8 +- ...-i386-multiboot_mbi.c-grub_multiboot.patch | 8 +- ...386-uppermem.c-lower_hook-COREBOOT-I.patch | 8 +- ...386-pc-mmap.c-Fallback-to-EISA-memor.patch | 8 +- ...6-openbsd_bootarg.h-Add-addr-and-fre.patch | 8 +- ...eck-for-IBM-pseries-emulated-machine.patch | 6 +- ...er-arm64-linux.c-Remove-redundant-0x.patch | 8 +- ...locator.c-Fix-the-case-when-end-of-l.patch | 8 +- ...atch => 0068-Fix-grub-probe-0-option.patch | 8 +- ...todisk-and-abstraction-handling-in-g.patch | 8 +- ...ot-key-comparison-failures-due-to-en.patch | 8 +- ...linux-getroot.c-grub_util_part_to_di.patch | 8 +- ...ances-of-memcmp-memcpy-in-the-code-t.patch | 8 +- ...gcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch | 8 +- ...ndif.patch => 0074-Add-missing-endif.patch | 6 +- ...syslinux_parse.c-Fix-timeout-quoting.patch | 8 +- ...-LVM-logical_volumes-string-matching.patch | 8 +- ...-with-no-filesystem-UUID-returned-by.patch | 8 +- ...d-kernels-by-placing-GDT-in-conventi.patch | 8 +- ...isc.c-__bzero-Don-t-compile-in-GRUB_.patch | 8 +- ...ds-verify.c-grub_pubkey_open-Fix-mem.patch | 8 +- ...ds-verify.c-grub_pubkey_open-Trust-p.patch | 8 +- ...ciih.c-add_glyph-Fix-uninitialised-v.patch | 8 +- ...ds-efi-lsefisystab.c-grub_cmd_lsefis.patch | 8 +- ...-i386-bsd.c-grub_netbsd_boot-Pass-po.patch | 8 +- ...nstall.c-Fix-handling-of-disk-module.patch | 8 +- ...ds-loadenv.c-check_blocklists-Fix-ov.patch | 8 +- ...xi-Finding-your-way-around-The-build.patch | 47 + ...ix-an-infinite-loop-in-grub-mkconfig.patch | 99 + ...an-command-in-fact-dates-back-to-1.9.patch | 26 - ...s.c-Don-t-probe-disks-of-unknow-size.patch | 41 + 0090-Fix-Changelog.patch | 25 + ...386-pc-biosdisk.c-grub_biosdisk_rw-A.patch | 48 + ...isk_common.c-Clump-disk-size-to-1EiB.patch | 68 + ...t_keyboard.c-Retry-probing-keyboard-.patch | 84 + ...text_print-instead-of-gettext_printf.patch | 39 + ...ips-arc-init.c-grub_machine_get_boot.patch | 40 + ...emove-several-unnecessary-semicolons.patch | 139 + ...-on-x32-ILP32-but-with-x86-64-instru.patch | 111 + ...incorrect-address-reference-in-btrfs.patch | 50 + 0099-Fix-build-with-glibc-2.20.patch | 47 + 0100-Tidy-up-ChangeLog-formatting.patch | 23 + ...rd_ctx-so-we-don-t-free-a-random-poi.patch | 47 +- ...unix-config.c-Remove-extraneous-comm.patch | 162 ++ 0103-Fix-wrong-commit.patch | 130 + ...e.pl.in-Accept-newer-binutils-which-.patch | 40 + ...nds-keylayouts.c-Ignore-unknown-keys.patch | 44 + ...-main.c-Don-t-drop-to-rescue-console.patch | 116 + 0107-ACPIhalt-Add-more-ACPI-opcodes.patch | 173 ++ ...-relax-rather-than-mno-relax-for-uni.patch | 43 + ...pu_to_XXX_compile_time-for-constants.patch | 779 ++++++ ...-platform-that-only-builds-utilities.patch | 196 ++ 0111-Fix-in-tree-platform-none.patch | 45 + ...izer-for-initrd_ctx-to-avoid-fatal-w.patch | 151 ++ ...-respond-to-neighbor-solicit-message.patch | 43 + ...ck-path-non-null-before-grub_strrchr.patch | 56 + 0115-Fix-date-in-last-ChangeLog-entry.patch | 22 + ...onsistently-print-output-of-grub-ls-.patch | 47 + ...citation-for-ipv6-address-autoconf-v.patch | 163 ++ ...e-out-of-bound-access-to-tar-header-.patch | 53 + ...mon-avoid-out-of-bound-access-when-r.patch | 43 + ...uks.c-fix-use-after-free-and-memory-.patch | 136 + ...ssize_t-for-grub_util_fd_read-result.patch | 26 + ...rame-to-list-of-relocations-stripped.patch | 25 - ...eli.c-fix-memory-leaks-in-error-path.patch | 50 + 0123-Fix-ChangeLog.patch | 24 + ...zopio.c-fix-double-free-in-error-pat.patch | 39 + ...b-syslinux_parse.c-do-not-free-array.patch | 40 + ...-zfsinfo.c-memory-leak-in-print_vdev.patch | 45 + ...-i386-xen_fileXX.c-memory-leak-in-gr.patch | 88 + ...hell-support-files-also-for-net-boot.patch | 59 + 0129-add-file-filters-tests.patch | 322 +++ ...uption-in-pubkey-filter-over-network.patch | 181 ++ ...ble-free-in-grub_net_recv_tcp_packet.patch | 49 + ...non-portable-echo-n-in-grub-mkconfig.patch | 162 ++ ...2.c-grub_ext2_read_block-Support-lar.patch | 42 + ...rm-misc.S-fix-unaligned-grub_uint64_.patch | 65 + ...-Fix-serial-rtscts-option-processing.patch | 42 + 0136-Support-GELI-v6-and-v7.patch | 93 + ...licit-sizeof-divisions-by-ARRAY_SIZE.patch | 152 ++ ...r_yywrap-Update-len-synchronously-wi.patch | 41 + ..._file-Don-t-attempt-to-read-past-the.patch | 47 + ...ix.c-grub_minix_read_file-Avoid-read.patch | 66 + ...grub_cmd_play-Avoid-division-by-zero.patch | 61 + ...tion-and-include-some-libgcc-fuction.patch | 439 ---- ...FSplitter.c-AF_merge-Check-that-mdle.patch | 41 + ...ess-Check-that-geometry-is-sane-when.patch | 46 + ...S2-superblocks-with-over-1GiB-blocks.patch | 47 + ...heck-that-sblock.ino_per_group-is-no.patch | 43 + ...2.c-grub_ext2_mount-Additional-check.patch | 47 + ...ix.c-Additional-filesystem-sanity-ch.patch | 125 + ....c-grub_hfs_mount-Additional-filesys.patch | 53 + ...raid_nv_detect-Do-not-divide-by-zero.patch | 52 + ...eee1275-nand.c-grub_nand_open-Check-.patch | 45 + ...386-pc-biosdisk.c-Check-disk-size-sa.patch | 44 + ...klist.c-grub_install_get_blocklist-C.patch | 42 + ...kdf2.c-grub_crypto_pbkdf2-Check-that.patch | 41 + ...e-fs-btrfs.c-Avoid-divisions-by-zero.patch | 119 + ...ore-fs-zfs.c-Avoid-divisions-by-zero.patch | 64 + ...urining-0-sized-terminal-as-it-may-l.patch | 48 + ...iskfilter.c-Validate-volumes-to-avoi.patch | 184 ++ ...readers-jpeg.c-Avoid-division-by-zer.patch | 41 + 0159-Avoid-division-by-zero-in-serial.patch | 72 + ...erm-gfxterm.c-Avoid-division-by-zero.patch | 41 + ...c.h-grub_div_roundup-Remove-as-it-s-.patch | 46 + ...i386-tsc.c-calibrate_tsc-Ensure-that.patch | 46 + ...-i386-xnu.c-guessfsb-Avoid-division-.patch | 54 + ...c-grub_rtc_get_time_ms-Avoid-divisio.patch | 40 + ...grub_util_find_partition_start_os-Av.patch | 42 + ...fi-mm.c-grub_efi_get_memory_map-Neve.patch | 57 + ...ache-sc_clk_tck-and-check-it-for-san.patch | 49 + ...age-Avoid-returning-0-geometry-to-av.patch | 43 + ...e-potential-division-by-0-in-gfxmenu.patch | 167 ++ ...lseek-code-and-require-long-filesyst.patch | 108 + ...hdX-as-alias-to-native-Xen-disk-name.patch | 129 + 0172-Mention-platform-none-in-NEWS.patch | 25 + ..._filter-file-Really-add-missing-file.patch | 34 + ...enerate-ChangeLog-from-git-changelog.patch | 489 ++++ ....common-Remove-unused-LD-C-FLAGS_CPU.patch | 42 + ...ue.c-Always-include-part_msdos-and-p.patch | 40 + ...he-determined-root-disk-even-if-part.patch | 52 + ...file.am-Fix-Changelog-cutoff-address.patch | 27 + ...ty-ChangeLog-if-no-.git-is-available.patch | 30 + ...-float-to-avoid-compiler-generating-.patch | 30 + 0181-uhci-Fix-null-pointer-dereference.patch | 28 + ...e-ALIGN_UP-rather-than-manual-expres.patch | 38 + ...ange-the-confusing-loop-stop-conditi.patch | 48 + 0184-commands-fileXX-Fix-memory-leak.patch | 48 + 0185-gptsync-Add-missing-device_close.patch | 26 + ...s-hdparm-Add-missing-grub_disk_close.patch | 25 + 0187-zfs-Fix-disk-matching-logic.patch | 68 + ...ommands-legacycfg-Fix-resource-leaks.patch | 65 + ...-macbless-Remove-incorrect-grub_free.patch | 25 + ...ands-macbless-Fix-potential-overflow.patch | 29 + ...s-Handle-device-opening-errors-corre.patch | 38 + ...-nativedisk-Add-missing-device_close.patch | 33 + ...ds-parttool-Add-missing-device-close.patch | 39 + 0194-commands-syslinux-Add-missing-free.patch | 29 + ...plify-and-fix-missing-parameter-test.patch | 26 + ...-verify-Fix-sha1-context-zeroing-out.patch | 27 + 0197-commands-wildcard-Add-missing-free.patch | 29 + ...check-argument-validity-before-doing.patch | 37 + ...k-ahci-Fix-device_map_range-argument.patch | 28 + ...k-cryptodisk-Add-missing-error-check.patch | 35 + ...filter-Add-missing-lv-presence-check.patch | 26 + ...-geli-Add-missing-seek-success-check.patch | 27 + 0203-disk-geli-Add-missing-free.patch | 29 + 0204-biosdisk-Add-missing-cast.patch | 37 + 0205-font-Add-missing-free.patch | 25 + 0206-fs-cbfs-Add-missing-free.patch | 34 + ...ommon-Add-a-sanity-check-on-namesize.patch | 32 + ...x-codepath-to-properly-free-on-error.patch | 26 + ...-hfs_open-Check-that-mount-succeeded.patch | 30 + 0210-fs-hfs-Add-pointer-sanity-checks.patch | 63 + ...nds-fileXX-Fix-remaining-memory-leak.patch | 26 + ...d-Explicitly-check-read_node-return-.patch | 38 + ...minix-Fix-sector-promotion-to-64-bit.patch | 100 + 0214-fs-ntfs-Add-missing-free.patch | 29 + 0215-fs-ntfs-Add-sizes-sanity-checks.patch | 34 + ...s-reiserfs-Fix-sector-count-overflow.patch | 26 + ...Fix-error-check-and-add-sanity-check.patch | 57 + ....ac-Always-add-D_FILE_OFFSET_BITS-64.patch | 35 + 0219-fs-ufs-Add-missing-error-check.patch | 32 + ...manager-Fix-null-pointer-dereference.patch | 30 + ...loader-Add-missing-allos-error-check.patch | 26 + 0222-i386-pc-mmap-Fix-memset-size.patch | 26 + ...slinux_parse-Add-missing-alloc-check.patch | 26 + 0224-lib-syslinux_parse-Fix-memory-leak.patch | 25 + ...slinux_parse-Add-missing-error-check.patch | 31 + 0226-bsd-Add-missing-null-pointer-check.patch | 27 + ...mplify-to-avoid-confusing-assignment.patch | 111 + ...-plan9-Add-missing-grub_device_close.patch | 55 + 0229-xnu-Add-missing-error-check.patch | 26 + 0230-normal-main-Fix-error-handling.patch | 26 + ...rmal-misc-Close-device-on-all-pathes.patch | 31 + 0232-devmapper-getroot-Fix-memory-leak.patch | 53 + 0233-linux-blocklist-Fix-memory-leak.patch | 25 + 0234-linux-getroot-Fix-error-handling.patch | 97 + ...ix-password-Fix-file-descriptor-leak.patch | 37 + 0236-vbe-Fix-incorrect-register-usage.patch | 27 + ...-getroot-Add-missing-grub_disk_close.patch | 29 + ...grub-install-common-Fix-sizeof-usage.patch | 26 + 0239-grub-install-Fix-memory-leak.patch | 29 + 0240-grub-macbless-Fix-resource-leak.patch | 26 + ...til-misc.c-Check-ftello-return-value.patch | 26 + 0242-linux-getroot-fix-descriptor-leak.patch | 29 + ...inux-ofpath-fix-various-memory-leaks.patch | 53 + 0244-util-setup-fix-memory-leak.patch | 29 + 0245-util-install-fix-memory-leak.patch | 25 + 0246-linux-getroot-fix-memory-leak.patch | 37 + ...l-rearrange-code-to-avoid-memory-lea.patch | 39 + ...il-grub-mkstandalone-fix-memory-leak.patch | 25 + ...-util-grub-mount-fix-descriptor-leak.patch | 25 + 0250-util-mkimage-fix-memory-leaks.patch | 35 + 0251-util-setup-fix-memory-leak.patch | 36 + ...e-ALIGN_UP-rather-than-manual-expres.patch | 38 + ...Remove-useless-check-if-mode-is-NULL.patch | 44 + 0254-fs-zfs-Fix-error-handling.patch | 63 + ...s-zfscrypt-Add-missing-explicit-cast.patch | 26 + ...isk-Limit-strcpy-size-to-buffer-size.patch | 35 + 0257-linux-ofpath-Fix-error-handling.patch | 38 + 0258-Document-intentional-fallthroughs.patch | 192 ++ ...tdisk-use-strncpy-instead-of-strlcpy.patch | 39 + 0260-linux-ofpath-fix-descriptor-leak.patch | 26 + 0261-fs-zfs-zfs.c-fix-memory-leak.patch | 26 + 0262-commands-parttool-fix-memory-leak.patch | 30 + 0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch | 67 + 0264-fs-zfs-zfscrypt.c-fix-indentation.patch | 33 + 0265-fs-hfsplus-fix-memory-leak.patch | 41 + 0266-util-grub-probe-fix-memory-leaks.patch | 50 + 0267-loader-xnu-fix-memory-leak.patch | 53 + ...uotes-to-match-overall-style-in-NEWS.patch | 25 + 0269-syslinux_parse-fix-memory-leak.patch | 26 + 0270-script-execute.c-fix-memory-leak.patch | 148 ++ ...e.ac-don-t-use-msoft-float-for-arm64.patch | 33 + ...-after-first-file-test-or-closing-br.patch | 63 + ...s-commit-we-need-to-return-from-sube.patch | 28 + ...y-use-TMPDIR-and-same-name-pattern-f.patch | 41 + 0275-tests-add-test-command-file-tests.patch | 107 + ...ip-check-result-of-grub_netbuff_push.patch | 59 + ...x-potential-NULL-pointer-dereference.patch | 37 + 0278-net-pxe-fix-error-condition.patch | 30 + 0279-grub-fstest-fix-descriptor-leak.patch | 31 + ...setup-fix-blocklist-size-calculation.patch | 26 + ...ditional-relocations-generated-by-gc.patch | 113 + ...-util-mkimage-fix-gcc5-build-failure.patch | 41 + ...rash-in-validate_lv-for-mdraid-array.patch | 89 + ...x-double-free-of-lv-names-for-mdraid.patch | 75 + ...nformation-request-tag-size-calculat.patch | 27 + ...loc-to-ensure-that-segments-are-init.patch | 27 + ...raid-more-memory-leaks-in-failure-pa.patch | 58 + ...lways-output-comments-even-if-no-ent.patch | 44 + 0289-Don-t-remove-initrd-parameter.patch | 75 + 0290-Add-test-for-syslinux-converter.patch | 535 ++++ ...s-add-syslinux-test-files-to-tarball.patch | 32 + ...e-hardcoded-paths-from-syslinux_test.patch | 167 ++ 0293-ext2-Support-META_BG.patch | 134 + 0294-ext2-Ignore-INCOMPAT_MMP.patch | 41 + 0295-configure-Add-missing-comma.patch | 25 + ...dding-of-include-options-to-the-very.patch | 43 + ...biflags-which-causes-compile-failure.patch | 39 + ...s-of-host-flags-to-match-actual-beha.patch | 30 + ...div_test-Don-t-try-to-divide-by-zero.patch | 25 + 0300-Provide-__aeabi_mem-cpy-set.patch | 45 + ...startup_raw-Use-more-portable-.asciz.patch | 47 + ...nfigure-Add-msoft-float-to-CCASFLAGS.patch | 25 + ...fdisk-Exclude-floppies-from-scanning.patch | 75 + ...ildcard-Mark-unused-argument-as-such.patch | 26 + 0305-zfs-mzap_lookup-Fix-argument-types.patch | 42 + ...y-that-clang-support-is-experimental.patch | 26 + ...est-which-flags-make-our-asm-compile.patch | 184 ++ ...xplicit-ADDR32-DATA32-prefixes-to-in.patch | 114 + ...dot-assignmnet-to-more-portable-.org.patch | 199 ++ ...licitly-mark-kernel_address-_high-as.patch | 94 + ...less-ADDR32-prefixes-when-address-is.patch | 41 + ...ve-obsolete-ADDR32-and-DATA32-checks.patch | 150 ++ ...ve-realmode.S-from-coreboot-and-qemu.patch | 37 + 0314-qemu-Fix-compilation.patch | 70 + 0315-qemu-Fix-GateA20-enabling.patch | 33 + 0316-qemu-Switch-to-more-portable-.org.patch | 52 + ...ts-on-asm-for-non-BIOS-i386-platform.patch | 77 + ...el-8086-Switch-to-more-portable-.org.patch | 25 + ...sparc64-Switch-to-more-portable-.org.patch | 75 + 0320-mips-Switch-to-more-portable-.org.patch | 78 + ...ption-provides-soft-float-on-configu.patch | 64 + ...mental-support-for-clang-for-sparc64.patch | 137 + ...c-Fix-unused-function-warning-on-xen.patch | 34 + ...-ia64-specific-way-to-disable-floats.patch | 29 + 0325-acpi-Fix-unused-function-warning.patch | 33 + ...gned-division-to-fix-ARM-compilation.patch | 425 +++ 0327-arm64-Fix-compilation-failure.patch | 37 + ...ilation-for-thumb-with-mthumb-interw.patch | 41 + ...ng-grub_-prefix-in-memcpy-invocation.patch | 39 + 0330-mips-Fix-soft-float-handling.patch | 137 + ...minilzo-Skip-parts-tha-we-don-t-need.patch | 31 + ...imize-by-moving-division-out-of-the-.patch | 178 ++ ...by-replacing-division-with-additions.patch | 160 ++ 0334-Add-missing-lib-division.c.patch | 92 + 0335-png-Optimize-by-avoiding-divisions.patch | 60 + ...se-by-replacing-division-with-shifts.patch | 78 + ...rict-cipher-block-size-to-power-of-2.patch | 184 ++ ...x-division-by-0-and-missing-byte-swa.patch | 59 + ...-raid6-Optimize-by-removing-division.patch | 48 + 0340-gzio-Optimize-by-removing-division.patch | 48 + ...ling-of-nonstandard-relocation-sizes.patch | 29 + ...-declaration-of-__clear_cache-to-mat.patch | 27 + ...test-Skip-is-setfattr-is-unavailable.patch | 29 + ...b-shell-Add-missing-locale-directory.patch | 25 + ...probe-Mark-a-default-for-translation.patch | 32 + ...xclude.pot-Add-new-technical-strings.patch | 356 +++ 0347-grub-probe-free-temporary-variable.patch | 24 + ...o-query-block-size-if-disk-doesn-t-h.patch | 148 ++ ...-CPPFLAGS-when-checking-for-no_app_r.patch | 26 + ...pes.h-Use-__builtin_bswap-with-clang.patch | 27 + 0351-Remove-libgcc-dependency.patch | 2313 +++++++++++++++++ ...onfigure.ac-Remove-unused-COND_clang.patch | 24 + 0353-Remove-emu-libusb-support.patch | 420 +++ 0354-Fix-canonicalize_file_name-clash.patch | 381 +++ ....ac-Fix-the-name-of-pciaccess-header.patch | 25 + ...se-Fix-the-case-of-unknown-localboot.patch | 25 + ...-inline.m4-to-upstream-version-to-fi.patch | 130 + ...gp-help.c-to-fix-garbage-in-grub-mkn.patch | 65 + ...-overriding-the-python-to-be-used-by.patch | 68 + ...ntial-access-to-uninited-memory-on-i.patch | 84 + ...etter-estimation-of-filesystem-time-.patch | 54 + ...xplicitly-set-segment-type-for-LVM-m.patch | 31 + 0363-core-add-LVM-RAID1-support.patch | 71 + ...grub-fs-tester-add-LVM-RAID1-support.patch | 75 + ...info-Add-missing-license-information.patch | 25 + ...ss-all-unrecognized-options-unchange.patch | 154 ++ 0367-fddboot_test-Add-no-pad-to-xorriso.patch | 24 + 0368-emunet-Fix-init-error-checking.patch | 26 + 0369-compiler-rt-emu-Add-missing-file.patch | 254 ++ ...Drop-unnecessary-feature-test-macros.patch | 32 + ...dling-in-case-of-oversized-or-invali.patch | 314 +++ ...ore.def-Remove-obsolete-LDADD_KERNEL.patch | 25 + ...o.sh.in-Add-missing-config-variables.patch | 34 + ...-stable-timestamp-when-generating-bi.patch | 45 + ...ile.util.def-independent-of-platform.patch | 24 + ...net-Check-for-immediate-completition.patch | 51 + 0377-dl_helper-Cleanup.patch | 166 ++ ...ializers-to-silence-suprious-warning.patch | 67 + ...atform-even-in-case-of-mismatch-betw.patch | 81 + 0380-syslinux-Support-vesa-menu.c32.patch | 208 ++ ...-grub_cpu_to_XX_compile_time-cleanup.patch | 41 + ...-i386-xen.c-Initialized-initrd_ctx-s.patch | 27 + ...emit-cryptomount-without-crypto-UUID.patch | 25 + ...id-NULL-derefrence-in-grub_divmod64s.patch | 30 + ...s-grub.texi-Fix-spelling-of-cbfstool.patch | 25 + ...ame-sun-to-avoid-clash-with-predefin.patch | 101 + ...root-include-sys-mkdev.h-for-makedev.patch | 27 + 0388-Remove-V-in-grub-mkrescue.c.patch | 26 + ...b-mkconfig-use-pkgdatadir-in-scripts.patch | 167 ++ ...m.delphix-hole_birth-feature-support.patch | 55 + ...elphix-embedded_data-feature-support.patch | 204 ++ ...NULL-check-and-fix-incorrect-buffer-.patch | 51 + ...efinet-memory-leak-on-module-removal.patch | 30 + ...finet-cannot-free-const-char-pointer.patch | 25 + ...efinet-memory-leak-on-module-removal.patch | 34 + ...Export-useful-functions-from-linux.c.patch | 291 +++ 0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch | 34 + ...accidentally-committed-2-commits-ago.patch | 91 + ...c-Ensure-that-initrd-is-page-aligned.patch | 62 + ...cognize-output-as-an-alias-of-output.patch | 33 + ...mon-Increase-buf-size-to-8192-as-mod.patch | 26 + ...emove-unused-extern-grub_relocator64.patch | 26 + ...not-pad-initrd-with-zeroes-at-the-en.patch | 69 + ...rom-CPU-byte-order-in-DNS-receive-fu.patch | 44 + ...vice-path-helpers-in-core-for-efinet.patch | 207 ++ ...ual-IPv4-and-IPv6-devices-when-enume.patch | 97 + ...-Simple-Network-Protocol-exclusively.patch | 89 + 0408-util-grub-mkrescue-Fix-compilation.patch | 25 + 0409-Add-asm-tests-to-tarball.patch | 24 + ...kip-BIOS-scan-if-EBDA-length-is-zero.patch | 83 + ...ination-loop-for-directory-iteration.patch | 32 + ...e-numbers-to-cpu-endianity-immediate.patch | 82 + ...extra-newlines-in-grub_util_-strings.patch | 323 +++ ...fix-integer-truncation-in-zap_lookup.patch | 51 + ...tdisk-fix-crash-with-NULL-device.map.patch | 26 + ...-bootp-ignore-gateway_ip-relay-field.patch | 75 + ...ps.c-Add-new-time-stamp-descriptions.patch | 45 + ...fines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch | 35 + ...t1-never-place-modules-in-low-memory.patch | 28 + ...ataset-and-large_blocks-feature-supp.patch | 88 + 0421-Correct-spelling-of-scheduled.patch | 46 + ...uperusers-variable-and-menu-entry-ac.patch | 38 + ...d-port-number-to-port-debug-messages.patch | 103 + ...m64-setjmp-Add-missing-license-macro.patch | 34 + ...c-clean-up-arm64-soft-float-handling.patch | 50 + ..._tag_module_align-fix-to-confirm-mul.patch | 27 + 0427-xfs-Add-helpers-for-inode-size.patch | 97 + 0428-xfs-V5-filesystem-format-support.patch | 579 +++++ 0429-NEWS-XFS-v5-support.patch | 24 + ...defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch | 30 + 0431-Fix-exit-to-EFI-firmware.patch | 55 + ...432-Migrate-PPC-from-Yaboot-to-Grub2.patch | 8 +- ...=> 0433-Add-fw_path-variable-revised.patch | 8 +- ...tch => 0434-Add-support-for-linuxefi.patch | 14 +- ...xefi-and-initrdefi-where-appropriate.patch | 8 +- ...w-insmod-when-secure-boot-is-enabled.patch | 16 +- ...-hex-hex-straight-through-unmolested.patch | 14 +- ...http.patch => 0438-Fix-crash-on-http.patch | 6 +- ...ient-architecture-CAS-reboot-support.patch | 12 +- ...t.patch => 0440-Add-vlan-tag-support.patch | 6 +- ...441-Add-X-option-to-printf-functions.patch | 18 +- ...HCP-client-ID-and-UUID-options-added.patch | 10 +- ...for-specific-config-file-for-netboot.patch | 12 +- ...g-module-to-parse-Boot-Loader-Specif.patch | 10 +- ...5-Move-bash-completion-script-922997.patch | 6 +- ...nsole-display-attr-when-clear-screen.patch | 6 +- ...7-Don-t-write-messages-to-the-screen.patch | 12 +- ... => 0448-Don-t-print-GNU-GRUB-header.patch | 8 +- ...=> 0449-Don-t-add-to-highlighted-row.patch | 8 +- ...atch => 0450-Message-string-cleanups.patch | 10 +- ...ing-now-that-we-aren-t-displaying-it.patch | 8 +- ...t-indentation-for-the-term-help-text.patch | 8 +- ...es.patch => 0453-Indent-menu-entries.patch | 8 +- ...ix-margins.patch => 0454-Fix-margins.patch | 8 +- ...UEFI-operating-systems-returned-by-o.patch | 17 +- ...video-support-for-IBM-power-machines.patch | 6 +- ...-1-for-our-right-hand-margin-so-line.patch | 8 +- ...-Use-linux16-when-appropriate-880840.patch | 8 +- ...0459-Enable-pager-by-default.-985860.patch | 8 +- ...-on-serial-so-don-t-tell-the-user-to.patch | 8 +- ...n-t-say-GNU-Linux-in-generated-menus.patch | 10 +- ...-Don-t-draw-a-border-around-the-menu.patch | 10 +- ...andard-margin-for-the-timeout-string.patch | 12 +- ...ript_execute_sourcecode-usage-on-ppc.patch | 8 +- ...rame-to-list-of-relocations-stripped.patch | 25 + ...rk-with-our-changes-for-linux16-and-.patch | 10 +- ...on-t-print-during-fdt-loading-method.patch | 8 +- ...when-generating-configuration-by-gru.patch | 10 +- ...spaces-when-we-re-doing-our-cmdline-.patch | 6 +- ...password-to-boot-entries-generated-b.patch | 8 +- ...=> 0471-Don-t-emit-Booting-.-message.patch | 10 +- ...T-keys-work-as-expected-on-EFI-syste.patch | 6 +- ...-it.patch => 0473-May-as-well-try-it.patch | 24 +- ...ix-when-fallback-searching-for-grub-.patch | 8 +- ...-before-grub.cfg-on-tftp-config-file.patch | 8 +- ...-trim-arp-packets-with-abnormal-size.patch | 16 +- ...ert-function-to-support-NVMe-devices.patch | 12 +- ...Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch | 10 +- ...M-Mustang-device-tree-for-hardware-t.patch | 10 +- ...device-tree-from-the-grub-default-fi.patch | 14 +- ...P-protocol-for-exclusive-use-by-grub.patch | 12 +- ...2-Reduce-timer-event-frequency-by-10.patch | 8 +- ... => 0483-always-return-error-to-UEFI.patch | 12 +- ...-powerpc-little-endian-ppc64le-flags.patch | 62 +- ...tion-and-include-some-libgcc-fuction.patch | 241 ++ ...-Suport-for-bi-endianess-in-elf-file.patch | 6 +- ...patch => 0487-Add-grub_util_readlink.patch | 8 +- ...se-symlinks-including-those-across-d.patch | 8 +- ...CLASS-in-10_linux-from-etc-os-releas.patch | 8 +- ...x-GRUB_DISABLE_SUBMENU-one-more-time.patch | 10 +- ...t-ordering-for-.debug-and-rescue-ker.patch | 12 +- ....patch => 0492-Add-GRUB_DISABLE_UUID.patch | 18 +- ...o-include-entries-by-title-not-just-.patch | 8 +- ...tch => 0494-Load-arm-with-SB-enabled.patch | 107 +- ...5-Try-prefix-if-fw_path-doesn-t-work.patch | 12 +- ...x16-initrd16-and-linuxefi-initrdefi-.patch | 15 +- ...patch => 0497-Update-to-minilzo-2.08.patch | 6 +- ...fig-construct-titles-that-look-like-.patch | 10 +- ...debug-entries-sort-right-again-in-gr.patch | 14 +- ...> 0500-Make-.gitignore-suck-way-less.patch | 12 +- ...-grub.cfg-netboot-selection-order-11.patch | 70 + ...-Package-Sort-for-grub2-mkconfig-112.patch | 450 ++++ ...ly-grub2-password-config-tool-985962.patch | 274 ++ 0504-Make-exit-take-a-return-code.patch | 230 ++ ...d__-where-gcc-5.x-is-more-picky-abou.patch | 80 + 0506-Fix-race-in-EFI-validation.patch | 97 + grub2.spec | 656 +++-- 511 files changed, 29506 insertions(+), 1417 deletions(-) delete mode 100644 0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch rename 0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch => 0005-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch (89%) rename 0007-remove-unused-error.h-from-kern-emu-misc.c.patch => 0006-remove-unused-error.h-from-kern-emu-misc.c.patch (87%) rename 0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch => 0007-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch (93%) rename 0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch => 0008-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch (97%) rename 0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch => 0009-strip-.eh_frame-section-from-arm64-efi-kernel.patch (91%) rename 0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch => 0010-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch (89%) rename 0012-fix-32-bit-compilation-on-MinGW-w64.patch => 0011-fix-32-bit-compilation-on-MinGW-w64.patch (91%) rename 0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch => 0012-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch (91%) rename 0014-arm64-set-correct-length-of-device-path-end-entry.patch => 0013-arm64-set-correct-length-of-device-path-end-entry.patch (91%) rename 0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch => 0014-Makefile.util.def-grub-macbless-Change-mansection-to.patch (87%) rename 0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch => 0015-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch (92%) rename 0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch => 0016-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch (91%) rename 0018-Prefer-more-portable-test-1-constructs.patch => 0017-Prefer-more-portable-test-1-constructs.patch (96%) rename 0019-NEWS-Add-few-missing-entries.patch => 0018-NEWS-Add-few-missing-entries.patch (96%) rename 0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch => 0019-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch (94%) rename 0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch => 0020-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch (89%) rename 0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch => 0021-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch (98%) rename 0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch => 0022-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch (96%) rename 0024-Fix-ChangeLog-date.patch => 0023-Fix-ChangeLog-date.patch (83%) rename 0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch => 0024-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch (92%) rename 0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch => 0025-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch (98%) rename 0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch => 0026-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch (98%) rename 0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch => 0027-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch (92%) rename 0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch => 0028-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch (87%) rename 0030-Makefile.am-default_payload.elf-Add-modules.patch => 0029-Makefile.am-default_payload.elf-Add-modules.patch (93%) rename 0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch => 0030-fix-removal-of-cpu-machine-links-on-mingw-msys.patch (92%) rename 0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch => 0031-grub-core-normal-main.c-read_config_file-Buffer-conf.patch (92%) rename 0033-util-grub-install.c-Fix-a-typo.patch => 0032-util-grub-install.c-Fix-a-typo.patch (89%) rename 0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch => 0033-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch (95%) rename 0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch => 0034-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch (94%) rename 0036-change-stop-condition-to-avoid-infinite-loops.patch => 0035-change-stop-condition-to-avoid-infinite-loops.patch (92%) rename 0037-increase-network-try-interval-gradually.patch => 0036-increase-network-try-interval-gradually.patch (96%) rename 0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch => 0037-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch (90%) rename 0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch => 0038-Show-detected-path-to-DejaVuSans-in-configure-summar.patch (86%) rename 0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch => 0039-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch (93%) rename 0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch => 0040-util-grub-install.c-write_to_disk-Add-an-info-messag.patch (87%) rename 0042-util-grub-install.c-List-available-targets.patch => 0041-util-grub-install.c-List-available-targets.patch (96%) rename 0043-Fix-several-translatable-strings.patch => 0042-Fix-several-translatable-strings.patch (96%) rename 0044-do-not-set-default-prefix-in-grub-mkimage.patch => 0043-do-not-set-default-prefix-in-grub-mkimage.patch (94%) rename 0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch => 0044-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch (97%) rename 0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch => 0045-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch (92%) rename 0047-grub-install-support-for-partitioned-partx-loop-devi.patch => 0046-grub-install-support-for-partitioned-partx-loop-devi.patch (91%) rename 0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch => 0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch (88%) rename 0049-.gitignore-add-missing-files-and-.exe-variants.patch => 0048-.gitignore-add-missing-files-and-.exe-variants.patch (83%) rename 0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch => 0049-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch (83%) rename 0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch => 0050-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch (91%) rename 0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch => 0051-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch (91%) rename 0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch => 0052-grub-core-disk-ahci.c-Add-safety-cleanups.patch (92%) rename 0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch => 0053-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch (91%) rename 0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch => 0054-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch (88%) rename 0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch => 0055-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch (85%) rename 0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch => 0056-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch (87%) rename 0058-add-grub_env_set_net_property-function.patch => 0057-add-grub_env_set_net_property-function.patch (97%) rename 0059-add-bootpath-parser-for-open-firmware.patch => 0058-add-bootpath-parser-for-open-firmware.patch (97%) rename 0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch => 0059-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch (86%) rename 0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch => 0060-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch (94%) rename 0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch => 0061-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch (88%) rename 0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch => 0062-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch (87%) rename 0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch => 0063-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch (93%) rename 0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch => 0064-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch (93%) rename 0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch => 0065-ieee1275-check-for-IBM-pseries-emulated-machine.patch (88%) rename 0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch => 0066-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch (86%) rename 0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch => 0067-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch (87%) rename 0069-Fix-grub-probe-0-option.patch => 0068-Fix-grub-probe-0-option.patch (91%) rename 0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch => 0069-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch (98%) rename 0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch => 0070-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch (88%) rename 0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch => 0071-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch (89%) rename 0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch => 0072-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch (95%) rename 0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch => 0073-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch (87%) rename 0075-Add-missing-endif.patch => 0074-Add-missing-endif.patch (81%) rename 0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch => 0075-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch (86%) rename 0077-Improve-LVM-logical_volumes-string-matching.patch => 0076-Improve-LVM-logical_volumes-string-matching.patch (87%) rename 0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch => 0077-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch (94%) rename 0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch => 0078-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch (90%) rename 0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch => 0079-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch (86%) rename 0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch => 0080-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch (87%) rename 0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch => 0081-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch (88%) rename 0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch => 0082-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch (92%) rename 0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch => 0083-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch (89%) rename 0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch => 0084-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch (92%) rename 0086-util-grub-install.c-Fix-handling-of-disk-module.patch => 0085-util-grub-install.c-Fix-handling-of-disk-module.patch (89%) rename 0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch => 0086-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch (91%) create mode 100644 0087-docs-grub-dev.texi-Finding-your-way-around-The-build.patch create mode 100644 0088-Fix-an-infinite-loop-in-grub-mkconfig.patch delete mode 100644 0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch create mode 100644 0089-grub-core-fs-cbfs.c-Don-t-probe-disks-of-unknow-size.patch create mode 100644 0090-Fix-Changelog.patch create mode 100644 0091-grub-core-disk-i386-pc-biosdisk.c-grub_biosdisk_rw-A.patch create mode 100644 0092-grub-core-kern-disk_common.c-Clump-disk-size-to-1EiB.patch create mode 100644 0093-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch create mode 100644 0094-Fix-typo-gettext_print-instead-of-gettext_printf.patch create mode 100644 0095-grub-core-kern-mips-arc-init.c-grub_machine_get_boot.patch create mode 100644 0096-configure.ac-Remove-several-unnecessary-semicolons.patch create mode 100644 0097-Support-grub-emu-on-x32-ILP32-but-with-x86-64-instru.patch create mode 100644 0098-Fix-incorrect-address-reference-in-btrfs.patch create mode 100644 0099-Fix-build-with-glibc-2.20.patch create mode 100644 0100-Tidy-up-ChangeLog-formatting.patch rename 0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch => 0101-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch (75%) create mode 100644 0102-grub-core-osdep-unix-config.c-Remove-extraneous-comm.patch create mode 100644 0103-Fix-wrong-commit.patch create mode 100644 0104-grub-core-gmodule.pl.in-Accept-newer-binutils-which-.patch create mode 100644 0105-grub-core-commands-keylayouts.c-Ignore-unknown-keys.patch create mode 100644 0106-grub-core-normal-main.c-Don-t-drop-to-rescue-console.patch create mode 100644 0107-ACPIhalt-Add-more-ACPI-opcodes.patch create mode 100644 0108-Revert-Use-Wl-no-relax-rather-than-mno-relax-for-uni.patch create mode 100644 0109-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch create mode 100644 0110-Add-a-new-none-platform-that-only-builds-utilities.patch create mode 100644 0111-Fix-in-tree-platform-none.patch create mode 100644 0112-Use-full-initializer-for-initrd_ctx-to-avoid-fatal-w.patch create mode 100644 0113-icmp6-fix-no-respond-to-neighbor-solicit-message.patch create mode 100644 0114-efi-check-path-non-null-before-grub_strrchr.patch create mode 100644 0115-Fix-date-in-last-ChangeLog-entry.patch create mode 100644 0116-grub-fs-tester-consistently-print-output-of-grub-ls-.patch create mode 100644 0117-send-router-solicitation-for-ipv6-address-autoconf-v.patch create mode 100644 0118-grub-mkstandalone-out-of-bound-access-to-tar-header-.patch create mode 100644 0119-grub-install-common-avoid-out-of-bound-access-when-r.patch create mode 100644 0120-grub-core-disk-luks.c-fix-use-after-free-and-memory-.patch create mode 100644 0121-Use-ssize_t-for-grub_util_fd_read-result.patch delete mode 100644 0122-Add-.eh_frame-to-list-of-relocations-stripped.patch create mode 100644 0122-grub-core-disk-geli.c-fix-memory-leaks-in-error-path.patch create mode 100644 0123-Fix-ChangeLog.patch create mode 100644 0124-grub-core-disk-lzopio.c-fix-double-free-in-error-pat.patch create mode 100644 0125-grub-core-lib-syslinux_parse.c-do-not-free-array.patch create mode 100644 0126-grub-core-fs-zfs-zfsinfo.c-memory-leak-in-print_vdev.patch create mode 100644 0127-grub-core-loader-i386-xen_fileXX.c-memory-leak-in-gr.patch create mode 100644 0128-grub-shell-support-files-also-for-net-boot.patch create mode 100644 0129-add-file-filters-tests.patch create mode 100644 0130-fix-memory-corruption-in-pubkey-filter-over-network.patch create mode 100644 0131-fix-double-free-in-grub_net_recv_tcp_packet.patch create mode 100644 0132-Avoid-use-of-non-portable-echo-n-in-grub-mkconfig.patch create mode 100644 0133-grub-core-fs-ext2.c-grub_ext2_read_block-Support-lar.patch create mode 100644 0134-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch create mode 100644 0135-Fix-serial-rtscts-option-processing.patch create mode 100644 0136-Support-GELI-v6-and-v7.patch create mode 100644 0137-Replace-explicit-sizeof-divisions-by-ARRAY_SIZE.patch create mode 100644 0138-grub_script_lexer_yywrap-Update-len-synchronously-wi.patch create mode 100644 0139-grub_fshelp_read_file-Don-t-attempt-to-read-past-the.patch create mode 100644 0140-grub-core-fs-minix.c-grub_minix_read_file-Avoid-read.patch create mode 100644 0141-grub_cmd_play-Avoid-division-by-zero.patch delete mode 100644 0142-Files-reorganization-and-include-some-libgcc-fuction.patch create mode 100644 0142-grub-core-disk-AFSplitter.c-AF_merge-Check-that-mdle.patch create mode 100644 0143-grub_ata_setaddress-Check-that-geometry-is-sane-when.patch create mode 100644 0144-Reject-NILFS2-superblocks-with-over-1GiB-blocks.patch create mode 100644 0145-grub_ufs_mount-Check-that-sblock.ino_per_group-is-no.patch create mode 100644 0146-grub-core-fs-ext2.c-grub_ext2_mount-Additional-check.patch create mode 100644 0147-grub-core-fs-minix.c-Additional-filesystem-sanity-ch.patch create mode 100644 0148-grub-core-fs-hfs.c-grub_hfs_mount-Additional-filesys.patch create mode 100644 0149-grub_dmraid_nv_detect-Do-not-divide-by-zero.patch create mode 100644 0150-grub-core-disk-ieee1275-nand.c-grub_nand_open-Check-.patch create mode 100644 0151-grub-core-disk-i386-pc-biosdisk.c-Check-disk-size-sa.patch create mode 100644 0152-osdep-linux-blocklist.c-grub_install_get_blocklist-C.patch create mode 100644 0153-grub-core-lib-pbkdf2.c-grub_crypto_pbkdf2-Check-that.patch create mode 100644 0154-grub-core-fs-btrfs.c-Avoid-divisions-by-zero.patch create mode 100644 0155-grub-core-fs-zfs.c-Avoid-divisions-by-zero.patch create mode 100644 0156-term.h-Avoid-returining-0-sized-terminal-as-it-may-l.patch create mode 100644 0157-grub-core-disk-diskfilter.c-Validate-volumes-to-avoi.patch create mode 100644 0158-grub-core-video-readers-jpeg.c-Avoid-division-by-zer.patch create mode 100644 0159-Avoid-division-by-zero-in-serial.patch create mode 100644 0160-grub-core-term-gfxterm.c-Avoid-division-by-zero.patch create mode 100644 0161-include-grub-misc.h-grub_div_roundup-Remove-as-it-s-.patch create mode 100644 0162-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch create mode 100644 0163-grub-core-loader-i386-xnu.c-guessfsb-Avoid-division-.patch create mode 100644 0164-rtc_get_time_ms.c-grub_rtc_get_time_ms-Avoid-divisio.patch create mode 100644 0165-haiku-getroot.c-grub_util_find_partition_start_os-Av.patch create mode 100644 0166-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch create mode 100644 0167-unix-cputime.c-Cache-sc_clk_tck-and-check-it-for-san.patch create mode 100644 0168-grub_menu_init_page-Avoid-returning-0-geometry-to-av.patch create mode 100644 0169-Remove-potential-division-by-0-in-gfxmenu.patch create mode 100644 0170-Remove-direct-_llseek-code-and-require-long-filesyst.patch create mode 100644 0171-accept-also-hdX-as-alias-to-native-Xen-disk-name.patch create mode 100644 0172-Mention-platform-none-in-NEWS.patch create mode 100644 0173-tests-file_filter-file-Really-add-missing-file.patch create mode 100644 0174-Autogenerate-ChangeLog-from-git-changelog.patch create mode 100644 0175-conf-Makefile.common-Remove-unused-LD-C-FLAGS_CPU.patch create mode 100644 0176-util-grub-mkrescue.c-Always-include-part_msdos-and-p.patch create mode 100644 0177-efidisk-Return-the-determined-root-disk-even-if-part.patch create mode 100644 0178-Makefile.am-Fix-Changelog-cutoff-address.patch create mode 100644 0179-Generate-empty-ChangeLog-if-no-.git-is-available.patch create mode 100644 0180-Always-add-msoft-float-to-avoid-compiler-generating-.patch create mode 100644 0181-uhci-Fix-null-pointer-dereference.patch create mode 100644 0182-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch create mode 100644 0183-commands-file-Change-the-confusing-loop-stop-conditi.patch create mode 100644 0184-commands-fileXX-Fix-memory-leak.patch create mode 100644 0185-gptsync-Add-missing-device_close.patch create mode 100644 0186-commands-hdparm-Add-missing-grub_disk_close.patch create mode 100644 0187-zfs-Fix-disk-matching-logic.patch create mode 100644 0188-commands-legacycfg-Fix-resource-leaks.patch create mode 100644 0189-commands-macbless-Remove-incorrect-grub_free.patch create mode 100644 0190-commands-macbless-Fix-potential-overflow.patch create mode 100644 0191-commands-macbless-Handle-device-opening-errors-corre.patch create mode 100644 0192-commands-nativedisk-Add-missing-device_close.patch create mode 100644 0193-commands-parttool-Add-missing-device-close.patch create mode 100644 0194-commands-syslinux-Add-missing-free.patch create mode 100644 0195-commands-tr-Simplify-and-fix-missing-parameter-test.patch create mode 100644 0196-commands-verify-Fix-sha1-context-zeroing-out.patch create mode 100644 0197-commands-wildcard-Add-missing-free.patch create mode 100644 0198-disk-AFsplitter-check-argument-validity-before-doing.patch create mode 100644 0199-disk-ahci-Fix-device_map_range-argument.patch create mode 100644 0200-disk-cryptodisk-Add-missing-error-check.patch create mode 100644 0201-disk-diskfilter-Add-missing-lv-presence-check.patch create mode 100644 0202-disk-geli-Add-missing-seek-success-check.patch create mode 100644 0203-disk-geli-Add-missing-free.patch create mode 100644 0204-biosdisk-Add-missing-cast.patch create mode 100644 0205-font-Add-missing-free.patch create mode 100644 0206-fs-cbfs-Add-missing-free.patch create mode 100644 0207-fs-cpio_common-Add-a-sanity-check-on-namesize.patch create mode 100644 0208-fs-fat-Fix-codepath-to-properly-free-on-error.patch create mode 100644 0209-fs-hfs-hfs_open-Check-that-mount-succeeded.patch create mode 100644 0210-fs-hfs-Add-pointer-sanity-checks.patch create mode 100644 0211-commands-fileXX-Fix-remaining-memory-leak.patch create mode 100644 0212-grub_iso9660_read-Explicitly-check-read_node-return-.patch create mode 100644 0213-fs-minix-Fix-sector-promotion-to-64-bit.patch create mode 100644 0214-fs-ntfs-Add-missing-free.patch create mode 100644 0215-fs-ntfs-Add-sizes-sanity-checks.patch create mode 100644 0216-fs-reiserfs-Fix-sector-count-overflow.patch create mode 100644 0217-fs-sfs-Fix-error-check-and-add-sanity-check.patch create mode 100644 0218-configure.ac-Always-add-D_FILE_OFFSET_BITS-64.patch create mode 100644 0219-fs-ufs-Add-missing-error-check.patch create mode 100644 0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch create mode 100644 0221-gfxmenu-theme_loader-Add-missing-allos-error-check.patch create mode 100644 0222-i386-pc-mmap-Fix-memset-size.patch create mode 100644 0223-lib-syslinux_parse-Add-missing-alloc-check.patch create mode 100644 0224-lib-syslinux_parse-Fix-memory-leak.patch create mode 100644 0225-lib-syslinux_parse-Add-missing-error-check.patch create mode 100644 0226-bsd-Add-missing-null-pointer-check.patch create mode 100644 0227-multiboot-Simplify-to-avoid-confusing-assignment.patch create mode 100644 0228-plan9-Add-missing-grub_device_close.patch create mode 100644 0229-xnu-Add-missing-error-check.patch create mode 100644 0230-normal-main-Fix-error-handling.patch create mode 100644 0231-normal-misc-Close-device-on-all-pathes.patch create mode 100644 0232-devmapper-getroot-Fix-memory-leak.patch create mode 100644 0233-linux-blocklist-Fix-memory-leak.patch create mode 100644 0234-linux-getroot-Fix-error-handling.patch create mode 100644 0235-unix-password-Fix-file-descriptor-leak.patch create mode 100644 0236-vbe-Fix-incorrect-register-usage.patch create mode 100644 0237-util-getroot-Add-missing-grub_disk_close.patch create mode 100644 0238-grub-install-common-Fix-sizeof-usage.patch create mode 100644 0239-grub-install-Fix-memory-leak.patch create mode 100644 0240-grub-macbless-Fix-resource-leak.patch create mode 100644 0241-util-misc.c-Check-ftello-return-value.patch create mode 100644 0242-linux-getroot-fix-descriptor-leak.patch create mode 100644 0243-linux-ofpath-fix-various-memory-leaks.patch create mode 100644 0244-util-setup-fix-memory-leak.patch create mode 100644 0245-util-install-fix-memory-leak.patch create mode 100644 0246-linux-getroot-fix-memory-leak.patch create mode 100644 0247-util-grub-install-rearrange-code-to-avoid-memory-lea.patch create mode 100644 0248-util-grub-mkstandalone-fix-memory-leak.patch create mode 100644 0249-util-grub-mount-fix-descriptor-leak.patch create mode 100644 0250-util-mkimage-fix-memory-leaks.patch create mode 100644 0251-util-setup-fix-memory-leak.patch create mode 100644 0252-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch create mode 100644 0253-fs-cbfs-cpio-Remove-useless-check-if-mode-is-NULL.patch create mode 100644 0254-fs-zfs-Fix-error-handling.patch create mode 100644 0255-fs-zfscrypt-Add-missing-explicit-cast.patch create mode 100644 0256-linux-hostdisk-Limit-strcpy-size-to-buffer-size.patch create mode 100644 0257-linux-ofpath-Fix-error-handling.patch create mode 100644 0258-Document-intentional-fallthroughs.patch create mode 100644 0259-linux-hostdisk-use-strncpy-instead-of-strlcpy.patch create mode 100644 0260-linux-ofpath-fix-descriptor-leak.patch create mode 100644 0261-fs-zfs-zfs.c-fix-memory-leak.patch create mode 100644 0262-commands-parttool-fix-memory-leak.patch create mode 100644 0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch create mode 100644 0264-fs-zfs-zfscrypt.c-fix-indentation.patch create mode 100644 0265-fs-hfsplus-fix-memory-leak.patch create mode 100644 0266-util-grub-probe-fix-memory-leaks.patch create mode 100644 0267-loader-xnu-fix-memory-leak.patch create mode 100644 0268-Change-quotes-to-match-overall-style-in-NEWS.patch create mode 100644 0269-syslinux_parse-fix-memory-leak.patch create mode 100644 0270-script-execute.c-fix-memory-leak.patch create mode 100644 0271-configure.ac-don-t-use-msoft-float-for-arm64.patch create mode 100644 0272-test-do-not-stop-after-first-file-test-or-closing-br.patch create mode 100644 0273-test-fix-previous-commit-we-need-to-return-from-sube.patch create mode 100644 0274-test-consistently-use-TMPDIR-and-same-name-pattern-f.patch create mode 100644 0275-tests-add-test-command-file-tests.patch create mode 100644 0276-net-ip-check-result-of-grub_netbuff_push.patch create mode 100644 0277-grub-mkimage-fix-potential-NULL-pointer-dereference.patch create mode 100644 0278-net-pxe-fix-error-condition.patch create mode 100644 0279-grub-fstest-fix-descriptor-leak.patch create mode 100644 0280-setup-fix-blocklist-size-calculation.patch create mode 100644 0281-arm-implement-additional-relocations-generated-by-gc.patch create mode 100644 0282-util-mkimage-fix-gcc5-build-failure.patch create mode 100644 0283-diskfilter-fix-crash-in-validate_lv-for-mdraid-array.patch create mode 100644 0284-diskfilter-fix-double-free-of-lv-names-for-mdraid.patch create mode 100644 0285-multiboot2-Fix-information-request-tag-size-calculat.patch create mode 100644 0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch create mode 100644 0287-diskfilter_make_raid-more-memory-leaks-in-failure-pa.patch create mode 100644 0288-syslinux_parse-Always-output-comments-even-if-no-ent.patch create mode 100644 0289-Don-t-remove-initrd-parameter.patch create mode 100644 0290-Add-test-for-syslinux-converter.patch create mode 100644 0291-build-sys-add-syslinux-test-files-to-tarball.patch create mode 100644 0292-tests-remove-hardcoded-paths-from-syslinux_test.patch create mode 100644 0293-ext2-Support-META_BG.patch create mode 100644 0294-ext2-Ignore-INCOMPAT_MMP.patch create mode 100644 0295-configure-Add-missing-comma.patch create mode 100644 0296-configure-Move-adding-of-include-options-to-the-very.patch create mode 100644 0297-Strip-.MIPS.abiflags-which-causes-compile-failure.patch create mode 100644 0298-INSTALL-Fix-names-of-host-flags-to-match-actual-beha.patch create mode 100644 0299-div_test-Don-t-try-to-divide-by-zero.patch create mode 100644 0300-Provide-__aeabi_mem-cpy-set.patch create mode 100644 0301-mips-startup_raw-Use-more-portable-.asciz.patch create mode 100644 0302-configure-Add-msoft-float-to-CCASFLAGS.patch create mode 100644 0303-ofdisk-Exclude-floppies-from-scanning.patch create mode 100644 0304-wildcard-Mark-unused-argument-as-such.patch create mode 100644 0305-zfs-mzap_lookup-Fix-argument-types.patch create mode 100644 0306-INSTALL-clarify-that-clang-support-is-experimental.patch create mode 100644 0307-Test-which-flags-make-our-asm-compile.patch create mode 100644 0308-i386-Move-from-explicit-ADDR32-DATA32-prefixes-to-in.patch create mode 100644 0309-Change-dot-assignmnet-to-more-portable-.org.patch create mode 100644 0310-i386-pc-boot-Explicitly-mark-kernel_address-_high-as.patch create mode 100644 0311-i386-Remove-needless-ADDR32-prefixes-when-address-is.patch create mode 100644 0312-Remove-obsolete-ADDR32-and-DATA32-checks.patch create mode 100644 0313-Remove-realmode.S-from-coreboot-and-qemu.patch create mode 100644 0314-qemu-Fix-compilation.patch create mode 100644 0315-qemu-Fix-GateA20-enabling.patch create mode 100644 0316-qemu-Switch-to-more-portable-.org.patch create mode 100644 0317-Relax-requirements-on-asm-for-non-BIOS-i386-platform.patch create mode 100644 0318-kernel-8086-Switch-to-more-portable-.org.patch create mode 100644 0319-sparc64-Switch-to-more-portable-.org.patch create mode 100644 0320-mips-Switch-to-more-portable-.org.patch create mode 100644 0321-Discover-which-option-provides-soft-float-on-configu.patch create mode 100644 0322-Experimental-support-for-clang-for-sparc64.patch create mode 100644 0323-i386-tsc-Fix-unused-function-warning-on-xen.patch create mode 100644 0324-configure.ac-Add-ia64-specific-way-to-disable-floats.patch create mode 100644 0325-acpi-Fix-unused-function-warning.patch create mode 100644 0326-Supply-signed-division-to-fix-ARM-compilation.patch create mode 100644 0327-arm64-Fix-compilation-failure.patch create mode 100644 0328-Allow-clang-compilation-for-thumb-with-mthumb-interw.patch create mode 100644 0329-Add-missing-grub_-prefix-in-memcpy-invocation.patch create mode 100644 0330-mips-Fix-soft-float-handling.patch create mode 100644 0331-minilzo-Skip-parts-tha-we-don-t-need.patch create mode 100644 0332-bitmap_scale-Optimize-by-moving-division-out-of-the-.patch create mode 100644 0333-fbblit-Optimize-by-replacing-division-with-additions.patch create mode 100644 0334-Add-missing-lib-division.c.patch create mode 100644 0335-png-Optimize-by-avoiding-divisions.patch create mode 100644 0336-jpeg-Optimise-by-replacing-division-with-shifts.patch create mode 100644 0337-crypto-restrict-cipher-block-size-to-power-of-2.patch create mode 100644 0338-dmraid_nvidia-Fix-division-by-0-and-missing-byte-swa.patch create mode 100644 0339-raid6-Optimize-by-removing-division.patch create mode 100644 0340-gzio-Optimize-by-removing-division.patch create mode 100644 0341-arm-dl-Fix-handling-of-nonstandard-relocation-sizes.patch create mode 100644 0342-emu-cache-Change-declaration-of-__clear_cache-to-mat.patch create mode 100644 0343-ntfs_test-Skip-is-setfattr-is-unavailable.patch create mode 100644 0344-grub-shell-Add-missing-locale-directory.patch create mode 100644 0345-grub-probe-Mark-a-default-for-translation.patch create mode 100644 0346-exclude.pot-Add-new-technical-strings.patch create mode 100644 0347-grub-probe-free-temporary-variable.patch create mode 100644 0348-Don-t-continue-to-query-block-size-if-disk-doesn-t-h.patch create mode 100644 0349-configure.ac-Set-CPPFLAGS-when-checking-for-no_app_r.patch create mode 100644 0350-types.h-Use-__builtin_bswap-with-clang.patch create mode 100644 0351-Remove-libgcc-dependency.patch create mode 100644 0352-configure.ac-Remove-unused-COND_clang.patch create mode 100644 0353-Remove-emu-libusb-support.patch create mode 100644 0354-Fix-canonicalize_file_name-clash.patch create mode 100644 0355-configure.ac-Fix-the-name-of-pciaccess-header.patch create mode 100644 0356-syslinux_parse-Fix-the-case-of-unknown-localboot.patch create mode 100644 0357-update-m4-extern-inline.m4-to-upstream-version-to-fi.patch create mode 100644 0358-update-gnulib-argp-help.c-to-fix-garbage-in-grub-mkn.patch create mode 100644 0359-autogen.sh-Allow-overriding-the-python-to-be-used-by.patch create mode 100644 0360-hfsplus-Fix-potential-access-to-uninited-memory-on-i.patch create mode 100644 0361-grub-fs-tester-better-estimation-of-filesystem-time-.patch create mode 100644 0362-grub-fs-tester-explicitly-set-segment-type-for-LVM-m.patch create mode 100644 0363-core-add-LVM-RAID1-support.patch create mode 100644 0364-grub-fs-tester-add-LVM-RAID1-support.patch create mode 100644 0365-cacheinfo-Add-missing-license-information.patch create mode 100644 0366-grub-mkrescue-pass-all-unrecognized-options-unchange.patch create mode 100644 0367-fddboot_test-Add-no-pad-to-xorriso.patch create mode 100644 0368-emunet-Fix-init-error-checking.patch create mode 100644 0369-compiler-rt-emu-Add-missing-file.patch create mode 100644 0370-hostfs-Drop-unnecessary-feature-test-macros.patch create mode 100644 0371-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch create mode 100644 0372-Makefile.core.def-Remove-obsolete-LDADD_KERNEL.patch create mode 100644 0373-modinfo.sh.in-Add-missing-config-variables.patch create mode 100644 0374-util-mkimage-Use-stable-timestamp-when-generating-bi.patch create mode 100644 0375-Make-Makefile.util.def-independent-of-platform.patch create mode 100644 0376-efinet-Check-for-immediate-completition.patch create mode 100644 0377-dl_helper-Cleanup.patch create mode 100644 0378-Add-missing-initializers-to-silence-suprious-warning.patch create mode 100644 0379-Recognize-EFI-platform-even-in-case-of-mismatch-betw.patch create mode 100644 0380-syslinux-Support-vesa-menu.c32.patch create mode 100644 0381-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch create mode 100644 0382-grub-core-loader-i386-xen.c-Initialized-initrd_ctx-s.patch create mode 100644 0383-do-not-emit-cryptomount-without-crypto-UUID.patch create mode 100644 0384-core-avoid-NULL-derefrence-in-grub_divmod64s.patch create mode 100644 0385-docs-grub.texi-Fix-spelling-of-cbfstool.patch create mode 100644 0386-core-partmap-rename-sun-to-avoid-clash-with-predefin.patch create mode 100644 0387-getroot-include-sys-mkdev.h-for-makedev.patch create mode 100644 0388-Remove-V-in-grub-mkrescue.c.patch create mode 100644 0389-grub-mkconfig-use-pkgdatadir-in-scripts.patch create mode 100644 0390-zfs-com.delphix-hole_birth-feature-support.patch create mode 100644 0391-zfs-com.delphix-embedded_data-feature-support.patch create mode 100644 0392-zfs-add-missing-NULL-check-and-fix-incorrect-buffer-.patch create mode 100644 0393-efinet-memory-leak-on-module-removal.patch create mode 100644 0394-efinet-cannot-free-const-char-pointer.patch create mode 100644 0395-Revert-efinet-memory-leak-on-module-removal.patch create mode 100644 0396-arm64-Export-useful-functions-from-linux.c.patch create mode 100644 0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch create mode 100644 0398-Revert-parts-accidentally-committed-2-commits-ago.patch create mode 100644 0399-linux.c-Ensure-that-initrd-is-page-aligned.patch create mode 100644 0400-grub-mkrescue-Recognize-output-as-an-alias-of-output.patch create mode 100644 0401-grub-install-common-Increase-buf-size-to-8192-as-mod.patch create mode 100644 0402-i386-relocator-Remove-unused-extern-grub_relocator64.patch create mode 100644 0403-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch create mode 100644 0404-convert-to-not-from-CPU-byte-order-in-DNS-receive-fu.patch create mode 100644 0405-efidisk-move-device-path-helpers-in-core-for-efinet.patch create mode 100644 0406-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch create mode 100644 0407-efinet-open-Simple-Network-Protocol-exclusively.patch create mode 100644 0408-util-grub-mkrescue-Fix-compilation.patch create mode 100644 0409-Add-asm-tests-to-tarball.patch create mode 100644 0410-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch create mode 100644 0411-xfs-Fix-termination-loop-for-directory-iteration.patch create mode 100644 0412-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch create mode 100644 0413-remove-extra-newlines-in-grub_util_-strings.patch create mode 100644 0414-zfs-fix-integer-truncation-in-zap_lookup.patch create mode 100644 0415-hostdisk-fix-crash-with-NULL-device.map.patch create mode 100644 0416-bootp-ignore-gateway_ip-relay-field.patch create mode 100644 0417-cb_timestamps.c-Add-new-time-stamp-descriptions.patch create mode 100644 0418-disk-ahci-Use-defines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch create mode 100644 0419-multiboot1-never-place-modules-in-low-memory.patch create mode 100644 0420-zfs-extensible_dataset-and-large_blocks-feature-supp.patch create mode 100644 0421-Correct-spelling-of-scheduled.patch create mode 100644 0422-Clarify-use-of-superusers-variable-and-menu-entry-ac.patch create mode 100644 0423-disk-ahci.c-Add-port-number-to-port-debug-messages.patch create mode 100644 0424-arm64-setjmp-Add-missing-license-macro.patch create mode 100644 0425-configure.ac-clean-up-arm64-soft-float-handling.patch create mode 100644 0426-multiboot_header_tag_module_align-fix-to-confirm-mul.patch create mode 100644 0427-xfs-Add-helpers-for-inode-size.patch create mode 100644 0428-xfs-V5-filesystem-format-support.patch create mode 100644 0429-NEWS-XFS-v5-support.patch create mode 100644 0430-disk-ahci.c-Use-defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch create mode 100644 0431-Fix-exit-to-EFI-firmware.patch rename 0089-Migrate-PPC-from-Yaboot-to-Grub2.patch => 0432-Migrate-PPC-from-Yaboot-to-Grub2.patch (95%) rename 0090-Add-fw_path-variable-revised.patch => 0433-Add-fw_path-variable-revised.patch (93%) rename 0091-Add-support-for-linuxefi.patch => 0434-Add-support-for-linuxefi.patch (98%) rename 0092-Use-linuxefi-and-initrdefi-where-appropriate.patch => 0435-Use-linuxefi-and-initrdefi-where-appropriate.patch (90%) rename 0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch => 0436-Don-t-allow-insmod-when-secure-boot-is-enabled.patch (90%) rename 0094-Pass-x-hex-hex-straight-through-unmolested.patch => 0437-Pass-x-hex-hex-straight-through-unmolested.patch (93%) rename 0095-Fix-crash-on-http.patch => 0438-Fix-crash-on-http.patch (87%) rename 0096-IBM-client-architecture-CAS-reboot-support.patch => 0439-IBM-client-architecture-CAS-reboot-support.patch (95%) rename 0097-Add-vlan-tag-support.patch => 0440-Add-vlan-tag-support.patch (98%) rename 0098-Add-X-option-to-printf-functions.patch => 0441-Add-X-option-to-printf-functions.patch (66%) rename 0099-DHCP-client-ID-and-UUID-options-added.patch => 0442-DHCP-client-ID-and-UUID-options-added.patch (94%) rename 0100-Search-for-specific-config-file-for-netboot.patch => 0443-Search-for-specific-config-file-for-netboot.patch (96%) rename 0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch => 0444-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch (96%) rename 0102-Move-bash-completion-script-922997.patch => 0445-Move-bash-completion-script-922997.patch (85%) rename 0103-for-ppc-reset-console-display-attr-when-clear-screen.patch => 0446-for-ppc-reset-console-display-attr-when-clear-screen.patch (88%) rename 0104-Don-t-write-messages-to-the-screen.patch => 0447-Don-t-write-messages-to-the-screen.patch (95%) rename 0105-Don-t-print-GNU-GRUB-header.patch => 0448-Don-t-print-GNU-GRUB-header.patch (82%) rename 0106-Don-t-add-to-highlighted-row.patch => 0449-Don-t-add-to-highlighted-row.patch (80%) rename 0107-Message-string-cleanups.patch => 0450-Message-string-cleanups.patch (92%) rename 0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch => 0451-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch (84%) rename 0109-Use-the-correct-indentation-for-the-term-help-text.patch => 0452-Use-the-correct-indentation-for-the-term-help-text.patch (84%) rename 0110-Indent-menu-entries.patch => 0453-Indent-menu-entries.patch (82%) rename 0111-Fix-margins.patch => 0454-Fix-margins.patch (89%) rename 0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch => 0455-Add-support-for-UEFI-operating-systems-returned-by-o.patch (75%) rename 0113-Disable-GRUB-video-support-for-IBM-power-machines.patch => 0456-Disable-GRUB-video-support-for-IBM-power-machines.patch (94%) rename 0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch => 0457-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch (81%) rename 0115-Use-linux16-when-appropriate-880840.patch => 0458-Use-linux16-when-appropriate-880840.patch (88%) rename 0116-Enable-pager-by-default.-985860.patch => 0459-Enable-pager-by-default.-985860.patch (78%) rename 0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch => 0460-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch (84%) rename 0118-Don-t-say-GNU-Linux-in-generated-menus.patch => 0461-Don-t-say-GNU-Linux-in-generated-menus.patch (87%) rename 0119-Don-t-draw-a-border-around-the-menu.patch => 0462-Don-t-draw-a-border-around-the-menu.patch (91%) rename 0120-Use-the-standard-margin-for-the-timeout-string.patch => 0463-Use-the-standard-margin-for-the-timeout-string.patch (80%) rename 0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch => 0464-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch (83%) create mode 100644 0465-Add-.eh_frame-to-list-of-relocations-stripped.patch rename 0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch => 0466-Make-10_linux-work-with-our-changes-for-linux16-and-.patch (90%) rename 0124-Don-t-print-during-fdt-loading-method.patch => 0467-Don-t-print-during-fdt-loading-method.patch (77%) rename 0125-Honor-a-symlink-when-generating-configuration-by-gru.patch => 0468-Honor-a-symlink-when-generating-configuration-by-gru.patch (75%) rename 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch => 0469-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch (86%) rename 0127-Don-t-require-a-password-to-boot-entries-generated-b.patch => 0470-Don-t-require-a-password-to-boot-entries-generated-b.patch (83%) rename 0128-Don-t-emit-Booting-.-message.patch => 0471-Don-t-emit-Booting-.-message.patch (86%) rename 0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch => 0472-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch (98%) rename 0130-May-as-well-try-it.patch => 0473-May-as-well-try-it.patch (99%) rename 0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch => 0474-use-fw_path-prefix-when-fallback-searching-for-grub-.patch (89%) rename 0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch => 0475-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch (94%) rename 0133-trim-arp-packets-with-abnormal-size.patch => 0476-trim-arp-packets-with-abnormal-size.patch (68%) rename 0134-Fix-convert-function-to-support-NVMe-devices.patch => 0477-Fix-convert-function-to-support-NVMe-devices.patch (80%) rename 0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch => 0478-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch (81%) rename 0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch => 0479-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch (75%) rename 0137-Use-the-default-device-tree-from-the-grub-default-fi.patch => 0480-Use-the-default-device-tree-from-the-grub-default-fi.patch (78%) rename 0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch => 0481-reopen-SNP-protocol-for-exclusive-use-by-grub.patch (80%) rename 0139-Reduce-timer-event-frequency-by-10.patch => 0482-Reduce-timer-event-frequency-by-10.patch (88%) rename 0140-always-return-error-to-UEFI.patch => 0483-always-return-error-to-UEFI.patch (68%) rename 0141-Add-powerpc-little-endian-ppc64le-flags.patch => 0484-Add-powerpc-little-endian-ppc64le-flags.patch (70%) create mode 100644 0485-Files-reorganization-and-include-some-libgcc-fuction.patch rename 0143-Suport-for-bi-endianess-in-elf-file.patch => 0486-Suport-for-bi-endianess-in-elf-file.patch (98%) rename 0144-Add-grub_util_readlink.patch => 0487-Add-grub_util_readlink.patch (99%) rename 0145-Make-editenv-chase-symlinks-including-those-across-d.patch => 0488-Make-editenv-chase-symlinks-including-those-across-d.patch (94%) rename 0146-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch => 0489-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch (86%) rename 0147-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch => 0490-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch (77%) rename 0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch => 0491-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch (67%) rename 0149-Add-GRUB_DISABLE_UUID.patch => 0492-Add-GRUB_DISABLE_UUID.patch (91%) rename 0150-Allow-fallback-to-include-entries-by-title-not-just-.patch => 0493-Allow-fallback-to-include-entries-by-title-not-just-.patch (95%) rename 0152-Load-arm-with-SB-enabled.patch => 0494-Load-arm-with-SB-enabled.patch (84%) rename 0153-Try-prefix-if-fw_path-doesn-t-work.patch => 0495-Try-prefix-if-fw_path-doesn-t-work.patch (95%) rename 0154-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch => 0496-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch (85%) rename 0001-Update-to-minilzo-2.08.patch => 0497-Update-to-minilzo-2.08.patch (99%) rename 0001-Make-grub2-mkconfig-construct-titles-that-look-like-.patch => 0498-Make-grub2-mkconfig-construct-titles-that-look-like-.patch (90%) rename 0002-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch => 0499-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch (69%) rename 0001-Make-.gitignore-suck-way-less.patch => 0500-Make-.gitignore-suck-way-less.patch (95%) create mode 100644 0501-Update-info-with-grub.cfg-netboot-selection-order-11.patch create mode 100644 0502-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch create mode 100644 0503-Add-friendly-grub2-password-config-tool-985962.patch create mode 100644 0504-Make-exit-take-a-return-code.patch create mode 100644 0505-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch create mode 100644 0506-Fix-race-in-EFI-validation.patch diff --git a/0001-fix-EFI-detection-on-Windows.patch b/0001-fix-EFI-detection-on-Windows.patch index 9886abf..ec7c893 100644 --- a/0001-fix-EFI-detection-on-Windows.patch +++ b/0001-fix-EFI-detection-on-Windows.patch @@ -1,7 +1,7 @@ From a6e7719bbe05993613a8de69dba14fa092144925 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Wed, 25 Dec 2013 22:36:28 +0400 -Subject: [PATCH 001/152] fix EFI detection on Windows +Subject: [PATCH 001/506] fix EFI detection on Windows We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns zero) *and* extended error information is ERROR_INVALID_FUNCTION. @@ -39,5 +39,5 @@ index f2b9d71..d217efe 100644 platform = PLAT_BIOS; return; -- -1.9.3 +2.4.3 diff --git a/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch b/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch index 3457a78..0fc5621 100644 --- a/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch +++ b/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch @@ -1,7 +1,7 @@ From 5bda44d7f98c36f87144869ec58b518f80a69b56 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 25 Dec 2013 23:31:42 +0100 -Subject: [PATCH 002/152] * grub-core/kern/arm/cache_armv6.S: Remove +Subject: [PATCH 002/506] * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. As these functions are used on pre-ARMv6 CPUs as well we don't want @@ -39,5 +39,5 @@ index 39da1df..dfaded0 100644 # define DMB mcr p15, 0, r0, c7, c10, 5 # define DSB mcr p15, 0, r0, c7, c10, 4 -- -1.9.3 +2.4.3 diff --git a/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch b/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch index 52aa300..6787b70 100644 --- a/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch +++ b/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch @@ -1,7 +1,7 @@ -From 8ebe593c564edc8ae62086df8a1448e898ef259b Mon Sep 17 00:00:00 2001 +From 51f941a0d871fe9af20d57574272e62d52b3375c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Dec 2013 03:03:32 +0000 -Subject: [PATCH 003/152] * INSTALL (Cross-compiling the GRUB): Fix some +Subject: [PATCH 003/506] * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. * docs/grub.texi (Getting the source code): Likewise. --- @@ -11,7 +11,7 @@ Subject: [PATCH 003/152] * INSTALL (Cross-compiling the GRUB): Fix some 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 153bc43..bbb0f31 100644 +index 21ec1c7..e61d48b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -20,9 +20,9 @@ index 153bc43..bbb0f31 100644 + * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. + * docs/grub.texi (Getting the source code): Likewise. + - 2013-12-25 Vladimir Serbinenko + 2013-12-25 Andrey Borzenkov - * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. + * grub-core/osdep/windows/platform.c (get_platform): Fix EFI diff --git a/INSTALL b/INSTALL index afc957c..db12530 100644 --- a/INSTALL @@ -84,5 +84,5 @@ index c796850..7c6244c 100644 Once you have used @kbd{git clone} to fetch an initial copy of a branch, you -- -1.9.3 +2.4.3 diff --git a/0004-NEWS-First-draft-of-2.02-entry.patch b/0004-NEWS-First-draft-of-2.02-entry.patch index a9f6448..e57511d 100644 --- a/0004-NEWS-First-draft-of-2.02-entry.patch +++ b/0004-NEWS-First-draft-of-2.02-entry.patch @@ -1,7 +1,7 @@ -From c0e2febef52139e0e580e52f553bf3aa521e390c Mon Sep 17 00:00:00 2001 +From 30a338460ad97c190502a1067979dac2fc548f16 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Dec 2013 03:05:38 +0000 -Subject: [PATCH 004/152] * NEWS: First draft of 2.02 entry. +Subject: [PATCH 004/506] * NEWS: First draft of 2.02 entry. --- ChangeLog | 4 +++ @@ -9,7 +9,7 @@ Subject: [PATCH 004/152] * NEWS: First draft of 2.02 entry. 2 files changed, 123 insertions(+) diff --git a/ChangeLog b/ChangeLog -index bbb0f31..82dc61d 100644 +index e61d48b..53f0481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ @@ -150,5 +150,5 @@ index 4bb5f98..577d9fd 100644 * Appearance: -- -1.9.3 +2.4.3 diff --git a/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch b/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch deleted file mode 100644 index 2cea0c9..0000000 --- a/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9ee79da5bf54babe11178ced48470b5f09d3dda3 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Fri, 27 Dec 2013 11:20:37 +0100 -Subject: [PATCH 005/152] Merge branch 'master' of git.sv.gnu.org:/srv/git/grub - -Conflicts: - ChangeLog ---- - ChangeLog | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index 82dc61d..da3c2df 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2013-12-27 Vladimir Serbinenko -+ -+ * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. -+ -+ As these functions are used on pre-ARMv6 CPUs as well we don't want -+ to make assembler assume that architecture is higher than default one. -+ - 2013-12-27 Colin Watson - - * NEWS: First draft of 2.02 entry. -@@ -7,13 +14,6 @@ - * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. - * docs/grub.texi (Getting the source code): Likewise. - --2013-12-25 Vladimir Serbinenko -- -- * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. -- -- As these functions are used on pre-ARMv6 CPUs as well we don't want -- to make assembler assume that architecture is higher than default one. -- - 2013-12-25 Andrey Borzenkov - - * grub-core/osdep/windows/platform.c (get_platform): Fix EFI --- -1.9.3 - diff --git a/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch b/0005-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch similarity index 89% rename from 0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch rename to 0005-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch index 401987b..2492e8e 100644 --- a/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +++ b/0005-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch @@ -1,7 +1,7 @@ -From 94763697f5f33614b7bd6da91707a27b6872b750 Mon Sep 17 00:00:00 2001 +From 8442d3e956fa3775419b0b3ce65f4289875e7ecf Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 28 Dec 2013 02:20:27 +0000 -Subject: [PATCH 006/152] * NEWS: The cmosclean command in fact dates back to +Subject: [PATCH 005/506] * NEWS: The cmosclean command in fact dates back to 1.99. Remove mention of it from 2.02. --- @@ -37,5 +37,5 @@ index 577d9fd..b74c05f 100644 coreboot. * Improve opcode parsing in ACPI halt implementation. -- -1.9.3 +2.4.3 diff --git a/0007-remove-unused-error.h-from-kern-emu-misc.c.patch b/0006-remove-unused-error.h-from-kern-emu-misc.c.patch similarity index 87% rename from 0007-remove-unused-error.h-from-kern-emu-misc.c.patch rename to 0006-remove-unused-error.h-from-kern-emu-misc.c.patch index 589bd16..5133c25 100644 --- a/0007-remove-unused-error.h-from-kern-emu-misc.c.patch +++ b/0006-remove-unused-error.h-from-kern-emu-misc.c.patch @@ -1,7 +1,7 @@ -From 904bd6b3cb12977def4f940e90aca3fe557c3bb5 Mon Sep 17 00:00:00 2001 +From 989af025829b20a19f4d3ee01e86f4ee9de7cf1e Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 28 Dec 2013 09:01:20 +0400 -Subject: [PATCH 007/152] remove unused error.h from kern/emu/misc.c +Subject: [PATCH 006/506] remove unused error.h from kern/emu/misc.c Fixes compilation on mingw32, where include is apparently missing. --- @@ -35,5 +35,5 @@ index 43471b4..bb606da 100644 #include #include -- -1.9.3 +2.4.3 diff --git a/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch b/0007-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch similarity index 93% rename from 0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch rename to 0007-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch index bb4dcc1..b81d989 100644 --- a/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch +++ b/0007-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch @@ -1,7 +1,7 @@ -From 23cd074c57ee6f35776fd5122a050bcef6c9eef5 Mon Sep 17 00:00:00 2001 +From 093dec7370650ecfa9b770210e21b8d6b03f1df3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 28 Dec 2013 17:25:14 +0100 -Subject: [PATCH 008/152] Don't abort() on unavailable coreboot tables +Subject: [PATCH 007/506] Don't abort() on unavailable coreboot tables if not running on coreboot. --- @@ -66,5 +66,5 @@ index 6b150b4..3314f02 100644 grub_video_coreboot_fb_late_init (); -- -1.9.3 +2.4.3 diff --git a/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch b/0008-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch similarity index 97% rename from 0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch rename to 0008-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch index ca774cd..535dac3 100644 --- a/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch +++ b/0008-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch @@ -1,7 +1,7 @@ -From 3eff91e86e4df2cf8a5e1b26f98e96bf4731f526 Mon Sep 17 00:00:00 2001 +From 0e309454f6f184c3704d7b78687e314f14a07b3c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 30 Dec 2013 06:49:15 +0100 -Subject: [PATCH 009/152] * NEWS: Add few missing entries. Correct +Subject: [PATCH 008/506] * NEWS: Add few missing entries. Correct existing ones. --- @@ -117,5 +117,5 @@ index b74c05f..49a2459 100644 * HFS string is now treated like mac-roman and not UTF-8 * HFS mtime support. -- -1.9.3 +2.4.3 diff --git a/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch b/0009-strip-.eh_frame-section-from-arm64-efi-kernel.patch similarity index 91% rename from 0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch rename to 0009-strip-.eh_frame-section-from-arm64-efi-kernel.patch index 0928178..44f9f04 100644 --- a/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch +++ b/0009-strip-.eh_frame-section-from-arm64-efi-kernel.patch @@ -1,7 +1,7 @@ -From 9e9507d2e1eaed4fc2ebe2959c5405687485f613 Mon Sep 17 00:00:00 2001 +From 668add258ff7ffcfdc2c501fe5eb32e53c69b6f4 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 30 Dec 2013 12:56:19 +0000 -Subject: [PATCH 010/152] strip .eh_frame section from arm64-efi kernel +Subject: [PATCH 009/506] strip .eh_frame section from arm64-efi kernel Fixes grub-mkimage error "relocation 0x105 is not implemented yet." --- @@ -35,5 +35,5 @@ index c916246..42443bc 100644 i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; -- -1.9.3 +2.4.3 diff --git a/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch b/0010-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch similarity index 89% rename from 0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch rename to 0010-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch index d800f7a..c29f64b 100644 --- a/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch +++ b/0010-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch @@ -1,7 +1,7 @@ -From 7e782c6996ee433c94fb378cbc8db0fa0f663c84 Mon Sep 17 00:00:00 2001 +From c9e839e2caaf278491f99e7d181cf20dcf5f0b75 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 10:38:54 +0400 -Subject: [PATCH 011/152] use {grub,boot}aa64.efi for boot images on AArch64 +Subject: [PATCH 010/506] use {grub,boot}aa64.efi for boot images on AArch64 According to UEFI 2.4 specification, default boot file name on AArch64 is BOOTAA64.EFI (3.4.1.1 Removable Media Boot Behavior). Also set default @@ -33,5 +33,5 @@ index 8cfe0ea..4608b80 100644 default: efi_file = "grub.efi"; -- -1.9.3 +2.4.3 diff --git a/0012-fix-32-bit-compilation-on-MinGW-w64.patch b/0011-fix-32-bit-compilation-on-MinGW-w64.patch similarity index 91% rename from 0012-fix-32-bit-compilation-on-MinGW-w64.patch rename to 0011-fix-32-bit-compilation-on-MinGW-w64.patch index 17c5a03..e3b001f 100644 --- a/0012-fix-32-bit-compilation-on-MinGW-w64.patch +++ b/0011-fix-32-bit-compilation-on-MinGW-w64.patch @@ -1,7 +1,7 @@ -From afda7f47601f36a98074d8d21ffb640256f02267 Mon Sep 17 00:00:00 2001 +From 94cee4a4c201bb506377b2c26e072eee8cb19d6f Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 18:43:02 +0400 -Subject: [PATCH 012/152] fix 32 bit compilation on MinGW-w64 +Subject: [PATCH 011/506] fix 32 bit compilation on MinGW-w64 Use _FILE_OFFSET_BITS macro to distinguish between native MinGW and 32 bit under MinGW-64. The latter does not require fseeko/ftello @@ -41,5 +41,5 @@ index 36615b2..79efcfa 100644 #endif -- -1.9.3 +2.4.3 diff --git a/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch b/0012-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch similarity index 91% rename from 0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch rename to 0012-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch index b1ca8f8..c2aa759 100644 --- a/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch +++ b/0012-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch @@ -1,7 +1,7 @@ -From 9981c4e3f366b4795655368a78baa058b18711c6 Mon Sep 17 00:00:00 2001 +From e7cfa8d5e1c6d54d40731065e535889b2e8bc9a2 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 20:34:25 +0400 -Subject: [PATCH 013/152] Change grub-mkrescue to use bootaa64.efi too +Subject: [PATCH 012/506] Change grub-mkrescue to use bootaa64.efi too Also add ChangeLog entry for previous change. --- @@ -40,5 +40,5 @@ index 317879d..0d03e55 100644 imgname); free (imgname); -- -1.9.3 +2.4.3 diff --git a/0014-arm64-set-correct-length-of-device-path-end-entry.patch b/0013-arm64-set-correct-length-of-device-path-end-entry.patch similarity index 91% rename from 0014-arm64-set-correct-length-of-device-path-end-entry.patch rename to 0013-arm64-set-correct-length-of-device-path-end-entry.patch index 06df30b..b778fca 100644 --- a/0014-arm64-set-correct-length-of-device-path-end-entry.patch +++ b/0013-arm64-set-correct-length-of-device-path-end-entry.patch @@ -1,7 +1,7 @@ -From f493e0d352e1e8ff8cbafee69878d00487a04808 Mon Sep 17 00:00:00 2001 +From 4d21c1019904598a991e847eef049c65f9c49bd9 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Tue, 7 Jan 2014 17:52:50 +0000 -Subject: [PATCH 014/152] arm64: set correct length of device path end entry +Subject: [PATCH 013/506] arm64: set correct length of device path end entry The length of the Device Path End entry in the grub_linux_boot() function was incorrectly set to 0. This triggers an assert failure @@ -39,5 +39,5 @@ index 9d15aad..75ad871 100644 b = grub_efi_system_table->boot_services; status = b->load_image (0, grub_efi_image_handle, -- -1.9.3 +2.4.3 diff --git a/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch b/0014-Makefile.util.def-grub-macbless-Change-mansection-to.patch similarity index 87% rename from 0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch rename to 0014-Makefile.util.def-grub-macbless-Change-mansection-to.patch index 74c5bae..092216a 100644 --- a/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch +++ b/0014-Makefile.util.def-grub-macbless-Change-mansection-to.patch @@ -1,7 +1,7 @@ -From 1c0db34a9597ecccb3ad4899892fb6ff6e22304d Mon Sep 17 00:00:00 2001 +From ccd21a65ed5ebce27b1e78b56208169fbf30351e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 8 Jan 2014 11:05:20 +0000 -Subject: [PATCH 015/152] * Makefile.util.def (grub-macbless): Change +Subject: [PATCH 014/506] * Makefile.util.def (grub-macbless): Change mansection to 8. --- @@ -35,5 +35,5 @@ index 985e76c..3c99be2 100644 common = grub-core/osdep/init.c; common = grub-core/kern/emu/argp_common.c; -- -1.9.3 +2.4.3 diff --git a/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch b/0015-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch similarity index 92% rename from 0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch rename to 0015-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch index 194a36a..7f2b863 100644 --- a/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch +++ b/0015-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch @@ -1,7 +1,7 @@ -From 3aea6cc46177a90056ba60381e6387377fe40c99 Mon Sep 17 00:00:00 2001 +From 0776112c5311196889a15058a3b1be4c81ba5e05 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sun, 12 Jan 2014 15:29:21 +0400 -Subject: [PATCH 016/152] add part_apple to EFI rescue image to fix missing +Subject: [PATCH 015/506] add part_apple to EFI rescue image to fix missing prefix On Mac rescue image is booted from HFS+ partition, so bootpath looks like @@ -44,5 +44,5 @@ index 0d03e55..34e0b7a 100644 if (source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]) { -- -1.9.3 +2.4.3 diff --git a/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch b/0016-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch similarity index 91% rename from 0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch rename to 0016-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch index 07161ae..48eeed8 100644 --- a/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch +++ b/0016-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch @@ -1,7 +1,7 @@ -From a433d177585c8355c6ede67469a521d05cf1e9d7 Mon Sep 17 00:00:00 2001 +From 09a836e59c1103ed9aa238dcd526da670c9b0d90 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 02:30:52 +0000 -Subject: [PATCH 017/152] freebsd/hostdisk.c is only ever compiled on FreeBSD +Subject: [PATCH 016/506] freebsd/hostdisk.c is only ever compiled on FreeBSD * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove redundant preprocessor conditional. @@ -44,5 +44,5 @@ index bd5fddb..eb202dc 100644 return ret; } -- -1.9.3 +2.4.3 diff --git a/0018-Prefer-more-portable-test-1-constructs.patch b/0017-Prefer-more-portable-test-1-constructs.patch similarity index 96% rename from 0018-Prefer-more-portable-test-1-constructs.patch rename to 0017-Prefer-more-portable-test-1-constructs.patch index 7b15632..24a1e59 100644 --- a/0018-Prefer-more-portable-test-1-constructs.patch +++ b/0017-Prefer-more-portable-test-1-constructs.patch @@ -1,7 +1,7 @@ -From 4ec08b960f6de1190dea9fe7e6ab3b4b249840e5 Mon Sep 17 00:00:00 2001 +From ff66b8e7d8397c40bdd57ada31665b605c20c565 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 15:24:50 +0000 -Subject: [PATCH 018/152] Prefer more portable test(1) constructs +Subject: [PATCH 017/506] Prefer more portable test(1) constructs * util/grub.d/00_header.in (make_timeout): Use && rather than test -a. @@ -105,5 +105,5 @@ index 0470e66..7cf8487 100644 continue fi -- -1.9.3 +2.4.3 diff --git a/0019-NEWS-Add-few-missing-entries.patch b/0018-NEWS-Add-few-missing-entries.patch similarity index 96% rename from 0019-NEWS-Add-few-missing-entries.patch rename to 0018-NEWS-Add-few-missing-entries.patch index 3b34f96..ee4520a 100644 --- a/0019-NEWS-Add-few-missing-entries.patch +++ b/0018-NEWS-Add-few-missing-entries.patch @@ -1,7 +1,7 @@ -From e18da008f74a3c5f27a191e4f7be80c02a49f2fe Mon Sep 17 00:00:00 2001 +From 5acc8020b46605703a59915d4166520788dfdf00 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:31:10 +0100 -Subject: [PATCH 019/152] * NEWS: Add few missing entries. +Subject: [PATCH 018/506] * NEWS: Add few missing entries. --- ChangeLog | 4 ++++ @@ -96,5 +96,5 @@ index 49a2459..a61df94 100644 improvements to the build system. * Remove variable length arrays. -- -1.9.3 +2.4.3 diff --git a/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch b/0019-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch similarity index 94% rename from 0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch rename to 0019-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch index 443639b..db30e43 100644 --- a/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch +++ b/0019-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch @@ -1,7 +1,7 @@ -From 29c96f00677e1dd2a9df4de645a7f5fab7b736a1 Mon Sep 17 00:00:00 2001 +From 7e7293d745ef7c0a13d8cbf12f474843edfdd0ab Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:41:47 +0100 -Subject: [PATCH 020/152] * grub-core/kern/efi/efi.c: Ensure that the +Subject: [PATCH 019/506] * grub-core/kern/efi/efi.c: Ensure that the result starts with / and has no //. --- @@ -86,5 +86,5 @@ index b253141..b9eb1ab 100644 return name; } -- -1.9.3 +2.4.3 diff --git a/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch b/0020-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch similarity index 89% rename from 0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch rename to 0020-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch index 63c5477..1fdd8e1 100644 --- a/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch +++ b/0020-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch @@ -1,7 +1,7 @@ -From fa9e3a9aa30988c2339e9d05c81b5d91534f4049 Mon Sep 17 00:00:00 2001 +From ae80f312700c72fcb0222a7865ea69f37517a313 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:43:29 +0100 -Subject: [PATCH 021/152] * util/grub-mount.c: Extend GCC warning +Subject: [PATCH 020/506] * util/grub-mount.c: Extend GCC warning workaround to grub-mount. --- @@ -43,5 +43,5 @@ index 118881e..19de2e6 100644 static const char *root = NULL; grub_device_t dev = NULL; -- -1.9.3 +2.4.3 diff --git a/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch b/0021-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch similarity index 98% rename from 0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch rename to 0021-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch index 5ccfcca..09912fd 100644 --- a/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch +++ b/0021-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch @@ -1,7 +1,7 @@ -From 3bea802b45b9c98f70753370522fa6e47ba8966b Mon Sep 17 00:00:00 2001 +From dcecae1a49996bbaefb4133a878215594eb5094a Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 19:50:54 +0400 -Subject: [PATCH 022/152] reintroduce BUILD_LDFLAGS for the cross-compile case +Subject: [PATCH 021/506] reintroduce BUILD_LDFLAGS for the cross-compile case This allows providing separate LDFLAGS for build and host environments, which are not necessary the same for cross-compile case. In particular, it allows @@ -149,5 +149,5 @@ index 1b3142d..13b7979 100644 # trigtables.c -- -1.9.3 +2.4.3 diff --git a/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch b/0022-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch similarity index 96% rename from 0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch rename to 0022-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch index ba33f13..40243f2 100644 --- a/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch +++ b/0022-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch @@ -1,7 +1,7 @@ -From ac660e42875162e599f50c085cb646c633cf376d Mon Sep 17 00:00:00 2001 +From 3abb9563712f73bc48a33d428a3ab4c756191904 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:57:35 +0100 -Subject: [PATCH 023/152] * grub-core/term/terminfo.c: Recognize keys +Subject: [PATCH 022/506] * grub-core/term/terminfo.c: Recognize keys F1-F12. --- @@ -151,5 +151,5 @@ index 3d48b19..f0d3e3d 100644 } #undef CONTINUE_READ -- -1.9.3 +2.4.3 diff --git a/0024-Fix-ChangeLog-date.patch b/0023-Fix-ChangeLog-date.patch similarity index 83% rename from 0024-Fix-ChangeLog-date.patch rename to 0023-Fix-ChangeLog-date.patch index 277c34f..97114cb 100644 --- a/0024-Fix-ChangeLog-date.patch +++ b/0023-Fix-ChangeLog-date.patch @@ -1,7 +1,7 @@ -From 6e5cf6b00fa82e5a02135ea5e21230ee44c72087 Mon Sep 17 00:00:00 2001 +From 9b9c4686f07644eb9c4f4786ff121bb9e19e31cd Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:01:16 +0400 -Subject: [PATCH 024/152] Fix ChangeLog date +Subject: [PATCH 023/506] Fix ChangeLog date --- ChangeLog | 2 +- @@ -21,5 +21,5 @@ index bdfbf44..fcbf220 100644 * configure.ac: Add support for BUILD_LDFLAGS. * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... -- -1.9.3 +2.4.3 diff --git a/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch b/0024-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch similarity index 92% rename from 0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch rename to 0024-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch index 55a8472..a9a5c3a 100644 --- a/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch +++ b/0024-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch @@ -1,7 +1,7 @@ -From bb3e1a1e8448f3ea9489b5ebfcec799196bc862f Mon Sep 17 00:00:00 2001 +From 5ef569df5b359048ee55c5000e2679855cb87e06 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:04:11 +0400 -Subject: [PATCH 025/152] Use _W64 to detect MinGW W64-32 instead of +Subject: [PATCH 024/506] Use _W64 to detect MinGW W64-32 instead of _FILE_OFFSET_BITS In 94cee4a4c201bb506377b2c26e072eee8cb19d6f I overlooked that config.h @@ -43,5 +43,5 @@ index 79efcfa..bf6451b 100644 #define ftello ftello64 #endif -- -1.9.3 +2.4.3 diff --git a/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch b/0025-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch similarity index 98% rename from 0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch rename to 0025-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch index 3814c94..f26ba2a 100644 --- a/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch +++ b/0025-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch @@ -1,7 +1,7 @@ -From 5ac7afd762d11b4c91d5756222c3abf5862203de Mon Sep 17 00:00:00 2001 +From 1ecf96fcc4bd882381bf21a461a12baf3c5ecf77 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:41:24 +0400 -Subject: [PATCH 026/152] add BUILD_EXEEXT support to fix make clean on Windows +Subject: [PATCH 025/506] add BUILD_EXEEXT support to fix make clean on Windows Add $(BUILD_EXEEXT) to ensure files are removed. Also add CLEANFILES where appropriate. @@ -170,5 +170,5 @@ index 13b7979..826b3dd 100644 # XXX Use Automake's LEX & YACC support -- -1.9.3 +2.4.3 diff --git a/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch b/0026-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch similarity index 98% rename from 0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch rename to 0026-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch index 3075cf2..b0e5e39 100644 --- a/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch +++ b/0026-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch @@ -1,7 +1,7 @@ -From 09194ac15b3c348cbf147e8ea27b982b57a7a778 Mon Sep 17 00:00:00 2001 +From f371dd5da81701f7bc3d28c67cb4c2c289728691 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 21:22:57 +0400 -Subject: [PATCH 027/152] fix include loop on MinGW due to libintl.h pulling +Subject: [PATCH 026/506] fix include loop on MinGW due to libintl.h pulling stdio.h In file included from ./include/grub/dl.h:23:0, @@ -277,5 +277,5 @@ index d393da7..8cc331d 100644 struct grub_procfs_entry { -- -1.9.3 +2.4.3 diff --git a/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch b/0027-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch similarity index 92% rename from 0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch rename to 0027-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch index 4ba0214..38f4a98 100644 --- a/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch +++ b/0027-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch @@ -1,7 +1,7 @@ -From 9cbb9fc3d79e449affe7ed5e104aa828b72ad2cd Mon Sep 17 00:00:00 2001 +From 6c519b5c6c95a0d486c548157b2af3d4fb4e0bbe Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:26:40 +0100 -Subject: [PATCH 028/152] * grub-core/commands/macbless.c: Rename FILE +Subject: [PATCH 027/506] * grub-core/commands/macbless.c: Rename FILE and DIR to avoid conflicts. Reported by: Andrey Borzenkov. @@ -57,5 +57,5 @@ index c521083..4724edd 100644 static grub_err_t -- -1.9.3 +2.4.3 diff --git a/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch b/0028-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch similarity index 87% rename from 0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch rename to 0028-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch index 0c25a18..6a5075e 100644 --- a/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch +++ b/0028-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch @@ -1,7 +1,7 @@ -From 6c3fa2da4fd22c3ebda0c6cf69f97d578c04e704 Mon Sep 17 00:00:00 2001 +From 6ba983559dcffa0fa69c7fc861b5a16b4877a92c Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 18 Jan 2014 19:41:15 +0100 -Subject: [PATCH 029/152] * Makefile.util.def: Link grub-ofpathname with +Subject: [PATCH 028/506] * Makefile.util.def: Link grub-ofpathname with zfs libs. --- @@ -35,5 +35,5 @@ index 83df212..a286a89 100644 program = { -- -1.9.3 +2.4.3 diff --git a/0030-Makefile.am-default_payload.elf-Add-modules.patch b/0029-Makefile.am-default_payload.elf-Add-modules.patch similarity index 93% rename from 0030-Makefile.am-default_payload.elf-Add-modules.patch rename to 0029-Makefile.am-default_payload.elf-Add-modules.patch index 10f8209..b69e584 100644 --- a/0030-Makefile.am-default_payload.elf-Add-modules.patch +++ b/0029-Makefile.am-default_payload.elf-Add-modules.patch @@ -1,7 +1,7 @@ -From 3f6bd432acbf2244e6f4b83dd3a259392b10afb6 Mon Sep 17 00:00:00 2001 +From 0b47c57ad62e314fac9c77cc17bdea032f945fca Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:43:19 +0100 -Subject: [PATCH 030/152] * Makefile.am (default_payload.elf): Add +Subject: [PATCH 029/506] * Makefile.am (default_payload.elf): Add modules multiboot cbmemc linux16 gzio echo help. --- @@ -38,5 +38,5 @@ index aa526f5..97c062d 100644 windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows -- -1.9.3 +2.4.3 diff --git a/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch b/0030-fix-removal-of-cpu-machine-links-on-mingw-msys.patch similarity index 92% rename from 0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch rename to 0030-fix-removal-of-cpu-machine-links-on-mingw-msys.patch index 25cc7f2..6067044 100644 --- a/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch +++ b/0030-fix-removal-of-cpu-machine-links-on-mingw-msys.patch @@ -1,7 +1,7 @@ -From d0cf0d7dcd4813a168d2bd94ec77ee0ae8ff860e Mon Sep 17 00:00:00 2001 +From e0a850947f541e5078304699106f9f66a79e4151 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 22:48:04 +0400 -Subject: [PATCH 031/152] fix removal of {cpu,machine} links on mingw/msys +Subject: [PATCH 030/506] fix removal of {cpu,machine} links on mingw/msys At least on Windows 2003 using "ln -s dir1 dir2" in msys shell succeeds, but results in what looks like hard link. Subsequent "rm -f dir2" (e.g. @@ -51,5 +51,5 @@ index 32d5477..b2bb88d 100644 [link_dir=yes else -- -1.9.3 +2.4.3 diff --git a/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch b/0031-grub-core-normal-main.c-read_config_file-Buffer-conf.patch similarity index 92% rename from 0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch rename to 0031-grub-core-normal-main.c-read_config_file-Buffer-conf.patch index c81d2b2..a9c3f40 100644 --- a/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch +++ b/0031-grub-core-normal-main.c-read_config_file-Buffer-conf.patch @@ -1,7 +1,7 @@ -From 221f6e1ac22f66881276d4cb012d588ecfb17e47 Mon Sep 17 00:00:00 2001 +From 41155a57223e346b990a3d1b6708fa85351ab256 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:54:09 +0100 -Subject: [PATCH 032/152] * grub-core/normal/main.c (read_config_file): +Subject: [PATCH 031/506] * grub-core/normal/main.c (read_config_file): Buffer config file. Reduces boot time. --- @@ -64,5 +64,5 @@ index c36663f..3a926fc 100644 if (ctmp) old_file = grub_strdup (ctmp); -- -1.9.3 +2.4.3 diff --git a/0033-util-grub-install.c-Fix-a-typo.patch b/0032-util-grub-install.c-Fix-a-typo.patch similarity index 89% rename from 0033-util-grub-install.c-Fix-a-typo.patch rename to 0032-util-grub-install.c-Fix-a-typo.patch index d75d75a..96c7d45 100644 --- a/0033-util-grub-install.c-Fix-a-typo.patch +++ b/0032-util-grub-install.c-Fix-a-typo.patch @@ -1,7 +1,7 @@ -From d353b169aa6b2a9cd03d0c2987da7da059aa6f99 Mon Sep 17 00:00:00 2001 +From b204b718cc00432f18be861b8bf4342e50feef90 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 20:02:51 +0100 -Subject: [PATCH 033/152] * util/grub-install.c: Fix a typo. +Subject: [PATCH 032/506] * util/grub-install.c: Fix a typo. --- ChangeLog | 4 ++++ @@ -36,5 +36,5 @@ index 4608b80..5903f34 100644 if (disk_module && grub_strcmp (disk_module, "ata") == 0) -- -1.9.3 +2.4.3 diff --git a/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch b/0033-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch similarity index 95% rename from 0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch rename to 0033-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch index 541eeac..9320a50 100644 --- a/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch +++ b/0033-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch @@ -1,7 +1,7 @@ -From 85cc4b1abfed85fd8504da4acc391d5936de2812 Mon Sep 17 00:00:00 2001 +From 015045471ed815fc45ba9fba52cb34582d129a96 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 23:15:40 +0400 -Subject: [PATCH 034/152] use MODULE_FILES for genemuinit* instead of MOD_FILES +Subject: [PATCH 033/506] use MODULE_FILES for genemuinit* instead of MOD_FILES MinGW native nm does not support ELF binaries. --- @@ -87,5 +87,5 @@ index 6b83f59..a99a15d 100644 fi done -- -1.9.3 +2.4.3 diff --git a/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch b/0034-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch similarity index 94% rename from 0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch rename to 0034-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch index 22b52e0..a7c7e0f 100644 --- a/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch +++ b/0034-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch @@ -1,7 +1,7 @@ -From 97fca4331e317b0491912c3cf3d02a9fac96c419 Mon Sep 17 00:00:00 2001 +From 049f63824c654ca10dc9073decc139ccd2f9a06b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 02:28:46 +0000 -Subject: [PATCH 035/152] Ignore EPERM when modifying kern.geom.debugflags +Subject: [PATCH 034/506] Ignore EPERM when modifying kern.geom.debugflags Many tests fail when run as a non-root user on FreeBSD. The failures all amount to an inability to open files using grub_util_fd_open, @@ -54,5 +54,5 @@ index eb202dc..6145d07 100644 ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR); -- -1.9.3 +2.4.3 diff --git a/0036-change-stop-condition-to-avoid-infinite-loops.patch b/0035-change-stop-condition-to-avoid-infinite-loops.patch similarity index 92% rename from 0036-change-stop-condition-to-avoid-infinite-loops.patch rename to 0035-change-stop-condition-to-avoid-infinite-loops.patch index 9a1c0e3..48ed86c 100644 --- a/0036-change-stop-condition-to-avoid-infinite-loops.patch +++ b/0035-change-stop-condition-to-avoid-infinite-loops.patch @@ -1,7 +1,7 @@ -From 547d1e84df5d57c7600ead4556d43d5dbbe33c4b Mon Sep 17 00:00:00 2001 +From d99d2f84166b0f60673d5c0714605a153946c0fc Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 21 Jan 2014 10:49:39 -0200 -Subject: [PATCH 036/152] change stop condition to avoid infinite loops +Subject: [PATCH 035/506] change stop condition to avoid infinite loops In net/net.c there is a while (1) that only exits if there is a stop condition and more then 10 packages or if there is no package received. @@ -48,5 +48,5 @@ index 0e57e93..56355f3 100644 /* Maybe should be better have a fixed number of packets for each card and just mark them as used and not used. */ -- -1.9.3 +2.4.3 diff --git a/0037-increase-network-try-interval-gradually.patch b/0036-increase-network-try-interval-gradually.patch similarity index 96% rename from 0037-increase-network-try-interval-gradually.patch rename to 0036-increase-network-try-interval-gradually.patch index adbd75e..26aa423 100644 --- a/0037-increase-network-try-interval-gradually.patch +++ b/0036-increase-network-try-interval-gradually.patch @@ -1,7 +1,7 @@ -From d3652ff33623d842fc4422ffd98e4303795e9519 Mon Sep 17 00:00:00 2001 +From 6f65e36cc4f92fe40672181eccf12eac4afb6738 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 21 Jan 2014 11:03:51 -0200 -Subject: [PATCH 037/152] increase network try interval gradually +Subject: [PATCH 036/506] increase network try interval gradually * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try interval gradually. @@ -107,5 +107,5 @@ index de6259e..0e0a605 100644 #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.4.3 diff --git a/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch b/0037-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch similarity index 90% rename from 0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch rename to 0037-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch index ca93d1e..868d4d4 100644 --- a/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch +++ b/0037-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch @@ -1,7 +1,7 @@ -From 90d83cda679fef485f7bb1a318bd682c4eb86cb4 Mon Sep 17 00:00:00 2001 +From 36387ece6be1b912c778d4a5f068801f99385fa2 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 19:29:33 +0400 -Subject: [PATCH 038/152] look for DejaVu also in /usr/share/fonts/truetype +Subject: [PATCH 037/506] look for DejaVu also in /usr/share/fonts/truetype It is installed in this path on openSUSE. --- @@ -35,5 +35,5 @@ index cf3de3b..120263e 100644 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" break 2 -- -1.9.3 +2.4.3 diff --git a/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch b/0038-Show-detected-path-to-DejaVuSans-in-configure-summar.patch similarity index 86% rename from 0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch rename to 0038-Show-detected-path-to-DejaVuSans-in-configure-summar.patch index 4c6c275..feef272 100644 --- a/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch +++ b/0038-Show-detected-path-to-DejaVuSans-in-configure-summar.patch @@ -1,7 +1,7 @@ -From 3e02e2fbd2089645ac2c482dad59318394b62252 Mon Sep 17 00:00:00 2001 +From 443b3222621b6df1e5e01bd6fb2c496568065f92 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 19:41:11 +0400 -Subject: [PATCH 039/152] Show detected path to DejaVuSans in configure summary +Subject: [PATCH 038/506] Show detected path to DejaVuSans in configure summary --- ChangeLog | 1 + @@ -33,5 +33,5 @@ index 120263e..8888c2f 100644 echo starfield theme: No "($starfield_excuse)" fi -- -1.9.3 +2.4.3 diff --git a/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch b/0039-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch similarity index 93% rename from 0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch rename to 0039-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch index 6883573..d7470a5 100644 --- a/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch +++ b/0039-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch @@ -1,7 +1,7 @@ -From 6e9483ee94033f4bb7b9a17bd032c4af4479abc0 Mon Sep 17 00:00:00 2001 +From eec4237a3265b024cc97d3cd287bdea7cd187f48 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 20:54:09 +0400 -Subject: [PATCH 040/152] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime +Subject: [PATCH 039/506] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime files Not all toolkits provide static libraries. This patch enables creation of self @@ -58,5 +58,5 @@ index 97c062d..f02ae0a 100644 EXTRA_DIST += linguas.sh -- -1.9.3 +2.4.3 diff --git a/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch b/0040-util-grub-install.c-write_to_disk-Add-an-info-messag.patch similarity index 87% rename from 0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch rename to 0040-util-grub-install.c-write_to_disk-Add-an-info-messag.patch index 9f76928..e285852 100644 --- a/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch +++ b/0040-util-grub-install.c-write_to_disk-Add-an-info-messag.patch @@ -1,7 +1,7 @@ -From 100e7015f7dcf2cee0c4ddbbd7498a67bac695d0 Mon Sep 17 00:00:00 2001 +From d08059309f83388312b7f3e533f4b70d803f7bda Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 23 Jan 2014 12:05:36 +0000 -Subject: [PATCH 041/152] * util/grub-install.c (write_to_disk): Add an info +Subject: [PATCH 040/506] * util/grub-install.c (write_to_disk): Add an info message. --- @@ -34,5 +34,5 @@ index 5903f34..787dc90 100644 core_size, core_img); free (core_img); -- -1.9.3 +2.4.3 diff --git a/0042-util-grub-install.c-List-available-targets.patch b/0041-util-grub-install.c-List-available-targets.patch similarity index 96% rename from 0042-util-grub-install.c-List-available-targets.patch rename to 0041-util-grub-install.c-List-available-targets.patch index 87fe952..574213a 100644 --- a/0042-util-grub-install.c-List-available-targets.patch +++ b/0041-util-grub-install.c-List-available-targets.patch @@ -1,7 +1,7 @@ -From d25ddbcafa537525f606938df0e500c50a5e93e1 Mon Sep 17 00:00:00 2001 +From 95cd131ea0085ce16a4f2bfabc22d83548fc85cf Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 24 Jan 2014 18:09:25 +0100 -Subject: [PATCH 042/152] * util/grub-install.c: List available targets. +Subject: [PATCH 041/506] * util/grub-install.c: List available targets. --- ChangeLog | 4 ++++ @@ -105,5 +105,5 @@ index 787dc90..2e6226a 100644 return xasprintf (text, program_name, GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME); default: -- -1.9.3 +2.4.3 diff --git a/0043-Fix-several-translatable-strings.patch b/0042-Fix-several-translatable-strings.patch similarity index 96% rename from 0043-Fix-several-translatable-strings.patch rename to 0042-Fix-several-translatable-strings.patch index 7becc47..1226bba 100644 --- a/0043-Fix-several-translatable-strings.patch +++ b/0042-Fix-several-translatable-strings.patch @@ -1,7 +1,7 @@ -From 2cd73ec6b2efeaff2bdcd40cce0cd3145d9e07d0 Mon Sep 17 00:00:00 2001 +From 61c8482b2097dfc08d76c36a1087bc3d243f4db1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 24 Jan 2014 18:20:27 +0100 -Subject: [PATCH 043/152] Fix several translatable strings. +Subject: [PATCH 042/506] Fix several translatable strings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -74,5 +74,5 @@ index 5e944c2..f4fda6d 100644 {"output", 'o', N_("FILE"), 0, N_("write output to FILE [default=stdout]."), 0}, {"isolinux", 'i', 0, 0, N_("assume input is an isolinux configuration file."), 0}, -- -1.9.3 +2.4.3 diff --git a/0044-do-not-set-default-prefix-in-grub-mkimage.patch b/0043-do-not-set-default-prefix-in-grub-mkimage.patch similarity index 94% rename from 0044-do-not-set-default-prefix-in-grub-mkimage.patch rename to 0043-do-not-set-default-prefix-in-grub-mkimage.patch index 8e0a1c6..54082ec 100644 --- a/0044-do-not-set-default-prefix-in-grub-mkimage.patch +++ b/0043-do-not-set-default-prefix-in-grub-mkimage.patch @@ -1,7 +1,7 @@ -From 2b2a550c14e70d17af4140e64d08022ed170f0c8 Mon Sep 17 00:00:00 2001 +From 1440b7ebae47e1cb710e920bec9d88c4d75ff432 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 25 Jan 2014 19:54:51 +0400 -Subject: [PATCH 044/152] do not set default prefix in grub-mkimage +Subject: [PATCH 043/506] do not set default prefix in grub-mkimage Default prefix is likely wrong on Unix and completely wrong on Windows. Let caller set it explicitly to avoid any ambiguity. @@ -71,5 +71,5 @@ index a2bd4c1..1e0bcf1 100644 arguments.memdisk, arguments.pubkeys, arguments.npubkeys, arguments.config, -- -1.9.3 +2.4.3 diff --git a/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch b/0044-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch similarity index 97% rename from 0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch rename to 0044-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch index b53e03c..1949eee 100644 --- a/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch +++ b/0044-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch @@ -1,7 +1,7 @@ -From 90efd351fa4f81df97473e1bb8c8234a801f8ebe Mon Sep 17 00:00:00 2001 +From 5ae584c0b0c64b445c0820037d74058595133af3 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 25 Jan 2014 21:49:41 +0400 -Subject: [PATCH 045/152] fix Mingw W64-32 cross compile failure due to printf +Subject: [PATCH 044/506] fix Mingw W64-32 cross compile failure due to printf redefinition in libintl.h In file included from util/misc.c:36:0: @@ -104,5 +104,5 @@ index 63ebb90..2b3322d 100644 f.close () fw.close () -- -1.9.3 +2.4.3 diff --git a/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch b/0045-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch similarity index 92% rename from 0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch rename to 0045-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch index eecd076..dc63b40 100644 --- a/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch +++ b/0045-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch @@ -1,7 +1,7 @@ -From c18e39b667adb11624f3f4162c1342b76712d655 Mon Sep 17 00:00:00 2001 +From 9afe2053c9b37820888bd5e77acd35c0eacf6699 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 26 Jan 2014 02:36:05 +0100 -Subject: [PATCH 046/152] * grub-core/term/serial.c +Subject: [PATCH 045/506] * grub-core/term/serial.c (grub_serial_register): Fix invalid free. Ensure that pointers are inited to NULL and that pointers are not accessed after free. @@ -56,5 +56,5 @@ index b581a76..c9b5574 100644 } -- -1.9.3 +2.4.3 diff --git a/0047-grub-install-support-for-partitioned-partx-loop-devi.patch b/0046-grub-install-support-for-partitioned-partx-loop-devi.patch similarity index 91% rename from 0047-grub-install-support-for-partitioned-partx-loop-devi.patch rename to 0046-grub-install-support-for-partitioned-partx-loop-devi.patch index a530b8c..66927cb 100644 --- a/0047-grub-install-support-for-partitioned-partx-loop-devi.patch +++ b/0046-grub-install-support-for-partitioned-partx-loop-devi.patch @@ -1,7 +1,7 @@ -From c889057e089d69bd187c8ba134c9669247744628 Mon Sep 17 00:00:00 2001 +From 35f2d96c0d68772c831952b2ee4eba6519d6ea1b Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sun, 26 Jan 2014 02:56:04 +0100 -Subject: [PATCH 047/152] grub-install: support for partitioned partx +Subject: [PATCH 046/506] grub-install: support for partitioned partx loop devices. * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect @@ -51,5 +51,5 @@ index 772de0a..19581d3 100644 return path; -- -1.9.3 +2.4.3 diff --git a/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch b/0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch similarity index 88% rename from 0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch rename to 0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch index c086429..d50f2f0 100644 --- a/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch +++ b/0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch @@ -1,7 +1,7 @@ -From 379cbd6233fe227544ff3073b60b295fe841b654 Mon Sep 17 00:00:00 2001 +From 7f64fb590cd80517e1381693a16d7cf2486fa808 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 26 Jan 2014 03:31:10 +0100 -Subject: [PATCH 048/152] * grub-core/term/at_keyboard.c: Tolerate +Subject: [PATCH 047/506] * grub-core/term/at_keyboard.c: Tolerate missing keyboard. --- @@ -36,5 +36,5 @@ index f5071ce..b4257e8 100644 { e0_received = 1; -- -1.9.3 +2.4.3 diff --git a/0049-.gitignore-add-missing-files-and-.exe-variants.patch b/0048-.gitignore-add-missing-files-and-.exe-variants.patch similarity index 83% rename from 0049-.gitignore-add-missing-files-and-.exe-variants.patch rename to 0048-.gitignore-add-missing-files-and-.exe-variants.patch index f592363..146b9d4 100644 --- a/0049-.gitignore-add-missing-files-and-.exe-variants.patch +++ b/0048-.gitignore-add-missing-files-and-.exe-variants.patch @@ -1,7 +1,7 @@ -From 58ca3abc65a64d950d6da8b473e91f16d410f1ac Mon Sep 17 00:00:00 2001 +From ba584da163bc4dc2a36988ae327733ba10251143 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 29 Jan 2014 13:26:00 -0200 -Subject: [PATCH 049/152] .gitignore: add missing files and .exe variants. +Subject: [PATCH 048/506] .gitignore: add missing files and .exe variants. --- .gitignore | 7 +++++++ @@ -48,7 +48,7 @@ index 2b0156a..18ab8e8 100644 grub-core/gnulib/alloca.h grub-core/gnulib/arg-nonnull.h diff --git a/ChangeLog b/ChangeLog -index d37d4a6..a49f5f1 100644 +index bbec1e7..b996df8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -56,10 +56,10 @@ index d37d4a6..a49f5f1 100644 + + * .gitignore: add missing files and .exe variants. + - 2014-01-26 Vladimir Serbinenko + 2014-01-26 Mike Gilbert - * grub-core/term/at_keyboard.c: Tolerate missing keyboard. -@@ -1113,7 +1117,7 @@ + grub-install: support for partitioned partx loop devices. +@@ -1109,7 +1113,7 @@ 2013-12-14 Vladimir Serbinenko @@ -69,5 +69,5 @@ index d37d4a6..a49f5f1 100644 2013-12-14 Vladimir Serbinenko -- -1.9.3 +2.4.3 diff --git a/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch b/0049-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch similarity index 83% rename from 0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch rename to 0049-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch index 3b56b73..c255ef7 100644 --- a/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch +++ b/0049-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch @@ -1,31 +1,29 @@ -From f21c40f33c95d908cee32a5063f285d22574a507 Mon Sep 17 00:00:00 2001 +From ba424f37a95cf3f9c9995e051383424e328d13f6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:41:48 +0100 -Subject: [PATCH 050/152] * util/grub-mkfont.c: Downgrade warnings about +Subject: [PATCH 049/506] * util/grub-mkfont.c: Downgrade warnings about unhandled features to debug. --- - ChangeLog | 9 +++++++++ + ChangeLog | 5 +++++ util/grub-mkfont.c | 14 ++++++++------ - 2 files changed, 17 insertions(+), 6 deletions(-) + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog -index a49f5f1..9837c7f 100644 +index 5692a5b..ce0ea89 100644 --- a/ChangeLog +++ b/ChangeLog -@@ -1,3 +1,12 @@ -+2014-01-29 Vladimir Serbinenko -+ +@@ -1,5 +1,10 @@ + 2014-01-29 Vladimir Serbinenko + + * util/grub-mkfont.c: Downgrade warnings about unhandled features + to debug. + +2014-01-29 Vladimir Serbinenko + -+ * grub-core/term/at_keyboard.c: Tolerate missing keyboard. -+ - 2014-01-29 Paulo Flabiano Smorigo + * grub-core/term/at_keyboard.c: Tolerate missing keyboard. - * .gitignore: add missing files and .exe variants. + 2014-01-29 Paulo Flabiano Smorigo diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c index 3cb02ad..3de07ee 100644 --- a/util/grub-mkfont.c @@ -73,5 +71,5 @@ index 3cb02ad..3de07ee 100644 } } -- -1.9.3 +2.4.3 diff --git a/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch b/0050-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch similarity index 91% rename from 0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch rename to 0050-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch index 07315a8..c6d72cf 100644 --- a/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch +++ b/0050-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch @@ -1,7 +1,7 @@ -From 5795341bb64a4e101d7c067d688b19a41dd50662 Mon Sep 17 00:00:00 2001 +From 4686e163f278ae7cfaab3bebbde215f5688c7e3f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:43:25 +0100 -Subject: [PATCH 051/152] * grub-core/disk/ahci.c: Do not enable I/O +Subject: [PATCH 050/506] * grub-core/disk/ahci.c: Do not enable I/O decoding and keep enabling busmaster for the end. --- @@ -10,7 +10,7 @@ Subject: [PATCH 051/152] * grub-core/disk/ahci.c: Do not enable I/O 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 9837c7f..51eba95 100644 +index ce0ea89..8c37450 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -53,5 +53,5 @@ index 0b13fb8..18c1327 100644 if (adevs[i]) { -- -1.9.3 +2.4.3 diff --git a/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch b/0051-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch similarity index 91% rename from 0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch rename to 0051-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch index 62dc26f..cfc23d8 100644 --- a/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch +++ b/0051-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch @@ -1,7 +1,7 @@ -From 50cb0018044359180aa57e6aa7ec944def83bbcc Mon Sep 17 00:00:00 2001 +From 3142b2feacc45ae42f4d3e6891d233727da4c3e1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:45:18 +0100 -Subject: [PATCH 052/152] * grub-core/disk/ahci.c: Allocate and clean +Subject: [PATCH 051/506] * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 slots to avoid pointing to uninited area. --- @@ -10,7 +10,7 @@ Subject: [PATCH 052/152] * grub-core/disk/ahci.c: Allocate and clean 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 51eba95..9bb1817 100644 +index 8c37450..b2b54b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -51,5 +51,5 @@ index 18c1327..d63fd09 100644 = grub_dma_get_phys (adevs[i]->command_table_chunk); -- -1.9.3 +2.4.3 diff --git a/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch b/0052-grub-core-disk-ahci.c-Add-safety-cleanups.patch similarity index 92% rename from 0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch rename to 0052-grub-core-disk-ahci.c-Add-safety-cleanups.patch index 6f8d8ca..2215113 100644 --- a/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch +++ b/0052-grub-core-disk-ahci.c-Add-safety-cleanups.patch @@ -1,7 +1,7 @@ -From 3f00de9c207fb4b3f9e45fd775650404ce087aac Mon Sep 17 00:00:00 2001 +From 07ea8daa8606160a18778af9a806d61b884d8d73 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:46:17 +0100 -Subject: [PATCH 053/152] * grub-core/disk/ahci.c: Add safety cleanups. +Subject: [PATCH 052/506] * grub-core/disk/ahci.c: Add safety cleanups. --- ChangeLog | 4 ++++ @@ -9,7 +9,7 @@ Subject: [PATCH 053/152] * grub-core/disk/ahci.c: Add safety cleanups. 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog -index 9bb1817..15300b0 100644 +index b2b54b9..148607f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ @@ -58,5 +58,5 @@ index d63fd09..643e691 100644 while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) if (grub_get_time_ms () > endtime) -- -1.9.3 +2.4.3 diff --git a/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch b/0053-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch similarity index 91% rename from 0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch rename to 0053-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch index dceb20e..a26d8fb 100644 --- a/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch +++ b/0053-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch @@ -1,7 +1,7 @@ -From 5e8c619b17cdf70b30d37412738b149d80874c28 Mon Sep 17 00:00:00 2001 +From d6b94c5eb2a968ebb64f7937d244a267d56f10ab Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:49:51 +0100 -Subject: [PATCH 054/152] * grub-core/disk/ahci.c: Properly handle +Subject: [PATCH 053/506] * grub-core/disk/ahci.c: Properly handle transactions with no transferred data. --- @@ -10,7 +10,7 @@ Subject: [PATCH 054/152] * grub-core/disk/ahci.c: Properly handle 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 15300b0..bc1ab23 100644 +index 148607f..1cd2b39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -50,5 +50,5 @@ index 643e691..fdd40c6 100644 | (parms->write ? GRUB_AHCI_CONFIG_WRITE : GRUB_AHCI_CONFIG_READ) | (parms->taskfile.cmd == 8 ? (1 << 8) : 0); -- -1.9.3 +2.4.3 diff --git a/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch b/0054-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch similarity index 88% rename from 0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch rename to 0054-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch index 843513e..da91e6f 100644 --- a/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch +++ b/0054-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch @@ -1,7 +1,7 @@ -From 45dd39fb467d061a550113fd5e5431209f0db73c Mon Sep 17 00:00:00 2001 +From 9abbaae7cdc5ffba6065c089c9ebb076864d9bbd Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:50:49 +0100 -Subject: [PATCH 055/152] * grub-core/disk/ahci.c: Increase timeout. +Subject: [PATCH 054/506] * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to 7 seconds to recover if last poweroff was bad. --- @@ -10,7 +10,7 @@ Subject: [PATCH 055/152] * grub-core/disk/ahci.c: Increase timeout. 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index bc1ab23..1a822f3 100644 +index 1cd2b39..cfa9c83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -38,5 +38,5 @@ index fdd40c6..5e4a639 100644 if (grub_get_time_ms () > endtime) { -- -1.9.3 +2.4.3 diff --git a/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch b/0055-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch similarity index 85% rename from 0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch rename to 0055-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch index 4fc8f1b..0bb4ac6 100644 --- a/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch +++ b/0055-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch @@ -1,7 +1,7 @@ -From 767cf43a2e5c738df50155cc8729ad0f57d6ab47 Mon Sep 17 00:00:00 2001 +From 511ece7cebe261bcdd4a1d3f50ed9c05a234bcc6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 3 Feb 2014 14:34:27 +0100 -Subject: [PATCH 056/152] * util/grub-mkfont.c: Build fix for argp.h +Subject: [PATCH 055/506] * util/grub-mkfont.c: Build fix for argp.h with older gcc. --- @@ -10,7 +10,7 @@ Subject: [PATCH 056/152] * util/grub-mkfont.c: Build fix for argp.h 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog -index 1a822f3..f2bba84 100644 +index cfa9c83..7891088 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -38,5 +38,5 @@ index 3de07ee..e6485b4 100644 #include -- -1.9.3 +2.4.3 diff --git a/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch b/0056-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch similarity index 87% rename from 0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch rename to 0056-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch index 59a32cf..eb38952 100644 --- a/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch +++ b/0056-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch @@ -1,7 +1,7 @@ -From 3365d3eb4062cee9581f3560ec3e93f8c8ababb2 Mon Sep 17 00:00:00 2001 +From 006c78f378629e83db718ce6e3f83d2f2c68ce7e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 3 Feb 2014 14:35:51 +0100 -Subject: [PATCH 057/152] * util/grub-mkrescue.c: Build fix for argp.h +Subject: [PATCH 056/506] * util/grub-mkrescue.c: Build fix for argp.h with older gcc. --- @@ -10,7 +10,7 @@ Subject: [PATCH 057/152] * util/grub-mkrescue.c: Build fix for argp.h 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog -index f2bba84..f4a4721 100644 +index 7891088..eb72cc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ @@ -40,5 +40,5 @@ index 34e0b7a..e719839 100644 #include #include -- -1.9.3 +2.4.3 diff --git a/0058-add-grub_env_set_net_property-function.patch b/0057-add-grub_env_set_net_property-function.patch similarity index 97% rename from 0058-add-grub_env_set_net_property-function.patch rename to 0057-add-grub_env_set_net_property-function.patch index 7256e06..d4229cc 100644 --- a/0058-add-grub_env_set_net_property-function.patch +++ b/0057-add-grub_env_set_net_property-function.patch @@ -1,7 +1,7 @@ -From 533058df7c164a4d3498dfaa626923904597f162 Mon Sep 17 00:00:00 2001 +From e4dbf247b656eb9577020af653ff37159fc340f2 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 4 Feb 2014 18:41:38 -0200 -Subject: [PATCH 058/152] add grub_env_set_net_property function +Subject: [PATCH 057/506] add grub_env_set_net_property function * grub-core/net/bootp.c: Remove set_env_limn_ro. * grub-core/net/net.c: Add grub_env_set_net_property. @@ -14,7 +14,7 @@ Subject: [PATCH 058/152] add grub_env_set_net_property function 4 files changed, 66 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog -index f4a4721..63f5aa3 100644 +index eb72cc3..5af5748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ @@ -195,5 +195,5 @@ index 0e0a605..538baa3 100644 grub_net_poll_cards (unsigned time, int *stop_condition); -- -1.9.3 +2.4.3 diff --git a/0059-add-bootpath-parser-for-open-firmware.patch b/0058-add-bootpath-parser-for-open-firmware.patch similarity index 97% rename from 0059-add-bootpath-parser-for-open-firmware.patch rename to 0058-add-bootpath-parser-for-open-firmware.patch index a4af3b6..67d67c4 100644 --- a/0059-add-bootpath-parser-for-open-firmware.patch +++ b/0058-add-bootpath-parser-for-open-firmware.patch @@ -1,7 +1,7 @@ -From 1a768cc5a65094e19c216caf92dd190317df25fc Mon Sep 17 00:00:00 2001 +From 9585647a25b65f98db6bd22c569b34795512f046 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 4 Feb 2014 19:00:55 -0200 -Subject: [PATCH 059/152] add bootpath parser for open firmware +Subject: [PATCH 058/506] add bootpath parser for open firmware It enables net boot even when there is no bootp/dhcp server. @@ -17,7 +17,7 @@ call it at grub_ieee1275_net_config_real. 4 files changed, 125 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 63f5aa3..5237631 100644 +index 5af5748..07caf46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ @@ -207,5 +207,5 @@ index dc54bea..8e42513 100644 /* Maps a device alias to a pathname. */ extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen); -- -1.9.3 +2.4.3 diff --git a/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch b/0059-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch similarity index 86% rename from 0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch rename to 0059-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch index c03e1d1..c484877 100644 --- a/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch +++ b/0059-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch @@ -1,7 +1,7 @@ -From 7f4e3839c9b872f0981e1ecdecfa2bd91065f99c Mon Sep 17 00:00:00 2001 +From d0949e374731e3f36c279774cd08fadd6553dcee Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 20 Feb 2014 10:11:43 +0100 -Subject: [PATCH 060/152] * grub-core/disk/ahci.c: Ignore NPORTS field +Subject: [PATCH 059/506] * grub-core/disk/ahci.c: Ignore NPORTS field and rely on PI exclusively. --- @@ -10,7 +10,7 @@ Subject: [PATCH 060/152] * grub-core/disk/ahci.c: Ignore NPORTS field 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 5237631..be41aa5 100644 +index 07caf46..aec689d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -36,5 +36,5 @@ index 5e4a639..89365cd 100644 grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, hba->ports_implemented); -- -1.9.3 +2.4.3 diff --git a/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch b/0060-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch similarity index 94% rename from 0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch rename to 0060-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch index f8c2180..6d80872 100644 --- a/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch +++ b/0060-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch @@ -1,7 +1,7 @@ -From c65d7e05498edecd560753768114b574f7c3543d Mon Sep 17 00:00:00 2001 +From f94b2b4eeb5ec804671d5a0efa4ce779c179b68f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:47:57 +0100 -Subject: [PATCH 061/152] * grub-core/kern/i386/coreboot/mmap.c: Filter +Subject: [PATCH 060/506] * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 region. --- @@ -10,7 +10,7 @@ Subject: [PATCH 061/152] * grub-core/kern/i386/coreboot/mmap.c: Filter 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog -index be41aa5..4f6f6d6 100644 +index aec689d..c2983f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -78,5 +78,5 @@ index 1197975..4d29f6b 100644 return 0; -- -1.9.3 +2.4.3 diff --git a/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch b/0061-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch similarity index 88% rename from 0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch rename to 0061-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch index 74d7442..f0c15c6 100644 --- a/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch +++ b/0061-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch @@ -1,7 +1,7 @@ -From 4530afc725782bbb92d4681fc338acebc4604b45 Mon Sep 17 00:00:00 2001 +From 4a70fed815c12090c772ed911363520d0f02cf36 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:48:57 +0100 -Subject: [PATCH 062/152] * grub-core/loader/i386/multiboot_mbi.c +Subject: [PATCH 061/506] * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit location to 640K. --- @@ -10,7 +10,7 @@ Subject: [PATCH 062/152] * grub-core/loader/i386/multiboot_mbi.c 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 4f6f6d6..bbaed26 100644 +index c2983f2..feea178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -38,5 +38,5 @@ index 7431aa4..f10c087 100644 GRUB_RELOCATOR_PREFERENCE_NONE, 0); if (err) -- -1.9.3 +2.4.3 diff --git a/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch b/0062-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch similarity index 87% rename from 0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch rename to 0062-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch index cb3de42..e41c1a8 100644 --- a/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch +++ b/0062-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch @@ -1,7 +1,7 @@ -From e85cc7078e669509d3a22c4e76f94cdd53335fff Mon Sep 17 00:00:00 2001 +From dfc5ccfa97e15c8c83c98594570e4e07b3630877 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:50:47 +0100 -Subject: [PATCH 063/152] * grub-core/mmap/i386/uppermem.c (lower_hook) +Subject: [PATCH 062/506] * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low tables for low memory calculations. --- @@ -10,7 +10,7 @@ Subject: [PATCH 063/152] * grub-core/mmap/i386/uppermem.c (lower_hook) 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index bbaed26..6ed6cf4 100644 +index feea178..5edbf67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -43,5 +43,5 @@ index bd8b429..a6be989 100644 } -- -1.9.3 +2.4.3 diff --git a/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch b/0063-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch similarity index 93% rename from 0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch rename to 0063-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch index b0a6310..6dee9a6 100644 --- a/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch +++ b/0063-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch @@ -1,7 +1,7 @@ -From 37e3b5e42930e8cd4e801e4203dc2fde335b4b10 Mon Sep 17 00:00:00 2001 +From bec35dad2a86b2412e9ce11d09f47f1d01ccc616 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 10:07:11 +0100 -Subject: [PATCH 064/152] * grub-core/kern/i386/pc/mmap.c: Fallback to +Subject: [PATCH 063/506] * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map if E820 failed to return any regions. --- @@ -10,7 +10,7 @@ Subject: [PATCH 064/152] * grub-core/kern/i386/pc/mmap.c: Fallback to 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 6ed6cf4..97cf57e 100644 +index 5edbf67..2e98f39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -84,5 +84,5 @@ index 8009e83..f1375f3 100644 grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); -- -1.9.3 +2.4.3 diff --git a/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch b/0064-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch similarity index 93% rename from 0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch rename to 0064-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch index 6fcca74..b5e86a2 100644 --- a/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch +++ b/0064-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch @@ -1,7 +1,7 @@ -From 1cdf2c717c0f4a2efac0e5dc8b5c564f930c537a Mon Sep 17 00:00:00 2001 +From 86402b4e0fec7d0e5637f70a3103a4d9c3f62839 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 10:50:05 +0100 -Subject: [PATCH 065/152] * include/grub/i386/openbsd_bootarg.h: Add +Subject: [PATCH 064/506] * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr field. MIME-Version: 1.0 @@ -16,7 +16,7 @@ Content-Transfer-Encoding: 8bit 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog -index 97cf57e..f571f66 100644 +index 2e98f39..770269c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ @@ -66,5 +66,5 @@ index 01ca486..9ebe6b4 100644 struct grub_openbsd_bootarg_pcibios -- -1.9.3 +2.4.3 diff --git a/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch b/0065-ieee1275-check-for-IBM-pseries-emulated-machine.patch similarity index 88% rename from 0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch rename to 0065-ieee1275-check-for-IBM-pseries-emulated-machine.patch index 127c56b..17ae58b 100644 --- a/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch +++ b/0065-ieee1275-check-for-IBM-pseries-emulated-machine.patch @@ -1,7 +1,7 @@ -From 2a20b05871d51635060ab58c1b63ac2ee9f8a359 Mon Sep 17 00:00:00 2001 +From e4a1fe391906bfcd1a778c5ec4e242c4b07d429d Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Thu, 20 Mar 2014 16:57:12 +0530 -Subject: [PATCH 066/152] ieee1275: check for IBM pseries emulated machine +Subject: [PATCH 065/506] ieee1275: check for IBM pseries emulated machine is_qemu is not being set lead to disabling of feature like GRUB_IEEE1275_FLAG_HAS_CURSORONOFF. This resulted in cursor not being @@ -29,5 +29,5 @@ index d92ae14..3e12e6b 100644 if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0) grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); -- -1.9.3 +2.4.3 diff --git a/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch b/0066-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch similarity index 86% rename from 0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch rename to 0066-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch index 183c570..16493ad 100644 --- a/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch +++ b/0066-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch @@ -1,7 +1,7 @@ -From 530b22a1c04a08fbdb4dcbc3d34bc610af17cc68 Mon Sep 17 00:00:00 2001 +From 68f17b2b300e4eaf9852c23d0b652d6e210ac180 Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Wed, 26 Mar 2014 08:13:07 +0100 -Subject: [PATCH 067/152] * grub-core/loader/arm64/linux.c: Remove +Subject: [PATCH 066/506] * grub-core/loader/arm64/linux.c: Remove redundant "0x". --- @@ -10,7 +10,7 @@ Subject: [PATCH 067/152] * grub-core/loader/arm64/linux.c: Remove 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index f571f66..091535b 100644 +index 770269c..44ce649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -35,5 +35,5 @@ index 65129c2..f1d10a1 100644 } -- -1.9.3 +2.4.3 diff --git a/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch b/0067-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch similarity index 87% rename from 0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch rename to 0067-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch index aaab022..c820a0a 100644 --- a/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch +++ b/0067-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch @@ -1,7 +1,7 @@ -From 5d1749ea5730be5c9c32228461b784317a500f4b Mon Sep 17 00:00:00 2001 +From 46b74dd3cbb3a97a7abeb7f0464de548006e0e3d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 26 Mar 2014 08:48:30 +0100 -Subject: [PATCH 068/152] * grub-core/lib/relocator.c: Fix the case when +Subject: [PATCH 067/506] * grub-core/lib/relocator.c: Fix the case when end of leftover is used. --- @@ -10,7 +10,7 @@ Subject: [PATCH 068/152] * grub-core/lib/relocator.c: Fix the case when 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog -index 091535b..9404eda 100644 +index 44ce649..b3f077a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -35,5 +35,5 @@ index 9f9770b..cb11ea5 100644 &= ((1 << (8 - (start % 8))) - 1); grub_memset (lo->freebytes + (offstart + 7) / 8, 0, -- -1.9.3 +2.4.3 diff --git a/0069-Fix-grub-probe-0-option.patch b/0068-Fix-grub-probe-0-option.patch similarity index 91% rename from 0069-Fix-grub-probe-0-option.patch rename to 0068-Fix-grub-probe-0-option.patch index a18d82c..aa9839f 100644 --- a/0069-Fix-grub-probe-0-option.patch +++ b/0068-Fix-grub-probe-0-option.patch @@ -1,7 +1,7 @@ -From fdf24f98bc9e4632bfe7f280872cbbf40942ae7b Mon Sep 17 00:00:00 2001 +From 9b35fe819f642f9277534d97f73024eb6734057d Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 31 Mar 2014 13:51:17 +0100 -Subject: [PATCH 069/152] Fix grub-probe -0 option +Subject: [PATCH 068/506] Fix grub-probe -0 option * util/grub-probe,c (options): Make -0 work again (broken by conversion to argp). @@ -12,7 +12,7 @@ conversion to argp). 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 9404eda..efbed8c 100644 +index b3f077a..46a6561 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ @@ -51,5 +51,5 @@ index 1f3b59f..80509be 100644 /* Free resources. */ -- -1.9.3 +2.4.3 diff --git a/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch b/0069-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch similarity index 98% rename from 0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch rename to 0069-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch index 795da7e..9a8cfc6 100644 --- a/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch +++ b/0069-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch @@ -1,7 +1,7 @@ -From 0a65563c2b355c0eb7412b46f015556691f1b5d1 Mon Sep 17 00:00:00 2001 +From 24024dac7f51d3c0df8e1bec63c02d52828de534 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 31 Mar 2014 14:48:33 +0100 -Subject: [PATCH 070/152] Fix partmap, cryptodisk, and abstraction handling in +Subject: [PATCH 069/506] Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig @@ -35,7 +35,7 @@ probe_abstraction): Use configured delimiter. Update callers. 7 files changed, 74 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog -index efbed8c..1cb3b68 100644 +index 46a6561..d613bf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,30 @@ @@ -362,5 +362,5 @@ index 80509be..ecb7b6b 100644 continue; } -- -1.9.3 +2.4.3 diff --git a/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch b/0070-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch similarity index 88% rename from 0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch rename to 0070-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch index 12d71f0..4580676 100644 --- a/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch +++ b/0070-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch @@ -1,7 +1,7 @@ -From bd2125649cbeae60a5caff05d5a39c88a4e6eff6 Mon Sep 17 00:00:00 2001 +From 4afd0107efa6a2d9cbe6fc71c529264dc2b9fb8a Mon Sep 17 00:00:00 2001 From: Thomas Falcon Date: Mon, 31 Mar 2014 15:32:30 +0100 -Subject: [PATCH 071/152] btrfs: fix get_root key comparison failures due to +Subject: [PATCH 070/506] btrfs: fix get_root key comparison failures due to endianness * grub-core/fs/btrfs.c (get_root): Convert @@ -12,7 +12,7 @@ GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian. 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 1cb3b68..accffad 100644 +index d613bf6..6eca73e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ @@ -40,5 +40,5 @@ index 89666b6..f7b6c15 100644 key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM; err = lower_bound (data, &key_in, &key_out, -- -1.9.3 +2.4.3 diff --git a/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch b/0071-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch similarity index 89% rename from 0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch rename to 0071-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch index 86e5abd..6cddc1c 100644 --- a/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch +++ b/0071-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch @@ -1,7 +1,7 @@ -From c3d9e64a61d17e57ef941a6a46e5a148c51c8519 Mon Sep 17 00:00:00 2001 +From 9706066791b994a55fb2d3d532a86aa1fde2a457 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 3 Apr 2014 21:31:12 +0200 -Subject: [PATCH 072/152] * grub-core/osdep/linux/getroot.c +Subject: [PATCH 071/506] * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe device names. --- @@ -10,7 +10,7 @@ Subject: [PATCH 072/152] * grub-core/osdep/linux/getroot.c 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog -index accffad..4a48409 100644 +index 6eca73e..20a3661 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -51,5 +51,5 @@ index 19581d3..7007193 100644 return path; -- -1.9.3 +2.4.3 diff --git a/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch b/0072-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch similarity index 95% rename from 0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch rename to 0072-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch index 34271a4..9d133e8 100644 --- a/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch +++ b/0072-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch @@ -1,7 +1,7 @@ -From cb2cfc87fad111a539e9645f6a96d0a89a28c8ab Mon Sep 17 00:00:00 2001 +From 8063ce197f3196da077c667ba7a6a82173608fbb Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 07:58:42 +0200 -Subject: [PATCH 073/152] Replace few instances of memcmp/memcpy in the code +Subject: [PATCH 072/506] Replace few instances of memcmp/memcpy in the code that should be grub_memcmp/grub_memcpy. --- @@ -13,7 +13,7 @@ Subject: [PATCH 073/152] Replace few instances of memcmp/memcpy in the code 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 4a48409..f18cdba 100644 +index 20a3661..f633fae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -98,5 +98,5 @@ index 19985f0..41ef910 100644 else { -- -1.9.3 +2.4.3 diff --git a/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch b/0073-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch similarity index 87% rename from 0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch rename to 0073-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch index b8f821e..8349ec3 100644 --- a/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch +++ b/0073-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch @@ -1,7 +1,7 @@ -From 91152c6e2944e9ad3583482140f8991b972fec08 Mon Sep 17 00:00:00 2001 +From 6f6d4aa02cbc522fadbc8dc42a43dedfca40da0d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 08:02:38 +0200 -Subject: [PATCH 074/152] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. +Subject: [PATCH 073/506] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer pulled from libgcc. --- @@ -10,7 +10,7 @@ Subject: [PATCH 074/152] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog -index f18cdba..90e41bd 100644 +index f633fae..094fbca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -43,5 +43,5 @@ index fdc6611..97233d7 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); -- -1.9.3 +2.4.3 diff --git a/0075-Add-missing-endif.patch b/0074-Add-missing-endif.patch similarity index 81% rename from 0075-Add-missing-endif.patch rename to 0074-Add-missing-endif.patch index 84b1629..a2e1416 100644 --- a/0075-Add-missing-endif.patch +++ b/0074-Add-missing-endif.patch @@ -1,7 +1,7 @@ -From fb1b02802aa368f43c8d0a871e017c14cb39b180 Mon Sep 17 00:00:00 2001 +From 2009da62f2fa19634c4485edaccf9c88ab98b276 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 08:11:15 +0200 -Subject: [PATCH 075/152] Add missing #endif +Subject: [PATCH 074/506] Add missing #endif --- include/grub/libgcc.h | 1 + @@ -20,5 +20,5 @@ index 97233d7..8e93b67 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); -- -1.9.3 +2.4.3 diff --git a/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch b/0075-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch similarity index 86% rename from 0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch rename to 0075-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch index 6a8431a..a4cb9de 100644 --- a/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch +++ b/0075-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch @@ -1,7 +1,7 @@ -From fb62186fefaca6b302eb61081bb6281042ff7283 Mon Sep 17 00:00:00 2001 +From a72fc329ebd81c03d7a2e6ad422e573e5a4d3213 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 6 Apr 2014 00:44:44 +0200 -Subject: [PATCH 076/152] * grub-core/lib/syslinux_parse.c: Fix timeout +Subject: [PATCH 075/506] * grub-core/lib/syslinux_parse.c: Fix timeout quoting. --- @@ -10,7 +10,7 @@ Subject: [PATCH 076/152] * grub-core/lib/syslinux_parse.c: Fix timeout 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 90e41bd..50d9291 100644 +index 094fbca..11de908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -35,5 +35,5 @@ index 21fa175..6bc504b 100644 if (err) return err; -- -1.9.3 +2.4.3 diff --git a/0077-Improve-LVM-logical_volumes-string-matching.patch b/0076-Improve-LVM-logical_volumes-string-matching.patch similarity index 87% rename from 0077-Improve-LVM-logical_volumes-string-matching.patch rename to 0076-Improve-LVM-logical_volumes-string-matching.patch index b8723cf..1f5d7f1 100644 --- a/0077-Improve-LVM-logical_volumes-string-matching.patch +++ b/0076-Improve-LVM-logical_volumes-string-matching.patch @@ -1,7 +1,7 @@ -From d576e05a7bfe25413f70b54f671f305397bacf5e Mon Sep 17 00:00:00 2001 +From c4badfe8363cc41dbedfabaa238b6c8a884e03c8 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 10 Apr 2014 14:42:41 +0100 -Subject: [PATCH 077/152] Improve LVM "logical_volumes" string matching +Subject: [PATCH 076/506] Improve LVM "logical_volumes" string matching * grub-core/disk/lvm.c (grub_lvm_detect): Search for "logical_volumes" block a little more accurately. @@ -11,7 +11,7 @@ Subject: [PATCH 077/152] Improve LVM "logical_volumes" string matching 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 50d9291..7f0c57d 100644 +index 11de908..c98e0df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -41,5 +41,5 @@ index 483c17e..862a966 100644 /* And add all the lvs to the volume group. */ while (1) -- -1.9.3 +2.4.3 diff --git a/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch b/0077-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch similarity index 94% rename from 0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch rename to 0077-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch index 8badef7..da91cd1 100644 --- a/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch +++ b/0077-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch @@ -1,7 +1,7 @@ -From 0942ce33c5b88d85a6b81f4b3dd75c32fdf21978 Mon Sep 17 00:00:00 2001 +From 3a310e842fb7a9818c2e7cf0f4118f13660871d2 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 10 Apr 2014 16:54:33 +0100 -Subject: [PATCH 078/152] Tolerate devices with no filesystem UUID returned by +Subject: [PATCH 077/506] Tolerate devices with no filesystem UUID returned by os-prober * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem @@ -16,7 +16,7 @@ Fixes Ubuntu bug #1287436. 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 7f0c57d..3556468 100644 +index c98e0df..30d0cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ @@ -79,5 +79,5 @@ index 7cf8487..6f38c82 100644 hurd) onstr="$(gettext_printf "(on %s)" "${DEVICE}")" -- -1.9.3 +2.4.3 diff --git a/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch b/0078-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch similarity index 90% rename from 0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch rename to 0078-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch index e664213..e8b0efe 100644 --- a/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch +++ b/0078-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch @@ -1,7 +1,7 @@ -From 42c1756fd0ff7d94dcc8e9be2e429a2a976f6d41 Mon Sep 17 00:00:00 2001 +From 5a6db38d62235094a903882b71ef2749b4c19cbb Mon Sep 17 00:00:00 2001 From: Piotr Krysiuk Date: Sun, 20 Apr 2014 15:58:45 +0200 -Subject: [PATCH 079/152] Allow loading old kernels by placing GDT in +Subject: [PATCH 078/506] Allow loading old kernels by placing GDT in conventional memory. --- @@ -10,7 +10,7 @@ Subject: [PATCH 079/152] Allow loading old kernels by placing GDT in 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 3556468..73a8928 100644 +index 30d0cac..1be8e5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -45,5 +45,5 @@ index d2a1b27..ffaf25f 100644 if (err) return err; -- -1.9.3 +2.4.3 diff --git a/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch b/0079-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch similarity index 86% rename from 0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch rename to 0079-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch index 584fa1b..a9f26e9 100644 --- a/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch +++ b/0079-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch @@ -1,7 +1,7 @@ -From ec4609b70a7deebf6381297aae95dd4bf05bd008 Mon Sep 17 00:00:00 2001 +From 4b8b9135f1676924a8458da528d264bbc7bbb301 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 20 Apr 2014 16:12:41 +0200 -Subject: [PATCH 080/152] * grub-core/kern/misc.c (__bzero): Don't +Subject: [PATCH 079/506] * grub-core/kern/misc.c (__bzero): Don't compile in GRUB_UTIL. Reported by: Yves Blusseau . @@ -11,7 +11,7 @@ Subject: [PATCH 080/152] * grub-core/kern/misc.c (__bzero): Don't 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog -index 73a8928..3b61c0a 100644 +index 1be8e5e..ba5e205 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ @@ -39,5 +39,5 @@ index 54db2e1..c5c815d 100644 __bzero (void *s, grub_size_t n) { -- -1.9.3 +2.4.3 diff --git a/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch b/0080-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch similarity index 87% rename from 0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch rename to 0080-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch index 2be9e72..af147be 100644 --- a/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch +++ b/0080-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch @@ -1,7 +1,7 @@ -From 4a307e8fe1298f88641a40c8a8008363aa4b9c17 Mon Sep 17 00:00:00 2001 +From 480c89858e58a2360d62fdafbeda3e7080133e9e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 12 May 2014 10:01:48 +0200 -Subject: [PATCH 081/152] * grub-core/commands/verify.c +Subject: [PATCH 080/506] * grub-core/commands/verify.c (grub_pubkey_open): Fix memdisk check. --- @@ -10,7 +10,7 @@ Subject: [PATCH 081/152] * grub-core/commands/verify.c 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index 3b61c0a..d0896d8 100644 +index ba5e205..c32d4c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -36,5 +36,5 @@ index a9dfd88..6349ccf 100644 fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); if (!fsuf) -- -1.9.3 +2.4.3 diff --git a/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch b/0081-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch similarity index 88% rename from 0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch rename to 0081-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch index c50cb1f..9af4537 100644 --- a/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch +++ b/0081-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch @@ -1,7 +1,7 @@ -From 61fdf8bebdeaed4b601f0eca847282780380191f Mon Sep 17 00:00:00 2001 +From 2c2c5c720d79c54af39a5a4423f2d6a48d21bfda Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 15 May 2014 14:36:48 +0200 -Subject: [PATCH 082/152] * grub-core/commands/verify.c +Subject: [PATCH 081/506] * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. --- @@ -10,7 +10,7 @@ Subject: [PATCH 082/152] * grub-core/commands/verify.c 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index d0896d8..2a94ad9 100644 +index c32d4c6..6d2f8c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ @@ -39,5 +39,5 @@ index 6349ccf..525bdd1 100644 fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); if (!fsuf) -- -1.9.3 +2.4.3 diff --git a/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch b/0082-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch similarity index 92% rename from 0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch rename to 0082-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch index 2f6681e..1e773b3 100644 --- a/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch +++ b/0082-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch @@ -1,7 +1,7 @@ -From 473348e663de53939fc077a1e1ef262405712dd8 Mon Sep 17 00:00:00 2001 +From 87de66d9d83446ecddb29cfbdf7369102c8e209e Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Sat, 21 Jun 2014 20:26:47 +0200 -Subject: [PATCH 083/152] * util/grub-gen-asciih.c (add_glyph): Fix +Subject: [PATCH 082/506] * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. --- @@ -10,7 +10,7 @@ Subject: [PATCH 083/152] * util/grub-gen-asciih.c (add_glyph): Fix 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 2a94ad9..b552113 100644 +index 6d2f8c6..8929dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -69,5 +69,5 @@ index e01447a..e35dcb7 100644 if (glyph.width == 8 && glyph.height == 16 -- -1.9.3 +2.4.3 diff --git a/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch b/0083-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch similarity index 89% rename from 0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch rename to 0083-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch index 635ac9b..e491486 100644 --- a/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch +++ b/0083-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch @@ -1,7 +1,7 @@ -From 9de53cc99ce4c8e404e645443d07324bd9cfc157 Mon Sep 17 00:00:00 2001 +From 3f3ec8ef44f484ef581d030b0d8500c8906b673f Mon Sep 17 00:00:00 2001 From: Stephane Rochoy Date: Sun, 22 Jun 2014 01:34:57 +0200 -Subject: [PATCH 084/152] * grub-core/commands/efi/lsefisystab.c +Subject: [PATCH 083/506] * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show EFI system table physical address. --- @@ -10,7 +10,7 @@ Subject: [PATCH 084/152] * grub-core/commands/efi/lsefisystab.c 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog -index b552113..abf8f4b 100644 +index 8929dbb..1dba603 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -35,5 +35,5 @@ index eda8c5f..8717db9 100644 st->hdr.signature, st->hdr.revision); { -- -1.9.3 +2.4.3 diff --git a/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch b/0084-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch similarity index 92% rename from 0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch rename to 0084-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch index 8182d92..adef2b9 100644 --- a/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch +++ b/0084-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch @@ -1,7 +1,7 @@ -From 3be166827cecb977ad47ac4d3d89ec92688307a4 Mon Sep 17 00:00:00 2001 +From 15bd333e10b236fd24d17b2b23065f14d70ce478 Mon Sep 17 00:00:00 2001 From: Stephane Rochoy Date: Sun, 22 Jun 2014 01:35:52 +0200 -Subject: [PATCH 085/152] * grub-core/loader/i386/bsd.c +Subject: [PATCH 084/506] * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to EFI system table. --- @@ -11,7 +11,7 @@ Subject: [PATCH 085/152] * grub-core/loader/i386/bsd.c 3 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog -index abf8f4b..0cdd095 100644 +index 1dba603..ee46a4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ @@ -68,5 +68,5 @@ index e48c19b..9b4f460 100644 + #endif -- -1.9.3 +2.4.3 diff --git a/0086-util-grub-install.c-Fix-handling-of-disk-module.patch b/0085-util-grub-install.c-Fix-handling-of-disk-module.patch similarity index 89% rename from 0086-util-grub-install.c-Fix-handling-of-disk-module.patch rename to 0085-util-grub-install.c-Fix-handling-of-disk-module.patch index 203967d..7ede9e3 100644 --- a/0086-util-grub-install.c-Fix-handling-of-disk-module.patch +++ b/0085-util-grub-install.c-Fix-handling-of-disk-module.patch @@ -1,7 +1,7 @@ -From d45ed8a6bf7c0c0abacb268da1f6d569743f16a0 Mon Sep 17 00:00:00 2001 +From fa33530870839e303354ff2660baeff5356ea736 Mon Sep 17 00:00:00 2001 From: Glenn Washburn Date: Sun, 22 Jun 2014 01:45:11 +0200 -Subject: [PATCH 086/152] * util/grub-install.c: Fix handling of +Subject: [PATCH 085/506] * util/grub-install.c: Fix handling of --disk-module. --- @@ -10,7 +10,7 @@ Subject: [PATCH 086/152] * util/grub-install.c: Fix handling of 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 0cdd095..4ce6643 100644 +index ee46a4d..03eedb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -43,5 +43,5 @@ index e9c6a46..7d61c32 100644 "This option is only available on BIOS target."), 2}, {"no-nvram", OPTION_NO_NVRAM, 0, 0, -- -1.9.3 +2.4.3 diff --git a/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch b/0086-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch similarity index 91% rename from 0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch rename to 0086-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch index 07c5419..4333db9 100644 --- a/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch +++ b/0086-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch @@ -1,8 +1,8 @@ -From a9c472a7eeec6816868dbccce6decaef3b3c62bb Mon Sep 17 00:00:00 2001 +From 1f6af2a9f8b02a71f213b4717d8e62c8a6b14fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=9F=D0=B5=D1=85=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Sun, 22 Jun 2014 03:51:50 +0400 -Subject: [PATCH 087/152] * grub-core/commands/loadenv.c +Subject: [PATCH 086/506] * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. --- @@ -11,7 +11,7 @@ Subject: [PATCH 087/152] * grub-core/commands/loadenv.c 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 4ce6643..a2da974 100644 +index 03eedb3..be322d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -54,5 +54,5 @@ index 6af8112..acd93d1 100644 /* This might be actually valid, but it is unbelievable that any filesystem makes such a silly allocation. */ -- -1.9.3 +2.4.3 diff --git a/0087-docs-grub-dev.texi-Finding-your-way-around-The-build.patch b/0087-docs-grub-dev.texi-Finding-your-way-around-The-build.patch new file mode 100644 index 0000000..663ad93 --- /dev/null +++ b/0087-docs-grub-dev.texi-Finding-your-way-around-The-build.patch @@ -0,0 +1,47 @@ +From 4250f552a6c78f5547d45c77b46ea11c5e8e394d Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Thu, 26 Jun 2014 14:20:17 +0100 +Subject: [PATCH 087/506] * docs/grub-dev.texi (Finding your way around): The + build system no longer uses AutoGen directly. + +--- + ChangeLog | 5 +++++ + docs/grub-dev.texi | 6 +++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index be322d4..5109c5a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-06-26 Colin Watson ++ ++ * docs/grub-dev.texi (Finding your way around): The build system no ++ longer uses AutoGen directly. ++ + 2014-06-21 Роман Пехов + + * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. +diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi +index 7c6244c..a9f4de6 100644 +--- a/docs/grub-dev.texi ++++ b/docs/grub-dev.texi +@@ -228,12 +228,12 @@ The opening @samp{/*} and closing @samp{*/} should be placed together on a line + Here is a brief map of the GRUB code base. + + GRUB uses Autoconf and Automake, with most of the Automake input generated +-by AutoGen. The top-level build rules are in @file{configure.ac}, ++by a Python script. The top-level build rules are in @file{configure.ac}, + @file{grub-core/Makefile.core.def}, and @file{Makefile.util.def}. Each + block in a @file{*.def} file represents a build target, and specifies the + source files used to build it on various platforms. The @file{*.def} files +-are processed into AutoGen input by @file{gentpl.py} (which you only need to +-look at if you are extending the build system). If you are adding a new ++are processed into Automake input by @file{gentpl.py} (which you only need ++to look at if you are extending the build system). If you are adding a new + module which follows an existing pattern, such as a new command or a new + filesystem implementation, it is usually easiest to grep + @file{grub-core/Makefile.core.def} and @file{Makefile.util.def} for an +-- +2.4.3 + diff --git a/0088-Fix-an-infinite-loop-in-grub-mkconfig.patch b/0088-Fix-an-infinite-loop-in-grub-mkconfig.patch new file mode 100644 index 0000000..035945d --- /dev/null +++ b/0088-Fix-an-infinite-loop-in-grub-mkconfig.patch @@ -0,0 +1,99 @@ +From 0901e7855f922e770cbfeb58262cb8fded518190 Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Tue, 8 Jul 2014 23:54:30 +0100 +Subject: [PATCH 088/506] Fix an infinite loop in grub-mkconfig + +* util/grub.d/10_hurd.in: Make kernel list progression not fail on +kernels whose paths contain regex metacharacters. +* util/grub.d/10_kfreebsd.in: Likewise. +* util/grub.d/10_linux.in: Likewise. +* util/grub.d/20_linux_xen.in: Likewise. + +Reported by: Heimo Stranner. +--- + ChangeLog | 10 ++++++++++ + util/grub.d/10_hurd.in | 2 +- + util/grub.d/10_kfreebsd.in | 2 +- + util/grub.d/10_linux.in | 2 +- + util/grub.d/20_linux_xen.in | 4 ++-- + 5 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 5109c5a..ccd8ac1 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,13 @@ ++2014-07-08 Colin Watson ++ ++ * util/grub.d/10_hurd.in: Make kernel list progression not fail on ++ kernels whose paths contain regex metacharacters. ++ * util/grub.d/10_kfreebsd.in: Likewise. ++ * util/grub.d/10_linux.in: Likewise. ++ * util/grub.d/20_linux_xen.in: Likewise. ++ ++ Reported by: Heimo Stranner. ++ + 2014-06-26 Colin Watson + + * docs/grub-dev.texi (Finding your way around): The build system no +diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in +index 82dfe19..29b4554 100644 +--- a/util/grub.d/10_hurd.in ++++ b/util/grub.d/10_hurd.in +@@ -168,7 +168,7 @@ while [ "x$kernels" != "x" ] ; do + hurd_entry "$kernel" advanced + hurd_entry "$kernel" recovery + +- kernels=`echo $kernels | tr ' ' '\n' | grep -vx $kernel | tr '\n' ' '` ++ kernels=`echo $kernels | tr ' ' '\n' | fgrep -vx "$kernel" | tr '\n' ' '` + done + + # If at least one kernel was found, then we need to +diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in +index a524762..ba7175b 100644 +--- a/util/grub.d/10_kfreebsd.in ++++ b/util/grub.d/10_kfreebsd.in +@@ -228,7 +228,7 @@ while [ "x$list" != "x" ] ; do + kfreebsd_entry "${OS}" "${version}" recovery "-s" + fi + +- list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '` ++ list=`echo $list | tr ' ' '\n' | fgrep -vx "$kfreebsd" | tr '\n' ' '` + done + + # If at least one kernel was found, then we need to +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 00d1931..d2e2a8f 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -241,7 +241,7 @@ while [ "x$list" != "x" ] ; do + "single ${GRUB_CMDLINE_LINUX}" + fi + +- list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` ++ list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` + done + + # If at least one kernel was found, then we need to +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index a608435..2e77758 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -255,12 +255,12 @@ while [ "x${xen_list}" != "x" ] ; do + "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" + fi + +- list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` ++ list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` + done + if [ x"$is_top_level" != xtrue ]; then + echo ' }' + fi +- xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '` ++ xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '` + done + + # If at least one kernel was found, then we need to +-- +2.4.3 + diff --git a/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch b/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch deleted file mode 100644 index 9e99379..0000000 --- a/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e4ecf3a1f8eef683feae27ed84c85eb8aeb79e11 Mon Sep 17 00:00:00 2001 -From: Colin Watson -Date: Sat, 28 Dec 2013 02:20:27 +0000 -Subject: [PATCH 088/152] * NEWS: The cmosclean command in fact dates back to - 1.99. Remove mention of it from 2.02. - ---- - NEWS | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/NEWS b/NEWS -index a61df94..f621c65 100644 ---- a/NEWS -+++ b/NEWS -@@ -63,6 +63,8 @@ New in 2.02: - * New `efifwsetup' and `lsefi' commands on EFI platforms. - * New `cmosdump' and `cmosset' commands on platforms with CMOS support. - * New command `pcidump' for PCI platforms. -+ * New `cbmemc', `coreboot_boottime', and `lscoreboot' commands on -+ coreboot. - * Improve opcode parsing in ACPI halt implementation. - * Use the TSC as a possible time source on i386-ieee1275. - * Merge PowerPC grub-mkrescue implementation with the common one. --- -1.9.3 - diff --git a/0089-grub-core-fs-cbfs.c-Don-t-probe-disks-of-unknow-size.patch b/0089-grub-core-fs-cbfs.c-Don-t-probe-disks-of-unknow-size.patch new file mode 100644 index 0000000..397bd91 --- /dev/null +++ b/0089-grub-core-fs-cbfs.c-Don-t-probe-disks-of-unknow-size.patch @@ -0,0 +1,41 @@ +From 33f6ce671f984465e0f8f9c96927c087b6d0c1a1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 10 Aug 2014 09:50:36 +0200 +Subject: [PATCH 089/506] * grub-core/fs/cbfs.c: Don't probe disks of + unknow size. + + Fixes hang on virtualbox. +--- + ChangeLog | 4 ++++ + grub-core/fs/cbfs.c | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index ccd8ac1..47ff355 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-08-10 Vladimir Serbinenko ++ ++ * grub-core/fs/cbfs.c: Don't probe disks of unknow size. ++ + 2014-07-08 Colin Watson + + * util/grub.d/10_hurd.in: Make kernel list progression not fail on +diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c +index 7ad1483..35750a0 100644 +--- a/grub-core/fs/cbfs.c ++++ b/grub-core/fs/cbfs.c +@@ -149,6 +149,9 @@ grub_cbfs_mount (grub_disk_t disk) + grub_off_t header_off; + struct cbfs_header head; + ++ if (grub_disk_get_size (disk) == GRUB_DISK_SIZE_UNKNOWN) ++ goto fail; ++ + if (grub_disk_read (disk, grub_disk_get_size (disk) - 1, + GRUB_DISK_SECTOR_SIZE - sizeof (ptr), + sizeof (ptr), &ptr)) +-- +2.4.3 + diff --git a/0090-Fix-Changelog.patch b/0090-Fix-Changelog.patch new file mode 100644 index 0000000..a92f8d4 --- /dev/null +++ b/0090-Fix-Changelog.patch @@ -0,0 +1,25 @@ +From 79c80b06b80c680e584038537098b9e433415465 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 10 Aug 2014 10:04:04 +0200 +Subject: [PATCH 090/506] Fix Changelog + +--- + ChangeLog | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 47ff355..cab1427 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,6 +2,8 @@ + + * grub-core/fs/cbfs.c: Don't probe disks of unknow size. + ++ Fixes hang on virtualbox. ++ + 2014-07-08 Colin Watson + + * util/grub.d/10_hurd.in: Make kernel list progression not fail on +-- +2.4.3 + diff --git a/0091-grub-core-disk-i386-pc-biosdisk.c-grub_biosdisk_rw-A.patch b/0091-grub-core-disk-i386-pc-biosdisk.c-grub_biosdisk_rw-A.patch new file mode 100644 index 0000000..08b419c --- /dev/null +++ b/0091-grub-core-disk-i386-pc-biosdisk.c-grub_biosdisk_rw-A.patch @@ -0,0 +1,48 @@ +From 0af3ae2d8b31e31c991eb7dd1d4b79e698907c8d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 10 Aug 2014 11:27:13 +0200 +Subject: [PATCH 091/506] * grub-core/disk/i386/pc/biosdisk.c + (grub_biosdisk_rw): Add safety to avoid triggerring VirtualBox bug. + +--- + ChangeLog | 5 +++++ + grub-core/disk/i386/pc/biosdisk.c | 8 ++++++++ + 2 files changed, 13 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index cab1427..9e159a8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-08-10 Vladimir Serbinenko + ++ * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add ++ safety to avoid triggerring VirtualBox bug. ++ ++2014-08-10 Vladimir Serbinenko ++ + * grub-core/fs/cbfs.c: Don't probe disks of unknow size. + + Fixes hang on virtualbox. +diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c +index 1689539..6b21525 100644 +--- a/grub-core/disk/i386/pc/biosdisk.c ++++ b/grub-core/disk/i386/pc/biosdisk.c +@@ -455,6 +455,14 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, + { + struct grub_biosdisk_data *data = disk->data; + ++ /* VirtualBox fails with sectors above 2T on CDs. ++ Since even BD-ROMS are never that big anyway, return error. */ ++ if ((data->flags & GRUB_BIOSDISK_FLAG_CDROM) ++ && (sector >> 32)) ++ return grub_error (GRUB_ERR_OUT_OF_RANGE, ++ N_("attempt to read or write outside of disk `%s'"), ++ disk->name); ++ + if (data->flags & GRUB_BIOSDISK_FLAG_LBA) + { + struct grub_biosdisk_dap *dap; +-- +2.4.3 + diff --git a/0092-grub-core-kern-disk_common.c-Clump-disk-size-to-1EiB.patch b/0092-grub-core-kern-disk_common.c-Clump-disk-size-to-1EiB.patch new file mode 100644 index 0000000..a0d369f --- /dev/null +++ b/0092-grub-core-kern-disk_common.c-Clump-disk-size-to-1EiB.patch @@ -0,0 +1,68 @@ +From d1224d209be3fcfa5cea7b3e637cfc429f7d2345 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 10 Aug 2014 11:27:36 +0200 +Subject: [PATCH 092/506] * grub-core/kern/disk_common.c: Clump disk + size to 1EiB. + +--- + ChangeLog | 4 ++++ + grub-core/kern/disk_common.c | 22 ++++++++++++++++------ + 2 files changed, 20 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 9e159a8..6c389b0 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-08-10 Vladimir Serbinenko + ++ * grub-core/kern/disk_common.c: Clump disk size to 1EiB. ++ ++2014-08-10 Vladimir Serbinenko ++ + * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add + safety to avoid triggerring VirtualBox bug. + +diff --git a/grub-core/kern/disk_common.c b/grub-core/kern/disk_common.c +index fb19778..2ca12b5 100644 +--- a/grub-core/kern/disk_common.c ++++ b/grub-core/kern/disk_common.c +@@ -7,6 +7,8 @@ grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, + grub_off_t *offset, grub_size_t size) + { + grub_partition_t part; ++ grub_disk_addr_t total_sectors; ++ + *sector += *offset >> GRUB_DISK_SECTOR_BITS; + *offset &= GRUB_DISK_SECTOR_SIZE - 1; + +@@ -27,12 +29,20 @@ grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, + *sector += start; + } + +- if (disk->total_sectors != GRUB_DISK_SIZE_UNKNOWN +- && ((disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)) <= *sector +- || ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1) +- >> GRUB_DISK_SECTOR_BITS) > (disk->total_sectors +- << (disk->log_sector_size +- - GRUB_DISK_SECTOR_BITS)) - *sector)) ++ /* Transform total_sectors to number of 512B blocks. */ ++ total_sectors = disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); ++ ++ /* Some drivers have problems with disks above reasonable. ++ Treat unknown as 1EiB disk. While on it, clamp the size to 1EiB. ++ Just one condition is enough since GRUB_DISK_UNKNOWN_SIZE << ls is always ++ above 9EiB. ++ */ ++ if (total_sectors > (1ULL << 51)) ++ total_sectors = (1ULL << 51); ++ ++ if ((total_sectors <= *sector ++ || ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1) ++ >> GRUB_DISK_SECTOR_BITS) > total_sectors - *sector)) + return grub_error (GRUB_ERR_OUT_OF_RANGE, + N_("attempt to read or write outside of disk `%s'"), disk->name); + +-- +2.4.3 + diff --git a/0093-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch b/0093-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch new file mode 100644 index 0000000..67fdd84 --- /dev/null +++ b/0093-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch @@ -0,0 +1,84 @@ +From 3c058332499f6c0185c167a7faf37afa808136b7 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 13 Aug 2014 23:04:01 +0200 +Subject: [PATCH 093/506] * grub-core/term/at_keyboard.c: Retry probing + keyboard if scancode setup failed. + +--- + ChangeLog | 5 +++++ + grub-core/term/at_keyboard.c | 11 +++++------ + 2 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6c389b0..22030fd 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-08-13 Vladimir Serbinenko ++ ++ * grub-core/term/at_keyboard.c: Retry probing keyboard if ++ scancode setup failed. ++ + 2014-08-10 Vladimir Serbinenko + + * grub-core/kern/disk_common.c: Clump disk size to 1EiB. +diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c +index b4257e8..c234e92 100644 +--- a/grub-core/term/at_keyboard.c ++++ b/grub-core/term/at_keyboard.c +@@ -226,7 +226,7 @@ static const struct + {0x7d, GRUB_KEYBOARD_KEY_PPAGE}, + }; + +-static int alive = 0, ping_sent; ++static int ping_sent; + + static void + keyboard_controller_wait_until_ready (void) +@@ -373,7 +373,7 @@ set_scancodes (void) + grub_dprintf ("atkeyb", "returned set %d\n", current_set); + if (current_set == 1) + return; +- grub_printf ("No supported scancode set found\n"); ++ grub_dprintf ("atkeyb", "no supported scancode set found\n"); + #endif + } + +@@ -543,7 +543,7 @@ grub_keyboard_getkey (void) + int + grub_at_keyboard_is_alive (void) + { +- if (alive) ++ if (current_set != 0) + return 1; + if (ping_sent + && KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)) +@@ -611,7 +611,6 @@ static void + grub_keyboard_controller_init (void) + { + at_keyboard_status = 0; +- alive = 1; + /* Drain input buffer. */ + while (1) + { +@@ -639,7 +638,7 @@ grub_keyboard_controller_init (void) + static grub_err_t + grub_keyboard_controller_fini (struct grub_term_input *term __attribute__ ((unused))) + { +- if (!alive) ++ if (current_set == 0) + return GRUB_ERR_NONE; + if (grub_keyboard_orig_set) + write_mode (grub_keyboard_orig_set); +@@ -656,7 +655,7 @@ grub_at_fini_hw (int noreturn __attribute__ ((unused))) + static grub_err_t + grub_at_restore_hw (void) + { +- if (!alive) ++ if (current_set == 0) + return GRUB_ERR_NONE; + + /* Drain input buffer. */ +-- +2.4.3 + diff --git a/0094-Fix-typo-gettext_print-instead-of-gettext_printf.patch b/0094-Fix-typo-gettext_print-instead-of-gettext_printf.patch new file mode 100644 index 0000000..4f06645 --- /dev/null +++ b/0094-Fix-typo-gettext_print-instead-of-gettext_printf.patch @@ -0,0 +1,39 @@ +From c291f47b2c003ef6daeafaedd458db838bad6fb8 Mon Sep 17 00:00:00 2001 +From: Andrey Borzenkov +Date: Thu, 14 Aug 2014 21:02:31 +0400 +Subject: [PATCH 094/506] Fix typo (gettext_print instead of gettext_printf) + +--- + ChangeLog | 5 +++++ + util/grub-mkconfig.in | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 22030fd..a8f379b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-08-14 Andrey Borzenkov ++ ++ * util/grub-mkconfig.in: Fix typo (gettext_print instead of ++ gettext_printf). ++ + 2014-08-13 Vladimir Serbinenko + + * grub-core/term/at_keyboard.c: Retry probing keyboard if +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index ca040dd..d1fae49 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -124,7 +124,7 @@ set $grub_probe dummy + if test -f "$1"; then + : + else +- gettext_print "%s: Not found.\n" "$1" 1>&2 ++ gettext_printf "%s: Not found.\n" "$1" 1>&2 + exit 1 + fi + +-- +2.4.3 + diff --git a/0095-grub-core-kern-mips-arc-init.c-grub_machine_get_boot.patch b/0095-grub-core-kern-mips-arc-init.c-grub_machine_get_boot.patch new file mode 100644 index 0000000..0c2595a --- /dev/null +++ b/0095-grub-core-kern-mips-arc-init.c-grub_machine_get_boot.patch @@ -0,0 +1,40 @@ +From 1de3a48098053aaebd35232bd73e3ce3f3fdf51c Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Mon, 25 Aug 2014 15:19:48 -0700 +Subject: [PATCH 095/506] * grub-core/kern/mips/arc/init.c + (grub_machine_get_bootlocation): Initialise pend to pacify GCC. + +--- + ChangeLog | 5 +++++ + grub-core/kern/mips/arc/init.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index a8f379b..6a99e2a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-08-25 Colin Watson ++ ++ * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation): ++ Initialise pend to pacify GCC. ++ + 2014-08-14 Andrey Borzenkov + + * util/grub-mkconfig.in: Fix typo (gettext_print instead of +diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/init.c +index b4f50e4..3834a14 100644 +--- a/grub-core/kern/mips/arc/init.c ++++ b/grub-core/kern/mips/arc/init.c +@@ -360,7 +360,7 @@ grub_machine_get_bootlocation (char **device, char **path) + char *loaddev = boot_location; + char *pptr, *partptr; + char *dname; +- grub_disk_addr_t poff = -1, pend; ++ grub_disk_addr_t poff = -1, pend = -1; + struct get_device_name_ctx ctx; + grub_disk_t parent = 0; + unsigned i; +-- +2.4.3 + diff --git a/0096-configure.ac-Remove-several-unnecessary-semicolons.patch b/0096-configure.ac-Remove-several-unnecessary-semicolons.patch new file mode 100644 index 0000000..3e532fa --- /dev/null +++ b/0096-configure.ac-Remove-several-unnecessary-semicolons.patch @@ -0,0 +1,139 @@ +From 4d94b2db58e5d6e3d6e451ab294cd9def33f7aef Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Sun, 7 Sep 2014 20:47:43 +0100 +Subject: [PATCH 096/506] * configure.ac: Remove several unnecessary + semicolons. + +--- + ChangeLog | 4 ++++ + configure.ac | 36 ++++++++++++++++++------------------ + 2 files changed, 22 insertions(+), 18 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6a99e2a..4e422b8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-09-07 Colin Watson ++ ++ * configure.ac: Remove several unnecessary semicolons. ++ + 2014-08-25 Colin Watson + + * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation): +diff --git a/configure.ac b/configure.ac +index 8888c2f..a3610e1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -90,18 +90,18 @@ case "$target_cpu" in + amd64) target_cpu=x86_64 ;; + sparc) target_cpu=sparc64 ;; + mipsel|mips64el) +- target_cpu=mipsel; +- machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1"; ++ target_cpu=mipsel ++ machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1" + ;; + mips|mips64) +- target_cpu=mips; +- machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1"; ++ target_cpu=mips ++ machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1" + ;; + arm*) +- target_cpu=arm; ++ target_cpu=arm + ;; + aarch64*) +- target_cpu=arm64; ++ target_cpu=arm64 + ;; + esac + +@@ -178,7 +178,7 @@ if test x$platform != xemu ; then + fi + + if test x"$target_cpu-$platform" = xsparc64-emu ; then +- target_m64=1 ; ++ target_m64=1 + fi + + case "$target_os" in +@@ -742,7 +742,7 @@ if test x"$efiemu_excuse" = x ; then + ]], [[]])], [flag=1], [flag=0]) + if test x"$flag" = x1; then + grub_cv_target_cc_efiemu64_link_format="$format" +- break; ++ break + fi + done]) + if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then +@@ -775,12 +775,12 @@ if test x"$platform" = xemu ; then + ;; + *windows* | *cygwin* | *mingw*) + if test x${target_cpu} = xi386 ; then +- grub_cv_target_cc_link_format=-mi386pe; +- TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)'; ++ grub_cv_target_cc_link_format=-mi386pe ++ TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' + fi + if test x${target_cpu} = xx86_64 ; then +- grub_cv_target_cc_link_format=-mi386pep; +- TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)'; ++ grub_cv_target_cc_link_format=-mi386pep ++ TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' + fi + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" + ;; +@@ -806,7 +806,7 @@ elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then + ]], [[]])], [flag=1], [flag=0]) + if test x"$flag" = x1; then + grub_cv_target_cc_link_format="$format" +- break; ++ break + fi + done]) + if test x"$grub_cv_target_cc_link_format" = xunknown; then +@@ -814,10 +814,10 @@ elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then + fi + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" + if test x"$grub_cv_target_cc_link_format" = x-mi386pe ; then +- TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)'; ++ TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' + fi + if test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then +- TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)'; ++ TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' + fi + fi + +@@ -995,7 +995,7 @@ if test "$target_cpu" = arm; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0]) + if test x"$flag" = x1; then + grub_cv_target_cc_strict_align="$arg" +- break; ++ break + fi + done]) + +@@ -1416,7 +1416,7 @@ for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do + md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')" + # PCF and BDF from version 6.3 isn't hanled properly by libfreetype. + if test "$md5" = 0a54834d2788c83886a3e1785a6a1e61 || test "$md5" = 28f2565c7a41d8d407e2551159385edb || test "$md5" = dae5e588461b3b92b87b6ffee734f936 || test "$md5" = 4a3d687aa5bb329ed05f4263a1016791 ; then +- continue; ++ continue + fi + FONT_SOURCE="$dir/unifont.$ext" + break 2 +@@ -1501,7 +1501,7 @@ if test x"$device_mapper_excuse" = x ; then + fi + + if test x"$device_mapper_excuse" = x ; then +- LIBDEVMAPPER="-ldevmapper"; ++ LIBDEVMAPPER="-ldevmapper" + AC_DEFINE([HAVE_DEVICE_MAPPER], [1], + [Define to 1 if you have the devmapper library.]) + fi +-- +2.4.3 + diff --git a/0097-Support-grub-emu-on-x32-ILP32-but-with-x86-64-instru.patch b/0097-Support-grub-emu-on-x32-ILP32-but-with-x86-64-instru.patch new file mode 100644 index 0000000..1ed0bca --- /dev/null +++ b/0097-Support-grub-emu-on-x32-ILP32-but-with-x86-64-instru.patch @@ -0,0 +1,111 @@ +From 2a5a532c0047d4eff90175936b220b638cce1013 Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Sun, 7 Sep 2014 23:04:35 +0100 +Subject: [PATCH 097/506] Support grub-emu on x32 (ILP32 but with x86-64 + instruction set) + +* configure.ac: Remove -m64 from checks for -mcmodel=large and +-mno-red-zone. These are always either unnecessary (x86_64-emu) or +already in TARGET_CFLAGS at this point, and they produce incorrect +results when building for x32. +* grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Cast +pointers to Elf64_Xword via grub_addr_t, in order to work on x32. +* include/grub/x86_64/types.h (GRUB_TARGET_SIZEOF_VOID_P, +GRUB_TARGET_SIZEOF_LONG): Define to 4 on x32. +--- + ChangeLog | 13 +++++++++++++ + configure.ac | 4 ++-- + grub-core/kern/x86_64/dl.c | 4 ++-- + include/grub/x86_64/types.h | 6 +++++- + 4 files changed, 22 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4e422b8..572ee50 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,18 @@ + 2014-09-07 Colin Watson + ++ Support grub-emu on x32 (ILP32 but with x86-64 instruction set) ++ ++ * configure.ac: Remove -m64 from checks for -mcmodel=large and ++ -mno-red-zone. These are always either unnecessary (x86_64-emu) or ++ already in TARGET_CFLAGS at this point, and they produce incorrect ++ results when building for x32. ++ * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Cast ++ pointers to Elf64_Xword via grub_addr_t, in order to work on x32. ++ * include/grub/x86_64/types.h (GRUB_TARGET_SIZEOF_VOID_P, ++ GRUB_TARGET_SIZEOF_LONG): Define to 4 on x32. ++ ++2014-09-07 Colin Watson ++ + * configure.ac: Remove several unnecessary semicolons. + + 2014-08-25 Colin Watson +diff --git a/configure.ac b/configure.ac +index a3610e1..8662bac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -862,7 +862,7 @@ LDFLAGS="$TARGET_LDFLAGS" + if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; then + # Use large model to support 4G memory + AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ +- CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large" ++ CFLAGS="$TARGET_CFLAGS -mcmodel=large" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_mcmodel=yes], + [grub_cv_cc_mcmodel=no]) +@@ -877,7 +877,7 @@ fi + if test "$target_cpu"-"$platform" = x86_64-efi; then + # EFI writes to stack below %rsp, we must not use the red zone + AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ +- CFLAGS="$TARGET_CFLAGS -m64 -mno-red-zone" ++ CFLAGS="$TARGET_CFLAGS -mno-red-zone" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_no_red_zone=yes], + [grub_cv_cc_no_red_zone=no]) +diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c +index 6cb88bf..4406906 100644 +--- a/grub-core/kern/x86_64/dl.c ++++ b/grub-core/kern/x86_64/dl.c +@@ -73,7 +73,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, + { + grub_int64_t value; + value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - +- (Elf64_Xword) seg->addr - rel->r_offset; ++ (Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset; + if (value != (grub_int32_t) value) + return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); + *addr32 = value; +@@ -83,7 +83,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, + case R_X86_64_PC64: + { + *addr64 += rel->r_addend + sym->st_value - +- (Elf64_Xword) seg->addr - rel->r_offset; ++ (Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset; + } + break; + +diff --git a/include/grub/x86_64/types.h b/include/grub/x86_64/types.h +index fec9109..0bbdc6d 100644 +--- a/include/grub/x86_64/types.h ++++ b/include/grub/x86_64/types.h +@@ -20,10 +20,14 @@ + #define GRUB_TYPES_CPU_HEADER 1 + + /* The size of void *. */ ++#ifdef __ILP32__ ++#define GRUB_TARGET_SIZEOF_VOID_P 4 ++#else + #define GRUB_TARGET_SIZEOF_VOID_P 8 ++#endif + + /* The size of long. */ +-#ifdef __MINGW32__ ++#if defined(__MINGW32__) || defined(__ILP32__) + #define GRUB_TARGET_SIZEOF_LONG 4 + #else + #define GRUB_TARGET_SIZEOF_LONG 8 +-- +2.4.3 + diff --git a/0098-Fix-incorrect-address-reference-in-btrfs.patch b/0098-Fix-incorrect-address-reference-in-btrfs.patch new file mode 100644 index 0000000..6378305 --- /dev/null +++ b/0098-Fix-incorrect-address-reference-in-btrfs.patch @@ -0,0 +1,50 @@ +From 54bd9a061083b916d3563101d147a01e002486aa Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Thu, 14 Aug 2014 18:17:45 +0800 +Subject: [PATCH 098/506] Fix incorrect address reference in btrfs + +We encountered a weird random kernel initrd unpacking error on btrfs +and finally found it was caused by incorrect address reference in range +check for type GRUB_BTRFS_EXTENT_REGULAR and the entire result is +unpredictable. + +This is a quick fix to make the address reference to the +grub_btrfs_extent_data structure correctly, not the pointer variable +to it. + +Any suggestions to this patch is welcome. +--- + ChangeLog | 6 ++++++ + grub-core/fs/btrfs.c | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 572ee50..0676065 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++2014-09-08 Michael Chang ++ ++ * grub-core/fs/btrfs.c (grub_btrfs_extent_read): Fix extent size ++ check; comparing &data->extent against addresses in the region it ++ points to is unpredictable. ++ + 2014-09-07 Colin Watson + + Support grub-emu on x32 (ILP32 but with x86-64 instruction set) +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index f7b6c15..95a8fa6 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -1051,7 +1051,7 @@ grub_btrfs_extent_read (struct grub_btrfs_data *data, + + data->extend = data->extstart + grub_le_to_cpu64 (data->extent->size); + if (data->extent->type == GRUB_BTRFS_EXTENT_REGULAR +- && (char *) &data->extent + elemsize ++ && (char *) data->extent + elemsize + >= (char *) &data->extent->filled + sizeof (data->extent->filled)) + data->extend = + data->extstart + grub_le_to_cpu64 (data->extent->filled); +-- +2.4.3 + diff --git a/0099-Fix-build-with-glibc-2.20.patch b/0099-Fix-build-with-glibc-2.20.patch new file mode 100644 index 0000000..1529ec0 --- /dev/null +++ b/0099-Fix-build-with-glibc-2.20.patch @@ -0,0 +1,47 @@ +From a276b840464629fdaecbe7e813f83a717a34993a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 3 Sep 2014 01:15:08 -0700 +Subject: [PATCH 099/506] Fix build with glibc 2.20 + +* grub-core/kern/emu/hostfs.c: squahes below warning + warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + +Signed-off-by: Khem Raj + +Upstream-Status: Submitted +--- + ChangeLog | 4 ++++ + grub-core/kern/emu/hostfs.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 0676065..ea011b7 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-09-15 Khem Raj ++ * grub-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to ++ _BSD_SOURCE to avoid warnings under glibc 2.20+. ++ + 2014-09-08 Michael Chang + + * grub-core/fs/btrfs.c (grub_btrfs_extent_read): Fix extent size +diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c +index 7e725f6..823116d 100644 +--- a/grub-core/kern/emu/hostfs.c ++++ b/grub-core/kern/emu/hostfs.c +@@ -19,7 +19,11 @@ + + #include + ++/* Legacy feature macro.*/ + #define _BSD_SOURCE ++/* New feature macro that provides everything _BSD_SOURCE and ++ * _SVID_SOURCE provided and possibly more. */ ++#define _DEFAULT_SOURCE + #include + #include + #include +-- +2.4.3 + diff --git a/0100-Tidy-up-ChangeLog-formatting.patch b/0100-Tidy-up-ChangeLog-formatting.patch new file mode 100644 index 0000000..2b75a71 --- /dev/null +++ b/0100-Tidy-up-ChangeLog-formatting.patch @@ -0,0 +1,23 @@ +From 60049a0e7204c267fc867ce8de31421613af0b69 Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Fri, 19 Sep 2014 14:50:51 +0100 +Subject: [PATCH 100/506] Tidy up ChangeLog formatting. + +--- + ChangeLog | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index ea011b7..2bbf501 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,4 +1,5 @@ +-2014-09-15 Khem Raj ++2014-09-15 Khem Raj ++ + * grub-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to + _BSD_SOURCE to avoid warnings under glibc 2.20+. + +-- +2.4.3 + diff --git a/0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch b/0101-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch similarity index 75% rename from 0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch rename to 0101-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch index 7933955..ed39b5f 100644 --- a/0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch +++ b/0101-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch @@ -1,7 +1,7 @@ -From 3cb3d2a07b11c95b3f8a908ae9d43eabef4dcf62 Mon Sep 17 00:00:00 2001 +From 631a82003851ca68bfaf87e12be5c94e14cd2a91 Mon Sep 17 00:00:00 2001 From: Peter Jones -Date: Wed, 17 Sep 2014 15:13:14 -0500 -Subject: [PATCH 151/152] Initialized initrd_ctx so we don't free a random +Date: Wed, 17 Sep 2014 16:30:11 -0400 +Subject: [PATCH 101/506] Initialized initrd_ctx so we don't free a random pointer from the stack. Currently, if "linux" fails, the "goto fail;" in grub_cmd_initrd sends us @@ -15,16 +15,37 @@ So initialize the memory up front. Signed-off-by: Peter Jones --- - grub-core/loader/arm/linux.c | 2 +- - grub-core/loader/arm64/linux.c | 2 +- - grub-core/loader/i386/linux.c | 2 +- - grub-core/loader/i386/pc/linux.c | 2 +- - grub-core/loader/ia64/efi/linux.c | 2 +- - grub-core/loader/mips/linux.c | 2 +- - grub-core/loader/powerpc/ieee1275/linux.c | 2 +- - grub-core/loader/sparc64/ieee1275/linux.c | 2 +- - 8 files changed, 8 insertions(+), 8 deletions(-) + ChangeLog | 12 ++++++++++++ + grub-core/loader/arm/linux.c | 2 +- + grub-core/loader/arm64/linux.c | 2 +- + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 2 +- + grub-core/loader/ia64/efi/linux.c | 2 +- + grub-core/loader/mips/linux.c | 2 +- + grub-core/loader/powerpc/ieee1275/linux.c | 2 +- + grub-core/loader/sparc64/ieee1275/linux.c | 2 +- + 9 files changed, 20 insertions(+), 8 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 2bbf501..1c79b77 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,15 @@ ++2014-21-15 Peter Jones ++ ++ * grub-core/loader/arm/linux.c: Initialized initrd_ctx so ++ we don't free a random pointer from the stack. ++ * grub-core/loader/arm64/linux.c: Likewise. ++ * grub-core/loader/i386/linux.c: Likewise. ++ * grub-core/loader/i386/pc/linux.c: Likewise. ++ * grub-core/loader/ia64/efi/linux.c: Likewise. ++ * grub-core/loader/mips/linux.c: Likewise. ++ * grub-core/loader/powerpc/ieee1275/linux.c: Likewise. ++ * grub-core/loader/sparc64/ieee1275/linux.c: Likewise. ++ + 2014-09-15 Khem Raj + + * grub-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c index e6770d9..62cbe75 100644 --- a/grub-core/loader/arm/linux.c @@ -130,5 +151,5 @@ index de6ee2f..c5e8dfa 100644 if (argc == 0) { -- -1.9.3 +2.4.3 diff --git a/0102-grub-core-osdep-unix-config.c-Remove-extraneous-comm.patch b/0102-grub-core-osdep-unix-config.c-Remove-extraneous-comm.patch new file mode 100644 index 0000000..f13a628 --- /dev/null +++ b/0102-grub-core-osdep-unix-config.c-Remove-extraneous-comm.patch @@ -0,0 +1,162 @@ +From 0aece00c54aa6a6ac316c619a1ad31ec3190aca2 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Sun, 21 Sep 2014 17:49:13 +0200 +Subject: [PATCH 102/506] * grub-core/osdep/unix/config.c: Remove + extraneous comma. + +--- + ChangeLog | 6 +++++- + grub-core/commands/keylayouts.c | 4 +++- + grub-core/gmodule.pl.in | 2 +- + grub-core/normal/main.c | 10 +++++++--- + grub-core/normal/menu.c | 2 +- + grub-core/normal/menu_entry.c | 2 +- + grub-core/osdep/unix/config.c | 4 ++-- + grub-core/tests/cmdline_cat_test.c | 2 +- + include/grub/normal.h | 2 +- + 9 files changed, 22 insertions(+), 12 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 1c79b77..bac248c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,4 +1,8 @@ +-2014-21-15 Peter Jones ++2014-09-21 Michael Chang ++ ++ * grub-core/osdep/unix/config.c: Remove extraneous comma. ++ ++2014-09-21 Peter Jones + + * grub-core/loader/arm/linux.c: Initialized initrd_ctx so + we don't free a random pointer from the stack. +diff --git a/grub-core/commands/keylayouts.c b/grub-core/commands/keylayouts.c +index da04389..f4b7730 100644 +--- a/grub-core/commands/keylayouts.c ++++ b/grub-core/commands/keylayouts.c +@@ -173,8 +173,10 @@ grub_term_map_key (grub_keyboard_key_t code, int status) + + key = map_key_core (code, status, &alt_gr_consumed); + +- if (key == 0 || key == GRUB_TERM_SHIFT) ++ if (key == 0 || key == GRUB_TERM_SHIFT) { + grub_printf ("Unknown key 0x%x detected\n", code); ++ return GRUB_TERM_NO_KEY; ++ } + + if (status & GRUB_TERM_STATUS_CAPS) + { +diff --git a/grub-core/gmodule.pl.in b/grub-core/gmodule.pl.in +index 6739a6f..78aa1e6 100644 +--- a/grub-core/gmodule.pl.in ++++ b/grub-core/gmodule.pl.in +@@ -23,7 +23,7 @@ while (<>) { + } + + print " -s $2 $sections{$1}" +- if ($sections{$1} ne '0x0'); ++ if ($sections{$1} ne '0x0' and $sections{$1} ne ''); + }; + close (READELF); + print "\n"; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 3a926fc..c41f175 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -302,7 +302,7 @@ grub_enter_normal_mode (const char *config) + nested_level++; + grub_normal_execute (config, 0, 0); + grub_boot_time ("Entering shell"); +- grub_cmdline_run (0); ++ grub_cmdline_run (0, 1); + nested_level--; + if (grub_normal_exit_level) + grub_normal_exit_level--; +@@ -424,11 +424,15 @@ grub_normal_read_line (char **line, int cont, + } + + void +-grub_cmdline_run (int nested) ++grub_cmdline_run (int nested, int force_auth) + { + grub_err_t err = GRUB_ERR_NONE; + +- err = grub_auth_check_authentication (NULL); ++ do ++ { ++ err = grub_auth_check_authentication (NULL); ++ } ++ while (err && force_auth); + + if (err) + { +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index b47991a..719e2fb 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -773,7 +773,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + + case 'c': + menu_fini (); +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + goto refresh; + + case 'e': +diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c +index b485df8..62c7e16 100644 +--- a/grub-core/normal/menu_entry.c ++++ b/grub-core/normal/menu_entry.c +@@ -1396,7 +1396,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) + + case GRUB_TERM_CTRL | 'c': + case GRUB_TERM_KEY_F2: +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + goto refresh; + + case GRUB_TERM_CTRL | 'x': +diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c +index f4b0bb4..65effa9 100644 +--- a/grub-core/osdep/unix/config.c ++++ b/grub-core/osdep/unix/config.c +@@ -105,8 +105,8 @@ grub_util_load_config (struct grub_util_config *cfg) + *ptr++ = *iptr; + } + +- strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", " +- "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\""); ++ strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" " ++ "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\""); + + argv[2] = script; + argv[3] = '\0'; +diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c +index c3de5c4..f1e2143 100644 +--- a/grub-core/tests/cmdline_cat_test.c ++++ b/grub-core/tests/cmdline_cat_test.c +@@ -109,7 +109,7 @@ cmdline_cat_test (void) + grub_video_checksum ("cmdline_cat"); + + if (!grub_test_use_gfxterm ()) +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + + grub_test_use_gfxterm_end (); + +diff --git a/include/grub/normal.h b/include/grub/normal.h +index c4ab193..218cbab 100644 +--- a/include/grub/normal.h ++++ b/include/grub/normal.h +@@ -66,7 +66,7 @@ void grub_menu_init_page (int nested, int edit, + struct grub_term_output *term); + void grub_normal_init_page (struct grub_term_output *term, int y); + char *grub_file_getline (grub_file_t file); +-void grub_cmdline_run (int nested); ++void grub_cmdline_run (int nested, int force_auth); + + /* Defined in `cmdline.c'. */ + char *grub_cmdline_get (const char *prompt); +-- +2.4.3 + diff --git a/0103-Fix-wrong-commit.patch b/0103-Fix-wrong-commit.patch new file mode 100644 index 0000000..49c36c6 --- /dev/null +++ b/0103-Fix-wrong-commit.patch @@ -0,0 +1,130 @@ +From 5e42618e001ab28346ee1a3f4591977afda7f2f5 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 21 Sep 2014 18:18:03 +0200 +Subject: [PATCH 103/506] Fix wrong commit + +--- + grub-core/commands/keylayouts.c | 4 +--- + grub-core/gmodule.pl.in | 2 +- + grub-core/normal/main.c | 10 +++------- + grub-core/normal/menu.c | 2 +- + grub-core/normal/menu_entry.c | 2 +- + grub-core/tests/cmdline_cat_test.c | 2 +- + include/grub/normal.h | 2 +- + 7 files changed, 9 insertions(+), 15 deletions(-) + +diff --git a/grub-core/commands/keylayouts.c b/grub-core/commands/keylayouts.c +index f4b7730..da04389 100644 +--- a/grub-core/commands/keylayouts.c ++++ b/grub-core/commands/keylayouts.c +@@ -173,10 +173,8 @@ grub_term_map_key (grub_keyboard_key_t code, int status) + + key = map_key_core (code, status, &alt_gr_consumed); + +- if (key == 0 || key == GRUB_TERM_SHIFT) { ++ if (key == 0 || key == GRUB_TERM_SHIFT) + grub_printf ("Unknown key 0x%x detected\n", code); +- return GRUB_TERM_NO_KEY; +- } + + if (status & GRUB_TERM_STATUS_CAPS) + { +diff --git a/grub-core/gmodule.pl.in b/grub-core/gmodule.pl.in +index 78aa1e6..6739a6f 100644 +--- a/grub-core/gmodule.pl.in ++++ b/grub-core/gmodule.pl.in +@@ -23,7 +23,7 @@ while (<>) { + } + + print " -s $2 $sections{$1}" +- if ($sections{$1} ne '0x0' and $sections{$1} ne ''); ++ if ($sections{$1} ne '0x0'); + }; + close (READELF); + print "\n"; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index c41f175..3a926fc 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -302,7 +302,7 @@ grub_enter_normal_mode (const char *config) + nested_level++; + grub_normal_execute (config, 0, 0); + grub_boot_time ("Entering shell"); +- grub_cmdline_run (0, 1); ++ grub_cmdline_run (0); + nested_level--; + if (grub_normal_exit_level) + grub_normal_exit_level--; +@@ -424,15 +424,11 @@ grub_normal_read_line (char **line, int cont, + } + + void +-grub_cmdline_run (int nested, int force_auth) ++grub_cmdline_run (int nested) + { + grub_err_t err = GRUB_ERR_NONE; + +- do +- { +- err = grub_auth_check_authentication (NULL); +- } +- while (err && force_auth); ++ err = grub_auth_check_authentication (NULL); + + if (err) + { +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index 719e2fb..b47991a 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -773,7 +773,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + + case 'c': + menu_fini (); +- grub_cmdline_run (1, 0); ++ grub_cmdline_run (1); + goto refresh; + + case 'e': +diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c +index 62c7e16..b485df8 100644 +--- a/grub-core/normal/menu_entry.c ++++ b/grub-core/normal/menu_entry.c +@@ -1396,7 +1396,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) + + case GRUB_TERM_CTRL | 'c': + case GRUB_TERM_KEY_F2: +- grub_cmdline_run (1, 0); ++ grub_cmdline_run (1); + goto refresh; + + case GRUB_TERM_CTRL | 'x': +diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c +index f1e2143..c3de5c4 100644 +--- a/grub-core/tests/cmdline_cat_test.c ++++ b/grub-core/tests/cmdline_cat_test.c +@@ -109,7 +109,7 @@ cmdline_cat_test (void) + grub_video_checksum ("cmdline_cat"); + + if (!grub_test_use_gfxterm ()) +- grub_cmdline_run (1, 0); ++ grub_cmdline_run (1); + + grub_test_use_gfxterm_end (); + +diff --git a/include/grub/normal.h b/include/grub/normal.h +index 218cbab..c4ab193 100644 +--- a/include/grub/normal.h ++++ b/include/grub/normal.h +@@ -66,7 +66,7 @@ void grub_menu_init_page (int nested, int edit, + struct grub_term_output *term); + void grub_normal_init_page (struct grub_term_output *term, int y); + char *grub_file_getline (grub_file_t file); +-void grub_cmdline_run (int nested, int force_auth); ++void grub_cmdline_run (int nested); + + /* Defined in `cmdline.c'. */ + char *grub_cmdline_get (const char *prompt); +-- +2.4.3 + diff --git a/0104-grub-core-gmodule.pl.in-Accept-newer-binutils-which-.patch b/0104-grub-core-gmodule.pl.in-Accept-newer-binutils-which-.patch new file mode 100644 index 0000000..dacedbd --- /dev/null +++ b/0104-grub-core-gmodule.pl.in-Accept-newer-binutils-which-.patch @@ -0,0 +1,40 @@ +From 2988a849fcf9f7b3c9fca94a4b1cd5913ca4c912 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 21 Sep 2014 18:23:23 +0200 +Subject: [PATCH 104/506] * grub-core/gmodule.pl.in: Accept newer + binutils which output empty column rather than 0x0. + +--- + ChangeLog | 5 +++++ + grub-core/gmodule.pl.in | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index bac248c..163265b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-09-21 Vladimir Serbinenko ++ ++ * grub-core/gmodule.pl.in: Accept newer binutils which output ++ empty column rather than 0x0. ++ + 2014-09-21 Michael Chang + + * grub-core/osdep/unix/config.c: Remove extraneous comma. +diff --git a/grub-core/gmodule.pl.in b/grub-core/gmodule.pl.in +index 6739a6f..78aa1e6 100644 +--- a/grub-core/gmodule.pl.in ++++ b/grub-core/gmodule.pl.in +@@ -23,7 +23,7 @@ while (<>) { + } + + print " -s $2 $sections{$1}" +- if ($sections{$1} ne '0x0'); ++ if ($sections{$1} ne '0x0' and $sections{$1} ne ''); + }; + close (READELF); + print "\n"; +-- +2.4.3 + diff --git a/0105-grub-core-commands-keylayouts.c-Ignore-unknown-keys.patch b/0105-grub-core-commands-keylayouts.c-Ignore-unknown-keys.patch new file mode 100644 index 0000000..ff31225 --- /dev/null +++ b/0105-grub-core-commands-keylayouts.c-Ignore-unknown-keys.patch @@ -0,0 +1,44 @@ +From 7c378c3964a19ae6da0648ca18cf37308b072629 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 21 Sep 2014 18:49:49 +0200 +Subject: [PATCH 105/506] * grub-core/commands/keylayouts.c: Ignore + unknown keys. + +--- + ChangeLog | 4 ++++ + grub-core/commands/keylayouts.c | 4 +++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 163265b..6d4e295 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-09-21 Vladimir Serbinenko + ++ * grub-core/commands/keylayouts.c: Ignore unknown keys. ++ ++2014-09-21 Vladimir Serbinenko ++ + * grub-core/gmodule.pl.in: Accept newer binutils which output + empty column rather than 0x0. + +diff --git a/grub-core/commands/keylayouts.c b/grub-core/commands/keylayouts.c +index da04389..f4b7730 100644 +--- a/grub-core/commands/keylayouts.c ++++ b/grub-core/commands/keylayouts.c +@@ -173,8 +173,10 @@ grub_term_map_key (grub_keyboard_key_t code, int status) + + key = map_key_core (code, status, &alt_gr_consumed); + +- if (key == 0 || key == GRUB_TERM_SHIFT) ++ if (key == 0 || key == GRUB_TERM_SHIFT) { + grub_printf ("Unknown key 0x%x detected\n", code); ++ return GRUB_TERM_NO_KEY; ++ } + + if (status & GRUB_TERM_STATUS_CAPS) + { +-- +2.4.3 + diff --git a/0106-grub-core-normal-main.c-Don-t-drop-to-rescue-console.patch b/0106-grub-core-normal-main.c-Don-t-drop-to-rescue-console.patch new file mode 100644 index 0000000..d5ef595 --- /dev/null +++ b/0106-grub-core-normal-main.c-Don-t-drop-to-rescue-console.patch @@ -0,0 +1,116 @@ +From 41c6f91fce842b6c9565b8a61bf6289ba0f5cd6a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 21 Sep 2014 18:51:09 +0200 +Subject: [PATCH 106/506] * grub-core/normal/main.c: Don't drop to + rescue console in case of password-protected prompt and no menu entries. + +--- + ChangeLog | 5 +++++ + grub-core/normal/main.c | 10 +++++++--- + grub-core/normal/menu.c | 2 +- + grub-core/normal/menu_entry.c | 2 +- + grub-core/tests/cmdline_cat_test.c | 2 +- + include/grub/normal.h | 2 +- + 6 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6d4e295..002461c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-09-21 Vladimir Serbinenko + ++ * grub-core/normal/main.c: Don't drop to rescue console in ++ case of password-protected prompt and no menu entries. ++ ++2014-09-21 Vladimir Serbinenko ++ + * grub-core/commands/keylayouts.c: Ignore unknown keys. + + 2014-09-21 Vladimir Serbinenko +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 3a926fc..c41f175 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -302,7 +302,7 @@ grub_enter_normal_mode (const char *config) + nested_level++; + grub_normal_execute (config, 0, 0); + grub_boot_time ("Entering shell"); +- grub_cmdline_run (0); ++ grub_cmdline_run (0, 1); + nested_level--; + if (grub_normal_exit_level) + grub_normal_exit_level--; +@@ -424,11 +424,15 @@ grub_normal_read_line (char **line, int cont, + } + + void +-grub_cmdline_run (int nested) ++grub_cmdline_run (int nested, int force_auth) + { + grub_err_t err = GRUB_ERR_NONE; + +- err = grub_auth_check_authentication (NULL); ++ do ++ { ++ err = grub_auth_check_authentication (NULL); ++ } ++ while (err && force_auth); + + if (err) + { +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index b47991a..719e2fb 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -773,7 +773,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + + case 'c': + menu_fini (); +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + goto refresh; + + case 'e': +diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c +index b485df8..62c7e16 100644 +--- a/grub-core/normal/menu_entry.c ++++ b/grub-core/normal/menu_entry.c +@@ -1396,7 +1396,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) + + case GRUB_TERM_CTRL | 'c': + case GRUB_TERM_KEY_F2: +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + goto refresh; + + case GRUB_TERM_CTRL | 'x': +diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c +index c3de5c4..f1e2143 100644 +--- a/grub-core/tests/cmdline_cat_test.c ++++ b/grub-core/tests/cmdline_cat_test.c +@@ -109,7 +109,7 @@ cmdline_cat_test (void) + grub_video_checksum ("cmdline_cat"); + + if (!grub_test_use_gfxterm ()) +- grub_cmdline_run (1); ++ grub_cmdline_run (1, 0); + + grub_test_use_gfxterm_end (); + +diff --git a/include/grub/normal.h b/include/grub/normal.h +index c4ab193..218cbab 100644 +--- a/include/grub/normal.h ++++ b/include/grub/normal.h +@@ -66,7 +66,7 @@ void grub_menu_init_page (int nested, int edit, + struct grub_term_output *term); + void grub_normal_init_page (struct grub_term_output *term, int y); + char *grub_file_getline (grub_file_t file); +-void grub_cmdline_run (int nested); ++void grub_cmdline_run (int nested, int force_auth); + + /* Defined in `cmdline.c'. */ + char *grub_cmdline_get (const char *prompt); +-- +2.4.3 + diff --git a/0107-ACPIhalt-Add-more-ACPI-opcodes.patch b/0107-ACPIhalt-Add-more-ACPI-opcodes.patch new file mode 100644 index 0000000..51b63d6 --- /dev/null +++ b/0107-ACPIhalt-Add-more-ACPI-opcodes.patch @@ -0,0 +1,173 @@ +From 0f1f95c7b7bc72cfbeea2f6dc5986855738ad96d Mon Sep 17 00:00:00 2001 +From: Valentin Dornauer +Date: Sun, 21 Sep 2014 18:58:14 +0200 +Subject: [PATCH 107/506] ACPIhalt: Add more ACPI opcodes. + + The AML parser implements only a small subset of possible AML + opcodes. On the Fujitsu Lifebook E744 this and another bug in + the parser (incorrect handling of TermArg data types) would lead + to the laptop not turning off (_S5 not found). + + * grub-core/commands/acpihalt.c: Support OpAlias in the AML parser; + in skip_ext_op(), handle some Type2Opcodes more correctly (TermArgs + aren't always simply strings!); Add function to skip TermArgs + * include/grub/acpi.h: Add new opcodes +--- + ChangeLog | 12 +++++++++ + grub-core/commands/acpihalt.c | 59 +++++++++++++++++++++++++++++++++++++++++-- + include/grub/acpi.h | 19 +++++++++++++- + 3 files changed, 87 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 002461c..6b35a5c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,15 @@ ++2014-09-21 Valentin Dornauer ++ ++ The AML parser implements only a small subset of possible AML ++ opcodes. On the Fujitsu Lifebook E744 this and another bug in ++ the parser (incorrect handling of TermArg data types) would lead ++ to the laptop not turning off (_S5 not found). ++ ++ * grub-core/commands/acpihalt.c: Support OpAlias in the AML parser; ++ in skip_ext_op(), handle some Type2Opcodes more correctly (TermArgs ++ aren't always simply strings!); Add function to skip TermArgs ++ * include/grub/acpi.h: Add new opcodes ++ + 2014-09-21 Vladimir Serbinenko + + * grub-core/normal/main.c: Don't drop to rescue console in +diff --git a/grub-core/commands/acpihalt.c b/grub-core/commands/acpihalt.c +index 83bdfe1..da68b5b 100644 +--- a/grub-core/commands/acpihalt.c ++++ b/grub-core/commands/acpihalt.c +@@ -136,6 +136,49 @@ skip_data_ref_object (const grub_uint8_t *ptr, const grub_uint8_t *end) + } + + static inline grub_uint32_t ++skip_term (const grub_uint8_t *ptr, const grub_uint8_t *end) ++{ ++ grub_uint32_t add; ++ const grub_uint8_t *ptr0 = ptr; ++ ++ switch(*ptr) ++ { ++ case GRUB_ACPI_OPCODE_ADD: ++ case GRUB_ACPI_OPCODE_AND: ++ case GRUB_ACPI_OPCODE_CONCAT: ++ case GRUB_ACPI_OPCODE_CONCATRES: ++ case GRUB_ACPI_OPCODE_DIVIDE: ++ case GRUB_ACPI_OPCODE_INDEX: ++ case GRUB_ACPI_OPCODE_LSHIFT: ++ case GRUB_ACPI_OPCODE_MOD: ++ case GRUB_ACPI_OPCODE_MULTIPLY: ++ case GRUB_ACPI_OPCODE_NAND: ++ case GRUB_ACPI_OPCODE_NOR: ++ case GRUB_ACPI_OPCODE_OR: ++ case GRUB_ACPI_OPCODE_RSHIFT: ++ case GRUB_ACPI_OPCODE_SUBTRACT: ++ case GRUB_ACPI_OPCODE_TOSTRING: ++ case GRUB_ACPI_OPCODE_XOR: ++ /* ++ * Parameters for these opcodes: TermArg, TermArg Target, see ACPI ++ * spec r5.0, page 828f. ++ */ ++ ptr++; ++ ptr += add = skip_term (ptr, end); ++ if (!add) ++ return 0; ++ ptr += add = skip_term (ptr, end); ++ if (!add) ++ return 0; ++ ptr += skip_name_string (ptr, end); ++ break; ++ default: ++ return skip_data_ref_object (ptr, end); ++ } ++ return ptr - ptr0; ++} ++ ++static inline grub_uint32_t + skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) + { + const grub_uint8_t *ptr0 = ptr; +@@ -156,10 +199,10 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) + ptr++; + ptr += skip_name_string (ptr, end); + ptr++; +- ptr += add = skip_data_ref_object (ptr, end); ++ ptr += add = skip_term (ptr, end); + if (!add) + return 0; +- ptr += add = skip_data_ref_object (ptr, end); ++ ptr += add = skip_term (ptr, end); + if (!add) + return 0; + break; +@@ -180,6 +223,7 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) + return ptr - ptr0; + } + ++ + static int + get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, + grub_uint8_t *scope, int scope_len) +@@ -250,6 +294,17 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, + if (!add) + return -1; + break; ++ case GRUB_ACPI_OPCODE_ALIAS: ++ ptr++; ++ /* We need to skip two name strings */ ++ ptr += add = skip_name_string (ptr, end); ++ if (!add) ++ return -1; ++ ptr += add = skip_name_string (ptr, end); ++ if (!add) ++ return -1; ++ break; ++ + case GRUB_ACPI_OPCODE_SCOPE: + { + int scope_sleep_type; +diff --git a/include/grub/acpi.h b/include/grub/acpi.h +index 2ac2bd6..f6e6a11 100644 +--- a/include/grub/acpi.h ++++ b/include/grub/acpi.h +@@ -191,7 +191,8 @@ void grub_acpi_halt (void); + enum + { + GRUB_ACPI_OPCODE_ZERO = 0, GRUB_ACPI_OPCODE_ONE = 1, +- GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a, ++ GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_ALIAS = 0x06, ++ GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a, + GRUB_ACPI_OPCODE_WORD_CONST = 0x0b, + GRUB_ACPI_OPCODE_DWORD_CONST = 0x0c, + GRUB_ACPI_OPCODE_STRING_CONST = 0x0d, +@@ -199,6 +200,22 @@ enum + GRUB_ACPI_OPCODE_BUFFER = 0x11, + GRUB_ACPI_OPCODE_PACKAGE = 0x12, + GRUB_ACPI_OPCODE_METHOD = 0x14, GRUB_ACPI_OPCODE_EXTOP = 0x5b, ++ GRUB_ACPI_OPCODE_ADD = 0x72, ++ GRUB_ACPI_OPCODE_CONCAT = 0x73, ++ GRUB_ACPI_OPCODE_SUBTRACT = 0x74, ++ GRUB_ACPI_OPCODE_MULTIPLY = 0x77, ++ GRUB_ACPI_OPCODE_DIVIDE = 0x78, ++ GRUB_ACPI_OPCODE_LSHIFT = 0x79, ++ GRUB_ACPI_OPCODE_RSHIFT = 0x7a, ++ GRUB_ACPI_OPCODE_AND = 0x7b, ++ GRUB_ACPI_OPCODE_NAND = 0x7c, ++ GRUB_ACPI_OPCODE_OR = 0x7d, ++ GRUB_ACPI_OPCODE_NOR = 0x7e, ++ GRUB_ACPI_OPCODE_XOR = 0x7f, ++ GRUB_ACPI_OPCODE_CONCATRES = 0x84, ++ GRUB_ACPI_OPCODE_MOD = 0x85, ++ GRUB_ACPI_OPCODE_INDEX = 0x88, ++ GRUB_ACPI_OPCODE_TOSTRING = 0x9c, + GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b, + GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c, + GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff +-- +2.4.3 + diff --git a/0108-Revert-Use-Wl-no-relax-rather-than-mno-relax-for-uni.patch b/0108-Revert-Use-Wl-no-relax-rather-than-mno-relax-for-uni.patch new file mode 100644 index 0000000..5b8ce4c --- /dev/null +++ b/0108-Revert-Use-Wl-no-relax-rather-than-mno-relax-for-uni.patch @@ -0,0 +1,43 @@ +From 6d05b6383c0ea1a094cbfdbd503af31af0f6c393 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 21 Sep 2014 19:02:11 +0200 +Subject: [PATCH 108/506] Revert " Use -Wl,--no-relax rather than + -mno-relax for uniformity." + +This reverts commit 063f2a04d158ec1b275a925dfbae74b124708cde. +--- + ChangeLog | 4 ---- + conf/Makefile.common | 2 +- + 2 files changed, 1 insertion(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6b35a5c..6d786ba 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -988,10 +988,6 @@ + + 2013-12-18 Vladimir Serbinenko + +- Use -Wl,--no-relax rather than -mno-relax for uniformity. +- +-2013-12-18 Vladimir Serbinenko +- + * INSTALL: Update comment as to why sparc64 clang isn't usable. + + 2013-12-18 Vladimir Serbinenko +diff --git a/conf/Makefile.common b/conf/Makefile.common +index e4c301f..51fbaf9 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -8,7 +8,7 @@ unexport LC_ALL + # Platform specific options + if COND_sparc64_ieee1275 + CFLAGS_PLATFORM += -mno-app-regs +- LDFLAGS_PLATFORM = -Wl,-melf64_sparc -Wl,--no-relax ++ LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax + endif + if COND_sparc64_emu + CFLAGS_PLATFORM += -mno-app-regs +-- +2.4.3 + diff --git a/0109-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch b/0109-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch new file mode 100644 index 0000000..9131aef --- /dev/null +++ b/0109-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch @@ -0,0 +1,779 @@ +From 954fe77163dc12ccbb3d958b9dbb330aa59b62fe Mon Sep 17 00:00:00 2001 +From: Andrey Borzenkov +Date: Mon, 22 Sep 2014 20:47:10 +0400 +Subject: [PATCH 109/506] cleanup: grub_cpu_to_XXX_compile_time for constants + +This tries to catch all cases where grub_cpu_to_XXX was used for constant +expressions (including sizeof). +--- + ChangeLog | 4 ++++ + grub-core/bus/usb/ehci.c | 44 ++++++++++++++++++++-------------------- + grub-core/bus/usb/ohci.c | 8 ++++---- + grub-core/commands/gptsync.c | 6 +++--- + grub-core/disk/mdraid_linux.c | 12 +++++------ + grub-core/disk/scsi.c | 2 +- + grub-core/disk/usbms.c | 4 ++-- + grub-core/fs/hfs.c | 2 +- + grub-core/fs/reiserfs.c | 12 +++++------ + grub-core/lib/fdt.c | 12 +++++------ + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 20 +++++++++--------- + grub-core/loader/i386/xen_file.c | 4 ++-- + grub-core/net/arp.c | 4 ++-- + grub-core/net/bootp.c | 4 ++-- + grub-core/net/ip.c | 2 +- + grub-core/net/net.c | 2 +- + grub-core/net/tftp.c | 8 ++++---- + grub-core/partmap/acorn.c | 4 ++-- + grub-core/partmap/bsdlabel.c | 2 +- + grub-core/partmap/gpt.c | 2 +- + grub-core/partmap/msdos.c | 4 ++-- + grub-core/tests/video_checksum.c | 6 +++--- + util/grub-mkfont.c | 4 ++-- + util/grub-mklayout.c | 2 +- + util/mkimage.c | 15 +++++++------- + 26 files changed, 98 insertions(+), 93 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6d786ba..8316b8f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-09-22 Andrei Borzenkov ++ ++ Use grub_cpu_to_XXX_compile_time for constants. ++ + 2014-09-21 Valentin Dornauer + + The AML parser implements only a small subset of possible AML +diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c +index c0feefa..8ece400 100644 +--- a/grub-core/bus/usb/ehci.c ++++ b/grub-core/bus/usb/ehci.c +@@ -670,23 +670,23 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, + for (i = 0; i < (GRUB_EHCI_N_TD - 1); i++) + { + e->td_virt[i].link_td = e->td_phys + (i + 1) * sizeof (struct grub_ehci_td); +- e->td_virt[i].next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); +- e->td_virt[i].alt_next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ e->td_virt[i].next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); ++ e->td_virt[i].alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + } + e->td_virt[GRUB_EHCI_N_TD - 1].next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->td_virt[GRUB_EHCI_N_TD - 1].alt_next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->tdfree_virt = e->td_virt; + /* Set Terminate in first QH, which is used in framelist */ +- e->qh_virt[0].qh_hptr = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH); +- e->qh_virt[0].td_overlay.next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ e->qh_virt[0].qh_hptr = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH); ++ e->qh_virt[0].td_overlay.next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->qh_virt[0].td_overlay.alt_next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + /* Also set Halted bit in token */ +- e->qh_virt[0].td_overlay.token = grub_cpu_to_le32 (GRUB_EHCI_STATUS_HALTED); ++ e->qh_virt[0].td_overlay.token = grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + /* Set the H bit in first QH used for AL */ +- e->qh_virt[1].ep_char = grub_cpu_to_le32 (GRUB_EHCI_H); ++ e->qh_virt[1].ep_char = grub_cpu_to_le32_compile_time (GRUB_EHCI_H); + /* Set Terminate into TD in rest of QHs and set horizontal link + * pointer to itself - these QHs will be used for asynchronous + * schedule and they should have valid value in horiz. link */ +@@ -697,12 +697,12 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, + e->qh_chunk) & + GRUB_EHCI_POINTER_MASK) | GRUB_EHCI_HPTR_TYPE_QH); + e->qh_virt[i].td_overlay.next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->qh_virt[i].td_overlay.alt_next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + /* Also set Halted bit in token */ + e->qh_virt[i].td_overlay.token = +- grub_cpu_to_le32 (GRUB_EHCI_STATUS_HALTED); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + } + + /* Note: QH 0 and QH 1 are reserved and must not be used anywhere. +@@ -991,7 +991,7 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer) + target = ((transfer->endpoint << GRUB_EHCI_EP_NUM_OFF) | + transfer->devaddr) & GRUB_EHCI_TARGET_MASK; + target = grub_cpu_to_le32 (target); +- mask = grub_cpu_to_le32 (GRUB_EHCI_TARGET_MASK); ++ mask = grub_cpu_to_le32_compile_time (GRUB_EHCI_TARGET_MASK); + + /* low speed interrupt transfers are linked to the periodic */ + /* schedule, everything else to the asynchronous schedule */ +@@ -1200,7 +1200,7 @@ grub_ehci_transaction (struct grub_ehci *e, + grub_memset ((void *) td, 0, sizeof (struct grub_ehci_td)); + + /* Don't point to any TD yet, just terminate. */ +- td->next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ td->next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + /* Set alternate pointer. When short packet occurs, alternate TD + * will not be really fetched because it is not active. But don't + * forget, EHCI will try to fetch alternate TD every scan of AL +@@ -1325,9 +1325,9 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, + /* Fill whole alternate TD by zeros (= inactive) and set + * Terminate bits and Halt bit */ + grub_memset ((void *) cdata->td_alt_virt, 0, sizeof (struct grub_ehci_td)); +- cdata->td_alt_virt->next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); +- cdata->td_alt_virt->alt_next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); +- cdata->td_alt_virt->token = grub_cpu_to_le32 (GRUB_EHCI_STATUS_HALTED); ++ cdata->td_alt_virt->next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); ++ cdata->td_alt_virt->alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); ++ cdata->td_alt_virt->token = grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + + /* Allocate appropriate number of TDs and set */ + for (i = 0; i < transfer->transcnt; i++) +@@ -1364,7 +1364,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, + cdata->td_last_virt = td; + cdata->td_last_phys = grub_dma_virt2phys (td, e->td_chunk); + /* Last TD should not have set alternate TD */ +- cdata->td_last_virt->alt_next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ cdata->td_last_virt->alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + + grub_dprintf ("ehci", "setup_transfer: cdata=%p, qh=%p\n", + cdata,cdata->qh_virt); +@@ -1377,14 +1377,14 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, + /* Start transfer: */ + /* Unlink possible alternate pointer in QH */ + cdata->qh_virt->td_overlay.alt_next_td = +- grub_cpu_to_le32 (GRUB_EHCI_TERMINATE); ++ grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + /* Link new TDs with QH via next_td */ + cdata->qh_virt->td_overlay.next_td = + grub_cpu_to_le32 (grub_dma_virt2phys + (cdata->td_first_virt, e->td_chunk)); + /* Reset Active and Halted bits in QH to activate Advance Queue, + * i.e. reset token */ +- cdata->qh_virt->td_overlay.token = grub_cpu_to_le32 (0); ++ cdata->qh_virt->td_overlay.token = grub_cpu_to_le32_compile_time (0); + + /* Finito */ + transfer->controller_data = cdata; +@@ -1408,9 +1408,9 @@ grub_ehci_pre_finish_transfer (grub_usb_transfer_t transfer) + * safely manipulate with QH TD part. */ + cdata->qh_virt->td_overlay.token = (cdata->qh_virt->td_overlay.token + | +- grub_cpu_to_le32 ++ grub_cpu_to_le32_compile_time + (GRUB_EHCI_STATUS_HALTED)) & +- grub_cpu_to_le32 (~GRUB_EHCI_STATUS_ACTIVE); ++ grub_cpu_to_le32_compile_time (~GRUB_EHCI_STATUS_ACTIVE); + + /* Print debug data here if necessary */ + +diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c +index 946a4ed..d27bfe7 100644 +--- a/grub-core/bus/usb/ohci.c ++++ b/grub-core/bus/usb/ohci.c +@@ -314,7 +314,7 @@ grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, + grub_memset ((void *) o->ed_ctrl, 0, sizeof (struct grub_ohci_ed) + * GRUB_OHCI_CTRL_EDS); + for (j=0; j < GRUB_OHCI_CTRL_EDS; j++) +- o->ed_ctrl[j].target = grub_cpu_to_le32 (1 << 14); /* skip */ ++ o->ed_ctrl[j].target = grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + + grub_dprintf ("ohci", "EDs-C: chunk=%p, virt=%p, phys=0x%02x\n", + o->ed_ctrl_chunk, o->ed_ctrl, o->ed_ctrl_addr); +@@ -329,7 +329,7 @@ grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, + /* Preset EDs */ + grub_memset ((void*)o->ed_bulk, 0, sizeof(struct grub_ohci_ed) * GRUB_OHCI_BULK_EDS); + for (j=0; j < GRUB_OHCI_BULK_EDS; j++) +- o->ed_bulk[j].target = grub_cpu_to_le32 (1 << 14); /* skip */ ++ o->ed_bulk[j].target = grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + + grub_dprintf ("ohci", "EDs-B: chunk=%p, virt=%p, phys=0x%02x\n", + o->ed_bulk_chunk, o->ed_bulk, o->ed_bulk_addr); +@@ -1349,10 +1349,10 @@ grub_ohci_fini_hw (int noreturn __attribute__ ((unused))) + /* Set skip in all EDs */ + if (o->ed_bulk) + for (i=0; i < GRUB_OHCI_BULK_EDS; i++) +- o->ed_bulk[i].target |= grub_cpu_to_le32 (1 << 14); /* skip */ ++ o->ed_bulk[i].target |= grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + if (o->ed_ctrl) + for (i=0; i < GRUB_OHCI_CTRL_EDS; i++) +- o->ed_ctrl[i].target |= grub_cpu_to_le32 (1 << 14); /* skip */ ++ o->ed_ctrl[i].target |= grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + + /* We should wait for next SOF to be sure that all EDs are + * unaccessed by OHCI. But OHCI can be non-functional, so +diff --git a/grub-core/commands/gptsync.c b/grub-core/commands/gptsync.c +index 3db6288..16592e9 100644 +--- a/grub-core/commands/gptsync.c ++++ b/grub-core/commands/gptsync.c +@@ -101,7 +101,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), + } + + /* Check if it is valid. */ +- if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) ++ if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); +@@ -216,7 +216,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), + first_sector--; + mbr.entries[0].flag = 0; + mbr.entries[0].type = GRUB_PC_PARTITION_TYPE_GPT_DISK; +- mbr.entries[0].start = grub_cpu_to_le32 (1); ++ mbr.entries[0].start = grub_cpu_to_le32_compile_time (1); + lba_to_chs (1, + &(mbr.entries[0].start_sector), + &(mbr.entries[0].start_cylinder), +@@ -227,7 +227,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), + &(mbr.entries[0].end_head)); + mbr.entries[0].length = grub_cpu_to_le32 (first_sector); + +- mbr.signature = grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE); ++ mbr.signature = grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE); + + if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr)) + { +diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c +index 4aa5882..11024ae 100644 +--- a/grub-core/disk/mdraid_linux.c ++++ b/grub-core/disk/mdraid_linux.c +@@ -33,16 +33,16 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #define grub_md_to_cpu64 grub_be_to_cpu64 + #define grub_md_to_cpu32 grub_be_to_cpu32 + #define grub_md_to_cpu16 grub_be_to_cpu16 +-#define grub_cpu_to_md64_compile_time grub_cpu_to_be64 +-#define grub_cpu_to_md32_compile_time grub_cpu_to_be32 +-#define grub_cpu_to_md16_compile_time grub_cpu_to_be16 ++#define grub_cpu_to_md64_compile_time grub_cpu_to_be64_compile_time ++#define grub_cpu_to_md32_compile_time grub_cpu_to_be32_compile_time ++#define grub_cpu_to_md16_compile_time grub_cpu_to_be16_compile_time + #else + #define grub_md_to_cpu64 grub_le_to_cpu64 + #define grub_md_to_cpu32 grub_le_to_cpu32 + #define grub_md_to_cpu16 grub_le_to_cpu16 +-#define grub_cpu_to_md64_compile_time grub_cpu_to_le64 +-#define grub_cpu_to_md32_compile_time grub_cpu_to_le32 +-#define grub_cpu_to_md16_compile_time grub_cpu_to_le16 ++#define grub_cpu_to_md64_compile_time grub_cpu_to_le64_compile_time ++#define grub_cpu_to_md32_compile_time grub_cpu_to_le32_compile_time ++#define grub_cpu_to_md16_compile_time grub_cpu_to_le16_compile_time + #endif + + #define RESERVED_BYTES (64 * 1024) +diff --git a/grub-core/disk/scsi.c b/grub-core/disk/scsi.c +index b6cb2f4..92084d0 100644 +--- a/grub-core/disk/scsi.c ++++ b/grub-core/disk/scsi.c +@@ -201,7 +201,7 @@ grub_scsi_read_capacity16 (grub_scsi_t scsi) + rc.opcode = grub_scsi_cmd_read_capacity16; + rc.lun = (scsi->lun << GRUB_SCSI_LUN_SHIFT) | 0x10; + rc.logical_block_addr = 0; +- rc.alloc_len = grub_cpu_to_be32 (sizeof (rcd)); ++ rc.alloc_len = grub_cpu_to_be32_compile_time (sizeof (rcd)); + rc.PMI = 0; + rc.control = 0; + +diff --git a/grub-core/disk/usbms.c b/grub-core/disk/usbms.c +index 2b769bd..380ca4c 100644 +--- a/grub-core/disk/usbms.c ++++ b/grub-core/disk/usbms.c +@@ -307,7 +307,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + + /* Setup the request. */ + grub_memset (&cbw, 0, sizeof (cbw)); +- cbw.signature = grub_cpu_to_le32 (0x43425355); ++ cbw.signature = grub_cpu_to_le32_compile_time (0x43425355); + cbw.tag = tag; + cbw.transfer_length = grub_cpu_to_le32 (size); + cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT; +@@ -414,7 +414,7 @@ CheckCSW: + + /* If phase error or not valid signature, do bulk-only reset device. */ + if ((status.status == 2) || +- (status.signature != grub_cpu_to_le32(0x53425355))) ++ (status.signature != grub_cpu_to_le32_compile_time(0x53425355))) + { /* Bulk-only reset device. */ + grub_dprintf ("usb", "Bulk-only reset device - bad status\n"); + grub_usbms_reset (dev); +diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c +index 1e59305..d1dc015 100644 +--- a/grub-core/fs/hfs.c ++++ b/grub-core/fs/hfs.c +@@ -369,7 +369,7 @@ grub_hfs_mount (grub_disk_t disk) + + /* Lookup the root directory node in the catalog tree using the + volume name. */ +- key.parent_dir = grub_cpu_to_be32 (1); ++ key.parent_dir = grub_cpu_to_be32_compile_time (1); + key.strlen = data->sblock.volname[0]; + grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); + +diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c +index ac65054..de3d4fa 100644 +--- a/grub-core/fs/reiserfs.c ++++ b/grub-core/fs/reiserfs.c +@@ -365,7 +365,7 @@ grub_reiserfs_set_key_offset (struct grub_reiserfs_key *key, + key->u.v1.offset = grub_cpu_to_le32 (value); + else + key->u.v2.offset_type \ +- = ((key->u.v2.offset_type & grub_cpu_to_le64 (15ULL << 60)) ++ = ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (15ULL << 60)) + | grub_cpu_to_le64 (value & (~0ULL >> 4))); + } + +@@ -412,7 +412,7 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key, + key->u.v1.type = grub_cpu_to_le32 (type); + else + key->u.v2.offset_type +- = ((key->u.v2.offset_type & grub_cpu_to_le64 (~0ULL >> 4)) ++ = ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (~0ULL >> 4)) + | grub_cpu_to_le64 ((grub_uint64_t) type << 60)); + + assert (grub_reiserfs_get_key_type (key) == grub_type); +@@ -997,8 +997,8 @@ grub_reiserfs_open (struct grub_file *file, const char *name) + data = grub_reiserfs_mount (file->device->disk); + if (! data) + goto fail; +- key.directory_id = grub_cpu_to_le32 (1); +- key.object_id = grub_cpu_to_le32 (2); ++ key.directory_id = grub_cpu_to_le32_compile_time (1); ++ key.object_id = grub_cpu_to_le32_compile_time (2); + key.u.v2.offset_type = 0; + grub_reiserfs_set_key_type (&key, GRUB_REISERFS_DIRECTORY, 2); + grub_reiserfs_set_key_offset (&key, 1); +@@ -1289,8 +1289,8 @@ grub_reiserfs_dir (grub_device_t device, const char *path, + data = grub_reiserfs_mount (device->disk); + if (! data) + goto fail; +- root_key.directory_id = grub_cpu_to_le32 (1); +- root_key.object_id = grub_cpu_to_le32 (2); ++ root_key.directory_id = grub_cpu_to_le32_compile_time (1); ++ root_key.object_id = grub_cpu_to_le32_compile_time (2); + root_key.u.v2.offset_type = 0; + grub_reiserfs_set_key_type (&root_key, GRUB_REISERFS_DIRECTORY, 2); + grub_reiserfs_set_key_offset (&root_key, 1); +diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c +index 907a7bf..7e76dc0 100644 +--- a/grub-core/lib/fdt.c ++++ b/grub-core/lib/fdt.c +@@ -164,10 +164,10 @@ static int add_subnode (void *fdt, int parentoffset, const char *name) + insert: + grub_memmove (token + entry_size / sizeof(*token), token, + (grub_addr_t) end - (grub_addr_t) token); +- *token = grub_cpu_to_be32(FDT_BEGIN_NODE); ++ *token = grub_cpu_to_be32_compile_time(FDT_BEGIN_NODE); + token[entry_size / sizeof(*token) - 2] = 0; /* padding bytes */ + grub_strcpy((char *) (token + 1), name); +- token[entry_size / sizeof(*token) - 1] = grub_cpu_to_be32(FDT_END_NODE); ++ token[entry_size / sizeof(*token) - 1] = grub_cpu_to_be32_compile_time(FDT_END_NODE); + grub_fdt_set_size_dt_struct (fdt, struct_size + entry_size); + return ((grub_addr_t) token - (grub_addr_t) fdt + - grub_fdt_get_off_dt_struct(fdt)); +@@ -377,7 +377,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + + prop_name_present = 1; + for (i = 0; i < prop_len / sizeof(grub_uint32_t); i++) +- *(prop + 3 + i) = grub_cpu_to_be32 (FDT_NOP); ++ *(prop + 3 + i) = grub_cpu_to_be32_compile_time (FDT_NOP); + if (len > ALIGN_UP(prop_len, sizeof(grub_uint32_t))) + { + /* Length of new property value is greater than the space allocated +@@ -385,7 +385,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + nameoff field of the current entry and replace the current entry + with NOP tokens. */ + nameoff = grub_be_to_cpu32 (*(prop + 2)); +- *prop = *(prop + 1) = *(prop + 2) = grub_cpu_to_be32 (FDT_NOP); ++ *prop = *(prop + 1) = *(prop + 2) = grub_cpu_to_be32_compile_time (FDT_NOP); + prop = NULL; + } + } +@@ -419,7 +419,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + 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)); +- *prop = grub_cpu_to_be32 (FDT_PROP); ++ *prop = grub_cpu_to_be32_compile_time (FDT_PROP); + *(prop + 2) = grub_cpu_to_be32 (nameoff); + } + *(prop + 1) = grub_cpu_to_be32 (len); +@@ -447,7 +447,7 @@ grub_fdt_create_empty_tree (void *fdt, unsigned int size) + et->empty_node.node_end = grub_cpu_to_be32_compile_time (FDT_END_NODE); + et->empty_node.node_start = grub_cpu_to_be32_compile_time (FDT_BEGIN_NODE); + ((struct grub_fdt_empty_tree *) fdt)->header.off_mem_rsvmap = +- grub_cpu_to_be32 (ALIGN_UP (sizeof (grub_fdt_header_t), 8)); ++ grub_cpu_to_be32_compile_time (ALIGN_UP (sizeof (grub_fdt_header_t), 8)); + + grub_fdt_set_off_dt_strings (fdt, sizeof (*et)); + grub_fdt_set_off_dt_struct (fdt, +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 2ae1763..0bd060a 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -722,7 +722,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 (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_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 b481e46..e88341e 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -151,7 +151,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) ++ if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) + { + grub_error (GRUB_ERR_BAD_OS, "invalid magic number"); + goto fail; +@@ -169,7 +169,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + maximal_cmdline_size = 256; + +- if (lh.header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + && grub_le_to_cpu16 (lh.version) >= 0x0200) + { + grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); +@@ -188,7 +188,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + if (grub_le_to_cpu16 (lh.version) >= 0x0201) + { +- lh.heap_end_ptr = grub_cpu_to_le16 (GRUB_LINUX_HEAP_END_OFFSET); ++ lh.heap_end_ptr = grub_cpu_to_le16_compile_time (GRUB_LINUX_HEAP_END_OFFSET); + lh.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; + } + +@@ -196,17 +196,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + lh.cmd_line_ptr = grub_linux_real_target + GRUB_LINUX_CL_OFFSET; + else + { +- lh.cl_magic = grub_cpu_to_le16 (GRUB_LINUX_CL_MAGIC); +- lh.cl_offset = grub_cpu_to_le16 (GRUB_LINUX_CL_OFFSET); +- lh.setup_move_size = grub_cpu_to_le16 (GRUB_LINUX_CL_OFFSET ++ lh.cl_magic = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_MAGIC); ++ lh.cl_offset = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET); ++ lh.setup_move_size = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET + + maximal_cmdline_size); + } + } + else + { + /* Your kernel is quite old... */ +- lh.cl_magic = grub_cpu_to_le16 (GRUB_LINUX_CL_MAGIC); +- lh.cl_offset = grub_cpu_to_le16 (GRUB_LINUX_CL_OFFSET); ++ lh.cl_magic = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_MAGIC); ++ lh.cl_offset = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET); + + setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + +@@ -319,7 +319,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0200) + /* Clear the heap space. */ + grub_memset (grub_linux_real_chunk +@@ -404,7 +404,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 (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_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 ff23235..5836218 100644 +--- a/grub-core/loader/i386/xen_file.c ++++ b/grub-core/loader/i386/xen_file.c +@@ -38,8 +38,8 @@ grub_xen_file (grub_file_t file) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + goto fail; + +- if (lh.boot_flag != grub_cpu_to_le16 (0xaa55) +- || lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) ++ if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55) ++ || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0208) + { + grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); +diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c +index d62d0cc..8cc390b 100644 +--- a/grub-core/net/arp.c ++++ b/grub-core/net/arp.c +@@ -81,11 +81,11 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, + return err; + + arp_header = (struct arphdr *) nb.data; +- arp_header->hrd = grub_cpu_to_be16 (GRUB_NET_ARPHRD_ETHERNET); ++ arp_header->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); + arp_header->hln = 6; + arp_header->pro = grub_cpu_to_be16 (etherpro); + arp_header->pln = addrlen; +- arp_header->op = grub_cpu_to_be16 (ARP_REQUEST); ++ arp_header->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); + aux = (grub_uint8_t *) arp_header + sizeof (*arp_header); + /* Sender hardware address. */ + grub_memcpy (aux, &inf->hwaddress.mac, 6); +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 6310ed4..6136755 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -522,8 +522,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), + grub_netbuff_push (nb, sizeof (*udph)); + + udph = (struct udphdr *) nb->data; +- udph->src = grub_cpu_to_be16 (68); +- udph->dst = grub_cpu_to_be16 (67); ++ udph->src = grub_cpu_to_be16_compile_time (68); ++ udph->dst = grub_cpu_to_be16_compile_time (67); + udph->chksum = 0; + udph->len = grub_cpu_to_be16 (nb->tail - nb->data); + target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c +index c6971f9..5a60954 100644 +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -611,7 +611,7 @@ grub_net_send_ip6_packet (struct grub_net_network_level_interface *inf, + grub_netbuff_push (nb, sizeof (*iph)); + iph = (struct ip6hdr *) nb->data; + +- iph->version_class_flow = grub_cpu_to_be32 ((6 << 28)); ++ iph->version_class_flow = grub_cpu_to_be32_compile_time ((6 << 28)); + iph->len = grub_cpu_to_be16 (nb->tail - nb->data - sizeof (*iph)); + iph->protocol = proto; + iph->ttl = 0xff; +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index f2e723b..82af3a0 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -306,7 +306,7 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, + return NULL; + + addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; +- addr.ipv6[0] = grub_cpu_to_be64 (0xfe80ULL << 48); ++ addr.ipv6[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48); + addr.ipv6[1] = grub_net_ipv6_get_id (hwaddr); + + FOR_NET_NETWORK_LEVEL_INTERFACES (inf) +diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c +index 5173614..1319671 100644 +--- a/grub-core/net/tftp.c ++++ b/grub-core/net/tftp.c +@@ -149,7 +149,7 @@ ack (tftp_data_t data, grub_uint64_t block) + return err; + + tftph_ack = (struct tftphdr *) nb_ack.data; +- tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK); ++ tftph_ack->opcode = grub_cpu_to_be16_compile_time (TFTP_ACK); + tftph_ack->u.ack.block = grub_cpu_to_be16 (block); + + err = grub_net_send_udp_packet (data->sock, &nb_ack); +@@ -333,7 +333,7 @@ tftp_open (struct grub_file *file, const char *filename) + rrq = (char *) tftph->u.rrq; + rrqlen = 0; + +- tftph->opcode = grub_cpu_to_be16 (TFTP_RRQ); ++ tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_RRQ); + grub_strcpy (rrq, filename); + rrqlen += grub_strlen (filename) + 1; + rrq += grub_strlen (filename) + 1; +@@ -443,8 +443,8 @@ tftp_close (struct grub_file *file) + if (!err) + { + tftph = (struct tftphdr *) nb_err.data; +- tftph->opcode = grub_cpu_to_be16 (TFTP_ERROR); +- tftph->u.err.errcode = grub_cpu_to_be16 (TFTP_EUNDEF); ++ tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_ERROR); ++ tftph->u.err.errcode = grub_cpu_to_be16_compile_time (TFTP_EUNDEF); + grub_memcpy (tftph->u.err.errmsg, "closed", sizeof ("closed")); + + err = grub_net_send_udp_packet (data->sock, &nb_err); +diff --git a/grub-core/partmap/acorn.c b/grub-core/partmap/acorn.c +index 7bb93d9..c022c61 100644 +--- a/grub-core/partmap/acorn.c ++++ b/grub-core/partmap/acorn.c +@@ -25,8 +25,8 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + +-#define LINUX_NATIVE_MAGIC grub_cpu_to_le32 (0xdeafa1de) +-#define LINUX_SWAP_MAGIC grub_cpu_to_le32 (0xdeafab1e) ++#define LINUX_NATIVE_MAGIC grub_cpu_to_le32_compile_time (0xdeafa1de) ++#define LINUX_SWAP_MAGIC grub_cpu_to_le32_compile_time (0xdeafab1e) + #define LINUX_MAP_ENTRIES (512 / 12) + + #define NONADFS_PARTITION_TYPE_LINUX 9 +diff --git a/grub-core/partmap/bsdlabel.c b/grub-core/partmap/bsdlabel.c +index cf0f967..1d78590 100644 +--- a/grub-core/partmap/bsdlabel.c ++++ b/grub-core/partmap/bsdlabel.c +@@ -53,7 +53,7 @@ iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd, + return grub_errno; + + /* Check if it is valid. */ +- if (label.magic != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) ++ if (label.magic != grub_cpu_to_le32_compile_time (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + + /* A kludge to determine a base of be.offset. */ +diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c +index 38df7b3..83bcba7 100644 +--- a/grub-core/partmap/gpt.c ++++ b/grub-core/partmap/gpt.c +@@ -65,7 +65,7 @@ grub_gpt_partition_map_iterate (grub_disk_t disk, + return grub_errno; + + /* Check if it is valid. */ +- if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) ++ if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + + /* Make sure the MBR is a protective MBR and not a normal MBR. */ +diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c +index 1d81a53..46c406b 100644 +--- a/grub-core/partmap/msdos.c ++++ b/grub-core/partmap/msdos.c +@@ -162,7 +162,7 @@ grub_partition_msdos_iterate (grub_disk_t disk, + lastaddr = p.offset; + + /* Check if it is valid. */ +- if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) ++ if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + + for (i = 0; i < 4; i++) +@@ -280,7 +280,7 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, + lastaddr = offset; + + /* Check if it is valid. */ +- if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) ++ if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + + for (i = 0; i < 4; i++) +diff --git a/grub-core/tests/video_checksum.c b/grub-core/tests/video_checksum.c +index 491bc55..74d5b65 100644 +--- a/grub-core/tests/video_checksum.c ++++ b/grub-core/tests/video_checksum.c +@@ -288,16 +288,16 @@ grub_video_capture_write_bmp (const char *fname, + if (mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_RGB) + { + head.filesize = grub_cpu_to_le32 (sizeof (head) + mode_info->width * mode_info->height * 3); +- head.bmp_off = grub_cpu_to_le32 (sizeof (head)); ++ head.bmp_off = grub_cpu_to_le32_compile_time (sizeof (head)); + head.bpp = grub_cpu_to_le16_compile_time (24); + } + else + { + head.filesize = grub_cpu_to_le32 (sizeof (head) + 3 * 256 + mode_info->width * mode_info->height); +- head.bmp_off = grub_cpu_to_le32 (sizeof (head) + 3 * 256); ++ head.bmp_off = grub_cpu_to_le32_compile_time (sizeof (head) + 3 * 256); + head.bpp = grub_cpu_to_le16_compile_time (8); + } +- head.head_size = grub_cpu_to_le32 (sizeof (head) - 14); ++ head.head_size = grub_cpu_to_le32_compile_time (sizeof (head) - 14); + head.width = grub_cpu_to_le16 (mode_info->width); + head.height = grub_cpu_to_le16 (mode_info->height); + head.planes = grub_cpu_to_le16_compile_time (1); +diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c +index e6485b4..a0cab3a 100644 +--- a/util/grub-mkfont.c ++++ b/util/grub-mkfont.c +@@ -704,7 +704,7 @@ write_be16_section (const char *name, grub_uint16_t data, int* offset, + { + grub_uint32_t leng; + +- leng = grub_cpu_to_be32 (2); ++ leng = grub_cpu_to_be32_compile_time (2); + data = grub_cpu_to_be16 (data); + grub_util_write_image (name, 4, file, filename); + grub_util_write_image ((char *) &leng, 4, file, filename); +@@ -801,7 +801,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file) + + offset = 0; + +- leng = grub_cpu_to_be32 (4); ++ leng = grub_cpu_to_be32_compile_time (4); + grub_util_write_image (FONT_FORMAT_SECTION_NAMES_FILE, + sizeof(FONT_FORMAT_SECTION_NAMES_FILE) - 1, file, + output_file); +diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c +index 692f881..1a4f1b4 100644 +--- a/util/grub-mklayout.c ++++ b/util/grub-mklayout.c +@@ -329,7 +329,7 @@ write_file (FILE *out, const char *fname, struct grub_keyboard_layout *layout) + grub_uint32_t version; + unsigned i; + +- version = grub_cpu_to_le32 (GRUB_KEYBOARD_LAYOUTS_VERSION); ++ version = grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION); + + for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++) + layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]); +diff --git a/util/mkimage.c b/util/mkimage.c +index 26d9816..e6b799f 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -1528,9 +1528,10 @@ grub_install_generate_image (const char *dir, const char *prefix, + text_section->virtual_address = grub_cpu_to_le32 (header_size); + text_section->raw_data_size = grub_cpu_to_le32 (exec_size); + text_section->raw_data_offset = grub_cpu_to_le32 (header_size); +- text_section->characteristics = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_CODE +- | GRUB_PE32_SCN_MEM_EXECUTE +- | GRUB_PE32_SCN_MEM_READ); ++ text_section->characteristics = grub_cpu_to_le32_compile_time ( ++ GRUB_PE32_SCN_CNT_CODE ++ | GRUB_PE32_SCN_MEM_EXECUTE ++ | GRUB_PE32_SCN_MEM_READ); + + data_section = text_section + 1; + strcpy (data_section->name, ".data"); +@@ -1539,7 +1540,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + data_section->raw_data_size = grub_cpu_to_le32 (kernel_size - exec_size); + data_section->raw_data_offset = grub_cpu_to_le32 (header_size + exec_size); + data_section->characteristics +- = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA ++ = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA + | GRUB_PE32_SCN_MEM_READ + | GRUB_PE32_SCN_MEM_WRITE); + +@@ -1551,7 +1552,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + bss_section->raw_data_size = 0; + bss_section->raw_data_offset = 0; + bss_section->characteristics +- = grub_cpu_to_le32 (GRUB_PE32_SCN_MEM_READ ++ = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_MEM_READ + | GRUB_PE32_SCN_MEM_WRITE + | GRUB_PE32_SCN_ALIGN_64BYTES + | GRUB_PE32_SCN_CNT_INITIALIZED_DATA +@@ -1565,7 +1566,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - kernel_size - header_size); + mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + kernel_size); + mods_section->characteristics +- = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA ++ = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA + | GRUB_PE32_SCN_MEM_READ + | GRUB_PE32_SCN_MEM_WRITE); + +@@ -1576,7 +1577,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + reloc_section->raw_data_size = grub_cpu_to_le32 (reloc_size); + reloc_section->raw_data_offset = grub_cpu_to_le32 (reloc_addr); + reloc_section->characteristics +- = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA ++ = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA + | GRUB_PE32_SCN_MEM_DISCARDABLE + | GRUB_PE32_SCN_MEM_READ); + free (core_img); +-- +2.4.3 + diff --git a/0110-Add-a-new-none-platform-that-only-builds-utilities.patch b/0110-Add-a-new-none-platform-that-only-builds-utilities.patch new file mode 100644 index 0000000..6ee9a8b --- /dev/null +++ b/0110-Add-a-new-none-platform-that-only-builds-utilities.patch @@ -0,0 +1,196 @@ +From 5d90f6e533d82abf89f9e1787f90f17f2fab14aa Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Tue, 23 Sep 2014 12:06:30 +0100 +Subject: [PATCH 110/506] Add a new "none" platform that only builds utilities + +This makes it possible to build generally-useful utilities such as +grub-mount even if the rest of GRUB has not been ported to the target +CPU. + +* configure.ac: Add "none" platform. Default to it for unsupported +CPUs rather than stopping with a fatal error. Don't downgrade +x86_64-none to i386. Define COND_real_platform Automake conditional +if the platform is anything other than "none". Don't do any include +directory linking for "none". +* Makefile.am: Skip building grub-core and all bootcheck targets if +!COND_real_platform. +* include/grub/time.h: Don't include if GRUB_UTIL +is defined. +--- + ChangeLog | 14 ++++++++++++++ + Makefile.am | 14 +++++++++++--- + configure.ac | 46 +++++++++++++++++++++++++++++----------------- + include/grub/time.h | 2 +- + 4 files changed, 55 insertions(+), 21 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 8316b8f..08cc7c6 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,17 @@ ++2014-09-23 Colin Watson ++ ++ Add a new "none" platform that only builds utilities ++ ++ * configure.ac: Add "none" platform. Default to it for unsupported ++ CPUs rather than stopping with a fatal error. Don't downgrade ++ x86_64-none to i386. Define COND_real_platform Automake conditional ++ if the platform is anything other than "none". Don't do any include ++ directory linking for "none". ++ * Makefile.am: Skip building grub-core and all bootcheck targets if ++ !COND_real_platform. ++ * include/grub/time.h: Don't include if GRUB_UTIL ++ is defined. ++ + 2014-09-22 Andrei Borzenkov + + Use grub_cpu_to_XXX_compile_time for constants. +diff --git a/Makefile.am b/Makefile.am +index f02ae0a..cc537a2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,11 @@ + AUTOMAKE_OPTIONS = subdir-objects -Wno-portability + + DEPDIR = .deps-util +-SUBDIRS = grub-core/gnulib . grub-core po docs util/bash-completion.d ++SUBDIRS = grub-core/gnulib . ++if COND_real_platform ++SUBDIRS += grub-core ++endif ++SUBDIRS += po docs util/bash-completion.d + + include $(top_srcdir)/conf/Makefile.common + include $(top_srcdir)/conf/Makefile.extra-dist +@@ -132,6 +136,8 @@ nodist_platform_HEADERS = config.h + pkgdata_DATA += grub-mkconfig_lib + + ++if COND_real_platform ++ + if COND_i386_coreboot + QEMU32=qemu-system-i386 + endif +@@ -383,8 +389,6 @@ if COND_powerpc_ieee1275 + BOOTCHECKS = bootcheck-linux-ppc + endif + +-EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/tests/boot/qemu-shutdown-x86.S +- + .PHONY: bootcheck-linux-i386 bootcheck-linux-x86_64 \ + bootcheck-kfreebsd-i386 bootcheck-kfreebsd-x86_64 \ + bootcheck-knetbsd-i386 bootcheck-knetbsd-x86_64 \ +@@ -402,6 +406,10 @@ default_payload.elf: grub-mkstandalone grub-mkimage + pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + endif + ++endif ++ ++EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/tests/boot/qemu-shutdown-x86.S ++ + windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows + windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) + test -d $(windowsdir) && rm -rf $(windowsdir) || true +diff --git a/configure.ac b/configure.ac +index 8662bac..fdf0fdc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -125,7 +125,10 @@ if test "x$with_platform" = x; then + ia64-*) platform=efi ;; + arm-*) platform=uboot ;; + arm64-*) platform=efi ;; +- *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; ++ *) ++ AC_MSG_WARN([unsupported CPU: "$target_cpu" - only building utilities]) ++ platform=none ++ ;; + esac + else + platform="$with_platform" +@@ -135,6 +138,7 @@ case "$target_cpu"-"$platform" in + x86_64-efi) ;; + x86_64-emu) ;; + x86_64-xen) ;; ++ x86_64-none) ;; + x86_64-*) target_cpu=i386 ;; + powerpc64-ieee1275) target_cpu=powerpc ;; + esac +@@ -167,6 +171,7 @@ case "$target_cpu"-"$platform" in + arm-efi) ;; + arm64-efi) ;; + *-emu) ;; ++ *-none) ;; + *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; + esac + +@@ -1653,6 +1658,7 @@ AC_SUBST(BUILD_LIBM) + # Automake conditionals + # + ++AM_CONDITIONAL([COND_real_platform], [test x$platform != xnone]) + AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) + AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang = xyes]) + AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) +@@ -1726,24 +1732,30 @@ AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir]) + + + # Output files. +-cpudir="${target_cpu}" +-if test x${cpudir} = xmipsel; then +- cpudir=mips; +-fi +-grub_CHECK_LINK_DIR +-if test x"$link_dir" = xyes ; then +- AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) +- if test "$platform" != emu ; then +- AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform]) ++if test "$platform" != none; then ++ cpudir="${target_cpu}" ++ if test x${cpudir} = xmipsel; then ++ cpudir=mips; + fi +-else +- mkdir -p include/grub 2>/dev/null +- rm -rf include/grub/cpu +- cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null +- if test "$platform" != emu ; then +- rm -rf include/grub/machine +- cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null ++ grub_CHECK_LINK_DIR ++ if test x"$link_dir" = xyes ; then ++ AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) ++ if test "$platform" != emu ; then ++ AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform]) ++ fi ++ else ++ mkdir -p include/grub 2>/dev/null ++ rm -rf include/grub/cpu ++ cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null ++ if test "$platform" != emu ; then ++ rm -rf include/grub/machine ++ cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null ++ fi + fi ++else ++ # Just enough to stop the compiler failing with -I$(srcdir)/include. ++ mkdir -p include 2>/dev/null ++ rm -rf include/grub + fi + + AC_CONFIG_FILES([Makefile]) +diff --git a/include/grub/time.h b/include/grub/time.h +index 64ac99a..c919c1f 100644 +--- a/include/grub/time.h ++++ b/include/grub/time.h +@@ -21,7 +21,7 @@ + + #include + #include +-#ifndef GRUB_MACHINE_EMU ++#if !defined(GRUB_MACHINE_EMU) && !defined(GRUB_UTIL) + #include + #else + static inline void +-- +2.4.3 + diff --git a/0111-Fix-in-tree-platform-none.patch b/0111-Fix-in-tree-platform-none.patch new file mode 100644 index 0000000..65deb75 --- /dev/null +++ b/0111-Fix-in-tree-platform-none.patch @@ -0,0 +1,45 @@ +From 77063f4cb672f423272db7e21ca448cf3de98dcf Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Thu, 25 Sep 2014 20:59:26 +0100 +Subject: [PATCH 111/506] Fix in-tree --platform=none + +* configure.ac: Only remove include/grub/cpu and +include/grub/machine in the --platform=none case, not all of +include/grub. +--- + ChangeLog | 8 ++++++++ + configure.ac | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 08cc7c6..192e8bc 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,11 @@ ++2014-09-25 Colin Watson ++ ++ Fix in-tree --platform=none ++ ++ * configure.ac: Only remove include/grub/cpu and ++ include/grub/machine in the --platform=none case, not all of ++ include/grub. ++ + 2014-09-23 Colin Watson + + Add a new "none" platform that only builds utilities +diff --git a/configure.ac b/configure.ac +index fdf0fdc..31d2b0b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1755,7 +1755,7 @@ if test "$platform" != none; then + else + # Just enough to stop the compiler failing with -I$(srcdir)/include. + mkdir -p include 2>/dev/null +- rm -rf include/grub ++ rm -rf include/grub/cpu include/grub/machine + fi + + AC_CONFIG_FILES([Makefile]) +-- +2.4.3 + diff --git a/0112-Use-full-initializer-for-initrd_ctx-to-avoid-fatal-w.patch b/0112-Use-full-initializer-for-initrd_ctx-to-avoid-fatal-w.patch new file mode 100644 index 0000000..820a46f --- /dev/null +++ b/0112-Use-full-initializer-for-initrd_ctx-to-avoid-fatal-w.patch @@ -0,0 +1,151 @@ +From 9a67e1ac8e92cd0b7521c75a734fcaf2e58523ad Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 14 Oct 2014 20:12:15 +0400 +Subject: [PATCH 112/506] Use full initializer for initrd_ctx to avoid fatal + warnings with older GCC + +struct ... foo = { 0, } is valid initializer, but older GCC emits +warning which is fatal error due to -Werror=missing-field-initializer. +So simply use full initializer to avoid these errors. This was fixed +probably in GCC 4.7. + +See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750 +--- + ChangeLog | 12 ++++++++++++ + grub-core/loader/arm/linux.c | 2 +- + grub-core/loader/arm64/linux.c | 2 +- + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 2 +- + grub-core/loader/ia64/efi/linux.c | 2 +- + grub-core/loader/mips/linux.c | 2 +- + grub-core/loader/powerpc/ieee1275/linux.c | 2 +- + grub-core/loader/sparc64/ieee1275/linux.c | 2 +- + 9 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 192e8bc..190d19d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,15 @@ ++2014-10-14 Andrei Borzenkov ++ ++ * grub-core/loader/arm/linux.c: Use full initializer for initrd_ctx to ++ avoid fatal warnings with older gcc (probably before 4.7). ++ * grub-core/loader/arm64/linux.c: Likewise. ++ * grub-core/loader/i386/linux.c: Likewise. ++ * grub-core/loader/i386/pc/linux.c: Likewise. ++ * grub-core/loader/ia64/efi/linux.c: Likewise. ++ * grub-core/loader/mips/linux.c: Likewise. ++ * grub-core/loader/powerpc/ieee1275/linux.c: Likewise. ++ * grub-core/loader/sparc64/ieee1275/linux.c: Likewise. ++ + 2014-09-25 Colin Watson + + Fix in-tree --platform=none +diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c +index 62cbe75..5b39f02 100644 +--- a/grub-core/loader/arm/linux.c ++++ b/grub-core/loader/arm/linux.c +@@ -396,7 +396,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_file_t file; + grub_size_t size = 0; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 0dc144e..564a75a 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -328,7 +328,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + int initrd_size, initrd_pages; + void *initrd_mem = NULL; + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 0bd060a..291f728 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -1050,7 +1050,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + { +diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c +index e88341e..870992b 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -388,7 +388,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_uint8_t *initrd_chunk; + grub_addr_t initrd_addr; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + { +diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c +index eb78e6e..efaa42c 100644 +--- a/grub-core/loader/ia64/efi/linux.c ++++ b/grub-core/loader/ia64/efi/linux.c +@@ -568,7 +568,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + { +diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c +index 4a3e8c5..5f383be 100644 +--- a/grub-core/loader/mips/linux.c ++++ b/grub-core/loader/mips/linux.c +@@ -415,7 +415,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + void *initrd_src; + grub_addr_t initrd_dest; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c +index 787d7dc..6e81464 100644 +--- a/grub-core/loader/powerpc/ieee1275/linux.c ++++ b/grub-core/loader/powerpc/ieee1275/linux.c +@@ -333,7 +333,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_size_t size = 0; + grub_addr_t first_addr; + grub_addr_t addr; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + { +diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c +index c5e8dfa..6389170 100644 +--- a/grub-core/loader/sparc64/ieee1275/linux.c ++++ b/grub-core/loader/sparc64/ieee1275/linux.c +@@ -373,7 +373,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_addr_t paddr; + grub_addr_t addr; + int ret; +- struct grub_linux_initrd_context initrd_ctx = { 0, }; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + + if (argc == 0) + { +-- +2.4.3 + diff --git a/0113-icmp6-fix-no-respond-to-neighbor-solicit-message.patch b/0113-icmp6-fix-no-respond-to-neighbor-solicit-message.patch new file mode 100644 index 0000000..70615ea --- /dev/null +++ b/0113-icmp6-fix-no-respond-to-neighbor-solicit-message.patch @@ -0,0 +1,43 @@ +From 72ec399ad8d6348b6c74ea63d80c79784c8b84ae Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Mon, 3 Nov 2014 16:27:45 +0800 +Subject: [PATCH 113/506] icmp6 fix no respond to neighbor solicit message + +The structure size used in grub_netbuff_pull to get the pointer to +option header is apparently wrong, which leads to subsequent range check +failed and therefore not responding to any neighbor solicit message in my +testing. +--- + ChangeLog | 5 +++++ + grub-core/net/icmp6.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 190d19d..87faadf 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-11-03 Michael Chang ++ ++ * grub-core/net/icmp6.c (grub_net_recv_icmp6_packet): Fix size ++ of neighbor solicitation packet in grub_netbuff_pull. ++ + 2014-10-14 Andrei Borzenkov + + * grub-core/loader/arm/linux.c: Use full initializer for initrd_ctx to +diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c +index bbc9020..796d549 100644 +--- a/grub-core/net/icmp6.c ++++ b/grub-core/net/icmp6.c +@@ -205,7 +205,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, + if (ttl != 0xff) + break; + nbh = (struct neighbour_solicit *) nb->data; +- err = grub_netbuff_pull (nb, sizeof (struct router_adv)); ++ err = grub_netbuff_pull (nb, sizeof (*nbh)); + if (err) + { + grub_netbuff_free (nb); +-- +2.4.3 + diff --git a/0114-efi-check-path-non-null-before-grub_strrchr.patch b/0114-efi-check-path-non-null-before-grub_strrchr.patch new file mode 100644 index 0000000..ab83223 --- /dev/null +++ b/0114-efi-check-path-non-null-before-grub_strrchr.patch @@ -0,0 +1,56 @@ +From 004a2b1efdd782cf946387d2060ad9250d61c435 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Mon, 17 Nov 2014 14:11:01 +0000 +Subject: [PATCH 114/506] efi: check *path non-null before grub_strrchr + +The EFI version of grub_machine_get_bootlocation crops the boot image +name back to the last / in order to get a directory path. However, it +does not check that *name is actually set before calling grub_strrchr +to do this, and neither does grub_strrchr before dereferencing a NULL +pointer. + +Parent function, grub_set_prefix_and_root, does check the pointer +before using. +--- + ChangeLog | 5 +++++ + grub-core/kern/efi/init.c | 11 +++++++---- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 87faadf..07d0646 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-07 Leif Lindholm ++ ++ * grub-core/kern/efi/init.c: check value of *path before ++ dereferencing. ++ + 2014-11-03 Michael Chang + + * grub-core/net/icmp6.c (grub_net_recv_icmp6_packet): Fix size +diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c +index 942ab02..e9c85de 100644 +--- a/grub-core/kern/efi/init.c ++++ b/grub-core/kern/efi/init.c +@@ -63,10 +63,13 @@ grub_machine_get_bootlocation (char **device, char **path) + if (!*device && grub_efi_net_config) + grub_efi_net_config (image->device_handle, device, path); + +- /* Get the directory. */ +- p = grub_strrchr (*path, '/'); +- if (p) +- *p = '\0'; ++ if (*path) ++ { ++ /* Get the directory. */ ++ p = grub_strrchr (*path, '/'); ++ if (p) ++ *p = '\0'; ++ } + } + + void +-- +2.4.3 + diff --git a/0115-Fix-date-in-last-ChangeLog-entry.patch b/0115-Fix-date-in-last-ChangeLog-entry.patch new file mode 100644 index 0000000..feed54e --- /dev/null +++ b/0115-Fix-date-in-last-ChangeLog-entry.patch @@ -0,0 +1,22 @@ +From 2ccaa3b9fdc3e71e9e2e68acfa3054233a2a30b2 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 20 Nov 2014 20:54:49 +0300 +Subject: [PATCH 115/506] Fix date in last ChangeLog entry + +--- + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 07d0646..b86feea 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,4 +1,4 @@ +-2014-01-07 Leif Lindholm ++2014-11-07 Leif Lindholm + + * grub-core/kern/efi/init.c: check value of *path before + dereferencing. +-- +2.4.3 + diff --git a/0116-grub-fs-tester-consistently-print-output-of-grub-ls-.patch b/0116-grub-fs-tester-consistently-print-output-of-grub-ls-.patch new file mode 100644 index 0000000..9bd32b3 --- /dev/null +++ b/0116-grub-fs-tester-consistently-print-output-of-grub-ls-.patch @@ -0,0 +1,47 @@ +From e2dd6daa8c33e3e7641e442dc269fcca479c6fda Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 20 Nov 2014 20:56:51 +0300 +Subject: [PATCH 116/506] grub-fs-tester: consistently print output of grub ls + if test fails + +--- + ChangeLog | 5 +++++ + tests/util/grub-fs-tester.in | 2 ++ + 2 files changed, 7 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index b86feea..6fbec06 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-11-20 Andrei Borzenkov ++ ++ * tests/util/grub-fs-tester.in: Consistently print output ++ of grub ls if test fails. ++ + 2014-11-07 Leif Lindholm + + * grub-core/kern/efi/init.c: check value of *path before +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 669527a..5656927 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -1065,6 +1065,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + : + else + echo NLIST FAIL ++ echo "$LSROUT" + TZ=UTC ls --time-style=+%Y%m%d%H%M%S.%N -lA "$MNTPOINTRO" + exit 1 + fi +@@ -1082,6 +1083,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + : + else + echo LONG LIST FAIL ++ echo "$LSROUT" + TZ=UTC ls --time-style=+%Y%m%d%H%M%S.%N -l "$MNTPOINTRO" + exit 1 + fi +-- +2.4.3 + diff --git a/0117-send-router-solicitation-for-ipv6-address-autoconf-v.patch b/0117-send-router-solicitation-for-ipv6-address-autoconf-v.patch new file mode 100644 index 0000000..aee1165 --- /dev/null +++ b/0117-send-router-solicitation-for-ipv6-address-autoconf-v.patch @@ -0,0 +1,163 @@ +From 7c4b6b7bb476963ca7e86f79d32036e7f80d27f6 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 18 Nov 2014 16:03:08 +0800 +Subject: [PATCH 117/506] send router solicitation for ipv6 address autoconf v2 + +Many routers have long router advertisment interval configured by +default. The Neighbor Discovery protocol (RFC4861) has defined default +MaxRtrAdvInterval value as 600 seconds and +MinRtrAdvInterval as 0.33*MaxRtrAdvInterval. This makes +net_ipv6_autoconf fails more often than not as currently it passively +listens the RA message to perfom address autoconfiguration. + +This patch tries to send router solicitation to overcome the problem of +long RA interval. + +v2: +use cpu_to_be macro for network byte order conversion +add missing error handling +--- + grub-core/net/icmp6.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ + grub-core/net/net.c | 4 ++- + include/grub/net/ip.h | 2 ++ + 3 files changed, 88 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c +index 796d549..7822394 100644 +--- a/grub-core/net/icmp6.c ++++ b/grub-core/net/icmp6.c +@@ -72,6 +72,11 @@ struct neighbour_advertise + grub_uint64_t target[2]; + } GRUB_PACKED; + ++struct router_solicit ++{ ++ grub_uint32_t reserved; ++} GRUB_PACKED; ++ + enum + { + FLAG_SLAAC = 0x40 +@@ -81,6 +86,7 @@ enum + { + ICMP6_ECHO = 128, + ICMP6_ECHO_REPLY = 129, ++ ICMP6_ROUTER_SOLICIT = 133, + ICMP6_ROUTER_ADVERTISE = 134, + ICMP6_NEIGHBOUR_SOLICIT = 135, + ICMP6_NEIGHBOUR_ADVERTISE = 136, +@@ -533,3 +539,80 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, + grub_netbuff_free (nb); + return err; + } ++ ++grub_err_t ++grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf) ++{ ++ struct grub_net_buff *nb; ++ grub_err_t err = GRUB_ERR_NONE; ++ grub_net_network_level_address_t multicast; ++ grub_net_link_level_address_t ll_multicast; ++ struct option_header *ohdr; ++ struct router_solicit *sol; ++ struct icmp_header *icmphr; ++ ++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ multicast.ipv6[0] = grub_cpu_to_be64 (0xff02ULL << 48); ++ multicast.ipv6[1] = grub_cpu_to_be64 (0x02ULL); ++ ++ err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); ++ if (err) ++ return err; ++ ++ nb = grub_netbuff_alloc (sizeof (struct router_solicit) ++ + sizeof (struct option_header) ++ + 6 ++ + sizeof (struct icmp_header) ++ + GRUB_NET_OUR_IPV6_HEADER_SIZE ++ + GRUB_NET_MAX_LINK_HEADER_SIZE); ++ if (!nb) ++ return grub_errno; ++ err = grub_netbuff_reserve (nb, ++ sizeof (struct router_solicit) ++ + sizeof (struct option_header) ++ + 6 ++ + sizeof (struct icmp_header) ++ + GRUB_NET_OUR_IPV6_HEADER_SIZE ++ + GRUB_NET_MAX_LINK_HEADER_SIZE); ++ if (err) ++ goto fail; ++ ++ err = grub_netbuff_push (nb, 6); ++ if (err) ++ goto fail; ++ ++ grub_memcpy (nb->data, inf->hwaddress.mac, 6); ++ ++ err = grub_netbuff_push (nb, sizeof (*ohdr)); ++ if (err) ++ goto fail; ++ ++ ohdr = (struct option_header *) nb->data; ++ ohdr->type = OPTION_SOURCE_LINK_LAYER_ADDRESS; ++ ohdr->len = 1; ++ ++ err = grub_netbuff_push (nb, sizeof (*sol)); ++ if (err) ++ goto fail; ++ ++ sol = (struct router_solicit *) nb->data; ++ sol->reserved = 0; ++ ++ err = grub_netbuff_push (nb, sizeof (*icmphr)); ++ if (err) ++ goto fail; ++ ++ icmphr = (struct icmp_header *) nb->data; ++ icmphr->type = ICMP6_ROUTER_SOLICIT; ++ icmphr->code = 0; ++ icmphr->checksum = 0; ++ icmphr->checksum = grub_net_ip_transport_checksum (nb, ++ GRUB_NET_IP_ICMPV6, ++ &inf->address, ++ &multicast); ++ err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, ++ GRUB_NET_IP_ICMPV6); ++ fail: ++ grub_netbuff_free (nb); ++ return err; ++} +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 82af3a0..21a4e94 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -380,12 +380,14 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), + + for (interval = 200; interval < 10000; interval *= 2) + { +- /* FIXME: send router solicitation. */ + int done = 1; + for (j = 0; j < ncards; j++) + { + if (slaacs[j]->slaac_counter) + continue; ++ err = grub_net_icmp6_send_router_solicit (ifaces[j]); ++ if (err) ++ err = GRUB_ERR_NONE; + done = 0; + } + if (done) +diff --git a/include/grub/net/ip.h b/include/grub/net/ip.h +index 7a8e614..dcceaa5 100644 +--- a/include/grub/net/ip.h ++++ b/include/grub/net/ip.h +@@ -92,4 +92,6 @@ grub_err_t + grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, + const grub_net_network_level_address_t *proto_addr); + ++grub_err_t ++grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf); + #endif +-- +2.4.3 + diff --git a/0118-grub-mkstandalone-out-of-bound-access-to-tar-header-.patch b/0118-grub-mkstandalone-out-of-bound-access-to-tar-header-.patch new file mode 100644 index 0000000..eb8d293 --- /dev/null +++ b/0118-grub-mkstandalone-out-of-bound-access-to-tar-header-.patch @@ -0,0 +1,53 @@ +From 478b5675209ab0263b8271764ef85d8fc1faec42 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 20:39:22 +0300 +Subject: [PATCH 118/506] grub-mkstandalone: out of bound access to tar header + magic + +Magic size is 6 bytes and we copied 7 bytes in it. + +CID: 73587, 73888 +Closes bug 43690 +--- + ChangeLog | 5 +++++ + util/grub-mkstandalone.c | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6fbec06..930ceb2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-11-28 Andrei Borzenkov ++ ++ * util/grub-mkstandalone.c (add_tar_file): Fix out of bound access ++ to hd.magic (Coverity CID 73587, 73888, bug 43690). ++ + 2014-11-20 Andrei Borzenkov + + * tests/util/grub-fs-tester.in: Consistently print output +diff --git a/util/grub-mkstandalone.c b/util/grub-mkstandalone.c +index 8e2a2b8..6017d71 100644 +--- a/util/grub-mkstandalone.c ++++ b/util/grub-mkstandalone.c +@@ -236,7 +236,7 @@ add_tar_file (const char *from, + set_tar_value (hd.size, optr - tcn, 12); + set_tar_value (hd.mtime, mtime, 12); + hd.typeflag = 'L'; +- memcpy (hd.magic, "ustar ", 7); ++ memcpy (hd.magic, MAGIC, sizeof (hd.magic)); + memcpy (hd.uname, "grub", 4); + memcpy (hd.gname, "grub", 4); + +@@ -266,7 +266,7 @@ add_tar_file (const char *from, + set_tar_value (hd.size, size, 12); + set_tar_value (hd.mtime, mtime, 12); + hd.typeflag = '0'; +- memcpy (hd.magic, "ustar ", 7); ++ memcpy (hd.magic, MAGIC, sizeof (hd.magic)); + memcpy (hd.uname, "grub", 4); + memcpy (hd.gname, "grub", 4); + +-- +2.4.3 + diff --git a/0119-grub-install-common-avoid-out-of-bound-access-when-r.patch b/0119-grub-install-common-avoid-out-of-bound-access-when-r.patch new file mode 100644 index 0000000..44744b0 --- /dev/null +++ b/0119-grub-install-common-avoid-out-of-bound-access-when-r.patch @@ -0,0 +1,43 @@ +From 0415dbe28f3dc3520b70745b3bd78073f094fb4d Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 20:45:27 +0300 +Subject: [PATCH 119/506] grub-install-common: avoid out of bound access when + read failed + +Check that modinfo.sh could be read successfully; abort on error. Avoids +potential out-of-bound array access. + +CID: 73819 +--- + ChangeLog | 2 ++ + util/grub-install-common.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 930ceb2..e46b999 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,7 @@ + 2014-11-28 Andrei Borzenkov + ++ * util/grub-install-common.c (grub_install_get_target): Check return ++ value of grub_util_fd_read (Coverity CID 73819). + * util/grub-mkstandalone.c (add_tar_file): Fix out of bound access + to hd.magic (Coverity CID 73587, 73888, bug 43690). + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index c8bedcb..4b5d4d4 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -911,6 +911,8 @@ grub_install_get_target (const char *src) + grub_util_error (_("%s doesn't exist. Please specify --target or --directory"), + fn); + r = grub_util_fd_read (f, buf, sizeof (buf) - 1); ++ if (r < 0) ++ grub_util_error (_("cannot read `%s': %s"), fn, strerror (errno)); + grub_util_fd_close (f); + buf[r] = '\0'; + c = strstr (buf, "grub_modinfo_target_cpu="); +-- +2.4.3 + diff --git a/0120-grub-core-disk-luks.c-fix-use-after-free-and-memory-.patch b/0120-grub-core-disk-luks.c-fix-use-after-free-and-memory-.patch new file mode 100644 index 0000000..7bd0cf9 --- /dev/null +++ b/0120-grub-core-disk-luks.c-fix-use-after-free-and-memory-.patch @@ -0,0 +1,136 @@ +From ea44693fc8cbe9e8e8566f16e3dc4031c98b063a Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 21:12:00 +0300 +Subject: [PATCH 120/506] grub-core/disk/luks.c: fix use after free and memory + leaks + +configure_ciphers: + +- several memory leaks where allocated ciphers were not freed. CID: 73813, +73710 + +- use after free. It is probably quite innocent as grub is single threaded, +but could potentially be a problem with memory allocator debugger turned on. +CID: 73730 + +luks_recover_key: + +- memory leak. CID: 73854 +--- + ChangeLog | 4 ++++ + grub-core/disk/luks.c | 19 ++++++++++++++++--- + 2 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index e46b999..0ba21d5 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-11-28 Andrei Borzenkov + ++ * grub-core/disk/luks.c (configure_ciphers): Fix memory leaks ++ and use after free (Coverity CID 73813, 73710, 73730) ++ * grub-core/disk/luks.c (luks_recover_key): Fix memory leak (Coverity ++ CID 73854) + * util/grub-install-common.c (grub_install_get_target): Check return + value of grub_util_fd_read (Coverity CID 73819). + * util/grub-mkstandalone.c (add_tar_file): Fix out of bound access +diff --git a/grub-core/disk/luks.c b/grub-core/disk/luks.c +index 2502029..86c50c6 100644 +--- a/grub-core/disk/luks.c ++++ b/grub-core/disk/luks.c +@@ -143,6 +143,7 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid keysize %d", + grub_be_to_cpu32 (header.keyBytes)); ++ grub_crypto_cipher_close (cipher); + return NULL; + } + +@@ -181,9 +182,10 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + } + if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) + { +- grub_crypto_cipher_close (cipher); + grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + cipher->cipher->blocksize); ++ grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); + return NULL; + } + if (secondary_cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) +@@ -191,6 +193,7 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + grub_crypto_cipher_close (cipher); + grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + secondary_cipher->cipher->blocksize); ++ grub_crypto_cipher_close (secondary_cipher); + return NULL; + } + } +@@ -200,9 +203,9 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + cipheriv = ciphermode + sizeof ("lrw-") - 1; + if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) + { +- grub_crypto_cipher_close (cipher); + grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported LRW block size: %d", + cipher->cipher->blocksize); ++ grub_crypto_cipher_close (cipher); + return NULL; + } + } +@@ -225,6 +228,7 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + || cipher->cipher->blocksize == 0) + grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported benbi blocksize: %d", + cipher->cipher->blocksize); ++ /* FIXME should we return an error here? */ + for (benbi_log = 0; + (cipher->cipher->blocksize << benbi_log) < GRUB_DISK_SECTOR_SIZE; + benbi_log++); +@@ -243,6 +247,7 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + if (!essiv_hash) + { + grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); + grub_error (GRUB_ERR_FILE_NOT_FOUND, + "Couldn't load %s hash", hash_str); + return NULL; +@@ -251,12 +256,14 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + if (!essiv_cipher) + { + grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); + return NULL; + } + } + else + { + grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); + grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown IV mode: %s", + cipheriv); + return NULL; +@@ -276,7 +283,12 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + + newdev = grub_zalloc (sizeof (struct grub_cryptodisk)); + if (!newdev) +- return NULL; ++ { ++ grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (essiv_cipher); ++ grub_crypto_cipher_close (secondary_cipher); ++ return NULL; ++ } + newdev->cipher = cipher; + newdev->offset = grub_be_to_cpu32 (header.payloadOffset); + newdev->source_disk = NULL; +@@ -451,6 +463,7 @@ luks_recover_key (grub_disk_t source, + return GRUB_ERR_NONE; + } + ++ grub_free (split_key); + return GRUB_ACCESS_DENIED; + } + +-- +2.4.3 + diff --git a/0121-Use-ssize_t-for-grub_util_fd_read-result.patch b/0121-Use-ssize_t-for-grub_util_fd_read-result.patch new file mode 100644 index 0000000..cd91d90 --- /dev/null +++ b/0121-Use-ssize_t-for-grub_util_fd_read-result.patch @@ -0,0 +1,26 @@ +From 740c08ed2ff33625bdc2e0ad9ef6264978bf32cf Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 21:43:07 +0300 +Subject: [PATCH 121/506] Use ssize_t for grub_util_fd_read result + +Fixes commit 0415dbe28f3dc3520b70745b3bd78073f094fb4d. +--- + util/grub-install-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index 4b5d4d4..b6dec93 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -902,7 +902,7 @@ grub_install_get_target (const char *src) + char *fn; + grub_util_fd_t f; + char buf[2048]; +- size_t r; ++ ssize_t r; + char *c, *pl, *p; + size_t i; + fn = grub_util_path_concat (2, src, "modinfo.sh"); +-- +2.4.3 + diff --git a/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch b/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch deleted file mode 100644 index fd4544c..0000000 --- a/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9120cc5592d26a945ead586b71820fb9708f5062 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas -Date: Mon, 13 Jan 2014 21:50:59 -0500 -Subject: [PATCH 122/152] Add .eh_frame to list of relocations stripped - ---- - conf/Makefile.common | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/conf/Makefile.common b/conf/Makefile.common -index e4c301f..6f836d8 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -45,7 +45,7 @@ CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding - LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) - CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 - CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) --STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -+STRIPFLAGS_KERNEL = -R .eh_frame -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version - - CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding - LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d --- -1.9.3 - diff --git a/0122-grub-core-disk-geli.c-fix-memory-leaks-in-error-path.patch b/0122-grub-core-disk-geli.c-fix-memory-leaks-in-error-path.patch new file mode 100644 index 0000000..88a22b9 --- /dev/null +++ b/0122-grub-core-disk-geli.c-fix-memory-leaks-in-error-path.patch @@ -0,0 +1,50 @@ +From bbbcb791ed06c75f3dd6a2671a57a67fa86bf2ca Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 22:23:30 +0300 +Subject: [PATCH 122/506] grub-core/disk/geli.c: fix memory leaks in error + paths + +CID: 73813, 73710 +--- + grub-core/disk/geli.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c +index 9025c9d..1727341 100644 +--- a/grub-core/disk/geli.c ++++ b/grub-core/disk/geli.c +@@ -332,19 +332,29 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + { + secondary_cipher = grub_crypto_cipher_open (ciph); + if (!secondary_cipher) +- return NULL; ++ { ++ grub_crypto_cipher_close (cipher); ++ return NULL; ++ } ++ + } + + if (grub_le_to_cpu16 (header.keylen) > 1024) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid keysize %d", + grub_le_to_cpu16 (header.keylen)); ++ grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); + return NULL; + } + + newdev = grub_zalloc (sizeof (struct grub_cryptodisk)); + if (!newdev) +- return NULL; ++ { ++ grub_crypto_cipher_close (cipher); ++ grub_crypto_cipher_close (secondary_cipher); ++ return NULL; ++ } + newdev->cipher = cipher; + newdev->secondary_cipher = secondary_cipher; + newdev->offset = 0; +-- +2.4.3 + diff --git a/0123-Fix-ChangeLog.patch b/0123-Fix-ChangeLog.patch new file mode 100644 index 0000000..57abc42 --- /dev/null +++ b/0123-Fix-ChangeLog.patch @@ -0,0 +1,24 @@ +From f07784e8901906d47b892bc49b44dd7c832cebdd Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 22:35:01 +0300 +Subject: [PATCH 123/506] Fix ChangeLog + +--- + ChangeLog | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 0ba21d5..504d829 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,7 @@ + 2014-11-28 Andrei Borzenkov + ++ * grub-core/disk/geli.c (configure_ciphers): Fix memory leaks ++ (Coverity CID 73813, 73710) + * grub-core/disk/luks.c (configure_ciphers): Fix memory leaks + and use after free (Coverity CID 73813, 73710, 73730) + * grub-core/disk/luks.c (luks_recover_key): Fix memory leak (Coverity +-- +2.4.3 + diff --git a/0124-grub-core-disk-lzopio.c-fix-double-free-in-error-pat.patch b/0124-grub-core-disk-lzopio.c-fix-double-free-in-error-pat.patch new file mode 100644 index 0000000..7ee8ad2 --- /dev/null +++ b/0124-grub-core-disk-lzopio.c-fix-double-free-in-error-pat.patch @@ -0,0 +1,39 @@ +From 343dad410eaa37f4f02eff6a4a4114102d211a28 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 28 Nov 2014 22:37:00 +0300 +Subject: [PATCH 124/506] grub-core/disk/lzopio.c: fix double free in error + path + +CID: 73665 +--- + ChangeLog | 1 + + grub-core/io/lzopio.c | 2 -- + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 504d829..b6220de 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,6 @@ + 2014-11-28 Andrei Borzenkov + ++ * grub-core/io/lzopio.c (test_header): Fix double free (CID 73665) + * grub-core/disk/geli.c (configure_ciphers): Fix memory leaks + (Coverity CID 73813, 73710) + * grub-core/disk/luks.c (configure_ciphers): Fix memory leaks +diff --git a/grub-core/io/lzopio.c b/grub-core/io/lzopio.c +index de2ea67..7559c6c 100644 +--- a/grub-core/io/lzopio.c ++++ b/grub-core/io/lzopio.c +@@ -403,8 +403,6 @@ test_header (grub_file_t file) + return 1; + + CORRUPTED: +- grub_free(name); +- + return 0; + } + +-- +2.4.3 + diff --git a/0125-grub-core-lib-syslinux_parse.c-do-not-free-array.patch b/0125-grub-core-lib-syslinux_parse.c-do-not-free-array.patch new file mode 100644 index 0000000..6fe1ea1 --- /dev/null +++ b/0125-grub-core-lib-syslinux_parse.c-do-not-free-array.patch @@ -0,0 +1,40 @@ +From dbbac5a04c7cec1c14026e807e998eae387ddee4 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 30 Nov 2014 18:48:42 +0300 +Subject: [PATCH 125/506] grub-core/lib/syslinux_parse.c: do not free array + +say->msg is inline array in a structure and should not be freed. +CID: 73610 +--- + ChangeLog | 5 +++++ + grub-core/lib/syslinux_parse.c | 1 - + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index b6220de..21434ff 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-11-30 Andrei Borzenkov ++ ++ * grub-core/lib/syslinux_parse.c (free_menu): Do not free ++ inline array (CID 73610). ++ + 2014-11-28 Andrei Borzenkov + + * grub-core/io/lzopio.c (test_header): Fix double free (CID 73665) +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 6bc504b..08e451c 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -1351,7 +1351,6 @@ free_menu (struct syslinux_menu *menu) + for (say = menu->say; say ; say = nsay) + { + nsay = say->next; +- grub_free (say->msg); + grub_free (say); + } + +-- +2.4.3 + diff --git a/0126-grub-core-fs-zfs-zfsinfo.c-memory-leak-in-print_vdev.patch b/0126-grub-core-fs-zfs-zfsinfo.c-memory-leak-in-print_vdev.patch new file mode 100644 index 0000000..331bf70 --- /dev/null +++ b/0126-grub-core-fs-zfs-zfsinfo.c-memory-leak-in-print_vdev.patch @@ -0,0 +1,45 @@ +From 03d79a878ba04db2cfbbe05564728748de0f6a2f Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 1 Dec 2014 20:54:12 +0300 +Subject: [PATCH 126/506] grub-core/fs/zfs/zfsinfo.c: memory leak in + print_vdev_info + +CID: 73635 +--- + ChangeLog | 5 +++++ + grub-core/fs/zfs/zfsinfo.c | 2 ++ + 2 files changed, 7 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 21434ff..dd44cd8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-12-01 Andrei Borzenkov ++ ++ * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix memory leak ++ (CID 73635). ++ + 2014-11-30 Andrei Borzenkov + + * grub-core/lib/syslinux_parse.c (free_menu): Do not free +diff --git a/grub-core/fs/zfs/zfsinfo.c b/grub-core/fs/zfs/zfsinfo.c +index c96bf21..c8a28ac 100644 +--- a/grub-core/fs/zfs/zfsinfo.c ++++ b/grub-core/fs/zfs/zfsinfo.c +@@ -130,10 +130,12 @@ print_vdev_info (char *nvlist, int tab) + grub_free (bootpath); + grub_free (devid); + grub_free (path); ++ grub_free (type); + return GRUB_ERR_NONE; + } + char is_mirror=(grub_strcmp(type,VDEV_TYPE_MIRROR) == 0); + char is_raidz=(grub_strcmp(type,VDEV_TYPE_RAIDZ) == 0); ++ grub_free (type); + + if (is_mirror || is_raidz) + { +-- +2.4.3 + diff --git a/0127-grub-core-loader-i386-xen_fileXX.c-memory-leak-in-gr.patch b/0127-grub-core-loader-i386-xen_fileXX.c-memory-leak-in-gr.patch new file mode 100644 index 0000000..84e93c8 --- /dev/null +++ b/0127-grub-core-loader-i386-xen_fileXX.c-memory-leak-in-gr.patch @@ -0,0 +1,88 @@ +From 3173c7501ccc02e1475261404fc8b0199be6314e Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 1 Dec 2014 21:23:54 +0300 +Subject: [PATCH 127/506] grub-core/loader/i386/xen_fileXX.c: memory leak in + grub_xen_get_infoXX + +CID: 73645, 73782 +--- + ChangeLog | 2 ++ + grub-core/loader/i386/xen_fileXX.c | 30 +++++++++++++++++++++++------- + 2 files changed, 25 insertions(+), 7 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index dd44cd8..46f049d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,7 @@ + 2014-12-01 Andrei Borzenkov + ++ * grub-core/loader/i386/xen_fileXX.c (grub_xen_get_infoXX): Fix ++ memory leak (CID 73645, 73782). + * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix memory leak + (CID 73635). + +diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c +index 73a5f90..1ba5649 100644 +--- a/grub-core/loader/i386/xen_fileXX.c ++++ b/grub-core/loader/i386/xen_fileXX.c +@@ -311,14 +311,19 @@ grub_xen_get_infoXX (grub_elf_t elf, struct grub_xen_file_info *xi) + return grub_errno; + + if (grub_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (grub_off_t) -1) +- return grub_errno; ++ { ++ err = grub_errno; ++ goto cleanup; ++ } + + if (grub_file_read (elf->file, s0, shsize) != (grub_ssize_t) shsize) + { + if (grub_errno) +- return grub_errno; +- return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ err = grub_errno; ++ else ++ err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + elf->file->name); ++ goto cleanup; + } + + s = (Elf_Shdr *) ((char *) s0 + elf->ehdr.ehdrXX.e_shstrndx * shentsize); +@@ -330,18 +335,29 @@ grub_xen_get_infoXX (grub_elf_t elf, struct grub_xen_file_info *xi) + char name[sizeof("__xen_guest")]; + grub_memset (name, 0, sizeof (name)); + if (grub_file_seek (elf->file, stroff + s->sh_name) == (grub_off_t) -1) +- return grub_errno; ++ { ++ err = grub_errno; ++ goto cleanup; ++ } + + if (grub_file_read (elf->file, name, sizeof (name)) != (grub_ssize_t) sizeof (name)) + { + if (grub_errno) +- return grub_errno; ++ { ++ err = grub_errno; ++ goto cleanup; ++ } + continue; + } + if (grub_memcmp (name, "__xen_guest", + sizeof("__xen_guest")) != 0) + continue; +- return parse_xen_guest (elf, xi, s->sh_offset, s->sh_size); ++ err = parse_xen_guest (elf, xi, s->sh_offset, s->sh_size); ++ goto cleanup; + } +- return grub_error (GRUB_ERR_BAD_OS, "no XEN note found"); ++ err = grub_error (GRUB_ERR_BAD_OS, "no XEN note found"); ++ ++cleanup: ++ grub_free (s0); ++ return err; + } +-- +2.4.3 + diff --git a/0128-grub-shell-support-files-also-for-net-boot.patch b/0128-grub-shell-support-files-also-for-net-boot.patch new file mode 100644 index 0000000..e3f66c4 --- /dev/null +++ b/0128-grub-shell-support-files-also-for-net-boot.patch @@ -0,0 +1,59 @@ +From 4b94e3227b611a381e96ab41899cd4e8682f995d Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 5 Dec 2014 19:55:59 +0300 +Subject: [PATCH 128/506] grub-shell: support --files also for net boot + +This allows running tests that require extra files using netboot as well. +--- + ChangeLog | 4 ++++ + tests/util/grub-shell.in | 17 +++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 46f049d..c163cd5 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-12-05 Andrei Borzenkov ++ ++ * tests/util/grub-shell.in: Support --files also for netboot. ++ + 2014-12-01 Andrei Borzenkov + + * grub-core/loader/i386/xen_fileXX.c (grub_xen_get_infoXX): Fix +diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in +index d9a5253..5b66139 100644 +--- a/tests/util/grub-shell.in ++++ b/tests/util/grub-shell.in +@@ -422,11 +422,28 @@ do_trim () + fi + } + ++copy_extra_files() { ++ _destdir="$1" ++ shift ++ ++ # FIXME support '=' in file names ++ for _file in "$@"; do ++ _target="${_file%=*}" ++ _source="${_file#*=}" ++ [ -n "$_source" ] || _source="$_target" ++ _target="$_destdir/$_target" ++ _targetdir="$(dirname "$_target")" ++ [ -d "$_targetdir" ] || mkdir -p "$_targetdir" ++ cp "$_source" "$_target" ++ done ++} ++ + if [ x$boot = xnet ]; then + netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 + pkgdatadir="@builddir@" "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null + cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" + cp "${source}" "$netdir/boot/grub/testcase.cfg" ++ [ -z "$files" ] || copy_extra_files "$netdir" $files + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim + elif [ x$boot = xemu ]; then + grubdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" +-- +2.4.3 + diff --git a/0129-add-file-filters-tests.patch b/0129-add-file-filters-tests.patch new file mode 100644 index 0000000..3127c5a --- /dev/null +++ b/0129-add-file-filters-tests.patch @@ -0,0 +1,322 @@ +From 272e0466da16d0f8ce782895de4189c1585de9f3 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 5 Dec 2014 20:19:58 +0300 +Subject: [PATCH 129/506] add file filters tests + +Tests file access with all filters enabled. It does it both for local +and network access, due to regression in signature checking over network. + +This includes all files in distribution to not depend on existence +of compression tools and gpg. Test preloads all required modules to +avoid having to provide signatures for them. + +Still not implemented is file offset filter (is not available in grub +script, needs extra module) +--- + ChangeLog | 12 +++++++ + Makefile.util.def | 6 ++++ + conf/Makefile.extra-dist | 11 ++++++ + tests/file_filter/file.gz | Bin 0 -> 33 bytes + tests/file_filter/file.gz.sig | Bin 0 -> 96 bytes + tests/file_filter/file.lzop | Bin 0 -> 67 bytes + tests/file_filter/file.lzop.sig | Bin 0 -> 96 bytes + tests/file_filter/file.xz | Bin 0 -> 72 bytes + tests/file_filter/file.xz.sig | Bin 0 -> 96 bytes + tests/file_filter/keys | Bin 0 -> 994 bytes + tests/file_filter/keys.pub | Bin 0 -> 990 bytes + tests/file_filter/test.cfg | 6 ++++ + tests/file_filter_test.in | 76 ++++++++++++++++++++++++++++++++++++++++ + 13 files changed, 111 insertions(+) + create mode 100644 tests/file_filter/file.gz + create mode 100644 tests/file_filter/file.gz.sig + create mode 100644 tests/file_filter/file.lzop + create mode 100644 tests/file_filter/file.lzop.sig + create mode 100644 tests/file_filter/file.xz + create mode 100644 tests/file_filter/file.xz.sig + create mode 100644 tests/file_filter/keys + create mode 100644 tests/file_filter/keys.pub + create mode 100644 tests/file_filter/test.cfg + create mode 100644 tests/file_filter_test.in + +diff --git a/ChangeLog b/ChangeLog +index c163cd5..91ea81f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,18 @@ + 2014-12-05 Andrei Borzenkov + + * tests/util/grub-shell.in: Support --files also for netboot. ++ * tests/file_filter_test.in: New file with file filters tests. ++ * Makefile.util.def: Add file_filter_test. ++ * conf/Makefile.extra-dist: ... and here. ++ * tests/file_filter/file.gz: Test file for file_filter_test. ++ * tests/file_filter/file.gz.sig: Likewise. ++ * tests/file_filter/file.lzop: Likewise. ++ * tests/file_filter/file.lzop.sig: Likewise. ++ * tests/file_filter/file.xz: Likewise. ++ * tests/file_filter/file.xz.sig: Likewise. ++ * tests/file_filter/keys: Likewise. ++ * tests/file_filter/keys.pub: Likewise. ++ * tests/file_filter/test.cfg: Likewise. + + 2014-12-01 Andrei Borzenkov + +diff --git a/Makefile.util.def b/Makefile.util.def +index a286a89..fed96d8 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -1150,6 +1150,12 @@ script = { + common = tests/grub_cmd_tr.in; + }; + ++script = { ++ testcase; ++ name = file_filter_test; ++ common = tests/file_filter_test.in; ++}; ++ + program = { + testcase; + name = example_unit_test; +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 51f08c1..1b95ccd 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -110,3 +110,14 @@ EXTRA_DIST += tests/dfly-mbr-mbexample.mbr.img.gz + EXTRA_DIST += tests/dfly-mbr-mbexample.dfly.img.gz + + EXTRA_DIST += coreboot.cfg ++ ++EXTRA_DIST += tests/file_filter/file ++EXTRA_DIST += tests/file_filter/file.gz ++EXTRA_DIST += tests/file_filter/file.gz.sig ++EXTRA_DIST += tests/file_filter/file.lzop ++EXTRA_DIST += tests/file_filter/file.lzop.sig ++EXTRA_DIST += tests/file_filter/file.xz ++EXTRA_DIST += tests/file_filter/file.xz.sig ++EXTRA_DIST += tests/file_filter/keys ++EXTRA_DIST += tests/file_filter/keys.pub ++EXTRA_DIST += tests/file_filter/test.cfg +diff --git a/tests/file_filter/file.gz b/tests/file_filter/file.gz +new file mode 100644 +index 0000000000000000000000000000000000000000..a07ffcbe0cbad415ea51ec72bbe7b54094284d3d +GIT binary patch +literal 33 +pcmb2|=3qFtrZI$p`LoB_lP9kSYUuju20dY7FxvO)Cocm70|4R_48H&X + +literal 0 +HcmV?d00001 + +diff --git a/tests/file_filter/file.gz.sig b/tests/file_filter/file.gz.sig +new file mode 100644 +index 0000000000000000000000000000000000000000..602e6187e22d7fc288a52ac572f38cc1066083cb +GIT binary patch +literal 96 +zcmV-m0H6PeUIYLU2ml5J0#t#n2LK8Q5M~MT@8nv<3h9^t|7f?gmaE1LNh!Sm;mO#P +zdLo*tTpkl+s!TB^f%Fh1{Q&^Tlz2`!Q4Giq +Ct|zAe + +literal 0 +HcmV?d00001 + +diff --git a/tests/file_filter/file.lzop b/tests/file_filter/file.lzop +new file mode 100644 +index 0000000000000000000000000000000000000000..5f5a97171821de55168fcbdc9b1b335316d295b9 +GIT binary patch +literal 67 +zcmeD5iSlRQ<&xqOFi>dVbYNsjC(Bu@f@NKNp%ec7JvFb-Lz3O)* +CVl0pV + +literal 0 +HcmV?d00001 + +diff --git a/tests/file_filter/file.xz b/tests/file_filter/file.xz +new file mode 100644 +index 0000000000000000000000000000000000000000..151a98029033dd0947d54f8ddad670da85a45185 +GIT binary patch +literal 72 +zcmexsUKJ6=z`*kC+7>q^21Q0O1_p)_{ill=8F)NWb8_-^6iSOzixjzl!VG^@7(cF= +Z)UCz9sLER?d1RaXw$HVUAPJVpC;$*f6z~85 + +literal 0 +HcmV?d00001 + +diff --git a/tests/file_filter/file.xz.sig b/tests/file_filter/file.xz.sig +new file mode 100644 +index 0000000000000000000000000000000000000000..57569242e4742cdfb929307ec19440cf91f49e9a +GIT binary patch +literal 96 +zcmV-m0H6PeUIYLU2ml5J0#t#n3jhiU5M~MT@8nv<3OS$v{x;4Uj6+!wt^-rP*&N$| +z+5zKQ7vOO`?M~+y=au4FasdGNRgV;Q;4TNc&v05)-JLjLl54~a(Q}0wbmOZ2ne0%w +Ci77V# + +literal 0 +HcmV?d00001 + +diff --git a/tests/file_filter/keys b/tests/file_filter/keys +new file mode 100644 +index 0000000000000000000000000000000000000000..1afa71382364060d08bb0c28e36a1ff98d585fe8 +GIT binary patch +literal 994 +zcmV<810DRC11@ew%2nM8awI88}g~WvBj*BJPpr^(@>)pd~ex-<$MMPxbNPGZV|BH +zWj8IQR4B@uXKc3uaPJ1=^^Zq^DT +zGR)3)y_E}*oM=>(9mHp}SKbH+oTA=g$}Y_>Yo72Jn4N$d^(*k!0WN3*`c`xB4p;&y +zxUni$jurte*DGtmax;-CBK;ReR-(#??6SOFAtnGFD6+^8CX~5LD{yPt|2mUMt +zwJE)m>0ZFNaB_Tkn{@&~ymmqz6=oI&zK^|yp26yNF-zSkq2MW>GyFClY9q{@=2rys +zhJs5IhyReW6c9&Zrk@1~&dA`O!?SH6dN^nA@=cwz&`Ezpv7R;6gk|My_?I8#%?Z*v +z0G=T3S|-k)ND-11n=+U)J=DUmZ`*NlWO1qRl1d|e3jZ@ioyPN?bxzIto0ltfBGhMj +z*HF^AUdvgzSm>LzM75fVG>0caAHZcq9dkq@E1ccwLg7IkAD-Uj9eRWey-8OeDLZtP +zFGWnyh(8GDLvyN?Wb=5U*>gB4;O4Q~QA&IhlL~dxCca=f>yhv4IlbS9*wP37G*l-7 +z68Nu9XH0V?#8Mlr_|4bivnV+Xw +zydOTU@TyjupFl11F8p`)R&210tm6Y4QE*AG%aIRbg##g$XGEjNV}o~RH4hXtsdF}8 +zgc#a=4BiAs$WhG?LV$*t4U}ex(o2%HHKsbzt@0q@tiFkDvxZ4j5EO=^&d${9btru+ +zAB}{L36Q;49P;3xdCKCi1x(1w?GNPIz7@+G3MU121``j|n!I&1(;|JmS_t_VuMTgP +z(dkfWGS@ew%2nM8awI88}g~WvBj*BJPpr^(@>)pd~ex-<$MMPxbNPGZV|BH +zWj8IQR4B@uXKc3uaPJ1=^^Zq^DT +zGR)3)y_E}*oM=>(9mHp}SKbH+oTA=g$}Y_>Yo72Jn4N$d^(*k!0WN3*`c`xB4p;&y +zxUni$jurte*DGtmax;-CBK;ReR-(#??6SOFAtnGFD6+^8CX~5LD{yPt|2mUMt +zwJE)m>0ZFNaB_Tkn{@&~ymmqz6=oI&zK^|yp26yNF-zSkq2MW>GyFClY9q{@=2rys +zhJs5IhyReW6c9&Zrk@1~&dA`O!?SH6dN^nA@=cwz&`Ezpv7R;6gk|My_?I8#%?Z*v +z0G=T3S|-k)ND-11n=+U)J=DUmZ`*NlWO1qRl1d|e3jZ@ioyPN?bxzIto0ltfBGhMj +z*HF^AUdvgzSm>LzM75fVG>0caAHZcq9dkq@E1ccwLg7IkAD-Uj9eRWey-8OeDLZtP +zFGWnyh(8GDLvyN?Wb=5U*>gB4;O4Q~QA&IhlL~dxCca=f>yhv4IlbS9*wP37G*l-7 +z68Nu9XH0V?#8Mlr_|4bivnV+Xw +zydOTU@TyjupFl11F8p`)R&210tm6Y4QE*AG%aIRbg##g$XGEjNV}o~RH4hXtsdF}8 +zgc#a=4BiAs$WhG?LV$*t4U}ex(o2%HHKsbzt@0q@tiFkDvxZ4j5EO=^&d${9btru+ +zAB}{L36Q;49P;3xdCKCi1x(1w?GNPIz7@+G3MU121``j|n!I&1(;|JmS_t_VuMTgP +z(dkfWGS. ++ ++set -e ++grubshell=@builddir@/grub-shell ++ ++. "@builddir@/grub-core/modinfo.sh" ++ ++filters="gzio xzio lzopio verify" ++modules="cat mpi" ++ ++for mod in $(cut -d ' ' -f 2 "@builddir@/grub-core/crypto.lst" | sort -u); do ++ modules="$modules $mod" ++done ++ ++for file in file.gz file.xz file.lzop file.gz.sig file.xz.sig file.lzop.sig keys.pub; do ++ files="$files /$file=@srcdir@/tests/file_filter/$file" ++done ++ ++# GRUB cat command adds extra newline after file ++result="Hello, user! ++ ++Hello, user! ++ ++Hello, user!" ++ ++out="$("${grubshell}" --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" ++if [ "$out" != "$result" ]; then ++ echo LOCAL FAIL ++ echo "$out" ++ exit 1 ++fi ++ ++# Taken from netboot_test ++case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in ++ # PLATFORM: emu is different ++ *-emu) ++ exit 0;; ++ # PLATFORM: Flash targets ++ i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) ++ exit 0;; ++ # FIXME: currently grub-shell uses only -kernel for loongson ++ mipsel-loongson) ++ exit 0;; ++ # FIXME: no rtl8139 support ++ i386-multiboot) ++ exit 0;; ++ # FIXME: We don't fully support netboot on ARC ++ *-arc) ++ exit 0;; ++ # FIXME: Many QEMU firmware have no netboot capability ++ *-efi | i386-ieee1275 | powerpc-ieee1275 | sparc64-ieee1275) ++ exit 0;; ++esac ++ ++out="$("${grubshell}" --boot=net --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" ++if [ "$out" != "$result" ]; then ++ echo NET FAIL ++ echo "$out" ++ exit 1 ++fi ++ ++exit 0 +-- +2.4.3 + diff --git a/0130-fix-memory-corruption-in-pubkey-filter-over-network.patch b/0130-fix-memory-corruption-in-pubkey-filter-over-network.patch new file mode 100644 index 0000000..ce8e661 --- /dev/null +++ b/0130-fix-memory-corruption-in-pubkey-filter-over-network.patch @@ -0,0 +1,181 @@ +From ebb3d958aa2e1af8993c77018436bb14bec600b4 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 5 Dec 2014 21:17:08 +0300 +Subject: [PATCH 130/506] fix memory corruption in pubkey filter over network + +grub_pubkey_open closed original file after it was read; it set +io->device to NULL to prevent grub_file_close from trying to close device. +But network device itself is stacked (net -> bufio); and bufio preserved +original netfs file which hold reference to device. grub_file_close(io) +called grub_bufio_close which called grub_file_close for original file. +grub_file_close(netfs-file) now also called grub_device_close which +freed file->device->net. So file structure returned by grub_pubkey_open +now had device->net pointed to freed memory. When later file was closed, +it was attempted to be freed again. + +Change grub_pubkey_open to behave like other filters - preserve original +parent file and pass grub_file_close down to parent. In this way only the +original file will close device. We really need to move this logic into +core instead. + +Also plug memory leaks in error paths on the way. + +Reported-By: Robert Kliewer +Closes: bug #43601 +--- + ChangeLog | 2 ++ + grub-core/commands/verify.c | 72 +++++++++++++++++++++++++++++++++++++-------- + 2 files changed, 62 insertions(+), 12 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 91ea81f..a9ed5aa 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -13,6 +13,8 @@ + * tests/file_filter/keys: Likewise. + * tests/file_filter/keys.pub: Likewise. + * tests/file_filter/test.cfg: Likewise. ++ * grub-core/commands/verify.c: Fix memory corruption doing ++ signature check for network files (closes 43601). + + 2014-12-01 Andrei Borzenkov + +diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c +index 525bdd1..d599576 100644 +--- a/grub-core/commands/verify.c ++++ b/grub-core/commands/verify.c +@@ -33,6 +33,13 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + ++struct grub_verified ++{ ++ grub_file_t file; ++ void *buf; ++}; ++typedef struct grub_verified *grub_verified_t; ++ + enum + { + OPTION_SKIP_SIG = 0 +@@ -802,19 +809,39 @@ grub_cmd_verify_signature (grub_extcmd_context_t ctxt, + + static int sec = 0; + ++static void ++verified_free (grub_verified_t verified) ++{ ++ if (verified) ++ { ++ grub_free (verified->buf); ++ grub_free (verified); ++ } ++} ++ + static grub_ssize_t + verified_read (struct grub_file *file, char *buf, grub_size_t len) + { +- grub_memcpy (buf, (char *) file->data + file->offset, len); ++ grub_verified_t verified = file->data; ++ ++ grub_memcpy (buf, (char *) verified->buf + file->offset, len); + return len; + } + + static grub_err_t + verified_close (struct grub_file *file) + { +- grub_free (file->data); ++ grub_verified_t verified = file->data; ++ ++ grub_file_close (verified->file); ++ verified_free (verified); + file->data = 0; +- return GRUB_ERR_NONE; ++ ++ /* device and name are freed by parent */ ++ file->device = 0; ++ file->name = 0; ++ ++ return grub_errno; + } + + struct grub_fs verified_fs = +@@ -832,6 +859,7 @@ grub_pubkey_open (grub_file_t io, const char *filename) + grub_err_t err; + grub_file_filter_t curfilt[GRUB_FILE_FILTER_MAX]; + grub_file_t ret; ++ grub_verified_t verified; + + if (!sec) + return io; +@@ -857,7 +885,10 @@ grub_pubkey_open (grub_file_t io, const char *filename) + + ret = grub_malloc (sizeof (*ret)); + if (!ret) +- return NULL; ++ { ++ grub_file_close (sig); ++ return NULL; ++ } + *ret = *io; + + ret->fs = &verified_fs; +@@ -866,29 +897,46 @@ grub_pubkey_open (grub_file_t io, const char *filename) + { + grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "big file signature isn't implemented yet"); ++ grub_file_close (sig); ++ grub_free (ret); ++ return NULL; ++ } ++ verified = grub_malloc (sizeof (*verified)); ++ if (!verified) ++ { ++ grub_file_close (sig); ++ grub_free (ret); + return NULL; + } +- ret->data = grub_malloc (ret->size); +- if (!ret->data) ++ verified->buf = grub_malloc (ret->size); ++ if (!verified->buf) + { ++ grub_file_close (sig); ++ grub_free (verified); + grub_free (ret); + return NULL; + } +- if (grub_file_read (io, ret->data, ret->size) != (grub_ssize_t) ret->size) ++ if (grub_file_read (io, verified->buf, ret->size) != (grub_ssize_t) ret->size) + { + if (!grub_errno) + grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + filename); ++ grub_file_close (sig); ++ verified_free (verified); ++ grub_free (ret); + return NULL; + } + +- err = grub_verify_signature_real (ret->data, ret->size, 0, sig, NULL); ++ err = grub_verify_signature_real (verified->buf, ret->size, 0, sig, NULL); + grub_file_close (sig); + if (err) +- return NULL; +- io->device = 0; +- io->name = 0; +- grub_file_close (io); ++ { ++ verified_free (verified); ++ grub_free (ret); ++ return NULL; ++ } ++ verified->file = io; ++ ret->data = verified; + return ret; + } + +-- +2.4.3 + diff --git a/0131-fix-double-free-in-grub_net_recv_tcp_packet.patch b/0131-fix-double-free-in-grub_net_recv_tcp_packet.patch new file mode 100644 index 0000000..186f36d --- /dev/null +++ b/0131-fix-double-free-in-grub_net_recv_tcp_packet.patch @@ -0,0 +1,49 @@ +From 06eadf5ebf21c8520d696c6438a976e5f7c218c3 Mon Sep 17 00:00:00 2001 +From: Curtis Larsen +Date: Sun, 7 Dec 2014 11:28:57 +0300 +Subject: [PATCH 131/506] fix double free in grub_net_recv_tcp_packet + +Using the http module to download config files, produces memory errors, +after the config file is downloaded. + +The error was traced to the tcp stack in grub-core/net/tcp.c. The wrong +netbuff pointer was being freed in the clean up loop. + +Changing the code to free the correct netbuff pointer removes the runtime +error. + +Closes 42765. +--- + ChangeLog | 5 +++++ + grub-core/net/tcp.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index a9ed5aa..e5c9fd3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-12-07 Curtis Larsen ++ ++ * grub-core/net/tcp.c (grub_net_recv_tcp_packet): Fix double ++ free when multiple empty segments were received (closes 42765). ++ + 2014-12-05 Andrei Borzenkov + + * tests/util/grub-shell.in: Support --files also for netboot. +diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c +index 2077f55..1d90f1e 100644 +--- a/grub-core/net/tcp.c ++++ b/grub-core/net/tcp.c +@@ -918,7 +918,7 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, + do_ack = 1; + } + else +- grub_netbuff_free (nb); ++ grub_netbuff_free (nb_top); + } + if (do_ack) + ack (sock); +-- +2.4.3 + diff --git a/0132-Avoid-use-of-non-portable-echo-n-in-grub-mkconfig.patch b/0132-Avoid-use-of-non-portable-echo-n-in-grub-mkconfig.patch new file mode 100644 index 0000000..2e614d2 --- /dev/null +++ b/0132-Avoid-use-of-non-portable-echo-n-in-grub-mkconfig.patch @@ -0,0 +1,162 @@ +From cdae5bf208f5fa6093fa34c978c5da7b5bbafc54 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 7 Dec 2014 14:56:17 +0300 +Subject: [PATCH 132/506] Avoid use of non-portable echo -n in grub-mkconfig + +util/grub-mkconfig_lib.in(version_test_gt): "echo -n" is not really needed, +final newline is stripped by command substitution. + +util/grub.d/10_kfreebsd.in, util/grub.d/10_linux.in, +util/grub.d/20_linux_xen.in: change how list is built, to avoid echo -n +completely. + +util/grub.d/30_os-prober.in: add spaces to printed line directly + +Closes 43668. +--- + ChangeLog | 11 +++++++++++ + util/grub-mkconfig_lib.in | 4 ++-- + util/grub.d/10_kfreebsd.in | 9 ++++++--- + util/grub.d/10_linux.in | 14 ++++++++------ + util/grub.d/20_linux_xen.in | 14 ++++++++------ + util/grub.d/30_os-prober.in | 3 +-- + 6 files changed, 36 insertions(+), 19 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index e5c9fd3..b23f069 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,14 @@ ++2014-12-07 Andrei Borzenkov ++ ++ * util/grub-mkconfig_lib.in (version_test_gt): Remove redundant ++ non-portable '-n' echo option. ++ * util/grub.d/10_kfreebsd.in: Change how list is built to avoid ++ non-portable 'echo -n. ++ * util/grub.d/10_linux.in: Likewise (closes 43668). ++ * util/grub.d/20_linux_xen.in: Likewise. ++ * util/grub.d/30_os-prober.in: Print spaces directly to avoid ++ non-portable 'echo -n'. ++ + 2014-12-07 Curtis Larsen + + * grub-core/net/tcp.c (grub_net_recv_tcp_packet): Fix double +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 14fadbc..29ef865 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -246,8 +246,8 @@ version_test_gt () + fi + case "$version_test_gt_a:$version_test_gt_b" in + *.old:*.old) ;; +- *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; +- *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; ++ *.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 ;; + esac + version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" + return "$?" +diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in +index ba7175b..65f6c32 100644 +--- a/util/grub.d/10_kfreebsd.in ++++ b/util/grub.d/10_kfreebsd.in +@@ -143,9 +143,12 @@ EOF + EOF + } + +-list=`for i in /boot/kfreebsd-* /boot/kernel/kernel ; do +- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi +- done` ++list= ++for i in /boot/kfreebsd-* /boot/kernel/kernel ; do ++ if grub_file_is_not_garbage "$i" ; then ++ list="$list $i" ++ fi ++done + prepare_boot_cache= + boot_device_id= + title_correction_code= +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index d2e2a8f..a2a84dc 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -147,13 +147,15 @@ EOF + machine=`uname -m` + case "x$machine" in + xi?86 | xx86_64) +- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi +- done` ;; ++ list= ++ for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do ++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi ++ done ;; + *) +- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi +- done` ;; ++ list= ++ for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do ++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi ++ done ;; + esac + + case "$machine" in +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index 2e77758..de34c8d 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -137,7 +137,8 @@ EOF + EOF + } + +-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do ++linux_list= ++for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do + if grub_file_is_not_garbage "$i"; then + basename=$(basename $i) + version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") +@@ -149,9 +150,9 @@ linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do + break + fi + done +- if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi ++ if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then linux_list="$linux_list $i" ; fi + fi +- done` ++done + if [ "x${linux_list}" = "x" ] ; then + exit 0 + fi +@@ -165,9 +166,10 @@ file_is_not_sym () { + esac + } + +-xen_list=`for i in /boot/xen*; do +- if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then echo -n "$i " ; fi +- done` ++xen_list= ++for i in /boot/xen*; do ++ if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi ++done + prepare_boot_cache= + boot_device_id= + +diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in +index 6f38c82..4ee6015 100644 +--- a/util/grub.d/30_os-prober.in ++++ b/util/grub.d/30_os-prober.in +@@ -322,9 +322,8 @@ EOF + EOF + ;; + *) +- echo -n " " + # TRANSLATORS: %s is replaced by OS name. +- gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2 ++ gettext_printf "%s is not yet supported by grub-mkconfig.\n" " ${LONGNAME}" >&2 + ;; + esac + done +-- +2.4.3 + diff --git a/0133-grub-core-fs-ext2.c-grub_ext2_read_block-Support-lar.patch b/0133-grub-core-fs-ext2.c-grub_ext2_read_block-Support-lar.patch new file mode 100644 index 0000000..37860c1 --- /dev/null +++ b/0133-grub-core-fs-ext2.c-grub_ext2_read_block-Support-lar.patch @@ -0,0 +1,42 @@ +From 58f66137a37f3d84a8b37fbe7d5be8e49c3c5768 Mon Sep 17 00:00:00 2001 +From: Peter Nelson +Date: Sun, 7 Dec 2014 17:57:49 +0100 +Subject: [PATCH 133/506] * grub-core/fs/ext2.c (grub_ext2_read_block): Support + large sparse chunks. + +--- + ChangeLog | 5 +++++ + grub-core/fs/ext2.c | 4 ++++ + 2 files changed, 9 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index b23f069..6f2924e 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-12-07 Peter Nelson ++ ++ * grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse ++ chunks. ++ + 2014-12-07 Andrei Borzenkov + + * util/grub-mkconfig_lib.in (version_test_gt): Remove redundant +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index 5f7a2b9..217771d 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -484,6 +484,10 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + + indirect: + do { ++ /* If the indirect block is zero, all child blocks are absent ++ (i.e. filled with zeros.) */ ++ if (indir == 0) ++ return 0; + if (grub_disk_read (data->disk, + ((grub_disk_addr_t) grub_le_to_cpu32 (indir)) + << log2_blksz, +-- +2.4.3 + diff --git a/0134-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch b/0134-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch new file mode 100644 index 0000000..f809eed --- /dev/null +++ b/0134-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch @@ -0,0 +1,65 @@ +From 17328db3b33d67f2e5365fcb123d41aacc7ab16b Mon Sep 17 00:00:00 2001 +From: David Kozub +Date: Thu, 20 Nov 2014 21:53:14 +0100 +Subject: [PATCH 134/506] grub-core/kern/arm/misc.S: fix unaligned + grub_uint64_t local variable + +The unaligned local in __aeabi_uidivmod leads to a store to a 64bit +value at an address that is not divisible by 8 (in grub_divmod64). +The compiler most likely generates a STRD instruction to store it and +this causes an exception. + +Fixes Savannah bug #43632. + +This includes improvements done by Leif Lindholm. +--- + ChangeLog | 6 ++++++ + grub-core/kern/arm/misc.S | 14 +++++++------- + 2 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6f2924e..4150810 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++2014-12-07 David Kozub ++ ++ * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable ++ in __aeabi_uidivmod ++ Fixes Savannah bug #43632. ++ + 2014-12-07 Peter Nelson + + * grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse +diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/misc.S +index 8943cc3..16b6f8e 100644 +--- a/grub-core/kern/arm/misc.S ++++ b/grub-core/kern/arm/misc.S +@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) + + .macro division parent + +- stmfd sp!, {lr} +- sub sp, sp, #12 ++ sub sp, sp, #8 @ Allocate naturally aligned 64-bit space ++ stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment ++ add r3, sp, #8 @ Set r3 to address of 64-bit space ++ str r3, [sp] @ Stack parameter, pointer to 64-bit space + mov r2, r1 +- add r1, sp, #4 +- str r1, [sp, #0] + mov r1, #0 + mov r3, #0 + bl \parent +- ldr r1, [sp, #4] +- add sp, sp, #12 +- ldmfd sp!, {lr} ++ ldr r1, [sp, #8] @ Extract remainder ++ ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register ++ add sp, sp, #8 + bx lr + .endm + +-- +2.4.3 + diff --git a/0135-Fix-serial-rtscts-option-processing.patch b/0135-Fix-serial-rtscts-option-processing.patch new file mode 100644 index 0000000..2a1c9c4 --- /dev/null +++ b/0135-Fix-serial-rtscts-option-processing.patch @@ -0,0 +1,42 @@ +From bac5d1a64ab4191058a8fd4c05f6b3b339e249e7 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 9 Dec 2014 21:41:49 +0300 +Subject: [PATCH 135/506] Fix serial --rtscts option processing + +--- + ChangeLog | 5 +++++ + grub-core/term/serial.c | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4150810..c38917b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-12-09 Andrei Borzenkov ++ ++ * grub-core/term/serial.c (grub_cmd_serial): Fix --rtscts ++ option processing. ++ + 2014-12-07 David Kozub + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable +diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c +index c9b5574..5784bc2 100644 +--- a/grub-core/term/serial.c ++++ b/grub-core/term/serial.c +@@ -241,9 +241,9 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) + + if (state[OPTION_RTSCTS].set) + { +- if (grub_strcmp (state[OPTION_PARITY].arg, "on") == 0) ++ if (grub_strcmp (state[OPTION_RTSCTS].arg, "on") == 0) + config.rtscts = 1; +- if (grub_strcmp (state[OPTION_PARITY].arg, "off") == 0) ++ else if (grub_strcmp (state[OPTION_RTSCTS].arg, "off") == 0) + config.rtscts = 0; + else + return grub_error (GRUB_ERR_BAD_ARGUMENT, +-- +2.4.3 + diff --git a/0136-Support-GELI-v6-and-v7.patch b/0136-Support-GELI-v6-and-v7.patch new file mode 100644 index 0000000..6b900ad --- /dev/null +++ b/0136-Support-GELI-v6-and-v7.patch @@ -0,0 +1,93 @@ +From ba3031f9963dfc5416140ceebd16d8239e22b1e4 Mon Sep 17 00:00:00 2001 +From: Kris Moore +Date: Mon, 19 Jan 2015 21:56:41 +0300 +Subject: [PATCH 136/506] Support GELI v6 and v7 + +--- + ChangeLog | 4 ++++ + grub-core/disk/geli.c | 26 ++++++++++++++++++++------ + 2 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c38917b..854c008 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2015-01-19 Kris Moore ++ ++ * grub-core/disk/geli.c: Support GELI v6 and v7. ++ + 2014-12-09 Andrei Borzenkov + + * grub-core/term/serial.c (grub_cmd_serial): Fix --rtscts +diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c +index 1727341..4ed07bb 100644 +--- a/grub-core/disk/geli.c ++++ b/grub-core/disk/geli.c +@@ -225,7 +225,7 @@ grub_util_get_geli_uuid (const char *dev) + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header->version) > 5 ++ || grub_le_to_cpu32 (header->version) > 7 + || grub_le_to_cpu32 (header->version) < 1) + grub_util_error ("%s", _("wrong ELI magic or version")); + +@@ -265,7 +265,7 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header.version) > 5 ++ || grub_le_to_cpu32 (header.version) > 7 + || grub_le_to_cpu32 (header.version) < 1) + { + grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]); +@@ -401,6 +401,7 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev) + grub_uint8_t geomkey[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t verify_key[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t zero[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; ++ grub_uint8_t geli_cipher_key[64]; + char passphrase[MAX_PASSPHRASE] = ""; + unsigned i; + gcry_err_code_t gcry_err; +@@ -524,6 +525,19 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev) + continue; + grub_printf_ (N_("Slot %d opened\n"), i); + ++ if (grub_le_to_cpu32 (header.version) >= 7) ++ { ++ /* GELI >=7 uses the cipher_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.cipher_key, ++ sizeof (candidate_key.cipher_key)); ++ } ++ else ++ { ++ /* GELI <=6 uses the iv_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.iv_key, ++ sizeof (candidate_key.iv_key)); ++ } ++ + /* Set the master key. */ + if (!dev->rekey) + { +@@ -540,13 +554,13 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev) + grub_size_t real_keysize = keysize; + if (grub_le_to_cpu16 (header.alg) == 0x16) + real_keysize *= 2; +- /* For a reason I don't know, the IV key is used in rekeying. */ +- grub_memcpy (dev->rekey_key, candidate_key.iv_key, +- sizeof (candidate_key.iv_key)); ++ ++ grub_memcpy (dev->rekey_key, geli_cipher_key, ++ sizeof (geli_cipher_key)); + dev->rekey_derived_size = real_keysize; + dev->last_rekey = -1; + COMPILE_TIME_ASSERT (sizeof (dev->rekey_key) +- >= sizeof (candidate_key.iv_key)); ++ >= sizeof (geli_cipher_key)); + } + + dev->iv_prefix_len = sizeof (candidate_key.iv_key); +-- +2.4.3 + diff --git a/0137-Replace-explicit-sizeof-divisions-by-ARRAY_SIZE.patch b/0137-Replace-explicit-sizeof-divisions-by-ARRAY_SIZE.patch new file mode 100644 index 0000000..b4ee796 --- /dev/null +++ b/0137-Replace-explicit-sizeof-divisions-by-ARRAY_SIZE.patch @@ -0,0 +1,152 @@ +From 59d403659461db52e08a0bd49d418baaa2fa106b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 12:45:45 +0100 +Subject: [PATCH 137/506] Replace explicit sizeof divisions by ARRAY_SIZE. + +--- + ChangeLog | 4 ++++ + grub-core/commands/i386/pc/sendkey.c | 10 ++++------ + grub-core/kern/emu/hostdisk.c | 6 +++--- + grub-core/lib/syslinux_parse.c | 4 ++-- + grub-core/loader/i386/xnu.c | 4 ++-- + grub-core/normal/color.c | 2 +- + 6 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 854c008..326f621 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2015-01-20 Vladimir Serbinenko ++ ++ Replace explicit sizeof divisions by ARRAY_SIZE. ++ + 2015-01-19 Kris Moore + + * grub-core/disk/geli.c: Support GELI v6 and v7. +diff --git a/grub-core/commands/i386/pc/sendkey.c b/grub-core/commands/i386/pc/sendkey.c +index d985cb3..26d9acd 100644 +--- a/grub-core/commands/i386/pc/sendkey.c ++++ b/grub-core/commands/i386/pc/sendkey.c +@@ -292,7 +292,7 @@ find_key_code (char *key) + { + unsigned i; + +- for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++) ++ for (i = 0; i < ARRAY_SIZE(keysym_table); i++) + { + if (keysym_table[i].unshifted_name + && grub_strcmp (key, keysym_table[i].unshifted_name) == 0) +@@ -311,7 +311,7 @@ find_ascii_code (char *key) + { + unsigned i; + +- for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++) ++ for (i = 0; i < ARRAY_SIZE(keysym_table); i++) + { + if (keysym_table[i].unshifted_name + && grub_strcmp (key, keysym_table[i].unshifted_name) == 0) +@@ -352,15 +352,13 @@ grub_cmd_sendkey (grub_extcmd_context_t ctxt, int argc, char **args) + + { + unsigned i; +- for (i = 0; i < sizeof (simple_flag_offsets) +- / sizeof (simple_flag_offsets[0]); i++) ++ for (i = 0; i < ARRAY_SIZE(simple_flag_offsets); i++) + grub_sendkey_set_simple_flag (simple_flag_offsets[i], + grub_sendkey_parse_op(state[i])); + } + + /* Set noled. */ +- noled = (state[sizeof (simple_flag_offsets) +- / sizeof (simple_flag_offsets[0])].set); ++ noled = (state[ARRAY_SIZE(simple_flag_offsets)].set); + + return GRUB_ERR_NONE; + } +diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c +index 44b0fcb..a4ebf78 100644 +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -99,7 +99,7 @@ find_free_slot (void) + { + unsigned int i; + +- for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) ++ for (i = 0; i < ARRAY_SIZE (map); i++) + if (! map[i].drive) + return i; + +@@ -115,7 +115,7 @@ grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, + if (pull != GRUB_DISK_PULL_NONE) + return 0; + +- for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) ++ for (i = 0; i < ARRAY_SIZE (map); i++) + if (map[i].drive && hook (map[i].drive, hook_data)) + return 1; + +@@ -581,7 +581,7 @@ grub_util_biosdisk_fini (void) + { + unsigned i; + +- for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) ++ for (i = 0; i < ARRAY_SIZE(map); i++) + { + if (map[i].drive) + free (map[i].drive); +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 08e451c..241cefe 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -717,7 +717,7 @@ syslinux_parse_real (struct syslinux_menu *menu) + for (ptr3 = ptr2; grub_isspace (*ptr3) && *ptr3; ptr3++); + for (ptr4 = ptr3; !grub_isspace (*ptr4) && *ptr4; ptr4++); + for (ptr5 = ptr4; grub_isspace (*ptr5) && *ptr5; ptr5++); +- for (i = 0; i < sizeof (commands) / sizeof (commands[0]); i++) ++ for (i = 0; i < ARRAY_SIZE(commands); i++) + if (grub_strlen (commands[i].name1) == (grub_size_t) (ptr2 - ptr1) + && grub_strncasecmp (commands[i].name1, ptr1, ptr2 - ptr1) == 0 + && (commands[i].name2 == NULL +@@ -726,7 +726,7 @@ syslinux_parse_real (struct syslinux_menu *menu) + && grub_strncasecmp (commands[i].name2, ptr3, ptr4 - ptr3) + == 0))) + break; +- if (i == sizeof (commands) / sizeof (commands[0])) ++ if (i == ARRAY_SIZE(commands)) + { + if (sizeof ("text") - 1 == ptr2 - ptr1 + && grub_strncasecmp ("text", ptr1, ptr2 - ptr1) == 0 +diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c +index e83e1e9..94daa02 100644 +--- a/grub-core/loader/i386/xnu.c ++++ b/grub-core/loader/i386/xnu.c +@@ -741,10 +741,10 @@ grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out) + *((grub_uint64_t *) curval->data) = (grub_addr_t) ptr; + + /* Create alias. */ +- for (j = 0; j < sizeof (table_aliases) / sizeof (table_aliases[0]); j++) ++ for (j = 0; j < ARRAY_SIZE(table_aliases); j++) + if (grub_memcmp (&table_aliases[j].guid, &guid, sizeof (guid)) == 0) + break; +- if (j != sizeof (table_aliases) / sizeof (table_aliases[0])) ++ if (j != ARRAY_SIZE(table_aliases)) + { + curval = grub_xnu_create_value (&(curkey->first_child), "alias"); + if (!curval) +diff --git a/grub-core/normal/color.c b/grub-core/normal/color.c +index c265423..d22cf90 100644 +--- a/grub-core/normal/color.c ++++ b/grub-core/normal/color.c +@@ -47,7 +47,7 @@ static int + parse_color_name (grub_uint8_t *ret, char *name) + { + grub_uint8_t i; +- for (i = 0; i < sizeof (color_list) / sizeof (*color_list); i++) ++ for (i = 0; i < ARRAY_SIZE(color_list); i++) + if (! grub_strcmp (name, color_list[i])) + { + *ret = i; +-- +2.4.3 + diff --git a/0138-grub_script_lexer_yywrap-Update-len-synchronously-wi.patch b/0138-grub_script_lexer_yywrap-Update-len-synchronously-wi.patch new file mode 100644 index 0000000..fd000f5 --- /dev/null +++ b/0138-grub_script_lexer_yywrap-Update-len-synchronously-wi.patch @@ -0,0 +1,41 @@ +From 66ce4d1aefd54f952f809801380253c28754ed81 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 12:53:20 +0100 +Subject: [PATCH 138/506] grub_script_lexer_yywrap: Update len synchronously + with line. + +--- + ChangeLog | 5 +++++ + grub-core/script/lexer.c | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 326f621..80ef35c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/script/lexer.c (grub_script_lexer_yywrap): Update len ++ synchronously with line. ++ ++2015-01-20 Vladimir Serbinenko ++ + Replace explicit sizeof divisions by ARRAY_SIZE. + + 2015-01-19 Kris Moore +diff --git a/grub-core/script/lexer.c b/grub-core/script/lexer.c +index 128d238..89cf677 100644 +--- a/grub-core/script/lexer.c ++++ b/grub-core/script/lexer.c +@@ -164,6 +164,7 @@ grub_script_lexer_yywrap (struct grub_parser_param *parserstate, + { + grub_free (line); + line = grub_strdup ("\n"); ++ len = 1; + } + else if (len && line[len - 1] != '\n') + { +-- +2.4.3 + diff --git a/0139-grub_fshelp_read_file-Don-t-attempt-to-read-past-the.patch b/0139-grub_fshelp_read_file-Don-t-attempt-to-read-past-the.patch new file mode 100644 index 0000000..771d88b --- /dev/null +++ b/0139-grub_fshelp_read_file-Don-t-attempt-to-read-past-the.patch @@ -0,0 +1,47 @@ +From af435524cd39f0967cd46e650e4312ecfeb158ed Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 12:58:17 +0100 +Subject: [PATCH 139/506] grub_fshelp_read_file: Don't attempt to read past the + end of file. + +--- + ChangeLog | 5 +++++ + grub-core/fs/fshelp.c | 7 +++++++ + 2 files changed, 12 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 80ef35c..c18ab2d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/fshelp.c (grub_fshelp_read_file): Don't attempt to read ++ past the end of file. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/script/lexer.c (grub_script_lexer_yywrap): Update len + synchronously with line. + +diff --git a/grub-core/fs/fshelp.c b/grub-core/fs/fshelp.c +index 42bd542..b899bed 100644 +--- a/grub-core/fs/fshelp.c ++++ b/grub-core/fs/fshelp.c +@@ -252,6 +252,13 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, + grub_disk_addr_t i, blockcnt; + int blocksize = 1 << (log2blocksize + GRUB_DISK_SECTOR_BITS); + ++ if (pos > filesize) ++ { ++ grub_error (GRUB_ERR_OUT_OF_RANGE, ++ N_("attempt to read past the end of file")); ++ return -1; ++ } ++ + /* Adjust LEN so it we can't read past the end of the file. */ + if (pos + len > filesize) + len = filesize - pos; +-- +2.4.3 + diff --git a/0140-grub-core-fs-minix.c-grub_minix_read_file-Avoid-read.patch b/0140-grub-core-fs-minix.c-grub_minix_read_file-Avoid-read.patch new file mode 100644 index 0000000..b079339 --- /dev/null +++ b/0140-grub-core-fs-minix.c-grub_minix_read_file-Avoid-read.patch @@ -0,0 +1,66 @@ +From 30e177a05bc2ba8d01c69dd587198a9b88279de1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 13:55:55 +0100 +Subject: [PATCH 140/506] grub-core/fs/minix.c (grub_minix_read_file): Avoid + reading past the end of file. + +--- + ChangeLog | 10 ++++++++++ + grub-core/bus/usb/usbtrans.c | 2 +- + grub-core/fs/minix.c | 7 +++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index c18ab2d..1428477 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,15 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_maxpacket): Avoid ++ potentially returning 0. ++ ++2015-01-20 Vladimir Serbinenko ++ ++ * grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past ++ the end of file. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/fshelp.c (grub_fshelp_read_file): Don't attempt to read + past the end of file. + +diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c +index 557e71c..b614997 100644 +--- a/grub-core/bus/usb/usbtrans.c ++++ b/grub-core/bus/usb/usbtrans.c +@@ -31,7 +31,7 @@ grub_usb_bulk_maxpacket (grub_usb_device_t dev, + struct grub_usb_desc_endp *endpoint) + { + /* Use the maximum packet size given in the endpoint descriptor. */ +- if (dev->initialized && endpoint) ++ if (dev->initialized && endpoint && (unsigned int) endpoint->maxpacket) + return endpoint->maxpacket; + + return 64; +diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c +index 98e1b71..6f629a1 100644 +--- a/grub-core/fs/minix.c ++++ b/grub-core/fs/minix.c +@@ -262,6 +262,13 @@ grub_minix_read_file (struct grub_minix_data *data, + grub_uint32_t posblock; + grub_uint32_t blockoff; + ++ if (pos > GRUB_MINIX_INODE_SIZE (data)) ++ { ++ grub_error (GRUB_ERR_OUT_OF_RANGE, ++ N_("attempt to read past the end of file")); ++ return -1; ++ } ++ + /* Adjust len so it we can't read past the end of the file. */ + if (len + pos > GRUB_MINIX_INODE_SIZE (data)) + len = GRUB_MINIX_INODE_SIZE (data) - pos; +-- +2.4.3 + diff --git a/0141-grub_cmd_play-Avoid-division-by-zero.patch b/0141-grub_cmd_play-Avoid-division-by-zero.patch new file mode 100644 index 0000000..ef090c9 --- /dev/null +++ b/0141-grub_cmd_play-Avoid-division-by-zero.patch @@ -0,0 +1,61 @@ +From 44461d5af23dc00bf31604fa07e191b0d4c5cb67 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:11:32 +0100 +Subject: [PATCH 141/506] grub_cmd_play: Avoid division by zero. + +--- + ChangeLog | 5 +++++ + grub-core/commands/i386/pc/play.c | 15 +++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 1428477..3ae00de 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/commands/i386/pc/play.c (grub_cmd_play): Avoid ++ division by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_maxpacket): Avoid + potentially returning 0. + +diff --git a/grub-core/commands/i386/pc/play.c b/grub-core/commands/i386/pc/play.c +index 40798c9..7712e2a 100644 +--- a/grub-core/commands/i386/pc/play.c ++++ b/grub-core/commands/i386/pc/play.c +@@ -107,6 +107,14 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), + return grub_errno; + } + ++ if (!tempo) ++ { ++ grub_file_close (file); ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), ++ args[0]); ++ return grub_errno; ++ } ++ + tempo = grub_le_to_cpu32 (tempo); + grub_dprintf ("play","tempo = %d\n", tempo); + +@@ -131,6 +139,13 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), + + tempo = grub_strtoul (args[0], &end, 0); + ++ if (!tempo) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), ++ args[0]); ++ return grub_errno; ++ } ++ + if (*end) + /* Was not a number either, assume it was supposed to be a file name. */ + return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), args[0]); +-- +2.4.3 + diff --git a/0142-Files-reorganization-and-include-some-libgcc-fuction.patch b/0142-Files-reorganization-and-include-some-libgcc-fuction.patch deleted file mode 100644 index 26efb6f..0000000 --- a/0142-Files-reorganization-and-include-some-libgcc-fuction.patch +++ /dev/null @@ -1,439 +0,0 @@ -From 8bbf108c19b8e9d42f538941a3ae5db49d4c53cd Mon Sep 17 00:00:00 2001 -From: Paulo Flabiano Smorigo -Date: Wed, 13 Aug 2014 19:00:19 +0000 -Subject: [PATCH 142/152] Files reorganization and include some libgcc fuctions - -As we avoid libgcc dependency for powerpc64el, we moved some functions -to other files and add the necessary ones. - -* Makefile.core.def: Include compiler-rt.S. -* misc.c: Add the necessary libgcc functions. -* compiler-rt.S: New file. -* libgcc.h: Move some content from here ... -* compiler.h: ... to here. - -Also-By: Brent Baude -Also-By: Vladimir 'phcoder' Serbinenko ---- - grub-core/Makefile.core.def | 1 + - grub-core/kern/misc.c | 107 ++++++++++++++++++++++++++++ - grub-core/kern/powerpc/compiler-rt.S | 130 +++++++++++++++++++++++++++++++++++ - include/grub/compiler.h | 61 ++++++++++++++++ - include/grub/libgcc.h | 67 ------------------ - 5 files changed, 299 insertions(+), 67 deletions(-) - create mode 100644 grub-core/kern/powerpc/compiler-rt.S - -diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 7bf1c8a..9ff9ae5 100644 ---- a/grub-core/Makefile.core.def -+++ b/grub-core/Makefile.core.def -@@ -252,6 +252,7 @@ kernel = { - - powerpc_ieee1275 = kern/powerpc/cache.S; - powerpc_ieee1275 = kern/powerpc/dl.c; -+ powerpc_ieee1275 = kern/powerpc/compiler-rt.S; - - sparc64_ieee1275 = kern/sparc64/cache.S; - sparc64_ieee1275 = kern/sparc64/dl.c; -diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index a56cfe7..a3e5056 100644 ---- a/grub-core/kern/misc.c -+++ b/grub-core/kern/misc.c -@@ -1345,3 +1345,110 @@ grub_real_boot_time (const char *file, - grub_error_pop (); - } - #endif -+ -+#if defined (NO_LIBGCC) -+ -+/* Based on libgcc2.c from gcc suite. */ -+int -+__ucmpdi2 (grub_uint64_t a, grub_uint64_t b) -+{ -+ union component64 ac, bc; -+ ac.full = a; -+ bc.full = b; -+ -+ if (ac.high < bc.high) -+ return 0; -+ else if (ac.high > bc.high) -+ return 2; -+ -+ if (ac.low < bc.low) -+ return 0; -+ else if (ac.low > bc.low) -+ return 2; -+ return 1; -+} -+ -+ -+/* Based on libgcc2.c from gcc suite. */ -+grub_uint64_t -+__lshrdi3 (grub_uint64_t u, int b) -+{ -+ if (b == 0) -+ return u; -+ -+ const union component64 uu = {.full = u}; -+ const int bm = 32 - b; -+ union component64 w; -+ -+ if (bm <= 0) -+ { -+ w.high = 0; -+ w.low = (grub_uint32_t) uu.high >> -bm; -+ } -+ else -+ { -+ const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; -+ -+ w.high = (grub_uint32_t) uu.high >> b; -+ w.low = ((grub_uint32_t) uu.low >> b) | carries; -+ } -+ -+ return w.full; -+} -+ -+/* Based on libgcc2.c from gcc suite. */ -+grub_uint64_t -+__ashrdi3 (grub_uint64_t u, int b) -+{ -+ if (b == 0) -+ return u; -+ -+ const union component64 uu = {.full = u}; -+ const int bm = 32 - b; -+ union component64 w; -+ -+ if (bm <= 0) -+ { -+ /* w.high = 1..1 or 0..0 */ -+ w.high = uu.high >> (32 - 1); -+ w.low = uu.high >> -bm; -+ } -+ else -+ { -+ const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; -+ -+ w.high = uu.high >> b; -+ w.low = ((grub_uint32_t) uu.low >> b) | carries; -+ } -+ -+ return w.full; -+} -+ -+/* Based on libgcc2.c from gcc suite. */ -+grub_uint64_t -+__ashldi3 (grub_uint64_t u, int b) -+{ -+ if (b == 0) -+ return u; -+ -+ const union component64 uu = {.full = u}; -+ const int bm = 32 - b; -+ union component64 w; -+ -+ if (bm <= 0) -+ { -+ w.low = 0; -+ w.high = (grub_uint32_t) uu.low << -bm; -+ } -+ else -+ { -+ const grub_uint32_t carries = (grub_uint32_t) uu.low >> bm; -+ -+ w.low = (grub_uint32_t) uu.low << b; -+ w.high = ((grub_uint32_t) uu.high << b) | carries; -+ } -+ -+ return w.full; -+} -+ -+#endif -diff --git a/grub-core/kern/powerpc/compiler-rt.S b/grub-core/kern/powerpc/compiler-rt.S -new file mode 100644 -index 0000000..63e3a0d ---- /dev/null -+++ b/grub-core/kern/powerpc/compiler-rt.S -@@ -0,0 +1,130 @@ -+/* -+ * Special support for eabi and SVR4 -+ * -+ * Copyright (C) 1995-2014 Free Software Foundation, Inc. -+ * Written By Michael Meissner -+ * 64-bit support written by David Edelsohn -+ * -+ * This file 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, or (at your option) any -+ * later version. -+ * -+ * This file 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. -+ * -+ * Under Section 7 of GPL version 3, you are granted additional -+ * permissions described in the GCC Runtime Library Exception, version -+ * 3.1, as published by the Free Software Foundation. -+ * -+ * You should have received a copy of the GNU General Public License and -+ * a copy of the GCC Runtime Library Exception along with this program; -+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+ * . -+ */ -+ -+/* Do any initializations needed for the eabi environment */ -+ -+#include -+#include -+ -+ .section ".text" -+ -+#define CFI_RESTORE(reg) .cfi_restore reg -+#define CFI_OFFSET(reg, off) .cfi_offset reg, off -+#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg -+#define CFI_STARTPROC .cfi_startproc -+#define CFI_ENDPROC .cfi_endproc -+ -+/* Routines for restoring integer registers, called by the compiler. */ -+/* Called with r11 pointing to the stack header word of the caller of the */ -+/* function, just beyond the end of the integer restore area. */ -+ -+CFI_STARTPROC -+CFI_DEF_CFA_REGISTER (11) -+CFI_OFFSET (65, 4) -+CFI_OFFSET (14, -72) -+CFI_OFFSET (15, -68) -+CFI_OFFSET (16, -64) -+CFI_OFFSET (17, -60) -+CFI_OFFSET (18, -56) -+CFI_OFFSET (19, -52) -+CFI_OFFSET (20, -48) -+CFI_OFFSET (21, -44) -+CFI_OFFSET (22, -40) -+CFI_OFFSET (23, -36) -+CFI_OFFSET (24, -32) -+CFI_OFFSET (25, -28) -+CFI_OFFSET (26, -24) -+CFI_OFFSET (27, -20) -+CFI_OFFSET (28, -16) -+CFI_OFFSET (29, -12) -+CFI_OFFSET (30, -8) -+CFI_OFFSET (31, -4) -+FUNCTION(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */ -+CFI_RESTORE (14) -+FUNCTION(_restgpr_15_x) lwz 15,-68(11) -+CFI_RESTORE (15) -+FUNCTION(_restgpr_16_x) lwz 16,-64(11) -+CFI_RESTORE (16) -+FUNCTION(_restgpr_17_x) lwz 17,-60(11) -+CFI_RESTORE (17) -+FUNCTION(_restgpr_18_x) lwz 18,-56(11) -+CFI_RESTORE (18) -+FUNCTION(_restgpr_19_x) lwz 19,-52(11) -+CFI_RESTORE (19) -+FUNCTION(_restgpr_20_x) lwz 20,-48(11) -+CFI_RESTORE (20) -+FUNCTION(_restgpr_21_x) lwz 21,-44(11) -+CFI_RESTORE (21) -+FUNCTION(_restgpr_22_x) lwz 22,-40(11) -+CFI_RESTORE (22) -+FUNCTION(_restgpr_23_x) lwz 23,-36(11) -+CFI_RESTORE (23) -+FUNCTION(_restgpr_24_x) lwz 24,-32(11) -+CFI_RESTORE (24) -+FUNCTION(_restgpr_25_x) lwz 25,-28(11) -+CFI_RESTORE (25) -+FUNCTION(_restgpr_26_x) lwz 26,-24(11) -+CFI_RESTORE (26) -+FUNCTION(_restgpr_27_x) lwz 27,-20(11) -+CFI_RESTORE (27) -+FUNCTION(_restgpr_28_x) lwz 28,-16(11) -+CFI_RESTORE (28) -+FUNCTION(_restgpr_29_x) lwz 29,-12(11) -+CFI_RESTORE (29) -+FUNCTION(_restgpr_30_x) lwz 30,-8(11) -+CFI_RESTORE (30) -+FUNCTION(_restgpr_31_x) lwz 0,4(11) -+ lwz 31,-4(11) -+CFI_RESTORE (31) -+ mtlr 0 -+CFI_RESTORE (65) -+ mr 1,11 -+CFI_DEF_CFA_REGISTER (1) -+ blr -+CFI_ENDPROC -+ -+CFI_STARTPROC -+FUNCTION(_savegpr_14) stw 14,-72(11) /* save gp registers */ -+FUNCTION(_savegpr_15) stw 15,-68(11) -+FUNCTION(_savegpr_16) stw 16,-64(11) -+FUNCTION(_savegpr_17) stw 17,-60(11) -+FUNCTION(_savegpr_18) stw 18,-56(11) -+FUNCTION(_savegpr_19) stw 19,-52(11) -+FUNCTION(_savegpr_20) stw 20,-48(11) -+FUNCTION(_savegpr_21) stw 21,-44(11) -+FUNCTION(_savegpr_22) stw 22,-40(11) -+FUNCTION(_savegpr_23) stw 23,-36(11) -+FUNCTION(_savegpr_24) stw 24,-32(11) -+FUNCTION(_savegpr_25) stw 25,-28(11) -+FUNCTION(_savegpr_26) stw 26,-24(11) -+FUNCTION(_savegpr_27) stw 27,-20(11) -+FUNCTION(_savegpr_28) stw 28,-16(11) -+FUNCTION(_savegpr_29) stw 29,-12(11) -+FUNCTION(_savegpr_30) stw 30,-8(11) -+FUNCTION(_savegpr_31) stw 31,-4(11) -+ blr -+CFI_ENDPROC -diff --git a/include/grub/compiler.h b/include/grub/compiler.h -index c9e1d7a..a9a684c 100644 ---- a/include/grub/compiler.h -+++ b/include/grub/compiler.h -@@ -48,4 +48,65 @@ - # define WARN_UNUSED_RESULT - #endif - -+#include "types.h" -+ -+union component64 -+{ -+ grub_uint64_t full; -+ struct -+ { -+#ifdef GRUB_CPU_WORDS_BIGENDIAN -+ grub_uint32_t high; -+ grub_uint32_t low; -+#else -+ grub_uint32_t low; -+ grub_uint32_t high; -+#endif -+ }; -+}; -+ -+#if defined (__powerpc__) -+grub_uint64_t EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); -+grub_uint64_t EXPORT_FUNC (__ashrdi3) (grub_uint64_t u, int b); -+grub_uint64_t EXPORT_FUNC (__ashldi3) (grub_uint64_t u, int b); -+int EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); -+void EXPORT_FUNC (_restgpr_14_x) (void); -+void EXPORT_FUNC (_restgpr_15_x) (void); -+void EXPORT_FUNC (_restgpr_16_x) (void); -+void EXPORT_FUNC (_restgpr_17_x) (void); -+void EXPORT_FUNC (_restgpr_18_x) (void); -+void EXPORT_FUNC (_restgpr_19_x) (void); -+void EXPORT_FUNC (_restgpr_20_x) (void); -+void EXPORT_FUNC (_restgpr_21_x) (void); -+void EXPORT_FUNC (_restgpr_22_x) (void); -+void EXPORT_FUNC (_restgpr_23_x) (void); -+void EXPORT_FUNC (_restgpr_24_x) (void); -+void EXPORT_FUNC (_restgpr_25_x) (void); -+void EXPORT_FUNC (_restgpr_26_x) (void); -+void EXPORT_FUNC (_restgpr_27_x) (void); -+void EXPORT_FUNC (_restgpr_28_x) (void); -+void EXPORT_FUNC (_restgpr_29_x) (void); -+void EXPORT_FUNC (_restgpr_30_x) (void); -+void EXPORT_FUNC (_restgpr_31_x) (void); -+void EXPORT_FUNC (_savegpr_14) (void); -+void EXPORT_FUNC (_savegpr_15) (void); -+void EXPORT_FUNC (_savegpr_16) (void); -+void EXPORT_FUNC (_savegpr_17) (void); -+void EXPORT_FUNC (_savegpr_18) (void); -+void EXPORT_FUNC (_savegpr_19) (void); -+void EXPORT_FUNC (_savegpr_20) (void); -+void EXPORT_FUNC (_savegpr_21) (void); -+void EXPORT_FUNC (_savegpr_22) (void); -+void EXPORT_FUNC (_savegpr_23) (void); -+void EXPORT_FUNC (_savegpr_24) (void); -+void EXPORT_FUNC (_savegpr_25) (void); -+void EXPORT_FUNC (_savegpr_26) (void); -+void EXPORT_FUNC (_savegpr_27) (void); -+void EXPORT_FUNC (_savegpr_28) (void); -+void EXPORT_FUNC (_savegpr_29) (void); -+void EXPORT_FUNC (_savegpr_30) (void); -+void EXPORT_FUNC (_savegpr_31) (void); -+ -+#endif -+ - #endif /* ! GRUB_COMPILER_HEADER */ -diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h -index 8e93b67..5bdb8fb 100644 ---- a/include/grub/libgcc.h -+++ b/include/grub/libgcc.h -@@ -16,73 +16,6 @@ - * along with GRUB. If not, see . - */ - --/* We need to include config-util.h.in for HAVE_*. */ --#ifndef __STDC_VERSION__ --#define __STDC_VERSION__ 0 --#endif --#include -- --/* On x86 these functions aren't really needed. Save some space. */ --#if !defined (__i386__) && !defined (__x86_64__) --# ifdef HAVE___ASHLDI3 --void EXPORT_FUNC (__ashldi3) (void); --# endif --# ifdef HAVE___ASHRDI3 --void EXPORT_FUNC (__ashrdi3) (void); --# endif --# ifdef HAVE___LSHRDI3 --void EXPORT_FUNC (__lshrdi3) (void); --# endif --# ifdef HAVE___UCMPDI2 --void EXPORT_FUNC (__ucmpdi2) (void); --# endif --# ifdef HAVE___BSWAPSI2 --void EXPORT_FUNC (__bswapsi2) (void); --# endif --# ifdef HAVE___BSWAPDI2 --void EXPORT_FUNC (__bswapdi2) (void); --# endif --#endif -- --#ifdef HAVE__RESTGPR_14_X --void EXPORT_FUNC (_restgpr_14_x) (void); --void EXPORT_FUNC (_restgpr_15_x) (void); --void EXPORT_FUNC (_restgpr_16_x) (void); --void EXPORT_FUNC (_restgpr_17_x) (void); --void EXPORT_FUNC (_restgpr_18_x) (void); --void EXPORT_FUNC (_restgpr_19_x) (void); --void EXPORT_FUNC (_restgpr_20_x) (void); --void EXPORT_FUNC (_restgpr_21_x) (void); --void EXPORT_FUNC (_restgpr_22_x) (void); --void EXPORT_FUNC (_restgpr_23_x) (void); --void EXPORT_FUNC (_restgpr_24_x) (void); --void EXPORT_FUNC (_restgpr_25_x) (void); --void EXPORT_FUNC (_restgpr_26_x) (void); --void EXPORT_FUNC (_restgpr_27_x) (void); --void EXPORT_FUNC (_restgpr_28_x) (void); --void EXPORT_FUNC (_restgpr_29_x) (void); --void EXPORT_FUNC (_restgpr_30_x) (void); --void EXPORT_FUNC (_restgpr_31_x) (void); --void EXPORT_FUNC (_savegpr_14) (void); --void EXPORT_FUNC (_savegpr_15) (void); --void EXPORT_FUNC (_savegpr_16) (void); --void EXPORT_FUNC (_savegpr_17) (void); --void EXPORT_FUNC (_savegpr_18) (void); --void EXPORT_FUNC (_savegpr_19) (void); --void EXPORT_FUNC (_savegpr_20) (void); --void EXPORT_FUNC (_savegpr_21) (void); --void EXPORT_FUNC (_savegpr_22) (void); --void EXPORT_FUNC (_savegpr_23) (void); --void EXPORT_FUNC (_savegpr_24) (void); --void EXPORT_FUNC (_savegpr_25) (void); --void EXPORT_FUNC (_savegpr_26) (void); --void EXPORT_FUNC (_savegpr_27) (void); --void EXPORT_FUNC (_savegpr_28) (void); --void EXPORT_FUNC (_savegpr_29) (void); --void EXPORT_FUNC (_savegpr_30) (void); --void EXPORT_FUNC (_savegpr_31) (void); --#endif -- - #if defined (__arm__) - void EXPORT_FUNC (__aeabi_lasr) (void); - void EXPORT_FUNC (__aeabi_llsl) (void); --- -1.9.3 - diff --git a/0142-grub-core-disk-AFSplitter.c-AF_merge-Check-that-mdle.patch b/0142-grub-core-disk-AFSplitter.c-AF_merge-Check-that-mdle.patch new file mode 100644 index 0000000..4e4a0e6 --- /dev/null +++ b/0142-grub-core-disk-AFSplitter.c-AF_merge-Check-that-mdle.patch @@ -0,0 +1,41 @@ +From 1dfe3f973e83b33badeee1c1f7d2644401294d8c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:12:30 +0100 +Subject: [PATCH 142/506] * grub-core/disk/AFSplitter.c (AF_merge): Check that + mdlen is not 0. + +--- + ChangeLog | 4 ++++ + grub-core/disk/AFSplitter.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 3ae00de..0c85b35 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/AFSplitter.c (AF_merge): Check that mdlen is not 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/commands/i386/pc/play.c (grub_cmd_play): Avoid + division by zero. + +diff --git a/grub-core/disk/AFSplitter.c b/grub-core/disk/AFSplitter.c +index d76a1c4..7e1bd57 100644 +--- a/grub-core/disk/AFSplitter.c ++++ b/grub-core/disk/AFSplitter.c +@@ -76,7 +76,7 @@ AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, grub_uint8_t * dst, + if (bufblock == NULL) + return GPG_ERR_OUT_OF_MEMORY; + +- if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) ++ if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN || hash->mdlen == 0) + return GPG_ERR_INV_ARG; + + grub_memset (bufblock, 0, blocksize); +-- +2.4.3 + diff --git a/0143-grub_ata_setaddress-Check-that-geometry-is-sane-when.patch b/0143-grub_ata_setaddress-Check-that-geometry-is-sane-when.patch new file mode 100644 index 0000000..b4fb0de --- /dev/null +++ b/0143-grub_ata_setaddress-Check-that-geometry-is-sane-when.patch @@ -0,0 +1,46 @@ +From f27ccb584ccaf70bfb26b3c893b63124d8563db4 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:16:22 +0100 +Subject: [PATCH 143/506] grub_ata_setaddress: Check that geometry is sane when + using CHS addressing. + +--- + ChangeLog | 5 +++++ + grub-core/disk/ata.c | 6 ++++++ + 2 files changed, 11 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 0c85b35..575bd18 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/ata.c (grub_ata_setaddress): Check that geometry ++ is sane when using CHS addressing. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/AFSplitter.c (AF_merge): Check that mdlen is not 0. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/disk/ata.c b/grub-core/disk/ata.c +index 2b98849..8ba4e5c 100644 +--- a/grub-core/disk/ata.c ++++ b/grub-core/disk/ata.c +@@ -216,6 +216,12 @@ grub_ata_setaddress (struct grub_ata *dev, + unsigned int head; + unsigned int sect; + ++ if (dev->sectors_per_track == 0 ++ || dev->heads == 0) ++ return grub_error (GRUB_ERR_OUT_OF_RANGE, ++ "sector %d cannot be addressed " ++ "using CHS addressing", sector); ++ + /* Calculate the sector, cylinder and head to use. */ + sect = ((grub_uint32_t) sector % dev->sectors_per_track) + 1; + cylinder = (((grub_uint32_t) sector / dev->sectors_per_track) +-- +2.4.3 + diff --git a/0144-Reject-NILFS2-superblocks-with-over-1GiB-blocks.patch b/0144-Reject-NILFS2-superblocks-with-over-1GiB-blocks.patch new file mode 100644 index 0000000..8c159e9 --- /dev/null +++ b/0144-Reject-NILFS2-superblocks-with-over-1GiB-blocks.patch @@ -0,0 +1,47 @@ +From 9201cd79a33a5f802cdf78437eca91082f382d55 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:27:27 +0100 +Subject: [PATCH 144/506] Reject NILFS2 superblocks with over 1GiB blocks. + + * grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that + block size is <= 1GiB. +--- + ChangeLog | 7 +++++++ + grub-core/fs/nilfs2.c | 4 ++++ + 2 files changed, 11 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 575bd18..454aef8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,12 @@ + 2015-01-20 Vladimir Serbinenko + ++ Reject NILFS2 superblocks with over 1GiB blocks. ++ ++ * grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that ++ block size is <= 1GiB. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/ata.c (grub_ata_setaddress): Check that geometry + is sane when using CHS addressing. + +diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c +index 388ee18..598a2a5 100644 +--- a/grub-core/fs/nilfs2.c ++++ b/grub-core/fs/nilfs2.c +@@ -724,6 +724,10 @@ grub_nilfs2_valid_sb (struct grub_nilfs2_super_block *sbp) + if (grub_le_to_cpu32 (sbp->s_rev_level) != NILFS_SUPORT_REV) + return 0; + ++ /* 20 already means 1GiB blocks. We don't want to deal with blocks overflowing int32. */ ++ if (grub_le_to_cpu32 (sbp->s_log_block_size) > 20) ++ return 0; ++ + return 1; + } + +-- +2.4.3 + diff --git a/0145-grub_ufs_mount-Check-that-sblock.ino_per_group-is-no.patch b/0145-grub_ufs_mount-Check-that-sblock.ino_per_group-is-no.patch new file mode 100644 index 0000000..9a1ed36 --- /dev/null +++ b/0145-grub_ufs_mount-Check-that-sblock.ino_per_group-is-no.patch @@ -0,0 +1,43 @@ +From 245e21b2b56e787ec5953efef6ac6ffe251e136b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:30:05 +0100 +Subject: [PATCH 145/506] grub_ufs_mount: Check that sblock.ino_per_group is + not 0. + +--- + ChangeLog | 5 +++++ + grub-core/fs/ufs.c | 3 ++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 454aef8..d7d5c40 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/ufs.c (grub_ufs_mount): Check ++ that sblock.ino_per_group is not 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + Reject NILFS2 superblocks with over 1GiB blocks. + + * grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that +diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c +index 4a2161c..f560ad3 100644 +--- a/grub-core/fs/ufs.c ++++ b/grub-core/fs/ufs.c +@@ -604,7 +604,8 @@ grub_ufs_mount (grub_disk_t disk) + endiannesses. */ + if (data->sblock.magic == grub_cpu_to_ufs32_compile_time (GRUB_UFS_MAGIC) + && data->sblock.bsize != 0 +- && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0)) ++ && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0) ++ && data->sblock.ino_per_group != 0) + { + for (data->log2_blksz = 0; + (1U << data->log2_blksz) < grub_ufs_to_cpu32 (data->sblock.bsize); +-- +2.4.3 + diff --git a/0146-grub-core-fs-ext2.c-grub_ext2_mount-Additional-check.patch b/0146-grub-core-fs-ext2.c-grub_ext2_mount-Additional-check.patch new file mode 100644 index 0000000..8b804eb --- /dev/null +++ b/0146-grub-core-fs-ext2.c-grub_ext2_mount-Additional-check.patch @@ -0,0 +1,47 @@ +From 47cd2645ddc885e7821b4a86a5ccf549dd4d5fcc Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:40:27 +0100 +Subject: [PATCH 146/506] * grub-core/fs/ext2.c (grub_ext2_mount): Additional + checks for superblock validity. + +--- + ChangeLog | 5 +++++ + grub-core/fs/ext2.c | 7 ++++++- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index d7d5c40..f69541e 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/ext2.c (grub_ext2_mount): Additional ++ checks for superblock validity. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/ufs.c (grub_ufs_mount): Check + that sblock.ino_per_group is not 0. + +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index 217771d..44c7974 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -577,7 +577,12 @@ grub_ext2_mount (grub_disk_t disk) + + /* Make sure this is an ext2 filesystem. */ + if (data->sblock.magic != grub_cpu_to_le16_compile_time (EXT2_MAGIC) +- || grub_le_to_cpu32 (data->sblock.log2_block_size) >= 16) ++ || grub_le_to_cpu32 (data->sblock.log2_block_size) >= 16 ++ || data->sblock.inodes_per_group == 0 ++ /* 20 already means 1GiB blocks. We don't want to deal with blocks overflowing int32. */ ++ || grub_le_to_cpu32 (data->sblock.log2_block_size) > 20 ++ || EXT2_INODE_SIZE (data) == 0 ++ || EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data) == 0) + { + grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); + goto fail; +-- +2.4.3 + diff --git a/0147-grub-core-fs-minix.c-Additional-filesystem-sanity-ch.patch b/0147-grub-core-fs-minix.c-Additional-filesystem-sanity-ch.patch new file mode 100644 index 0000000..78bebce --- /dev/null +++ b/0147-grub-core-fs-minix.c-Additional-filesystem-sanity-ch.patch @@ -0,0 +1,125 @@ +From 5ed3a5d0491f7e00d76bed0cdf4fa3cb8868ade4 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:53:09 +0100 +Subject: [PATCH 147/506] * grub-core/fs/minix.c: Additional filesystem + sanity checks. + +--- + ChangeLog | 5 +++++ + grub-core/fs/minix.c | 34 ++++++++++++++++++---------------- + 2 files changed, 23 insertions(+), 16 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index f69541e..a5d925a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/minix.c: Additional filesystem ++ sanity checks. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/ext2.c (grub_ext2_mount): Additional + checks for superblock validity. + +diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c +index 6f629a1..90ddd34 100644 +--- a/grub-core/fs/minix.c ++++ b/grub-core/fs/minix.c +@@ -65,7 +65,6 @@ typedef grub_uint16_t grub_minix_uintn_t; + #define grub_minix_to_cpu_n grub_minix_to_cpu16 + #endif + +-#define GRUB_MINIX_INODE_BLKSZ(data) sizeof (grub_minix_uintn_t) + #ifdef MODE_MINIX3 + typedef grub_uint32_t grub_minix_ino_t; + #define grub_minix_to_cpu_ino grub_minix_to_cpu32 +@@ -87,8 +86,6 @@ typedef grub_uint16_t grub_minix_ino_t; + #define GRUB_MINIX_LOG2_ZONESZ (GRUB_MINIX_LOG2_BSIZE \ + + grub_minix_to_cpu16 (data->sblock.log2_zone_size)) + #endif +-#define GRUB_MINIX_ZONESZ ((grub_uint64_t) data->block_size << \ +- (GRUB_DISK_SECTOR_BITS + grub_minix_to_cpu16 (data->sblock.log2_zone_size))) + + #ifdef MODE_MINIX3 + #define GRUB_MINIX_ZONE2SECT(zone) ((zone) * data->block_size) +@@ -172,6 +169,7 @@ struct grub_minix_data + { + struct grub_minix_sblock sblock; + struct grub_minix_inode inode; ++ grub_uint32_t block_per_zone; + grub_minix_ino_t ino; + int linknest; + grub_disk_t disk; +@@ -202,8 +200,6 @@ static grub_minix_uintn_t + grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) + { + grub_minix_uintn_t indir; +- const grub_uint32_t block_per_zone = (GRUB_MINIX_ZONESZ +- / GRUB_MINIX_INODE_BLKSZ (data)); + + /* Direct block. */ + if (blk < GRUB_MINIX_INODE_DIR_BLOCKS) +@@ -211,33 +207,33 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) + + /* Indirect block. */ + blk -= GRUB_MINIX_INODE_DIR_BLOCKS; +- if (blk < block_per_zone) ++ if (blk < data->block_per_zone) + { + indir = grub_get_indir (data, GRUB_MINIX_INODE_INDIR_ZONE (data), blk); + return indir; + } + + /* Double indirect block. */ +- blk -= block_per_zone; +- if (blk < block_per_zone * block_per_zone) ++ blk -= data->block_per_zone; ++ if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone) + { + indir = grub_get_indir (data, GRUB_MINIX_INODE_DINDIR_ZONE (data), +- blk / block_per_zone); ++ blk / data->block_per_zone); + +- indir = grub_get_indir (data, indir, blk % block_per_zone); ++ indir = grub_get_indir (data, indir, blk % data->block_per_zone); + + return indir; + } + + #if defined (MODE_MINIX3) || defined (MODE_MINIX2) +- blk -= block_per_zone * block_per_zone; +- if (blk < ((grub_uint64_t) block_per_zone * (grub_uint64_t) block_per_zone +- * (grub_uint64_t) block_per_zone)) ++ blk -= data->block_per_zone * data->block_per_zone; ++ if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone ++ * (grub_uint64_t) data->block_per_zone)) + { + indir = grub_get_indir (data, grub_minix_to_cpu_n (data->inode.triple_indir_zone), +- (blk / block_per_zone) / block_per_zone); +- indir = grub_get_indir (data, indir, (blk / block_per_zone) % block_per_zone); +- indir = grub_get_indir (data, indir, blk % block_per_zone); ++ (blk / data->block_per_zone) / data->block_per_zone); ++ indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone); ++ indir = grub_get_indir (data, indir, blk % data->block_per_zone); + + return indir; + } +@@ -515,6 +511,12 @@ grub_minix_mount (grub_disk_t disk) + data->block_size = 2; + #endif + ++ data->block_per_zone = (((grub_uint64_t) data->block_size << \ ++ (GRUB_DISK_SECTOR_BITS + grub_minix_to_cpu16 (data->sblock.log2_zone_size))) ++ / sizeof (grub_minix_uintn_t)); ++ if (!data->block_per_zone) ++ goto fail; ++ + return data; + + fail: +-- +2.4.3 + diff --git a/0148-grub-core-fs-hfs.c-grub_hfs_mount-Additional-filesys.patch b/0148-grub-core-fs-hfs.c-grub_hfs_mount-Additional-filesys.patch new file mode 100644 index 0000000..95c3ca4 --- /dev/null +++ b/0148-grub-core-fs-hfs.c-grub_hfs_mount-Additional-filesys.patch @@ -0,0 +1,53 @@ +From 98f74998d5749c7e5b8293aaeaaaea5692240073 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 14:59:40 +0100 +Subject: [PATCH 148/506] * grub-core/fs/hfs.c (grub_hfs_mount): Additional + filesystem sanity checks. + +--- + ChangeLog | 5 +++++ + grub-core/fs/hfs.c | 6 ++++++ + 2 files changed, 11 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index a5d925a..473eb14 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem ++ sanity checks. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/minix.c: Additional filesystem + sanity checks. + +diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c +index d1dc015..f46f77a 100644 +--- a/grub-core/fs/hfs.c ++++ b/grub-core/fs/hfs.c +@@ -330,6 +330,7 @@ grub_hfs_mount (grub_disk_t disk) + + /* Check if this is a HFS filesystem. */ + if (grub_be_to_cpu16 (data->sblock.magic) != GRUB_HFS_MAGIC ++ || data->sblock.blksz == 0 + || (data->sblock.blksz & grub_cpu_to_be32_compile_time (0xc00001ff))) + { + grub_error (GRUB_ERR_BAD_FS, "not an HFS filesystem"); +@@ -367,6 +368,11 @@ grub_hfs_mount (grub_disk_t disk) + data->cat_root = grub_be_to_cpu32 (treehead.head.root_node); + data->cat_size = grub_be_to_cpu16 (treehead.head.node_size); + ++ if (data->cat_size == 0 ++ || data->blksz < data->cat_size ++ || data->blksz < data->ext_size) ++ goto fail; ++ + /* Lookup the root directory node in the catalog tree using the + volume name. */ + key.parent_dir = grub_cpu_to_be32_compile_time (1); +-- +2.4.3 + diff --git a/0149-grub_dmraid_nv_detect-Do-not-divide-by-zero.patch b/0149-grub_dmraid_nv_detect-Do-not-divide-by-zero.patch new file mode 100644 index 0000000..ab0ea17 --- /dev/null +++ b/0149-grub_dmraid_nv_detect-Do-not-divide-by-zero.patch @@ -0,0 +1,52 @@ +From 935863518f3a9ec12161616a31ac40e5b78bd550 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 15:01:58 +0100 +Subject: [PATCH 149/506] grub_dmraid_nv_detect: Do not divide by zero. + +--- + ChangeLog | 5 +++++ + grub-core/disk/dmraid_nvidia.c | 6 ++++++ + 2 files changed, 11 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 473eb14..8661726 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Do not ++ divide by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem + sanity checks. + +diff --git a/grub-core/disk/dmraid_nvidia.c b/grub-core/disk/dmraid_nvidia.c +index 6e64055..fc02f57 100644 +--- a/grub-core/disk/dmraid_nvidia.c ++++ b/grub-core/disk/dmraid_nvidia.c +@@ -129,6 +129,9 @@ grub_dmraid_nv_detect (grub_disk_t disk, + case NV_LEVEL_0: + level = 0; + disk_size = sb.capacity / sb.array.total_volumes; ++ if (sb.array.total_volumes == 0) ++ /* Not RAID. */ ++ return NULL; + break; + + case NV_LEVEL_1: +@@ -139,6 +142,9 @@ grub_dmraid_nv_detect (grub_disk_t disk, + case NV_LEVEL_5: + level = 5; + disk_size = sb.capacity / (sb.array.total_volumes - 1); ++ if (sb.array.total_volumes == 0 || sb.array.total_volumes == 1) ++ /* Not RAID. */ ++ return NULL; + break; + + default: +-- +2.4.3 + diff --git a/0150-grub-core-disk-ieee1275-nand.c-grub_nand_open-Check-.patch b/0150-grub-core-disk-ieee1275-nand.c-grub_nand_open-Check-.patch new file mode 100644 index 0000000..d369981 --- /dev/null +++ b/0150-grub-core-disk-ieee1275-nand.c-grub_nand_open-Check-.patch @@ -0,0 +1,45 @@ +From f1959b16957bbb49bfaa16471d04bd9efc77387f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 15:09:42 +0100 +Subject: [PATCH 150/506] * grub-core/disk/ieee1275/nand.c + (grub_nand_open): Check block size validity. + +--- + ChangeLog | 5 +++++ + grub-core/disk/ieee1275/nand.c | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 8661726..bdd5697 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/ieee1275/nand.c (grub_nand_open): Check block size ++ validity. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Do not + divide by zero. + +diff --git a/grub-core/disk/ieee1275/nand.c b/grub-core/disk/ieee1275/nand.c +index 576e9cc..feffa8c 100644 +--- a/grub-core/disk/ieee1275/nand.c ++++ b/grub-core/disk/ieee1275/nand.c +@@ -113,6 +113,11 @@ grub_nand_open (const char *name, grub_disk_t disk) + } + + data->block_size = (args.size1 >> GRUB_DISK_SECTOR_BITS); ++ if (!data->block_size) ++ { ++ grub_error (GRUB_ERR_UNKNOWN_DEVICE, "invalid block size"); ++ goto fail; ++ } + + INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); + args.method = (grub_ieee1275_cell_t) "size"; +-- +2.4.3 + diff --git a/0151-grub-core-disk-i386-pc-biosdisk.c-Check-disk-size-sa.patch b/0151-grub-core-disk-i386-pc-biosdisk.c-Check-disk-size-sa.patch new file mode 100644 index 0000000..b5ad1d7 --- /dev/null +++ b/0151-grub-core-disk-i386-pc-biosdisk.c-Check-disk-size-sa.patch @@ -0,0 +1,44 @@ +From 4200ad44fe782193a397bd0f0ab72283a6d25e89 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 15:10:34 +0100 +Subject: [PATCH 151/506] * grub-core/disk/i386/pc/biosdisk.c: Check + disk size sanity. + +--- + ChangeLog | 4 ++++ + grub-core/disk/i386/pc/biosdisk.c | 5 +++++ + 2 files changed, 9 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index bdd5697..e8c1d68 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/i386/pc/biosdisk.c: Check disk size sanity. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/ieee1275/nand.c (grub_nand_open): Check block size + validity. + +diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c +index 6b21525..26a4973 100644 +--- a/grub-core/disk/i386/pc/biosdisk.c ++++ b/grub-core/disk/i386/pc/biosdisk.c +@@ -419,6 +419,11 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) + } + } + ++ if (data->sectors == 0) ++ data->sectors = 63; ++ if (data->heads == 0) ++ data->heads = 255; ++ + if (! total_sectors) + total_sectors = data->cylinders * data->heads * data->sectors; + } +-- +2.4.3 + diff --git a/0152-osdep-linux-blocklist.c-grub_install_get_blocklist-C.patch b/0152-osdep-linux-blocklist.c-grub_install_get_blocklist-C.patch new file mode 100644 index 0000000..cadf71e --- /dev/null +++ b/0152-osdep-linux-blocklist.c-grub_install_get_blocklist-C.patch @@ -0,0 +1,42 @@ +From 111ab3b9cc4ffbf0901d0303872d80a7e1c08a20 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 15:19:35 +0100 +Subject: [PATCH 152/506] osdep/linux/blocklist.c (grub_install_get_blocklist): + Check blocksize validity. + +--- + ChangeLog | 5 +++++ + grub-core/osdep/linux/blocklist.c | 2 ++ + 2 files changed, 7 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index e8c1d68..87c4658 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/osdep/linux/blocklist.c (grub_install_get_blocklist): Check ++ blocksize validity. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/i386/pc/biosdisk.c: Check disk size sanity. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/osdep/linux/blocklist.c b/grub-core/osdep/linux/blocklist.c +index f33a7d5..10ddd11 100644 +--- a/grub-core/osdep/linux/blocklist.c ++++ b/grub-core/osdep/linux/blocklist.c +@@ -82,6 +82,8 @@ grub_install_get_blocklist (grub_device_t root_dev, + strerror (errno)); + if (bsize & (GRUB_DISK_SECTOR_SIZE - 1)) + grub_util_error ("%s", _("blocksize is not divisible by 512")); ++ if (!bsize) ++ grub_util_error ("%s", _("invalid zero blocksize")); + mul = bsize >> GRUB_DISK_SECTOR_BITS; + nblocks = (core_size + bsize - 1) / bsize; + if (mul == 0 || nblocks == 0) +-- +2.4.3 + diff --git a/0153-grub-core-lib-pbkdf2.c-grub_crypto_pbkdf2-Check-that.patch b/0153-grub-core-lib-pbkdf2.c-grub_crypto_pbkdf2-Check-that.patch new file mode 100644 index 0000000..b6dbe94 --- /dev/null +++ b/0153-grub-core-lib-pbkdf2.c-grub_crypto_pbkdf2-Check-that.patch @@ -0,0 +1,41 @@ +From 065ed900d4865fc31062f01290560ad1bc189522 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 15:26:09 +0100 +Subject: [PATCH 153/506] grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Check + that hash len is not 0. + +--- + ChangeLog | 4 ++++ + grub-core/lib/pbkdf2.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 87c4658..a708ca2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Check that hash len is not 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/osdep/linux/blocklist.c (grub_install_get_blocklist): Check + blocksize validity. + +diff --git a/grub-core/lib/pbkdf2.c b/grub-core/lib/pbkdf2.c +index 2fbaa95..01cee39 100644 +--- a/grub-core/lib/pbkdf2.c ++++ b/grub-core/lib/pbkdf2.c +@@ -52,7 +52,7 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md, + grub_uint8_t *tmp; + grub_size_t tmplen = Slen + 4; + +- if (md->mdlen > GRUB_CRYPTO_MAX_MDLEN) ++ if (md->mdlen > GRUB_CRYPTO_MAX_MDLEN || md->mdlen == 0) + return GPG_ERR_INV_ARG; + + if (c == 0) +-- +2.4.3 + diff --git a/0154-grub-core-fs-btrfs.c-Avoid-divisions-by-zero.patch b/0154-grub-core-fs-btrfs.c-Avoid-divisions-by-zero.patch new file mode 100644 index 0000000..407d752 --- /dev/null +++ b/0154-grub-core-fs-btrfs.c-Avoid-divisions-by-zero.patch @@ -0,0 +1,119 @@ +From 9deb46e363a341d8c243e4c85754e673b4b68571 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 17:36:29 +0100 +Subject: [PATCH 154/506] * grub-core/fs/btrfs.c: Avoid divisions by + zero. + +--- + ChangeLog | 4 ++++ + grub-core/fs/btrfs.c | 35 +++++++++++++++++++++-------------- + 2 files changed, 25 insertions(+), 14 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index a708ca2..8e38fdd 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/btrfs.c: Avoid divisions by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Check that hash len is not 0. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 95a8fa6..9cffa91 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -680,6 +680,8 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, + grub_uint64_t stripen; + grub_uint64_t stripe_offset; + grub_uint64_t off = addr - grub_le_to_cpu64 (key->offset); ++ grub_uint64_t chunk_stripe_length; ++ grub_uint16_t nstripes; + unsigned redundancy = 1; + unsigned i, j; + +@@ -690,15 +692,17 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, + "couldn't find the chunk descriptor"); + } + ++ nstripes = grub_le_to_cpu16 (chunk->nstripes) ? : 1; ++ chunk_stripe_length = grub_le_to_cpu64 (chunk->stripe_length) ? : 512; + grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T + "+0x%" PRIxGRUB_UINT64_T + " (%d stripes (%d substripes) of %" + PRIxGRUB_UINT64_T ")\n", + grub_le_to_cpu64 (key->offset), + grub_le_to_cpu64 (chunk->size), +- grub_le_to_cpu16 (chunk->nstripes), ++ nstripes, + grub_le_to_cpu16 (chunk->nsubstripes), +- grub_le_to_cpu64 (chunk->stripe_length)); ++ chunk_stripe_length); + + switch (grub_le_to_cpu64 (chunk->type) + & ~GRUB_BTRFS_CHUNK_TYPE_BITS_DONTCARE) +@@ -708,8 +712,10 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, + grub_uint64_t stripe_length; + grub_dprintf ("btrfs", "single\n"); + stripe_length = grub_divmod64 (grub_le_to_cpu64 (chunk->size), +- grub_le_to_cpu16 (chunk->nstripes), ++ nstripes, + NULL); ++ if (stripe_length == 0) ++ stripe_length = 512; + stripen = grub_divmod64 (off, stripe_length, &stripe_offset); + csize = (stripen + 1) * stripe_length - off; + break; +@@ -730,33 +736,34 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, + grub_uint64_t low; + grub_dprintf ("btrfs", "RAID0\n"); + middle = grub_divmod64 (off, +- grub_le_to_cpu64 (chunk->stripe_length), ++ chunk_stripe_length, + &low); + +- high = grub_divmod64 (middle, grub_le_to_cpu16 (chunk->nstripes), ++ high = grub_divmod64 (middle, nstripes, + &stripen); + stripe_offset = +- low + grub_le_to_cpu64 (chunk->stripe_length) * high; +- csize = grub_le_to_cpu64 (chunk->stripe_length) - low; ++ low + chunk_stripe_length * high; ++ csize = chunk_stripe_length - low; + break; + } + case GRUB_BTRFS_CHUNK_TYPE_RAID10: + { + grub_uint64_t middle, high; + grub_uint64_t low; ++ grub_uint16_t nsubstripes; ++ nsubstripes = grub_le_to_cpu16 (chunk->nsubstripes) ? : 1; + middle = grub_divmod64 (off, +- grub_le_to_cpu64 (chunk->stripe_length), ++ chunk_stripe_length, + &low); + + high = grub_divmod64 (middle, +- grub_le_to_cpu16 (chunk->nstripes) +- / grub_le_to_cpu16 (chunk->nsubstripes), ++ nstripes / nsubstripes ? : 1, + &stripen); +- stripen *= grub_le_to_cpu16 (chunk->nsubstripes); +- redundancy = grub_le_to_cpu16 (chunk->nsubstripes); +- stripe_offset = low + grub_le_to_cpu64 (chunk->stripe_length) ++ stripen *= nsubstripes; ++ redundancy = nsubstripes; ++ stripe_offset = low + chunk_stripe_length + * high; +- csize = grub_le_to_cpu64 (chunk->stripe_length) - low; ++ csize = chunk_stripe_length - low; + break; + } + default: +-- +2.4.3 + diff --git a/0155-grub-core-fs-zfs.c-Avoid-divisions-by-zero.patch b/0155-grub-core-fs-zfs.c-Avoid-divisions-by-zero.patch new file mode 100644 index 0000000..393d0a1 --- /dev/null +++ b/0155-grub-core-fs-zfs.c-Avoid-divisions-by-zero.patch @@ -0,0 +1,64 @@ +From 475bffeae67fa0f6787c33147c120b40e89b1985 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 17:46:55 +0100 +Subject: [PATCH 155/506] * grub-core/fs/zfs.c: Avoid divisions by zero. + +--- + ChangeLog | 4 ++++ + grub-core/fs/zfs/zfs.c | 12 ++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 8e38fdd..c60a231 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/fs/zfs.c: Avoid divisions by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/btrfs.c: Avoid divisions by zero. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index cfb25c0..c943b52 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -1501,6 +1501,9 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "raidz%d is not supported", desc->nparity); + ++ if (desc->n_children <= desc->nparity || desc->n_children < 1) ++ return grub_error(GRUB_ERR_BAD_FS, "too little devices for given parity"); ++ + orig_s = (((len + (1 << desc->ashift) - 1) >> desc->ashift) + + (desc->n_children - desc->nparity) - 1); + s = orig_s; +@@ -2804,6 +2807,9 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, + dnode_path->dn.endian) + << SPA_MINBLOCKSHIFT); + ++ if (blksz == 0) ++ return grub_error(GRUB_ERR_BAD_FS, "0-sized block"); ++ + sym_value = grub_malloc (sym_sz); + if (!sym_value) + return grub_errno; +@@ -3798,6 +3804,12 @@ grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) + blksz = grub_zfs_to_cpu16 (data->dnode.dn.dn_datablkszsec, + data->dnode.endian) << SPA_MINBLOCKSHIFT; + ++ if (blksz == 0) ++ { ++ grub_error (GRUB_ERR_BAD_FS, "0-sized block"); ++ return -1; ++ } ++ + /* + * Entire Dnode is too big to fit into the space available. We + * will need to read it in chunks. This could be optimized to +-- +2.4.3 + diff --git a/0156-term.h-Avoid-returining-0-sized-terminal-as-it-may-l.patch b/0156-term.h-Avoid-returining-0-sized-terminal-as-it-may-l.patch new file mode 100644 index 0000000..f57efef --- /dev/null +++ b/0156-term.h-Avoid-returining-0-sized-terminal-as-it-may-l.patch @@ -0,0 +1,48 @@ +From 1b6aaddc456961d87d98e0f342c70b874b2fb232 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 17:55:41 +0100 +Subject: [PATCH 156/506] term.h: Avoid returining 0-sized terminal as it may + lead to division by zero. + +--- + ChangeLog | 5 +++++ + include/grub/term.h | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c60a231..141aa06 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * include/grub/term.h: Avoid returining 0-sized terminal ++ as it may lead to division by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/fs/zfs.c: Avoid divisions by zero. + + 2015-01-20 Vladimir Serbinenko +diff --git a/include/grub/term.h b/include/grub/term.h +index 98c68a5..5ffb38f 100644 +--- a/include/grub/term.h ++++ b/include/grub/term.h +@@ -334,12 +334,12 @@ void grub_term_restore_pos (struct grub_term_coordinate *pos); + + static inline unsigned grub_term_width (struct grub_term_output *term) + { +- return term->getwh(term).x; ++ return term->getwh(term).x ? : 80; + } + + static inline unsigned grub_term_height (struct grub_term_output *term) + { +- return term->getwh(term).y; ++ return term->getwh(term).y ? : 24; + } + + static inline struct grub_term_coordinate +-- +2.4.3 + diff --git a/0157-grub-core-disk-diskfilter.c-Validate-volumes-to-avoi.patch b/0157-grub-core-disk-diskfilter.c-Validate-volumes-to-avoi.patch new file mode 100644 index 0000000..3b8a47f --- /dev/null +++ b/0157-grub-core-disk-diskfilter.c-Validate-volumes-to-avoi.patch @@ -0,0 +1,184 @@ +From 750f4bacd3262376ced3f837d8dc78f834ca233a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 19:33:20 +0100 +Subject: [PATCH 157/506] * grub-core/disk/diskfilter.c: Validate volumes to + avoid division by zero. + +--- + ChangeLog | 5 ++ + grub-core/disk/diskfilter.c | 123 ++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 123 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 141aa06..fbdd560 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/disk/diskfilter.c: Validate volumes to avoid division ++ by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * include/grub/term.h: Avoid returining 0-sized terminal + as it may lead to division by zero. + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index e8a3bcb..97ca546 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -483,6 +483,96 @@ grub_diskfilter_read_node (const struct grub_diskfilter_node *node, + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); + } + ++ ++static grub_err_t ++validate_segment (struct grub_diskfilter_segment *seg); ++ ++static grub_err_t ++validate_lv (struct grub_diskfilter_lv *lv) ++{ ++ unsigned int i; ++ if (!lv) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume"); ++ ++ if (lv->vg->extent_size == 0) ++ return grub_error (GRUB_ERR_READ_ERROR, "invalid volume"); ++ ++ for (i = 0; i < lv->segment_count; i++) ++ { ++ grub_err_t err; ++ err = validate_segment (&lv->segments[1]); ++ if (err) ++ return err; ++ } ++ return GRUB_ERR_NONE; ++} ++ ++ ++static grub_err_t ++validate_node (const struct grub_diskfilter_node *node) ++{ ++ /* Check whether we actually know the physical volume we want to ++ read from. */ ++ if (node->pv) ++ return GRUB_ERR_NONE; ++ if (node->lv) ++ return validate_lv (node->lv); ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); ++} ++ ++static grub_err_t ++validate_segment (struct grub_diskfilter_segment *seg) ++{ ++ grub_err_t err; ++ ++ if (seg->stripe_size == 0 || seg->node_count == 0) ++ return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); ++ ++ switch (seg->type) ++ { ++ case GRUB_DISKFILTER_RAID10: ++ { ++ grub_uint8_t near, far; ++ near = seg->layout & 0xFF; ++ far = (seg->layout >> 8) & 0xFF; ++ if ((seg->layout >> 16) == 0 && far == 0) ++ return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); ++ if (near > seg->node_count) ++ return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); ++ break; ++ } ++ ++ case GRUB_DISKFILTER_STRIPED: ++ case GRUB_DISKFILTER_MIRROR: ++ break; ++ ++ case GRUB_DISKFILTER_RAID4: ++ case GRUB_DISKFILTER_RAID5: ++ if (seg->node_count <= 1) ++ return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); ++ break; ++ ++ case GRUB_DISKFILTER_RAID6: ++ if (seg->node_count <= 2) ++ return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); ++ break; ++ ++ default: ++ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, ++ "unsupported RAID level %d", seg->type); ++ } ++ ++ unsigned i; ++ for (i = 0; i < seg->node_count; i++) ++ { ++ err = validate_node (&seg->nodes[i]); ++ if (err) ++ return err; ++ } ++ return GRUB_ERR_NONE; ++ ++} ++ + static grub_err_t + read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, + grub_size_t size, char *buf) +@@ -848,6 +938,32 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) + + for (lv = vg->lvs; lv; lv = lv->next) + { ++ /* RAID 1 and single-disk RAID 0 don't use a chunksize but code assumes one so set ++ one. */ ++ for (i = 0; i < lv->segment_count; i++) ++ { ++ if (lv->segments[i].type == 1) ++ lv->segments[i].stripe_size = 64; ++ if (lv->segments[i].type == GRUB_DISKFILTER_STRIPED ++ && lv->segments[i].node_count == 1 ++ && lv->segments[i].stripe_size == 0) ++ lv->segments[i].stripe_size = 64; ++ } ++ } ++ ++ for (lv = vg->lvs; lv; lv = lv->next) ++ { ++ grub_err_t err; ++ ++ /* RAID 1 doesn't use a chunksize but code assumes one so set ++ one. */ ++ for (i = 0; i < lv->segment_count; i++) ++ if (lv->segments[i].type == 1) ++ lv->segments[i].stripe_size = 64; ++ ++ err = validate_lv(lv); ++ if (err) ++ return err; + lv->number = lv_num++; + + if (lv->fullname) +@@ -888,11 +1004,6 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) + lv->fullname = tmp; + } + } +- /* RAID 1 doesn't use a chunksize but code assumes one so set +- one. */ +- for (i = 0; i < lv->segment_count; i++) +- if (lv->segments[i].type == 1) +- lv->segments[i].stripe_size = 64; + lv->vg = vg; + } + /* Add our new array to the list. */ +@@ -926,6 +1037,8 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + n = layout & 0xFF; + if (n == 1) + n = (layout >> 8) & 0xFF; ++ if (n == 0) ++ return NULL; + + totsize = grub_divmod64 (nmemb * disk_size, n, 0); + } +-- +2.4.3 + diff --git a/0158-grub-core-video-readers-jpeg.c-Avoid-division-by-zer.patch b/0158-grub-core-video-readers-jpeg.c-Avoid-division-by-zer.patch new file mode 100644 index 0000000..21bc982 --- /dev/null +++ b/0158-grub-core-video-readers-jpeg.c-Avoid-division-by-zer.patch @@ -0,0 +1,41 @@ +From 4816dcac19a05a1209822015d88903faef3d6f44 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 19:35:49 +0100 +Subject: [PATCH 158/506] * grub-core/video/readers/jpeg.c: Avoid + division by zero. + +--- + ChangeLog | 4 ++++ + grub-core/video/readers/jpeg.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index fbdd560..7b34ba7 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/video/readers/jpeg.c: Avoid sivision by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/disk/diskfilter.c: Validate volumes to avoid division + by zero. + +diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c +index 2dc2ee1..38ea239 100644 +--- a/grub-core/video/readers/jpeg.c ++++ b/grub-core/video/readers/jpeg.c +@@ -317,7 +317,7 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) + { + data->vs = ss & 0xF; /* Vertical sampling. */ + data->hs = ss >> 4; /* Horizontal sampling. */ +- if ((data->vs > 2) || (data->hs > 2)) ++ if ((data->vs > 2) || (data->hs > 2) || (data->vs == 0) || (data->hs == 0)) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "jpeg: sampling method not supported"); + } +-- +2.4.3 + diff --git a/0159-Avoid-division-by-zero-in-serial.patch b/0159-Avoid-division-by-zero-in-serial.patch new file mode 100644 index 0000000..c799423 --- /dev/null +++ b/0159-Avoid-division-by-zero-in-serial.patch @@ -0,0 +1,72 @@ +From e95685dab1a7b7ae31b65be1ebc3fd84ebc41c34 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 20:41:36 +0100 +Subject: [PATCH 159/506] Avoid division by zero in serial. + +--- + ChangeLog | 7 +++++++ + grub-core/term/ns8250.c | 2 ++ + grub-core/term/serial.c | 9 ++++++++- + 3 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 7b34ba7..7d5a651 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,12 @@ + 2015-01-20 Vladimir Serbinenko + ++ Avoid division by zero in serial. ++ ++ * grub-core/term/serial.c (grub_cmd_serial): Ensure speed is not 0. ++ * grub-core/term/ns8250.c (serial_get_divisor): Exit if speed is 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/video/readers/jpeg.c: Avoid sivision by zero. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/term/ns8250.c b/grub-core/term/ns8250.c +index 2959632..39809d0 100644 +--- a/grub-core/term/ns8250.c ++++ b/grub-core/term/ns8250.c +@@ -57,6 +57,8 @@ serial_get_divisor (const struct grub_serial_port *port __attribute__ ((unused)) + base_clock = config->base_clock ? (config->base_clock >> 4) : DEFAULT_BASE_CLOCK; + + divisor = (base_clock + (config->speed / 2)) / config->speed; ++ if (config->speed == 0) ++ return 0; + if (divisor > 0xffff || divisor == 0) + return 0; + actual_speed = base_clock / divisor; +diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c +index 5784bc2..db80b3b 100644 +--- a/grub-core/term/serial.c ++++ b/grub-core/term/serial.c +@@ -220,8 +220,12 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) + + config = port->config; + +- if (state[OPTION_SPEED].set) ++ if (state[OPTION_SPEED].set) { + config.speed = grub_strtoul (state[OPTION_SPEED].arg, 0, 0); ++ if (config.speed == 0) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, ++ N_("unsupported serial port parity")); ++ } + + if (state[OPTION_WORD].set) + config.word_len = grub_strtoul (state[OPTION_WORD].arg, 0, 0); +@@ -275,6 +279,9 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) + config.base_clock *= 1000; + } + ++ if (config.speed == 0) ++ config.speed = 9600; ++ + /* Initialize with new settings. */ + err = port->driver->configure (port, &config); + if (err) +-- +2.4.3 + diff --git a/0160-grub-core-term-gfxterm.c-Avoid-division-by-zero.patch b/0160-grub-core-term-gfxterm.c-Avoid-division-by-zero.patch new file mode 100644 index 0000000..4db98fb --- /dev/null +++ b/0160-grub-core-term-gfxterm.c-Avoid-division-by-zero.patch @@ -0,0 +1,41 @@ +From c453760c71282bc01a88ab80fff02a247297c62b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 20:50:35 +0100 +Subject: [PATCH 160/506] * grub-core/term/gfxterm.c: Avoid division by + zero. + +--- + ChangeLog | 4 ++++ + grub-core/term/gfxterm.c | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 7d5a651..dc882d8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/term/gfxterm.c: Avoid division by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + Avoid division by zero in serial. + + * grub-core/term/serial.c (grub_cmd_serial): Ensure speed is not 0. +diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c +index dc0669b..70f10f1 100644 +--- a/grub-core/term/gfxterm.c ++++ b/grub-core/term/gfxterm.c +@@ -221,6 +221,8 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, + calculate_normal_character_width (virtual_screen.font); + virtual_screen.normal_char_height = + grub_font_get_max_char_height (virtual_screen.font); ++ if (virtual_screen.normal_char_height == 0) ++ virtual_screen.normal_char_height = 16; + virtual_screen.cursor_x = 0; + virtual_screen.cursor_y = 0; + virtual_screen.cursor_state = 1; +-- +2.4.3 + diff --git a/0161-include-grub-misc.h-grub_div_roundup-Remove-as-it-s-.patch b/0161-include-grub-misc.h-grub_div_roundup-Remove-as-it-s-.patch new file mode 100644 index 0000000..b21534a --- /dev/null +++ b/0161-include-grub-misc.h-grub_div_roundup-Remove-as-it-s-.patch @@ -0,0 +1,46 @@ +From e360b5d176ef0a6e65cbbc3ddfffe9cf4ae7d07d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 20:52:41 +0100 +Subject: [PATCH 161/506] * include/grub/misc.h (grub_div_roundup): + Remove as it's unused. + +--- + ChangeLog | 4 ++++ + include/grub/misc.h | 7 ------- + 2 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index dc882d8..ecbe11d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * include/grub/misc.h (grub_div_roundup): Remove as it's unused. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/term/gfxterm.c: Avoid division by zero. + + 2015-01-20 Vladimir Serbinenko +diff --git a/include/grub/misc.h b/include/grub/misc.h +index c6cd456..4b6ee06 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -390,13 +390,6 @@ grub_abs (int x) + return (unsigned int) x; + } + +-/* Rounded-up division */ +-static inline unsigned int +-grub_div_roundup (unsigned int x, unsigned int y) +-{ +- return (x + y - 1) / y; +-} +- + /* Reboot the machine. */ + #if defined (GRUB_MACHINE_EMU) || defined (GRUB_MACHINE_QEMU_MIPS) + void EXPORT_FUNC(grub_reboot) (void) __attribute__ ((noreturn)); +-- +2.4.3 + diff --git a/0162-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch b/0162-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch new file mode 100644 index 0000000..5d837dc --- /dev/null +++ b/0162-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch @@ -0,0 +1,46 @@ +From 2e62352bc28bd5d3efafc1b5cbe211ff9e9987fd Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 21:07:08 +0100 +Subject: [PATCH 162/506] * grub-core/kern/i386/tsc.c (calibrate_tsc): + Ensure that no division by 0 occurs. + +--- + ChangeLog | 5 +++++ + grub-core/kern/i386/tsc.c | 6 +++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index ecbe11d..c2551db 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that ++ no division by 0 occurs. ++ ++2015-01-20 Vladimir Serbinenko ++ + * include/grub/misc.h (grub_div_roundup): Remove as it's unused. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c +index 3a4cae6..d7d1783 100644 +--- a/grub-core/kern/i386/tsc.c ++++ b/grub-core/kern/i386/tsc.c +@@ -122,7 +122,11 @@ calibrate_tsc (void) + grub_pit_wait (0xffff); + end_tsc = grub_get_tsc (); + +- grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); ++ grub_tsc_rate = 0; ++ if (end_tsc > tsc_boot_time) ++ grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); ++ if (grub_tsc_rate == 0) ++ grub_tsc_rate = 5368;/* 800 MHz */ + } + #endif + +-- +2.4.3 + diff --git a/0163-grub-core-loader-i386-xnu.c-guessfsb-Avoid-division-.patch b/0163-grub-core-loader-i386-xnu.c-guessfsb-Avoid-division-.patch new file mode 100644 index 0000000..3d8f4a2 --- /dev/null +++ b/0163-grub-core-loader-i386-xnu.c-guessfsb-Avoid-division-.patch @@ -0,0 +1,54 @@ +From b666e01b9cb932de5f04fece08f21f0e5f074ebd Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 21:07:41 +0100 +Subject: [PATCH 163/506] * grub-core/loader/i386/xnu.c (guessfsb): + Avoid division by 0. + +--- + ChangeLog | 4 ++++ + grub-core/loader/i386/xnu.c | 8 +++++--- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c2551db..0376974 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/loader/i386/xnu.c (guessfsb): Avoid division by 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that + no division by 0 occurs. + +diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c +index 94daa02..e0506a6 100644 +--- a/grub-core/loader/i386/xnu.c ++++ b/grub-core/loader/i386/xnu.c +@@ -126,7 +126,7 @@ guessfsb (void) + { + const grub_uint64_t sane_value = 100000000; + grub_uint32_t manufacturer[3], max_cpuid, capabilities, msrlow; +- grub_uint32_t a, b, d; ++ grub_uint32_t a, b, d, divisor; + + if (! grub_cpu_is_cpuid_supported ()) + return sane_value; +@@ -166,8 +166,10 @@ guessfsb (void) + r = (2000ULL << 32) - v * grub_tsc_rate; + v += r / grub_tsc_rate; + +- return grub_divmod64 (v, ((msrlow >> 7) & 0x3e) | ((msrlow >> 14) & 1), +- 0); ++ divisor = ((msrlow >> 7) & 0x3e) | ((msrlow >> 14) & 1); ++ if (divisor == 0) ++ return sane_value; ++ return grub_divmod64 (v, divisor, 0); + } + + struct property_descriptor +-- +2.4.3 + diff --git a/0164-rtc_get_time_ms.c-grub_rtc_get_time_ms-Avoid-divisio.patch b/0164-rtc_get_time_ms.c-grub_rtc_get_time_ms-Avoid-divisio.patch new file mode 100644 index 0000000..0f0b995 --- /dev/null +++ b/0164-rtc_get_time_ms.c-grub_rtc_get_time_ms-Avoid-divisio.patch @@ -0,0 +1,40 @@ +From 4e0a25a4c03b5e91396912393d5db9871d45bde8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 21:10:55 +0100 +Subject: [PATCH 164/506] rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid + division by zero. + +--- + ChangeLog | 5 +++++ + grub-core/kern/generic/rtc_get_time_ms.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 0376974..40ced5a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/kern/generic/rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid ++ division by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/loader/i386/xnu.c (guessfsb): Avoid division by 0. + + 2015-01-20 Vladimir Serbinenko +diff --git a/grub-core/kern/generic/rtc_get_time_ms.c b/grub-core/kern/generic/rtc_get_time_ms.c +index 49f2aca..3e39c8f 100644 +--- a/grub-core/kern/generic/rtc_get_time_ms.c ++++ b/grub-core/kern/generic/rtc_get_time_ms.c +@@ -34,5 +34,5 @@ grub_rtc_get_time_ms (void) + 1 s 1 T rtc ticks + */ + grub_uint64_t ticks_ms_per_sec = ((grub_uint64_t) 1000) * grub_get_rtc (); +- return grub_divmod64 (ticks_ms_per_sec, GRUB_TICKS_PER_SECOND, 0); ++ return grub_divmod64 (ticks_ms_per_sec, GRUB_TICKS_PER_SECOND ? : 1000, 0); + } +-- +2.4.3 + diff --git a/0165-haiku-getroot.c-grub_util_find_partition_start_os-Av.patch b/0165-haiku-getroot.c-grub_util_find_partition_start_os-Av.patch new file mode 100644 index 0000000..6f774b2 --- /dev/null +++ b/0165-haiku-getroot.c-grub_util_find_partition_start_os-Av.patch @@ -0,0 +1,42 @@ +From ac8bac2496d6ebf74f678288293d89a6b315ff5b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 20 Jan 2015 21:12:46 +0100 +Subject: [PATCH 165/506] haiku/getroot.c (grub_util_find_partition_start_os): + Avoid division by zero. + +--- + ChangeLog | 5 +++++ + grub-core/osdep/haiku/getroot.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 40ced5a..1670569 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/osdep/haiku/getroot.c (grub_util_find_partition_start_os): ++ Avoid division by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/kern/generic/rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid + division by zero. + +diff --git a/grub-core/osdep/haiku/getroot.c b/grub-core/osdep/haiku/getroot.c +index 0852c5e..4e123c0 100644 +--- a/grub-core/osdep/haiku/getroot.c ++++ b/grub-core/osdep/haiku/getroot.c +@@ -65,7 +65,7 @@ grub_util_find_partition_start_os (const char *dev) + device_geometry geo; + if (ioctl (fd, B_GET_GEOMETRY, &geo, sizeof (geo)) < 0) + return 0; +- ret /= geo.bytes_per_sector; ++ ret /= geo.bytes_per_sector ? : 512; + close (fd); + return ret; + } +-- +2.4.3 + diff --git a/0166-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch b/0166-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch new file mode 100644 index 0000000..ab7a565 --- /dev/null +++ b/0166-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch @@ -0,0 +1,57 @@ +From 69aee43fa64601cabf6efa9279c10d69b466662e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 21 Jan 2015 10:17:36 +0100 +Subject: [PATCH 166/506] * grub-core/kern/efi/mm.c + (grub_efi_get_memory_map): Never return a descriptor_size==0 to avoid + potential divisions by zero. + +--- + ChangeLog | 5 +++++ + grub-core/kern/efi/mm.c | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 1670569..f9ac599 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/kern/efi/mm.c (grub_efi_get_memory_map): Never return a ++ descriptor_size==0 to avoid potential divisions by zero. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/osdep/haiku/getroot.c (grub_util_find_partition_start_os): + Avoid division by zero. + +diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c +index be37afd..20a47aa 100644 +--- a/grub-core/kern/efi/mm.c ++++ b/grub-core/kern/efi/mm.c +@@ -230,6 +230,7 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, + grub_efi_boot_services_t *b; + grub_efi_uintn_t key; + grub_efi_uint32_t version; ++ grub_efi_uintn_t size; + + if (grub_efi_is_finished) + { +@@ -259,10 +260,14 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, + map_key = &key; + if (! descriptor_version) + descriptor_version = &version; ++ if (! descriptor_size) ++ descriptor_size = &size; + + b = grub_efi_system_table->boot_services; + status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key, + descriptor_size, descriptor_version); ++ if (*descriptor_size == 0) ++ *descriptor_size = sizeof (grub_efi_memory_descriptor_t); + if (status == GRUB_EFI_SUCCESS) + return 1; + else if (status == GRUB_EFI_BUFFER_TOO_SMALL) +-- +2.4.3 + diff --git a/0167-unix-cputime.c-Cache-sc_clk_tck-and-check-it-for-san.patch b/0167-unix-cputime.c-Cache-sc_clk_tck-and-check-it-for-san.patch new file mode 100644 index 0000000..427c8b3 --- /dev/null +++ b/0167-unix-cputime.c-Cache-sc_clk_tck-and-check-it-for-san.patch @@ -0,0 +1,49 @@ +From 68581b009f6e943bd6ddf3c781db1c884832fa8e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 21 Jan 2015 10:28:52 +0100 +Subject: [PATCH 167/506] unix/cputime.c: Cache sc_clk_tck and check it for + sanity. + +--- + ChangeLog | 5 +++++ + grub-core/osdep/unix/cputime.c | 9 ++++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index f9ac599..4b9f9b2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/osdep/unix/cputime.c (grub_util_get_cpu_time_ms): Cache ++ sc_clk_tck and check it for sanity. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/kern/efi/mm.c (grub_efi_get_memory_map): Never return a + descriptor_size==0 to avoid potential divisions by zero. + +diff --git a/grub-core/osdep/unix/cputime.c b/grub-core/osdep/unix/cputime.c +index 47e3abc..cff359a 100644 +--- a/grub-core/osdep/unix/cputime.c ++++ b/grub-core/osdep/unix/cputime.c +@@ -9,7 +9,14 @@ grub_uint64_t + grub_util_get_cpu_time_ms (void) + { + struct tms tm; ++ static long sc_clk_tck; ++ if (!sc_clk_tck) ++ { ++ sc_clk_tck = sysconf(_SC_CLK_TCK); ++ if (sc_clk_tck <= 0) ++ sc_clk_tck = 1000; ++ } + + times (&tm); +- return (tm.tms_utime * 1000ULL) / sysconf(_SC_CLK_TCK); ++ return (tm.tms_utime * 1000ULL) / sc_clk_tck; + } +-- +2.4.3 + diff --git a/0168-grub_menu_init_page-Avoid-returning-0-geometry-to-av.patch b/0168-grub_menu_init_page-Avoid-returning-0-geometry-to-av.patch new file mode 100644 index 0000000..fbf3f84 --- /dev/null +++ b/0168-grub_menu_init_page-Avoid-returning-0-geometry-to-av.patch @@ -0,0 +1,43 @@ +From 44b38e49885ffcb286e796b572f3f862f3be371a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 21 Jan 2015 15:51:49 +0100 +Subject: [PATCH 168/506] grub_menu_init_page: Avoid returning 0 geometry to + avoid divisions by 0. + +--- + ChangeLog | 5 +++++ + grub-core/normal/menu_text.c | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 4b9f9b2..3383d46 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2015-01-20 Vladimir Serbinenko + ++ * grub-core/normal/menu_text.c (grub_menu_init_page): Avoid ++ returning 0 geometry to avoid divisions by 0. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/osdep/unix/cputime.c (grub_util_get_cpu_time_ms): Cache + sc_clk_tck and check it for sanity. + +diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c +index 2ff2941..e22bb91 100644 +--- a/grub-core/normal/menu_text.c ++++ b/grub-core/normal/menu_text.c +@@ -369,6 +369,9 @@ grub_menu_init_page (int nested, int edit, + geo->border = 0; + } + ++ if (geo->entry_width <= 0) ++ geo->entry_width = 1; ++ + if (geo->num_entries - msg_num_lines < 3 + && geo->timeout_lines == 2) + { +-- +2.4.3 + diff --git a/0169-Remove-potential-division-by-0-in-gfxmenu.patch b/0169-Remove-potential-division-by-0-in-gfxmenu.patch new file mode 100644 index 0000000..d005848 --- /dev/null +++ b/0169-Remove-potential-division-by-0-in-gfxmenu.patch @@ -0,0 +1,167 @@ +From 6866f2ba37aafd807a6370278b49618e348a3677 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 21 Jan 2015 15:56:53 +0100 +Subject: [PATCH 169/506] Remove potential division by 0 in gfxmenu. + +--- + ChangeLog | 4 ++ + grub-core/gfxmenu/gui_circular_progress.c | 88 ++++++++++++++++--------------- + grub-core/gfxmenu/gui_list.c | 3 ++ + grub-core/gfxmenu/gui_progress_bar.c | 12 +++-- + 4 files changed, 61 insertions(+), 46 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 3383d46..2d57d83 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2015-01-20 Vladimir Serbinenko + ++ Remove potential division by 0 in gfxmenu. ++ ++2015-01-20 Vladimir Serbinenko ++ + * grub-core/normal/menu_text.c (grub_menu_init_page): Avoid + returning 0 geometry to avoid divisions by 0. + +diff --git a/grub-core/gfxmenu/gui_circular_progress.c b/grub-core/gfxmenu/gui_circular_progress.c +index 04f68b8..354dd7b 100644 +--- a/grub-core/gfxmenu/gui_circular_progress.c ++++ b/grub-core/gfxmenu/gui_circular_progress.c +@@ -138,51 +138,53 @@ circprog_paint (void *vself, const grub_video_rect_t *region) + (height - center_height) / 2, 0, 0, + center_width, center_height); + +- int radius = grub_min (height, width) / 2 - grub_max (tick_height, tick_width) / 2 - 1; +- unsigned nticks; +- unsigned tick_begin; +- unsigned tick_end; +- if (self->end <= self->start +- || self->value <= self->start) +- nticks = 0; +- else +- nticks = ((unsigned) (self->num_ticks +- * (self->value - self->start))) +- / ((unsigned) (self->end - self->start)); +- /* Do ticks appear or disappear as the value approached the end? */ +- if (self->ticks_disappear) ++ if (self->num_ticks) + { +- tick_begin = nticks; +- tick_end = self->num_ticks; +- } +- else +- { +- tick_begin = 0; +- tick_end = nticks; +- } +- +- unsigned i; +- for (i = tick_begin; i < tick_end; i++) +- { +- int x; +- int y; +- int angle; +- +- /* Calculate the location of the tick. */ +- angle = self->start_angle +- + i * GRUB_TRIG_ANGLE_MAX / self->num_ticks; +- x = width / 2 + (grub_cos (angle) * radius / GRUB_TRIG_FRACTION_SCALE); +- y = height / 2 + (grub_sin (angle) * radius / GRUB_TRIG_FRACTION_SCALE); +- +- /* Adjust (x,y) so the tick is centered. */ +- x -= tick_width / 2; +- y -= tick_height / 2; +- +- /* Draw the tick. */ +- grub_video_blit_bitmap (self->tick_bitmap, GRUB_VIDEO_BLIT_BLEND, +- x, y, 0, 0, tick_width, tick_height); ++ int radius = grub_min (height, width) / 2 - grub_max (tick_height, tick_width) / 2 - 1; ++ unsigned nticks; ++ unsigned tick_begin; ++ unsigned tick_end; ++ if (self->end <= self->start ++ || self->value <= self->start) ++ nticks = 0; ++ else ++ nticks = ((unsigned) (self->num_ticks ++ * (self->value - self->start))) ++ / ((unsigned) (self->end - self->start)); ++ /* Do ticks appear or disappear as the value approached the end? */ ++ if (self->ticks_disappear) ++ { ++ tick_begin = nticks; ++ tick_end = self->num_ticks; ++ } ++ else ++ { ++ tick_begin = 0; ++ tick_end = nticks; ++ } ++ ++ unsigned i; ++ for (i = tick_begin; i < tick_end; i++) ++ { ++ int x; ++ int y; ++ int angle; ++ ++ /* Calculate the location of the tick. */ ++ angle = self->start_angle ++ + i * GRUB_TRIG_ANGLE_MAX / self->num_ticks; ++ x = width / 2 + (grub_cos (angle) * radius / GRUB_TRIG_FRACTION_SCALE); ++ y = height / 2 + (grub_sin (angle) * radius / GRUB_TRIG_FRACTION_SCALE); ++ ++ /* Adjust (x,y) so the tick is centered. */ ++ x -= tick_width / 2; ++ y -= tick_height / 2; ++ ++ /* Draw the tick. */ ++ grub_video_blit_bitmap (self->tick_bitmap, GRUB_VIDEO_BLIT_BLEND, ++ x, y, 0, 0, tick_width, tick_height); ++ } + } +- + grub_gui_restore_viewport (&vpsave); + } + +diff --git a/grub-core/gfxmenu/gui_list.c b/grub-core/gfxmenu/gui_list.c +index 5d26811..01477cd 100644 +--- a/grub-core/gfxmenu/gui_list.c ++++ b/grub-core/gfxmenu/gui_list.c +@@ -131,6 +131,9 @@ get_num_shown_items (list_impl_t self) + int max_top_pad = grub_max (item_top_pad, sel_top_pad); + int max_bottom_pad = grub_max (item_bottom_pad, sel_bottom_pad); + ++ if (item_height + item_vspace <= 0) ++ return 1; ++ + return (self->bounds.height + item_vspace - 2 * boxpad + - max_top_pad - max_bottom_pad + - box_top_pad - box_bottom_pad) / (item_height + item_vspace); +diff --git a/grub-core/gfxmenu/gui_progress_bar.c b/grub-core/gfxmenu/gui_progress_bar.c +index 3501b01..b128f08 100644 +--- a/grub-core/gfxmenu/gui_progress_bar.c ++++ b/grub-core/gfxmenu/gui_progress_bar.c +@@ -118,9 +118,15 @@ draw_filled_rect_bar (grub_gui_progress_bar_t self) + f.width + 2, f.height + 2); + + /* Bar background. */ +- int barwidth = (f.width +- * (self->value - self->start) +- / (self->end - self->start)); ++ unsigned barwidth; ++ ++ if (self->end <= self->start ++ || self->value <= self->start) ++ barwidth = 0; ++ else ++ barwidth = (f.width ++ * (self->value - self->start) ++ / (self->end - self->start)); + grub_video_fill_rect (grub_video_map_rgba_color (self->bg_color), + f.x + barwidth, f.y, + f.width - barwidth, f.height); +-- +2.4.3 + diff --git a/0170-Remove-direct-_llseek-code-and-require-long-filesyst.patch b/0170-Remove-direct-_llseek-code-and-require-long-filesyst.patch new file mode 100644 index 0000000..f9ae6ca --- /dev/null +++ b/0170-Remove-direct-_llseek-code-and-require-long-filesyst.patch @@ -0,0 +1,108 @@ +From 3bac4caa2bc64db313aaee54fffb90383e118517 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Thu, 22 Jan 2015 19:54:36 +0100 +Subject: [PATCH 170/506] Remove direct _llseek code and require long + filesystem libc. + +--- + ChangeLog | 4 ++++ + INSTALL | 1 + + configure.ac | 8 ++++++++ + grub-core/osdep/unix/hostdisk.c | 24 ------------------------ + 4 files changed, 13 insertions(+), 24 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 2d57d83..024a876 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2015-01-22 Felix Janda ++ ++ Remove direct _llseek code and require long filesystem libc. ++ + 2015-01-20 Vladimir Serbinenko + + Remove potential division by 0 in gfxmenu. +diff --git a/INSTALL b/INSTALL +index b67cd7f..f6f276c 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -35,6 +35,7 @@ configuring the GRUB. + * GNU binutils 2.9.1.0.23 or later + * Flex 2.5.35 or later + * Other standard GNU/Unix tools ++* a libc with large file support (e.g. glibc 2.1 or later) + + On GNU/Linux, you also need: + +diff --git a/configure.ac b/configure.ac +index 31d2b0b..fdddbad 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -366,6 +366,14 @@ case "$host_os" in + ;; + esac + ++case "$host_os" in ++ cygwin | windows* | mingw32* | aros*) ++ ;; ++ *) ++ AC_CHECK_SIZEOF(off_t) ++ test x"$ac_cv_sizeof_off_t" = x8 || AC_MSG_ERROR([Large file support is required]);; ++esac ++ + if test x$USE_NLS = xno; then + HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext" + fi +diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c +index 43b56ff..b3bc0e4 100644 +--- a/grub-core/osdep/unix/hostdisk.c ++++ b/grub-core/osdep/unix/hostdisk.c +@@ -48,11 +48,6 @@ + #ifdef __linux__ + # include /* ioctl */ + # include +-# if !defined(__GLIBC__) || \ +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) +-/* Maybe libc doesn't have large file support. */ +-# include /* _llseek */ +-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ + #endif /* __linux__ */ + + grub_uint64_t +@@ -79,24 +74,6 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz + return st.st_size; + } + +-#if defined(__linux__) && (!defined(__GLIBC__) || \ +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) +- /* Maybe libc doesn't have large file support. */ +-int +-grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) +-{ +- loff_t offset, result; +- static int _llseek (uint filedes, ulong hi, ulong lo, +- loff_t *res, uint wh); +- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, +- loff_t *, res, uint, wh); +- +- offset = (loff_t) off; +- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) +- return -1; +- return GRUB_ERR_NONE; +-} +-#else + int + grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) + { +@@ -107,7 +84,6 @@ grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) + + return 0; + } +-#endif + + + /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an +-- +2.4.3 + diff --git a/0171-accept-also-hdX-as-alias-to-native-Xen-disk-name.patch b/0171-accept-also-hdX-as-alias-to-native-Xen-disk-name.patch new file mode 100644 index 0000000..4d9706c --- /dev/null +++ b/0171-accept-also-hdX-as-alias-to-native-Xen-disk-name.patch @@ -0,0 +1,129 @@ +From 2f73d2733ce8f1e60561a4f7c3a7caa3717fb174 Mon Sep 17 00:00:00 2001 +From: Andrey Borzenkov +Date: Fri, 23 Jan 2015 19:52:45 +0300 +Subject: [PATCH 171/506] accept also hdX as alias to native Xen disk name + +To be compatible with legacy pv-grub, sort disks by increasing order of handle +value. This allows reusing legacy pv-grub menu.lst which is using hdX names. + +Suggested-By: Michael Chang +Closes: 44026 +--- + ChangeLog | 5 +++++ + grub-core/disk/xen/xendisk.c | 45 +++++++++++++++++++++++++++++++++++--------- + 2 files changed, 41 insertions(+), 9 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 024a876..3f01f98 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2015-01-23 Andrei Borzenkov ++ ++ * grub-core/disk/xen/xendisk.c: Accept hdX as disk names on Xen to ++ allow legacy menu.lst processing. ++ + 2015-01-22 Felix Janda + + Remove direct _llseek code and require long filesystem libc. +diff --git a/grub-core/disk/xen/xendisk.c b/grub-core/disk/xen/xendisk.c +index 2b11c2a..b18a923 100644 +--- a/grub-core/disk/xen/xendisk.c ++++ b/grub-core/disk/xen/xendisk.c +@@ -40,6 +40,7 @@ struct virtdisk + grub_xen_evtchn_t evtchn; + void *dma_page; + grub_xen_grant_t dma_grant; ++ struct virtdisk *compat_next; + }; + + #define xen_wmb() mb() +@@ -47,6 +48,7 @@ struct virtdisk + + static struct virtdisk *virtdisks; + static grub_size_t vdiskcnt; ++struct virtdisk *compat_head; + + static int + grub_virtdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, +@@ -66,20 +68,32 @@ grub_virtdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, + static grub_err_t + grub_virtdisk_open (const char *name, grub_disk_t disk) + { +- grub_size_t i; ++ int i; + grub_uint32_t secsize; + char fdir[200]; + char *buf; ++ int num = -1; ++ struct virtdisk *vd; + +- for (i = 0; i < vdiskcnt; i++) +- if (grub_strcmp (name, virtdisks[i].fullname) == 0) ++ /* For compatibility with pv-grub legacy menu.lst accept hdX as disk name */ ++ if (name[0] == 'h' && name[1] == 'd' && name[2]) ++ { ++ num = grub_strtoul (name + 2, 0, 10); ++ if (grub_errno) ++ { ++ grub_errno = 0; ++ num = -1; ++ } ++ } ++ for (i = 0, vd = compat_head; vd; vd = vd->compat_next, i++) ++ if (i == num || grub_strcmp (name, vd->fullname) == 0) + break; +- if (i == vdiskcnt) ++ if (!vd) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a virtdisk"); +- disk->data = &virtdisks[i]; +- disk->id = i; ++ disk->data = vd; ++ disk->id = vd - virtdisks; + +- grub_snprintf (fdir, sizeof (fdir), "%s/sectors", virtdisks[i].backend_dir); ++ grub_snprintf (fdir, sizeof (fdir), "%s/sectors", vd->backend_dir); + buf = grub_xenstore_get_file (fdir, NULL); + if (!buf) + return grub_errno; +@@ -87,8 +101,7 @@ grub_virtdisk_open (const char *name, grub_disk_t disk) + if (grub_errno) + return grub_errno; + +- grub_snprintf (fdir, sizeof (fdir), "%s/sector-size", +- virtdisks[i].backend_dir); ++ grub_snprintf (fdir, sizeof (fdir), "%s/sector-size", vd->backend_dir); + buf = grub_xenstore_get_file (fdir, NULL); + if (!buf) + return grub_errno; +@@ -264,6 +277,7 @@ fill (const char *dir, void *data) + grub_err_t err; + void *buf; + struct evtchn_alloc_unbound alloc_unbound; ++ struct virtdisk **prev = &compat_head, *vd = compat_head; + + /* Shouldn't happen unles some hotplug happened. */ + if (vdiskcnt >= *ctr) +@@ -374,6 +388,19 @@ fill (const char *dir, void *data) + + virtdisks[vdiskcnt].frontend_dir = grub_strdup (fdir); + ++ /* For compatibility with pv-grub maintain linked list sorted by handle ++ value in increasing order. This allows mapping of (hdX) disk names ++ from legacy menu.lst */ ++ while (vd) ++ { ++ if (vd->handle > virtdisks[vdiskcnt].handle) ++ break; ++ prev = &vd->compat_next; ++ vd = vd->compat_next; ++ } ++ virtdisks[vdiskcnt].compat_next = vd; ++ *prev = &virtdisks[vdiskcnt]; ++ + vdiskcnt++; + return 0; + +-- +2.4.3 + diff --git a/0172-Mention-platform-none-in-NEWS.patch b/0172-Mention-platform-none-in-NEWS.patch new file mode 100644 index 0000000..ff24371 --- /dev/null +++ b/0172-Mention-platform-none-in-NEWS.patch @@ -0,0 +1,25 @@ +From edf2db97e72916786ee87b5a7630659369e1ee97 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 23 Jan 2015 21:06:16 +0300 +Subject: [PATCH 172/506] Mention platform "none" in NEWS + +--- + NEWS | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/NEWS b/NEWS +index a61df94..55f09d6 100644 +--- a/NEWS ++++ b/NEWS +@@ -85,6 +85,8 @@ New in 2.02: + * Support for USB debug dongles. + * Support for *-emu on all platforms (previously only i386/x86_64 worked). + * Support *-emu on Windows. ++ * New platform "none" which builds only user level utilities. This is now ++ default if target CPU is not supported. + + * Security: + * Add optional facility to enforce that all files read by the core image +-- +2.4.3 + diff --git a/0173-tests-file_filter-file-Really-add-missing-file.patch b/0173-tests-file_filter-file-Really-add-missing-file.patch new file mode 100644 index 0000000..bde4065 --- /dev/null +++ b/0173-tests-file_filter-file-Really-add-missing-file.patch @@ -0,0 +1,34 @@ +From 8acb9dc697627e4189972f15fc219581557365b6 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 23 Jan 2015 19:46:02 +0100 +Subject: [PATCH 173/506] * tests/file_filter/file: Really add missing + file. + +--- + ChangeLog | 4 ++++ + tests/file_filter/file | 1 + + 2 files changed, 5 insertions(+) + create mode 100644 tests/file_filter/file + +diff --git a/ChangeLog b/ChangeLog +index 3f01f98..869f6bf 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2015-01-23 Vladimir Serbinenko ++ ++ * tests/file_filter/file: Really add missing file. ++ + 2015-01-23 Andrei Borzenkov + + * grub-core/disk/xen/xendisk.c: Accept hdX as disk names on Xen to +diff --git a/tests/file_filter/file b/tests/file_filter/file +new file mode 100644 +index 0000000..64650ac +--- /dev/null ++++ b/tests/file_filter/file +@@ -0,0 +1 @@ ++Hello, user! +-- +2.4.3 + diff --git a/0174-Autogenerate-ChangeLog-from-git-changelog.patch b/0174-Autogenerate-ChangeLog-from-git-changelog.patch new file mode 100644 index 0000000..533bcdf --- /dev/null +++ b/0174-Autogenerate-ChangeLog-from-git-changelog.patch @@ -0,0 +1,489 @@ +From 3bd0868364f693b17b36d592bd390ad974885ee1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 17:29:50 +0100 +Subject: [PATCH 174/506] Autogenerate ChangeLog from git changelog. + +Old ChangeLog is moved to ChangeLog-2015. For all changes starting from +this one ChangeLog will be generated from gitlog only on explicit make +invocation and make dist. +--- + ChangeLog => ChangeLog-2015 | 0 + Makefile.am | 13 +- + build-aux/gitlog-to-changelog | 432 ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 444 insertions(+), 1 deletion(-) + rename ChangeLog => ChangeLog-2015 (100%) + create mode 100755 build-aux/gitlog-to-changelog + +diff --git a/ChangeLog b/ChangeLog-2015 +similarity index 100% +rename from ChangeLog +rename to ChangeLog-2015 +diff --git a/Makefile.am b/Makefile.am +index cc537a2..df0a728 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -392,7 +392,7 @@ endif + .PHONY: bootcheck-linux-i386 bootcheck-linux-x86_64 \ + bootcheck-kfreebsd-i386 bootcheck-kfreebsd-x86_64 \ + bootcheck-knetbsd-i386 bootcheck-knetbsd-x86_64 \ +- bootcheck-linux-mips ++ bootcheck-linux-mips FORCE + + # Randomly generated + SUCCESSFUL_BOOT_STRING=3e49994fd5d82b7c9298d672d774080d +@@ -439,3 +439,14 @@ windowszip: windowsdir + rm -rf $(windowsdir) + + EXTRA_DIST += linguas.sh ++ ++changelog_start_date = 2015-01-24 ++gitlog_to_changelog = $(top_srcdir)/build-aux/gitlog-to-changelog ++ ++ChangeLog: FORCE ++ if test -d $(top_srcdir)/.git; then \ ++ $(gitlog_to_changelog) --srcdir=$(top_srcdir) --since=$(changelog_start_date) > '$@.tmp'; \ ++ rm -f '$@'; mv '$@.tmp' '$@'; \ ++ fi ++ ++EXTRA_DIST += ChangeLog ChangeLog-2015 +diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog +new file mode 100755 +index 0000000..78afff4 +--- /dev/null ++++ b/build-aux/gitlog-to-changelog +@@ -0,0 +1,432 @@ ++eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' ++ & eval 'exec perl -wS "$0" $argv:q' ++ if 0; ++# Convert git log output to ChangeLog format. ++ ++my $VERSION = '2012-07-29 06:11'; # UTC ++# The definition above must lie within the first 8 lines in order ++# for the Emacs time-stamp write hook (at end) to update it. ++# If you change this file with Emacs, please let the write hook ++# do its job. Otherwise, update this string manually. ++ ++# Copyright (C) 2008-2014 Free Software Foundation, Inc. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program 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 this program. If not, see . ++ ++# Written by Jim Meyering ++ ++use strict; ++use warnings; ++use Getopt::Long; ++use POSIX qw(strftime); ++ ++(my $ME = $0) =~ s|.*/||; ++ ++# use File::Coda; # http://meyering.net/code/Coda/ ++END { ++ defined fileno STDOUT or return; ++ close STDOUT and return; ++ warn "$ME: failed to close standard output: $!\n"; ++ $? ||= 1; ++} ++ ++sub usage ($) ++{ ++ my ($exit_code) = @_; ++ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); ++ if ($exit_code != 0) ++ { ++ print $STREAM "Try '$ME --help' for more information.\n"; ++ } ++ else ++ { ++ print $STREAM < ChangeLog ++ $ME -- -n 5 foo > last-5-commits-to-branch-foo ++ ++SPECIAL SYNTAX: ++ ++The following types of strings are interpreted specially when they appear ++at the beginning of a log message line. They are not copied to the output. ++ ++ Copyright-paperwork-exempt: Yes ++ Append the "(tiny change)" notation to the usual "date name email" ++ ChangeLog header to mark a change that does not require a copyright ++ assignment. ++ Co-authored-by: Joe User ++ List the specified name and email address on a second ++ ChangeLog header, denoting a co-author. ++ Signed-off-by: Joe User ++ These lines are simply elided. ++ ++In a FILE specified via --amend, comment lines (starting with "#") are ignored. ++FILE must consist of pairs where SHA is a 40-byte SHA1 (alone on ++a line) referring to a commit in the current project, and CODE refers to one ++or more consecutive lines of Perl code. Pairs must be separated by one or ++more blank line. ++ ++Here is sample input for use with --amend=FILE, from coreutils: ++ ++3a169f4c5d9159283548178668d2fae6fced3030 ++# fix typo in title: ++s/all tile types/all file types/ ++ ++1379ed974f1fa39b12e2ffab18b3f7a607082202 ++# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself. ++# Change the author to be Paul. Note the escaped "@": ++s,Jim .*>,Paul Eggert , ++ ++EOF ++ } ++ exit $exit_code; ++} ++ ++# If the string $S is a well-behaved file name, simply return it. ++# If it contains white space, quotes, etc., quote it, and return the new string. ++sub shell_quote($) ++{ ++ my ($s) = @_; ++ if ($s =~ m![^\w+/.,-]!) ++ { ++ # Convert each single quote to '\'' ++ $s =~ s/\'/\'\\\'\'/g; ++ # Then single quote the string. ++ $s = "'$s'"; ++ } ++ return $s; ++} ++ ++sub quoted_cmd(@) ++{ ++ return join (' ', map {shell_quote $_} @_); ++} ++ ++# Parse file F. ++# Comment lines (starting with "#") are ignored. ++# F must consist of pairs where SHA is a 40-byte SHA1 ++# (alone on a line) referring to a commit in the current project, and ++# CODE refers to one or more consecutive lines of Perl code. ++# Pairs must be separated by one or more blank line. ++sub parse_amend_file($) ++{ ++ my ($f) = @_; ++ ++ open F, '<', $f ++ or die "$ME: $f: failed to open for reading: $!\n"; ++ ++ my $fail; ++ my $h = {}; ++ my $in_code = 0; ++ my $sha; ++ while (defined (my $line = )) ++ { ++ $line =~ /^\#/ ++ and next; ++ chomp $line; ++ $line eq '' ++ and $in_code = 0, next; ++ ++ if (!$in_code) ++ { ++ $line =~ /^([0-9a-fA-F]{40})$/ ++ or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"), ++ $fail = 1, next; ++ $sha = lc $1; ++ $in_code = 1; ++ exists $h->{$sha} ++ and (warn "$ME: $f:$.: duplicate SHA1\n"), ++ $fail = 1, next; ++ } ++ else ++ { ++ $h->{$sha} ||= ''; ++ $h->{$sha} .= "$line\n"; ++ } ++ } ++ close F; ++ ++ $fail ++ and exit 1; ++ ++ return $h; ++} ++ ++# git_dir_option $SRCDIR ++# ++# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR ++# is undef). Return as a list (0 or 1 element). ++sub git_dir_option($) ++{ ++ my ($srcdir) = @_; ++ my @res = (); ++ if (defined $srcdir) ++ { ++ my $qdir = shell_quote $srcdir; ++ my $cmd = "cd $qdir && git rev-parse --show-toplevel"; ++ my $qcmd = shell_quote $cmd; ++ my $git_dir = qx($cmd); ++ defined $git_dir ++ or die "$ME: cannot run $qcmd: $!\n"; ++ $? == 0 ++ or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; ++ chomp $git_dir; ++ push @res, "--git-dir=$git_dir/.git"; ++ } ++ @res; ++} ++ ++{ ++ my $since_date; ++ my $format_string = '%s%n%b%n'; ++ my $amend_file; ++ my $append_dot = 0; ++ my $cluster = 1; ++ my $strip_tab = 0; ++ my $strip_cherry_pick = 0; ++ my $srcdir; ++ GetOptions ++ ( ++ help => sub { usage 0 }, ++ version => sub { print "$ME version $VERSION\n"; exit }, ++ 'since=s' => \$since_date, ++ 'format=s' => \$format_string, ++ 'amend=s' => \$amend_file, ++ 'append-dot' => \$append_dot, ++ 'cluster!' => \$cluster, ++ 'strip-tab' => \$strip_tab, ++ 'strip-cherry-pick' => \$strip_cherry_pick, ++ 'srcdir=s' => \$srcdir, ++ ) or usage 1; ++ ++ defined $since_date ++ and unshift @ARGV, "--since=$since_date"; ++ ++ # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/) ++ # that makes a correction in the log or attribution of that commit. ++ my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; ++ ++ my @cmd = ('git', ++ git_dir_option $srcdir, ++ qw(log --log-size), ++ '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); ++ open PIPE, '-|', @cmd ++ or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" ++ . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); ++ ++ my $prev_multi_paragraph; ++ my $prev_date_line = ''; ++ my @prev_coauthors = (); ++ while (1) ++ { ++ defined (my $in = ) ++ or last; ++ $in =~ /^log size (\d+)$/ ++ or die "$ME:$.: Invalid line (expected log size):\n$in"; ++ my $log_nbytes = $1; ++ ++ my $log; ++ my $n_read = read PIPE, $log, $log_nbytes; ++ $n_read == $log_nbytes ++ or die "$ME:$.: unexpected EOF\n"; ++ ++ # Extract leading hash. ++ my ($sha, $rest) = split ':', $log, 2; ++ defined $sha ++ or die "$ME:$.: malformed log entry\n"; ++ $sha =~ /^[0-9a-fA-F]{40}$/ ++ or die "$ME:$.: invalid SHA1: $sha\n"; ++ ++ # If this commit's log requires any transformation, do it now. ++ my $code = $amend_code->{$sha}; ++ if (defined $code) ++ { ++ eval 'use Safe'; ++ my $s = new Safe; ++ # Put the unpreprocessed entry into "$_". ++ $_ = $rest; ++ ++ # Let $code operate on it, safely. ++ my $r = $s->reval("$code") ++ or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n"; ++ ++ # Note that we've used this entry. ++ delete $amend_code->{$sha}; ++ ++ # Update $rest upon success. ++ $rest = $_; ++ } ++ ++ # Remove lines inserted by "git cherry-pick". ++ if ($strip_cherry_pick) ++ { ++ $rest =~ s/^\s*Conflicts:\n.*//sm; ++ $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; ++ } ++ ++ my @line = split "\n", $rest; ++ my $author_line = shift @line; ++ defined $author_line ++ or die "$ME:$.: unexpected EOF\n"; ++ $author_line =~ /^(\d+) (.*>)$/ ++ or die "$ME:$.: Invalid line " ++ . "(expected date/author/email):\n$author_line\n"; ++ ++ # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog ++ # `(tiny change)' annotation. ++ my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line) ++ ? ' (tiny change)' : ''); ++ ++ my $date_line = sprintf "%s %s$tiny\n", ++ strftime ("%F", localtime ($1)), $2; ++ ++ my @coauthors = grep /^Co-authored-by:.*$/, @line; ++ # Omit meta-data lines we've already interpreted. ++ @line = grep !/^(?:Signed-off-by:[ ].*>$ ++ |Co-authored-by:[ ] ++ |Copyright-paperwork-exempt:[ ] ++ )/x, @line; ++ ++ # Remove leading and trailing blank lines. ++ if (@line) ++ { ++ while ($line[0] =~ /^\s*$/) { shift @line; } ++ while ($line[$#line] =~ /^\s*$/) { pop @line; } ++ } ++ ++ # Record whether there are two or more paragraphs. ++ my $multi_paragraph = grep /^\s*$/, @line; ++ ++ # Format 'Co-authored-by: A U Thor ' lines in ++ # standard multi-author ChangeLog format. ++ for (@coauthors) ++ { ++ s/^Co-authored-by:\s*/\t /; ++ s/\s*/ ++ or warn "$ME: warning: missing email address for " ++ . substr ($_, 5) . "\n"; ++ } ++ ++ # If clustering of commit messages has been disabled, if this header ++ # would be different from the previous date/name/email/coauthors header, ++ # or if this or the previous entry consists of two or more paragraphs, ++ # then print the header. ++ if ( ! $cluster ++ || $date_line ne $prev_date_line ++ || "@coauthors" ne "@prev_coauthors" ++ || $multi_paragraph ++ || $prev_multi_paragraph) ++ { ++ $prev_date_line eq '' ++ or print "\n"; ++ print $date_line; ++ @coauthors ++ and print join ("\n", @coauthors), "\n"; ++ } ++ $prev_date_line = $date_line; ++ @prev_coauthors = @coauthors; ++ $prev_multi_paragraph = $multi_paragraph; ++ ++ # If there were any lines ++ if (@line == 0) ++ { ++ warn "$ME: warning: empty commit message:\n $date_line\n"; ++ } ++ else ++ { ++ if ($append_dot) ++ { ++ # If the first line of the message has enough room, then ++ if (length $line[0] < 72) ++ { ++ # append a dot if there is no other punctuation or blank ++ # at the end. ++ $line[0] =~ /[[:punct:]\s]$/ ++ or $line[0] .= '.'; ++ } ++ } ++ ++ # Remove one additional leading TAB from each line. ++ $strip_tab ++ and map { s/^\t// } @line; ++ ++ # Prefix each non-empty line with a TAB. ++ @line = map { length $_ ? "\t$_" : '' } @line; ++ ++ print "\n", join ("\n", @line), "\n"; ++ } ++ ++ defined ($in = ) ++ or last; ++ $in ne "\n" ++ and die "$ME:$.: unexpected line:\n$in"; ++ } ++ ++ close PIPE ++ or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; ++ # FIXME-someday: include $PROCESS_STATUS in the diagnostic ++ ++ # Complain about any unused entry in the --amend=F specified file. ++ my $fail = 0; ++ foreach my $sha (keys %$amend_code) ++ { ++ warn "$ME:$amend_file: unused entry: $sha\n"; ++ $fail = 1; ++ } ++ ++ exit $fail; ++} ++ ++# Local Variables: ++# mode: perl ++# indent-tabs-mode: nil ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "my $VERSION = '" ++# time-stamp-format: "%:y-%02m-%02d %02H:%02M" ++# time-stamp-time-zone: "UTC" ++# time-stamp-end: "'; # UTC" ++# End: +-- +2.4.3 + diff --git a/0175-conf-Makefile.common-Remove-unused-LD-C-FLAGS_CPU.patch b/0175-conf-Makefile.common-Remove-unused-LD-C-FLAGS_CPU.patch new file mode 100644 index 0000000..440fd19 --- /dev/null +++ b/0175-conf-Makefile.common-Remove-unused-LD-C-FLAGS_CPU.patch @@ -0,0 +1,42 @@ +From 11504d523cca9206e0df1e4f128d6d7d59ac1d9a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 17:44:19 +0100 +Subject: [PATCH 175/506] conf/Makefile.common: Remove unused {LD,C}FLAGS_CPU. + +--- + conf/Makefile.common | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 51fbaf9..8c4d148 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -41,19 +41,19 @@ BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT) + + LDADD_KERNEL = $(TARGET_LIBGCC) + +-CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding +-LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) ++CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding ++LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) + CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 + CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) + STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version + +-CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding +-LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d ++CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding ++LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d + CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) + CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) + +-CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin +-LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-S ++CFLAGS_IMAGE = $(CFLAGS_PLATFORM) -fno-builtin ++LDFLAGS_IMAGE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-S + CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) + CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) + +-- +2.4.3 + diff --git a/0176-util-grub-mkrescue.c-Always-include-part_msdos-and-p.patch b/0176-util-grub-mkrescue.c-Always-include-part_msdos-and-p.patch new file mode 100644 index 0000000..f0735e3 --- /dev/null +++ b/0176-util-grub-mkrescue.c-Always-include-part_msdos-and-p.patch @@ -0,0 +1,40 @@ +From eeea31b2208d862a3ff50f2739e103b22dc0061b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 17:45:16 +0100 +Subject: [PATCH 176/506] util/grub-mkrescue.c: Always include part_msdos and + part_gpt on EFI. + +When booted from stick, EFI would use GPT partition and our root +device detection algortihm depends on GRUB's ability to see the same +partitions. Hence include msdos and gpt partmap modules on EFI even when +they're not needed to access root filesystem. +--- + util/grub-mkrescue.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c +index e719839..e02340f 100644 +--- a/util/grub-mkrescue.c ++++ b/util/grub-mkrescue.c +@@ -653,6 +653,9 @@ main (int argc, char *argv[]) + char *efiimgfat; + grub_install_mkdir_p (efidir_efi_boot); + ++ grub_install_push_module ("part_gpt"); ++ grub_install_push_module ("part_msdos"); ++ + imgname = grub_util_path_concat (2, efidir_efi_boot, "bootia64.efi"); + make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_IA64_EFI, "ia64-efi", imgname); + free (imgname); +@@ -713,6 +716,8 @@ main (int argc, char *argv[]) + free (efiimgfat); + free (efidir_efi); + free (efidir); ++ grub_install_pop_module (); ++ grub_install_pop_module (); + } + + grub_install_push_module ("part_apple"); +-- +2.4.3 + diff --git a/0177-efidisk-Return-the-determined-root-disk-even-if-part.patch b/0177-efidisk-Return-the-determined-root-disk-even-if-part.patch new file mode 100644 index 0000000..33bc3e8 --- /dev/null +++ b/0177-efidisk-Return-the-determined-root-disk-even-if-part.patch @@ -0,0 +1,52 @@ +From 7d027b4d3e632b0a3a81dd1f31012a80f7746b74 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 19:53:13 +0100 +Subject: [PATCH 177/506] efidisk: Return the determined root disk even if + partition is unknown. + +--- + grub-core/disk/efi/efidisk.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index 3b12c34..60a6d3c 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -803,7 +803,6 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE + || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)) + { +- int is_cdrom = 0; + struct grub_efidisk_get_device_name_ctx ctx; + char *dev_name; + grub_efi_device_path_t *dup_dp; +@@ -824,9 +823,6 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + || GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) + break; + +- if (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE) +- is_cdrom = 1; +- + dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + dup_ldp->length = sizeof (*dup_ldp); +@@ -861,10 +857,13 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + + if (! ctx.partition_name) + { ++ /* No partition found. In most cases partition is embed in ++ the root path anyway, so this is not critical. ++ This happens only if partition is on partmap that GRUB ++ doesn't need to access root. ++ */ + grub_disk_close (parent); +- if (is_cdrom) +- return grub_strdup (device_name); +- return 0; ++ return grub_strdup (device_name); + } + + dev_name = grub_xasprintf ("%s,%s", parent->name, +-- +2.4.3 + diff --git a/0178-Makefile.am-Fix-Changelog-cutoff-address.patch b/0178-Makefile.am-Fix-Changelog-cutoff-address.patch new file mode 100644 index 0000000..050e2a1 --- /dev/null +++ b/0178-Makefile.am-Fix-Changelog-cutoff-address.patch @@ -0,0 +1,27 @@ +From 14c9a720397e6674c8c46e2e0697c2bf2a7132ae Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:12:51 +0100 +Subject: [PATCH 178/506] Makefile.am: Fix Changelog cutoff address. + +gitlog-to-changelog Doesn't generate entries for cutoff day, only +for days after the cutoff date, adjust by one to compensate. +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index df0a728..a232eb1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -440,7 +440,7 @@ windowszip: windowsdir + + EXTRA_DIST += linguas.sh + +-changelog_start_date = 2015-01-24 ++changelog_start_date = 2015-01-23 + gitlog_to_changelog = $(top_srcdir)/build-aux/gitlog-to-changelog + + ChangeLog: FORCE +-- +2.4.3 + diff --git a/0179-Generate-empty-ChangeLog-if-no-.git-is-available.patch b/0179-Generate-empty-ChangeLog-if-no-.git-is-available.patch new file mode 100644 index 0000000..38b7287 --- /dev/null +++ b/0179-Generate-empty-ChangeLog-if-no-.git-is-available.patch @@ -0,0 +1,30 @@ +From b8f537199a64c7aef68ed39e037f52e9bb629cfc Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:14:59 +0100 +Subject: [PATCH 179/506] Generate empty ChangeLog if no .git is available. + +When making dist from a git snapshot without repo available make dist would +fail to find ChangeLog. Generate empty ChangeLog if no ChangeLog is already +present and repo is not available. + +Reported by: Andrei Borzenkov +--- + Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.am b/Makefile.am +index a232eb1..f702951 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -447,6 +447,8 @@ ChangeLog: FORCE + if test -d $(top_srcdir)/.git; then \ + $(gitlog_to_changelog) --srcdir=$(top_srcdir) --since=$(changelog_start_date) > '$@.tmp'; \ + rm -f '$@'; mv '$@.tmp' '$@'; \ ++ else \ ++ touch $@; \ + fi + + EXTRA_DIST += ChangeLog ChangeLog-2015 +-- +2.4.3 + diff --git a/0180-Always-add-msoft-float-to-avoid-compiler-generating-.patch b/0180-Always-add-msoft-float-to-avoid-compiler-generating-.patch new file mode 100644 index 0000000..2ea6e1d --- /dev/null +++ b/0180-Always-add-msoft-float-to-avoid-compiler-generating-.patch @@ -0,0 +1,30 @@ +From 3661261fe17a8fe19681073889b5b36ec1ee823d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:37:08 +0100 +Subject: [PATCH 180/506] Always add -msoft-float to avoid compiler generating + float arithmetics. + +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index fdddbad..b734dd0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -671,6 +671,12 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p + TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow" + fi + ++# GRUB doesn't use float or doubles at all. Yet some toolchains may decide ++# 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. ++TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float" ++ + # By default, GCC 4.4 generates .eh_frame sections containing unwind + # information in some cases where it previously did not. GRUB doesn't need + # these and they just use up vital space. Restore the old compiler +-- +2.4.3 + diff --git a/0181-uhci-Fix-null-pointer-dereference.patch b/0181-uhci-Fix-null-pointer-dereference.patch new file mode 100644 index 0000000..d4c4fa3 --- /dev/null +++ b/0181-uhci-Fix-null-pointer-dereference.patch @@ -0,0 +1,28 @@ +From 9ff9d5a54ead6fba080a08fcb1ff8462b8cf2497 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:38:12 +0100 +Subject: [PATCH 181/506] uhci: Fix null pointer dereference. + +Found by: Coverity scan. +--- + grub-core/bus/usb/uhci.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/grub-core/bus/usb/uhci.c b/grub-core/bus/usb/uhci.c +index a95fdfe..7c5811f 100644 +--- a/grub-core/bus/usb/uhci.c ++++ b/grub-core/bus/usb/uhci.c +@@ -625,9 +625,7 @@ grub_uhci_check_transfer (grub_usb_controller_t dev, + return GRUB_USB_ERR_NONE; + } + +- grub_dprintf ("uhci", "t status=0x%02x\n", errtd->ctrl_status); +- +- if (!(errtd->ctrl_status & (1 << 23))) ++ if (errtd && !(errtd->ctrl_status & (1 << 23))) + { + grub_usb_err_t err = GRUB_USB_ERR_NONE; + +-- +2.4.3 + diff --git a/0182-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch b/0182-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch new file mode 100644 index 0000000..00fa305 --- /dev/null +++ b/0182-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch @@ -0,0 +1,38 @@ +From e902163e484523698f1cc4f06b64830f30909153 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:41:43 +0100 +Subject: [PATCH 182/506] commands/acpi: Use ALIGN_UP rather than manual + expression. + +Improves readability and hopefully automatic scanning. + +Found by: Coverity Scan. +--- + grub-core/commands/acpi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c +index 97c2cf2..f66fa2d 100644 +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -227,7 +227,7 @@ grub_acpi_create_ebda (void) + grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + v2inebda = target; + target += v2->length; +- target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); ++ target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + v2 = 0; + break; + } +@@ -246,7 +246,7 @@ grub_acpi_create_ebda (void) + grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); + v1inebda = target; + target += sizeof (struct grub_acpi_rsdp_v10); +- target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); ++ target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + v1 = 0; + break; + } +-- +2.4.3 + diff --git a/0183-commands-file-Change-the-confusing-loop-stop-conditi.patch b/0183-commands-file-Change-the-confusing-loop-stop-conditi.patch new file mode 100644 index 0000000..0fc2a68 --- /dev/null +++ b/0183-commands-file-Change-the-confusing-loop-stop-conditi.patch @@ -0,0 +1,48 @@ +From b04c6d32ce816c5d8943c767bb4cc7e56aa3c1c5 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:45:25 +0100 +Subject: [PATCH 183/506] commands/file: Change the confusing loop stop + condition. + +Old condition was used to zero-out header variable on exit of the loop. +This is correct but confusing. Replace with in-loop logic. + +Found by: Coverity Scan. +--- + grub-core/commands/file.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c +index 42d62d4..12fba99 100644 +--- a/grub-core/commands/file.c ++++ b/grub-core/commands/file.c +@@ -476,8 +476,8 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) + be at least 12 bytes and aligned on a 4-byte boundary. */ + for (header = buffer; + ((char *) header <= +- (char *) buffer + len - (type == IS_MULTIBOOT2 ? 16 : 12)) +- || (header = 0); header += step) ++ (char *) buffer + len - (type == IS_MULTIBOOT2 ? 16 : 12)); ++ header += step) + { + if (header[0] == magic + && !(grub_le_to_cpu32 (header[0]) +@@ -485,11 +485,12 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) + + grub_le_to_cpu32 (header[2]) + + (type == IS_MULTIBOOT2 + ? grub_le_to_cpu32 (header[3]) : 0))) +- break; ++ { ++ ret = 1; ++ break; ++ } + } + +- if (header != 0) +- ret = 1; + grub_free (buffer); + break; + } +-- +2.4.3 + diff --git a/0184-commands-fileXX-Fix-memory-leak.patch b/0184-commands-fileXX-Fix-memory-leak.patch new file mode 100644 index 0000000..aa439ca --- /dev/null +++ b/0184-commands-fileXX-Fix-memory-leak.patch @@ -0,0 +1,48 @@ +From 95a8c9182bc8ab25cbd62424f28a32432f823698 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:50:35 +0100 +Subject: [PATCH 184/506] commands/fileXX: Fix memory leak. + +Found by: Coverity Scan. +--- + grub-core/commands/fileXX.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/grub-core/commands/fileXX.c b/grub-core/commands/fileXX.c +index 58e1094..7743f3e 100644 +--- a/grub-core/commands/fileXX.c ++++ b/grub-core/commands/fileXX.c +@@ -40,10 +40,10 @@ grub_file_check_netbsdXX (grub_elf_t elf) + return 0; + + if (grub_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (grub_off_t) -1) +- return 0; ++ goto fail; + + if (grub_file_read (elf->file, s0, shsize) != (grub_ssize_t) shsize) +- return 0; ++ goto fail; + + s = (Elf_Shdr *) ((char *) s0 + elf->ehdr.ehdrXX.e_shstrndx * shentsize); + stroff = s->sh_offset; +@@ -59,13 +59,16 @@ grub_file_check_netbsdXX (grub_elf_t elf) + if (grub_file_read (elf->file, name, sizeof (name)) != (grub_ssize_t) sizeof (name)) + { + if (grub_errno) +- return grub_errno; ++ goto fail; + continue; + } + if (grub_memcmp (name, ".note.netbsd.ident", + sizeof(".note.netbsd.ident")) != 0) + continue; ++ grub_free (s0); + return 1; + } ++ fail: ++ grub_free (s0); + return 0; + } +-- +2.4.3 + diff --git a/0185-gptsync-Add-missing-device_close.patch b/0185-gptsync-Add-missing-device_close.patch new file mode 100644 index 0000000..9256ab2 --- /dev/null +++ b/0185-gptsync-Add-missing-device_close.patch @@ -0,0 +1,26 @@ +From 9d999852a223b9b00b5f417cb49d3334773408d8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:52:02 +0100 +Subject: [PATCH 185/506] gptsync: Add missing device_close. + +Found by: Coverity scan +--- + grub-core/commands/gptsync.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/commands/gptsync.c b/grub-core/commands/gptsync.c +index 16592e9..444e248 100644 +--- a/grub-core/commands/gptsync.c ++++ b/grub-core/commands/gptsync.c +@@ -235,6 +235,8 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), + return grub_errno; + } + ++ grub_device_close (dev); ++ + grub_printf_ (N_("New MBR is written to `%s'\n"), args[0]); + + return GRUB_ERR_NONE; +-- +2.4.3 + diff --git a/0186-commands-hdparm-Add-missing-grub_disk_close.patch b/0186-commands-hdparm-Add-missing-grub_disk_close.patch new file mode 100644 index 0000000..1d37b10 --- /dev/null +++ b/0186-commands-hdparm-Add-missing-grub_disk_close.patch @@ -0,0 +1,25 @@ +From 68cf24376c531ee468615a84aa361e2a6e0406a9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:55:06 +0100 +Subject: [PATCH 186/506] commands/hdparm: Add missing grub_disk_close. + +Found by: Coverity scan. +--- + grub-core/commands/hdparm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c +index 3fb0891..f6b178e 100644 +--- a/grub-core/commands/hdparm.c ++++ b/grub-core/commands/hdparm.c +@@ -329,6 +329,7 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) + break; + } + default: ++ grub_disk_close (disk); + return grub_error (GRUB_ERR_IO, "not an ATA device"); + } + +-- +2.4.3 + diff --git a/0187-zfs-Fix-disk-matching-logic.patch b/0187-zfs-Fix-disk-matching-logic.patch new file mode 100644 index 0000000..8762737 --- /dev/null +++ b/0187-zfs-Fix-disk-matching-logic.patch @@ -0,0 +1,68 @@ +From 12a9c52e516b94888db0a4502946242e3b14709f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 20:57:26 +0100 +Subject: [PATCH 187/506] zfs: Fix disk-matching logic. + +Reported by: Tim Chase +--- + grub-core/fs/zfs/zfs.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index c943b52..c8c7b97 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -252,7 +252,6 @@ struct grub_zfs_data + + uberblock_t current_uberblock; + +- int mounted; + grub_uint64_t guid; + }; + +@@ -957,7 +956,7 @@ nvpair_value (const char *nvp,char **val, + static grub_err_t + check_pool_label (struct grub_zfs_data *data, + struct grub_zfs_device_desc *diskdesc, +- int *inserted) ++ int *inserted, int original) + { + grub_uint64_t pool_state, txg = 0; + char *nvlist,*features; +@@ -1081,11 +1080,12 @@ check_pool_label (struct grub_zfs_data *data, + + grub_dprintf ("zfs", "check 11 passed\n"); + +- if (data->mounted && data->guid != poolguid) +- return grub_error (GRUB_ERR_BAD_FS, "another zpool"); +- else ++ if (original) + data->guid = poolguid; + ++ if (data->guid != poolguid) ++ return grub_error (GRUB_ERR_BAD_FS, "another zpool"); ++ + { + char *nv; + nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); +@@ -1186,7 +1186,7 @@ scan_disk (grub_device_t dev, struct grub_zfs_data *data, + } + grub_dprintf ("zfs", "label ok %d\n", label); + +- err = check_pool_label (data, &desc, inserted); ++ err = check_pool_label (data, &desc, inserted, original); + if (err || !*inserted) + { + grub_errno = GRUB_ERR_NONE; +@@ -3612,8 +3612,6 @@ zfs_mount (grub_device_t dev) + ub_endian) >> 63) & 1; + grub_free (osp); + +- data->mounted = 1; +- + return data; + } + +-- +2.4.3 + diff --git a/0188-commands-legacycfg-Fix-resource-leaks.patch b/0188-commands-legacycfg-Fix-resource-leaks.patch new file mode 100644 index 0000000..bc404e8 --- /dev/null +++ b/0188-commands-legacycfg-Fix-resource-leaks.patch @@ -0,0 +1,65 @@ +From f579f097bbf37d0ec23acb1434f2f1a38f266594 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:06:23 +0100 +Subject: [PATCH 188/506] commands/legacycfg: Fix resource leaks. + +--- + grub-core/commands/legacycfg.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c +index 2c09fb7..d42d777 100644 +--- a/grub-core/commands/legacycfg.c ++++ b/grub-core/commands/legacycfg.c +@@ -57,14 +57,20 @@ legacy_file (const char *filename) + + file = grub_file_open (filename); + if (! file) +- return grub_errno; ++ { ++ grub_free (suffix); ++ return grub_errno; ++ } + + menu = grub_env_get_menu (); + if (! menu) + { + menu = grub_zalloc (sizeof (*menu)); + if (! menu) +- return grub_errno; ++ { ++ grub_free (suffix); ++ return grub_errno; ++ } + + grub_env_set_menu (menu); + } +@@ -77,6 +83,7 @@ legacy_file (const char *filename) + if (!buf && grub_errno) + { + grub_file_close (file); ++ grub_free (suffix); + return grub_errno; + } + +@@ -173,6 +180,8 @@ legacy_file (const char *filename) + if (!args) + { + grub_file_close (file); ++ grub_free (suffix); ++ grub_free (entrysrc); + return grub_errno; + } + args[0] = entryname; +@@ -376,6 +385,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), + if (part && grub_strcmp (part->partmap->name, "msdos") == 0) + bsd_slice = part->number; + } ++ if (dev) ++ grub_device_close (dev); + } + + /* k*BSD didn't really work well with grub-legacy. */ +-- +2.4.3 + diff --git a/0189-commands-macbless-Remove-incorrect-grub_free.patch b/0189-commands-macbless-Remove-incorrect-grub_free.patch new file mode 100644 index 0000000..6027e9e --- /dev/null +++ b/0189-commands-macbless-Remove-incorrect-grub_free.patch @@ -0,0 +1,25 @@ +From 09e84f188b6e18acf7ae2d3d82d798d92c35d7a5 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:08:50 +0100 +Subject: [PATCH 189/506] commands/macbless: Remove incorrect grub_free. + +Found by: Coverity Scan +--- + grub-core/commands/macbless.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c +index 4724edd..cf90eea 100644 +--- a/grub-core/commands/macbless.c ++++ b/grub-core/commands/macbless.c +@@ -203,7 +203,6 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args) + grub_device_close (dev); + + grub_free (device_name); +- grub_free (path); + + return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); + } +-- +2.4.3 + diff --git a/0190-commands-macbless-Fix-potential-overflow.patch b/0190-commands-macbless-Fix-potential-overflow.patch new file mode 100644 index 0000000..ba3ea13 --- /dev/null +++ b/0190-commands-macbless-Fix-potential-overflow.patch @@ -0,0 +1,29 @@ +From e3b3e53f72647fa189ae245d73dc560166bb57d3 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:12:02 +0100 +Subject: [PATCH 190/506] commands/macbless: Fix potential overflow. + +Is a minor concern as no such FS would be created under normal circumstances +and failure was benign. + +Found by: Coverity scan. +--- + grub-core/commands/macbless.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c +index cf90eea..f9e01b6 100644 +--- a/grub-core/commands/macbless.c ++++ b/grub-core/commands/macbless.c +@@ -106,7 +106,7 @@ grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir, + ablk_size = grub_be_to_cpu32 (volheader.hfs.blksz); + ablk_start = grub_be_to_cpu16 (volheader.hfs.first_block); + embedded_offset = (ablk_start +- + extent_start ++ + ((grub_uint64_t) extent_start) + * (ablk_size >> GRUB_DISK_SECTOR_BITS)); + + err = +-- +2.4.3 + diff --git a/0191-commands-macbless-Handle-device-opening-errors-corre.patch b/0191-commands-macbless-Handle-device-opening-errors-corre.patch new file mode 100644 index 0000000..32b0e1a --- /dev/null +++ b/0191-commands-macbless-Handle-device-opening-errors-corre.patch @@ -0,0 +1,38 @@ +From 72bbd8046a55f4a7995535696f375e465ccb0237 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:15:14 +0100 +Subject: [PATCH 191/506] commands/macbless: Handle device opening errors + correctly. + +Wrong variable was checked for errors. + +Found by: Coverity scan. +--- + grub-core/commands/macbless.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c +index f9e01b6..18efa1a 100644 +--- a/grub-core/commands/macbless.c ++++ b/grub-core/commands/macbless.c +@@ -183,7 +183,7 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args) + { + char *device_name; + char *path = 0; +- grub_device_t dev; ++ grub_device_t dev = 0; + grub_err_t err; + + if (argc != 1) +@@ -197,7 +197,7 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args) + else + path = path + 1; + +- if (!path || *path == 0 || !device_name) ++ if (!path || *path == 0 || !dev) + { + if (dev) + grub_device_close (dev); +-- +2.4.3 + diff --git a/0192-commands-nativedisk-Add-missing-device_close.patch b/0192-commands-nativedisk-Add-missing-device_close.patch new file mode 100644 index 0000000..32fd904 --- /dev/null +++ b/0192-commands-nativedisk-Add-missing-device_close.patch @@ -0,0 +1,33 @@ +From bd50aa323d30d064563c213ab7ee8b8846981609 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:18:36 +0100 +Subject: [PATCH 192/506] commands/nativedisk: Add missing device_close. + +Found by: Coverity scan. +--- + grub-core/commands/nativedisk.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/commands/nativedisk.c b/grub-core/commands/nativedisk.c +index 33b6b99..b3bc463 100644 +--- a/grub-core/commands/nativedisk.c ++++ b/grub-core/commands/nativedisk.c +@@ -57,6 +57,7 @@ get_uuid (const char *name, char **uuid, int getnative) + if (!dev->disk) + { + grub_dprintf ("nativedisk", "Skipping non-disk\n"); ++ grub_device_close (dev); + return 0; + } + +@@ -90,6 +91,7 @@ get_uuid (const char *name, char **uuid, int getnative) + case GRUB_DISK_DEVICE_MEMDISK_ID: + grub_dprintf ("nativedisk", "Skipping native disk %s\n", + dev->disk->name); ++ grub_device_close (dev); + return 0; + + /* FIXME: those probably need special handling. */ +-- +2.4.3 + diff --git a/0193-commands-parttool-Add-missing-device-close.patch b/0193-commands-parttool-Add-missing-device-close.patch new file mode 100644 index 0000000..683bf54 --- /dev/null +++ b/0193-commands-parttool-Add-missing-device-close.patch @@ -0,0 +1,39 @@ +From 4947f11b09184806cbfda7ebb2ae25df25be6693 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:22:02 +0100 +Subject: [PATCH 193/506] commands/parttool: Add missing device close. + +Found by: Coverity scan. +--- + grub-core/commands/parttool.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c +index a47ff07..d907694 100644 +--- a/grub-core/commands/parttool.c ++++ b/grub-core/commands/parttool.c +@@ -243,11 +243,19 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), + } + + if (argc == 1) +- return show_help (dev); ++ { ++ err = show_help (dev); ++ grub_device_close (dev); ++ return err; ++ } + + for (i = 1; i < argc; i++) + if (grub_strcmp (args[i], "help") == 0) +- return show_help (dev); ++ { ++ err = show_help (dev); ++ grub_device_close (dev); ++ return err; ++ } + + parsed = (int *) grub_zalloc (argc * sizeof (int)); + +-- +2.4.3 + diff --git a/0194-commands-syslinux-Add-missing-free.patch b/0194-commands-syslinux-Add-missing-free.patch new file mode 100644 index 0000000..096b3cf --- /dev/null +++ b/0194-commands-syslinux-Add-missing-free.patch @@ -0,0 +1,29 @@ +From fbae51dcea91bf5b8d1f11a436867f933d370346 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:23:25 +0100 +Subject: [PATCH 194/506] commands/syslinux: Add missing free. + +Found by: Coverity scan. +--- + grub-core/commands/syslinuxcfg.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/syslinuxcfg.c b/grub-core/commands/syslinuxcfg.c +index 00ae113..7be28fa 100644 +--- a/grub-core/commands/syslinuxcfg.c ++++ b/grub-core/commands/syslinuxcfg.c +@@ -119,7 +119,10 @@ syslinux_file (grub_extcmd_context_t ctxt, const char *filename) + { + menu = grub_zalloc (sizeof (*menu)); + if (! menu) +- return grub_errno; ++ { ++ grub_free (result); ++ return grub_errno; ++ } + + grub_env_set_menu (menu); + } +-- +2.4.3 + diff --git a/0195-commands-tr-Simplify-and-fix-missing-parameter-test.patch b/0195-commands-tr-Simplify-and-fix-missing-parameter-test.patch new file mode 100644 index 0000000..259019a --- /dev/null +++ b/0195-commands-tr-Simplify-and-fix-missing-parameter-test.patch @@ -0,0 +1,26 @@ +From 6079e67926079d4b3ca35aa570eee2c0f4459f04 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:25:42 +0100 +Subject: [PATCH 195/506] commands/tr: Simplify and fix missing parameter test. + +Found by: Coverity scan +--- + grub-core/commands/tr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/tr.c b/grub-core/commands/tr.c +index 84ad6ff..ef72841 100644 +--- a/grub-core/commands/tr.c ++++ b/grub-core/commands/tr.c +@@ -80,7 +80,7 @@ grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args) + } else if (argc > 3) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many parameters"); + +- if (argc <= 0 && (!s1 || !s2 || !input)) ++ if (!s1 || !s2 || !input) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing parameters"); + + if (grub_strlen (s1) != grub_strlen (s2)) +-- +2.4.3 + diff --git a/0196-commands-verify-Fix-sha1-context-zeroing-out.patch b/0196-commands-verify-Fix-sha1-context-zeroing-out.patch new file mode 100644 index 0000000..d3118c4 --- /dev/null +++ b/0196-commands-verify-Fix-sha1-context-zeroing-out.patch @@ -0,0 +1,27 @@ +From 37ba761b1cba6e210fa451a7f3dbd6e3dab58a65 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:27:10 +0100 +Subject: [PATCH 196/506] commands/verify: Fix sha1 context zeroing-out. + +Current code doesn't zero-out context completely. It's a minor issue +really as sha1 init already takes care of initing the context. +--- + grub-core/commands/verify.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c +index d599576..6569391 100644 +--- a/grub-core/commands/verify.c ++++ b/grub-core/commands/verify.c +@@ -308,7 +308,7 @@ grub_load_public_key (grub_file_t f) + if (!sk) + goto fail; + +- grub_memset (fingerprint_context, 0, sizeof (fingerprint_context)); ++ grub_memset (fingerprint_context, 0, GRUB_MD_SHA1->contextsize); + GRUB_MD_SHA1->init (fingerprint_context); + GRUB_MD_SHA1->write (fingerprint_context, "\x99", 1); + len_be = grub_cpu_to_be16 (len); +-- +2.4.3 + diff --git a/0197-commands-wildcard-Add-missing-free.patch b/0197-commands-wildcard-Add-missing-free.patch new file mode 100644 index 0000000..5df1772 --- /dev/null +++ b/0197-commands-wildcard-Add-missing-free.patch @@ -0,0 +1,29 @@ +From 3b1b39c08234ba856ec89748f379bac7c710e11a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:29:19 +0100 +Subject: [PATCH 197/506] commands/wildcard: Add missing free. + +Found by: Coverity scan. +--- + grub-core/commands/wildcard.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c +index 2807f80..d207acf 100644 +--- a/grub-core/commands/wildcard.c ++++ b/grub-core/commands/wildcard.c +@@ -245,7 +245,10 @@ match_devices_iter (const char *name, void *data) + + t = grub_realloc (ctx->devs, sizeof (char*) * (ctx->ndev + 2)); + if (! t) +- return 1; ++ { ++ grub_free (buffer); ++ return 1; ++ } + + ctx->devs = t; + ctx->devs[ctx->ndev++] = buffer; +-- +2.4.3 + diff --git a/0198-disk-AFsplitter-check-argument-validity-before-doing.patch b/0198-disk-AFsplitter-check-argument-validity-before-doing.patch new file mode 100644 index 0000000..5a23d88 --- /dev/null +++ b/0198-disk-AFsplitter-check-argument-validity-before-doing.patch @@ -0,0 +1,37 @@ +From 7d973359427394a00d1d8778b352b67c9ff486d6 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:33:30 +0100 +Subject: [PATCH 198/506] disk/AFsplitter: check argument validity before doing + any allocs. + +This avoids possible memory leaks. + +Found by: Coverity scan. +--- + grub-core/disk/AFSplitter.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/disk/AFSplitter.c b/grub-core/disk/AFSplitter.c +index 7e1bd57..f5a8ddc 100644 +--- a/grub-core/disk/AFSplitter.c ++++ b/grub-core/disk/AFSplitter.c +@@ -72,13 +72,13 @@ AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, grub_uint8_t * dst, + grub_size_t i; + grub_uint8_t *bufblock; + ++ if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN || hash->mdlen == 0) ++ return GPG_ERR_INV_ARG; ++ + bufblock = grub_zalloc (blocksize); + if (bufblock == NULL) + return GPG_ERR_OUT_OF_MEMORY; + +- if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN || hash->mdlen == 0) +- return GPG_ERR_INV_ARG; +- + grub_memset (bufblock, 0, blocksize); + for (i = 0; i < blocknumbers - 1; i++) + { +-- +2.4.3 + diff --git a/0199-disk-ahci-Fix-device_map_range-argument.patch b/0199-disk-ahci-Fix-device_map_range-argument.patch new file mode 100644 index 0000000..76d5d11 --- /dev/null +++ b/0199-disk-ahci-Fix-device_map_range-argument.patch @@ -0,0 +1,28 @@ +From 2a8200bba8d6372fdb2ffb38240542795084f7d8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:37:28 +0100 +Subject: [PATCH 199/506] disk/ahci: Fix device_map_range argument. + +Argument is not used on x86, hence it's gone unnoticed. + +Found by: Coverity scan. +--- + grub-core/disk/ahci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index 89365cd..d6bdbdd 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -198,7 +198,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + | GRUB_PCI_COMMAND_MEM_ENABLED); + + hba = grub_pci_device_map_range (dev, bar & GRUB_PCI_ADDR_MEM_MASK, +- sizeof (hba)); ++ sizeof (*hba)); + grub_dprintf ("ahci", "dev: %x:%x.%x\n", dev.bus, dev.device, dev.function); + + grub_dprintf ("ahci", "tfd[0]: %x\n", +-- +2.4.3 + diff --git a/0200-disk-cryptodisk-Add-missing-error-check.patch b/0200-disk-cryptodisk-Add-missing-error-check.patch new file mode 100644 index 0000000..fc394c8 --- /dev/null +++ b/0200-disk-cryptodisk-Add-missing-error-check.patch @@ -0,0 +1,35 @@ +From 4c7337bfe9082c2a005a10ce6dd98293e707943c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:38:22 +0100 +Subject: [PATCH 200/506] disk/cryptodisk: Add missing error check. + +Found by: Coverity scan. +--- + grub-core/disk/cryptodisk.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c +index f0e3a90..376ab83 100644 +--- a/grub-core/disk/cryptodisk.c ++++ b/grub-core/disk/cryptodisk.c +@@ -372,11 +372,13 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, + break; + case GRUB_CRYPTODISK_MODE_ECB: + if (do_encrypt) +- grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i, +- (1U << dev->log_sector_size)); ++ err = grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i, ++ (1U << dev->log_sector_size)); + else +- grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i, +- (1U << dev->log_sector_size)); ++ err = grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i, ++ (1U << dev->log_sector_size)); ++ if (err) ++ return err; + break; + default: + return GPG_ERR_NOT_IMPLEMENTED; +-- +2.4.3 + diff --git a/0201-disk-diskfilter-Add-missing-lv-presence-check.patch b/0201-disk-diskfilter-Add-missing-lv-presence-check.patch new file mode 100644 index 0000000..5500d39 --- /dev/null +++ b/0201-disk-diskfilter-Add-missing-lv-presence-check.patch @@ -0,0 +1,26 @@ +From f2baeb194be2f08e9281115df514cd3ceeba6110 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:44:27 +0100 +Subject: [PATCH 201/506] disk/diskfilter: Add missing lv presence check. + +Found by: Coverity scan. +--- + grub-core/disk/diskfilter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index 97ca546..6124846 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -1065,7 +1065,7 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + array->lvs->segments->extent_count = totsize; + } + +- if (array->lvs->segments ++ if (array->lvs && array->lvs->segments + && array->lvs->segments->raid_member_size > disk_size) + array->lvs->segments->raid_member_size = disk_size; + +-- +2.4.3 + diff --git a/0202-disk-geli-Add-missing-seek-success-check.patch b/0202-disk-geli-Add-missing-seek-success-check.patch new file mode 100644 index 0000000..51e5888 --- /dev/null +++ b/0202-disk-geli-Add-missing-seek-success-check.patch @@ -0,0 +1,27 @@ +From 6f43e350ed1d122a35c6b1880f6e1756455f0a6c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:46:23 +0100 +Subject: [PATCH 202/506] disk/geli: Add missing seek success check. + +Found by: Coverity scan. +--- + grub-core/disk/geli.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c +index 4ed07bb..bf73fbd 100644 +--- a/grub-core/disk/geli.c ++++ b/grub-core/disk/geli.c +@@ -212,7 +212,8 @@ grub_util_get_geli_uuid (const char *dev) + + s = grub_util_get_fd_size (fd, dev, &log_secsize); + s >>= log_secsize; +- grub_util_fd_seek (fd, (s << log_secsize) - 512); ++ if (grub_util_fd_seek (fd, (s << log_secsize) - 512) < 0) ++ grub_util_error ("%s", _("couldn't read ELI metadata")); + + uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1); + if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0) +-- +2.4.3 + diff --git a/0203-disk-geli-Add-missing-free.patch b/0203-disk-geli-Add-missing-free.patch new file mode 100644 index 0000000..cbb9723 --- /dev/null +++ b/0203-disk-geli-Add-missing-free.patch @@ -0,0 +1,29 @@ +From 7656b72b17c3bf12a3e2173fc04aebf67b286983 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:47:51 +0100 +Subject: [PATCH 203/506] disk/geli: Add missing free. + +Found by: Coverity scan. +--- + grub-core/disk/geli.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c +index bf73fbd..e9d2329 100644 +--- a/grub-core/disk/geli.c ++++ b/grub-core/disk/geli.c +@@ -232,7 +232,10 @@ grub_util_get_geli_uuid (const char *dev) + + err = make_uuid ((void *) &hdr, uuid); + if (err) +- return NULL; ++ { ++ grub_free (uuid); ++ return NULL; ++ } + + return uuid; + } +-- +2.4.3 + diff --git a/0204-biosdisk-Add-missing-cast.patch b/0204-biosdisk-Add-missing-cast.patch new file mode 100644 index 0000000..99cc31e --- /dev/null +++ b/0204-biosdisk-Add-missing-cast.patch @@ -0,0 +1,37 @@ +From d1130afa5f22e4fee75ab55f11e16e0fbd98597d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:50:30 +0100 +Subject: [PATCH 204/506] biosdisk: Add missing cast. + +Found by: Coverity scan. +--- + grub-core/disk/i386/pc/biosdisk.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c +index 26a4973..f0aadd1 100644 +--- a/grub-core/disk/i386/pc/biosdisk.c ++++ b/grub-core/disk/i386/pc/biosdisk.c +@@ -382,7 +382,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) + /* Some buggy BIOSes doesn't return the total sectors + correctly but returns zero. So if it is zero, compute + it by C/H/S returned by the LBA BIOS call. */ +- total_sectors = drp->cylinders * drp->heads * drp->sectors; ++ total_sectors = ((grub_uint64_t) drp->cylinders) ++ * drp->heads * drp->sectors; + if (drp->bytes_per_sector + && !(drp->bytes_per_sector & (drp->bytes_per_sector - 1)) + && drp->bytes_per_sector >= 512 +@@ -425,7 +426,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) + data->heads = 255; + + if (! total_sectors) +- total_sectors = data->cylinders * data->heads * data->sectors; ++ total_sectors = ((grub_uint64_t) data->cylinders) ++ * data->heads * data->sectors; + } + + disk->total_sectors = total_sectors; +-- +2.4.3 + diff --git a/0205-font-Add-missing-free.patch b/0205-font-Add-missing-free.patch new file mode 100644 index 0000000..5d21dba --- /dev/null +++ b/0205-font-Add-missing-free.patch @@ -0,0 +1,25 @@ +From dd430afbf874f6212742c079d72b4b9e959e0542 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 24 Jan 2015 21:55:18 +0100 +Subject: [PATCH 205/506] font: Add missing free. + +Found by: Coverity Scan. +--- + grub-core/font/font.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/font/font.c b/grub-core/font/font.c +index 14b93e1..607964b 100644 +--- a/grub-core/font/font.c ++++ b/grub-core/font/font.c +@@ -777,6 +777,7 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) + if (grub_file_read (font->file, glyph->bitmap, len) != len) + { + remove_font (font); ++ grub_free (glyph); + return 0; + } + } +-- +2.4.3 + diff --git a/0206-fs-cbfs-Add-missing-free.patch b/0206-fs-cbfs-Add-missing-free.patch new file mode 100644 index 0000000..0ce76e2 --- /dev/null +++ b/0206-fs-cbfs-Add-missing-free.patch @@ -0,0 +1,34 @@ +From b6f21bcb98f03d61087b4423261bda5d6a58fb1f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 00:00:49 +0100 +Subject: [PATCH 206/506] fs/cbfs: Add missing free. + +Found by: Coverity scan. +--- + grub-core/fs/cbfs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c +index 35750a0..4ddd683 100644 +--- a/grub-core/fs/cbfs.c ++++ b/grub-core/fs/cbfs.c +@@ -144,7 +144,7 @@ static struct grub_archelp_data * + grub_cbfs_mount (grub_disk_t disk) + { + struct cbfs_file hd; +- struct grub_archelp_data *data; ++ struct grub_archelp_data *data = NULL; + grub_uint32_t ptr; + grub_off_t header_off; + struct cbfs_header head; +@@ -196,6 +196,7 @@ grub_cbfs_mount (grub_disk_t disk) + return data; + + fail: ++ grub_free (data); + grub_error (GRUB_ERR_BAD_FS, "not a cbfs filesystem"); + return 0; + } +-- +2.4.3 + diff --git a/0207-fs-cpio_common-Add-a-sanity-check-on-namesize.patch b/0207-fs-cpio_common-Add-a-sanity-check-on-namesize.patch new file mode 100644 index 0000000..eae56f7 --- /dev/null +++ b/0207-fs-cpio_common-Add-a-sanity-check-on-namesize.patch @@ -0,0 +1,32 @@ +From faad548ce3b906535acaeff95777b46836b817e6 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 00:11:59 +0100 +Subject: [PATCH 207/506] fs/cpio_common: Add a sanity check on namesize. + +Found by: Coverity scan. +--- + grub-core/fs/cpio_common.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/grub-core/fs/cpio_common.c b/grub-core/fs/cpio_common.c +index b0ae9f4..20230a7 100644 +--- a/grub-core/fs/cpio_common.c ++++ b/grub-core/fs/cpio_common.c +@@ -61,6 +61,14 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, + modeval = read_number (hd.mode, ARRAY_SIZE (hd.mode)); + namesize = read_number (hd.namesize, ARRAY_SIZE (hd.namesize)); + ++ /* Don't allow negative numbers. */ ++ if (namesize >= 0x80000000) ++ { ++ /* Probably a corruption, don't attempt to recover. */ ++ *mode = GRUB_ARCHELP_ATTR_END; ++ return GRUB_ERR_NONE; ++ } ++ + if (mode) + *mode = modeval; + +-- +2.4.3 + diff --git a/0208-fs-fat-Fix-codepath-to-properly-free-on-error.patch b/0208-fs-fat-Fix-codepath-to-properly-free-on-error.patch new file mode 100644 index 0000000..81f05fc --- /dev/null +++ b/0208-fs-fat-Fix-codepath-to-properly-free-on-error.patch @@ -0,0 +1,26 @@ +From 83543f937a3525ef577c5a6333cb6791aadcee3d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 01:27:44 +0100 +Subject: [PATCH 208/506] fs/fat: Fix codepath to properly free on error. + +Found by: Coverity scan. +--- + grub-core/fs/fat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c +index 79fe864..71537ff 100644 +--- a/grub-core/fs/fat.c ++++ b/grub-core/fs/fat.c +@@ -1136,7 +1136,7 @@ grub_fat_label (grub_device_t device, char **label) + if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); +- return 0; ++ goto fail; + } + + err = grub_fat_iterate_init (&ctxt); +-- +2.4.3 + diff --git a/0209-fs-hfs-hfs_open-Check-that-mount-succeeded.patch b/0209-fs-hfs-hfs_open-Check-that-mount-succeeded.patch new file mode 100644 index 0000000..0898ae9 --- /dev/null +++ b/0209-fs-hfs-hfs_open-Check-that-mount-succeeded.patch @@ -0,0 +1,30 @@ +From 4387ca78f0aada6ce04e4132e50f6b73fa60671f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 01:28:17 +0100 +Subject: [PATCH 209/506] fs/hfs/hfs_open: Check that mount succeeded. + +Found by: Coverity scan. +--- + grub-core/fs/hfs.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c +index f46f77a..ab472f4 100644 +--- a/grub-core/fs/hfs.c ++++ b/grub-core/fs/hfs.c +@@ -1306,6 +1306,12 @@ grub_hfs_open (struct grub_file *file, const char *name) + + data = grub_hfs_mount (file->device->disk); + ++ if (!data) ++ { ++ grub_dl_unref (my_mod); ++ return grub_errno; ++ } ++ + if (grub_hfs_find_dir (data, name, &frec, 0)) + { + grub_free (data); +-- +2.4.3 + diff --git a/0210-fs-hfs-Add-pointer-sanity-checks.patch b/0210-fs-hfs-Add-pointer-sanity-checks.patch new file mode 100644 index 0000000..7f3855c --- /dev/null +++ b/0210-fs-hfs-Add-pointer-sanity-checks.patch @@ -0,0 +1,63 @@ +From d0af2156c3b3e900956651523da17afff4969815 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 11:32:29 +0100 +Subject: [PATCH 210/506] fs/hfs: Add pointer sanity checks. + +Found by: Coverity scan. +--- + grub-core/fs/hfs.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c +index ab472f4..06cf0c7 100644 +--- a/grub-core/fs/hfs.c ++++ b/grub-core/fs/hfs.c +@@ -692,6 +692,7 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, + int i; + struct grub_hfs_extent *dat; + int blk; ++ grub_uint16_t reccnt; + + dat = (struct grub_hfs_extent *) (type == 0 + ? (&data->sblock.catalog_recs) +@@ -710,8 +711,12 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, + return grub_errno; + } + ++ reccnt = grub_be_to_cpu16 (node->node.reccnt); ++ if (reccnt > (nodesize >> 1)) ++ reccnt = (nodesize >> 1); ++ + /* Iterate over all records in this node. */ +- for (i = 0; i < grub_be_to_cpu16 (node->node.reccnt); i++) ++ for (i = 0; i < reccnt; i++) + { + int pos = (nodesize >> 1) - 1 - i; + struct pointer +@@ -719,16 +724,19 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, + grub_uint8_t keylen; + grub_uint8_t key; + } GRUB_PACKED *pnt; +- pnt = (struct pointer *) (grub_be_to_cpu16 (node->offsets[pos]) +- + node->rawnode); ++ grub_uint16_t off = grub_be_to_cpu16 (node->offsets[pos]); ++ if (off > nodesize - sizeof(*pnt)) ++ continue; ++ pnt = (struct pointer *) (off + node->rawnode); ++ if (nodesize < (grub_size_t) off + pnt->keylen + 1) ++ continue; + + struct grub_hfs_record rec = + { + &pnt->key, + pnt->keylen, + &pnt->key + pnt->keylen +(pnt->keylen + 1) % 2, +- nodesize - grub_be_to_cpu16 (node->offsets[pos]) +- - pnt->keylen - 1 ++ nodesize - off - pnt->keylen - 1 + }; + + if (node_hook (&node->node, &rec, hook_arg)) +-- +2.4.3 + diff --git a/0211-commands-fileXX-Fix-remaining-memory-leak.patch b/0211-commands-fileXX-Fix-remaining-memory-leak.patch new file mode 100644 index 0000000..a97de8d --- /dev/null +++ b/0211-commands-fileXX-Fix-remaining-memory-leak.patch @@ -0,0 +1,26 @@ +From fb66b512fa241c98b44ce6032e1d285d9d9f9aa3 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 25 Jan 2015 16:36:30 +0300 +Subject: [PATCH 211/506] commands/fileXX: Fix remaining memory leak. + +Found by: Coverity Scan. +--- + grub-core/commands/fileXX.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/fileXX.c b/grub-core/commands/fileXX.c +index 7743f3e..c17d26c 100644 +--- a/grub-core/commands/fileXX.c ++++ b/grub-core/commands/fileXX.c +@@ -54,7 +54,7 @@ grub_file_check_netbsdXX (grub_elf_t elf) + char name[sizeof(".note.netbsd.ident")]; + grub_memset (name, 0, sizeof (name)); + if (grub_file_seek (elf->file, stroff + s->sh_name) == (grub_off_t) -1) +- return grub_errno; ++ goto fail; + + if (grub_file_read (elf->file, name, sizeof (name)) != (grub_ssize_t) sizeof (name)) + { +-- +2.4.3 + diff --git a/0212-grub_iso9660_read-Explicitly-check-read_node-return-.patch b/0212-grub_iso9660_read-Explicitly-check-read_node-return-.patch new file mode 100644 index 0000000..1c0a588 --- /dev/null +++ b/0212-grub_iso9660_read-Explicitly-check-read_node-return-.patch @@ -0,0 +1,38 @@ +From ac602ce7005090a34e021f736a9ad3ac033a4cc8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:19:58 +0100 +Subject: [PATCH 212/506] grub_iso9660_read: Explicitly check read_node return + value. + +Not really needed as grub_errno is already checked but is nicer. + +Found by: Coverity scan. +--- + grub-core/fs/iso9660.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c +index 6a66773..67a67cf 100644 +--- a/grub-core/fs/iso9660.c ++++ b/grub-core/fs/iso9660.c +@@ -959,14 +959,15 @@ grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len) + { + struct grub_iso9660_data *data = + (struct grub_iso9660_data *) file->data; ++ grub_err_t err; + + /* XXX: The file is stored in as a single extent. */ + data->disk->read_hook = file->read_hook; + data->disk->read_hook_data = file->read_hook_data; +- read_node (data->node, file->offset, len, buf); ++ err = read_node (data->node, file->offset, len, buf); + data->disk->read_hook = NULL; + +- if (grub_errno) ++ if (err || grub_errno) + return -1; + + return len; +-- +2.4.3 + diff --git a/0213-fs-minix-Fix-sector-promotion-to-64-bit.patch b/0213-fs-minix-Fix-sector-promotion-to-64-bit.patch new file mode 100644 index 0000000..e92f8e3 --- /dev/null +++ b/0213-fs-minix-Fix-sector-promotion-to-64-bit.patch @@ -0,0 +1,100 @@ +From ca793e9c058dd1d08780e176ce5bcdeefa47a6be Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:21:32 +0100 +Subject: [PATCH 213/506] fs/minix: Fix sector promotion to 64-bit. + +While on it make GRUB_MINIX_ZONE2SECT into function. + +Found by: Coverity scan +--- + grub-core/fs/minix.c | 39 +++++++++++++++++++++++---------------- + 1 file changed, 23 insertions(+), 16 deletions(-) + +diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c +index 90ddd34..d451b34 100644 +--- a/grub-core/fs/minix.c ++++ b/grub-core/fs/minix.c +@@ -82,17 +82,6 @@ typedef grub_uint16_t grub_minix_ino_t; + #define GRUB_MINIX_INODE_DINDIR_ZONE(data) (grub_minix_to_cpu_n \ + (data->inode.double_indir_zone)) + +-#ifndef MODE_MINIX3 +-#define GRUB_MINIX_LOG2_ZONESZ (GRUB_MINIX_LOG2_BSIZE \ +- + grub_minix_to_cpu16 (data->sblock.log2_zone_size)) +-#endif +- +-#ifdef MODE_MINIX3 +-#define GRUB_MINIX_ZONE2SECT(zone) ((zone) * data->block_size) +-#else +-#define GRUB_MINIX_ZONE2SECT(zone) ((zone) << GRUB_MINIX_LOG2_ZONESZ) +-#endif +- + + #ifdef MODE_MINIX3 + struct grub_minix_sblock +@@ -182,15 +171,32 @@ static grub_dl_t my_mod; + static grub_err_t grub_minix_find_file (struct grub_minix_data *data, + const char *path); + ++#ifdef MODE_MINIX3 ++static inline grub_disk_addr_t ++grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone) ++{ ++ return ((grub_disk_addr_t) zone) * data->block_size; ++} ++#else ++static inline grub_disk_addr_t ++grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone) ++{ ++ int log2_zonesz = (GRUB_MINIX_LOG2_BSIZE ++ + grub_minix_to_cpu16 (data->sblock.log2_zone_size)); ++ return (((grub_disk_addr_t) zone) << log2_zonesz); ++} ++#endif ++ ++ + /* Read the block pointer in ZONE, on the offset NUM. */ + static grub_minix_uintn_t +-grub_get_indir (struct grub_minix_data *data, ++grub_get_indir (struct grub_minix_data *data, + grub_minix_uintn_t zone, + grub_minix_uintn_t num) + { + grub_minix_uintn_t indirn; + grub_disk_read (data->disk, +- GRUB_MINIX_ZONE2SECT(zone), ++ grub_minix_zone2sect(data, zone), + sizeof (grub_minix_uintn_t) * num, + sizeof (grub_minix_uintn_t), (char *) &indirn); + return grub_minix_to_cpu_n (indirn); +@@ -281,7 +287,7 @@ grub_minix_read_file (struct grub_minix_data *data, + + for (i = posblock; i < blockcnt; i++) + { +- grub_disk_addr_t blknr; ++ grub_minix_uintn_t blknr; + grub_uint64_t blockend = data->block_size << GRUB_DISK_SECTOR_BITS; + grub_off_t skipfirst = 0; + +@@ -310,7 +316,7 @@ grub_minix_read_file (struct grub_minix_data *data, + data->disk->read_hook = read_hook; + data->disk->read_hook_data = read_hook_data; + grub_disk_read (data->disk, +- GRUB_MINIX_ZONE2SECT(blknr), ++ grub_minix_zone2sect(data, blknr), + skipfirst, blockend, buf); + data->disk->read_hook = 0; + if (grub_errno) +@@ -336,7 +342,8 @@ grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino) + + /* The first inode in minix is inode 1. */ + ino--; +- block = GRUB_MINIX_ZONE2SECT (2 + grub_minix_to_cpu16 (sblock->inode_bmap_size) ++ block = grub_minix_zone2sect (data, ++ 2 + grub_minix_to_cpu16 (sblock->inode_bmap_size) + + grub_minix_to_cpu16 (sblock->zone_bmap_size)); + block += ino / (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix_inode)); + int offs = (ino % (GRUB_DISK_SECTOR_SIZE +-- +2.4.3 + diff --git a/0214-fs-ntfs-Add-missing-free.patch b/0214-fs-ntfs-Add-missing-free.patch new file mode 100644 index 0000000..0b551ec --- /dev/null +++ b/0214-fs-ntfs-Add-missing-free.patch @@ -0,0 +1,29 @@ +From bc0ecd7104b3420964364b7a01b7dd7141081b9b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:22:24 +0100 +Subject: [PATCH 214/506] fs/ntfs: Add missing free. + +Found by: Coverity scan. +--- + grub-core/fs/ntfs.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c +index d3a91f5..2cbcb0b 100644 +--- a/grub-core/fs/ntfs.c ++++ b/grub-core/fs/ntfs.c +@@ -618,7 +618,10 @@ list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos, + + ustr = get_utf8 (np, ns); + if (ustr == NULL) +- return 0; ++ { ++ grub_free (fdiro); ++ return 0; ++ } + if (namespace) + type |= GRUB_FSHELP_CASE_INSENSITIVE; + +-- +2.4.3 + diff --git a/0215-fs-ntfs-Add-sizes-sanity-checks.patch b/0215-fs-ntfs-Add-sizes-sanity-checks.patch new file mode 100644 index 0000000..f866849 --- /dev/null +++ b/0215-fs-ntfs-Add-sizes-sanity-checks.patch @@ -0,0 +1,34 @@ +From 157f9a9cca0990bf213e5041daaf4641c1764e09 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:28:50 +0100 +Subject: [PATCH 215/506] fs/ntfs: Add sizes sanity checks. + +Found by: Coverity scan. +--- + grub-core/fs/ntfs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c +index 2cbcb0b..6f84688 100644 +--- a/grub-core/fs/ntfs.c ++++ b/grub-core/fs/ntfs.c +@@ -920,12 +920,16 @@ grub_ntfs_mount (grub_disk_t disk) + + if (bpb.clusters_per_mft > 0) + data->mft_size = ((grub_disk_addr_t) bpb.clusters_per_mft) << data->log_spc; ++ else if (-bpb.clusters_per_mft < GRUB_NTFS_BLK_SHR || -bpb.clusters_per_mft >= 31) ++ goto fail; + else + data->mft_size = 1ULL << (-bpb.clusters_per_mft - GRUB_NTFS_BLK_SHR); + + if (bpb.clusters_per_index > 0) + data->idx_size = (((grub_disk_addr_t) bpb.clusters_per_index) + << data->log_spc); ++ else if (-bpb.clusters_per_index < GRUB_NTFS_BLK_SHR || -bpb.clusters_per_index >= 31) ++ goto fail; + else + data->idx_size = 1ULL << (-bpb.clusters_per_index - GRUB_NTFS_BLK_SHR); + +-- +2.4.3 + diff --git a/0216-fs-reiserfs-Fix-sector-count-overflow.patch b/0216-fs-reiserfs-Fix-sector-count-overflow.patch new file mode 100644 index 0000000..1a8dd86 --- /dev/null +++ b/0216-fs-reiserfs-Fix-sector-count-overflow.patch @@ -0,0 +1,26 @@ +From 8c1d08668974cc59f00e0cbc1c37c2f03e1a132e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:29:26 +0100 +Subject: [PATCH 216/506] fs/reiserfs: Fix sector count overflow. + +Found by: Coverity scan. +--- + grub-core/fs/reiserfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c +index de3d4fa..b781665 100644 +--- a/grub-core/fs/reiserfs.c ++++ b/grub-core/fs/reiserfs.c +@@ -1090,7 +1090,7 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, + switch (found.type) + { + case GRUB_REISERFS_DIRECT: +- block = found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS); ++ block = ((grub_disk_addr_t) found.block_number) * (block_size >> GRUB_DISK_SECTOR_BITS); + grub_dprintf ("reiserfs_blocktype", "D: %u\n", (unsigned) block); + if (initial_position < current_position + item_size) + { +-- +2.4.3 + diff --git a/0217-fs-sfs-Fix-error-check-and-add-sanity-check.patch b/0217-fs-sfs-Fix-error-check-and-add-sanity-check.patch new file mode 100644 index 0000000..d8f76c6 --- /dev/null +++ b/0217-fs-sfs-Fix-error-check-and-add-sanity-check.patch @@ -0,0 +1,57 @@ +From 66baeffc0f6373be4745a8f1941c46fc5e104392 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 25 Jan 2015 13:33:03 +0100 +Subject: [PATCH 217/506] fs/sfs: Fix error check and add sanity check. + +Found by: Coverity scan. +--- + grub-core/fs/sfs.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/grub-core/fs/sfs.c b/grub-core/fs/sfs.c +index 6c82150..57b8d8d 100644 +--- a/grub-core/fs/sfs.c ++++ b/grub-core/fs/sfs.c +@@ -173,10 +173,11 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, + struct grub_sfs_btree *tree; + int i; + grub_uint32_t next; ++ grub_size_t blocksize = GRUB_DISK_SECTOR_SIZE << data->log_blocksize; + +- treeblock = grub_malloc (GRUB_DISK_SECTOR_SIZE << data->log_blocksize); +- if (!block) +- return 0; ++ treeblock = grub_malloc (blocksize); ++ if (!treeblock) ++ return grub_errno; + + next = grub_be_to_cpu32 (data->rblock.btree); + tree = (struct grub_sfs_btree *) treeblock; +@@ -184,17 +185,21 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, + /* Handle this level in the btree. */ + do + { ++ grub_uint16_t nnodes; + grub_disk_read (data->disk, + ((grub_disk_addr_t) next) << data->log_blocksize, +- 0, GRUB_DISK_SECTOR_SIZE << data->log_blocksize, +- treeblock); ++ 0, blocksize, treeblock); + if (grub_errno) + { + grub_free (treeblock); + return grub_errno; + } + +- for (i = grub_be_to_cpu16 (tree->nodes) - 1; i >= 0; i--) ++ nnodes = grub_be_to_cpu16 (tree->nodes); ++ if (nnodes * (grub_uint32_t) (tree)->nodesize > blocksize) ++ break; ++ ++ for (i = (int) nnodes - 1; i >= 0; i--) + { + + #define EXTNODE(tree, index) \ +-- +2.4.3 + diff --git a/0218-configure.ac-Always-add-D_FILE_OFFSET_BITS-64.patch b/0218-configure.ac-Always-add-D_FILE_OFFSET_BITS-64.patch new file mode 100644 index 0000000..65389bd --- /dev/null +++ b/0218-configure.ac-Always-add-D_FILE_OFFSET_BITS-64.patch @@ -0,0 +1,35 @@ +From fc7a64bc5aa2ab9b0a9475692c6f392681525b93 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:35:44 +0100 +Subject: [PATCH 218/506] configure.ac: Always add -D_FILE_OFFSET_BITS=64. + +--- + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b734dd0..a3bca06 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -354,6 +354,9 @@ if test x"$target_cpu-$platform" = xsparc64-emu ; then + HOST_CFLAGS="$HOST_CFLAGS -m64" + fi + ++CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" ++HOST_CPPFLAGS="$HOST_CPPFLAGS -D_FILE_OFFSET_BITS=64" ++ + AC_C_BIGENDIAN + AC_CHECK_SIZEOF(void *) + AC_CHECK_SIZEOF(long) +@@ -1477,7 +1480,7 @@ fi + if test x"$grub_mount_excuse" = x ; then + # Check for fuse headers. + SAVED_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26" ++ CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" + AC_CHECK_HEADERS([fuse/fuse.h], [], + [grub_mount_excuse=["need FUSE headers"]]) + CPPFLAGS="$SAVED_CPPFLAGS" +-- +2.4.3 + diff --git a/0219-fs-ufs-Add-missing-error-check.patch b/0219-fs-ufs-Add-missing-error-check.patch new file mode 100644 index 0000000..9ccc8fe --- /dev/null +++ b/0219-fs-ufs-Add-missing-error-check.patch @@ -0,0 +1,32 @@ +From a4e33a8b180a289ee48ab22c63e0f836adb2ade7 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:36:19 +0100 +Subject: [PATCH 219/506] fs/ufs: Add missing error check. + +Found by: Coverity scan. +--- + grub-core/fs/ufs.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c +index f560ad3..0619d6e 100644 +--- a/grub-core/fs/ufs.c ++++ b/grub-core/fs/ufs.c +@@ -465,7 +465,13 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) + && INODE_SIZE (data) <= sizeof (data->inode.symlink)) + grub_strcpy (symlink, (char *) data->inode.symlink); + else +- grub_ufs_read_file (data, 0, 0, 0, sz, symlink); ++ { ++ if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0) ++ { ++ grub_free(symlink); ++ return grub_errno; ++ } ++ } + symlink[sz] = '\0'; + + /* The symlink is an absolute path, go back to the root inode. */ +-- +2.4.3 + diff --git a/0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch b/0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch new file mode 100644 index 0000000..8fc40c6 --- /dev/null +++ b/0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch @@ -0,0 +1,30 @@ +From bd74a925e5026cd0368b3455df8ffcf0b1b4150b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:37:01 +0100 +Subject: [PATCH 220/506] gfxmenu/icon_manager: Fix null pointer dereference. + +Found by: Coverity scan. +--- + grub-core/gfxmenu/icon_manager.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/grub-core/gfxmenu/icon_manager.c b/grub-core/gfxmenu/icon_manager.c +index ff49ab0..1894682 100644 +--- a/grub-core/gfxmenu/icon_manager.c ++++ b/grub-core/gfxmenu/icon_manager.c +@@ -106,8 +106,10 @@ grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr, + const char *path) + { + /* Clear the cache if the theme path has changed. */ +- if (((mgr->theme_path == 0) != (path == 0)) +- || (grub_strcmp (mgr->theme_path, path) != 0)) ++ if (mgr->theme_path == 0 && path == 0) ++ return; ++ if (mgr->theme_path == 0 || path == 0 ++ || grub_strcmp (mgr->theme_path, path) != 0) + grub_gfxmenu_icon_manager_clear_cache (mgr); + + grub_free (mgr->theme_path); +-- +2.4.3 + diff --git a/0221-gfxmenu-theme_loader-Add-missing-allos-error-check.patch b/0221-gfxmenu-theme_loader-Add-missing-allos-error-check.patch new file mode 100644 index 0000000..c5b4742 --- /dev/null +++ b/0221-gfxmenu-theme_loader-Add-missing-allos-error-check.patch @@ -0,0 +1,26 @@ +From af0be976bf5bb45c0d5d5290ca0f2a83fb380785 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:37:39 +0100 +Subject: [PATCH 221/506] gfxmenu/theme_loader: Add missing allos error check. + +Found by: Coverity scan. +--- + grub-core/gfxmenu/theme_loader.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/gfxmenu/theme_loader.c b/grub-core/gfxmenu/theme_loader.c +index 8a79458..1a6ed1d 100644 +--- a/grub-core/gfxmenu/theme_loader.c ++++ b/grub-core/gfxmenu/theme_loader.c +@@ -774,6 +774,8 @@ grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, const char *theme_path) + view->canvas->component.ops->destroy (view->canvas); + + view->canvas = grub_gui_canvas_new (); ++ if (!view->canvas) ++ goto fail; + ((grub_gui_component_t) view->canvas) + ->ops->set_bounds ((grub_gui_component_t) view->canvas, + &view->screen); +-- +2.4.3 + diff --git a/0222-i386-pc-mmap-Fix-memset-size.patch b/0222-i386-pc-mmap-Fix-memset-size.patch new file mode 100644 index 0000000..76487a7 --- /dev/null +++ b/0222-i386-pc-mmap-Fix-memset-size.patch @@ -0,0 +1,26 @@ +From 21f22c71077a4d460049107a946ceca8b514ffb3 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:38:11 +0100 +Subject: [PATCH 222/506] i386/pc/mmap: Fix memset size. + +Found by: Coverity scan. +--- + grub-core/kern/i386/pc/mmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/i386/pc/mmap.c b/grub-core/kern/i386/pc/mmap.c +index f1375f3..c0c3c35 100644 +--- a/grub-core/kern/i386/pc/mmap.c ++++ b/grub-core/kern/i386/pc/mmap.c +@@ -148,7 +148,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) + + while (1) + { +- grub_memset (entry, 0, sizeof (entry)); ++ grub_memset (entry, 0, sizeof (*entry)); + + cont = grub_get_mmap_entry (entry, cont); + +-- +2.4.3 + diff --git a/0223-lib-syslinux_parse-Add-missing-alloc-check.patch b/0223-lib-syslinux_parse-Add-missing-alloc-check.patch new file mode 100644 index 0000000..ee839b5 --- /dev/null +++ b/0223-lib-syslinux_parse-Add-missing-alloc-check.patch @@ -0,0 +1,26 @@ +From aa64393144f0a805b191bc2c45b84606b03706a0 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:40:42 +0100 +Subject: [PATCH 223/506] lib/syslinux_parse: Add missing alloc check. + +Found by: Coverity scan. +--- + grub-core/lib/syslinux_parse.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 241cefe..2f1f1a5 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -649,6 +649,8 @@ helptext (const char *line, grub_file_t file, struct syslinux_menu *menu) + grub_size_t helplen, alloclen = 0; + + help = grub_strdup (line); ++ if (!help) ++ return grub_errno; + helplen = grub_strlen (line); + while ((grub_free (buf), buf = grub_file_getline (file))) + { +-- +2.4.3 + diff --git a/0224-lib-syslinux_parse-Fix-memory-leak.patch b/0224-lib-syslinux_parse-Fix-memory-leak.patch new file mode 100644 index 0000000..a69bde8 --- /dev/null +++ b/0224-lib-syslinux_parse-Fix-memory-leak.patch @@ -0,0 +1,25 @@ +From ca7c1fd6f377bebf300d0bfcb61253c34fefc861 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:41:24 +0100 +Subject: [PATCH 224/506] lib/syslinux_parse: Fix memory leak. + +Found by: Coveriy scan. +--- + grub-core/lib/syslinux_parse.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 2f1f1a5..1927c4f 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -684,6 +684,7 @@ helptext (const char *line, grub_file_t file, struct syslinux_menu *menu) + } + + grub_free (buf); ++ grub_free (help); + return grub_errno; + } + +-- +2.4.3 + diff --git a/0225-lib-syslinux_parse-Add-missing-error-check.patch b/0225-lib-syslinux_parse-Add-missing-error-check.patch new file mode 100644 index 0000000..918c0f1 --- /dev/null +++ b/0225-lib-syslinux_parse-Add-missing-error-check.patch @@ -0,0 +1,31 @@ +From 49978c5c4f5a88a8065042133e5d4b7e3c472eaa Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:42:04 +0100 +Subject: [PATCH 225/506] lib/syslinux_parse: Add missing error check. + +Found by: Coverity scan. +--- + grub-core/lib/syslinux_parse.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 1927c4f..f605326 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -846,7 +846,12 @@ write_entry (struct output_buffer *outbuf, + { + grub_err_t err; + if (curentry->comments) +- print (outbuf, curentry->comments, grub_strlen (curentry->comments)); ++ { ++ err = print (outbuf, curentry->comments, ++ grub_strlen (curentry->comments)); ++ if (err) ++ return err; ++ } + { + struct syslinux_say *say; + for (say = curentry->say; say && say->next; say = say->next); +-- +2.4.3 + diff --git a/0226-bsd-Add-missing-null-pointer-check.patch b/0226-bsd-Add-missing-null-pointer-check.patch new file mode 100644 index 0000000..62ab837 --- /dev/null +++ b/0226-bsd-Add-missing-null-pointer-check.patch @@ -0,0 +1,27 @@ +From 1e0d71837124add3adb810ebbb13607dac037635 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:42:42 +0100 +Subject: [PATCH 226/506] bsd: Add missing null-pointer check. + +Found by: Coverity scan. +--- + grub-core/loader/i386/bsd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c +index 8f691e0..bc377b3 100644 +--- a/grub-core/loader/i386/bsd.c ++++ b/grub-core/loader/i386/bsd.c +@@ -234,7 +234,8 @@ grub_bsd_add_meta_ptr (grub_uint32_t type, void **ptr, grub_uint32_t len) + { + struct bsd_tag *p; + for (p = tags; +- p->type != (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_KERNEND); ++ p && p->type != (FREEBSD_MODINFO_METADATA ++ | FREEBSD_MODINFOMD_KERNEND); + p = p->next); + + if (p) +-- +2.4.3 + diff --git a/0227-multiboot-Simplify-to-avoid-confusing-assignment.patch b/0227-multiboot-Simplify-to-avoid-confusing-assignment.patch new file mode 100644 index 0000000..bca85ca --- /dev/null +++ b/0227-multiboot-Simplify-to-avoid-confusing-assignment.patch @@ -0,0 +1,111 @@ +From ef02b4ca933fd4c215e169a23b2b069aab712677 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:43:52 +0100 +Subject: [PATCH 227/506] multiboot: Simplify to avoid confusing assignment. + +Found by: Coverity scan. +--- + grub-core/loader/i386/multiboot_mbi.c | 29 +++++++++++++++++++---------- + grub-core/loader/multiboot_mbi2.c | 32 ++++++++++++++++++++------------ + 2 files changed, 39 insertions(+), 22 deletions(-) + +diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c +index f10c087..956d0e3 100644 +--- a/grub-core/loader/i386/multiboot_mbi.c ++++ b/grub-core/loader/i386/multiboot_mbi.c +@@ -121,6 +121,24 @@ load_kernel (grub_file_t file, const char *filename, + return grub_multiboot_load_elf (file, filename, buffer); + } + ++static struct multiboot_header * ++find_header (char *buffer, grub_ssize_t len) ++{ ++ struct multiboot_header *header; ++ ++ /* Look for the multiboot header in the buffer. The header should ++ be at least 12 bytes and aligned on a 4-byte boundary. */ ++ for (header = (struct multiboot_header *) buffer; ++ ((char *) header <= buffer + len - 12); ++ header = (struct multiboot_header *) ((char *) header + MULTIBOOT_HEADER_ALIGN)) ++ { ++ if (header->magic == MULTIBOOT_HEADER_MAGIC ++ && !(header->magic + header->flags + header->checksum)) ++ return header; ++ } ++ return NULL; ++} ++ + grub_err_t + grub_multiboot_load (grub_file_t file, const char *filename) + { +@@ -143,16 +161,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + return grub_errno; + } + +- /* Look for the multiboot header in the buffer. The header should +- be at least 12 bytes and aligned on a 4-byte boundary. */ +- for (header = (struct multiboot_header *) buffer; +- ((char *) header <= buffer + len - 12) || (header = 0); +- header = (struct multiboot_header *) ((char *) header + MULTIBOOT_HEADER_ALIGN)) +- { +- if (header->magic == MULTIBOOT_HEADER_MAGIC +- && !(header->magic + header->flags + header->checksum)) +- break; +- } ++ header = find_header (buffer, len); + + if (header == 0) + { +diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c +index 83e8919..6f74aee 100644 +--- a/grub-core/loader/multiboot_mbi2.c ++++ b/grub-core/loader/multiboot_mbi2.c +@@ -79,6 +79,25 @@ grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, + elf_sections = data; + } + ++static struct multiboot_header * ++find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) ++{ ++ struct multiboot_header *header; ++ /* Look for the multiboot header in the buffer. The header should ++ be at least 12 bytes and aligned on a 4-byte boundary. */ ++ for (header = (struct multiboot_header *) buffer; ++ ((char *) header <= (char *) buffer + len - 12); ++ header = (struct multiboot_header *) ((grub_uint32_t *) header + MULTIBOOT_HEADER_ALIGN / 4)) ++ { ++ if (header->magic == MULTIBOOT_HEADER_MAGIC ++ && !(header->magic + header->architecture ++ + header->header_length + header->checksum) ++ && header->architecture == MULTIBOOT_ARCHITECTURE_CURRENT) ++ return header; ++ } ++ return NULL; ++} ++ + grub_err_t + grub_multiboot_load (grub_file_t file, const char *filename) + { +@@ -107,18 +126,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + + COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); + +- /* Look for the multiboot header in the buffer. The header should +- be at least 12 bytes and aligned on a 4-byte boundary. */ +- for (header = (struct multiboot_header *) buffer; +- ((char *) header <= (char *) buffer + len - 12) || (header = 0); +- header = (struct multiboot_header *) ((grub_uint32_t *) header + MULTIBOOT_HEADER_ALIGN / 4)) +- { +- if (header->magic == MULTIBOOT_HEADER_MAGIC +- && !(header->magic + header->architecture +- + header->header_length + header->checksum) +- && header->architecture == MULTIBOOT_ARCHITECTURE_CURRENT) +- break; +- } ++ header = find_header (buffer, len); + + if (header == 0) + { +-- +2.4.3 + diff --git a/0228-plan9-Add-missing-grub_device_close.patch b/0228-plan9-Add-missing-grub_device_close.patch new file mode 100644 index 0000000..62be56b --- /dev/null +++ b/0228-plan9-Add-missing-grub_device_close.patch @@ -0,0 +1,55 @@ +From e12c3bed90221fad33c4b08ce208745dd65bd782 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:44:33 +0100 +Subject: [PATCH 228/506] plan9: Add missing grub_device_close. + +Found by: Coverity scan. +--- + grub-core/loader/i386/pc/plan9.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/i386/pc/plan9.c b/grub-core/loader/i386/pc/plan9.c +index 0d10b1c..814a49d 100644 +--- a/grub-core/loader/i386/pc/plan9.c ++++ b/grub-core/loader/i386/pc/plan9.c +@@ -342,6 +342,7 @@ fill_disk (const char *name, void *data) + if (!plan9name) + { + grub_print_error (); ++ grub_device_close (dev); + return 0; + } + if (grub_extend_alloc (fill_ctx->pmapptr + grub_strlen (plan9name) +@@ -349,6 +350,7 @@ fill_disk (const char *name, void *data) + &fill_ctx->pmap)) + { + grub_free (plan9name); ++ grub_device_close (dev); + return 1; + } + grub_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, plan9name); +@@ -366,12 +368,19 @@ fill_disk (const char *name, void *data) + fill_ctx->noslash = 1; + grub_memset (fill_ctx->prefixescnt, 0, sizeof (fill_ctx->prefixescnt)); + if (grub_partition_iterate (dev->disk, fill_partition, fill_ctx)) +- return 1; ++ { ++ grub_device_close (dev); ++ return 1; ++ } + if (grub_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, + &fill_ctx->pmap)) +- return 1; ++ { ++ grub_device_close (dev); ++ return 1; ++ } + fill_ctx->pmap[fill_ctx->pmapptr++] = '\n'; + ++ grub_device_close (dev); + return 0; + } + +-- +2.4.3 + diff --git a/0229-xnu-Add-missing-error-check.patch b/0229-xnu-Add-missing-error-check.patch new file mode 100644 index 0000000..04526d8 --- /dev/null +++ b/0229-xnu-Add-missing-error-check.patch @@ -0,0 +1,26 @@ +From a05a6e6f92335236dc12339c73144ef8d03f07e8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:44:57 +0100 +Subject: [PATCH 229/506] xnu: Add missing error check. + +Found by: Coveriy scan. +--- + grub-core/loader/xnu.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/loader/xnu.c b/grub-core/loader/xnu.c +index cdd9715..bc89cdf 100644 +--- a/grub-core/loader/xnu.c ++++ b/grub-core/loader/xnu.c +@@ -1378,6 +1378,8 @@ grub_xnu_fill_devicetree (void) + name[len] = 0; + + curvalue = grub_xnu_create_value (curkey, name); ++ if (!curvalue) ++ return grub_errno; + grub_free (name); + + data = grub_malloc (grub_strlen (var->value) + 1); +-- +2.4.3 + diff --git a/0230-normal-main-Fix-error-handling.patch b/0230-normal-main-Fix-error-handling.patch new file mode 100644 index 0000000..a9ba3b7 --- /dev/null +++ b/0230-normal-main-Fix-error-handling.patch @@ -0,0 +1,26 @@ +From 73b1e8383906910e9da82fb3c79c590e450d598f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:48:46 +0100 +Subject: [PATCH 230/506] normal/main: Fix error handling. + +Found by: Coverity scan. +--- + grub-core/normal/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index c41f175..623b93b 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -130,7 +130,7 @@ read_config_file (const char *config) + file = grub_bufio_open (rawfile, 0); + if (! file) + { +- grub_file_close (file); ++ grub_file_close (rawfile); + return 0; + } + +-- +2.4.3 + diff --git a/0231-normal-misc-Close-device-on-all-pathes.patch b/0231-normal-misc-Close-device-on-all-pathes.patch new file mode 100644 index 0000000..c4f2482 --- /dev/null +++ b/0231-normal-misc-Close-device-on-all-pathes.patch @@ -0,0 +1,31 @@ +From 6603c22f3125185077d9e6431e1004aff83a473c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:49:32 +0100 +Subject: [PATCH 231/506] normal/misc: Close device on all pathes. + +Found by: Coverity scan. +--- + grub-core/normal/misc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/grub-core/normal/misc.c b/grub-core/normal/misc.c +index 34d505e..38f91b9 100644 +--- a/grub-core/normal/misc.c ++++ b/grub-core/normal/misc.c +@@ -184,10 +184,11 @@ grub_normal_print_device_info (const char *name) + /* TRANSLATORS: Replace dot with appropriate decimal separator for + your language. */ + (grub_disk_get_size (dev->disk) & 1) ? _(".5") : ""); +- +- grub_device_close (dev); + } + ++ if (dev) ++ grub_device_close (dev); ++ + grub_xputs ("\n"); + return grub_errno; + } +-- +2.4.3 + diff --git a/0232-devmapper-getroot-Fix-memory-leak.patch b/0232-devmapper-getroot-Fix-memory-leak.patch new file mode 100644 index 0000000..51be1ec --- /dev/null +++ b/0232-devmapper-getroot-Fix-memory-leak.patch @@ -0,0 +1,53 @@ +From c14dff3ca722cc139cd9c44261aa99882d8a8ca3 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:50:27 +0100 +Subject: [PATCH 232/506] devmapper/getroot: Fix memory leak. + +Found by: Coverity scan. +--- + grub-core/osdep/devmapper/getroot.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c +index d02386b..0a77a04 100644 +--- a/grub-core/osdep/devmapper/getroot.c ++++ b/grub-core/osdep/devmapper/getroot.c +@@ -160,7 +160,10 @@ grub_util_pull_devmapper (const char *os_dev) + uuid = get_dm_uuid (os_dev); + + if (!grub_util_open_dm (os_dev, &tree, &node)) +- return; ++ { ++ grub_free (uuid); ++ return; ++ } + + while ((child = dm_tree_next_child (&handle, node, 0))) + { +@@ -192,6 +195,7 @@ grub_util_pull_devmapper (const char *os_dev) + } + else + dm_tree_free (tree); ++ grub_free (uuid); + } + + char * +@@ -253,6 +257,7 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) + grub_free (uuid); + return grub_dev; + } ++ grub_free (uuid); + return NULL; + } + +@@ -279,6 +284,7 @@ grub_util_get_vg_uuid (const char *os_dev) + } + optr--; + *optr = '\0'; ++ grub_free (uuid); + return vgid; + } + +-- +2.4.3 + diff --git a/0233-linux-blocklist-Fix-memory-leak.patch b/0233-linux-blocklist-Fix-memory-leak.patch new file mode 100644 index 0000000..57418e0 --- /dev/null +++ b/0233-linux-blocklist-Fix-memory-leak.patch @@ -0,0 +1,25 @@ +From 5adc6d76d3c82ed7d85fc7aaa341743f5378314c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:50:58 +0100 +Subject: [PATCH 233/506] linux/blocklist: Fix memory leak. + +Found by: Coverity scan. +--- + grub-core/osdep/linux/blocklist.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/osdep/linux/blocklist.c b/grub-core/osdep/linux/blocklist.c +index 10ddd11..c77d608 100644 +--- a/grub-core/osdep/linux/blocklist.c ++++ b/grub-core/osdep/linux/blocklist.c +@@ -130,6 +130,7 @@ grub_install_get_blocklist (grub_device_t root_dev, + & (GRUB_DISK_SECTOR_SIZE - 1), + fie2->fm_extents[i].fe_length, hook_data); + } ++ free (fie2); + } + close (fd); + } +-- +2.4.3 + diff --git a/0234-linux-getroot-Fix-error-handling.patch b/0234-linux-getroot-Fix-error-handling.patch new file mode 100644 index 0000000..2780e62 --- /dev/null +++ b/0234-linux-getroot-Fix-error-handling.patch @@ -0,0 +1,97 @@ +From cba5a85a67f879b6431833e87ceb93d44b8ac48a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:51:48 +0100 +Subject: [PATCH 234/506] linux/getroot: Fix error handling. + +Found by: Coverity scan. +--- + grub-core/osdep/linux/getroot.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c +index 7007193..f48b81a 100644 +--- a/grub-core/osdep/linux/getroot.c ++++ b/grub-core/osdep/linux/getroot.c +@@ -226,7 +226,7 @@ grub_find_root_devices_from_btrfs (const char *dir) + char **ret; + + fd = open (dir, 0); +- if (!fd) ++ if (fd < 0) + return NULL; + + if (ioctl (fd, BTRFS_IOC_FS_INFO, &fsi) < 0) +@@ -274,11 +274,11 @@ get_btrfs_fs_prefix (const char *mount_path) + args.objectid = GRUB_BTRFS_TREE_ROOT_OBJECTID; + + if (ioctl (fd, BTRFS_IOC_INO_LOOKUP, &args) < 0) +- return NULL; ++ goto fail; + tree_id = args.treeid; + + if (fstat (fd, &st) < 0) +- return NULL; ++ goto fail; + inode_id = st.st_ino; + + while (tree_id != GRUB_BTRFS_ROOT_VOL_OBJECTID +@@ -309,11 +309,11 @@ get_btrfs_fs_prefix (const char *mount_path) + sargs.key.nr_items = 1; + + if (ioctl (fd, BTRFS_IOC_TREE_SEARCH, &sargs) < 0) +- return NULL; ++ goto fail; + + if (sargs.key.nr_items == 0) +- return NULL; +- ++ goto fail; ++ + tree_id = sargs.buf[2]; + br = (struct grub_btrfs_root_backref *) (sargs.buf + 4); + inode_id = br->inode_id; +@@ -336,10 +336,10 @@ get_btrfs_fs_prefix (const char *mount_path) + sargs.key.max_type = GRUB_BTRFS_ITEM_TYPE_INODE_REF; + + if (ioctl (fd, BTRFS_IOC_TREE_SEARCH, &sargs) < 0) +- return NULL; ++ goto fail; + + if (sargs.key.nr_items == 0) +- return NULL; ++ goto fail; + + inode_id = sargs.buf[2]; + +@@ -362,6 +362,10 @@ get_btrfs_fs_prefix (const char *mount_path) + if (!ret) + return xstrdup ("/"); + return ret; ++ fail: ++ free (ret); ++ close (fd); ++ return NULL; + } + + +@@ -688,7 +692,7 @@ char * + grub_util_part_to_disk (const char *os_dev, struct stat *st, + int *is_part) + { +- char *path = xmalloc (PATH_MAX); ++ char *path; + + if (! S_ISBLK (st->st_mode)) + { +@@ -696,6 +700,8 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, + return xstrdup (os_dev); + } + ++ path = xmalloc (PATH_MAX); ++ + if (! realpath (os_dev, path)) + return NULL; + +-- +2.4.3 + diff --git a/0235-unix-password-Fix-file-descriptor-leak.patch b/0235-unix-password-Fix-file-descriptor-leak.patch new file mode 100644 index 0000000..868bec7 --- /dev/null +++ b/0235-unix-password-Fix-file-descriptor-leak.patch @@ -0,0 +1,37 @@ +From 810254093959708aa6a260c59ad3cf3a1d250755 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:53:03 +0100 +Subject: [PATCH 235/506] unix/password: Fix file descriptor leak. + +Found by: Coverity scan. +--- + grub-core/osdep/unix/password.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/unix/password.c b/grub-core/osdep/unix/password.c +index 470a6ea..4b9507b 100644 +--- a/grub-core/osdep/unix/password.c ++++ b/grub-core/osdep/unix/password.c +@@ -53,7 +53,10 @@ grub_password_get (char buf[], unsigned buf_size) + tty_changed = 0; + grub_memset (buf, 0, buf_size); + if (!fgets (buf, buf_size, stdin)) +- return 0; ++ { ++ fclose (in); ++ return 0; ++ } + ptr = buf + strlen (buf) - 1; + while (buf <= ptr && (*ptr == '\n' || *ptr == '\r')) + *ptr-- = 0; +@@ -64,5 +67,7 @@ grub_password_get (char buf[], unsigned buf_size) + grub_xputs ("\n"); + grub_refresh (); + ++ fclose (in); ++ + return 1; + } +-- +2.4.3 + diff --git a/0236-vbe-Fix-incorrect-register-usage.patch b/0236-vbe-Fix-incorrect-register-usage.patch new file mode 100644 index 0000000..8affde3 --- /dev/null +++ b/0236-vbe-Fix-incorrect-register-usage.patch @@ -0,0 +1,27 @@ +From c4fcfd8744f320635949d62ec0df4ea60ebe60e8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:53:39 +0100 +Subject: [PATCH 236/506] vbe: Fix incorrect register usage. + +Found by: Coverity scan. +--- + grub-core/video/i386/pc/vbe.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c +index 62b5c22..07a614a 100644 +--- a/grub-core/video/i386/pc/vbe.c ++++ b/grub-core/video/i386/pc/vbe.c +@@ -304,8 +304,7 @@ grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size) + struct grub_bios_int_registers regs; + + regs.eax = 0x4f08; +- regs.ebx = (*dac_mask_size & 0xff) >> 8; +- regs.ebx = set ? 1 : 0; ++ regs.ebx = ((*dac_mask_size & 0xff) << 8) | (set ? 1 : 0); + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + grub_bios_interrupt (0x10, ®s); + *dac_mask_size = (regs.ebx >> 8) & 0xff; +-- +2.4.3 + diff --git a/0237-util-getroot-Add-missing-grub_disk_close.patch b/0237-util-getroot-Add-missing-grub_disk_close.patch new file mode 100644 index 0000000..4a08fd6 --- /dev/null +++ b/0237-util-getroot-Add-missing-grub_disk_close.patch @@ -0,0 +1,29 @@ +From 866f469683a1cc99bb3adeee5b3eb07ec18a000c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:54:14 +0100 +Subject: [PATCH 237/506] util/getroot: Add missing grub_disk_close. + +Found by: Coverity scan. +--- + util/getroot.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/getroot.c b/util/getroot.c +index 3958105..345d49b 100644 +--- a/util/getroot.c ++++ b/util/getroot.c +@@ -417,7 +417,10 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) + + name = grub_util_get_ldm (disk, ctx.start); + if (name) +- return name; ++ { ++ grub_disk_close (disk); ++ return name; ++ } + + ctx.partname = NULL; + +-- +2.4.3 + diff --git a/0238-grub-install-common-Fix-sizeof-usage.patch b/0238-grub-install-common-Fix-sizeof-usage.patch new file mode 100644 index 0000000..c641db7 --- /dev/null +++ b/0238-grub-install-common-Fix-sizeof-usage.patch @@ -0,0 +1,26 @@ +From c3f52305976ffcdee679df4229b65d5f71a53023 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:54:50 +0100 +Subject: [PATCH 238/506] grub-install-common: Fix sizeof usage. + +Found by: Coverity scan. +--- + util/grub-install-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index b6dec93..a465699 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -238,7 +238,7 @@ grub_install_push_module (const char *val) + if (modules.n_alloc < 16) + modules.n_alloc = 16; + modules.entries = xrealloc (modules.entries, +- modules.n_alloc * sizeof (modules.entries)); ++ modules.n_alloc * sizeof (*modules.entries)); + } + modules.entries[modules.n_entries++] = xstrdup (val); + modules.entries[modules.n_entries] = NULL; +-- +2.4.3 + diff --git a/0239-grub-install-Fix-memory-leak.patch b/0239-grub-install-Fix-memory-leak.patch new file mode 100644 index 0000000..e644dd7 --- /dev/null +++ b/0239-grub-install-Fix-memory-leak.patch @@ -0,0 +1,29 @@ +From 3c6384832bb304078fcafc537195827710f9f6bf Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:55:30 +0100 +Subject: [PATCH 239/506] grub-install: Fix memory leak. + +Found by: Coverity scan. +--- + util/grub-install.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/grub-install.c b/util/grub-install.c +index 7d61c32..afbc557 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -622,7 +622,10 @@ device_map_check_duplicates (const char *dev_map) + + fp = grub_util_fopen (dev_map, "r"); + if (! fp) +- return; ++ { ++ free (d); ++ return; ++ } + + while (fgets (buf, sizeof (buf), fp)) + { +-- +2.4.3 + diff --git a/0240-grub-macbless-Fix-resource-leak.patch b/0240-grub-macbless-Fix-resource-leak.patch new file mode 100644 index 0000000..c3a94c2 --- /dev/null +++ b/0240-grub-macbless-Fix-resource-leak.patch @@ -0,0 +1,26 @@ +From 5d61a6a6120954380a46a3c1a46a01fdf763e037 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:55:58 +0100 +Subject: [PATCH 240/506] grub-macbless: Fix resource leak. + +Found by: Coverity scan. +--- + util/grub-macbless.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/util/grub-macbless.c b/util/grub-macbless.c +index 742353a..e57e13d 100644 +--- a/util/grub-macbless.c ++++ b/util/grub-macbless.c +@@ -92,6 +92,8 @@ bless (const char *path, int x86) + free (filebuf_via_grub); + free (filebuf_via_sys); + free (drive_name); ++ free (devices); ++ grub_device_close (dev); + } + + static struct argp_option options[] = { +-- +2.4.3 + diff --git a/0241-util-misc.c-Check-ftello-return-value.patch b/0241-util-misc.c-Check-ftello-return-value.patch new file mode 100644 index 0000000..5b7dc3d --- /dev/null +++ b/0241-util-misc.c-Check-ftello-return-value.patch @@ -0,0 +1,26 @@ +From 11eed6abce6626edecdbc81876bc7f5b91458c0b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 26 Jan 2015 09:56:24 +0100 +Subject: [PATCH 241/506] util/misc.c: Check ftello return value. + +Found by: Coverity scan. +--- + util/misc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/util/misc.c b/util/misc.c +index b0e023e..b8ec691 100644 +--- a/util/misc.c ++++ b/util/misc.c +@@ -89,6 +89,8 @@ grub_util_get_image_size (const char *path) + fseeko (f, 0, SEEK_END); + + sz = ftello (f); ++ if (sz < 0) ++ grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + if (sz != (size_t) sz) + grub_util_error (_("file `%s' is too big"), path); + ret = (size_t) sz; +-- +2.4.3 + diff --git a/0242-linux-getroot-fix-descriptor-leak.patch b/0242-linux-getroot-fix-descriptor-leak.patch new file mode 100644 index 0000000..7306c0b --- /dev/null +++ b/0242-linux-getroot-fix-descriptor-leak.patch @@ -0,0 +1,29 @@ +From 6704abade6674a91d8c652a7e4596ca3421411b6 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 21:38:40 +0300 +Subject: [PATCH 242/506] linux/getroot: fix descriptor leak. + +Found by: Coverity scan. +--- + grub-core/osdep/linux/getroot.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c +index f48b81a..a2e360f 100644 +--- a/grub-core/osdep/linux/getroot.c ++++ b/grub-core/osdep/linux/getroot.c +@@ -360,8 +360,10 @@ get_btrfs_fs_prefix (const char *mount_path) + ret[1+namelen] = '\0'; + } + if (!ret) +- return xstrdup ("/"); ++ ret = xstrdup ("/"); ++ close (fd); + return ret; ++ + fail: + free (ret); + close (fd); +-- +2.4.3 + diff --git a/0243-linux-ofpath-fix-various-memory-leaks.patch b/0243-linux-ofpath-fix-various-memory-leaks.patch new file mode 100644 index 0000000..0d0d3cf --- /dev/null +++ b/0243-linux-ofpath-fix-various-memory-leaks.patch @@ -0,0 +1,53 @@ +From e2a21238da913dd834b6b656170eb295c589e65d Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 21:41:29 +0300 +Subject: [PATCH 243/506] linux/ofpath: fix various memory leaks. + +Found by: Coverity scan. +--- + grub-core/osdep/linux/ofpath.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 8f24bc9..4cc171c 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -128,6 +128,8 @@ find_obppath (const char *sysfs_path_orig) + + if (fd < 0 || fstat (fd, &st) < 0) + { ++ if (fd >= 0) ++ close (fd); + kill_trailing_dir(sysfs_path); + if (!strcmp(sysfs_path, "/sys")) + { +@@ -147,6 +149,9 @@ find_obppath (const char *sysfs_path_orig) + { + grub_util_info (_("cannot read `%s': %s"), path, strerror (errno)); + close(fd); ++ free (path); ++ free (of_path); ++ free (sysfs_path); + return NULL; + } + close(fd); +@@ -480,6 +485,7 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev + snprintf(disk, sizeof (disk), + "/sas/%s@%lx,%lu:%c", disk_name, sas_address, longlun, 'a' + (part - 1)); + } ++ free (lunstr); + } + } + strcat(of_path, disk); +@@ -530,7 +536,7 @@ grub_util_devname_to_ofpath (const char *sys_devname) + else + { + grub_util_warn (_("unknown device type %s\n"), device); +- return NULL; ++ ofpath = NULL; + } + + free (devnode); +-- +2.4.3 + diff --git a/0244-util-setup-fix-memory-leak.patch b/0244-util-setup-fix-memory-leak.patch new file mode 100644 index 0000000..da66601 --- /dev/null +++ b/0244-util-setup-fix-memory-leak.patch @@ -0,0 +1,29 @@ +From 64440daa21e150337ee285674eca3dd84de20958 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 21:07:19 +0300 +Subject: [PATCH 244/506] util/setup: fix memory leak. + +Found by: Coverity scan. +--- + util/setup.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/setup.c b/util/setup.c +index 9fb91a8..ed4bd11 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -322,7 +322,10 @@ SETUP (const char *dir, + continue; + try_dev = grub_device_open (drive); + if (! try_dev) +- continue; ++ { ++ free (drive); ++ continue; ++ } + if (!found && try_dev->disk->id == dest_dev->disk->id + && try_dev->disk->dev->id == dest_dev->disk->dev->id) + { +-- +2.4.3 + diff --git a/0245-util-install-fix-memory-leak.patch b/0245-util-install-fix-memory-leak.patch new file mode 100644 index 0000000..2b3fb36 --- /dev/null +++ b/0245-util-install-fix-memory-leak.patch @@ -0,0 +1,25 @@ +From 5e27fb06f22eda7d7ffd86d16c27262aaf59e132 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 21:11:32 +0300 +Subject: [PATCH 245/506] util/install: fix memory leak. + +Found by: Coverity scan. +--- + util/grub-install-common.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index a465699..37c1a98 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -490,6 +490,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + dir, prefix, + outname, mkimage_target, + compnames[compression], note ? "--note" : "", s); ++ free (s); + + tgt = grub_install_get_image_target (mkimage_target); + if (!tgt) +-- +2.4.3 + diff --git a/0246-linux-getroot-fix-memory-leak.patch b/0246-linux-getroot-fix-memory-leak.patch new file mode 100644 index 0000000..37d82bd --- /dev/null +++ b/0246-linux-getroot-fix-memory-leak.patch @@ -0,0 +1,37 @@ +From e61f4eba1850c1c6576c0977fc1a305ad02ab0ce Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:08:13 +0300 +Subject: [PATCH 246/506] linux/getroot: fix memory leak. + +Found by: Coverity scan. +--- + grub-core/osdep/unix/getroot.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c +index e3887cb..10fb56a 100644 +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -621,7 +621,10 @@ grub_util_pull_lvm_by_command (const char *os_dev) + free (vgname); + + if (!pid) +- return; ++ { ++ free (vgid); ++ return; ++ } + + /* Parent. Read vgs' output. */ + vgs = fdopen (fd, "r"); +@@ -653,6 +656,7 @@ out: + close (fd); + waitpid (pid, NULL, 0); + free (buf); ++ free (vgid); + } + + /* ZFS has similar problems to those of btrfs (see above). */ +-- +2.4.3 + diff --git a/0247-util-grub-install-rearrange-code-to-avoid-memory-lea.patch b/0247-util-grub-install-rearrange-code-to-avoid-memory-lea.patch new file mode 100644 index 0000000..b81db35 --- /dev/null +++ b/0247-util-grub-install-rearrange-code-to-avoid-memory-lea.patch @@ -0,0 +1,39 @@ +From be0743b052d76c27cc704d94cfd38cc54e7e02b3 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:17:31 +0300 +Subject: [PATCH 247/506] util/grub-install: rearrange code to avoid memory + leak. + +Found by: Coverity scan. +--- + util/grub-install.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/util/grub-install.c b/util/grub-install.c +index afbc557..210f4a7 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -615,17 +615,14 @@ device_map_check_duplicates (const char *dev_map) + char **d; + size_t i; + +- d = xmalloc (alloced * sizeof (d[0])); +- + if (dev_map[0] == '\0') + return; + + fp = grub_util_fopen (dev_map, "r"); + if (! fp) +- { +- free (d); +- return; +- } ++ return; ++ ++ d = xmalloc (alloced * sizeof (d[0])); + + while (fgets (buf, sizeof (buf), fp)) + { +-- +2.4.3 + diff --git a/0248-util-grub-mkstandalone-fix-memory-leak.patch b/0248-util-grub-mkstandalone-fix-memory-leak.patch new file mode 100644 index 0000000..e9a7331 --- /dev/null +++ b/0248-util-grub-mkstandalone-fix-memory-leak.patch @@ -0,0 +1,25 @@ +From bd4e20eedfaa3079a2efcb13559e916772365ee1 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:20:51 +0300 +Subject: [PATCH 248/506] util/grub-mkstandalone: fix memory leak. + +Found by: Coverity scan. +--- + util/grub-mkstandalone.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-mkstandalone.c b/util/grub-mkstandalone.c +index 6017d71..4907d44 100644 +--- a/util/grub-mkstandalone.c ++++ b/util/grub-mkstandalone.c +@@ -284,6 +284,7 @@ add_tar_file (const char *from, + grub_util_fd_close (in); + + write_pad (size); ++ free (tcn); + } + + int +-- +2.4.3 + diff --git a/0249-util-grub-mount-fix-descriptor-leak.patch b/0249-util-grub-mount-fix-descriptor-leak.patch new file mode 100644 index 0000000..cc1caaf --- /dev/null +++ b/0249-util-grub-mount-fix-descriptor-leak.patch @@ -0,0 +1,25 @@ +From 1a87156e01e3cb873f3479c31c34c97fb690eb71 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:24:28 +0300 +Subject: [PATCH 249/506] util/grub-mount: fix descriptor leak. + +Found by: Coverity scan. +--- + util/grub-mount.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-mount.c b/util/grub-mount.c +index 19de2e6..4626e54 100644 +--- a/util/grub-mount.c ++++ b/util/grub-mount.c +@@ -516,6 +516,7 @@ argp_parser (int key, char *arg, struct argp_state *state) + return 0; + } + grub_zfs_add_key (buf, real_size, 0); ++ fclose (f); + } + return 0; + +-- +2.4.3 + diff --git a/0250-util-mkimage-fix-memory-leaks.patch b/0250-util-mkimage-fix-memory-leaks.patch new file mode 100644 index 0000000..130760a --- /dev/null +++ b/0250-util-mkimage-fix-memory-leaks.patch @@ -0,0 +1,35 @@ +From fe4efe0d50482b433b46de677546f796de46d5ae Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:39:08 +0300 +Subject: [PATCH 250/506] util/mkimage: fix memory leaks. + +Found by: Coverity scan. +--- + util/mkimage.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/util/mkimage.c b/util/mkimage.c +index e6b799f..bccd703 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -1278,6 +1278,8 @@ grub_install_generate_image (const char *dir, const char *prefix, + free (core_img); + core_img = full_img; + core_size = full_size; ++ free (decompress_img); ++ free (decompress_path); + } + + switch (image_target->id) +@@ -1744,6 +1746,8 @@ grub_install_generate_image (const char *dir, const char *prefix, + free (core_img); + core_img = rom_img; + core_size = rom_size; ++ free (boot_img); ++ free (boot_path); + } + break; + case IMAGE_QEMU_MIPS_FLASH: +-- +2.4.3 + diff --git a/0251-util-setup-fix-memory-leak.patch b/0251-util-setup-fix-memory-leak.patch new file mode 100644 index 0000000..167f891 --- /dev/null +++ b/0251-util-setup-fix-memory-leak.patch @@ -0,0 +1,36 @@ +From bd196014ec4eed6b4671cac4f4cb73621b219afa Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 26 Jan 2015 22:44:45 +0300 +Subject: [PATCH 251/506] util/setup: fix memory leak. + +Found by: Coverity scan. +--- + util/setup.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/setup.c b/util/setup.c +index ed4bd11..b299159 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -670,15 +670,17 @@ unable_to_embed: + if (dest_dev->disk->id != root_dev->disk->id + || dest_dev->disk->dev->id != root_dev->disk->dev->id) + { +- const char *dest_ofpath; ++ char *dest_ofpath; + dest_ofpath + = grub_util_devname_to_ofpath (grub_util_biosdisk_get_osdev (root_dev->disk)); ++ /* FIXME handle NULL result */ + grub_util_info ("dest_ofpath is `%s'", dest_ofpath); + strncpy (boot_devpath, dest_ofpath, + GRUB_BOOT_MACHINE_BOOT_DEVPATH_END + - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1); + boot_devpath[GRUB_BOOT_MACHINE_BOOT_DEVPATH_END + - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1] = 0; ++ free (dest_ofpath); + } + else + { +-- +2.4.3 + diff --git a/0252-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch b/0252-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch new file mode 100644 index 0000000..616285b --- /dev/null +++ b/0252-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch @@ -0,0 +1,38 @@ +From 4192f2e3d1779b71f53580a59f280af1bfda1f3b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 10:20:54 +0100 +Subject: [PATCH 252/506] commands/acpi: Use ALIGN_UP rather than manual + expression. + +Improves readability and hopefully automatic scanning. + +Found by: Coverity Scan. +--- + grub-core/commands/acpi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c +index f66fa2d..5507ffa 100644 +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -265,7 +265,7 @@ grub_acpi_create_ebda (void) + grub_memcpy (target, v2, v2->length); + v2inebda = target; + target += v2->length; +- target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); ++ target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + v2 = 0; + break; + } +@@ -282,7 +282,7 @@ grub_acpi_create_ebda (void) + grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); + v1inebda = target; + target += sizeof (struct grub_acpi_rsdp_v10); +- target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); ++ target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + v1 = 0; + break; + } +-- +2.4.3 + diff --git a/0253-fs-cbfs-cpio-Remove-useless-check-if-mode-is-NULL.patch b/0253-fs-cbfs-cpio-Remove-useless-check-if-mode-is-NULL.patch new file mode 100644 index 0000000..f16616f --- /dev/null +++ b/0253-fs-cbfs-cpio-Remove-useless-check-if-mode-is-NULL.patch @@ -0,0 +1,44 @@ +From 69a52e95d425502945fe43892cebf6b183290e6e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 10:30:43 +0100 +Subject: [PATCH 253/506] fs/{cbfs,cpio}: Remove useless check if mode is NULL. + +Callers already ensure that it's not null. + +Found by: Coverity Scan. +--- + grub-core/fs/cbfs.c | 3 +-- + grub-core/fs/cpio_common.c | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c +index 4ddd683..a34eb88 100644 +--- a/grub-core/fs/cbfs.c ++++ b/grub-core/fs/cbfs.c +@@ -74,8 +74,7 @@ grub_cbfs_find_file (struct grub_archelp_data *data, char **name, + (void) mtime; + offset = grub_be_to_cpu32 (hd.offset); + +- if (mode) +- *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME; ++ *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME; + + namesize = offset; + if (namesize >= sizeof (hd)) +diff --git a/grub-core/fs/cpio_common.c b/grub-core/fs/cpio_common.c +index 20230a7..50fea47 100644 +--- a/grub-core/fs/cpio_common.c ++++ b/grub-core/fs/cpio_common.c +@@ -69,8 +69,7 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, + return GRUB_ERR_NONE; + } + +- if (mode) +- *mode = modeval; ++ *mode = modeval; + + *name = grub_malloc (namesize + 1); + if (*name == NULL) +-- +2.4.3 + diff --git a/0254-fs-zfs-Fix-error-handling.patch b/0254-fs-zfs-Fix-error-handling.patch new file mode 100644 index 0000000..c9eaab7 --- /dev/null +++ b/0254-fs-zfs-Fix-error-handling.patch @@ -0,0 +1,63 @@ +From 0daf46fdbd37627411f3a0dd99390ee4523de1bb Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 16:31:35 +0100 +Subject: [PATCH 254/506] fs/zfs: Fix error handling. + +Found by: Coverity Scan. +--- + grub-core/fs/zfs/zfs.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index c8c7b97..9edac50 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -285,7 +285,7 @@ static const char *spa_feature_names[] = { + + static int + check_feature(const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx); +-static int ++static grub_err_t + check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data ); + + static grub_err_t +@@ -1975,7 +1975,7 @@ dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, + dn->endian) + << SPA_MINBLOCKSHIFT; + *buf = grub_malloc (size); +- if (*buf) ++ if (!*buf) + { + err = grub_errno; + break; +@@ -3979,7 +3979,12 @@ iterate_zap (const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx) + dnode_end_t dn; + grub_memset (&info, 0, sizeof (info)); + +- dnode_get (&(ctx->data->subvol.mdn), val, 0, &dn, ctx->data); ++ err = dnode_get (&(ctx->data->subvol.mdn), val, 0, &dn, ctx->data); ++ if (err) ++ { ++ grub_print_error (); ++ return 0; ++ } + + if (dn.dn.dn_bonustype == DMU_OT_SA) + { +@@ -4200,11 +4205,11 @@ check_feature (const char *name, grub_uint64_t val, + * errnum: Failure. + */ + +-static int ++static grub_err_t + check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data ) + { + grub_uint64_t objnum; +- grub_uint8_t errnum = 0; ++ grub_err_t errnum = 0; + dnode_end_t dn,mosmdn; + mzap_phys_t* mzp; + grub_zfs_endian_t endianzap; +-- +2.4.3 + diff --git a/0255-fs-zfscrypt-Add-missing-explicit-cast.patch b/0255-fs-zfscrypt-Add-missing-explicit-cast.patch new file mode 100644 index 0000000..eeed2d2 --- /dev/null +++ b/0255-fs-zfscrypt-Add-missing-explicit-cast.patch @@ -0,0 +1,26 @@ +From 916733ea6ae90c56797d39bb41b72427da3e1e4f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 16:35:37 +0100 +Subject: [PATCH 255/506] fs/zfscrypt: Add missing explicit cast. + +Found by: Coverity scan. +--- + grub-core/fs/zfs/zfscrypt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/fs/zfs/zfscrypt.c b/grub-core/fs/zfs/zfscrypt.c +index 88dae72..91a0af6 100644 +--- a/grub-core/fs/zfs/zfscrypt.c ++++ b/grub-core/fs/zfs/zfscrypt.c +@@ -238,7 +238,7 @@ grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher, + grub_crypto_xor (out + 16 * i, in + 16 * i, mul, csize); + } + for (j = 0; j < 8; j++) +- mac[15 - j] ^= ((psize * 8) >> (8 * j)); ++ mac[15 - j] ^= ((((grub_uint64_t) psize) * 8) >> (8 * j)); + grub_gcm_mul (mac, h); + + if (mac_out) +-- +2.4.3 + diff --git a/0256-linux-hostdisk-Limit-strcpy-size-to-buffer-size.patch b/0256-linux-hostdisk-Limit-strcpy-size-to-buffer-size.patch new file mode 100644 index 0000000..c1186bd --- /dev/null +++ b/0256-linux-hostdisk-Limit-strcpy-size-to-buffer-size.patch @@ -0,0 +1,35 @@ +From c2fc41990a77923c44a71d616561920ae186db56 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 16:48:53 +0100 +Subject: [PATCH 256/506] linux/hostdisk: Limit strcpy size to buffer size. + +Found by: Coverity scan. +--- + grub-core/osdep/linux/hostdisk.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/osdep/linux/hostdisk.c b/grub-core/osdep/linux/hostdisk.c +index c96427a..75cb8f5 100644 +--- a/grub-core/osdep/linux/hostdisk.c ++++ b/grub-core/osdep/linux/hostdisk.c +@@ -376,7 +376,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f + + part_start = grub_partition_get_start (disk->partition); + +- strcpy (dev, grub_util_biosdisk_get_osdev (disk)); ++ strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev)); + if (disk->partition + && strncmp (dev, "/dev/", 5) == 0) + { +@@ -439,7 +439,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f + if (*max == 0) + *max = ~0ULL; + is_partition = 0; +- strcpy (dev, grub_util_biosdisk_get_osdev (disk)); ++ strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev)); + goto reopen; + } + sector -= part_start; +-- +2.4.3 + diff --git a/0257-linux-ofpath-Fix-error-handling.patch b/0257-linux-ofpath-Fix-error-handling.patch new file mode 100644 index 0000000..3b7a39e --- /dev/null +++ b/0257-linux-ofpath-Fix-error-handling.patch @@ -0,0 +1,38 @@ +From 8f95eae423fc7220af3c1f6150ac35e98281bb96 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 16:49:49 +0100 +Subject: [PATCH 257/506] linux/ofpath: Fix error handling. + +Found by: Coverity Scan. +--- + grub-core/osdep/linux/ofpath.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 4cc171c..f716fd2 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -334,7 +334,7 @@ vendor_is_ATA(const char *path) + } + + static void +-check_sas (char *sysfs_path, int *tgt, unsigned long int *sas_address) ++check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address) + { + char *ed = strstr (sysfs_path, "end_device"); + char *p, *q, *path; +@@ -346,8 +346,10 @@ check_sas (char *sysfs_path, int *tgt, unsigned long int *sas_address) + return; + + /* SAS devices are identified using disk@$PHY_ID */ +- p = strdup (sysfs_path); ++ p = xstrdup (sysfs_path); + ed = strstr(p, "end_device"); ++ if (!ed) ++ return; + + q = ed; + while (*q && *q != '/') +-- +2.4.3 + diff --git a/0258-Document-intentional-fallthroughs.patch b/0258-Document-intentional-fallthroughs.patch new file mode 100644 index 0000000..4b85a9e --- /dev/null +++ b/0258-Document-intentional-fallthroughs.patch @@ -0,0 +1,192 @@ +From 9ee5ae1fae1d7e19f76d4758d9658af90018b0f9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 27 Jan 2015 17:17:58 +0100 +Subject: [PATCH 258/506] Document intentional fallthroughs. + +Found by: Coverity scan. +--- + grub-core/disk/diskfilter.c | 3 +++ + grub-core/font/font.c | 3 ++- + grub-core/fs/udf.c | 1 + + grub-core/lib/legacy_parse.c | 1 + + grub-core/loader/i386/pc/linux.c | 3 +++ + grub-core/normal/charset.c | 1 + + grub-core/video/bochs.c | 1 + + grub-core/video/cirrus.c | 1 + + grub-core/video/i386/pc/vbe.c | 2 ++ + util/getroot.c | 1 + + util/grub-install.c | 2 +- + 11 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index 6124846..80966ac 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -71,10 +71,12 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily) + case GRUB_DISKFILTER_RAID6: + if (!easily) + need--; ++ /* Fallthrough. */ + case GRUB_DISKFILTER_RAID4: + case GRUB_DISKFILTER_RAID5: + if (!easily) + need--; ++ /* Fallthrough. */ + case GRUB_DISKFILTER_STRIPED: + break; + +@@ -584,6 +586,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, + if (seg->node_count == 1) + return grub_diskfilter_read_node (&seg->nodes[0], + sector, size, buf); ++ /* Fallthrough. */ + case GRUB_DISKFILTER_MIRROR: + case GRUB_DISKFILTER_RAID10: + { +diff --git a/grub-core/font/font.c b/grub-core/font/font.c +index 607964b..53d76a6 100644 +--- a/grub-core/font/font.c ++++ b/grub-core/font/font.c +@@ -1286,7 +1286,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, + - grub_font_get_xheight (combining_glyphs[i]->font) - 1; + if (space <= 0) + space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8; +- ++ /* Fallthrough. */ + case GRUB_UNICODE_STACK_ATTACHED_ABOVE: + do_blit (combining_glyphs[i], targetx, + -(ctx.bounds.height + ctx.bounds.y + space +@@ -1327,6 +1327,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, + + combining_glyphs[i]->height); + if (space <= 0) + space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8; ++ /* Fallthrough. */ + + case GRUB_UNICODE_STACK_ATTACHED_BELOW: + do_blit (combining_glyphs[i], targetx, -(ctx.bounds.y - space), +diff --git a/grub-core/fs/udf.c b/grub-core/fs/udf.c +index fd41283..839bff8 100644 +--- a/grub-core/fs/udf.c ++++ b/grub-core/fs/udf.c +@@ -986,6 +986,7 @@ grub_udf_read_symlink (grub_fshelp_node_t node) + case 1: + if (ptr[1]) + goto fail; ++ /* Fallthrough. */ + case 2: + /* in 4 bytes. out: 1 byte. */ + optr = out; +diff --git a/grub-core/lib/legacy_parse.c b/grub-core/lib/legacy_parse.c +index 61266d9..ef56150 100644 +--- a/grub-core/lib/legacy_parse.c ++++ b/grub-core/lib/legacy_parse.c +@@ -664,6 +664,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) + { + case TYPE_FILE_NO_CONSUME: + hold_arg = 1; ++ /* Fallthrough. */ + case TYPE_PARTITION: + case TYPE_FILE: + args[i] = adjust_file (curarg, curarglen); +diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c +index 870992b..a293b17 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -280,10 +280,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + { + case 'g': + shift += 10; ++ /* Fallthrough. */ + case 'm': + shift += 10; ++ /* Fallthrough. */ + case 'k': + shift += 10; ++ /* Fallthrough. */ + default: + break; + } +diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c +index 3e4c337..eeb7ec1 100644 +--- a/grub-core/normal/charset.c ++++ b/grub-core/normal/charset.c +@@ -929,6 +929,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, + case GRUB_BIDI_TYPE_R: + case GRUB_BIDI_TYPE_AL: + bidi_needed = 1; ++ /* Fallthrough. */ + default: + { + if (join_state == JOIN_FORCE) +diff --git a/grub-core/video/bochs.c b/grub-core/video/bochs.c +index 9098f90..3bcfa53 100644 +--- a/grub-core/video/bochs.c ++++ b/grub-core/video/bochs.c +@@ -359,6 +359,7 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, + case 32: + framebuffer.mode_info.reserved_mask_size = 8; + framebuffer.mode_info.reserved_field_pos = 24; ++ /* Fallthrough. */ + + case 24: + framebuffer.mode_info.red_mask_size = 8; +diff --git a/grub-core/video/cirrus.c b/grub-core/video/cirrus.c +index 4913084..e2149e8 100644 +--- a/grub-core/video/cirrus.c ++++ b/grub-core/video/cirrus.c +@@ -440,6 +440,7 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, + case 32: + framebuffer.mode_info.reserved_mask_size = 8; + framebuffer.mode_info.reserved_field_pos = 24; ++ /* Fallthrough. */ + + case 24: + framebuffer.mode_info.red_mask_size = 8; +diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c +index 07a614a..b7f9119 100644 +--- a/grub-core/video/i386/pc/vbe.c ++++ b/grub-core/video/i386/pc/vbe.c +@@ -874,6 +874,7 @@ vbe2videoinfo (grub_uint32_t mode, + /* CGA is basically 4-bit packed pixel. */ + case GRUB_VBE_MEMORY_MODEL_CGA: + mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_CGA; ++ /* Fallthrough. */ + case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: + mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + break; +@@ -886,6 +887,7 @@ vbe2videoinfo (grub_uint32_t mode, + /* Non chain 4 is a special case of planar. */ + case GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256: + mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_NONCHAIN4; ++ /* Fallthrough. */ + case GRUB_VBE_MEMORY_MODEL_PLANAR: + mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PLANAR + | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; +diff --git a/util/getroot.c b/util/getroot.c +index 345d49b..3c1f12d 100644 +--- a/util/getroot.c ++++ b/util/getroot.c +@@ -107,6 +107,7 @@ grub_util_pull_device (const char *os_dev) + default: + if (grub_util_pull_device_os (os_dev, ab)) + return; ++ /* Fallthrough. */ + case GRUB_DEV_ABSTRACTION_NONE: + free (grub_util_biosdisk_get_grub_dev (os_dev)); + return; +diff --git a/util/grub-install.c b/util/grub-install.c +index 210f4a7..cedc188 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -1809,7 +1809,7 @@ main (int argc, char *argv[]) + grub_install_copy_file (imgfile, dst, 1); + free (dst); + } +- ++ /* Fallthrough. */ + case GRUB_INSTALL_PLATFORM_X86_64_EFI: + if (efidir_is_mac) + { +-- +2.4.3 + diff --git a/0259-linux-hostdisk-use-strncpy-instead-of-strlcpy.patch b/0259-linux-hostdisk-use-strncpy-instead-of-strlcpy.patch new file mode 100644 index 0000000..20678b0 --- /dev/null +++ b/0259-linux-hostdisk-use-strncpy-instead-of-strlcpy.patch @@ -0,0 +1,39 @@ +From 7ba137f6286dcd17a1104f1dfc6eb1f58c5ef743 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 20:00:23 +0300 +Subject: [PATCH 259/506] linux/hostdisk: use strncpy instead of strlcpy + +strlcpy is not available on Linux as part of standard libraries. +It probably is not worth extra configure checks espicially as we +need to handle missing function anyway. +--- + grub-core/osdep/linux/hostdisk.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/grub-core/osdep/linux/hostdisk.c b/grub-core/osdep/linux/hostdisk.c +index 75cb8f5..06179fc 100644 +--- a/grub-core/osdep/linux/hostdisk.c ++++ b/grub-core/osdep/linux/hostdisk.c +@@ -376,7 +376,8 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f + + part_start = grub_partition_get_start (disk->partition); + +- strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev)); ++ strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); ++ dev[sizeof(dev) - 1] = '\0'; + if (disk->partition + && strncmp (dev, "/dev/", 5) == 0) + { +@@ -439,7 +440,8 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f + if (*max == 0) + *max = ~0ULL; + is_partition = 0; +- strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev)); ++ strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); ++ dev[sizeof(dev) - 1] = '\0'; + goto reopen; + } + sector -= part_start; +-- +2.4.3 + diff --git a/0260-linux-ofpath-fix-descriptor-leak.patch b/0260-linux-ofpath-fix-descriptor-leak.patch new file mode 100644 index 0000000..7aadf2a --- /dev/null +++ b/0260-linux-ofpath-fix-descriptor-leak.patch @@ -0,0 +1,26 @@ +From 637fc62699e7ae3f0057e1c56d330eb193fd40b6 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 20:29:00 +0300 +Subject: [PATCH 260/506] linux/ofpath: fix descriptor leak + +Found by: Coverity scan +--- + grub-core/osdep/linux/ofpath.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index f716fd2..05b1ecd 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -122,6 +122,8 @@ find_obppath (const char *sysfs_path_orig) + fd = open(path, O_RDONLY); + if (fd < 0 || fstat (fd, &st) < 0) + { ++ if (fd >= 0) ++ close (fd); + snprintf(path, path_size, "%s/devspec", sysfs_path); + fd = open(path, O_RDONLY); + } +-- +2.4.3 + diff --git a/0261-fs-zfs-zfs.c-fix-memory-leak.patch b/0261-fs-zfs-zfs.c-fix-memory-leak.patch new file mode 100644 index 0000000..3a40e60 --- /dev/null +++ b/0261-fs-zfs-zfs.c-fix-memory-leak.patch @@ -0,0 +1,26 @@ +From e871994849802889af1ad26ddde68e9a12466ba1 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 20:52:27 +0300 +Subject: [PATCH 261/506] fs/zfs/zfs.c: fix memory leak. + +Found by: Coverity scan. +--- + grub-core/fs/zfs/zfs.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 9edac50..057b471 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -2835,6 +2835,8 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, + if (!path_buf) + { + grub_free (oldpathbuf); ++ if (free_symval) ++ grub_free (sym_value); + return grub_errno; + } + grub_memcpy (path, sym_value, sym_sz); +-- +2.4.3 + diff --git a/0262-commands-parttool-fix-memory-leak.patch b/0262-commands-parttool-fix-memory-leak.patch new file mode 100644 index 0000000..07ee418 --- /dev/null +++ b/0262-commands-parttool-fix-memory-leak.patch @@ -0,0 +1,30 @@ +From 3db4f05a10e98a4835ddd87f9d1ef9185e8eef84 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 20:55:25 +0300 +Subject: [PATCH 262/506] commands/parttool: fix memory leak. + +Found by: Coverity scan. +--- + grub-core/commands/parttool.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c +index d907694..42c590e 100644 +--- a/grub-core/commands/parttool.c ++++ b/grub-core/commands/parttool.c +@@ -282,8 +282,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), + break; + } + if (! cur) +- return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), ++ { ++ grub_device_close (dev); ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), + args[i]); ++ } + ptool = cur; + pargs = (struct grub_parttool_args *) + grub_zalloc (ptool->nargs * sizeof (struct grub_parttool_args)); +-- +2.4.3 + diff --git a/0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch b/0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch new file mode 100644 index 0000000..2edb3d6 --- /dev/null +++ b/0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch @@ -0,0 +1,67 @@ +From fa13e605270f46dc78cbfded62e4cc58a31dff50 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 21:12:19 +0300 +Subject: [PATCH 263/506] fs/zfs/zfscrypt.c: fix memory leaks. + +Found by: Coverity scan. +--- + grub-core/fs/zfs/zfscrypt.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/grub-core/fs/zfs/zfscrypt.c b/grub-core/fs/zfs/zfscrypt.c +index 91a0af6..834f858 100644 +--- a/grub-core/fs/zfs/zfscrypt.c ++++ b/grub-core/fs/zfs/zfscrypt.c +@@ -354,6 +354,7 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + if (err) + { + grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (cipher); + continue; + } + +@@ -362,6 +363,7 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + if (err) + { + grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (cipher); + continue; + } + +@@ -372,6 +374,7 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + { + grub_dprintf ("zfs", "key loading failed\n"); + grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (cipher); + continue; + } + +@@ -381,12 +384,14 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + { + grub_dprintf ("zfs", "key loading failed\n"); + grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (cipher); + continue; + } + ret = grub_crypto_cipher_open (GRUB_CIPHER_AES); + if (!ret) + { + grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (cipher); + continue; + } + err = grub_crypto_cipher_set_key (ret, decrypted, keylen); +@@ -394,8 +399,10 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + { + grub_errno = GRUB_ERR_NONE; + grub_crypto_cipher_close (ret); ++ grub_crypto_cipher_close (cipher); + continue; + } ++ grub_crypto_cipher_close (cipher); + return ret; + } + return NULL; +-- +2.4.3 + diff --git a/0264-fs-zfs-zfscrypt.c-fix-indentation.patch b/0264-fs-zfs-zfscrypt.c-fix-indentation.patch new file mode 100644 index 0000000..935e1fa --- /dev/null +++ b/0264-fs-zfs-zfscrypt.c-fix-indentation.patch @@ -0,0 +1,33 @@ +From 3900726fa8a794869c42a0a33fbd96b5cd4ba14f Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 21:13:10 +0300 +Subject: [PATCH 264/506] fs/zfs/zfscrypt.c: fix indentation. + +--- + grub-core/fs/zfs/zfscrypt.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/grub-core/fs/zfs/zfscrypt.c b/grub-core/fs/zfs/zfscrypt.c +index 834f858..87eef62 100644 +--- a/grub-core/fs/zfs/zfscrypt.c ++++ b/grub-core/fs/zfs/zfscrypt.c +@@ -397,11 +397,11 @@ grub_zfs_load_key_real (const struct grub_zfs_key *key, + err = grub_crypto_cipher_set_key (ret, decrypted, keylen); + if (err) + { +- grub_errno = GRUB_ERR_NONE; +- grub_crypto_cipher_close (ret); +- grub_crypto_cipher_close (cipher); +- continue; +- } ++ grub_errno = GRUB_ERR_NONE; ++ grub_crypto_cipher_close (ret); ++ grub_crypto_cipher_close (cipher); ++ continue; ++ } + grub_crypto_cipher_close (cipher); + return ret; + } +-- +2.4.3 + diff --git a/0265-fs-hfsplus-fix-memory-leak.patch b/0265-fs-hfsplus-fix-memory-leak.patch new file mode 100644 index 0000000..9f1a840 --- /dev/null +++ b/0265-fs-hfsplus-fix-memory-leak.patch @@ -0,0 +1,41 @@ +From edc94e4b0bd026bf08861a4f4010a36bec0775cd Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 21:19:28 +0300 +Subject: [PATCH 265/506] fs/hfsplus: fix memory leak. + +Found by: Coverity scan. +--- + grub-core/fs/hfsplus.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c +index 950d8a1..8f07f85 100644 +--- a/grub-core/fs/hfsplus.c ++++ b/grub-core/fs/hfsplus.c +@@ -723,7 +723,10 @@ list_nodes (void *record, void *hook_arg) + + /* If the name is obviously invalid, skip this node. */ + if (catkey->name[i] == 0) +- return 0; ++ { ++ grub_free (filename); ++ return 0; ++ } + } + + *grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name, +@@ -745,7 +748,10 @@ list_nodes (void *record, void *hook_arg) + callback function. */ + node = grub_malloc (sizeof (*node)); + if (!node) +- return 1; ++ { ++ grub_free (filename); ++ return 1; ++ } + node->data = ctx->dir->data; + node->compressed = 0; + node->cbuf = 0; +-- +2.4.3 + diff --git a/0266-util-grub-probe-fix-memory-leaks.patch b/0266-util-grub-probe-fix-memory-leaks.patch new file mode 100644 index 0000000..0002841 --- /dev/null +++ b/0266-util-grub-probe-fix-memory-leaks.patch @@ -0,0 +1,50 @@ +From 11aae26cc374d01c9bf4fa33f792bff16b444ef5 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 21:29:55 +0300 +Subject: [PATCH 266/506] util/grub-probe: fix memory leaks. + +Found by: Coverity scan. +--- + util/grub-probe.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index ecb7b6b..8a0c4f3 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -295,6 +295,7 @@ probe (const char *path, char **device_names, char delim) + } + printf ("%s", disk); + putchar (delim); ++ free (disk); + } + return; + } +@@ -496,6 +497,7 @@ probe (const char *path, char **device_names, char delim) + { + grub_util_fprint_full_disk_name (stdout, dev->disk->name, dev); + putchar (delim); ++ grub_device_close (dev); + continue; + } + +@@ -542,7 +544,7 @@ probe (const char *path, char **device_names, char delim) + if (print == PRINT_IEEE1275_HINT) + { + const char *osdev = grub_util_biosdisk_get_osdev (dev->disk); +- const char *ofpath = grub_util_devname_to_ofpath (osdev); ++ char *ofpath = grub_util_devname_to_ofpath (osdev); + const char *map; + + map = grub_util_biosdisk_get_compatibility_hint (dev->disk); +@@ -560,6 +562,7 @@ probe (const char *path, char **device_names, char delim) + strcpy (p, ofpath); + grub_util_fprint_full_disk_name (stdout, tmp, dev); + free (tmp); ++ free (ofpath); + putchar (delim); + } + +-- +2.4.3 + diff --git a/0267-loader-xnu-fix-memory-leak.patch b/0267-loader-xnu-fix-memory-leak.patch new file mode 100644 index 0000000..686d4b1 --- /dev/null +++ b/0267-loader-xnu-fix-memory-leak.patch @@ -0,0 +1,53 @@ +From fbb4aa1c050162bef5478b5441abeeaefb4d94f2 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 21:49:45 +0300 +Subject: [PATCH 267/506] loader/xnu: fix memory leak. + +Foound by: Coverity scan. +--- + grub-core/loader/xnu.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/grub-core/loader/xnu.c b/grub-core/loader/xnu.c +index bc89cdf..c9885b1 100644 +--- a/grub-core/loader/xnu.c ++++ b/grub-core/loader/xnu.c +@@ -689,10 +689,10 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile, + /* Allocate the space. */ + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) +- return err; ++ goto fail; + err = grub_xnu_heap_malloc (neededspace, &buf0, &buf_target); + if (err) +- return err; ++ goto fail; + buf = buf0; + + exthead = (struct grub_xnu_extheader *) buf; +@@ -709,10 +709,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile, + else + err = grub_macho_readfile32 (macho, filename, buf); + if (err) +- { +- grub_macho_close (macho); +- return err; +- } ++ goto fail; + grub_macho_close (macho); + buf += machosize; + } +@@ -747,6 +744,10 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile, + /* Announce to kernel */ + return grub_xnu_register_memory ("Driver-", &driversnum, buf_target, + neededspace); ++fail: ++ if (macho) ++ grub_macho_close (macho); ++ return err; + } + + /* Load mkext. */ +-- +2.4.3 + diff --git a/0268-Change-quotes-to-match-overall-style-in-NEWS.patch b/0268-Change-quotes-to-match-overall-style-in-NEWS.patch new file mode 100644 index 0000000..98675a1 --- /dev/null +++ b/0268-Change-quotes-to-match-overall-style-in-NEWS.patch @@ -0,0 +1,25 @@ +From 1a4e47879c55390bd80e6f06bee68317b4f16cfa Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Jan 2015 22:34:50 +0300 +Subject: [PATCH 268/506] Change quotes to match overall style in NEWS + +--- + NEWS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/NEWS b/NEWS +index 55f09d6..e417eba 100644 +--- a/NEWS ++++ b/NEWS +@@ -85,7 +85,7 @@ New in 2.02: + * Support for USB debug dongles. + * Support for *-emu on all platforms (previously only i386/x86_64 worked). + * Support *-emu on Windows. +- * New platform "none" which builds only user level utilities. This is now ++ * New platform `none' which builds only user level utilities. This is now + default if target CPU is not supported. + + * Security: +-- +2.4.3 + diff --git a/0269-syslinux_parse-fix-memory-leak.patch b/0269-syslinux_parse-fix-memory-leak.patch new file mode 100644 index 0000000..0e6a758 --- /dev/null +++ b/0269-syslinux_parse-fix-memory-leak.patch @@ -0,0 +1,26 @@ +From 2efab86d5a45da41adbe20ac59cc4d5b946de61e Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Wed, 28 Jan 2015 20:09:25 +0300 +Subject: [PATCH 269/506] syslinux_parse: fix memory leak. + +Found by: Coverity scan. +--- + grub-core/lib/syslinux_parse.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index f605326..2c874b1 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -922,6 +922,8 @@ write_entry (struct output_buffer *outbuf, + + print_string ("\n"); + } ++ if (ptr && *ptr) ++ grub_free (cmdline); + } + break; + case KERNEL_CHAINLOADER: +-- +2.4.3 + diff --git a/0270-script-execute.c-fix-memory-leak.patch b/0270-script-execute.c-fix-memory-leak.patch new file mode 100644 index 0000000..27824d8 --- /dev/null +++ b/0270-script-execute.c-fix-memory-leak.patch @@ -0,0 +1,148 @@ +From 9883307a527a0d0e39fe9d500c22ef3eccda83ba Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Wed, 28 Jan 2015 20:35:28 +0300 +Subject: [PATCH 270/506] script/execute.c: fix memory leak. + +Make sure to continue loop over array after failure to free +allocated strings. + +Found by: Coverity scan. +--- + grub-core/script/execute.c | 120 ++++++++++++++++++++++++++------------------- + 1 file changed, 70 insertions(+), 50 deletions(-) + +diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c +index afd5513..bb70ebf 100644 +--- a/grub-core/script/execute.c ++++ b/grub-core/script/execute.c +@@ -635,57 +635,77 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, + { + case GRUB_SCRIPT_ARG_TYPE_VAR: + case GRUB_SCRIPT_ARG_TYPE_DQVAR: +- values = grub_script_env_get (arg->str, arg->type); +- for (i = 0; values && values[i]; i++) +- { +- if (i != 0 && grub_script_argv_next (&result)) +- goto fail; ++ { ++ int need_cleanup = 0; + +- if (arg->type == GRUB_SCRIPT_ARG_TYPE_VAR) +- { +- int len; +- char ch; +- char *p; +- char *op; +- const char *s = values[i]; +- +- len = grub_strlen (values[i]); +- /* \? -> \\\? */ +- /* \* -> \\\* */ +- /* \ -> \\ */ +- p = grub_malloc (len * 2 + 1); +- if (! p) +- goto fail; +- +- op = p; +- while ((ch = *s++)) +- { +- if (ch == '\\') +- { +- *op++ = '\\'; +- if (*s == '?' || *s == '*') +- *op++ = '\\'; +- } +- *op++ = ch; +- } +- *op = '\0'; +- +- if (grub_script_argv_append (&result, p, op - p)) +- { +- grub_free (p); +- goto fail; +- } +- } +- else +- { +- if (append (&result, values[i], 1)) +- goto fail; +- } +- +- grub_free (values[i]); +- } +- grub_free (values); +- break; ++ values = grub_script_env_get (arg->str, arg->type); ++ for (i = 0; values && values[i]; i++) ++ { ++ if (!need_cleanup) ++ { ++ if (i != 0 && grub_script_argv_next (&result)) ++ { ++ need_cleanup = 1; ++ goto cleanup; ++ } ++ ++ if (arg->type == GRUB_SCRIPT_ARG_TYPE_VAR) ++ { ++ int len; ++ char ch; ++ char *p; ++ char *op; ++ const char *s = values[i]; ++ ++ len = grub_strlen (values[i]); ++ /* \? -> \\\? */ ++ /* \* -> \\\* */ ++ /* \ -> \\ */ ++ p = grub_malloc (len * 2 + 1); ++ if (! p) ++ { ++ need_cleanup = 1; ++ goto cleanup; ++ } ++ ++ op = p; ++ while ((ch = *s++)) ++ { ++ if (ch == '\\') ++ { ++ *op++ = '\\'; ++ if (*s == '?' || *s == '*') ++ *op++ = '\\'; ++ } ++ *op++ = ch; ++ } ++ *op = '\0'; ++ ++ if (grub_script_argv_append (&result, p, op - p)) ++ { ++ grub_free (p); ++ need_cleanup = 1; ++ /* Fall through to cleanup */ ++ } ++ } ++ else ++ { ++ if (append (&result, values[i], 1)) ++ need_cleanup = 1; ++ /* Fall through to cleanup */ ++ } ++ } ++ ++cleanup: ++ grub_free (values[i]); ++ } ++ grub_free (values); ++ ++ if (need_cleanup) ++ goto fail; ++ ++ break; ++ } + + case GRUB_SCRIPT_ARG_TYPE_BLOCK: + { +-- +2.4.3 + diff --git a/0271-configure.ac-don-t-use-msoft-float-for-arm64.patch b/0271-configure.ac-don-t-use-msoft-float-for-arm64.patch new file mode 100644 index 0000000..a6f12bc --- /dev/null +++ b/0271-configure.ac-don-t-use-msoft-float-for-arm64.patch @@ -0,0 +1,33 @@ +From 2da4171eabfe0d1b9b1be6146f628099d08aac02 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Wed, 28 Jan 2015 20:17:18 +0000 +Subject: [PATCH 271/506] configure.ac: don't use -msoft-float for arm64 + +aarch64 toolchains do not support the -msoft-float option added by +commit 3661261f. Insted, for arm64 use -march=armv8-a+nofp+nosimd. + +Reported-by: Ryan Harkin +--- + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index a3bca06..6d31ed0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -678,7 +678,11 @@ 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. +-TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float" ++if test "x$target_cpu" = xarm64; then ++ TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd" ++else ++ TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float" ++fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind + # information in some cases where it previously did not. GRUB doesn't need +-- +2.4.3 + diff --git a/0272-test-do-not-stop-after-first-file-test-or-closing-br.patch b/0272-test-do-not-stop-after-first-file-test-or-closing-br.patch new file mode 100644 index 0000000..3d919ee --- /dev/null +++ b/0272-test-do-not-stop-after-first-file-test-or-closing-br.patch @@ -0,0 +1,63 @@ +From d29259b134257458a98c1ddc05d2a36c677ded37 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 20:10:43 +0300 +Subject: [PATCH 272/506] test: do not stop after first file test or closing + bracket + +Closes: 44115 +--- + grub-core/commands/test.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/grub-core/commands/test.c b/grub-core/commands/test.c +index c98c13d..f58b87c 100644 +--- a/grub-core/commands/test.c ++++ b/grub-core/commands/test.c +@@ -332,7 +332,7 @@ test_parse (char **args, int *argn, int argc) + get_fileinfo (args[*argn + 1], &ctx); + update_val (ctx.file_exists && ctx.file_info.dir, &ctx); + (*argn) += 2; +- return ctx.or || ctx.and; ++ continue; + } + + if (grub_strcmp (args[*argn], "-e") == 0) +@@ -340,7 +340,7 @@ test_parse (char **args, int *argn, int argc) + get_fileinfo (args[*argn + 1], &ctx); + update_val (ctx.file_exists, &ctx); + (*argn) += 2; +- return ctx.or || ctx.and; ++ continue; + } + + if (grub_strcmp (args[*argn], "-f") == 0) +@@ -349,7 +349,7 @@ test_parse (char **args, int *argn, int argc) + /* FIXME: check for other types. */ + update_val (ctx.file_exists && ! ctx.file_info.dir, &ctx); + (*argn) += 2; +- return ctx.or || ctx.and; ++ continue; + } + + if (grub_strcmp (args[*argn], "-s") == 0) +@@ -362,7 +362,7 @@ test_parse (char **args, int *argn, int argc) + grub_file_close (file); + grub_errno = GRUB_ERR_NONE; + (*argn) += 2; +- return ctx.or || ctx.and; ++ continue; + } + + /* String tests. */ +@@ -387,7 +387,7 @@ test_parse (char **args, int *argn, int argc) + if (grub_strcmp (args[*argn], ")") == 0) + { + (*argn)++; +- return ctx.or || ctx.and; ++ continue; + } + /* Recursively invoke if parenthesis. */ + if (grub_strcmp (args[*argn], "(") == 0) +-- +2.4.3 + diff --git a/0273-test-fix-previous-commit-we-need-to-return-from-sube.patch b/0273-test-fix-previous-commit-we-need-to-return-from-sube.patch new file mode 100644 index 0000000..98405a3 --- /dev/null +++ b/0273-test-fix-previous-commit-we-need-to-return-from-sube.patch @@ -0,0 +1,28 @@ +From 958167b91cdebe55c6cccdd28ad007c554df56d7 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 20:21:56 +0300 +Subject: [PATCH 273/506] test: fix previous commit - we need to return from + subexpression + +( ... ) was processed recursively, we need to return from it. Revert +this change. +--- + grub-core/commands/test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/commands/test.c b/grub-core/commands/test.c +index f58b87c..5f06642 100644 +--- a/grub-core/commands/test.c ++++ b/grub-core/commands/test.c +@@ -387,7 +387,7 @@ test_parse (char **args, int *argn, int argc) + if (grub_strcmp (args[*argn], ")") == 0) + { + (*argn)++; +- continue; ++ return ctx.or || ctx.and; + } + /* Recursively invoke if parenthesis. */ + if (grub_strcmp (args[*argn], "(") == 0) +-- +2.4.3 + diff --git a/0274-test-consistently-use-TMPDIR-and-same-name-pattern-f.patch b/0274-test-consistently-use-TMPDIR-and-same-name-pattern-f.patch new file mode 100644 index 0000000..27b7a3b --- /dev/null +++ b/0274-test-consistently-use-TMPDIR-and-same-name-pattern-f.patch @@ -0,0 +1,41 @@ +From f153fcb5a5863d7ce190cfc531b7dff1000316a0 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 20:31:20 +0300 +Subject: [PATCH 274/506] test: consistently use TMPDIR and same name pattern + for temp files + +--- + tests/test_sha512sum.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_sha512sum.in b/tests/test_sha512sum.in +index 524c1d1..d5ef7f9 100644 +--- a/tests/test_sha512sum.in ++++ b/tests/test_sha512sum.in +@@ -1,7 +1,7 @@ + #! /bin/bash + + # create a randome file +-file=`mktemp` ++file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 + cat >$file <$outfile1 <$outfile2 + + SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ ` +-- +2.4.3 + diff --git a/0275-tests-add-test-command-file-tests.patch b/0275-tests-add-test-command-file-tests.patch new file mode 100644 index 0000000..cb42a34 --- /dev/null +++ b/0275-tests-add-test-command-file-tests.patch @@ -0,0 +1,107 @@ +From 1e047e53aeb684a3a21a4269a99c708c381b96b5 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 21:42:46 +0300 +Subject: [PATCH 275/506] tests: add test command file tests + +This requires access to files in both host and grub image, so +implementing as separate test unit instead of script test was +more easy. +--- + Makefile.util.def | 6 +++++ + tests/grub_cmd_test.in | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 73 insertions(+) + create mode 100644 tests/grub_cmd_test.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index fed96d8..378b577 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -1156,6 +1156,12 @@ script = { + common = tests/file_filter_test.in; + }; + ++script = { ++ testcase; ++ name = grub_cmd_test; ++ common = tests/grub_cmd_test.in; ++}; ++ + program = { + testcase; + name = example_unit_test; +diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.in +new file mode 100644 +index 0000000..6269891 +--- /dev/null ++++ b/tests/grub_cmd_test.in +@@ -0,0 +1,67 @@ ++#! /bin/bash ++ ++# create a randome file ++empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 ++non_empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 ++cat >$non_empty <$outfile < /dev/null 2>&1; then ++ echo "GRUB test command file tests failed." ++ cat "$outfile" ++ exit 1 ++else ++ rm -f "${outfile}" ++ exit 0 ++fi +-- +2.4.3 + diff --git a/0276-net-ip-check-result-of-grub_netbuff_push.patch b/0276-net-ip-check-result-of-grub_netbuff_push.patch new file mode 100644 index 0000000..c54f912 --- /dev/null +++ b/0276-net-ip-check-result-of-grub_netbuff_push.patch @@ -0,0 +1,59 @@ +From b40fde29a446d9fa5a6ebea7aafb34e3c958afbb Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 22:09:51 +0300 +Subject: [PATCH 276/506] net/ip: check result of grub_netbuff_push + +Found by: Coverity scan. +--- + grub-core/net/ip.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c +index 5a60954..8c56baa 100644 +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -191,15 +191,18 @@ grub_net_send_ip4_packet (struct grub_net_network_level_interface *inf, + grub_net_ip_protocol_t proto) + { + struct iphdr *iph; ++ grub_err_t err; + + COMPILE_TIME_ASSERT (GRUB_NET_OUR_IPV4_HEADER_SIZE == sizeof (*iph)); + + if (nb->tail - nb->data + sizeof (struct iphdr) > inf->card->mtu) + return send_fragmented (inf, target, nb, proto, *ll_target_addr); + +- grub_netbuff_push (nb, sizeof (*iph)); +- iph = (struct iphdr *) nb->data; ++ err = grub_netbuff_push (nb, sizeof (*iph)); ++ if (err) ++ return err; + ++ iph = (struct iphdr *) nb->data; + iph->verhdrlen = ((4 << 4) | 5); + iph->service = 0; + iph->len = grub_cpu_to_be16 (nb->tail - nb->data); +@@ -602,15 +605,18 @@ grub_net_send_ip6_packet (struct grub_net_network_level_interface *inf, + grub_net_ip_protocol_t proto) + { + struct ip6hdr *iph; ++ grub_err_t err; + + COMPILE_TIME_ASSERT (GRUB_NET_OUR_IPV6_HEADER_SIZE == sizeof (*iph)); + + if (nb->tail - nb->data + sizeof (struct iphdr) > inf->card->mtu) + return grub_error (GRUB_ERR_NET_PACKET_TOO_BIG, "packet too big"); + +- grub_netbuff_push (nb, sizeof (*iph)); +- iph = (struct ip6hdr *) nb->data; ++ err = grub_netbuff_push (nb, sizeof (*iph)); ++ if (err) ++ return err; + ++ iph = (struct ip6hdr *) nb->data; + iph->version_class_flow = grub_cpu_to_be32_compile_time ((6 << 28)); + iph->len = grub_cpu_to_be16 (nb->tail - nb->data - sizeof (*iph)); + iph->protocol = proto; +-- +2.4.3 + diff --git a/0277-grub-mkimage-fix-potential-NULL-pointer-dereference.patch b/0277-grub-mkimage-fix-potential-NULL-pointer-dereference.patch new file mode 100644 index 0000000..4aa4721 --- /dev/null +++ b/0277-grub-mkimage-fix-potential-NULL-pointer-dereference.patch @@ -0,0 +1,37 @@ +From 7aaed66455cc172bd9a3db1893925aa156ba2e14 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 22:26:05 +0300 +Subject: [PATCH 277/506] grub-mkimage: fix potential NULL pointer dereference + +Move fatal check whether symtab_section is NULL before first reference. + +Found by: Coverity scan. +--- + util/grub-mkimagexx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c +index 0a1ac9e..3c76d07 100644 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -1539,6 +1539,8 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, + symtab_section = s; + break; + } ++ if (! symtab_section) ++ grub_util_error ("%s", _("no symbol table")); + + #ifdef MKIMAGE_ELF32 + if (image_target->elf_target == EM_ARM) +@@ -1577,8 +1579,6 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, + } + #endif + +- if (! symtab_section) +- grub_util_error ("%s", _("no symbol table")); + } + else + { +-- +2.4.3 + diff --git a/0278-net-pxe-fix-error-condition.patch b/0278-net-pxe-fix-error-condition.patch new file mode 100644 index 0000000..6d5c7aa --- /dev/null +++ b/0278-net-pxe-fix-error-condition.patch @@ -0,0 +1,30 @@ +From 12abe75aa03695dfa5f6963013a5eb20f656224d Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 22:39:11 +0300 +Subject: [PATCH 278/506] net/pxe: fix error condition + +Test return value of grub_netbuff_reserve(), buf itself cannot be +NULL here. + +Found by: Coverity scan. +--- + grub-core/net/drivers/i386/pc/pxe.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/grub-core/net/drivers/i386/pc/pxe.c b/grub-core/net/drivers/i386/pc/pxe.c +index e8c0b22..3f4152d 100644 +--- a/grub-core/net/drivers/i386/pc/pxe.c ++++ b/grub-core/net/drivers/i386/pc/pxe.c +@@ -218,8 +218,7 @@ grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused))) + return NULL; + /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible + by 4. So that IP header is aligned on 4 bytes. */ +- grub_netbuff_reserve (buf, 2); +- if (!buf) ++ if (grub_netbuff_reserve (buf, 2)) + { + grub_netbuff_free (buf); + return NULL; +-- +2.4.3 + diff --git a/0279-grub-fstest-fix-descriptor-leak.patch b/0279-grub-fstest-fix-descriptor-leak.patch new file mode 100644 index 0000000..a672151 --- /dev/null +++ b/0279-grub-fstest-fix-descriptor-leak.patch @@ -0,0 +1,31 @@ +From 151c19a42a8ea76395fdb579221198156da9c026 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 22:45:58 +0300 +Subject: [PATCH 279/506] grub-fstest: fix descriptor leak + +Found by: Coverity scan. +--- + util/grub-fstest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-fstest.c b/util/grub-fstest.c +index 31af2a7..02cd3e3 100644 +--- a/util/grub-fstest.c ++++ b/util/grub-fstest.c +@@ -570,12 +570,12 @@ argp_parser (int key, char *arg, struct argp_state *state) + return 0; + } + real_size = fread (buf, 1, 1024, f); ++ fclose (f); + if (real_size < 0) + { + printf (_("%s: error:"), program_name); + printf (_("cannot read `%s': %s"), arg, strerror (errno)); + printf ("\n"); +- fclose (f); + return 0; + } + grub_zfs_add_key (buf, real_size, 0); +-- +2.4.3 + diff --git a/0280-setup-fix-blocklist-size-calculation.patch b/0280-setup-fix-blocklist-size-calculation.patch new file mode 100644 index 0000000..6668934 --- /dev/null +++ b/0280-setup-fix-blocklist-size-calculation.patch @@ -0,0 +1,26 @@ +From 016875dd52456c38c8dee55a8390c0f9fc092afe Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 30 Jan 2015 22:57:39 +0300 +Subject: [PATCH 280/506] setup: fix blocklist size calculation + +Found by: Coverity scan. +--- + util/setup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/setup.c b/util/setup.c +index b299159..8f20e99 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -529,7 +529,7 @@ SETUP (const char *dir, + bl.block = bl.first_block; + while (bl.block->len) + { +- grub_memset (bl.block, 0, sizeof (bl.block)); ++ grub_memset (bl.block, 0, sizeof (*bl.block)); + + bl.block--; + +-- +2.4.3 + diff --git a/0281-arm-implement-additional-relocations-generated-by-gc.patch b/0281-arm-implement-additional-relocations-generated-by-gc.patch new file mode 100644 index 0000000..ddf20a2 --- /dev/null +++ b/0281-arm-implement-additional-relocations-generated-by-gc.patch @@ -0,0 +1,113 @@ +From c0f529ea679bdf48cbe1c4b3dd92fb552456a1fe Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Tue, 3 Feb 2015 21:16:36 +0000 +Subject: [PATCH 281/506] arm: implement additional relocations generated by + gcc 4.9 at -O3 + +GCC 4.9 also generates R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_ABS, +as an alternative to ABS32. + +Signed-off-by: Leif Lindholm +--- + grub-core/kern/arm/dl.c | 15 +++++++++++++++ + grub-core/kern/arm/dl_helper.c | 39 +++++++++++++++++++++++++++++++++++++++ + include/grub/arm/reloc.h | 5 +++++ + 3 files changed, 59 insertions(+) + +diff --git a/grub-core/kern/arm/dl.c b/grub-core/kern/arm/dl.c +index 57cac2e..5cbd65e 100644 +--- a/grub-core/kern/arm/dl.c ++++ b/grub-core/kern/arm/dl.c +@@ -205,6 +205,21 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, + */ + case R_ARM_V4BX: + break; ++ case R_ARM_THM_MOVW_ABS_NC: ++ case R_ARM_THM_MOVT_ABS: ++ { ++ grub_uint32_t offset; ++ offset = grub_arm_thm_movw_movt_get_value((grub_uint16_t *) target); ++ offset += sym_addr; ++ ++ if (ELF_R_TYPE (rel->r_info) == R_ARM_THM_MOVT_ABS) ++ offset >>= 16; ++ else ++ offset &= 0xffff; ++ ++ grub_arm_thm_movw_movt_set_value((grub_uint16_t *) target, offset); ++ } ++ break; + case R_ARM_THM_JUMP19: + { + /* Thumb instructions can be 16-bit aligned */ +diff --git a/grub-core/kern/arm/dl_helper.c b/grub-core/kern/arm/dl_helper.c +index 5721939..8a72632 100644 +--- a/grub-core/kern/arm/dl_helper.c ++++ b/grub-core/kern/arm/dl_helper.c +@@ -25,6 +25,20 @@ + #include + #include + ++static inline grub_uint32_t ++thumb_get_instruction_word(grub_uint16_t *target) ++{ ++ /* Extract instruction word in alignment-safe manner */ ++ return grub_le_to_cpu16 ((*target)) << 16 | grub_le_to_cpu16 (*(target + 1)); ++} ++ ++static inline void ++thumb_set_instruction_word(grub_uint16_t *target, grub_uint32_t insword) ++{ ++ *target = grub_cpu_to_le16 (insword >> 16); ++ *(target + 1) = grub_cpu_to_le16 (insword & 0xffff); ++} ++ + /* + * R_ARM_ABS32 + * +@@ -214,3 +228,28 @@ grub_arm_jump24_set_offset (grub_uint32_t *target, + + *target = grub_cpu_to_le32 (insword); + } ++ ++grub_uint16_t ++grub_arm_thm_movw_movt_get_value (grub_uint16_t *target) ++{ ++ grub_uint32_t insword; ++ ++ insword = thumb_get_instruction_word (target); ++ ++ return ((insword & 0xf0000) >> 4) | ((insword & 0x04000000) >> 15) | \ ++ ((insword & 0x7000) >> 4) | (insword & 0xff); ++} ++ ++void ++grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value) ++{ ++ grub_uint32_t insword; ++ ++ insword = thumb_get_instruction_word (target); ++ insword &= 0xfbf08f00; ++ ++ insword |= ((value & 0xf000) << 4) | ((value & 0x0800) << 15) | \ ++ ((value & 0x0700) << 4) | (value & 0xff); ++ ++ thumb_set_instruction_word (target, insword); ++} +diff --git a/include/grub/arm/reloc.h b/include/grub/arm/reloc.h +index b938037..ae92e21 100644 +--- a/include/grub/arm/reloc.h ++++ b/include/grub/arm/reloc.h +@@ -43,4 +43,9 @@ void + grub_arm_jump24_set_offset (grub_uint32_t *target, + grub_int32_t offset); + ++grub_uint16_t ++grub_arm_thm_movw_movt_get_value (grub_uint16_t *target); ++void ++grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value); ++ + #endif +-- +2.4.3 + diff --git a/0282-util-mkimage-fix-gcc5-build-failure.patch b/0282-util-mkimage-fix-gcc5-build-failure.patch new file mode 100644 index 0000000..8238098 --- /dev/null +++ b/0282-util-mkimage-fix-gcc5-build-failure.patch @@ -0,0 +1,41 @@ +From 32cd33bd19348afb77ab849846e0b6d6157ea308 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Thu, 12 Feb 2015 11:02:09 +0100 +Subject: [PATCH 282/506] util: mkimage, fix gcc5 build failure + +gcc5 reports: +../util/mkimage.c: In function 'grub_install_get_image_target': +../util/mkimage.c:954:5: error: loop exit may only be reached after undefined behavior [-Werror=aggressive-loop-optimizations] + && j < ARRAY_SIZE (image_targets[i].names); j++) + ^ +../util/mkimage.c:953:39: note: possible undefined statement is here + for (j = 0; image_targets[i].names[j] + ^ + +Well, let's move the index 'j' test before accesing the array to: +1) make the loop obvious +2) make gcc happy + +Signed-off-by: Jiri Slaby +--- + util/mkimage.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/util/mkimage.c b/util/mkimage.c +index bccd703..7821dc5 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -937,8 +937,8 @@ grub_install_get_image_target (const char *arg) + { + unsigned i, j; + for (i = 0; i < ARRAY_SIZE (image_targets); i++) +- for (j = 0; image_targets[i].names[j] +- && j < ARRAY_SIZE (image_targets[i].names); j++) ++ for (j = 0; j < ARRAY_SIZE (image_targets[i].names) && ++ image_targets[i].names[j]; j++) + if (strcmp (arg, image_targets[i].names[j]) == 0) + return &image_targets[i]; + return NULL; +-- +2.4.3 + diff --git a/0283-diskfilter-fix-crash-in-validate_lv-for-mdraid-array.patch b/0283-diskfilter-fix-crash-in-validate_lv-for-mdraid-array.patch new file mode 100644 index 0000000..1f2a186 --- /dev/null +++ b/0283-diskfilter-fix-crash-in-validate_lv-for-mdraid-array.patch @@ -0,0 +1,89 @@ +From e27fdbd6866a3dc9c6ee4d777d89c861f04368e7 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 14 Feb 2015 17:55:35 +0300 +Subject: [PATCH 283/506] diskfilter: fix crash in validate_lv for mdraid + arrays + +Commit 750f4bacd3262376ced3f837d8dc78f834ca233a put LV validation before +actual vg assignment. Make grub_diskfilter_make_raid to assign ->vg as +happens in other cases for consistency. Also clean up redundant code and add +explicit NULL lv->vg check in validate_lv. + +Also fix segment validation in validate_lv; it became obvious when crash +was fixed. + +Closes: 44199 +--- + grub-core/disk/diskfilter.c | 23 +++++++---------------- + 1 file changed, 7 insertions(+), 16 deletions(-) + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index 80966ac..ad558fa 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -496,13 +496,13 @@ validate_lv (struct grub_diskfilter_lv *lv) + if (!lv) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume"); + +- if (lv->vg->extent_size == 0) ++ if (!lv->vg || lv->vg->extent_size == 0) + return grub_error (GRUB_ERR_READ_ERROR, "invalid volume"); + + for (i = 0; i < lv->segment_count; i++) + { + grub_err_t err; +- err = validate_segment (&lv->segments[1]); ++ err = validate_segment (&lv->segments[i]); + if (err) + return err; + } +@@ -941,8 +941,10 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) + + for (lv = vg->lvs; lv; lv = lv->next) + { +- /* RAID 1 and single-disk RAID 0 don't use a chunksize but code assumes one so set +- one. */ ++ grub_err_t err; ++ ++ /* RAID 1 and single-disk RAID 0 don't use a chunksize but code ++ assumes one so set one. */ + for (i = 0; i < lv->segment_count; i++) + { + if (lv->segments[i].type == 1) +@@ -952,17 +954,6 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) + && lv->segments[i].stripe_size == 0) + lv->segments[i].stripe_size = 64; + } +- } +- +- for (lv = vg->lvs; lv; lv = lv->next) +- { +- grub_err_t err; +- +- /* RAID 1 doesn't use a chunksize but code assumes one so set +- one. */ +- for (i = 0; i < lv->segment_count; i++) +- if (lv->segments[i].type == 1) +- lv->segments[i].stripe_size = 64; + + err = validate_lv(lv); + if (err) +@@ -1007,7 +998,6 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) + lv->fullname = tmp; + } + } +- lv->vg = vg; + } + /* Add our new array to the list. */ + vg->next = array_list; +@@ -1101,6 +1091,7 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + array->lvs->visible = 1; + array->lvs->name = array->name; + array->lvs->fullname = array->name; ++ array->lvs->vg = array; + + array->lvs->idname = grub_malloc (sizeof ("mduuid/") + 2 * uuidlen); + if (!array->lvs->idname) +-- +2.4.3 + diff --git a/0284-diskfilter-fix-double-free-of-lv-names-for-mdraid.patch b/0284-diskfilter-fix-double-free-of-lv-names-for-mdraid.patch new file mode 100644 index 0000000..c26375f --- /dev/null +++ b/0284-diskfilter-fix-double-free-of-lv-names-for-mdraid.patch @@ -0,0 +1,75 @@ +From fc535b32b9fe0cd84213724ffba43b98e2da6ab4 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 14 Feb 2015 19:08:58 +0300 +Subject: [PATCH 284/506] diskfilter: fix double free of lv names for mdraid + +Avoid micro-optimization in grub_diskfilter_make_raid and make sure +name and fullname are independent strings. This avoids need to special +case it everywhere else. + +Also fix memory leak in failure case in grub_diskfilter_make_raid. + +Closes: 41582 +--- + grub-core/disk/diskfilter.c | 31 ++++++++++++++++++++++++------- + 1 file changed, 24 insertions(+), 7 deletions(-) + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index ad558fa..1b7464d 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -1089,8 +1089,15 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + goto fail; + array->lvs->segment_count = 1; + array->lvs->visible = 1; +- array->lvs->name = array->name; +- array->lvs->fullname = array->name; ++ if (array->name) ++ { ++ array->lvs->name = grub_strdup (array->name); ++ if (!array->lvs->name) ++ goto fail; ++ array->lvs->fullname = grub_strdup (array->name); ++ if (!array->lvs->fullname) ++ goto fail; ++ } + array->lvs->vg = array; + + array->lvs->idname = grub_malloc (sizeof ("mduuid/") + 2 * uuidlen); +@@ -1141,7 +1148,18 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + return array; + + fail: +- grub_free (array->lvs); ++ if (array->lvs) ++ { ++ grub_free (array->lvs->name); ++ grub_free (array->lvs->fullname); ++ grub_free (array->lvs->idname); ++ if (array->lvs->segments) ++ { ++ grub_free (array->lvs->segments->nodes); ++ grub_free (array->lvs->segments); ++ } ++ grub_free (array->lvs); ++ } + while (array->pvs) + { + pv = array->pvs->next; +@@ -1250,10 +1268,9 @@ free_array (void) + { + unsigned i; + vg->lvs = lv->next; +- if (lv->name != lv->fullname) +- grub_free (lv->fullname); +- if (lv->name != vg->name) +- grub_free (lv->name); ++ grub_free (lv->fullname); ++ grub_free (lv->name); ++ grub_free (lv->idname); + for (i = 0; i < lv->segment_count; i++) + grub_free (lv->segments[i].nodes); + grub_free (lv->segments); +-- +2.4.3 + diff --git a/0285-multiboot2-Fix-information-request-tag-size-calculat.patch b/0285-multiboot2-Fix-information-request-tag-size-calculat.patch new file mode 100644 index 0000000..c8891d2 --- /dev/null +++ b/0285-multiboot2-Fix-information-request-tag-size-calculat.patch @@ -0,0 +1,27 @@ +From 8e5bc2f4d3767485e729ed96ea943570d1cb1e45 Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Fri, 30 Jan 2015 18:59:24 +0100 +Subject: [PATCH 285/506] multiboot2: Fix information request tag size + calculation + +Signed-off-by: Daniel Kiper +--- + grub-core/loader/multiboot_mbi2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c +index 6f74aee..d7c19bc 100644 +--- a/grub-core/loader/multiboot_mbi2.c ++++ b/grub-core/loader/multiboot_mbi2.c +@@ -150,7 +150,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) + = (struct multiboot_header_tag_information_request *) tag; + if (request_tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL) + break; +- for (i = 0; i < (request_tag->size - sizeof (request_tag)) ++ for (i = 0; i < (request_tag->size - sizeof (*request_tag)) + / sizeof (request_tag->requests[0]); i++) + switch (request_tag->requests[i]) + { +-- +2.4.3 + diff --git a/0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch b/0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch new file mode 100644 index 0000000..55a4ee7 --- /dev/null +++ b/0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch @@ -0,0 +1,27 @@ +From 2ae9457e6eb4c352051fb32bc6fc931a22528ab2 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 14 Feb 2015 20:31:00 +0100 +Subject: [PATCH 286/506] disk/lvm: Use zalloc to ensure that segments are + initialised to sane value. + +Reported by: EmanueL Czirai. +--- + grub-core/disk/lvm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c +index 862a966..1e7f197 100644 +--- a/grub-core/disk/lvm.c ++++ b/grub-core/disk/lvm.c +@@ -426,7 +426,7 @@ grub_lvm_detect (grub_disk_t disk, + #endif + goto lvs_fail; + } +- lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count); ++ lv->segments = grub_zalloc (sizeof (*seg) * lv->segment_count); + seg = lv->segments; + + for (i = 0; i < lv->segment_count; i++) +-- +2.4.3 + diff --git a/0287-diskfilter_make_raid-more-memory-leaks-in-failure-pa.patch b/0287-diskfilter_make_raid-more-memory-leaks-in-failure-pa.patch new file mode 100644 index 0000000..58b8057 --- /dev/null +++ b/0287-diskfilter_make_raid-more-memory-leaks-in-failure-pa.patch @@ -0,0 +1,58 @@ +From 8f5ebb1245446f8e26c64cf0ebbb514dfb1a8d57 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 15 Feb 2015 10:10:03 +0300 +Subject: [PATCH 287/506] diskfilter_make_raid: more memory leaks in failure + path + +--- + grub-core/disk/diskfilter.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c +index 1b7464d..c4f6678 100644 +--- a/grub-core/disk/diskfilter.c ++++ b/grub-core/disk/diskfilter.c +@@ -1031,7 +1031,10 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + if (n == 1) + n = (layout >> 8) & 0xFF; + if (n == 0) +- return NULL; ++ { ++ grub_free (uuid); ++ return NULL; ++ } + + totsize = grub_divmod64 (nmemb * disk_size, n, 0); + } +@@ -1045,6 +1048,7 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + break; + + default: ++ grub_free (uuid); + return NULL; + } + +@@ -1067,7 +1071,10 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + } + array = grub_zalloc (sizeof (*array)); + if (!array) +- return NULL; ++ { ++ grub_free (uuid); ++ return NULL; ++ } + array->uuid = uuid; + array->uuid_len = uuidlen; + if (name) +@@ -1166,6 +1173,8 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, + grub_free (array->pvs); + array->pvs = pv; + } ++ grub_free (array->name); ++ grub_free (array->uuid); + grub_free (array); + return NULL; + } +-- +2.4.3 + diff --git a/0288-syslinux_parse-Always-output-comments-even-if-no-ent.patch b/0288-syslinux_parse-Always-output-comments-even-if-no-ent.patch new file mode 100644 index 0000000..e4b598f --- /dev/null +++ b/0288-syslinux_parse-Always-output-comments-even-if-no-ent.patch @@ -0,0 +1,44 @@ +From b23635fcff62b68b6d5bfde541350095d743a13a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 16 Feb 2015 10:54:20 +0100 +Subject: [PATCH 288/506] syslinux_parse: Always output comments even if no + entries are found. + +--- + grub-core/lib/syslinux_parse.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 2c874b1..46eff1e 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -1430,6 +1430,13 @@ config_file (struct output_buffer *outbuf, + print_string ("\n"); + } + ++ if (menu.comments) ++ { ++ err = print (outbuf, menu.comments, grub_strlen (menu.comments)); ++ if (err) ++ return err; ++ } ++ + if (menu.timeout == 0 && menu.entries && menu.def) + { + err = print_entry (outbuf, &menu, menu.def); +@@ -1446,12 +1453,6 @@ config_file (struct output_buffer *outbuf, + if (err) + return err; + print_string ("\n"); +- if (menu.comments) +- { +- err = print (outbuf, menu.comments, grub_strlen (menu.comments)); +- if (err) +- return err; +- } + + if (menu.def) + { +-- +2.4.3 + diff --git a/0289-Don-t-remove-initrd-parameter.patch b/0289-Don-t-remove-initrd-parameter.patch new file mode 100644 index 0000000..e60c813 --- /dev/null +++ b/0289-Don-t-remove-initrd-parameter.patch @@ -0,0 +1,75 @@ +From e29af836d02a267d6ad9bd6eba808d5bf0a96949 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 16 Feb 2015 15:56:26 +0100 +Subject: [PATCH 289/506] Don't remove initrd= parameter. + +Based on simplified patch by Lunar. + +Reported by: Lunar +--- + grub-core/lib/syslinux_parse.c | 28 +++++++--------------------- + 1 file changed, 7 insertions(+), 21 deletions(-) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 46eff1e..afc12b5 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -869,7 +869,6 @@ write_entry (struct output_buffer *outbuf, + case KERNEL_LINUX: + { + char *ptr; +- char *cmdline; + char *initrd = NULL; + for (ptr = curentry->append; ptr && *ptr; ptr++) + if ((ptr == curentry->append || grub_isspace (ptr[-1])) +@@ -879,31 +878,19 @@ write_entry (struct output_buffer *outbuf, + if (ptr && *ptr) + { + char *ptr2; +- grub_size_t totlen = grub_strlen (curentry->append); +- initrd = ptr + sizeof ("initrd=") - 1; +- for (ptr2 = ptr; *ptr2 && !grub_isspace (*ptr2); ptr2++); +- if (*ptr2) +- { +- *ptr2 = 0; +- ptr2++; +- } +- cmdline = grub_malloc (totlen + 1 - (ptr2 - ptr)); +- if (!cmdline) ++ initrd = grub_strdup(ptr + sizeof ("initrd=") - 1); ++ if (!initrd) + return grub_errno; +- grub_memcpy (cmdline, curentry->append, ptr - curentry->append); +- grub_memcpy (cmdline + (ptr - curentry->append), +- ptr2, totlen - (ptr2 - curentry->append)); +- *(cmdline + totlen - (ptr2 - ptr)) = 0; ++ for (ptr2 = initrd; *ptr2 && !grub_isspace (*ptr2); ptr2++); ++ *ptr2 = 0; + } +- else +- cmdline = curentry->append; + print_string (" if test x$grub_platform = xpc; then " + "linux_suffix=16; else linux_suffix= ; fi\n"); + print_string (" linux$linux_suffix "); + print_file (outbuf, menu, curentry->kernel_file, NULL); + print_string (" "); +- if (cmdline) +- print (outbuf, cmdline, grub_strlen (cmdline)); ++ if (curentry->append) ++ print (outbuf, curentry->append, grub_strlen (curentry->append)); + print_string ("\n"); + if (initrd || curentry->initrds) + { +@@ -922,8 +909,7 @@ write_entry (struct output_buffer *outbuf, + + print_string ("\n"); + } +- if (ptr && *ptr) +- grub_free (cmdline); ++ grub_free (initrd); + } + break; + case KERNEL_CHAINLOADER: +-- +2.4.3 + diff --git a/0290-Add-test-for-syslinux-converter.patch b/0290-Add-test-for-syslinux-converter.patch new file mode 100644 index 0000000..6951517 --- /dev/null +++ b/0290-Add-test-for-syslinux-converter.patch @@ -0,0 +1,535 @@ +From d3d2e549119477d92b506477fd923c51162b9beb Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 16 Feb 2015 15:58:59 +0100 +Subject: [PATCH 290/506] Add test for syslinux converter + +--- + Makefile.util.def | 6 + + tests/syslinux/ubuntu10.04/isolinux/adtxt.cfg | 0 + tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg | 52 +++++ + tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg | 3 + + tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg | 12 ++ + tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg | 6 + + tests/syslinux/ubuntu10.04/isolinux/menu.cfg | 23 +++ + tests/syslinux/ubuntu10.04/isolinux/po4a.cfg | 3 + + tests/syslinux/ubuntu10.04/isolinux/prompt.cfg | 16 ++ + tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg | 4 + + tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg | 15 ++ + tests/syslinux/ubuntu10.04/isolinux/txt.cfg | 19 ++ + tests/syslinux/ubuntu10.04_grub.cfg | 236 +++++++++++++++++++++++ + tests/syslinux_test.in | 16 ++ + 14 files changed, 411 insertions(+) + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/adtxt.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/menu.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/po4a.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/prompt.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg + create mode 100644 tests/syslinux/ubuntu10.04/isolinux/txt.cfg + create mode 100644 tests/syslinux/ubuntu10.04_grub.cfg + create mode 100644 tests/syslinux_test.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index 378b577..67dfb29 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -1162,6 +1162,12 @@ script = { + common = tests/grub_cmd_test.in; + }; + ++script = { ++ testcase; ++ name = syslinux_test; ++ common = tests/syslinux_test.in; ++}; ++ + program = { + testcase; + name = example_unit_test; +diff --git a/tests/syslinux/ubuntu10.04/isolinux/adtxt.cfg b/tests/syslinux/ubuntu10.04/isolinux/adtxt.cfg +new file mode 100644 +index 0000000..e69de29 +diff --git a/tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg b/tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg +new file mode 100644 +index 0000000..2e107fa +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg +@@ -0,0 +1,52 @@ ++menu hshift 9 ++menu width 58 ++ ++menu begin desktop ++ include stdmenu.cfg ++ menu hshift 13 ++ menu width 49 ++ menu label Alternative desktop environments ++ menu title Desktop environment menu ++ label mainmenu-kde ++ menu label ^Back.. ++ text help ++ Higher level options install the GNOME desktop environment ++ endtext ++ menu exit ++ menu begin kde-desktop ++ include stdmenu.cfg ++ menu label ^KDE ++ menu title KDE desktop boot menu ++ text help ++ Select the 'K Desktop Environment' for the Desktop task ++ endtext ++ label mainmenu-kde ++ menu label ^Back.. ++ menu exit ++ include kde/menu.cfg ++ menu end ++ menu begin lxde-desktop ++ include stdmenu.cfg ++ menu label ^LXDE ++ menu title LXDE desktop boot menu ++ text help ++ Select the 'Lightweight X11 Desktop Environment' for the Desktop task ++ endtext ++ label mainmenu-lxde ++ menu label ^Back.. ++ menu exit ++ include lxde/menu.cfg ++ menu end ++ menu begin xfce-desktop ++ include stdmenu.cfg ++ menu label ^Xfce ++ menu title Xfce desktop boot menu ++ text help ++ Select the 'Xfce lightweight desktop environment' for the Desktop task ++ endtext ++ label mainmenu-xfce ++ menu label ^Back.. ++ menu exit ++ include xfce/menu.cfg ++ menu end ++menu end +diff --git a/tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg b/tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg +new file mode 100644 +index 0000000..3119e65 +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg +@@ -0,0 +1,3 @@ ++label menu ++ kernel vesamenu.c32 ++ config isolinux.cfg +diff --git a/tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg b/tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg +new file mode 100644 +index 0000000..b799cb5 +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg +@@ -0,0 +1,12 @@ ++foreground=0xFFFFFF ++background=0x958490 ++screen-colour=0x270A1E ++hidden-timeout=2 ++label normal=Normal ++append normal= ++label driverupdates=Use driver update disc ++append driverupdates=debian-installer/driver-update=true ++applies driverupdates=live live-install ++label oem=OEM install (for manufacturers) ++append oem=oem-config/enable=true ++applies oem=live live-install install +diff --git a/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg b/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg +new file mode 100644 +index 0000000..fd9c333 +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg +@@ -0,0 +1,6 @@ ++# D-I config version 2.0 ++include menu.cfg ++default vesamenu.c32 ++prompt 0 ++timeout 50 ++ui gfxboot bootlogo +diff --git a/tests/syslinux/ubuntu10.04/isolinux/menu.cfg b/tests/syslinux/ubuntu10.04/isolinux/menu.cfg +new file mode 100644 +index 0000000..9f5607d +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/menu.cfg +@@ -0,0 +1,23 @@ ++menu hshift 13 ++menu width 49 ++menu margin 8 ++ ++menu title Installer boot menu ++include stdmenu.cfg ++include txt.cfg ++include gtk.cfg ++menu begin advanced ++ menu title Advanced options ++ include stdmenu.cfg ++ label mainmenu ++ menu label ^Back.. ++ menu exit ++ include adtxt.cfg ++ include adgtk.cfg ++menu end ++label help ++ menu label ^Help ++ text help ++ Display help screens; type 'menu' at boot prompt to return to this menu ++ endtext ++ config prompt.cfg +diff --git a/tests/syslinux/ubuntu10.04/isolinux/po4a.cfg b/tests/syslinux/ubuntu10.04/isolinux/po4a.cfg +new file mode 100644 +index 0000000..75f6788 +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/po4a.cfg +@@ -0,0 +1,3 @@ ++[po4a_langs] ar bn ca cs da de es eu fi fr gl hu id it ja ka ko ku lv nb nl pl pt pt_BR ru sk sv ta tr vi zh_CN zh_TW ++[po4a_paths] po/help.pot $lang:po/$lang.po ++[type:docbook] help.xml +diff --git a/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg b/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg +new file mode 100644 +index 0000000..f9984ae +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg +@@ -0,0 +1,16 @@ ++prompt 1 ++display f1.txt ++timeout 50 ++include menu.cfg ++include exithelp.cfg ++ ++f1 f1.txt ++f2 f2.txt ++f3 f3.txt ++f4 f4.txt ++f5 f5.txt ++f6 f6.txt ++f7 f7.txt ++f8 f8.txt ++f9 f9.txt ++f0 f10.txt +diff --git a/tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg b/tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg +new file mode 100644 +index 0000000..bdf6231 +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg +@@ -0,0 +1,4 @@ ++label rescue ++ menu label ^Rescue mode ++ kernel /install/vmlinuz ++ append vga=788 initrd=/install/initrd.gz rescue/enable=true -- quiet +diff --git a/tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg b/tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg +new file mode 100644 +index 0000000..671b16f +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg +@@ -0,0 +1,15 @@ ++menu background splash.png ++menu color title * #FFFFFFFF * ++menu color border * #00000000 #00000000 none ++menu color sel * #ffffffff #76a1d0ff * ++menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff * ++menu color tabmsg * #ffffffff #00000000 * ++menu color help 37;40 #ffdddd00 #00000000 none ++menu vshift 12 ++menu rows 10 ++menu helpmsgrow 15 ++# The command line must be at least one line from the bottom. ++menu cmdlinerow 16 ++menu timeoutrow 16 ++menu tabmsgrow 18 ++menu tabmsg Press ENTER to boot or TAB to edit a menu entry +diff --git a/tests/syslinux/ubuntu10.04/isolinux/txt.cfg b/tests/syslinux/ubuntu10.04/isolinux/txt.cfg +new file mode 100644 +index 0000000..860daad +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04/isolinux/txt.cfg +@@ -0,0 +1,19 @@ ++default live ++label live ++ menu label ^Try Ubuntu without installing ++ kernel /casper/vmlinuz ++ append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- ++label live-install ++ menu label ^Install Ubuntu ++ kernel /casper/vmlinuz ++ append file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- ++label check ++ menu label ^Check disc for defects ++ kernel /casper/vmlinuz ++ append boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- ++label memtest ++ menu label Test ^memory ++ kernel /install/mt86plus ++label hd ++ menu label ^Boot from first hard disk ++ localboot 0x80 +diff --git a/tests/syslinux/ubuntu10.04_grub.cfg b/tests/syslinux/ubuntu10.04_grub.cfg +new file mode 100644 +index 0000000..e6bd82c +--- /dev/null ++++ b/tests/syslinux/ubuntu10.04_grub.cfg +@@ -0,0 +1,236 @@ ++ background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux'/'splash.png' ++# D-I config version 2.0 ++ # UNSUPPORTED command 'menu hshift 13' ++ # UNSUPPORTED command 'menu width 49' ++ # UNSUPPORTED command 'menu margin 8' ++ ++ # UNSUPPORTED command 'menu title Installer boot menu' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++set timeout=5 ++ default='vesamenu.c32' ++menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Test memory' --hotkey 'm' --id 'memtest' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/install/mt86plus' ++} ++menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/gtk.cfg not found ++ # UNSUPPORTED command 'menu begin advanced' ++ # UNSUPPORTED command 'menu title Advanced options' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++ root=hd0; ++ chainloader +1; ++} ++menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { ++ # UNSUPPORTED command 'menu exit' ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/adgtk.cfg not found ++ # UNSUPPORTED command 'menu end' ++ # UNSUPPORTED entry type 0 ++true; ++} ++menuentry 'Help' --hotkey 'h' --id 'help' { ++ # UNSUPPORTED command 'ui gfxboot bootlogo' ++#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'splash.png' ++ # UNSUPPORTED command 'display f1.txt' ++ # UNSUPPORTED command 'menu hshift 13' ++ # UNSUPPORTED command 'menu width 49' ++ # UNSUPPORTED command 'menu margin 8' ++ ++ # UNSUPPORTED command 'menu title Installer boot menu' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++set timeout=5 ++ default='live' ++menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Test memory' --hotkey 'm' --id 'memtest' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/install/mt86plus' ++} ++menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//gtk.cfg not found ++ # UNSUPPORTED command 'menu begin advanced' ++ # UNSUPPORTED command 'menu title Advanced options' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++ root=hd0; ++ chainloader +1; ++} ++menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { ++ # UNSUPPORTED command 'menu exit' ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//adgtk.cfg not found ++ # UNSUPPORTED command 'menu end' ++ # UNSUPPORTED entry type 0 ++true; ++} ++menuentry 'Help' --hotkey 'h' --id 'help' { ++#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ syslinux_configfile -r '/'/'/' -c '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'' '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' ++} ++menuentry 'menu' --id 'menu' { ++ # UNSUPPORTED command 'f1 f1.txt' ++ # UNSUPPORTED command 'f2 f2.txt' ++ # UNSUPPORTED command 'f3 f3.txt' ++ # UNSUPPORTED command 'f4 f4.txt' ++ # UNSUPPORTED command 'f5 f5.txt' ++ # UNSUPPORTED command 'f6 f6.txt' ++ # UNSUPPORTED command 'f7 f7.txt' ++ # UNSUPPORTED command 'f8 f8.txt' ++ # UNSUPPORTED command 'f9 f9.txt' ++ # UNSUPPORTED command 'f0 f10.txt' ++#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'isolinux.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg: ++ background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'splash.png' ++# D-I config version 2.0 ++ # UNSUPPORTED command 'menu hshift 13' ++ # UNSUPPORTED command 'menu width 49' ++ # UNSUPPORTED command 'menu margin 8' ++ ++ # UNSUPPORTED command 'menu title Installer boot menu' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++set timeout=5 ++ default='vesamenu.c32' ++menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- ++ initrd$linux_suffix '/'/'/casper/initrd.lz' ++} ++menuentry 'Test memory' --hotkey 'm' --id 'memtest' { ++ if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi ++ linux$linux_suffix '/'/'/install/mt86plus' ++} ++menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux///gtk.cfg not found ++ # UNSUPPORTED command 'menu begin advanced' ++ # UNSUPPORTED command 'menu title Advanced options' ++ # UNSUPPORTED command 'menu color title * #FFFFFFFF *' ++ # UNSUPPORTED command 'menu color border * #00000000 #00000000 none' ++ # UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *' ++ # UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *' ++ # UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none' ++ # UNSUPPORTED command 'menu vshift 12' ++ # UNSUPPORTED command 'menu rows 10' ++ # UNSUPPORTED command 'menu helpmsgrow 15' ++# The command line must be at least one line from the bottom. ++ # UNSUPPORTED command 'menu cmdlinerow 16' ++ # UNSUPPORTED command 'menu timeoutrow 16' ++ # UNSUPPORTED command 'menu tabmsgrow 18' ++ # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry' ++ root=hd0; ++ chainloader +1; ++} ++menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { ++ # UNSUPPORTED command 'menu exit' ++# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux///adgtk.cfg not found ++ # UNSUPPORTED command 'menu end' ++ # UNSUPPORTED entry type 0 ++true; ++} ++menuentry 'Help' --hotkey 'h' --id 'help' { ++ # UNSUPPORTED command 'ui gfxboot bootlogo' ++#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ syslinux_configfile -r '/'/'/' -c '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'' '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' ++} ++} ++} +diff --git a/tests/syslinux_test.in b/tests/syslinux_test.in +new file mode 100644 +index 0000000..08d28da +--- /dev/null ++++ b/tests/syslinux_test.in +@@ -0,0 +1,16 @@ ++#!/bin/sh ++ ++set -e ++ ++outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 ++ ++"@builddir@/grub-syslinux2cfg" -r "@srcdir@/tests/syslinux/ubuntu10.04" "@srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile" ++ ++echo "$outfile" ++ ++if ! diff -u "$outfile" "@srcdir@/tests/syslinux/ubuntu10.04_grub.cfg"; then ++ echo "Mismatch in ubuntu10.04" ++ exit 1; ++fi ++ ++exit 0 +-- +2.4.3 + diff --git a/0291-build-sys-add-syslinux-test-files-to-tarball.patch b/0291-build-sys-add-syslinux-test-files-to-tarball.patch new file mode 100644 index 0000000..41f39f7 --- /dev/null +++ b/0291-build-sys-add-syslinux-test-files-to-tarball.patch @@ -0,0 +1,32 @@ +From 251ddf26dc80d1fa91ca3f242da8613bc59c930d Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 16 Feb 2015 20:31:22 +0300 +Subject: [PATCH 291/506] build-sys: add syslinux test files to tarball + +--- + conf/Makefile.extra-dist | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 1b95ccd..8a65e37 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -121,3 +121,15 @@ EXTRA_DIST += tests/file_filter/file.xz.sig + EXTRA_DIST += tests/file_filter/keys + EXTRA_DIST += tests/file_filter/keys.pub + EXTRA_DIST += tests/file_filter/test.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/prompt.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/gfxboot.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/adtxt.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/exithelp.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/txt.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/menu.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/po4a.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04_grub.cfg +-- +2.4.3 + diff --git a/0292-tests-remove-hardcoded-paths-from-syslinux_test.patch b/0292-tests-remove-hardcoded-paths-from-syslinux_test.patch new file mode 100644 index 0000000..8e48975 --- /dev/null +++ b/0292-tests-remove-hardcoded-paths-from-syslinux_test.patch @@ -0,0 +1,167 @@ +From 35a492e4a2c70d27bc0a7f0c567b2a3405f31599 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 16 Feb 2015 22:07:33 +0300 +Subject: [PATCH 292/506] tests: remove hardcoded paths from syslinux_test + +abs_top_srcdir appeared in Autoconf 2.52f. Minimal grub requirement +is 2.60 so we should be good here. +--- + Makefile.am | 6 +++++ + conf/Makefile.extra-dist | 2 +- + ...buntu10.04_grub.cfg => ubuntu10.04_grub.cfg.in} | 30 +++++++++++----------- + tests/syslinux_test.in | 4 +-- + 4 files changed, 24 insertions(+), 18 deletions(-) + rename tests/syslinux/{ubuntu10.04_grub.cfg => ubuntu10.04_grub.cfg.in} (85%) + +diff --git a/Makefile.am b/Makefile.am +index f702951..994ebbd 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -452,3 +452,9 @@ ChangeLog: FORCE + fi + + EXTRA_DIST += ChangeLog ChangeLog-2015 ++ ++syslinux_test: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_grub.cfg ++ ++tests/syslinux/ubuntu10.04_grub.cfg: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_grub.cfg.in ++ (for x in tests/syslinux/ubuntu10.04_grub.cfg.in ; do cat $(srcdir)/"$$x"; done) | $(top_builddir)/config.status --file=$@:- ++CLEANFILES += tests/syslinux/ubuntu10.04_grub.cfg +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 8a65e37..db6cfd1 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -132,4 +132,4 @@ EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg + EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg + EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/po4a.cfg + EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg +-EXTRA_DIST += tests/syslinux/ubuntu10.04_grub.cfg ++EXTRA_DIST += tests/syslinux/ubuntu10.04_grub.cfg.in +diff --git a/tests/syslinux/ubuntu10.04_grub.cfg b/tests/syslinux/ubuntu10.04_grub.cfg.in +similarity index 85% +rename from tests/syslinux/ubuntu10.04_grub.cfg +rename to tests/syslinux/ubuntu10.04_grub.cfg.in +index e6bd82c..846e4ac 100644 +--- a/tests/syslinux/ubuntu10.04_grub.cfg ++++ b/tests/syslinux/ubuntu10.04_grub.cfg.in +@@ -1,4 +1,4 @@ +- background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux'/'splash.png' ++ background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux'/'splash.png' + # D-I config version 2.0 + # UNSUPPORTED command 'menu hshift 13' + # UNSUPPORTED command 'menu width 49' +@@ -41,7 +41,7 @@ menuentry 'Test memory' --hotkey 'm' --id 'memtest' { + linux$linux_suffix '/'/'/install/mt86plus' + } + menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/gtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/gtk.cfg not found + # UNSUPPORTED command 'menu begin advanced' + # UNSUPPORTED command 'menu title Advanced options' + # UNSUPPORTED command 'menu color title * #FFFFFFFF *' +@@ -63,15 +63,15 @@ menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { + } + menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { + # UNSUPPORTED command 'menu exit' +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/adgtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/adgtk.cfg not found + # UNSUPPORTED command 'menu end' + # UNSUPPORTED entry type 0 + true; + } + menuentry 'Help' --hotkey 'h' --id 'help' { + # UNSUPPORTED command 'ui gfxboot bootlogo' +-#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: +- background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'splash.png' ++#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'splash.png' + # UNSUPPORTED command 'display f1.txt' + # UNSUPPORTED command 'menu hshift 13' + # UNSUPPORTED command 'menu width 49' +@@ -114,7 +114,7 @@ menuentry 'Test memory' --hotkey 'm' --id 'memtest' { + linux$linux_suffix '/'/'/install/mt86plus' + } + menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//gtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//gtk.cfg not found + # UNSUPPORTED command 'menu begin advanced' + # UNSUPPORTED command 'menu title Advanced options' + # UNSUPPORTED command 'menu color title * #FFFFFFFF *' +@@ -136,14 +136,14 @@ menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { + } + menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { + # UNSUPPORTED command 'menu exit' +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//adgtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//adgtk.cfg not found + # UNSUPPORTED command 'menu end' + # UNSUPPORTED entry type 0 + true; + } + menuentry 'Help' --hotkey 'h' --id 'help' { +-#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: +- syslinux_configfile -r '/'/'/' -c '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'' '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' ++#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ syslinux_configfile -r '/'/'/' -c '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'' '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' + } + menuentry 'menu' --id 'menu' { + # UNSUPPORTED command 'f1 f1.txt' +@@ -156,8 +156,8 @@ menuentry 'menu' --id 'menu' { + # UNSUPPORTED command 'f8 f8.txt' + # UNSUPPORTED command 'f9 f9.txt' + # UNSUPPORTED command 'f0 f10.txt' +-#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/'/'isolinux.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg: +- background_image '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'splash.png' ++#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'isolinux.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg: ++ background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'splash.png' + # D-I config version 2.0 + # UNSUPPORTED command 'menu hshift 13' + # UNSUPPORTED command 'menu width 49' +@@ -200,7 +200,7 @@ menuentry 'Test memory' --hotkey 'm' --id 'memtest' { + linux$linux_suffix '/'/'/install/mt86plus' + } + menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux///gtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux///gtk.cfg not found + # UNSUPPORTED command 'menu begin advanced' + # UNSUPPORTED command 'menu title Advanced options' + # UNSUPPORTED command 'menu color title * #FFFFFFFF *' +@@ -222,15 +222,15 @@ menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { + } + menuentry 'Back..' --hotkey 'b' --id 'mainmenu' { + # UNSUPPORTED command 'menu exit' +-# File (host)//home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux///adgtk.cfg not found ++# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux///adgtk.cfg not found + # UNSUPPORTED command 'menu end' + # UNSUPPORTED entry type 0 + true; + } + menuentry 'Help' --hotkey 'h' --id 'help' { + # UNSUPPORTED command 'ui gfxboot bootlogo' +-#'/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' (host)/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: +- syslinux_configfile -r '/'/'/' -c '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'' '/home/phcoder/grub2/git/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' ++#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg: ++ syslinux_configfile -r '/'/'/' -c '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'' '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' + } + } + } +diff --git a/tests/syslinux_test.in b/tests/syslinux_test.in +index 08d28da..fc4edd8 100644 +--- a/tests/syslinux_test.in ++++ b/tests/syslinux_test.in +@@ -4,11 +4,11 @@ set -e + + outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 + +-"@builddir@/grub-syslinux2cfg" -r "@srcdir@/tests/syslinux/ubuntu10.04" "@srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile" ++"@builddir@/grub-syslinux2cfg" -r "@abs_top_srcdir@/tests/syslinux/ubuntu10.04" "@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile" + + echo "$outfile" + +-if ! diff -u "$outfile" "@srcdir@/tests/syslinux/ubuntu10.04_grub.cfg"; then ++if ! diff -u "$outfile" "@builddir@/tests/syslinux/ubuntu10.04_grub.cfg"; then + echo "Mismatch in ubuntu10.04" + exit 1; + fi +-- +2.4.3 + diff --git a/0293-ext2-Support-META_BG.patch b/0293-ext2-Support-META_BG.patch new file mode 100644 index 0000000..8c13b6a --- /dev/null +++ b/0293-ext2-Support-META_BG.patch @@ -0,0 +1,134 @@ +From e20aa39ea4298011ba716087713cff26c6c52006 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 16 Feb 2015 20:53:26 +0100 +Subject: [PATCH 293/506] ext2: Support META_BG. + +This fixes bug that system would become unbootable after ext* +online resize if no resize_inode was created at ext* format time. +--- + grub-core/fs/ext2.c | 61 +++++++++++++++++++++++++++++++++++++++++--- + tests/ext234_test.in | 1 + + tests/util/grub-fs-tester.in | 6 ++++- + 3 files changed, 63 insertions(+), 5 deletions(-) + +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index 44c7974..4d45edc 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -107,6 +107,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #define EXT2_DRIVER_SUPPORTED_INCOMPAT ( EXT2_FEATURE_INCOMPAT_FILETYPE \ + | EXT4_FEATURE_INCOMPAT_EXTENTS \ + | EXT4_FEATURE_INCOMPAT_FLEX_BG \ ++ | EXT2_FEATURE_INCOMPAT_META_BG \ + | EXT4_FEATURE_INCOMPAT_64BIT) + /* List of rationales for the ignored "incompatible" features: + * needs_recovery: Not really back-incompatible - was added as such to forbid +@@ -331,16 +332,68 @@ static grub_dl_t my_mod; + + + ++/* Check is a = b^x for some x. */ ++static inline int ++is_power_of (grub_uint64_t a, grub_uint32_t b) ++{ ++ grub_uint64_t c; ++ /* Prevent overflow assuming b < 8. */ ++ if (a >= (1LL << 60)) ++ return 0; ++ for (c = 1; c <= a; c *= b); ++ return (c == a); ++} ++ ++ ++static inline int ++group_has_super_block (struct grub_ext2_data *data, grub_uint64_t group) ++{ ++ if (!(data->sblock.feature_ro_compat ++ & grub_cpu_to_le32_compile_time(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER))) ++ return 1; ++ /* Algorithm looked up in Linux source. */ ++ if (group <= 1) ++ return 1; ++ /* Even number is never a power of odd number. */ ++ if (!(group & 1)) ++ return 0; ++ return (is_power_of(group, 7) || is_power_of(group, 5) || ++ is_power_of(group, 3)); ++} ++ + /* Read into BLKGRP the blockgroup descriptor of blockgroup GROUP of + the mounted filesystem DATA. */ + inline static grub_err_t +-grub_ext2_blockgroup (struct grub_ext2_data *data, int group, ++grub_ext2_blockgroup (struct grub_ext2_data *data, grub_uint64_t group, + struct grub_ext2_block_group *blkgrp) + { ++ grub_uint64_t full_offset = (group << data->log_group_desc_size); ++ grub_uint64_t block, offset; ++ block = (full_offset >> LOG2_BLOCK_SIZE (data)); ++ offset = (full_offset & ((1 << LOG2_BLOCK_SIZE (data)) - 1)); ++ if ((data->sblock.feature_incompat ++ & grub_cpu_to_le32_compile_time (EXT2_FEATURE_INCOMPAT_META_BG)) ++ && block >= grub_le_to_cpu32(data->sblock.first_meta_bg)) ++ { ++ grub_uint64_t first_block_group; ++ /* Find the first block group for which a descriptor ++ is stored in given block. */ ++ first_block_group = (block << (LOG2_BLOCK_SIZE (data) ++ - data->log_group_desc_size)); ++ ++ block = (first_block_group ++ * grub_le_to_cpu32(data->sblock.blocks_per_group)); ++ ++ if (group_has_super_block (data, first_block_group)) ++ block++; ++ } ++ else ++ /* Superblock. */ ++ block++; + return grub_disk_read (data->disk, +- ((grub_le_to_cpu32 (data->sblock.first_data_block) + 1) +- << LOG2_EXT2_BLOCK_SIZE (data)), +- group << data->log_group_desc_size, ++ ((grub_le_to_cpu32 (data->sblock.first_data_block) ++ + block) ++ << LOG2_EXT2_BLOCK_SIZE (data)), offset, + sizeof (struct grub_ext2_block_group), blkgrp); + } + +diff --git a/tests/ext234_test.in b/tests/ext234_test.in +index 8910b71..c986960 100644 +--- a/tests/ext234_test.in ++++ b/tests/ext234_test.in +@@ -29,3 +29,4 @@ fi + "@builddir@/grub-fs-tester" ext2 + "@builddir@/grub-fs-tester" ext3 + "@builddir@/grub-fs-tester" ext4 ++"@builddir@/grub-fs-tester" ext4_metabg +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 5656927..9ecbe0f 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -281,7 +281,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + #FSLABEL="g;/_é莭ð¯¦ðŸ˜ÐºÐ¸Ñ‚ u" + ;; + # FS LIMITATION: reiserfs, extN and jfs label is at most 16 UTF-8 characters +- x"reiserfs_old" | x"reiserfs" | x"ext2" | xext2_old | x"ext3" | x"ext4" | x"lvm"* | x"mdraid"* | x"jfs" | x"jfs_caseins") ++ x"reiserfs_old" | x"reiserfs" | x"ext"* | x"lvm"* | x"mdraid"* | x"jfs" | x"jfs_caseins") + FSLABEL="g;/éт 莭ðŸ˜";; + # FS LIMITATION: No underscore, space, semicolon, slash or international characters in UFS* in label. Limited to 32 UTF-8 characters + x"ufs1" | x"ufs1_sun" | x"ufs2") +@@ -746,6 +746,10 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext2" -r 0 -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}" + MOUNTFS=ext2 + ;; ++ xext4_metabg) ++ MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext4" -O meta_bg,^resize_inode -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}" ++ MOUNTFS=ext4 ++ ;; + xext*) + MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.$fs" -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}" ;; + xxfs) +-- +2.4.3 + diff --git a/0294-ext2-Ignore-INCOMPAT_MMP.patch b/0294-ext2-Ignore-INCOMPAT_MMP.patch new file mode 100644 index 0000000..d182537 --- /dev/null +++ b/0294-ext2-Ignore-INCOMPAT_MMP.patch @@ -0,0 +1,41 @@ +From 5537a586e0b92b94910d0170a128ae8a85787713 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 16 Feb 2015 21:08:37 +0100 +Subject: [PATCH 294/506] ext2: Ignore INCOMPAT_MMP. + +It's not really incompatible as long as driver never writes to FS. +--- + grub-core/fs/ext2.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index 4d45edc..5199cb0 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -100,6 +100,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 + #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* Extents used */ + #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 ++#define EXT4_FEATURE_INCOMPAT_MMP 0x0100 + #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 + + /* The set of back-incompatible features this driver DOES support. Add (OR) +@@ -115,8 +116,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); + * journal because they will ignore the journal, but the next + * ext3 driver to mount the volume will find the journal and + * replay it, potentially corrupting the metadata written by +- * the ext2 drivers. Safe to ignore for this RO driver. */ +-#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER ) ++ * the ext2 drivers. Safe to ignore for this RO driver. ++ * mmp: Not really back-incompatible - was added as such to ++ * avoid multiple read-write mounts. Safe to ignore for this ++ * RO driver. ++ */ ++#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ ++ | EXT4_FEATURE_INCOMPAT_MMP) + + + #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U +-- +2.4.3 + diff --git a/0295-configure-Add-missing-comma.patch b/0295-configure-Add-missing-comma.patch new file mode 100644 index 0000000..d381fab --- /dev/null +++ b/0295-configure-Add-missing-comma.patch @@ -0,0 +1,25 @@ +From 86f05f1491b87550d69adbd003b9975ad7222557 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Feb 2015 21:29:35 +0100 +Subject: [PATCH 295/506] configure: Add missing comma. + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 6d31ed0..9f54158 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -552,7 +552,7 @@ int main (void); + + TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags" + +-AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang] ++AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang], + [ + CFLAGS="$TARGET_CFLAGS" + AC_COMPILE_IFELSE( +-- +2.4.3 + diff --git a/0296-configure-Move-adding-of-include-options-to-the-very.patch b/0296-configure-Move-adding-of-include-options-to-the-very.patch new file mode 100644 index 0000000..80fb02b --- /dev/null +++ b/0296-configure-Move-adding-of-include-options-to-the-very.patch @@ -0,0 +1,43 @@ +From b46bf3cd1c3682df0a6460dcee95ce4d9da4d1fd Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Feb 2015 21:30:34 +0100 +Subject: [PATCH 296/506] configure: Move adding of include options to the very + end to avoid subshell. + +--- + configure.ac | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9f54158..8945afa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -78,12 +78,9 @@ fi + + # Default HOST_CPPFLAGS + HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" +-HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" + HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" + + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W" +-TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" +-TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" + + case "$target_cpu" in + i[[3456]]86) target_cpu=i386 ;; +@@ -1643,6 +1640,12 @@ fi + TARGET_CPP="$TARGET_CC -E" + TARGET_CCAS=$TARGET_CC + ++# Includes which include make-time substitutions. They must come last ++# as to avoid executing top_builddir in shell. ++HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" ++TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" ++TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" ++ + GRUB_TARGET_CPU="${target_cpu}" + GRUB_PLATFORM="${platform}" + +-- +2.4.3 + diff --git a/0297-Strip-.MIPS.abiflags-which-causes-compile-failure.patch b/0297-Strip-.MIPS.abiflags-which-causes-compile-failure.patch new file mode 100644 index 0000000..96b5071 --- /dev/null +++ b/0297-Strip-.MIPS.abiflags-which-causes-compile-failure.patch @@ -0,0 +1,39 @@ +From e3c7aca76d5a3467f1bf0736dcd439a0d6f55ae9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:01:53 +0100 +Subject: [PATCH 297/506] Strip .MIPS.abiflags which causes compile failure + +--- + conf/Makefile.common | 2 +- + gentpl.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 8c4d148..66c9fdb 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -45,7 +45,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding + LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) + CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 + CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) +-STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version ++STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags + + CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding + LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d +diff --git a/gentpl.py b/gentpl.py +index bdcae1a..c986cec 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -753,7 +753,7 @@ def image(defn, platform): + if test x$(TARGET_APPLE_LINKER) = x1; then \ + $(MACHO2IMG) $< $@; \ + else \ +- $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ ++ $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ + fi + """) + +-- +2.4.3 + diff --git a/0298-INSTALL-Fix-names-of-host-flags-to-match-actual-beha.patch b/0298-INSTALL-Fix-names-of-host-flags-to-match-actual-beha.patch new file mode 100644 index 0000000..b47c667 --- /dev/null +++ b/0298-INSTALL-Fix-names-of-host-flags-to-match-actual-beha.patch @@ -0,0 +1,30 @@ +From d93147abb70fba583091ac6ec0426a0bf504d697 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:03:11 +0100 +Subject: [PATCH 298/506] INSTALL: Fix names of host flags to match actual + behaviour + +--- + INSTALL | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/INSTALL b/INSTALL +index f6f276c..05cc443 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -175,9 +175,9 @@ corresponding platform are not needed for the platform in question. + - For host + 1. --host= to autoconf name of host. + 2. CC= for gcc able to compile for host +- 3. CFLAGS= for C options for host. +- 4. CPPFLAGS= for C preprocessor options for host. +- 5. LDFLAGS= for linker options for host. ++ 3. HOST_CFLAGS= for C options for host. ++ 4. HOST_CPPFLAGS= for C preprocessor options for host. ++ 5. HOST_LDFLAGS= for linker options for host. + 6. FREETYPE= for freetype-config for host (optional). + 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional). + 8. Libfuse if any must be in standard linker folders (-lfuse) (optional). +-- +2.4.3 + diff --git a/0299-div_test-Don-t-try-to-divide-by-zero.patch b/0299-div_test-Don-t-try-to-divide-by-zero.patch new file mode 100644 index 0000000..d968715 --- /dev/null +++ b/0299-div_test-Don-t-try-to-divide-by-zero.patch @@ -0,0 +1,25 @@ +From 2426ac36d3b42b6be507bde733c4bbd58883fe09 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:05:45 +0100 +Subject: [PATCH 299/506] div_test: Don't try to divide by zero + +--- + grub-core/tests/div_test.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/tests/div_test.c b/grub-core/tests/div_test.c +index 1928f85..7bdc80b 100644 +--- a/grub-core/tests/div_test.c ++++ b/grub-core/tests/div_test.c +@@ -34,6 +34,8 @@ static void + test32 (grub_uint32_t a, grub_uint32_t b) + { + grub_uint64_t q, r; ++ if (b == 0) ++ return; + q = grub_divmod64 (a, b, &r); + grub_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx", + (long long) a, (long long) b, (long long) r); +-- +2.4.3 + diff --git a/0300-Provide-__aeabi_mem-cpy-set.patch b/0300-Provide-__aeabi_mem-cpy-set.patch new file mode 100644 index 0000000..dd9d783 --- /dev/null +++ b/0300-Provide-__aeabi_mem-cpy-set.patch @@ -0,0 +1,45 @@ +From aee2502cb54d29d7d86240be7259895bdee15d07 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:07:59 +0100 +Subject: [PATCH 300/506] Provide __aeabi_mem{cpy,set} + +Fixes ARM compilation +--- + grub-core/kern/misc.c | 4 ++++ + include/grub/misc.h | 5 +++++ + 2 files changed, 9 insertions(+) + +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index c5c815d..883d353 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -735,6 +735,10 @@ __ctzsi2 (grub_uint32_t x) + grub_uint32_t + __aeabi_uidiv (grub_uint32_t a, grub_uint32_t b) + __attribute__ ((alias ("__udivsi3"))); ++void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n) ++ __attribute__ ((alias ("grub_memcpy"))); ++void *__aeabi_memset (void *s, int c, grub_size_t n) ++ __attribute__ ((alias ("grub_memset"))); + #endif + + #if defined (__ia64__) +diff --git a/include/grub/misc.h b/include/grub/misc.h +index 4b6ee06..e35934c 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -469,6 +469,11 @@ EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); + grub_uint64_t + EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); + ++void * ++EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); ++void * ++EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); ++ + #endif + + #if defined (__ia64__) +-- +2.4.3 + diff --git a/0301-mips-startup_raw-Use-more-portable-.asciz.patch b/0301-mips-startup_raw-Use-more-portable-.asciz.patch new file mode 100644 index 0000000..e733bde --- /dev/null +++ b/0301-mips-startup_raw-Use-more-portable-.asciz.patch @@ -0,0 +1,47 @@ +From e5851b63e0b84cc648faaeff50d6300a16f9236a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:09:46 +0100 +Subject: [PATCH 301/506] mips/startup_raw: Use more portable .asciz + +--- + grub-core/boot/mips/startup_raw.S | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/grub-core/boot/mips/startup_raw.S b/grub-core/boot/mips/startup_raw.S +index 29e93c1..c169ca3 100644 +--- a/grub-core/boot/mips/startup_raw.S ++++ b/grub-core/boot/mips/startup_raw.S +@@ -150,18 +150,18 @@ digcont: + 1: + jr $ra + nop +-busclockstr: .asciiz "busclock=" +-cpuclockstr: .asciiz "cpuclock=" +-memsizestr: .asciiz "memsize=" +-highmemsizestr: .asciiz "highmemsize=" +-machtype_yeeloong_str1: .asciiz "machtype=8.9" +-machtype_yeeloong_str2: .asciiz "machtype=lemote-yeeloong-" +-machtype_fuloong2f_str: .asciiz "machtype=lemote-fuloong-2f" +-machtype_fuloong2e_str: .asciiz "machtype=lemote-fuloong-2e" +-pmon_yeeloong_str: .asciiz "PMON_VER=LM8" +-pmon_fuloong2f_str: .asciiz "PMON_VER=LM6" +-pmon_yeeloong_verstr: .asciiz "Version=LM8" +-pmon_fuloong2f_verstr: .asciiz "Version=LM6" ++busclockstr: .asciz "busclock=" ++cpuclockstr: .asciz "cpuclock=" ++memsizestr: .asciz "memsize=" ++highmemsizestr: .asciz "highmemsize=" ++machtype_yeeloong_str1: .asciz "machtype=8.9" ++machtype_yeeloong_str2: .asciz "machtype=lemote-yeeloong-" ++machtype_fuloong2f_str: .asciz "machtype=lemote-fuloong-2f" ++machtype_fuloong2e_str: .asciz "machtype=lemote-fuloong-2e" ++pmon_yeeloong_str: .asciz "PMON_VER=LM8" ++pmon_fuloong2f_str: .asciz "PMON_VER=LM6" ++pmon_yeeloong_verstr: .asciz "Version=LM8" ++pmon_fuloong2f_verstr: .asciz "Version=LM6" + .p2align 2 + + argdone: +-- +2.4.3 + diff --git a/0302-configure-Add-msoft-float-to-CCASFLAGS.patch b/0302-configure-Add-msoft-float-to-CCASFLAGS.patch new file mode 100644 index 0000000..11ac584 --- /dev/null +++ b/0302-configure-Add-msoft-float-to-CCASFLAGS.patch @@ -0,0 +1,25 @@ +From ef7c843b443da6aac23cac6d73f90a951dff7436 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:13:11 +0100 +Subject: [PATCH 302/506] configure: Add -msoft-float to CCASFLAGS + +Otherwise mismatch between API flags triggers linker failure +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 8945afa..4ef67f0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -679,6 +679,7 @@ if test "x$target_cpu" = xarm64; then + TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd" + else + TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float" ++ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -msoft-float" + fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind +-- +2.4.3 + diff --git a/0303-ofdisk-Exclude-floppies-from-scanning.patch b/0303-ofdisk-Exclude-floppies-from-scanning.patch new file mode 100644 index 0000000..03f6637 --- /dev/null +++ b/0303-ofdisk-Exclude-floppies-from-scanning.patch @@ -0,0 +1,75 @@ +From 967e5aa591cdd3bd462ffca4028c00e6a6dbc96d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:16:48 +0100 +Subject: [PATCH 303/506] ofdisk: Exclude floppies from scanning. + +It causes similar hang as CD on at least the qemu. +--- + grub-core/disk/ieee1275/ofdisk.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c +index 6870b39..5d88637 100644 +--- a/grub-core/disk/ieee1275/ofdisk.c ++++ b/grub-core/disk/ieee1275/ofdisk.c +@@ -34,7 +34,7 @@ struct ofdisk_hash_ent + char *open_path; + char *grub_devpath; + int is_boot; +- int is_cdrom; ++ int is_removable; + /* Pointer to shortest available name on nodes representing canonical names, + otherwise NULL. */ + const char *shortest; +@@ -123,7 +123,7 @@ ofdisk_hash_add_real (char *devpath) + } + + static int +-check_string_cdrom (const char *str) ++check_string_removable (const char *str) + { + const char *ptr = grub_strrchr (str, '/'); + +@@ -131,7 +131,7 @@ check_string_cdrom (const char *str) + ptr++; + else + ptr = str; +- return (grub_strncmp (ptr, "cdrom", 5) == 0); ++ return (grub_strncmp (ptr, "cdrom", 5) == 0 || grub_strncmp (ptr, "fd", 2) == 0); + } + + static struct ofdisk_hash_ent * +@@ -147,8 +147,8 @@ ofdisk_hash_add (char *devpath, char *curcan) + { + p->shortest = p->devpath; + p->grub_shortest = p->grub_devpath; +- if (check_string_cdrom (devpath)) +- p->is_cdrom = 1; ++ if (check_string_removable (devpath)) ++ p->is_removable = 1; + return p; + } + +@@ -158,8 +158,8 @@ ofdisk_hash_add (char *devpath, char *curcan) + else + grub_free (curcan); + +- if (check_string_cdrom (devpath) || check_string_cdrom (curcan)) +- pcan->is_cdrom = 1; ++ if (check_string_removable (devpath) || check_string_removable (curcan)) ++ pcan->is_removable = 1; + + if (!pcan) + grub_errno = GRUB_ERR_NONE; +@@ -330,7 +330,7 @@ grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, + } + } + +- if (!ent->is_boot && ent->is_cdrom) ++ if (!ent->is_boot && ent->is_removable) + continue; + + if (hook (ent->grub_shortest, hook_data)) +-- +2.4.3 + diff --git a/0304-wildcard-Mark-unused-argument-as-such.patch b/0304-wildcard-Mark-unused-argument-as-such.patch new file mode 100644 index 0000000..8be1378 --- /dev/null +++ b/0304-wildcard-Mark-unused-argument-as-such.patch @@ -0,0 +1,26 @@ +From ec65605af487d702577bfba214c27efd1a0d8b73 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:19:09 +0100 +Subject: [PATCH 304/506] wildcard: Mark unused argument as such. + +--- + grub-core/commands/wildcard.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c +index d207acf..9b4e727 100644 +--- a/grub-core/commands/wildcard.c ++++ b/grub-core/commands/wildcard.c +@@ -293,7 +293,8 @@ struct match_files_ctx + + /* Helper for match_files. */ + static int +-match_files_iter (const char *name, const struct grub_dirhook_info *info, ++match_files_iter (const char *name, ++ const struct grub_dirhook_info *info __attribute__((unused)), + void *data) + { + struct match_files_ctx *ctx = data; +-- +2.4.3 + diff --git a/0305-zfs-mzap_lookup-Fix-argument-types.patch b/0305-zfs-mzap_lookup-Fix-argument-types.patch new file mode 100644 index 0000000..6fcc587 --- /dev/null +++ b/0305-zfs-mzap_lookup-Fix-argument-types.patch @@ -0,0 +1,42 @@ +From 87a04adb6541c4bf169644bb2f84036a7c8558dd Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:22:01 +0100 +Subject: [PATCH 305/506] zfs/mzap_lookup: Fix argument types + +--- + grub-core/fs/zfs/zfs.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 057b471..0cbb84b 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -2013,12 +2013,14 @@ dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, + */ + static grub_err_t + mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian, +- int objsize, const char *name, grub_uint64_t * value, ++ grub_uint16_t objsize, const char *name, grub_uint64_t * value, + int case_insensitive) + { +- int i, chunks; ++ grub_uint16_t i, chunks; + mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; + ++ if (objsize < MZAP_ENT_LEN) ++ return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); + chunks = objsize / MZAP_ENT_LEN - 1; + for (i = 0; i < chunks; i++) + { +@@ -2426,7 +2428,7 @@ zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val, + struct grub_zfs_data *data, int case_insensitive) + { + grub_uint64_t block_type; +- int size; ++ grub_uint16_t size; + void *zapbuf; + grub_err_t err; + grub_zfs_endian_t endian; +-- +2.4.3 + diff --git a/0306-INSTALL-clarify-that-clang-support-is-experimental.patch b/0306-INSTALL-clarify-that-clang-support-is-experimental.patch new file mode 100644 index 0000000..fda791b --- /dev/null +++ b/0306-INSTALL-clarify-that-clang-support-is-experimental.patch @@ -0,0 +1,26 @@ +From 0b02bfa034be0102507fd1df56d577c9c1892df1 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:22:48 +0100 +Subject: [PATCH 306/506] INSTALL: clarify that clang support is experimental + +--- + INSTALL | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/INSTALL b/INSTALL +index 05cc443..afbb660 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -13,6 +13,9 @@ configuring the GRUB. + + * GCC 4.1.3 or later + Note: older versions may work but support is limited ++ ++ Experimental support for clang 3.3 or later (results in much bigger binaries) ++ for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc + Note: clang 3.2 or later works for i386 and x86_64 targets but results in + much bigger binaries. + earlier versions not tested +-- +2.4.3 + diff --git a/0307-Test-which-flags-make-our-asm-compile.patch b/0307-Test-which-flags-make-our-asm-compile.patch new file mode 100644 index 0000000..2144084 --- /dev/null +++ b/0307-Test-which-flags-make-our-asm-compile.patch @@ -0,0 +1,184 @@ +From 065ad910f1938fb8c02a14fe020819ed28429bad Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 16:29:28 +0100 +Subject: [PATCH 307/506] Test which flags make our asm compile. + +Previously we relied on assumption that clang always needs -no-integrated-as +but it's not always true. +--- + asm-tests/arm.S | 20 ++++++++++++++++++ + asm-tests/i386.S | 10 +++++++++ + asm-tests/mips.S | 11 ++++++++++ + asm-tests/powerpc.S | 8 +++++++ + asm-tests/sparc64.S | 9 ++++++++ + configure.ac | 60 ++++++++++++++++++++++++++++------------------------- + 6 files changed, 90 insertions(+), 28 deletions(-) + create mode 100644 asm-tests/arm.S + create mode 100644 asm-tests/i386.S + create mode 100644 asm-tests/mips.S + create mode 100644 asm-tests/powerpc.S + create mode 100644 asm-tests/sparc64.S + +diff --git a/asm-tests/arm.S b/asm-tests/arm.S +new file mode 100644 +index 0000000..97c2546 +--- /dev/null ++++ b/asm-tests/arm.S +@@ -0,0 +1,20 @@ ++/* on arm clang doesn't support .arch directive */ ++ ++ .text ++ .syntax unified ++ ++#if !defined (__thumb2__) ++ .arch armv7a ++ .arm ++#else ++ .arch armv7 ++ .thumb ++#endif ++ mcr p15, 0, r11, c7, c14, 2 ++ ++ /* clang restricts access to dsb/isb despite .arch */ ++ dsb ++ isb ++ ++ ++ +diff --git a/asm-tests/i386.S b/asm-tests/i386.S +new file mode 100644 +index 0000000..97cd32a +--- /dev/null ++++ b/asm-tests/i386.S +@@ -0,0 +1,10 @@ ++/* on x86 old clang doesn't support .code16 ++ newer clang supports it but creates 6-byte jumps instead of 3-byte ones ++ which makes us go over boot sector size. */ ++ ++ .code16 ++ jmp far ++ .org 4 ++ .space 300 ++far: ++ .byte 0 +diff --git a/asm-tests/mips.S b/asm-tests/mips.S +new file mode 100644 +index 0000000..8233dfc +--- /dev/null ++++ b/asm-tests/mips.S +@@ -0,0 +1,11 @@ ++/* on mips clang doesn't support privilegied instructions, doubleword store/load ++ and crashes with hand-written assembly ++ */ ++ ++ .set mips3 ++ sync ++ ld $t2, 0($t6) ++ ++a: ++ addiu $t7, $s0, (b - a) ++b: nop +diff --git a/asm-tests/powerpc.S b/asm-tests/powerpc.S +new file mode 100644 +index 0000000..396a6cc +--- /dev/null ++++ b/asm-tests/powerpc.S +@@ -0,0 +1,8 @@ ++/* clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly ++ used by gcrypt */ ++/* Cache invalidation loop is a fair test. */ ++ li 5, 0 ++1: icbi 5, 3 ++ addi 5, 5, 32 ++ cmpw 5, 4 ++ blt 1b +diff --git a/asm-tests/sparc64.S b/asm-tests/sparc64.S +new file mode 100644 +index 0000000..03c5fe0 +--- /dev/null ++++ b/asm-tests/sparc64.S +@@ -0,0 +1,9 @@ ++ .text ++1: ++ /* A small list of examples of what clang doesn't support. */ ++ clr %o0 ++ lduw [%o4 + 4], %o4 ++ and %o6, ~0xff, %o6 ++ stw %o5, [%o3] ++ bne,pt %icc, 1b ++ nop +diff --git a/configure.ac b/configure.ac +index 4ef67f0..40b7329 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -560,35 +560,39 @@ AC_COMPILE_IFELSE( + ]])], + [grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])]) + +-# on x86 clang doesn't support .code16 +-# on arm clang doesn't support .arch directive +-# on mips clang doesn't support privilegied instructions, doubleword store/load +-# and crashes with hand-written assembly +-if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \ +- || test "x$target_cpu" = xx86_64 || test "x$target_cpu" = xarm \ +- || test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ); then +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as" +-fi +- +-if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then +-AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame] +-[ +-CFLAGS="$TARGET_CFLAGS" +-AC_COMPILE_IFELSE( +-[AC_LANG_PROGRAM([], [[ +- unsigned int a = 0, b = 0; +- asm volatile ("{ame|addme} %0,%1" : "=r" (a) : "r" (b)); +- if (a) +- return 1; +-]])], +-[grub_cv_cc_target_clang_ame=yes], [grub_cv_cc_target_clang_ame=no])]) +- # clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly +- # used by gcrypt +- if test x$grub_cv_cc_target_clang_ame = xno ; then +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as" +- TARGET_CFLAGS="$TARGET_CFLAGS -no-integrated-as" +- fi ++AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [ ++test_program= ++case "x$target_cpu" in ++ xmips | xmipsel) ++ test_program=mips ++ ;; ++ xi386 | xx86_64) ++ test_program=i386 ++ ;; ++ xpowerpc | xsparc64 | xarm) ++ test_program=$target_cpu ++ ;; ++esac ++if test x"$test_program" = x ; then ++ grub_cv_cc_target_asm_compile= ++else ++ found=no ++ for arg in "" "-no-integrated-as"; do ++ cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S" ++ echo "Running $cmdline" >&AS_MESSAGE_LOG_FD ++ if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ++ grub_cv_cc_target_asm_compile="$arg" ++ found=yes ++ break ++ fi ++ done ++ if test x"$found" = xno ; then ++ AC_MSG_ERROR([could not compile assembly]) ++ fi + fi ++]) ++ ++TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_cc_target_asm_compile" + + if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then + TARGET_CFLAGS="$TARGET_CFLAGS -march=i386" +-- +2.4.3 + diff --git a/0308-i386-Move-from-explicit-ADDR32-DATA32-prefixes-to-in.patch b/0308-i386-Move-from-explicit-ADDR32-DATA32-prefixes-to-in.patch new file mode 100644 index 0000000..25f65f9 --- /dev/null +++ b/0308-i386-Move-from-explicit-ADDR32-DATA32-prefixes-to-in.patch @@ -0,0 +1,114 @@ +From f571dc1af85e2044141a1dfff3af85a18c30fcd5 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 17:13:23 +0100 +Subject: [PATCH 308/506] i386: Move from explicit ADDR32/DATA32 prefixes to + instruction suffixes. + +Is more portable. +Binary is unchanged (verified). +--- + grub-core/boot/i386/pc/startup_raw.S | 4 ++-- + grub-core/boot/i386/qemu/boot.S | 2 +- + grub-core/kern/i386/pc/startup.S | 2 +- + grub-core/kern/i386/realmode.S | 10 +++++----- + 4 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/grub-core/boot/i386/pc/startup_raw.S b/grub-core/boot/i386/pc/startup_raw.S +index 2796740..812ff54 100644 +--- a/grub-core/boot/i386/pc/startup_raw.S ++++ b/grub-core/boot/i386/pc/startup_raw.S +@@ -95,7 +95,7 @@ LOCAL (codestart): + int $0x13 + + /* transition to protected mode */ +- DATA32 call real_to_prot ++ calll real_to_prot + + /* The ".code32" directive takes GAS out of 16-bit mode. */ + .code32 +@@ -149,7 +149,7 @@ gate_a20_try_bios: + movw $0x2401, %ax + int $0x15 + +- DATA32 call real_to_prot ++ calll real_to_prot + .code32 + + popl %ebp +diff --git a/grub-core/boot/i386/qemu/boot.S b/grub-core/boot/i386/qemu/boot.S +index bdd68c7..8d97fc1 100644 +--- a/grub-core/boot/i386/qemu/boot.S ++++ b/grub-core/boot/i386/qemu/boot.S +@@ -48,7 +48,7 @@ VARIABLE(grub_core_entry_addr) + /* Transition to protected mode. We use pushl to force generation + of a flat return address. */ + pushl $1f +- DATA32 jmp real_to_prot ++ jmpl real_to_prot + .code32 + /* Ensure A20 is enabled. We're in qemu, so control port A works + and there is no need to wait since there is no real logic, it's +diff --git a/grub-core/kern/i386/pc/startup.S b/grub-core/kern/i386/pc/startup.S +index 6bb36c6..b8a9b33 100644 +--- a/grub-core/kern/i386/pc/startup.S ++++ b/grub-core/kern/i386/pc/startup.S +@@ -135,7 +135,7 @@ LOCAL(prot_to_real_addr): + + .macro REAL_TO_PROT + movl LOCAL(real_to_prot_addr), %eax +- DATA32 call *%ax ++ calll *%eax + .endm + + /* +diff --git a/grub-core/kern/i386/realmode.S b/grub-core/kern/i386/realmode.S +index 541cedc..732697c 100644 +--- a/grub-core/kern/i386/realmode.S ++++ b/grub-core/kern/i386/realmode.S +@@ -54,7 +54,7 @@ protstack: + .endm + + .macro REAL_TO_PROT +- DATA32 call real_to_prot ++ calll real_to_prot + .endm + + /* +@@ -137,7 +137,7 @@ real_to_prot: + /* load the GDT register */ + xorw %ax, %ax + movw %ax, %ds +- DATA32 ADDR32 lgdt gdtdesc ++ ADDR32 lgdtl gdtdesc + + /* turn on protected mode */ + movl %cr0, %eax +@@ -145,7 +145,7 @@ real_to_prot: + movl %eax, %cr0 + + /* jump to relocation, flush prefetch queue, and reload %cs */ +- DATA32 ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg ++ ljmpl $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg + + .code32 + protcseg: +@@ -237,7 +237,7 @@ tmpcseg: + movl %eax, %cr0 + + /* flush prefetch queue, reload %cs */ +- DATA32 ljmp $0, $realcseg ++ ljmpl $0, $realcseg + + realcseg: + /* we are in real mode now +@@ -258,6 +258,6 @@ realcseg: + #endif + + /* return on new stack! */ +- DATA32 ret ++ retl + + .code32 +-- +2.4.3 + diff --git a/0309-Change-dot-assignmnet-to-more-portable-.org.patch b/0309-Change-dot-assignmnet-to-more-portable-.org.patch new file mode 100644 index 0000000..7199d4e --- /dev/null +++ b/0309-Change-dot-assignmnet-to-more-portable-.org.patch @@ -0,0 +1,199 @@ +From bc29c6d019c8645e6da843c78ba522f17165e808 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 17:19:01 +0100 +Subject: [PATCH 309/506] Change dot assignmnet to more portable .org. + +Binary is unchanged (verified) +--- + grub-core/boot/i386/pc/boot.S | 20 ++++++++++---------- + grub-core/boot/i386/pc/cdboot.S | 4 ++-- + grub-core/boot/i386/pc/diskboot.S | 2 +- + grub-core/boot/i386/pc/lnxboot.S | 4 ++-- + grub-core/boot/i386/pc/pxeboot.S | 2 +- + grub-core/boot/i386/pc/startup_raw.S | 10 +++++----- + 6 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S +index b4975e2..d17a138 100644 +--- a/grub-core/boot/i386/pc/boot.S ++++ b/grub-core/boot/i386/pc/boot.S +@@ -165,8 +165,8 @@ start: + * this area. + */ + +- . = _start + GRUB_BOOT_MACHINE_BPB_START +- . = _start + 4 ++ .org GRUB_BOOT_MACHINE_BPB_START ++ .org 4 + #endif + #ifdef HYBRID_BOOT + floppy +@@ -174,7 +174,7 @@ start: + scratch + #endif + +- . = _start + GRUB_BOOT_MACHINE_BPB_END ++ .org GRUB_BOOT_MACHINE_BPB_END + /* + * End of BIOS parameter block. + */ +@@ -183,14 +183,14 @@ kernel_address: + .word GRUB_BOOT_MACHINE_KERNEL_ADDR + + #ifndef HYBRID_BOOT +- . = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR ++ .org GRUB_BOOT_MACHINE_KERNEL_SECTOR + kernel_sector: + .long 1 + kernel_sector_high: + .long 0 + #endif + +- . = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE ++ .org GRUB_BOOT_MACHINE_BOOT_DRIVE + boot_drive: + .byte 0xff /* the disk to load kernel from */ + /* 0xff means use the boot drive */ +@@ -208,7 +208,7 @@ LOCAL(after_BPB): + * possible boot drive. If GRUB is installed into a floppy, + * this does nothing (only jump). + */ +- . = _start + GRUB_BOOT_MACHINE_DRIVE_CHECK ++ .org GRUB_BOOT_MACHINE_DRIVE_CHECK + boot_drive_check: + jmp 3f /* grub-setup may overwrite this jump */ + testb $0x80, %dl +@@ -511,13 +511,13 @@ LOCAL(message): + */ + + #ifdef HYBRID_BOOT +- . = _start + 0x1b0 ++ .org 0x1b0 + kernel_sector: + .long 1 + kernel_sector_high: + .long 0 + #endif +- . = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC ++ .org GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC + nt_magic: + .long 0 + .word 0 +@@ -528,7 +528,7 @@ nt_magic: + * sneaky, huh? + */ + +- . = _start + GRUB_BOOT_MACHINE_PART_START ++ .org GRUB_BOOT_MACHINE_PART_START + + #ifndef HYBRID_BOOT + floppy +@@ -536,7 +536,7 @@ nt_magic: + scratch + #endif + +- . = _start + GRUB_BOOT_MACHINE_PART_END ++ .org GRUB_BOOT_MACHINE_PART_END + + /* the last 2 bytes in the sector 0 contain the signature */ + .word GRUB_BOOT_MACHINE_SIGNATURE +diff --git a/grub-core/boot/i386/pc/cdboot.S b/grub-core/boot/i386/pc/cdboot.S +index 92df7c7..de4f809 100644 +--- a/grub-core/boot/i386/pc/cdboot.S ++++ b/grub-core/boot/i386/pc/cdboot.S +@@ -43,7 +43,7 @@ _start: + LOCAL(next): + jmp 1f + +- . = start + 8 ++ .org 8 + + bi_pvd: + .long 0 /* LBA of primary volume descriptor. */ +@@ -168,6 +168,6 @@ err_noboot_msg: + err_cdfail_msg: + .ascii "cdrom read fails\0" + +- . = start + 0x7FF ++ .org 0x7FF + + .byte 0 +diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S +index d030a14..1ee4cf5 100644 +--- a/grub-core/boot/i386/pc/diskboot.S ++++ b/grub-core/boot/i386/pc/diskboot.S +@@ -362,7 +362,7 @@ LOCAL(message): + .word 0 + .word 0 + +- . = _start + 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE ++ .org 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE + LOCAL(firstlist): /* this label has to be before the first list entry!!! */ + /* fill the first data listing with the default */ + blocklist_default_start: +diff --git a/grub-core/boot/i386/pc/lnxboot.S b/grub-core/boot/i386/pc/lnxboot.S +index 87e56a2..2dda0e0 100644 +--- a/grub-core/boot/i386/pc/lnxboot.S ++++ b/grub-core/boot/i386/pc/lnxboot.S +@@ -41,7 +41,7 @@ data_start: + xorl %ebp, %ebp + jmp LOCAL(linux_next) + +- . = data_start + 0x1F1 ++ .org 0x1F1 + + setup_sects: + .byte CODE_SECTORS +@@ -292,4 +292,4 @@ LOCAL(fail): + err_int15_msg: + .ascii "move memory fails\0" + +- . = _start + CODE_SECTORS * 512 ++ .org (CODE_SECTORS * 512 + 512) +diff --git a/grub-core/boot/i386/pc/pxeboot.S b/grub-core/boot/i386/pc/pxeboot.S +index 446bfc7..b695b24 100644 +--- a/grub-core/boot/i386/pc/pxeboot.S ++++ b/grub-core/boot/i386/pc/pxeboot.S +@@ -38,5 +38,5 @@ start: + /* This region is a junk. Do you say that this is wasteful? + But I like that the memory layout of the body is consistent + among different kernels rather than scamping just for 1.5KB. */ +- . = _start + 0x8200 - 0x7C00 - 0x200 - 1 ++ .org 0x8200 - 0x7C00 - 0x200 - 1 + .byte 0 +diff --git a/grub-core/boot/i386/pc/startup_raw.S b/grub-core/boot/i386/pc/startup_raw.S +index 812ff54..0f8806c 100644 +--- a/grub-core/boot/i386/pc/startup_raw.S ++++ b/grub-core/boot/i386/pc/startup_raw.S +@@ -50,23 +50,23 @@ LOCAL (base): + * This is a special data area. + */ + +- . = _start + GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE ++ .org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE + LOCAL(compressed_size): + .long 0 +- . = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE ++ .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE + LOCAL(uncompressed_size): + .long 0 + +- . = _start + GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY ++ .org GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY + reed_solomon_redundancy: + .long 0 +- . = _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH ++ .org GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH + .short (LOCAL(reed_solomon_part) - _start) + + /* + * This is the area for all of the special variables. + */ +- . = _start + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE ++ .org GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + LOCAL(boot_dev): + .byte 0xFF, 0xFF, 0xFF + LOCAL(boot_drive): +-- +2.4.3 + diff --git a/0310-i386-pc-boot-Explicitly-mark-kernel_address-_high-as.patch b/0310-i386-pc-boot-Explicitly-mark-kernel_address-_high-as.patch new file mode 100644 index 0000000..3aa7c78 --- /dev/null +++ b/0310-i386-pc-boot-Explicitly-mark-kernel_address-_high-as.patch @@ -0,0 +1,94 @@ +From 1998d63688080e59abda2092ff4b58a1eeb19b90 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 17:20:10 +0100 +Subject: [PATCH 310/506] i386-pc/boot: Explicitly mark kernel_address[_high] + as local. + +Otherwise apple asm might try to make accesses relocatable. +--- + grub-core/boot/i386/pc/boot.S | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S +index d17a138..2bd0b2d 100644 +--- a/grub-core/boot/i386/pc/boot.S ++++ b/grub-core/boot/i386/pc/boot.S +@@ -179,14 +179,14 @@ start: + * End of BIOS parameter block. + */ + +-kernel_address: ++LOCAL(kernel_address): + .word GRUB_BOOT_MACHINE_KERNEL_ADDR + + #ifndef HYBRID_BOOT + .org GRUB_BOOT_MACHINE_KERNEL_SECTOR +-kernel_sector: ++LOCAL(kernel_sector): + .long 1 +-kernel_sector_high: ++LOCAL(kernel_sector_high): + .long 0 + #endif + +@@ -275,7 +275,7 @@ real_start: + andw $1, %cx + jz LOCAL(chs_mode) + +-lba_mode: ++LOCAL(lba_mode): + xorw %ax, %ax + movw %ax, 4(%si) + +@@ -290,9 +290,9 @@ lba_mode: + movw $0x0010, (%si) + + /* the absolute address */ +- movl kernel_sector, %ebx ++ movl LOCAL(kernel_sector), %ebx + movl %ebx, 8(%si) +- movl kernel_sector_high, %ebx ++ movl LOCAL(kernel_sector_high), %ebx + movl %ebx, 12(%si) + + /* the segment of buffer address */ +@@ -361,13 +361,13 @@ LOCAL(final_init): + + setup_sectors: + /* load logical sector start (top half) */ +- movl kernel_sector_high, %eax ++ movl LOCAL(kernel_sector_high), %eax + + orl %eax, %eax + jnz LOCAL(geometry_error) + + /* load logical sector start (bottom half) */ +- movl kernel_sector, %eax ++ movl LOCAL(kernel_sector), %eax + + /* zero %edx */ + xorl %edx, %edx +@@ -452,7 +452,7 @@ LOCAL(copy_buffer): + popa + + /* boot kernel */ +- jmp *(kernel_address) ++ jmp *(LOCAL(kernel_address)) + + /* END OF MAIN LOOP */ + +@@ -512,9 +512,9 @@ LOCAL(message): + + #ifdef HYBRID_BOOT + .org 0x1b0 +-kernel_sector: ++LOCAL(kernel_sector): + .long 1 +-kernel_sector_high: ++LOCAL(kernel_sector_high): + .long 0 + #endif + .org GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC +-- +2.4.3 + diff --git a/0311-i386-Remove-needless-ADDR32-prefixes-when-address-is.patch b/0311-i386-Remove-needless-ADDR32-prefixes-when-address-is.patch new file mode 100644 index 0000000..7b8f6f0 --- /dev/null +++ b/0311-i386-Remove-needless-ADDR32-prefixes-when-address-is.patch @@ -0,0 +1,41 @@ +From 37353f0ae5b9a4123ca9fe132a2336c08f30615a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 17:38:56 +0100 +Subject: [PATCH 311/506] i386: Remove needless ADDR32 prefixes when address is + known and fixed. + +Shaves off 6 bytes in lzma_decompress.img. +--- + grub-core/boot/i386/pc/startup_raw.S | 2 +- + grub-core/kern/i386/realmode.S | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/boot/i386/pc/startup_raw.S b/grub-core/boot/i386/pc/startup_raw.S +index 0f8806c..8bce798 100644 +--- a/grub-core/boot/i386/pc/startup_raw.S ++++ b/grub-core/boot/i386/pc/startup_raw.S +@@ -89,7 +89,7 @@ LOCAL (codestart): + sti /* we're safe again */ + + /* save the boot drive */ +- ADDR32 movb %dl, LOCAL(boot_drive) ++ movb %dl, LOCAL(boot_drive) + + /* reset disk system (%ah = 0) */ + int $0x13 +diff --git a/grub-core/kern/i386/realmode.S b/grub-core/kern/i386/realmode.S +index 732697c..1384d52 100644 +--- a/grub-core/kern/i386/realmode.S ++++ b/grub-core/kern/i386/realmode.S +@@ -137,7 +137,7 @@ real_to_prot: + /* load the GDT register */ + xorw %ax, %ax + movw %ax, %ds +- ADDR32 lgdtl gdtdesc ++ lgdtl gdtdesc + + /* turn on protected mode */ + movl %cr0, %eax +-- +2.4.3 + diff --git a/0312-Remove-obsolete-ADDR32-and-DATA32-checks.patch b/0312-Remove-obsolete-ADDR32-and-DATA32-checks.patch new file mode 100644 index 0000000..8225d9c --- /dev/null +++ b/0312-Remove-obsolete-ADDR32-and-DATA32-checks.patch @@ -0,0 +1,150 @@ +From 6505b241fd86456626dda85651f22467df8294fa Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 17:44:41 +0100 +Subject: [PATCH 312/506] Remove obsolete ADDR32 and DATA32 checks. + +--- + acinclude.m4 | 74 ------------------------------------------------- + config.h.in | 4 --- + configure.ac | 4 --- + grub-core/modinfo.sh.in | 2 -- + 4 files changed, 84 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index b2bb88d..609c4f2 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -210,80 +210,6 @@ fi + ]) + + +-dnl Mass confusion! +-dnl Older versions of GAS interpret `.code16' to mean ``generate 32-bit +-dnl instructions, but implicitly insert addr32 and data32 bytes so +-dnl that the code works in real mode''. +-dnl +-dnl Newer versions of GAS interpret `.code16' to mean ``generate 16-bit +-dnl instructions,'' which seems right. This requires the programmer +-dnl to explicitly insert addr32 and data32 instructions when they want +-dnl them. +-dnl +-dnl We only support the newer versions, because the old versions cause +-dnl major pain, by requiring manual assembly to get 16-bit instructions into +-dnl asm files. +-AC_DEFUN([grub_I386_ASM_ADDR32], +-[AC_REQUIRE([AC_PROG_CC]) +-AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT]) +-AC_MSG_CHECKING([for .code16 addr32 assembler support]) +-AC_CACHE_VAL(grub_cv_i386_asm_addr32, +-[cat > conftest.s.in <<\EOF +- .code16 +-l1: @ADDR32@ movb %al, l1 +-EOF +- +-if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then +- sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s +-else +- sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s +-fi +- +-if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then +- grub_cv_i386_asm_addr32=yes +-else +- grub_cv_i386_asm_addr32=no +-fi +- +-rm -f conftest*]) +- +-AC_MSG_RESULT([$grub_cv_i386_asm_addr32])]) +- +-dnl Later versions of GAS requires that addr32 and data32 prefixes +-dnl appear in the same lines as the instructions they modify, while +-dnl earlier versions requires that they appear in separate lines. +-AC_DEFUN([grub_I386_ASM_PREFIX_REQUIREMENT], +-[AC_REQUIRE([AC_PROG_CC]) +-AC_MSG_CHECKING(dnl +-[whether addr32 must be in the same line as the instruction]) +-AC_CACHE_VAL(grub_cv_i386_asm_prefix_requirement, +-[cat > conftest.s <<\EOF +- .code16 +-l1: addr32 movb %al, l1 +-EOF +- +-if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then +- grub_cv_i386_asm_prefix_requirement=yes +-else +- grub_cv_i386_asm_prefix_requirement=no +-fi +- +-rm -f conftest*]) +- +-if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then +- grub_tmp_addr32="addr32" +- grub_tmp_data32="data32" +-else +- grub_tmp_addr32="addr32;" +- grub_tmp_data32="data32;" +-fi +- +-ADDR32=$grub_tmp_addr32 +-DATA32=$grub_tmp_data32 +- +-AC_MSG_RESULT([$grub_cv_i386_asm_prefix_requirement])]) +- +- + dnl Check what symbol is defined as a bss start symbol. + dnl Written by Michael Hohmoth and Yoshinori K. Okuji. + AC_DEFUN([grub_CHECK_BSS_START_SYMBOL], +diff --git a/config.h.in b/config.h.in +index 4b63014..d93b687 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -31,10 +31,6 @@ + #define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ + /* Define if C symbols get an underscore after compilation. */ + #define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ +-/* Define it to \"addr32\" or \"addr32;\" to make GAS happy. */ +-#define ADDR32 @ADDR32@ +-/* Define it to \"data32\" or \"data32;\" to make GAS happy. */ +-#define DATA32 @DATA32@ + /* Define it to one of __bss_start, edata and _edata. */ + #define BSS_START_SYMBOL @BSS_START_SYMBOL@ + /* Define it to either end or _end. */ +diff --git a/configure.ac b/configure.ac +index 40b7329..8ddb5d3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1096,8 +1096,6 @@ if test "x$target_cpu" = xi386; then + grub_CHECK_END_SYMBOL + fi + CFLAGS="$TARGET_CFLAGS" +- grub_I386_ASM_PREFIX_REQUIREMENT +- grub_I386_ASM_ADDR32 + fi + + grub_PROG_NM_WORKS +@@ -1621,8 +1619,6 @@ AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], + [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) + + AC_SUBST(HAVE_ASM_USCORE) +-AC_SUBST(ADDR32) +-AC_SUBST(DATA32) + AC_SUBST(BSS_START_SYMBOL) + AC_SUBST(END_SYMBOL) + AC_SUBST(PACKAGE) +diff --git a/grub-core/modinfo.sh.in b/grub-core/modinfo.sh.in +index 69d8334..09d22f9 100644 +--- a/grub-core/modinfo.sh.in ++++ b/grub-core/modinfo.sh.in +@@ -9,8 +9,6 @@ grub_have_font_source=@HAVE_FONT_SOURCE@ + + # Autodetected config + grub_have_asm_uscore=@HAVE_ASM_USCORE@ +-grub_i8086_addr32="@ADDR32@" +-grub_i8086_data32="@DATA32@" + grub_bss_start_symbol="@BSS_START_SYMBOL@" + grub_end_symbol="@END_SYMBOL@" + +-- +2.4.3 + diff --git a/0313-Remove-realmode.S-from-coreboot-and-qemu.patch b/0313-Remove-realmode.S-from-coreboot-and-qemu.patch new file mode 100644 index 0000000..430e66f --- /dev/null +++ b/0313-Remove-realmode.S-from-coreboot-and-qemu.patch @@ -0,0 +1,37 @@ +From 44ff462e836cb24bde0de184fb1e3cdeedcdd572 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 19:53:18 +0100 +Subject: [PATCH 313/506] Remove realmode.S from coreboot and qemu. + +It's not used there. +--- + grub-core/kern/i386/coreboot/startup.S | 5 ----- + grub-core/kern/i386/qemu/startup.S | 2 -- + 2 files changed, 7 deletions(-) + +diff --git a/grub-core/kern/i386/coreboot/startup.S b/grub-core/kern/i386/coreboot/startup.S +index 8c32838..c848654 100644 +--- a/grub-core/kern/i386/coreboot/startup.S ++++ b/grub-core/kern/i386/coreboot/startup.S +@@ -61,8 +61,3 @@ multiboot_header: + /* checksum */ + .long -0x1BADB002 - MULTIBOOT_MEMORY_INFO + +-/* +- * prot_to_real and associated structures (but NOT real_to_prot, that is +- * only needed for BIOS gates). +- */ +-#include "../realmode.S" +diff --git a/grub-core/kern/i386/qemu/startup.S b/grub-core/kern/i386/qemu/startup.S +index 3d47d1e..17aace9 100644 +--- a/grub-core/kern/i386/qemu/startup.S ++++ b/grub-core/kern/i386/qemu/startup.S +@@ -73,5 +73,3 @@ codestart: + 1: + hlt + jmp 1b +- +-#include "../realmode.S" +-- +2.4.3 + diff --git a/0314-qemu-Fix-compilation.patch b/0314-qemu-Fix-compilation.patch new file mode 100644 index 0000000..83a2116 --- /dev/null +++ b/0314-qemu-Fix-compilation.patch @@ -0,0 +1,70 @@ +From e62ca2a870ecec4d46fcc03556e8e61592e9dd18 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 19:55:53 +0100 +Subject: [PATCH 314/506] qemu: Fix compilation + +--- + grub-core/boot/i386/qemu/boot.S | 2 +- + grub-core/kern/i386/realmode.S | 20 +++++++++++++++++++- + 2 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/grub-core/boot/i386/qemu/boot.S b/grub-core/boot/i386/qemu/boot.S +index 8d97fc1..354436e 100644 +--- a/grub-core/boot/i386/qemu/boot.S ++++ b/grub-core/boot/i386/qemu/boot.S +@@ -48,7 +48,7 @@ VARIABLE(grub_core_entry_addr) + /* Transition to protected mode. We use pushl to force generation + of a flat return address. */ + pushl $1f +- jmpl real_to_prot ++ jmp real_to_prot + .code32 + /* Ensure A20 is enabled. We're in qemu, so control port A works + and there is no need to wait since there is no real logic, it's +diff --git a/grub-core/kern/i386/realmode.S b/grub-core/kern/i386/realmode.S +index 1384d52..998fdc7 100644 +--- a/grub-core/kern/i386/realmode.S ++++ b/grub-core/kern/i386/realmode.S +@@ -137,7 +137,22 @@ real_to_prot: + /* load the GDT register */ + xorw %ax, %ax + movw %ax, %ds ++#ifdef GRUB_MACHINE_QEMU ++ /* ++ qemu is special: gdtdesc is in ROM. ++ %cs = 0xf000 ++ _start + GRUB_BOOT_MACHINE_SIZE = 0x100000 ++ So ++ _start + GRUB_BOOT_MACHINE_SIZE - 0x10000 points to the same point ++ as %cs. ++ gdtdesc - (_start + GRUB_BOOT_MACHINE_SIZE - 0x10000) ++ = gdtdesc - _start - GRUB_BOOT_MACHINE_SIZE + 0x10000 ++ but the later can be computed by assembly. ++ */ ++ lgdtl %cs:(gdtdesc - _start - GRUB_BOOT_MACHINE_SIZE + 0x10000) ++#else + lgdtl gdtdesc ++#endif + + /* turn on protected mode */ + movl %cr0, %eax +@@ -178,6 +193,9 @@ protcseg: + + /* return on the old (or initialized) stack! */ + ret ++ /* prot_to_real assumes that this code is under 64K which is not ++ true for qemu. */ ++#ifndef GRUB_MACHINE_QEMU + /* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009,2010 Free Software Foundation, Inc. +@@ -259,5 +277,5 @@ realcseg: + + /* return on new stack! */ + retl +- ++#endif + .code32 +-- +2.4.3 + diff --git a/0315-qemu-Fix-GateA20-enabling.patch b/0315-qemu-Fix-GateA20-enabling.patch new file mode 100644 index 0000000..6fd8b80 --- /dev/null +++ b/0315-qemu-Fix-GateA20-enabling.patch @@ -0,0 +1,33 @@ +From 8afd8f3b641aaa80b70bb6629ea8eecae5d359df Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:00:18 +0100 +Subject: [PATCH 315/506] qemu: Fix GateA20 enabling. + +GateA20 code was inactive due to address error. +--- + grub-core/boot/i386/qemu/boot.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/boot/i386/qemu/boot.S b/grub-core/boot/i386/qemu/boot.S +index 354436e..c5343bf 100644 +--- a/grub-core/boot/i386/qemu/boot.S ++++ b/grub-core/boot/i386/qemu/boot.S +@@ -50,6 +50,7 @@ VARIABLE(grub_core_entry_addr) + pushl $1f + jmp real_to_prot + .code32 ++1: + /* Ensure A20 is enabled. We're in qemu, so control port A works + and there is no need to wait since there is no real logic, it's + all emulated. */ +@@ -57,7 +58,6 @@ VARIABLE(grub_core_entry_addr) + andb $(~0x03), %al + orb $0x02, %al + outb $0x92 +-1: + movl EXT_C(grub_core_entry_addr), %edx + jmp *%edx + +-- +2.4.3 + diff --git a/0316-qemu-Switch-to-more-portable-.org.patch b/0316-qemu-Switch-to-more-portable-.org.patch new file mode 100644 index 0000000..6f164ef --- /dev/null +++ b/0316-qemu-Switch-to-more-portable-.org.patch @@ -0,0 +1,52 @@ +From 3c6043245e9618a499766fdb0e51c4953d5d3da9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:13:58 +0100 +Subject: [PATCH 316/506] qemu: Switch to more portable .org + +Binary is checked identical. +--- + grub-core/boot/i386/qemu/boot.S | 6 +++--- + grub-core/kern/i386/qemu/startup.S | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/grub-core/boot/i386/qemu/boot.S b/grub-core/boot/i386/qemu/boot.S +index c5343bf..8c3a1db 100644 +--- a/grub-core/boot/i386/qemu/boot.S ++++ b/grub-core/boot/i386/qemu/boot.S +@@ -31,7 +31,7 @@ _start: + + jmp 1f + +- . = _start + GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR ++ .org GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR + VARIABLE(grub_core_entry_addr) + .long 0 + 1: +@@ -66,9 +66,9 @@ VARIABLE(grub_core_entry_addr) + /* Intel, in its infinite wisdom, decided to put the i8086 entry point + *right here* and this is why we need this kludge. */ + +- . = GRUB_BOOT_MACHINE_SIZE - 16 ++ .org GRUB_BOOT_MACHINE_SIZE - 16 + + .code16 + + jmp _start +- . = GRUB_BOOT_MACHINE_SIZE ++ .org GRUB_BOOT_MACHINE_SIZE +diff --git a/grub-core/kern/i386/qemu/startup.S b/grub-core/kern/i386/qemu/startup.S +index 17aace9..0d89858 100644 +--- a/grub-core/kern/i386/qemu/startup.S ++++ b/grub-core/kern/i386/qemu/startup.S +@@ -28,7 +28,7 @@ + _start: + jmp codestart + +- . = _start + GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR ++ .org GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR + VARIABLE(grub_core_entry_addr) + .long 0 + +-- +2.4.3 + diff --git a/0317-Relax-requirements-on-asm-for-non-BIOS-i386-platform.patch b/0317-Relax-requirements-on-asm-for-non-BIOS-i386-platform.patch new file mode 100644 index 0000000..2f31aa3 --- /dev/null +++ b/0317-Relax-requirements-on-asm-for-non-BIOS-i386-platform.patch @@ -0,0 +1,77 @@ +From f16b8c04057925270d765532fa5710757119c6da Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:18:18 +0100 +Subject: [PATCH 317/506] Relax requirements on asm for non-BIOS i386 + platforms. + +These platforms don't have a hard limit on size of resulting code16 +code, so we don't care if assembly is bigger than necessarry. +--- + asm-tests/i386-pc.S | 10 ++++++++++ + asm-tests/i386.S | 10 ++-------- + configure.ac | 11 +++++++---- + 3 files changed, 19 insertions(+), 12 deletions(-) + create mode 100644 asm-tests/i386-pc.S + +diff --git a/asm-tests/i386-pc.S b/asm-tests/i386-pc.S +new file mode 100644 +index 0000000..97cd32a +--- /dev/null ++++ b/asm-tests/i386-pc.S +@@ -0,0 +1,10 @@ ++/* on x86 old clang doesn't support .code16 ++ newer clang supports it but creates 6-byte jumps instead of 3-byte ones ++ which makes us go over boot sector size. */ ++ ++ .code16 ++ jmp far ++ .org 4 ++ .space 300 ++far: ++ .byte 0 +diff --git a/asm-tests/i386.S b/asm-tests/i386.S +index 97cd32a..30adc4f 100644 +--- a/asm-tests/i386.S ++++ b/asm-tests/i386.S +@@ -1,10 +1,4 @@ +-/* on x86 old clang doesn't support .code16 +- newer clang supports it but creates 6-byte jumps instead of 3-byte ones +- which makes us go over boot sector size. */ ++/* on x86 old clang doesn't support .code16 */ + + .code16 +- jmp far +- .org 4 +- .space 300 +-far: +- .byte 0 ++ movb %al, %bl +diff --git a/configure.ac b/configure.ac +index 8ddb5d3..8b94d34 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -562,14 +562,17 @@ AC_COMPILE_IFELSE( + + AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [ + test_program= +-case "x$target_cpu" in +- xmips | xmipsel) ++case "x$target_cpu-$platform" in ++ xmips-* | xmipsel-*) + test_program=mips + ;; +- xi386 | xx86_64) ++ xi386-pc) ++ test_program=i386-pc ++ ;; ++ xi386-* | xx86_64-*) + test_program=i386 + ;; +- xpowerpc | xsparc64 | xarm) ++ xpowerpc-* | xsparc64-* | xarm-*) + test_program=$target_cpu + ;; + esac +-- +2.4.3 + diff --git a/0318-kernel-8086-Switch-to-more-portable-.org.patch b/0318-kernel-8086-Switch-to-more-portable-.org.patch new file mode 100644 index 0000000..9116a2b --- /dev/null +++ b/0318-kernel-8086-Switch-to-more-portable-.org.patch @@ -0,0 +1,25 @@ +From e77dc3d9a0b672d933f328fce4332a61a9f5f707 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:24:59 +0100 +Subject: [PATCH 318/506] kernel-8086: Switch to more portable .org. + +--- + grub-core/tests/boot/kernel-8086.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/tests/boot/kernel-8086.S b/grub-core/tests/boot/kernel-8086.S +index 510897c..5ec5368 100644 +--- a/grub-core/tests/boot/kernel-8086.S ++++ b/grub-core/tests/boot/kernel-8086.S +@@ -46,5 +46,5 @@ message: + .ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n" + .byte 0 + +- . = base + 510 +- .short 0xaa55 +\ No newline at end of file ++ .org 510 ++ .short 0xaa55 +-- +2.4.3 + diff --git a/0319-sparc64-Switch-to-more-portable-.org.patch b/0319-sparc64-Switch-to-more-portable-.org.patch new file mode 100644 index 0000000..f8b4c3c --- /dev/null +++ b/0319-sparc64-Switch-to-more-portable-.org.patch @@ -0,0 +1,75 @@ +From 49e5fcb9fb1efd1c9b9622d1bc0fe5fa23e99b81 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:32:03 +0100 +Subject: [PATCH 319/506] sparc64: Switch to more portable .org. + +Binaries are unchanged. +--- + grub-core/boot/sparc64/ieee1275/boot.S | 8 ++++---- + grub-core/boot/sparc64/ieee1275/diskboot.S | 2 +- + grub-core/kern/sparc64/ieee1275/crt0.S | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/grub-core/boot/sparc64/ieee1275/boot.S b/grub-core/boot/sparc64/ieee1275/boot.S +index 5073677..586efb4 100644 +--- a/grub-core/boot/sparc64/ieee1275/boot.S ++++ b/grub-core/boot/sparc64/ieee1275/boot.S +@@ -41,9 +41,9 @@ pic_base: + * After loading in that block we will execute it by jumping to the + * load address plus the size of the prepended A.OUT header (32 bytes). + */ +- . = _start + GRUB_BOOT_MACHINE_BOOT_DEVPATH ++ .org GRUB_BOOT_MACHINE_BOOT_DEVPATH + boot_path: +- . = _start + GRUB_BOOT_MACHINE_KERNEL_BYTE ++ .org GRUB_BOOT_MACHINE_KERNEL_BYTE + boot_path_end: + kernel_byte: .xword (2 << 9) + kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR +@@ -52,7 +52,7 @@ kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR + #define boot_path_end (_start + 1024) + #include + +- . = _start + 8 ++ .org 8 + kernel_byte: .xword (2 << 9) + kernel_size: .word 512 + kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS +@@ -224,7 +224,7 @@ bootpath_known: + #else + nop + #endif +- . = _start + GRUB_BOOT_MACHINE_CODE_END ++ .org GRUB_BOOT_MACHINE_CODE_END + + /* the last 4 bytes in the sector 0 contain the signature */ + .word GRUB_BOOT_MACHINE_SIGNATURE +diff --git a/grub-core/boot/sparc64/ieee1275/diskboot.S b/grub-core/boot/sparc64/ieee1275/diskboot.S +index e020f62..35e02c1 100644 +--- a/grub-core/boot/sparc64/ieee1275/diskboot.S ++++ b/grub-core/boot/sparc64/ieee1275/diskboot.S +@@ -136,7 +136,7 @@ lastlist: + .word 0 + .word 0 + +- . = _start + (0x200 - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE) ++ .org (0x200 - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE) + blocklist_default_start: + .word 0 + .word 2 +diff --git a/grub-core/kern/sparc64/ieee1275/crt0.S b/grub-core/kern/sparc64/ieee1275/crt0.S +index 79b6bb3..03b916f 100644 +--- a/grub-core/kern/sparc64/ieee1275/crt0.S ++++ b/grub-core/kern/sparc64/ieee1275/crt0.S +@@ -27,7 +27,7 @@ _start: + ba codestart + mov %o4, %o0 + +- . = EXT_C(_start) + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE ++ .org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE + + VARIABLE(grub_total_module_size) + .word 0 +-- +2.4.3 + diff --git a/0320-mips-Switch-to-more-portable-.org.patch b/0320-mips-Switch-to-more-portable-.org.patch new file mode 100644 index 0000000..b93611e --- /dev/null +++ b/0320-mips-Switch-to-more-portable-.org.patch @@ -0,0 +1,78 @@ +From da9f30b455a3d1b9e52ae6875b4724c0784c9e8a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 20:43:57 +0100 +Subject: [PATCH 320/506] mips: Switch to more portable .org + +Binary is unchanged. +--- + grub-core/boot/mips/loongson/fwstart.S | 6 +++--- + grub-core/boot/mips/startup_raw.S | 6 +++--- + grub-core/kern/mips/startup.S | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/grub-core/boot/mips/loongson/fwstart.S b/grub-core/boot/mips/loongson/fwstart.S +index 6ae3269..71bab6d 100644 +--- a/grub-core/boot/mips/loongson/fwstart.S ++++ b/grub-core/boot/mips/loongson/fwstart.S +@@ -162,7 +162,7 @@ retry_cs5536: + + b continue + +- . = start + GRUB_CPU_LOONGSON_FLASH_TLB_REFILL - GRUB_CPU_LOONGSON_FLASH_START ++ .org GRUB_CPU_LOONGSON_FLASH_TLB_REFILL - GRUB_CPU_LOONGSON_FLASH_START + tlb_refill: + mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC + mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR +@@ -196,13 +196,13 @@ tlb_refill: + b fatal + addiu $a0, $a0, %lo(unhandled_tlb_refill) + +- . = start + GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR - GRUB_CPU_LOONGSON_FLASH_START ++ .org GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR - GRUB_CPU_LOONGSON_FLASH_START + cache_error: + lui $a0, %hi(unhandled_cache_error) + b fatal + addiu $a0, $a0, %lo(unhandled_cache_error) + +- . = start + GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - GRUB_CPU_LOONGSON_FLASH_START ++ .org GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - GRUB_CPU_LOONGSON_FLASH_START + other_exception: + mfc0 $s0, GRUB_CPU_LOONGSON_COP0_CAUSE + mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC +diff --git a/grub-core/boot/mips/startup_raw.S b/grub-core/boot/mips/startup_raw.S +index c169ca3..ca3413b 100644 +--- a/grub-core/boot/mips/startup_raw.S ++++ b/grub-core/boot/mips/startup_raw.S +@@ -39,13 +39,13 @@ start: + bal codestart + nop + base: +- . = _start + GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE ++ .org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE + compressed_size: + .long 0 +- . = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE ++ .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE + uncompressed_size: + .long 0 +- . = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR ++ .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR + uncompressed_addr: + .long 0 + codestart: +diff --git a/grub-core/kern/mips/startup.S b/grub-core/kern/mips/startup.S +index 709a91a..339ab33 100644 +--- a/grub-core/kern/mips/startup.S ++++ b/grub-core/kern/mips/startup.S +@@ -36,7 +36,7 @@ start: + bal cont + nop + +- . = _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE ++ .org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE + VARIABLE(grub_total_modules_size) + .long 0 + +-- +2.4.3 + diff --git a/0321-Discover-which-option-provides-soft-float-on-configu.patch b/0321-Discover-which-option-provides-soft-float-on-configu.patch new file mode 100644 index 0000000..8c2f774 --- /dev/null +++ b/0321-Discover-which-option-provides-soft-float-on-configu.patch @@ -0,0 +1,64 @@ +From ebe316e4dfebb83c2e1de437b316b60195470961 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 21 Feb 2015 23:46:47 +0100 +Subject: [PATCH 321/506] Discover which option provides soft-float on + configure stage. + +Deals with clang needing other arguments to stop issuing floating +instructions than gcc. +--- + configure.ac | 38 +++++++++++++++++++++++++++++++++----- + 1 file changed, 33 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 8b94d34..10a6bf9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -682,11 +682,39 @@ 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$target_cpu" = xarm64; then +- TARGET_CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd" +-else +- TARGET_CFLAGS="$TARGET_CFLAGS -msoft-float" +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS -msoft-float" ++if test x"$platform" != xemu ; 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 ++ CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd -Werror" ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ [grub_cv_target_cc_soft_float="-march=armv8-a+nofp+nosimd"], []) ++ fi ++ for cand in "-Xclang -msoft-float -Xclang -no-implicit-float" \ ++ "-Xclang -msoft-float" "-msoft-float"; do ++ if test x"$grub_cv_target_cc_soft_float" != xno ; then ++ break ++ fi ++ CFLAGS="$TARGET_CFLAGS $cand -Werror" ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ [grub_cv_target_cc_soft_float="$cand"], []) ++ done ++ ]) ++ ++ if test x"$grub_cv_target_cc_soft_float" = xno ; then ++ AC_MSG_ERROR([could not force soft-float]) ++ fi ++ ++ case x"$grub_cv_target_cc_soft_float" in ++ x"-Xclang"*) ++ # A trick so that clang doesn't see it on link stаge ++ TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_soft_float" ++ ;; ++ *) ++ TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float" ++ ;; ++ esac ++ TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" + fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind +-- +2.4.3 + diff --git a/0322-Experimental-support-for-clang-for-sparc64.patch b/0322-Experimental-support-for-clang-for-sparc64.patch new file mode 100644 index 0000000..bb30bb7 --- /dev/null +++ b/0322-Experimental-support-for-clang-for-sparc64.patch @@ -0,0 +1,137 @@ +From 155f334f5740a33948ee92432a9eacfd0bf4a398 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 01:53:00 +0100 +Subject: [PATCH 322/506] Experimental support for clang for sparc64. + +Automatically discover command line options to make clang and +gcc behave in same way. + +Tested with qemu. +--- + INSTALL | 5 +++-- + conf/Makefile.common | 7 +------ + configure.ac | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 3 files changed, 55 insertions(+), 10 deletions(-) + +diff --git a/INSTALL b/INSTALL +index afbb660..846ac38 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -15,7 +15,7 @@ configuring the GRUB. + Note: older versions may work but support is limited + + Experimental support for clang 3.3 or later (results in much bigger binaries) +- for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc ++ for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc, sparc64 + Note: clang 3.2 or later works for i386 and x86_64 targets but results in + much bigger binaries. + earlier versions not tested +@@ -29,7 +29,8 @@ configuring the GRUB. + fail. + Note: clang 3.2 or later works for powerpc + earlier versions not tested +- Note: clang doesn't support -mno-app-regs and so can't be used for sparc64 ++ Note: clang 3.5 or later works for sparc64 ++ earlier versions return "error: unable to interface with target machine" + Note: clang has no support for ia64 and hence you can't compile GRUB + for ia64 with clang + * GNU Make +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 66c9fdb..8861096 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -7,12 +7,7 @@ unexport LC_ALL + + # Platform specific options + if COND_sparc64_ieee1275 +- CFLAGS_PLATFORM += -mno-app-regs +- LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax +-endif +-if COND_sparc64_emu +- CFLAGS_PLATFORM += -mno-app-regs +- LDFLAGS_PLATFORM = -Wl,--no-relax ++ LDFLAGS_PLATFORM = -Wl,-melf64_sparc + endif + if COND_arm + if !COND_emu +diff --git a/configure.ac b/configure.ac +index 10a6bf9..4d59fbe 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -717,6 +717,55 @@ if test x"$platform" != xemu ; then + TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" + fi + ++if test x"$target_cpu" = xsparc64 ; then ++ AC_CACHE_CHECK([for options to reserve application registers], grub_cv_target_cc_mno_app_regs, [ ++ grub_cv_target_cc_mno_app_regs=no ++ for cand in "-mllvm -sparc-reserve-app-registers" \ ++ "-mno-app-regs"; do ++ if test x"$grub_cv_target_cc_mno_app_regs" != xno ; then ++ break ++ fi ++ CFLAGS="$TARGET_CFLAGS $cand -Werror" ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ [grub_cv_target_cc_mno_app_regs="$cand"], []) ++ done ++ ]) ++ ++ if test x"$grub_cv_target_cc_mno_app_regs" = xno ; then ++ AC_MSG_ERROR([could not reserve application registers]) ++ fi ++ if test x"$grub_cv_target_cc_mno_app_regs" = x"-mllvm -sparc-reserve-app-registers" ; then ++ # A trick so that clang doesn't see it on link stаge ++ TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_app_regs" ++ else ++ TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mno_app_regs" ++ fi ++ ++ AC_CACHE_CHECK([for no-relax options], grub_cv_target_cc_mno_relax, [ ++ grub_cv_target_cc_mno_relax=no ++ for cand in "-mno-relax" "-Wl,--no-relax"; do ++ if test x"$grub_cv_target_cc_mno_relax" != xno ; then ++ break ++ fi ++ LDFLAGS="$TARGET_LDFLAGS $cand -nostdlib -static" ++ CFLAGS="$TARGET_CFLAGS -Werror" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ asm (".globl start; start:"); ++ void __main (void); ++ void __main (void) {} ++ int main (void); ++ ]], [[]])], [grub_cv_target_cc_mno_relax="$cand"], []) ++ done ++ ]) ++ LDFLAGS="$TARGET_LDFLAGS" ++ CFLAGS="$TARGET_CFLAGS" ++ ++ if test x"$grub_cv_target_cc_mno_relax" = xno ; then ++ AC_MSG_ERROR([could not find no-relax options]) ++ fi ++ TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_mno_relax" ++fi ++ + # By default, GCC 4.4 generates .eh_frame sections containing unwind + # information in some cases where it previously did not. GRUB doesn't need + # these and they just use up vital space. Restore the old compiler +@@ -918,7 +967,7 @@ AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) + + LDFLAGS="$TARGET_LDFLAGS" + +-if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; then ++if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 ; then + # Use large model to support 4G memory + AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ + CFLAGS="$TARGET_CFLAGS -mcmodel=large" +@@ -928,7 +977,7 @@ if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; t + ]) + if test "x$grub_cv_cc_mcmodel" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" +- elif test "$target_cpu-$platform" = sparc64-emu; then ++ elif test "$target_cpu" = sparc64; then + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany" + fi + fi +-- +2.4.3 + diff --git a/0323-i386-tsc-Fix-unused-function-warning-on-xen.patch b/0323-i386-tsc-Fix-unused-function-warning-on-xen.patch new file mode 100644 index 0000000..a8f4694 --- /dev/null +++ b/0323-i386-tsc-Fix-unused-function-warning-on-xen.patch @@ -0,0 +1,34 @@ +From 50ebc8f5f35a322b3736c03e16de7108932126b0 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 13:12:44 +0100 +Subject: [PATCH 323/506] i386/tsc: Fix unused function warning on xen. + +--- + grub-core/kern/i386/tsc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c +index d7d1783..bc441d0 100644 +--- a/grub-core/kern/i386/tsc.c ++++ b/grub-core/kern/i386/tsc.c +@@ -57,6 +57,8 @@ grub_get_tsc (void) + return (((grub_uint64_t) hi) << 32) | lo; + } + ++#ifndef GRUB_MACHINE_XEN ++ + static __inline int + grub_cpu_is_tsc_supported (void) + { +@@ -69,8 +71,6 @@ grub_cpu_is_tsc_supported (void) + return (d & (1 << 4)) != 0; + } + +-#ifndef GRUB_MACHINE_XEN +- + static void + grub_pit_wait (grub_uint16_t tics) + { +-- +2.4.3 + diff --git a/0324-configure.ac-Add-ia64-specific-way-to-disable-floats.patch b/0324-configure.ac-Add-ia64-specific-way-to-disable-floats.patch new file mode 100644 index 0000000..7bb17af --- /dev/null +++ b/0324-configure.ac-Add-ia64-specific-way-to-disable-floats.patch @@ -0,0 +1,29 @@ +From ea39b87a8b258a0f19752f5e5607e14deec54c44 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 14:42:19 +0100 +Subject: [PATCH 324/506] configure.ac: Add ia64-specific way to disable + floats. + +--- + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 4d59fbe..94f96c4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -690,6 +690,11 @@ if test x"$platform" != xemu ; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_target_cc_soft_float="-march=armv8-a+nofp+nosimd"], []) + fi ++ if test "x$target_cpu" = xia64; then ++ CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ [grub_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], []) ++ fi + for cand in "-Xclang -msoft-float -Xclang -no-implicit-float" \ + "-Xclang -msoft-float" "-msoft-float"; do + if test x"$grub_cv_target_cc_soft_float" != xno ; then +-- +2.4.3 + diff --git a/0325-acpi-Fix-unused-function-warning.patch b/0325-acpi-Fix-unused-function-warning.patch new file mode 100644 index 0000000..cb29f83 --- /dev/null +++ b/0325-acpi-Fix-unused-function-warning.patch @@ -0,0 +1,33 @@ +From e1d4520bfb63aa669fc197f44623f6c9228f7757 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 14:42:43 +0100 +Subject: [PATCH 325/506] acpi: Fix unused function warning. + +--- + grub-core/commands/acpi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c +index 5507ffa..05a6dca 100644 +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -131,6 +131,8 @@ grub_acpi_get_rsdpv1 (void) + return grub_machine_acpi_get_rsdpv1 (); + } + ++#if defined (__i386__) || defined (__x86_64__) ++ + static inline int + iszero (grub_uint8_t *reg, int size) + { +@@ -141,7 +143,6 @@ iszero (grub_uint8_t *reg, int size) + return 1; + } + +-#if defined (__i386__) || defined (__x86_64__) + /* Context for grub_acpi_create_ebda. */ + struct grub_acpi_create_ebda_ctx { + int ebda_len; +-- +2.4.3 + diff --git a/0326-Supply-signed-division-to-fix-ARM-compilation.patch b/0326-Supply-signed-division-to-fix-ARM-compilation.patch new file mode 100644 index 0000000..66b1390 --- /dev/null +++ b/0326-Supply-signed-division-to-fix-ARM-compilation.patch @@ -0,0 +1,425 @@ +From f034fab6206173d411407fab6eb9a44c90e02dca Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 17:24:28 +0100 +Subject: [PATCH 326/506] Supply signed division to fix ARM compilation. + +Previously we supplied only unsigned divisions on platforms that need software +division. +Yet compiler may itself use a signed division. A typical example would be a +difference between 2 pointers which involves division by object size. +--- + gentpl.py | 6 ++++ + grub-core/Makefile.core.def | 8 +++++ + grub-core/kern/arm/misc.S | 13 +++----- + grub-core/kern/misc.c | 71 ++++++++++++++++++++++++++++------------- + grub-core/tests/div_test.c | 73 +++++++++++++++++++++++++++++++++++++++--- + include/grub/misc.h | 78 +++++++++++++++++++++++++++++++++++---------- + 6 files changed, 198 insertions(+), 51 deletions(-) + +diff --git a/gentpl.py b/gentpl.py +index c986cec..d2aa035 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -76,6 +76,12 @@ for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i) + # Flattened Device Trees (FDT) + GROUPS["fdt"] = [ "arm64_efi", "arm_uboot", "arm_efi" ] + ++# Needs software helpers for division ++# Must match GRUB_DIVISION_IN_SOFTWARE in misc.h ++GROUPS["softdiv"] = GROUPS["arm"] + ["ia64_efi"] ++GROUPS["no_softdiv"] = GRUB_PLATFORMS[:] ++for i in GROUPS["softdiv"]: GROUPS["no_softdiv"].remove(i) ++ + # Miscelaneous groups schedulded to disappear in future + GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"] + GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc") +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 42443bc..b539ccf 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -159,6 +159,8 @@ kernel = { + terminfoinkernel = commands/extcmd.c; + terminfoinkernel = lib/arg.c; + ++ softdiv = lib/division.c; ++ + i386 = kern/i386/dl.c; + i386_xen = kern/i386/dl.c; + +@@ -1970,6 +1972,12 @@ module = { + }; + + module = { ++ name = div; ++ common = lib/division.c; ++ enable = no_softdiv; ++}; ++ ++module = { + name = div_test; + common = tests/div_test.c; + }; +diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/misc.S +index 16b6f8e..645b42f 100644 +--- a/grub-core/kern/arm/misc.S ++++ b/grub-core/kern/arm/misc.S +@@ -58,15 +58,11 @@ FUNCTION(__aeabi_lmul) + ldmfd sp!, {r4, fp} + bx lr + +- .macro division parent ++ .macro division32 parent + + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment +- add r3, sp, #8 @ Set r3 to address of 64-bit space +- str r3, [sp] @ Stack parameter, pointer to 64-bit space +- mov r2, r1 +- mov r1, #0 +- mov r3, #0 ++ add r2, sp, #8 @ Set r2 to address of 64-bit space + bl \parent + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register +@@ -75,8 +71,9 @@ FUNCTION(__aeabi_lmul) + .endm + + FUNCTION(__aeabi_uidivmod) +- division grub_divmod64 +- ++ division32 grub_divmod32 ++FUNCTION(__aeabi_idivmod) ++ division32 grub_divmod32s + + /* + * Null divide-by-zero handler +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 883d353..b0347e7 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -594,10 +594,10 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) + grub_uint64_t m = 0; + + /* ARM and IA64 don't have a fast 32-bit division. +- Using that code would just make us use libgcc routines, calling +- them twice (once for modulo and once for quotient. ++ Using that code would just make us use software division routines, calling ++ ourselves indirectly and hence getting infinite recursion. + */ +-#if !defined (__arm__) && !defined (__ia64__) ++#if !GRUB_DIVISION_IN_SOFTWARE + /* Skip the slow computation if 32-bit arithmetic is possible. */ + if (n < 0xffffffff && d < 0xffffffff) + { +@@ -633,7 +633,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) + + #if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) + +-#if defined (__arm__) ++#if GRUB_DIVISION_IN_SOFTWARE + + grub_uint32_t + __udivsi3 (grub_uint32_t a, grub_uint32_t b) +@@ -641,6 +641,12 @@ __udivsi3 (grub_uint32_t a, grub_uint32_t b) + return grub_divmod64 (a, b, 0); + } + ++grub_int32_t ++__divsi3 (grub_int32_t a, grub_int32_t b) ++{ ++ return grub_divmod64s (a, b, 0); ++} ++ + grub_uint32_t + __umodsi3 (grub_uint32_t a, grub_uint32_t b) + { +@@ -649,6 +655,42 @@ __umodsi3 (grub_uint32_t a, grub_uint32_t b) + return ret; + } + ++grub_int32_t ++__modsi3 (grub_int32_t a, grub_int32_t b) ++{ ++ grub_int64_t ret; ++ grub_divmod64s (a, b, &ret); ++ return ret; ++} ++ ++grub_uint64_t ++__udivdi3 (grub_uint64_t a, grub_uint64_t b) ++{ ++ return grub_divmod64 (a, b, 0); ++} ++ ++grub_uint64_t ++__umoddi3 (grub_uint64_t a, grub_uint64_t b) ++{ ++ grub_uint64_t ret; ++ grub_divmod64 (a, b, &ret); ++ return ret; ++} ++ ++grub_int64_t ++__divdi3 (grub_int64_t a, grub_int64_t b) ++{ ++ return grub_divmod64s (a, b, 0); ++} ++ ++grub_int64_t ++__moddi3 (grub_int64_t a, grub_int64_t b) ++{ ++ grub_int64_t ret; ++ grub_divmod64s (a, b, &ret); ++ return ret; ++} ++ + #endif + + #ifdef NEED_CTZDI2 +@@ -735,30 +777,15 @@ __ctzsi2 (grub_uint32_t x) + grub_uint32_t + __aeabi_uidiv (grub_uint32_t a, grub_uint32_t b) + __attribute__ ((alias ("__udivsi3"))); ++grub_int32_t ++__aeabi_idiv (grub_int32_t a, grub_int32_t b) ++ __attribute__ ((alias ("__divsi3"))); + void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n) + __attribute__ ((alias ("grub_memcpy"))); + void *__aeabi_memset (void *s, int c, grub_size_t n) + __attribute__ ((alias ("grub_memset"))); + #endif + +-#if defined (__ia64__) +- +-grub_uint64_t +-__udivdi3 (grub_uint64_t a, grub_uint64_t b) +-{ +- return grub_divmod64 (a, b, 0); +-} +- +-grub_uint64_t +-__umoddi3 (grub_uint64_t a, grub_uint64_t b) +-{ +- grub_uint64_t ret; +- grub_divmod64 (a, b, &ret); +- return ret; +-} +- +-#endif +- + #endif /* GRUB_UTIL */ + + /* Convert a long long value to a string. This function avoids 64-bit +diff --git a/grub-core/tests/div_test.c b/grub-core/tests/div_test.c +index 7bdc80b..9abc6d5 100644 +--- a/grub-core/tests/div_test.c ++++ b/grub-core/tests/div_test.c +@@ -97,6 +97,72 @@ test64 (grub_uint64_t a, grub_uint64_t b) + #endif + } + ++static grub_int64_t ++abs64(grub_int64_t a) ++{ ++ return a > 0 ? a : -a; ++} ++ ++static void ++test32s (grub_int32_t a, grub_int32_t b) ++{ ++ grub_int64_t q, r; ++ if (b == 0) ++ return; ++ ++ q = grub_divmod64s (a, b, &r); ++ grub_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", ++ (long long) a, (long long) b, (long long) r); ++ grub_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", ++ (long long) a, (long long) b, (long long) q); ++ grub_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", ++ (long long) a, (long long) b, (long long) r); ++ grub_test_assert (q * b + r == a, "division doesn't satisfy base property: %lld * %lld + %lld != %lld", (long long) q, (long long) b, (long long) r, ++ (long long) a); ++ if (0) { grub_test_assert (q == (a / b), ++ "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); ++ grub_test_assert (r == (a % b), ++ "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); ++ } ++} ++ ++static void ++test64s (grub_int64_t a, grub_int64_t b) ++{ ++ grub_int64_t q, r; ++ q = grub_divmod64s (a, b, &r); ++ ++ grub_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", ++ (long long) a, (long long) b, (long long) r); ++ grub_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", ++ (long long) a, (long long) b, (long long) q); ++ grub_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", ++ (long long) a, (long long) b, (long long) r); ++ grub_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, ++ (long long) a); ++#if GRUB_TARGET_SIZEOF_VOID_P == 8 ++ grub_test_assert (q == (a / b), ++ "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); ++ grub_test_assert (r == (a % b), ++ "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); ++#endif ++} ++ ++static void ++test_all(grub_uint64_t a, grub_uint64_t b) ++{ ++ test64 (a, b); ++ test32 (a, b); ++ test64s (a, b); ++ test32s (a, b); ++ test64s (a, -b); ++ test32s (a, -b); ++ test64s (-a, b); ++ test32s (-a, b); ++ test64s (-a, -b); ++ test32s (-a, -b); ++} ++ + static void + div_test (void) + { +@@ -105,8 +171,7 @@ div_test (void) + + for (i = 0; i < ARRAY_SIZE (vectors); i++) + { +- test64 (vectors[i][0], vectors[i][1]); +- test32 (vectors[i][0], vectors[i][1]); ++ test_all (vectors[i][0], vectors[i][1]); + } + for (i = 0; i < 40000; i++) + { +@@ -116,9 +181,7 @@ div_test (void) + b = 1; + if (a == 0) + a = 1; +- test64 (a, b); +- test32 (a, b); +- ++ test_all (a, b); + } + } + +diff --git a/include/grub/misc.h b/include/grub/misc.h +index e35934c..a05b3fd 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -358,6 +358,64 @@ grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, + grub_uint64_t d, + grub_uint64_t *r); + ++/* Must match softdiv group in gentpl.py. */ ++#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__ia64__)) ++#define GRUB_DIVISION_IN_SOFTWARE 1 ++#else ++#define GRUB_DIVISION_IN_SOFTWARE 0 ++#endif ++ ++/* Some division functions need to be in kernel if compiler generates calls ++ to them. Otherwise we still need them for consistent tests but they go ++ into a separate module. */ ++#if GRUB_DIVISION_IN_SOFTWARE ++#define EXPORT_FUNC_IF_SOFTDIV EXPORT_FUNC ++#else ++#define EXPORT_FUNC_IF_SOFTDIV(x) x ++#endif ++ ++grub_int64_t ++EXPORT_FUNC_IF_SOFTDIV(grub_divmod64s) (grub_int64_t n, ++ grub_int64_t d, ++ grub_int64_t *r); ++grub_uint32_t ++EXPORT_FUNC_IF_SOFTDIV (grub_divmod32) (grub_uint32_t n, ++ grub_uint32_t d, ++ grub_uint32_t *r); ++ ++grub_int32_t ++EXPORT_FUNC_IF_SOFTDIV (grub_divmod32s) (grub_int32_t n, ++ grub_int32_t d, ++ grub_int32_t *r); ++ ++#if defined(GRUB_DIVISION_IN_SOFTWARE) && GRUB_DIVISION_IN_SOFTWARE ++ ++grub_uint32_t ++EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); ++ ++grub_uint32_t ++EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); ++ ++grub_int32_t ++EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); ++ ++grub_int32_t ++EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); ++ ++grub_int64_t ++EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); ++ ++grub_int64_t ++EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); ++ ++grub_uint64_t ++EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); ++ ++grub_uint64_t ++EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); ++ ++#endif ++ + #if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL) + void EXPORT_FUNC (__register_frame_info) (void); + void EXPORT_FUNC (__deregister_frame_info) (void); +@@ -437,12 +495,6 @@ grub_error_load (const struct grub_error_saved *save) + + #if defined (__arm__) + +-grub_uint32_t +-EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); +- +-grub_uint32_t +-EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); +- + #endif + + #if defined (__sparc__) || defined (__powerpc__) +@@ -460,8 +512,12 @@ EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); + #ifdef __arm__ + grub_uint32_t + EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); ++grub_int32_t ++EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); + grub_uint32_t + EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); ++grub_int32_t ++EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); + + /* Needed for allowing modules to be compiled as thumb. */ + grub_uint64_t +@@ -476,16 +532,6 @@ EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); + + #endif + +-#if defined (__ia64__) +- +-grub_uint64_t +-EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); +- +-grub_uint64_t +-EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); +- +-#endif +- + #endif /* GRUB_UTIL */ + + +-- +2.4.3 + diff --git a/0327-arm64-Fix-compilation-failure.patch b/0327-arm64-Fix-compilation-failure.patch new file mode 100644 index 0000000..be446fc --- /dev/null +++ b/0327-arm64-Fix-compilation-failure.patch @@ -0,0 +1,37 @@ +From 345076a78a15a61e1545eec60e7661e13b2dc62f Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 17:41:12 +0100 +Subject: [PATCH 327/506] arm64: Fix compilation failure. + +Don't supply +nosimd to asm files. +Otherwise +nosimd coming from flags forbids some of instructions +used in cache_flush. +--- + configure.ac | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 94f96c4..35f430a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -719,7 +719,16 @@ if test x"$platform" != xemu ; then + TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float" + ;; + esac +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" ++ case x"$grub_cv_target_cc_soft_float" in ++ x"-march=armv8-a+nofp+nosimd") ++ # +nosimd disables also the cache opcodes that we need in asm. ++ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -march=armv8-a+nofp" ++ ;; ++ *) ++ TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" ++ ;; ++ esac ++ + fi + + if test x"$target_cpu" = xsparc64 ; then +-- +2.4.3 + diff --git a/0328-Allow-clang-compilation-for-thumb-with-mthumb-interw.patch b/0328-Allow-clang-compilation-for-thumb-with-mthumb-interw.patch new file mode 100644 index 0000000..f9c79a1 --- /dev/null +++ b/0328-Allow-clang-compilation-for-thumb-with-mthumb-interw.patch @@ -0,0 +1,41 @@ +From 2066c35b3ff6e35edf2a4e903f9aa79a23b6aefe Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 17:45:30 +0100 +Subject: [PATCH 328/506] Allow clang compilation for thumb with + -mthumb-interwork. + +clang already uses -mthumb-interwork behaviour even thout it doesn't +support the option. +--- + configure.ac | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 35f430a..8f9ab81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1029,20 +1029,9 @@ if test "x$target_cpu" = xarm; then + ]) + if test "x$grub_cv_cc_mthumb_interwork" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mthumb-interwork" ++ # Clang defaults to thumb interworking + elif test "x$grub_cv_cc_target_clang" = xno ; then + AC_MSG_ERROR([your compiler doesn't support -mthumb-interwork]) +- else +- CFLAGS="$TARGET_CFLAGS" +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ +-#if defined (__thumb__) && !defined (__thumb2__) +-#error thumb without interworking +-#endif +-]])], +- [no_interwork_ok=yes], +- [no_interwork_ok=no]) +- if test x$no_interwork_ok = xno ; then +- AC_MSG_ERROR([attempt to compile to thumb with no thumb interwork]) +- fi + fi + fi + +-- +2.4.3 + diff --git a/0329-Add-missing-grub_-prefix-in-memcpy-invocation.patch b/0329-Add-missing-grub_-prefix-in-memcpy-invocation.patch new file mode 100644 index 0000000..573b8b1 --- /dev/null +++ b/0329-Add-missing-grub_-prefix-in-memcpy-invocation.patch @@ -0,0 +1,39 @@ +From 7ea452a142d55e80b2a33d59958eef41559fb8eb Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sun, 22 Feb 2015 19:34:46 +0100 +Subject: [PATCH 329/506] Add missing grub_ prefix in memcpy invocation + +--- + grub-core/kern/dl.c | 2 +- + grub-core/loader/sparc64/ieee1275/linux.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c +index 6850e04..3a438e9 100644 +--- a/grub-core/kern/dl.c ++++ b/grub-core/kern/dl.c +@@ -340,7 +340,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) + mod->symtab = grub_malloc (s->sh_size); + if (!mod->symtab) + return grub_errno; +- memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size); ++ grub_memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size); + #else + mod->symtab = (Elf_Sym *) ((char *) e + s->sh_offset); + #endif +diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c +index 6389170..63d6a1f 100644 +--- a/grub-core/loader/sparc64/ieee1275/linux.c ++++ b/grub-core/loader/sparc64/ieee1275/linux.c +@@ -110,7 +110,7 @@ grub_linux_boot (void) + int len = grub_strlen (linux_args) + 1; + if (bp->len < len) + len = bp->len; +- memcpy(bp->buf, linux_args, len); ++ grub_memcpy(bp->buf, linux_args, len); + bp->buf[len-1] = '\0'; + bp->valid = 1; + } +-- +2.4.3 + diff --git a/0330-mips-Fix-soft-float-handling.patch b/0330-mips-Fix-soft-float-handling.patch new file mode 100644 index 0000000..3b6e16a --- /dev/null +++ b/0330-mips-Fix-soft-float-handling.patch @@ -0,0 +1,137 @@ +From 6a4ecd276ed39f66be0ad6ff0f8ff67598098605 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 23 Feb 2015 22:33:28 +0100 +Subject: [PATCH 330/506] mips: Fix soft-float handling. + +Add -msoft-float alongside clang arguments to specify ABI. +Specify ABI in asm files explicitly. +This trigers asm warning due to gcc failing to propagate -msoft-float +but it's tolerable. +--- + configure.ac | 5 +++-- + grub-core/boot/mips/startup_raw.S | 2 ++ + grub-core/kern/mips/cache.S | 4 +++- + grub-core/kern/mips/startup.S | 2 ++ + grub-core/lib/mips/relocator_asm.S | 2 ++ + include/grub/mips/kernel.h | 4 ++++ + 6 files changed, 16 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 8f9ab81..908bb81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -695,7 +695,8 @@ if test x"$platform" != xemu ; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], []) + fi +- for cand in "-Xclang -msoft-float -Xclang -no-implicit-float" \ ++ for cand in "-msoft-float -Xclang -msoft-float -Xclang -no-implicit-float" \ ++ "-Xclang -msoft-float -Xclang -no-implicit-float" \ + "-Xclang -msoft-float" "-msoft-float"; do + if test x"$grub_cv_target_cc_soft_float" != xno ; then + break +@@ -711,7 +712,7 @@ if test x"$platform" != xemu ; then + fi + + case x"$grub_cv_target_cc_soft_float" in +- x"-Xclang"*) ++ x*"-Xclang"*) + # A trick so that clang doesn't see it on link stаge + TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_soft_float" + ;; +diff --git a/grub-core/boot/mips/startup_raw.S b/grub-core/boot/mips/startup_raw.S +index ca3413b..fd95c31 100644 +--- a/grub-core/boot/mips/startup_raw.S ++++ b/grub-core/boot/mips/startup_raw.S +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + #define BASE_ADDR 8 +@@ -32,6 +33,7 @@ + .globl __start, _start, start + .set noreorder + .set nomacro ++ mips_attributes + __start: + _start: + start: +diff --git a/grub-core/kern/mips/cache.S b/grub-core/kern/mips/cache.S +index 78e40bc..e83960f 100644 +--- a/grub-core/kern/mips/cache.S ++++ b/grub-core/kern/mips/cache.S +@@ -1,8 +1,10 @@ + + #include ++#include + + .set noreorder + .set nomacro ++ mips_attributes + + FUNCTION (grub_arch_sync_caches) + #include "cache_flush.S" +@@ -65,4 +67,4 @@ FUNCTION (grub_arch_sync_dma_caches) + #endif + sync_op + +- jr $ra +\ No newline at end of file ++ jr $ra +diff --git a/grub-core/kern/mips/startup.S b/grub-core/kern/mips/startup.S +index 339ab33..337aca9 100644 +--- a/grub-core/kern/mips/startup.S ++++ b/grub-core/kern/mips/startup.S +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + #define BASE_ADDR 8 +@@ -28,6 +29,7 @@ + .globl __start, _start, start + .set noreorder + .set nomacro ++ mips_attributes + __start: + _start: + start: +diff --git a/grub-core/lib/mips/relocator_asm.S b/grub-core/lib/mips/relocator_asm.S +index 1d142a4..959893c 100644 +--- a/grub-core/lib/mips/relocator_asm.S ++++ b/grub-core/lib/mips/relocator_asm.S +@@ -17,11 +17,13 @@ + */ + + #include ++#include + + .p2align 4 /* force 16-byte alignment */ + + .set noreorder + .set nomacro ++ mips_attributes + + VARIABLE (grub_relocator_forward_start) + move $a0, $9 +diff --git a/include/grub/mips/kernel.h b/include/grub/mips/kernel.h +index 07b0884..d0e09dd 100644 +--- a/include/grub/mips/kernel.h ++++ b/include/grub/mips/kernel.h +@@ -21,4 +21,8 @@ + + #include + ++#ifdef ASM_FILE ++#define mips_attributes .gnu_attribute 4, 3 ++#endif ++ + #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +-- +2.4.3 + diff --git a/0331-minilzo-Skip-parts-tha-we-don-t-need.patch b/0331-minilzo-Skip-parts-tha-we-don-t-need.patch new file mode 100644 index 0000000..6c125ed --- /dev/null +++ b/0331-minilzo-Skip-parts-tha-we-don-t-need.patch @@ -0,0 +1,31 @@ +From c5a4e79335cebc026684de623bdd327312139330 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 18:11:53 +0100 +Subject: [PATCH 331/506] minilzo: Skip parts tha we don't need. + +--- + config.h.in | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/config.h.in b/config.h.in +index d93b687..ea0f383 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -12,6 +12,14 @@ + #define DISK_CACHE_STATS @DISK_CACHE_STATS@ + #define BOOT_TIME_STATS @BOOT_TIME_STATS@ + ++/* We don't need those. */ ++#define MINILZO_CFG_SKIP_LZO_PTR 1 ++#define MINILZO_CFG_SKIP_LZO_UTIL 1 ++#define MINILZO_CFG_SKIP_LZO_STRING 1 ++#define MINILZO_CFG_SKIP_LZO_INIT 1 ++#define MINILZO_CFG_SKIP_LZO1X_1_COMPRESS 1 ++#define MINILZO_CFG_SKIP_LZO1X_DECOMPRESS 1 ++ + #if defined (GRUB_BUILD) + #undef ENABLE_NLS + #define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ +-- +2.4.3 + diff --git a/0332-bitmap_scale-Optimize-by-moving-division-out-of-the-.patch b/0332-bitmap_scale-Optimize-by-moving-division-out-of-the-.patch new file mode 100644 index 0000000..62f450f --- /dev/null +++ b/0332-bitmap_scale-Optimize-by-moving-division-out-of-the-.patch @@ -0,0 +1,178 @@ +From dd4889f727c535948fd6ab67154a52b10bc544c9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 18:13:36 +0100 +Subject: [PATCH 332/506] bitmap_scale: Optimize by moving division out of the + loop. + +--- + grub-core/video/bitmap_scale.c | 114 +++++++++++++++++++++++++---------------- + 1 file changed, 69 insertions(+), 45 deletions(-) + +diff --git a/grub-core/video/bitmap_scale.c b/grub-core/video/bitmap_scale.c +index 0b93d02..70c32f0 100644 +--- a/grub-core/video/bitmap_scale.c ++++ b/grub-core/video/bitmap_scale.c +@@ -361,35 +361,46 @@ scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) + unsigned dh = dst->mode_info.height; + unsigned sw = src->mode_info.width; + unsigned sh = src->mode_info.height; +- unsigned dstride = dst->mode_info.pitch; +- unsigned sstride = src->mode_info.pitch; ++ int dstride = dst->mode_info.pitch; ++ int sstride = src->mode_info.pitch; + /* bytes_per_pixel is the same for both src and dst. */ +- unsigned bytes_per_pixel = dst->mode_info.bytes_per_pixel; ++ int bytes_per_pixel = dst->mode_info.bytes_per_pixel; ++ unsigned dy, sy, ystep, yfrac, yover; ++ unsigned sx, xstep, xfrac, xover; ++ grub_uint8_t *dptr, *dline_end, *sline; + +- unsigned dy; +- for (dy = 0; dy < dh; dy++) ++ xstep = sw / dw; ++ xover = sw % dw; ++ ystep = sh / dh; ++ yover = sh % dh; ++ ++ for (dy = 0, sy = 0, yfrac = 0; dy < dh; dy++, sy += ystep, yfrac += yover) + { +- unsigned dx; +- for (dx = 0; dx < dw; dx++) ++ if (yfrac >= dh) ++ { ++ yfrac -= dh; ++ sy++; ++ } ++ dptr = ddata + dy * dstride; ++ dline_end = dptr + dw * bytes_per_pixel; ++ sline = sdata + sy * sstride; ++ for (sx = 0, xfrac = 0; dptr < dline_end; sx += xstep, xfrac += xover, dptr += bytes_per_pixel) + { +- grub_uint8_t *dptr; + grub_uint8_t *sptr; +- unsigned sx; +- unsigned sy; +- unsigned comp; ++ int comp; + +- /* Compute the source coordinate that the destination coordinate +- maps to. Note: sx/sw = dx/dw => sx = sw*dx/dw. */ +- sx = sw * dx / dw; +- sy = sh * dy / dh; ++ if (xfrac >= dw) ++ { ++ xfrac -= dw; ++ sx++; ++ } + + /* Get the address of the pixels in src and dst. */ +- dptr = ddata + dy * dstride + dx * bytes_per_pixel; +- sptr = sdata + sy * sstride + sx * bytes_per_pixel; ++ sptr = sline + sx * bytes_per_pixel; + +- /* Copy the pixel color value. */ +- for (comp = 0; comp < bytes_per_pixel; comp++) +- dptr[comp] = sptr[comp]; ++ /* Copy the pixel color value. */ ++ for (comp = 0; comp < bytes_per_pixel; comp++) ++ dptr[comp] = sptr[comp]; + } + } + return GRUB_ERR_NONE; +@@ -422,27 +433,40 @@ scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) + int sstride = src->mode_info.pitch; + /* bytes_per_pixel is the same for both src and dst. */ + int bytes_per_pixel = dst->mode_info.bytes_per_pixel; ++ unsigned dy, syf, sy, ystep, yfrac, yover; ++ unsigned sxf, sx, xstep, xfrac, xover; ++ grub_uint8_t *dptr, *dline_end, *sline; ++ ++ xstep = (sw << 8) / dw; ++ xover = (sw << 8) % dw; ++ ystep = (sh << 8) / dh; ++ yover = (sh << 8) % dh; + +- unsigned dy; +- for (dy = 0; dy < dh; dy++) ++ for (dy = 0, syf = 0, yfrac = 0; dy < dh; dy++, syf += ystep, yfrac += yover) + { +- unsigned dx; +- for (dx = 0; dx < dw; dx++) ++ if (yfrac >= dh) ++ { ++ yfrac -= dh; ++ syf++; ++ } ++ sy = syf >> 8; ++ dptr = ddata + dy * dstride; ++ dline_end = dptr + dw * bytes_per_pixel; ++ sline = sdata + sy * sstride; ++ for (sxf = 0, xfrac = 0; dptr < dline_end; sxf += xstep, xfrac += xover, dptr += bytes_per_pixel) + { +- grub_uint8_t *dptr; + grub_uint8_t *sptr; +- unsigned sx; +- unsigned sy; + int comp; + +- /* Compute the source coordinate that the destination coordinate +- maps to. Note: sx/sw = dx/dw => sx = sw*dx/dw. */ +- sx = sw * dx / dw; +- sy = sh * dy / dh; ++ if (xfrac >= dw) ++ { ++ xfrac -= dw; ++ sxf++; ++ } + + /* Get the address of the pixels in src and dst. */ +- dptr = ddata + dy * dstride + dx * bytes_per_pixel; +- sptr = sdata + sy * sstride + sx * bytes_per_pixel; ++ sx = sxf >> 8; ++ sptr = sline + sx * bytes_per_pixel; + + /* If we have enough space to do so, use bilinear interpolation. + Otherwise, fall back to nearest neighbor for this pixel. */ +@@ -453,27 +477,27 @@ scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) + /* Fixed-point .8 numbers representing the fraction of the + distance in the x (u) and y (v) direction within the + box of 4 pixels in the source. */ +- int u = (256 * sw * dx / dw) - (sx * 256); +- int v = (256 * sh * dy / dh) - (sy * 256); ++ unsigned u = sxf & 0xff; ++ unsigned v = syf & 0xff; + + for (comp = 0; comp < bytes_per_pixel; comp++) + { + /* Get the component's values for the + four source corner pixels. */ +- int f00 = sptr[comp]; +- int f10 = sptr[comp + bytes_per_pixel]; +- int f01 = sptr[comp + sstride]; +- int f11 = sptr[comp + sstride + bytes_per_pixel]; ++ unsigned f00 = sptr[comp]; ++ unsigned f10 = sptr[comp + bytes_per_pixel]; ++ unsigned f01 = sptr[comp + sstride]; ++ unsigned f11 = sptr[comp + sstride + bytes_per_pixel]; + + /* Count coeffecients. */ +- int c00 = (256 - u) * (256 - v); +- int c10 = u * (256 - v); +- int c01 = (256 - u) * v; +- int c11 = u * v; ++ unsigned c00 = (256 - u) * (256 - v); ++ unsigned c10 = u * (256 - v); ++ unsigned c01 = (256 - u) * v; ++ unsigned c11 = u * v; + + /* Interpolate. */ +- int fxy = c00 * f00 + c01 * f01 + c10 * f10 + c11 * f11; +- fxy = fxy / (256 * 256); ++ unsigned fxy = c00 * f00 + c01 * f01 + c10 * f10 + c11 * f11; ++ fxy = fxy >> 16; + + dptr[comp] = fxy; + } +-- +2.4.3 + diff --git a/0333-fbblit-Optimize-by-replacing-division-with-additions.patch b/0333-fbblit-Optimize-by-replacing-division-with-additions.patch new file mode 100644 index 0000000..7f5fdef --- /dev/null +++ b/0333-fbblit-Optimize-by-replacing-division-with-additions.patch @@ -0,0 +1,160 @@ +From f51218bc15ff7b82894a2096ec1cdb7c8f0084f4 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 18:14:28 +0100 +Subject: [PATCH 333/506] fbblit: Optimize by replacing division with additions + and shifts. + +--- + grub-core/video/fb/fbblit.c | 71 ++++++++++++++++++++++++++------------------- + 1 file changed, 41 insertions(+), 30 deletions(-) + +diff --git a/grub-core/video/fb/fbblit.c b/grub-core/video/fb/fbblit.c +index 3a073ce..d559248 100644 +--- a/grub-core/video/fb/fbblit.c ++++ b/grub-core/video/fb/fbblit.c +@@ -1145,6 +1145,20 @@ grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, + } + } + ++static inline grub_uint8_t ++alpha_dilute (grub_uint8_t bg, grub_uint8_t fg, grub_uint8_t alpha) ++{ ++ grub_uint16_t s; ++ grub_uint16_t h, l; ++ s = (fg * alpha) + (bg * (255 ^ alpha)); ++ /* Optimised division by 255. */ ++ h = s >> 8; ++ l = s & 0xff; ++ if (h + l >= 255) ++ h++; ++ return h; ++} ++ + /* Generic blending blitter. Works for every supported format. */ + static void + grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, +@@ -1190,12 +1204,9 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, + grub_video_fb_unmap_color_int (dst, dst_color, &dst_red, + &dst_green, &dst_blue, &dst_alpha); + +- dst_red = (((src_red * src_alpha) +- + (dst_red * (255 ^ src_alpha))) / 255U); +- dst_green = (((src_green * src_alpha) +- + (dst_green * (255 ^ src_alpha))) / 255U); +- dst_blue = (((src_blue * src_alpha) +- + (dst_blue * (255 ^ src_alpha))) / 255U); ++ dst_red = alpha_dilute (dst_red, src_red, src_alpha); ++ dst_green = alpha_dilute (dst_green, src_green, src_alpha); ++ dst_blue = alpha_dilute (dst_blue, src_blue, src_alpha); + + dst_alpha = src_alpha; + dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue, +@@ -1270,11 +1281,11 @@ grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + color = *dstptr; + + dr = (color >> 16) & 0xFF; +- dr = (dr * (255 ^ a) + sr * a) / 255U; ++ dr = alpha_dilute (dr, sr, a); + dg = (color >> 8) & 0xFF; +- dg = (dg * (255 ^ a) + sg * a) / 255U; ++ dg = alpha_dilute (dg, sg, a); + db = (color >> 0) & 0xFF; +- db = (db * (255 ^ a) + sb * a) / 255U; ++ db = alpha_dilute (db, sb, a); + } + + color = (a << 24) | (dr << 16) | (dg << 8) | db; +@@ -1360,9 +1371,9 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, + db = dstptr[2]; + #endif + +- db = (db * (255 ^ a) + sb * a) / 255U; +- dg = (dg * (255 ^ a) + sg * a) / 255U; +- dr = (dr * (255 ^ a) + sr * a) / 255U; ++ db = alpha_dilute (db, sb, a); ++ dg = alpha_dilute (dg, sg, a); ++ dr = alpha_dilute (dr, sr, a); + } + + #ifndef GRUB_CPU_WORDS_BIGENDIAN +@@ -1440,9 +1451,9 @@ grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + dg = (color >> 8) & 0xFF; + db = (color >> 16) & 0xFF; + +- dr = (dr * (255 ^ a) + sr * a) / 255U; +- dg = (dg * (255 ^ a) + sg * a) / 255U; +- db = (db * (255 ^ a) + sb * a) / 255U; ++ dr = alpha_dilute (dr, sr, a); ++ dg = alpha_dilute (dg, sg, a); ++ db = alpha_dilute (db, sb, a); + + color = (a << 24) | (db << 16) | (dg << 8) | dr; + +@@ -1525,9 +1536,9 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, + dr = dstptr[2]; + #endif + +- dr = (dr * (255 ^ a) + sr * a) / 255U; +- dg = (dg * (255 ^ a) + sg * a) / 255U; +- db = (db * (255 ^ a) + sb * a) / 255U; ++ dr = alpha_dilute (dr, sr, a); ++ dg = alpha_dilute (dg, sg, a); ++ db = alpha_dilute (db, sb, a); + + #ifndef GRUB_CPU_WORDS_BIGENDIAN + *dstptr++ = dr; +@@ -1601,9 +1612,9 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, + + grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); + +- dr = (dr * (255 ^ a) + sr * a) / 255U; +- dg = (dg * (255 ^ a) + sg * a) / 255U; +- db = (db * (255 ^ a) + sb * a) / 255U; ++ dr = alpha_dilute (dr, sr, a); ++ dg = alpha_dilute (dg, sg, a); ++ db = alpha_dilute (db, sb, a); + + color = grub_video_fb_map_rgb(dr, dg, db); + +@@ -1683,9 +1694,9 @@ grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, + grub_uint8_t d2 = (*dstptr >> 8) & 0xFF; + grub_uint8_t d3 = (*dstptr >> 16) & 0xFF; + +- d1 = (d1 * (255 ^ a) + s1 * a) / 255U; +- d2 = (d2 * (255 ^ a) + s2 * a) / 255U; +- d3 = (d3 * (255 ^ a) + s3 * a) / 255U; ++ d1 = alpha_dilute (d1, s1, a); ++ d2 = alpha_dilute (d2, s2, a); ++ d3 = alpha_dilute (d3, s3, a); + + *dstptr = (a << 24) | (d3 << 16) | (d2 << 8) | d1; + } +@@ -1791,9 +1802,9 @@ grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, + grub_uint8_t d2 = (*(grub_uint32_t *) dstptr >> 8) & 0xFF; + grub_uint8_t d3 = (*(grub_uint32_t *) dstptr >> 16) & 0xFF; + +- ((grub_uint8_t *) dstptr)[0] = (d1 * (255 ^ a) + s1 * a) / 255U; +- ((grub_uint8_t *) dstptr)[1] = (d2 * (255 ^ a) + s2 * a) / 255U; +- ((grub_uint8_t *) dstptr)[2] = (d3 * (255 ^ a) + s3 * a) / 255U; ++ ((grub_uint8_t *) dstptr)[0] = alpha_dilute (d1, s1, a); ++ ((grub_uint8_t *) dstptr)[1] = alpha_dilute (d2, s2, a); ++ ((grub_uint8_t *) dstptr)[2] = alpha_dilute (d3, s3, a); + } + + srcmask >>= 1; +@@ -1887,9 +1898,9 @@ grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, + grub_uint8_t d2 = (*dstptr >> 5) & 0x3F; + grub_uint8_t d3 = (*dstptr >> 11) & 0x1F; + +- d1 = (d1 * (255 ^ a) + s1 * a) / 255U; +- d2 = (d2 * (255 ^ a) + s2 * a) / 255U; +- d3 = (d3 * (255 ^ a) + s3 * a) / 255U; ++ d1 = alpha_dilute (d1, s1, a); ++ d2 = alpha_dilute (d2, s2, a); ++ d3 = alpha_dilute (d3, s3, a); + + *dstptr = (d1 & 0x1f) | ((d2 & 0x3f) << 5) | ((d3 & 0x1f) << 11); + } +-- +2.4.3 + diff --git a/0334-Add-missing-lib-division.c.patch b/0334-Add-missing-lib-division.c.patch new file mode 100644 index 0000000..7ef0048 --- /dev/null +++ b/0334-Add-missing-lib-division.c.patch @@ -0,0 +1,92 @@ +From 80310ad07dfbd682ade52f2db2e536e0e7ccc471 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 18:22:40 +0100 +Subject: [PATCH 334/506] Add missing lib/division.c + +--- + grub-core/lib/division.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + create mode 100644 grub-core/lib/division.c + +diff --git a/grub-core/lib/division.c b/grub-core/lib/division.c +new file mode 100644 +index 0000000..920a79f +--- /dev/null ++++ b/grub-core/lib/division.c +@@ -0,0 +1,73 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_uint64_t ++abs64(grub_int64_t a) ++{ ++ return a > 0 ? a : -a; ++} ++ ++grub_int64_t ++grub_divmod64s (grub_int64_t n, ++ grub_int64_t d, ++ grub_int64_t *ro) ++{ ++ grub_uint64_t ru; ++ grub_int64_t q, r; ++ q = grub_divmod64 (abs64(n), abs64(d), &ru); ++ r = ru; ++ /* Now: |n| = |d| * q + r */ ++ if (n < 0) ++ { ++ /* -|n| = |d| * (-q) + (-r) */ ++ q = -q; ++ r = -r; ++ } ++ /* Now: n = |d| * q + r */ ++ if (d < 0) ++ { ++ /* n = (-|d|) * (-q) + r */ ++ q = -q; ++ } ++ /* Now: n = d * q + r */ ++ *ro = r; ++ return q; ++} ++ ++grub_uint32_t ++grub_divmod32 (grub_uint32_t n, grub_uint32_t d, grub_uint32_t *ro) ++{ ++ grub_uint64_t q, r; ++ q = grub_divmod64 (n, d, &r); ++ *ro = r; ++ return q; ++} ++ ++grub_int32_t ++grub_divmod32s (grub_int32_t n, grub_int32_t d, grub_int32_t *ro) ++{ ++ grub_int64_t q, r; ++ q = grub_divmod64s (n, d, &r); ++ *ro = r; ++ return q; ++} +-- +2.4.3 + diff --git a/0335-png-Optimize-by-avoiding-divisions.patch b/0335-png-Optimize-by-avoiding-divisions.patch new file mode 100644 index 0000000..de79bec --- /dev/null +++ b/0335-png-Optimize-by-avoiding-divisions.patch @@ -0,0 +1,60 @@ +From 18125877eec4e6d7b0b6567b6c92eab1df946f47 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 18:27:43 +0100 +Subject: [PATCH 335/506] png: Optimize by avoiding divisions. + +--- + grub-core/video/readers/png.c | 29 ++++++++++++++++++++--------- + 1 file changed, 20 insertions(+), 9 deletions(-) + +diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c +index 1f03f88..e1a01e9 100644 +--- a/grub-core/video/readers/png.c ++++ b/grub-core/video/readers/png.c +@@ -227,7 +227,7 @@ grub_png_decode_image_palette (struct grub_png_data *data, + { + unsigned i = 0, j; + +- if (len == 0 || len % 3 != 0) ++ if (len == 0) + return GRUB_ERR_NONE; + + for (i = 0; 3 * i < len && i < 256; i++) +@@ -851,15 +851,26 @@ grub_png_convert_image (struct grub_png_data *data) + int mask = (1 << data->color_bits) - 1; + unsigned j; + if (data->is_gray) +- for (i = 0; i < (1U << data->color_bits); i++) +- { +- grub_uint8_t col = (0xff * i) / ((1U << data->color_bits) - 1); +- palette[i][0] = col; +- palette[i][1] = col; +- palette[i][2] = col; +- } ++ { ++ /* Generic formula is ++ (0xff * i) / ((1U << data->color_bits) - 1) ++ but for allowed bit depth of 1, 2 and for it's ++ equivalent to ++ (0xff / ((1U << data->color_bits) - 1)) * i ++ Precompute the multipliers to avoid division. ++ */ ++ ++ const grub_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 }; ++ for (i = 0; i < (1U << data->color_bits); i++) ++ { ++ grub_uint8_t col = multipliers[data->color_bits] * i; ++ palette[i][0] = col; ++ palette[i][1] = col; ++ palette[i][2] = col; ++ } ++ } + else +- grub_memcpy (palette, data->palette, 16 * 3); ++ grub_memcpy (palette, data->palette, 3 << data->color_bits); + d1c = d1; + d2c = d2; + for (j = 0; j < data->image_height; j++, d1c += data->image_width * 3, +-- +2.4.3 + diff --git a/0336-jpeg-Optimise-by-replacing-division-with-shifts.patch b/0336-jpeg-Optimise-by-replacing-division-with-shifts.patch new file mode 100644 index 0000000..6f3f754 --- /dev/null +++ b/0336-jpeg-Optimise-by-replacing-division-with-shifts.patch @@ -0,0 +1,78 @@ +From 7213c1e02807e760febec06a0f19b11173abc55a Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 21:27:32 +0100 +Subject: [PATCH 336/506] jpeg: Optimise by replacing division with shifts. + +--- + grub-core/video/readers/jpeg.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c +index 38ea239..c3e0df2 100644 +--- a/grub-core/video/readers/jpeg.c ++++ b/grub-core/video/readers/jpeg.c +@@ -94,7 +94,7 @@ struct grub_jpeg_data + jpeg_data_unit_t crdu; + jpeg_data_unit_t cbdu; + +- unsigned vs, hs; ++ unsigned log_vs, log_hs; + int dri; + unsigned r1; + +@@ -315,11 +315,14 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) + ss = grub_jpeg_get_byte (data); /* Sampling factor. */ + if (!id) + { +- data->vs = ss & 0xF; /* Vertical sampling. */ +- data->hs = ss >> 4; /* Horizontal sampling. */ +- if ((data->vs > 2) || (data->hs > 2) || (data->vs == 0) || (data->hs == 0)) ++ grub_uint8_t vs, hs; ++ vs = ss & 0xF; /* Vertical sampling. */ ++ hs = ss >> 4; /* Horizontal sampling. */ ++ if ((vs > 2) || (hs > 2) || (vs == 0) || (hs == 0)) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "jpeg: sampling method not supported"); ++ data->log_vs = (vs == 2); ++ data->log_hs = (hs == 2); + } + else if (ss != JPEG_SAMPLING_1x1) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, +@@ -616,10 +619,10 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) + unsigned c1, vb, hb, nr1, nc1; + int rst = data->dri; + +- vb = data->vs * 8; +- hb = data->hs * 8; +- nr1 = (data->image_height + vb - 1) / vb; +- nc1 = (data->image_width + hb - 1) / hb; ++ vb = 8 << data->log_vs; ++ hb = 8 << data->log_hs; ++ nr1 = (data->image_height + vb - 1) >> (3 + data->log_vs); ++ nc1 = (data->image_width + hb - 1) >> (3 + data->log_hs); + + for (; data->r1 < nr1 && (!data->dri || rst); + data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3) +@@ -629,8 +632,8 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) + unsigned r2, c2, nr2, nc2; + grub_uint8_t *ptr2; + +- for (r2 = 0; r2 < data->vs; r2++) +- for (c2 = 0; c2 < data->hs; c2++) ++ for (r2 = 0; r2 < (1U << data->log_vs); r2++) ++ for (c2 = 0; c2 < (1U << data->log_hs); c2++) + grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]); + + if (data->color_components >= 3) +@@ -652,7 +655,7 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) + unsigned i0; + int yy; + +- i0 = (r2 / data->vs) * 8 + (c2 / data->hs); ++ i0 = (r2 >> data->log_vs) * 8 + (c2 >> data->log_hs); + yy = data->ydu[(r2 / 8) * 2 + (c2 / 8)][(r2 % 8) * 8 + (c2 % 8)]; + + if (data->color_components >= 3) +-- +2.4.3 + diff --git a/0337-crypto-restrict-cipher-block-size-to-power-of-2.patch b/0337-crypto-restrict-cipher-block-size-to-power-of-2.patch new file mode 100644 index 0000000..858ea85 --- /dev/null +++ b/0337-crypto-restrict-cipher-block-size-to-power-of-2.patch @@ -0,0 +1,184 @@ +From 94f701a826b54e6652044bdba9a8b6a9aa2b479e Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:04:40 +0100 +Subject: [PATCH 337/506] crypto: restrict cipher block size to power of 2. + +All current ciphers have blocks which are power of 2 and it's +unlikely to change. Other block length would be tricky to handle anyway. +This restriction allows avoiding extra divisions. +--- + grub-core/disk/cryptodisk.c | 36 +++++++++++++++++++++--------------- + grub-core/lib/crypto.c | 42 +++++++++++++++++++++++++++--------------- + 2 files changed, 48 insertions(+), 30 deletions(-) + +diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c +index 376ab83..82a3dcb 100644 +--- a/grub-core/disk/cryptodisk.c ++++ b/grub-core/disk/cryptodisk.c +@@ -110,20 +110,23 @@ grub_crypto_pcbc_decrypt (grub_crypto_cipher_handle_t cipher, + { + grub_uint8_t *inptr, *outptr, *end; + grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; +- if (cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) +- return GPG_ERR_INV_ARG; ++ grub_size_t blocksize; + if (!cipher->cipher->decrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) ++ return GPG_ERR_INV_ARG; ++ if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + return GPG_ERR_INV_ARG; + end = (grub_uint8_t *) in + size; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + { +- grub_memcpy (ivt, inptr, cipher->cipher->blocksize); ++ grub_memcpy (ivt, inptr, blocksize); + cipher->cipher->decrypt (cipher->ctx, outptr, inptr); +- grub_crypto_xor (outptr, outptr, iv, cipher->cipher->blocksize); +- grub_crypto_xor (iv, ivt, outptr, cipher->cipher->blocksize); ++ grub_crypto_xor (outptr, outptr, iv, blocksize); ++ grub_crypto_xor (iv, ivt, outptr, blocksize); + } + return GPG_ERR_NO_ERROR; + } +@@ -135,20 +138,23 @@ grub_crypto_pcbc_encrypt (grub_crypto_cipher_handle_t cipher, + { + grub_uint8_t *inptr, *outptr, *end; + grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; +- if (cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) +- return GPG_ERR_INV_ARG; +- if (!cipher->cipher->decrypt) ++ grub_size_t blocksize; ++ if (!cipher->cipher->encrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) ++ return GPG_ERR_INV_ARG; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) + return GPG_ERR_INV_ARG; + end = (grub_uint8_t *) in + size; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + { +- grub_memcpy (ivt, inptr, cipher->cipher->blocksize); +- grub_crypto_xor (outptr, outptr, iv, cipher->cipher->blocksize); ++ grub_memcpy (ivt, inptr, blocksize); ++ grub_crypto_xor (outptr, outptr, iv, blocksize); + cipher->cipher->encrypt (cipher->ctx, outptr, inptr); +- grub_crypto_xor (iv, ivt, outptr, cipher->cipher->blocksize); ++ grub_crypto_xor (iv, ivt, outptr, blocksize); + } + return GPG_ERR_NO_ERROR; + } +diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c +index 8e8426c..010e550 100644 +--- a/grub-core/lib/crypto.c ++++ b/grub-core/lib/crypto.c +@@ -205,13 +205,16 @@ grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher, + { + const grub_uint8_t *inptr, *end; + grub_uint8_t *outptr; ++ grub_size_t blocksize; + if (!cipher->cipher->decrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) + return GPG_ERR_INV_ARG; + end = (const grub_uint8_t *) in + size; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + cipher->cipher->decrypt (cipher->ctx, outptr, inptr); + return GPG_ERR_NO_ERROR; + } +@@ -222,13 +225,16 @@ grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher, + { + const grub_uint8_t *inptr, *end; + grub_uint8_t *outptr; ++ grub_size_t blocksize; + if (!cipher->cipher->encrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) + return GPG_ERR_INV_ARG; + end = (const grub_uint8_t *) in + size; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + cipher->cipher->encrypt (cipher->ctx, outptr, inptr); + return GPG_ERR_NO_ERROR; + } +@@ -241,20 +247,23 @@ grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher, + grub_uint8_t *outptr; + const grub_uint8_t *inptr, *end; + void *iv; +- if (!cipher->cipher->decrypt) ++ grub_size_t blocksize; ++ if (!cipher->cipher->encrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) + return GPG_ERR_INV_ARG; + end = (const grub_uint8_t *) in + size; + iv = iv_in; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + { +- grub_crypto_xor (outptr, inptr, iv, cipher->cipher->blocksize); ++ grub_crypto_xor (outptr, inptr, iv, blocksize); + cipher->cipher->encrypt (cipher->ctx, outptr, outptr); + iv = outptr; + } +- grub_memcpy (iv_in, iv, cipher->cipher->blocksize); ++ grub_memcpy (iv_in, iv, blocksize); + return GPG_ERR_NO_ERROR; + } + +@@ -266,20 +275,23 @@ grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher, + const grub_uint8_t *inptr, *end; + grub_uint8_t *outptr; + grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; ++ grub_size_t blocksize; + if (!cipher->cipher->decrypt) + return GPG_ERR_NOT_SUPPORTED; +- if (size % cipher->cipher->blocksize != 0) ++ blocksize = cipher->cipher->blocksize; ++ if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) ++ || ((size & (blocksize - 1)) != 0)) + return GPG_ERR_INV_ARG; +- if (cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) ++ if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + return GPG_ERR_INV_ARG; + end = (const grub_uint8_t *) in + size; + for (inptr = in, outptr = out; inptr < end; +- inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) ++ inptr += blocksize, outptr += blocksize) + { +- grub_memcpy (ivt, inptr, cipher->cipher->blocksize); ++ grub_memcpy (ivt, inptr, blocksize); + cipher->cipher->decrypt (cipher->ctx, outptr, inptr); +- grub_crypto_xor (outptr, outptr, iv, cipher->cipher->blocksize); +- grub_memcpy (iv, ivt, cipher->cipher->blocksize); ++ grub_crypto_xor (outptr, outptr, iv, blocksize); ++ grub_memcpy (iv, ivt, blocksize); + } + return GPG_ERR_NO_ERROR; + } +-- +2.4.3 + diff --git a/0338-dmraid_nvidia-Fix-division-by-0-and-missing-byte-swa.patch b/0338-dmraid_nvidia-Fix-division-by-0-and-missing-byte-swa.patch new file mode 100644 index 0000000..c7ded2d --- /dev/null +++ b/0338-dmraid_nvidia-Fix-division-by-0-and-missing-byte-swa.patch @@ -0,0 +1,59 @@ +From f76c98b79eabccd1bdbd0d7c2763e09aa1e58e06 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:06:19 +0100 +Subject: [PATCH 338/506] dmraid_nvidia: Fix division by 0 and missing + byte-swap. + +--- + grub-core/disk/dmraid_nvidia.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/grub-core/disk/dmraid_nvidia.c b/grub-core/disk/dmraid_nvidia.c +index fc02f57..881508c 100644 +--- a/grub-core/disk/dmraid_nvidia.c ++++ b/grub-core/disk/dmraid_nvidia.c +@@ -99,6 +99,8 @@ grub_dmraid_nv_detect (grub_disk_t disk, + struct grub_nv_super sb; + int level; + grub_uint64_t disk_size; ++ grub_uint32_t capacity; ++ grub_uint8_t total_volumes; + char *uuid; + + if (disk->partition) +@@ -124,14 +126,17 @@ grub_dmraid_nv_detect (grub_disk_t disk, + return NULL; + } + ++ capacity = grub_le_to_cpu32 (sb.capacity); ++ total_volumes = sb.array.total_volumes; ++ + switch (sb.array.raid_level) + { + case NV_LEVEL_0: + level = 0; +- disk_size = sb.capacity / sb.array.total_volumes; +- if (sb.array.total_volumes == 0) ++ if (total_volumes == 0) + /* Not RAID. */ + return NULL; ++ disk_size = capacity / total_volumes; + break; + + case NV_LEVEL_1: +@@ -141,10 +146,10 @@ grub_dmraid_nv_detect (grub_disk_t disk, + + case NV_LEVEL_5: + level = 5; +- disk_size = sb.capacity / (sb.array.total_volumes - 1); +- if (sb.array.total_volumes == 0 || sb.array.total_volumes == 1) ++ if (total_volumes == 0 || total_volumes == 1) + /* Not RAID. */ + return NULL; ++ disk_size = capacity / (total_volumes - 1); + break; + + default: +-- +2.4.3 + diff --git a/0339-raid6-Optimize-by-removing-division.patch b/0339-raid6-Optimize-by-removing-division.patch new file mode 100644 index 0000000..98417a0 --- /dev/null +++ b/0339-raid6-Optimize-by-removing-division.patch @@ -0,0 +1,48 @@ +From 67a6a9512a52fee34a452752787dc80577fa7838 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:07:22 +0100 +Subject: [PATCH 339/506] raid6: Optimize by removing division. + +--- + grub-core/disk/raid6_recover.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/grub-core/disk/raid6_recover.c b/grub-core/disk/raid6_recover.c +index f9ec632..aa674f6 100644 +--- a/grub-core/disk/raid6_recover.c ++++ b/grub-core/disk/raid6_recover.c +@@ -63,6 +63,16 @@ grub_raid6_init_table (void) + } + } + ++static unsigned ++mod_255 (unsigned x) ++{ ++ while (x > 0xff) ++ x = (x >> 8) + (x & 0xff); ++ if (x == 0xff) ++ return 0; ++ return x; ++} ++ + static grub_err_t + grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, + char *buf, grub_disk_addr_t sector, grub_size_t size) +@@ -162,11 +172,11 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, + + grub_crypto_xor (qbuf, qbuf, buf, size); + +- c = ((255 ^ bad1) +- + (255 ^ powx_inv[(powx[bad2 + (bad1 ^ 255)] ^ 1)])) % 255; ++ c = mod_255((255 ^ bad1) ++ + (255 ^ powx_inv[(powx[bad2 + (bad1 ^ 255)] ^ 1)])); + grub_raid_block_mulx (c, qbuf, size); + +- c = ((unsigned) bad2 + c) % 255; ++ c = mod_255((unsigned) bad2 + c); + grub_raid_block_mulx (c, pbuf, size); + + grub_crypto_xor (pbuf, pbuf, qbuf, size); +-- +2.4.3 + diff --git a/0340-gzio-Optimize-by-removing-division.patch b/0340-gzio-Optimize-by-removing-division.patch new file mode 100644 index 0000000..73f8ef0 --- /dev/null +++ b/0340-gzio-Optimize-by-removing-division.patch @@ -0,0 +1,48 @@ +From 7ba066419a2e0f777a0c103b058fba49e1492f04 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:10:09 +0100 +Subject: [PATCH 340/506] gzio: Optimize by removing division. + +--- + grub-core/io/gzio.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c +index 129209e..0f2ea6b 100644 +--- a/grub-core/io/gzio.c ++++ b/grub-core/io/gzio.c +@@ -1161,6 +1161,19 @@ grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) + return file; + } + ++static grub_uint8_t ++mod_31 (grub_uint16_t v) ++{ ++ /* At most 2 iterations for any number that ++ we can get here. ++ In any case faster than real division. */ ++ while (v > 0x1f) ++ v = (v & 0x1f) + (v >> 5); ++ if (v == 0x1f) ++ return 0; ++ return v; ++} ++ + static int + test_zlib_header (grub_gzio_t gzio) + { +@@ -1178,7 +1191,10 @@ test_zlib_header (grub_gzio_t gzio) + return 0; + } + +- if ((cmf * 256U + flg) % 31U) ++ /* Usually it would be: (cmf * 256 + flg) % 31 != 0. */ ++ /* But 256 == 8 (31). */ ++ /* By multiplying by 4 and using 32 == 1 (31). We get our formula. */ ++ if (mod_31 (cmf + flg * 4) != 0) + { + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); + return 0; +-- +2.4.3 + diff --git a/0341-arm-dl-Fix-handling-of-nonstandard-relocation-sizes.patch b/0341-arm-dl-Fix-handling-of-nonstandard-relocation-sizes.patch new file mode 100644 index 0000000..27c99c8 --- /dev/null +++ b/0341-arm-dl-Fix-handling-of-nonstandard-relocation-sizes.patch @@ -0,0 +1,29 @@ +From 38b7a3026900670159f299f2daa7e35957752942 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:10:29 +0100 +Subject: [PATCH 341/506] arm/dl: Fix handling of nonstandard relocation sizes + +--- + grub-core/kern/arm/dl.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/kern/arm/dl.c b/grub-core/kern/arm/dl.c +index 5cbd65e..24364e1 100644 +--- a/grub-core/kern/arm/dl.c ++++ b/grub-core/kern/arm/dl.c +@@ -78,9 +78,9 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, + const Elf_Rel *rel, *max; + + for (rel = (const Elf_Rel *) ((grub_addr_t) e + s->sh_offset), +- max = rel + s->sh_size / s->sh_entsize; +- rel < max; +- rel++) ++ max = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_size); ++ rel + 1 <= max; ++ rel = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_entsize)) + switch (ELF_R_TYPE (rel->r_info)) + { + case R_ARM_CALL: +-- +2.4.3 + diff --git a/0342-emu-cache-Change-declaration-of-__clear_cache-to-mat.patch b/0342-emu-cache-Change-declaration-of-__clear_cache-to-mat.patch new file mode 100644 index 0000000..c55d396 --- /dev/null +++ b/0342-emu-cache-Change-declaration-of-__clear_cache-to-mat.patch @@ -0,0 +1,27 @@ +From 66b0e6649b8aa169db1b026abc4dd4167bb312e8 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 26 Feb 2015 22:20:59 +0100 +Subject: [PATCH 342/506] emu/cache: Change declaration of __clear_cache to + match builtin declaration. + +Fixes compile of arm64-emu. +--- + grub-core/kern/emu/cache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/emu/cache.c b/grub-core/kern/emu/cache.c +index 07be675..6f89e87 100644 +--- a/grub-core/kern/emu/cache.c ++++ b/grub-core/kern/emu/cache.c +@@ -8,7 +8,7 @@ + #include "../ia64/cache.c" + #elif defined (__arm__) || defined (__aarch64__) + +-void __clear_cache (char *beg, char *end); ++void __clear_cache (void *beg, void *end); + + void + grub_arch_sync_caches (void *address, grub_size_t len) +-- +2.4.3 + diff --git a/0343-ntfs_test-Skip-is-setfattr-is-unavailable.patch b/0343-ntfs_test-Skip-is-setfattr-is-unavailable.patch new file mode 100644 index 0000000..e80ca96 --- /dev/null +++ b/0343-ntfs_test-Skip-is-setfattr-is-unavailable.patch @@ -0,0 +1,29 @@ +From 050505ab8f695c10b3e4e768a4188688ebe5e366 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 28 Feb 2015 15:13:41 +0100 +Subject: [PATCH 343/506] ntfs_test: Skip is setfattr is unavailable. + +--- + tests/ntfs_test.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/ntfs_test.in b/tests/ntfs_test.in +index 6bf09e6..e25c638 100644 +--- a/tests/ntfs_test.in ++++ b/tests/ntfs_test.in +@@ -15,5 +15,10 @@ if ! which mkfs.ntfs >/dev/null 2>&1; then + exit 77 + fi + ++if ! which setfattr >/dev/null 2>&1; then ++ echo "setfattr not installed; cannot test ntfs." ++ exit 77 ++fi ++ + "@builddir@/grub-fs-tester" ntfs +-"@builddir@/grub-fs-tester" ntfscomp +\ No newline at end of file ++"@builddir@/grub-fs-tester" ntfscomp +-- +2.4.3 + diff --git a/0344-grub-shell-Add-missing-locale-directory.patch b/0344-grub-shell-Add-missing-locale-directory.patch new file mode 100644 index 0000000..fcc2312 --- /dev/null +++ b/0344-grub-shell-Add-missing-locale-directory.patch @@ -0,0 +1,25 @@ +From ddde9ca71ac7e0c42a445f5a37085c5895098e34 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 28 Feb 2015 15:14:16 +0100 +Subject: [PATCH 344/506] grub-shell: Add missing --locale-directory. + +Fixes the language tests is no make install was done. +--- + tests/util/grub-shell.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in +index 5b66139..6d2b132 100644 +--- a/tests/util/grub-shell.in ++++ b/tests/util/grub-shell.in +@@ -349,6 +349,7 @@ fi + if [ x$boot != xnet ] && [ x$boot != xemu ]; then + pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ + --rom-directory="${rom_directory}" \ ++ --locale-directory="@srcdir@/po" \ + --themes-directory="@srcdir@/themes" \ + $mkimage_extra_arg ${mkrescue_args} \ + "/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \ +-- +2.4.3 + diff --git a/0345-grub-probe-Mark-a-default-for-translation.patch b/0345-grub-probe-Mark-a-default-for-translation.patch new file mode 100644 index 0000000..4d324e6 --- /dev/null +++ b/0345-grub-probe-Mark-a-default-for-translation.patch @@ -0,0 +1,32 @@ +From afd6b6bbaedfd7724e6ccc0401c76021a429779b Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 28 Feb 2015 16:22:46 +0100 +Subject: [PATCH 345/506] grub-probe: Mark a "[default=]" for translation. + +--- + util/grub-probe.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 8a0c4f3..08d477f 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -728,10 +728,12 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) + + case 't': + { +- char *ret, *t = get_targets_string (); ++ char *ret, *t = get_targets_string (), *def; + +- ret = xasprintf ("%s\n%s %s [default=%s]", _("print TARGET"), +- _("available targets:"), t, targets[print]); ++ def = xasprintf (_("[default=%s]"), targets[print]); ++ ++ ret = xasprintf ("%s\n%s %s %s", _("print TARGET"), ++ _("available targets:"), t, def); + free (t); + return ret; + } +-- +2.4.3 + diff --git a/0346-exclude.pot-Add-new-technical-strings.patch b/0346-exclude.pot-Add-new-technical-strings.patch new file mode 100644 index 0000000..5f5256a --- /dev/null +++ b/0346-exclude.pot-Add-new-technical-strings.patch @@ -0,0 +1,356 @@ +From 0d6498a67d4542244c2ca183e05cfc3d858218be Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 28 Feb 2015 16:23:27 +0100 +Subject: [PATCH 346/506] exclude.pot: Add new technical strings + +--- + po/exclude.pot | 311 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 291 insertions(+), 20 deletions(-) + +diff --git a/po/exclude.pot b/po/exclude.pot +index 1659eb0..ab52e99 100644 +--- a/po/exclude.pot ++++ b/po/exclude.pot +@@ -2296,10 +2296,6 @@ msgstr "" + msgid "WEEKDAY" + msgstr "" + +-#: grub-core/io/lzopio.c:30 +-msgid "‰LZO" +-msgstr "" +- + #: grub-core/kern/dl.c:412 + msgid "grub_mod_init" + msgstr "" +@@ -4215,22 +4211,10 @@ msgstr "" + msgid "ext*" + msgstr "" + +-#: grub-core/partmap/msdos.c:74 +-msgid "ÔA õ" +-msgstr "" +- +-#: grub-core/partmap/msdos.c:80 +-msgid "ØA õ" +-msgstr "" +- + #: grub-core/partmap/msdos.c:86 + msgid "HP Backup and Recovery Manager (?)" + msgstr "" + +-#: grub-core/partmap/msdos.c:87 +-msgid "pŠ]F5Å“®=†ý±U>à" +-msgstr "" +- + #: grub-core/partmap/msdos.c:94 + msgid "ycgl" + msgstr "" +@@ -4574,10 +4558,6 @@ msgstr "" + msgid " failed: %ld\n" + msgstr "" + +-#: grub-core/lib/xzembed/xz_stream.h:35 +-msgid "ý7zXZ" +-msgstr "" +- + #: grub-core/lib/xzembed/xz_stream.h:38 + msgid "YZ" + msgstr "" +@@ -7173,3 +7153,294 @@ msgstr "" + #: util/grub-mkimagexx.c:845 + msgid "CALL26 Relocation out of range" + msgstr "" ++ ++#: grub-core/commands/verify.c:313 ++msgid "\x99" ++msgstr "" ++ ++#: grub-core/commands/videotest.c:122 ++msgid "Unicode test: happy\xE2\x98\xBA \xC2\xA3 5.00" ++ " \xC2\xA1\xCF\x84\xC3\xA4u! " ++ " \xE2\x84\xA4\xE2\x8A\x86\xE2\x84\x9D" ++msgstr "" ++ ++#: grub-core/disk/luks.c:40 ++msgid "LUKS\xBA\xBE" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:67 grub-core/disk/lvmparse.c:69 ++msgid " = [" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:115 grub-core/disk/lvmparse.c:123 ++#: grub-core/disk/lvmparse.c:167 grub-core/disk/lvmparse.c:170 ++msgid "id = \"" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:127 ++msgid "extent_size = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:143 grub-core/disk/lvmparse.c:146 ++msgid "physical_volumes {" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:174 ++msgid "pe_start = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:199 ++msgid "logical_volumes" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:202 ++msgid "logical_volumes = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:226 grub-core/disk/lvmparse.c:227 ++msgid "status" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:226 ++msgid "VISIBLE" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:227 ++msgid "PVMOVE" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:228 ++msgid "segment_count = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:246 ++msgid "segment" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:255 ++msgid "start_extent = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:263 ++msgid "extent_count = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:272 grub-core/disk/lvmparse.c:275 ++msgid "type = \"" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:277 grub-core/disk/lvmparse.c:278 ++msgid "striped\"" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:282 ++msgid "stripe_count = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:292 grub-core/disk/lvmparse.c:396 ++msgid "stripe_size = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:299 grub-core/disk/lvmparse.c:307 ++msgid "stripes = [" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:332 ++msgid "mirror\"" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:336 ++msgid "mirror_count = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:350 grub-core/disk/lvmparse.c:358 ++msgid "mirrors = [" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:375 grub-core/disk/lvmparse.c:376 ++#: grub-core/disk/lvmparse.c:377 grub-core/disk/lvmparse.c:384 ++msgid "raid" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:378 ++msgid "raidX" ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:386 ++msgid "device_count = " ++msgstr "" ++ ++#: grub-core/disk/lvmparse.c:410 grub-core/disk/lvmparse.c:418 ++msgid "raids = [" ++msgstr "" ++ ++#: grub-core/fs/cpio.c:24 ++msgid "\xc7\x71" ++msgstr "" ++ ++#: grub-core/fs/cpio_be.c:23 ++msgid "\x71\xc7" ++msgstr "" ++ ++#: grub-core/gfxmenu/gui_circular_progress.c:244 ++msgid "\xc2\xb0" ++msgstr "" ++ ++#: grub-core/kern/ieee1275/cmain.c:88 ++msgid "IBM pSeries (emulated by qemu)" ++msgstr "" ++ ++#: grub-core/lib/all_video.c:36 ++msgid "/video.lst" ++msgstr "" ++ ++#: grub-core/osdep/unix/config.c:108 ++#, c-format ++msgid "" ++"'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" " ++"\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"" ++msgstr "" ++ ++#: include/grub/dl.h:141 ++msgid "license" ++msgstr "" ++ ++#: util/grub-install.c:1106 ++msgid "BOOTAA64.EFI" ++msgstr "" ++ ++#: util/grub-install.c:1133 ++msgid "grubaa64.efi" ++msgstr "" ++ ++#: util/grub-install.c:1274 ++msgid "GRUB_ENABLE_CRYPTODISK=y" ++msgstr "" ++ ++#: util/grub-mkrescue.c:656 ++msgid "part_gpt" ++msgstr "" ++ ++#: util/grub-mkrescue.c:657 ++msgid "part_msdos" ++msgstr "" ++ ++#: util/grub-mkrescue.c:663 util/grub-mkrescue.c:668 util/grub-mkrescue.c:723 ++msgid "part_apple" ++msgstr "" ++ ++#: util/grub-mkrescue.c:677 ++msgid "bootaa64.efi" ++msgstr "" ++ ++#: util/grub-probe.c:136 util/grub-probe.c:151 util/grub-probe.c:190 ++#: util/grub-probe.c:247 ++#, c-format ++msgid "%s%c" ++msgstr "" ++ ++#: util/grub-probe.c:233 ++#, c-format ++msgid "lvm%c" ++msgstr "" ++ ++#: util/grub-probe.c:237 ++#, c-format ++msgid "ldm%c" ++msgstr "" ++ ++#: util/grub-probe.c:245 ++#, c-format ++msgid "diskfilter%c" ++msgstr "" ++ ++#: util/grub-probe.c:250 ++#, c-format ++msgid "raid5rec%c" ++msgstr "" ++ ++#: util/grub-probe.c:252 ++#, c-format ++msgid "raid6rec%c" ++msgstr "" ++ ++#: util/grub-mkrescue.c:136 ++#, c-format ++msgid "%s\n\n%s\n\n%s" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:133 ++msgid "couldn't get memory map, not enabling caches" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:149 ++#, c-format ++msgid "%d crossers\n" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:154 ++msgid "couldn't allocate place for MMU table, not enabling caches" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:212 ++msgid "MMU tables generated\n" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:216 ++msgid "enabling MMU\n" ++msgstr "" ++ ++#: grub-core/kern/arm/cache.c:218 ++msgid "MMU enabled\n" ++msgstr "" ++ ++#: grub-core/commands/verify.c:313 ++msgid "™" ++msgstr "" ++ ++#: grub-core/commands/videotest.c:122 ++msgid "Unicode test: happy☺ £ 5.00 ¡Ã„äu! ℤ⊆â„Â" ++msgstr "" ++ ++#: grub-core/disk/luks.c:40 ++msgid "LUKSº¾" ++msgstr "" ++ ++#: grub-core/fs/cpio.c:24 ++msgid "Çq" ++msgstr "" ++ ++#: grub-core/fs/cpio_be.c:23 ++msgid "qÇ" ++msgstr "" ++ ++#: grub-core/gfxmenu/gui_circular_progress.c:244 ++msgid "°" ++msgstr "" ++ ++#: grub-core/lib/xzembed/xz_stream.h:35 ++msgid "ý7zXZ" ++msgstr "" ++ ++#: grub-core/partmap/msdos.c:74 ++msgid "ÔA õ" ++msgstr "" ++ ++#: grub-core/partmap/msdos.c:80 ++msgid "ØA õ" ++msgstr "" ++ ++#: grub-core/partmap/msdos.c:87 ++msgid "pŠ]F5Ã…“®=†ý±U>à" ++msgstr "" ++ ++#: grub-core/io/lzopio.c:30 ++msgid "" ++"‰LZO\n" ++"\n" ++msgstr "" ++ ++#: util/grub-probe.c:735 ++#, c-format ++msgid "%s\n%s %s %s" ++msgstr "" +-- +2.4.3 + diff --git a/0347-grub-probe-free-temporary-variable.patch b/0347-grub-probe-free-temporary-variable.patch new file mode 100644 index 0000000..e91d603 --- /dev/null +++ b/0347-grub-probe-free-temporary-variable.patch @@ -0,0 +1,24 @@ +From 018f79da6f6f0aab34ce501e62db77c89a23aca1 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 28 Feb 2015 20:19:57 +0300 +Subject: [PATCH 347/506] grub-probe: free temporary variable + +--- + util/grub-probe.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 08d477f..8f4aa61 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -735,6 +735,7 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) + ret = xasprintf ("%s\n%s %s %s", _("print TARGET"), + _("available targets:"), t, def); + free (t); ++ free (def); + return ret; + } + +-- +2.4.3 + diff --git a/0348-Don-t-continue-to-query-block-size-if-disk-doesn-t-h.patch b/0348-Don-t-continue-to-query-block-size-if-disk-doesn-t-h.patch new file mode 100644 index 0000000..39654b2 --- /dev/null +++ b/0348-Don-t-continue-to-query-block-size-if-disk-doesn-t-h.patch @@ -0,0 +1,148 @@ +From 87ec3b7fa9061f470616ed927fc140e995831c00 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 27 Feb 2015 14:26:00 +0100 +Subject: [PATCH 348/506] Don't continue to query block-size if disk doesn't + have it. + +Stops poluting screen with a lot of "block-size: exception -21". +--- + grub-core/disk/ieee1275/ofdisk.c | 62 ++++++++++++++++++++++++++++------------ + include/grub/ieee1275/ofdisk.h | 3 -- + 2 files changed, 44 insertions(+), 21 deletions(-) + +diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c +index 5d88637..331769b 100644 +--- a/grub-core/disk/ieee1275/ofdisk.c ++++ b/grub-core/disk/ieee1275/ofdisk.c +@@ -35,6 +35,7 @@ struct ofdisk_hash_ent + char *grub_devpath; + int is_boot; + int is_removable; ++ int block_size_fails; + /* Pointer to shortest available name on nodes representing canonical names, + otherwise NULL. */ + const char *shortest; +@@ -42,6 +43,10 @@ struct ofdisk_hash_ent + struct ofdisk_hash_ent *next; + }; + ++static grub_err_t ++grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size, ++ struct ofdisk_hash_ent *op); ++ + #define OFDISK_HASH_SZ 8 + static struct ofdisk_hash_ent *ofdisk_hash[OFDISK_HASH_SZ]; + +@@ -375,6 +380,8 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) + /* XXX: This should be large enough for any possible case. */ + char prop[64]; + grub_ssize_t actual; ++ grub_uint32_t block_size = 0; ++ grub_err_t err; + + if (grub_strncmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) != 0) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, +@@ -405,14 +412,6 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a block device"); + } + +- grub_uint32_t block_size = 0; +- if (grub_ofdisk_get_block_size (devpath, &block_size) == 0) +- { +- for (disk->log_sector_size = 0; +- (1U << disk->log_sector_size) < block_size; +- disk->log_sector_size++); +- } +- + /* XXX: There is no property to read the number of blocks. There + should be a property `#blocks', but it is not there. Perhaps it + is possible to use seek for this. */ +@@ -429,6 +428,18 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) + return grub_errno; + disk->id = (unsigned long) op; + disk->data = op->open_path; ++ ++ err = grub_ofdisk_get_block_size (devpath, &block_size, op); ++ if (err) ++ return err; ++ if (block_size != 0) ++ { ++ for (disk->log_sector_size = 0; ++ (1U << disk->log_sector_size) < block_size; ++ disk->log_sector_size++); ++ } ++ else ++ disk->log_sector_size = 9; + } + + return 0; +@@ -589,8 +600,9 @@ grub_ofdisk_init (void) + grub_disk_dev_register (&grub_ofdisk_dev); + } + +-grub_err_t +-grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size) ++static grub_err_t ++grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size, ++ struct ofdisk_hash_ent *op) + { + struct size_args_ieee1275 + { +@@ -612,20 +624,34 @@ grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size) + if (! last_ihandle) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + ++ *block_size = 0; ++ ++ if (op->block_size_fails >= 2) ++ return GRUB_ERR_NONE; ++ + INIT_IEEE1275_COMMON (&args_ieee1275.common, "call-method", 2, 2); + args_ieee1275.method = (grub_ieee1275_cell_t) "block-size"; + args_ieee1275.ihandle = last_ihandle; + args_ieee1275.result = 1; + +- *block_size = GRUB_DISK_SECTOR_SIZE; +- +- if ((IEEE1275_CALL_ENTRY_FN (&args_ieee1275) == -1) || (args_ieee1275.result)) +- grub_dprintf ("disk", "can't get block size\n"); +- else +- if (args_ieee1275.size1 +- && !(args_ieee1275.size1 & (args_ieee1275.size1 - 1)) +- && args_ieee1275.size1 >= 512 && args_ieee1275.size1 <= 16384) ++ if (IEEE1275_CALL_ENTRY_FN (&args_ieee1275) == -1) ++ { ++ grub_dprintf ("disk", "can't get block size: failed call-method\n"); ++ op->block_size_fails++; ++ } ++ else if (args_ieee1275.result) ++ { ++ grub_dprintf ("disk", "can't get block size: %lld\n", ++ (long long) args_ieee1275.result); ++ op->block_size_fails++; ++ } ++ else if (args_ieee1275.size1 ++ && !(args_ieee1275.size1 & (args_ieee1275.size1 - 1)) ++ && args_ieee1275.size1 >= 512 && args_ieee1275.size1 <= 16384) ++ { ++ op->block_size_fails = 0; + *block_size = args_ieee1275.size1; ++ } + + return 0; + } +diff --git a/include/grub/ieee1275/ofdisk.h b/include/grub/ieee1275/ofdisk.h +index 3f58317..2f69e3f 100644 +--- a/include/grub/ieee1275/ofdisk.h ++++ b/include/grub/ieee1275/ofdisk.h +@@ -22,7 +22,4 @@ + extern void grub_ofdisk_init (void); + extern void grub_ofdisk_fini (void); + +-extern grub_err_t grub_ofdisk_get_block_size (const char *device, +- grub_uint32_t *block_size); +- + #endif /* ! GRUB_INIT_HEADER */ +-- +2.4.3 + diff --git a/0349-configure.ac-Set-CPPFLAGS-when-checking-for-no_app_r.patch b/0349-configure.ac-Set-CPPFLAGS-when-checking-for-no_app_r.patch new file mode 100644 index 0000000..b5b5ad5 --- /dev/null +++ b/0349-configure.ac-Set-CPPFLAGS-when-checking-for-no_app_r.patch @@ -0,0 +1,26 @@ +From aa6ccc05c10df14bc39a6a7d9d928d8180e3ef79 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 3 Mar 2015 09:07:53 +0100 +Subject: [PATCH 349/506] configure.ac: Set $CPPFLAGS when checking for + no_app_regs. + +Fixes compilation for sparc64 with clang. +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 908bb81..9e24d89 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -741,6 +741,7 @@ if test x"$target_cpu" = xsparc64 ; then + break + fi + CFLAGS="$TARGET_CFLAGS $cand -Werror" ++ CPPFLAGS="$TARGET_CPPFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_target_cc_mno_app_regs="$cand"], []) + done +-- +2.4.3 + diff --git a/0350-types.h-Use-__builtin_bswap-with-clang.patch b/0350-types.h-Use-__builtin_bswap-with-clang.patch new file mode 100644 index 0000000..588d0ba --- /dev/null +++ b/0350-types.h-Use-__builtin_bswap-with-clang.patch @@ -0,0 +1,27 @@ +From 77697d14e55eaf878639a630ab45563fa9556a97 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 3 Mar 2015 09:12:10 +0100 +Subject: [PATCH 350/506] types.h: Use __builtin_bswap* with clang. + +clang pretends to be GCC 4.2 but we use __builtin_bswap* only with GCC 4.3+. +clang support __builtin_bswap*, so use it. +--- + include/grub/types.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/grub/types.h b/include/grub/types.h +index 79f765c..e732efb 100644 +--- a/include/grub/types.h ++++ b/include/grub/types.h +@@ -179,7 +179,7 @@ static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x) + | (_x >> 56)); \ + }) + +-#if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) ++#if (defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3)) || defined(__clang__) + static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x) + { + return __builtin_bswap32(x); +-- +2.4.3 + diff --git a/0351-Remove-libgcc-dependency.patch b/0351-Remove-libgcc-dependency.patch new file mode 100644 index 0000000..1cfa754 --- /dev/null +++ b/0351-Remove-libgcc-dependency.patch @@ -0,0 +1,2313 @@ +From 064360e6671e0c5f2f47b73fd03b33be8a81f72c Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 3 Mar 2015 20:23:42 +0100 +Subject: [PATCH 351/506] Remove libgcc dependency. + +libgcc for boot environment isn't always present and compatible. +libgcc is often absent if endianness or bit-size at boot is different +from running OS. +libgcc may use optimised opcodes that aren't available on boot time. +So instead of relying on libgcc shipped with the compiler, supply +the functions in GRUB directly. +Tests are present to ensure that those replacement functions behave the +way compiler expects them to. +--- + conf/Makefile.common | 4 +- + config.h.in | 1 + + configure.ac | 25 +- + grub-core/Makefile.am | 8 +- + grub-core/Makefile.core.def | 43 ++- + grub-core/boot/decompressor/minilib.c | 11 +- + grub-core/kern/arm/{misc.S => compiler-rt.S} | 0 + grub-core/kern/compiler-rt.c | 404 +++++++++++++++++++++++++++ + grub-core/kern/misc.c | 232 --------------- + grub-core/kern/powerpc/compiler-rt.S | 130 +++++++++ + grub-core/lib/posix_wrap/string.h | 20 +- + grub-core/tests/bswap_test.c | 121 ++++++++ + grub-core/tests/cmp_test.c | 190 +++++++++++++ + grub-core/tests/ctz_test.c | 111 ++++++++ + grub-core/tests/lib/functional_test.c | 5 + + grub-core/tests/mul_test.c | 73 +++++ + grub-core/tests/shift_test.c | 157 +++++++++++ + include/grub/compiler-rt.h | 193 +++++++++++++ + include/grub/libgcc.h | 91 ------ + include/grub/misc.h | 99 +------ + include/grub/xen.h | 2 + + 21 files changed, 1441 insertions(+), 479 deletions(-) + rename grub-core/kern/arm/{misc.S => compiler-rt.S} (100%) + create mode 100644 grub-core/kern/compiler-rt.c + create mode 100644 grub-core/kern/powerpc/compiler-rt.S + create mode 100644 grub-core/tests/bswap_test.c + create mode 100644 grub-core/tests/cmp_test.c + create mode 100644 grub-core/tests/ctz_test.c + create mode 100644 grub-core/tests/mul_test.c + create mode 100644 grub-core/tests/shift_test.c + create mode 100644 include/grub/compiler-rt.h + delete mode 100644 include/grub/libgcc.h + +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 8861096..96e58c9 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -34,10 +34,8 @@ CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/ + CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1 + BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT) + +-LDADD_KERNEL = $(TARGET_LIBGCC) +- + CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding +-LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) ++LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) + CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 + CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) + STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags +diff --git a/config.h.in b/config.h.in +index ea0f383..9e8f991 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -7,6 +7,7 @@ + #endif + + #define GCRYPT_NO_DEPRECATED 1 ++#define HAVE_MEMMOVE 1 + + /* Define to 1 to enable disk cache statistics. */ + #define DISK_CACHE_STATS @DISK_CACHE_STATS@ +diff --git a/configure.ac b/configure.ac +index 9e24d89..be980ad 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1131,22 +1131,17 @@ fi + + # Set them to their new values for the tests below. + CC="$TARGET_CC" +-if test "x$TARGET_APPLE_LINKER" = x1 ; then ++if test x"$platform" = xemu ; then ++CFLAGS="$TARGET_CFLAGS -Wno-error" ++elif test "x$TARGET_APPLE_LINKER" = x1 ; then + CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error" + else + CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" + fi + CPPFLAGS="$TARGET_CPPFLAGS" +-if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then +-TARGET_LIBGCC= +-else +-TARGET_LIBGCC=-lgcc +-fi +- +-LIBS="$TARGET_LIBGCC" + + grub_ASM_USCORE +-if test "x$TARGET_APPLE_LINKER" = x0 ; then ++if test "x$TARGET_APPLE_LINKER" = x0 && test x"$platform" != xemu; then + if test x$grub_cv_asm_uscore = xyes; then + DEFSYM="-Wl,--defsym,_abort=_main -Wl,--defsym,__main=_main" + else +@@ -1156,7 +1151,9 @@ CFLAGS="$TARGET_CFLAGS -nostdlib $DEFSYM" + fi + + # Check for libgcc symbols +-AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x) ++if test x"$platform" = xemu; then ++AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 __udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __aeabi_uidiv __aeabi_uidivmod __aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy __aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 __ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero __register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms) ++fi + + if test "x$TARGET_APPLE_LINKER" = x1 ; then + CFLAGS="$TARGET_CFLAGS -nostdlib -static" +@@ -1717,12 +1714,6 @@ if test x"$enable_werror" != xno ; then + HOST_CFLAGS="$HOST_CFLAGS -Werror" + fi + +-if test "x$grub_cv_cc_target_clang" = xno; then +- TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc" +-else +- TARGET_LDFLAGS_STATIC_LIBGCC= +-fi +- + TARGET_CPP="$TARGET_CC -E" + TARGET_CCAS=$TARGET_CC + +@@ -1739,8 +1730,6 @@ AC_SUBST(GRUB_TARGET_CPU) + AC_SUBST(GRUB_PLATFORM) + + AC_SUBST(TARGET_OBJCONV) +-AC_SUBST(TARGET_LIBGCC) +-AC_SUBST(TARGET_LDFLAGS_STATIC_LIBGCC) + AC_SUBST(TARGET_CPP) + AC_SUBST(TARGET_CCAS) + AC_SUBST(TARGET_OBJ2ELF) +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 5c087c8..57c0b64 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -76,6 +76,11 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i18n.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/kernel.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/list.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/misc.h ++if COND_emu ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/compiler-rt-emu.h ++else ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/compiler-rt.h ++endif + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/parser.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/partition.h +@@ -83,9 +88,6 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h +-if !COND_clang +-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h +-endif + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h + + if COND_i386_pc +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index b539ccf..7a6fa21 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -132,6 +132,7 @@ kernel = { + common = kern/rescue_reader.c; + common = kern/term.c; + ++ noemu = kern/compiler-rt.c; + noemu = kern/mm.c; + noemu = kern/time.c; + noemu = kern/generic/millisleep.c; +@@ -254,6 +255,7 @@ kernel = { + + powerpc_ieee1275 = kern/powerpc/cache.S; + powerpc_ieee1275 = kern/powerpc/dl.c; ++ powerpc_ieee1275 = kern/powerpc/compiler-rt.S; + + sparc64_ieee1275 = kern/sparc64/cache.S; + sparc64_ieee1275 = kern/sparc64/dl.c; +@@ -265,7 +267,7 @@ kernel = { + arm = kern/arm/cache_armv7.S; + extra_dist = kern/arm/cache.S; + arm = kern/arm/cache.c; +- arm = kern/arm/misc.S; ++ arm = kern/arm/compiler-rt.S; + + arm64 = kern/arm64/cache.c; + arm64 = kern/arm64/cache_flush.S; +@@ -443,13 +445,13 @@ image = { + common = lib/xzembed/xz_dec_bcj.c; + common = lib/xzembed/xz_dec_lzma2.c; + common = lib/xzembed/xz_dec_stream.c; ++ common = kern/compiler-rt.c; + + cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1'; + + objcopyflags = '-O binary'; +- mips_ldflags = '$(TARGET_LDFLAGS_STATIC_LIBGCC) -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; +- ldadd = '$(TARGET_LIBGCC)'; +- cflags = '-Wno-unreachable-code $(TARGET_LDFLAGS_STATIC_LIBGCC)'; ++ mips_ldflags = '-Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; ++ cflags = '-Wno-unreachable-code'; + enable = mips; + }; + +@@ -461,9 +463,7 @@ image = { + cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1'; + + objcopyflags = '-O binary'; +- mips_ldflags = '$(TARGET_LDFLAGS_STATIC_LIBGCC) -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; +- ldadd = '$(TARGET_LIBGCC)'; +- cflags = '$(TARGET_LDFLAGS_STATIC_LIBGCC)'; ++ mips_ldflags = '-Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; + enable = mips; + }; + +@@ -481,7 +481,7 @@ image = { + name = fwstart; + mips_loongson = boot/mips/loongson/fwstart.S; + objcopyflags = '-O binary'; +- ldflags = '$(TARGET_LDFLAGS_STATIC_LIBGCC) $(TARGET_LIBGCC) -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic'; ++ ldflags = '-Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic'; + enable = mips_loongson; + }; + +@@ -489,7 +489,7 @@ image = { + name = fwstart_fuloong2f; + mips_loongson = boot/mips/loongson/fuloong2f.S; + objcopyflags = '-O binary'; +- ldflags = '$(TARGET_LDFLAGS_STATIC_LIBGCC) $(TARGET_LIBGCC) -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic'; ++ ldflags = '-Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic'; + enable = mips_loongson; + }; + +@@ -1983,6 +1983,31 @@ module = { + }; + + module = { ++ name = mul_test; ++ common = tests/mul_test.c; ++}; ++ ++module = { ++ name = shift_test; ++ common = tests/shift_test.c; ++}; ++ ++module = { ++ name = cmp_test; ++ common = tests/cmp_test.c; ++}; ++ ++module = { ++ name = ctz_test; ++ common = tests/ctz_test.c; ++}; ++ ++module = { ++ name = bswap_test; ++ common = tests/bswap_test.c; ++}; ++ ++module = { + name = videotest_checksum; + common = tests/videotest_checksum.c; + }; +diff --git a/grub-core/boot/decompressor/minilib.c b/grub-core/boot/decompressor/minilib.c +index 94edfd5..fc46ee0 100644 +--- a/grub-core/boot/decompressor/minilib.c ++++ b/grub-core/boot/decompressor/minilib.c +@@ -21,7 +21,7 @@ + #include + + void * +-memset (void *s, int c, grub_size_t len) ++grub_memset (void *s, int c, grub_size_t len) + { + grub_uint8_t *ptr; + for (ptr = s; len; ptr++, len--) +@@ -68,15 +68,6 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) + return 0; + } + +-int memcmp (const void *s1, const void *s2, grub_size_t n) +- __attribute__ ((alias ("grub_memcmp"))); +- +-void *memmove (void *dest, const void *src, grub_size_t n) +- __attribute__ ((alias ("grub_memmove"))); +- +-void *memcpy (void *dest, const void *src, grub_size_t n) +- __attribute__ ((alias ("grub_memmove"))); +- + void *grub_decompressor_scratch; + + void +diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/compiler-rt.S +similarity index 100% +rename from grub-core/kern/arm/misc.S +rename to grub-core/kern/arm/compiler-rt.S +diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c +new file mode 100644 +index 0000000..d4cc155 +--- /dev/null ++++ b/grub-core/kern/compiler-rt.c +@@ -0,0 +1,404 @@ ++/* compiler-rt.c - compiler helpers. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010-2014 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 ++ ++#ifndef GRUB_EMBED_DECOMPRESSOR ++void * GRUB_BUILTIN_ATTR ++memcpy (void *dest, const void *src, grub_size_t n) ++{ ++ return grub_memmove (dest, src, n); ++} ++void * GRUB_BUILTIN_ATTR ++memmove (void *dest, const void *src, grub_size_t n) ++{ ++ return grub_memmove (dest, src, n); ++} ++int GRUB_BUILTIN_ATTR ++memcmp (const void *s1, const void *s2, grub_size_t n) ++{ ++ return grub_memcmp (s1, s2, n); ++} ++void * GRUB_BUILTIN_ATTR ++memset (void *s, int c, grub_size_t n) ++{ ++ return grub_memset (s, c, n); ++} ++ ++#ifdef __APPLE__ ++ ++void GRUB_BUILTIN_ATTR ++__bzero (void *s, grub_size_t n) ++{ ++ grub_memset (s, 0, n); ++} ++ ++#endif ++ ++#if GRUB_DIVISION_IN_SOFTWARE ++ ++grub_uint32_t ++__udivsi3 (grub_uint32_t a, grub_uint32_t b) ++{ ++ return grub_divmod64 (a, b, 0); ++} ++ ++grub_int32_t ++__divsi3 (grub_int32_t a, grub_int32_t b) ++{ ++ return grub_divmod64s (a, b, 0); ++} ++ ++grub_uint32_t ++__umodsi3 (grub_uint32_t a, grub_uint32_t b) ++{ ++ grub_uint64_t ret; ++ grub_divmod64 (a, b, &ret); ++ return ret; ++} ++ ++grub_int32_t ++__modsi3 (grub_int32_t a, grub_int32_t b) ++{ ++ grub_int64_t ret; ++ grub_divmod64s (a, b, &ret); ++ return ret; ++} ++ ++grub_uint64_t ++__udivdi3 (grub_uint64_t a, grub_uint64_t b) ++{ ++ return grub_divmod64 (a, b, 0); ++} ++ ++grub_uint64_t ++__umoddi3 (grub_uint64_t a, grub_uint64_t b) ++{ ++ grub_uint64_t ret; ++ grub_divmod64 (a, b, &ret); ++ return ret; ++} ++ ++grub_int64_t ++__divdi3 (grub_int64_t a, grub_int64_t b) ++{ ++ return grub_divmod64s (a, b, 0); ++} ++ ++grub_int64_t ++__moddi3 (grub_int64_t a, grub_int64_t b) ++{ ++ grub_int64_t ret; ++ grub_divmod64s (a, b, &ret); ++ return ret; ++} ++ ++#endif ++ ++#endif ++ ++#ifdef NEED_CTZDI2 ++ ++unsigned ++__ctzdi2 (grub_uint64_t x) ++{ ++ unsigned ret = 0; ++ if (!x) ++ return 64; ++ if (!(x & 0xffffffff)) ++ { ++ x >>= 32; ++ ret |= 32; ++ } ++ if (!(x & 0xffff)) ++ { ++ x >>= 16; ++ ret |= 16; ++ } ++ if (!(x & 0xff)) ++ { ++ x >>= 8; ++ ret |= 8; ++ } ++ if (!(x & 0xf)) ++ { ++ x >>= 4; ++ ret |= 4; ++ } ++ if (!(x & 0x3)) ++ { ++ x >>= 2; ++ ret |= 2; ++ } ++ if (!(x & 0x1)) ++ { ++ x >>= 1; ++ ret |= 1; ++ } ++ return ret; ++} ++#endif ++ ++#ifdef NEED_CTZSI2 ++unsigned ++__ctzsi2 (grub_uint32_t x) ++{ ++ unsigned ret = 0; ++ if (!x) ++ return 32; ++ ++ if (!(x & 0xffff)) ++ { ++ x >>= 16; ++ ret |= 16; ++ } ++ if (!(x & 0xff)) ++ { ++ x >>= 8; ++ ret |= 8; ++ } ++ if (!(x & 0xf)) ++ { ++ x >>= 4; ++ ret |= 4; ++ } ++ if (!(x & 0x3)) ++ { ++ x >>= 2; ++ ret |= 2; ++ } ++ if (!(x & 0x1)) ++ { ++ x >>= 1; ++ ret |= 1; ++ } ++ return ret; ++} ++ ++#endif ++ ++ ++#if defined (__clang__) && !defined(GRUB_EMBED_DECOMPRESSOR) ++/* clang emits references to abort(). */ ++void __attribute__ ((noreturn)) ++abort (void) ++{ ++ grub_fatal ("compiler abort"); ++} ++#endif ++ ++#if (defined (__MINGW32__) || defined (__CYGWIN__)) ++void __register_frame_info (void) ++{ ++} ++ ++void __deregister_frame_info (void) ++{ ++} ++ ++void ___chkstk_ms (void) ++{ ++} ++ ++void __chkstk_ms (void) ++{ ++} ++#endif ++ ++union component64 ++{ ++ grub_uint64_t full; ++ struct ++ { ++#ifdef GRUB_CPU_WORDS_BIGENDIAN ++ grub_uint32_t high; ++ grub_uint32_t low; ++#else ++ grub_uint32_t low; ++ grub_uint32_t high; ++#endif ++ }; ++}; ++ ++#if defined (__powerpc__) || defined (__arm__) || defined(__mips__) ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__lshrdi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ w.high = 0; ++ w.low = (grub_uint32_t) uu.high >> -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; ++ ++ w.high = (grub_uint32_t) uu.high >> b; ++ w.low = ((grub_uint32_t) uu.low >> b) | carries; ++ } ++ ++ return w.full; ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__ashrdi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ /* w.high = 1..1 or 0..0 */ ++ w.high = ((grub_int32_t) uu.high) >> (32 - 1); ++ w.low = ((grub_int32_t) uu.high) >> -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = ((grub_uint32_t) uu.high) << bm; ++ ++ w.high = ((grub_int32_t) uu.high) >> b; ++ w.low = ((grub_uint32_t) uu.low >> b) | carries; ++ } ++ ++ return w.full; ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__ashldi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ w.low = 0; ++ w.high = (grub_uint32_t) uu.low << -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = (grub_uint32_t) uu.low >> bm; ++ ++ w.low = (grub_uint32_t) uu.low << b; ++ w.high = ((grub_uint32_t) uu.high << b) | carries; ++ } ++ ++ return w.full; ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++int ++__ucmpdi2 (grub_uint64_t a, grub_uint64_t b) ++{ ++ union component64 ac, bc; ++ ac.full = a; ++ bc.full = b; ++ ++ if (ac.high < bc.high) ++ return 0; ++ else if (ac.high > bc.high) ++ return 2; ++ ++ if (ac.low < bc.low) ++ return 0; ++ else if (ac.low > bc.low) ++ return 2; ++ return 1; ++} ++ ++#endif ++ ++#if defined (__powerpc__) || defined(__mips__) || defined(__sparc__) || defined(__arm__) ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint32_t ++__bswapsi2 (grub_uint32_t u) ++{ ++ return ((((u) & 0xff000000) >> 24) ++ | (((u) & 0x00ff0000) >> 8) ++ | (((u) & 0x0000ff00) << 8) ++ | (((u) & 0x000000ff) << 24)); ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__bswapdi2 (grub_uint64_t u) ++{ ++ return ((((u) & 0xff00000000000000ull) >> 56) ++ | (((u) & 0x00ff000000000000ull) >> 40) ++ | (((u) & 0x0000ff0000000000ull) >> 24) ++ | (((u) & 0x000000ff00000000ull) >> 8) ++ | (((u) & 0x00000000ff000000ull) << 8) ++ | (((u) & 0x0000000000ff0000ull) << 24) ++ | (((u) & 0x000000000000ff00ull) << 40) ++ | (((u) & 0x00000000000000ffull) << 56)); ++} ++ ++ ++#endif ++ ++#ifdef __arm__ ++grub_uint32_t ++__aeabi_uidiv (grub_uint32_t a, grub_uint32_t b) ++ __attribute__ ((alias ("__udivsi3"))); ++grub_int32_t ++__aeabi_idiv (grub_int32_t a, grub_int32_t b) ++ __attribute__ ((alias ("__divsi3"))); ++void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n) ++ __attribute__ ((alias ("grub_memcpy"))); ++void *__aeabi_memset (void *s, int c, grub_size_t n) ++ __attribute__ ((alias ("memset"))); ++ ++int ++__aeabi_ulcmp (grub_uint64_t a, grub_uint64_t b) ++{ ++ return __ucmpdi2 (a, b) - 1; ++} ++ ++grub_uint64_t ++__aeabi_lasr (grub_uint64_t u, int b) ++ __attribute__ ((alias ("__ashrdi3"))); ++grub_uint64_t ++__aeabi_llsr (grub_uint64_t u, int b) ++ __attribute__ ((alias ("__lshrdi3"))); ++ ++grub_uint64_t ++__aeabi_llsl (grub_uint64_t u, int b) ++ __attribute__ ((alias ("__ashldi3"))); ++ ++#endif +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index b0347e7..906d2c2 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -95,25 +95,6 @@ grub_memmove (void *dest, const void *src, grub_size_t n) + return dest; + } + +-#ifndef __APPLE__ +-void *memmove (void *dest, const void *src, grub_size_t n) +- __attribute__ ((alias ("grub_memmove"))); +-/* GCC emits references to memcpy() for struct copies etc. */ +-void *memcpy (void *dest, const void *src, grub_size_t n) +- __attribute__ ((alias ("grub_memmove"))); +-#else +-void * GRUB_BUILTIN_ATTR +-memcpy (void *dest, const void *src, grub_size_t n) +-{ +- return grub_memmove (dest, src, n); +-} +-void * GRUB_BUILTIN_ATTR +-memmove (void *dest, const void *src, grub_size_t n) +-{ +- return grub_memmove (dest, src, n); +-} +-#endif +- + char * + grub_strcpy (char *dest, const char *src) + { +@@ -253,16 +234,6 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) + + return 0; + } +-#ifndef __APPLE__ +-int memcmp (const void *s1, const void *s2, grub_size_t n) +- __attribute__ ((alias ("grub_memcmp"))); +-#else +-int GRUB_BUILTIN_ATTR +-memcmp (const void *s1, const void *s2, grub_size_t n) +-{ +- return grub_memcmp (s1, s2, n); +-} +-#endif + + int + grub_strcmp (const char *s1, const char *s2) +@@ -532,26 +503,6 @@ grub_memset (void *s, int c, grub_size_t len) + + return s; + } +-#ifndef __APPLE__ +-void *memset (void *s, int c, grub_size_t n) +- __attribute__ ((alias ("grub_memset"))); +-#else +-void * GRUB_BUILTIN_ATTR +-memset (void *s, int c, grub_size_t n) +-{ +- return grub_memset (s, c, n); +-} +- +-#endif +- +-#if !defined(GRUB_UTIL) && defined(__APPLE__) +-void GRUB_BUILTIN_ATTR +-__bzero (void *s, grub_size_t n) +-{ +- grub_memset (s, 0, n); +-} +- +-#endif + + grub_size_t + grub_strlen (const char *s) +@@ -631,163 +582,6 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) + return q; + } + +-#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) +- +-#if GRUB_DIVISION_IN_SOFTWARE +- +-grub_uint32_t +-__udivsi3 (grub_uint32_t a, grub_uint32_t b) +-{ +- return grub_divmod64 (a, b, 0); +-} +- +-grub_int32_t +-__divsi3 (grub_int32_t a, grub_int32_t b) +-{ +- return grub_divmod64s (a, b, 0); +-} +- +-grub_uint32_t +-__umodsi3 (grub_uint32_t a, grub_uint32_t b) +-{ +- grub_uint64_t ret; +- grub_divmod64 (a, b, &ret); +- return ret; +-} +- +-grub_int32_t +-__modsi3 (grub_int32_t a, grub_int32_t b) +-{ +- grub_int64_t ret; +- grub_divmod64s (a, b, &ret); +- return ret; +-} +- +-grub_uint64_t +-__udivdi3 (grub_uint64_t a, grub_uint64_t b) +-{ +- return grub_divmod64 (a, b, 0); +-} +- +-grub_uint64_t +-__umoddi3 (grub_uint64_t a, grub_uint64_t b) +-{ +- grub_uint64_t ret; +- grub_divmod64 (a, b, &ret); +- return ret; +-} +- +-grub_int64_t +-__divdi3 (grub_int64_t a, grub_int64_t b) +-{ +- return grub_divmod64s (a, b, 0); +-} +- +-grub_int64_t +-__moddi3 (grub_int64_t a, grub_int64_t b) +-{ +- grub_int64_t ret; +- grub_divmod64s (a, b, &ret); +- return ret; +-} +- +-#endif +- +-#ifdef NEED_CTZDI2 +- +-unsigned +-__ctzdi2 (grub_uint64_t x) +-{ +- unsigned ret = 0; +- if (!x) +- return 64; +- if (!(x & 0xffffffff)) +- { +- x >>= 32; +- ret |= 32; +- } +- if (!(x & 0xffff)) +- { +- x >>= 16; +- ret |= 16; +- } +- if (!(x & 0xff)) +- { +- x >>= 8; +- ret |= 8; +- } +- if (!(x & 0xf)) +- { +- x >>= 4; +- ret |= 4; +- } +- if (!(x & 0x3)) +- { +- x >>= 2; +- ret |= 2; +- } +- if (!(x & 0x1)) +- { +- x >>= 1; +- ret |= 1; +- } +- return ret; +-} +-#endif +- +-#ifdef NEED_CTZSI2 +-unsigned +-__ctzsi2 (grub_uint32_t x) +-{ +- unsigned ret = 0; +- if (!x) +- return 32; +- +- if (!(x & 0xffff)) +- { +- x >>= 16; +- ret |= 16; +- } +- if (!(x & 0xff)) +- { +- x >>= 8; +- ret |= 8; +- } +- if (!(x & 0xf)) +- { +- x >>= 4; +- ret |= 4; +- } +- if (!(x & 0x3)) +- { +- x >>= 2; +- ret |= 2; +- } +- if (!(x & 0x1)) +- { +- x >>= 1; +- ret |= 1; +- } +- return ret; +-} +- +-#endif +- +-#ifdef __arm__ +-grub_uint32_t +-__aeabi_uidiv (grub_uint32_t a, grub_uint32_t b) +- __attribute__ ((alias ("__udivsi3"))); +-grub_int32_t +-__aeabi_idiv (grub_int32_t a, grub_int32_t b) +- __attribute__ ((alias ("__divsi3"))); +-void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n) +- __attribute__ ((alias ("grub_memcpy"))); +-void *__aeabi_memset (void *s, int c, grub_size_t n) +- __attribute__ ((alias ("grub_memset"))); +-#endif +- +-#endif /* GRUB_UTIL */ +- + /* Convert a long long value to a string. This function avoids 64-bit + modular arithmetic or divisions. */ + static inline char * +@@ -1296,15 +1090,6 @@ grub_abort (void) + grub_exit (); + } + +-#if defined (__clang__) && !defined (GRUB_UTIL) +-/* clang emits references to abort(). */ +-void __attribute__ ((noreturn)) +-abort (void) +-{ +- grub_abort (); +-} +-#endif +- + void + grub_fatal (const char *fmt, ...) + { +@@ -1317,23 +1102,6 @@ grub_fatal (const char *fmt, ...) + grub_abort (); + } + +-#if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL) +-void __register_frame_info (void) +-{ +-} +- +-void __deregister_frame_info (void) +-{ +-} +-void ___chkstk_ms (void) +-{ +-} +- +-void __chkstk_ms (void) +-{ +-} +-#endif +- + #if BOOT_TIME_STATS + + #include +diff --git a/grub-core/kern/powerpc/compiler-rt.S b/grub-core/kern/powerpc/compiler-rt.S +new file mode 100644 +index 0000000..b3b912d +--- /dev/null ++++ b/grub-core/kern/powerpc/compiler-rt.S +@@ -0,0 +1,130 @@ ++/* ++ * Special support for eabi and SVR4 ++ * ++ * Copyright (C) 1995-2014 Free Software Foundation, Inc. ++ * Written By Michael Meissner ++ * 64-bit support written by David Edelsohn ++ * ++ * This file 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, or (at your option) any ++ * later version. ++ * ++ * This file 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. ++ * ++ * Under Section 7 of GPL version 3, you are granted additional ++ * permissions described in the GCC Runtime Library Exception, version ++ * 3.1, as published by the Free Software Foundation. ++ * ++ * You should have received a copy of the GNU General Public License and ++ * a copy of the GCC Runtime Library Exception along with this program; ++ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++ * . ++ */ ++ ++/* Do any initializations needed for the eabi environment */ ++ ++#include ++#include ++ ++ .section ".text" ++ ++#define CFI_RESTORE(reg) .cfi_restore reg ++#define CFI_OFFSET(reg, off) .cfi_offset reg, off ++#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg ++#define CFI_STARTPROC .cfi_startproc ++#define CFI_ENDPROC .cfi_endproc ++ ++/* Routines for restoring integer registers, called by the compiler. */ ++/* Called with r11 pointing to the stack header word of the caller of the */ ++/* function, just beyond the end of the integer restore area. */ ++ ++CFI_STARTPROC ++CFI_DEF_CFA_REGISTER (11) ++CFI_OFFSET (65, 4) ++CFI_OFFSET (14, -72) ++CFI_OFFSET (15, -68) ++CFI_OFFSET (16, -64) ++CFI_OFFSET (17, -60) ++CFI_OFFSET (18, -56) ++CFI_OFFSET (19, -52) ++CFI_OFFSET (20, -48) ++CFI_OFFSET (21, -44) ++CFI_OFFSET (22, -40) ++CFI_OFFSET (23, -36) ++CFI_OFFSET (24, -32) ++CFI_OFFSET (25, -28) ++CFI_OFFSET (26, -24) ++CFI_OFFSET (27, -20) ++CFI_OFFSET (28, -16) ++CFI_OFFSET (29, -12) ++CFI_OFFSET (30, -8) ++CFI_OFFSET (31, -4) ++FUNCTION(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */ ++CFI_RESTORE (14) ++FUNCTION(_restgpr_15_x) lwz 15,-68(11) ++CFI_RESTORE (15) ++FUNCTION(_restgpr_16_x) lwz 16,-64(11) ++CFI_RESTORE (16) ++FUNCTION(_restgpr_17_x) lwz 17,-60(11) ++CFI_RESTORE (17) ++FUNCTION(_restgpr_18_x) lwz 18,-56(11) ++CFI_RESTORE (18) ++FUNCTION(_restgpr_19_x) lwz 19,-52(11) ++CFI_RESTORE (19) ++FUNCTION(_restgpr_20_x) lwz 20,-48(11) ++CFI_RESTORE (20) ++FUNCTION(_restgpr_21_x) lwz 21,-44(11) ++CFI_RESTORE (21) ++FUNCTION(_restgpr_22_x) lwz 22,-40(11) ++CFI_RESTORE (22) ++FUNCTION(_restgpr_23_x) lwz 23,-36(11) ++CFI_RESTORE (23) ++FUNCTION(_restgpr_24_x) lwz 24,-32(11) ++CFI_RESTORE (24) ++FUNCTION(_restgpr_25_x) lwz 25,-28(11) ++CFI_RESTORE (25) ++FUNCTION(_restgpr_26_x) lwz 26,-24(11) ++CFI_RESTORE (26) ++FUNCTION(_restgpr_27_x) lwz 27,-20(11) ++CFI_RESTORE (27) ++FUNCTION(_restgpr_28_x) lwz 28,-16(11) ++CFI_RESTORE (28) ++FUNCTION(_restgpr_29_x) lwz 29,-12(11) ++CFI_RESTORE (29) ++FUNCTION(_restgpr_30_x) lwz 30,-8(11) ++CFI_RESTORE (30) ++FUNCTION(_restgpr_31_x) lwz 0,4(11) ++ lwz 31,-4(11) ++CFI_RESTORE (31) ++ mtlr 0 ++CFI_RESTORE (65) ++ mr 1,11 ++CFI_DEF_CFA_REGISTER (1) ++ blr ++CFI_ENDPROC ++ ++CFI_STARTPROC ++FUNCTION(_savegpr_14) stw 14,-72(11) /* save gp registers */ ++FUNCTION(_savegpr_15) stw 15,-68(11) ++FUNCTION(_savegpr_16) stw 16,-64(11) ++FUNCTION(_savegpr_17) stw 17,-60(11) ++FUNCTION(_savegpr_18) stw 18,-56(11) ++FUNCTION(_savegpr_19) stw 19,-52(11) ++FUNCTION(_savegpr_20) stw 20,-48(11) ++FUNCTION(_savegpr_21) stw 21,-44(11) ++FUNCTION(_savegpr_22) stw 22,-40(11) ++FUNCTION(_savegpr_23) stw 23,-36(11) ++FUNCTION(_savegpr_24) stw 24,-32(11) ++FUNCTION(_savegpr_25) stw 25,-28(11) ++FUNCTION(_savegpr_26) stw 26,-24(11) ++FUNCTION(_savegpr_27) stw 27,-20(11) ++FUNCTION(_savegpr_28) stw 28,-16(11) ++FUNCTION(_savegpr_29) stw 29,-12(11) ++FUNCTION(_savegpr_30) stw 30,-8(11) ++FUNCTION(_savegpr_31) stw 31,-4(11) ++ blr ++CFI_ENDPROC +diff --git a/grub-core/lib/posix_wrap/string.h b/grub-core/lib/posix_wrap/string.h +index c4b9bf0..7ae6eee 100644 +--- a/grub-core/lib/posix_wrap/string.h ++++ b/grub-core/lib/posix_wrap/string.h +@@ -42,21 +42,6 @@ strcasecmp (const char *s1, const char *s2) + return grub_strcasecmp (s1, s2); + } + +-#ifdef GRUB_UTIL +-static inline void * +-memcpy (void *dest, const void *src, grub_size_t n) +-{ +- return grub_memcpy (dest, src, n); +-} +- +-static inline int +-memcmp (const void *s1, const void *s2, grub_size_t n) +-{ +- return grub_memcmp (s1, s2, n); +-} +- +-#endif +- + static inline void + bcopy (const void *src, void *dest, grub_size_t n) + { +@@ -99,4 +84,9 @@ memchr (const void *s, int c, grub_size_t n) + return grub_memchr (s, c, n); + } + ++#define memcmp grub_memcmp ++#define memcpy grub_memcpy ++#define memmove grub_memmove ++#define memset grub_memset ++ + #endif +diff --git a/grub-core/tests/bswap_test.c b/grub-core/tests/bswap_test.c +new file mode 100644 +index 0000000..4eb3a98 +--- /dev/null ++++ b/grub-core/tests/bswap_test.c +@@ -0,0 +1,121 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_uint64_t vectors[] = { ++ 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL ++}; ++ ++static void ++test16 (grub_uint16_t a) ++{ ++ grub_uint16_t b, c; ++ grub_uint8_t *ap, *bp; ++ int i; ++ b = grub_swap_bytes16 (a); ++ c = grub_swap_bytes16 (b); ++ grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", ++ (long long) a, (long long) b, (long long) c); ++ ap = (grub_uint8_t *) &a; ++ bp = (grub_uint8_t *) &b; ++ for (i = 0; i < 2; i++) ++ { ++ grub_test_assert (ap[i] == bp[1 - i], ++ "bswap bytes wrong: 0x%llx, 0x%llx", ++ (long long) a, (long long) b); ++ } ++} ++ ++static void ++test32 (grub_uint32_t a) ++{ ++ grub_uint32_t b, c; ++ grub_uint8_t *ap, *bp; ++ int i; ++ b = grub_swap_bytes32 (a); ++ c = grub_swap_bytes32 (b); ++ grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", ++ (long long) a, (long long) b, (long long) c); ++ ap = (grub_uint8_t *) &a; ++ bp = (grub_uint8_t *) &b; ++ for (i = 0; i < 4; i++) ++ { ++ grub_test_assert (ap[i] == bp[3 - i], ++ "bswap bytes wrong: 0x%llx, 0x%llx", ++ (long long) a, (long long) b); ++ } ++} ++ ++static void ++test64 (grub_uint64_t a) ++{ ++ grub_uint64_t b, c; ++ grub_uint8_t *ap, *bp; ++ int i; ++ b = grub_swap_bytes64 (a); ++ c = grub_swap_bytes64 (b); ++ grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", ++ (long long) a, (long long) b, (long long) c); ++ ap = (grub_uint8_t *) &a; ++ bp = (grub_uint8_t *) &b; ++ for (i = 0; i < 4; i++) ++ { ++ grub_test_assert (ap[i] == bp[7 - i], ++ "bswap bytes wrong: 0x%llx, 0x%llx", ++ (long long) a, (long long) b); ++ } ++} ++ ++static void ++test_all(grub_uint64_t a) ++{ ++ test64 (a); ++ test32 (a); ++ test16 (a); ++} ++ ++static void ++bswap_test (void) ++{ ++ grub_uint64_t a = 404, b = 7; ++ grub_size_t i; ++ ++ for (i = 0; i < ARRAY_SIZE (vectors); i++) ++ { ++ test_all (vectors[i]); ++ } ++ for (i = 0; i < 40000; i++) ++ { ++ a = 17 * a + 13 * b; ++ b = 23 * a + 29 * b; ++ if (b == 0) ++ b = 1; ++ if (a == 0) ++ a = 1; ++ test_all (a); ++ test_all (b); ++ } ++} ++ ++/* Register example_test method as a functional test. */ ++GRUB_FUNCTIONAL_TEST (bswap_test, bswap_test); +diff --git a/grub-core/tests/cmp_test.c b/grub-core/tests/cmp_test.c +new file mode 100644 +index 0000000..af5b395 +--- /dev/null ++++ b/grub-core/tests/cmp_test.c +@@ -0,0 +1,190 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_uint64_t vectors[][2] = { ++ { 0xffffffffffffffffULL, 1}, ++ { 1, 0xffffffffffffffffULL}, ++ { 0xffffffffffffffffULL, 0xffffffffffffffffULL}, ++ { 1, 1 }, ++ { 2, 1 } ++}; ++ ++/* Don't change those to use shift as shift may call to compile rt ++ functions and we're not testing them now. ++ */ ++static int ++leading_bit64 (grub_uint64_t a) ++{ ++ return !!(a & 0x8000000000000000LL); ++} ++ ++static int ++leading_bit32 (grub_uint32_t a) ++{ ++ return !!(a & 0x80000000); ++} ++ ++/* Computes (a < b) without involving comparison operator. */ ++static int ++is_less32 (grub_uint32_t a, grub_uint32_t b) ++{ ++ if (leading_bit32(a) && !leading_bit32(b)) ++ return 0; ++ if (!leading_bit32(a) && leading_bit32(b)) ++ return 1; ++ return leading_bit32(a - b); ++} ++ ++static void ++test32 (grub_uint32_t a, grub_uint32_t b) ++{ ++ grub_test_assert ((a < b) == is_less32(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((a > b) == is_less32(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b < a) == is_less32(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b > a) == is_less32(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert (!(is_less32(a, b) && is_less32(b, a)), "comparison inconsistent: %lld, %lld", ++ (long long) a, (long long) b); ++} ++ ++/* Computes (a > b) without involving comparison operator. */ ++static int ++is_less32s (grub_int32_t a, grub_int32_t b) ++{ ++ if (leading_bit32(a) && !leading_bit32(b)) ++ return 1; /* a < 0 && b >= 0. */ ++ if (!leading_bit32(a) && leading_bit32(b)) ++ return 0; /* b < 0 && a >= 0. */ ++ return leading_bit32(a - b); ++} ++ ++static void ++test32s (grub_int32_t a, grub_int32_t b) ++{ ++ grub_test_assert ((a < b) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((a > b) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b < a) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b > a) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert (!(is_less32s(a, b) && is_less32s(b, a)), "comparison inconsistent: %lld, %lld", ++ (long long) a, (long long) b); ++} ++ ++/* Computes (a > b) without involving comparison operator. */ ++static int ++is_less64 (grub_uint64_t a, grub_uint64_t b) ++{ ++ if (leading_bit64(a) && !leading_bit64(b)) ++ return 0; ++ if (!leading_bit64(a) && leading_bit64(b)) ++ return 1; ++ return leading_bit64(a - b); ++} ++ ++static void ++test64 (grub_uint64_t a, grub_uint64_t b) ++{ ++ grub_test_assert ((a < b) == is_less64(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((a > b) == is_less64(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b < a) == is_less64(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b > a) == is_less64(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert (!(is_less64(a, b) && is_less64(b, a)), "comparison inconsistent: %lld, %lld", ++ (long long) a, (long long) b); ++} ++ ++/* Computes (a > b) without involving comparison operator. */ ++static int ++is_less64s (grub_int64_t a, grub_int64_t b) ++{ ++ if (leading_bit64(a) && !leading_bit64(b)) ++ return 1; /* a < 0 && b >= 0. */ ++ if (!leading_bit64(a) && leading_bit64(b)) ++ return 0; /* b < 0 && a >= 0. */ ++ return leading_bit64(a - b); ++} ++ ++static void ++test64s (grub_int64_t a, grub_int64_t b) ++{ ++ grub_test_assert ((a < b) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((a > b) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b < a) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert ((b > a) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", ++ (long long) a, (long long) b); ++ grub_test_assert (!(is_less64s(a, b) && is_less64s(b, a)), "comparison inconsistent: %lld, %lld", ++ (long long) a, (long long) b); ++} ++ ++static void ++test_all(grub_uint64_t a, grub_uint64_t b) ++{ ++ test64 (a, b); ++ test32 (a, b); ++ test64s (a, b); ++ test32s (a, b); ++ test64s (a, -b); ++ test32s (a, -b); ++ test64s (-a, b); ++ test32s (-a, b); ++ test64s (-a, -b); ++ test32s (-a, -b); ++} ++ ++static void ++cmp_test (void) ++{ ++ grub_uint64_t a = 404, b = 7; ++ grub_size_t i; ++ ++ for (i = 0; i < ARRAY_SIZE (vectors); i++) ++ { ++ test_all (vectors[i][0], vectors[i][1]); ++ } ++ for (i = 0; i < 40000; i++) ++ { ++ a = 17 * a + 13 * b; ++ b = 23 * a + 29 * b; ++ if (b == 0) ++ b = 1; ++ if (a == 0) ++ a = 1; ++ test_all (a, b); ++ } ++} ++ ++/* Register example_test method as a functional test. */ ++GRUB_FUNCTIONAL_TEST (cmp_test, cmp_test); +diff --git a/grub-core/tests/ctz_test.c b/grub-core/tests/ctz_test.c +new file mode 100644 +index 0000000..eb7a1df +--- /dev/null ++++ b/grub-core/tests/ctz_test.c +@@ -0,0 +1,111 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2013 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++/* ull version is not used on i386 other than in this test. ++ Avoid requiring extra function. ++ */ ++#if defined (__i386__) ++#define SKIP_ULL 1 ++#endif ++ ++static grub_uint64_t vectors[] = { ++ 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL ++}; ++ ++static void ++test_ui (unsigned int a) ++{ ++ int i; ++ a |= 1; ++ for (i = 0; i < (int) (8 * sizeof (a)); i++) ++ { ++ grub_test_assert (__builtin_ctz(a << i) == i, ++ "ctz mismatch: ctz(0x%llx) != 0x%x", ++ (long long) (a << i), __builtin_ctz(a << i)); ++ } ++} ++ ++static void ++test_ul (unsigned long a) ++{ ++ int i; ++ a |= 1; ++ for (i = 0; i < (int) (8 * sizeof (a)); i++) ++ { ++ grub_test_assert (__builtin_ctzl(a << i) == i, ++ "ctzl mismatch: ctzl(0x%llx) != 0x%x", ++ (long long) (a << i), __builtin_ctz(a << i)); ++ } ++} ++ ++#ifndef SKIP_ULL ++static void ++test_ull (unsigned long long a) ++{ ++ int i; ++ a |= 1; ++ for (i = 0; i < (int) (8 * sizeof (a)); i++) ++ { ++ grub_test_assert (__builtin_ctzll(a << i) == i, ++ "ctzll mismatch: ctzll(0x%llx) != 0x%x", ++ (long long) (a << i), __builtin_ctz(a << i)); ++ } ++} ++#endif ++ ++static void ++test_all(grub_uint64_t a) ++{ ++ test_ui (a); ++ test_ul (a); ++#ifndef SKIP_ULL ++ test_ull (a); ++#endif ++} ++ ++static void ++ctz_test (void) ++{ ++ grub_uint64_t a = 404, b = 7; ++ grub_size_t i; ++ ++ for (i = 0; i < ARRAY_SIZE (vectors); i++) ++ { ++ test_all (vectors[i]); ++ } ++ for (i = 0; i < 40000; i++) ++ { ++ a = 17 * a + 13 * b; ++ b = 23 * a + 29 * b; ++ if (b == 0) ++ b = 1; ++ if (a == 0) ++ a = 1; ++ test_all (a); ++ test_all (b); ++ } ++} ++ ++/* Register example_test method as a functional test. */ ++GRUB_FUNCTIONAL_TEST (ctz_test, ctz_test); +diff --git a/grub-core/tests/lib/functional_test.c b/grub-core/tests/lib/functional_test.c +index 5be7a58..d4822a1 100644 +--- a/grub-core/tests/lib/functional_test.c ++++ b/grub-core/tests/lib/functional_test.c +@@ -65,6 +65,11 @@ grub_functional_all_tests (grub_extcmd_context_t ctxt __attribute__ ((unused)), + grub_dl_load ("pbkdf2_test"); + grub_dl_load ("signature_test"); + grub_dl_load ("sleep_test"); ++ grub_dl_load ("bswap_test"); ++ grub_dl_load ("ctz_test"); ++ grub_dl_load ("cmp_test"); ++ grub_dl_load ("mul_test"); ++ grub_dl_load ("shift_test"); + + FOR_LIST_ELEMENTS (test, grub_test_list) + ok = !grub_test_run (test) && ok; +diff --git a/grub-core/tests/mul_test.c b/grub-core/tests/mul_test.c +new file mode 100644 +index 0000000..cd64231 +--- /dev/null ++++ b/grub-core/tests/mul_test.c +@@ -0,0 +1,73 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2013 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_uint64_t vectors[][2] = { ++ { 0xffffffffffffffffULL, 1}, ++ { 1, 0xffffffffffffffffULL}, ++ { 0xffffffffffffffffULL, 0xffffffffffffffffULL}, ++ { 1, 1 }, ++ { 2, 1 } ++}; ++ ++static void ++test64(grub_uint64_t a, grub_uint64_t b) ++{ ++ grub_uint64_t r1 = a * b, r2 = 0, r3; ++ int i; ++ for (i = 0; i < 64; i++) ++ if ((a & (1LL << i))) ++ r2 += b << i; ++ r3 = ((grub_int64_t) a) * ((grub_int64_t) b); ++ grub_test_assert (r1 == r2, ++ "multiplication mismatch (u): 0x%llx x 0x%llx = 0x%llx != 0x%llx", ++ (long long) a, (long long) b, (long long) r2, (long long) r1); ++ grub_test_assert (r3 == r2, ++ "multiplication mismatch (s): 0x%llx x 0x%llx = 0x%llx != 0x%llx", ++ (long long) a, (long long) b, (long long) r2, (long long) r3); ++} ++ ++static void ++mul_test (void) ++{ ++ grub_uint64_t a = 404, b = 7; ++ grub_size_t i; ++ ++ for (i = 0; i < ARRAY_SIZE (vectors); i++) ++ { ++ test64 (vectors[i][0], vectors[i][1]); ++ } ++ for (i = 0; i < 40000; i++) ++ { ++ a = 17 * a + 13 * b; ++ b = 23 * a + 29 * b; ++ if (b == 0) ++ b = 1; ++ if (a == 0) ++ a = 1; ++ test64 (a, b); ++ } ++} ++ ++/* Register example_test method as a functional test. */ ++GRUB_FUNCTIONAL_TEST (mul_test, mul_test); +diff --git a/grub-core/tests/shift_test.c b/grub-core/tests/shift_test.c +new file mode 100644 +index 0000000..4120f52 +--- /dev/null ++++ b/grub-core/tests/shift_test.c +@@ -0,0 +1,157 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * 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 ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_uint64_t vectors[] = { ++ 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL ++}; ++ ++/* We're testing shifts, don't replace access to this with a shift. */ ++static const grub_uint8_t bitmask[] = ++ { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; ++ ++typedef union { ++ grub_uint64_t v64; ++ grub_uint8_t v8[8]; ++} grub_raw_u64_t; ++ ++static int ++get_bit64 (grub_uint64_t v, int b) ++{ ++ grub_raw_u64_t vr = { .v64 = v }; ++ grub_uint8_t *p = vr.v8; ++ if (b >= 64) ++ return 0; ++#ifdef GRUB_CPU_WORDS_BIGENDIAN ++ p += 7 - b / 8; ++#else ++ p += b / 8; ++#endif ++ return !!(*p & bitmask[b % 8]); ++} ++ ++static grub_uint64_t ++set_bit64 (grub_uint64_t v, int b) ++{ ++ grub_raw_u64_t vr = { .v64 = v }; ++ grub_uint8_t *p = vr.v8; ++ if (b >= 64) ++ return v; ++#ifdef GRUB_CPU_WORDS_BIGENDIAN ++ p += 7 - b / 8; ++#else ++ p += b / 8; ++#endif ++ *p |= bitmask[b % 8]; ++ return vr.v64; ++} ++ ++static grub_uint64_t ++left_shift64 (grub_uint64_t v, int s) ++{ ++ grub_uint64_t r = 0; ++ int i; ++ for (i = 0; i + s < 64; i++) ++ if (get_bit64 (v, i)) ++ r = set_bit64 (r, i + s); ++ return r; ++} ++ ++static grub_uint64_t ++right_shift64 (grub_uint64_t v, int s) ++{ ++ grub_uint64_t r = 0; ++ int i; ++ for (i = s; i < 64; i++) ++ if (get_bit64 (v, i)) ++ r = set_bit64 (r, i - s); ++ return r; ++} ++ ++static grub_uint64_t ++arithmetic_right_shift64 (grub_uint64_t v, int s) ++{ ++ grub_uint64_t r = 0; ++ int i; ++ for (i = s; i < 64; i++) ++ if (get_bit64 (v, i)) ++ r = set_bit64 (r, i - s); ++ if (get_bit64 (v, 63)) ++ for (i -= s; i < 64; i++) ++ r = set_bit64 (r, i); ++ ++ return r; ++} ++ ++static void ++test64 (grub_uint64_t v) ++{ ++ int i; ++ for (i = 0; i < 64; i++) ++ { ++ grub_test_assert ((v << i) == left_shift64 (v, i), ++ "lshift wrong: 0x%llx << %d: 0x%llx, 0x%llx", ++ (long long) v, i, ++ (long long) (v << i), (long long) left_shift64 (v, i)); ++ grub_test_assert ((v >> i) == right_shift64 (v, i), ++ "rshift wrong: 0x%llx >> %d: 0x%llx, 0x%llx", ++ (long long) v, i, ++ (long long) (v >> i), (long long) right_shift64 (v, i)); ++ grub_test_assert ((((grub_int64_t) v) >> i) == (grub_int64_t) arithmetic_right_shift64 (v, i), ++ "arithmetic rshift wrong: ((grub_int64_t) 0x%llx) >> %d: 0x%llx, 0x%llx", ++ (long long) v, i, ++ (long long) (((grub_int64_t) v) >> i), (long long) arithmetic_right_shift64 (v, i)); ++ } ++} ++ ++static void ++test_all(grub_uint64_t a) ++{ ++ test64 (a); ++} ++ ++static void ++shift_test (void) ++{ ++ grub_uint64_t a = 404, b = 7; ++ grub_size_t i; ++ ++ for (i = 0; i < ARRAY_SIZE (vectors); i++) ++ { ++ test_all (vectors[i]); ++ } ++ for (i = 0; i < 4000; i++) ++ { ++ a = 17 * a + 13 * b; ++ b = 23 * a + 29 * b; ++ if (b == 0) ++ b = 1; ++ if (a == 0) ++ a = 1; ++ test_all (a); ++ test_all (b); ++ } ++} ++ ++/* Register example_test method as a functional test. */ ++GRUB_FUNCTIONAL_TEST (shift_test, shift_test); +diff --git a/include/grub/compiler-rt.h b/include/grub/compiler-rt.h +new file mode 100644 +index 0000000..9265c7e +--- /dev/null ++++ b/include/grub/compiler-rt.h +@@ -0,0 +1,193 @@ ++/* compiler-rt.h - prototypes for compiler helpers. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010-2014 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_COMPILER_RT_HEADER ++#define GRUB_COMPILER_RT_HEADER 1 ++ ++#include ++#include ++#include ++#include ++ ++#if defined(GRUB_DIVISION_IN_SOFTWARE) && GRUB_DIVISION_IN_SOFTWARE ++ ++grub_uint32_t ++EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); ++ ++grub_uint32_t ++EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); ++ ++grub_int32_t ++EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); ++ ++grub_int32_t ++EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); ++ ++grub_int64_t ++EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); ++ ++grub_int64_t ++EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); ++ ++grub_uint64_t ++EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); ++ ++grub_uint64_t ++EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); ++ ++#endif ++ ++#if defined (__sparc__) || defined (__powerpc__) || defined (__mips__) || defined (__arm__) ++unsigned ++EXPORT_FUNC (__ctzdi2) (grub_uint64_t x); ++#define NEED_CTZDI2 1 ++#endif ++ ++#if defined (__mips__) || defined (__arm__) ++unsigned ++EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); ++#define NEED_CTZSI2 1 ++#endif ++ ++#ifdef __arm__ ++grub_uint32_t ++EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); ++grub_uint32_t ++EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); ++ ++grub_int32_t ++EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); ++grub_int32_t ++EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); ++ ++int ++EXPORT_FUNC (__aeabi_ulcmp) (grub_uint64_t a, grub_uint64_t b); ++ ++/* Needed for allowing modules to be compiled as thumb. */ ++grub_uint64_t ++EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); ++grub_uint64_t ++EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); ++ ++void * ++EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); ++void * ++EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); ++ ++grub_uint64_t ++EXPORT_FUNC (__aeabi_lasr) (grub_uint64_t u, int b); ++ ++grub_uint64_t ++EXPORT_FUNC (__aeabi_llsl) (grub_uint64_t u, int b); ++ ++grub_uint64_t ++EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); ++ ++#endif ++ ++ ++#if defined (__powerpc__) ++ ++void EXPORT_FUNC (_restgpr_14_x) (void); ++void EXPORT_FUNC (_restgpr_15_x) (void); ++void EXPORT_FUNC (_restgpr_16_x) (void); ++void EXPORT_FUNC (_restgpr_17_x) (void); ++void EXPORT_FUNC (_restgpr_18_x) (void); ++void EXPORT_FUNC (_restgpr_19_x) (void); ++void EXPORT_FUNC (_restgpr_20_x) (void); ++void EXPORT_FUNC (_restgpr_21_x) (void); ++void EXPORT_FUNC (_restgpr_22_x) (void); ++void EXPORT_FUNC (_restgpr_23_x) (void); ++void EXPORT_FUNC (_restgpr_24_x) (void); ++void EXPORT_FUNC (_restgpr_25_x) (void); ++void EXPORT_FUNC (_restgpr_26_x) (void); ++void EXPORT_FUNC (_restgpr_27_x) (void); ++void EXPORT_FUNC (_restgpr_28_x) (void); ++void EXPORT_FUNC (_restgpr_29_x) (void); ++void EXPORT_FUNC (_restgpr_30_x) (void); ++void EXPORT_FUNC (_restgpr_31_x) (void); ++void EXPORT_FUNC (_savegpr_14) (void); ++void EXPORT_FUNC (_savegpr_15) (void); ++void EXPORT_FUNC (_savegpr_16) (void); ++void EXPORT_FUNC (_savegpr_17) (void); ++void EXPORT_FUNC (_savegpr_18) (void); ++void EXPORT_FUNC (_savegpr_19) (void); ++void EXPORT_FUNC (_savegpr_20) (void); ++void EXPORT_FUNC (_savegpr_21) (void); ++void EXPORT_FUNC (_savegpr_22) (void); ++void EXPORT_FUNC (_savegpr_23) (void); ++void EXPORT_FUNC (_savegpr_24) (void); ++void EXPORT_FUNC (_savegpr_25) (void); ++void EXPORT_FUNC (_savegpr_26) (void); ++void EXPORT_FUNC (_savegpr_27) (void); ++void EXPORT_FUNC (_savegpr_28) (void); ++void EXPORT_FUNC (_savegpr_29) (void); ++void EXPORT_FUNC (_savegpr_30) (void); ++void EXPORT_FUNC (_savegpr_31) (void); ++ ++#endif ++ ++#if defined (__powerpc__) || defined(__mips__) || defined (__arm__) ++ ++int ++EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); ++ ++grub_uint64_t ++EXPORT_FUNC(__ashldi3) (grub_uint64_t u, int b); ++ ++grub_uint64_t ++EXPORT_FUNC(__ashrdi3) (grub_uint64_t u, int b); ++ ++grub_uint64_t ++EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); ++#endif ++ ++#if defined (__powerpc__) || defined(__mips__) || defined(__sparc__) || defined (__arm__) ++grub_uint32_t ++EXPORT_FUNC(__bswapsi2) (grub_uint32_t u); ++ ++grub_uint64_t ++EXPORT_FUNC(__bswapdi2) (grub_uint64_t u); ++#endif ++ ++#if defined (__APPLE__) && defined(__i386__) ++#define GRUB_BUILTIN_ATTR __attribute__ ((regparm(0))) ++#else ++#define GRUB_BUILTIN_ATTR ++#endif ++ ++/* Prototypes for aliases. */ ++int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); ++void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); ++void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); ++void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); ++ ++#ifdef __APPLE__ ++void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n); ++#endif ++ ++#if defined (__MINGW32__) || defined (__CYGWIN__) ++void EXPORT_FUNC (__register_frame_info) (void); ++void EXPORT_FUNC (__deregister_frame_info) (void); ++void EXPORT_FUNC (___chkstk_ms) (void); ++void EXPORT_FUNC (__chkstk_ms) (void); ++#endif ++ ++#endif ++ +diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h +deleted file mode 100644 +index 8e93b67..0000000 +--- a/include/grub/libgcc.h ++++ /dev/null +@@ -1,91 +0,0 @@ +-/* +- * GRUB -- GRand Unified Bootloader +- * Copyright (C) 2004,2007,2009 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 . +- */ +- +-/* We need to include config-util.h.in for HAVE_*. */ +-#ifndef __STDC_VERSION__ +-#define __STDC_VERSION__ 0 +-#endif +-#include +- +-/* On x86 these functions aren't really needed. Save some space. */ +-#if !defined (__i386__) && !defined (__x86_64__) +-# ifdef HAVE___ASHLDI3 +-void EXPORT_FUNC (__ashldi3) (void); +-# endif +-# ifdef HAVE___ASHRDI3 +-void EXPORT_FUNC (__ashrdi3) (void); +-# endif +-# ifdef HAVE___LSHRDI3 +-void EXPORT_FUNC (__lshrdi3) (void); +-# endif +-# ifdef HAVE___UCMPDI2 +-void EXPORT_FUNC (__ucmpdi2) (void); +-# endif +-# ifdef HAVE___BSWAPSI2 +-void EXPORT_FUNC (__bswapsi2) (void); +-# endif +-# ifdef HAVE___BSWAPDI2 +-void EXPORT_FUNC (__bswapdi2) (void); +-# endif +-#endif +- +-#ifdef HAVE__RESTGPR_14_X +-void EXPORT_FUNC (_restgpr_14_x) (void); +-void EXPORT_FUNC (_restgpr_15_x) (void); +-void EXPORT_FUNC (_restgpr_16_x) (void); +-void EXPORT_FUNC (_restgpr_17_x) (void); +-void EXPORT_FUNC (_restgpr_18_x) (void); +-void EXPORT_FUNC (_restgpr_19_x) (void); +-void EXPORT_FUNC (_restgpr_20_x) (void); +-void EXPORT_FUNC (_restgpr_21_x) (void); +-void EXPORT_FUNC (_restgpr_22_x) (void); +-void EXPORT_FUNC (_restgpr_23_x) (void); +-void EXPORT_FUNC (_restgpr_24_x) (void); +-void EXPORT_FUNC (_restgpr_25_x) (void); +-void EXPORT_FUNC (_restgpr_26_x) (void); +-void EXPORT_FUNC (_restgpr_27_x) (void); +-void EXPORT_FUNC (_restgpr_28_x) (void); +-void EXPORT_FUNC (_restgpr_29_x) (void); +-void EXPORT_FUNC (_restgpr_30_x) (void); +-void EXPORT_FUNC (_restgpr_31_x) (void); +-void EXPORT_FUNC (_savegpr_14) (void); +-void EXPORT_FUNC (_savegpr_15) (void); +-void EXPORT_FUNC (_savegpr_16) (void); +-void EXPORT_FUNC (_savegpr_17) (void); +-void EXPORT_FUNC (_savegpr_18) (void); +-void EXPORT_FUNC (_savegpr_19) (void); +-void EXPORT_FUNC (_savegpr_20) (void); +-void EXPORT_FUNC (_savegpr_21) (void); +-void EXPORT_FUNC (_savegpr_22) (void); +-void EXPORT_FUNC (_savegpr_23) (void); +-void EXPORT_FUNC (_savegpr_24) (void); +-void EXPORT_FUNC (_savegpr_25) (void); +-void EXPORT_FUNC (_savegpr_26) (void); +-void EXPORT_FUNC (_savegpr_27) (void); +-void EXPORT_FUNC (_savegpr_28) (void); +-void EXPORT_FUNC (_savegpr_29) (void); +-void EXPORT_FUNC (_savegpr_30) (void); +-void EXPORT_FUNC (_savegpr_31) (void); +-#endif +- +-#if defined (__arm__) +-void EXPORT_FUNC (__aeabi_lasr) (void); +-void EXPORT_FUNC (__aeabi_llsl) (void); +-void EXPORT_FUNC (__aeabi_llsr) (void); +-void EXPORT_FUNC (__aeabi_ulcmp) (void); +-#endif +diff --git a/include/grub/misc.h b/include/grub/misc.h +index a05b3fd..2a9f87c 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -71,12 +71,6 @@ grub_memcpy (void *dest, const void *src, grub_size_t n) + return grub_memmove (dest, src, n); + } + +-#if defined (__APPLE__) && defined(__i386__) && !defined (GRUB_UTIL) +-#define GRUB_BUILTIN_ATTR __attribute__ ((regparm(0))) +-#else +-#define GRUB_BUILTIN_ATTR +-#endif +- + #if defined(__x86_64__) && !defined (GRUB_UTIL) + #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (__MINGW64__) + #define GRUB_ASM_ATTR __attribute__ ((sysv_abi)) +@@ -85,19 +79,6 @@ grub_memcpy (void *dest, const void *src, grub_size_t n) + #endif + #endif + +-/* Prototypes for aliases. */ +-#ifndef GRUB_UTIL +-int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); +-void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); +-void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); +-void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); +- +-#ifdef __APPLE__ +-void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n); +-#endif +- +-#endif +- + int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); + int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); + int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); +@@ -378,6 +359,7 @@ grub_int64_t + EXPORT_FUNC_IF_SOFTDIV(grub_divmod64s) (grub_int64_t n, + grub_int64_t d, + grub_int64_t *r); ++ + grub_uint32_t + EXPORT_FUNC_IF_SOFTDIV (grub_divmod32) (grub_uint32_t n, + grub_uint32_t d, +@@ -388,41 +370,6 @@ EXPORT_FUNC_IF_SOFTDIV (grub_divmod32s) (grub_int32_t n, + grub_int32_t d, + grub_int32_t *r); + +-#if defined(GRUB_DIVISION_IN_SOFTWARE) && GRUB_DIVISION_IN_SOFTWARE +- +-grub_uint32_t +-EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); +- +-grub_uint32_t +-EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); +- +-grub_int32_t +-EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); +- +-grub_int32_t +-EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); +- +-grub_int64_t +-EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); +- +-grub_int64_t +-EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); +- +-grub_uint64_t +-EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); +- +-grub_uint64_t +-EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); +- +-#endif +- +-#if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL) +-void EXPORT_FUNC (__register_frame_info) (void); +-void EXPORT_FUNC (__deregister_frame_info) (void); +-void EXPORT_FUNC (___chkstk_ms) (void); +-void EXPORT_FUNC (__chkstk_ms) (void); +-#endif +- + /* Inline functions. */ + + static inline char * +@@ -491,50 +438,6 @@ grub_error_load (const struct grub_error_saved *save) + grub_errno = save->grub_errno; + } + +-#ifndef GRUB_UTIL +- +-#if defined (__arm__) +- +-#endif +- +-#if defined (__sparc__) || defined (__powerpc__) +-unsigned +-EXPORT_FUNC (__ctzdi2) (grub_uint64_t x); +-#define NEED_CTZDI2 1 +-#endif +- +-#if defined (__mips__) || defined (__arm__) +-unsigned +-EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); +-#define NEED_CTZSI2 1 +-#endif +- +-#ifdef __arm__ +-grub_uint32_t +-EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); +-grub_int32_t +-EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); +-grub_uint32_t +-EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); +-grub_int32_t +-EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); +- +-/* Needed for allowing modules to be compiled as thumb. */ +-grub_uint64_t +-EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); +-grub_uint64_t +-EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); +- +-void * +-EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); +-void * +-EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); +- +-#endif +- +-#endif /* GRUB_UTIL */ +- +- + #if BOOT_TIME_STATS + struct grub_boot_time + { +diff --git a/include/grub/xen.h b/include/grub/xen.h +index 6035d1a..9ba3b8e 100644 +--- a/include/grub/xen.h ++++ b/include/grub/xen.h +@@ -21,6 +21,8 @@ + + #define __XEN_INTERFACE_VERSION__ 0x0003020a + ++#define memset grub_memset ++ + #ifdef ASM_FILE + #define __ASSEMBLY__ + #include +-- +2.4.3 + diff --git a/0352-configure.ac-Remove-unused-COND_clang.patch b/0352-configure.ac-Remove-unused-COND_clang.patch new file mode 100644 index 0000000..1b6997d --- /dev/null +++ b/0352-configure.ac-Remove-unused-COND_clang.patch @@ -0,0 +1,24 @@ +From 9f95d12153098f8b3e4c34ad106c6402cd4dc0ff Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 3 Mar 2015 20:49:48 +0100 +Subject: [PATCH 352/506] configure.ac: Remove unused COND_clang + +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index be980ad..16fa0da 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1759,7 +1759,6 @@ AC_SUBST(BUILD_LIBM) + + AM_CONDITIONAL([COND_real_platform], [test x$platform != xnone]) + AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) +-AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang = xyes]) + AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) + AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi]) + AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi]) +-- +2.4.3 + diff --git a/0353-Remove-emu-libusb-support.patch b/0353-Remove-emu-libusb-support.patch new file mode 100644 index 0000000..79e898d --- /dev/null +++ b/0353-Remove-emu-libusb-support.patch @@ -0,0 +1,420 @@ +From 9d25b0da9a8cce9b3766f4e1b449d7936d5ba124 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Tue, 3 Mar 2015 20:59:36 +0100 +Subject: [PATCH 353/506] Remove emu libusb support. + +It's disabled by default and has been broken for a long time. +As nobody is interested in fixing and maintaining it, remove it. +--- + configure.ac | 44 ---------- + gentpl.py | 2 +- + grub-core/Makefile.am | 3 - + grub-core/Makefile.core.def | 14 --- + grub-core/bus/usb/emu/usb.c | 203 -------------------------------------------- + include/grub/libusb.h | 29 ------- + 6 files changed, 1 insertion(+), 294 deletions(-) + delete mode 100644 grub-core/bus/usb/emu/usb.c + delete mode 100644 include/grub/libusb.h + +diff --git a/configure.ac b/configure.ac +index 16fa0da..2200776 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1255,10 +1255,6 @@ else + fi + AC_SUBST([BOOT_TIME_STATS]) + +-AC_ARG_ENABLE([grub-emu-usb], +- [AS_HELP_STRING([--enable-grub-emu-usb], +- [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) +- + AC_ARG_ENABLE([grub-emu-sdl], + [AS_HELP_STRING([--enable-grub-emu-sdl], + [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) +@@ -1269,34 +1265,6 @@ AC_ARG_ENABLE([grub-emu-pci], + + if test "$platform" = emu; then + +-if test x"$enable_grub_emu_usb" != xyes ; then +- grub_emu_usb_excuse="not enabled" +-fi +- +-if test x"$enable_grub_emu_pci" = xyes ; then +- grub_emu_usb_excuse="conflicts with PCI support" +-fi +- +-[if [ x"$grub_emu_usb_excuse" = x ]; then +- # Check for libusb libraries.] +-AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], +- [grub_emu_usb_excuse=["need libusb library"]]) +- AC_SUBST([LIBUSB]) +-[fi] +-[if [ x"$grub_emu_usb_excuse" = x ]; then +- # Check for headers.] +- AC_CHECK_HEADERS([usb.h], [], +- [grub_emu_usb_excuse=["need libusb headers"]]) +-[fi] +-if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then +- AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled ($grub_emu_usb_excuse)]) +-fi +-if test x"$grub_emu_usb_excuse" = x ; then +-enable_grub_emu_usb=yes +-else +-enable_grub_emu_usb=no +-fi +- + if test x"$enable_grub_emu_sdl" = xno ; then + grub_emu_sdl_excuse="explicitly disabled" + fi +@@ -1326,10 +1294,6 @@ if test x"$enable_grub_emu_pci" != xyes ; then + grub_emu_pci_excuse="not enabled" + fi + +-if test x"$enable_grub_emu_usb" = xyes ; then +- grub_emu_pci_excuse="conflicts with USB support" +-fi +- + [if [ x"$grub_emu_pci_excuse" = x ]; then + # Check for libpci libraries.] + AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], +@@ -1350,14 +1314,12 @@ enable_grub_emu_pci=no + fi + + AC_SUBST([enable_grub_emu_sdl]) +-AC_SUBST([enable_grub_emu_usb]) + AC_SUBST([enable_grub_emu_pci]) + + else + + # Ignore --enable-emu-* if platform is not emu + enable_grub_emu_sdl=no +-enable_grub_emu_usb=no + enable_grub_emu_pci=no + fi + +@@ -1793,7 +1755,6 @@ AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu]) + AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos]) + + AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x]) +-AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes]) + AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) + AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) + AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) +@@ -1871,11 +1832,6 @@ echo "*******************************************************" + echo GRUB2 will be compiled with following components: + echo Platform: "$target_cpu"-"$platform" + if [ x"$platform" = xemu ]; then +-if [ x"$grub_emu_usb_excuse" = x ]; then +-echo USB support for grub-emu: Yes +-else +-echo USB support for grub-emu: No "($grub_emu_usb_excuse)" +-fi + if [ x"$grub_emu_sdl_excuse" = x ]; then + echo SDL support for grub-emu: Yes + else +diff --git a/gentpl.py b/gentpl.py +index d2aa035..f177883 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -606,7 +606,7 @@ def foreach_enabled_platform(defn, closure): + # enable = emu; + # enable = i386; + # enable = mips_loongson; +-# emu_condition = COND_GRUB_EMU_USB; ++# emu_condition = COND_GRUB_EMU_SDL; + # }; + # + def under_platform_specific_conditionals(defn, platform, closure): +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 57c0b64..af0c7f4 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -250,9 +250,6 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h + if COND_GRUB_EMU_SDL + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h + endif +-if COND_GRUB_EMU_USB +-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libusb.h +-endif + if COND_GRUB_EMU_PCI + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libpciaccess.h + endif +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 7a6fa21..8eaae45 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -512,13 +512,6 @@ module = { + }; + + module = { +- name = libusb; +- emu = bus/usb/emu/usb.c; +- enable = emu; +- condition = COND_GRUB_EMU_USB; +-}; +- +-module = { + name = lsspd; + mips_loongson = commands/mips/loongson/lsspd.c; + enable = mips_loongson; +@@ -533,13 +526,6 @@ module = { + }; + + module = { +- name = emuusb; +- common = bus/usb/usb.c; +- enable = emu; +- condition = COND_GRUB_EMU_USB; +-}; +- +-module = { + name = usbserial_common; + common = bus/usb/serial/common.c; + enable = usb; +diff --git a/grub-core/bus/usb/emu/usb.c b/grub-core/bus/usb/emu/usb.c +deleted file mode 100644 +index 3ad2fc3..0000000 +--- a/grub-core/bus/usb/emu/usb.c ++++ /dev/null +@@ -1,203 +0,0 @@ +-/* usb.c -- libusb USB support for GRUB. */ +-/* +- * GRUB -- GRand Unified Bootloader +- * Copyright (C) 2008 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 +- +-GRUB_MOD_LICENSE ("GPLv3+"); +- +- +-static struct grub_usb_controller_dev usb_controller = +-{ +- .name = "libusb" +-}; +- +-static struct grub_usb_device *grub_usb_devs[128]; +- +-struct usb_bus *busses; +- +-static grub_err_t +-grub_libusb_devices (void) +- +-{ +- struct usb_bus *bus; +- int last = 0; +- +- busses = usb_get_busses(); +- +- for (bus = busses; bus; bus = bus->next) +- { +- struct usb_device *usbdev; +- struct grub_usb_device *dev; +- +- for (usbdev = bus->devices; usbdev; usbdev = usbdev->next) +- { +- struct usb_device_descriptor *desc = &usbdev->descriptor; +- grub_err_t err; +- +- if (! desc->bcdUSB) +- continue; +- +- dev = grub_malloc (sizeof (*dev)); +- if (! dev) +- return grub_errno; +- +- dev->data = usbdev; +- +- /* Fill in all descriptors. */ +- err = grub_usb_device_initialize (dev); +- if (err) +- { +- grub_errno = GRUB_ERR_NONE; +- continue; +- } +- +- /* Register the device. */ +- grub_usb_devs[last++] = dev; +- } +- } +- +- return GRUB_USB_ERR_NONE; +-} +- +-void +-grub_usb_poll_devices (void) +-{ +- /* TODO: recheck grub_usb_devs */ +-} +- +- +-int +-grub_usb_iterate (grub_usb_iterate_hook_t hook, void *hook_data) +-{ +- int i; +- +- for (i = 0; i < 128; i++) +- { +- if (grub_usb_devs[i]) +- { +- if (hook (grub_usb_devs[i], hook_data)) +- return 1; +- } +- } +- +- return 0; +-} +- +-grub_usb_err_t +-grub_usb_root_hub (grub_usb_controller_t controller __attribute__((unused))) +-{ +- return GRUB_USB_ERR_NONE; +-} +- +-grub_usb_err_t +-grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype, +- grub_uint8_t request, grub_uint16_t value, +- grub_uint16_t idx, grub_size_t size, char *data) +-{ +- usb_dev_handle *devh; +- struct usb_device *d = dev->data; +- +- devh = usb_open (d); +- if (usb_control_msg (devh, reqtype, request, +- value, idx, data, size, 20) < 0) +- { +- usb_close (devh); +- return GRUB_USB_ERR_STALL; +- } +- +- usb_close (devh); +- +- return GRUB_USB_ERR_NONE; +-} +- +-grub_usb_err_t +-grub_usb_bulk_read (grub_usb_device_t dev, +- int endpoint, grub_size_t size, char *data) +-{ +- usb_dev_handle *devh; +- struct usb_device *d = dev->data; +- +- devh = usb_open (d); +- if (usb_claim_interface (devh, 0) < 1) +- { +- usb_close (devh); +- return GRUB_USB_ERR_STALL; +- } +- +- if (usb_bulk_read (devh, endpoint, data, size, 20) < 1) +- { +- usb_close (devh); +- return GRUB_USB_ERR_STALL; +- } +- +- usb_release_interface (devh, 0); +- usb_close (devh); +- +- return GRUB_USB_ERR_NONE; +-} +- +-grub_usb_err_t +-grub_usb_bulk_write (grub_usb_device_t dev, +- int endpoint, grub_size_t size, char *data) +-{ +- usb_dev_handle *devh; +- struct usb_device *d = dev->data; +- +- devh = usb_open (d); +- if (usb_claim_interface (devh, 0) < 0) +- goto fail; +- +- if (usb_bulk_write (devh, endpoint, data, size, 20) < 0) +- goto fail; +- +- if (usb_release_interface (devh, 0) < 0) +- goto fail; +- +- usb_close (devh); +- +- return GRUB_USB_ERR_NONE; +- +- fail: +- usb_close (devh); +- return GRUB_USB_ERR_STALL; +-} +- +-GRUB_MOD_INIT (libusb) +-{ +- usb_init(); +- usb_find_busses(); +- usb_find_devices(); +- +- if (grub_libusb_devices ()) +- return; +- +- grub_usb_controller_dev_register (&usb_controller); +- +- return; +-} +- +-GRUB_MOD_FINI (libusb) +-{ +- return; +-} +diff --git a/include/grub/libusb.h b/include/grub/libusb.h +deleted file mode 100644 +index 26548bc..0000000 +--- a/include/grub/libusb.h ++++ /dev/null +@@ -1,29 +0,0 @@ +-/* +- * GRUB -- GRand Unified Bootloader +- * Copyright (C) 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 . +- */ +- +-void EXPORT_FUNC (usb_bulk_write) (void); +-void EXPORT_FUNC (usb_find_busses) (void); +-void EXPORT_FUNC (usb_init) (void); +-void EXPORT_FUNC (usb_find_devices) (void); +-void EXPORT_FUNC (usb_open) (void); +-void EXPORT_FUNC (usb_get_busses) (void); +-void EXPORT_FUNC (usb_control_msg) (void); +-void EXPORT_FUNC (usb_release_interface) (void); +-void EXPORT_FUNC (usb_close) (void); +-void EXPORT_FUNC (usb_bulk_read) (void); +-void EXPORT_FUNC (usb_claim_interface) (void); +-- +2.4.3 + diff --git a/0354-Fix-canonicalize_file_name-clash.patch b/0354-Fix-canonicalize_file_name-clash.patch new file mode 100644 index 0000000..e9f229a --- /dev/null +++ b/0354-Fix-canonicalize_file_name-clash.patch @@ -0,0 +1,381 @@ +From 27d1a67f8a99e62b0900c68198477143f5bfbaa5 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 4 Mar 2015 01:00:19 +0100 +Subject: [PATCH 354/506] Fix canonicalize_file_name clash. + +canonicalize_file_name clashed with gnulib function. Additionally +it was declared in 2 places: emu/misc.h and util/misc.h. Added +grub_ prefix and removed second declaration. +--- + grub-core/bus/emu/pci.c | 7 ++++--- + grub-core/kern/emu/hostdisk.c | 4 ++-- + grub-core/osdep/aros/hostdisk.c | 2 +- + grub-core/osdep/unix/getroot.c | 4 ++-- + grub-core/osdep/unix/hostdisk.c | 2 +- + grub-core/osdep/unix/relpath.c | 2 +- + grub-core/osdep/windows/hostdisk.c | 2 +- + grub-core/osdep/windows/init.c | 2 +- + include/grub/emu/misc.h | 3 +-- + include/grub/util/misc.h | 2 +- + util/getroot.c | 2 +- + util/grub-file.c | 2 +- + util/grub-fstest.c | 2 +- + util/grub-install.c | 4 ++-- + util/grub-macbless.c | 2 +- + util/grub-mount.c | 2 +- + util/grub-probe.c | 2 +- + util/grub-syslinux2cfg.c | 6 +++--- + util/probe.c | 6 +++--- + util/render-label.c | 2 +- + 20 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/grub-core/bus/emu/pci.c b/grub-core/bus/emu/pci.c +index 9d32963..663e554 100644 +--- a/grub-core/bus/emu/pci.c ++++ b/grub-core/bus/emu/pci.c +@@ -55,7 +55,8 @@ grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, + int err; + err = pci_device_map_range (dev, base, size, PCI_DEV_MAP_FLAG_WRITABLE, &addr); + if (err) +- grub_util_error ("mapping 0x%x failed (error %d)\n", base, err); ++ grub_util_error ("mapping 0x%llx failed (error %d)\n", ++ (unsigned long long) base, err); + return addr; + } + +@@ -66,12 +67,12 @@ grub_pci_device_unmap_range (grub_pci_device_t dev, void *mem, + pci_device_unmap_range (dev, mem, size); + } + +-GRUB_MOD_INIT (pci) ++GRUB_MOD_INIT (emupci) + { + pci_system_init (); + } + +-GRUB_MOD_FINI (pci) ++GRUB_MOD_FINI (emupci) + { + pci_system_cleanup (); + } +diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c +index a4ebf78..a3b00c8 100644 +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -184,7 +184,7 @@ grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add) + unsigned int i; + char *canon; + +- canon = canonicalize_file_name (os_disk); ++ canon = grub_canonicalize_file_name (os_disk); + if (!canon) + canon = xstrdup (os_disk); + +@@ -535,7 +535,7 @@ read_device_map (const char *dev_map) + /* On Linux, the devfs uses symbolic links horribly, and that + confuses the interface very much, so use realpath to expand + symbolic links. */ +- map[drive].device = canonicalize_file_name (p); ++ map[drive].device = grub_canonicalize_file_name (p); + if (! map[drive].device) + map[drive].device = xstrdup (p); + +diff --git a/grub-core/osdep/aros/hostdisk.c b/grub-core/osdep/aros/hostdisk.c +index e1eeea7..7d99b54 100644 +--- a/grub-core/osdep/aros/hostdisk.c ++++ b/grub-core/osdep/aros/hostdisk.c +@@ -61,7 +61,7 @@ + static ULONG *bounce; + + char * +-canonicalize_file_name (const char *path) ++grub_canonicalize_file_name (const char *path) + { + char *ret; + BPTR lck; +diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c +index 10fb56a..ccee7ce 100644 +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -491,7 +491,7 @@ grub_guess_root_devices (const char *dir_in) + char **os_dev = NULL; + struct stat st; + dev_t dev; +- char *dir = canonicalize_file_name (dir_in); ++ char *dir = grub_canonicalize_file_name (dir_in); + + if (!dir) + grub_util_error (_("failed to get canonical path of `%s'"), dir_in); +@@ -516,7 +516,7 @@ grub_guess_root_devices (const char *dir_in) + *cur = tmp; + else + { +- *cur = canonicalize_file_name (tmp); ++ *cur = grub_canonicalize_file_name (tmp); + if (*cur == NULL) + grub_util_error (_("failed to get canonical path of `%s'"), tmp); + free (tmp); +diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c +index b3bc0e4..2a8c588 100644 +--- a/grub-core/osdep/unix/hostdisk.c ++++ b/grub-core/osdep/unix/hostdisk.c +@@ -198,7 +198,7 @@ grub_util_fd_close (grub_util_fd_t fd) + } + + char * +-canonicalize_file_name (const char *path) ++grub_canonicalize_file_name (const char *path) + { + #if defined (PATH_MAX) + char *ret; +diff --git a/grub-core/osdep/unix/relpath.c b/grub-core/osdep/unix/relpath.c +index 71c19d8..8fdc3a7 100644 +--- a/grub-core/osdep/unix/relpath.c ++++ b/grub-core/osdep/unix/relpath.c +@@ -44,7 +44,7 @@ grub_make_system_path_relative_to_its_root (const char *path) + char *poolfs = NULL; + + /* canonicalize. */ +- p = canonicalize_file_name (path); ++ p = grub_canonicalize_file_name (path); + if (p == NULL) + grub_util_error (_("failed to get canonical path of `%s'"), path); + +diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c +index d390b25..85507af 100644 +--- a/grub-core/osdep/windows/hostdisk.c ++++ b/grub-core/osdep/windows/hostdisk.c +@@ -328,7 +328,7 @@ grub_util_fd_strerror (void) + } + + char * +-canonicalize_file_name (const char *path) ++grub_canonicalize_file_name (const char *path) + { + char *ret; + LPTSTR windows_path; +diff --git a/grub-core/osdep/windows/init.c b/grub-core/osdep/windows/init.c +index 98c325c..e8ffd62 100644 +--- a/grub-core/osdep/windows/init.c ++++ b/grub-core/osdep/windows/init.c +@@ -170,7 +170,7 @@ grub_util_host_init (int *argc __attribute__ ((unused)), + #error "Unsupported TCHAR size" + #endif + +- grub_util_base_directory = canonicalize_file_name ((*argv)[0]); ++ grub_util_base_directory = grub_canonicalize_file_name ((*argv)[0]); + if (!grub_util_base_directory) + grub_util_base_directory = xstrdup ((*argv)[0]); + for (ptr = grub_util_base_directory + strlen (grub_util_base_directory) - 1; +diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h +index a588ba2..df6085b 100644 +--- a/include/grub/emu/misc.h ++++ b/include/grub/emu/misc.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + extern int verbosity; + extern const char *program_name; +@@ -61,8 +62,6 @@ void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format + + grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); + +-extern char * canonicalize_file_name (const char *path); +- + #ifdef HAVE_DEVICE_MAPPER + int grub_device_mapper_supported (void); + #endif +diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h +index 192874d..e9e0a67 100644 +--- a/include/grub/util/misc.h ++++ b/include/grub/util/misc.h +@@ -41,7 +41,7 @@ void grub_util_write_image_at (const void *img, size_t size, off_t offset, + + char *make_system_path_relative_to_its_root (const char *path); + +-char *canonicalize_file_name (const char *path); ++char *grub_canonicalize_file_name (const char *path); + + void grub_util_init_nls (void); + +diff --git a/util/getroot.c b/util/getroot.c +index 3c1f12d..36f1730 100644 +--- a/util/getroot.c ++++ b/util/getroot.c +@@ -406,7 +406,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) + os_dev); + grub_errno = GRUB_ERR_NONE; + +- canon = canonicalize_file_name (os_dev); ++ canon = grub_canonicalize_file_name (os_dev); + drive = grub_hostdisk_os_dev_to_grub_drive (canon ? : os_dev, 1); + if (canon) + free (canon); +diff --git a/util/grub-file.c b/util/grub-file.c +index 9989dfe..50c18b6 100644 +--- a/util/grub-file.c ++++ b/util/grub-file.c +@@ -77,7 +77,7 @@ main (int argc, char *argv[]) + } + if (had_file) + grub_util_error ("one argument expected"); +- argv2[i - 1] = canonicalize_file_name (argv[i]); ++ argv2[i - 1] = grub_canonicalize_file_name (argv[i]); + if (!argv2[i - 1]) + { + grub_util_error (_("cannot open `%s': %s"), argv[i], +diff --git a/util/grub-fstest.c b/util/grub-fstest.c +index 02cd3e3..a358ae4 100644 +--- a/util/grub-fstest.c ++++ b/util/grub-fstest.c +@@ -651,7 +651,7 @@ argp_parser (int key, char *arg, struct argp_state *state) + { + if (args_count == 0) + images = xmalloc (num_disks * sizeof (images[0])); +- images[args_count] = canonicalize_file_name (arg); ++ images[args_count] = grub_canonicalize_file_name (arg); + args_count++; + return 0; + } +diff --git a/util/grub-install.c b/util/grub-install.c +index cedc188..7b394c9 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -967,7 +967,7 @@ main (int argc, char *argv[]) + { + char * t = grub_util_path_concat (2, bootdir, GRUB_DIR_NAME); + grub_install_mkdir_p (t); +- grubdir = canonicalize_file_name (t); ++ grubdir = grub_canonicalize_file_name (t); + if (!grubdir) + grub_util_error (_("failed to get canonical path of `%s'"), t); + free (t); +@@ -1299,7 +1299,7 @@ main (int argc, char *argv[]) + { + char *t = grub_util_path_concat (2, grubdir, + platname); +- platdir = canonicalize_file_name (t); ++ platdir = grub_canonicalize_file_name (t); + if (!platdir) + grub_util_error (_("failed to get canonical path of `%s'"), + t); +diff --git a/util/grub-macbless.c b/util/grub-macbless.c +index e57e13d..e9b15a0 100644 +--- a/util/grub-macbless.c ++++ b/util/grub-macbless.c +@@ -64,7 +64,7 @@ bless (const char *path, int x86) + grub_err_t err; + struct stat st; + +- grub_path = canonicalize_file_name (path); ++ grub_path = grub_canonicalize_file_name (path); + + if (stat (grub_path, &st) < 0) + grub_util_error (N_("cannot stat `%s': %s"), +diff --git a/util/grub-mount.c b/util/grub-mount.c +index 4626e54..0d0fea5 100644 +--- a/util/grub-mount.c ++++ b/util/grub-mount.c +@@ -547,7 +547,7 @@ argp_parser (int key, char *arg, struct argp_state *state) + } + + images = xrealloc (images, (num_disks + 1) * sizeof (images[0])); +- images[num_disks] = canonicalize_file_name (arg); ++ images[num_disks] = grub_canonicalize_file_name (arg); + num_disks++; + + return 0; +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 8f4aa61..6075cb3 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -262,7 +262,7 @@ probe (const char *path, char **device_names, char delim) + + if (path != NULL) + { +- grub_path = canonicalize_file_name (path); ++ grub_path = grub_canonicalize_file_name (path); + if (! grub_path) + grub_util_error (_("failed to get canonical path of `%s'"), path); + device_names = grub_guess_root_devices (grub_path); +diff --git a/util/grub-syslinux2cfg.c b/util/grub-syslinux2cfg.c +index f4fda6d..85fa0da 100644 +--- a/util/grub-syslinux2cfg.c ++++ b/util/grub-syslinux2cfg.c +@@ -175,7 +175,7 @@ main (int argc, char *argv[]) + grub_host_init (); + + char *t, *inpfull, *rootfull, *res; +- t = canonicalize_file_name (arguments.input); ++ t = grub_canonicalize_file_name (arguments.input); + if (!t) + { + grub_util_error (_("cannot open `%s': %s"), arguments.input, +@@ -185,7 +185,7 @@ main (int argc, char *argv[]) + inpfull = xasprintf ("(host)/%s", t); + free (t); + +- t = canonicalize_file_name (arguments.root ? : "/"); ++ t = grub_canonicalize_file_name (arguments.root ? : "/"); + if (!t) + { + grub_util_error (_("cannot open `%s': %s"), arguments.root, +@@ -206,7 +206,7 @@ main (int argc, char *argv[]) + cwd = xstrdup ("."); + } + +- t = canonicalize_file_name (arguments.cwd ? : cwd); ++ t = grub_canonicalize_file_name (arguments.cwd ? : cwd); + if (!t) + { + grub_util_error (_("cannot open `%s': %s"), arguments.root, +diff --git a/util/probe.c b/util/probe.c +index c389f5d..fa7ca34 100644 +--- a/util/probe.c ++++ b/util/probe.c +@@ -73,7 +73,7 @@ grub_util_guess_bios_drive (const char *orig_path) + { + char *canon; + char *ptr; +- canon = canonicalize_file_name (orig_path); ++ canon = grub_canonicalize_file_name (orig_path); + if (!canon) + return NULL; + ptr = strrchr (orig_path, '/'); +@@ -102,7 +102,7 @@ grub_util_guess_efi_drive (const char *orig_path) + { + char *canon; + char *ptr; +- canon = canonicalize_file_name (orig_path); ++ canon = grub_canonicalize_file_name (orig_path); + if (!canon) + return NULL; + ptr = strrchr (orig_path, '/'); +@@ -131,7 +131,7 @@ grub_util_guess_baremetal_drive (const char *orig_path) + { + char *canon; + char *ptr; +- canon = canonicalize_file_name (orig_path); ++ canon = grub_canonicalize_file_name (orig_path); + if (!canon) + return NULL; + ptr = strrchr (orig_path, '/'); +diff --git a/util/render-label.c b/util/render-label.c +index 39663a8..91c080c 100644 +--- a/util/render-label.c ++++ b/util/render-label.c +@@ -157,7 +157,7 @@ grub_util_render_label (const char *label_font, + ieee1275_palette[cptr].a = 0xff; + + char * t; +- t = canonicalize_file_name (label_font); ++ t = grub_canonicalize_file_name (label_font); + if (!t) + { + grub_util_error (_("cannot open `%s': %s"), label_font, +-- +2.4.3 + diff --git a/0355-configure.ac-Fix-the-name-of-pciaccess-header.patch b/0355-configure.ac-Fix-the-name-of-pciaccess-header.patch new file mode 100644 index 0000000..a4cbaae --- /dev/null +++ b/0355-configure.ac-Fix-the-name-of-pciaccess-header.patch @@ -0,0 +1,25 @@ +From 5959b15c1cf2113999968291e0723337888d4979 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 4 Mar 2015 01:01:45 +0100 +Subject: [PATCH 355/506] configure.ac: Fix the name of pciaccess header. + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 2200776..891c14f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1302,7 +1302,7 @@ fi + [fi] + [if [ x"$grub_emu_pci_excuse" = x ]; then + # Check for headers.] +- AC_CHECK_HEADERS([pci/pci.h], [], ++ AC_CHECK_HEADERS([pciaccess.h], [], + [grub_emu_pci_excuse=["need libpciaccess headers"]]) + [fi] + +-- +2.4.3 + diff --git a/0356-syslinux_parse-Fix-the-case-of-unknown-localboot.patch b/0356-syslinux_parse-Fix-the-case-of-unknown-localboot.patch new file mode 100644 index 0000000..1a1fed1 --- /dev/null +++ b/0356-syslinux_parse-Fix-the-case-of-unknown-localboot.patch @@ -0,0 +1,25 @@ +From dc06aa949b7ff25cec78e6c415a65b444c11d8d9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 4 Mar 2015 14:19:29 +0100 +Subject: [PATCH 356/506] syslinux_parse: Fix the case of unknown localboot. + +Reported by: Jordan Uggla +--- + grub-core/lib/syslinux_parse.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index afc12b5..22389eb 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -945,6 +945,7 @@ write_entry (struct output_buffer *outbuf, + break; + } + print_string (" # UNSUPPORTED localboot type "); ++ print_string ("\ntrue;\n"); + if (print_num (outbuf, n)) + return grub_errno; + print_string ("\n"); +-- +2.4.3 + diff --git a/0357-update-m4-extern-inline.m4-to-upstream-version-to-fi.patch b/0357-update-m4-extern-inline.m4-to-upstream-version-to-fi.patch new file mode 100644 index 0000000..8e612f0 --- /dev/null +++ b/0357-update-m4-extern-inline.m4-to-upstream-version-to-fi.patch @@ -0,0 +1,130 @@ +From 20f21d897858d827210d67c75f42d18887cbce81 Mon Sep 17 00:00:00 2001 +From: Andrey Borzenkov +Date: Thu, 5 Mar 2015 19:25:56 +0300 +Subject: [PATCH 357/506] update m4/extern-inline.m4 to upstream version to fix + compilation on FreeBSD + +In file included from util/grub-mkimage.c:54:0: +./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but +used in inline function '_option_is_short' which is not static +[-Werror] cc1: all warnings being treated as errors gmake[2]: *** +[util/grub_mkimage-grub-mkimage.o] Error 1 + +Update m4/extern-inline.m4 to current upstream gnulib version that +contains fix for this (commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d). + +Reported-By: Beeblebrox +--- + m4/extern-inline.m4 | 71 +++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 53 insertions(+), 18 deletions(-) + +diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 +index 0152f29..e74339a 100644 +--- a/m4/extern-inline.m4 ++++ b/m4/extern-inline.m4 +@@ -1,6 +1,6 @@ + dnl 'extern inline' a la ISO C99. + +-dnl Copyright 2012-2013 Free Software Foundation, Inc. ++dnl Copyright 2012-2015 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation + dnl gives unlimited permission to copy and/or distribute it, + dnl with or without modifications, as long as this notice is preserved. +@@ -8,42 +8,77 @@ dnl with or without modifications, as long as this notice is preserved. + AC_DEFUN([gl_EXTERN_INLINE], + [ + AH_VERBATIM([extern_inline], +-[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. +- _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. +- _GL_INLINE_HEADER_BEGIN contains useful stuff to put +- in an include file, before uses of _GL_INLINE. +- It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, +- when FOO is an inline function in the header; see +- . +- _GL_INLINE_HEADER_END contains useful stuff to put +- in the same include file, after uses of _GL_INLINE. ++[/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + . + +- Suppress the use of extern inline on Apple's platforms, +- as Libc-825.25 (2012-09-19) is incompatible with it; see +- . +- Perhaps Apple will fix this some day. */ ++ Suppress extern inline with Sun C in standards-conformance mode, as it ++ mishandles inline functions that call each other. E.g., for 'inline void f ++ (void) { } inline void g (void) { f (); }', c99 incorrectly complains ++ 'reference to static identifier "f" in extern inline function'. ++ This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. ++ ++ Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) ++ on configurations that mistakenly use 'static inline' to implement ++ functions or macros in standard C headers like . For example, ++ if isdigit is mistakenly implemented via a static inline function, ++ a program containing an extern inline function that calls isdigit ++ may not work since the C standard prohibits extern inline functions ++ from calling static functions. This bug is known to occur on: ++ ++ OS X 10.8 and earlier; see: ++ http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html ++ ++ DragonFly; see ++ http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log ++ ++ FreeBSD; see: ++ http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html ++ ++ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and ++ for clang but remains for g++; see . ++ Assume DragonFly and FreeBSD will be similar. */ ++#if (((defined __APPLE__ && defined __MACH__) \ ++ || defined __DragonFly__ || defined __FreeBSD__) \ ++ && (defined __header_inline \ ++ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ ++ && ! defined __clang__) \ ++ : ((! defined _DONT_USE_CTYPE_INLINE_ \ ++ && (defined __GNUC__ || defined __cplusplus)) \ ++ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ ++ && defined __GNUC__ && ! defined __cplusplus)))) ++# define _GL_EXTERN_INLINE_STDHEADER_BUG ++#endif + #if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ +- : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \ +- && !defined __APPLE__) ++ : (199901L <= __STDC_VERSION__ \ ++ && !defined __HP_cc \ ++ && !(defined __SUNPRO_C && __STDC__))) \ ++ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) + # define _GL_INLINE inline + # define _GL_EXTERN_INLINE extern inline +-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__ +-# if __GNUC_GNU_INLINE__ ++# define _GL_EXTERN_INLINE_IN_USE ++#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ ++ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) ++# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ + # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) + # else + # define _GL_INLINE extern inline + # endif + # define _GL_EXTERN_INLINE extern ++# define _GL_EXTERN_INLINE_IN_USE + #else + # define _GL_INLINE static _GL_UNUSED + # define _GL_EXTERN_INLINE static _GL_UNUSED + #endif + ++/* In GCC, suppress bogus "no previous prototype for 'FOO'" ++ and "no previous declaration for 'FOO'" diagnostics, ++ when FOO is an inline function in the header; see ++ and ++ . */ + #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) + # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ + # define _GL_INLINE_HEADER_CONST_PRAGMA +-- +2.4.3 + diff --git a/0358-update-gnulib-argp-help.c-to-fix-garbage-in-grub-mkn.patch b/0358-update-gnulib-argp-help.c-to-fix-garbage-in-grub-mkn.patch new file mode 100644 index 0000000..293bacd --- /dev/null +++ b/0358-update-gnulib-argp-help.c-to-fix-garbage-in-grub-mkn.patch @@ -0,0 +1,65 @@ +From 8842991a56f062c6bff03da9c2f7dcffa7e31492 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 5 Mar 2015 20:19:47 +0300 +Subject: [PATCH 358/506] update gnulib/argp-help.c to fix garbage in + grub-mknetdir --help output +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +argp_help attempts to translate empty string, which results in printing +meta information about translation, like in + +bor@opensuse:~/build/grub> grub2-mknetdir --help +ИÑпользование: grub2-mknetdir [ПÐРÐМЕТР…] +Project-Id-Version: grub 2.02-pre2 +Report-Msgid-Bugs-To: bug-grub@gnu.org +... + +Update gnulib/argp-help.c to the current version which fixes this +(commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d). +--- + grub-core/gnulib/argp-help.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/grub-core/gnulib/argp-help.c b/grub-core/gnulib/argp-help.c +index 2914f47..b9be63f 100644 +--- a/grub-core/gnulib/argp-help.c ++++ b/grub-core/gnulib/argp-help.c +@@ -1,5 +1,5 @@ + /* Hierarchical argument parsing help output +- Copyright (C) 1995-2005, 2007, 2009-2013 Free Software Foundation, Inc. ++ Copyright (C) 1995-2005, 2007, 2009-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + +@@ -650,7 +650,7 @@ hol_find_entry (struct hol *hol, const char *name) + return 0; + } + +-/* If an entry with the long option NAME occurs in HOL, set it's special ++/* If an entry with the long option NAME occurs in HOL, set its special + sort position to GROUP. */ + static void + hol_set_group (struct hol *hol, const char *name, int group) +@@ -1507,11 +1507,15 @@ argp_doc (const struct argp *argp, const struct argp_state *state, + if (vt) + { + if (post) +- inp_text = vt + 1; ++ { ++ inp_text = vt + 1; ++ if (! *inp_text) ++ inp_text = 0; ++ } + else + { + inp_text_len = vt - argp->doc; +- inp_text = __strndup (argp->doc, inp_text_len); ++ inp_text = inp_text_len ? __strndup (argp->doc, inp_text_len) : 0; + } + } + else +-- +2.4.3 + diff --git a/0359-autogen.sh-Allow-overriding-the-python-to-be-used-by.patch b/0359-autogen.sh-Allow-overriding-the-python-to-be-used-by.patch new file mode 100644 index 0000000..b9f8e93 --- /dev/null +++ b/0359-autogen.sh-Allow-overriding-the-python-to-be-used-by.patch @@ -0,0 +1,68 @@ +From be41c1cf11313bc433eaad4792f1e5a90d30e5b5 Mon Sep 17 00:00:00 2001 +From: Jon McCune +Date: Fri, 6 Mar 2015 00:33:41 +0100 +Subject: [PATCH 359/506] autogen.sh: Allow overriding the python to be used by + setting $PYTHON. + +Some installations have several python versions installed. Allow user +to choose which one to use by setting $PYTHON. +--- + INSTALL | 3 +++ + autogen.sh | 11 +++++++---- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/INSTALL b/INSTALL +index 846ac38..e5b0811 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -104,6 +104,9 @@ The simplest way to compile this package is: + + 3. Type `./autogen.sh'. + ++ * autogen.sh uses python. By default invocation is "python" but can be ++ overriden by setting variable $PYTHON. ++ + 4. Type `./configure' to configure the package for your system. + If you're using `csh' on an old version of System V, you might + need to type `sh ./configure' instead to prevent `csh' from trying +diff --git a/autogen.sh b/autogen.sh +index 7424428..5020456 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -2,6 +2,9 @@ + + set -e + ++# Set ${PYTHON} to plain 'python' if not set already ++: ${PYTHON:=python} ++ + export LC_COLLATE=C + unset LC_ALL + +@@ -9,10 +12,10 @@ find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './b + find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in + + echo "Importing unicode..." +-python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c ++${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c + + echo "Importing libgcrypt..." +-python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core ++${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core + sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h + if [ -f include/grub/gcrypt/g10lib.h ]; then + rm include/grub/gcrypt/g10lib.h +@@ -54,8 +57,8 @@ for extra in contrib/*/Makefile.core.def; do + fi + done + +-python gentpl.py $UTIL_DEFS > Makefile.util.am +-python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am ++${PYTHON} gentpl.py $UTIL_DEFS > Makefile.util.am ++${PYTHON} gentpl.py $CORE_DEFS > grub-core/Makefile.core.am + + for extra in contrib/*/Makefile.common; do + if test -e "$extra"; then +-- +2.4.3 + diff --git a/0360-hfsplus-Fix-potential-access-to-uninited-memory-on-i.patch b/0360-hfsplus-Fix-potential-access-to-uninited-memory-on-i.patch new file mode 100644 index 0000000..e31cca2 --- /dev/null +++ b/0360-hfsplus-Fix-potential-access-to-uninited-memory-on-i.patch @@ -0,0 +1,84 @@ +From 5fe21c996893b9ef4d22a728b40f75d4b4cd7566 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 6 Mar 2015 22:33:20 +0100 +Subject: [PATCH 360/506] hfsplus: Fix potential access to uninited memory on + invalid FS + +--- + grub-core/fs/hfsplus.c | 6 ++++++ + include/grub/hfsplus.h | 14 +++++++++----- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c +index 8f07f85..110d858 100644 +--- a/grub-core/fs/hfsplus.c ++++ b/grub-core/fs/hfsplus.c +@@ -336,6 +336,9 @@ grub_hfsplus_mount (grub_disk_t disk) + data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) && + (header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE)); + ++ if (data->catalog_tree.nodesize < 2) ++ goto fail; ++ + if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, + sizeof (struct grub_hfsplus_btnode), + sizeof (header), (char *) &header) <= 0) +@@ -350,6 +353,9 @@ grub_hfsplus_mount (grub_disk_t disk) + data->extoverflow_tree.root = grub_be_to_cpu32 (header.root); + data->extoverflow_tree.nodesize = grub_be_to_cpu16 (header.nodesize); + ++ if (data->extoverflow_tree.nodesize < 2) ++ goto fail; ++ + if (grub_hfsplus_read_file (&data->attr_tree.file, 0, 0, + sizeof (struct grub_hfsplus_btnode), + sizeof (header), (char *) &header) <= 0) +diff --git a/include/grub/hfsplus.h b/include/grub/hfsplus.h +index 8ba8f32..117740a 100644 +--- a/include/grub/hfsplus.h ++++ b/include/grub/hfsplus.h +@@ -171,7 +171,7 @@ struct grub_hfsplus_catkey + grub_uint16_t keylen; + grub_uint32_t parent; + grub_uint16_t namelen; +- grub_uint16_t name[30]; ++ grub_uint16_t name[0]; + } GRUB_PACKED; + + /* The on disk layout of an extent overflow file key. */ +@@ -207,12 +207,14 @@ struct grub_hfsplus_btnode + + /* Return the offset of the record with the index INDEX, in the node + NODE which is part of the B+ tree BTREE. */ +-static inline grub_off_t ++static inline grub_uint16_t + grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree, +- struct grub_hfsplus_btnode *node, int index) ++ struct grub_hfsplus_btnode *node, unsigned index) + { + char *cnode = (char *) node; + void *recptr; ++ if (btree->nodesize < index * sizeof (grub_uint16_t) + 2) ++ index = 0; + recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]); + return grub_be_to_cpu16 (grub_get_unaligned16 (recptr)); + } +@@ -221,11 +223,13 @@ grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree, + NODE which is part of the B+ tree BTREE. */ + static inline struct grub_hfsplus_key * + grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree, +- struct grub_hfsplus_btnode *node, int index) ++ struct grub_hfsplus_btnode *node, unsigned index) + { + char *cnode = (char *) node; +- grub_off_t offset; ++ grub_uint16_t offset; + offset = grub_hfsplus_btree_recoffset (btree, node, index); ++ if (offset > btree->nodesize - sizeof (struct grub_hfsplus_key)) ++ offset = 0; + return (struct grub_hfsplus_key *) &cnode[offset]; + } + +-- +2.4.3 + diff --git a/0361-grub-fs-tester-better-estimation-of-filesystem-time-.patch b/0361-grub-fs-tester-better-estimation-of-filesystem-time-.patch new file mode 100644 index 0000000..fd70feb --- /dev/null +++ b/0361-grub-fs-tester-better-estimation-of-filesystem-time-.patch @@ -0,0 +1,54 @@ +From fa07d919d1ff868b18d8a42276d094b63a58e299 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 15 Mar 2015 21:06:26 +0300 +Subject: [PATCH 361/506] grub-fs-tester: better estimation of filesystem time + for LVM/RAID + +Write activity with LVM/RAID can happen after filesystem is unmounted. +In my testing modification time of loop files was 15 - 20 seconds +after unmount. So use time as close to unmount as possible as +reference instead. +--- + tests/util/grub-fs-tester.in | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 9ecbe0f..4f7f920 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -993,6 +993,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + fi + sleep 1; + done ++ UMOUNT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S") + sleep 1 + vgchange -a n grub_test + ;; +@@ -1004,6 +1005,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + fi + sleep 1; + done ++ UMOUNT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S") + sleep 1 + mdadm --stop /dev/md/"${fs}_$NDEVICES" + ;; +@@ -1214,10 +1216,15 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + case x$fs in + xiso9660 | xziso9660 | xrockridge | xjoliet | xrockridge_joliet | xiso9660_1999 | xrockridge_1999 | xjoliet_1999 | xrockridge_joliet_1999) + FSTIME="$(date -d "$(echo ${FSUUID} | awk -F - '{ print $1"-"$2"-"$3" "$4":"$5":"$6 ;}')" '+%Y-%m-%d %H:%M:%S')";; ++ xlvm*|xmdraid*) ++ # With some abstractions like mdraid flushing to disk ++ # may be delayed for a long time. ++ FSTIME="$UMOUNT_TIME";; + *) + FSTIME="$(TZ=UTC ls --time-style="+%Y-%m-%d_%H:%M:%S" -l -d "${FSIMAGES[0]}"|awk '{print $6; }'|sed 's,_, ,g')";; + esac +- # With some abstractions like mdraid it may take up to 2 seconds for the data to reach the disks after it was flushed by FS in these tests. ++ # With some abstractions like mdraid computing of UMOUNT_TIME ++ # is not precise. Account for small difference here. + FSTIMEM1="$(date -d "$FSTIME UTC -1 second" -u "+%Y-%m-%d %H:%M:%S")" + FSTIMEM2="$(date -d "$FSTIME UTC -2 second" -u "+%Y-%m-%d %H:%M:%S")" + +-- +2.4.3 + diff --git a/0362-grub-fs-tester-explicitly-set-segment-type-for-LVM-m.patch b/0362-grub-fs-tester-explicitly-set-segment-type-for-LVM-m.patch new file mode 100644 index 0000000..8a034ea --- /dev/null +++ b/0362-grub-fs-tester-explicitly-set-segment-type-for-LVM-m.patch @@ -0,0 +1,31 @@ +From 7c9309e50a124817e67de38b30c6291acecad560 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 16 Mar 2015 21:16:19 +0300 +Subject: [PATCH 362/506] grub-fs-tester: explicitly set segment type for LVM + mirror + +LVM mirror defaults to RAID1 today and can be different on different +systems as set in lvm.conf. +--- + tests/util/grub-fs-tester.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index 4f7f920..f63ed0b 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -729,9 +729,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + elif [ x$fs = xlvm_stripe ] ; then + lvcreate -l "$((NDEVICES*7*LVMBLKMUL))" -i "$NDEVICES" -n testvol grub_test + elif [ x$fs = xlvm_mirror1 ] ; then +- lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" -n testvol grub_test ++ lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" --type mirror -n testvol grub_test + elif [ x$fs = xlvm_mirrorall ] ; then +- lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL))" -n testvol grub_test ++ lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL))" --type mirror -n testvol grub_test + elif [ x$fs = xlvm_raid4 ] || [ x$fs = xlvm_raid5 ]; then + lvcreate -l "$(((NDEVICES-1) * 5*LVMBLKMUL))" -i "$((NDEVICES-1))" --type "${fs/lvm_/}" -n testvol grub_test + elif [ x$fs = xlvm_raid6 ]; then +-- +2.4.3 + diff --git a/0363-core-add-LVM-RAID1-support.patch b/0363-core-add-LVM-RAID1-support.patch new file mode 100644 index 0000000..d2b2310 --- /dev/null +++ b/0363-core-add-LVM-RAID1-support.patch @@ -0,0 +1,71 @@ +From 527eeeeee6c8d3d8e3bb1fac408d47bb1dcbec95 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 19 Mar 2015 21:30:27 +0300 +Subject: [PATCH 363/506] core: add LVM RAID1 support + +Closes 44534. +--- + grub-core/disk/lvm.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c +index 1e7f197..9b97004 100644 +--- a/grub-core/disk/lvm.c ++++ b/grub-core/disk/lvm.c +@@ -577,13 +577,17 @@ grub_lvm_detect (grub_disk_t disk, + if (is_pvmove) + seg->node_count = 1; + } +- else if (grub_memcmp (p, "raid", sizeof ("raid") - 1) +- == 0 && (p[sizeof ("raid") - 1] >= '4' +- && p[sizeof ("raid") - 1] <= '6') ++ else if (grub_memcmp (p, "raid", sizeof ("raid") - 1) == 0 ++ && ((p[sizeof ("raid") - 1] >= '4' ++ && p[sizeof ("raid") - 1] <= '6') ++ || p[sizeof ("raid") - 1] == '1') + && p[sizeof ("raidX") - 1] == '"') + { + switch (p[sizeof ("raid") - 1]) + { ++ case '1': ++ seg->type = GRUB_DISKFILTER_MIRROR; ++ break; + case '4': + seg->type = GRUB_DISKFILTER_RAID4; + seg->layout = GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC; +@@ -608,16 +612,18 @@ grub_lvm_detect (grub_disk_t disk, + goto lvs_segment_fail; + } + +- seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); +- if (p == NULL) ++ if (seg->type != GRUB_DISKFILTER_MIRROR) + { ++ seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); ++ if (p == NULL) ++ { + #ifdef GRUB_UTIL +- grub_util_info ("unknown stripe_size\n"); ++ grub_util_info ("unknown stripe_size\n"); + #endif +- goto lvs_segment_fail; ++ goto lvs_segment_fail; ++ } + } + +- + seg->nodes = grub_zalloc (sizeof (seg->nodes[0]) + * seg->node_count); + +@@ -625,7 +631,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown mirrors\n"); ++ grub_util_info ("unknown raids\n"); + #endif + goto lvs_segment_fail2; + } +-- +2.4.3 + diff --git a/0364-grub-fs-tester-add-LVM-RAID1-support.patch b/0364-grub-fs-tester-add-LVM-RAID1-support.patch new file mode 100644 index 0000000..e663713 --- /dev/null +++ b/0364-grub-fs-tester-add-LVM-RAID1-support.patch @@ -0,0 +1,75 @@ +From 19c4156d1694e3ab82e412d280d1d6677b711d2c Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 19 Mar 2015 21:31:26 +0300 +Subject: [PATCH 364/506] grub-fs-tester: add LVM RAID1 support + +LVM miscalculates bitmap size with small extent, so start with 16K as +for other RAID types. + +Until version 2.02.103 LVM counts metadata segments twice when checking +available space, reduce segment count by one to account for this bug. +--- + tests/util/grub-fs-tester.in | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index f63ed0b..e9e85c2 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -102,7 +102,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + # OS LIMITATION: Linux oopses with >=32768K + MAXBLKSIZE=$((16384*1024)) + ;; +- x"lvm_raid4" | x"lvm_raid5" | x"lvm_raid6") ++ x"lvm_raid1"* | x"lvm_raid4" | x"lvm_raid5" | x"lvm_raid6") + # OS LIMITATION: Linux crashes with less than 16384 + MINBLKSIZE=16384 + # Could go further but what's the point? +@@ -166,7 +166,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + x"zfs_raidz" | x"zfs_stripe" | x"zfs_mirror" | xbtrfs_raid0 \ + | xbtrfs_raid1 | x"mdraid"*"_raid4" | x"mdraid"*"_raid5" \ + | x"mdraid"*"_linear" \ +- | x"mdraid"*"_raid10" | xlvm_mirror1 | xlvm_mirrorall) ++ | x"mdraid"*"_raid10" | xlvm_raid1* | xlvm_mirror1 | xlvm_mirrorall) + MINDEVICES=2 + MAXDEVICES=7 + ;; +@@ -199,7 +199,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + + case x$fs in + # RAID 1 has to work with even one device of the set. +- xzfs_mirror | x"mdraid"*"_raid1" | xlvm_mirrorall) ++ xzfs_mirror | x"mdraid"*"_raid1" | xlvm_mirrorall | xlvm_raid1all) + NEED_IMAGES_N=1;; + # Degrade raidz by removing 3 devices + xzfs_raidz3) +@@ -210,7 +210,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + # Degrade raidz and btrfs RAID1 by removing one device + xbtrfs_raid1 | xbtrfs_raid10 | xzfs_raidz | x"mdraid"*"_raid4" \ + | x"mdraid"*"_raid5" | x"mdraid"*"_raid10" | xlvm_mirror1 \ +- | x"lvm_raid4" | x"lvm_raid5") ++ | x"lvm_raid1" | x"lvm_raid4" | x"lvm_raid5") + NEED_IMAGES_N=$((NDEVICES-1));; + *) + NEED_IMAGES_N=$NDEVICES;; +@@ -728,10 +728,15 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + + lvcreate -l "$((NDEVICES*7*LVMBLKMUL))" -n testvol grub_test + elif [ x$fs = xlvm_stripe ] ; then + lvcreate -l "$((NDEVICES*7*LVMBLKMUL))" -i "$NDEVICES" -n testvol grub_test +- elif [ x$fs = xlvm_mirror1 ] ; then +- lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" --type mirror -n testvol grub_test ++ elif [ x$fs = xlvm_mirror1 ] || [ x$fs = xlvm_raid1 ] ; then ++ lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" --type "${fs/lvm_/}" -n testvol grub_test + elif [ x$fs = xlvm_mirrorall ] ; then + lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL))" --type mirror -n testvol grub_test ++ elif [ x$fs = xlvm_raid1all ] ; then ++ # Until version 2.02.103 LVM counts metadata segments ++ # twice when checking available space. Reduce segment ++ # count to work around it. ++ lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL - 1))" --type raid1 -n testvol grub_test + elif [ x$fs = xlvm_raid4 ] || [ x$fs = xlvm_raid5 ]; then + lvcreate -l "$(((NDEVICES-1) * 5*LVMBLKMUL))" -i "$((NDEVICES-1))" --type "${fs/lvm_/}" -n testvol grub_test + elif [ x$fs = xlvm_raid6 ]; then +-- +2.4.3 + diff --git a/0365-cacheinfo-Add-missing-license-information.patch b/0365-cacheinfo-Add-missing-license-information.patch new file mode 100644 index 0000000..899d0ef --- /dev/null +++ b/0365-cacheinfo-Add-missing-license-information.patch @@ -0,0 +1,25 @@ +From 9c07daaf917ddbcb738233aa1d3a209b179f3444 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 11:13:58 +0100 +Subject: [PATCH 365/506] cacheinfo: Add missing license information. + +--- + grub-core/commands/cacheinfo.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/commands/cacheinfo.c b/grub-core/commands/cacheinfo.c +index ead6ff8..d34a346 100644 +--- a/grub-core/commands/cacheinfo.c ++++ b/grub-core/commands/cacheinfo.c +@@ -23,6 +23,8 @@ + #include + #include + ++GRUB_MOD_LICENSE ("GPLv3+"); ++ + static grub_err_t + grub_rescue_cmd_info (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), +-- +2.4.3 + diff --git a/0366-grub-mkrescue-pass-all-unrecognized-options-unchange.patch b/0366-grub-mkrescue-pass-all-unrecognized-options-unchange.patch new file mode 100644 index 0000000..3c38ca0 --- /dev/null +++ b/0366-grub-mkrescue-pass-all-unrecognized-options-unchange.patch @@ -0,0 +1,154 @@ +From cf47a2fba5852014bc59959c5e357e8313933414 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 12:55:27 +0100 +Subject: [PATCH 366/506] grub-mkrescue: pass all unrecognized options + unchanged to xorriso. + +--- + util/grub-mkrescue.c | 103 ++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 89 insertions(+), 14 deletions(-) + +diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c +index e02340f..5d3ec0d 100644 +--- a/util/grub-mkrescue.c ++++ b/util/grub-mkrescue.c +@@ -44,9 +44,6 @@ static char *label_color; + static char *label_bgcolor; + static char *product_name; + static char *product_version; +-static int xorriso_tail_argc; +-static int xorriso_tail_arg_alloc; +-static char **xorriso_tail_argv; + static char *output_image; + static char *xorriso; + static char *boot_grub; +@@ -215,16 +212,6 @@ argp_parser (int key, char *arg, struct argp_state *state) + xorriso = xstrdup (arg); + return 0; + +- case ARGP_KEY_ARG: +- if (xorriso_tail_arg_alloc <= xorriso_tail_argc) +- { +- xorriso_tail_arg_alloc = 2 * (4 + xorriso_tail_argc); +- xorriso_tail_argv = xrealloc (xorriso_tail_argv, +- sizeof (xorriso_tail_argv[0]) +- * xorriso_tail_arg_alloc); +- } +- xorriso_tail_argv[xorriso_tail_argc++] = xstrdup (arg); +- return 0; + default: + return ARGP_ERR_UNKNOWN; + } +@@ -374,12 +361,70 @@ make_image_fwdisk (enum grub_install_plat plat, + free (out); + } + ++static int ++option_is_end (const struct argp_option *opt) ++{ ++ return !opt->key && !opt->name && !opt->doc && !opt->group; ++} ++ ++ ++static int ++args_to_eat (const char *arg) ++{ ++ int j; ++ ++ if (arg[0] != '-') ++ return 0; ++ ++ if (arg[1] == '-') ++ { ++ for (j = 0; !option_is_end(&options[j]); j++) ++ { ++ size_t len = strlen (options[j].name); ++ if (strncmp (arg + 2, options[j].name, len) == 0) ++ { ++ if (arg[2 + len] == '=') ++ return 1; ++ if (arg[2 + len] == '\0' && options[j].arg) ++ return 2; ++ if (arg[2 + len] == '\0') ++ return 1; ++ } ++ } ++ if (strcmp (arg, "--help") == 0) ++ return 1; ++ if (strcmp (arg, "--usage") == 0) ++ return 1; ++ if (strcmp (arg, "--version") == 0) ++ return 1; ++ return 0; ++ } ++ if (arg[2] && arg[3]) ++ return 0; ++ for (j = 0; !option_is_end(&options[j]); j++) ++ { ++ if (options[j].key > 0 && options[j].key < 128 && arg[1] == options[j].key) ++ { ++ if (options[j].arg) ++ return 2; ++ return 1; ++ } ++ if (arg[1] == '?' || arg[1] == 'V') ++ return 1; ++ } ++ return 0; ++} ++ + int + main (int argc, char *argv[]) + { + char *romdir; + char *sysarea_img = NULL; + const char *pkgdatadir; ++ int argp_argc; ++ char **argp_argv; ++ int xorriso_tail_argc; ++ char **xorriso_tail_argv; + + grub_util_host_init (&argc, &argv); + grub_util_disable_fd_syncs (); +@@ -391,7 +436,37 @@ main (int argc, char *argv[]) + xorriso = xstrdup ("xorriso"); + label_font = grub_util_path_concat (2, pkgdatadir, "unicode.pf2"); + +- argp_parse (&argp, argc, argv, 0, 0, 0); ++ argp_argv = xmalloc (sizeof (argp_argv[0]) * argc); ++ xorriso_tail_argv = xmalloc (sizeof (argp_argv[0]) * argc); ++ ++ xorriso_tail_argc = 0; ++ /* Program name */ ++ argp_argv[0] = argv[0]; ++ argp_argc = 1; ++ ++ /* argp doesn't allow us to catch unknwon arguments, ++ so catch them before passing to argp ++ */ ++ { ++ int i; ++ for (i = 1; i < argc; i++) ++ { ++ switch (args_to_eat (argv[i])) ++ { ++ case 2: ++ argp_argv[argp_argc++] = argv[i++]; ++ /* Fallthrough */ ++ case 1: ++ argp_argv[argp_argc++] = argv[i]; ++ break; ++ case 0: ++ xorriso_tail_argv[xorriso_tail_argc++] = argv[i]; ++ break; ++ } ++ } ++ } ++ ++ argp_parse (&argp, argp_argc, argp_argv, 0, 0, 0); + + if (!output_image) + grub_util_error ("%s", _("output file must be specified")); +-- +2.4.3 + diff --git a/0367-fddboot_test-Add-no-pad-to-xorriso.patch b/0367-fddboot_test-Add-no-pad-to-xorriso.patch new file mode 100644 index 0000000..fe63a58 --- /dev/null +++ b/0367-fddboot_test-Add-no-pad-to-xorriso.patch @@ -0,0 +1,24 @@ +From 237510486af6e2d73fa57075f72b407d24ad8874 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 12:58:08 +0100 +Subject: [PATCH 367/506] fddboot_test: Add -no-pad to xorriso. + +--- + tests/fddboot_test.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in +index a05eb3e..a59645b 100644 +--- a/tests/fddboot_test.in ++++ b/tests/fddboot_test.in +@@ -46,6 +46,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in + exit 0;; + esac + +-if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes=")" != "Hello World" ]; then ++if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad")" != "Hello World" ]; then + exit 1 + fi +-- +2.4.3 + diff --git a/0368-emunet-Fix-init-error-checking.patch b/0368-emunet-Fix-init-error-checking.patch new file mode 100644 index 0000000..e8375c6 --- /dev/null +++ b/0368-emunet-Fix-init-error-checking.patch @@ -0,0 +1,26 @@ +From fe6695b7d6cd8beae55981b5efbd21f592a0afc0 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 12:59:00 +0100 +Subject: [PATCH 368/506] emunet: Fix init error checking. + +Otherwise emunet doesn't expose any cards. +--- + grub-core/net/drivers/emu/emunet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/net/drivers/emu/emunet.c b/grub-core/net/drivers/emu/emunet.c +index 7c977cd..b194920 100644 +--- a/grub-core/net/drivers/emu/emunet.c ++++ b/grub-core/net/drivers/emu/emunet.c +@@ -98,7 +98,7 @@ static int registered = 0; + + GRUB_MOD_INIT(emunet) + { +- if (grub_emunet_create (&emucard.mtu)) ++ if (!grub_emunet_create (&emucard.mtu)) + { + grub_net_card_register (&emucard); + registered = 1; +-- +2.4.3 + diff --git a/0369-compiler-rt-emu-Add-missing-file.patch b/0369-compiler-rt-emu-Add-missing-file.patch new file mode 100644 index 0000000..524324e --- /dev/null +++ b/0369-compiler-rt-emu-Add-missing-file.patch @@ -0,0 +1,254 @@ +From e9f68f1f4cc1a07d94d200f1e7bdcfb1c4d7e40d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 13:00:53 +0100 +Subject: [PATCH 369/506] compiler-rt-emu: Add missing file. + +--- + include/grub/compiler-rt-emu.h | 235 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 235 insertions(+) + create mode 100644 include/grub/compiler-rt-emu.h + +diff --git a/include/grub/compiler-rt-emu.h b/include/grub/compiler-rt-emu.h +new file mode 100644 +index 0000000..edc8299 +--- /dev/null ++++ b/include/grub/compiler-rt-emu.h +@@ -0,0 +1,235 @@ ++/* compiler-rt-emu.h - prototypes for compiler helpers. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010-2014 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_COMPILER_RT_HEADER ++#define GRUB_COMPILER_RT_HEADER 1 ++ ++#include ++#include ++#include ++ ++#ifdef HAVE___UDIVSI3 ++grub_uint32_t ++EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); ++#endif ++ ++#ifdef HAVE___UMODSI3 ++grub_uint32_t ++EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); ++#endif ++ ++#ifdef HAVE___DIVSI3 ++grub_int32_t ++EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); ++#endif ++ ++#ifdef HAVE___MODSI3 ++grub_int32_t ++EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); ++#endif ++ ++#ifdef HAVE___DIVDI3 ++grub_int64_t ++EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); ++#endif ++ ++#ifdef HAVE___MODDI3 ++grub_int64_t ++EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); ++#endif ++ ++#ifdef HAVE___UDIVDI3 ++grub_uint64_t ++EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++#ifdef HAVE___UMODDI3 ++grub_uint64_t ++EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++#ifdef HAVE___CTZDI2 ++unsigned ++EXPORT_FUNC (__ctzdi2) (grub_uint64_t x); ++#endif ++ ++#ifdef HAVE___CTZSI2 ++unsigned ++EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); ++#endif ++ ++#ifdef HAVE___AEABI_UIDIV ++grub_uint32_t ++EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); ++#endif ++ ++#ifdef HAVE___AEABI_UIDIVMOD ++grub_uint32_t ++EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); ++#endif ++ ++#ifdef HAVE___AEABI_IDIV ++grub_int32_t ++EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); ++#endif ++ ++#ifdef HAVE___AEABI_IDIVMOD ++grub_int32_t ++EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); ++#endif ++ ++#ifdef HAVE___AEABI_ULCMP ++int ++EXPORT_FUNC (__aeabi_ulcmp) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++/* Needed for allowing modules to be compiled as thumb. */ ++#ifdef HAVE___MULDI3 ++grub_uint64_t ++EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++#ifdef HAVE___AEABI_LMUL ++grub_uint64_t ++EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++#ifdef HAVE___AEABI_MEMCPY ++void * ++EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); ++#endif ++ ++#ifdef HAVE___AEABI_MEMSET ++void * ++EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); ++#endif ++ ++#ifdef HAVE___AEABI_LASR ++grub_uint64_t ++EXPORT_FUNC (__aeabi_lasr) (grub_uint64_t u, int b); ++#endif ++ ++#ifdef HAVE___AEABI_LLSL ++grub_uint64_t ++EXPORT_FUNC (__aeabi_llsl) (grub_uint64_t u, int b); ++#endif ++ ++#ifdef HAVE___AEABI_LLSR ++grub_uint64_t ++EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); ++#endif ++ ++ ++#ifdef HAVE__RESTGPR_14_X ++ ++void EXPORT_FUNC (_restgpr_14_x) (void); ++void EXPORT_FUNC (_restgpr_15_x) (void); ++void EXPORT_FUNC (_restgpr_16_x) (void); ++void EXPORT_FUNC (_restgpr_17_x) (void); ++void EXPORT_FUNC (_restgpr_18_x) (void); ++void EXPORT_FUNC (_restgpr_19_x) (void); ++void EXPORT_FUNC (_restgpr_20_x) (void); ++void EXPORT_FUNC (_restgpr_21_x) (void); ++void EXPORT_FUNC (_restgpr_22_x) (void); ++void EXPORT_FUNC (_restgpr_23_x) (void); ++void EXPORT_FUNC (_restgpr_24_x) (void); ++void EXPORT_FUNC (_restgpr_25_x) (void); ++void EXPORT_FUNC (_restgpr_26_x) (void); ++void EXPORT_FUNC (_restgpr_27_x) (void); ++void EXPORT_FUNC (_restgpr_28_x) (void); ++void EXPORT_FUNC (_restgpr_29_x) (void); ++void EXPORT_FUNC (_restgpr_30_x) (void); ++void EXPORT_FUNC (_restgpr_31_x) (void); ++void EXPORT_FUNC (_savegpr_14) (void); ++void EXPORT_FUNC (_savegpr_15) (void); ++void EXPORT_FUNC (_savegpr_16) (void); ++void EXPORT_FUNC (_savegpr_17) (void); ++void EXPORT_FUNC (_savegpr_18) (void); ++void EXPORT_FUNC (_savegpr_19) (void); ++void EXPORT_FUNC (_savegpr_20) (void); ++void EXPORT_FUNC (_savegpr_21) (void); ++void EXPORT_FUNC (_savegpr_22) (void); ++void EXPORT_FUNC (_savegpr_23) (void); ++void EXPORT_FUNC (_savegpr_24) (void); ++void EXPORT_FUNC (_savegpr_25) (void); ++void EXPORT_FUNC (_savegpr_26) (void); ++void EXPORT_FUNC (_savegpr_27) (void); ++void EXPORT_FUNC (_savegpr_28) (void); ++void EXPORT_FUNC (_savegpr_29) (void); ++void EXPORT_FUNC (_savegpr_30) (void); ++void EXPORT_FUNC (_savegpr_31) (void); ++ ++#endif ++ ++#ifdef HAVE___UCMPDI2 ++int ++EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); ++#endif ++ ++#ifdef HAVE___ASHLDI3 ++grub_uint64_t ++EXPORT_FUNC(__ashldi3) (grub_uint64_t u, int b); ++#endif ++ ++#ifdef HAVE___ASHRDI3 ++grub_uint64_t ++EXPORT_FUNC(__ashrdi3) (grub_uint64_t u, int b); ++#endif ++ ++#ifdef HAVE___LSHRDI3 ++grub_uint64_t ++EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); ++#endif ++ ++#ifdef HAVE___BSWAPSI2 ++grub_uint32_t ++EXPORT_FUNC(__bswapsi2) (grub_uint32_t u); ++#endif ++ ++#ifdef HAVE___BSWAPDI2 ++grub_uint64_t ++EXPORT_FUNC(__bswapdi2) (grub_uint64_t u); ++#endif ++ ++int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); ++void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); ++void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); ++void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); ++ ++#ifdef HAVE___BZERO ++void EXPORT_FUNC (__bzero) (void *s, grub_size_t n); ++#endif ++ ++#ifdef HAVE___REGISTER_FRAME_INFO ++void EXPORT_FUNC (__register_frame_info) (void); ++#endif ++ ++#ifdef HAVE___DEREGISTER_FRAME_INFO ++void EXPORT_FUNC (__deregister_frame_info) (void); ++#endif ++#ifdef HAVE____CHKSTK_MS ++void EXPORT_FUNC (___chkstk_ms) (void); ++#endif ++ ++#ifdef HAVE___CHKSTK_MS ++void EXPORT_FUNC (__chkstk_ms) (void); ++#endif ++ ++#endif ++ +-- +2.4.3 + diff --git a/0370-hostfs-Drop-unnecessary-feature-test-macros.patch b/0370-hostfs-Drop-unnecessary-feature-test-macros.patch new file mode 100644 index 0000000..4d46617 --- /dev/null +++ b/0370-hostfs-Drop-unnecessary-feature-test-macros.patch @@ -0,0 +1,32 @@ +From 5974d4ba65fc5ad9253857bf992ffd3c635baf2a Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Mon, 23 Mar 2015 14:27:41 +0000 +Subject: [PATCH 370/506] hostfs: Drop unnecessary feature test macros + +_BSD_SOURCE was added to allow the use of DT_DIR, but that was removed +in e768b77068a0b030a07576852bd0f121c9a077eb. While adding +_DEFAULT_SOURCE as well works around problems with current glibc, +neither is in fact needed nowadays. +--- + grub-core/kern/emu/hostfs.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c +index 823116d..7b28c00 100644 +--- a/grub-core/kern/emu/hostfs.c ++++ b/grub-core/kern/emu/hostfs.c +@@ -19,11 +19,6 @@ + + #include + +-/* Legacy feature macro.*/ +-#define _BSD_SOURCE +-/* New feature macro that provides everything _BSD_SOURCE and +- * _SVID_SOURCE provided and possibly more. */ +-#define _DEFAULT_SOURCE + #include + #include + #include +-- +2.4.3 + diff --git a/0371-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch b/0371-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch new file mode 100644 index 0000000..07b8613 --- /dev/null +++ b/0371-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch @@ -0,0 +1,314 @@ +From 63034d32612dd34f577605dfa8b417ee9144d8cb Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 21:14:23 +0100 +Subject: [PATCH 371/506] arp, icmp: Fix handling in case of oversized or + invalid packets. + +This restrict ARP handling to MAC and IP addresses but in practice we need +only this case anyway and other cases are very rar if exist at all. It makes +code much simpler and less error-prone. +--- + grub-core/net/arp.c | 145 +++++++++++++++++++++------------------------ + grub-core/net/icmp.c | 14 +---- + grub-core/net/netbuff.c | 20 +++++++ + include/grub/net/netbuff.h | 1 + + 4 files changed, 92 insertions(+), 88 deletions(-) + +diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c +index 8cc390b..46a56e0 100644 +--- a/grub-core/net/arp.c ++++ b/grub-core/net/arp.c +@@ -37,12 +37,16 @@ enum + GRUB_NET_ARPHRD_ETHERNET = 1 + }; + +-struct arphdr { ++struct arppkt { + 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; +@@ -53,21 +57,14 @@ 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 arphdr *arp_header; +- grub_net_link_level_address_t target_hw_addr; +- grub_uint8_t *aux, arp_data[128]; ++ struct arppkt *arp_packet; ++ grub_net_link_level_address_t target_mac_addr; + grub_err_t err; + int i; +- grub_size_t addrlen; +- grub_uint16_t etherpro; + grub_uint8_t *nbd; ++ grub_uint8_t arp_data[128]; + +- if (proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) +- { +- addrlen = 4; +- etherpro = GRUB_NET_ETHERTYPE_IP; +- } +- else ++ if (proto_addr->type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) + return grub_error (GRUB_ERR_BUG, "unsupported address family"); + + /* Build a request packet. */ +@@ -76,34 +73,26 @@ 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_header) + 2 * (6 + addrlen)); ++ err = grub_netbuff_push (&nb, sizeof (*arp_packet)); + if (err) + return err; + +- arp_header = (struct arphdr *) nb.data; +- arp_header->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); +- arp_header->hln = 6; +- arp_header->pro = grub_cpu_to_be16 (etherpro); +- arp_header->pln = addrlen; +- arp_header->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); +- aux = (grub_uint8_t *) arp_header + sizeof (*arp_header); ++ 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 (GRUB_NET_ETHERTYPE_IP); ++ arp_packet->pln = 4; ++ arp_packet->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); + /* Sender hardware address. */ +- grub_memcpy (aux, &inf->hwaddress.mac, 6); +- +- aux += 6; +- /* Sender protocol address */ +- grub_memcpy (aux, &inf->address.ipv4, 4); +- aux += addrlen; +- /* Target hardware address */ +- for (i = 0; i < 6; i++) +- aux[i] = 0x00; +- aux += 6; ++ 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_memcpy (aux, &proto_addr->ipv4, 4); +- grub_memset (&target_hw_addr.mac, 0xff, 6); ++ grub_memset (&target_mac_addr.mac, 0xff, 6); + + nbd = nb.data; +- send_ethernet_packet (inf, &nb, target_hw_addr, GRUB_NET_ETHERTYPE_ARP); ++ send_ethernet_packet (inf, &nb, target_mac_addr, GRUB_NET_ETHERTYPE_ARP); + for (i = 0; i < GRUB_NET_TRIES; i++) + { + if (grub_net_link_layer_resolve_check (inf, proto_addr)) +@@ -115,7 +104,7 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, + if (grub_net_link_layer_resolve_check (inf, proto_addr)) + return GRUB_ERR_NONE; + nb.data = nbd; +- send_ethernet_packet (inf, &nb, target_hw_addr, GRUB_NET_ETHERTYPE_ARP); ++ send_ethernet_packet (inf, &nb, target_mac_addr, GRUB_NET_ETHERTYPE_ARP); + } + + return GRUB_ERR_NONE; +@@ -125,63 +114,67 @@ grub_err_t + grub_net_arp_receive (struct grub_net_buff *nb, + struct grub_net_card *card) + { +- struct arphdr *arp_header = (struct arphdr *) nb->data; +- grub_uint8_t *sender_hardware_address; +- grub_uint8_t *target_hardware_address; ++ struct arppkt *arp_packet = (struct arppkt *) nb->data; + grub_net_network_level_address_t sender_addr, target_addr; +- grub_net_link_level_address_t sender_hw_addr; ++ grub_net_link_level_address_t sender_mac_addr; + struct grub_net_network_level_interface *inf; +- grub_uint8_t *sender_protocol_address, *target_protocol_address; +- +- sender_hardware_address = +- (grub_uint8_t *) arp_header + sizeof (*arp_header); +- sender_protocol_address = sender_hardware_address + arp_header->hln; +- target_hardware_address = sender_protocol_address + arp_header->pln; +- target_protocol_address = target_hardware_address + arp_header->hln; +- if (grub_be_to_cpu16 (arp_header->pro) == GRUB_NET_ETHERTYPE_IP +- && arp_header->pln == 4) +- { +- sender_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +- target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +- grub_memcpy (&sender_addr.ipv4, sender_protocol_address, 4); +- grub_memcpy (&target_addr.ipv4, target_protocol_address, 4); +- if (grub_memcmp (sender_protocol_address, &pending_req, 4) == 0) +- have_pending = 1; +- } +- else ++ ++ 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)) + return GRUB_ERR_NONE; + +- sender_hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (sender_hw_addr.mac, sender_hardware_address, +- sizeof (sender_hw_addr.mac)); +- grub_net_link_layer_add_address (card, &sender_addr, &sender_hw_addr, 1); ++ sender_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; ++ 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) ++ 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) + { + /* Am I the protocol address target? */ + if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 +- && grub_be_to_cpu16 (arp_header->op) == ARP_REQUEST) ++ && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) + { + grub_net_link_level_address_t target; +- /* We've already checked that pln is either 4 or 16. */ +- char tmp[16]; +- grub_size_t pln = arp_header->pln; +- +- if (pln > 16) +- pln = 16; ++ struct grub_net_buff nb_reply; ++ struct arppkt *arp_reply; ++ grub_uint8_t arp_data[128]; ++ grub_err_t err; ++ ++ nb_reply.head = arp_data; ++ nb_reply.end = arp_data + sizeof (arp_data); ++ grub_netbuff_clear (&nb_reply); ++ grub_netbuff_reserve (&nb_reply, 128); ++ ++ err = grub_netbuff_push (&nb_reply, sizeof (*arp_packet)); ++ if (err) ++ return err; ++ ++ arp_reply = (struct arppkt *) nb_reply.data; ++ ++ arp_reply->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); ++ arp_reply->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); ++ arp_reply->pln = 4; ++ arp_reply->hln = 6; ++ 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, sender_hardware_address, 6); +- grub_memcpy (target_hardware_address, target.mac, 6); +- grub_memcpy (sender_hardware_address, inf->hwaddress.mac, 6); +- +- grub_memcpy (tmp, sender_protocol_address, pln); +- grub_memcpy (sender_protocol_address, target_protocol_address, pln); +- grub_memcpy (target_protocol_address, tmp, pln); ++ 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); + + /* Change operation to REPLY and send packet */ +- arp_header->op = grub_be_to_cpu16 (ARP_REPLY); +- send_ethernet_packet (inf, nb, target, GRUB_NET_ETHERTYPE_ARP); ++ send_ethernet_packet (inf, &nb_reply, target, GRUB_NET_ETHERTYPE_ARP); + } + } + return GRUB_ERR_NONE; +diff --git a/grub-core/net/icmp.c b/grub-core/net/icmp.c +index 28d825b..b1eef11 100644 +--- a/grub-core/net/icmp.c ++++ b/grub-core/net/icmp.c +@@ -85,22 +85,13 @@ grub_net_recv_icmp_packet (struct grub_net_buff *nb, + struct icmp_header *icmphr; + if (icmph->code) + break; +- nb_reply = grub_netbuff_alloc (nb->tail - nb->data + 512); ++ nb_reply = grub_netbuff_make_pkt (nb->tail - nb->data + sizeof (*icmphr)); + if (!nb_reply) + { + grub_netbuff_free (nb); + return grub_errno; + } +- err = grub_netbuff_reserve (nb_reply, nb->tail - nb->data + 512); +- if (err) +- goto ping_fail; +- err = grub_netbuff_push (nb_reply, nb->tail - nb->data); +- if (err) +- goto ping_fail; +- grub_memcpy (nb_reply->data, nb->data, nb->tail - nb->data); +- err = grub_netbuff_push (nb_reply, sizeof (*icmphr)); +- if (err) +- goto ping_fail; ++ grub_memcpy (nb_reply->data + sizeof (*icmphr), nb->data, nb->tail - nb->data); + icmphr = (struct icmp_header *) nb_reply->data; + icmphr->type = ICMP_ECHO_REPLY; + icmphr->code = 0; +@@ -110,7 +101,6 @@ grub_net_recv_icmp_packet (struct grub_net_buff *nb, + err = grub_net_send_ip_packet (inf, src, ll_src, + nb_reply, GRUB_NET_IP_ICMP); + +- ping_fail: + grub_netbuff_free (nb); + grub_netbuff_free (nb_reply); + return err; +diff --git a/grub-core/net/netbuff.c b/grub-core/net/netbuff.c +index e97ecd2..dbeeefe 100644 +--- a/grub-core/net/netbuff.c ++++ b/grub-core/net/netbuff.c +@@ -97,6 +97,26 @@ grub_netbuff_alloc (grub_size_t len) + return nb; + } + ++struct grub_net_buff * ++grub_netbuff_make_pkt (grub_size_t len) ++{ ++ struct grub_net_buff *nb; ++ grub_err_t err; ++ nb = grub_netbuff_alloc (len + 512); ++ if (!nb) ++ return NULL; ++ err = grub_netbuff_reserve (nb, len + 512); ++ if (err) ++ goto fail; ++ err = grub_netbuff_push (nb, len); ++ if (err) ++ goto fail; ++ return nb; ++ fail: ++ grub_netbuff_free (nb); ++ return NULL; ++} ++ + void + grub_netbuff_free (struct grub_net_buff *nb) + { +diff --git a/include/grub/net/netbuff.h b/include/grub/net/netbuff.h +index 9ac168c..1177c12 100644 +--- a/include/grub/net/netbuff.h ++++ b/include/grub/net/netbuff.h +@@ -25,6 +25,7 @@ grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len); + grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len); + grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff); + struct grub_net_buff * grub_netbuff_alloc (grub_size_t len); ++struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len); + void grub_netbuff_free (struct grub_net_buff *net_buff); + + #endif +-- +2.4.3 + diff --git a/0372-Makefile.core.def-Remove-obsolete-LDADD_KERNEL.patch b/0372-Makefile.core.def-Remove-obsolete-LDADD_KERNEL.patch new file mode 100644 index 0000000..58dffdf --- /dev/null +++ b/0372-Makefile.core.def-Remove-obsolete-LDADD_KERNEL.patch @@ -0,0 +1,25 @@ +From 94222b72b53cc5fc36aa15346ff389f37302aa85 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 21:41:17 +0100 +Subject: [PATCH 372/506] Makefile.core.def: Remove obsolete LDADD_KERNEL + +--- + grub-core/Makefile.core.def | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 8eaae45..a6101de 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -83,8 +83,6 @@ kernel = { + x86_64_xen_ldflags = '$(TARGET_IMG_LDFLAGS)'; + x86_64_xen_ldflags = '$(TARGET_IMG_BASE_LDOPT),0'; + +- ldadd = '$(LDADD_KERNEL)'; +- + mips_loongson_ldflags = '-Wl,-Ttext,0x80200000'; + powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000'; + sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400'; +-- +2.4.3 + diff --git a/0373-modinfo.sh.in-Add-missing-config-variables.patch b/0373-modinfo.sh.in-Add-missing-config-variables.patch new file mode 100644 index 0000000..351cd37 --- /dev/null +++ b/0373-modinfo.sh.in-Add-missing-config-variables.patch @@ -0,0 +1,34 @@ +From c14f8a9366517270c2171757e1b9a13fe0205dd3 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 20 Mar 2015 21:42:48 +0100 +Subject: [PATCH 373/506] modinfo.sh.in: Add missing config variables. + +--- + grub-core/modinfo.sh.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/grub-core/modinfo.sh.in b/grub-core/modinfo.sh.in +index 09d22f9..faf0ad3 100644 +--- a/grub-core/modinfo.sh.in ++++ b/grub-core/modinfo.sh.in +@@ -19,11 +19,17 @@ grub_target_cflags='@TARGET_CFLAGS@' + grub_target_cppflags='@TARGET_CPPFLAGS@' + grub_target_ccasflags='@TARGET_CCASFLAGS@' + grub_target_ldflags='@TARGET_LDFLAGS@' ++grub_cflags='@CFLAGS@' ++grub_cppflags='@CPPFLAGS@' ++grub_ccasflags='@CCASFLAGS@' ++grub_ldflags='@LDFLAGS@' + grub_target_strip='@TARGET_STRIP@' + grub_target_nm='@TARGET_NM@' + grub_target_ranlib='@TARGET_RANLIB@' + grub_target_objconf='@TARGET_OBJCONV@' + grub_target_obj2elf='@TARGET_OBJ2ELF@' ++grub_target_img_base_ldopt='@TARGET_IMG_BASE_LDOPT@' ++grub_target_img_ldflags='@TARGET_IMG_BASE_LDFLAGS@' + + # Version + grub_version="@VERSION@" +-- +2.4.3 + diff --git a/0374-util-mkimage-Use-stable-timestamp-when-generating-bi.patch b/0374-util-mkimage-Use-stable-timestamp-when-generating-bi.patch new file mode 100644 index 0000000..feef876 --- /dev/null +++ b/0374-util-mkimage-Use-stable-timestamp-when-generating-bi.patch @@ -0,0 +1,45 @@ +From 85a7be2414c4718e96d81a2ebaa70d0d42152e62 Mon Sep 17 00:00:00 2001 +From: Daniel Kahn Gillmor +Date: Fri, 27 Mar 2015 13:26:48 +0100 +Subject: [PATCH 374/506] util/mkimage: Use stable timestamp when generating + binaries. + +--- + util/mkimage.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/util/mkimage.c b/util/mkimage.c +index 7821dc5..52265b5 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -55,6 +55,9 @@ + + #define TARGET_NO_FIELD 0xffffffff + ++/* use 2015-01-01T00:00:00+0000 as a stock timestamp */ ++#define STABLE_EMBEDDING_TIMESTAMP 1420070400 ++ + struct grub_install_image_target_desc + { + const char *dirname; +@@ -1439,7 +1442,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + c->machine = grub_host_to_target16 (image_target->pe_target); + + c->num_sections = grub_host_to_target16 (4); +- c->time = grub_host_to_target32 (time (0)); ++ c->time = grub_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP); + c->characteristics = grub_host_to_target16 (GRUB_PE32_EXECUTABLE_IMAGE + | GRUB_PE32_LINE_NUMS_STRIPPED + | ((image_target->voidp_sizeof == 4) +@@ -1782,7 +1785,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + + memset (hdr, 0, sizeof (*hdr)); + hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC); +- hdr->ih_time = grub_cpu_to_be32 (time (0)); ++ hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); + hdr->ih_size = grub_cpu_to_be32 (core_size); + hdr->ih_load = grub_cpu_to_be32 (image_target->link_addr); + hdr->ih_ep = grub_cpu_to_be32 (image_target->link_addr); +-- +2.4.3 + diff --git a/0375-Make-Makefile.util.def-independent-of-platform.patch b/0375-Make-Makefile.util.def-independent-of-platform.patch new file mode 100644 index 0000000..6cb964f --- /dev/null +++ b/0375-Make-Makefile.util.def-independent-of-platform.patch @@ -0,0 +1,24 @@ +From 1f23c87c19b3002231c2939a8d03fa4b67f7bcb6 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 27 Mar 2015 14:04:41 +0100 +Subject: [PATCH 375/506] Make Makefile.util.def independent of platform. + +--- + Makefile.util.def | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile.util.def b/Makefile.util.def +index 67dfb29..3cb6b21 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -613,7 +613,6 @@ program = { + common = grub-core/disk/host.c; + + common = util/resolve.c; +- enable = noemu; + common = grub-core/kern/emu/argp_common.c; + common = grub-core/osdep/init.c; + +-- +2.4.3 + diff --git a/0376-efinet-Check-for-immediate-completition.patch b/0376-efinet-Check-for-immediate-completition.patch new file mode 100644 index 0000000..425f565 --- /dev/null +++ b/0376-efinet-Check-for-immediate-completition.patch @@ -0,0 +1,51 @@ +From cf2b4a36c408084852c44dea045331f039b895d2 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 27 Mar 2015 14:27:56 +0100 +Subject: [PATCH 376/506] efinet: Check for immediate completition. + +This both speeds GRUB up and workarounds unexpected EFI behaviour. +--- + grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index 2b344d6..f171f20 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -37,11 +37,12 @@ send_card_buffer (struct grub_net_card *dev, + grub_efi_status_t st; + grub_efi_simple_network_t *net = dev->efi_net; + grub_uint64_t limit_time = grub_get_time_ms () + 4000; ++ void *txbuf; + + if (dev->txbusy) + while (1) + { +- void *txbuf = NULL; ++ txbuf = NULL; + st = efi_call_3 (net->get_status, net, 0, &txbuf); + if (st != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_IO, +@@ -74,7 +75,18 @@ send_card_buffer (struct grub_net_card *dev, + dev->txbuf, NULL, NULL, NULL); + if (st != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); +- dev->txbusy = 1; ++ ++ /* ++ The card may have sent out the packet immediately - set txbusy ++ to 0 in this case. ++ Cases were observed where checking txbuf at the next call ++ of send_card_buffer() is too late: 0 is returned in txbuf and ++ we run in the GRUB_ERR_TIMEOUT case above. ++ Perhaps a timeout in the FW has discarded the recycle buffer. ++ */ ++ st = efi_call_3 (net->get_status, net, 0, &txbuf); ++ dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf == dev->txbuf); ++ + return GRUB_ERR_NONE; + } + +-- +2.4.3 + diff --git a/0377-dl_helper-Cleanup.patch b/0377-dl_helper-Cleanup.patch new file mode 100644 index 0000000..0a7d260 --- /dev/null +++ b/0377-dl_helper-Cleanup.patch @@ -0,0 +1,166 @@ +From d47e8ab4b945d1dd50bc7d7ebbbf6f1f255f8f58 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Fri, 27 Mar 2015 14:37:16 +0100 +Subject: [PATCH 377/506] dl_helper: Cleanup + +Use the new thumb_get_instruction_word/thumb_set_instruction_word +helpers throughout. + +Style cleanup (missing spaces). + +Move Thumb MOVW/MOVT handlers into Thumb relocation section of file. +--- + grub-core/kern/arm/dl_helper.c | 78 ++++++++++++++++++------------------------ + 1 file changed, 34 insertions(+), 44 deletions(-) + +diff --git a/grub-core/kern/arm/dl_helper.c b/grub-core/kern/arm/dl_helper.c +index 8a72632..21d77f7 100644 +--- a/grub-core/kern/arm/dl_helper.c ++++ b/grub-core/kern/arm/dl_helper.c +@@ -26,14 +26,14 @@ + #include + + static inline grub_uint32_t +-thumb_get_instruction_word(grub_uint16_t *target) ++thumb_get_instruction_word (grub_uint16_t *target) + { + /* Extract instruction word in alignment-safe manner */ + return grub_le_to_cpu16 ((*target)) << 16 | grub_le_to_cpu16 (*(target + 1)); + } + + static inline void +-thumb_set_instruction_word(grub_uint16_t *target, grub_uint32_t insword) ++thumb_set_instruction_word (grub_uint16_t *target, grub_uint32_t insword) + { + *target = grub_cpu_to_le16 (insword >> 16); + *(target + 1) = grub_cpu_to_le16 (insword & 0xffff); +@@ -70,9 +70,7 @@ grub_arm_thm_call_get_offset (grub_uint16_t *target) + grub_uint32_t insword; + grub_int32_t offset; + +- /* Extract instruction word in alignment-safe manner */ +- insword = (grub_le_to_cpu16 (*target) << 16) +- | (grub_le_to_cpu16(*(target + 1))); ++ insword = thumb_get_instruction_word (target); + + /* Extract bitfields from instruction words */ + sign = (insword >> 26) & 1; +@@ -97,9 +95,7 @@ grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset) + grub_uint32_t insword; + int is_blx; + +- /* Extract instruction word in alignment-safe manner */ +- insword = (grub_le_to_cpu16 (*target) << 16) +- | (grub_le_to_cpu16(*(target + 1))); ++ insword = thumb_get_instruction_word (target); + + if (((insword >> 12) & 0xd) == 0xc) + is_blx = 1; +@@ -122,9 +118,7 @@ grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset) + (((offset >> 12) & 0x03ff) << 16) | + (j1 << 13) | (j2 << 11) | ((offset >> 1) & 0x07ff); + +- /* Write instruction word back in alignment-safe manner */ +- *target = grub_cpu_to_le16 ((insword >> 16) & 0xffff); +- *(target + 1) = grub_cpu_to_le16 (insword & 0xffff); ++ thumb_set_instruction_word (target, insword); + + grub_dprintf ("dl", " *insword = 0x%08x", insword); + +@@ -137,9 +131,7 @@ grub_arm_thm_jump19_get_offset (grub_uint16_t *target) + grub_int32_t offset; + grub_uint32_t insword; + +- /* Extract instruction word in alignment-safe manner */ +- insword = (grub_le_to_cpu16 (*target) << 16) +- | (grub_le_to_cpu16(*(target + 1))); ++ insword = thumb_get_instruction_word (target); + + /* Extract and sign extend offset */ + offset = ((insword >> 26) & 1) << 19 +@@ -163,9 +155,7 @@ grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset) + offset >>= 1; + offset &= 0xfffff; + +- /* Extract instruction word in alignment-safe manner */ +- insword = grub_le_to_cpu16 ((*target)) << 16 +- | grub_le_to_cpu16 (*(target + 1)); ++ insword = thumb_get_instruction_word (target); + + /* Reassemble instruction word and write back */ + insword &= insmask; +@@ -174,8 +164,7 @@ grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset) + | ((offset >> 17) & 1) << 13 + | ((offset >> 11) & 0x3f) << 16 + | (offset & 0x7ff); +- *target = grub_cpu_to_le16 (insword >> 16); +- *(target + 1) = grub_cpu_to_le16 (insword & 0xffff); ++ thumb_set_instruction_word (target, insword); + } + + int +@@ -186,6 +175,32 @@ grub_arm_thm_jump19_check_offset (grub_int32_t offset) + return 1; + } + ++grub_uint16_t ++grub_arm_thm_movw_movt_get_value (grub_uint16_t *target) ++{ ++ grub_uint32_t insword; ++ ++ insword = thumb_get_instruction_word (target); ++ ++ return ((insword & 0xf0000) >> 4) | ((insword & 0x04000000) >> 15) | \ ++ ((insword & 0x7000) >> 4) | (insword & 0xff); ++} ++ ++void ++grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value) ++{ ++ grub_uint32_t insword; ++ const grub_uint32_t insmask = 0xfbf08f00; ++ ++ insword = thumb_get_instruction_word (target); ++ insword &= insmask; ++ ++ insword |= ((value & 0xf000) << 4) | ((value & 0x0800) << 15) | \ ++ ((value & 0x0700) << 4) | (value & 0xff); ++ ++ thumb_set_instruction_word (target, insword); ++} ++ + + /*********************************************************** + * ARM (A32) relocations: * +@@ -228,28 +243,3 @@ grub_arm_jump24_set_offset (grub_uint32_t *target, + + *target = grub_cpu_to_le32 (insword); + } +- +-grub_uint16_t +-grub_arm_thm_movw_movt_get_value (grub_uint16_t *target) +-{ +- grub_uint32_t insword; +- +- insword = thumb_get_instruction_word (target); +- +- return ((insword & 0xf0000) >> 4) | ((insword & 0x04000000) >> 15) | \ +- ((insword & 0x7000) >> 4) | (insword & 0xff); +-} +- +-void +-grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value) +-{ +- grub_uint32_t insword; +- +- insword = thumb_get_instruction_word (target); +- insword &= 0xfbf08f00; +- +- insword |= ((value & 0xf000) << 4) | ((value & 0x0800) << 15) | \ +- ((value & 0x0700) << 4) | (value & 0xff); +- +- thumb_set_instruction_word (target, insword); +-} +-- +2.4.3 + diff --git a/0378-Add-missing-initializers-to-silence-suprious-warning.patch b/0378-Add-missing-initializers-to-silence-suprious-warning.patch new file mode 100644 index 0000000..59c2a87 --- /dev/null +++ b/0378-Add-missing-initializers-to-silence-suprious-warning.patch @@ -0,0 +1,67 @@ +From ed07b7e1289dd00b9d6dc8ac5dd56130f3376bc9 Mon Sep 17 00:00:00 2001 +From: Michael Zimmermann +Date: Fri, 27 Mar 2015 14:44:41 +0100 +Subject: [PATCH 378/506] Add missing initializers to silence suprious + warnings. + +--- + grub-core/commands/verify.c | 2 +- + grub-core/fs/hfsplus.c | 8 ++++---- + grub-core/normal/main.c | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c +index 6569391..9620a3b 100644 +--- a/grub-core/commands/verify.c ++++ b/grub-core/commands/verify.c +@@ -454,7 +454,7 @@ grub_verify_signature_real (char *buf, grub_size_t size, + grub_err_t err; + grub_size_t i; + gcry_mpi_t mpis[10]; +- grub_uint8_t type; ++ grub_uint8_t type = 0; + + err = read_packet_header (sig, &type, &len); + if (err) +diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c +index 110d858..21159e8 100644 +--- a/grub-core/fs/hfsplus.c ++++ b/grub-core/fs/hfsplus.c +@@ -792,8 +792,8 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, + }; + + struct grub_hfsplus_key_internal intern; +- struct grub_hfsplus_btnode *node; +- grub_disk_addr_t ptr; ++ struct grub_hfsplus_btnode *node = NULL; ++ grub_disk_addr_t ptr = 0; + + { + struct grub_fshelp_node *fsnode; +@@ -976,8 +976,8 @@ grub_hfsplus_label (grub_device_t device, char **label) + struct grub_hfsplus_catkey *catkey; + int i, label_len; + struct grub_hfsplus_key_internal intern; +- struct grub_hfsplus_btnode *node; +- grub_disk_addr_t ptr; ++ struct grub_hfsplus_btnode *node = NULL; ++ grub_disk_addr_t ptr = 0; + + *label = 0; + +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 623b93b..78a70a8 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -445,7 +445,7 @@ grub_cmdline_run (int nested, int force_auth) + + while (1) + { +- char *line; ++ char *line = NULL; + + if (grub_normal_exit_level) + break; +-- +2.4.3 + diff --git a/0379-Recognize-EFI-platform-even-in-case-of-mismatch-betw.patch b/0379-Recognize-EFI-platform-even-in-case-of-mismatch-betw.patch new file mode 100644 index 0000000..e546170 --- /dev/null +++ b/0379-Recognize-EFI-platform-even-in-case-of-mismatch-betw.patch @@ -0,0 +1,81 @@ +From 1a33de8b5612f8d7ab344546f8a91fa814f712b5 Mon Sep 17 00:00:00 2001 +From: Steve McIntyre +Date: Fri, 27 Mar 2015 14:51:51 +0100 +Subject: [PATCH 379/506] Recognize EFI platform even in case of mismatch + between Linux and EFI. + +Some x86 systems might be capable of running a 64-bit Linux kernel but +only use a 32-bit EFI (e.g. Intel Bay Trail systems). It's useful for +grub-install to be able to recognise such systems, to set the default +x86 platform correctly. + +To allow grub-install to know the size of the firmware rather than +just the size of the kernel, there is now an extra EFI sysfs file to +describe the underlying firmware. Read that if possible, otherwise +fall back to the kernel type as before. + +Signed-off-by: Steve McIntyre +--- + grub-core/osdep/linux/platform.c | 39 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 38 insertions(+), 1 deletion(-) + +diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c +index 4b9f6ef..775b6c0 100644 +--- a/grub-core/osdep/linux/platform.c ++++ b/grub-core/osdep/linux/platform.c +@@ -60,6 +60,43 @@ is_64_kernel (void) + return strcmp (un.machine, "x86_64") == 0; + } + ++static int ++read_platform_size (void) ++{ ++ FILE *fp; ++ char *buf = NULL; ++ size_t len = 0; ++ int ret = 0; ++ ++ /* Newer kernels can tell us directly about the size of the ++ * underlying firmware - let's see if that interface is there. */ ++ fp = grub_util_fopen ("/sys/firmware/efi/fw_platform_size", "r"); ++ if (fp != NULL) ++ { ++ if (getline (&buf, &len, fp) >= 3) /* 2 digits plus newline */ ++ { ++ if (strncmp (buf, "32", 2) == 0) ++ ret = 32; ++ else if (strncmp (buf, "64", 2) == 0) ++ ret = 64; ++ } ++ free (buf); ++ fclose (fp); ++ } ++ ++ if (ret == 0) ++ { ++ /* Unrecognised - fall back to matching the kernel size ++ * instead */ ++ if (is_64_kernel ()) ++ ret = 64; ++ else ++ ret = 32; ++ } ++ ++ return ret; ++} ++ + const char * + grub_install_get_default_x86_platform (void) + { +@@ -77,7 +114,7 @@ grub_install_get_default_x86_platform (void) + if (is_not_empty_directory ("/sys/firmware/efi")) + { + grub_util_info ("...found"); +- if (is_64_kernel ()) ++ if (read_platform_size() == 64) + return "x86_64-efi"; + else + return "i386-efi"; +-- +2.4.3 + diff --git a/0380-syslinux-Support-vesa-menu.c32.patch b/0380-syslinux-Support-vesa-menu.c32.patch new file mode 100644 index 0000000..9e52032 --- /dev/null +++ b/0380-syslinux-Support-vesa-menu.c32.patch @@ -0,0 +1,208 @@ +From c9ee9bedefe71df6bb18868e47ff2189e79d821e Mon Sep 17 00:00:00 2001 +From: Lunar +Date: Fri, 27 Mar 2015 15:15:13 +0100 +Subject: [PATCH 380/506] syslinux: Support {vesa,}menu.c32. + +--- + grub-core/lib/syslinux_parse.c | 165 ++++++++++++++++++++++++++--------------- + 1 file changed, 107 insertions(+), 58 deletions(-) + +diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c +index 22389eb..153260b 100644 +--- a/grub-core/lib/syslinux_parse.c ++++ b/grub-core/lib/syslinux_parse.c +@@ -840,6 +840,82 @@ simplify_filename (char *str) + } + + static grub_err_t ++print_config (struct output_buffer *outbuf, ++ struct syslinux_menu *menu, ++ const char *filename, const char *basedir) ++{ ++ struct syslinux_menu *menuptr; ++ grub_err_t err = GRUB_ERR_NONE; ++ char *new_cwd = NULL; ++ char *new_target_cwd = NULL; ++ char *newname = NULL; ++ int depth = 0; ++ ++ new_cwd = get_read_filename (menu, basedir); ++ if (!new_cwd) ++ { ++ err = grub_errno; ++ goto out; ++ } ++ new_target_cwd = get_target_filename (menu, basedir); ++ if (!new_target_cwd) ++ { ++ err = grub_errno; ++ goto out; ++ } ++ newname = get_read_filename (menu, filename); ++ if (!newname) ++ { ++ err = grub_errno; ++ goto out; ++ } ++ simplify_filename (newname); ++ ++ print_string ("#"); ++ print_file (outbuf, menu, filename, NULL); ++ print_string (" "); ++ print (outbuf, newname, grub_strlen (newname)); ++ print_string (":\n"); ++ ++ for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++) ++ if (grub_strcmp (menuptr->filename, newname) == 0 ++ || depth > 20) ++ break; ++ if (menuptr) ++ { ++ print_string (" syslinux_configfile -r "); ++ print_file (outbuf, menu, "/", NULL); ++ print_string (" -c "); ++ print_file (outbuf, menu, basedir, NULL); ++ print_string (" "); ++ print_file (outbuf, menu, filename, NULL); ++ print_string ("\n"); ++ } ++ else ++ { ++ err = config_file (outbuf, menu->root_read_directory, ++ menu->root_target_directory, new_cwd, new_target_cwd, ++ newname, menu, menu->flavour); ++ if (err == GRUB_ERR_FILE_NOT_FOUND ++ || err == GRUB_ERR_BAD_FILENAME) ++ { ++ grub_errno = err = GRUB_ERR_NONE; ++ print_string ("# File "); ++ err = print (outbuf, newname, grub_strlen (newname)); ++ if (err) ++ goto out; ++ print_string (" not found\n"); ++ } ++ } ++ ++ out: ++ grub_free (newname); ++ grub_free (new_cwd); ++ grub_free (new_target_cwd); ++ return err; ++} ++ ++static grub_err_t + write_entry (struct output_buffer *outbuf, + struct syslinux_menu *menu, + struct syslinux_menuentry *curentry) +@@ -1227,6 +1303,36 @@ write_entry (struct output_buffer *outbuf, + break; + } + ++ if (grub_strcasecmp (basename, "menu.c32") == 0 || ++ grub_strcasecmp (basename, "vesamenu.c32") == 0) ++ { ++ char *ptr; ++ char *end; ++ ++ ptr = curentry->append; ++ if (!ptr) ++ return grub_errno; ++ ++ while (*ptr) ++ { ++ end = ptr; ++ for (end = ptr; *end && !grub_isspace (*end); end++); ++ if (*end) ++ *end++ = '\0'; ++ ++ /* "~" is supposed to be current file, so let's skip it */ ++ if (grub_strcmp (ptr, "~") != 0) ++ { ++ err = print_config (outbuf, menu, ptr, ""); ++ if (err != GRUB_ERR_NONE) ++ break; ++ } ++ for (ptr = end; *ptr && grub_isspace (*ptr); ptr++); ++ } ++ err = GRUB_ERR_NONE; ++ break; ++ } ++ + /* FIXME: gdb, GFXBoot, Hdt, Ifcpu, Ifplop, Kbdmap, + FIXME: Linux, Lua, Meminfo, rosh, Sanbboot */ + +@@ -1239,70 +1345,13 @@ write_entry (struct output_buffer *outbuf, + } + case KERNEL_CONFIG: + { +- char *new_cwd, *new_target_cwd; + const char *ap; + ap = curentry->append; + if (!ap) + ap = curentry->argument; + if (!ap) + ap = ""; +- new_cwd = get_read_filename (menu, ap); +- if (!new_cwd) +- return grub_errno; +- new_target_cwd = get_target_filename (menu, ap); +- if (!new_target_cwd) +- return grub_errno; +- +- struct syslinux_menu *menuptr; +- char *newname; +- int depth = 0; +- +- newname = get_read_filename (menu, curentry->kernel_file); +- if (!newname) +- return grub_errno; +- simplify_filename (newname); +- +- print_string ("#"); +- print_file (outbuf, menu, curentry->kernel_file, NULL); +- print_string (" "); +- print (outbuf, newname, grub_strlen (newname)); +- print_string (":\n"); +- +- for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++) +- if (grub_strcmp (menuptr->filename, newname) == 0 +- || depth > 20) +- break; +- if (menuptr) +- { +- print_string (" syslinux_configfile -r "); +- print_file (outbuf, menu, "/", NULL); +- print_string (" -c "); +- print_file (outbuf, menu, ap, NULL); +- print_string (" "); +- print_file (outbuf, menu, curentry->kernel_file, NULL); +- print_string ("\n"); +- } +- else +- { +- err = config_file (outbuf, menu->root_read_directory, +- menu->root_target_directory, new_cwd, new_target_cwd, +- newname, menu, menu->flavour); +- if (err == GRUB_ERR_FILE_NOT_FOUND +- || err == GRUB_ERR_BAD_FILENAME) +- { +- grub_errno = err = GRUB_ERR_NONE; +- print_string ("# File "); +- err = print (outbuf, newname, grub_strlen (newname)); +- if (err) +- return err; +- print_string (" not found\n"); +- } +- if (err) +- return err; +- } +- grub_free (newname); +- grub_free (new_cwd); +- grub_free (new_target_cwd); ++ print_config (outbuf, menu, curentry->kernel_file, ap); + } + break; + case KERNEL_NO_KERNEL: +-- +2.4.3 + diff --git a/0381-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch b/0381-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch new file mode 100644 index 0000000..d8d4d9f --- /dev/null +++ b/0381-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch @@ -0,0 +1,41 @@ +From ebd92af8c3f8fc30c48bbf36a1875fda1246981c Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 27 Mar 2015 18:58:57 +0300 +Subject: [PATCH 381/506] net: trivial grub_cpu_to_XX_compile_time cleanup + +--- + grub-core/net/arp.c | 2 +- + grub-core/net/icmp6.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c +index 46a56e0..4b68c41 100644 +--- a/grub-core/net/arp.c ++++ b/grub-core/net/arp.c +@@ -80,7 +80,7 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, + 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 (GRUB_NET_ETHERTYPE_IP); ++ 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. */ +diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c +index 7822394..7953e68 100644 +--- a/grub-core/net/icmp6.c ++++ b/grub-core/net/icmp6.c +@@ -552,8 +552,8 @@ grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf + struct icmp_header *icmphr; + + multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; +- multicast.ipv6[0] = grub_cpu_to_be64 (0xff02ULL << 48); +- multicast.ipv6[1] = grub_cpu_to_be64 (0x02ULL); ++ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); ++ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x02ULL); + + err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); + if (err) +-- +2.4.3 + diff --git a/0382-grub-core-loader-i386-xen.c-Initialized-initrd_ctx-s.patch b/0382-grub-core-loader-i386-xen.c-Initialized-initrd_ctx-s.patch new file mode 100644 index 0000000..0c4f6ab --- /dev/null +++ b/0382-grub-core-loader-i386-xen.c-Initialized-initrd_ctx-s.patch @@ -0,0 +1,27 @@ +From 7d3993847466435bcc8c82267f101c5e8193f4be Mon Sep 17 00:00:00 2001 +From: Sarah Newman +Date: Fri, 27 Mar 2015 12:56:43 -0700 +Subject: [PATCH 382/506] grub-core/loader/i386/xen.c: Initialized initrd_ctx + so we don't free a random pointer from the stack. + +Signed-off-by: Sarah Newman +--- + grub-core/loader/i386/xen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c +index c16b4b2..c4d9689 100644 +--- a/grub-core/loader/i386/xen.c ++++ b/grub-core/loader/i386/xen.c +@@ -521,7 +521,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_size_t size = 0; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + grub_relocator_chunk_t ch; + + if (argc == 0) +-- +2.4.3 + diff --git a/0383-do-not-emit-cryptomount-without-crypto-UUID.patch b/0383-do-not-emit-cryptomount-without-crypto-UUID.patch new file mode 100644 index 0000000..89c92ef --- /dev/null +++ b/0383-do-not-emit-cryptomount-without-crypto-UUID.patch @@ -0,0 +1,25 @@ +From 12bf55703940cde06448a1c1a19001556c1450f9 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 28 Mar 2015 22:13:35 +0300 +Subject: [PATCH 383/506] do not emit cryptomount without crypto UUID + +--- + util/grub-mkconfig_lib.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 29ef865..60b31ca 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -145,7 +145,7 @@ prepare_grub_to_access_device () + done + + if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then +- for uuid in "`"${grub_probe}" --device $@ --target=cryptodisk_uuid`"; do ++ for uuid in `"${grub_probe}" --device $@ --target=cryptodisk_uuid`; do + echo "cryptomount -u $uuid" + done + fi +-- +2.4.3 + diff --git a/0384-core-avoid-NULL-derefrence-in-grub_divmod64s.patch b/0384-core-avoid-NULL-derefrence-in-grub_divmod64s.patch new file mode 100644 index 0000000..7681218 --- /dev/null +++ b/0384-core-avoid-NULL-derefrence-in-grub_divmod64s.patch @@ -0,0 +1,30 @@ +From f11db3c7fc50b0b7de22e5ccdcb06bcbccb22a46 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 6 Apr 2015 19:25:02 +0300 +Subject: [PATCH 384/506] core: avoid NULL derefrence in grub_divmod64s + +It can be called with NULL for third argument. grub_divmod32* for +now are called only from within wrappers, so skip check. + +Reported-By: Michael Zimmermann +--- + grub-core/lib/division.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/lib/division.c b/grub-core/lib/division.c +index 920a79f..35606fe 100644 +--- a/grub-core/lib/division.c ++++ b/grub-core/lib/division.c +@@ -50,7 +50,8 @@ grub_divmod64s (grub_int64_t n, + q = -q; + } + /* Now: n = d * q + r */ +- *ro = r; ++ if (ro) ++ *ro = r; + return q; + } + +-- +2.4.3 + diff --git a/0385-docs-grub.texi-Fix-spelling-of-cbfstool.patch b/0385-docs-grub.texi-Fix-spelling-of-cbfstool.patch new file mode 100644 index 0000000..b3fd906 --- /dev/null +++ b/0385-docs-grub.texi-Fix-spelling-of-cbfstool.patch @@ -0,0 +1,25 @@ +From e97f5f4968c4b92c43985833604118149cbba128 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Sat, 11 Apr 2015 21:40:50 +0200 +Subject: [PATCH 385/506] docs/grub.texi: Fix spelling of cbfstool + +--- + docs/grub.texi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 46b9e7f..4af22af 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -5848,7 +5848,7 @@ Following variables must be defined: + + @multitable @columnfractions .30 .65 + @item GRUB_PAYLOADS_DIR @tab directory containing the required kernels +-@item GRUB_CBFSTOOL @tab cbfstoll from Coreboot package (for coreboot platform only) ++@item GRUB_CBFSTOOL @tab cbfstool from Coreboot package (for coreboot platform only) + @item GRUB_COREBOOT_ROM @tab empty Coreboot ROM + @item GRUB_QEMU_OPTS @tab additional options to be supplied to QEMU + @end multitable +-- +2.4.3 + diff --git a/0386-core-partmap-rename-sun-to-avoid-clash-with-predefin.patch b/0386-core-partmap-rename-sun-to-avoid-clash-with-predefin.patch new file mode 100644 index 0000000..c9b2154 --- /dev/null +++ b/0386-core-partmap-rename-sun-to-avoid-clash-with-predefin.patch @@ -0,0 +1,101 @@ +From 5b5d8666a748109a3a0175f8140382d295a7938a Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Mon, 13 Apr 2015 19:49:15 +0300 +Subject: [PATCH 386/506] core/partmap: rename 'sun' to avoid clash with + predefined symbol +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the symbol “sun†is defined macro in solaris derived systems, from +gcc -dM -E: + +and therefore can not be used as name. +--- + grub-core/partmap/sun.c | 14 +++++++------- + grub-core/partmap/sunpc.c | 10 +++++----- + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/grub-core/partmap/sun.c b/grub-core/partmap/sun.c +index dae3602..aac30a3 100644 +--- a/grub-core/partmap/sun.c ++++ b/grub-core/partmap/sun.c +@@ -91,7 +91,7 @@ sun_partition_map_iterate (grub_disk_t disk, + struct grub_partition p; + union + { +- struct grub_sun_block sun; ++ struct grub_sun_block sun_block; + grub_uint16_t raw[0]; + } block; + int partnum; +@@ -103,7 +103,7 @@ sun_partition_map_iterate (grub_disk_t disk, + if (err) + return err; + +- if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun.magic)) ++ if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun_block.magic)) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table"); + + if (! grub_sun_is_valid (block.raw)) +@@ -115,14 +115,14 @@ sun_partition_map_iterate (grub_disk_t disk, + { + struct grub_sun_partition_descriptor *desc; + +- if (block.sun.infos[partnum].id == 0 +- || block.sun.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID) ++ if (block.sun_block.infos[partnum].id == 0 ++ || block.sun_block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID) + continue; + +- desc = &block.sun.partitions[partnum]; ++ desc = &block.sun_block.partitions[partnum]; + p.start = ((grub_uint64_t) grub_be_to_cpu32 (desc->start_cylinder) +- * grub_be_to_cpu16 (block.sun.ntrks) +- * grub_be_to_cpu16 (block.sun.nsect)); ++ * grub_be_to_cpu16 (block.sun_block.ntrks) ++ * grub_be_to_cpu16 (block.sun_block.nsect)); + p.len = grub_be_to_cpu32 (desc->num_sectors); + p.number = p.index = partnum; + if (p.len) +diff --git a/grub-core/partmap/sunpc.c b/grub-core/partmap/sunpc.c +index 442763e..73a430c 100644 +--- a/grub-core/partmap/sunpc.c ++++ b/grub-core/partmap/sunpc.c +@@ -74,7 +74,7 @@ sun_pc_partition_map_iterate (grub_disk_t disk, + grub_partition_t p; + union + { +- struct grub_sun_pc_block sun; ++ struct grub_sun_pc_block sun_block; + grub_uint16_t raw[0]; + } block; + int partnum; +@@ -92,7 +92,7 @@ sun_pc_partition_map_iterate (grub_disk_t disk, + return err; + } + +- if (GRUB_PARTMAP_SUN_PC_MAGIC != grub_le_to_cpu16 (block.sun.magic)) ++ if (GRUB_PARTMAP_SUN_PC_MAGIC != grub_le_to_cpu16 (block.sun_block.magic)) + { + grub_free (p); + return grub_error (GRUB_ERR_BAD_PART_TABLE, +@@ -111,12 +111,12 @@ sun_pc_partition_map_iterate (grub_disk_t disk, + { + struct grub_sun_pc_partition_descriptor *desc; + +- if (block.sun.partitions[partnum].id == 0 +- || block.sun.partitions[partnum].id ++ if (block.sun_block.partitions[partnum].id == 0 ++ || block.sun_block.partitions[partnum].id + == GRUB_PARTMAP_SUN_PC_WHOLE_DISK_ID) + continue; + +- desc = &block.sun.partitions[partnum]; ++ desc = &block.sun_block.partitions[partnum]; + p->start = grub_le_to_cpu32 (desc->start_sector); + p->len = grub_le_to_cpu32 (desc->num_sectors); + p->number = partnum; +-- +2.4.3 + diff --git a/0387-getroot-include-sys-mkdev.h-for-makedev.patch b/0387-getroot-include-sys-mkdev.h-for-makedev.patch new file mode 100644 index 0000000..238da12 --- /dev/null +++ b/0387-getroot-include-sys-mkdev.h-for-makedev.patch @@ -0,0 +1,27 @@ +From 677dcaa92bdd31f38d49a4d5575f2adca8479d94 Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Mon, 13 Apr 2015 19:52:28 +0300 +Subject: [PATCH 387/506] getroot: include sys/mkdev.h for makedev + +Solaris (like) systems need to include sys/mkdev.h for makedev() function. +--- + grub-core/osdep/unix/getroot.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c +index ccee7ce..b98b2df 100644 +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -57,6 +57,9 @@ + #endif + + #include ++#if defined(HAVE_SYS_MKDEV_H) ++#include ++#endif + + #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) + # include +-- +2.4.3 + diff --git a/0388-Remove-V-in-grub-mkrescue.c.patch b/0388-Remove-V-in-grub-mkrescue.c.patch new file mode 100644 index 0000000..3dae318 --- /dev/null +++ b/0388-Remove-V-in-grub-mkrescue.c.patch @@ -0,0 +1,26 @@ +From 70b002de55abbfd6b2d2f2ea4408078d93c9e0de Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 24 Apr 2015 17:52:30 +0200 +Subject: [PATCH 388/506] Remove -V in grub-mkrescue.c + +It clashhes with -V which is alias to -volid. +--- + util/grub-mkrescue.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c +index 5d3ec0d..815fc91 100644 +--- a/util/grub-mkrescue.c ++++ b/util/grub-mkrescue.c +@@ -409,7 +409,7 @@ args_to_eat (const char *arg) + return 2; + return 1; + } +- if (arg[1] == '?' || arg[1] == 'V') ++ if (arg[1] == '?') + return 1; + } + return 0; +-- +2.4.3 + diff --git a/0389-grub-mkconfig-use-pkgdatadir-in-scripts.patch b/0389-grub-mkconfig-use-pkgdatadir-in-scripts.patch new file mode 100644 index 0000000..6817b57 --- /dev/null +++ b/0389-grub-mkconfig-use-pkgdatadir-in-scripts.patch @@ -0,0 +1,167 @@ +From 104dff36eabe25dec143838167466fd6a8ddbc79 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Wed, 29 Apr 2015 19:18:54 +0300 +Subject: [PATCH 389/506] grub-mkconfig: use $pkgdatadir in scripts + +Otherwise scripts will source wrong grub-mkconfig_lib. +--- + util/grub-mkconfig.in | 3 +++ + util/grub.d/00_header.in | 2 +- + util/grub.d/10_hurd.in | 2 +- + util/grub.d/10_illumos.in | 2 +- + util/grub.d/10_kfreebsd.in | 2 +- + util/grub.d/10_linux.in | 2 +- + util/grub.d/10_netbsd.in | 2 +- + util/grub.d/10_windows.in | 2 +- + util/grub.d/10_xnu.in | 2 +- + util/grub.d/20_linux_xen.in | 2 +- + util/grub.d/30_os-prober.in | 2 +- + 11 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index d1fae49..3183744 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -33,6 +33,9 @@ datadir="@datadir@" + if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/@PACKAGE@" + fi ++# export it for scripts ++export pkgdatadir ++ + grub_cfg="" + grub_mkconfig_dir="${sysconfdir}"/grub.d + +diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in +index ce2ec81..93a9023 100644 +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -25,7 +25,7 @@ grub_lang=`echo $LANG | cut -d . -f 1` + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + # Do this as early as possible, since other commands might depend on it. + # (e.g. the `loadfont' command might need lvm or raid modules) +diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in +index 29b4554..59a9a48 100644 +--- a/util/grub.d/10_hurd.in ++++ b/util/grub.d/10_hurd.in +@@ -24,7 +24,7 @@ datarootdir="@datarootdir@" + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + CLASS="--class gnu --class os" + +diff --git a/util/grub.d/10_illumos.in b/util/grub.d/10_illumos.in +index 0de616e..a133e1b 100644 +--- a/util/grub.d/10_illumos.in ++++ b/util/grub.d/10_illumos.in +@@ -20,7 +20,7 @@ set -e + prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in +index 65f6c32..9d8e8fd 100644 +--- a/util/grub.d/10_kfreebsd.in ++++ b/util/grub.d/10_kfreebsd.in +@@ -20,7 +20,7 @@ set -e + prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index a2a84dc..859b608 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -21,7 +21,7 @@ prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in +index 9988a42..874f599 100644 +--- a/util/grub.d/10_netbsd.in ++++ b/util/grub.d/10_netbsd.in +@@ -20,7 +20,7 @@ set -e + prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in +index 48bd955..554c561 100644 +--- a/util/grub.d/10_windows.in ++++ b/util/grub.d/10_windows.in +@@ -24,7 +24,7 @@ datarootdir="@datarootdir@" + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + case "`uname 2>/dev/null`" in + CYGWIN*) ;; +diff --git a/util/grub.d/10_xnu.in b/util/grub.d/10_xnu.in +index 4270385..51ee2f4 100644 +--- a/util/grub.d/10_xnu.in ++++ b/util/grub.d/10_xnu.in +@@ -24,7 +24,7 @@ datarootdir="@datarootdir@" + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + osx_entry() { + if [ x$2 = x32 ]; then +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index de34c8d..f532fb9 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -21,7 +21,7 @@ prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in +index 4ee6015..5fc4f0c 100644 +--- a/util/grub.d/30_os-prober.in ++++ b/util/grub.d/30_os-prober.in +@@ -24,7 +24,7 @@ datarootdir="@datarootdir@" + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-. "@datadir@/@PACKAGE@/grub-mkconfig_lib" ++. "$pkgdatadir/grub-mkconfig_lib" + + if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then + exit 0 +-- +2.4.3 + diff --git a/0390-zfs-com.delphix-hole_birth-feature-support.patch b/0390-zfs-com.delphix-hole_birth-feature-support.patch new file mode 100644 index 0000000..82468a5 --- /dev/null +++ b/0390-zfs-com.delphix-hole_birth-feature-support.patch @@ -0,0 +1,55 @@ +From a1007c6af296172c788f3346ff3ad30b9020f723 Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Thu, 16 Apr 2015 08:22:08 +0300 +Subject: [PATCH 390/506] zfs: com.delphix:hole_birth feature support + +In the past birth was always zero for holes. This feature started +to make use of birth for holes as well, so change code to test for +valid DVA address instead. +--- + grub-core/fs/zfs/zfs.c | 6 ++++-- + include/grub/zfs/spa.h | 4 +++- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 0cbb84b..71c155d 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -280,7 +280,9 @@ grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key + */ + #define MAX_SUPPORTED_FEATURE_STRLEN 50 + static const char *spa_feature_names[] = { +- "org.illumos:lz4_compress",NULL ++ "org.illumos:lz4_compress", ++ "com.delphix:hole_birth", ++ NULL + }; + + static int +@@ -1751,7 +1753,7 @@ zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf, + + for (i = 0; i < SPA_GBH_NBLKPTRS; i++) + { +- if (zio_gb->zg_blkptr[i].blk_birth == 0) ++ if (BP_IS_HOLE(&zio_gb->zg_blkptr[i])) + continue; + + err = zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, data); +diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h +index 7edb8ab..df43b6b 100644 +--- a/include/grub/zfs/spa.h ++++ b/include/grub/zfs/spa.h +@@ -279,7 +279,9 @@ typedef struct blkptr { + + #define BP_IDENTITY(bp) (&(bp)->blk_dva[0]) + #define BP_IS_GANG(bp) DVA_GET_GANG(BP_IDENTITY(bp)) +-#define BP_IS_HOLE(bp) ((bp)->blk_birth == 0) ++#define DVA_IS_EMPTY(dva) ((dva)->dva_word[0] == 0ULL && \ ++ (dva)->dva_word[1] == 0ULL) ++#define BP_IS_HOLE(bp) DVA_IS_EMPTY(BP_IDENTITY(bp)) + + /* BP_IS_RAIDZ(bp) assumes no block compression */ + #define BP_IS_RAIDZ(bp) (DVA_GET_ASIZE(&(bp)->blk_dva[0]) > \ +-- +2.4.3 + diff --git a/0391-zfs-com.delphix-embedded_data-feature-support.patch b/0391-zfs-com.delphix-embedded_data-feature-support.patch new file mode 100644 index 0000000..3dea141 --- /dev/null +++ b/0391-zfs-com.delphix-embedded_data-feature-support.patch @@ -0,0 +1,204 @@ +From 4a7ea4003bd9f39e9bf2ebadbe4ab38f8874be66 Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Thu, 16 Apr 2015 08:23:22 +0300 +Subject: [PATCH 391/506] zfs: com.delphix:embedded_data feature support + +--- + grub-core/fs/zfs/zfs.c | 84 +++++++++++++++++++++++++++++++++++++++++--------- + include/grub/zfs/spa.h | 27 +++++++++++++--- + 2 files changed, 93 insertions(+), 18 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 71c155d..03d587d 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -282,6 +282,7 @@ grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key + static const char *spa_feature_names[] = { + "org.illumos:lz4_compress", + "com.delphix:hole_birth", ++ "com.delphix:embedded_data", + NULL + }; + +@@ -1803,6 +1804,39 @@ zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf, + } + + /* ++ * buf must be at least BPE_GET_PSIZE(bp) bytes long (which will never be ++ * more than BPE_PAYLOAD_SIZE bytes). ++ */ ++static grub_err_t ++decode_embedded_bp_compressed(const blkptr_t *bp, void *buf) ++{ ++ grub_size_t psize, i; ++ grub_uint8_t *buf8 = buf; ++ grub_uint64_t w = 0; ++ const grub_uint64_t *bp64 = (const grub_uint64_t *)bp; ++ ++ psize = BPE_GET_PSIZE(bp); ++ ++ /* ++ * Decode the words of the block pointer into the byte array. ++ * Low bits of first word are the first byte (little endian). ++ */ ++ for (i = 0; i < psize; i++) ++ { ++ if (i % sizeof (w) == 0) ++ { ++ /* beginning of a word */ ++ w = *bp64; ++ bp64++; ++ if (!BPE_IS_PAYLOADWORD(bp, bp64)) ++ bp64++; ++ } ++ buf8[i] = BF64_GET(w, (i % sizeof (w)) * 8, 8); ++ } ++ return GRUB_ERR_NONE; ++} ++ ++/* + * Read in a block of data, verify its checksum, decompress if needed, + * and put the uncompressed data in buf. + */ +@@ -1820,12 +1854,26 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, + *buf = NULL; + + checksum = (grub_zfs_to_cpu64((bp)->blk_prop, endian) >> 40) & 0xff; +- comp = (grub_zfs_to_cpu64((bp)->blk_prop, endian)>>32) & 0xff; ++ comp = (grub_zfs_to_cpu64((bp)->blk_prop, endian)>>32) & 0x7f; + encrypted = ((grub_zfs_to_cpu64((bp)->blk_prop, endian) >> 60) & 3); +- lsize = (BP_IS_HOLE(bp) ? 0 : +- (((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1) +- << SPA_MINBLOCKSHIFT)); +- psize = get_psize (bp, endian); ++ if (BP_IS_EMBEDDED(bp)) ++ { ++ if (BPE_GET_ETYPE(bp) != BP_EMBEDDED_TYPE_DATA) ++ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, ++ "unsupported embedded BP (type=%u)\n", ++ BPE_GET_ETYPE(bp)); ++ lsize = BPE_GET_LSIZE(bp); ++ psize = BF64_GET_SB(grub_zfs_to_cpu64 ((bp)->blk_prop, endian), 25, 7, 0, 1); ++ } ++ else ++ { ++ lsize = (BP_IS_HOLE(bp) ? 0 : ++ (((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1) ++ << SPA_MINBLOCKSHIFT)); ++ psize = get_psize (bp, endian); ++ } ++ grub_dprintf("zfs", "zio_read: E %d: size %" PRIdGRUB_SSIZE "/%" ++ PRIdGRUB_SSIZE "\n", (int)BP_IS_EMBEDDED(bp), lsize, psize); + + if (size) + *size = lsize; +@@ -1849,23 +1897,31 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, + compbuf = *buf = grub_malloc (lsize); + + grub_dprintf ("zfs", "endian = %d\n", endian); +- err = zio_read_data (bp, endian, compbuf, data); ++ if (BP_IS_EMBEDDED(bp)) ++ err = decode_embedded_bp_compressed(bp, compbuf); ++ else ++ { ++ err = zio_read_data (bp, endian, compbuf, data); ++ grub_memset (compbuf, 0, ALIGN_UP (psize, 16) - psize); ++ } + if (err) + { + grub_free (compbuf); + *buf = NULL; + return err; + } +- grub_memset (compbuf, 0, ALIGN_UP (psize, 16) - psize); + +- err = zio_checksum_verify (zc, checksum, endian, +- compbuf, psize); +- if (err) ++ if (!BP_IS_EMBEDDED(bp)) + { +- grub_dprintf ("zfs", "incorrect checksum\n"); +- grub_free (compbuf); +- *buf = NULL; +- return err; ++ err = zio_checksum_verify (zc, checksum, endian, ++ compbuf, psize); ++ if (err) ++ { ++ grub_dprintf ("zfs", "incorrect checksum\n"); ++ grub_free (compbuf); ++ *buf = NULL; ++ return err; ++ } + } + + if (encrypted) +diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h +index df43b6b..8dd1fa8 100644 +--- a/include/grub/zfs/spa.h ++++ b/include/grub/zfs/spa.h +@@ -126,7 +126,7 @@ typedef struct zio_cksum { + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 5 |G| offset3 | + * +-------+-------+-------+-------+-------+-------+-------+-------+ +- * 6 |BDX|lvl| type | cksum | comp | PSIZE | LSIZE | ++ * 6 |BDX|lvl| type | cksum |E| comp| PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 7 | padding | + * +-------+-------+-------+-------+-------+-------+-------+-------+ +@@ -160,7 +160,8 @@ typedef struct zio_cksum { + * G gang block indicator + * B byteorder (endianness) + * D dedup +- * X unused ++ * X encryption ++ * E blkptr_t contains embedded data + * lvl level of indirection + * type DMU object type + * phys birth txg of block allocation; zero if same as logical birth txg +@@ -203,8 +204,8 @@ typedef struct blkptr { + #define BP_SET_LSIZE(bp, x) \ + BF64_SET_SB((bp)->blk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1, x) + +-#define BP_GET_COMPRESS(bp) BF64_GET((bp)->blk_prop, 32, 8) +-#define BP_SET_COMPRESS(bp, x) BF64_SET((bp)->blk_prop, 32, 8, x) ++#define BP_GET_COMPRESS(bp) BF64_GET((bp)->blk_prop, 32, 7) ++#define BP_SET_COMPRESS(bp, x) BF64_SET((bp)->blk_prop, 32, 7, x) + + #define BP_GET_CHECKSUM(bp) BF64_GET((bp)->blk_prop, 40, 8) + #define BP_SET_CHECKSUM(bp, x) BF64_SET((bp)->blk_prop, 40, 8, x) +@@ -215,6 +216,8 @@ typedef struct blkptr { + #define BP_GET_LEVEL(bp) BF64_GET((bp)->blk_prop, 56, 5) + #define BP_SET_LEVEL(bp, x) BF64_SET((bp)->blk_prop, 56, 5, x) + ++#define BP_IS_EMBEDDED(bp) BF64_GET((bp)->blk_prop, 39, 1) ++ + #define BP_GET_PROP_BIT_61(bp) BF64_GET((bp)->blk_prop, 61, 1) + #define BP_SET_PROP_BIT_61(bp, x) BF64_SET((bp)->blk_prop, 61, 1, x) + +@@ -277,6 +280,22 @@ typedef struct blkptr { + (zcp)->zc_word[3] = w3; \ + } + ++#define BPE_GET_ETYPE(bp) BP_GET_CHECKSUM(bp) ++#define BPE_GET_LSIZE(bp) \ ++ BF64_GET_SB((bp)->blk_prop, 0, 25, 0, 1) ++#define BPE_GET_PSIZE(bp) \ ++ BF64_GET_SB((bp)->blk_prop, 25, 7, 0, 1) ++ ++typedef enum bp_embedded_type { ++ BP_EMBEDDED_TYPE_DATA, ++ NUM_BP_EMBEDDED_TYPES ++} bp_embedded_type_t; ++ ++#define BPE_NUM_WORDS 14 ++#define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof(grub_uint64_t)) ++#define BPE_IS_PAYLOADWORD(bp, wp) \ ++ ((wp) != &(bp)->blk_prop && (wp) != &(bp)->blk_birth) ++ + #define BP_IDENTITY(bp) (&(bp)->blk_dva[0]) + #define BP_IS_GANG(bp) DVA_GET_GANG(BP_IDENTITY(bp)) + #define DVA_IS_EMPTY(dva) ((dva)->dva_word[0] == 0ULL && \ +-- +2.4.3 + diff --git a/0392-zfs-add-missing-NULL-check-and-fix-incorrect-buffer-.patch b/0392-zfs-add-missing-NULL-check-and-fix-incorrect-buffer-.patch new file mode 100644 index 0000000..c443e7a --- /dev/null +++ b/0392-zfs-add-missing-NULL-check-and-fix-incorrect-buffer-.patch @@ -0,0 +1,51 @@ +From 6210b8e8f7b4640711dd449ca8301d06fee62334 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 3 May 2015 18:55:13 +0300 +Subject: [PATCH 392/506] zfs: add missing NULL check and fix incorrect buffer + overwrite + +grub_memset should zero out padding after data end. It is not clear +why it is needed at all - ZFS block is at least 512 bytes and power +of two, so it is always multiple of 16 bytes. This grub_memset +apparently never did anything. +--- + grub-core/fs/zfs/zfs.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 03d587d..08ed453 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -1887,14 +1887,12 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, + "compression algorithm %s not supported\n", decomp_table[comp].name); + + if (comp != ZIO_COMPRESS_OFF) +- { +- /* It's not really necessary to align to 16, just for safety. */ +- compbuf = grub_malloc (ALIGN_UP (psize, 16)); +- if (! compbuf) +- return grub_errno; +- } ++ /* It's not really necessary to align to 16, just for safety. */ ++ compbuf = grub_malloc (ALIGN_UP (psize, 16)); + else + compbuf = *buf = grub_malloc (lsize); ++ if (! compbuf) ++ return grub_errno; + + grub_dprintf ("zfs", "endian = %d\n", endian); + if (BP_IS_EMBEDDED(bp)) +@@ -1902,7 +1900,9 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, + else + { + err = zio_read_data (bp, endian, compbuf, data); +- grub_memset (compbuf, 0, ALIGN_UP (psize, 16) - psize); ++ /* FIXME is it really necessary? */ ++ if (comp != ZIO_COMPRESS_OFF) ++ grub_memset (compbuf + psize, 0, ALIGN_UP (psize, 16) - psize); + } + if (err) + { +-- +2.4.3 + diff --git a/0393-efinet-memory-leak-on-module-removal.patch b/0393-efinet-memory-leak-on-module-removal.patch new file mode 100644 index 0000000..5be04eb --- /dev/null +++ b/0393-efinet-memory-leak-on-module-removal.patch @@ -0,0 +1,30 @@ +From 8d3c4544ffdd0289a4b0bdeb0cdc6355f801a4b3 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 4 May 2015 08:08:57 +0300 +Subject: [PATCH 393/506] efinet: memory leak on module removal + +--- + grub-core/net/drivers/efi/efinet.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index f171f20..eb1e682 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -278,6 +278,12 @@ GRUB_MOD_FINI(efinet) + + FOR_NET_CARDS_SAFE (card, next) + if (card->driver == &efidriver) +- grub_net_card_unregister (card); ++ { ++ grub_net_card_unregister (card); ++ grub_free (card->txbuf); ++ grub_free (card->rcvbuf); ++ grub_free (card->name); ++ grub_free (card); ++ } + } + +-- +2.4.3 + diff --git a/0394-efinet-cannot-free-const-char-pointer.patch b/0394-efinet-cannot-free-const-char-pointer.patch new file mode 100644 index 0000000..4e82769 --- /dev/null +++ b/0394-efinet-cannot-free-const-char-pointer.patch @@ -0,0 +1,25 @@ +From 47b2bee3ef0ea60fc3f5bfc37f3784e559385297 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 4 May 2015 08:39:29 +0300 +Subject: [PATCH 394/506] efinet: cannot free const char * pointer + +--- + grub-core/net/drivers/efi/efinet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index eb1e682..a879dec 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -282,7 +282,7 @@ GRUB_MOD_FINI(efinet) + grub_net_card_unregister (card); + grub_free (card->txbuf); + grub_free (card->rcvbuf); +- grub_free (card->name); ++ grub_free ((char *)card->name); + grub_free (card); + } + } +-- +2.4.3 + diff --git a/0395-Revert-efinet-memory-leak-on-module-removal.patch b/0395-Revert-efinet-memory-leak-on-module-removal.patch new file mode 100644 index 0000000..f0920a1 --- /dev/null +++ b/0395-Revert-efinet-memory-leak-on-module-removal.patch @@ -0,0 +1,34 @@ +From cc699535e57e0d0f099090e64a63037c7834f104 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Mon, 4 May 2015 09:13:53 +0300 +Subject: [PATCH 395/506] Revert "efinet: memory leak on module removal" + +This reverts commits 47b2bee3ef0ea60fc3f5bfc37f3784e559385297 +and 8d3c4544ffdd0289a4b0bdeb0cdc6355f801a4b3. It is not safe +to free allocated cards, dangling pointers main remain. Such +cleanup requires more changes in net core. +--- + grub-core/net/drivers/efi/efinet.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index a879dec..f171f20 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -278,12 +278,6 @@ GRUB_MOD_FINI(efinet) + + FOR_NET_CARDS_SAFE (card, next) + if (card->driver == &efidriver) +- { +- grub_net_card_unregister (card); +- grub_free (card->txbuf); +- grub_free (card->rcvbuf); +- grub_free ((char *)card->name); +- grub_free (card); +- } ++ grub_net_card_unregister (card); + } + +-- +2.4.3 + diff --git a/0396-arm64-Export-useful-functions-from-linux.c.patch b/0396-arm64-Export-useful-functions-from-linux.c.patch new file mode 100644 index 0000000..a8f280c --- /dev/null +++ b/0396-arm64-Export-useful-functions-from-linux.c.patch @@ -0,0 +1,291 @@ +From f8451af8251a3866cb8b7307b9917dd5d34fbd0a Mon Sep 17 00:00:00 2001 +From: Fu Wei +Date: Thu, 7 May 2015 15:11:04 +0200 +Subject: [PATCH 396/506] arm64: Export useful functions from linux.c + +Signed-off-by: Fu Wei +--- + gentpl.py | 2 +- + grub-core/loader/arm64/linux.c | 59 +++++++++++++++++++++--------------------- + grub-core/loader/i386/linux.c | 11 ++++---- + grub-core/loader/linux.c | 3 ++- + include/grub/arm64/linux.h | 11 ++++++++ + 5 files changed, 49 insertions(+), 37 deletions(-) + +diff --git a/gentpl.py b/gentpl.py +index f177883..0fd5ba4 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -759,7 +759,7 @@ def image(defn, platform): + if test x$(TARGET_APPLE_LINKER) = x1; then \ + $(MACHO2IMG) $< $@; \ + else \ +- $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ ++ $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .hash -R .dynsym -R .dynstr -R .rel.text $< $@; \ + fi + """) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 564a75a..987f5b9 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -33,12 +33,6 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + +-#define GRUB_EFI_PAGE_SHIFT 12 +-#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) +-#define GRUB_EFI_PE_MAGIC 0x5A4D +- +-static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; +- + static grub_dl_t my_mod; + static int loaded; + +@@ -58,6 +52,7 @@ static void * + get_firmware_fdt (void) + { + grub_efi_configuration_table_t *tables; ++ grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + void *firmware_fdt = NULL; + unsigned int i; + +@@ -75,8 +70,8 @@ get_firmware_fdt (void) + return firmware_fdt; + } + +-static void +-get_fdt (void) ++void * ++grub_linux_get_fdt (void) + { + void *raw_fdt; + grub_size_t size; +@@ -99,7 +94,7 @@ get_fdt (void) + grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size); + fdt = grub_efi_allocate_pages (0, BYTES_TO_PAGES (size)); + if (!fdt) +- return; ++ return NULL; + + if (raw_fdt) + { +@@ -110,10 +105,11 @@ get_fdt (void) + { + grub_fdt_create_empty_tree (fdt, size); + } ++ return fdt; + } + +-static grub_err_t +-check_kernel (struct grub_arm64_linux_kernel_header *lh) ++grub_err_t ++grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) + { + if (lh->magic != GRUB_ARM64_LINUX_MAGIC) + return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); +@@ -131,14 +127,14 @@ check_kernel (struct grub_arm64_linux_kernel_header *lh) + } + + static grub_err_t +-finalize_params (void) ++finalize_params_linux (void) + { + grub_efi_boot_services_t *b; ++ grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + grub_efi_status_t status; + int node, retval; + +- get_fdt (); +- if (!fdt) ++ if (!grub_linux_get_fdt ()) + goto failure; + + node = grub_fdt_find_subnode (fdt, 0, "chosen"); +@@ -240,21 +236,16 @@ out: + return grub_errno; + } + +-static grub_err_t +-grub_linux_boot (void) ++grub_err_t ++grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) + { + grub_efi_memory_mapped_device_path_t *mempath; + grub_efi_handle_t image_handle; + grub_efi_boot_services_t *b; + grub_efi_status_t status; +- grub_err_t retval; + grub_efi_loaded_image_t *loaded_image; + int len; + +- retval = finalize_params(); +- if (retval != GRUB_ERR_NONE) +- return retval; +- + mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); + if (!mempath) + return grub_errno; +@@ -263,8 +254,8 @@ grub_linux_boot (void) + mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; + mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); + mempath[0].memory_type = GRUB_EFI_LOADER_DATA; +- mempath[0].start_address = (grub_addr_t) kernel_addr; +- mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size; ++ mempath[0].start_address = addr; ++ mempath[0].end_address = addr + size; + + mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; + mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; +@@ -273,16 +264,16 @@ grub_linux_boot (void) + b = grub_efi_system_table->boot_services; + status = b->load_image (0, grub_efi_image_handle, + (grub_efi_device_path_t *) mempath, +- kernel_addr, kernel_size, &image_handle); ++ (void *) addr, size, &image_handle); + if (status != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); + +- grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); ++ grub_dprintf ("linux", "linux command line: '%s'\n", args); + + /* Convert command line to UCS-2 */ + loaded_image = grub_efi_get_loaded_image (image_handle); + loaded_image->load_options_size = len = +- (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); ++ (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); + loaded_image->load_options = + grub_efi_allocate_pages (0, + BYTES_TO_PAGES (loaded_image->load_options_size)); +@@ -291,9 +282,9 @@ grub_linux_boot (void) + + loaded_image->load_options_size = + 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, +- (grub_uint8_t *) linux_args, len, NULL); ++ (grub_uint8_t *) args, len, NULL); + +- grub_dprintf("linux", "starting image %p\n", image_handle); ++ grub_dprintf ("linux", "starting image %p\n", image_handle); + status = b->start_image (image_handle, 0, NULL); + + /* When successful, not reached */ +@@ -305,6 +296,16 @@ grub_linux_boot (void) + } + + static grub_err_t ++grub_linux_boot (void) ++{ ++ if (finalize_params_linux () != GRUB_ERR_NONE) ++ return grub_errno; ++ ++ return (grub_arm64_uefi_boot_image((grub_addr_t)kernel_addr, ++ kernel_size, linux_args)); ++} ++ ++static grub_err_t + grub_linux_unload (void) + { + grub_dl_unref (my_mod); +@@ -400,7 +401,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + if (grub_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh)) + return grub_errno; + +- if (check_kernel (&lh) != GRUB_ERR_NONE) ++ if (grub_arm64_uefi_check_image (&lh) != GRUB_ERR_NONE) + goto fail; + + grub_loader_unset(); +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 291f728..fddcc46 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -69,7 +69,6 @@ static grub_addr_t prot_mode_target; + static void *initrd_mem; + static grub_addr_t initrd_mem_target; + static grub_size_t prot_init_space; +-static grub_uint32_t initrd_pages; + static struct grub_relocator *relocator = NULL; + static void *efi_mmap_buf; + static grub_size_t maximal_cmdline_size; +@@ -1046,7 +1045,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- grub_size_t size = 0; ++ grub_size_t size = 0, aligned_size = 0; + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + grub_err_t err; +@@ -1068,8 +1067,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + goto fail; + + size = grub_get_initrd_size (&initrd_ctx); +- +- initrd_pages = (page_align (size) >> 12); ++ aligned_size = ALIGN_UP (size, 4096); + + /* Get the highest address available for the initrd. */ + if (grub_le_to_cpu16 (linux_params.version) >= 0x0203) +@@ -1097,7 +1095,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + addr_min = (grub_addr_t) prot_mode_target + prot_init_space; + + /* Put the initrd as high as possible, 4KiB aligned. */ +- addr = (addr_max - size) & ~0xFFF; ++ addr = (addr_max - aligned_size) & ~0xFFF; + + if (addr < addr_min) + { +@@ -1108,7 +1106,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_relocator_chunk_t ch; + err = grub_relocator_alloc_chunk_align (relocator, &ch, +- addr_min, addr, size, 0x1000, ++ addr_min, addr, aligned_size, ++ 0x1000, + GRUB_RELOCATOR_PREFERENCE_HIGH, + 1); + if (err) +diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c +index 117232f..a63a11a 100644 +--- a/grub-core/loader/linux.c ++++ b/grub-core/loader/linux.c +@@ -205,7 +205,8 @@ grub_initrd_init (int argc, char *argv[], + initrd_ctx->nfiles++; + initrd_ctx->components[i].size + = grub_file_size (initrd_ctx->components[i].file); +- initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); ++ if (argc != 1) ++ initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); + } + + if (newc) +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index 864e5dc..65796d9 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -23,6 +23,10 @@ + + #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + ++#define GRUB_EFI_PAGE_SHIFT 12 ++#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) ++#define GRUB_EFI_PE_MAGIC 0x5A4D ++ + /* From linux/Documentation/arm64/booting.txt */ + struct grub_arm64_linux_kernel_header + { +@@ -38,4 +42,11 @@ struct grub_arm64_linux_kernel_header + grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ + }; + ++/* Declare the functions for getting dtb and checking/booting image */ ++void *grub_linux_get_fdt (void); ++grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header ++ *lh); ++grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, ++ char *args); ++ + #endif /* ! GRUB_LINUX_CPU_HEADER */ +-- +2.4.3 + diff --git a/0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch b/0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch new file mode 100644 index 0000000..2fe7951 --- /dev/null +++ b/0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch @@ -0,0 +1,34 @@ +From cfe2ae89360954f0cbc585f5c72e60a07eb066a2 Mon Sep 17 00:00:00 2001 +From: Fu Wei +Date: Thu, 7 May 2015 15:13:25 +0200 +Subject: [PATCH 397/506] fdt.h: Add grub_fdt_set_reg64 macro + +Signed-off-by: Fu Wei +--- + include/grub/fdt.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/include/grub/fdt.h b/include/grub/fdt.h +index 3016998..fdfca75 100644 +--- a/include/grub/fdt.h ++++ b/include/grub/fdt.h +@@ -117,4 +117,16 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \ + }) + ++/* Setup "reg" property for ++ * #address-cells = <0x2> ++ * #size-cells = <0x2> ++ */ ++#define grub_fdt_set_reg64(fdt, nodeoffset, addr, size) \ ++({ \ ++ grub_uint64_t reg_64[2]; \ ++ reg_64[0] = grub_cpu_to_be64(addr); \ ++ reg_64[1] = grub_cpu_to_be64(size); \ ++ grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ ++}) ++ + #endif /* ! GRUB_FDT_HEADER */ +-- +2.4.3 + diff --git a/0398-Revert-parts-accidentally-committed-2-commits-ago.patch b/0398-Revert-parts-accidentally-committed-2-commits-ago.patch new file mode 100644 index 0000000..6388465 --- /dev/null +++ b/0398-Revert-parts-accidentally-committed-2-commits-ago.patch @@ -0,0 +1,91 @@ +From 9f731abc7f960a96a4c58d89717915e632837389 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 May 2015 16:21:34 +0200 +Subject: [PATCH 398/506] Revert parts accidentally committed 2 commits ago. + +--- + gentpl.py | 2 +- + grub-core/loader/i386/linux.c | 11 ++++++----- + grub-core/loader/linux.c | 3 +-- + 3 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/gentpl.py b/gentpl.py +index 0fd5ba4..f177883 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -759,7 +759,7 @@ def image(defn, platform): + if test x$(TARGET_APPLE_LINKER) = x1; then \ + $(MACHO2IMG) $< $@; \ + else \ +- $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .hash -R .dynsym -R .dynstr -R .rel.text $< $@; \ ++ $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ + fi + """) + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index fddcc46..291f728 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -69,6 +69,7 @@ static grub_addr_t prot_mode_target; + static void *initrd_mem; + static grub_addr_t initrd_mem_target; + static grub_size_t prot_init_space; ++static grub_uint32_t initrd_pages; + static struct grub_relocator *relocator = NULL; + static void *efi_mmap_buf; + static grub_size_t maximal_cmdline_size; +@@ -1045,7 +1046,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- grub_size_t size = 0, aligned_size = 0; ++ grub_size_t size = 0; + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + grub_err_t err; +@@ -1067,7 +1068,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + goto fail; + + size = grub_get_initrd_size (&initrd_ctx); +- aligned_size = ALIGN_UP (size, 4096); ++ ++ initrd_pages = (page_align (size) >> 12); + + /* Get the highest address available for the initrd. */ + if (grub_le_to_cpu16 (linux_params.version) >= 0x0203) +@@ -1095,7 +1097,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + addr_min = (grub_addr_t) prot_mode_target + prot_init_space; + + /* Put the initrd as high as possible, 4KiB aligned. */ +- addr = (addr_max - aligned_size) & ~0xFFF; ++ addr = (addr_max - size) & ~0xFFF; + + if (addr < addr_min) + { +@@ -1106,8 +1108,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_relocator_chunk_t ch; + err = grub_relocator_alloc_chunk_align (relocator, &ch, +- addr_min, addr, aligned_size, +- 0x1000, ++ addr_min, addr, size, 0x1000, + GRUB_RELOCATOR_PREFERENCE_HIGH, + 1); + if (err) +diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c +index a63a11a..117232f 100644 +--- a/grub-core/loader/linux.c ++++ b/grub-core/loader/linux.c +@@ -205,8 +205,7 @@ grub_initrd_init (int argc, char *argv[], + initrd_ctx->nfiles++; + initrd_ctx->components[i].size + = grub_file_size (initrd_ctx->components[i].file); +- if (argc != 1) +- initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); ++ initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); + } + + if (newc) +-- +2.4.3 + diff --git a/0399-linux.c-Ensure-that-initrd-is-page-aligned.patch b/0399-linux.c-Ensure-that-initrd-is-page-aligned.patch new file mode 100644 index 0000000..cdf3cc3 --- /dev/null +++ b/0399-linux.c-Ensure-that-initrd-is-page-aligned.patch @@ -0,0 +1,62 @@ +From e5b4ba8c2b2cfbb84e5b8254fb7d0b15b799fe78 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 May 2015 16:23:39 +0200 +Subject: [PATCH 399/506] linux.c: Ensure that initrd is page-aligned. + +--- + grub-core/loader/i386/linux.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 291f728..fddcc46 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -69,7 +69,6 @@ static grub_addr_t prot_mode_target; + static void *initrd_mem; + static grub_addr_t initrd_mem_target; + static grub_size_t prot_init_space; +-static grub_uint32_t initrd_pages; + static struct grub_relocator *relocator = NULL; + static void *efi_mmap_buf; + static grub_size_t maximal_cmdline_size; +@@ -1046,7 +1045,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- grub_size_t size = 0; ++ grub_size_t size = 0, aligned_size = 0; + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + grub_err_t err; +@@ -1068,8 +1067,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + goto fail; + + size = grub_get_initrd_size (&initrd_ctx); +- +- initrd_pages = (page_align (size) >> 12); ++ aligned_size = ALIGN_UP (size, 4096); + + /* Get the highest address available for the initrd. */ + if (grub_le_to_cpu16 (linux_params.version) >= 0x0203) +@@ -1097,7 +1095,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + addr_min = (grub_addr_t) prot_mode_target + prot_init_space; + + /* Put the initrd as high as possible, 4KiB aligned. */ +- addr = (addr_max - size) & ~0xFFF; ++ addr = (addr_max - aligned_size) & ~0xFFF; + + if (addr < addr_min) + { +@@ -1108,7 +1106,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_relocator_chunk_t ch; + err = grub_relocator_alloc_chunk_align (relocator, &ch, +- addr_min, addr, size, 0x1000, ++ addr_min, addr, aligned_size, ++ 0x1000, + GRUB_RELOCATOR_PREFERENCE_HIGH, + 1); + if (err) +-- +2.4.3 + diff --git a/0400-grub-mkrescue-Recognize-output-as-an-alias-of-output.patch b/0400-grub-mkrescue-Recognize-output-as-an-alias-of-output.patch new file mode 100644 index 0000000..5777191 --- /dev/null +++ b/0400-grub-mkrescue-Recognize-output-as-an-alias-of-output.patch @@ -0,0 +1,33 @@ +From 5fd1cb980af603126b82f421417f15326b0ca38d Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 May 2015 16:34:34 +0200 +Subject: [PATCH 400/506] grub-mkrescue: Recognize -output as an alias of + --output. + +This helps us to be in line with xorriso -as mkisofs. + +Suggested by: Thomas Schmitt +--- + util/grub-mkrescue.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c +index 815fc91..5a7993f 100644 +--- a/util/grub-mkrescue.c ++++ b/util/grub-mkrescue.c +@@ -451,6 +451,12 @@ main (int argc, char *argv[]) + int i; + for (i = 1; i < argc; i++) + { ++ if (strcmp (argv[i], "-output") == 0) { ++ argp_argv[argp_argc++] = "--output"; ++ i++; ++ argp_argv[argp_argc++] = argv[i]; ++ continue; ++ } + switch (args_to_eat (argv[i])) + { + case 2: +-- +2.4.3 + diff --git a/0401-grub-install-common-Increase-buf-size-to-8192-as-mod.patch b/0401-grub-install-common-Increase-buf-size-to-8192-as-mod.patch new file mode 100644 index 0000000..ece663e --- /dev/null +++ b/0401-grub-install-common-Increase-buf-size-to-8192-as-mod.patch @@ -0,0 +1,26 @@ +From 9916ed6f82d12b203b61cbc6d6bb9c56af707c02 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 May 2015 17:09:58 +0200 +Subject: [PATCH 401/506] grub-install-common: Increase buf size to 8192 as + modinfo.sh is bigger. + +--- + util/grub-install-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index 37c1a98..0364b32 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -902,7 +902,7 @@ grub_install_get_target (const char *src) + { + char *fn; + grub_util_fd_t f; +- char buf[2048]; ++ char buf[8192]; + ssize_t r; + char *c, *pl, *p; + size_t i; +-- +2.4.3 + diff --git a/0402-i386-relocator-Remove-unused-extern-grub_relocator64.patch b/0402-i386-relocator-Remove-unused-extern-grub_relocator64.patch new file mode 100644 index 0000000..4589d1a --- /dev/null +++ b/0402-i386-relocator-Remove-unused-extern-grub_relocator64.patch @@ -0,0 +1,26 @@ +From 71783dc9780c1e1897a59ec3273e6259807f47eb Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +Date: Thu, 7 May 2015 18:00:47 +0200 +Subject: [PATCH 402/506] i386/relocator: Remove unused extern + grub_relocator64_rip_addr + +Signed-off-by: Daniel Kiper +--- + grub-core/lib/i386/relocator.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/relocator.c +index ffaf25f..71dd4f0 100644 +--- a/grub-core/lib/i386/relocator.c ++++ b/grub-core/lib/i386/relocator.c +@@ -64,7 +64,6 @@ extern grub_uint64_t grub_relocator64_rbx; + extern grub_uint64_t grub_relocator64_rcx; + extern grub_uint64_t grub_relocator64_rdx; + extern grub_uint64_t grub_relocator64_rip; +-extern grub_uint64_t grub_relocator64_rip_addr; + extern grub_uint64_t grub_relocator64_rsp; + extern grub_uint64_t grub_relocator64_rsi; + extern grub_addr_t grub_relocator64_cr3; +-- +2.4.3 + diff --git a/0403-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch b/0403-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch new file mode 100644 index 0000000..6601d9a --- /dev/null +++ b/0403-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch @@ -0,0 +1,69 @@ +From a8c473288d3f0a5e17a903a5121dea1a695dda3b Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:24:24 +0300 +Subject: [PATCH 403/506] loader/linux: do not pad initrd with zeroes at the + end + +Syslinux memdisk is using initrd image and needs to know uncompressed +size in advance. For gzip uncompressed size is at the end of compressed +stream. Grub padded each input file to 4 bytes at the end, which means +syslinux got wrong size. + +Linux initramfs loader apparently does not care about trailing alignment. +So change code to align beginning of each file instead which atomatically +gives us the correct size for single file. + +Reported-By: David Shaw +--- + grub-core/loader/linux.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c +index 117232f..d2cd591 100644 +--- a/grub-core/loader/linux.c ++++ b/grub-core/loader/linux.c +@@ -161,6 +161,9 @@ grub_initrd_init (int argc, char *argv[], + for (i = 0; i < argc; i++) + { + const char *fname = argv[i]; ++ ++ initrd_ctx->size = ALIGN_UP (initrd_ctx->size, 4); ++ + if (grub_memcmp (argv[i], "newc:", 5) == 0) + { + const char *ptr, *eptr; +@@ -205,7 +208,7 @@ grub_initrd_init (int argc, char *argv[], + initrd_ctx->nfiles++; + initrd_ctx->components[i].size + = grub_file_size (initrd_ctx->components[i].file); +- initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); ++ initrd_ctx->size += initrd_ctx->components[i].size; + } + + if (newc) +@@ -248,10 +251,12 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, + int i; + int newc = 0; + struct dir *root = 0; ++ grub_ssize_t cursize = 0; + + for (i = 0; i < initrd_ctx->nfiles; i++) + { +- grub_ssize_t cursize; ++ grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ++ ptr += ALIGN_UP_OVERHEAD (cursize, 4); + + if (initrd_ctx->components[i].newc_name) + { +@@ -283,8 +288,6 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, + return grub_errno; + } + ptr += cursize; +- grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); +- ptr += ALIGN_UP_OVERHEAD (cursize, 4); + } + if (newc) + ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); +-- +2.4.3 + diff --git a/0404-convert-to-not-from-CPU-byte-order-in-DNS-receive-fu.patch b/0404-convert-to-not-from-CPU-byte-order-in-DNS-receive-fu.patch new file mode 100644 index 0000000..24cfa16 --- /dev/null +++ b/0404-convert-to-not-from-CPU-byte-order-in-DNS-receive-fu.patch @@ -0,0 +1,44 @@ +From 16a7e723ea37d4596348a76f54a6675c6e03fedc Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:33:28 +0300 +Subject: [PATCH 404/506] convert to, not from, CPU byte order in DNS receive + function + +--- + grub-core/net/dns.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c +index 0b771fb..9d0c8fc 100644 +--- a/grub-core/net/dns.c ++++ b/grub-core/net/dns.c +@@ -262,7 +262,7 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), + grub_netbuff_free (nb); + return GRUB_ERR_NONE; + } +- for (i = 0; i < grub_cpu_to_be16 (head->qdcount); i++) ++ for (i = 0; i < grub_be_to_cpu16 (head->qdcount); i++) + { + if (ptr >= nb->tail) + { +@@ -277,7 +277,7 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), + ptr += 4; + } + *data->addresses = grub_malloc (sizeof ((*data->addresses)[0]) +- * grub_cpu_to_be16 (head->ancount)); ++ * grub_be_to_cpu16 (head->ancount)); + if (!*data->addresses) + { + grub_errno = GRUB_ERR_NONE; +@@ -286,7 +286,7 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), + } + reparse_ptr = ptr; + reparse: +- for (i = 0, ptr = reparse_ptr; i < grub_cpu_to_be16 (head->ancount); i++) ++ for (i = 0, ptr = reparse_ptr; i < grub_be_to_cpu16 (head->ancount); i++) + { + int ignored = 0; + grub_uint8_t class; +-- +2.4.3 + diff --git a/0405-efidisk-move-device-path-helpers-in-core-for-efinet.patch b/0405-efidisk-move-device-path-helpers-in-core-for-efinet.patch new file mode 100644 index 0000000..20e8363 --- /dev/null +++ b/0405-efidisk-move-device-path-helpers-in-core-for-efinet.patch @@ -0,0 +1,207 @@ +From 7b386b703154c0901c4616badf18ddb260954bc1 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:37:16 +0300 +Subject: [PATCH 405/506] efidisk: move device path helpers in core for efinet + +--- + grub-core/disk/efi/efidisk.c | 61 ++++++++------------------------------------ + grub-core/kern/efi/efi.c | 41 +++++++++++++++++++++++++++++ + include/grub/efi/efi.h | 4 +++ + 3 files changed, 55 insertions(+), 51 deletions(-) + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index 60a6d3c..a8783a3 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -43,47 +43,6 @@ static struct grub_efidisk_data *fd_devices; + static struct grub_efidisk_data *hd_devices; + static struct grub_efidisk_data *cd_devices; + +-/* Duplicate a device path. */ +-static grub_efi_device_path_t * +-duplicate_device_path (const grub_efi_device_path_t *dp) +-{ +- grub_efi_device_path_t *p; +- grub_size_t total_size = 0; +- +- for (p = (grub_efi_device_path_t *) dp; +- ; +- p = GRUB_EFI_NEXT_DEVICE_PATH (p)) +- { +- total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); +- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) +- break; +- } +- +- p = grub_malloc (total_size); +- if (! p) +- return 0; +- +- grub_memcpy (p, dp, total_size); +- return p; +-} +- +-/* Return the device path node right before the end node. */ +-static grub_efi_device_path_t * +-find_last_device_path (const grub_efi_device_path_t *dp) +-{ +- grub_efi_device_path_t *next, *p; +- +- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) +- return 0; +- +- for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); +- ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); +- p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) +- ; +- +- return p; +-} +- + static struct grub_efidisk_data * + make_devices (void) + { +@@ -110,7 +69,7 @@ make_devices (void) + if (! dp) + continue; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + if (! ldp) + /* This is empty. Why? */ + continue; +@@ -150,11 +109,11 @@ find_parent_device (struct grub_efidisk_data *devices, + grub_efi_device_path_t *dp, *ldp; + struct grub_efidisk_data *parent; + +- dp = duplicate_device_path (d->device_path); ++ dp = grub_efi_duplicate_device_path (d->device_path); + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp->length = sizeof (*ldp); +@@ -180,11 +139,11 @@ is_child (struct grub_efidisk_data *child, + grub_efi_device_path_t *dp, *ldp; + int ret; + +- dp = duplicate_device_path (child->device_path); ++ dp = grub_efi_duplicate_device_path (child->device_path); + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp->length = sizeof (*ldp); +@@ -207,8 +166,8 @@ add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d) + { + int ret; + +- ret = grub_efi_compare_device_paths (find_last_device_path ((*p)->device_path), +- find_last_device_path (d->device_path)); ++ ret = grub_efi_compare_device_paths (grub_efi_find_last_device_path ((*p)->device_path), ++ grub_efi_find_last_device_path (d->device_path)); + if (ret == 0) + ret = grub_efi_compare_device_paths ((*p)->device_path, + d->device_path); +@@ -795,7 +754,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + if (! ldp) + return 0; + +@@ -810,14 +769,14 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + + /* It is necessary to duplicate the device path so that GRUB + can overwrite it. */ +- dup_dp = duplicate_device_path (dp); ++ dup_dp = grub_efi_duplicate_device_path (dp); + if (! dup_dp) + return 0; + + while (1) + { + grub_efi_device_path_t *dup_ldp; +- dup_ldp = find_last_device_path (dup_dp); ++ dup_ldp = grub_efi_find_last_device_path (dup_dp); + if (!(GRUB_EFI_DEVICE_PATH_TYPE (dup_ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE + && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE + || GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index b9eb1ab..49a1501 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -394,6 +394,47 @@ grub_efi_get_device_path (grub_efi_handle_t handle) + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + } + ++/* Return the device path node right before the end node. */ ++grub_efi_device_path_t * ++grub_efi_find_last_device_path (const grub_efi_device_path_t *dp) ++{ ++ grub_efi_device_path_t *next, *p; ++ ++ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) ++ return 0; ++ ++ for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); ++ ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); ++ p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) ++ ; ++ ++ return p; ++} ++ ++/* Duplicate a device path. */ ++grub_efi_device_path_t * ++grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp) ++{ ++ grub_efi_device_path_t *p; ++ grub_size_t total_size = 0; ++ ++ for (p = (grub_efi_device_path_t *) dp; ++ ; ++ p = GRUB_EFI_NEXT_DEVICE_PATH (p)) ++ { ++ total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); ++ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) ++ break; ++ } ++ ++ p = grub_malloc (total_size); ++ if (! p) ++ return 0; ++ ++ grub_memcpy (p, dp, total_size); ++ return p; ++} ++ + static void + dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor) + { +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index 489cf9e..0e6fd86 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -53,6 +53,10 @@ 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); + grub_efi_device_path_t * + EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); ++grub_efi_device_path_t * ++EXPORT_FUNC(grub_efi_find_last_device_path) (const grub_efi_device_path_t *dp); ++grub_efi_device_path_t * ++EXPORT_FUNC(grub_efi_duplicate_device_path) (const grub_efi_device_path_t *dp); + grub_err_t EXPORT_FUNC (grub_efi_finish_boot_services) (grub_efi_uintn_t *outbuf_size, void *outbuf, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *efi_desc_size, +-- +2.4.3 + diff --git a/0406-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch b/0406-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch new file mode 100644 index 0000000..59288c5 --- /dev/null +++ b/0406-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch @@ -0,0 +1,97 @@ +From c52ae40570c3bfbcca22d2195f5e6b31009d8a3f Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:37:17 +0300 +Subject: [PATCH 406/506] efinet: skip virtual IPv4 and IPv6 devices when + enumerating cards + +EDK2 PXE driver creates two child devices - IPv4 and IPv6 - with +bound SNP instance. This means we get three cards for every physical +adapter when enumerating. Not only is this confusing, this may result +in grub ignoring packets that come in via the "wrong" card. + +Example of device hierarchy is + + Ctrl[91] PciRoot(0x0)/Pci(0x3,0x0) + Ctrl[95] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1) + Ctrl[B4] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0) + Ctrl[BC] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000) + +Skip PXE created virtual devices when enumerating cards. Make sure to +find real card when applying initial autoconfiguration during PXE boot, +this information is associated with one of child devices. +--- + grub-core/net/drivers/efi/efinet.c | 51 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 50 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index f171f20..2b53e9e 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -174,6 +174,29 @@ grub_efinet_findcards (void) + { + grub_efi_simple_network_t *net; + struct grub_net_card *card; ++ grub_efi_device_path_t *dp, *parent = NULL, *child = NULL; ++ ++ /* EDK2 UEFI PXE driver creates IPv4 and IPv6 messaging devices as ++ children of main MAC messaging device. We only need one device with ++ bound SNP per physical card, otherwise they compete with each other ++ when polling for incoming packets. ++ */ ++ dp = grub_efi_get_device_path (*handle); ++ if (!dp) ++ continue; ++ for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp); dp = GRUB_EFI_NEXT_DEVICE_PATH (dp)) ++ { ++ parent = child; ++ child = dp; ++ } ++ if (child ++ && GRUB_EFI_DEVICE_PATH_TYPE (child) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE ++ && (GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE ++ || GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) ++ && parent ++ && GRUB_EFI_DEVICE_PATH_TYPE (parent) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE ++ && GRUB_EFI_DEVICE_PATH_SUBTYPE (parent) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) ++ continue; + + net = grub_efi_open_protocol (*handle, &net_io_guid, + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); +@@ -251,7 +274,33 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + if (! cdp) + continue; + if (grub_efi_compare_device_paths (dp, cdp) != 0) +- continue; ++ { ++ grub_efi_device_path_t *ldp, *dup_dp, *dup_ldp; ++ int match; ++ ++ /* EDK2 UEFI PXE driver creates pseudo devices with type IPv4/IPv6 ++ as children of Ethernet card and binds PXE and Load File protocols ++ to it. Loaded Image Device Path protocol will point to these pseudo ++ devices. We skip them when enumerating cards, so here we need to ++ find matching MAC device. ++ */ ++ ldp = grub_efi_find_last_device_path (dp); ++ 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)) ++ continue; ++ dup_dp = grub_efi_duplicate_device_path (dp); ++ if (!dup_dp) ++ continue; ++ 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; ++ dup_ldp->length = sizeof (*dup_ldp); ++ match = grub_efi_compare_device_paths (dup_dp, cdp) == 0; ++ grub_free (dup_dp); ++ if (!match) ++ continue; ++ } + pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (! pxe) +-- +2.4.3 + diff --git a/0407-efinet-open-Simple-Network-Protocol-exclusively.patch b/0407-efinet-open-Simple-Network-Protocol-exclusively.patch new file mode 100644 index 0000000..fbeff65 --- /dev/null +++ b/0407-efinet-open-Simple-Network-Protocol-exclusively.patch @@ -0,0 +1,89 @@ +From 49426e9fd2e562c73a4f1206f32eff9e424a1a73 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:37:17 +0300 +Subject: [PATCH 407/506] efinet: open Simple Network Protocol exclusively + +EDK2 network stack is based on Managed Network Protocol which is layered +on top of Simple Management Protocol and does background polling. This +polling races with grub for received (and probably trasmitted) packets +which causes either serious slowdown or complete failure to load files. + +Open SNP device exclusively. This destroys all child MNP instances and +stops background polling. + +Exclusive open cannot be done when enumerating cards, as it would destroy +PXE information we need to autoconfigure interface; and it cannot be done +during autoconfiguration as we need to do it for non-PXE boot as well. So +move SNP open to card ->open method and add matching ->close to clean up. + +Based on patch from Mark Salter + +Also-By: Mark Salter +Closes: 41731 +--- + grub-core/net/drivers/efi/efinet.c | 46 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index 2b53e9e..5533515 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -142,9 +142,55 @@ get_card_packet (struct grub_net_card *dev) + return nb; + } + ++static grub_err_t ++open_card (struct grub_net_card *dev) ++{ ++ grub_efi_simple_network_t *net; ++ ++ /* Try to reopen SNP exlusively to close any active MNP protocol instance ++ that may compete for packet polling ++ */ ++ net = grub_efi_open_protocol (dev->efi_handle, &net_io_guid, ++ GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); ++ if (net) ++ { ++ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED ++ && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS) ++ return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net start failed", ++ dev->name); ++ ++ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED) ++ return grub_error (GRUB_ERR_NET_NO_CARD, "%s: card stopped", ++ dev->name); ++ ++ if (net->mode->state == GRUB_EFI_NETWORK_STARTED ++ && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS) ++ return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net initialize failed", ++ dev->name); ++ ++ efi_call_4 (grub_efi_system_table->boot_services->close_protocol, ++ dev->efi_net, &net_io_guid, ++ grub_efi_image_handle, dev->efi_handle); ++ dev->efi_net = net; ++ } ++ ++ /* If it failed we just try to run as best as we can */ ++ return GRUB_ERR_NONE; ++} ++ ++static void ++close_card (struct grub_net_card *dev) ++{ ++ efi_call_4 (grub_efi_system_table->boot_services->close_protocol, ++ dev->efi_net, &net_io_guid, ++ grub_efi_image_handle, dev->efi_handle); ++} ++ + static struct grub_net_card_driver efidriver = + { + .name = "efinet", ++ .open = open_card, ++ .close = close_card, + .send = send_card_buffer, + .recv = get_card_packet + }; +-- +2.4.3 + diff --git a/0408-util-grub-mkrescue-Fix-compilation.patch b/0408-util-grub-mkrescue-Fix-compilation.patch new file mode 100644 index 0000000..fb56af7 --- /dev/null +++ b/0408-util-grub-mkrescue-Fix-compilation.patch @@ -0,0 +1,25 @@ +From 2dcf260d899f65cd84e4f676e03d76f51ae01736 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Thu, 7 May 2015 19:45:06 +0200 +Subject: [PATCH 408/506] util/grub-mkrescue: Fix compilation + +--- + util/grub-mkrescue.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c +index 5a7993f..4511826 100644 +--- a/util/grub-mkrescue.c ++++ b/util/grub-mkrescue.c +@@ -452,7 +452,7 @@ main (int argc, char *argv[]) + for (i = 1; i < argc; i++) + { + if (strcmp (argv[i], "-output") == 0) { +- argp_argv[argp_argc++] = "--output"; ++ argp_argv[argp_argc++] = (char *) "--output"; + i++; + argp_argv[argp_argc++] = argv[i]; + continue; +-- +2.4.3 + diff --git a/0409-Add-asm-tests-to-tarball.patch b/0409-Add-asm-tests-to-tarball.patch new file mode 100644 index 0000000..5c33685 --- /dev/null +++ b/0409-Add-asm-tests-to-tarball.patch @@ -0,0 +1,24 @@ +From 6a5c78c8c85c890034974a297bfb009dff0954c6 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 22:13:34 +0300 +Subject: [PATCH 409/506] Add asm-tests to tarball + +--- + conf/Makefile.extra-dist | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index db6cfd1..ea6b9df 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -5,6 +5,7 @@ EXTRA_DIST += gentpl.py + EXTRA_DIST += Makefile.util.def + EXTRA_DIST += Makefile.utilgcry.def + ++EXTRA_DIST += asm-tests + EXTRA_DIST += unicode + + EXTRA_DIST += util/import_gcry.py +-- +2.4.3 + diff --git a/0410-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch b/0410-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch new file mode 100644 index 0000000..dbd47cb --- /dev/null +++ b/0410-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch @@ -0,0 +1,83 @@ +From 07258815e96aab2c72593d0129d17051cbf68d27 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 8 May 2015 06:15:16 +0300 +Subject: [PATCH 410/506] acpi: do not skip BIOS scan if EBDA length is zero + +EBDA layout is not standardized so we cannot assume first two bytes +are length. Neither is it required by ACPI standard. HP 8710W is known +to contain zeroes here. + +Closes: 45002 +--- + grub-core/commands/acpi.c | 4 ++++ + grub-core/commands/i386/pc/acpi.c | 10 ++++++---- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c +index 05a6dca..c3861f5 100644 +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -180,8 +180,10 @@ grub_acpi_create_ebda (void) + struct grub_acpi_rsdp_v20 *v2; + + ebda = (grub_uint8_t *) (grub_addr_t) ((*((grub_uint16_t *)0x40e)) << 4); ++ grub_dprintf ("acpi", "EBDA @%p\n", ebda); + if (ebda) + ebda_kb_len = *(grub_uint16_t *) ebda; ++ grub_dprintf ("acpi", "EBDA length 0x%x\n", ebda_kb_len); + if (ebda_kb_len > 16) + ebda_kb_len = 0; + ctx.ebda_len = (ebda_kb_len + 1) << 10; +@@ -495,6 +497,8 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) + if (! rsdp) + rsdp = grub_machine_acpi_get_rsdpv1 (); + ++ grub_dprintf ("acpi", "RSDP @%p\n", rsdp); ++ + if (rsdp) + { + grub_uint32_t *entry_ptr; +diff --git a/grub-core/commands/i386/pc/acpi.c b/grub-core/commands/i386/pc/acpi.c +index d415d23..297f5d0 100644 +--- a/grub-core/commands/i386/pc/acpi.c ++++ b/grub-core/commands/i386/pc/acpi.c +@@ -29,14 +29,15 @@ grub_machine_acpi_get_rsdpv1 (void) + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); + ebda_len = * (grub_uint16_t *) ebda; +- if (! ebda_len) +- return 0; ++ if (! ebda_len) /* FIXME do we really need this check? */ ++ goto scan_bios; + for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) + if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) + return (struct grub_acpi_rsdp_v10 *) ptr; + ++scan_bios: + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + ptr += 16) +@@ -56,8 +57,8 @@ grub_machine_acpi_get_rsdpv2 (void) + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); + ebda_len = * (grub_uint16_t *) ebda; +- if (! ebda_len) +- return 0; ++ if (! ebda_len) /* FIXME do we really need this check? */ ++ goto scan_bios; + for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) + if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 +@@ -67,6 +68,7 @@ grub_machine_acpi_get_rsdpv2 (void) + == 0) + return (struct grub_acpi_rsdp_v20 *) ptr; + ++scan_bios: + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + ptr += 16) +-- +2.4.3 + diff --git a/0411-xfs-Fix-termination-loop-for-directory-iteration.patch b/0411-xfs-Fix-termination-loop-for-directory-iteration.patch new file mode 100644 index 0000000..f326325 --- /dev/null +++ b/0411-xfs-Fix-termination-loop-for-directory-iteration.patch @@ -0,0 +1,32 @@ +From 1570140f0362d9936f97a014a9fa5cecbca54f07 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 14 Jul 2014 17:21:29 +0200 +Subject: [PATCH 411/506] xfs: Fix termination loop for directory iteration + +Directory iteration used wrong position (sizeof wrong structure) for +termination of iteration inside a directory block. Luckily the position +ended up being wrong by just 1 byte and directory entries are larger so +things worked out fine in practice. But fix the problem anyway. + +Signed-off-by: Jan Kara +--- + grub-core/fs/xfs.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index 16ffd3f..4bd52d1 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -603,8 +603,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + - grub_be_to_cpu32 (tail->leaf_stale)); + + /* Iterate over all entries within this block. */ +- while (pos < (dirblk_size +- - (int) sizeof (struct grub_xfs_dir2_entry))) ++ while (pos < tail_start) + { + struct grub_xfs_dir2_entry *direntry; + grub_uint8_t *freetag; +-- +2.4.3 + diff --git a/0412-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch b/0412-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch new file mode 100644 index 0000000..cabb02a --- /dev/null +++ b/0412-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch @@ -0,0 +1,82 @@ +From a139188eb559ee23f51540948ec84ef5948fb2d1 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 14 Jul 2014 17:21:30 +0200 +Subject: [PATCH 412/506] xfs: Convert inode numbers to cpu endianity + immediately after reading + +Currently XFS driver converted inode numbers to native endianity only +when using them to compute inode position. Although this works, it is +somewhat confusing. So convert inode numbers when reading them from disk +structures as every other field. + +Signed-off-by: Jan Kara +--- + grub-core/fs/xfs.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index 4bd52d1..0d704e9 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -180,14 +180,14 @@ static inline grub_uint64_t + GRUB_XFS_INO_INOINAG (struct grub_xfs_data *data, + grub_uint64_t ino) + { +- return (grub_be_to_cpu64 (ino) & ((1LL << GRUB_XFS_INO_AGBITS (data)) - 1)); ++ return (ino & ((1LL << GRUB_XFS_INO_AGBITS (data)) - 1)); + } + + static inline grub_uint64_t + GRUB_XFS_INO_AG (struct grub_xfs_data *data, + grub_uint64_t ino) + { +- return (grub_be_to_cpu64 (ino) >> GRUB_XFS_INO_AGBITS (data)); ++ return (ino >> GRUB_XFS_INO_AGBITS (data)); + } + + static inline grub_disk_addr_t +@@ -506,13 +506,12 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + if (smallino) + { + parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4); +- parent = grub_cpu_to_be64 (parent); + /* The header is a bit smaller than usual. */ + de = (struct grub_xfs_dir_entry *) ((char *) de - 4); + } + else + { +- parent = diro->inode.data.dir.dirhead.parent.i8; ++ parent = grub_be_to_cpu64(diro->inode.data.dir.dirhead.parent.i8); + } + + /* Synthesize the direntries for `.' and `..'. */ +@@ -545,7 +544,6 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + | (((grub_uint64_t) inopos[5]) << 16) + | (((grub_uint64_t) inopos[6]) << 8) + | (((grub_uint64_t) inopos[7]) << 0); +- ino = grub_cpu_to_be64 (ino); + + c = de->name[de->len]; + de->name[de->len] = '\0'; +@@ -627,7 +625,8 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + is not used by GRUB. So it can be overwritten. */ + filename[direntry->len] = '\0'; + +- if (iterate_dir_call_hook (direntry->inode, filename, &ctx)) ++ if (iterate_dir_call_hook (grub_be_to_cpu64(direntry->inode), ++ filename, &ctx)) + { + grub_free (dirblock); + return 1; +@@ -689,7 +688,7 @@ grub_xfs_mount (grub_disk_t disk) + goto fail; + + data->diropen.data = data; +- data->diropen.ino = data->sblock.rootino; ++ data->diropen.ino = grub_be_to_cpu64(data->sblock.rootino); + data->diropen.inode_read = 1; + data->bsize = grub_be_to_cpu32 (data->sblock.bsize); + data->agsize = grub_be_to_cpu32 (data->sblock.agsize); +-- +2.4.3 + diff --git a/0413-remove-extra-newlines-in-grub_util_-strings.patch b/0413-remove-extra-newlines-in-grub_util_-strings.patch new file mode 100644 index 0000000..2312c4a --- /dev/null +++ b/0413-remove-extra-newlines-in-grub_util_-strings.patch @@ -0,0 +1,323 @@ +From 5082ea618439fe59956d071777be0c9c74fbbcf5 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Wed, 13 May 2015 09:47:17 +0300 +Subject: [PATCH 413/506] remove extra newlines in grub_util_* strings + +grub_util_{info,warn,error} already add trailing newlines, so remove +them from format strings. Also trailing full stops are already added. +--- + grub-core/bus/emu/pci.c | 2 +- + grub-core/disk/lvm.c | 40 ++++++++++++++++++++-------------------- + grub-core/osdep/linux/ofpath.c | 2 +- + util/grub-install-common.c | 2 +- + util/grub-install.c | 6 +++--- + util/grub-mknetdir.c | 2 +- + util/grub-pe2elf.c | 2 +- + util/mkimage.c | 4 ++-- + 8 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/grub-core/bus/emu/pci.c b/grub-core/bus/emu/pci.c +index 663e554..267f262 100644 +--- a/grub-core/bus/emu/pci.c ++++ b/grub-core/bus/emu/pci.c +@@ -55,7 +55,7 @@ grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, + int err; + err = pci_device_map_range (dev, base, size, PCI_DEV_MAP_FLAG_WRITABLE, &addr); + if (err) +- grub_util_error ("mapping 0x%llx failed (error %d)\n", ++ grub_util_error ("mapping 0x%llx failed (error %d)", + (unsigned long long) base, err); + return addr; + } +diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c +index 9b97004..7b265c7 100644 +--- a/grub-core/disk/lvm.c ++++ b/grub-core/disk/lvm.c +@@ -160,7 +160,7 @@ grub_lvm_detect (grub_disk_t disk, + "we don't support multiple LVM data areas"); + + #ifdef GRUB_UTIL +- grub_util_info ("we don't support multiple LVM data areas\n"); ++ grub_util_info ("we don't support multiple LVM data areas"); + #endif + goto fail; + } +@@ -189,7 +189,7 @@ grub_lvm_detect (grub_disk_t disk, + grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "unknown LVM metadata header"); + #ifdef GRUB_UTIL +- grub_util_info ("unknown LVM metadata header\n"); ++ grub_util_info ("unknown LVM metadata header"); + #endif + goto fail2; + } +@@ -213,7 +213,7 @@ grub_lvm_detect (grub_disk_t disk, + if (q == metadatabuf + mda_size) + { + #ifdef GRUB_UTIL +- grub_util_info ("error parsing metadata\n"); ++ grub_util_info ("error parsing metadata"); + #endif + goto fail2; + } +@@ -230,7 +230,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("couldn't find ID\n"); ++ grub_util_info ("couldn't find ID"); + #endif + goto fail3; + } +@@ -258,7 +258,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown extent size\n"); ++ grub_util_info ("unknown extent size"); + #endif + goto fail4; + } +@@ -306,7 +306,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown pe_start\n"); ++ grub_util_info ("unknown pe_start"); + #endif + goto pvs_fail; + } +@@ -315,7 +315,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("error parsing pe_start\n"); ++ grub_util_info ("error parsing pe_start"); + #endif + goto pvs_fail; + } +@@ -402,7 +402,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("couldn't find ID\n"); ++ grub_util_info ("couldn't find ID"); + #endif + goto lvs_fail; + } +@@ -422,7 +422,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown segment_count\n"); ++ grub_util_info ("unknown segment_count"); + #endif + goto lvs_fail; + } +@@ -436,7 +436,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown segment\n"); ++ grub_util_info ("unknown segment"); + #endif + goto lvs_segment_fail; + } +@@ -445,7 +445,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown start_extent\n"); ++ grub_util_info ("unknown start_extent"); + #endif + goto lvs_segment_fail; + } +@@ -453,7 +453,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown extent_count\n"); ++ grub_util_info ("unknown extent_count"); + #endif + goto lvs_segment_fail; + } +@@ -475,7 +475,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown stripe_count\n"); ++ grub_util_info ("unknown stripe_count"); + #endif + goto lvs_segment_fail; + } +@@ -491,7 +491,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown stripes\n"); ++ grub_util_info ("unknown stripes"); + #endif + goto lvs_segment_fail2; + } +@@ -533,7 +533,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown mirror_count\n"); ++ grub_util_info ("unknown mirror_count"); + #endif + goto lvs_segment_fail; + } +@@ -545,7 +545,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown mirrors\n"); ++ grub_util_info ("unknown mirrors"); + #endif + goto lvs_segment_fail2; + } +@@ -607,7 +607,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown device_count\n"); ++ grub_util_info ("unknown device_count"); + #endif + goto lvs_segment_fail; + } +@@ -618,7 +618,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown stripe_size\n"); ++ grub_util_info ("unknown stripe_size"); + #endif + goto lvs_segment_fail; + } +@@ -631,7 +631,7 @@ grub_lvm_detect (grub_disk_t disk, + if (p == NULL) + { + #ifdef GRUB_UTIL +- grub_util_info ("unknown raids\n"); ++ grub_util_info ("unknown raids"); + #endif + goto lvs_segment_fail2; + } +@@ -678,7 +678,7 @@ grub_lvm_detect (grub_disk_t disk, + p2 = grub_strchr (p, '"'); + if (p2) + *p2 = 0; +- grub_util_info ("unknown LVM type %s\n", p); ++ grub_util_info ("unknown LVM type %s", p); + if (p2) + *p2 ='"'; + #endif +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 05b1ecd..a79682a 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -539,7 +539,7 @@ grub_util_devname_to_ofpath (const char *sys_devname) + ofpath = xstrdup ("floppy"); + else + { +- grub_util_warn (_("unknown device type %s\n"), device); ++ grub_util_warn (_("unknown device type %s"), device); + ofpath = NULL; + } + +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index 0364b32..2598308 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -494,7 +494,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + + tgt = grub_install_get_image_target (mkimage_target); + if (!tgt) +- grub_util_error (_("unknown target format %s\n"), mkimage_target); ++ grub_util_error (_("unknown target format %s"), mkimage_target); + + grub_install_generate_image (dir, prefix, fp, outname, + modules.entries, memdisk_path, +diff --git a/util/grub-install.c b/util/grub-install.c +index 7b394c9..5662726 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -773,7 +773,7 @@ bless (grub_device_t dev, const char *path, int x86) + err = grub_mac_bless_inode (dev, st.st_ino, S_ISDIR (st.st_mode), x86); + if (err) + grub_util_error ("%s", grub_errmsg); +- grub_util_info ("blessed\n"); ++ grub_util_info ("blessed"); + } + + static void +@@ -1070,7 +1070,7 @@ main (int argc, char *argv[]) + efidir_is_mac = 1; + + if (!efidir_is_mac && grub_strcmp (fs->name, "fat") != 0) +- grub_util_error (_("%s doesn't look like an EFI partition.\n"), efidir); ++ grub_util_error (_("%s doesn't look like an EFI partition"), efidir); + + /* The EFI specification requires that an EFI System Partition must + contain an "EFI" subdirectory, and that OS loaders are stored in +@@ -1271,7 +1271,7 @@ main (int argc, char *argv[]) + + if (!config.is_cryptodisk_enabled && have_cryptodisk) + grub_util_error (_("attempt to install to encrypted disk without cryptodisk enabled. " +- "Set `%s' in file `%s'."), "GRUB_ENABLE_CRYPTODISK=y", ++ "Set `%s' in file `%s'"), "GRUB_ENABLE_CRYPTODISK=y", + grub_util_get_config_filename ()); + + if (disk_module && grub_strcmp (disk_module, "ata") == 0) +diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c +index 8366a11..3813e8b 100644 +--- a/util/grub-mknetdir.c ++++ b/util/grub-mknetdir.c +@@ -140,7 +140,7 @@ process_input_dir (const char *input_dir, enum grub_install_plat platform) + + prefix = xasprintf ("/%s", subdir); + if (!targets[platform].mkimage_target) +- grub_util_error (_("unsupported platform %s\n"), platsub); ++ grub_util_error (_("unsupported platform %s"), platsub); + + grub_cfg = grub_util_path_concat (2, grubdir, "grub.cfg"); + cfg = grub_util_fopen (grub_cfg, "wb"); +diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c +index f4abf70..0d4084a 100644 +--- a/util/grub-pe2elf.c ++++ b/util/grub-pe2elf.c +@@ -279,7 +279,7 @@ write_reloc_section (FILE* fp, const char *name, char *image, + break; + #endif + default: +- grub_util_error ("unknown pe relocation type %d\n", pe_rel->type); ++ grub_util_error ("unknown pe relocation type %d", pe_rel->type); + } + + if (type == +diff --git a/util/mkimage.c b/util/mkimage.c +index 52265b5..35df998 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -823,7 +823,7 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char + + if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS + && (comp != GRUB_COMPRESSION_NONE)) +- grub_util_error (_("unknown compression %d\n"), comp); ++ grub_util_error (_("unknown compression %d"), comp); + + *core_img = xmalloc (kernel_size); + memcpy (*core_img, kernel_img, kernel_size); +@@ -1234,7 +1234,7 @@ grub_install_generate_image (const char *dir, const char *prefix, + name = "none_decompress.img"; + break; + default: +- grub_util_error (_("unknown compression %d\n"), comp); ++ grub_util_error (_("unknown compression %d"), comp); + } + + decompress_path = grub_util_get_path (dir, name); +-- +2.4.3 + diff --git a/0414-zfs-fix-integer-truncation-in-zap_lookup.patch b/0414-zfs-fix-integer-truncation-in-zap_lookup.patch new file mode 100644 index 0000000..734a1fa --- /dev/null +++ b/0414-zfs-fix-integer-truncation-in-zap_lookup.patch @@ -0,0 +1,51 @@ +From 5370dcfdae66b60cff3507ad925300a679fe4117 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 14 May 2015 07:50:33 +0300 +Subject: [PATCH 414/506] zfs: fix integer truncation in zap_lookup + +Size after shift could exceed 16 bits; use grub_unit32_t for result. + +Reported and tested by: Kostya Berger +Closes: 44448 +--- + grub-core/fs/zfs/zfs.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index 08ed453..aac6f28 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -2071,10 +2071,10 @@ dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, + */ + static grub_err_t + mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian, +- grub_uint16_t objsize, const char *name, grub_uint64_t * value, ++ grub_uint32_t objsize, const char *name, grub_uint64_t * value, + int case_insensitive) + { +- grub_uint16_t i, chunks; ++ grub_uint32_t i, chunks; + mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; + + if (objsize < MZAP_ENT_LEN) +@@ -2486,7 +2486,7 @@ zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val, + struct grub_zfs_data *data, int case_insensitive) + { + grub_uint64_t block_type; +- grub_uint16_t size; ++ grub_uint32_t size; + void *zapbuf; + grub_err_t err; + grub_zfs_endian_t endian; +@@ -2494,7 +2494,7 @@ zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val, + grub_dprintf ("zfs", "looking for '%s'\n", name); + + /* Read in the first block of the zap object data. */ +- size = grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, ++ size = (grub_uint32_t) grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + zap_dnode->endian) << SPA_MINBLOCKSHIFT; + err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); + if (err) +-- +2.4.3 + diff --git a/0415-hostdisk-fix-crash-with-NULL-device.map.patch b/0415-hostdisk-fix-crash-with-NULL-device.map.patch new file mode 100644 index 0000000..87ba18b --- /dev/null +++ b/0415-hostdisk-fix-crash-with-NULL-device.map.patch @@ -0,0 +1,26 @@ +From 2498dc7a3aee638215ad47899031496b50633d55 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 17 May 2015 14:16:36 +0300 +Subject: [PATCH 415/506] hostdisk: fix crash with NULL device.map + +grub-macbless calls grub_util_biosdisk_init with NULL device.map. +--- + grub-core/kern/emu/hostdisk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c +index a3b00c8..610518d 100644 +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -422,7 +422,7 @@ read_device_map (const char *dev_map) + char buf[1024]; /* XXX */ + int lineno = 0; + +- if (dev_map[0] == '\0') ++ if (!dev_map || dev_map[0] == '\0') + { + grub_util_info ("no device.map"); + return; +-- +2.4.3 + diff --git a/0416-bootp-ignore-gateway_ip-relay-field.patch b/0416-bootp-ignore-gateway_ip-relay-field.patch new file mode 100644 index 0000000..795850b --- /dev/null +++ b/0416-bootp-ignore-gateway_ip-relay-field.patch @@ -0,0 +1,75 @@ +From a666c8bd18aee7bf1b202b6b8c0ffe953bd2c1b6 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sun, 17 May 2015 22:38:30 +0300 +Subject: [PATCH 416/506] bootp: ignore gateway_ip (relay) field. + +From RFC1542: + + The 'giaddr' field is rather poorly named. It exists to facilitate + the transfer of BOOTREQUEST messages from a client, through BOOTP + relay agents, to servers on different networks than the client. + Similarly, it facilitates the delivery of BOOTREPLY messages from the + servers, through BOOTP relay agents, back to the client. In no case + does it represent a general IP router to be used by the client. A + BOOTP client MUST set the 'giaddr' field to zero (0.0.0.0) in all + BOOTREQUEST messages it generates. + + A BOOTP client MUST NOT interpret the 'giaddr' field of a BOOTREPLY + message to be the IP address of an IP router. A BOOTP client SHOULD + completely ignore the contents of the 'giaddr' field in BOOTREPLY + messages. + +Leave code ifdef'd out for the time being in case we see regression. + +Suggested by: Rink Springer +Closes: 43396 +--- + docs/grub.texi | 6 ++++-- + grub-core/net/bootp.c | 7 +++++++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 4af22af..88bd75f 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -5162,8 +5162,10 @@ by @var{shortname} which can be used to remove it (@pxref{net_del_route}). + Perform configuration of @var{card} using DHCP protocol. If no card name + is specified, try to configure all existing cards. If configuration was + successful, interface with name @var{card}@samp{:dhcp} and configured +-address is added to @var{card}. If server provided gateway information in +-DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. Additionally the following DHCP options are recognized and processed: ++address is added to @var{card}. ++@comment If server provided gateway information in ++@comment DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. ++Additionally the following DHCP options are recognized and processed: + + @table @samp + @item 1 (Subnet Mask) +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 6136755..4fdeac3 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -157,6 +157,12 @@ grub_net_configure_by_dhcp_ack (const char *name, + hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + + inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); ++#if 0 ++ /* This is likely based on misunderstanding. gateway_ip refers to ++ address of BOOTP relay and should not be used after BOOTP transaction ++ is complete. ++ See RFC1542, 3.4 Interpretation of the 'giaddr' field ++ */ + if (bp->gateway_ip) + { + grub_net_network_level_netaddress_t target; +@@ -178,6 +184,7 @@ grub_net_configure_by_dhcp_ack (const char *name, + target.ipv4.masksize = 32; + grub_net_add_route (name, target, inter); + } ++#endif + + if (size > OFFSET_OF (boot_file, bp)) + grub_env_set_net_property (name, "boot_file", bp->boot_file, +-- +2.4.3 + diff --git a/0417-cb_timestamps.c-Add-new-time-stamp-descriptions.patch b/0417-cb_timestamps.c-Add-new-time-stamp-descriptions.patch new file mode 100644 index 0000000..c46b47c --- /dev/null +++ b/0417-cb_timestamps.c-Add-new-time-stamp-descriptions.patch @@ -0,0 +1,45 @@ +From f4e62af000116de93f0c9d1c5f8aaf40934d5a01 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Fri, 15 May 2015 17:35:00 +0200 +Subject: [PATCH 417/506] cb_timestamps.c: Add new time stamp descriptions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add the descriptions of the “coreâ€, that means no vendorcode or payload, +coreboot time stamps added up to coreboot commit a7d92441 (timestamps: +You can never have enough of them!) [1]. + +Running `coreboot_boottime` in the GRUB command line interface now shows +descriptions for all time stamps again on the ASRock E350M1. + +[1] http://review.coreboot.org/9608 +--- + grub-core/commands/i386/coreboot/cb_timestamps.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/grub-core/commands/i386/coreboot/cb_timestamps.c b/grub-core/commands/i386/coreboot/cb_timestamps.c +index 07fbb02..e72f38d 100644 +--- a/grub-core/commands/i386/coreboot/cb_timestamps.c ++++ b/grub-core/commands/i386/coreboot/cb_timestamps.c +@@ -39,9 +39,17 @@ static const char *descs[] = { + [2] = "before RAM init", + [3] = "after RAM init", + [4] = "end of romstage", ++ [5] = "start of verified boot", ++ [6] = "end of verified boot", + [8] = "start of RAM copy", + [9] = "end of RAM copy", + [10] = "start of ramstage", ++ [11] = "start of bootblock", ++ [12] = "end of bootblock", ++ [13] = "starting to load romstage", ++ [14] = "finished loading romstage", ++ [15] = "starting LZMA decompress (ignore for x86)", ++ [16] = "finished LZMA decompress (ignore for x86)", + [30] = "device enumerate", + [40] = "device configure", + [50] = "device enable", +-- +2.4.3 + diff --git a/0418-disk-ahci-Use-defines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch b/0418-disk-ahci-Use-defines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch new file mode 100644 index 0000000..9de38b3 --- /dev/null +++ b/0418-disk-ahci-Use-defines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch @@ -0,0 +1,35 @@ +From 5e74a3e6dfc4e5992c423bf740a4b3604030b007 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Sun, 24 May 2015 11:11:25 +0200 +Subject: [PATCH 418/506] disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and + `GRUB_ATA_STATUS_DRQ` + +Instead of hard coding `0x88` use the macros defined in `disk/ata.h`. +--- + grub-core/disk/ahci.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index d6bdbdd..7f75724 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -565,14 +565,14 @@ grub_ahci_pciinit (grub_pci_device_t dev, + while (grub_get_time_ms () < endtime) + { + for (i = 0; i < nports; i++) +- if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & 0x88)) ++ if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ))) + break; + if (i == nports) + break; + } + + for (i = 0; i < nports; i++) +- if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & 0x88)) ++ if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ))) + { + grub_dprintf ("ahci", "port %d is busy\n", i); + failed_adevs[i] = adevs[i]; +-- +2.4.3 + diff --git a/0419-multiboot1-never-place-modules-in-low-memory.patch b/0419-multiboot1-never-place-modules-in-low-memory.patch new file mode 100644 index 0000000..077196c --- /dev/null +++ b/0419-multiboot1-never-place-modules-in-low-memory.patch @@ -0,0 +1,28 @@ +From c856be6bca6f963a9a2c91eda954ab687bc7e573 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 27 May 2015 08:37:55 +0200 +Subject: [PATCH 419/506] multiboot1: never place modules in low memory. + +While in theory permitted by the spec, modules rarely fit in low memory +anyway and not every kernel is able to handle modules in low memory anyway. +At least VMWare is known not to be able to handle modules at arbitrary +locations. +--- + grub-core/loader/multiboot.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c +index 4b71f33..fd8f28e 100644 +--- a/grub-core/loader/multiboot.c ++++ b/grub-core/loader/multiboot.c +@@ -333,6 +333,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), + return grub_errno; + + #ifndef GRUB_USE_MULTIBOOT2 ++ lowest_addr = 0x100000; + if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL) + lowest_addr = ALIGN_UP (highest_load + 1048576, 4096); + #endif +-- +2.4.3 + diff --git a/0420-zfs-extensible_dataset-and-large_blocks-feature-supp.patch b/0420-zfs-extensible_dataset-and-large_blocks-feature-supp.patch new file mode 100644 index 0000000..0f1aad0 --- /dev/null +++ b/0420-zfs-extensible_dataset-and-large_blocks-feature-supp.patch @@ -0,0 +1,88 @@ +From cad5cc0f5d3d3630ccfbe242552958b13f2120d6 Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Thu, 16 Apr 2015 08:24:38 +0300 +Subject: [PATCH 420/506] zfs extensible_dataset and large_blocks feature + support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +large blocks basically use extensible dataset feature, or to be exact, +setting recordsize above 128k will trigger large_block feature to be +enabled and storing such blocks is using feature extensible dataset. so +the extensible dataset is prerequisite. + +Changes implement read support extensible dataset… instead of fixed DMU +types they dont specify type, making it possible to use fat zap objects +from bonus area. +--- + grub-core/fs/zfs/zfs.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c +index aac6f28..f9ca0e7 100644 +--- a/grub-core/fs/zfs/zfs.c ++++ b/grub-core/fs/zfs/zfs.c +@@ -283,6 +283,8 @@ static const char *spa_feature_names[] = { + "org.illumos:lz4_compress", + "com.delphix:hole_birth", + "com.delphix:embedded_data", ++ "com.delphix:extensible_dataset", ++ "org.open-zfs:large_blocks", + NULL + }; + +@@ -3080,7 +3082,7 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, + + grub_dprintf ("zfs", "alive\n"); + +- err = dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); ++ err = dnode_get (mosmdn, objnum, 0, mdn, data); + if (err) + return err; + +@@ -3113,7 +3115,7 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, + if (err) + return err; + +- err = dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); ++ err = dnode_get (mosmdn, objnum, 0, mdn, data); + if (err) + return err; + +@@ -3268,8 +3270,7 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, + + grub_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); + +- err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &subvol->mdn, +- data); ++ err = dnode_get (&(data->mos), headobj, 0, &subvol->mdn, data); + if (err) + { + grub_free (fsname); +@@ -3665,8 +3666,11 @@ zfs_mount (grub_device_t dev) + if (ub->ub_version >= SPA_VERSION_FEATURES && + check_mos_features(&((objset_phys_t *) osp)->os_meta_dnode,ub_endian, + data) != 0) +- return NULL; +- ++ { ++ grub_error (GRUB_ERR_BAD_FS, "Unsupported features in pool"); ++ return NULL; ++ } ++ + /* Got the MOS. Save it at the memory addr MOS. */ + grub_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dnode, + DNODE_SIZE); +@@ -3963,7 +3967,7 @@ fill_fs_info (struct grub_dirhook_info *info, + { + headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&mdn.dn))->dd_head_dataset_obj, mdn.endian); + +- err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &mdn, data); ++ err = dnode_get (&(data->mos), headobj, 0, &mdn, data); + if (err) + { + grub_dprintf ("zfs", "failed here\n"); +-- +2.4.3 + diff --git a/0421-Correct-spelling-of-scheduled.patch b/0421-Correct-spelling-of-scheduled.patch new file mode 100644 index 0000000..b3a97f8 --- /dev/null +++ b/0421-Correct-spelling-of-scheduled.patch @@ -0,0 +1,46 @@ +From fd73b3d00881abae3daf820fe0009434edf2e3d4 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Sun, 24 May 2015 23:27:46 +0200 +Subject: [PATCH 421/506] Correct spelling of *scheduled* + +Run the command below + + $ git grep -l schedulded | xargs sed -i 's/schedulded/scheduled/g' + +and revert the change in `ChangeLog-2015`. + +Including "miscellaneous" spelling fix noted by richardvoigt@gmail.com +--- + gentpl.py | 2 +- + grub-core/disk/ahci.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gentpl.py b/gentpl.py +index f177883..37b1f45 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -82,7 +82,7 @@ GROUPS["softdiv"] = GROUPS["arm"] + ["ia64_efi"] + GROUPS["no_softdiv"] = GRUB_PLATFORMS[:] + for i in GROUPS["softdiv"]: GROUPS["no_softdiv"].remove(i) + +-# Miscelaneous groups schedulded to disappear in future ++# Miscellaneous groups scheduled to disappear in future + GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"] + GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc") + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index 7f75724..4e8619c 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -1002,7 +1002,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, + if (parms->write) + grub_memcpy ((char *) grub_dma_get_virt (bufc), parms->buffer, parms->size); + +- grub_dprintf ("ahci", "AHCI command schedulded\n"); ++ grub_dprintf ("ahci", "AHCI command scheduled\n"); + grub_dprintf ("ahci", "AHCI tfd = %x\n", + dev->hba->ports[dev->port].task_file_data); + grub_dprintf ("ahci", "AHCI inten = %x\n", +-- +2.4.3 + diff --git a/0422-Clarify-use-of-superusers-variable-and-menu-entry-ac.patch b/0422-Clarify-use-of-superusers-variable-and-menu-entry-ac.patch new file mode 100644 index 0000000..62e7ce3 --- /dev/null +++ b/0422-Clarify-use-of-superusers-variable-and-menu-entry-ac.patch @@ -0,0 +1,38 @@ +From dec7718878f8a4566cd2894ab8970e1bec19dbb9 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 30 May 2015 19:36:41 +0300 +Subject: [PATCH 422/506] Clarify use of superusers variable and menu entry + access + +superusers controls both CLI and editing. Also explicitly mention that +empty superusers disables them. + +"Access to menuentry" is a bit vague - change to "execute menuentry" +to make it obvious, what access is granted. +--- + docs/grub.texi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 88bd75f..b9f41a7 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -5428,10 +5428,12 @@ In order to enable authentication support, the @samp{superusers} environment + variable must be set to a list of usernames, separated by any of spaces, + commas, semicolons, pipes, or ampersands. Superusers are permitted to use + the GRUB command line, edit menu entries, and execute any menu entry. If +-@samp{superusers} is set, then use of the command line is automatically +-restricted to superusers. ++@samp{superusers} is set, then use of the command line and editing of menu ++entries are automatically restricted to superusers. Setting @samp{superusers} ++to empty string effectively disables both access to CLI and editing of menu ++entries. + +-Other users may be given access to specific menu entries by giving a list of ++Other users may be allowed to execute specific menu entries by giving a list of + usernames (as above) using the @option{--users} option to the + @samp{menuentry} command (@pxref{menuentry}). If the @option{--unrestricted} + option is used for a menu entry, then that entry is unrestricted. +-- +2.4.3 + diff --git a/0423-disk-ahci.c-Add-port-number-to-port-debug-messages.patch b/0423-disk-ahci.c-Add-port-number-to-port-debug-messages.patch new file mode 100644 index 0000000..291d40a --- /dev/null +++ b/0423-disk-ahci.c-Add-port-number-to-port-debug-messages.patch @@ -0,0 +1,103 @@ +From ca59c24bd0e2a90db764065e24829775aa2b363c Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Wed, 27 May 2015 22:48:57 +0200 +Subject: [PATCH 423/506] disk/ahci.c: Add port number to port debug messages + +Currently, some messages cannot be mapped to the port they belong to as +the port number is missing from the output. So add `port: n` to the +debug messages. +--- + grub-core/disk/ahci.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index 4e8619c..da5fead 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -355,7 +355,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + if (adevs[i]) + { + adevs[i]->hba->ports[adevs[i]->port].sata_error = adevs[i]->hba->ports[adevs[i]->port].sata_error; +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head) * 32); +@@ -440,7 +440,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + adevs[i]->hba->ports[adevs[i]->port].intstatus = ~0; + // adevs[i]->hba->ports[adevs[i]->port].fbs = 0; + +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->rfis = grub_memalign_dma32 (4096, +@@ -480,7 +480,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + for (i = 0; i < nports; i++) + if (adevs[i]) + { +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + fr_running |= (1 << i); + +@@ -488,7 +488,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON; + adevs[i]->hba->ports[adevs[i]->port].command |= 1 << 28; + +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + } + +@@ -515,26 +515,26 @@ grub_ahci_pciinit (grub_pci_device_t dev, + for (i = 0; i < nports; i++) + if (adevs[i]) + { +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON; + adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_SPIN_UP; + +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->hba->ports[adevs[i]->port].sata_error = ~0; +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + +- grub_dprintf ("ahci", "offset: %x, tfd:%x, CMD: %x\n", ++ grub_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, + (int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data - + (char *) adevs[i]->hba), + adevs[i]->hba->ports[adevs[i]->port].task_file_data, + adevs[i]->hba->ports[adevs[i]->port].command); + +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + } + +@@ -542,13 +542,13 @@ grub_ahci_pciinit (grub_pci_device_t dev, + for (i = 0; i < nports; i++) + if (adevs[i]) + { +- grub_dprintf ("ahci", "offset: %x, tfd:%x, CMD: %x\n", ++ grub_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, + (int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data - + (char *) adevs[i]->hba), + adevs[i]->hba->ports[adevs[i]->port].task_file_data, + adevs[i]->hba->ports[adevs[i]->port].command); + +- grub_dprintf ("ahci", "err: %x\n", ++ grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->hba->ports[adevs[i]->port].command +-- +2.4.3 + diff --git a/0424-arm64-setjmp-Add-missing-license-macro.patch b/0424-arm64-setjmp-Add-missing-license-macro.patch new file mode 100644 index 0000000..dbdac74 --- /dev/null +++ b/0424-arm64-setjmp-Add-missing-license-macro.patch @@ -0,0 +1,34 @@ +From 3ac342205dc81293bb8e2d91b8c5ebe124b4ad35 Mon Sep 17 00:00:00 2001 +From: dann frazier +Date: Thu, 21 May 2015 10:28:48 -0600 +Subject: [PATCH 424/506] arm64/setjmp: Add missing license macro + +Including the setjmp module in an arm64-efi image will cause it to +immediately exit with an "incompatible license" error. + +The source file includes a GPLv3+ boilerplate, so fix this by declaring a +GPLv3+ license using the GRUB_MOD_LICENSE macro. + +Signed-off-by: dann frazier +--- + grub-core/lib/arm64/setjmp.S | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/lib/arm64/setjmp.S b/grub-core/lib/arm64/setjmp.S +index adaafe4..eabfd99 100644 +--- a/grub-core/lib/arm64/setjmp.S ++++ b/grub-core/lib/arm64/setjmp.S +@@ -17,8 +17,10 @@ + */ + + #include ++#include + + .file "setjmp.S" ++GRUB_MOD_LICENSE "GPLv3+" + .text + + /* +-- +2.4.3 + diff --git a/0425-configure.ac-clean-up-arm64-soft-float-handling.patch b/0425-configure.ac-clean-up-arm64-soft-float-handling.patch new file mode 100644 index 0000000..38c85bd --- /dev/null +++ b/0425-configure.ac-clean-up-arm64-soft-float-handling.patch @@ -0,0 +1,50 @@ +From 43d4231432838821cabe4f6aea4f0f50e87af9c4 Mon Sep 17 00:00:00 2001 +From: Leif Lindholm +Date: Tue, 2 Jun 2015 15:41:09 +0100 +Subject: [PATCH 425/506] configure.ac: clean up arm64 soft-float handling + +Fix compilation with gcc 5.1 (avoid internal compiler error), by +replacing explicit -march +nofp+nosimd options with -mgeneral-regs-only. + +This also enables the removal of some further conditional build flag +setting. +--- + configure.ac | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 891c14f..fd8a62e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -686,9 +686,9 @@ if test x"$platform" != xemu ; 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 +- CFLAGS="$TARGET_CFLAGS -march=armv8-a+nofp+nosimd -Werror" ++ CFLAGS="$TARGET_CFLAGS -mgeneral-regs-only -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], +- [grub_cv_target_cc_soft_float="-march=armv8-a+nofp+nosimd"], []) ++ [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) + fi + if test "x$target_cpu" = xia64; then + CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" +@@ -720,15 +720,7 @@ if test x"$platform" != xemu ; then + TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float" + ;; + esac +- case x"$grub_cv_target_cc_soft_float" in +- x"-march=armv8-a+nofp+nosimd") +- # +nosimd disables also the cache opcodes that we need in asm. +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS -march=armv8-a+nofp" +- ;; +- *) +- TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" +- ;; +- esac ++ TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" + + fi + +-- +2.4.3 + diff --git a/0426-multiboot_header_tag_module_align-fix-to-confirm-mul.patch b/0426-multiboot_header_tag_module_align-fix-to-confirm-mul.patch new file mode 100644 index 0000000..2df3849 --- /dev/null +++ b/0426-multiboot_header_tag_module_align-fix-to-confirm-mul.patch @@ -0,0 +1,27 @@ +From 697eceff6a168e8712fb7b784b333e0aeb925958 Mon Sep 17 00:00:00 2001 +From: Toomas Soome +Date: Thu, 4 Jun 2015 19:41:54 +0300 +Subject: [PATCH 426/506] multiboot_header_tag_module_align fix to confirm + multiboot specification + +--- + include/multiboot2.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/include/multiboot2.h b/include/multiboot2.h +index 3ccff15..9d48627 100644 +--- a/include/multiboot2.h ++++ b/include/multiboot2.h +@@ -156,9 +156,6 @@ struct multiboot_header_tag_module_align + multiboot_uint16_t type; + multiboot_uint16_t flags; + multiboot_uint32_t size; +- multiboot_uint32_t width; +- multiboot_uint32_t height; +- multiboot_uint32_t depth; + }; + + struct multiboot_color +-- +2.4.3 + diff --git a/0427-xfs-Add-helpers-for-inode-size.patch b/0427-xfs-Add-helpers-for-inode-size.patch new file mode 100644 index 0000000..21dd28e --- /dev/null +++ b/0427-xfs-Add-helpers-for-inode-size.patch @@ -0,0 +1,97 @@ +From d3ffeb9a9a54148af610cd122028783217d30699 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 1 Jun 2015 14:28:45 +0200 +Subject: [PATCH 427/506] xfs: Add helpers for inode size + +Add helpers to return size of XFS inode on disk and when loaded in +memory. + +Signed-off-by: Jan Kara +--- + grub-core/fs/xfs.c | 35 ++++++++++++++++++++++++----------- + 1 file changed, 24 insertions(+), 11 deletions(-) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index 0d704e9..26d8147 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -255,6 +255,24 @@ grub_xfs_inode_offset (struct grub_xfs_data *data, + data->sblock.log2_inode); + } + ++static inline grub_size_t ++grub_xfs_inode_size(struct grub_xfs_data *data) ++{ ++ return 1 << data->sblock.log2_inode; ++} ++ ++/* ++ * Returns size occupied by XFS inode stored in memory - we store struct ++ * grub_fshelp_node there but on disk inode size may be actually larger than ++ * struct grub_xfs_inode so we need to account for that so that we can read ++ * from disk directly into in-memory structure. ++ */ ++static inline grub_size_t ++grub_xfs_fshelp_size(struct grub_xfs_data *data) ++{ ++ return sizeof (struct grub_fshelp_node) - sizeof (struct grub_xfs_inode) ++ + grub_xfs_inode_size(data); ++} + + static grub_err_t + grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, +@@ -264,8 +282,8 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, + int offset = grub_xfs_inode_offset (data, ino); + + /* Read the inode. */ +- if (grub_disk_read (data->disk, block, offset, +- 1 << data->sblock.log2_inode, inode)) ++ if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data), ++ inode)) + return grub_errno; + + if (grub_strncmp ((char *) inode->magic, "IN", 2)) +@@ -297,7 +315,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + if (node->inode.fork_offset) + recoffset = (node->inode.fork_offset - 1) / 2; + else +- recoffset = ((1 << node->data->sblock.log2_inode) ++ recoffset = (grub_xfs_inode_size(node->data) + - ((char *) &node->inode.data.btree.keys + - (char *) &node->inode)) + / (2 * sizeof (grub_uint64_t)); +@@ -456,9 +474,7 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename, + struct grub_fshelp_node *fdiro; + grub_err_t err; + +- fdiro = grub_malloc (sizeof (struct grub_fshelp_node) +- - sizeof (struct grub_xfs_inode) +- + (1 << ctx->diro->data->sblock.log2_inode) + 1); ++ fdiro = grub_malloc (grub_xfs_fshelp_size(ctx->diro->data) + 1); + if (!fdiro) + { + grub_print_error (); +@@ -682,7 +698,7 @@ grub_xfs_mount (grub_disk_t disk) + data = grub_realloc (data, + sizeof (struct grub_xfs_data) + - sizeof (struct grub_xfs_inode) +- + (1 << data->sblock.log2_inode) + 1); ++ + grub_xfs_inode_size(data) + 1); + + if (! data) + goto fail; +@@ -797,10 +813,7 @@ grub_xfs_open (struct grub_file *file, const char *name) + + if (fdiro != &data->diropen) + { +- grub_memcpy (&data->diropen, fdiro, +- sizeof (struct grub_fshelp_node) +- - sizeof (struct grub_xfs_inode) +- + (1 << data->sblock.log2_inode)); ++ grub_memcpy (&data->diropen, fdiro, grub_xfs_fshelp_size(data)); + grub_free (fdiro); + } + +-- +2.4.3 + diff --git a/0428-xfs-V5-filesystem-format-support.patch b/0428-xfs-V5-filesystem-format-support.patch new file mode 100644 index 0000000..026f6aa --- /dev/null +++ b/0428-xfs-V5-filesystem-format-support.patch @@ -0,0 +1,579 @@ +From b6e80c7778b708c1632d957d00507aad60d9e255 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 1 Jun 2015 14:28:46 +0200 +Subject: [PATCH 428/506] xfs: V5 filesystem format support + +Add support for new XFS on disk format. We have to handle optional +filetype fields in directory entries, additional CRC, LSN, UUID entries +in some structures, etc. + +Signed-off-by: Jan Kara +--- + grub-core/fs/xfs.c | 332 ++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 252 insertions(+), 80 deletions(-) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index 26d8147..f00e43e 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -34,6 +34,50 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #define XFS_INODE_FORMAT_EXT 2 + #define XFS_INODE_FORMAT_BTREE 3 + ++/* Superblock version field flags */ ++#define XFS_SB_VERSION_NUMBITS 0x000f ++#define XFS_SB_VERSION_ATTRBIT 0x0010 ++#define XFS_SB_VERSION_NLINKBIT 0x0020 ++#define XFS_SB_VERSION_QUOTABIT 0x0040 ++#define XFS_SB_VERSION_ALIGNBIT 0x0080 ++#define XFS_SB_VERSION_DALIGNBIT 0x0100 ++#define XFS_SB_VERSION_LOGV2BIT 0x0400 ++#define XFS_SB_VERSION_SECTORBIT 0x0800 ++#define XFS_SB_VERSION_EXTFLGBIT 0x1000 ++#define XFS_SB_VERSION_DIRV2BIT 0x2000 ++#define XFS_SB_VERSION_MOREBITSBIT 0x8000 ++#define XFS_SB_VERSION_BITS_SUPPORTED \ ++ (XFS_SB_VERSION_NUMBITS | \ ++ XFS_SB_VERSION_ATTRBIT | \ ++ XFS_SB_VERSION_NLINKBIT | \ ++ XFS_SB_VERSION_QUOTABIT | \ ++ XFS_SB_VERSION_ALIGNBIT | \ ++ XFS_SB_VERSION_DALIGNBIT | \ ++ XFS_SB_VERSION_LOGV2BIT | \ ++ XFS_SB_VERSION_SECTORBIT | \ ++ XFS_SB_VERSION_EXTFLGBIT | \ ++ XFS_SB_VERSION_DIRV2BIT | \ ++ XFS_SB_VERSION_MOREBITSBIT) ++ ++/* Recognized xfs format versions */ ++#define XFS_SB_VERSION_4 4 /* Good old XFS filesystem */ ++#define XFS_SB_VERSION_5 5 /* CRC enabled filesystem */ ++ ++/* features2 field flags */ ++#define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002 /* Superblk counters */ ++#define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ ++#define XFS_SB_VERSION2_PROJID32BIT 0x00000080 /* 32-bit project ids */ ++#define XFS_SB_VERSION2_FTYPE 0x00000200 /* inode type in dir */ ++#define XFS_SB_VERSION2_BITS_SUPPORTED \ ++ (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \ ++ XFS_SB_VERSION2_ATTR2BIT | \ ++ XFS_SB_VERSION2_PROJID32BIT | \ ++ XFS_SB_VERSION2_FTYPE) ++ ++/* incompat feature flags */ ++#define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ ++#define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ ++ (XFS_SB_FEAT_INCOMPAT_FTYPE) + + struct grub_xfs_sblock + { +@@ -45,7 +89,9 @@ struct grub_xfs_sblock + grub_uint64_t rootino; + grub_uint8_t unused3[20]; + grub_uint32_t agsize; +- grub_uint8_t unused4[20]; ++ grub_uint8_t unused4[12]; ++ grub_uint16_t version; ++ grub_uint8_t unused5[6]; + grub_uint8_t label[12]; + grub_uint8_t log2_bsize; + grub_uint8_t log2_sect; +@@ -54,12 +100,19 @@ struct grub_xfs_sblock + grub_uint8_t log2_agblk; + grub_uint8_t unused6[67]; + grub_uint8_t log2_dirblk; ++ grub_uint8_t unused7[7]; ++ grub_uint32_t features2; ++ grub_uint8_t unused8[4]; ++ grub_uint32_t sb_features_compat; ++ grub_uint32_t sb_features_ro_compat; ++ grub_uint32_t sb_features_incompat; ++ grub_uint32_t sb_features_log_incompat; + } GRUB_PACKED; + + struct grub_xfs_dir_header + { + grub_uint8_t count; +- grub_uint8_t smallino; ++ grub_uint8_t largeino; + union + { + grub_uint32_t i4; +@@ -67,14 +120,16 @@ struct grub_xfs_dir_header + } GRUB_PACKED parent; + } GRUB_PACKED; + ++/* Structure for directory entry inlined in the inode */ + struct grub_xfs_dir_entry + { + grub_uint8_t len; + grub_uint16_t offset; + char name[1]; +- /* Inode number follows, 32 bits. */ ++ /* Inode number follows, 32 / 64 bits. */ + } GRUB_PACKED; + ++/* Structure for directory entry in a block */ + struct grub_xfs_dir2_entry + { + grub_uint64_t inode; +@@ -90,7 +145,8 @@ struct grub_xfs_btree_node + grub_uint16_t numrecs; + grub_uint64_t left; + grub_uint64_t right; +- grub_uint64_t keys[1]; ++ /* In V5 here follow crc, uuid, etc. */ ++ /* Then follow keys and block pointers */ + } GRUB_PACKED; + + struct grub_xfs_btree_root +@@ -123,19 +179,11 @@ struct grub_xfs_inode + grub_uint16_t unused3; + grub_uint8_t fork_offset; + grub_uint8_t unused4[17]; +- union +- { +- char raw[156]; +- struct dir +- { +- struct grub_xfs_dir_header dirhead; +- struct grub_xfs_dir_entry direntry[1]; +- } dir; +- grub_xfs_extent extents[XFS_INODE_EXTENTS]; +- struct grub_xfs_btree_root btree; +- } GRUB_PACKED data; + } GRUB_PACKED; + ++#define XFS_V2_INODE_SIZE sizeof(struct grub_xfs_inode) ++#define XFS_V3_INODE_SIZE (XFS_V2_INODE_SIZE + 76) ++ + struct grub_xfs_dirblock_tail + { + grub_uint32_t leaf_count; +@@ -157,6 +205,8 @@ struct grub_xfs_data + int pos; + int bsize; + grub_uint32_t agsize; ++ unsigned int hasftype:1; ++ unsigned int hascrc:1; + struct grub_fshelp_node diropen; + }; + +@@ -164,6 +214,71 @@ static grub_dl_t my_mod; + + + ++static int grub_xfs_sb_hascrc(struct grub_xfs_data *data) ++{ ++ return (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == ++ grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5); ++} ++ ++static int grub_xfs_sb_hasftype(struct grub_xfs_data *data) ++{ ++ if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == ++ grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5) && ++ data->sblock.sb_features_incompat & grub_cpu_to_be32_compile_time(XFS_SB_FEAT_INCOMPAT_FTYPE)) ++ return 1; ++ if (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && ++ data->sblock.features2 & grub_cpu_to_be32_compile_time(XFS_SB_VERSION2_FTYPE)) ++ return 1; ++ return 0; ++} ++ ++static int grub_xfs_sb_valid(struct grub_xfs_data *data) ++{ ++ grub_dprintf("xfs", "Validating superblock\n"); ++ if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4) ++ || data->sblock.log2_bsize < GRUB_DISK_SECTOR_BITS ++ || ((int) data->sblock.log2_bsize ++ + (int) data->sblock.log2_dirblk) >= 27) ++ { ++ grub_error (GRUB_ERR_BAD_FS, "not a XFS filesystem"); ++ return 0; ++ } ++ if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == ++ grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5)) ++ { ++ grub_dprintf("xfs", "XFS v5 superblock detected\n"); ++ if (data->sblock.sb_features_incompat & ++ grub_cpu_to_be32_compile_time(~XFS_SB_FEAT_INCOMPAT_SUPPORTED)) ++ { ++ grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported " ++ "incompatible features"); ++ return 0; ++ } ++ return 1; ++ } ++ else if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == ++ grub_cpu_to_be16_compile_time(XFS_SB_VERSION_4)) ++ { ++ grub_dprintf("xfs", "XFS v4 superblock detected\n"); ++ if (!(data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_DIRV2BIT))) ++ { ++ grub_error (GRUB_ERR_BAD_FS, "XFS filesystem without V2 directories " ++ "is unsupported"); ++ return 0; ++ } ++ if (data->sblock.version & grub_cpu_to_be16_compile_time(~XFS_SB_VERSION_BITS_SUPPORTED) || ++ (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && ++ data->sblock.features2 & grub_cpu_to_be16_compile_time(~XFS_SB_VERSION2_BITS_SUPPORTED))) ++ { ++ grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported version " ++ "bits"); ++ return 0; ++ } ++ return 1; ++ } ++ return 0; ++} ++ + /* Filetype information as used in inodes. */ + #define FILETYPE_INO_MASK 0170000 + #define FILETYPE_INO_REG 0100000 +@@ -219,18 +334,6 @@ GRUB_XFS_EXTENT_SIZE (grub_xfs_extent *exts, int ex) + return (grub_be_to_cpu32 (exts[ex][3]) & ((1 << 21) - 1)); + } + +-static inline int +-GRUB_XFS_ROUND_TO_DIRENT (int pos) +-{ +- return ((((pos) + 8 - 1) / 8) * 8); +-} +- +-static inline int +-GRUB_XFS_NEXT_DIRENT (int pos, int len) +-{ +- return (pos) + GRUB_XFS_ROUND_TO_DIRENT (8 + 1 + len + 2); +-} +- + + static inline grub_uint64_t + grub_xfs_inode_block (struct grub_xfs_data *data, +@@ -274,6 +377,85 @@ grub_xfs_fshelp_size(struct grub_xfs_data *data) + + grub_xfs_inode_size(data); + } + ++static void * ++grub_xfs_inode_data(struct grub_xfs_inode *inode) ++{ ++ if (inode->version <= 2) ++ return ((char *)inode) + XFS_V2_INODE_SIZE; ++ return ((char *)inode) + XFS_V3_INODE_SIZE; ++} ++ ++static struct grub_xfs_dir_entry * ++grub_xfs_inline_de(struct grub_xfs_dir_header *head) ++{ ++ /* ++ * With small inode numbers the header is 4 bytes smaller because of ++ * smaller parent pointer ++ */ ++ return (void *)(((char *)head) + sizeof(struct grub_xfs_dir_header) - ++ (head->largeino ? 0 : sizeof(grub_uint32_t))); ++} ++ ++static grub_uint8_t * ++grub_xfs_inline_de_inopos(struct grub_xfs_data *data, ++ struct grub_xfs_dir_entry *de) ++{ ++ return ((grub_uint8_t *)(de + 1)) + de->len - 1 + ++ (data->hasftype ? 1 : 0); ++} ++ ++static struct grub_xfs_dir_entry * ++grub_xfs_inline_next_de(struct grub_xfs_data *data, ++ struct grub_xfs_dir_header *head, ++ struct grub_xfs_dir_entry *de) ++{ ++ char *p = (char *)de + sizeof(struct grub_xfs_dir_entry) - 1 + de->len; ++ ++ p += head->largeino ? sizeof(grub_uint64_t) : sizeof(grub_uint32_t); ++ if (data->hasftype) ++ p++; ++ ++ return (struct grub_xfs_dir_entry *)p; ++} ++ ++static struct grub_xfs_dirblock_tail * ++grub_xfs_dir_tail(struct grub_xfs_data *data, void *dirblock) ++{ ++ int dirblksize = 1 << (data->sblock.log2_bsize + data->sblock.log2_dirblk); ++ ++ return (struct grub_xfs_dirblock_tail *) ++ ((char *)dirblock + dirblksize - sizeof (struct grub_xfs_dirblock_tail)); ++} ++ ++static struct grub_xfs_dir2_entry * ++grub_xfs_first_de(struct grub_xfs_data *data, void *dirblock) ++{ ++ if (data->hascrc) ++ return (struct grub_xfs_dir2_entry *)((char *)dirblock + 64); ++ return (struct grub_xfs_dir2_entry *)((char *)dirblock + 16); ++} ++ ++static struct grub_xfs_dir2_entry * ++grub_xfs_next_de(struct grub_xfs_data *data, struct grub_xfs_dir2_entry *de) ++{ ++ int size = sizeof (struct grub_xfs_dir2_entry) + de->len + 2 /* Tag */; ++ ++ if (data->hasftype) ++ size++; /* File type */ ++ return (struct grub_xfs_dir2_entry *)(((char *)de) + ALIGN_UP(size, 8)); ++} ++ ++static grub_uint64_t * ++grub_xfs_btree_keys(struct grub_xfs_data *data, ++ struct grub_xfs_btree_node *leaf) ++{ ++ grub_uint64_t *keys = (grub_uint64_t *)(leaf + 1); ++ ++ if (data->hascrc) ++ keys += 6; /* skip crc, uuid, ... */ ++ return keys; ++} ++ + static grub_err_t + grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, + struct grub_xfs_inode *inode) +@@ -281,6 +463,8 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, + grub_uint64_t block = grub_xfs_inode_block (data, ino); + int offset = grub_xfs_inode_offset (data, ino); + ++ grub_dprintf("xfs", "Reading inode (%"PRIuGRUB_UINT64_T") - %"PRIuGRUB_UINT64_T", %d\n", ++ ino, block, offset); + /* Read the inode. */ + if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data), + inode)) +@@ -303,6 +487,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + + if (node->inode.format == XFS_INODE_FORMAT_BTREE) + { ++ struct grub_xfs_btree_root *root; + const grub_uint64_t *keys; + int recoffset; + +@@ -310,15 +495,15 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + if (leaf == 0) + return 0; + +- nrec = grub_be_to_cpu16 (node->inode.data.btree.numrecs); +- keys = &node->inode.data.btree.keys[0]; ++ root = grub_xfs_inode_data(&node->inode); ++ nrec = grub_be_to_cpu16 (root->numrecs); ++ keys = &root->keys[0]; + if (node->inode.fork_offset) + recoffset = (node->inode.fork_offset - 1) / 2; + else + recoffset = (grub_xfs_inode_size(node->data) +- - ((char *) &node->inode.data.btree.keys +- - (char *) &node->inode)) +- / (2 * sizeof (grub_uint64_t)); ++ - ((char *) keys - (char *) &node->inode)) ++ / (2 * sizeof (grub_uint64_t)); + do + { + int i; +@@ -340,7 +525,10 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + 0, node->data->bsize, leaf)) + return 0; + +- if (grub_strncmp ((char *) leaf->magic, "BMAP", 4)) ++ if ((!node->data->hascrc && ++ grub_strncmp ((char *) leaf->magic, "BMAP", 4)) || ++ (node->data->hascrc && ++ grub_strncmp ((char *) leaf->magic, "BMA3", 4))) + { + grub_free (leaf); + grub_error (GRUB_ERR_BAD_FS, "not a correct XFS BMAP node"); +@@ -348,8 +536,8 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + } + + nrec = grub_be_to_cpu16 (leaf->numrecs); +- keys = &leaf->keys[0]; +- recoffset = ((node->data->bsize - ((char *) &leaf->keys ++ keys = grub_xfs_btree_keys(node->data, leaf); ++ recoffset = ((node->data->bsize - ((char *) keys + - (char *) leaf)) + / (2 * sizeof (grub_uint64_t))); + } +@@ -359,7 +547,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + else if (node->inode.format == XFS_INODE_FORMAT_EXT) + { + nrec = grub_be_to_cpu32 (node->inode.nextents); +- exts = &node->inode.data.extents[0]; ++ exts = grub_xfs_inode_data(&node->inode); + } + else + { +@@ -417,7 +605,7 @@ grub_xfs_read_symlink (grub_fshelp_node_t node) + switch (node->inode.format) + { + case XFS_INODE_FORMAT_INO: +- return grub_strndup (node->inode.data.raw, size); ++ return grub_strndup (grub_xfs_inode_data(&node->inode), size); + + case XFS_INODE_FORMAT_EXT: + { +@@ -512,23 +700,18 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + { + case XFS_INODE_FORMAT_INO: + { +- struct grub_xfs_dir_entry *de = &diro->inode.data.dir.direntry[0]; +- int smallino = !diro->inode.data.dir.dirhead.smallino; ++ struct grub_xfs_dir_header *head = grub_xfs_inode_data(&diro->inode); ++ struct grub_xfs_dir_entry *de = grub_xfs_inline_de(head); ++ int smallino = !head->largeino; + int i; + grub_uint64_t parent; + + /* If small inode numbers are used to pack the direntry, the + parent inode number is small too. */ + if (smallino) +- { +- parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4); +- /* The header is a bit smaller than usual. */ +- de = (struct grub_xfs_dir_entry *) ((char *) de - 4); +- } ++ parent = grub_be_to_cpu32 (head->parent.i4); + else +- { +- parent = grub_be_to_cpu64(diro->inode.data.dir.dirhead.parent.i8); +- } ++ parent = grub_be_to_cpu64 (head->parent.i8); + + /* Synthesize the direntries for `.' and `..'. */ + if (iterate_dir_call_hook (diro->ino, ".", &ctx)) +@@ -537,12 +720,10 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + if (iterate_dir_call_hook (parent, "..", &ctx)) + return 1; + +- for (i = 0; i < diro->inode.data.dir.dirhead.count; i++) ++ for (i = 0; i < head->count; i++) + { + grub_uint64_t ino; +- grub_uint8_t *inopos = (((grub_uint8_t *) de) +- + sizeof (struct grub_xfs_dir_entry) +- + de->len - 1); ++ grub_uint8_t *inopos = grub_xfs_inline_de_inopos(dir->data, de); + grub_uint8_t c; + + /* inopos might be unaligned. */ +@@ -567,10 +748,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + return 1; + de->name[de->len] = c; + +- de = ((struct grub_xfs_dir_entry *) +- (((char *) de)+ sizeof (struct grub_xfs_dir_entry) + de->len +- + ((smallino ? sizeof (grub_uint32_t) +- : sizeof (grub_uint64_t))) - 1)); ++ de = grub_xfs_inline_next_de(dir->data, head, de); + } + break; + } +@@ -597,15 +775,11 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + >> dirblk_log2); + blk++) + { +- /* The header is skipped, the first direntry is stored +- from byte 16. */ +- int pos = 16; ++ struct grub_xfs_dir2_entry *direntry = ++ grub_xfs_first_de(dir->data, dirblock); + int entries; +- int tail_start = (dirblk_size +- - sizeof (struct grub_xfs_dirblock_tail)); +- +- struct grub_xfs_dirblock_tail *tail; +- tail = (struct grub_xfs_dirblock_tail *) &dirblock[tail_start]; ++ struct grub_xfs_dirblock_tail *tail = ++ grub_xfs_dir_tail(dir->data, dirblock); + + numread = grub_xfs_read_file (dir, 0, 0, + blk << dirblk_log2, +@@ -617,13 +791,11 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + - grub_be_to_cpu32 (tail->leaf_stale)); + + /* Iterate over all entries within this block. */ +- while (pos < tail_start) ++ while ((char *)direntry < (char *)tail) + { +- struct grub_xfs_dir2_entry *direntry; + grub_uint8_t *freetag; + char *filename; + +- direntry = (struct grub_xfs_dir2_entry *) &dirblock[pos]; + freetag = (grub_uint8_t *) direntry; + + if (grub_get_unaligned16 (freetag) == 0XFFFF) +@@ -631,14 +803,16 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + grub_uint8_t *skip = (freetag + sizeof (grub_uint16_t)); + + /* This entry is not used, go to the next one. */ +- pos += grub_be_to_cpu16 (grub_get_unaligned16 (skip)); ++ direntry = (struct grub_xfs_dir2_entry *) ++ (((char *)direntry) + ++ grub_be_to_cpu16 (grub_get_unaligned16 (skip))); + + continue; + } + +- filename = &dirblock[pos + sizeof (*direntry)]; +- /* The byte after the filename is for the tag, which +- is not used by GRUB. So it can be overwritten. */ ++ filename = (char *)(direntry + 1); ++ /* The byte after the filename is for the filetype, padding, or ++ tag, which is not used by GRUB. So it can be overwritten. */ + filename[direntry->len] = '\0'; + + if (iterate_dir_call_hook (grub_be_to_cpu64(direntry->inode), +@@ -655,8 +829,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + break; + + /* Select the next directory entry. */ +- pos = GRUB_XFS_NEXT_DIRENT (pos, direntry->len); +- pos = GRUB_XFS_ROUND_TO_DIRENT (pos); ++ direntry = grub_xfs_next_de(dir->data, direntry); + } + } + grub_free (dirblock); +@@ -681,19 +854,14 @@ grub_xfs_mount (grub_disk_t disk) + if (!data) + return 0; + ++ grub_dprintf("xfs", "Reading sb\n"); + /* Read the superblock. */ + if (grub_disk_read (disk, 0, 0, + sizeof (struct grub_xfs_sblock), &data->sblock)) + goto fail; + +- if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4) +- || data->sblock.log2_bsize < GRUB_DISK_SECTOR_BITS +- || ((int) data->sblock.log2_bsize +- + (int) data->sblock.log2_dirblk) >= 27) +- { +- grub_error (GRUB_ERR_BAD_FS, "not a XFS filesystem"); +- goto fail; +- } ++ if (!grub_xfs_sb_valid(data)) ++ goto fail; + + data = grub_realloc (data, + sizeof (struct grub_xfs_data) +@@ -708,9 +876,13 @@ grub_xfs_mount (grub_disk_t disk) + data->diropen.inode_read = 1; + data->bsize = grub_be_to_cpu32 (data->sblock.bsize); + data->agsize = grub_be_to_cpu32 (data->sblock.agsize); ++ data->hasftype = grub_xfs_sb_hasftype(data); ++ data->hascrc = grub_xfs_sb_hascrc(data); + + data->disk = disk; + data->pos = 0; ++ grub_dprintf("xfs", "Reading root ino %"PRIuGRUB_UINT64_T"\n", ++ grub_cpu_to_be64(data->sblock.rootino)); + + grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); + +-- +2.4.3 + diff --git a/0429-NEWS-XFS-v5-support.patch b/0429-NEWS-XFS-v5-support.patch new file mode 100644 index 0000000..57b7111 --- /dev/null +++ b/0429-NEWS-XFS-v5-support.patch @@ -0,0 +1,24 @@ +From df2aaf94b8d76b1ff7479ad5dc990f3efa30e419 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 12 Jun 2015 09:40:00 +0300 +Subject: [PATCH 429/506] NEWS: XFS v5 support + +--- + NEWS | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/NEWS b/NEWS +index e417eba..ad572ff 100644 +--- a/NEWS ++++ b/NEWS +@@ -17,6 +17,7 @@ New in 2.02: + files. + * ZFS features support. + * ZFS LZ4 support. ++ * XFS V5 format support. + + * New/improved terminal and video support: + * Monochrome text (matching `hercules' in GRUB Legacy). +-- +2.4.3 + diff --git a/0430-disk-ahci.c-Use-defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch b/0430-disk-ahci.c-Use-defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch new file mode 100644 index 0000000..c0b85f0 --- /dev/null +++ b/0430-disk-ahci.c-Use-defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch @@ -0,0 +1,30 @@ +From f4b1b48a837a034748a103adc7e9fd719a39ce42 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Thu, 28 May 2015 19:14:19 +0200 +Subject: [PATCH 430/506] disk/ahci.c: Use defines + `GRUB_AHCI_HBA_PORT_CMD_SPIN_UP` and `GRUB_AHCI_HBA_PORT_CMD_POWER_ON` + +Instead of hard coding `2` and `4` use the macros defined already at the +top of the file. As a consequence, wrap the now too long line. +--- + grub-core/disk/ahci.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index da5fead..f4725e8 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -552,7 +552,9 @@ grub_ahci_pciinit (grub_pci_device_t dev, + adevs[i]->hba->ports[adevs[i]->port].sata_error); + + adevs[i]->hba->ports[adevs[i]->port].command +- = (adevs[i]->hba->ports[adevs[i]->port].command & 0x0fffffff) | (1 << 28) | 2 | 4; ++ = (adevs[i]->hba->ports[adevs[i]->port].command & 0x0fffffff) | (1 << 28) ++ | GRUB_AHCI_HBA_PORT_CMD_SPIN_UP ++ | GRUB_AHCI_HBA_PORT_CMD_POWER_ON; + + /* struct grub_disk_ata_pass_through_parms parms2; + grub_memset (&parms2, 0, sizeof (parms2)); +-- +2.4.3 + diff --git a/0431-Fix-exit-to-EFI-firmware.patch b/0431-Fix-exit-to-EFI-firmware.patch new file mode 100644 index 0000000..c408650 --- /dev/null +++ b/0431-Fix-exit-to-EFI-firmware.patch @@ -0,0 +1,55 @@ +From c945ca75c3b2b900040b905323b1226cb60a1166 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Fri, 15 Aug 2014 12:22:43 -0400 +Subject: [PATCH 431/506] Fix exit to EFI firmware + +The current code for EFI grub_exit() calls grub_efi_fini() before +returning to firmware. In the case of ARM, this leaves a timer +event running which could lead to a firmware crash. This patch +changes this so that grub_machine_fini() is called with a NORETURN +flag. This allows machine-specific shutdown to happen as well +as the shutdown done by grub_efi_fini(). + +Signed-off-by: Mark Salter +--- + grub-core/kern/arm/efi/init.c | 2 +- + grub-core/kern/efi/efi.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c +index a6ae034..2572ca8 100644 +--- a/grub-core/kern/arm/efi/init.c ++++ b/grub-core/kern/arm/efi/init.c +@@ -67,7 +67,7 @@ grub_machine_fini (int flags) + + b = grub_efi_system_table->boot_services; + +- efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0); ++ efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0); + efi_call_1 (b->close_event, tmr_evt); + + grub_efi_fini (); +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index 49a1501..2e77834 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* The handle of GRUB itself. Filled in by the startup code. */ + grub_efi_handle_t grub_efi_image_handle; +@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) + void + grub_exit (void) + { +- grub_efi_fini (); ++ grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + efi_call_4 (grub_efi_system_table->boot_services->exit, + grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); + for (;;) ; +-- +2.4.3 + diff --git a/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch b/0432-Migrate-PPC-from-Yaboot-to-Grub2.patch similarity index 95% rename from 0089-Migrate-PPC-from-Yaboot-to-Grub2.patch rename to 0432-Migrate-PPC-from-Yaboot-to-Grub2.patch index bcd3f45..58fd2b5 100644 --- a/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch +++ b/0432-Migrate-PPC-from-Yaboot-to-Grub2.patch @@ -1,7 +1,7 @@ -From f01392a68f7f20bcc064a7d28e10805509701c4d Mon Sep 17 00:00:00 2001 +From 08a6cb996791748ae3f628ca81ea126b98befc0d Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 28 Mar 2012 14:46:41 -0500 -Subject: [PATCH 089/152] Migrate PPC from Yaboot to Grub2 +Subject: [PATCH 432/506] Migrate PPC from Yaboot to Grub2 Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. @@ -12,7 +12,7 @@ maximum screen size so that text is not overwritten. create mode 100644 util/grub.d/20_ppc_terminfo.in diff --git a/Makefile.util.def b/Makefile.util.def -index a286a89..8f40e78 100644 +index 3cb6b21..5bb7cef 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -485,6 +485,13 @@ script = { @@ -150,5 +150,5 @@ index 0000000..10d6658 + terminfo -g ${X}x${Y} ${TERMINAL} +EOF -- -1.9.3 +2.4.3 diff --git a/0090-Add-fw_path-variable-revised.patch b/0433-Add-fw_path-variable-revised.patch similarity index 93% rename from 0090-Add-fw_path-variable-revised.patch rename to 0433-Add-fw_path-variable-revised.patch index 96eb202..51a0463 100644 --- a/0090-Add-fw_path-variable-revised.patch +++ b/0433-Add-fw_path-variable-revised.patch @@ -1,7 +1,7 @@ -From 5bd3e1f888eeddc2575608516220ffa7b8270c7a Mon Sep 17 00:00:00 2001 +From dd00df22ba2bc9b9e388c65f98d208330020fc24 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 19 Sep 2012 21:22:55 -0300 -Subject: [PATCH 090/152] Add fw_path variable (revised) +Subject: [PATCH 433/506] Add fw_path variable (revised) This patch makes grub look for its config file on efi where the app was found. It was originally written by Matthew Garrett, and adapted to fix the @@ -41,7 +41,7 @@ index 9cad0c4..8ab7794 100644 } diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 3a926fc..6f4970f 100644 +index 78a70a8..df12dfb 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -319,7 +319,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -77,5 +77,5 @@ index 3a926fc..6f4970f 100644 prefix = grub_env_get ("prefix"); if (prefix) -- -1.9.3 +2.4.3 diff --git a/0091-Add-support-for-linuxefi.patch b/0434-Add-support-for-linuxefi.patch similarity index 98% rename from 0091-Add-support-for-linuxefi.patch rename to 0434-Add-support-for-linuxefi.patch index 348c517..a093e2d 100644 --- a/0091-Add-support-for-linuxefi.patch +++ b/0434-Add-support-for-linuxefi.patch @@ -1,7 +1,7 @@ -From 70e7bfb2caa9d0f52187b4f6e84762c6459c5903 Mon Sep 17 00:00:00 2001 +From 5b84fbd00374f561f82277b7d22fd8a4877667e6 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 10 Jul 2012 11:58:52 -0400 -Subject: [PATCH 091/152] Add support for linuxefi +Subject: [PATCH 434/506] Add support for linuxefi --- grub-core/Makefile.core.def | 8 + @@ -13,10 +13,10 @@ Subject: [PATCH 091/152] 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 42443bc..ec46506 100644 +index a6101de..a056b42 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1706,6 +1706,14 @@ module = { +@@ -1692,6 +1692,14 @@ module = { }; module = { @@ -32,7 +32,7 @@ index 42443bc..ec46506 100644 efi = loader/efi/chainloader.c; i386_pc = loader/i386/pc/chainloader.c; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index be37afd..ddeca60 100644 +index 20a47aa..efb15cc 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; @@ -452,7 +452,7 @@ index 0000000..b79e632 + grub_unregister_command (cmd_initrd); +} diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 489cf9e..9370fd5 100644 +index 0e6fd86..9a2da0e 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -40,6 +40,9 @@ void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds); @@ -478,5 +478,5 @@ index da0ca3b..fc36bda 100644 /* Boot parameters for Linux based on 2.6.12. This is used by the setup -- -1.9.3 +2.4.3 diff --git a/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch b/0435-Use-linuxefi-and-initrdefi-where-appropriate.patch similarity index 90% rename from 0092-Use-linuxefi-and-initrdefi-where-appropriate.patch rename to 0435-Use-linuxefi-and-initrdefi-where-appropriate.patch index 8ac647c..0304fbd 100644 --- a/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch +++ b/0435-Use-linuxefi-and-initrdefi-where-appropriate.patch @@ -1,14 +1,14 @@ -From acc83cfa76a6457be73b1e748a80deb3967e2364 Mon Sep 17 00:00:00 2001 +From 93b844d65dde67bf4dd668149bdcccab92514671 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 16 Jul 2012 18:57:11 -0400 -Subject: [PATCH 092/152] Use "linuxefi" and "initrdefi" where appropriate. +Subject: [PATCH 435/506] 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 00d1931..ad34cc0 100644 +index 859b608..b740c93 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -127,17 +127,31 @@ linux_entry () @@ -46,5 +46,5 @@ index 00d1931..ad34cc0 100644 sed "s/^/$submenu_indentation/" << EOF } -- -1.9.3 +2.4.3 diff --git a/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch b/0436-Don-t-allow-insmod-when-secure-boot-is-enabled.patch similarity index 90% rename from 0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch rename to 0436-Don-t-allow-insmod-when-secure-boot-is-enabled.patch index 6de4437..94500c2 100644 --- a/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +++ b/0436-Don-t-allow-insmod-when-secure-boot-is-enabled.patch @@ -1,7 +1,7 @@ -From fe7b32ab9e58470fdf930d8efc7c9ebcd69e6ef3 Mon Sep 17 00:00:00 2001 +From 6ca0c8870102ed6465fd2c66fd8f6d3fae76a99e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Oct 2012 10:40:49 -0400 -Subject: [PATCH 093/152] Don't allow insmod when secure boot is enabled. +Subject: [PATCH 436/506] Don't allow insmod when secure boot is enabled. Hi, @@ -23,7 +23,7 @@ moves the check into grub_dl_load_file. 3 files changed, 50 insertions(+) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index 6850e04..b0b0405 100644 +index 3a438e9..58931fa 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -38,6 +38,14 @@ @@ -62,10 +62,10 @@ index 6850e04..b0b0405 100644 file = grub_file_open (filename); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index b9eb1ab..cd839cc 100644 +index 2e77834..d12701e 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -259,6 +259,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, +@@ -260,6 +260,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, return NULL; } @@ -101,10 +101,10 @@ index b9eb1ab..cd839cc 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 9370fd5..a000c38 100644 +index 9a2da0e..2245632 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h -@@ -72,6 +72,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, +@@ -76,6 +76,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, const grub_efi_guid_t *guid, void *data, grub_size_t datasize); @@ -113,5 +113,5 @@ index 9370fd5..a000c38 100644 EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, const grub_efi_device_path_t *dp2); -- -1.9.3 +2.4.3 diff --git a/0094-Pass-x-hex-hex-straight-through-unmolested.patch b/0437-Pass-x-hex-hex-straight-through-unmolested.patch similarity index 93% rename from 0094-Pass-x-hex-hex-straight-through-unmolested.patch rename to 0437-Pass-x-hex-hex-straight-through-unmolested.patch index 80b5fd0..9d23d5c 100644 --- a/0094-Pass-x-hex-hex-straight-through-unmolested.patch +++ b/0437-Pass-x-hex-hex-straight-through-unmolested.patch @@ -1,7 +1,7 @@ -From a4f335a93d417c7f51f715d55ae59621fc9772ad Mon Sep 17 00:00:00 2001 +From e2df8fe29842472f8d49dfbfd39fca1b9c809eee Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 Oct 2012 13:24:37 -0400 -Subject: [PATCH 094/152] Pass "\x[[:hex:]][[:hex:]]" straight through +Subject: [PATCH 437/506] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. --- @@ -11,10 +11,10 @@ Subject: [PATCH 094/152] Pass "\x[[:hex:]][[:hex:]]" straight through 3 files changed, 84 insertions(+), 9 deletions(-) diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c -index 2807f80..0f40e04 100644 +index 9b4e727..02c46f9 100644 --- a/grub-core/commands/wildcard.c +++ b/grub-core/commands/wildcard.c -@@ -458,6 +458,12 @@ check_file (const char *dir, const char *basename) +@@ -462,6 +462,12 @@ check_file (const char *dir, const char *basename) return ctx.found; } @@ -27,7 +27,7 @@ index 2807f80..0f40e04 100644 static void unescape (char *out, const char *in, const char *end) { -@@ -466,7 +472,15 @@ unescape (char *out, const char *in, const char *end) +@@ -470,7 +476,15 @@ unescape (char *out, const char *in, const char *end) for (optr = out, iptr = in; iptr < end;) { @@ -104,7 +104,7 @@ index d5e10ee..0a5b2af 100644 *buf++ = *c; diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index afd5513..8f01c1b 100644 +index bb70ebf..2b9341f 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -52,6 +52,12 @@ static struct grub_script_scope *scope = 0; @@ -179,5 +179,5 @@ index afd5513..8f01c1b 100644 case '$': if (escaped) -- -1.9.3 +2.4.3 diff --git a/0095-Fix-crash-on-http.patch b/0438-Fix-crash-on-http.patch similarity index 87% rename from 0095-Fix-crash-on-http.patch rename to 0438-Fix-crash-on-http.patch index 399384e..b6bedab 100644 --- a/0095-Fix-crash-on-http.patch +++ b/0438-Fix-crash-on-http.patch @@ -1,7 +1,7 @@ -From e5a51c7c96d347cd6cbb7a2aa11f5dd7358c802a Mon Sep 17 00:00:00 2001 +From cf9eb6291b60f27c247c2586b1ee57498de72607 Mon Sep 17 00:00:00 2001 From: Gustavo Luiz Duarte Date: Tue, 25 Sep 2012 18:40:55 -0400 -Subject: [PATCH 095/152] Fix crash on http +Subject: [PATCH 438/506] Fix crash on http Don't free file->data on receiving FIN flag since it is used all over without checking. http_close() will be called later to free that memory. @@ -24,5 +24,5 @@ index 4684f8b..ef9538c 100644 if (!data->sock) { -- -1.9.3 +2.4.3 diff --git a/0096-IBM-client-architecture-CAS-reboot-support.patch b/0439-IBM-client-architecture-CAS-reboot-support.patch similarity index 95% rename from 0096-IBM-client-architecture-CAS-reboot-support.patch rename to 0439-IBM-client-architecture-CAS-reboot-support.patch index 133896b..a251c7e 100644 --- a/0096-IBM-client-architecture-CAS-reboot-support.patch +++ b/0439-IBM-client-architecture-CAS-reboot-support.patch @@ -1,7 +1,7 @@ -From 9d1411ffa7290c1cbdc9ee95bb5fcc5506e63e0f Mon Sep 17 00:00:00 2001 +From 3d35130015653257ae8e65bb85d63180195a34e7 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Thu, 20 Sep 2012 18:07:39 -0300 -Subject: [PATCH 096/152] IBM client architecture (CAS) reboot support +Subject: [PATCH 439/506] IBM client architecture (CAS) reboot support This is an implementation of IBM client architecture (CAS) reboot for GRUB. @@ -95,7 +95,7 @@ index ddb7783..6db8b98 100644 + return 0; +} diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 6f4970f..f72844c 100644 +index df12dfb..f805cb3 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,9 @@ @@ -132,7 +132,7 @@ index 6f4970f..f72844c 100644 grub_errno = GRUB_ERR_NONE; } diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index 8f01c1b..cec9539 100644 +index 2b9341f..0f7d143 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -27,6 +27,9 @@ @@ -145,7 +145,7 @@ index 8f01c1b..cec9539 100644 /* Max digits for a char is 3 (0xFF is 255), similarly for an int it is sizeof (int) * 3, and one extra for a possible -ve sign. */ -@@ -892,6 +895,10 @@ grub_script_execute_sourcecode (const char *source) +@@ -912,6 +915,10 @@ grub_script_execute_sourcecode (const char *source) grub_err_t ret = 0; struct grub_script *parsed_script; @@ -170,5 +170,5 @@ index 8e42513..9f26c69 100644 #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) -- -1.9.3 +2.4.3 diff --git a/0097-Add-vlan-tag-support.patch b/0440-Add-vlan-tag-support.patch similarity index 98% rename from 0097-Add-vlan-tag-support.patch rename to 0440-Add-vlan-tag-support.patch index 20c6ed0..cb65b8e 100644 --- a/0097-Add-vlan-tag-support.patch +++ b/0440-Add-vlan-tag-support.patch @@ -1,7 +1,7 @@ -From c987623113e2d03e80f0ba1e108bf0a800628f85 Mon Sep 17 00:00:00 2001 +From eb41d0f572081eeadf04cdf22a9ef508a9dc3216 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 30 Oct 2012 15:19:39 -0200 -Subject: [PATCH 097/152] Add vlan-tag support +Subject: [PATCH 440/506] Add vlan-tag support This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows multiple VLANs in a bridged network to share the same physical network link but @@ -182,5 +182,5 @@ index 538baa3..a799e6b 100644 + #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.4.3 diff --git a/0098-Add-X-option-to-printf-functions.patch b/0441-Add-X-option-to-printf-functions.patch similarity index 66% rename from 0098-Add-X-option-to-printf-functions.patch rename to 0441-Add-X-option-to-printf-functions.patch index f753e07..d134695 100644 --- a/0098-Add-X-option-to-printf-functions.patch +++ b/0441-Add-X-option-to-printf-functions.patch @@ -1,17 +1,17 @@ -From d7aaf1651f4b36721f73331753d017d33d7879b4 Mon Sep 17 00:00:00 2001 +From 29512e7fcc5500d37dff524da4a7af0c60971d65 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 16:58:39 -0200 -Subject: [PATCH 098/152] Add %X option to printf functions. +Subject: [PATCH 441/506] Add %X option to printf functions. --- grub-core/kern/misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index c5c815d..a56cfe7 100644 +index 906d2c2..6b3397f 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c -@@ -762,7 +762,7 @@ __umoddi3 (grub_uint64_t a, grub_uint64_t b) +@@ -587,7 +587,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) static inline char * grub_lltoa (char *str, int c, unsigned long long n) { @@ -20,7 +20,7 @@ index c5c815d..a56cfe7 100644 char *p; if ((long long) n < 0 && c == 'd') -@@ -777,7 +777,7 @@ grub_lltoa (char *str, int c, unsigned long long n) +@@ -602,7 +602,7 @@ grub_lltoa (char *str, int c, unsigned long long n) do { unsigned d = (unsigned) (n & 0xf); @@ -29,7 +29,7 @@ index c5c815d..a56cfe7 100644 } while (n >>= 4); else -@@ -850,6 +850,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, +@@ -675,6 +675,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, { case 'p': case 'x': @@ -37,7 +37,7 @@ index c5c815d..a56cfe7 100644 case 'u': case 'd': case 'c': -@@ -930,6 +931,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, +@@ -755,6 +756,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, switch (c) { case 'x': @@ -45,7 +45,7 @@ index c5c815d..a56cfe7 100644 case 'u': args->ptr[curn].type = UNSIGNED_INT + longfmt; break; -@@ -1067,6 +1069,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, +@@ -892,6 +894,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, c = 'x'; /* Fall through. */ case 'x': @@ -54,5 +54,5 @@ index c5c815d..a56cfe7 100644 case 'd': { -- -1.9.3 +2.4.3 diff --git a/0099-DHCP-client-ID-and-UUID-options-added.patch b/0442-DHCP-client-ID-and-UUID-options-added.patch similarity index 94% rename from 0099-DHCP-client-ID-and-UUID-options-added.patch rename to 0442-DHCP-client-ID-and-UUID-options-added.patch index 62451ff..350bbd8 100644 --- a/0099-DHCP-client-ID-and-UUID-options-added.patch +++ b/0442-DHCP-client-ID-and-UUID-options-added.patch @@ -1,7 +1,7 @@ -From 2f3846a557e4ddf83f44e166d959ee460bedf8e1 Mon Sep 17 00:00:00 2001 +From 0cdf813f43fff3c7dbb416e7afd3ea01fc2cb1cf Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:18:53 -0200 -Subject: [PATCH 099/152] DHCP client ID and UUID options added. +Subject: [PATCH 442/506] DHCP client ID and UUID options added. --- grub-core/net/bootp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++----- @@ -9,7 +9,7 @@ Subject: [PATCH 099/152] DHCP client ID and UUID options added. 2 files changed, 81 insertions(+), 8 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 6310ed4..88f2056 100644 +index 4fdeac3..8324aff 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -25,6 +25,49 @@ @@ -112,7 +112,7 @@ index 6310ed4..88f2056 100644 /* If you need any other options please contact GRUB development team. */ } -@@ -288,14 +367,6 @@ grub_net_process_dhcp (struct grub_net_buff *nb, +@@ -295,14 +374,6 @@ grub_net_process_dhcp (struct grub_net_buff *nb, } } @@ -141,5 +141,5 @@ index a799e6b..59e5975 100644 }; -- -1.9.3 +2.4.3 diff --git a/0100-Search-for-specific-config-file-for-netboot.patch b/0443-Search-for-specific-config-file-for-netboot.patch similarity index 96% rename from 0100-Search-for-specific-config-file-for-netboot.patch rename to 0443-Search-for-specific-config-file-for-netboot.patch index 274d16e..9ba864a 100644 --- a/0100-Search-for-specific-config-file-for-netboot.patch +++ b/0443-Search-for-specific-config-file-for-netboot.patch @@ -1,7 +1,7 @@ -From bf19a1e123fd09552165bd0d2b19ccf438c0a46c Mon Sep 17 00:00:00 2001 +From 6d9169d45e90c95fd17d9b42ab7ea91d18edee6b Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:22:07 -0200 -Subject: [PATCH 100/152] Search for specific config file for netboot +Subject: [PATCH 443/506] Search for specific config file for netboot This patch implements a search for a specific configuration when the config file is on a remoteserver. It uses the following order: @@ -22,10 +22,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=873406 3 files changed, 135 insertions(+), 4 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index f2e723b..578e057 100644 +index 21a4e94..cc68b0d 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c -@@ -1702,6 +1702,124 @@ grub_net_restore_hw (void) +@@ -1704,6 +1704,124 @@ grub_net_restore_hw (void) return GRUB_ERR_NONE; } @@ -151,7 +151,7 @@ index f2e723b..578e057 100644 static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f72844c..85d2a28 100644 +index f805cb3..23e2d3f 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,7 @@ @@ -199,5 +199,5 @@ index 59e5975..88fc71c 100644 + #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.4.3 diff --git a/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch b/0444-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch similarity index 96% rename from 0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch rename to 0444-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch index 407e832..b2aa55d 100644 --- a/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +++ b/0444-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch @@ -1,7 +1,7 @@ -From ddfb160353df14e9f88affe7498512a553146872 Mon Sep 17 00:00:00 2001 +From 86baf514c1f19d223bfbfb2ad7007e64f22a0648 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Tue, 22 Jan 2013 06:31:38 +0100 -Subject: [PATCH 101/152] blscfg: add blscfg module to parse Boot Loader +Subject: [PATCH 444/506] blscfg: add blscfg module to parse Boot Loader Specification snippets http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec @@ -21,10 +21,10 @@ 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 ec46506..7bf1c8a 100644 +index a056b42..98b6485 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -747,6 +747,14 @@ module = { +@@ -733,6 +733,14 @@ module = { }; module = { @@ -247,5 +247,5 @@ index 0000000..4274aca + grub_unregister_extcmd (cmd); +} -- -1.9.3 +2.4.3 diff --git a/0102-Move-bash-completion-script-922997.patch b/0445-Move-bash-completion-script-922997.patch similarity index 85% rename from 0102-Move-bash-completion-script-922997.patch rename to 0445-Move-bash-completion-script-922997.patch index a8d703c..08fb306 100644 --- a/0102-Move-bash-completion-script-922997.patch +++ b/0445-Move-bash-completion-script-922997.patch @@ -1,7 +1,7 @@ -From f60046d87e55646d36c21520c5f6391c184ec8ad Mon Sep 17 00:00:00 2001 +From e0c1af15ca7361a543adfe9b9d61d1cd43d7be43 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Apr 2013 14:35:34 -0400 -Subject: [PATCH 102/152] Move bash completion script (#922997) +Subject: [PATCH 445/506] Move bash completion script (#922997) Apparently these go in a new place now. --- @@ -22,5 +22,5 @@ index 136287c..0bcdb06 100644 $(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status -- -1.9.3 +2.4.3 diff --git a/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch b/0446-for-ppc-reset-console-display-attr-when-clear-screen.patch similarity index 88% rename from 0103-for-ppc-reset-console-display-attr-when-clear-screen.patch rename to 0446-for-ppc-reset-console-display-attr-when-clear-screen.patch index 2a37af3..c270a5d 100644 --- a/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch +++ b/0446-for-ppc-reset-console-display-attr-when-clear-screen.patch @@ -1,7 +1,7 @@ -From e52a5b66e765740deea4dbd201ab802c408184b9 Mon Sep 17 00:00:00 2001 +From 2add40f1185770a5cae18187659c334090a70ef5 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 24 Apr 2013 10:51:48 -0300 -Subject: [PATCH 103/152] for ppc, reset console display attr when clear screen +Subject: [PATCH 446/506] for ppc, reset console display attr when clear screen This should fix this bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=908519 @@ -23,5 +23,5 @@ index f0d3e3d..7cb7909 100644 data->reverse_video_off = grub_strdup ("\e[m"); if (grub_strcmp ("ieee1275", str) == 0) -- -1.9.3 +2.4.3 diff --git a/0104-Don-t-write-messages-to-the-screen.patch b/0447-Don-t-write-messages-to-the-screen.patch similarity index 95% rename from 0104-Don-t-write-messages-to-the-screen.patch rename to 0447-Don-t-write-messages-to-the-screen.patch index 688e66e..318de7a 100644 --- a/0104-Don-t-write-messages-to-the-screen.patch +++ b/0447-Don-t-write-messages-to-the-screen.patch @@ -1,7 +1,7 @@ -From 0ee337319fc8c21da04bca1cabb51b3445dba3fd Mon Sep 17 00:00:00 2001 +From e9cf038f6f4c0c94679ca290da2c12ece83b16c2 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:30:20 -0400 -Subject: [PATCH 104/152] Don't write messages to the screen +Subject: [PATCH 447/506] Don't write messages to the screen Writing messages to the screen before the menus or boot splash happens so quickly it looks like something is wrong and isn't @@ -15,7 +15,7 @@ very appealing. 5 files changed, 35 deletions(-) diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S -index b4975e2..432a472 100644 +index 2bd0b2d..ea167fe 100644 --- a/grub-core/boot/i386/pc/boot.S +++ b/grub-core/boot/i386/pc/boot.S @@ -249,9 +249,6 @@ real_start: @@ -29,7 +29,7 @@ index b4975e2..432a472 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 d030a14..a494d02 100644 +index 1ee4cf5..c8b87ed 100644 --- a/grub-core/boot/i386/pc/diskboot.S +++ b/grub-core/boot/i386/pc/diskboot.S @@ -50,11 +50,6 @@ _start: @@ -120,7 +120,7 @@ index 8ab7794..da47b18 100644 grub_boot_time ("Before loading embedded modules."); diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ad34cc0..e762e1f 100644 +index b740c93..70f3169 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -126,29 +126,22 @@ linux_entry () @@ -154,5 +154,5 @@ index ad34cc0..e762e1f 100644 EOF fi -- -1.9.3 +2.4.3 diff --git a/0105-Don-t-print-GNU-GRUB-header.patch b/0448-Don-t-print-GNU-GRUB-header.patch similarity index 82% rename from 0105-Don-t-print-GNU-GRUB-header.patch rename to 0448-Don-t-print-GNU-GRUB-header.patch index 1b16ad4..493ca3e 100644 --- a/0105-Don-t-print-GNU-GRUB-header.patch +++ b/0448-Don-t-print-GNU-GRUB-header.patch @@ -1,7 +1,7 @@ -From e3cabcd95237fadbad8e6a0e36222d97d16b5365 Mon Sep 17 00:00:00 2001 +From 58753a84c70d230beb407972706c71f1e3389e9b Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:53:48 -0400 -Subject: [PATCH 105/152] Don't print GNU GRUB header +Subject: [PATCH 448/506] Don't print GNU GRUB header No one cares. --- @@ -9,7 +9,7 @@ No one cares. 1 file changed, 2 insertions(+) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 85d2a28..3777cd2 100644 +index 23e2d3f..8e2ec37 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -212,6 +212,7 @@ grub_normal_init_page (struct grub_term_output *term, @@ -29,5 +29,5 @@ index 85d2a28..3777cd2 100644 static void -- -1.9.3 +2.4.3 diff --git a/0106-Don-t-add-to-highlighted-row.patch b/0449-Don-t-add-to-highlighted-row.patch similarity index 80% rename from 0106-Don-t-add-to-highlighted-row.patch rename to 0449-Don-t-add-to-highlighted-row.patch index 3046550..974d378 100644 --- a/0106-Don-t-add-to-highlighted-row.patch +++ b/0449-Don-t-add-to-highlighted-row.patch @@ -1,7 +1,7 @@ -From c89f05d148a1a1416513d22f62d23504b35dd230 Mon Sep 17 00:00:00 2001 +From 36d33527138e344d957a2e589f26455078aabe7a Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 17:49:45 -0400 -Subject: [PATCH 106/152] Don't add '*' to highlighted row +Subject: [PATCH 449/506] Don't add '*' to highlighted row It is already highlighted. --- @@ -9,7 +9,7 @@ It is already highlighted. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 2ff2941..2f84fcc 100644 +index e22bb91..a3d1f23 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -242,7 +242,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -22,5 +22,5 @@ index 2ff2941..2f84fcc 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -1.9.3 +2.4.3 diff --git a/0107-Message-string-cleanups.patch b/0450-Message-string-cleanups.patch similarity index 92% rename from 0107-Message-string-cleanups.patch rename to 0450-Message-string-cleanups.patch index 9ee9ab7..e317336 100644 --- a/0107-Message-string-cleanups.patch +++ b/0450-Message-string-cleanups.patch @@ -1,7 +1,7 @@ -From 6c33a9b3a96a5e8c782a8eef97f5d95a3a542921 Mon Sep 17 00:00:00 2001 +From 2115d88318a56ccc03fc298533b06c18e919517c Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 11:09:04 -0400 -Subject: [PATCH 107/152] Message string cleanups +Subject: [PATCH 450/506] Message string cleanups Make use of terminology consistent. Remove jargon. --- @@ -9,7 +9,7 @@ Make use of terminology consistent. Remove jargon. 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 2f84fcc..9d20c6b 100644 +index a3d1f23..64a8386 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,9 +157,8 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -57,7 +57,7 @@ index 2f84fcc..9d20c6b 100644 STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); } } -@@ -440,7 +437,7 @@ menu_text_print_timeout (int timeout, void *dataptr) +@@ -443,7 +440,7 @@ menu_text_print_timeout (int timeout, void *dataptr) || data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN) msg_translated = grub_xasprintf (_("%ds"), timeout); else @@ -67,5 +67,5 @@ index 2f84fcc..9d20c6b 100644 { grub_print_error (); -- -1.9.3 +2.4.3 diff --git a/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch b/0451-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch similarity index 84% rename from 0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch rename to 0451-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch index 3496c9e..c44d4ef 100644 --- a/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +++ b/0451-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch @@ -1,14 +1,14 @@ -From 6227514ebbfcf1744060eb4bf1b39b669221809d Mon Sep 17 00:00:00 2001 +From 694bfc483adcd4ef23aad0fd88d6331c1f2b8492 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:23 -0400 -Subject: [PATCH 108/152] Fix border spacing now that we aren't displaying it +Subject: [PATCH 451/506] Fix border spacing now that we aren't displaying it --- grub-core/normal/menu_text.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 9d20c6b..aa3454f 100644 +index 64a8386..1062d64 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -331,12 +331,12 @@ grub_menu_init_page (int nested, int edit, @@ -28,5 +28,5 @@ index 9d20c6b..aa3454f 100644 geo->timeout_lines = 2; -- -1.9.3 +2.4.3 diff --git a/0109-Use-the-correct-indentation-for-the-term-help-text.patch b/0452-Use-the-correct-indentation-for-the-term-help-text.patch similarity index 84% rename from 0109-Use-the-correct-indentation-for-the-term-help-text.patch rename to 0452-Use-the-correct-indentation-for-the-term-help-text.patch index 4efaa43..0f6b8a7 100644 --- a/0109-Use-the-correct-indentation-for-the-term-help-text.patch +++ b/0452-Use-the-correct-indentation-for-the-term-help-text.patch @@ -1,7 +1,7 @@ -From 9cc9edb600ad1acc1598910ed95a8482ff3de6e2 Mon Sep 17 00:00:00 2001 +From 066292ef95375f1848c5e403d7ca7d73277bdbcb Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:49 -0400 -Subject: [PATCH 109/152] Use the correct indentation for the term help text +Subject: [PATCH 452/506] Use the correct indentation for the term help text That is consistent with the menu help text --- @@ -9,7 +9,7 @@ That is consistent with the menu help text 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 3777cd2..0da2a52 100644 +index 8e2ec37..725e441 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -426,8 +426,8 @@ grub_normal_reader_init (int nested) @@ -24,5 +24,5 @@ index 3777cd2..0da2a52 100644 grub_print_message_indented (msg_formatted, 0, 0, term); grub_putcode ('\n', term); -- -1.9.3 +2.4.3 diff --git a/0110-Indent-menu-entries.patch b/0453-Indent-menu-entries.patch similarity index 82% rename from 0110-Indent-menu-entries.patch rename to 0453-Indent-menu-entries.patch index 2e77880..e37a5f3 100644 --- a/0110-Indent-menu-entries.patch +++ b/0453-Indent-menu-entries.patch @@ -1,14 +1,14 @@ -From e52c695e09447f6fbc51c23f1745d50c6db5c7b8 Mon Sep 17 00:00:00 2001 +From d9479d21d4b97295000fe2268b1e6cadf301f008 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:30:55 -0400 -Subject: [PATCH 110/152] Indent menu entries +Subject: [PATCH 453/506] Indent menu entries --- grub-core/normal/menu_text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index aa3454f..01b6f1c 100644 +index 1062d64..ecc60f9 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -239,7 +239,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -22,5 +22,5 @@ index aa3454f..01b6f1c 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -1.9.3 +2.4.3 diff --git a/0111-Fix-margins.patch b/0454-Fix-margins.patch similarity index 89% rename from 0111-Fix-margins.patch rename to 0454-Fix-margins.patch index d5d40e4..906383d 100644 --- a/0111-Fix-margins.patch +++ b/0454-Fix-margins.patch @@ -1,14 +1,14 @@ -From a623d490ea6a94cc7db68400d3fea5b0c25ccb9c Mon Sep 17 00:00:00 2001 +From 7b246fc51139c94f68152d490e255d930b022a55 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:59:36 -0400 -Subject: [PATCH 111/152] Fix margins +Subject: [PATCH 454/506] Fix margins --- grub-core/normal/menu_text.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 01b6f1c..ead3391 100644 +index ecc60f9..0e43f2c 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -333,17 +333,15 @@ grub_menu_init_page (int nested, int edit, @@ -33,5 +33,5 @@ index 01b6f1c..ead3391 100644 - geo->timeout_lines /* timeout */ - 1 /* empty final line */; -- -1.9.3 +2.4.3 diff --git a/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch b/0455-Add-support-for-UEFI-operating-systems-returned-by-o.patch similarity index 75% rename from 0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch rename to 0455-Add-support-for-UEFI-operating-systems-returned-by-o.patch index 19465af..2942427 100644 --- a/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch +++ b/0455-Add-support-for-UEFI-operating-systems-returned-by-o.patch @@ -1,7 +1,7 @@ -From 5980cac9e0320a3eb65e7fb73487a565d21361da Mon Sep 17 00:00:00 2001 +From 79f17b3b74ee1270959fb40de4ba55bb63534c1b Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 12 Jun 2013 11:51:49 -0400 -Subject: [PATCH 112/152] Add support for UEFI operating systems returned by +Subject: [PATCH 455/506] Add support for UEFI operating systems returned by os-prober os-prober returns UEFI operating systems in the form: @@ -11,20 +11,19 @@ path:long-name:name where path is the path under the EFI directory on the ESP. This is in contrast to legacy OSes, where path is the device string. Handle this case. --- - util/grub.d/30_os-prober.in | 22 ++++++++++++++++++---- - 1 file changed, 18 insertions(+), 4 deletions(-) + util/grub.d/30_os-prober.in | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 6f38c82..9f955ab 100644 +index 5fc4f0c..11586c9 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in -@@ -322,9 +322,23 @@ EOF +@@ -322,8 +322,23 @@ EOF EOF ;; *) -- echo -n " " - # TRANSLATORS: %s is replaced by OS name. -- gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2 +- gettext_printf "%s is not yet supported by grub-mkconfig.\n" " ${LONGNAME}" >&2 - ;; + case ${DEVICE} in + *.efi) @@ -47,5 +46,5 @@ index 6f38c82..9f955ab 100644 esac done -- -1.9.3 +2.4.3 diff --git a/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch b/0456-Disable-GRUB-video-support-for-IBM-power-machines.patch similarity index 94% rename from 0113-Disable-GRUB-video-support-for-IBM-power-machines.patch rename to 0456-Disable-GRUB-video-support-for-IBM-power-machines.patch index de6ff53..97e8857 100644 --- a/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/0456-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -1,7 +1,7 @@ -From 3fd909cbba26f1f76a64aa095937b00cd1785570 Mon Sep 17 00:00:00 2001 +From 49053d07add1a526a633f525933d5d17471a5989 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 11 Jun 2013 15:14:05 -0300 -Subject: [PATCH 113/152] Disable GRUB video support for IBM power machines +Subject: [PATCH 456/506] Disable GRUB video support for IBM power machines Should fix the problem in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=973205 @@ -61,5 +61,5 @@ index 6a21f5d..663935d 100644 extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); -- -1.9.3 +2.4.3 diff --git a/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch b/0457-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch similarity index 81% rename from 0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch rename to 0457-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch index 3dc6736..9939e80 100644 --- a/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +++ b/0457-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch @@ -1,7 +1,7 @@ -From 6550cd89b1dee8c9ad866cbf10bf72dc2ff8a8bc Mon Sep 17 00:00:00 2001 +From 1ec3f0284d7dee52ee1afc6ac72ec39bdf3fba88 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 21 Jun 2013 14:44:08 -0400 -Subject: [PATCH 114/152] Use -2 instead of -1 for our right-hand margin, so +Subject: [PATCH 457/506] Use -2 instead of -1 for our right-hand margin, so linewrapping works (#976643). Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index ead3391..bc1fc71 100644 +index 0e43f2c..537d4bf 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -334,7 +334,7 @@ grub_menu_init_page (int nested, int edit, @@ -23,5 +23,5 @@ index ead3391..bc1fc71 100644 geo->first_entry_y = 3; /* three empty lines*/ -- -1.9.3 +2.4.3 diff --git a/0115-Use-linux16-when-appropriate-880840.patch b/0458-Use-linux16-when-appropriate-880840.patch similarity index 88% rename from 0115-Use-linux16-when-appropriate-880840.patch rename to 0458-Use-linux16-when-appropriate-880840.patch index e4b486c..553dfa1 100644 --- a/0115-Use-linux16-when-appropriate-880840.patch +++ b/0458-Use-linux16-when-appropriate-880840.patch @@ -1,7 +1,7 @@ -From ba749818b7a53df63d887cb17497f82c78ca934c Mon Sep 17 00:00:00 2001 +From 6c42254d5f033b24b859a8a6a82720e99a62887a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:05:07 -0400 -Subject: [PATCH 115/152] Use linux16 when appropriate (#880840) +Subject: [PATCH 458/506] Use linux16 when appropriate (#880840) The kernel group really would prefer that we use the 16 bit entry point on x86 bios machines. @@ -14,7 +14,7 @@ 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 e762e1f..600bfd2 100644 +index 70f3169..013b7f0 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -74,6 +74,11 @@ linux_entry () @@ -48,5 +48,5 @@ index e762e1f..600bfd2 100644 fi fi -- -1.9.3 +2.4.3 diff --git a/0116-Enable-pager-by-default.-985860.patch b/0459-Enable-pager-by-default.-985860.patch similarity index 78% rename from 0116-Enable-pager-by-default.-985860.patch rename to 0459-Enable-pager-by-default.-985860.patch index b66712c..9e6d46a 100644 --- a/0116-Enable-pager-by-default.-985860.patch +++ b/0459-Enable-pager-by-default.-985860.patch @@ -1,7 +1,7 @@ -From 26f2fbd4fb424ad097ea99578864ae526b79f732 Mon Sep 17 00:00:00 2001 +From 20bc510e42d5eb2a041242cf59ebcc31509c995a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:09:27 -0400 -Subject: [PATCH 116/152] Enable pager by default. (#985860) +Subject: [PATCH 459/506] Enable pager by default. (#985860) Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index ce2ec81..fefa7dd 100644 +index 93a9023..858b526 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -43,6 +43,8 @@ if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_ @@ -22,5 +22,5 @@ index ce2ec81..fefa7dd 100644 load_env fi -- -1.9.3 +2.4.3 diff --git a/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch b/0460-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch similarity index 84% rename from 0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch rename to 0460-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch index a4309a0..45d65bc 100644 --- a/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +++ b/0460-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch @@ -1,7 +1,7 @@ -From 3e8fad7dba63db810a9626d472de5270b2d1bb75 Mon Sep 17 00:00:00 2001 +From bc27879780659acd3d2d7ec192339fde52404b73 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:13:27 -0400 -Subject: [PATCH 117/152] F10 doesn't work on serial, so don't tell the user to +Subject: [PATCH 460/506] F10 doesn't work on serial, so don't tell the user to hit it (#987443) Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index bc1fc71..6202c2a 100644 +index 537d4bf..452d55b 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,7 +157,7 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -23,5 +23,5 @@ index bc1fc71..6202c2a 100644 STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); -- -1.9.3 +2.4.3 diff --git a/0118-Don-t-say-GNU-Linux-in-generated-menus.patch b/0461-Don-t-say-GNU-Linux-in-generated-menus.patch similarity index 87% rename from 0118-Don-t-say-GNU-Linux-in-generated-menus.patch rename to 0461-Don-t-say-GNU-Linux-in-generated-menus.patch index 9521673..59f0067 100644 --- a/0118-Don-t-say-GNU-Linux-in-generated-menus.patch +++ b/0461-Don-t-say-GNU-Linux-in-generated-menus.patch @@ -1,7 +1,7 @@ -From 03d405d9b503c435f3a975c5789a0bda9650a753 Mon Sep 17 00:00:00 2001 +From f6d0829f2743a4eefa3419672d24ef2258bb281b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 14 Mar 2011 14:27:42 -0400 -Subject: [PATCH 118/152] Don't say "GNU/Linux" in generated menus. +Subject: [PATCH 461/506] Don't say "GNU/Linux" in generated menus. --- util/grub.d/10_linux.in | 4 ++-- @@ -9,7 +9,7 @@ Subject: [PATCH 118/152] 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 600bfd2..c943a1e 100644 +index 013b7f0..231c74c 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 600bfd2..c943a1e 100644 fi diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index a608435..79d4e38 100644 +index f532fb9..513aca1 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -41,5 +41,5 @@ index a608435..79d4e38 100644 fi -- -1.9.3 +2.4.3 diff --git a/0119-Don-t-draw-a-border-around-the-menu.patch b/0462-Don-t-draw-a-border-around-the-menu.patch similarity index 91% rename from 0119-Don-t-draw-a-border-around-the-menu.patch rename to 0462-Don-t-draw-a-border-around-the-menu.patch index 44df1f5..c29cdd1 100644 --- a/0119-Don-t-draw-a-border-around-the-menu.patch +++ b/0462-Don-t-draw-a-border-around-the-menu.patch @@ -1,7 +1,7 @@ -From 6bf4deb61df3ecb1e2d108195efa5ac980baa961 Mon Sep 17 00:00:00 2001 +From b28ff92a87ac8d67c78b6ebf4d74ff781610d312 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 16:47:33 -0400 -Subject: [PATCH 119/152] Don't draw a border around the menu +Subject: [PATCH 462/506] Don't draw a border around the menu It looks cleaner without it. --- @@ -9,7 +9,7 @@ It looks cleaner without it. 1 file changed, 43 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 6202c2a..beddd7f 100644 +index 452d55b..1ed2bd9 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right, @@ -60,7 +60,7 @@ index 6202c2a..beddd7f 100644 static int print_message (int nested, int edit, struct grub_term_output *term, int dry_run) { -@@ -403,8 +362,6 @@ grub_menu_init_page (int nested, int edit, +@@ -406,8 +365,6 @@ grub_menu_init_page (int nested, int edit, grub_term_normal_color = grub_color_menu_normal; grub_term_highlight_color = grub_color_menu_highlight; @@ -70,5 +70,5 @@ index 6202c2a..beddd7f 100644 grub_term_highlight_color = old_color_highlight; geo->timeout_y = geo->first_entry_y + geo->num_entries -- -1.9.3 +2.4.3 diff --git a/0120-Use-the-standard-margin-for-the-timeout-string.patch b/0463-Use-the-standard-margin-for-the-timeout-string.patch similarity index 80% rename from 0120-Use-the-standard-margin-for-the-timeout-string.patch rename to 0463-Use-the-standard-margin-for-the-timeout-string.patch index 10fb895..6618c84 100644 --- a/0120-Use-the-standard-margin-for-the-timeout-string.patch +++ b/0463-Use-the-standard-margin-for-the-timeout-string.patch @@ -1,7 +1,7 @@ -From a3e6964bd3242bd042489bb510e63fc0224fede4 Mon Sep 17 00:00:00 2001 +From 90dbbcfa9eeec55ba68b77b9bc16c369445ad809 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 10:52:32 -0400 -Subject: [PATCH 120/152] Use the standard margin for the timeout string +Subject: [PATCH 463/506] Use the standard margin for the timeout string So that it aligns with the other messages --- @@ -9,10 +9,10 @@ So that it aligns with the other messages 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index beddd7f..33b208b 100644 +index 1ed2bd9..7681f7d 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c -@@ -369,7 +369,7 @@ grub_menu_init_page (int nested, int edit, +@@ -372,7 +372,7 @@ grub_menu_init_page (int nested, int edit, if (bottom_message) { grub_term_gotoxy (term, @@ -21,7 +21,7 @@ index beddd7f..33b208b 100644 geo->timeout_y }); print_message (nested, edit, term, 0); -@@ -404,14 +404,14 @@ menu_text_print_timeout (int timeout, void *dataptr) +@@ -407,14 +407,14 @@ menu_text_print_timeout (int timeout, void *dataptr) if (data->timeout_msg == TIMEOUT_UNKNOWN) { data->timeout_msg = grub_print_message_indented_real (msg_translated, @@ -39,5 +39,5 @@ index beddd7f..33b208b 100644 } -- -1.9.3 +2.4.3 diff --git a/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch b/0464-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch similarity index 83% rename from 0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch rename to 0464-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch index d6ee4b4..fc3bbfa 100644 --- a/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch +++ b/0464-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch @@ -1,7 +1,7 @@ -From a7a033ed92a55dd44314ed20f720a3d32fa9c684 Mon Sep 17 00:00:00 2001 +From 9dc877744ea47b51b58e7a129e36c6d106302b94 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 10 Jan 2014 09:36:24 -0500 -Subject: [PATCH 121/152] Fix grub_script_execute_sourcecode() usage on ppc. +Subject: [PATCH 464/506] Fix grub_script_execute_sourcecode() usage on ppc. 593e430c made it not take the extra argc/argv that this code still passes it. @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 0da2a52..f66c03c 100644 +index 725e441..d98e868 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -289,7 +289,7 @@ grub_normal_execute (const char *config, int nested, int batch) @@ -25,5 +25,5 @@ index 0da2a52..f66c03c 100644 } grub_free (script); -- -1.9.3 +2.4.3 diff --git a/0465-Add-.eh_frame-to-list-of-relocations-stripped.patch b/0465-Add-.eh_frame-to-list-of-relocations-stripped.patch new file mode 100644 index 0000000..b1367f9 --- /dev/null +++ b/0465-Add-.eh_frame-to-list-of-relocations-stripped.patch @@ -0,0 +1,25 @@ +From 1b067956364d2860bc6adae9e6c782116030a356 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Mon, 13 Jan 2014 21:50:59 -0500 +Subject: [PATCH 465/506] Add .eh_frame to list of relocations stripped + +--- + conf/Makefile.common | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 96e58c9..8aab824 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding + LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) + CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 + CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) +-STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags ++STRIPFLAGS_KERNEL = -R .eh_frame -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags + + CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding + LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d +-- +2.4.3 + diff --git a/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch b/0466-Make-10_linux-work-with-our-changes-for-linux16-and-.patch similarity index 90% rename from 0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch rename to 0466-Make-10_linux-work-with-our-changes-for-linux16-and-.patch index b7907a7..8f2d343 100644 --- a/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +++ b/0466-Make-10_linux-work-with-our-changes-for-linux16-and-.patch @@ -1,7 +1,7 @@ -From 1c9518bb506f8f4fa6b388571c76797705e7b566 Mon Sep 17 00:00:00 2001 +From 7dbfa43dfad616a38a98ff301dcd93a6feef77f8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 13:12:23 -0500 -Subject: [PATCH 123/152] Make 10_linux work with our changes for linux16 and +Subject: [PATCH 466/506] Make 10_linux work with our changes for linux16 and linuxefi on aarch64 Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c943a1e..2b8c561 100644 +index 231c74c..379a577 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -75,8 +75,18 @@ linux_entry () @@ -65,7 +65,7 @@ index c943a1e..2b8c561 100644 sed "s/^/$submenu_indentation/" << EOF } EOF -@@ -211,6 +228,14 @@ while [ "x$list" != "x" ] ; do +@@ -213,6 +230,14 @@ while [ "x$list" != "x" ] ; do fi done @@ -81,5 +81,5 @@ index c943a1e..2b8c561 100644 for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do if test -e "${i}" ; then -- -1.9.3 +2.4.3 diff --git a/0124-Don-t-print-during-fdt-loading-method.patch b/0467-Don-t-print-during-fdt-loading-method.patch similarity index 77% rename from 0124-Don-t-print-during-fdt-loading-method.patch rename to 0467-Don-t-print-during-fdt-loading-method.patch index 4173e34..b2a23ae 100644 --- a/0124-Don-t-print-during-fdt-loading-method.patch +++ b/0467-Don-t-print-during-fdt-loading-method.patch @@ -1,7 +1,7 @@ -From aa8c71086da3a28382b8bd958bac1c5d3b2b2be3 Mon Sep 17 00:00:00 2001 +From 8a0557e9e05f6e6de54536d3ff4da789dbc3854e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 16:15:46 -0500 -Subject: [PATCH 124/152] Don't print during fdt loading method. +Subject: [PATCH 467/506] Don't print during fdt loading method. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ 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 2b8c561..acf2e0e 100644 +index 379a577..794f04b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -162,9 +162,7 @@ EOF @@ -23,5 +23,5 @@ index 2b8c561..acf2e0e 100644 EOF fi -- -1.9.3 +2.4.3 diff --git a/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch b/0468-Honor-a-symlink-when-generating-configuration-by-gru.patch similarity index 75% rename from 0125-Honor-a-symlink-when-generating-configuration-by-gru.patch rename to 0468-Honor-a-symlink-when-generating-configuration-by-gru.patch index 140245b..1c6b072 100644 --- a/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch +++ b/0468-Honor-a-symlink-when-generating-configuration-by-gru.patch @@ -1,7 +1,7 @@ -From 37ad82c4f11e293e30eea26302624691e80f19b8 Mon Sep 17 00:00:00 2001 +From f8368056ed2433473c563104b14d89e547db9b9a Mon Sep 17 00:00:00 2001 From: Marcel Kolaja Date: Tue, 21 Jan 2014 10:57:08 -0500 -Subject: [PATCH 125/152] Honor a symlink when generating configuration by +Subject: [PATCH 468/506] Honor a symlink when generating configuration by grub2-mkconfig Honor a symlink when generating configuration by grub2-mkconfig, so that @@ -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 ca040dd..b00f9e6 100644 +index 3183744..2c17979 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -272,7 +272,8 @@ and /etc/grub.d/* files or please file a bug report with +@@ -275,7 +275,8 @@ and /etc/grub.d/* files or please file a bug report with echo >&2 else # none of the children aborted with error, install the new grub.cfg @@ -25,5 +25,5 @@ index ca040dd..b00f9e6 100644 fi -- -1.9.3 +2.4.3 diff --git a/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch b/0469-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch similarity index 86% rename from 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch rename to 0469-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch index ab67c92..677670a 100644 --- a/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +++ b/0469-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch @@ -1,7 +1,7 @@ -From ee6df3680adbe2bb8165c98ed0e39f6258cd873e Mon Sep 17 00:00:00 2001 +From 77911e9f883dd246f2adf104d00db7201fe0c8dc Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 30 Jun 2014 14:16:46 -0400 -Subject: [PATCH 126/152] Don't munge raw spaces when we're doing our cmdline +Subject: [PATCH 469/506] Don't munge raw spaces when we're doing our cmdline escaping (#923374) Signed-off-by: Peter Jones @@ -32,5 +32,5 @@ index 0a5b2af..970ea86 100644 { *buf++ = *c++; -- -1.9.3 +2.4.3 diff --git a/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch b/0470-Don-t-require-a-password-to-boot-entries-generated-b.patch similarity index 83% rename from 0127-Don-t-require-a-password-to-boot-entries-generated-b.patch rename to 0470-Don-t-require-a-password-to-boot-entries-generated-b.patch index 7fe5ae5..724e13d 100644 --- a/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch +++ b/0470-Don-t-require-a-password-to-boot-entries-generated-b.patch @@ -1,7 +1,7 @@ -From 0ce7596ab544955073318a4ed650d7d0615b933e Mon Sep 17 00:00:00 2001 +From 5a5d16211c91e4d650fab56c5035b7eb346a9e0f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 11 Feb 2014 11:14:50 -0500 -Subject: [PATCH 127/152] Don't require a password to boot entries generated by +Subject: [PATCH 470/506] Don't require a password to boot entries generated by grub-mkconfig. When we set a password, we just want that to mean you can't /edit/ an entry. @@ -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 acf2e0e..136abd7 100644 +index 794f04b..df3f288 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" @@ -27,5 +27,5 @@ index acf2e0e..136abd7 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS="$(sed 's, release .*$,,g' /etc/system-release)" -- -1.9.3 +2.4.3 diff --git a/0128-Don-t-emit-Booting-.-message.patch b/0471-Don-t-emit-Booting-.-message.patch similarity index 86% rename from 0128-Don-t-emit-Booting-.-message.patch rename to 0471-Don-t-emit-Booting-.-message.patch index 42860f4..2ab27e4 100644 --- a/0128-Don-t-emit-Booting-.-message.patch +++ b/0471-Don-t-emit-Booting-.-message.patch @@ -1,7 +1,7 @@ -From 34f60bd4d04b142667c5fc0a4287b118834e71bb Mon Sep 17 00:00:00 2001 +From 30f5402fabe385931871a3277db5ce62f137af72 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 09:37:49 -0500 -Subject: [PATCH 128/152] Don't emit "Booting ..." message. +Subject: [PATCH 471/506] Don't emit "Booting ..." message. UI team still hates this stuff, so we're disabling it for RHEL 7. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index b47991a..cc27c37 100644 +index 719e2fb..89ced26 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -810,9 +810,11 @@ static void @@ -30,7 +30,7 @@ index b47991a..cc27c37 100644 /* Callback invoked when a default menu entry executed because of a timeout diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c -index b485df8..62e5db1 100644 +index 62c7e16..cc41fa1 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -1156,9 +1156,6 @@ run (struct screen *screen) @@ -44,5 +44,5 @@ index b485df8..62e5db1 100644 errs_before = grub_err_printed_errors; -- -1.9.3 +2.4.3 diff --git a/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch b/0472-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch similarity index 98% rename from 0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch rename to 0472-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch index c3bb0b3..086538c 100644 --- a/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch +++ b/0472-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch @@ -1,7 +1,7 @@ -From fe42ce5fc9eec355027a533861dfe7f2eeefc63c Mon Sep 17 00:00:00 2001 +From e5accb37d101774583d94d0c8051e464c45e29c6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Feb 2014 15:21:46 -0500 -Subject: [PATCH 129/152] Make CTRL and ALT keys work as expected on EFI +Subject: [PATCH 472/506] Make CTRL and ALT keys work as expected on EFI systems (version 5). This is version 4. @@ -300,5 +300,5 @@ index e5dd543..1423403 100644 { grub_efi_status_t -- -1.9.3 +2.4.3 diff --git a/0130-May-as-well-try-it.patch b/0473-May-as-well-try-it.patch similarity index 99% rename from 0130-May-as-well-try-it.patch rename to 0473-May-as-well-try-it.patch index 50ec392..a96abae 100644 --- a/0130-May-as-well-try-it.patch +++ b/0473-May-as-well-try-it.patch @@ -1,7 +1,7 @@ -From bd4b1ae40c743174fc0236851855dfaf6094f875 Mon Sep 17 00:00:00 2001 +From 8b463a745e6c58e679f1a9869b55f441f038654b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 4 Mar 2014 11:00:23 -0500 -Subject: [PATCH 130/152] May as well try it. +Subject: [PATCH 473/506] May as well try it. --- conf/Makefile.extra-dist | 1 - @@ -121,10 +121,10 @@ Subject: [PATCH 130/152] May as well try it. create mode 100644 util/grub-sparc64-setup.8 diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index 51f08c1..e914dfd 100644 +index ea6b9df..9e9a20c 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist -@@ -10,7 +10,6 @@ EXTRA_DIST += unicode +@@ -11,7 +11,6 @@ EXTRA_DIST += unicode EXTRA_DIST += util/import_gcry.py EXTRA_DIST += util/import_unicode.py @@ -133,7 +133,7 @@ index 51f08c1..e914dfd 100644 EXTRA_DIST += docs/grub.cfg EXTRA_DIST += docs/osdetect.cfg diff --git a/configure.ac b/configure.ac -index 8888c2f..2632e2d 100644 +index fd8a62e..6275310 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,29 @@ grub_TRANSFORM([grub-set-default]) @@ -497,10 +497,10 @@ index ad25c8a..0000000 -[SEE ALSO] -.BR grub-menulst2cfg (8) diff --git a/gentpl.py b/gentpl.py -index bdcae1a..889cc91 100644 +index 37b1f45..7f03964 100644 --- a/gentpl.py +++ b/gentpl.py -@@ -792,10 +792,7 @@ def manpage(defn, adddeps): +@@ -798,10 +798,7 @@ def manpage(defn, adddeps): output("if COND_MAN_PAGES\n") gvar_add("man_MANS", name + "." + mansection) @@ -574,7 +574,7 @@ index 0000000..56f582b +.BR "info grub" diff --git a/util/grub-editenv.1 b/util/grub-editenv.1 new file mode 100644 -index 0000000..8dad33f +index 0000000..d28ba03 --- /dev/null +++ b/util/grub-editenv.1 @@ -0,0 +1,46 @@ @@ -592,7 +592,7 @@ index 0000000..8dad33f + +.SH OPTIONS +.TP -+\fB--verbose\fR ++\fB--verbose\fR +Print verbose messages. + +.TP @@ -1395,7 +1395,7 @@ index 0000000..d1bbc2e +.BR "info grub" diff --git a/util/grub-mknetdir.1 b/util/grub-mknetdir.1 new file mode 100644 -index 0000000..69c2262 +index 0000000..fa7e8d4 --- /dev/null +++ b/util/grub-mknetdir.1 @@ -0,0 +1,12 @@ @@ -1404,7 +1404,7 @@ index 0000000..69c2262 +\fBgrub-mknetdir\fR \(em Prepare a GRUB netboot directory. + +.SH SYNOPSIS -+\fBgrub-mknetdir\fR ++\fBgrub-mknetdir\fR + +.SH DESCRIPTION +\fBgrub-mknetdir\fR prepares a directory for GRUB to be netbooted from. @@ -1958,5 +1958,5 @@ index 0000000..37ea2dd +.SH SEE ALSO +.BR "info grub" -- -1.9.3 +2.4.3 diff --git a/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch b/0474-use-fw_path-prefix-when-fallback-searching-for-grub-.patch similarity index 89% rename from 0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch rename to 0474-use-fw_path-prefix-when-fallback-searching-for-grub-.patch index 6c72384..8f09fea 100644 --- a/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +++ b/0474-use-fw_path-prefix-when-fallback-searching-for-grub-.patch @@ -1,7 +1,7 @@ -From d60083bf794914c4f26f561adcdd107abe80cd7e Mon Sep 17 00:00:00 2001 +From c346d135db33d9be45a187f991a80c2a940c066d Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 19 Feb 2014 15:58:43 -0500 -Subject: [PATCH 131/152] use fw_path prefix when fallback searching for grub +Subject: [PATCH 474/506] use fw_path prefix when fallback searching for grub config When PXE booting via UEFI firmware, grub was searching for grub.cfg @@ -18,7 +18,7 @@ Signed-off-by: Mark Salter 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f66c03c..5e2ac15 100644 +index d98e868..660238a 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -343,7 +343,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -41,5 +41,5 @@ index f66c03c..5e2ac15 100644 { grub_size_t config_len; -- -1.9.3 +2.4.3 diff --git a/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch b/0475-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch similarity index 94% rename from 0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch rename to 0475-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch index 18b9fd6..aed7c02 100644 --- a/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +++ b/0475-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch @@ -1,7 +1,7 @@ -From 2927c4943326f09bd626744b8a46fc8ee16fea1c Mon Sep 17 00:00:00 2001 +From c0c97aabd80d0bad57f325e8c0c1eed923752422 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 6 Mar 2014 11:51:33 -0500 -Subject: [PATCH 132/152] Try mac/guid/etc before grub.cfg on tftp config +Subject: [PATCH 475/506] Try mac/guid/etc before grub.cfg on tftp config files. Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 5e2ac15..4190985 100644 +index 660238a..3ba1cdb 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -341,53 +341,59 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -111,5 +111,5 @@ index 5e2ac15..4190985 100644 else grub_enter_normal_mode (argv[0]); -- -1.9.3 +2.4.3 diff --git a/0133-trim-arp-packets-with-abnormal-size.patch b/0476-trim-arp-packets-with-abnormal-size.patch similarity index 68% rename from 0133-trim-arp-packets-with-abnormal-size.patch rename to 0476-trim-arp-packets-with-abnormal-size.patch index 90ffcfc..f437900 100644 --- a/0133-trim-arp-packets-with-abnormal-size.patch +++ b/0476-trim-arp-packets-with-abnormal-size.patch @@ -1,7 +1,7 @@ -From cf2e819b7059f199075b099260983e8108eea74a Mon Sep 17 00:00:00 2001 +From ee4302aa644523afd447e21201412ab6da00d4d6 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 5 Feb 2014 09:42:42 -0200 -Subject: [PATCH 133/152] trim arp packets with abnormal size +Subject: [PATCH 476/506] trim arp packets with abnormal size GRUB uses arp request to create the arp response. If the incoming packet is foobared, GRUB needs to trim the arp response packet before sending it. @@ -10,12 +10,12 @@ is foobared, GRUB needs to trim the arp response packet before sending it. 1 file changed, 6 insertions(+) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index d62d0cc..77581f4 100644 +index 4b68c41..f7c59d3 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c -@@ -162,6 +162,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, +@@ -142,6 +142,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 - && grub_be_to_cpu16 (arp_header->op) == ARP_REQUEST) + && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) { + if ((nb->tail - nb->data) > 50) + { @@ -24,8 +24,8 @@ index d62d0cc..77581f4 100644 + nb->tail = nb->data + 50; + } grub_net_link_level_address_t target; - /* We've already checked that pln is either 4 or 16. */ - char tmp[16]; + struct grub_net_buff nb_reply; + struct arppkt *arp_reply; -- -1.9.3 +2.4.3 diff --git a/0134-Fix-convert-function-to-support-NVMe-devices.patch b/0477-Fix-convert-function-to-support-NVMe-devices.patch similarity index 80% rename from 0134-Fix-convert-function-to-support-NVMe-devices.patch rename to 0477-Fix-convert-function-to-support-NVMe-devices.patch index abc2a3f..cf25218 100644 --- a/0134-Fix-convert-function-to-support-NVMe-devices.patch +++ b/0477-Fix-convert-function-to-support-NVMe-devices.patch @@ -1,7 +1,7 @@ -From f451ce261bcdb24d3428daac54e32e06c698e2f7 Mon Sep 17 00:00:00 2001 +From 0696467ff34b3862035a5beae0dad4a6ea9f3525 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 11:34:00 -0500 -Subject: [PATCH 134/152] Fix convert function to support NVMe devices +Subject: [PATCH 477/506] Fix convert function to support NVMe devices This is adapted from the patch at https://bugzilla.redhat.com/show_bug.cgi?id=1019660 , which is against @@ -18,10 +18,10 @@ Signed-off-by: Peter Jones 1 file changed, 19 insertions(+) diff --git a/util/getroot.c b/util/getroot.c -index 3958105..e700610 100644 +index 36f1730..0030d37 100644 --- a/util/getroot.c +++ b/util/getroot.c -@@ -152,6 +152,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) +@@ -153,6 +153,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) { #if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL struct stat st; @@ -29,7 +29,7 @@ index 3958105..e700610 100644 if (stat (os_dev, &st) < 0) { -@@ -164,6 +165,24 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) +@@ -165,6 +166,24 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) *is_part = 0; @@ -55,5 +55,5 @@ index 3958105..e700610 100644 return grub_util_devmapper_part_to_disk (&st, is_part, os_dev); -- -1.9.3 +2.4.3 diff --git a/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch b/0478-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch similarity index 81% rename from 0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch rename to 0478-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch index fcdff0a..9e75a71 100644 --- a/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +++ b/0478-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch @@ -1,7 +1,7 @@ -From da07b568a45d2c87ab2f6e498f0e304c73c5d195 Mon Sep 17 00:00:00 2001 +From 67e66f4a26a0862f0f2d931b08edc234f13cd227 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 12 Mar 2014 10:58:16 -0400 -Subject: [PATCH 135/152] Fix bad test on GRUB_DISABLE_SUBMENU. +Subject: [PATCH 478/506] Fix bad test on GRUB_DISABLE_SUBMENU. The file /etc/grub.d/10_linux does @@ -20,10 +20,10 @@ Resolves: rhbz#1063414 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 136abd7..3f799e9 100644 +index df3f288..137af42 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -255,7 +255,7 @@ while [ "x$list" != "x" ] ; do +@@ -257,7 +257,7 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion=${GRUB_DEVICE} fi @@ -33,5 +33,5 @@ index 136abd7..3f799e9 100644 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -- -1.9.3 +2.4.3 diff --git a/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch b/0479-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch similarity index 75% rename from 0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch rename to 0479-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch index 173b3f2..ec72544 100644 --- a/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +++ b/0479-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch @@ -1,7 +1,7 @@ -From e7ba5525f976930b792c91132eb5ec96c5379797 Mon Sep 17 00:00:00 2001 +From f56fb3d530641525a477888e94bbaa21265a15d0 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 10 Feb 2014 16:13:10 -0500 -Subject: [PATCH 136/152] Switch to use APM Mustang device tree, for hardware +Subject: [PATCH 479/506] Switch to use APM Mustang device tree, for hardware testing. Signed-off-by: David A. Marlin @@ -10,10 +10,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 3f799e9..2639511 100644 +index 137af42..c97226a 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do +@@ -230,8 +230,8 @@ while [ "x$list" != "x" ] ; do fdt= for i in "dtb-${version}" "dtb-${alt_version}"; do @@ -25,5 +25,5 @@ index 3f799e9..2639511 100644 fi done -- -1.9.3 +2.4.3 diff --git a/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch b/0480-Use-the-default-device-tree-from-the-grub-default-fi.patch similarity index 78% rename from 0137-Use-the-default-device-tree-from-the-grub-default-fi.patch rename to 0480-Use-the-default-device-tree-from-the-grub-default-fi.patch index f852e24..b41269a 100644 --- a/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch +++ b/0480-Use-the-default-device-tree-from-the-grub-default-fi.patch @@ -1,7 +1,7 @@ -From 5f1ee8ff7170321250874116eb80cbec83cc70ab Mon Sep 17 00:00:00 2001 +From aae3606b6b924083e215db5207f99ef78eec0ae5 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 12 Feb 2014 14:54:04 -0500 -Subject: [PATCH 137/152] Use the default device tree from the grub default +Subject: [PATCH 480/506] Use the default device tree from the grub default file instead of hardcoding a value. @@ -13,10 +13,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 b00f9e6..beb22de 100644 +index 2c17979..b253a3a 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -224,7 +224,8 @@ export GRUB_DEFAULT \ +@@ -227,7 +227,8 @@ export GRUB_DEFAULT \ GRUB_ENABLE_CRYPTODISK \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ @@ -27,10 +27,10 @@ index b00f9e6..beb22de 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 2639511..6480cd6 100644 +index c97226a..40dbd86 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do +@@ -230,8 +230,8 @@ while [ "x$list" != "x" ] ; do fdt= for i in "dtb-${version}" "dtb-${alt_version}"; do @@ -42,5 +42,5 @@ index 2639511..6480cd6 100644 fi done -- -1.9.3 +2.4.3 diff --git a/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0481-reopen-SNP-protocol-for-exclusive-use-by-grub.patch similarity index 80% rename from 0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch rename to 0481-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 35692aa..158dd1c 100644 --- a/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0481-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,17 +1,17 @@ -From f4bbb76f70ceca4e089e926ee44d8d3fe919f040 Mon Sep 17 00:00:00 2001 +From aa6d3d99ecc56e05a61dec3a5fd5e3f6300e6a02 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Sat, 15 Feb 2014 15:10:22 -0500 -Subject: [PATCH 138/152] reopen SNP protocol for exclusive use by grub +Subject: [PATCH 481/506] reopen SNP protocol for exclusive use by grub --- grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 2b344d6..a6e4c79 100644 +index 5533515..6a1dd1f 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c -@@ -223,6 +223,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -304,6 +304,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, { struct grub_net_card *card; grub_efi_device_path_t *dp; @@ -19,7 +19,7 @@ index 2b344d6..a6e4c79 100644 dp = grub_efi_get_device_path (hnd); if (! dp) -@@ -250,6 +251,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +@@ -357,6 +358,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, &pxe_mode->dhcp_ack, sizeof (pxe_mode->dhcp_ack), 1, device, path); @@ -42,5 +42,5 @@ index 2b344d6..a6e4c79 100644 } } -- -1.9.3 +2.4.3 diff --git a/0139-Reduce-timer-event-frequency-by-10.patch b/0482-Reduce-timer-event-frequency-by-10.patch similarity index 88% rename from 0139-Reduce-timer-event-frequency-by-10.patch rename to 0482-Reduce-timer-event-frequency-by-10.patch index 934ae2a..53b729a 100644 --- a/0139-Reduce-timer-event-frequency-by-10.patch +++ b/0482-Reduce-timer-event-frequency-by-10.patch @@ -1,7 +1,7 @@ -From 3aed1012cb8f559a0241569d6ec6b1be23844b05 Mon Sep 17 00:00:00 2001 +From c89ce9e7afd7b6b2aba2dd83a2c1faf4cf651262 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Thu, 20 Feb 2014 12:54:52 -0500 -Subject: [PATCH 139/152] Reduce timer event frequency by 10 +Subject: [PATCH 482/506] Reduce timer event frequency by 10 Timer event to keep grub msec counter was running at 1000HZ. This was too fast for UEFI timer driver and resulted in a 10x slowdown in grub time @@ -14,7 +14,7 @@ Signed-off-by: Mark Salter 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c -index a6ae034..0c17d83 100644 +index 2572ca8..06df60e 100644 --- a/grub-core/kern/arm/efi/init.c +++ b/grub-core/kern/arm/efi/init.c @@ -38,7 +38,7 @@ static void @@ -36,5 +36,5 @@ index a6ae034..0c17d83 100644 grub_install_get_time_ms (grub_efi_get_time_ms); } -- -1.9.3 +2.4.3 diff --git a/0140-always-return-error-to-UEFI.patch b/0483-always-return-error-to-UEFI.patch similarity index 68% rename from 0140-always-return-error-to-UEFI.patch rename to 0483-always-return-error-to-UEFI.patch index 8789efb..35fbdcb 100644 --- a/0140-always-return-error-to-UEFI.patch +++ b/0483-always-return-error-to-UEFI.patch @@ -1,19 +1,19 @@ -From 36a34ede9dfa34840c59c7b331c1bc8d8ae7442e Mon Sep 17 00:00:00 2001 +From 3d6c115a0511353f9f0a4fc99549d13012b37e6f Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 26 Feb 2014 21:49:12 -0500 -Subject: [PATCH 140/152] always return error to UEFI +Subject: [PATCH 483/506] always return error to UEFI --- grub-core/kern/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index cd839cc..1a8dba5 100644 +index d12701e..c80d85b 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c -@@ -158,7 +158,7 @@ grub_exit (void) +@@ -159,7 +159,7 @@ grub_exit (void) { - grub_efi_fini (); + grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); efi_call_4 (grub_efi_system_table->boot_services->exit, - grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); + grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0); @@ -21,5 +21,5 @@ index cd839cc..1a8dba5 100644 } -- -1.9.3 +2.4.3 diff --git a/0141-Add-powerpc-little-endian-ppc64le-flags.patch b/0484-Add-powerpc-little-endian-ppc64le-flags.patch similarity index 70% rename from 0141-Add-powerpc-little-endian-ppc64le-flags.patch rename to 0484-Add-powerpc-little-endian-ppc64le-flags.patch index 8ea344e..1f65793 100644 --- a/0141-Add-powerpc-little-endian-ppc64le-flags.patch +++ b/0484-Add-powerpc-little-endian-ppc64le-flags.patch @@ -1,7 +1,7 @@ -From 34df700b6984c730beef2ba9174883d835b360c9 Mon Sep 17 00:00:00 2001 +From eaf3b8f6a44f827047eb5a5197fec3daae453005 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 13 Aug 2014 18:59:58 +0000 -Subject: [PATCH 141/152] Add powerpc little-endian (ppc64le) flags +Subject: [PATCH 484/506] Add powerpc little-endian (ppc64le) flags libgcc dependency was removed *just* for this target because the distros that use ppc64el doesn't have 32-bit support on it. @@ -9,15 +9,15 @@ the distros that use ppc64el doesn't have 32-bit support on it. * configure.ac: Add targets for powerpc64el and skip libgcc. * Makefile.am: Likewise. --- - configure.ac | 17 +++++++++++++++-- - grub-core/Makefile.am | 2 ++ - 2 files changed, 17 insertions(+), 2 deletions(-) + configure.ac | 26 ++++++++++++++++++++++++++ + grub-core/Makefile.am | 3 +++ + 2 files changed, 29 insertions(+) diff --git a/configure.ac b/configure.ac -index 2632e2d..53fd7c7 100644 +index 6275310..9306223 100644 --- a/configure.ac +++ b/configure.ac -@@ -142,6 +142,7 @@ if test "x$with_platform" = x; then +@@ -139,6 +139,7 @@ if test "x$with_platform" = x; then x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; powerpc64-*) platform=ieee1275 ;; @@ -25,15 +25,15 @@ index 2632e2d..53fd7c7 100644 sparc64-*) platform=ieee1275 ;; mipsel-*) platform=loongson ;; mips-*) platform=arc ;; -@@ -160,6 +161,7 @@ case "$target_cpu"-"$platform" in - x86_64-xen) ;; +@@ -161,6 +162,7 @@ case "$target_cpu"-"$platform" in + x86_64-none) ;; x86_64-*) target_cpu=i386 ;; powerpc64-ieee1275) target_cpu=powerpc ;; + powerpc64le-ieee1275) target_cpu=powerpc ;; esac # Check if the platform is supported, make final adjustments. -@@ -604,6 +606,13 @@ if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then +@@ -624,6 +626,13 @@ if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then TARGET_CFLAGS="$TARGET_CFLAGS -march=i386" fi @@ -47,28 +47,37 @@ index 2632e2d..53fd7c7 100644 if test "x$target_m32" = x1; then # Force 32-bit mode. TARGET_CFLAGS="$TARGET_CFLAGS -m32" -@@ -1047,7 +1056,8 @@ else +@@ -1154,6 +1163,14 @@ else CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" fi CPPFLAGS="$TARGET_CPPFLAGS" --if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then +if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes \ + || ( test x$target_cpu = xpowerpc && test x$ac_cv_c_bigendian = xno ); then - TARGET_LIBGCC= - else - TARGET_LIBGCC=-lgcc -@@ -1631,7 +1641,9 @@ if test x"$enable_werror" != xno ; then ++TARGET_LIBGCC= ++else ++TARGET_LIBGCC=-lgcc ++fi ++ ++LIBS="$TARGET_LIBGCC" + + grub_ASM_USCORE + if test "x$TARGET_APPLE_LINKER" = x0 && test x"$platform" != xemu; then +@@ -1691,6 +1708,14 @@ if test x"$enable_werror" != xno ; then HOST_CFLAGS="$HOST_CFLAGS -Werror" fi --if test "x$grub_cv_cc_target_clang" = xno; then +# if not clang or power LE, use static libgcc +if test "x$grub_cv_cc_target_clang" = xno \ + || ! ( test x$target_cpu = xpowerpc && test x$ac_cv_c_bigendian = xno ); then - TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc" - else - TARGET_LDFLAGS_STATIC_LIBGCC= -@@ -1694,6 +1706,7 @@ AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = ++ TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc" ++else ++ TARGET_LDFLAGS_STATIC_LIBGCC= ++fi ++ + TARGET_CPP="$TARGET_CC -E" + TARGET_CCAS=$TARGET_CC + +@@ -1752,6 +1777,7 @@ AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275]) AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu]) AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275]) @@ -77,20 +86,19 @@ index 2632e2d..53fd7c7 100644 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel]) AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips]) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 5c087c8..cb7fd9f 100644 +index af0c7f4..8c37782 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am -@@ -84,8 +84,10 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h +@@ -88,6 +88,9 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h - if !COND_clang +if !COND_powerpc_le - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h - endif ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h +endif KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h if COND_i386_pc -- -1.9.3 +2.4.3 diff --git a/0485-Files-reorganization-and-include-some-libgcc-fuction.patch b/0485-Files-reorganization-and-include-some-libgcc-fuction.patch new file mode 100644 index 0000000..31b6949 --- /dev/null +++ b/0485-Files-reorganization-and-include-some-libgcc-fuction.patch @@ -0,0 +1,241 @@ +From 2470ef3c7e4ea175d8b70ff2676d0e715ac50816 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Wed, 13 Aug 2014 19:00:19 +0000 +Subject: [PATCH 485/506] Files reorganization and include some libgcc fuctions + +As we avoid libgcc dependency for powerpc64el, we moved some functions +to other files and add the necessary ones. + +* Makefile.core.def: Include compiler-rt.S. +* misc.c: Add the necessary libgcc functions. +* compiler-rt.S: New file. +* libgcc.h: Move some content from here ... +* compiler.h: ... to here. + +Also-By: Brent Baude +Also-By: Vladimir 'phcoder' Serbinenko +--- + grub-core/kern/misc.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ + include/grub/compiler.h | 61 +++++++++++++++++++++++++++ + include/grub/libgcc.h | 24 +++++++++++ + 3 files changed, 192 insertions(+) + create mode 100644 include/grub/libgcc.h + +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 6b3397f..66f11f8 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -1144,3 +1144,110 @@ grub_real_boot_time (const char *file, + grub_error_pop (); + } + #endif ++ ++#if defined (NO_LIBGCC) ++ ++/* Based on libgcc2.c from gcc suite. */ ++int ++__ucmpdi2 (grub_uint64_t a, grub_uint64_t b) ++{ ++ union component64 ac, bc; ++ ac.full = a; ++ bc.full = b; ++ ++ if (ac.high < bc.high) ++ return 0; ++ else if (ac.high > bc.high) ++ return 2; ++ ++ if (ac.low < bc.low) ++ return 0; ++ else if (ac.low > bc.low) ++ return 2; ++ return 1; ++} ++ ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__lshrdi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ w.high = 0; ++ w.low = (grub_uint32_t) uu.high >> -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; ++ ++ w.high = (grub_uint32_t) uu.high >> b; ++ w.low = ((grub_uint32_t) uu.low >> b) | carries; ++ } ++ ++ return w.full; ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__ashrdi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ /* w.high = 1..1 or 0..0 */ ++ w.high = uu.high >> (32 - 1); ++ w.low = uu.high >> -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; ++ ++ w.high = uu.high >> b; ++ w.low = ((grub_uint32_t) uu.low >> b) | carries; ++ } ++ ++ return w.full; ++} ++ ++/* Based on libgcc2.c from gcc suite. */ ++grub_uint64_t ++__ashldi3 (grub_uint64_t u, int b) ++{ ++ if (b == 0) ++ return u; ++ ++ const union component64 uu = {.full = u}; ++ const int bm = 32 - b; ++ union component64 w; ++ ++ if (bm <= 0) ++ { ++ w.low = 0; ++ w.high = (grub_uint32_t) uu.low << -bm; ++ } ++ else ++ { ++ const grub_uint32_t carries = (grub_uint32_t) uu.low >> bm; ++ ++ w.low = (grub_uint32_t) uu.low << b; ++ w.high = ((grub_uint32_t) uu.high << b) | carries; ++ } ++ ++ return w.full; ++} ++ ++#endif +diff --git a/include/grub/compiler.h b/include/grub/compiler.h +index c9e1d7a..a9a684c 100644 +--- a/include/grub/compiler.h ++++ b/include/grub/compiler.h +@@ -48,4 +48,65 @@ + # define WARN_UNUSED_RESULT + #endif + ++#include "types.h" ++ ++union component64 ++{ ++ grub_uint64_t full; ++ struct ++ { ++#ifdef GRUB_CPU_WORDS_BIGENDIAN ++ grub_uint32_t high; ++ grub_uint32_t low; ++#else ++ grub_uint32_t low; ++ grub_uint32_t high; ++#endif ++ }; ++}; ++ ++#if defined (__powerpc__) ++grub_uint64_t EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); ++grub_uint64_t EXPORT_FUNC (__ashrdi3) (grub_uint64_t u, int b); ++grub_uint64_t EXPORT_FUNC (__ashldi3) (grub_uint64_t u, int b); ++int EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); ++void EXPORT_FUNC (_restgpr_14_x) (void); ++void EXPORT_FUNC (_restgpr_15_x) (void); ++void EXPORT_FUNC (_restgpr_16_x) (void); ++void EXPORT_FUNC (_restgpr_17_x) (void); ++void EXPORT_FUNC (_restgpr_18_x) (void); ++void EXPORT_FUNC (_restgpr_19_x) (void); ++void EXPORT_FUNC (_restgpr_20_x) (void); ++void EXPORT_FUNC (_restgpr_21_x) (void); ++void EXPORT_FUNC (_restgpr_22_x) (void); ++void EXPORT_FUNC (_restgpr_23_x) (void); ++void EXPORT_FUNC (_restgpr_24_x) (void); ++void EXPORT_FUNC (_restgpr_25_x) (void); ++void EXPORT_FUNC (_restgpr_26_x) (void); ++void EXPORT_FUNC (_restgpr_27_x) (void); ++void EXPORT_FUNC (_restgpr_28_x) (void); ++void EXPORT_FUNC (_restgpr_29_x) (void); ++void EXPORT_FUNC (_restgpr_30_x) (void); ++void EXPORT_FUNC (_restgpr_31_x) (void); ++void EXPORT_FUNC (_savegpr_14) (void); ++void EXPORT_FUNC (_savegpr_15) (void); ++void EXPORT_FUNC (_savegpr_16) (void); ++void EXPORT_FUNC (_savegpr_17) (void); ++void EXPORT_FUNC (_savegpr_18) (void); ++void EXPORT_FUNC (_savegpr_19) (void); ++void EXPORT_FUNC (_savegpr_20) (void); ++void EXPORT_FUNC (_savegpr_21) (void); ++void EXPORT_FUNC (_savegpr_22) (void); ++void EXPORT_FUNC (_savegpr_23) (void); ++void EXPORT_FUNC (_savegpr_24) (void); ++void EXPORT_FUNC (_savegpr_25) (void); ++void EXPORT_FUNC (_savegpr_26) (void); ++void EXPORT_FUNC (_savegpr_27) (void); ++void EXPORT_FUNC (_savegpr_28) (void); ++void EXPORT_FUNC (_savegpr_29) (void); ++void EXPORT_FUNC (_savegpr_30) (void); ++void EXPORT_FUNC (_savegpr_31) (void); ++ ++#endif ++ + #endif /* ! GRUB_COMPILER_HEADER */ +diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h +new file mode 100644 +index 0000000..5bdb8fb +--- /dev/null ++++ b/include/grub/libgcc.h +@@ -0,0 +1,24 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2004,2007,2009 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 . ++ */ ++ ++#if defined (__arm__) ++void EXPORT_FUNC (__aeabi_lasr) (void); ++void EXPORT_FUNC (__aeabi_llsl) (void); ++void EXPORT_FUNC (__aeabi_llsr) (void); ++void EXPORT_FUNC (__aeabi_ulcmp) (void); ++#endif +-- +2.4.3 + diff --git a/0143-Suport-for-bi-endianess-in-elf-file.patch b/0486-Suport-for-bi-endianess-in-elf-file.patch similarity index 98% rename from 0143-Suport-for-bi-endianess-in-elf-file.patch rename to 0486-Suport-for-bi-endianess-in-elf-file.patch index 44285f3..85b975e 100644 --- a/0143-Suport-for-bi-endianess-in-elf-file.patch +++ b/0486-Suport-for-bi-endianess-in-elf-file.patch @@ -1,7 +1,7 @@ -From 15a559aa62cba70b714c066b1075bacfa72cb180 Mon Sep 17 00:00:00 2001 +From 86e23df10073c5b704ddd32cad65e033baeb1379 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Fri, 15 Aug 2014 14:39:53 -0300 -Subject: [PATCH 143/152] Suport for bi-endianess in elf file +Subject: [PATCH 486/506] Suport for bi-endianess in elf file * grub-core/kern/elf.c: check and switch endianess with grub_{be,le}_to cpu functions. @@ -198,5 +198,5 @@ index 1d09971..ecf9df6 100644 + return GRUB_ERR_NONE; +} -- -1.9.3 +2.4.3 diff --git a/0144-Add-grub_util_readlink.patch b/0487-Add-grub_util_readlink.patch similarity index 99% rename from 0144-Add-grub_util_readlink.patch rename to 0487-Add-grub_util_readlink.patch index 18f1716..da1a8bb 100644 --- a/0144-Add-grub_util_readlink.patch +++ b/0487-Add-grub_util_readlink.patch @@ -1,7 +1,7 @@ -From a4492dc21cd26878cc5f4a7766275b17b1f0340c Mon Sep 17 00:00:00 2001 +From 8d58af8b99565170b4b4a873f2df96327204a1f2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:01:03 -0400 -Subject: [PATCH 144/152] Add grub_util_readlink() +Subject: [PATCH 487/506] Add grub_util_readlink() Add grub_util_readlink(). This requires pulling in stat and readlink from gnulib, which pulls in stat and related headers, but after that the @@ -2599,7 +2599,7 @@ index 0000000..81abdf4 + +#endif diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c -index d390b25..9127e92 100644 +index 85507af..6f49df4 100644 --- a/grub-core/osdep/windows/hostdisk.c +++ b/grub-core/osdep/windows/hostdisk.c @@ -353,6 +353,12 @@ grub_util_mkdir (const char *dir) @@ -3730,5 +3730,5 @@ index 0000000..9852778 + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) +]) -- -1.9.3 +2.4.3 diff --git a/0145-Make-editenv-chase-symlinks-including-those-across-d.patch b/0488-Make-editenv-chase-symlinks-including-those-across-d.patch similarity index 94% rename from 0145-Make-editenv-chase-symlinks-including-those-across-d.patch rename to 0488-Make-editenv-chase-symlinks-including-those-across-d.patch index 11365e0..fabe9ca 100644 --- a/0145-Make-editenv-chase-symlinks-including-those-across-d.patch +++ b/0488-Make-editenv-chase-symlinks-including-those-across-d.patch @@ -1,7 +1,7 @@ -From 4ebb0b512d9cf934ace9478fde7890cebb33f56d Mon Sep 17 00:00:00 2001 +From 22e0e3e6652136c14550d97302c9569d5e5f2d45 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:38:00 -0400 -Subject: [PATCH 145/152] Make editenv chase symlinks including those across +Subject: [PATCH 488/506] Make editenv chase symlinks including those across devices. This lets us make /boot/grub2/grubenv a symlink to @@ -17,7 +17,7 @@ Reviewed-by: Adam Jackson 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Makefile.util.def b/Makefile.util.def -index 8f40e78..87029a1 100644 +index 5bb7cef..591c5e5 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -228,8 +228,17 @@ program = { @@ -102,5 +102,5 @@ index c6f8d22..d8d1dad 100644 + free (rename_target); } -- -1.9.3 +2.4.3 diff --git a/0146-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/0489-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch similarity index 86% rename from 0146-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch rename to 0489-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch index c4536b2..d7a14f7 100644 --- a/0146-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +++ b/0489-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch @@ -1,7 +1,7 @@ -From 6c49dab7f960e77a7025cf697b3432bbf480ac96 Mon Sep 17 00:00:00 2001 +From 1d1848f16c2bfd40fa5c89bae314b738f43abd95 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 14:23:23 -0400 -Subject: [PATCH 146/152] Generate OS and CLASS in 10_linux from +Subject: [PATCH 489/506] Generate OS and CLASS in 10_linux from /etc/os-release This makes us use pretty names in the titles we generate in @@ -15,7 +15,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 6480cd6..ede7175 100644 +index 40dbd86..a714340 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" @@ -29,5 +29,5 @@ index 6480cd6..ede7175 100644 OS="${GRUB_DISTRIBUTOR}" CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" -- -1.9.3 +2.4.3 diff --git a/0147-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch b/0490-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch similarity index 77% rename from 0147-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch rename to 0490-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch index bbe9af4..0fa82b2 100644 --- a/0147-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch +++ b/0490-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch @@ -1,7 +1,7 @@ -From 9e12a6e3a1cbc5d4747cef1e5f1517337bddf593 Mon Sep 17 00:00:00 2001 +From 64ce819ee219a6aa868cbf9e78f85c2d775657da Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 15:25:22 -0400 -Subject: [PATCH 147/152] Fix GRUB_DISABLE_SUBMENU one more time. +Subject: [PATCH 490/506] Fix GRUB_DISABLE_SUBMENU one more time. Resolves: rhbz#1063414 @@ -11,10 +11,10 @@ Signed-off-by: Peter Jones 1 file changed, 4 insertions(+) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ede7175..e8088a1 100644 +index a714340..358dd67 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -256,6 +256,10 @@ while [ "x$list" != "x" ] ; do +@@ -258,6 +258,10 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion=${GRUB_DEVICE} fi @@ -26,5 +26,5 @@ index ede7175..e8088a1 100644 linux_entry "${OS}" "${version}" simple \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -- -1.9.3 +2.4.3 diff --git a/0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/0491-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch similarity index 67% rename from 0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch rename to 0491-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch index 27301e1..97035ab 100644 --- a/0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +++ b/0491-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch @@ -1,7 +1,7 @@ -From 358aef9d8342b92662d4970fa7ec769293a7e879 Mon Sep 17 00:00:00 2001 +From 079eebad956087e7e1cb3a4dacd9689704f6d210 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 15:52:08 -0400 -Subject: [PATCH 148/152] Minimize the sort ordering for .debug and -rescue- +Subject: [PATCH 491/506] Minimize the sort ordering for .debug and -rescue- kernels. Resolves: rhbz#1065360 @@ -11,13 +11,13 @@ 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 14fadbc..7ac0bbe 100644 +index 60b31ca..c99e19d 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -248,6 +248,14 @@ version_test_gt () *.old:*.old) ;; - *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; - *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; + *.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 ;; + *-rescue-*:*-rescue-*) ;; + *.debug:*.debug) ;; + *-rescue-*:*.debug) return 1 ;; @@ -30,5 +30,5 @@ index 14fadbc..7ac0bbe 100644 version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" return "$?" -- -1.9.3 +2.4.3 diff --git a/0149-Add-GRUB_DISABLE_UUID.patch b/0492-Add-GRUB_DISABLE_UUID.patch similarity index 91% rename from 0149-Add-GRUB_DISABLE_UUID.patch rename to 0492-Add-GRUB_DISABLE_UUID.patch index 44e5537..368d657 100644 --- a/0149-Add-GRUB_DISABLE_UUID.patch +++ b/0492-Add-GRUB_DISABLE_UUID.patch @@ -1,7 +1,7 @@ -From c15606e88f9b6a97985febb331d7ee6d0489ba7e Mon Sep 17 00:00:00 2001 +From 39913783f3e1c3ce09e6cdb4851f538b316e74c9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 16:49:25 -0400 -Subject: [PATCH 149/152] Add GRUB_DISABLE_UUID. +Subject: [PATCH 492/506] Add GRUB_DISABLE_UUID. This will cause "search --fs-uuid --set=root ..." not to be generated by grub2-mkconfig, and instead simply attempt to use the grub device name @@ -17,7 +17,7 @@ Signed-off-by: Peter Jones 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index 46b9e7f..6b112c1 100644 +index b9f41a7..0d34036 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. @@ -35,10 +35,10 @@ index 46b9e7f..6b112c1 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 beb22de..bc26e7c 100644 +index b253a3a..63f7498 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -130,11 +130,11 @@ fi +@@ -133,11 +133,11 @@ fi # Device containing our userland. Typically used for root= parameter. GRUB_DEVICE="`${grub_probe} --target=device /`" @@ -52,7 +52,7 @@ index beb22de..bc26e7c 100644 # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. -@@ -148,6 +148,13 @@ if test -f ${sysconfdir}/default/grub ; then +@@ -151,6 +151,13 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi @@ -66,7 +66,7 @@ index beb22de..bc26e7c 100644 # XXX: should this be deprecated at some point? if [ "x${GRUB_TERMINAL}" != "x" ] ; then GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" -@@ -213,6 +220,7 @@ export GRUB_DEFAULT \ +@@ -216,6 +223,7 @@ export GRUB_DEFAULT \ GRUB_SERIAL_COMMAND \ GRUB_DISABLE_LINUX_UUID \ GRUB_DISABLE_RECOVERY \ @@ -75,7 +75,7 @@ index beb22de..bc26e7c 100644 GRUB_GFXMODE \ GRUB_BACKGROUND \ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 7ac0bbe..5c9ed84 100644 +index c99e19d..38dbcee 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -156,7 +156,7 @@ prepare_grub_to_access_device () @@ -97,5 +97,5 @@ index 7ac0bbe..5c9ed84 100644 else echo $device |sed 's, ,_,g' -- -1.9.3 +2.4.3 diff --git a/0150-Allow-fallback-to-include-entries-by-title-not-just-.patch b/0493-Allow-fallback-to-include-entries-by-title-not-just-.patch similarity index 95% rename from 0150-Allow-fallback-to-include-entries-by-title-not-just-.patch rename to 0493-Allow-fallback-to-include-entries-by-title-not-just-.patch index a32934f..d525e5e 100644 --- a/0150-Allow-fallback-to-include-entries-by-title-not-just-.patch +++ b/0493-Allow-fallback-to-include-entries-by-title-not-just-.patch @@ -1,7 +1,7 @@ -From fed4e69879282065708ac7cce9e048f0bb90d51c Mon Sep 17 00:00:00 2001 +From 9852edf71552cf8072ebaedddcd3eae865fe2fe6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 5 Sep 2014 10:07:04 -0400 -Subject: [PATCH 150/152] Allow "fallback" to include entries by title, not +Subject: [PATCH 493/506] Allow "fallback" to include entries by title, not just number. Resolves: rhbz#1026084 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index cc27c37..a446d9a 100644 +index 89ced26..5b971b3 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -163,12 +163,35 @@ grub_menu_set_timeout (int timeout) @@ -127,5 +127,5 @@ index cc27c37..a446d9a 100644 static int get_entry_number (grub_menu_t menu, const char *name) -- -1.9.3 +2.4.3 diff --git a/0152-Load-arm-with-SB-enabled.patch b/0494-Load-arm-with-SB-enabled.patch similarity index 84% rename from 0152-Load-arm-with-SB-enabled.patch rename to 0494-Load-arm-with-SB-enabled.patch index 33f63a5..c17a855 100644 --- a/0152-Load-arm-with-SB-enabled.patch +++ b/0494-Load-arm-with-SB-enabled.patch @@ -1,7 +1,7 @@ -From 6f45f8ab00907d7786bb9dd23575da41033f62e7 Mon Sep 17 00:00:00 2001 +From 52f32f8cba353fd61b05af6996f969632445125d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 18 Sep 2014 11:26:14 -0400 -Subject: [PATCH 152/152] Load arm with SB enabled. +Subject: [PATCH 494/506] Load arm with SB enabled. Make sure we actually try to validate secure boot on this platform (even though we're not shipping it enabled by default.) @@ -11,20 +11,20 @@ kernel command line, because we can't call systab->bs->LoadImage() if SB is enabled. --- grub-core/Makefile.core.def | 2 + - grub-core/loader/arm64/linux.c | 108 ++++++++++++++++++++------------------ - grub-core/loader/efi/linux.c | 66 +++++++++++++++++++++++ - grub-core/loader/i386/efi/linux.c | 39 ++------------ - include/grub/arm64/linux.h | 8 +++ + grub-core/loader/arm64/linux.c | 113 +++++++++++++++++++++----------------- + grub-core/loader/efi/linux.c | 65 ++++++++++++++++++++++ + grub-core/loader/i386/efi/linux.c | 39 +------------ + include/grub/arm64/linux.h | 13 +++-- include/grub/efi/linux.h | 31 +++++++++++ - 6 files changed, 167 insertions(+), 87 deletions(-) + 6 files changed, 170 insertions(+), 93 deletions(-) create mode 100644 grub-core/loader/efi/linux.c create mode 100644 include/grub/efi/linux.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 9ff9ae5..9378c73 100644 +index 98b6485..38291ce 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1682,6 +1682,7 @@ module = { +@@ -1667,6 +1667,7 @@ module = { ia64_efi = loader/ia64/efi/linux.c; arm = loader/arm/linux.c; arm64 = loader/arm64/linux.c; @@ -32,7 +32,7 @@ index 9ff9ae5..9378c73 100644 fdt = lib/fdt.c; common = loader/linux.c; common = lib/cmdline.c; -@@ -1718,6 +1719,7 @@ module = { +@@ -1703,6 +1704,7 @@ module = { name = linuxefi; efi = loader/i386/efi/linux.c; efi = lib/cmdline.c; @@ -41,7 +41,7 @@ index 9ff9ae5..9378c73 100644 enable = x86_64_efi; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 0dc144e..bdd9c9b 100644 +index 987f5b9..80647d2 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -27,6 +27,7 @@ @@ -52,7 +52,7 @@ index 0dc144e..bdd9c9b 100644 #include #include #include -@@ -44,6 +45,7 @@ static int loaded; +@@ -38,6 +39,7 @@ static int loaded; static void *kernel_addr; static grub_uint64_t kernel_size; @@ -60,17 +60,17 @@ index 0dc144e..bdd9c9b 100644 static char *linux_args; static grub_uint32_t cmdline_size; -@@ -135,7 +137,9 @@ finalize_params (void) - { +@@ -132,7 +134,9 @@ finalize_params_linux (void) grub_efi_boot_services_t *b; + grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; grub_efi_status_t status; + grub_efi_loaded_image_t *loaded_image = NULL; int node, retval; + int len; - get_fdt (); - if (!fdt) -@@ -172,6 +176,23 @@ finalize_params (void) + if (!grub_linux_get_fdt ()) + goto failure; +@@ -168,6 +172,23 @@ finalize_params_linux (void) grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", fdt); @@ -94,7 +94,7 @@ index 0dc144e..bdd9c9b 100644 return GRUB_ERR_NONE; failure: -@@ -181,6 +202,23 @@ failure: +@@ -177,6 +198,23 @@ failure: return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); } @@ -118,7 +118,7 @@ index 0dc144e..bdd9c9b 100644 static grub_err_t grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) -@@ -199,6 +237,10 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), +@@ -195,6 +233,10 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); @@ -129,63 +129,63 @@ index 0dc144e..bdd9c9b 100644 if (loaded_fdt) grub_free (loaded_fdt); loaded_fdt = NULL; -@@ -243,65 +285,20 @@ out: - static grub_err_t - grub_linux_boot (void) +@@ -239,60 +281,20 @@ out: + grub_err_t + grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) { - grub_efi_memory_mapped_device_path_t *mempath; - grub_efi_handle_t image_handle; - grub_efi_boot_services_t *b; - grub_efi_status_t status; - grub_err_t retval; - grub_efi_loaded_image_t *loaded_image; - int len; - - retval = finalize_params(); - if (retval != GRUB_ERR_NONE) - return retval; ++ grub_err_t retval; - mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); - if (!mempath) - return grub_errno; -- ++ retval = finalize_params(); ++ if (retval != GRUB_ERR_NONE) ++ return retval; + - mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE; - mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; - mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); - mempath[0].memory_type = GRUB_EFI_LOADER_DATA; -- mempath[0].start_address = (grub_addr_t) kernel_addr; -- mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size; -- +- mempath[0].start_address = addr; +- mempath[0].end_address = addr + size; ++ grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); + - mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; - mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; - mempath[1].header.length = sizeof (grub_efi_device_path_t); -- ++ retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, ++ kernel_addr); + - b = grub_efi_system_table->boot_services; - status = b->load_image (0, grub_efi_image_handle, - (grub_efi_device_path_t *) mempath, -- kernel_addr, kernel_size, &image_handle); +- (void *) addr, size, &image_handle); - if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); - - grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); - +- grub_dprintf ("linux", "linux command line: '%s'\n", args); +- - /* Convert command line to UCS-2 */ - loaded_image = grub_efi_get_loaded_image (image_handle); - loaded_image->load_options_size = len = -- (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); +- (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); - loaded_image->load_options = - grub_efi_allocate_pages (0, - BYTES_TO_PAGES (loaded_image->load_options_size)); - if (!loaded_image->load_options) - return grub_errno; -+ retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, -+ kernel_addr); - +- - loaded_image->load_options_size = - 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, -- (grub_uint8_t *) linux_args, len, NULL); +- (grub_uint8_t *) args, len, NULL); - -- grub_dprintf("linux", "starting image %p\n", image_handle); +- grub_dprintf ("linux", "starting image %p\n", image_handle); - status = b->start_image (image_handle, 0, NULL); - - /* When successful, not reached */ @@ -200,7 +200,7 @@ index 0dc144e..bdd9c9b 100644 } static grub_err_t -@@ -382,6 +379,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -383,6 +385,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), { grub_file_t file = 0; struct grub_arm64_linux_kernel_header lh; @@ -208,7 +208,7 @@ index 0dc144e..bdd9c9b 100644 grub_dl_ref (my_mod); -@@ -426,6 +424,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -427,6 +430,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); @@ -224,7 +224,7 @@ index 0dc144e..bdd9c9b 100644 cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE); linux_args = grub_malloc (cmdline_size); if (!linux_args) -@@ -464,7 +471,6 @@ fail: +@@ -465,7 +477,6 @@ fail: return grub_errno; } @@ -234,10 +234,10 @@ index 0dc144e..bdd9c9b 100644 GRUB_MOD_INIT (linux) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c new file mode 100644 -index 0000000..8634578 +index 0000000..aea378a --- /dev/null +++ b/grub-core/loader/efi/linux.c -@@ -0,0 +1,66 @@ +@@ -0,0 +1,65 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2014 Free Software Foundation, Inc. @@ -303,7 +303,6 @@ index 0000000..8634578 + + return GRUB_ERR_BUG; +} -+ diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c index b79e632..e5b7785 100644 --- a/grub-core/loader/i386/efi/linux.c @@ -372,7 +371,7 @@ index b79e632..e5b7785 100644 static grub_err_t diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index 864e5dc..2cbd64f 100644 +index 65796d9..aae2962 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -20,6 +20,7 @@ @@ -383,17 +382,23 @@ index 864e5dc..2cbd64f 100644 #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ -@@ -38,4 +39,11 @@ struct grub_arm64_linux_kernel_header +@@ -42,11 +43,11 @@ struct grub_arm64_linux_kernel_header grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ }; +-/* Declare the functions for getting dtb and checking/booting image */ +-void *grub_linux_get_fdt (void); +-grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_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 +{ + grub_uint32_t magic; + struct grub_pe32_coff_header coff; + struct grub_pe64_optional_header opt; +}; -+ + #endif /* ! GRUB_LINUX_CPU_HEADER */ diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h new file mode 100644 @@ -433,5 +438,5 @@ index 0000000..d9ede36 + +#endif /* ! GRUB_EFI_LINUX_HEADER */ -- -1.9.3 +2.4.3 diff --git a/0153-Try-prefix-if-fw_path-doesn-t-work.patch b/0495-Try-prefix-if-fw_path-doesn-t-work.patch similarity index 95% rename from 0153-Try-prefix-if-fw_path-doesn-t-work.patch rename to 0495-Try-prefix-if-fw_path-doesn-t-work.patch index 266fa76..e1bbb9b 100644 --- a/0153-Try-prefix-if-fw_path-doesn-t-work.patch +++ b/0495-Try-prefix-if-fw_path-doesn-t-work.patch @@ -1,7 +1,7 @@ -From b5adb83344dfeb6ff142dc41bd2a82d29029c1c2 Mon Sep 17 00:00:00 2001 +From d2fd442571640c4adb15d9aa726a5da9503b5b8a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 3 Oct 2014 11:08:03 -0400 -Subject: [PATCH 153/154] Try $prefix if $fw_path doesn't work. +Subject: [PATCH 495/506] Try $prefix if $fw_path doesn't work. Related: rhbz#1148652 @@ -57,10 +57,10 @@ index 8191f8c..8ca4bf7 100644 } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 578e057..10bfed3 100644 +index cc68b0d..6c9ba4c 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c -@@ -1817,7 +1817,7 @@ grub_net_search_configfile (char *config) +@@ -1819,7 +1819,7 @@ grub_net_search_configfile (char *config) /* Remove the remaining minus sign at the end. */ config[config_len] = '\0'; @@ -70,7 +70,7 @@ index 578e057..10bfed3 100644 static struct grub_preboot *fini_hnd; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 4190985..aa14499 100644 +index 3ba1cdb..13d9eab 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config) @@ -207,5 +207,5 @@ index 4190985..aa14499 100644 } -- -1.9.3 +2.4.3 diff --git a/0154-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch b/0496-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch similarity index 85% rename from 0154-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch rename to 0496-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch index baaa69f..ee426ac 100644 --- a/0154-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch +++ b/0496-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch @@ -1,7 +1,7 @@ -From 53e38c3eefd1e5f41bf1f3b5bc7bae4e5b667ff1 Mon Sep 17 00:00:00 2001 +From 470b4ecee71a70b35f7908b6a9cef9b55453d449 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 27 Oct 2014 09:22:55 -0400 -Subject: [PATCH 154/154] Try to emit linux16/initrd16 and linuxefi/initrdefi +Subject: [PATCH 496/506] Try to emit linux16/initrd16 and linuxefi/initrdefi in 30-os_prober. Resolves: rhbz#1108296 @@ -12,17 +12,16 @@ Signed-off-by: Peter Jones 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 9f955ab..908a09d 100644 +index 11586c9..8b1e8f6 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in -@@ -135,6 +135,29 @@ for OS in ${OSPROBED} ; do +@@ -135,6 +135,28 @@ for OS in ${OSPROBED} ; do LONGNAME="${LABEL}" fi + sixteenbit="" + linuxefi="linux" + initrdefi="initrd" -+ machine=`uname -m` + case "$machine" in + i?86|x86_64) + sixteenbit="16" @@ -45,7 +44,7 @@ index 9f955ab..908a09d 100644 gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 case ${BOOT} in -@@ -235,11 +258,11 @@ EOF +@@ -235,11 +257,11 @@ EOF save_default_entry | grub_add_tab printf '%s\n' "${prepare_boot_cache}" cat << EOF @@ -59,7 +58,7 @@ index 9f955ab..908a09d 100644 EOF fi cat << EOF -@@ -255,11 +278,11 @@ EOF +@@ -255,11 +277,11 @@ EOF save_default_entry | sed -e "s/^/$grub_tab$grub_tab/" printf '%s\n' "${prepare_boot_cache}" | grub_add_tab cat << EOF @@ -74,5 +73,5 @@ index 9f955ab..908a09d 100644 fi cat << EOF -- -1.9.3 +2.4.3 diff --git a/0001-Update-to-minilzo-2.08.patch b/0497-Update-to-minilzo-2.08.patch similarity index 99% rename from 0001-Update-to-minilzo-2.08.patch rename to 0497-Update-to-minilzo-2.08.patch index 9f58e4d..ad94927 100644 --- a/0001-Update-to-minilzo-2.08.patch +++ b/0497-Update-to-minilzo-2.08.patch @@ -1,7 +1,7 @@ -From eb05e317d1584a7c3607fbb066a48acaaed30dc2 Mon Sep 17 00:00:00 2001 +From 2d2bd88d2efd68e086dfa75ddc28c0f5f346996a 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 +Subject: [PATCH 497/506] Update to minilzo-2.08 This fixes CVE-2014-4607 - lzo: lzo1x_decompress_safe() integer overflow @@ -8786,5 +8786,5 @@ index 74fefa9..7937454 100644 -- -2.1.0 +2.4.3 diff --git a/0001-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0498-Make-grub2-mkconfig-construct-titles-that-look-like-.patch similarity index 90% rename from 0001-Make-grub2-mkconfig-construct-titles-that-look-like-.patch rename to 0498-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index 0993557..3d0ac16 100644 --- a/0001-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0498-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,8 +1,8 @@ -From 2c5fbe5cd72dc8225d49d75b714962787cc273f4 Mon Sep 17 00:00:00 2001 +From ec6fb2f84c14090f517cbe57b6a8eeabbb76d684 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH 1/2] Make grub2-mkconfig construct titles that look like the - ones we want elsewhere. +Subject: [PATCH 498/506] Make grub2-mkconfig construct titles that look like + the ones we want elsewhere. Resolves: rhbz#1215839 @@ -12,7 +12,7 @@ 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 e8088a1..ed4c1b7 100644 +index 358dd67..1f5899f 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -66,6 +66,15 @@ case x"$GRUB_FS" in @@ -50,5 +50,5 @@ index e8088a1..ed4c1b7 100644 echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else -- -2.3.6 +2.4.3 diff --git a/0002-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch b/0499-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch similarity index 69% rename from 0002-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch rename to 0499-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch index 91e2a60..cf5ad00 100644 --- a/0002-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch +++ b/0499-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch @@ -1,7 +1,7 @@ -From 97b30ff21f97a98dbb7de3fd676fb360b6e28040 Mon Sep 17 00:00:00 2001 +From 6114642c13b10fdb39145377ff74310f2f27158d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:17:02 -0400 -Subject: [PATCH 2/2] Make rescue and debug entries sort right /again/ in +Subject: [PATCH 499/506] Make rescue and debug entries sort right /again/ in grub2-mkconfig. Related: rhbz#12145839 @@ -12,13 +12,13 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index e85b60c..2e03651 100644 +index 38dbcee..10fabee 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in -@@ -254,14 +254,14 @@ version_test_gt () +@@ -248,14 +248,14 @@ version_test_gt () *.old:*.old) ;; - *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; - *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; + *.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 ;; - *-rescue-*:*-rescue-*) ;; - *.debug:*.debug) ;; - *-rescue-*:*.debug) return 1 ;; @@ -39,5 +39,5 @@ index e85b60c..2e03651 100644 version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" return "$?" -- -2.3.6 +2.4.3 diff --git a/0001-Make-.gitignore-suck-way-less.patch b/0500-Make-.gitignore-suck-way-less.patch similarity index 95% rename from 0001-Make-.gitignore-suck-way-less.patch rename to 0500-Make-.gitignore-suck-way-less.patch index bf3aac7..b951052 100644 --- a/0001-Make-.gitignore-suck-way-less.patch +++ b/0500-Make-.gitignore-suck-way-less.patch @@ -1,12 +1,12 @@ -From a41ad147febd85ec9a08c43f3e3db6845fb2cc2e Mon Sep 17 00:00:00 2001 +From 048b160002e097cf739739c2f9e88c7e684bc2bd Mon Sep 17 00:00:00 2001 From: Peter Jones -Date: Wed, 22 Jul 2015 09:14:32 -0400 -Subject: [PATCH] Make .gitignore suck way less +Date: Tue, 7 Jul 2015 10:13:14 -0400 +Subject: [PATCH 500/506] Make .gitignore suck way less -We lost a man page because of this bzrignore<->gitignore junk, so solve -that slightly better. +We lost a man page because of incompatibilities between bzr's ignore +system and .gitignore, so solve that slightly better. -Signed-off-by: Peter Jones +Signed-off-by: Peter Jones --- .gitignore | 265 ++++++++++++++++++++++++++++--------------------------------- 1 file changed, 120 insertions(+), 145 deletions(-) diff --git a/0501-Update-info-with-grub.cfg-netboot-selection-order-11.patch b/0501-Update-info-with-grub.cfg-netboot-selection-order-11.patch new file mode 100644 index 0000000..b9b1883 --- /dev/null +++ b/0501-Update-info-with-grub.cfg-netboot-selection-order-11.patch @@ -0,0 +1,70 @@ +From 9800d08533c09f76c226ebbbcfc1c35718c390f4 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 16 Mar 2015 16:34:51 -0400 +Subject: [PATCH 501/506] 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. + +Resolves rhbz#1148650 +--- + docs/grub.texi | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 0d34036..367b8f7 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 + Then follow instructions printed out by grub-mknetdir on configuring your DHCP + server. + ++The grub.cfg file is placed in the same directory as the path output by ++grub-mknetdir hereafter referred to as FWPATH. GRUB will search for its ++configuration files in order using the following rules where the appended ++value corresponds to a value on the client machine. ++ ++@example ++@group ++@samp{(FWPATH)}/grub.cfg-@samp{(UUID OF NIC)} ++@samp{(FWPATH)}/grub.cfg-@samp{(MAC ADDRESS OF NIC)} ++@samp{(FWPATH)}/grub.cfg-@samp{(IPv4 OR IPv6 ADDRESS)} ++@samp{(FWPATH)}/grub.cfg ++@end group ++@end example ++ ++The client will only attempt to look up an IPv6 address config once, however, ++it will try the IPv4 multiple times. The concrete example below shows what ++would happen under the IPv4 case. ++ ++@example ++@group ++UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a ++MAC: 52:54:00:ec:33:81 ++IPV4: 10.0.0.130 (0A000082) ++@end group ++@end example ++ ++@example ++@group ++@samp{(FWPATH)}/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a ++@samp{(FWPATH)}/grub.cfg-52-54-00-ec-33-81 ++@samp{(FWPATH)}/grub.cfg-0A000082 ++@samp{(FWPATH)}/grub.cfg-0A00008 ++@samp{(FWPATH)}/grub.cfg-0A0000 ++@samp{(FWPATH)}/grub.cfg-0A000 ++@samp{(FWPATH)}/grub.cfg-0A00 ++@samp{(FWPATH)}/grub.cfg-0A0 ++@samp{(FWPATH)}/grub.cfg-0A ++@samp{(FWPATH)}/grub.cfg-0 ++@samp{(FWPATH)}/grub.cfg ++@end group ++@end example ++ + After GRUB has started, files on the TFTP server will be accessible via the + @samp{(tftp)} device. + +-- +2.4.3 + diff --git a/0502-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/0502-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch new file mode 100644 index 0000000..22f4173 --- /dev/null +++ b/0502-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch @@ -0,0 +1,450 @@ +From 092d28444fac3b4629a84daed5003fcbbb24c9c7 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 16 Mar 2015 14:14:19 -0400 +Subject: [PATCH 502/506] Use Distribution Package Sort for grub2-mkconfig + (#1124074) + +Users reported that newly installed kernels on their systems installed +with grub-mkconfig would not appear on the grub boot list in order +starting with the most recent. Added an option for rpm-based systems to +use the rpm-sort library to sort kernels instead. + +Resolves rhbz#1124074 +--- + .gitignore | 1 + + Makefile.util.def | 16 +++ + configure.ac | 29 +++++ + util/grub-mkconfig_lib.in | 8 +- + util/grub-rpm-sort.8 | 12 ++ + util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 346 insertions(+), 1 deletion(-) + create mode 100644 util/grub-rpm-sort.8 + create mode 100644 util/grub-rpm-sort.c + +diff --git a/.gitignore b/.gitignore +index 06c9f3a..7697877 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -124,6 +124,7 @@ grub-ofpathname + grub-probe + grub-reboot + grub-render-label ++grub-rpm-sort + grub-script-check + grub-set-default + grub-shell +diff --git a/Makefile.util.def b/Makefile.util.def +index 591c5e5..f28d73d 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -674,6 +674,22 @@ program = { + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; + ++program = { ++ name = grub-rpm-sort; ++ mansection = 8; ++ installdir = sbin; ++ ++ common = grub-core/kern/emu/misc.c; ++ common = grub-core/kern/emu/argp_common.c; ++ common = grub-core/osdep/init.c; ++ common = util/misc.c; ++ common = util/grub-rpm-sort.c; ++ ++ ldadd = grub-core/gnulib/libgnu.a; ++ ldadd = libgrubkern.a; ++ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; ++}; ++ + script = { + name = grub-mkconfig; + common = util/grub-mkconfig.in; +diff --git a/configure.ac b/configure.ac +index 9306223..e86a40d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) + grub_TRANSFORM([grub-mkrescue]) + grub_TRANSFORM([grub-probe]) + grub_TRANSFORM([grub-reboot]) ++grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) + grub_TRANSFORM([grub-sparc64-setup]) +@@ -88,6 +89,7 @@ grub_TRANSFORM([grub-mkrescue.1]) + grub_TRANSFORM([grub-mkstandalone.3]) + grub_TRANSFORM([grub-ofpathname.3]) + grub_TRANSFORM([grub-probe.3]) ++grub_TRANSFORM([grub-rpm-sort.8]) + grub_TRANSFORM([grub-reboot.3]) + grub_TRANSFORM([grub-render-label.3]) + grub_TRANSFORM([grub-script-check.3]) +@@ -1610,6 +1612,33 @@ fi + + AC_SUBST([LIBDEVMAPPER]) + ++AC_ARG_ENABLE([rpm-sort], ++ [AS_HELP_STRING([--enable-rpm-sort], ++ [enable native rpm sorting of kernels in grub (default=guessed)])]) ++if test x"$enable_rpm-sort" = xno ; then ++ rpm_sort_excuse="explicitly disabled" ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ # Check for rpmlib header. ++ AC_CHECK_HEADER([rpm/rpmlib.h], [], ++ [rpm_sort_excuse="need rpm/rpmlib header"]) ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ # Check for rpm library. ++ AC_CHECK_LIB([rpm], [rpmvercmp], [], ++ [rpm_sort_excuse="rpmlib missing rpmvercmp"]) ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ LIBRPM="-lrpm"; ++ AC_DEFINE([HAVE_RPM], [1], ++ [Define to 1 if you have the rpm library.]) ++fi ++ ++AC_SUBST([LIBRPM]) ++ + LIBGEOM= + if test x$host_kernel = xkfreebsd; then + AC_CHECK_LIB([geom], [geom_gettree], [], +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 10fabee..954844d 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -213,6 +213,12 @@ version_sort () + esac + } + ++if [ "x$RPMLIB" = x ]; then ++ kernel_sort=version_sort ++else ++ kernel_sort="${sbindir}/grub-rpm-sort" ++fi ++ + version_test_numeric () + { + version_test_numeric_a="$1" +@@ -229,7 +235,7 @@ version_test_numeric () + version_test_numeric_a="$version_test_numeric_b" + version_test_numeric_b="$version_test_numeric_c" + fi +- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then ++ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then + return 0 + else + return 1 +diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 +new file mode 100644 +index 0000000..8ce2148 +--- /dev/null ++++ b/util/grub-rpm-sort.8 +@@ -0,0 +1,12 @@ ++.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" ++.SH NAME ++\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. ++ ++.SH SYNOPSIS ++\fBgrub-rpm-sort\fR [OPTIONS]. ++ ++.SH DESCRIPTION ++You should not normally run this program directly. Use grub-mkconfig instead. ++ ++.SH SEE ALSO ++.BR "info grub" +diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c +new file mode 100644 +index 0000000..f33bd1e +--- /dev/null ++++ b/util/grub-rpm-sort.c +@@ -0,0 +1,281 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static size_t ++read_file (const char *input, char **ret) ++{ ++ FILE *in; ++ size_t s; ++ size_t sz = 2048; ++ size_t offset = 0; ++ char *text; ++ ++ if (!strcmp(input, "-")) ++ in = stdin; ++ else ++ in = grub_util_fopen(input, "r"); ++ ++ text = xmalloc (sz); ++ ++ if (!in) ++ grub_util_error (_("cannot open `%s': %s"), input, strerror (errno)); ++ ++ while ((s = fread (text + offset, 1, sz - offset, in)) != 0) ++ { ++ offset += s; ++ if (sz - offset == 0) ++ { ++ sz += 2048; ++ text = xrealloc (text, sz); ++ } ++ } ++ ++ text[offset] = '\0'; ++ *ret = text; ++ ++ if (in != stdin) ++ fclose(in); ++ ++ return offset + 1; ++} ++ ++/* returns name/version/release */ ++/* NULL string pointer returned if nothing found */ ++static void ++split_package_string (char *package_string, char **name, ++ char **version, char **release) ++{ ++ char *package_version, *package_release; ++ ++ /* Release */ ++ package_release = strrchr (package_string, '-'); ++ ++ if (package_release != NULL) ++ *package_release++ = '\0'; ++ ++ *release = package_release; ++ ++ /* Version */ ++ package_version = strrchr(package_string, '-'); ++ ++ if (package_version != NULL) ++ *package_version++ = '\0'; ++ ++ *version = package_version; ++ /* Name */ ++ *name = package_string; ++ ++ /* Bubble up non-null values from release to name */ ++ if (*name == NULL) ++ { ++ *name = (*version == NULL ? *release : *version); ++ *version = *release; ++ *release = NULL; ++ } ++ if (*version == NULL) ++ { ++ *version = *release; ++ *release = NULL; ++ } ++} ++ ++/* ++ * package name-version-release comparator for qsort ++ * expects p, q which are pointers to character strings (char *) ++ * which will not be altered in this function ++ */ ++static int ++package_version_compare (const void *p, const void *q) ++{ ++ char *local_p, *local_q; ++ char *lhs_name, *lhs_version, *lhs_release; ++ char *rhs_name, *rhs_version, *rhs_release; ++ int vercmpflag = 0; ++ ++ local_p = alloca (strlen (*(char * const *)p) + 1); ++ local_q = alloca (strlen (*(char * const *)q) + 1); ++ ++ /* make sure these allocated */ ++ assert (local_p); ++ assert (local_q); ++ ++ strcpy (local_p, *(char * const *)p); ++ strcpy (local_q, *(char * const *)q); ++ ++ split_package_string (local_p, &lhs_name, &lhs_version, &lhs_release); ++ split_package_string (local_q, &rhs_name, &rhs_version, &rhs_release); ++ ++ /* Check Name and return if unequal */ ++ vercmpflag = rpmvercmp ((lhs_name == NULL ? "" : lhs_name), ++ (rhs_name == NULL ? "" : rhs_name)); ++ if (vercmpflag != 0) ++ return vercmpflag; ++ ++ /* Check version and return if unequal */ ++ vercmpflag = rpmvercmp ((lhs_version == NULL ? "" : lhs_version), ++ (rhs_version == NULL ? "" : rhs_version)); ++ if (vercmpflag != 0) ++ return vercmpflag; ++ ++ /* Check release and return the version compare value */ ++ vercmpflag = rpmvercmp ((lhs_release == NULL ? "" : lhs_release), ++ (rhs_release == NULL ? "" : rhs_release)); ++ ++ return vercmpflag; ++} ++ ++static void ++add_input (const char *filename, char ***package_names, size_t *n_package_names) ++{ ++ char *orig_input_buffer = NULL; ++ char *input_buffer; ++ char *position_of_newline; ++ char **names = *package_names; ++ char **new_names = NULL; ++ size_t n_names = *n_package_names; ++ ++ if (!*package_names) ++ new_names = names = xmalloc (sizeof (char *) * 2); ++ ++ if (read_file (filename, &orig_input_buffer) < 2) ++ { ++ if (new_names) ++ free (new_names); ++ if (orig_input_buffer) ++ free (orig_input_buffer); ++ return; ++ } ++ ++ input_buffer = orig_input_buffer; ++ while (input_buffer && *input_buffer && ++ (position_of_newline = strchrnul (input_buffer, '\n'))) ++ { ++ size_t sz = position_of_newline - input_buffer; ++ char *new; ++ ++ if (sz == 0) ++ { ++ input_buffer = position_of_newline + 1; ++ continue; ++ } ++ ++ new = xmalloc (sz+1); ++ strncpy (new, input_buffer, sz); ++ new[sz] = '\0'; ++ ++ names = xrealloc (names, sizeof (char *) * (n_names + 1)); ++ names[n_names] = new; ++ n_names++; ++ ++ /* move buffer ahead to next line */ ++ input_buffer = position_of_newline + 1; ++ if (*position_of_newline == '\0') ++ input_buffer = NULL; ++ } ++ ++ free (orig_input_buffer); ++ ++ *package_names = names; ++ *n_package_names = n_names; ++} ++ ++static char * ++help_filter (int key, const char *text, void *input __attribute__ ((unused))) ++{ ++ return (char *)text; ++} ++ ++static struct argp_option options[] = { ++ { 0, } ++}; ++ ++struct arguments ++{ ++ size_t ninputs; ++ size_t input_max; ++ char **inputs; ++}; ++ ++static error_t ++argp_parser (int key, char *arg, struct argp_state *state) ++{ ++ struct arguments *arguments = state->input; ++ switch (key) ++ { ++ case ARGP_KEY_ARG: ++ assert (arguments->ninputs < arguments->input_max); ++ arguments->inputs[arguments->ninputs++] = xstrdup (arg); ++ break; ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++static struct argp argp = { ++ options, argp_parser, N_("[INPUT_FILES]"), ++ N_("Sort a list of strings in RPM version sort order."), ++ NULL, help_filter, NULL ++}; ++ ++int ++main (int argc, char *argv[]) ++{ ++ struct arguments arguments; ++ char **package_names = NULL; ++ size_t n_package_names = 0; ++ int i; ++ ++ grub_util_host_init (&argc, &argv); ++ ++ memset (&arguments, 0, sizeof (struct arguments)); ++ arguments.input_max = argc+1; ++ arguments.inputs = xmalloc ((arguments.input_max + 1) ++ * sizeof (arguments.inputs[0])); ++ memset (arguments.inputs, 0, (arguments.input_max + 1) ++ * sizeof (arguments.inputs[0])); ++ ++ /* Parse our arguments */ ++ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) ++ grub_util_error ("%s", _("Error in parsing command line arguments\n")); ++ ++ /* If there's no inputs in argv, add one for stdin */ ++ if (!arguments.ninputs) ++ { ++ arguments.ninputs = 1; ++ arguments.inputs[0] = xmalloc (2); ++ strcpy(arguments.inputs[0], "-"); ++ } ++ ++ for (i = 0; i < arguments.ninputs; i++) ++ add_input(arguments.inputs[i], &package_names, &n_package_names); ++ ++ if (package_names == NULL || n_package_names < 1) ++ grub_util_error ("%s", _("Invalid input\n")); ++ ++ qsort (package_names, n_package_names, sizeof (char *), ++ package_version_compare); ++ ++ /* send sorted list to stdout */ ++ for (i = 0; i < n_package_names; i++) ++ { ++ fprintf (stdout, "%s\n", package_names[i]); ++ free (package_names[i]); ++ } ++ ++ free (package_names); ++ for (i = 0; i < arguments.ninputs; i++) ++ free (arguments.inputs[i]); ++ ++ free (arguments.inputs); ++ ++ return 0; ++} +-- +2.4.3 + diff --git a/0503-Add-friendly-grub2-password-config-tool-985962.patch b/0503-Add-friendly-grub2-password-config-tool-985962.patch new file mode 100644 index 0000000..dbedfa3 --- /dev/null +++ b/0503-Add-friendly-grub2-password-config-tool-985962.patch @@ -0,0 +1,274 @@ +From 130e377aa87178f1a5555f6ac039fc0530b7cdb3 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Thu, 25 Jun 2015 11:13:11 -0400 +Subject: [PATCH 503/506] Add friendly grub2 password config tool (#985962) + +Provided a tool for users to reset the grub2 root user password +without having to alter the grub.cfg. The hashed password now +lives in a root-only-readable configuration file. + +Resolves: rhbz#985962 +--- + .gitignore | 1 + + Makefile.util.def | 13 +++++ + configure.ac | 1 + + util/grub-mkconfig.in | 2 + + util/grub-setpassword.8 | 28 +++++++++++ + util/grub-setpassword.in | 123 +++++++++++++++++++++++++++++++++++++++++++++++ + util/grub.d/01_users.in | 11 +++++ + 7 files changed, 179 insertions(+) + create mode 100644 util/grub-setpassword.8 + create mode 100644 util/grub-setpassword.in + create mode 100644 util/grub.d/01_users.in + +diff --git a/.gitignore b/.gitignore +index 7697877..53a391e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -127,6 +127,7 @@ grub-render-label + grub-rpm-sort + grub-script-check + grub-set-default ++grub-setpassword + grub-shell + grub-shell-tester + grub-sparc64-setup +diff --git a/Makefile.util.def b/Makefile.util.def +index f28d73d..bc13d4a 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -438,6 +438,12 @@ script = { + }; + + script = { ++ name = '01_users'; ++ common = util/grub.d/01_users.in; ++ installdir = grubconf; ++}; ++ ++script = { + name = '10_windows'; + common = util/grub.d/10_windows.in; + installdir = grubconf; +@@ -712,6 +718,13 @@ script = { + }; + + script = { ++ name = grub-setpassword; ++ common = util/grub-setpassword.in; ++ mansection = 8; ++ installdir = sbin; ++}; ++ ++script = { + name = grub-mkconfig_lib; + common = util/grub-mkconfig_lib.in; + installdir = noinst; +diff --git a/configure.ac b/configure.ac +index e86a40d..991cb15 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) + grub_TRANSFORM([grub-mkrescue]) + grub_TRANSFORM([grub-probe]) + grub_TRANSFORM([grub-reboot]) ++grub_TRANSFORM([grub-setpassword]) + grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 63f7498..55ed21e 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -263,6 +263,8 @@ for i in "${grub_mkconfig_dir}"/* ; do + *~) ;; + # emacsen autosave files. FIXME: support other editors + */\#*\#) ;; ++ # rpm config files of yore. ++ *.rpmsave|*.rpmnew|*.rpmorig) ;; + *) + if grub_file_is_not_garbage "$i" && test -x "$i" ; then + echo +diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 +new file mode 100644 +index 0000000..5973abe +--- /dev/null ++++ b/util/grub-setpassword.8 +@@ -0,0 +1,28 @@ ++.TH GRUB-SETPASSWORD 3 "Thu Jun 25 2015" ++.SH NAME ++\fBgrub-setpassword\fR \(em Generate the user.cfg file containing the hashed grub bootloader password. ++ ++.SH SYNOPSIS ++\fBgrub-setpassword\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. ++ ++The file has the format: ++GRUB_2PASSWORD=<\fIhashed password\fR>. ++ ++.SH OPTIONS ++.TP ++-h, --help ++Display program usage and exit. ++.TP ++-v, --version ++Display the current version. ++.TP ++-o, --output[=\fIDIRECTORY PATH\fR] ++Choose the file path to which user.cfg will be written. ++ ++.SH SEE ALSO ++.BR "info grub" ++ ++.BR "info grub2-mkpasswd-pbkdf2" +diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in +new file mode 100644 +index 0000000..dd76f00 +--- /dev/null ++++ b/util/grub-setpassword.in +@@ -0,0 +1,123 @@ ++#!/bin/sh -e ++ ++if [ -d /sys/firmware/efi/efivars/ ]; then ++ grubdir=`echo "/@bootdirname@/efi/EFI/redhat/" | sed 's,//*,/,g'` ++else ++ grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` ++fi ++ ++PACKAGE_VERSION="@PACKAGE_VERSION@" ++PACKAGE_NAME="@PACKAGE_NAME@" ++self=`basename $0` ++bindir="@bindir@" ++grub_mkpasswd="${bindir}/@grub_mkpasswd_pbkdf2@" ++ ++# Usage: usage ++# Print the usage. ++usage () { ++ cat <&2 ++ exit 1 ++ fi ++ echo $1 ++} ++ ++# Ensure that it's the root user running this script ++if [ "${EUID}" -ne 0 ]; then ++ echo "The grub bootloader password may only be set by root." ++ usage ++ exit 2 ++fi ++ ++# Check the arguments. ++while test $# -gt 0 ++do ++ option=$1 ++ shift ++ ++ case "$option" in ++ -h | --help) ++ usage ++ exit 0 ;; ++ -v | --version) ++ echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" ++ exit 0 ;; ++ -o | --output) ++ OUTPUT_PATH=`argument $option "$@"`; shift ;; ++ --output=*) ++ OUTPUT_PATH=`echo "$option" | sed 's/--output=//'` ;; ++ -o=*) ++ OUTPUT_PATH=`echo "$option" | sed 's/-o=//'` ;; ++ esac ++done ++ ++# set user input or default path for user.cfg file ++if [ -z "${OUTPUT_PATH}" ]; then ++ OUTPUT_PATH="${grubdir}" ++fi ++ ++if [ ! -d "${OUTPUT_PATH}" ]; then ++ echo "${OUTPUT_PATH} does not exist." ++ usage ++ exit 2; ++fi ++ ++ttyopt=$(stty -g) ++fixtty() { ++ stty ${ttyopt} ++} ++ ++trap fixtty EXIT ++stty -echo ++ ++# prompt & confirm new grub2 root user password ++echo -n "Enter password: " ++read PASSWORD ++echo ++echo -n "Confirm password: " ++read PASSWORD_CONFIRM ++echo ++stty ${ttyopt} ++ ++getpass() { ++ local P0 ++ local P1 ++ P0="$1" && shift ++ P1="$1" && shift ++ ++ ( echo ${P0} ; echo ${P1} ) | \ ++ ${grub_mkpasswd} | \ ++ grep -v '[eE]nter password:' | \ ++ sed -e "s/PBKDF2 hash of your password is //" ++} ++ ++MYPASS="$(getpass "${PASSWORD}" "${PASSWORD_CONFIRM}")" ++if [ -z "${MYPASS}" ]; then ++ echo "${self}: error: empty password" 1>&2 ++ exit 1 ++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" +diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in +new file mode 100644 +index 0000000..facd409 +--- /dev/null ++++ b/util/grub.d/01_users.in +@@ -0,0 +1,11 @@ ++#!/bin/sh -e ++cat << EOF ++if [ -f \${prefix}/user.cfg ]; then ++ source \${prefix}/user.cfg ++ if [ -n \${GRUB2_PASSWORD} ]; then ++ set superusers="root" ++ export superusers ++ password_pbkdf2 root \${GRUB2_PASSWORD} ++ fi ++fi ++EOF +-- +2.4.3 + diff --git a/0504-Make-exit-take-a-return-code.patch b/0504-Make-exit-take-a-return-code.patch new file mode 100644 index 0000000..8cb2c67 --- /dev/null +++ b/0504-Make-exit-take-a-return-code.patch @@ -0,0 +1,230 @@ +From ebb9cc96a230bbd58e0064356cdb3d403a473581 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 7 Jul 2015 12:00:26 -0400 +Subject: [PATCH 504/506] Make "exit" take a return code. + +This adds "exit" with a return code. With this patch, any "exit" +command /may/ include a return code, and on platforms that support +returning with an exit status, we will do so. By default we return the +same exit status we did before this patch. + +Signed-off-by: Peter Jones +--- + grub-core/commands/minicmd.c | 20 ++++++++++++++++---- + grub-core/kern/efi/efi.c | 9 +++++++-- + grub-core/kern/emu/misc.c | 4 ++-- + grub-core/kern/i386/coreboot/init.c | 2 +- + grub-core/kern/i386/qemu/init.c | 2 +- + grub-core/kern/ieee1275/init.c | 2 +- + grub-core/kern/mips/arc/init.c | 2 +- + grub-core/kern/mips/loongson/init.c | 2 +- + grub-core/kern/mips/qemu_mips/init.c | 2 +- + grub-core/kern/misc.c | 2 +- + grub-core/kern/uboot/init.c | 6 +++--- + grub-core/kern/xen/init.c | 2 +- + 12 files changed, 36 insertions(+), 19 deletions(-) + +diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c +index a3a1182..b25ca4b 100644 +--- a/grub-core/commands/minicmd.c ++++ b/grub-core/commands/minicmd.c +@@ -176,12 +176,24 @@ grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)), + } + + /* exit */ +-static grub_err_t __attribute__ ((noreturn)) ++static grub_err_t + grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)), +- int argc __attribute__ ((unused)), +- char *argv[] __attribute__ ((unused))) ++ int argc, char *argv[]) + { +- grub_exit (); ++ int retval = -1; ++ unsigned long n; ++ ++ if (argc < 0 || argc > 1) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); ++ ++ if (argc == 1) ++ { ++ n = grub_strtoul (argv[0], 0, 10); ++ if (n != ~0UL) ++ retval = n; ++ } ++ ++ grub_exit (retval); + /* Not reached. */ + } + +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index c80d85b..95c75d4 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) + } + + void +-grub_exit (void) ++grub_exit (int retval) + { ++ int rc = GRUB_EFI_LOAD_ERROR; ++ ++ if (retval == 0) ++ rc = GRUB_EFI_SUCCESS; ++ + grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + efi_call_4 (grub_efi_system_table->boot_services->exit, +- grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0); ++ grub_efi_image_handle, rc, 0, 0); + for (;;) ; + } + +diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c +index bb606da..837d162 100644 +--- a/grub-core/kern/emu/misc.c ++++ b/grub-core/kern/emu/misc.c +@@ -135,9 +135,9 @@ xasprintf (const char *fmt, ...) + #endif + + void +-grub_exit (void) ++grub_exit (int rc) + { +- exit (1); ++ exit (rc < 0 ? 1 : rc); + } + + grub_uint64_t +diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c +index 3314f02..36f9134 100644 +--- a/grub-core/kern/i386/coreboot/init.c ++++ b/grub-core/kern/i386/coreboot/init.c +@@ -41,7 +41,7 @@ extern grub_uint8_t _end[]; + extern grub_uint8_t _edata[]; + + void __attribute__ ((noreturn)) +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + /* 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/i386/qemu/init.c b/grub-core/kern/i386/qemu/init.c +index 271b6fb..9fafe98 100644 +--- a/grub-core/kern/i386/qemu/init.c ++++ b/grub-core/kern/i386/qemu/init.c +@@ -42,7 +42,7 @@ extern grub_uint8_t _end[]; + extern grub_uint8_t _edata[]; + + void __attribute__ ((noreturn)) +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + /* 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 8ca4bf7..e2540bc 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -60,7 +60,7 @@ grub_addr_t grub_ieee1275_original_stack; + #endif + + void +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + grub_ieee1275_exit (); + } +diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/init.c +index 3834a14..86b3a25 100644 +--- a/grub-core/kern/mips/arc/init.c ++++ b/grub-core/kern/mips/arc/init.c +@@ -276,7 +276,7 @@ grub_halt (void) + } + + void +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + GRUB_ARC_FIRMWARE_VECTOR->exit (); + +diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c +index 7b96531..dff598c 100644 +--- a/grub-core/kern/mips/loongson/init.c ++++ b/grub-core/kern/mips/loongson/init.c +@@ -304,7 +304,7 @@ grub_halt (void) + } + + void +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + grub_halt (); + } +diff --git a/grub-core/kern/mips/qemu_mips/init.c b/grub-core/kern/mips/qemu_mips/init.c +index be88b77..8b6c55f 100644 +--- a/grub-core/kern/mips/qemu_mips/init.c ++++ b/grub-core/kern/mips/qemu_mips/init.c +@@ -75,7 +75,7 @@ grub_machine_fini (int flags __attribute__ ((unused))) + } + + void +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + grub_halt (); + } +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 66f11f8..be6aa63 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -1090,7 +1090,7 @@ grub_abort (void) + grub_getkey (); + } + +- grub_exit (); ++ grub_exit (1); + } + + void +diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c +index 5dcc106..430c62b 100644 +--- a/grub-core/kern/uboot/init.c ++++ b/grub-core/kern/uboot/init.c +@@ -43,9 +43,9 @@ extern grub_uint32_t grub_uboot_machine_type; + extern grub_addr_t grub_uboot_boot_data; + + void +-grub_exit (void) ++grub_exit (int rc) + { +- grub_uboot_return (0); ++ grub_uboot_return (rc < 0 ? 1 : rc); + } + + grub_uint32_t +@@ -94,7 +94,7 @@ grub_machine_init (void) + if (!ver) + { + /* Don't even have a console to log errors to... */ +- grub_exit (); ++ grub_exit (-1); + } + else if (ver > API_SIG_VERSION) + { +diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c +index 0559c03..fce526d 100644 +--- a/grub-core/kern/xen/init.c ++++ b/grub-core/kern/xen/init.c +@@ -549,7 +549,7 @@ grub_machine_init (void) + } + + void +-grub_exit (void) ++grub_exit (int rc __attribute__((unused))) + { + struct sched_shutdown arg; + +-- +2.4.3 + diff --git a/0505-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch b/0505-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch new file mode 100644 index 0000000..ee87dc9 --- /dev/null +++ b/0505-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch @@ -0,0 +1,80 @@ +From aec0ae4db26fafe3ec5ea29e60313df6c88162d1 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 7 Jul 2015 12:04:28 -0400 +Subject: [PATCH 505/506] Add some __unused__ where gcc 5.x is more picky about + it. + +With some build flags, gcc 5.x throws more warnings about __unused__ not +being present than older compilers did. This patch adds the annotation. + +Signed-off-by: Peter Jones +--- + grub-core/gettext/gettext.c | 10 +++++----- + grub-core/normal/menu.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c +index 1e5c21d..b22e1bc 100644 +--- a/grub-core/gettext/gettext.c ++++ b/grub-core/gettext/gettext.c +@@ -434,7 +434,7 @@ static char * + grub_gettext_env_write_lang (struct grub_env_var *var + __attribute__ ((unused)), const char *val) + { +- grub_err_t err; ++ grub_err_t __attribute__((__unused__)) err; + err = grub_gettext_init_ext (&main_context, val, grub_env_get ("locale_dir"), + grub_env_get ("prefix")); + +@@ -447,7 +447,7 @@ grub_gettext_env_write_lang (struct grub_env_var *var + void + grub_gettext_reread_prefix (const char *val) + { +- grub_err_t err; ++ grub_err_t __attribute__((__unused__)) err; + err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), + grub_env_get ("locale_dir"), + val); +@@ -457,7 +457,7 @@ static char * + read_main (struct grub_env_var *var + __attribute__ ((unused)), const char *val) + { +- grub_err_t err; ++ grub_err_t __attribute__((__unused__)) err; + err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), val, + grub_env_get ("prefix")); + return grub_strdup (val); +@@ -467,7 +467,7 @@ static char * + read_secondary (struct grub_env_var *var + __attribute__ ((unused)), const char *val) + { +- grub_err_t err; ++ grub_err_t __attribute__((__unused__)) err; + err = grub_gettext_init_ext (&secondary_context, grub_env_get ("lang"), val, + 0); + return grub_strdup (val); +@@ -489,7 +489,7 @@ grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)), + GRUB_MOD_INIT (gettext) + { + const char *lang; +- grub_err_t err; ++ grub_err_t __attribute__((__unused__)) err; + + lang = grub_env_get ("lang"); + +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index 5b971b3..e74cb56 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -829,7 +829,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) + + /* Callback invoked immediately before a menu entry is executed. */ + static void +-notify_booting (grub_menu_entry_t entry, ++notify_booting (grub_menu_entry_t __attribute__((unused)) entry, + void *userdata __attribute__((unused))) + { + #if 0 +-- +2.4.3 + diff --git a/0506-Fix-race-in-EFI-validation.patch b/0506-Fix-race-in-EFI-validation.patch new file mode 100644 index 0000000..442821c --- /dev/null +++ b/0506-Fix-race-in-EFI-validation.patch @@ -0,0 +1,97 @@ +From aaa2b70bc66f50d0cd9243b6b0f90a141958ced2 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 14 Jul 2015 16:58:51 -0700 +Subject: [PATCH 506/506] Fix race in EFI validation + +--- + grub-core/loader/i386/efi/linux.c | 44 ++++++++++----------------------------- + 1 file changed, 11 insertions(+), 33 deletions(-) + +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +index e5b7785..7ccf32d 100644 +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -154,7 +154,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_file_t file = 0; + struct linux_kernel_header lh; + grub_ssize_t len, start, filelen; +- void *kernel; ++ void *kernel = NULL; + + grub_dl_ref (my_mod); + +@@ -191,10 +191,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- grub_file_seek (file, 0); +- +- grub_free(kernel); +- + params = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384)); + + if (! params) +@@ -203,15 +199,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- memset (params, 0, 16384); ++ grub_memset (params, 0, 16384); + +- if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) +- { +- if (!grub_errno) +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +- argv[0]); +- goto fail; +- } ++ grub_memcpy (&lh, kernel, sizeof (lh)); + + if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + { +@@ -271,27 +261,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + goto fail; + } + +- if (grub_file_seek (file, start) == (grub_off_t) -1) +- { +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +- argv[0]); +- goto fail; +- } ++ grub_memcpy (kernel_mem, (char *)kernel + start, len); ++ grub_loader_set (grub_linuxefi_boot, grub_linuxefi_unload, 0); ++ loaded=1; + +- if (grub_file_read (file, kernel_mem, len) != len && !grub_errno) +- { +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +- argv[0]); +- } +- +- if (grub_errno == GRUB_ERR_NONE) +- { +- grub_loader_set (grub_linuxefi_boot, grub_linuxefi_unload, 0); +- loaded = 1; +- lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; +- } +- +- memcpy(params, &lh, 2 * 512); ++ lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; ++ grub_memcpy (params, &lh, 2 * 512); + + params->type_of_loader = 0x21; + +@@ -300,6 +275,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + if (file) + grub_file_close (file); + ++ if (kernel) ++ grub_free (kernel); ++ + if (grub_errno != GRUB_ERR_NONE) + { + grub_dl_unref (my_mod); +-- +2.4.3 + diff --git a/grub2.spec b/grub2.spec index 8fb4f27..9c298c6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -62,160 +62,508 @@ Patch0001: 0001-fix-EFI-detection-on-Windows.patch Patch0002: 0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch Patch0003: 0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch Patch0004: 0004-NEWS-First-draft-of-2.02-entry.patch -Patch0005: 0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch -Patch0006: 0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch -Patch0007: 0007-remove-unused-error.h-from-kern-emu-misc.c.patch -Patch0008: 0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch -Patch0009: 0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch -Patch0010: 0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch -Patch0011: 0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch -Patch0012: 0012-fix-32-bit-compilation-on-MinGW-w64.patch -Patch0013: 0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch -Patch0014: 0014-arm64-set-correct-length-of-device-path-end-entry.patch -Patch0015: 0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch -Patch0016: 0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch -Patch0017: 0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch -Patch0018: 0018-Prefer-more-portable-test-1-constructs.patch -Patch0019: 0019-NEWS-Add-few-missing-entries.patch -Patch0020: 0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch -Patch0021: 0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch -Patch0022: 0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch -Patch0023: 0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch -Patch0024: 0024-Fix-ChangeLog-date.patch -Patch0025: 0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch -Patch0026: 0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch -Patch0027: 0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch -Patch0028: 0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch -Patch0029: 0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch -Patch0030: 0030-Makefile.am-default_payload.elf-Add-modules.patch -Patch0031: 0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch -Patch0032: 0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch -Patch0033: 0033-util-grub-install.c-Fix-a-typo.patch -Patch0034: 0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch -Patch0035: 0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch -Patch0036: 0036-change-stop-condition-to-avoid-infinite-loops.patch -Patch0037: 0037-increase-network-try-interval-gradually.patch -Patch0038: 0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch -Patch0039: 0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch -Patch0040: 0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch -Patch0041: 0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch -Patch0042: 0042-util-grub-install.c-List-available-targets.patch -Patch0043: 0043-Fix-several-translatable-strings.patch -Patch0044: 0044-do-not-set-default-prefix-in-grub-mkimage.patch -Patch0045: 0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch -Patch0046: 0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch -Patch0047: 0047-grub-install-support-for-partitioned-partx-loop-devi.patch -Patch0048: 0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch -Patch0049: 0049-.gitignore-add-missing-files-and-.exe-variants.patch -Patch0050: 0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch -Patch0051: 0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch -Patch0052: 0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch -Patch0053: 0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch -Patch0054: 0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch -Patch0055: 0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch -Patch0056: 0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch -Patch0057: 0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch -Patch0058: 0058-add-grub_env_set_net_property-function.patch -Patch0059: 0059-add-bootpath-parser-for-open-firmware.patch -Patch0060: 0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch -Patch0061: 0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch -Patch0062: 0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch -Patch0063: 0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch -Patch0064: 0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch -Patch0065: 0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch -Patch0066: 0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch -Patch0067: 0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch -Patch0068: 0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch -Patch0069: 0069-Fix-grub-probe-0-option.patch -Patch0070: 0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch -Patch0071: 0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch -Patch0072: 0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch -Patch0073: 0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch -Patch0074: 0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch -Patch0075: 0075-Add-missing-endif.patch -Patch0076: 0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch -Patch0077: 0077-Improve-LVM-logical_volumes-string-matching.patch -Patch0078: 0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch -Patch0079: 0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch -Patch0080: 0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch -Patch0081: 0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch -Patch0082: 0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch -Patch0083: 0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch -Patch0084: 0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch -Patch0085: 0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch -Patch0086: 0086-util-grub-install.c-Fix-handling-of-disk-module.patch -Patch0087: 0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch -Patch0088: 0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch -Patch0089: 0089-Migrate-PPC-from-Yaboot-to-Grub2.patch -Patch0090: 0090-Add-fw_path-variable-revised.patch -Patch0091: 0091-Add-support-for-linuxefi.patch -Patch0092: 0092-Use-linuxefi-and-initrdefi-where-appropriate.patch -Patch0093: 0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch -Patch0094: 0094-Pass-x-hex-hex-straight-through-unmolested.patch -Patch0095: 0095-Fix-crash-on-http.patch -Patch0096: 0096-IBM-client-architecture-CAS-reboot-support.patch -Patch0097: 0097-Add-vlan-tag-support.patch -Patch0098: 0098-Add-X-option-to-printf-functions.patch -Patch0099: 0099-DHCP-client-ID-and-UUID-options-added.patch -Patch0100: 0100-Search-for-specific-config-file-for-netboot.patch -Patch0101: 0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch -Patch0102: 0102-Move-bash-completion-script-922997.patch -Patch0103: 0103-for-ppc-reset-console-display-attr-when-clear-screen.patch -Patch0104: 0104-Don-t-write-messages-to-the-screen.patch -Patch0105: 0105-Don-t-print-GNU-GRUB-header.patch -Patch0106: 0106-Don-t-add-to-highlighted-row.patch -Patch0107: 0107-Message-string-cleanups.patch -Patch0108: 0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch -Patch0109: 0109-Use-the-correct-indentation-for-the-term-help-text.patch -Patch0110: 0110-Indent-menu-entries.patch -Patch0111: 0111-Fix-margins.patch -Patch0112: 0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch -Patch0113: 0113-Disable-GRUB-video-support-for-IBM-power-machines.patch -Patch0114: 0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch -Patch0115: 0115-Use-linux16-when-appropriate-880840.patch -Patch0116: 0116-Enable-pager-by-default.-985860.patch -Patch0117: 0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch -Patch0118: 0118-Don-t-say-GNU-Linux-in-generated-menus.patch -Patch0119: 0119-Don-t-draw-a-border-around-the-menu.patch -Patch0120: 0120-Use-the-standard-margin-for-the-timeout-string.patch -Patch0121: 0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch -Patch0122: 0122-Add-.eh_frame-to-list-of-relocations-stripped.patch -Patch0123: 0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch -Patch0124: 0124-Don-t-print-during-fdt-loading-method.patch -Patch0125: 0125-Honor-a-symlink-when-generating-configuration-by-gru.patch -Patch0126: 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch -Patch0127: 0127-Don-t-require-a-password-to-boot-entries-generated-b.patch -Patch0128: 0128-Don-t-emit-Booting-.-message.patch -Patch0129: 0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch -Patch0130: 0130-May-as-well-try-it.patch -Patch0131: 0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch -Patch0132: 0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch -Patch0133: 0133-trim-arp-packets-with-abnormal-size.patch -Patch0134: 0134-Fix-convert-function-to-support-NVMe-devices.patch -Patch0135: 0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch -Patch0136: 0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch -Patch0137: 0137-Use-the-default-device-tree-from-the-grub-default-fi.patch -Patch0138: 0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch -Patch0139: 0139-Reduce-timer-event-frequency-by-10.patch -Patch0140: 0140-always-return-error-to-UEFI.patch -Patch0141: 0141-Add-powerpc-little-endian-ppc64le-flags.patch -Patch0142: 0142-Files-reorganization-and-include-some-libgcc-fuction.patch -Patch0143: 0143-Suport-for-bi-endianess-in-elf-file.patch -Patch0144: 0144-Add-grub_util_readlink.patch -Patch0145: 0145-Make-editenv-chase-symlinks-including-those-across-d.patch -Patch0146: 0146-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch -Patch0147: 0147-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch -Patch0148: 0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch -Patch0149: 0149-Add-GRUB_DISABLE_UUID.patch -Patch0150: 0150-Allow-fallback-to-include-entries-by-title-not-just-.patch -Patch0151: 0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch -Patch0152: 0152-Load-arm-with-SB-enabled.patch -Patch0153: 0153-Try-prefix-if-fw_path-doesn-t-work.patch -Patch0154: 0154-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch -Patch0155: 0001-Update-to-minilzo-2.08.patch -Patch0156: 0001-Make-grub2-mkconfig-construct-titles-that-look-like-.patch -Patch0157: 0002-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch -Patch0158: 0001-Make-.gitignore-suck-way-less.patch +Patch0005: 0005-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +Patch0006: 0006-remove-unused-error.h-from-kern-emu-misc.c.patch +Patch0007: 0007-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch +Patch0008: 0008-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch +Patch0009: 0009-strip-.eh_frame-section-from-arm64-efi-kernel.patch +Patch0010: 0010-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch +Patch0011: 0011-fix-32-bit-compilation-on-MinGW-w64.patch +Patch0012: 0012-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch +Patch0013: 0013-arm64-set-correct-length-of-device-path-end-entry.patch +Patch0014: 0014-Makefile.util.def-grub-macbless-Change-mansection-to.patch +Patch0015: 0015-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch +Patch0016: 0016-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch +Patch0017: 0017-Prefer-more-portable-test-1-constructs.patch +Patch0018: 0018-NEWS-Add-few-missing-entries.patch +Patch0019: 0019-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch +Patch0020: 0020-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch +Patch0021: 0021-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch +Patch0022: 0022-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch +Patch0023: 0023-Fix-ChangeLog-date.patch +Patch0024: 0024-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch +Patch0025: 0025-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch +Patch0026: 0026-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch +Patch0027: 0027-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch +Patch0028: 0028-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch +Patch0029: 0029-Makefile.am-default_payload.elf-Add-modules.patch +Patch0030: 0030-fix-removal-of-cpu-machine-links-on-mingw-msys.patch +Patch0031: 0031-grub-core-normal-main.c-read_config_file-Buffer-conf.patch +Patch0032: 0032-util-grub-install.c-Fix-a-typo.patch +Patch0033: 0033-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch +Patch0034: 0034-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch +Patch0035: 0035-change-stop-condition-to-avoid-infinite-loops.patch +Patch0036: 0036-increase-network-try-interval-gradually.patch +Patch0037: 0037-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch +Patch0038: 0038-Show-detected-path-to-DejaVuSans-in-configure-summar.patch +Patch0039: 0039-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch +Patch0040: 0040-util-grub-install.c-write_to_disk-Add-an-info-messag.patch +Patch0041: 0041-util-grub-install.c-List-available-targets.patch +Patch0042: 0042-Fix-several-translatable-strings.patch +Patch0043: 0043-do-not-set-default-prefix-in-grub-mkimage.patch +Patch0044: 0044-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch +Patch0045: 0045-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch +Patch0046: 0046-grub-install-support-for-partitioned-partx-loop-devi.patch +Patch0047: 0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch +Patch0048: 0048-.gitignore-add-missing-files-and-.exe-variants.patch +Patch0049: 0049-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch +Patch0050: 0050-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch +Patch0051: 0051-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch +Patch0052: 0052-grub-core-disk-ahci.c-Add-safety-cleanups.patch +Patch0053: 0053-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch +Patch0054: 0054-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch +Patch0055: 0055-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch +Patch0056: 0056-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch +Patch0057: 0057-add-grub_env_set_net_property-function.patch +Patch0058: 0058-add-bootpath-parser-for-open-firmware.patch +Patch0059: 0059-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch +Patch0060: 0060-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch +Patch0061: 0061-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch +Patch0062: 0062-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch +Patch0063: 0063-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch +Patch0064: 0064-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch +Patch0065: 0065-ieee1275-check-for-IBM-pseries-emulated-machine.patch +Patch0066: 0066-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch +Patch0067: 0067-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch +Patch0068: 0068-Fix-grub-probe-0-option.patch +Patch0069: 0069-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch +Patch0070: 0070-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch +Patch0071: 0071-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch +Patch0072: 0072-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch +Patch0073: 0073-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch +Patch0074: 0074-Add-missing-endif.patch +Patch0075: 0075-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch +Patch0076: 0076-Improve-LVM-logical_volumes-string-matching.patch +Patch0077: 0077-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch +Patch0078: 0078-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch +Patch0079: 0079-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch +Patch0080: 0080-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch +Patch0081: 0081-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch +Patch0082: 0082-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch +Patch0083: 0083-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch +Patch0084: 0084-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch +Patch0085: 0085-util-grub-install.c-Fix-handling-of-disk-module.patch +Patch0086: 0086-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch +Patch0087: 0087-docs-grub-dev.texi-Finding-your-way-around-The-build.patch +Patch0088: 0088-Fix-an-infinite-loop-in-grub-mkconfig.patch +Patch0089: 0089-grub-core-fs-cbfs.c-Don-t-probe-disks-of-unknow-size.patch +Patch0090: 0090-Fix-Changelog.patch +Patch0091: 0091-grub-core-disk-i386-pc-biosdisk.c-grub_biosdisk_rw-A.patch +Patch0092: 0092-grub-core-kern-disk_common.c-Clump-disk-size-to-1EiB.patch +Patch0093: 0093-grub-core-term-at_keyboard.c-Retry-probing-keyboard-.patch +Patch0094: 0094-Fix-typo-gettext_print-instead-of-gettext_printf.patch +Patch0095: 0095-grub-core-kern-mips-arc-init.c-grub_machine_get_boot.patch +Patch0096: 0096-configure.ac-Remove-several-unnecessary-semicolons.patch +Patch0097: 0097-Support-grub-emu-on-x32-ILP32-but-with-x86-64-instru.patch +Patch0098: 0098-Fix-incorrect-address-reference-in-btrfs.patch +Patch0099: 0099-Fix-build-with-glibc-2.20.patch +Patch0100: 0100-Tidy-up-ChangeLog-formatting.patch +Patch0101: 0101-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch +Patch0102: 0102-grub-core-osdep-unix-config.c-Remove-extraneous-comm.patch +Patch0103: 0103-Fix-wrong-commit.patch +Patch0104: 0104-grub-core-gmodule.pl.in-Accept-newer-binutils-which-.patch +Patch0105: 0105-grub-core-commands-keylayouts.c-Ignore-unknown-keys.patch +Patch0106: 0106-grub-core-normal-main.c-Don-t-drop-to-rescue-console.patch +Patch0107: 0107-ACPIhalt-Add-more-ACPI-opcodes.patch +Patch0108: 0108-Revert-Use-Wl-no-relax-rather-than-mno-relax-for-uni.patch +Patch0109: 0109-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch +Patch0110: 0110-Add-a-new-none-platform-that-only-builds-utilities.patch +Patch0111: 0111-Fix-in-tree-platform-none.patch +Patch0112: 0112-Use-full-initializer-for-initrd_ctx-to-avoid-fatal-w.patch +Patch0113: 0113-icmp6-fix-no-respond-to-neighbor-solicit-message.patch +Patch0114: 0114-efi-check-path-non-null-before-grub_strrchr.patch +Patch0115: 0115-Fix-date-in-last-ChangeLog-entry.patch +Patch0116: 0116-grub-fs-tester-consistently-print-output-of-grub-ls-.patch +Patch0117: 0117-send-router-solicitation-for-ipv6-address-autoconf-v.patch +Patch0118: 0118-grub-mkstandalone-out-of-bound-access-to-tar-header-.patch +Patch0119: 0119-grub-install-common-avoid-out-of-bound-access-when-r.patch +Patch0120: 0120-grub-core-disk-luks.c-fix-use-after-free-and-memory-.patch +Patch0121: 0121-Use-ssize_t-for-grub_util_fd_read-result.patch +Patch0122: 0122-grub-core-disk-geli.c-fix-memory-leaks-in-error-path.patch +Patch0123: 0123-Fix-ChangeLog.patch +Patch0124: 0124-grub-core-disk-lzopio.c-fix-double-free-in-error-pat.patch +Patch0125: 0125-grub-core-lib-syslinux_parse.c-do-not-free-array.patch +Patch0126: 0126-grub-core-fs-zfs-zfsinfo.c-memory-leak-in-print_vdev.patch +Patch0127: 0127-grub-core-loader-i386-xen_fileXX.c-memory-leak-in-gr.patch +Patch0128: 0128-grub-shell-support-files-also-for-net-boot.patch +Patch0129: 0129-add-file-filters-tests.patch +Patch0130: 0130-fix-memory-corruption-in-pubkey-filter-over-network.patch +Patch0131: 0131-fix-double-free-in-grub_net_recv_tcp_packet.patch +Patch0132: 0132-Avoid-use-of-non-portable-echo-n-in-grub-mkconfig.patch +Patch0133: 0133-grub-core-fs-ext2.c-grub_ext2_read_block-Support-lar.patch +Patch0134: 0134-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch +Patch0135: 0135-Fix-serial-rtscts-option-processing.patch +Patch0136: 0136-Support-GELI-v6-and-v7.patch +Patch0137: 0137-Replace-explicit-sizeof-divisions-by-ARRAY_SIZE.patch +Patch0138: 0138-grub_script_lexer_yywrap-Update-len-synchronously-wi.patch +Patch0139: 0139-grub_fshelp_read_file-Don-t-attempt-to-read-past-the.patch +Patch0140: 0140-grub-core-fs-minix.c-grub_minix_read_file-Avoid-read.patch +Patch0141: 0141-grub_cmd_play-Avoid-division-by-zero.patch +Patch0142: 0142-grub-core-disk-AFSplitter.c-AF_merge-Check-that-mdle.patch +Patch0143: 0143-grub_ata_setaddress-Check-that-geometry-is-sane-when.patch +Patch0144: 0144-Reject-NILFS2-superblocks-with-over-1GiB-blocks.patch +Patch0145: 0145-grub_ufs_mount-Check-that-sblock.ino_per_group-is-no.patch +Patch0146: 0146-grub-core-fs-ext2.c-grub_ext2_mount-Additional-check.patch +Patch0147: 0147-grub-core-fs-minix.c-Additional-filesystem-sanity-ch.patch +Patch0148: 0148-grub-core-fs-hfs.c-grub_hfs_mount-Additional-filesys.patch +Patch0149: 0149-grub_dmraid_nv_detect-Do-not-divide-by-zero.patch +Patch0150: 0150-grub-core-disk-ieee1275-nand.c-grub_nand_open-Check-.patch +Patch0151: 0151-grub-core-disk-i386-pc-biosdisk.c-Check-disk-size-sa.patch +Patch0152: 0152-osdep-linux-blocklist.c-grub_install_get_blocklist-C.patch +Patch0153: 0153-grub-core-lib-pbkdf2.c-grub_crypto_pbkdf2-Check-that.patch +Patch0154: 0154-grub-core-fs-btrfs.c-Avoid-divisions-by-zero.patch +Patch0155: 0155-grub-core-fs-zfs.c-Avoid-divisions-by-zero.patch +Patch0156: 0156-term.h-Avoid-returining-0-sized-terminal-as-it-may-l.patch +Patch0157: 0157-grub-core-disk-diskfilter.c-Validate-volumes-to-avoi.patch +Patch0158: 0158-grub-core-video-readers-jpeg.c-Avoid-division-by-zer.patch +Patch0159: 0159-Avoid-division-by-zero-in-serial.patch +Patch0160: 0160-grub-core-term-gfxterm.c-Avoid-division-by-zero.patch +Patch0161: 0161-include-grub-misc.h-grub_div_roundup-Remove-as-it-s-.patch +Patch0162: 0162-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch +Patch0163: 0163-grub-core-loader-i386-xnu.c-guessfsb-Avoid-division-.patch +Patch0164: 0164-rtc_get_time_ms.c-grub_rtc_get_time_ms-Avoid-divisio.patch +Patch0165: 0165-haiku-getroot.c-grub_util_find_partition_start_os-Av.patch +Patch0166: 0166-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch +Patch0167: 0167-unix-cputime.c-Cache-sc_clk_tck-and-check-it-for-san.patch +Patch0168: 0168-grub_menu_init_page-Avoid-returning-0-geometry-to-av.patch +Patch0169: 0169-Remove-potential-division-by-0-in-gfxmenu.patch +Patch0170: 0170-Remove-direct-_llseek-code-and-require-long-filesyst.patch +Patch0171: 0171-accept-also-hdX-as-alias-to-native-Xen-disk-name.patch +Patch0172: 0172-Mention-platform-none-in-NEWS.patch +Patch0173: 0173-tests-file_filter-file-Really-add-missing-file.patch +Patch0174: 0174-Autogenerate-ChangeLog-from-git-changelog.patch +Patch0175: 0175-conf-Makefile.common-Remove-unused-LD-C-FLAGS_CPU.patch +Patch0176: 0176-util-grub-mkrescue.c-Always-include-part_msdos-and-p.patch +Patch0177: 0177-efidisk-Return-the-determined-root-disk-even-if-part.patch +Patch0178: 0178-Makefile.am-Fix-Changelog-cutoff-address.patch +Patch0179: 0179-Generate-empty-ChangeLog-if-no-.git-is-available.patch +Patch0180: 0180-Always-add-msoft-float-to-avoid-compiler-generating-.patch +Patch0181: 0181-uhci-Fix-null-pointer-dereference.patch +Patch0182: 0182-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch +Patch0183: 0183-commands-file-Change-the-confusing-loop-stop-conditi.patch +Patch0184: 0184-commands-fileXX-Fix-memory-leak.patch +Patch0185: 0185-gptsync-Add-missing-device_close.patch +Patch0186: 0186-commands-hdparm-Add-missing-grub_disk_close.patch +Patch0187: 0187-zfs-Fix-disk-matching-logic.patch +Patch0188: 0188-commands-legacycfg-Fix-resource-leaks.patch +Patch0189: 0189-commands-macbless-Remove-incorrect-grub_free.patch +Patch0190: 0190-commands-macbless-Fix-potential-overflow.patch +Patch0191: 0191-commands-macbless-Handle-device-opening-errors-corre.patch +Patch0192: 0192-commands-nativedisk-Add-missing-device_close.patch +Patch0193: 0193-commands-parttool-Add-missing-device-close.patch +Patch0194: 0194-commands-syslinux-Add-missing-free.patch +Patch0195: 0195-commands-tr-Simplify-and-fix-missing-parameter-test.patch +Patch0196: 0196-commands-verify-Fix-sha1-context-zeroing-out.patch +Patch0197: 0197-commands-wildcard-Add-missing-free.patch +Patch0198: 0198-disk-AFsplitter-check-argument-validity-before-doing.patch +Patch0199: 0199-disk-ahci-Fix-device_map_range-argument.patch +Patch0200: 0200-disk-cryptodisk-Add-missing-error-check.patch +Patch0201: 0201-disk-diskfilter-Add-missing-lv-presence-check.patch +Patch0202: 0202-disk-geli-Add-missing-seek-success-check.patch +Patch0203: 0203-disk-geli-Add-missing-free.patch +Patch0204: 0204-biosdisk-Add-missing-cast.patch +Patch0205: 0205-font-Add-missing-free.patch +Patch0206: 0206-fs-cbfs-Add-missing-free.patch +Patch0207: 0207-fs-cpio_common-Add-a-sanity-check-on-namesize.patch +Patch0208: 0208-fs-fat-Fix-codepath-to-properly-free-on-error.patch +Patch0209: 0209-fs-hfs-hfs_open-Check-that-mount-succeeded.patch +Patch0210: 0210-fs-hfs-Add-pointer-sanity-checks.patch +Patch0211: 0211-commands-fileXX-Fix-remaining-memory-leak.patch +Patch0212: 0212-grub_iso9660_read-Explicitly-check-read_node-return-.patch +Patch0213: 0213-fs-minix-Fix-sector-promotion-to-64-bit.patch +Patch0214: 0214-fs-ntfs-Add-missing-free.patch +Patch0215: 0215-fs-ntfs-Add-sizes-sanity-checks.patch +Patch0216: 0216-fs-reiserfs-Fix-sector-count-overflow.patch +Patch0217: 0217-fs-sfs-Fix-error-check-and-add-sanity-check.patch +Patch0218: 0218-configure.ac-Always-add-D_FILE_OFFSET_BITS-64.patch +Patch0219: 0219-fs-ufs-Add-missing-error-check.patch +Patch0220: 0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch +Patch0221: 0221-gfxmenu-theme_loader-Add-missing-allos-error-check.patch +Patch0222: 0222-i386-pc-mmap-Fix-memset-size.patch +Patch0223: 0223-lib-syslinux_parse-Add-missing-alloc-check.patch +Patch0224: 0224-lib-syslinux_parse-Fix-memory-leak.patch +Patch0225: 0225-lib-syslinux_parse-Add-missing-error-check.patch +Patch0226: 0226-bsd-Add-missing-null-pointer-check.patch +Patch0227: 0227-multiboot-Simplify-to-avoid-confusing-assignment.patch +Patch0228: 0228-plan9-Add-missing-grub_device_close.patch +Patch0229: 0229-xnu-Add-missing-error-check.patch +Patch0230: 0230-normal-main-Fix-error-handling.patch +Patch0231: 0231-normal-misc-Close-device-on-all-pathes.patch +Patch0232: 0232-devmapper-getroot-Fix-memory-leak.patch +Patch0233: 0233-linux-blocklist-Fix-memory-leak.patch +Patch0234: 0234-linux-getroot-Fix-error-handling.patch +Patch0235: 0235-unix-password-Fix-file-descriptor-leak.patch +Patch0236: 0236-vbe-Fix-incorrect-register-usage.patch +Patch0237: 0237-util-getroot-Add-missing-grub_disk_close.patch +Patch0238: 0238-grub-install-common-Fix-sizeof-usage.patch +Patch0239: 0239-grub-install-Fix-memory-leak.patch +Patch0240: 0240-grub-macbless-Fix-resource-leak.patch +Patch0241: 0241-util-misc.c-Check-ftello-return-value.patch +Patch0242: 0242-linux-getroot-fix-descriptor-leak.patch +Patch0243: 0243-linux-ofpath-fix-various-memory-leaks.patch +Patch0244: 0244-util-setup-fix-memory-leak.patch +Patch0245: 0245-util-install-fix-memory-leak.patch +Patch0246: 0246-linux-getroot-fix-memory-leak.patch +Patch0247: 0247-util-grub-install-rearrange-code-to-avoid-memory-lea.patch +Patch0248: 0248-util-grub-mkstandalone-fix-memory-leak.patch +Patch0249: 0249-util-grub-mount-fix-descriptor-leak.patch +Patch0250: 0250-util-mkimage-fix-memory-leaks.patch +Patch0251: 0251-util-setup-fix-memory-leak.patch +Patch0252: 0252-commands-acpi-Use-ALIGN_UP-rather-than-manual-expres.patch +Patch0253: 0253-fs-cbfs-cpio-Remove-useless-check-if-mode-is-NULL.patch +Patch0254: 0254-fs-zfs-Fix-error-handling.patch +Patch0255: 0255-fs-zfscrypt-Add-missing-explicit-cast.patch +Patch0256: 0256-linux-hostdisk-Limit-strcpy-size-to-buffer-size.patch +Patch0257: 0257-linux-ofpath-Fix-error-handling.patch +Patch0258: 0258-Document-intentional-fallthroughs.patch +Patch0259: 0259-linux-hostdisk-use-strncpy-instead-of-strlcpy.patch +Patch0260: 0260-linux-ofpath-fix-descriptor-leak.patch +Patch0261: 0261-fs-zfs-zfs.c-fix-memory-leak.patch +Patch0262: 0262-commands-parttool-fix-memory-leak.patch +Patch0263: 0263-fs-zfs-zfscrypt.c-fix-memory-leaks.patch +Patch0264: 0264-fs-zfs-zfscrypt.c-fix-indentation.patch +Patch0265: 0265-fs-hfsplus-fix-memory-leak.patch +Patch0266: 0266-util-grub-probe-fix-memory-leaks.patch +Patch0267: 0267-loader-xnu-fix-memory-leak.patch +Patch0268: 0268-Change-quotes-to-match-overall-style-in-NEWS.patch +Patch0269: 0269-syslinux_parse-fix-memory-leak.patch +Patch0270: 0270-script-execute.c-fix-memory-leak.patch +Patch0271: 0271-configure.ac-don-t-use-msoft-float-for-arm64.patch +Patch0272: 0272-test-do-not-stop-after-first-file-test-or-closing-br.patch +Patch0273: 0273-test-fix-previous-commit-we-need-to-return-from-sube.patch +Patch0274: 0274-test-consistently-use-TMPDIR-and-same-name-pattern-f.patch +Patch0275: 0275-tests-add-test-command-file-tests.patch +Patch0276: 0276-net-ip-check-result-of-grub_netbuff_push.patch +Patch0277: 0277-grub-mkimage-fix-potential-NULL-pointer-dereference.patch +Patch0278: 0278-net-pxe-fix-error-condition.patch +Patch0279: 0279-grub-fstest-fix-descriptor-leak.patch +Patch0280: 0280-setup-fix-blocklist-size-calculation.patch +Patch0281: 0281-arm-implement-additional-relocations-generated-by-gc.patch +Patch0282: 0282-util-mkimage-fix-gcc5-build-failure.patch +Patch0283: 0283-diskfilter-fix-crash-in-validate_lv-for-mdraid-array.patch +Patch0284: 0284-diskfilter-fix-double-free-of-lv-names-for-mdraid.patch +Patch0285: 0285-multiboot2-Fix-information-request-tag-size-calculat.patch +Patch0286: 0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch +Patch0287: 0287-diskfilter_make_raid-more-memory-leaks-in-failure-pa.patch +Patch0288: 0288-syslinux_parse-Always-output-comments-even-if-no-ent.patch +Patch0289: 0289-Don-t-remove-initrd-parameter.patch +Patch0290: 0290-Add-test-for-syslinux-converter.patch +Patch0291: 0291-build-sys-add-syslinux-test-files-to-tarball.patch +Patch0292: 0292-tests-remove-hardcoded-paths-from-syslinux_test.patch +Patch0293: 0293-ext2-Support-META_BG.patch +Patch0294: 0294-ext2-Ignore-INCOMPAT_MMP.patch +Patch0295: 0295-configure-Add-missing-comma.patch +Patch0296: 0296-configure-Move-adding-of-include-options-to-the-very.patch +Patch0297: 0297-Strip-.MIPS.abiflags-which-causes-compile-failure.patch +Patch0298: 0298-INSTALL-Fix-names-of-host-flags-to-match-actual-beha.patch +Patch0299: 0299-div_test-Don-t-try-to-divide-by-zero.patch +Patch0300: 0300-Provide-__aeabi_mem-cpy-set.patch +Patch0301: 0301-mips-startup_raw-Use-more-portable-.asciz.patch +Patch0302: 0302-configure-Add-msoft-float-to-CCASFLAGS.patch +Patch0303: 0303-ofdisk-Exclude-floppies-from-scanning.patch +Patch0304: 0304-wildcard-Mark-unused-argument-as-such.patch +Patch0305: 0305-zfs-mzap_lookup-Fix-argument-types.patch +Patch0306: 0306-INSTALL-clarify-that-clang-support-is-experimental.patch +Patch0307: 0307-Test-which-flags-make-our-asm-compile.patch +Patch0308: 0308-i386-Move-from-explicit-ADDR32-DATA32-prefixes-to-in.patch +Patch0309: 0309-Change-dot-assignmnet-to-more-portable-.org.patch +Patch0310: 0310-i386-pc-boot-Explicitly-mark-kernel_address-_high-as.patch +Patch0311: 0311-i386-Remove-needless-ADDR32-prefixes-when-address-is.patch +Patch0312: 0312-Remove-obsolete-ADDR32-and-DATA32-checks.patch +Patch0313: 0313-Remove-realmode.S-from-coreboot-and-qemu.patch +Patch0314: 0314-qemu-Fix-compilation.patch +Patch0315: 0315-qemu-Fix-GateA20-enabling.patch +Patch0316: 0316-qemu-Switch-to-more-portable-.org.patch +Patch0317: 0317-Relax-requirements-on-asm-for-non-BIOS-i386-platform.patch +Patch0318: 0318-kernel-8086-Switch-to-more-portable-.org.patch +Patch0319: 0319-sparc64-Switch-to-more-portable-.org.patch +Patch0320: 0320-mips-Switch-to-more-portable-.org.patch +Patch0321: 0321-Discover-which-option-provides-soft-float-on-configu.patch +Patch0322: 0322-Experimental-support-for-clang-for-sparc64.patch +Patch0323: 0323-i386-tsc-Fix-unused-function-warning-on-xen.patch +Patch0324: 0324-configure.ac-Add-ia64-specific-way-to-disable-floats.patch +Patch0325: 0325-acpi-Fix-unused-function-warning.patch +Patch0326: 0326-Supply-signed-division-to-fix-ARM-compilation.patch +Patch0327: 0327-arm64-Fix-compilation-failure.patch +Patch0328: 0328-Allow-clang-compilation-for-thumb-with-mthumb-interw.patch +Patch0329: 0329-Add-missing-grub_-prefix-in-memcpy-invocation.patch +Patch0330: 0330-mips-Fix-soft-float-handling.patch +Patch0331: 0331-minilzo-Skip-parts-tha-we-don-t-need.patch +Patch0332: 0332-bitmap_scale-Optimize-by-moving-division-out-of-the-.patch +Patch0333: 0333-fbblit-Optimize-by-replacing-division-with-additions.patch +Patch0334: 0334-Add-missing-lib-division.c.patch +Patch0335: 0335-png-Optimize-by-avoiding-divisions.patch +Patch0336: 0336-jpeg-Optimise-by-replacing-division-with-shifts.patch +Patch0337: 0337-crypto-restrict-cipher-block-size-to-power-of-2.patch +Patch0338: 0338-dmraid_nvidia-Fix-division-by-0-and-missing-byte-swa.patch +Patch0339: 0339-raid6-Optimize-by-removing-division.patch +Patch0340: 0340-gzio-Optimize-by-removing-division.patch +Patch0341: 0341-arm-dl-Fix-handling-of-nonstandard-relocation-sizes.patch +Patch0342: 0342-emu-cache-Change-declaration-of-__clear_cache-to-mat.patch +Patch0343: 0343-ntfs_test-Skip-is-setfattr-is-unavailable.patch +Patch0344: 0344-grub-shell-Add-missing-locale-directory.patch +Patch0345: 0345-grub-probe-Mark-a-default-for-translation.patch +Patch0346: 0346-exclude.pot-Add-new-technical-strings.patch +Patch0347: 0347-grub-probe-free-temporary-variable.patch +Patch0348: 0348-Don-t-continue-to-query-block-size-if-disk-doesn-t-h.patch +Patch0349: 0349-configure.ac-Set-CPPFLAGS-when-checking-for-no_app_r.patch +Patch0350: 0350-types.h-Use-__builtin_bswap-with-clang.patch +Patch0351: 0351-Remove-libgcc-dependency.patch +Patch0352: 0352-configure.ac-Remove-unused-COND_clang.patch +Patch0353: 0353-Remove-emu-libusb-support.patch +Patch0354: 0354-Fix-canonicalize_file_name-clash.patch +Patch0355: 0355-configure.ac-Fix-the-name-of-pciaccess-header.patch +Patch0356: 0356-syslinux_parse-Fix-the-case-of-unknown-localboot.patch +Patch0357: 0357-update-m4-extern-inline.m4-to-upstream-version-to-fi.patch +Patch0358: 0358-update-gnulib-argp-help.c-to-fix-garbage-in-grub-mkn.patch +Patch0359: 0359-autogen.sh-Allow-overriding-the-python-to-be-used-by.patch +Patch0360: 0360-hfsplus-Fix-potential-access-to-uninited-memory-on-i.patch +Patch0361: 0361-grub-fs-tester-better-estimation-of-filesystem-time-.patch +Patch0362: 0362-grub-fs-tester-explicitly-set-segment-type-for-LVM-m.patch +Patch0363: 0363-core-add-LVM-RAID1-support.patch +Patch0364: 0364-grub-fs-tester-add-LVM-RAID1-support.patch +Patch0365: 0365-cacheinfo-Add-missing-license-information.patch +Patch0366: 0366-grub-mkrescue-pass-all-unrecognized-options-unchange.patch +Patch0367: 0367-fddboot_test-Add-no-pad-to-xorriso.patch +Patch0368: 0368-emunet-Fix-init-error-checking.patch +Patch0369: 0369-compiler-rt-emu-Add-missing-file.patch +Patch0370: 0370-hostfs-Drop-unnecessary-feature-test-macros.patch +Patch0371: 0371-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch +Patch0372: 0372-Makefile.core.def-Remove-obsolete-LDADD_KERNEL.patch +Patch0373: 0373-modinfo.sh.in-Add-missing-config-variables.patch +Patch0374: 0374-util-mkimage-Use-stable-timestamp-when-generating-bi.patch +Patch0375: 0375-Make-Makefile.util.def-independent-of-platform.patch +Patch0376: 0376-efinet-Check-for-immediate-completition.patch +Patch0377: 0377-dl_helper-Cleanup.patch +Patch0378: 0378-Add-missing-initializers-to-silence-suprious-warning.patch +Patch0379: 0379-Recognize-EFI-platform-even-in-case-of-mismatch-betw.patch +Patch0380: 0380-syslinux-Support-vesa-menu.c32.patch +Patch0381: 0381-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch +Patch0382: 0382-grub-core-loader-i386-xen.c-Initialized-initrd_ctx-s.patch +Patch0383: 0383-do-not-emit-cryptomount-without-crypto-UUID.patch +Patch0384: 0384-core-avoid-NULL-derefrence-in-grub_divmod64s.patch +Patch0385: 0385-docs-grub.texi-Fix-spelling-of-cbfstool.patch +Patch0386: 0386-core-partmap-rename-sun-to-avoid-clash-with-predefin.patch +Patch0387: 0387-getroot-include-sys-mkdev.h-for-makedev.patch +Patch0388: 0388-Remove-V-in-grub-mkrescue.c.patch +Patch0389: 0389-grub-mkconfig-use-pkgdatadir-in-scripts.patch +Patch0390: 0390-zfs-com.delphix-hole_birth-feature-support.patch +Patch0391: 0391-zfs-com.delphix-embedded_data-feature-support.patch +Patch0392: 0392-zfs-add-missing-NULL-check-and-fix-incorrect-buffer-.patch +Patch0393: 0393-efinet-memory-leak-on-module-removal.patch +Patch0394: 0394-efinet-cannot-free-const-char-pointer.patch +Patch0395: 0395-Revert-efinet-memory-leak-on-module-removal.patch +Patch0396: 0396-arm64-Export-useful-functions-from-linux.c.patch +Patch0397: 0397-fdt.h-Add-grub_fdt_set_reg64-macro.patch +Patch0398: 0398-Revert-parts-accidentally-committed-2-commits-ago.patch +Patch0399: 0399-linux.c-Ensure-that-initrd-is-page-aligned.patch +Patch0400: 0400-grub-mkrescue-Recognize-output-as-an-alias-of-output.patch +Patch0401: 0401-grub-install-common-Increase-buf-size-to-8192-as-mod.patch +Patch0402: 0402-i386-relocator-Remove-unused-extern-grub_relocator64.patch +Patch0403: 0403-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch +Patch0404: 0404-convert-to-not-from-CPU-byte-order-in-DNS-receive-fu.patch +Patch0405: 0405-efidisk-move-device-path-helpers-in-core-for-efinet.patch +Patch0406: 0406-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch +Patch0407: 0407-efinet-open-Simple-Network-Protocol-exclusively.patch +Patch0408: 0408-util-grub-mkrescue-Fix-compilation.patch +Patch0409: 0409-Add-asm-tests-to-tarball.patch +Patch0410: 0410-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch +Patch0411: 0411-xfs-Fix-termination-loop-for-directory-iteration.patch +Patch0412: 0412-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch +Patch0413: 0413-remove-extra-newlines-in-grub_util_-strings.patch +Patch0414: 0414-zfs-fix-integer-truncation-in-zap_lookup.patch +Patch0415: 0415-hostdisk-fix-crash-with-NULL-device.map.patch +Patch0416: 0416-bootp-ignore-gateway_ip-relay-field.patch +Patch0417: 0417-cb_timestamps.c-Add-new-time-stamp-descriptions.patch +Patch0418: 0418-disk-ahci-Use-defines-GRUB_ATA_STATUS_BUSY-and-GRUB_.patch +Patch0419: 0419-multiboot1-never-place-modules-in-low-memory.patch +Patch0420: 0420-zfs-extensible_dataset-and-large_blocks-feature-supp.patch +Patch0421: 0421-Correct-spelling-of-scheduled.patch +Patch0422: 0422-Clarify-use-of-superusers-variable-and-menu-entry-ac.patch +Patch0423: 0423-disk-ahci.c-Add-port-number-to-port-debug-messages.patch +Patch0424: 0424-arm64-setjmp-Add-missing-license-macro.patch +Patch0425: 0425-configure.ac-clean-up-arm64-soft-float-handling.patch +Patch0426: 0426-multiboot_header_tag_module_align-fix-to-confirm-mul.patch +Patch0427: 0427-xfs-Add-helpers-for-inode-size.patch +Patch0428: 0428-xfs-V5-filesystem-format-support.patch +Patch0429: 0429-NEWS-XFS-v5-support.patch +Patch0430: 0430-disk-ahci.c-Use-defines-GRUB_AHCI_HBA_PORT_CMD_SPIN_.patch +Patch0431: 0431-Fix-exit-to-EFI-firmware.patch +Patch0432: 0432-Migrate-PPC-from-Yaboot-to-Grub2.patch +Patch0433: 0433-Add-fw_path-variable-revised.patch +Patch0434: 0434-Add-support-for-linuxefi.patch +Patch0435: 0435-Use-linuxefi-and-initrdefi-where-appropriate.patch +Patch0436: 0436-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +Patch0437: 0437-Pass-x-hex-hex-straight-through-unmolested.patch +Patch0438: 0438-Fix-crash-on-http.patch +Patch0439: 0439-IBM-client-architecture-CAS-reboot-support.patch +Patch0440: 0440-Add-vlan-tag-support.patch +Patch0441: 0441-Add-X-option-to-printf-functions.patch +Patch0442: 0442-DHCP-client-ID-and-UUID-options-added.patch +Patch0443: 0443-Search-for-specific-config-file-for-netboot.patch +Patch0444: 0444-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +Patch0445: 0445-Move-bash-completion-script-922997.patch +Patch0446: 0446-for-ppc-reset-console-display-attr-when-clear-screen.patch +Patch0447: 0447-Don-t-write-messages-to-the-screen.patch +Patch0448: 0448-Don-t-print-GNU-GRUB-header.patch +Patch0449: 0449-Don-t-add-to-highlighted-row.patch +Patch0450: 0450-Message-string-cleanups.patch +Patch0451: 0451-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +Patch0452: 0452-Use-the-correct-indentation-for-the-term-help-text.patch +Patch0453: 0453-Indent-menu-entries.patch +Patch0454: 0454-Fix-margins.patch +Patch0455: 0455-Add-support-for-UEFI-operating-systems-returned-by-o.patch +Patch0456: 0456-Disable-GRUB-video-support-for-IBM-power-machines.patch +Patch0457: 0457-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +Patch0458: 0458-Use-linux16-when-appropriate-880840.patch +Patch0459: 0459-Enable-pager-by-default.-985860.patch +Patch0460: 0460-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +Patch0461: 0461-Don-t-say-GNU-Linux-in-generated-menus.patch +Patch0462: 0462-Don-t-draw-a-border-around-the-menu.patch +Patch0463: 0463-Use-the-standard-margin-for-the-timeout-string.patch +Patch0464: 0464-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch +Patch0465: 0465-Add-.eh_frame-to-list-of-relocations-stripped.patch +Patch0466: 0466-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +Patch0467: 0467-Don-t-print-during-fdt-loading-method.patch +Patch0468: 0468-Honor-a-symlink-when-generating-configuration-by-gru.patch +Patch0469: 0469-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +Patch0470: 0470-Don-t-require-a-password-to-boot-entries-generated-b.patch +Patch0471: 0471-Don-t-emit-Booting-.-message.patch +Patch0472: 0472-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch +Patch0473: 0473-May-as-well-try-it.patch +Patch0474: 0474-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +Patch0475: 0475-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +Patch0476: 0476-trim-arp-packets-with-abnormal-size.patch +Patch0477: 0477-Fix-convert-function-to-support-NVMe-devices.patch +Patch0478: 0478-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +Patch0479: 0479-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +Patch0480: 0480-Use-the-default-device-tree-from-the-grub-default-fi.patch +Patch0481: 0481-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0482: 0482-Reduce-timer-event-frequency-by-10.patch +Patch0483: 0483-always-return-error-to-UEFI.patch +Patch0484: 0484-Add-powerpc-little-endian-ppc64le-flags.patch +Patch0485: 0485-Files-reorganization-and-include-some-libgcc-fuction.patch +Patch0486: 0486-Suport-for-bi-endianess-in-elf-file.patch +Patch0487: 0487-Add-grub_util_readlink.patch +Patch0488: 0488-Make-editenv-chase-symlinks-including-those-across-d.patch +Patch0489: 0489-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +Patch0490: 0490-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch +Patch0491: 0491-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +Patch0492: 0492-Add-GRUB_DISABLE_UUID.patch +Patch0493: 0493-Allow-fallback-to-include-entries-by-title-not-just-.patch +Patch0494: 0494-Load-arm-with-SB-enabled.patch +Patch0495: 0495-Try-prefix-if-fw_path-doesn-t-work.patch +Patch0496: 0496-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch +Patch0497: 0497-Update-to-minilzo-2.08.patch +Patch0498: 0498-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +Patch0499: 0499-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch +Patch0500: 0500-Make-.gitignore-suck-way-less.patch +Patch0501: 0501-Update-info-with-grub.cfg-netboot-selection-order-11.patch +Patch0502: 0502-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +Patch0503: 0503-Add-friendly-grub2-password-config-tool-985962.patch +Patch0504: 0504-Make-exit-take-a-return-code.patch +Patch0505: 0505-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch +Patch0506: 0506-Fix-race-in-EFI-validation.patch BuildRequires: flex bison binutils python BuildRequires: ncurses-devel xz-devel bzip2-devel