--- /dev/null
- 9569221816a2a1a832be106440375a612e0121b7
- 9569221816a2a1a832be106440375a612e0121b7
- 59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
- 59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
- grub2_2.02+dfsg1.orig.tar.xz
- 7a7b17051b32cef09493aaf21ac54f680ddc37b1
- 6217988
+# see git-dpm(1) from git-dpm package
++54d1130537fbc5438d078e646a00b47a75384061
++54d1130537fbc5438d078e646a00b47a75384061
++00f6db2247174373b0d850bd3853ce59d6825ba9
++00f6db2247174373b0d850bd3853ce59d6825ba9
++grub2_2.04~rc1.orig.tar.xz
++045e0fd93453c361da2a0a62ebe806c866cafd81
++6422420
++signature:96b561119efe0b2ecb76edb1ec33fff6bc2d746c:228:grub2_2.04~rc1.orig.tar.xz.asc
--- /dev/null
- grub2 (2.02+dfsg1-19) UNRELEASED; urgency=medium
++grub2 (2.04~rc1-1) UNRELEASED; urgency=medium
+
++ * New upstream release candidate.
++ - getroot: Save/restore CWD more reliably on Unix (closes: #918700).
++ * Rename patches to use "-" as a separator rather than "_" (except when
++ referring to a file, function, or command containing a "_").
+ * Fix format of debian/copyright.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 14 May 2019 10:18:27 +0100
+
+grub2 (2.02+dfsg1-18) unstable; urgency=medium
+
+ * Apply patches from Alexander Graf to fix grub-efi-arm crash (closes:
+ #927269):
+ - arm: Move trampolines into code section
+ - arm: Align section alignment with manual relocation offset code
+ * Make grub2-common Breaks+Replaces grub-cloud-amd64 (<< 0.0.4) to work
+ around that package shipping colliding configuration file names in
+ stretch-backports (closes: #919915).
+ * Apply patch from Peter Jones to forbid the "devicetree" command when
+ Secure Boot is enabled (closes: #927888).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 04 May 2019 22:58:32 +0100
+
+grub2 (2.02+dfsg1-17) unstable; urgency=medium
+
+ * Make grub-efi-*-bin recommend efibootmgr. We don't actually use it any
+ more, but it's helpful for debugging.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 15 Apr 2019 18:38:30 +0100
+
+grub2 (2.02+dfsg1-16) unstable; urgency=medium
+
+ * Fix -Wcast-align diagnostics on ARM.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 23 Mar 2019 23:28:17 +0000
+
+grub2 (2.02+dfsg1-15) unstable; urgency=medium
+
+ * Build-depend on libefiboot-dev and libefivar-dev, for EFI variable
+ storage changes.
+ * Drop now-unnecessary dependencies on efibootmgr.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 23 Mar 2019 09:56:35 +0000
+
+grub2 (2.02+dfsg1-14) unstable; urgency=medium
+
+ * Make signed packages depend on a matching version of grub-common, in an
+ attempt to prevent incorrect testing migrations (closes: #924814).
+ * Cherry-pick from upstream:
+ - xfs: Accept filesystem with sparse inodes (closes: #924760).
+ * Minimise writes to EFI variable storage (closes: #891434).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 23 Mar 2019 09:47:10 +0000
+
+grub2 (2.02+dfsg1-13) unstable; urgency=medium
+
+ * Add regexp module to signed UEFI images.
+ * debian/signing-template.json.in: Use new extendable format.
+
+ [ Debconf translations ]
+ * [nb] Norwegian Bokmål (Petter Reinholdtsen; closes: #924326).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 14 Mar 2019 10:33:24 +0000
+
+grub2 (2.02+dfsg1-12) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Remove code to migrate grub-pc/install_devices to persistent device
+ names under /dev/disk/by-id/. This migration happened in
+ 1.98+20100702-1, which was in squeeze (four stable releases ago), so we
+ no longer need to carry around this complex code.
+ * Preserve previous answer to grub-pc/install_devices if we have to ask
+ grub-pc/install_devices_disks_changed and the user chooses not to
+ install to any devices, so that we can recover from temporary bugs that
+ cause /dev/disk/by-id/ paths to change (closes: #919029).
+ * debian/signing-template.json.in: Add trusted_certs key (empty, since
+ GRUB has no hardcoded list of trusted certificates).
+ * util: Detect more I/O errors (closes: #922741).
+
+ [ Leif Lindholm ]
+ * arm64/efi: Fix grub_efi_get_ram_base().
+
+ [ Steve McIntyre ]
+ * grub-install: Check for arm-efi as a default target (closes: #922104).
+
+ [ James Clarke ]
+ * osdep/freebsd: Fix partition calculation for EBR entries (closes:
+ #923253).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 01 Mar 2019 12:34:45 +0000
+
+grub2 (2.02+dfsg1-11) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Apply patches from Alexander Graf to set arm64-efi code offset to
+ EFI_PAGE_SIZE (closes: #919012, LP: #1812317).
+ * Upgrade to debhelper v10.
+ * Set Rules-Requires-Root: no.
+ * Add help and ls modules to signed UEFI images (closes: #919955).
+ * Fix application of answers from dpkg-reconfigure to /etc/default/grub
+ (based loosely on a patch by Steve Langasek, for which thanks; closes:
+ #921702).
+
+ [ Steve McIntyre ]
+ * Make grub-efi-amd64-signed recommend shim-signed (closes: #919067).
+
+ [ Jeroen Dekkers ]
+ * Initialize keyboard in at_keyboard module init if keyboard is ready
+ (closes: #741464).
+
+ [ John Paul Adrian Glaubitz ]
+ * Include a.out header in assembly of sparc64 boot loader (closes:
+ #921249).
+
+ [ Hervé Werner ]
+ * Fix setup on Secure Boot systems where cryptodisk is in use (closes:
+ #917117).
+
+ [ Debconf translations ]
+ * [de] German (Helge Kreutzmann and Holger Wansing; closes: #921018).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 10 Feb 2019 18:53:41 +0000
+
+grub2 (2.02+dfsg1-10) unstable; urgency=medium
+
+ * Apply patch from Heinrich Schuchardt (mentioned in #916695 though
+ unrelated):
+ - grub-core/loader/efi/fdt.c: do not copy random memory
+ * Add luks modules to signed UEFI images (pointed out by Alex Griffin and
+ Hervé Werner; closes: #908162, LP: #1565950).
+ * Keep track of the previous version of /usr/share/grub/default/grub and
+ set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
+ can't figure this out for itself since we apply debconf-based
+ customisations on top of the template configuration file (closes:
+ #812574, LP: #564853).
+ * Backport Xen PVH guest support from upstream (closes: #776450). Thanks
+ to Hans van Kranenburg for testing.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 11 Jan 2019 15:24:20 +0000
+
+grub2 (2.02+dfsg1-9) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Sync Maintainer/Uploaders in debian/signing-template/control.in with the
+ main packaging.
+ * Tell reportbug to submit bug reports against unsigned packages rather
+ than generated signed packages.
+ * Update Homepage, debian/copyright Source, and debian/watch to use HTTPS.
+ * Move bash completions to /usr/share/bash-completion/completions/grub and
+ add appropriate symlinks (closes: #912852).
+ * Build with GCC 8 (closes: #915735).
+
+ [ Leif Lindholm ]
+ * Apply patch series (mostly) from upstream to switch the arm loader over
+ to use the arm64 loader code and improve arm/arm64 initrd handling
+ (closes: #907596, #909420, #915091).
+
+ [ Matthew Garrett ]
+ * Don't enforce Shim signature validation if Secure Boot is disabled.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 07 Dec 2018 10:38:37 +0000
+
+grub2 (2.02+dfsg1-8) unstable; urgency=medium
+
+ * Revise grub-<platform>-bin and grub-<platform> package descriptions to
+ try to explain better how they fit together and which one should be used
+ (based loosely on work by Justin B Rye, for which thanks; closes:
+ #630224).
+ * Skip flaky grub_cmd_set_date test (closes: #906470).
+ * Work around bug in obsolete init-select package: add Conflicts/Replaces
+ from grub-common, and take over /etc/default/grub.d/init-select.cfg with
+ a no-op stub (thanks to Guillem Jover for the suggestion; closes:
+ #863801).
+ * Build-depend on dosfstools and mtools on non-Linux variants of
+ i386/amd64/arm64 as well, to match debian/rules.
+ * Cherry-pick from upstream:
+ - i386/linux: Add support for ext_lfb_base (LP: #1785033).
+ * Don't source /etc/default/grub.d/*.cfg in config maintainer scripts,
+ since otherwise we incorrectly merge settings from there into
+ /etc/default/grub (closes: #872637, LP: #1797894).
+ * Add xfs module to signed UEFI images (closes: #911147, LP: #1652822).
+ * Cope with / being on a ZFS root dataset (closes: #886178).
+
+ [ Debconf translations ]
+ * [sv] Swedish (Martin Bagge and Anders Jonsson; closes: #851964).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 29 Oct 2018 13:02:08 +0000
+
+grub2 (2.02+dfsg1-7) unstable; urgency=medium
+
+ * Move kernel maintainer script snippets into grub2-common (thanks,
+ Bastian Blank; closes: #910959).
+ * Add cryptodisk and gcry_* modules to signed UEFI images (closes:
+ #908162, LP: #1565950).
+ * Remove dh_builddeb override to use xz compression; this has been the
+ default since dpkg 1.17.0.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 27 Oct 2018 13:06:32 +0100
+
+grub2 (2.02+dfsg1-6) unstable; urgency=medium
+
+ * Only build *-signed packages on their native architecture for now, since
+ otherwise we end up with clashing source packages (closes: #906596).
+ * Refer to source packages in Built-Using, not binary packages (closes:
+ #907483).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 28 Aug 2018 16:17:21 +0100
+
+grub2 (2.02+dfsg1-5) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Change Maintainer to pkg-grub-devel@alioth-lists.debian.net, following
+ Alioth lists migration.
+ * Backport from upstream:
+ - Use grub-file to figure out whether multiboot2 should be used for
+ Xen.gz (closes: #898947).
+ - x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32.
+ * Fix some test failures:
+ - Disable sercon in SeaBIOS.
+ - Fix qemu options for UHCI test.
+
+ [ Philipp Hahn ]
+ * Disallow unsigned kernels if UEFI Secure Boot is enabled
+ (patch by Linn Crosetto <linn@hpe.com>)
+ * Add patch to fix lockdown mode
+ (patch by Luca Boccassi <bluca@debian.org>)
+ * Build monolithic EFI binaries for signing (closes: #851994)
+ * Add template for signing monolithic EFI binaries
+ * debian/build-efi-images: Use correct EFI vendor (closes: #769172)
+
+ [ Luca Boccassi ]
+ * template packages: install changelog and copyright
+ * Override lintian error about template rules file
+ * Add XB-Efi-Vendor metadata to efi-*-bin packages
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 30 Jul 2018 13:33:23 +0100
+
+grub2 (2.02+dfsg1-4) unstable; urgency=medium
+
+ * Adjust restore_mkdevicemap.patch to fix format-overflow warning with GCC
+ 7 (the overflow was in fact impossible in practice, but GCC couldn't
+ prove that).
+ * Cherry-pick upstream patch to disable -Wformat-truncation on GCC >= 7 in
+ printf_unit_test.
+ * Build with GCC 7 (closes: #892397).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 01 Apr 2018 10:49:48 +0100
+
+grub2 (2.02+dfsg1-3) unstable; urgency=medium
+
+ * sparc64: Don't use devspec to determine the OBP path (closes: #854568).
+ * ieee1275: Fix crash in of_path_of_nvme when of_path is empty (closes:
+ #891773).
+ * sparc64: Limit nvme of_path_of_nvme to just SPARC.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 02 Mar 2018 12:53:34 +0000
+
+grub2 (2.02+dfsg1-2) unstable; urgency=medium
+
+ * Build-depend on libparted-dev on powerpc and ppc64 (closes: #891070).
+ * Add support for modern sparc64 hardware (thanks, Eric Snowberg via John
+ Paul Adrian Glaubitz; closes: #854568).
+ * Build without PIE on sparc and sparc64 (thanks, John Paul Adrian
+ Glaubitz; closes: #891733).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 28 Feb 2018 12:03:49 +0000
+
+grub2 (2.02+dfsg1-1) unstable; urgency=medium
+
+ * Switch to tracking debian/grub-extras/ using "git subtree" rather than
+ submodules.
+ * Update debian/README.source for Salsa migration.
+ * Use pkg-config to find FreeType (closes: #887721).
+ * Change various binary packages' priorities to optional, since "Priority:
+ extra" is now deprecated.
+ * Repack upstream tarball without grub-core/lib/libgcrypt*/cipher/crc.c,
+ and provide a replacement implementation backported from more recent
+ versions of libgcrypt (closes: #745409).
+ * Cherry-pick upstream patch to avoid -Werror=unused-value build failure
+ (closes: #890431).
+ * Handle the case where udevadm exists but is non-functional, as warned
+ about by Lintian 2.5.75.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 17 Feb 2018 21:28:41 +0000
+
+grub2 (2.02-3) unstable; urgency=medium
+
+ * Use current location for upstream signing key
+ (debian/upstream/signing-key.asc).
+ * Update upstream signing key to a non-expired version.
+ * Install bootinfo.txt and grub.chrp in grub-ieee1275-bin for ppc64, and
+ install and use prep-bootdev on powerpc and ppc64 as well as ppc64el
+ (thanks, John Paul Adrian Glaubitz; closes: #881730).
+ * Cherry-pick upstream patch to change the default TSC calibration method
+ to pmtimer on EFI systems (closes: #883193).
+ * Move VCS to salsa.debian.org.
+ * Consistently create /boot/grub in the postinst of all grub-<platform>
+ packages (closes: #884883).
+
+ [ Debconf translations ]
+ * [sq] Albanian (Silva Arapi; closes: #874497).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 10 Feb 2018 03:00:30 +0000
+
+grub2 (2.02-2) unstable; urgency=medium
+
+ * Comment out debian/watch lines for betas and pre-releases for now.
+ * Cherry-pick upstream patch to allow mounting ext2/3/4 file systems that
+ have the 'encrypt' feature enabled (closes: #840204).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 06 Jul 2017 18:02:02 +0100
+
+grub2 (2.02-1) unstable; urgency=medium
+
+ * New upstream release.
+ - xen: Fix wrong register in relocator (closes: #799480).
+ * Resolve symlinks for supported init paths as well as for /sbin/init
+ (thanks, Felipe Sateler; closes: #842315).
+
+ [ Debconf translations ]
+ * [sr] Serbian (Karolina Kalic; closes: #691288).
+ * [sr@latin] Serbian Latin (Karolina Kalic; closes: #691289).
+ * [pt] Portuguese (Rui Branco - DebianPT; closes: #864171).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 23 Jun 2017 13:47:39 +0100
+
+grub2 (2.02~beta3-5) unstable; urgency=medium
+
+ [ Steve McIntyre ]
+ * Make grub-install check for errors from efibootmgr (closes: #853234).
+ There are probably still underlying issues in other similar reported
+ bugs, but they're more effectively tracked elsewhere (e.g. efibootmgr)
+ at this point (closes: #756253, #852513).
+
+ [ Debconf translations ]
+ * [ug] Uyghur (Abduqadir Abliz).
+ * [es] Spanish (Manuel "Venturi" Porras Peralta; closes: #852977).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 11 Feb 2017 15:09:19 +0000
+
+grub2 (2.02~beta3-4) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Drop build-dependency on libxen-dev, unnecessary now that upstream has
+ taken a copy of the necessary public headers.
+ * Ensure that build-efi-images has a suitable PATH for running mkfs.msdos
+ (thanks, Luca Boccassi; closes: #852001).
+
+ [ dann frazier ]
+ * Add grub2/update_nvram template to allow users to disable NVRAM
+ updates during package upgrades (LP: #1642298).
+
+ [ Debconf translations ]
+ * [ro] Romanian (Andrei POPESCU).
+ * [kk] Kazakh (Baurzhan Muftakhidinov).
+ * [lt] Lithuanian (Rimas Kudelis).
+ * [th] Thai (Theppitak Karoonboonyanan).
+ * [sl] Slovenian (Vanja Cvelbar).
+ * [pl] Polish (Łukasz Dulny).
+ * [eu] Basque (Iñaki Larrañaga Murgoitio; closes: #851981).
+ * [bg] Bulgarian (Damyan Ivanov; closes: #852024).
+ * [de] German (Helge Kreutzmann; closes: #852027).
+ * [vi] Vietnamese (Trần Ngọc Quân).
+ * [ko] Korean (Changwoo Ryu; closes: #852061).
+ * [ru] Russian (Yuri Kozlov; closes: #852064).
+ * [tr] Turkish (Mert Dirik).
+ * [it] Italian (Luca Monducci; closes: #852073).
+ * [cs] Czech (Miroslav Kure; closes: #852189).
+ * [be] Belarusian (Viktar Siarheichyk; closes: #852286).
+ * [eo] Esperanto (Felipe Castro).
+ * [uk] Ukrainian (Yatsenko Alexandr).
+ * [pt_BR] Brazilian Portuguese (Adriano Rafael Gomes; closes: #852325).
+ * [hr] Croatian (Tomislav Krznar).
+ * [ca] Catalan (Innocent De Marchi; closes: #852331).
+ * [fr] French (Baptiste Jammet; closes: #852341).
+ * [da] Danish (Joe Hansen; closes: #852349).
+ * [nl] Dutch (Frans Spiesschaert; closes: #852403).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 24 Jan 2017 11:39:45 +0000
+
+grub2 (2.02~beta3-3) unstable; urgency=medium
+
+ [ Chad MILLER ]
+ * Signal to zpool that it should emit full names of constituent devices
+ (closes: #824974, LP: #1527727).
+
+ [ Mathieu Trudel-Lapierre ]
+ * Fix support for IPv6 PXE booting under UEFI (LP: #1229458):
+ - misc-fix-invalid-char-strtol.patch: fix strto*l methods invalid chars.
+ - net_read_bracketed_ipv6_addr.patch: read bracketed IPv6 addresses.
+ - bootp_new_net_bootp6_command.patch: add new bootp6 commands.
+ - efinet_uefi_ipv6_pxe_support.patch: teach efinet to allow bootp6.
+ - bootp_process_dhcpack_http_boot.patch: process DHCPACK, support HTTP.
+ - efinet_set_network_from_uefi_devpath.patch: configure network from the
+ devpath provided by the UEFI firmware.
+ - efinet_set_dns_from_uefi_proto.patch: set DNS nameservers and search
+ domains from the UEFI protocol.
+ * debian/patches/install_signed.patch: update patch for the new names of
+ the EFI binaries from shim.
+ * debian/control: Breaks shim (<< 0.9+1474479173.6c180c6-0ubuntu1~) due to
+ the renamed binaries in the new shim.
+ * debian/postinst.in: call on to update-secureboot-policy on configure to
+ make sure users can disable shim validation if necessary.
+ * debian/build-efi-images: add loopback and squash4 modules to the signed
+ EFI images.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 01 Nov 2016 11:10:52 +0000
+
+grub2 (2.02~beta3-2) unstable; urgency=medium
+
+ * debian/watch: Switch URL scheme to HTTP.
+ * Fix operator precedence in GRUB_DEVICE UUID tests (closes: #841680,
+ #841741).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 31 Oct 2016 10:24:02 +0000
+
+grub2 (2.02~beta3-1) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * New upstream beta release.
+ * syslinux_test: Fix out-of-tree build handling.
+ * Drop "grub-shell: Pass -no-pad to xorriso when building floppy images".
+ The floppy images built by grub-shell are no longer over the floppy
+ limit, and this patch now itself causes fddboot_test failures.
+ * Build with GCC 6 (closes: #835964).
+ * linuxefi.patch: Adjust for libgcc removal.
+ * Apply openSUSE patch to accept empty modules for now so that Xen builds
+ work.
+
+ [ Debconf translations ]
+ * [ja] Japanese (Takuma Yamada; closes: #815203, #817084).
+
+ [ Martin Pitt ]
+ * debian/grub-common.init: Don't source /lib/init/vars.sh, we don't depend
+ on initscripts (and don't want to). There is no reason why we would not
+ use the LSB log_action_msg in non-verbose (default) mode, most other
+ packages use it unconditionally (closes: #824875, LP: #1584134).
+
+ [ Steve Beattie ]
+ * debian/rules: Disable PIE builds for GRUB modules (closes: #837493).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 16 Oct 2016 10:46:46 +0100
+
+grub2 (2.02~beta2-36) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Use HTTPS for Vcs-Git URL.
+ * Add zfs, zfscrypt, and zfsinfo to signed EFI images (LP: #1542358).
+
+ [ Martin Pitt ]
+ * debian/postinst.in, debian/kernel/zz-update-grub: Call
+ systemd-detect-virt (which works under any init system, despite the
+ name) instead of the Ubuntu specific running-in-container wrapper.
+ (LP: #1539016)
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 05 Feb 2016 15:41:05 +0000
+
+grub2 (2.02~beta2-35) unstable; urgency=medium
+
+ * Apply the arm64 -mpc-relative-literal-loads workaround in configure
+ rather than in debian/rules, to cope with toolchains that don't have the
+ relevant patch applied.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 22 Jan 2016 11:02:10 +0000
+
+grub2 (2.02~beta2-34) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Remove duplicate Replaces on grub-ieee1275 (<< 2.00-4) from
+ grub2-common.
+ * Refer to /usr/share/common-licenses/GPL-3 rather than
+ /usr/share/common-licenses/GPL.
+ * Cherry-pick upstream patches to add more ACPI opcodes to acpihalt
+ (closes: #766853, LP: #1530648).
+ * Drop build-dependency on libusb-dev, since it was currently unused in
+ any case; also explicitly configure with --disable-grub-emu-usb to avoid
+ possible future ambiguity (closes: #810421).
+ * Use dpkg-maintscript-helper to convert directories to symlinks in
+ various upgrade cases, in place of hand-coded equivalents.
+ * Change versioned Conflicts from grub-common and grub2-common into Breaks
+ or Breaks+Replaces as appropriate.
+ * Remove pragmas related to -Wunreachable-code (closes: #812047).
+ * Temporarily work around arm64 build failure with gcc-5 >= 5.3.1-4 using
+ -mpc-relative-literal-loads.
+ * Backport various ZFS improvements from trunk (closes: #706415, #772797;
+ LP: #1451476, #1530457).
+
+ [ Didier Roche ]
+ * Use new plymouth theme path to set grub theme configuration.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 22 Jan 2016 10:03:00 +0000
+
+grub2 (2.02~beta2-33) unstable; urgency=high
+
+ [ Mathieu Trudel-Lapierre ]
+ * Cherry-picks to better handle TFTP timeouts on some arches: (LP: #1521612)
+ - (7b386b7) efidisk: move device path helpers in core for efinet
+ - (c52ae40) efinet: skip virtual IP devices when enumerating cards
+ - (f348aee) efinet: enable hardware filters when opening interface
+
+ [ Lee Trager ]
+ * Add raid5rec and raid6rec to signed EFI images (closes: #807385).
+
+ [ Colin Watson ]
+ * CVE-2015-8370: Fix authentication bypass via backspace integer underflow
+ (closes: #808122).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 16 Dec 2015 09:46:22 +0000
+
+grub2 (2.02~beta2-32) unstable; urgency=medium
+
+ [ Mathieu Trudel-Lapierre ]
+ * Cherry-pick patch to add SAS disks to the device list from the ofdisk
+ module. (LP: #1517586)
+
+ [ dann frazier ]
+ * Cherry-pick patch to open Simple Network Protocol exclusively.
+ (LP: #1508893)
+
+ [ Linn Crosetto ]
+ * Install arm64 signed images if UEFI Secure Boot is enabled (closes:
+ #806178).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 25 Nov 2015 16:07:21 +0000
+
+grub2 (2.02~beta2-31) unstable; urgency=medium
+
+ * Cherry-pick upstream patch to fix XFS alignment treatment.
+ * Cherry-pick upstream patch to fix XFS handling of symlink with
+ crc-enabled filesystem.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 05 Nov 2015 15:08:03 +0000
+
+grub2 (2.02~beta2-30) unstable; urgency=medium
+
+ [ dann frazier ]
+ * arm64/setjmp: Add missing license macro. (LP: #1459871)
+
+ [ Colin Watson ]
+ * Cherry-pick upstream patches for XFS v5 support (closes: #772565).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 05 Nov 2015 12:30:27 +0000
+
+grub2 (2.02~beta2-29) unstable; urgency=medium
+
+ [ Linn Crosetto ]
+ * Clean up docs, mpi, and other files (closes: #798607).
+
+ [ dann frazier ]
+ * progress: avoid NULL dereference for net files. (LP: #1459872)
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 13 Oct 2015 23:36:46 +0100
+
+grub2 (2.02~beta2-28) unstable; urgency=medium
+
+ * Reduce the CFLAGS -O3 default on Ubuntu ppc64el to -O2; it introduces
+ various -Werror failures and isn't worth it here.
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 06 Sep 2015 01:25:56 +0100
+
+grub2 (2.02~beta2-27) unstable; urgency=medium
+
+ [ Felix Zielcke ]
+ * Remove Robert Millan from Uploaders with his permission. Thanks for
+ all the work he did for GRUB 2!
+ * Stop forcing gcc-4.9 for building.
+ * Update to Policy 3.9.6.
+ * Update the Browser URL for our git repository.
+ * Use dpkg-buildflags at least for the host binaries.
+ * Simplify Build-Depends.
+
+ [ Colin Watson ]
+ * Go back to forcing a particular compiler version, but this time gcc-5.
+ The reason for this is that new compiler versions often make slight
+ changes to the size of compiled code which break delicate parts of GRUB,
+ and we want to make sure that we test newer versions before switching to
+ them.
+ * Make builds that are not limited to architecture-dependent packages
+ (i.e. dpkg-buildpackage -b) work on non-x86 architectures (closes:
+ #744954).
+
+ [ Mathieu Trudel-Lapierre ]
+ * debian/build-efi-images: Look for grub.cfg in $cmdpath too in
+ gcdx64.efi, to simplify embedded scenarios: putting a grub.cfg snippet
+ that loads the right "real" grub.cfg can be useful. (LP: #1468111)
+ * debian/patches/uefi_firmware_setup.patch: Take into account that the
+ UEFI variable OsIndicationsSupported is a bit field, and as such should
+ be compared as hex values in 30_uefi-firmware.in. (LP: #1456911)
+ * Update quick boot logic to handle abstractions for which there is no
+ write support. (LP: #1274320)
+
+ [ dann frazier ]
+ * d/p/arm64-set-correct-length-of-device-path-end-entry.patch: Fixes
+ booting arm64 kernels on certain UEFI implementations. (LP: #1476882)
+
+ [ Debconf translations ]
+ * [lv] Latvian (Rudolfs Mazurs; closes: #777648).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 04 Sep 2015 12:35:59 +0100
+
+grub2 (2.02~beta2-26) unstable; urgency=medium
+
+ [ William Grant ]
+ * Fix linuxefi module to be included on x86_64-efi rather than amd64-efi.
+ amd64-efi isn't a thing. (LP: #1464959)
+
+ [ Steven Chamberlain ]
+ * Recognise Xen xbd and KVM virtio disks on kFreeBSD (closes: #786621).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 14 Jun 2015 10:02:19 +0100
+
+grub2 (2.02~beta2-25) unstable; urgency=medium
+
+ * Build-depend on dosfstools and mtools on arm64 as well as amd64.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 12 Jun 2015 12:29:19 +0100
+
+grub2 (2.02~beta2-24) unstable; urgency=medium
+
+ [ Mathieu Trudel-Lapierre ]
+ * Fix handling of --disk-module option (cherry-pick from fa335308).
+ (Closes: #746596, LP: #1309735)
+ * Fix double-free of LV names for mdraid (cherry-pick from fc535b32).
+ (LP: #1330963)
+
+ [ dann frazier ]
+ * Build image tarball on arm64
+ * Only include linuxefi module in images for amd64. This module doesn't
+ exist on other platforms like arm64, where GRUB chainloads to the kernel
+ EFI stub.
+
+ [ Paulo Flabiano Smorigo ]
+ * powerpc: Add a flag to avoid unnecessary optimizations (like vsx)
+ (LP: #1459706).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 11 Jun 2015 17:08:09 +0100
+
+grub2 (2.02~beta2-23) unstable; urgency=medium
+
+ [ Debconf translations ]
+ * [da] Danish (Joe Dalton; closes: #781333).
+
+ [ Felix Zielcke ]
+ * Run the tests with LC_MESSAGES=C.UTF-8. Some tests fail with non
+ english locale. (Closes: #782580)
+
+ [ Mathieu Trudel-Lapierre ]
+ * Backport from upstream:
+ - arp, icmp: Fix handling in case of oversized or invalid packets.
+ (LP: #1428005)
+
+ [ Robie Basak ]
+ * Change the default GRUB_RECORDFAIL_TIMEOUT to 30, so interactive users
+ still get the opporunity to intervene after a real boot failure, but
+ headless users will not end up stuck after boot failures that were
+ really power failures (closes: #782552, LP: #1443735).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 14 May 2015 16:18:33 +0100
+
+grub2 (2.02~beta2-22) unstable; urgency=medium
+
+ * Make grub-common's Suggests on grub-emu architecture-specific, to
+ quieten debcheck.
+ * Remove unnecessary feature test macros from hostfs, to fix building with
+ glibc 2.20.
+ * Backport from upstream:
+ - Fix UEFI boot failure with some firmware that returns incorrect paths
+ (closes: #735960).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 23 Mar 2015 15:30:15 +0000
+
+grub2 (2.02~beta2-21) unstable; urgency=medium
+
+ [ Mathieu Trudel-Lapierre ]
+ * Fix overlap check in check_blocklists for load_env (backported patch
+ from upstream commit 1f6af2a9; LP: #1311247).
+
+ [ Steve McIntyre ]
+ * Add support for running a 64-bit Linux kernel on a 32-bit EFI (closes:
+ #775202).
+
+ [ Colin Watson ]
+ * Use mtmsr rather than mtmsrd in ppc64el-disable-vsx.patch, since the
+ "VSX Available" bit is in the lower half of the MSR anyway, and mtmsrd
+ faults on 32-bit systems (closes: #776400).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 27 Jan 2015 20:37:04 +0000
+
+grub2 (2.02~beta2-20) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Generate alternative init entries in advanced menu (closes: #757298,
+ #773173).
+ * When configuring grub-pc, copy unicode.pf2 to /boot/grub/ even if
+ /boot/grub/grub.cfg does not exist yet; this matches the behaviour of
+ grub-efi-* (thanks, Luca Capello; closes: #617196).
+
+ [ Debconf translations ]
+ * [fi] Finnish (Timo Jyrinki; closes: #774060).
+ * [mr] Marathi (sampada nakhare; closes: #773901).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 03 Jan 2015 12:39:52 +0000
+
+grub2 (2.02~beta2-19) unstable; urgency=medium
+
+ [ Steve McIntyre ]
+ * Handle case insensitivity of VFAT filesystem on /boot/EFI when installing
+ extra cpoy of grub-efi to the removable media path
+ /boot/efi/EFI/BOOT/BOOT$ARCH.EFI (Closes: #773092)
+ * Make the force_efi_extra_removable debconf prompt only show up when
+ configuring grub-*efi*. Closes: #773004
+
+ [ Ian Campbell ]
+ * Improvements to English wording of new debconf template from Justin B Rye.
+ * Add debian/README.source.
+
+ [ Debconf translations ]
+ * [eu] Basque (Iñaki Larrañaga Murgoitio, Closes: #772946)
+ * [be] Belarusian (Viktar Siarheichyk, Closes: #773054)
+ * [pt_BR] Brazilian Portuguese (Adriano Rafael Gomes, Closes: #773682)
+ * [bg] Bulgarian (Damyan Ivanov, Closes: #772878)
+ * [cs] Czech (Miroslav Kure, Closes: #772924)
+ * [nl] Dutch (Frans Spiesschaert, Closes: 773637)
+ * [eo] Esperanto (Felipe Castro, Closes: #773096)
+ * [fi] Finnish (Timo Jyrinki, Closes: #772921)
+ * [fr] French (Christian PERRIER, Closes: #772771)
+ * [de] German (Martin Eberhard Schauer, Closes: #773664)
+ * [el] Greek (Panagiotis Georgakopoulos, Closes: #773068)
+ * [he] Hebrew (Omer Zak, Closes: #773377)
+ * [is] Icelandic (Sveinn í Felli, Closes: #772922)
+ * [it] Italian (Luca Monducci, Closes: #773553)
+ * [kk] Kazakh (Baurzhan Muftakhidinov, Closes: #772916)
+ * [lt] Lithuanian (Rimas Kudelis, Closes: #773060)
+ * [pl] Polish (Łukasz Dulny, Closes: #772930)
+ * [ro] Romanian (Andrei POPESCU, Closes: #773349)
+ * [ru] Russian (Yuri Kozlov, Closes: #773211)
+ * [sl] Slovenian (Vanja Cvelbar, Closes: #773508)
+ * [es] Spanish (Manuel "Venturi" Porras Peralta, Closes: #773222)
+ * [sv] Swedish (Martin Bagge & Anders Jonsson, Closes: 773208)
+ * [th] Thai (Theppitak Karoonboonyanan, Closes: #773160)
+ * [zh_TW] Traditional Chinese (Vincent W. Chen, Closes: #773418)
+ * [tr] Turkish (Mert Dirik, Closes: #773666)
+
+ -- Ian Campbell <ijc@debian.org> Mon, 22 Dec 2014 11:55:33 +0000
+
+grub2 (2.02~beta2-18) unstable; urgency=medium
+
+ [ Steve McIntyre ]
+ * Add support for forcing an extra copy of grub-efi to the removable
+ media path /boot/efi/EFI/BOOT/BOOT$ARCH.EFI (#767037)
+
+ [ Ian Campbell ]
+ * Add myself to Uploaders.
+
+ -- Ian Campbell <ijc@debian.org> Mon, 08 Dec 2014 08:38:38 +0000
+
+grub2 (2.02~beta2-17) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Fix up some pointer-to-integer casts in linuxefi so that it can build on
+ i386-efi.
+ * Backport from upstream:
+ - Fix typo (gettext_print instead of gettext_printf) (LP: #1390766).
+
+ [ Ian Campbell ]
+ * Correct syntax error in grub-xen-host bootstrap configuration file.
+ * Log failure when grub-install fails in postinst, rather than failing the
+ entire postinst. (Closes: #770412)
+ * Arrange to insmod xzio and lzopio when booting a kernel as a Xen guest.
+ (Closes: #755256)
+
+ -- Ian Campbell <ijc@debian.org> Sun, 30 Nov 2014 17:15:21 +0000
+
+grub2 (2.02~beta2-16) unstable; urgency=medium
+
+ [ Ian Campbell ]
+ * Provide prebuilt grub-xen binaries for host use in a new grub-xen-host
+ package.
+ * Build/Install binaries into /boot/xen when installing grub-xen.
+
+ -- Ian Campbell <ijc@debian.org> Thu, 06 Nov 2014 13:32:01 +0000
+
+grub2 (2.02~beta2-15) unstable; urgency=medium
+
+ * Disable nvram installation again on chrp_ibm machines that are emulated
+ by qemu; that doesn't have nvram devices so the nvram utility inevitably
+ fails.
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 15 Oct 2014 21:34:02 +0100
+
+grub2 (2.02~beta2-14) unstable; urgency=medium
+
+ * On architectures without a real GRUB port, just build the utilities.
+ This makes tools such as grub-probe and grub-fstest available
+ everywhere, and makes grub-mount available on all Linux and kFreeBSD
+ architectures.
+ * Remove .MIPS.abiflags section from images (thanks, Jurica Stanojkovic,
+ although I used a slightly simpler approach; closes: #762307).
+ * Include a text attribute reset in the clear command for ppc
+ (LP: #1295255).
+ * Disable VSX instruction on powerpc startup to fix booting on ppc64el.
+ * Stop adding a CHRP note on chrp_ibm machines, since that apparently
+ breaks PowerVM and isn't needed on other machine types as far as we can
+ tell (LP: #1334793).
+ * Refactor flicker-free-boot configuration in debian/rules to reduce
+ duplication.
+ * Disable flicker-free-boot on Ubuntu ppc64el for now, as it isn't needed
+ there and causes too many problems (LP: #1338471).
+ * Use nvram rather than nvsetenv on chrp_ibm machines, since that tool is
+ better-supported and copes with such things as nvram being missing in
+ qemu.
+ * Remove brace-expansion from the postrm, and switch the preinst and
+ postrm to /bin/sh (closes: #762940).
+ * On ppc64el, look for a PReP partition and install the core image to the
+ first one if found. For now this is done by borrowing prep-bootdev.c
+ from grub-installer, incurring a dependency on libparted.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 26 Sep 2014 18:05:15 +0100
+
+grub2 (2.02~beta2-13) unstable; urgency=medium
+
+ * Drop gcc-4.9-multilib build-dependency on ppc64el again.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 19 Sep 2014 20:30:31 +0100
+
+grub2 (2.02~beta2-12) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Point Vcs-* fields back at master.
+ * Support grub-emu on x32 (closes: #760428).
+ * Adjust packaging for x32:
+ - Build-depend on cpio on x32 as well.
+ - Make grub-efi-ia32-bin and grub-efi-amd64-bin depend on efibootmgr on
+ any Linux architecture for which they are built (in practice, adding
+ x32).
+ - Build grub-mount-udeb on x32 as well.
+ - Add Lintian binary-from-other-architecture overrides where
+ appropriate.
+ * Apply patches from Paulo Flabiano Smorigo to allow building a 32-bit
+ big-endian loader on ppc64el using -m32 -mbig-endian, replacing the
+ cross-compiler hack.
+
+ [ Ian Campbell ]
+ * Add dependency on efibootmgr to grub-efi-{arm,arm64}-bin.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 19 Sep 2014 15:19:26 +0100
+
+grub2 (2.02~beta2-11) unstable; urgency=medium
+
+ * Force grub-pc/mixed_legacy_and_grub2 to be reshown, rather than failing
+ when it was already seen (closes: #749571).
+ * Build with GCC 4.9 (closes: #748003).
+ * Build for sparc64 (closes: #753784).
+ * Fix an infinite loop in grub-mkconfig when kernel paths contain regex
+ metacharacters. Thanks to Heimo Stranner for the report.
+ * On upgrade, if we find that one of the install devices no longer exists,
+ ask the debconf question at priority critical rather than high.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 24 Jul 2014 09:11:31 +0100
+
+grub2 (2.02~beta2-10) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Add the true module to the signed image, since 05_debian_theme uses it.
+ Thanks to Dimitri John Ledkov for the report.
+ * Limit test suite parallelisation to 1; the test suite seems to have some
+ isolation problems at higher levels at the moment (closes: #746856).
+ * Simplify override_dh_install a bit.
+ * Backport patches from upstream to make the network stack more responsive
+ on busy networks (LP: #1314134).
+
+ [ Dimitri John Ledkov ]
+ * Add support for nvme device in grub-mkdevicemap (closes: #746396,
+ LP: #1275162).
+
+ [ Debconf translations ]
+ * Korean (Changwoo Ryu, closes: #745559).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 08 May 2014 11:13:48 +0100
+
+grub2 (2.02~beta2-9) unstable; urgency=medium
+
+ * Backport from upstream:
+ - Tolerate devices with no filesystem UUID returned by os-prober
+ (LP: #1287436).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 10 Apr 2014 17:34:44 +0100
+
+grub2 (2.02~beta2-8) unstable; urgency=medium
+
+ [ Colin Watson ]
+ * Backport from upstream:
+ - ieee1275: check for IBM pseries emulated machine.
+ - Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig
+ (closes: #735935).
+ - btrfs: fix get_root key comparison failures due to endianness.
+ * Build-depend on automake (>= 1.10.1) to ensure that it meets configure's
+ requirements (LP: #1299041).
+ * When installing an image for use with UEFI Secure Boot, generate a
+ load.cfg even if there are no device abstractions in use (LP: #1298399).
+
+ [ Jon Severinsson ]
+ * Add Tanglu support, as in Debian except:
+ - Enable splash screen by default (as Ubuntu)
+ - Enable quiet and quick boot (as Ubuntu)
+ - Enable the grub-common init script (as Ubuntu)
+ - Enable dynamic gfxpayload (as Ubuntu)
+ - Enable vt handover (as Ubuntu)
+ - Use monochromatic theme by default (as Ubuntu)
+ - Use Tanglu GRUB wallpaper by default.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 31 Mar 2014 16:30:37 +0100
+
+grub2 (2.02~beta2-7) experimental; urgency=medium
+
+ * Fix shift-held-down test not to clear other modifier key states
+ (LP: #843804).
+ * Explicitly pass an appropriate --target to grub-install in the postinst
+ (suggested by Jordan Uggla).
+ * Backport from upstream:
+ - Use bootaa64.efi instead of bootaarch64.efi on arm64 to comply with
+ EFI specification. Also use grubaa64.efi for consistency.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 10 Mar 2014 13:39:33 +0000
+
+grub2 (2.02~beta2-6) experimental; urgency=medium
+
+ * Install bootinfo.txt and grub.chrp into grub-ieee1275-bin on powerpc and
+ ppc64el.
+ * Port yaboot logic to improve installation for various powerpc machine
+ types.
+ * Improve parsing of /etc/default/grub.d/*.cfg in C utilities
+ (LP: #1273694).
+ * Run grub-install on install or upgrade on grub-ieee1275/ppc64el.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 28 Jan 2014 23:50:55 +0000
+
+grub2 (2.02~beta2-5) experimental; urgency=medium
+
+ * Add a number of EFI debugging commands to the signed image (lsefi,
+ lsefimmap, lsefisystab, lssal).
+ * Add gfxterm_background to the signed image so that background_image
+ works in UEFI Secure Boot mode. Thanks to syscon-hh for the report.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 27 Jan 2014 10:03:00 +0000
+
+grub2 (2.02~beta2-4) experimental; urgency=medium
+
+ * Remove redundant build-dependencies on autoconf and automake, covered by
+ dh-autoreconf.
+ * In --enable-quick-boot mode, restore previous behaviour of using a
+ hidden timeout if GRUB_HIDDEN_TIMEOUT=0 (thanks to Sebastien Bacher for
+ the report).
+ * Disable cpio test on kFreeBSD again for now; it fails within cpio itself
+ with "field width not sufficient for storing rdev minor".
+ * Copy shim.efi.signed to the correct path in UEFI Secure Boot mode.
+ Thanks to syscon-hh for the report.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 20 Jan 2014 15:53:36 +0000
+
+grub2 (2.02~beta2-3) experimental; urgency=medium
+
+ * Pass VERBOSE=1 when running tests so that Automake will print test logs
+ on failure.
+ * Adjust Vcs-* fields to indicate the experimental branch.
+ * Build-depend on cpio on architectures where we run the test suite, for
+ tests/cpio_test.in.
+ * Ignore EPERM when modifying kern.geom.debugflags on FreeBSD, fixing
+ tests.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 17 Jan 2014 10:50:40 +0000
+
+grub2 (2.02~beta2-2) experimental; urgency=medium
+
+ * Convert patch handling to git-dpm.
+ * Add bi-endian support to ELF parser (Tomohiro B Berry).
+ * Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
+ to appease "gcc -Werror=missing-prototypes".
+ * Cherry-pick from upstream:
+ - Change grub-macbless' manual page section to 8.
+ * Install grub-glue-efi, grub-macbless, grub-render-label, and
+ grub-syslinux2cfg.
+ * grub-shell: Pass -no-pad to xorriso when building floppy images.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 16 Jan 2014 15:18:04 +0000
+
+grub2 (2.02~beta2-1) experimental; urgency=low
+
+ * New upstream beta release.
+ * Drop qemu-utils build-dependency; the test suite no longer uses
+ qemu-img.
+ * Build grub-common, grub2-common, grub-themes-starfield, and grub-mount
+ on ARM and ARM64 architectures.
+ * Install grub-mkrescue in grub-common on all architectures.
+ * Make grub-efi-ia32, grub-efi-amd64, and grub-efi-ia64 conflict with
+ elilo.
+ * Adjust the postinst of grub-efi-ia64, grub-efi-arm, and grub-efi-arm64
+ to keep the EFI System Partition up to date with grub-install after it
+ has been run once, like grub-efi-ia32 and grub-efi-amd64 already do.
+ * Regularise indentation of "recordfail" in /etc/grub.d/10_linux.
+ * Add alpha.gnu.org to debian/watch, for pre-releases.
+ * Add OpenPGP signature checking configuration to watch file.
+ * Drop mkconfig_skip_dmcrypt.patch; it breaks GRUB_ENABLE_CRYPTODISK=y,
+ which is a better fix for the original problem (closes: #732245).
+ * Fix mismerge of mkconfig_loopback.patch.
+ * Build for ppc64el, using a powerpc cross-compiler at least for now.
+ * Don't run gettext_strings_test; this test is mainly useful as an
+ upstream maintenance check.
+ * Silence warning if /usr/share/locale-langpack does not exist (closes:
+ #732595).
+ * Remove debian/grub-common.preinst, superseded by .maintscript files.
+ * Install grub-file in grub-common.
+ * Fix crash due to pointer confusion in grub-mkdevicemap, introduced while
+ converting away from nested functions in 2.00+20131208-1.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 26 Dec 2013 00:52:47 +0000
+
+grub2 (2.00+20131208-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ - Skip issuing cursor on/off sequences on Macs (closes: #683068).
+ - Move grub-mknetdir to /usr/bin (closes: #688799).
+ - Apply program name transformations at build-time rather than at
+ run-time (closes: #696465).
+ - Add info documentation for grub-mount (closes: #666427).
+ - Clean up dangling references to grub-setup (LP: #1082045).
+ - Avoid installing to sectors matching the signature of an Acer
+ registration utility with several sightings in the wild (LP: #987022).
+ - Document the need for GRUB_DEFAULT=saved in grub-set-default(8)
+ (LP: #1102925).
+ - Fix missing PVs if they don't contain an "interesting" LV (probably
+ closes: #650724, #707613).
+ - Reimplement grub-reboot to not depend on saved_entry (closes: #707695,
+ LP: #704406).
+ - Fix Ctrl-u handling to copy the killed characters to the kill buffer
+ as UCS4 stored as grub_uint32_t rather than as 8-bit characters stored
+ as char (closes: #710076).
+ - Fix inconsistent use of GRUB_CRYPTODISK_ENABLE and
+ GRUB_ENABLE_CRYPTODISK (LP: #1232237).
+ - Support GRUB_DISABLE_SUBMENU configuration, and document submenu usage
+ in grub-reboot(8) (closes: #690538).
+ - Don't decompress initrd when booting with Xen (closes: #700197).
+ - Document how to delete the whole environment block (closes: #726265).
+ - Revamp hidden timeout handling by adding a new timeout_style
+ environment variable and a corresponding GRUB_TIMEOUT_STYLE
+ configuration key for grub-mkconfig. This controls hidden-timeout
+ handling more simply than the previous arrangements, and pressing any
+ hotkeys associated with menu entries during the hidden timeout will
+ now boot the corresponding menu entry immediately (LP: #1178618). As
+ part of merging this, radically simplify the mess that
+ quick_boot.patch had made of /etc/grub.d/30_os-prober; if it finds
+ other OSes it can now just set timeout_style=menu and make sure the
+ timeout is non-zero.
+ - On Linux, read partition start offsets from sysfs if possible
+ (LP: #1237519).
+ - New ports to arm-uboot, arm-efi, arm64-efi, i386-xen, and x86_64-xen.
+ * Add grub-uboot*, grub-efi-arm*, and grub-xen* binary packages.
+ * Ignore functional test failures for now as they are broken.
+ * Move working directories around (build/<package> -> obj/<package>,
+ build/stamps -> debian/stamps) so that "debian/rules build" still works
+ after working directories have been created.
+ * Drop "grub-mkrescue --diet" option; never merged upstream and only
+ matters for floppies. Please let me know if you were using this.
+ Explicitly use -no-pad to build grub-rescue-floppy.img, which has an
+ equivalent effect on size.
+ * Break lupin-support (<< 0.55) due to the rewrite of grub-install in C.
+ * Remove build-dependency on autogen, no longer needed.
+ * Compress GRUB files on grub-rescue-floppy.img using xz.
+ * Build-depend on wamerican, newly required by the test suite.
+ * Run tests with LC_CTYPE=C.UTF-8, so that grub-fs-tester can handle UTF-8
+ data correctly.
+ * Update debian/legacy/update-grub to the version from grub 0.97-67.
+ * Silence error message on initial installation when /etc/default/grub
+ does not yet exist.
+ * Add GRUB_RECOVERY_TITLE option, to allow the controversial "recovery
+ mode" text to be customised (LP: #1240360).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 09 Dec 2013 00:21:45 +0000
+
+grub2 (2.00-20) unstable; urgency=low
+
+ * Backport from upstream:
+ - Sort gnumach kernels in version order (closes: #725451).
+ * Move packaging to git, following upstream. Adjust Vcs-* fields.
+ * Remove obsolete DM-Upload-Allowed field.
+ * Merge (completely!) from Ubuntu:
+ - Handle probing striped DM-RAID devices (thanks, Robert Collins;
+ LP: #803658).
+ - Unconditionally create grub.cfg on our EFI boot partition in Secure
+ Boot mode; GRUB always needs some configuration in this case to find
+ /boot/grub, since we can't modify the signed image at install time
+ (Steve Langasek, LP: #1236625).
+ - If MokManager is present on the host system, copy it onto the EFI boot
+ partition for use (Steve Langasek).
+ - Adjust UEFI installation to cope with Kubuntu setting GRUB_DISTRIBUTOR
+ (LP: #1242417).
+ - If building for Ubuntu:
+ + Bypass menu unless other OSes are installed or Shift is pressed.
+ + Show the boot menu if the previous boot failed.
+ + Set GRUB_GFXPAYLOAD_LINUX=keep unless it's known to be unsupported
+ on the current hardware.
+ + Set vt.handoff=7 for smooth handoff to kernel graphical mode.
+ + In recovery mode, add nomodeset to the Linux kernel arguments, and
+ remove the 'set gfxpayload=keep' command.
+ + Set default timeout to 10 seconds.
+ + Enable hidden timeout support by default.
+ - Migrate timeout settings from menu.lst.
+ - Probe FusionIO devices (LP: #1237519).
+ * Make grub.cfg world-unreadable if even hashed passwords are in use
+ (closes: #632598).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 14 Nov 2013 10:49:31 +0000
+
+grub2 (2.00-19) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Merge from Ubuntu:
+ - debian/build-efi-images: Where possible, make use of the device path
+ derived from the EFI Loaded Image Protocol to compute the prefix
+ (LP: #1097570).
+ - debian/build-efi-images: Add a netboot image target to our set of
+ prebuilt EFI images (thanks, Steve Langasek).
+ * Backport from upstream:
+ - Handle partitions on non-512B EFI disks (LP: #1065281).
+
+ [ Phillip Susi ]
+ * restore_mkdevicemap.patch: Fix dmraid uuid check to look for "DMRAID-"
+ anywhere instead of only at the start, since kpartx prefixes it with
+ "partN-" (LP: #1183915).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 18 Sep 2013 17:18:27 +0100
+
+grub2 (2.00-18) unstable; urgency=low
+
+ * Add gettext module to signed UEFI images (LP: #1104627).
+ * Put the preprocessor definition for quiet-boot in the right place so
+ that it actually takes effect.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 26 Aug 2013 17:23:09 +0100
+
+grub2 (2.00-17) unstable; urgency=low
+
+ * Really include patches to reduce visual clutter in normal mode when
+ building for Ubuntu.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 15 Aug 2013 09:58:59 +0100
+
+grub2 (2.00-16) unstable; urgency=low
+
+ * Make reportbug script file robust against su authentication failures and
+ missing LVM commands.
+ * Backport from upstream:
+ - Move @itemize after @subsection to satisfy texinfo-5.1.
+ - grub-mkconfig: Fix detection of Emacs autosave files.
+ - Fix spurious failure on Xen partition devices without disk devices
+ (closes: #708614).
+ * Merge from Ubuntu:
+ - Treat Kubuntu as an alias for Ubuntu in GRUB_DISTRIBUTOR (Harald
+ Sitter).
+ - Make any EFI system boot into the shim (if installed) even if
+ SecureBoot is disabled (Stéphane Graber).
+ - Allow Shift to interrupt 'sleep --interruptible'.
+ - If building for Ubuntu:
+ + Reduce visual clutter in normal mode.
+ + Remove verbose messages printed before reading configuration.
+ + Suppress kernel/initrd progress messages, except in recovery mode.
+ + Suppress "GRUB loading" message unless Shift is held down.
+ - Skip Windows os-prober entries on Wubi systems.
+ * Consolidate debian/rules logic for when to build signed images.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 15 Aug 2013 08:35:53 +0100
+
+grub2 (2.00-15) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Install reportbug presubj and script files in all binary packages.
+ * Make grub-yeeloong.postinst explicitly install with
+ --target=mipsel-loongson (closes: #708204).
+ * Make grub-script-check fail on scripts containing no commands (closes:
+ #713886).
+ * Make the description of grub-firmware-qemu a little more generic, rather
+ than assuming that bochsbios provides qemu's default BIOS image (closes:
+ #714277).
+ * Don't assume that the presence of /etc/default/grub or
+ /etc/default/grub.d/*.cfg means that any particular item is set in it
+ (LP: #1199731).
+
+ [ Debconf translations ]
+ * Hungarian (Dr. Nagy Elemér Károly).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 13 Jul 2013 11:04:15 +0100
+
+grub2 (2.00-14) unstable; urgency=low
+
+ * Merge from Ubuntu:
+ - Don't call update-grub in the zz-update-grub kernel hook if
+ /boot/grub/grub.cfg doesn't exist.
+ - acpihalt: expand parser to handle SSDTs and some more opcodes. Fixes
+ test suite hang with current seabios.
+ * Remove kernel-specific grub.d conffiles that were dropped from packages
+ built for all but their corresponding kernel type in 1.96+20090307-1
+ (closes: #703539).
+ * Look for grub-bios-setup in /usr/lib/grub/i386-pc/ as well (closes:
+ #705636).
+ * Merge 1.99-27.1 (thanks, Steve McIntyre):
+ - Add entries for Windows Boot Manager found via UEFI in os-prober
+ (closes: #698914).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 09 May 2013 00:14:55 +0100
+
+grub2 (2.00-13) experimental; urgency=low
+
+ * Backport from upstream:
+ - Fix booting FreeBSD >= 9.1 amd64 kernels (closes: #699002).
+ * Merge from Ubuntu:
+ - Stop using the /usr/share/images/desktop-base/desktop-grub.png
+ alternative as the fallback background if GRUB_DISTRIBUTOR is
+ "Ubuntu".
+ - source_grub2.py: Use attach_default_grub from apport's hookutils.
+ - Output a menu entry for firmware setup on UEFI FastBoot systems.
+ - Set a monochromatic theme and an appropriate background for Ubuntu.
+ - Remove "GNU/Linux" from default distributor string for Ubuntu.
+ - Apply Ubuntu GRUB Legacy changes to legacy update-grub script.
+ - Apply patch from Fedora to add a "linuxefi" loader which boots kernels
+ with EFI handover patches, avoiding ExitBootServices.
+ - Temporarily make linuxefi refuse to validate kernels in the absence of
+ a shim, until we get some other details worked out.
+ - Automatically call linuxefi from linux if secure boot is enabled and
+ the kernel is signed, to hand over to the kernel without calling
+ ExitBootServices. Otherwise, linux will fall through to previous
+ code, call ExitBootServices itself, and boot the kernel normally.
+ - Generate configuration for signed UEFI kernels if available.
+ - On Ubuntu amd64, add a raw-uefi custom upload tarball for signing.
+ - Install signed images if available and UEFI Secure Boot is enabled.
+ - Add "splash" to default boot options on Ubuntu.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 01 Feb 2013 15:44:25 +0000
+
+grub2 (2.00-12) experimental; urgency=low
+
+ * Silence output from running-in-container.
+ * Also skip update-grub when running in a container (LP: #1060404).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 24 Jan 2013 23:21:48 +0000
+
+grub2 (2.00-11) experimental; urgency=low
+
+ [ Adam Conrad ]
+ * debian/{postinst,config}.in: Don't fail if /etc/default/grub.d
+ configuration snippets exist, but /etc/default/grub does not.
+
+ [ Colin Watson ]
+ * Merge wheezy branch up to 1.99-27, fixing overzealous removal of
+ load_video call when GRUB_GFXPAYLOAD_LINUX is empty (closes: #661789).
+ * Merge from Ubuntu:
+ - If the postinst is running in a container, skip grub-install and all
+ its associated questions (LP: #1060404).
+ - Fix backslash-escaping in merge_debconf_into_conf (LP: #448413). Note
+ that this differs slightly from the fix in Ubuntu, which corrected
+ behaviour when amending an existing configuration item but
+ accidentally over-escaped when adding a new one.
+ - Replace "single" with "recovery" when friendly-recovery is installed
+ (LP: #575469).
+ - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
+ Ubuntu's backport of the grub-doc split (LP: #493968).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 21 Jan 2013 10:49:00 +0000
+
+grub2 (2.00-10) experimental; urgency=low
+
+ * Support parallel builds.
+ * Remove /boot/grub/unicode.pf2 on purge of grub-efi-{amd64,i386} (closes:
+ #697183).
+ * Build with GCC 4.7.
+ * Merge from Ubuntu:
+ - Don't permit loading modules on UEFI Secure Boot (since in such a
+ setup the GRUB core image must be signed but it has no provision for
+ verifying module signatures).
+ - Read /etc/default/grub.d/*.cfg after /etc/default/grub (LP: #901600).
+ - Blacklist 1440x900x32 from VBE preferred mode handling until a better
+ solution is available (LP: #701111).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 03 Jan 2013 09:38:25 +0000
+
+grub2 (2.00-9) experimental; urgency=low
+
+ * Ensure /boot/grub exists before copying files to it for EFI installs
+ (closes: #696962).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 29 Dec 2012 23:44:51 +0000
+
+grub2 (2.00-8) experimental; urgency=low
+
+ * debian/apport/source_grub2.py:
+ - Use context managers to avoid (harmless) file descriptor leaks.
+ - Set a file encoding, per PEP 0263.
+ * Drop grub-ieee1275-bin's dependency on bc in favour of powerpc-ibm-utils
+ (>= 1.2.12-1) (cf. #625728).
+ * Move powerpc-ibm-utils and powerpc-utils dependencies from
+ grub-ieee1275-bin to grub-ieee1275 (closes: #693400).
+ * Merge from Ubuntu:
+ - Ignore symlink traversal failures in grub-mount readdir
+ (LP: #1051306).
+ - Fix incorrect initrd minimum address calculation (LP: #1055686).
+ - Avoid assuming that gets is declared.
+ * Copy unicode.pf2 to /boot/grub/ for EFI installs so that it is more
+ likely to be readable by GRUB (closes: #661789).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 28 Dec 2012 17:34:32 +0000
+
+grub2 (2.00-7) experimental; urgency=low
+
+ * Backport from upstream:
+ - Fix stderr leakage from grub-probe in is_path_readable_by_grub.
+ - Fix tftp endianness problem.
+ * Merge from Ubuntu:
+ - Prefer translations from language packs (LP: #537998). (No-op for
+ Debian, but harmless.)
+ - Avoid getting confused by inaccessible loop device backing paths
+ (LP: #938724).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 26 Sep 2012 16:05:07 +0100
+
+grub2 (2.00-6) experimental; urgency=low
+
+ [ Colin Watson ]
+ * Adjust package descriptions to talk about update-grub, not update-grub2.
+ * Backport from upstream:
+ - Fix grub-emu build on FreeBSD.
+ * Revert gcc-4.6-multilib build-dependency change from 2.00-1, since
+ kfreebsd-i386 and hurd-i386 don't have gcc-4.6-multilib. Instead, make
+ sure to only install efiemu32.o and efiemu64.o on (linux-)i386,
+ kopensolaris-i386, and any-amd64.
+ * Manually expand @PACKAGE@ symbols in grub-efi.postinst (closes:
+ #688725), grub-linuxbios.postinst (closes: #688726), and grub2.postinst
+ (closes: #688724).
+
+ [ Debconf translations ]
+ * Lithuanian (Rimas Kudelis). Closes: #675628
+ * Galician (Jorge Barreiro). Closes: #677389
+ * Welsh (Daffyd Tomos).
+ * Greek (galaxico). Closes: #685201
+ * Romanian (Andrei POPESCU). Closes: #685477
+ * Finnish (Timo Jyrinki).
+
+ [ Cyril Brulebois ]
+ * Use xz compression for all binaries to save up some space on CD images
+ (closes: #688773).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 25 Sep 2012 22:47:03 +0100
+
+grub2 (2.00-5) experimental; urgency=low
+
+ * Backport from upstream:
+ - Remove extra layer of escaping from grub_probe.
+ - Add efifwsetup module to reboot into firmware setup menu.
+ - Revert incorrect off-by-one fix when embedding in MBR (LP: #1051154).
+ * Switch watch file to point to ftp.gnu.org.
+ * Build-depend on liblzma-dev, enabling 'grub-mkimage -C xz'.
+ * Adjust /etc/grub.d/30_os-prober to detect Ubuntu's use of "recovery"
+ rather than "single".
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 19 Sep 2012 08:52:27 +0100
+
+grub2 (2.00-4) experimental; urgency=low
+
+ * Fix platform postinsts to handle new core.img location.
+ * Only fix up powerpc key repeat on IEEE1275 machines. Fixes powerpc-emu
+ compilation.
+ * Move grub-install to grub2-common, since it's now common across
+ platforms but clashes with grub-legacy.
+ * Move grub-mknetdir to grub-common, since it's now common across
+ platforms.
+ * Make grub-install fall back to i386-pc if booted using EFI but the
+ relevant *-efi target is not available (because only grub-pc is
+ installed).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 14 Sep 2012 13:38:37 +0100
+
+grub2 (2.00-3) experimental; urgency=low
+
+ * Use dh-autoreconf.
+ * Bail out if trying to run grub-mkconfig during upgrade to 2.00 (e.g.
+ while configuring a kernel image), since the old /etc/grub.d/00_header
+ conffile breaks until such time as grub-common is configured.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 13 Sep 2012 17:07:18 +0100
+
+grub2 (2.00-2) experimental; urgency=low
+
+ * Add -Wno-error=unused-result to HOST_CFLAGS for the moment, since at
+ least grub-core/lib/crypto.c fails to compile on Ubuntu otherwise.
+ * Update default/grub.md5sum to include Ubuntu maverick's default md5sum.
+ * Autogenerate packaging files for grub-emu, in order that its postinst
+ does not contain unexpanded @PACKAGE@ symbols.
+ * Only try to install efiemu*.o into grub-emu on *-i386.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 08 Sep 2012 10:32:33 +0100
+
+grub2 (2.00-1) experimental; urgency=low
+
+ [ Jordi Mallach, Colin Watson ]
+ * New upstream release.
+ - Add LUKS and GELI encrypted disk support (closes: #463107).
+ - Lazy scanning to avoid accessing devices which aren't really used.
+ This avoids boot delay due to slow device scanning (closes: #549905,
+ #550015, #550083, #564252, #595059, #632408).
+ - Don't override more informative errors when loading kernel/initrd
+ (closes: #551630).
+ - Support 4K-sector NTFS (closes: #567728).
+ - Unify grub-mkrescue interface on powerpc with that on other
+ architectures (closes: #570119).
+ - Fix infinite recursion in gettext when translation fails (closes:
+ #611537, #612454, #616487, #619618, #626853, #643608).
+ - Add more missing quotes to grub-mkconfig (closes: #612417).
+ - Import gnulib change to fix argp_help segfault with help filter
+ (closes: #612692).
+ - Support %1$d syntax in grub_printf (closes: #630647).
+ - Use write-combining MTRR to speed up video with buggy BIOSes (closes:
+ #630926).
+ - Remove multiboot header from PXE images to avoid confusing ipxe
+ (closes: #635877).
+ - Fix crash when attempting to install to a non-BIOS disk (closes:
+ #637208).
+ - Fix handling of grub-mkrescue --xorriso= option (closes: #646788).
+ - Use umask rather than chmod to create grub.cfg.new to avoid insecure
+ grub.cfg (closes: #654599).
+ - Improve font installation logic (closes: #654645).
+ - Add grub-probe info documentation (closes: #666031).
+ - Don't crash on canonicalize_file_name failure in grub-probe (closes:
+ #677211).
+
+ [ Colin Watson ]
+ * Adjust debian/watch to point to xz-compressed tarballs.
+ * debian/grub.d/05_debian_theme: Source grub-mkconfig_lib from
+ /usr/share/grub, not the /usr/lib/grub compatibility link.
+ * Convert to source format 3.0 (quilt). Developers, note that patches are
+ stored applied in bzr; you may want to 'quilt pop -a' / 'quilt push -a'
+ around merges.
+ * Remove pointless debian/grub-mount-udeb.install.hurd-i386;
+ grub-mount-udeb is not built on the Hurd.
+ * Refactor debian/grub-common.install.hurd-i386 into .in files so that it
+ imposes less of a maintenance burden.
+ * Restore grub-mkdevicemap for now. While it's kind of a mess, requiring
+ lots of OS-specific code to iterate over all possible devices, we use it
+ in a number of scripts to discover devices and reimplementing those in
+ terms of something else would be very complicated.
+ * Add grub-efi-ia64-bin and grub-efi-ia64 packages. These are currently
+ experimental, and grub-efi-ia64 does not automatically run grub-install.
+ * Build-depend on gcc-4.6-multilib on kfreebsd-i386 and hurd-i386 as well
+ as the other i386 architectures, since we need it to build efiemu32.o
+ and efiemu64.o.
+ * Add per-platform *-dbg packages containing files needed to use GRUB's
+ GDB stub. These are relatively large and thus worth splitting out.
+ * Build-depend on ttf-dejavu-core for the starfield theme.
+ * Add a grub-theme-starfield package containing the starfield theme.
+ * Backport from upstream:
+ - Don't decrease efi_mmap_size (LP: #1046429).
+ * grub-common Suggests: console-setup for grub-kbdcomp (closes: #686815).
+ * Silence error messages when translations are unavailable.
+ * Don't pass *.module to dpkg-shlibdeps, avoiding lots of build-time
+ warnings.
+ * Move transitional package to Section: oldlibs.
+ * Acknowledge NMU (closes: #676609).
+
+ [ Debconf translations ]
+ * Lithuanian (Rimas Kudelis). Closes: #675628
+ * Galician (Jorge Barreiro). Closes: #677389
+ * Welsh (Daffyd Tomos).
+ * Greek (galaxico). Closes: #685201
+ * Romanian (Andrei POPESCU). Closes: #685477
+ * Finnish (Timo Jyrinki).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 06 Sep 2012 19:04:21 +0100
+
+grub2 (1.99-27.1) unstable; urgency=medium
+
+ * NMU
+ * Add entries for Windows Boot Manager found via UEFI in
+ os-prober. Closes: #698914 before the Wheezy release.
+
+ -- Steve McIntyre <93sam@debian.org> Fri, 26 Apr 2013 23:53:34 +0100
+
+grub2 (1.99-27) unstable; urgency=low
+
+ * Amend gfxpayload_keep_default.patch to no longer remove the call to
+ load_video when GRUB_GFXPAYLOAD_LINUX is empty (closes: #661789).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 20 Jan 2013 16:37:52 +0000
+
+grub2 (1.99-26) unstable; urgency=low
+
+ * Remove /boot/grub/unicode.pf2 on purge of grub-efi-{amd64,i386} (closes:
+ #697183).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 02 Jan 2013 11:54:50 +0000
+
+grub2 (1.99-25) unstable; urgency=low
+
+ * Ensure /boot/grub exists before copying files to it for EFI installs
+ (closes: #696962).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 29 Dec 2012 23:45:01 +0000
+
+grub2 (1.99-24) unstable; urgency=low
+
+ * Acknowledge NMU with thanks.
+ * Fix namespace of EFI boot failure patch file added in NMU.
+ * Copy unicode.pf2 to /boot/grub/ for EFI installs so that it is more
+ likely to be readable by GRUB (closes: #661789).
+ * Fix infinite recursion in gettext when translation fails (closes:
+ #611537, #612454, #616487, #619618, #626853, #643608).
+ * Fix grammar in Finnish translation (closes: #687681).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 28 Dec 2012 13:01:38 +0000
+
+grub2 (1.99-23.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Apply Ubuntu patch fixing some EFI boot failures (closes: #687320)
+ - Thanks to Colin Watson.
+
+ -- Michael Gilbert <mgilbert@debian.org> Sun, 14 Oct 2012 04:09:51 -0400
+
+grub2 (1.99-23) unstable; urgency=low
+
+ [ Debconf translations ]
+ * Lithuanian (Rimas Kudelis). Closes: #675628
+ * Galician (Jorge Barreiro). Closes: #677389
+ * Welsh (Daffyd Tomos).
+ * Greek (galaxico). Closes: #685201
+ * Romanian (Andrei POPESCU). Closes: #685477
+ * Finnish (Timo Jyrinki).
+
+ [ Cyril Brulebois ]
+ * Use xz compression for all binaries to save up some space on CD images
+ (closes: #688773).
+
+ [ Colin Watson ]
+ * Autogenerate packaging files for grub-emu (closes: #688727), in order
+ that its postinst does not contain unexpanded @PACKAGE@ symbols.
+ * Manually expand @PACKAGE@ symbols in grub-efi.postinst (closes:
+ #688725), grub-linuxbios.postinst (closes: #688726), and grub2.postinst
+ (closes: #688724).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 25 Sep 2012 18:59:18 +0100
+
+grub2 (1.99-22.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Apply upstream patches for hurd-i386:
+ - Test inode number (Closes: #634799).
+ - Disable zfs code on GNU/Hurd (Closes: #670069).
+ - Add userland partition support (Closes: #670186).
+ * Fix packages build without libfuse (Closes: #670189).
+
+ -- Samuel Thibault <sthibault@debian.org> Fri, 08 Jun 2012 01:19:00 +0200
+
+grub2 (1.99-22) unstable; urgency=low
+
+ [ Debconf translations ]
+ * Khmer added (Khoem Sokhem)
+ * Slovenian (Vanja Cvelbar). Closes: #670616
+ * Traditional Chinese (Vincent Chen).
+ * Vietnamese (Hai Lang).
+ * Marathi (Sampada Nakhare)
+ * Finnish (Timo Jyrinki). Closes: #673976
+ * Latvian (Rūdolfs Mazurs). Closes: #674697
+
+ [ Colin Watson ]
+ * Make apport hook compatible with Python 3.
+ * Add upstream r3476 (fix memory leak in grub_disk_read_small) to
+ 4k_sectors.patch, otherwise the larger disk cache due to
+ efi_disk_cache.patch can cause EFI systems to run out of memory.
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 30 May 2012 10:38:40 +0100
+
+grub2 (1.99-21) unstable; urgency=low
+
+ * Backport from upstream:
+ - Fix hook calling for unaligned segments (closes: #666992,
+ LP: #972250).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 03 Apr 2012 14:19:18 +0100
+
+grub2 (1.99-20) unstable; urgency=low
+
+ * Backport kFreeBSD support from upstream to 4k_sectors.patch.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 02 Apr 2012 21:53:02 +0100
+
+grub2 (1.99-19) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Add grub-probe to grub-mount-udeb (LP: #963471).
+ * Backport from upstream:
+ - Restore CFLAGS after efiemu check (closes: #665772).
+ - Include __ctzdi2 and __ctzsi2 from libgcc if present (closes:
+ #665993).
+ - Support non-512B sectors and agglomerate reads.
+
+ [ Debconf translations ]
+ * Croatian (Tomislav Krznar).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 02 Apr 2012 18:26:09 +0100
+
+grub2 (1.99-18) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Ensure that /sbin and /usr/sbin are in $PATH when running tests (closes:
+ #662916).
+ * mkconfig_loopback.patch: Use different GRUB loop devices for different
+ OS loop devices (thanks, bcbc; LP: #888281).
+ * Backport from upstream:
+ - Add support for LZO compression in btrfs (LP: #727535).
+ - Fix efiemu configure check.
+
+ [ Ilya Yanok ]
+ * Backport from upstream:
+ - Make FAT UUID uppercase to match Linux (LP: #948716).
+
+ [ Debconf translations ]
+ * Norwegian Bokmål (Hans Fredrik Nordhaug).
+ * Gujarati (Kartik Mistry). Closes: #663542
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 19 Mar 2012 18:24:33 +0000
+
+grub2 (1.99-17) unstable; urgency=low
+
+ * efi_disk_cache.patch: Fix incorrect GRUB_DISK_CACHE_BITS (LP: #944347).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 06 Mar 2012 17:43:42 +0000
+
+grub2 (1.99-16) unstable; urgency=low
+
+ * Backport from upstream:
+ - Build with -fno-asynchronous-unwind-tables to save space (closes:
+ #662787).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 06 Mar 2012 12:45:42 +0000
+
+grub2 (1.99-15) unstable; urgency=low
+
+ [ Adam Conrad ]
+ * grub.cfg_400.patch: Redirect grep stdout to /dev/null since
+ grub-mkconfig is "exec > grub.cfg.new", which causes grep's input
+ and output to be the same FD (LP: #934269) (closes: #652972)
+ * efi_disk_cache.patch: Bump the disk cache on EFI systems to
+ dramatically reduce load times for vmlinux/initrd (LP: #944347)
+
+ [ Colin Watson ]
+ * no_libzfs.patch: Use xasprintf rather than asprintf.
+ * Backport from upstream:
+ - Rewrite XFS btree parsing; fixes invalid BMAP (closes: #657776).
+ - Handle newer autotools, and add some missing quotes in the process.
+ (Note that this moves grub-mkconfig_lib and update-grub_lib to
+ /usr/share/grub; I added links in /usr/lib/grub for compatibility.)
+ - Fix incorrect identifiers in bash-completion (closes: #661415).
+ - Add support for GRUB_CMDLINE_GNUMACH (closes: #660493).
+ * Build with GCC 4.6 (closes: #654727).
+
+ [ Debconf translations ]
+ * Dutch (Jeroen Schot). Closes: #651275
+ * Bulgarian (Damyan Ivanov). Closes: #653356
+ * Icelandic (Sveinn í Felli).
+ * Ukrainian (Yatsenko Alexandr). Closes: #654294
+ * Italian (Luca Monducci). Closes: #654304
+ * Thai (Theppitak Karoonboonyanan). Closes: #656551
+ * Uyghur (Abduqadir Abliz)
+ * Indonesian (Mahyuddin Susanto). Closes: #656705
+ * Hebrew (Omer Zak). Closes: #656852
+ * Turkish (Atila KOÇ). Closes: #656907
+ * Polish (Michał Kułach). Closes: #657265
+ * Asturian (Mikel González).
+ * Dzongkha (Dawa Pemo)
+ * Tamil (Dr.T.Vasudevan).
+ * Belarusian (Viktar Siarhiejczyk). Closes: #662615
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 05 Mar 2012 16:58:01 +0000
+
+grub2 (1.99-14) unstable; urgency=low
+
+ * Rewrite no_libzfs.patch using a different approach. (Closes: #648539)
+
+ -- Robert Millan <rmh@debian.org> Sun, 13 Nov 2011 00:14:38 +0100
+
+grub2 (1.99-13) unstable; urgency=low
+
+ [ Debconf translations ]
+ * Portuguese (Miguel Figueiredo). Closes: #641226
+ * German (Martin Eberhard Schauer). Closes: #641630
+ * Sinhala (Danishka Navin). Closes: #644080
+ * Uyghur (Gheyret Tohti). Closes: #627011
+
+ [ Robert Millan ]
+ * LVM support for GNU/kFreeBSD.
+ - kfreebsd_lvm.patch
+ * Cherry-pick several ZFS updates from upstream Bazaar.
+ - zfs_update.patch
+ * Build without libzfs.
+
+ -- Robert Millan <rmh@debian.org> Fri, 11 Nov 2011 23:04:58 +0100
+
+grub2 (1.99-12) unstable; urgency=low
+
+ [ Robert Millan ]
+ * Fix grub-probe detection for LSI MegaRAID SAS devices on kFreeBSD.
+ - kfreebsd_mfi_devices.patch
+
+ [ Colin Watson ]
+ * Backport from upstream:
+ - Canonicalise the path argument to grub-probe (closes: #637768).
+ - Skip */README* as well as README* (LP: #537123).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 05 Sep 2011 15:17:20 +0100
+
+grub2 (1.99-11) unstable; urgency=low
+
+ * Backport from upstream:
+ - Honour GRUB_CMDLINE_LINUX_XEN_REPLACE and
+ GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT, which replace
+ GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT (complementing the
+ existing options which append; closes: #617538).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 08 Aug 2011 17:55:21 +0100
+
+grub2 (1.99-10) unstable; urgency=high
+
+ * Mark la_array as packed.
+ - zfs_packed_la_array.patch
+
+ -- Robert Millan <rmh@debian.org> Sun, 07 Aug 2011 20:16:31 +0000
+
+grub2 (1.99-9) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Adjust apport hook to attach /boot/grub/device.map if it exists.
+ * Fix regression in gfxterm background_color handling.
+ * Improve detection of invalid shell syntax in apport hook.
+
+ [ Debconf translations ]
+ * Esperanto (Felipe E. F. de Castro). Closes: #632157
+ * Slovak (Slavko).
+
+ [ Robert Millan ]
+ * Enable grub-mount on kfreebsd-any.
+ * Build grub-mount-udeb on kfreebsd-i386 and kfreebsd-amd64.
+
+ -- Robert Millan <rmh@debian.org> Mon, 25 Jul 2011 15:36:31 +0200
+
+grub2 (1.99-8) unstable; urgency=low
+
+ [ Robert Millan ]
+ * Avoid buggy versions of libgeom-dev (see #630107). Closes: #630197
+ * Fix grub-probe detection for ATA devices using `ata' driver on kFreeBSD 9.
+ - kfreebsd-9_ada_devices.patch
+
+ [ Colin Watson ]
+ * Update ntldr-img from grub-extras:
+ - Handle ext3 inode sizes other than 128.
+
+ [ Debconf translations ]
+ * Kazakh (Baurzhan Muftakhidinov). Closes: #630915
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 21 Jun 2011 02:10:10 +0100
+
+grub2 (1.99-7) unstable; urgency=low
+
+ [ Debconf translations ]
+ * Basque (Iñaki Larrañaga Murgoitio). Closes: #628716
+ * Swedish (Martin Bagge / brother). Closes: #628866
+ * Czech (Miroslav Kure). Closes: #628978
+ * Brazilian Portuguese (Flamarion Jorge). Closes: #629135
+ * Spanish (Francisco Javier Cuadrado). Closes: #629633
+
+ [ Colin Watson ]
+ * Cope with btrfs / inside an encrypted block device (thanks, alexeagar;
+ LP: #757631).
+ * Merge from Ubuntu:
+ - Give up scanning partitions after ten consecutive open failures
+ (LP: #787461).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 16 Jun 2011 00:13:14 +0100
+
+grub2 (1.99-6) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Update Vcs-* fields for Alioth changes.
+ * Backport from upstream, removing the need for Breaks: udev (<< 168-1):
+ - Don't stat devices unless we have to.
+
+ [ Debconf translations ]
+ * Catalan (Jordi Mallach).
+ * Farsi (Behrad Eslamifar). Closes: #628648
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 31 May 2011 09:20:54 +0100
+
+grub2 (1.99-5) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Change grub2/linux_cmdline and grub2/kfreebsd_cmdline descriptions to
+ indicate that the command line is allowed to be empty, since this is a
+ common source of confusion (thanks, Jordan Uggla).
+ * On non-Ubuntu-derived systems, add Breaks: udev (<< 168-1) to
+ grub-common, for the sake of (some?) users without initrds (closes:
+ #627587).
+
+ [ Debconf translations ]
+ * French (Christian Perrier)
+ * Russian (Yuri Kozlov). Closes: #628196
+ * Simplified Chinese (YunQiang Su). Closes: #628210
+ * Japanese (Hideki Yamane). Closes: #628382
+ * Danish (Joe Hansen). Closes: #628427
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 29 May 2011 21:58:55 +0100
+
+grub2 (1.99-4) unstable; urgency=low
+
+ * Make grub-<platform>-bin packages depend on grub-common rather than
+ grub2-common, and add grub2-common dependencies to grub-<platform>.
+ This ensures that grub-<platform>-bin packages are coinstallable with
+ grub-legacy, making it easier to use them as build-dependencies.
+ * Stop trying to install the non-existent grub-ofpathname(8) on sparc for
+ now. It will exist in the next upstream snapshot.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 19 May 2011 12:38:45 +0100
+
+grub2 (1.99-3) unstable; urgency=low
+
+ * Ship grub-mkrescue on non-Linux amd64/i386 architectures.
+ * Don't try to ship grub-mkrescue on sparc.
+ * Drop boot_blocklist_hack.patch, fixed differently upstream some time ago
+ by being smarter about filesystem-root-relative path conversion.
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 18 May 2011 14:06:51 +0100
+
+grub2 (1.99-2) unstable; urgency=low
+
+ * Include both old and new Lintian override styles for
+ statically-linked-binary tag, since ftp-master has not yet been updated
+ to 2.5.0~rc1.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 17 May 2011 01:36:10 +0100
+
+grub2 (1.99-1) unstable; urgency=low
+
+ * New upstream release.
+ - Ensure uniqueness of RAID array numbers even if some elements have a
+ name (closes: #609804).
+ - Remove unnecessary brackets from tr arguments (closes: #612564).
+ - Add grub-mkrescue info documentation (closes: #612585).
+ - Avoid generating invalid configuration when something that looks like
+ a Xen hypervisor is present without any Xen kernels (closes: #612898).
+ - Fix memory alignment when calling 'linux' multiple times on EFI
+ (closes: #616638).
+ - Fix grub-install on amd64 EFI systems (closes: #617388).
+ - Automatically export pager variable (closes: #612995).
+ - Fix parser error with "time" (closes: #612991).
+ - Ignore case of bitmap extensions (closes: #611123).
+ - Skip vmlinux-* on x86 platforms (closes: #536846, #546008).
+ - Accept old-style Xen kernels (closes: #610428).
+ - Skip damaged LVM volumes (closes: #544731).
+ - Handle LVM mirroring (closes: #598441).
+ - Detect spares and report them as not RAID members (closes: #611561).
+ - Don't enable localisation unless gfxterm is available (closes:
+ #604609).
+ - Fix partitioned RAID support (closes: #595071, #613444).
+ - Dynamically count the number of lines for the lower banner (closes:
+ #606494).
+ - Improve quoting in grub-mkconfig, to support background image file
+ names containing spaces (closes: #612417).
+ - Flush BIOS disk devices more accurately (closes: #623124).
+ - Identify RAID devices by their UUID rather than by their guessed name
+ (closes: #624232).
+ - Add "SEE ALSO" sections to most man pages (closes: #551428).
+
+ [ Christian Perrier ]
+ * Drop extra word in French debconf translation. Thanks to David
+ Prévôt.
+ * Fix spelling error in French debconf translation. Thanks to David
+ Prévôt.
+
+ [ Colin Watson ]
+ * Set PACKAGE_VERSION and PACKAGE_STRING using configure arguments rather
+ than sedding configure.ac in debian/rules (which sometimes has annoying
+ interactions with quilt, etc.).
+ * Update branch_embed-sectors.patch:
+ - Detect sector used by HighPoint RAID controller (closes: #394868).
+ * Add debian/README.source (from quilt).
+ * Make debian/rules more explicit about when autogen.sh is run. We need
+ to be careful that all full builds run it, since we use GRUB extras.
+ * Merge from Ubuntu:
+ - Handle filesystems loop-mounted on file images.
+ - On Wubi, don't ask for an install device, but just update wubildr
+ using the diverted grub-install.
+ - Add grub-mount-udeb, containing just grub-mount. This can be used by
+ os-prober and other parts of d-i.
+ - Artificially bump Replaces: grub-common versioning to account for
+ grub-reboot/grub-set-default movement in Ubuntu.
+ * Don't do a separate build pass for grub-common. It will be identical to
+ the build for the default platform for the CPU architecture anyway, so
+ reuse that.
+ * Build with GCC 4.5 on all architectures.
+ * Update Lintian overrides for changes in Lintian 2.5.0~rc1.
+ * Invert how files are split among binary packages: rather than code in
+ debian/rules to remove files we don't want, add dh_install configuration
+ to declare the files we do want. This means a little more repetition
+ for platform-specific programs, but it seems less confusing and easier
+ to extend.
+ * Drop versioned dependencies on base-files. GPL-3 has been there for two
+ Debian releases now, and the dependency was never upgrade-critical
+ anyway.
+ * Create grub2-common package containing files that are common among GRUB
+ platform packages but that would break GRUB Legacy, or that are too
+ confusing when coinstalled with GRUB Legacy (closes: #564167).
+ * Drop conflict on an ancient (pre-lenny/hardy) version of desktop-base.
+ * Move /etc/grub.d/05_debian_theme to grub-common, to go with the other
+ /etc/grub.d/* files.
+ * Drop redundant Suggests: os-prober from several platform packages, as
+ grub-common already Recommends: os-prober.
+ * Create grub-<platform>-bin packages corresponding to all grub-<platform>
+ packages (except for grub-emu). These do not automatically install the
+ boot loader or update grub.cfg, and they install their binaries to
+ /usr/lib/grub/<cpu>-<platform>/; this means that they can be installed
+ in parallel, making it easier to use them to build GRUB-based disk
+ images (e.g. d-i). The grub-<platform> packages now depend on these and
+ include symlinks, so their behaviour will remain as before.
+ * Make grub-emu depend on grub-common.
+ * Make the documentation directory in most binary packages be a symlink to
+ that in grub-common.
+ * Drop lenny compatibility from grub2-common's dpkg/install-info
+ dependency, since it produces a Lintian warning and using the current
+ packaging on lenny is probably rather a stretch anyway.
+
+ [ Updated translations ]
+ * Belarusian (Viktar Siarheichyk). Closes: #606864
+ * Danish (Joe Hansen). Closes: #606879
+ * Romanian (Andrei POPESCU). Closes: #606888
+ * Italian (Luca Monducci). Closes: #606891
+ * Brazilian Portuguese (Flamarion Jorge). Closes: #610613
+ * Greek (Emmanuel Galatoulas). Closes: #604847
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 16 May 2011 17:42:07 +0100
+
+grub2 (1.99~rc1-13) unstable; urgency=low
+
+ * Cherry-pick from upstream:
+ - Use correct limits for mips initrd.
+ * Run grub-install on install or upgrade of grub-yeeloong.
+ * Update branch_fuse.patch:
+ - Tell FUSE to run single-threaded, since GRUB code is not thread-safe
+ (LP: #756297).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 15 Apr 2011 12:11:21 +0100
+
+grub2 (1.99~rc1-12) unstable; urgency=low
+
+ * Update branch_butter.patch:
+ - Fix filename comparison.
+ - Take extent offset in account on uncompressed extents.
+ - Use filled extent size if available.
+ * Allow use of first sector on btrfs (LP: #757446).
+ * Merge from Ubuntu:
+ - Build part_msdos and vfat into EFI boot images (LP: #677758).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 11 Apr 2011 16:22:08 +0100
+
+grub2 (1.99~rc1-11) unstable; urgency=low
+
+ * Update branch_fuse.patch:
+ - Make grub-mount exit non-zero if opening the device or filesystem
+ fails.
+ - Translate GRUB error codes into OS error codes for FUSE (LP: #756456).
+ * Merge from Ubuntu:
+ - Fix use of freed memory when replacing existing loopback device
+ (LP: #742967).
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 10 Apr 2011 21:52:26 +0100
+
+grub2 (1.99~rc1-10) unstable; urgency=low
+
+ * Update branch_butter.patch, fixing RAID1/duplicated chunk size
+ calculation (thanks, Vladimir Serbinenko; LP: #732149).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 09 Apr 2011 21:22:15 +0100
+
+grub2 (1.99~rc1-9) unstable; urgency=low
+
+ * Update branch_parse-color.patch, to blend text when any background is
+ set as opposed to only when a stretched background is set (closes:
+ #613120).
+ * Make update-grub2 a symlink to update-grub, rather than bothering with a
+ wrapper script.
+ * Cherry-pick from upstream:
+ - Check RAID superblock offset (closes: #610184).
+ - Flush buffer cache on close and not on open (closes: #620663).
+ - Handle special naming of yeeloong directory (closes: #620420).
+ * Add grub-mount utility, from the upstream 'fuse' branch.
+ * efibootmgr is only available on Linux architectures, so only make
+ grub-efi-ia32 and grub-efi-amd64 depend on it on Linux.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 09 Apr 2011 03:39:56 +0100
+
+grub2 (1.99~rc1-8) unstable; urgency=low
+
+ * Cherry-pick from upstream:
+ - Fix FreeBSD compilation problem.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 29 Mar 2011 15:13:51 +0100
+
+grub2 (1.99~rc1-7) unstable; urgency=low
+
+ * Add /proc/mdstat, LVM information, and listings of /dev/disk/by-id/ and
+ /dev/disk/by-uuid/ to bug reports, by request of upstream.
+ * Cherry-pick from upstream:
+ - Use libgeom on FreeBSD to detect partitions (closes: #612128).
+ - Copy the partition table zone if floppy support is disabled, even if
+ no partition table is found (LP: #741867).
+ - Fix an ext2 overflow affecting inodes past 2TiB.
+ - Fix RAID-0 disk size calculation for metadata 1.x (LP: #743136).
+ * Merge from Ubuntu:
+ - Build with gcc-4.5 on ppc64.
+ - Add apport hook for ProblemType = 'Package', thanks to Jean-Baptiste
+ Lallement (LP: #591753).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 29 Mar 2011 12:30:36 +0100
+
+grub2 (1.99~rc1-6) unstable; urgency=low
+
+ * Cherry-pick from upstream:
+ - Fix crash when extending menu entry line beyond 79 characters (closes:
+ #615893).
+ - Account for FreeBSD module headers when calculating allocation size.
+ - Switch back to framebuffer page zero before loading the kernel
+ (thanks, Felix Kuehling).
+ * Merge from Ubuntu:
+ - If we're upgrading and /boot/grub/core.img doesn't exist, then don't
+ ask where to install GRUB, since it probably means we're in some kind
+ of specialised environment such as a live USB stick (LP: #591202).
+ - Drop the default priority of grub2/linux_cmdline to medium. We only
+ need to ask it if we're upgrading from GRUB Legacy and found an empty
+ kopt in menu.lst (LP: #591202).
+ * Update branch_embed-sectors.patch, avoiding consuming lots of space and
+ time if the first partition is not near the start of the disk (closes:
+ #619458, LP: #691569).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 25 Mar 2011 19:23:04 +0000
+
+grub2 (1.99~rc1-5) unstable; urgency=low
+
+ * Update debian/legacy/update-grub to the version from grub 0.97-65.
+ * Mark binary packages as Multi-Arch: foreign (for example, an amd64
+ kernel installed on an i386 system could use the native architecture's
+ GRUB).
+ * Rewrite find_root_device_from_mountinfo to cope with move-mounts
+ (LP: #738345).
+
+ [ Updated translations ]
+ * Esperanto (Felipe Castro). Closes: #606524
+ * Thai (Theppitak Karoonboonyanan). Closes: #607706
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 23 Mar 2011 15:51:47 +0000
+
+grub2 (1.99~rc1-4) unstable; urgency=low
+
+ * Don't touch /boot/grub/grub2-installed if using the --root-directory
+ option to grub-install (thanks, Nicolas George; closes: #614927).
+ * Update branch_devmapper.patch, adding partitioned MD RAID support
+ (untested) and support for probing multipath disks.
+ * Update ntldr-img from grub-extras:
+ - Only call ntfs_fix_mmft if the attribute to find is AT_DATA. This
+ matches GRUB's NTFS module.
+ - Install grubinst as grub-ntldr-img.
+ * Fix loading GRUB from lnxboot (LP: #693671).
+ * Update branch_embed-sectors.patch to avoid straying into first partition
+ when embedding-area sectors are in use (closes: #613409, LP: #730225).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 15 Mar 2011 11:01:48 +0000
+
+grub2 (1.99~rc1-3) unstable; urgency=low
+
+ * Build for ppc64 (except for grub-emu, which doesn't build cleanly yet).
+ * Suppress output from debconf-communicate in upgrade-from-grub-legacy.
+ * Refer to the info documentation at the top of /etc/default/grub (closes:
+ #612538).
+ * We need at least freebsd-utils (>= 8.0-4) on kFreeBSD architectures for
+ camcontrol, so depend on it.
+ * Tolerate camcontrol failing to read capacity of IDE devices, until such
+ time as we know how to do this properly (see #612128).
+ * Adjust /etc/default/grub for rename of GRUB_DISABLE_LINUX_RECOVERY to
+ GRUB_DISABLE_RECOVERY (closes: #612777).
+ * Update ntldr-img from grub-extras:
+ - Install g2hdr.bin and g2ldr.mbr (closes: #613245).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 16 Feb 2011 13:11:11 +0000
+
+grub2 (1.99~rc1-2) unstable; urgency=low
+
+ * Merge 1.98+20100804-13 and 1.98+20100804-14, updating translations:
+ - Kazakh (Baurzhan Muftakhidinov / Timur Birsh).
+ * mkconfig_skip_dmcrypt.patch: Refer to GRUB_PRELOAD_MODULES rather than
+ suggesting people write a /etc/grub.d/01_modules script (thanks, Jordan
+ Uggla).
+ * Handle empty dir passed to grub_find_root_device_from_mountinfo; fixes
+ grub-mkrelpath on btrfs subvolumes (LP: #712029).
+ * Add rootflags=subvol=<name> if / is on a btrfs subvolume (LP: #712029).
+ * Upload to unstable.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 08 Feb 2011 11:39:26 +0000
+
+grub2 (1.99~rc1-1) experimental; urgency=low
+
+ [ Colin Watson ]
+ * New upstream release candidate.
+
+ [ Alexander Kurtz ]
+ * 05_debian_theme:
+ - If we find a background image and no colours were specified, use
+ upstream defaults for color_normal and color_highlight rather than
+ setting color_normal to black/black.
+ - Make the code more readable by replacing code for handling
+ alternatives.
+ - Make the code for searching for pictures in /boot/grub more readable
+ and robust (for example against newlines in the filename).
+ - Don't try the other alternatives when $GRUB_BACKGROUND is set; you can
+ now add GRUB_BACKGROUND= to /etc/default/grub to force no background
+ image (closes: #608263).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 17 Jan 2011 13:43:06 +0000
+
+grub2 (1.99~20110112-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - Disable ieee1275_fb on sparc (closes: #560823).
+ - Fix pf2 font generation on big-endian platforms (closes: #609818).
+ * branch_butter.patch: Resolve the device returned by
+ grub_find_root_device_from_mountinfo or find_root_device_from_libzfs
+ using grub_find_device (closes: #609590, #609814, LP: #700147).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 13 Jan 2011 00:12:41 +0000
+
+grub2 (1.99~20110111-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - Don't check amount of low memory, as reportedly INT 12h can be broken
+ and if low memory is too low we wouldn't have gotten into
+ grub_machine_init anyway (closes: #588293, LP: #513528).
+ - Submenu default support (LP: #691878).
+ - Fix optimisation-dependent grub-mklayout crash (closes: #609584).
+ * branch_butter.patch: Don't free an uninitialised pointer if /proc is
+ unmounted (LP: #697493).
+ * Add a po/LINGUAS file listing the translations we've synced from the TP
+ (closes: #609671).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 11 Jan 2011 17:11:44 +0000
+
+grub2 (1.99~20110106-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - Check that named RAID array devices exist before using them (closes:
+ #606035).
+ - Clear terminfo output on initialisation (closes: #569678).
+ - Fix grub-probe when btrfs is on / without a separate /boot.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 06 Jan 2011 13:38:57 +0000
+
+grub2 (1.99~20110104-2) experimental; urgency=low
+
+ * Support long command lines as per the 2.06 Linux boot protocol, from the
+ upstream 'longlinuxcmd' branch.
+ * Add a background_color command, from the upstream 'parse-color' branch.
+ * Update branch_devmapper.patch, adding a #include to fix a build failure
+ on Ubuntu amd64.
+ * When embedding the core image in a post-MBR gap, check for and avoid
+ sectors matching any of a number of known signatures, from the upstream
+ 'embed-sectors' branch.
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 05 Jan 2011 13:31:05 +0000
+
+grub2 (1.99~20110104-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - Don't emit drivemap directive for Windows Server 2008 (closes:
+ #607687).
+ - Don't add spurious RAID array members (closes: #605357).
+ - Improve presentation of Xen menu entries (closes: #607867).
+ - Fix PCI probing hangs by skipping remaining functions on devices that
+ do not implement function 0 (closes: #594967).
+ - Fix typo in descriptions of extract_legacy_entries_source and
+ extract_legacy_entries_configfile (LP: #696721).
+ * Merge 1.98+20100804-12:
+ - Use semicolons rather than commas to separate size from model in
+ debconf disk and partition descriptions.
+ * Add full btrfs support, from the upstream 'butter' branch.
+ * Support partitioned loop devices and improve devmapper support, from the
+ upstream 'devmapper' branch.
+ * Add squashfs 4 support, from the upstream 'squash' branch.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 04 Jan 2011 16:12:45 +0000
+
+grub2 (1.99~20101221-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - Initialise next pointer when creating multiboot module (closes:
+ #605567).
+ - Fix gettext quoting to work with bash as /bin/sh, and make echo
+ UTF-8-clean so that (at least) Catalan boot messages are displayed
+ properly (closes: #605615).
+ - Fix use of uninitialised memory in Reed-Solomon recovery code
+ (LP: #686705).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 21 Dec 2010 17:43:52 +0000
+
+grub2 (1.99~20101210-2) experimental; urgency=low
+
+ * Automatically remove MD devices from device.map on upgrade, since the
+ BIOS cannot read from these and including them in device.map will break
+ GRUB's ability to read from such devices (LP: #690030).
+ * Merge 1.98+20100804-9, 1.98+20100804-10, and 1.98+20100804-11:
+ - Apply debconf template review by debian-l10n-english and mark several
+ more strings for translation, thanks to David Prévot and Justin B Rye.
+ - Incorporate rewritten 05_debian_theme by Alexander Kurtz, which works
+ when /usr is inaccessible by GRUB.
+
+ -- Colin Watson <cjwatson@debian.org> Sun, 19 Dec 2010 13:25:14 +0000
+
+grub2 (1.99~20101210-1) experimental; urgency=low
+
+ * New Bazaar snapshot.
+ - ZFS moved into grub-core.
+ - Extend gettext to fall back from ll_CC to ll, and set lang to include
+ country part by default so that Chinese works (LP: #686788).
+ * Remove grub-mknetdir from grub-emu.
+ * Exit silently from zz-update-grub kernel hook if update-grub does not
+ exist (e.g. if grub-pc has been removed but not purged; closes:
+ #606184).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 11 Dec 2010 01:22:26 +0000
+
+grub2 (1.99~20101126-1) experimental; urgency=low
+
+ * New Bazaar snapshot (mipsel build fix, LVM-on-RAID probing fix).
+ * Fix comma-separation in handling of grub-pc/install_devices.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 26 Nov 2010 13:08:52 +0000
+
+grub2 (1.99~20101124-1) experimental; urgency=low
+
+ * New Bazaar snapshot (command priorities, build fixes, grub-mkdevicemap
+ segfault).
+ * Don't try to build grub-efi-amd64 on kfreebsd-i386 or hurd-i386
+ (requires gcc-4.4-multilib).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 24 Nov 2010 12:12:33 +0000
+
+grub2 (1.99~20101123-1) experimental; urgency=low
+
+ * New Bazaar snapshot (build fixes).
+ * Build-depend on qemu-utils and parted on non-Hurd architectures.
+ * qemu_img_exists.patch: Skip partmap test if qemu-img doesn't exist (as
+ is the case on the Hurd).
+ * Make grub-efi-ia32 and grub-efi-amd64 depend on efibootmgr so that
+ grub-install works properly.
+ * Upgrade the installed core image when upgrading grub-efi-ia32 or
+ grub-efi-amd64, although only if /boot/efi/EFI/<id> (where <id> is an
+ identifier based on GRUB_DISTRIBUTOR, e.g. 'debian') already exists.
+ * Re-expand a couple of dpkg architecture wildcards to exclude certain
+ special cases: gcc-4.4-multilib is not available on kfreebsd-i386 or
+ hurd-i386, and qemu-system is not available on hurd-i386.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 23 Nov 2010 10:51:23 +0000
+
+grub2 (1.99~20101122-1) experimental; urgency=low
+
+ [ Colin Watson ]
+ * New Bazaar snapshot. Too many changes to list in full, but some of the
+ more user-visible ones are as follows:
+ - GRUB script:
+ + Function parameters, "break", "continue", "shift", "setparams",
+ "return", and "!".
+ + "export" command supports multiple variable names.
+ + Multi-line quoted strings support.
+ + Wildcard expansion.
+ - sendkey support.
+ - USB hotunplugging and USB serial support.
+ - Rename CD-ROM to cd on BIOS.
+ - Add new --boot-directory option to grub-install, grub-reboot, and
+ grub-set-default; the old --root-directory option is still accepted
+ but was often confusing.
+ - Basic btrfs detection/UUID support (but no file reading yet).
+ - bash-completion for utilities.
+ - If a device is listed in device.map, always assume that it is
+ BIOS-visible rather than using extra layers such as LVM or RAID.
+ - Add grub-mknetdir script (closes: #550658).
+ - Remove deprecated "root" command.
+ - Handle RAID devices containing virtio components.
+ - GRUB Legacy configuration file support (via grub-menulst2cfg).
+ - Keyboard layout support (via grub-mklayout and grub-kbdcomp).
+ - Check generated grub.cfg for syntax errors before saving.
+ - Pause execution for at most ten seconds if any errors are displayed,
+ so that the user has a chance to see them.
+ - Support submenus.
+ - Write embedding zone using Reed-Solomon, so that it's robust against
+ being partially overwritten (closes: #550702, #591416, #593347).
+ - GRUB_DISABLE_LINUX_RECOVERY and GRUB_DISABLE_NETBSD_RECOVERY merged
+ into a single GRUB_DISABLE_RECOVERY variable.
+ - Fix loader memory allocation failure (closes: #551627).
+ - Don't call savedefault on recovery entries (closes: #589325).
+ - Support triple-indirect blocks on ext2 (closes: #543924).
+ - Recognise DDF1 fake RAID (closes: #603354).
+
+ [ Robert Millan ]
+ * Use dpkg architecture wildcards.
+
+ [ Updated translations ]
+ * Slovenian (Vanja Cvelbar). Closes: #604003
+ * Dzongkha (dawa pemo via Tenzin Dendup). Closes: #604102
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 22 Nov 2010 12:24:56 +0000
+
+grub2 (1.98+20100804-14) unstable; urgency=low
+
+ [ Updated translations ]
+ * Kazakh (Baurzhan Muftakhidinov / Timur Birsh). Closes: #609187
+
+ [ Alexander Kurtz ]
+ * 05_debian_theme:
+ - If we find a background image and no colours were specified, use
+ upstream defaults for color_normal and color_highlight rather than
+ setting color_normal to black/black.
+ - Don't try the other alternatives when $GRUB_BACKGROUND is set; you can
+ now add GRUB_BACKGROUND= to /etc/default/grub to force no background
+ image (closes: #608263).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 17 Jan 2011 23:19:38 +0000
+
+grub2 (1.98+20100804-13) unstable; urgency=low
+
+ * Backport from upstream:
+ - Don't add spurious RAID array members (closes: #605357).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 04 Jan 2011 14:07:14 +0000
+
+grub2 (1.98+20100804-12) unstable; urgency=low
+
+ * Backport from upstream:
+ - Support big ext2 files (closes: #543924).
+ - Fix gettext quoting to work with bash as /bin/sh, and make echo
+ UTF-8-clean so that (at least) Catalan boot messages are displayed
+ properly (closes: #605615).
+ - Initialise next pointer when creating multiboot module (closes:
+ #605567).
+ - Fix PCI probing hangs by skipping remaining functions on devices that
+ do not implement function 0 (closes: #594967).
+ * Use semicolons rather than commas to separate size from model in debconf
+ disk and partition descriptions; commas are too easily confused with the
+ multiselect choice separator, and in particular make it impossible to
+ answer questions properly in the editor frontend (closes: #608449).
+ Unfuzzy all translations where possible.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 04 Jan 2011 00:42:29 +0000
+
+grub2 (1.98+20100804-11) unstable; urgency=low
+
+ * Exit silently from zz-update-grub kernel hook if update-grub does not
+ exist (e.g. if grub-pc has been removed but not purged; closes:
+ #606184).
+ * Apply debconf template review by debian-l10n-english and mark several
+ more strings for translation, thanks to David Prévot and Justin B Rye
+ (closes: #605748).
+ * Unfuzzy some translations that were not updated in this round (thanks,
+ David Prévot; closes: #606921).
+ * Incorporate rewritten 05_debian_theme by Alexander Kurtz, which works
+ when /usr is inaccessible by GRUB (closes: #605705).
+ * Backport from upstream:
+ - Recognise DDF1 DM-RAID (closes: #603354).
+
+ [ Updated translations ]
+ * Chinese (YunQiang Su). Closes: #606426
+ * Indonesian (Arief S Fitrianto). Closes: #606431
+ * Slovenian (Vanja Cvelbar). Closes: #606445
+ * Swedish (Martin Bagge / brother). Closes: #606455
+ * Ukrainian (Yatsenko Alexandr). Closes: #606538
+ * Basque (Iñaki Larrañaga Murgoitio). Closes: #606644
+ * Slovak (Slavko). Closes: #606663
+ * Catalan (Jordi Mallach).
+ * Bulgarian (Damyan Ivanov). Closes: #606452
+ * Persian (Morteza Fakhraee). Closes: #606672
+ * Russian (Yuri Kozlov). Closes: #606753
+ * Dutch (Paul Gevers). Closes: #606807
+ * Japanese (Hideki Yamane). Closes: #606836
+ * French (Christian Perrier). Closes: #606842
+ * Czech (Miroslav Kure). Closes: #606854
+ * Spanish (Francisco Javier Cuadrado). Closes: #606903
+ * Portuguese (Tiago Fernandes / Miguel Figueiredo). Closes: #606908
+ * German (Martin Eberhard Schauer). Closes: #606896
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 18 Dec 2010 17:20:09 +0000
+
+grub2 (1.98+20100804-10) unstable; urgency=low
+
+ * fix_crash_condition_in_kfreebsd_loader.patch: Import from upstream.
+ Fixes crash condition in case kfreebsd_* commands are used after
+ kfreebsd has (gracefully) failed.
+
+ -- Robert Millan <rmh@debian.org> Tue, 30 Nov 2010 19:40:11 +0100
+
+grub2 (1.98+20100804-9) unstable; urgency=low
+
+ [ Robert Millan ]
+ * Import from upstream:
+ - refuse_embedingless_cross_disk.patch: Refuse to do a cross-disk
+ embeddingless install rather than creating a broken install.
+ - fix_grub_install_error_msg.patch: Replace useless recomendation to
+ pass --modules with a recomendation to report a bug.
+ - message_refresh.patch: Make error messages visible again. (Closes: #605485)
+
+ [ Jordi Mallach ]
+ * Update Catalan translation with latest file from the Translation Project.
+
+ [ Updated translations ]
+ * Slovenian (Vanja Cvelbar). Closes: #604003
+ * Dzongkha (dawa pemo via Tenzin Dendup). Closes: #604102
+
+ -- Robert Millan <rmh@debian.org> Tue, 30 Nov 2010 15:44:02 +0100
+
+grub2 (1.98+20100804-8) unstable; urgency=low
+
+ [ Robert Millan ]
+ * increase_disk_limit.patch: Increase SCSI/IDE disk limits to cope with
+ Sun Fire X4500.
+ * linux_mdraid_1x.patch: Support for Linux MD RAID v1.x. (Closes: #593652)
+ * yeeloong_boot_info.patch: On Yeeloong, pass machine type information
+ to Linux.
+
+ [ Updated translations ]
+ * Portuguese fixed by Christian Perrier (variable names
+ were translated)
+
+ -- Robert Millan <rmh@debian.org> Fri, 05 Nov 2010 23:43:15 +0100
+
+grub2 (1.98+20100804-7) unstable; urgency=low
+
+ [ Robert Millan ]
+ * zfs_fix_mkrelpath.patch: Replace with proper fix from upstream Bazaar.
+ (Closes: #601087)
+
+ [ Updated translations ]
+ * Vietnamese (Clytie Siddall). Closes: #598327
+ * Icelandic (Sveinn í Felli). Closes: #600126
+
+ -- Robert Millan <rmh@debian.org> Sun, 24 Oct 2010 16:35:37 +0200
+
+grub2 (1.98+20100804-6) unstable; urgency=low
+
+ [ Robert Millan ]
+ * zfs_v23.patch: Accept ZFS up to v23 (no changes required).
+ * fix_usb_boot.patch: Fix boot on USB devices, for BIOSes that
+ expose them as floppies. (Closes: #600580)
+ * zfs_fix_mkrelpath.patch: Fix grub-mkrelpath for non-root ZFS.
+ (Closes: #600578)
+
+ [ Updated translations ]
+ * Kazakh (kk.po) by Baurzhan Muftakhidinov via Timur Birsh (closes:
+ #598188).
+ * Portuguese (pt.po) by Tiago Fernandes via Rui Branco (closes: #599767).
+ * Catalan (ca.po) by Jordi Mallach.
+
+ -- Robert Millan <rmh@debian.org> Thu, 21 Oct 2010 23:45:23 +0200
+
+grub2 (1.98+20100804-5) unstable; urgency=low
+
+ [ Updated translations ]
+ * Hebrew (he.po) by Omer Zak and Lior Kaplan (closes: #593855).
+ * Romanian (ro.po) by ioan-eugen STAN (closes: #595727).
+ * Esperanto (eo.po) by Felipe Castro (closes: #596171).
+
+ [ Colin Watson ]
+ * Make grub-efi-amd64 conflict with grub-pc as well as the other way
+ round.
+ * Backport upstream patches to fix DM-RAID support (closes: #594221,
+ LP: #634840).
+
+ [ Robert Millan ]
+ * enable_zfs.patch: Fix grub-fstest build problem.
+ * zfs_fix_label_arg.patch: Fix kfreebsd_device initialization on ZFS
+ for non-main filesystems.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 17 Sep 2010 23:45:10 +0100
+
+grub2 (1.98+20100804-4) unstable; urgency=low
+
+ [ Updated translations ]
+ * Italian (it.po) by Luca Monducci (closes: #593685).
+ * Finnish (fi.po) by Esko Arajärvi (closes: #593921).
+
+ [ Colin Watson ]
+ * Run update-grub from kernel hooks if DEB_MAINT_PARAMS is unset, for
+ compatibility with old kernel packages. This may produce duplicate runs
+ of update-grub, but that's better than not running it at all (closes:
+ #594037).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 23 Aug 2010 12:11:55 +0100
+
+grub2 (1.98+20100804-3) unstable; urgency=low
+
+ [ Updated translations ]
+ * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge (closes: #592156).
+ * Asturian (ast.po) by Maacub (closes: #592313).
+ * Galician (gl.po) by Jorge Barreiro (closes: #592816).
+
+ [ Robert Millan ]
+ * Backport ZFS bugfixes from upstream Bazaar:
+ - zfs_fix_chroot.patch: Fix breakage when running grub-probe inside chroot.
+ - zfs_fix_label_arg.patch: Fix grub-probe fs_label argument.
+ - zfs_fix_pathname.patch: Fix pathname for non-root ZFS filesystems.
+ - zfs_fix_segfault.patch: Fix segfault when /dev is not mounted.
+
+ [ Colin Watson ]
+ * Escape single quotes when removing them from $mode in zz-update-grub, so
+ that this works when /bin/sh is bash (thanks, Will Dyson; closes:
+ #593242).
+ * Add support for ext2 root on GNU/kFreeBSD (thanks, Aurelien Jarno;
+ closes: #593467).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 19 Aug 2010 18:21:45 +0100
+
+grub2 (1.98+20100804-2) unstable; urgency=low
+
+ [ Colin Watson ]
+ * Make /etc/kernel/postrm.d/zz-update-grub a real file rather than a
+ symlink (closes: #592076).
+
+ [ Updated translations ]
+ * Norwegian Bokmål (nb.po) by Hans Nordhaug (closes: #591569).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 07 Aug 2010 17:53:34 +0100
+
+grub2 (1.98+20100804-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Fix grub-emu build on GNU/kFreeBSD (closes: #591490).
+
+ [ Colin Watson ]
+ * Add kernel hook scripts and remove any uses of update-grub as a
+ postinst_hook or postrm_hook in /etc/kernel-img.conf (closes: #554175).
+ Thanks to Ben Hutchings for advice and to Harald Braumann for an early
+ implementation.
+ * Extend the existing GRUB_LEGACY_0_BASED_PARTITIONS handling to avoid
+ new-style partition naming when generating output for GRUB Legacy
+ (closes: #590554).
+
+ [ Updated translations ]
+ * Slovak (sk.po) by Slavko (closes: #591458).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 04 Aug 2010 04:48:11 +0100
+
+grub2 (1.98+20100802-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Remove compatibility with terminal.mod prior to
+ terminal_input/terminal_output separation (LP: #519358).
+ - Enable `grub-probe -t device' resolution on ZFS.
+ - Don't use UUID for LVM root when generating Xen entries (closes:
+ #591093).
+ - Restore missing whitespace to commands' --help output (closes:
+ #590874).
+ - Select unique numbers for named RAID arrays, for use as keys in the
+ disk cache.
+
+ [ Updated translations ]
+ * German (Martin Eberhard Schauer). Closes: #590108
+ * Spanish (Francisco Javier Cuadrado). Closes: #590448
+ * Traditional Chinese (Tetralet). Closes: #591191
+ * Danish (Joe Hansen). Closes: #591223
+ * Dutch (Paul Gevers). Closes: #590864
+ * Japanese (Hideki Yamane). Closes: #591058
+
+ [ Robert Millan ]
+ * postinst.in: Fill in device size and model information on GNU/kFreeBSD,
+ using camcontrol.
+ * patches/enable_zfs.patch: New patch. Link ZFS from grub-extras into
+ grub-probe and grub-setup.
+ * control: Build-Depend on libzfs-dev and libnvpair-dev on kfreebsd-*.
+
+ [ Colin Watson ]
+ * Offer RAID devices as GRUB installation targets if they contain /,
+ /boot, or /boot/grub.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 03 Aug 2010 02:13:07 +0100
+
+grub2 (1.98+20100722-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Don't count named RAID arrays when looking for unused array numbers.
+
+ [ Colin Watson ]
+ * Merge from Ubuntu:
+ - grub-common Breaks: lupin-support (<< 0.30) due to a grub-mkimage
+ syntax change (lupin-support isn't in Debian, but this is harmless
+ anyway).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 22 Jul 2010 14:33:34 +0100
+
+grub2 (1.98+20100720-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Link to Info documentation on changes from GRUB Legacy in README
+ (closes: #502623).
+ - Add support for mdadm metadata formats 1.x (closes: #492897).
+
+ [ Aaron M. Ucko ]
+ * Compare -trunk kernels earlier than numeric ABIs (closes: #568160).
+
+ [ Colin Watson ]
+ * Remove /boot/grub/device.map, /boot/grub/grubenv,
+ /boot/grub/installed-version, and /boot/grub/locale/ on purge, if
+ permitted (closes: #547679).
+ * Convert from CDBS to dh.
+ * Use exact-version dependencies in grub2 and grub-efi, to reduce
+ potential confusion.
+ * Raise priority of grub-common and grub-pc to optional (also done in
+ archive overrides).
+ * Copy-edit debian/presubj.
+ * Use 'mktemp -t' rather than hardcoding /tmp (closes: #589537).
+
+ [ Mario 'BitKoenig' Holbe ]
+ * Update /etc/grub.d/05_debian_theme to handle multiple entries in
+ GRUB_TERMINAL_OUTPUT (closes: #589322).
+
+ [ Updated translations ]
+ * Simplified Chinese (zh_CN.po) by YunQiang Su (closes: #589013).
+ * Russian (ru.po) by Yuri Kozlov (closes: #589244).
+ * Swedish (sv.po) by Martin Bagge / brother (closes: #589259).
+ * Bulgarian (bg.po) by Damyan Ivanov (closes: #589272).
+ * Indonesian (id.po) by Arief S Fitrianto (closes: #589318).
+ * Arabic (ar.po) by Ossama M. Khayat.
+ * Basque (eu.po) by Iñaki Larrañaga Murgoitio (closes: #589489).
+ * Persian (fa.po) by Bersam Karbasion (closes: #589544).
+ * Czech (cs.po) by Miroslav Kure (closes: #589568).
+ * Belarusian (be.po) by Viktar Siarheichyk (closes: #589634).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 21 Jul 2010 09:11:14 +0100
+
+grub2 (1.98+20100710-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Handle degraded RAID arrays in grub-probe and grub-setup.
+ - Fix gfxterm pager handling.
+
+ [ Fabian Greffrath ]
+ * Get value of correct debconf question when deciding whether to purge
+ /boot/grub (closes: #588331).
+
+ [ Colin Watson ]
+ * Generate device.map in something closer to the old ordering (thanks,
+ Vadim Solomin).
+
+ [ Updated translations ]
+ * Croatian (hr.po) by Josip Rodin, closes: #588350.
+ * French (fr.po) by Christian Perrier (closes: #588695).
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 12 Jul 2010 11:46:53 +0100
+
+grub2 (1.98+20100706-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - USB hub support.
+ - Fix GRUB_BACKGROUND configuration ordering.
+ - Fix corruption of first entry name in a reiserfs directory.
+ - Don't include MD devices when generating device.map (if you're using
+ RAID and upgraded through 1.98+20100702-1 or 1.98+20100705-1, you may
+ need to fix this up manually).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 06 Jul 2010 18:06:40 +0100
+
+grub2 (1.98+20100705-1) unstable; urgency=medium
+
+ * New Bazaar snapshot.
+ - Bidi and diacritics support.
+ + Use terminfo for ieee1275 terminals (closes: #586953).
+ - Don't use empty grub_device in EFI grub-install (closes: #587838).
+ - Fix grub-setup core.img comparison when not embedding (thanks, Matt
+ Kraai and M. Vefa Bicakci; closes: #586621).
+
+ * Update Source: in debian/copyright (thanks, Jörg Sommer).
+ * Convert by-id disk device names from device.map to traditional device
+ names for display (closes: #587951).
+ * Set urgency=medium. We've cleared out most of the apparent regressions
+ at this point, and #550704 is getting more and more urgent to fix in
+ testing.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 05 Jul 2010 02:09:58 +0100
+
+grub2 (1.98+20100702-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Use video functions in Linux loader rather than hardcoding UGA; load
+ all available video backends (closes: #565576, probably).
+ - Add support for initrd images on Fedora 13.
+ - Output grub.cfg stanzas for Xen (closes: #505517).
+ - Add 'cat --dos' option to treat DOS-style "\r\n" line endings as
+ simple newlines (closes: #586358).
+ - Change grub-mkdevicemap to emit /dev/disk/by-id/ names where possible
+ on Linux.
+ - Return CF correctly in mmap e820/e801 int15 hook (closes: #584846).
+ - The info documentation now has no broken references, although of
+ course it could still use more work (closes: #553460).
+ - Support GRUB_BADRAM in grub-mkconfig.
+ - Skip LVM snapshots (closes: #574863).
+
+ [ Colin Watson ]
+ * Mention grub-rescue-usb.img in grub-rescue-pc description (closes:
+ #586462).
+ * Add instructions for using grub-rescue-usb.img (closes: #586463).
+ * Remove /usr/lib/grub/mips-* from grub-common rather than the incorrect
+ /usr/lib/grub/mipsel-*, so that it stops clashing with grub-yeeloong;
+ add a versioned Replaces to grub-yeeloong just in case (closes:
+ #586526).
+ * Remove qemu-system build-dependency on hurd-i386, where it doesn't seem
+ to exist. Disable tests if qemu-system-i386 isn't available.
+ * Mark "upgrade-from-grub-legacy" paragraph in
+ grub-pc/chainload_from_menu.lst as untranslatable.
+ * Update Homepage field (thanks, Sedat Dilek).
+ * On Linux, if /boot/grub/device.map exists on upgrade to this version,
+ regenerate it to use stable device names in /dev/disk/by-id/. If it had
+ more than one entry, then display a critical-priority debconf note
+ (sorry, but it's better than silently breaking boot menu entries)
+ advising people to check custom boot menu entries and update them if
+ necessary (closes: #583271).
+ * Use 'set -e' rather than '#! /bin/sh -e' or '#! /bin/bash -e', to avoid
+ accidents when debugging with 'sh -x'.
+ * Store grub-pc/install_devices as persistent device names under
+ /dev/disk/by-id/ (closes: #554790). Migrate previous device names to
+ that, with explicit confirmation in non-trivial cases to make sure we
+ got the right ones. If the devices we were told to install to ever go
+ away, ask again. (This is based on the implementation in Ubuntu.)
+ * If grub-install fails during upgrade-from-grub-legacy, allow the user to
+ try again with a different device, but failing that cancel the upgrade
+ (closes: #587790).
+ * Remove numbering from patch files. The order is now explicit in a quilt
+ series file, and renumbering from time to time is tedious.
+
+ [ Updated translations ]
+ * Ukrainian (uk.po) by Yatsenko Alexandr / Borys Yanovych (closes:
+ #586611).
+ * Indonesian (id.po) by Arief S Fitrianto (closes: #586799).
+ * Swedish (sv.po) by Martin Bagge (closes: #586827).
+ * Persian (fa.po) by Behrad Eslamifar (closes: #587085).
+ * French (fr.po) by Christian Perrier (closes: #587383).
+ * Galician (gl.po) by Jorge Barreiro (closes: #587796).
+
+ [ Robert Millan ]
+ * Add commented GRUB_BADRAM example in debian/default/grub.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 02 Jul 2010 17:42:56 +0100
+
+grub2 (1.98+20100617-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Fix i386-pc prefix handling with nested partitions (closes: #585068).
+
+ * When running grub-pc.postinst from upgrade-from-grub-legacy, tell it to
+ disregard the fact that /boot/grub/stage2 and /boot/grub/menu.lst still
+ exist (closes: #550477).
+ * Touch a marker file when grub-install is run but GRUB Legacy files are
+ still around. If that marker file is present, pretend that GRUB Legacy
+ files are missing when upgrading.
+ * If GRUB Legacy files are present when upgrading, scan boot sectors of
+ all disks for GRUB 2. If we find GRUB 2 installed anywhere, then ask
+ the user if they want to finish conversion to GRUB 2, and warn them that
+ not doing so may render the system unbootable (closes: #586143). Thanks
+ to Sedat Dilek for helping to narrow down this bug.
+ * Leaving grub-pc/install_devices empty makes sense in some situations,
+ but more often than not is a mistake. On the other hand, automatically
+ selecting all disk devices would upset some people too. Compromise by
+ simply asking for explicit confirmation if grub-pc/install_devices is
+ left empty, defaulting to false so that simply selecting all the
+ defaults in debconf can't leave you with an unbootable system (closes:
+ #547944, #557425).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 19 Jun 2010 01:31:40 +0100
+
+grub2 (1.98+20100614-2) unstable; urgency=low
+
+ * Build-depend on gcc-4.4-multilib on i386 and kopensolaris-i386 too, in
+ order to build grub-efi-amd64.
+ * Ignore non-option arguments in grub-mkconfig (closes: #586056).
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 16 Jun 2010 17:58:48 +0100
+
+grub2 (1.98+20100614-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Make target-related error messages from grub-mkimage slightly more
+ helpful (closes: #584415).
+ - Fix underquoting that broke savedefault (thanks, Mario 'BitKoenig'
+ Holbe; closes: #584812).
+ - Expand 'info grub' substantially, including a new section on
+ configuring authentication (closes: #584822).
+ - Give all manual pages proper NAME sections (closes: #496706).
+
+ * Update 915resolution from grub-extras:
+ - Fix a hang with 945GME (thanks, Sergio Perticone; closes: #582142).
+
+ [ Colin Watson ]
+ * Disable grub-emu on sparc for the time being. We're currently trying to
+ use TARGET_* flags to build it, which won't work.
+ * Don't build-depend on libsdl1.2-dev on hurd-i386. Although
+ libsdl1.2-dev exists there, it's currently uninstallable due to missing
+ libpulse-dev, and we can happily live without it for now.
+ * kfreebsd-amd64 needs gcc-4.4-multilib too (closes: #585668).
+ * Warn and return without error from prepare_grub_to_access_device if
+ /boot is a dm-crypt device (thanks, Marc Haber; closes: #542165).
+ * Make /etc/grub.d/05_debian_theme usable by shells other than bash
+ (thanks, Alex Chiang; closes: #585561).
+ * Remove grub-mkisofs leftovers from debian/copyright.
+ * Fix reversed sense of DEB_BUILD_OPTIONS=nocheck handling.
+ * Build-depend on qemu-system for grub-pc tests.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 15 Jun 2010 12:45:35 +0100
+
+grub2 (1.98+20100602-2) unstable; urgency=low
+
+ * Only build-depend on libdevmapper-dev on Linux architectures.
+ * Don't build-depend on libusb-dev on hurd-i386, where it doesn't seem to
+ be available.
+ * Fix printf format mismatch in disk/usbms.c (closes: #584474).
+ * Fix verbose error output when device-mapper isn't supported by the
+ running kernel (closes: #584196).
+ * Prepend "part_" to partmap module names in grub-mkconfig, in line with
+ grub-install (closes: #584426).
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 04 Jun 2010 14:01:58 +0100
+
+grub2 (1.98+20100602-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Add btrfs probing support, currently only in the single-device case
+ (closes: #540786).
+ - Fix grub-emu build on mips/powerpc/sparc.
+ - Add safety check to make sure that /boot/grub/locale exists before
+ trying to probe it (closes: #567211).
+ - Several 'info grub' improvements, including a new section on
+ configuration file generation using grub-mkconfig which documents the
+ available keys in /etc/default/grub (closes: #497085).
+ - Many USB fixes.
+
+ [ Colin Watson ]
+ * Reorganise configure and build targets in debian/rules to use stamp
+ files. configure/* never existed and build/* was always a directory, so
+ make never considered either of them up to date (closes: #450505).
+ * Remove config.h.in from AUTOGEN_FILES, since autoheader doesn't
+ necessarily update it.
+ * Remove conf/gcry.mk from AUTOGEN_FILES, and conf/gcry.rmk from their
+ dependencies. autogen.sh runs util/import_gcry.py after autoconf et al,
+ so conf/gcry.rmk's timestamp will be later than some of the
+ autogenerated outputs.
+ * Go back to shipping rescue images in the grub-rescue-pc .deb itself
+ rather than generating them in the postinst. This means that (a) they
+ get removed when the package is removed (closes: #584176); (b) they are
+ listed in package metadata, as is proper for files in /usr (closes:
+ #584218); (c) grub-rescue-pc can potentially be used as a
+ build-dependency for other packages that need to build GRUB images into
+ installation media etc., without having to build-depend on grub-pc which
+ isn't coinstallable with other platform variants and does invasive
+ things in its postinst.
+ * Add grub-mkrescue patch from Thomas Schmitt to allow reducing the size
+ of xorriso-created images. Use this to ensure that
+ grub-rescue-floppy.img fits well within size limits (closes: #548320).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 03 Jun 2010 11:24:41 +0100
+
+grub2 (1.98+20100527-2) unstable; urgency=low
+
+ * Always override statically-linked-binary Lintian tag for kernel.img;
+ dynamic linking makes no sense here.
+ * kernel.img is stripped upstream where it can be, but override Lintian's
+ error for the cases where it can't.
+ * Override binary-from-other-architecture for kernel.img as well as *.mod
+ when building grub-efi-amd64 on i386.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 01 Jun 2010 13:48:14 +0100
+
+grub2 (1.98+20100527-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Support multiple terminals in grub-mkconfig, e.g.
+ GRUB_TERMINAL='serial console' (closes: #506707).
+ - Speed up consecutive hostdisk operations on the same device (closes:
+ #508834, #574088).
+ - Fix grammar error in grub-setup warning (closes: #559005).
+ - Use xorriso for image creation rather than embedding a modified copy
+ of mkisofs (closes: #570156).
+ - Issue an error rather than segfaulting if only some LVM component
+ devices are in device.map (closes: #577808).
+ - Fix typo in make_device_name which caused grub-probe problems on
+ systems with BSD disk labels (closes: #578201).
+ - Add DM-RAID probe support (closes: #579919).
+ - Include all gnumach kernels on Hurd, not just gnumach and gnumach.gz
+ (closes: #581584).
+
+ [ Colin Watson ]
+ * Restore TEXTDOMAINDIR correction in grub.d files, lost by mistake in a
+ merge. Noticed by Anthony Fok.
+ * Don't fail on purge if the ucf association has already been taken over
+ by a different grub package (closes: #574176).
+ * Add debian/grub-extras/*/conf/*.mk to AUTOGEN_FILES.
+ * Remove support for the lpia architecture, now removed from Ubuntu.
+ * Conflict with grub (<< 0.97-54) as well as grub-legacy.
+ * Build-depend on libdevmapper-dev for DM-RAID probe support.
+ * Switch to quilt.
+ * Suggest xorriso (>= 0.5.6.pl00) in grub-common, since grub-mkrescue now
+ needs it. Depend on it in grub-rescue-pc.
+ * Move grub-mkimage to grub-common, now that it only has one
+ implementation.
+ * Clean up temporary files used while building grub-firmware-qemu.
+ * Make grub-probe work with symlinks under /dev/mapper (closes: #550704).
+ * When upgrading a system where GRUB 2 is chainloaded from GRUB Legacy and
+ upgrade-from-grub-legacy has not been run, upgrade the chainloaded image
+ rather than confusing the user by prompting them where they want to
+ install GRUB (closes: #546822).
+ * Build-depend on libsdl1.2-dev for SDL support in grub-emu.
+ * Don't leak debconf's file descriptor to update-grub, so that the LVM
+ tools called from os-prober don't complain about it (closes: #549976).
+ Other leaks are not this package's fault, may not be bugs at all, and in
+ any case os-prober 1.36 suppresses the warnings.
+ * Build-depend on flex (>= 2.5.35).
+ * Build-depend on gcc-4.4-multilib on amd64.
+
+ [ Updated translations ]
+ * Slovenian (sl.po) by Vanja Cvelbar (closes: #570110).
+ * Vietnamese (vi.po) by Clytie Siddall (closes: #574578).
+ * Tamil (ta.po) by Tirumurti Vasudevan (closes: #578282).
+ * Portuguese (pt.po) by Tiago Fernandes (closes: #580140).
+ * Romanian (ro.po) by Eddy Petrișor / Andrei Popescu (closes: #583185).
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 01 Jun 2010 11:24:38 +0100
+
+grub2 (1.98-1) unstable; urgency=low
+
+ * New upstream release (closes: #572898).
+ - Fix grub-script-check to handle empty lines (closes: #572302).
+ - Fix offset computation when reading last sectors. Partition reads and
+ writes within and outside a partition (closes: #567469, #567884).
+ - Fix script execution error handling bug that meant that an error in a
+ menuentry's last statement caused the whole menuentry to fail (closes:
+ #566538, LP: #464743).
+ - Support GRUB_GFXPAYLOAD_LINUX (closes: #536453, LP: #416772).
+
+ [ Samuel Thibault ]
+ * Add GRUB_INIT_TUNE example to /etc/default/grub (closes: #570340).
+
+ [ Colin Watson ]
+ * Build-depend on libusb-dev so that grub-emu is reliably built with USB
+ support (closes: #572854).
+ * Update directions in debian/rules on exporting grub-extras to account
+ for it being maintained in Bazaar nowadays.
+ * Add myself to Uploaders.
+ * Acknowledge NMUs, thanks to Torsten Landschoff and Julien Cristau.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 09 Mar 2010 13:25:35 +0000
+
+grub2 (1.98~20100128-1.2) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Stop setting gfxpayload=keep (closes: #567245).
+
+ -- Julien Cristau <jcristau@debian.org> Sun, 14 Feb 2010 20:37:51 +0100
+
+grub2 (1.98~20100128-1.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Apply trivial patch (already merged upstream) fixing the offset
+ computation for non-cached reads (closes: #567637).
+
+ -- Torsten Landschoff <torsten@debian.org> Mon, 08 Feb 2010 22:15:01 +0100
+
+grub2 (1.98~20100128-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Fix corruption problem when reading files from CDROM. (Closes: #567219)
+
+ [ Felix Zielcke ]
+ * Never strip kernel.img in rules. Upstream already does it when it
+ can be done. (Closes: #561933)
+ * Bump Standards-Version to 3.8.4.
+
+ [ Robert Millan ]
+ * rules: Run the testsuite (make check) when building grub-pc.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Thu, 28 Jan 2010 16:28:45 +0100
+
+grub2 (1.98~20100126-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Includes mipsel-yeeloong port.
+
+ [ Robert Millan ]
+ * config.in: Lower priority of grub2/linux_cmdline_default.
+
+ [ Felix Zielcke ]
+ * Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now.
+ * Ship grub-bin2h and grub-script-check in grub-common.
+ * Terminate NEWS.Debian with a blank line like lintian would suggest
+ if that check would be working correctly.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 26 Jan 2010 19:26:25 +0100
+
+grub2 (1.98~20100115-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Includes savedefault / grub-reboot branch.
+ - Includes Multiboot video support (from latest 1.x draft).
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Fri, 15 Jan 2010 18:15:26 +0100
+
+grub2 (1.98~20100110-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+
+ [ Robert Millan ]
+ * grub-rescue-pc.postinst: Fix image generation during upgrades.
+ (Closes: #564261)
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Sun, 10 Jan 2010 02:45:52 +0100
+
+grub2 (1.98~20100107-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+
+ [ Robert Millan ]
+ * grub-rescue-pc.postinst: Use grub-mkrescue for floppy as well.
+
+ [ Updated translations ]
+ * Chinese (zh_TW.po) by Tetralet. (Closes: #564044)
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Thu, 07 Jan 2010 17:56:10 +0100
+
+grub2 (1.98~20100101-1) unstable; urgency=high
+
+ * New Bazaar snapshot.
+ - Fix FTBS on sparc.
+
+ [ Robert Millan ]
+ * rules: Auto-update version from debian/changelog.
+
+ [ Felix Zielcke ]
+ * Add -O0 to CFLAGS on powerpc to avoid the `_restgpr_31_x in boot is
+ not defined' FTBFS.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Fri, 01 Jan 2010 00:31:37 +0100
+
+grub2 (1.98~20091229-1) unstable; urgency=high
+
+ * New Bazaar snapshot.
+ - Fix slowness when $prefix uses an UUID.
+ (Closes: #541145, LP: #420933)
+ - Correctly set TARGET_CFLAGS. (Closes: #562953)
+
+ [ Robert Millan ]
+ * grub-rescue-pc.postinst: Build USB rescue image.
+ * rules: Invoke configure with relative path. This makes binaries smaller,
+ since dprintf strings are constructed using this path.
+
+ [ Felix Zielcke ]
+ * Urgency=high due to RC bug fix.
+ * Fix version comparison in grub-common.preinst for handling obsolete
+ /etc/grub.d/10_freebsd. (Closes: #562921)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 29 Dec 2009 16:05:00 +0100
+
+grub2 (1.98~20091222-1) unstable; urgency=low
+
+ * New Baazar snapshot.
+ - Make 30_os-prober again dash compatible. (Closes: #562034)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 22 Dec 2009 12:50:57 +0100
+
+grub2 (1.98~20091221-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - Fix search command failing on some broken BIOSes. (Closes: #530357)
+
+ [ Felix Zielcke ]
+ * Add Replaces:/Conflicts: grub-linuxbios to grub-coreboot. (Closes: #561811)
+ * Delete obsolete /etc/grub.d/10_freebsd if it has not been modified,
+ else disable it. (Closes: #560346)
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 21 Dec 2009 22:04:17 +0100
+
+grub2 (1.98~20091210-1) unstable; urgency=low
+
+ * Version bump.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 14 Dec 2009 14:52:59 +0100
+
+grub2 (1.97+20091210-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ - patches/02_fix_mountpoints_in_mkrelpath.diff: Remove (merged).
+ - Fixes FTBFS on powerpc (again) and sparc.
+ - patches/903_grub_legacy_0_based_partitions.diff: Resync (merged into
+ debian branch).
+
+ * Fix dpkg dependency for lenny compatibility.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Thu, 10 Dec 2009 00:35:20 +0100
+
+grub2 (1.97+20091130-1) unstable; urgency=low
+
+ * New Bazaar snapshot.
+ * Enable ntldr-img from grub-extras.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 30 Nov 2009 02:33:03 +0100
+
+grub2 (1.97+20091125-2) unstable; urgency=low
+
+ [ Updated translations ]
+ * Bulgarian (bg.po) by Damyan Ivanovi (Closes: #558039)
+
+ [ Robert Millan ]
+ * control: Remove genisoimage from Build-Depends/Suggests (no longer
+ used).
+ * grub.d/05_debian_theme: Make output string distro-agnostic.
+
+ [ Felix Zielcke ]
+ * patches/02_fix_mountpoints_in_mkrelpath.diff: New patch to handle
+ mount points like the old shell function did. (Closes: #558042)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sun, 29 Nov 2009 21:38:00 +0100
+
+grub2 (1.97+20091125-1) unstable; urgency=low
+
+ [ Robert Millan ]
+ * New upstream snapshot.
+ - Fixes script parser load error.
+
+ * Add gettext to Build-Depends and gettext-base to grub-common's
+ Depends.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 25 Nov 2009 19:22:51 +0100
+
+grub2 (1.97+20091124-1) unstable; urgency=low
+
+ * New upstream snapshot.
+ - Fix grub-mkisofs related FTBFS on powerpc. (Closes: #557704)
+ - Create fake GRUB devices for devices not listed in device.map.
+ This also makes dmraid and multipath work as long as
+ search --fs-uuid works. (Closes: #442382, #540549, LP: #392136)
+ - rules: grub-emu is now built as a port.
+
+ [ Felix Zielcke ]
+ * Change the bt-utf-source build dependency to xfonts-unifont. It's
+ more complete, better maintained and grub-mkfont supports actually
+ more then BDF fonts as input, thanks to libfreetype.
+ * Use grub-probe to get the GRUB device of /boot/grub instead of
+ passing (hd0) to grub-install when creating the core.img with
+ chainloading. This avoids the (UUID=) hack slowness in case
+ /boot/grub is on a different disk then (hd0) in device.map.
+ * patches/903_grub_legacy_0_based_partitions.diff: Update.
+ * Add a build dependency on automake and python.
+ * Set TARGET_CC=$(CC) to really use gcc-4.4 everywhere. Also pass it
+ and CC as arguments to ./configure instead of env vars so they get
+ preserved.
+ * Ship grub-mkrelpath in grub-common.
+ * Ship the locale files in grub-common.
+ * Add a dependency on 'dpkg (>= 1.15.4) | install-info' for grub-common
+ as recommended by Policy and lintian.
+
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 24 Nov 2009 21:20:00 +0100
+
+grub2 (1.97+20091115-1) unstable; urgency=low
+
+ * New upstream snapshot.
+ - Fix security problem with password checking. (Closes: #555195)
+ - Fix the generated GNU/Hurd menu entries and also add support for
+ it in 30_os-prober. (Closes: #555188)
+ - Same grub-mkrescue for grub-pc and grub-coreboot, used by
+ grub-rescue-pc during postinst now. (Closes: #501867)
+
+ [ Felix Zielcke ]
+ * Ship grub-mkisofs in grub-common.
+ * patches/002_grub.d_freebsd.in.diff: Remove (merged upstream).
+ * patches/906_grub_extras.diff: Remove. Superseded by GRUB_CONTRIB variable
+ in recent upstream trunk.
+ * rules: Export GRUB_CONTRIB to enable grub-extras add-ons.
+ * Pass --force to grub-install in the postinst. (Closes: #553415)
+ * Don't strip debug symbols from grub-emu. It's meant for debugging
+ and with them it's much more useful.
+ * Ship grub-mkfloppy in grub-pc.
+ * Revert the Replaces: grub-common to (<= 1.96+20080413-1) on the
+ grub-pc package. It was wrongly modified long ago.
+
+ [ Robert Millan ]
+ * copyright: Document mkisofs.
+ * control: Update Vcs- fields (moved to Bazaar).
+ * rules: Update debian/legacy/update-grub rule to Bazaar.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sun, 15 Nov 2009 19:13:31 +0100
+
+grub2 (1.97-1) unstable; urgency=low
+
+ [ Robert Millan ]
+ * patches/905_setup_force.diff: Remove, no longer needed as of
+ grub-installer >= 1.47.
+ * grub.d/05_debian_theme: Attempt to source grub_background.sh from
+ desktop-base (Needed for #495282, #495616, #500134, see also
+ #550984).
+
+ [ Felix Zielcke ]
+ * Add a build dependency on texinfo.
+ * Fix little typo in /etc/default/grub. (LP: #457703)
+
+ [ Updated translations ]
+ * Finnish (fi.po) by Esko Arajärvi. (Closes: #551912)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sun, 25 Oct 2009 19:50:21 +0100
+
+grub2 (1.97~beta4-1) unstable; urgency=low
+
+ * New upstream beta release.
+
+ [ Felix Zielcke ]
+ * Change the Recommends: os-prober to (>= 1.33).
+ * patches/907_grub.cfg_400.diff: Really add it. Somehow it was a 0 byte file.
+ (Closes: #547409)
+ * Convert newlines back to spaces when parsing kopt from
+ GRUB Legacy's menu.lst, before giving the value to Debconf.
+ Thanks to Colin Watson. (Closes: #547649)
+ * Ship the info docs in grub-common. (Closes: #484074)
+ * Remove generated /usr/share/info/dir* files.
+ * Update the presubj bug file and also install it for grub-common.
+
+ [ Robert Millan ]
+ * Enable ZFS and 915resolution in grub-extras (now requires explicit
+ switch).
+ * grub-common conflicts with grub-doc (<< 0.97-32) and grub-legacy-doc
+ (<< 0.97-59).
+ * Move grub-emu to a separate package.
+
+ [ Updated translations ]
+ * Japanese (ja.po) by Hideki Yamane. (Closes: #549599)
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 05 Oct 2009 20:03:04 +0200
+
+grub2 (1.97~beta3-1) unstable; urgency=high
+
+ * New upstream beta release.
+ - Make it more clear how to use /etc/grub.d/40_custom. (Closes: #545153)
+ - fix a serious memory corruption in the graphical subsystem.
+ (Closes: #545364, #544155, #544639, #544822, LP: #424503)
+ - patches/003_grub_probe_segfault.diff: Remove (merged).
+
+ * Change the watch file so upstream beta releases are recognized.
+ * Include /etc/default/grub in bug reports.
+ * Recommend os-prober (>= 1.32). (Closes: #491872)
+ * Change the gcc-multilib [sparc] build dependency to gcc-4.4-multilib
+ [sparc].
+ * patches/907_grub.cfg_400.diff: New patch to make grub.cfg again mode
+ 444 if it does not contain a password line.
+ * Use `su' in the bug reporting script to read grub.cfg in case the user
+ is not allowed to read it.
+ * Readd grub-pc/kopt-extracted template.
+
+ [ Updated translations ]
+ * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge.
+ * Japanese (ja.po) by Hideki Yamane. (Closes: #545331)
+ * Spanish (es.po) by Francisco Javier Cuadrado. (Closes: #545566)
+ * Italian (it.po) by Luca Monducci. (Closes: #546035)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sat, 12 Sep 2009 15:28:20 +0200
+
+grub2 (1.97~beta2-2) unstable; urgency=low
+
+ [ Updated translations ]
+ * Dutch (nl.po) by Paul Gevers. (Closes: #545050)
+
+ [ Felix Zielcke ]
+ * Move GRUB Legacy's grub-set-default to /usr/lib/grub-legacy in
+ preparation for GRUB 2's grub-set-default.
+ * Remove password lines in bug script.
+
+ [ Robert Millan ]
+ * Do not conflict with `grub' dummy package (this prevented upgrades).
+ * patches/003_grub_probe_segfault.diff: Disable file test codepath, which
+ wasn't normally used before.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sat, 05 Sep 2009 00:27:22 +0200
+
+grub2 (1.97~beta2-1) unstable; urgency=low
+
+ * New upstream beta release.
+ - Fix loading of FreeBSD modules. (Closes: #544305)
+
+ [ Updated translations ]
+ * French (fr.po) by Christian Perrier. (Closes: #544320)
+ * Czech (cs.po) by Miroslav Kure. (Closes: #544327)
+ * Belarusian (be.po) by Hleb Rubanau.
+ * Arabic (ar.po) by Ossama M. Khayat.
+ * Catalan (ca.po) by Juan Andrés Gimeno Crespo.
+ * Russian (ru.po) by Yuri Kozlov. (Closes: #544730)
+ * Swedish (sv.po) by Martin Ågren. (Closes: #544759)
+ * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. (Closes: #544810)
+ * German (de.po) by Helge Kreutzmann. (Closes: #544912)
+
+ [ Robert Millan ]
+ * Build with GCC 4.4.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Fri, 04 Sep 2009 14:40:20 +0200
+
+grub2 (1.97~beta1-1) unstable; urgency=low
+
+ * New upstream beta release.
+
+ [ Updated translations ]
+ * German (de.po) by Helge Kreutzmann. (Closes: #544261)
+ * Asturian (ast.po) by Marcos.
+ * Georgian (ka.po) by Aiet Kolkhi.
+
+ [ Robert Millan ]
+ * Merge config, templates, postinst, postrm, dirs and install files
+ into a single source.
+ * Disable Linux-specific strings on GNU/kFreeBSD. Enable translations
+ in grub2/linux_cmdline_default. Add grub2/kfreebsd_* strings (still
+ unused).
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sun, 30 Aug 2009 18:01:40 +0200
+
+grub2 (1.96+20090829-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Fix filesystem mapping on GNU/kFreeBSD. (Closes: #543950)
+
+ * New grub-extras SVN snapshot.
+ - Add 915resolution support to the GMA500 (poulsbo) graphics chipset.
+ Thanks to Pedro Bulach Gapski. (Closes: #543917)
+
+ * Use `cp -p' to copy /usr/share/grub/default/grub to the temporary
+ file to preverse permissions.
+ * Remove also efiemu files from /boot/grub on purge if requested.
+ * Check that GRUB_CMDLINE_LINUX and GRUB_CMDLINUX_LINUX_DEFAULT is at
+ the start of line in *.postinst.
+ * Don't check that $GRUB_CMDLINE_LINUX{,DEFAULT} are non empty strings
+ in *.config.
+ * Add empty GRUB_CMDLINE_LINUX to /usr/share/grub/default/grub.
+ * Factorise the editing of the temporary file. Thanks to Martin F
+ Krafft.
+ * Read in /etc/default/grub in *.config files.
+
+ [ Updated translations ]
+ * French (fr.po) by Christian Perrier. (Closes: #544023)
+ * Russian (ru.po) by Yuri Kozlov. (Closes: #544077)
+ * Italian (it.po) by Luca Monducci. (Closes: #544200)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sat, 29 Aug 2009 17:01:17 +0200
+
+grub2 (1.96+20090826-3) unstable; urgency=low
+
+ * Add missing quotes in grub-pc.config and *.postinst.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 26 Aug 2009 19:14:23 +0200
+
+grub2 (1.96+20090826-2) unstable; urgency=low
+
+ * Really use the correct templates in grub-pc.config. ARGS.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 26 Aug 2009 14:10:41 +0200
+
+grub2 (1.96+20090826-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ * Use the right templates in grub-pc.config. (Closes: #543615)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 26 Aug 2009 11:00:36 +0200
+
+grub2 (1.96+20090825-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Enable gfxterm only if there's a suitable video backend and don't
+ print an error if not. (Closes: #520846)
+
+ [ Felix Zielcke ]
+ * Copy unicode.pf2 instead of ascii.pf2 to /boot/grub in grub-pc
+ postinst (Closes: #542314).
+ * Update Standards version to 3.8.3.
+ * Use DEB_HOST_ARCH_CPU for the generation of the lintian overrides.
+ * Fix calling the grub-pc/postrm_purge_boot_grub template in
+ grub-pc.postinst.
+ * Handle GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT via
+ debconf. Thanks to Martin F. Krafft and Colin Watson for idea and
+ hints.
+ * Use ucfr --force when /etc/default/grub is registered to a grub-* package.
+ * Use #!/bin/sh in *.config and fix a small bashism in grub-pc.config.
+
+ [ Robert Millan ]
+ * patches/907_terminal_output_workaround.diff: Remove. It seems that
+ it wasn't really necessary.
+ * grub-pc.postinst: Avoid printing an error if /etc/kernel-img.conf
+ doesn't exist, because it is misleading. We simply refrain from
+ fixing it and move along.
+ * grub-pc.postinst: Don't schedule generation of grub.cfg via "grub-install"
+ code path unless we actually run grub-install.
+ * grub-pc.postinst: Only copy unicode.pf2 and moreblue-orbit-grub.png when
+ /boot/grub/grub.cfg is scheduled to be generated.
+ * legacy/upgrade-from-grub-legacy: Reset grub-pc/install_devices.
+ Thanks Colin Watson. (Closes: #541230)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 25 Aug 2009 21:45:24 +0200
+
+grub2 (1.96+20090808-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Fix XFS with inode size different then 256. (Closes: #528761)
+ - Add support for multiple LVM metadata areas. (LP: #408580)
+ - patches/008_dac_palette_width.diff: Remove. (merged)
+ - Prefer unicode over ascii font. (LP: #352034)
+
+ [ Felix Zielcke ]
+ * Fix the generation of the lintian override for efiemu64.o.
+ * Remove the Conflicts dmsetup.
+ * Use ?= for setting DEB_HOST_ARCH.
+ * Document GRUB_DISABLE_LINUX_RECOVERY in /etc/default/grub.
+ (Closes: #476536 LP: #190207)
+ * Add docs/grub.cfg to examples.
+ * patches/01_uuids_and_lvm_dont_play_along_nicely.diff: Updated to
+ also disable UUIDs on LVM over RAID.
+ * Add a debconf prompt to remove all grub2 files from /boot/grub on
+ purge. (Closes: #527068, #470400)
+ * Move the Suggests: os-prober from grub-pc to grub-common.
+ * patches/901_dpkg_version_comparison.diff: Updated.
+ * Update the Replaces on grub-common for the other packages to (<<
+ 1.96+20080831-1). (Closes: #540492)
+
+ [ Robert Millan ]
+ * Reorganize grub-pc.{config,postinst} logic. The idea being that if there's
+ no trace of GRUB Legacy, the grub-pc/install_devices template will be
+ shown even if this is the first install.
+ * When setting grub-pc/install_devices, obtain input dynamically from
+ grub-mkdevicemap (rather than devices.map). (Closes: #535525)
+ * Add a note to grub-pc/install_devices template that it's also possible
+ to install GRUB to a partition boot record.
+ * patches/002_grub.d_freebsd.in.diff: New patch. Reimplement
+ 10_freebsd.in to handle multiple kernel versions & acpi.ko.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 10 Aug 2009 18:49:52 +0200
+
+grub2 (1.96+20090725-1) unstable; urgency=high
+
+ * New SVN snapshot.
+ - Don't add drivemap call with Windows Vista/7. It breaks Win 7.
+ (LP: #402154)
+
+ [ Felix Zielcke ]
+ * Don't build grub-efi-amd64 on hurd-i386.
+ * Change DEB_BUILD_ARCH to DEB_HOST_ARCH in the check for sparc.
+ * Don't add the lintian override for kernel.img for sparc and grub-pc.
+ * Add a lintian override for binary-from-other-architecture for
+ grub-efi-amd64 and grub-pc on i386.
+ * Use wildcards in the lintian overrides.
+ * Add a Conflicts/Replaces for all packages except grub-common.
+ (Closes: #538177)
+
+ [ Robert Millan ]
+ * 008_dac_palette_width.diff: New patch. Fix blank screen when booting
+ Linux with vga= parameter set to a packed color mode (<= 8-bit).
+ (Closes: #535026)
+ * Set urgency=high because #535026 affects 1.96+20090709-1 which is in
+ testing now.
+ * patches/907_terminal_output_workaround.diff: Work around recent regression
+ with terminal_output command (not critical, just breaks gfxterm).
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Sat, 25 Jul 2009 19:00:53 +0200
+
+grub2 (1.96+20090721-4) unstable; urgency=low
+
+ * Place grub-ofpathname only in grub-common. (Closes: #537999)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 22 Jul 2009 13:38:24 +0200
+
+grub2 (1.96+20090721-3) unstable; urgency=low
+
+ * Don't strip kernel.img on sparc.
+ * Suggest efibootmgr on grub-efi-{amd64,ia32}.
+ * Pass --disable-grub-fstest to configure. (Closes: #537897)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 21 Jul 2009 21:46:01 +0200
+
+grub2 (1.96+20090721-2) unstable; urgency=low
+
+ * Add back Conflicts/Replaces grub.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 21 Jul 2009 11:24:45 +0200
+
+grub2 (1.96+20090721-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ * Change License of my update-grub(8) and update-grub2(8) manpages to
+ GPL3+ to match new copyright file.
+ * Merge from Ubuntu: Don't build grub-efi-amd64 on lpia.
+ * Don't pass `--enable-efiemu' to configure. On kfreebsd-i386 it won't
+ compile and it should be now auto detected if it's compilable.
+ (Closes: #536783)
+ * Don't build grub-efi-amd64 on kfreebsd-i386. It lacks 64bit compiler
+ support.
+ * Rename the lintian override for kernel.elf to kernel.img.
+ * Strip kernel.img not kernel.elf, but not in the case of grub-pc.
+ * Rename the Conflicts/Replaces grub to grub-legacy. (Closes: #537824)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 21 Jul 2009 10:50:20 +0200
+
+grub2 (1.96+20090709-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ * control (Build-Depends): Add gcc-multilib [sparc].
+ * copyright: Rewrite using DEP-5 format.
+ * Merge grub-extras into the package, and integrate it with GRUB's
+ build system.
+ - patches/906_grub_extras.diff
+ - rules
+ - copyright
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Thu, 09 Jul 2009 00:26:49 +0200
+
+grub2 (1.96+20090702-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ * rules: Remove duplicated files in sparc64-ieee1275 port.
+ * rules: Comment out -DGRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 setting. We'll
+ re-evaluate using it when it's more mature. (Closes: #535026).
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Thu, 02 Jul 2009 13:23:51 +0200
+
+grub2 (1.96+20090629-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Misc fixes in Linux loader.
+
+ * control (grub-firmware-qemu): Make it buildable only on i386/amd64.
+ * control: Add sparc (grub-ieee1275), remove remnants of ppc64.
+ * rules: Include all modules in grub-firmware-qemu build.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Mon, 29 Jun 2009 19:22:37 +0200
+
+grub2 (1.96+20090628-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ * Re-enable QEMU port.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Sun, 28 Jun 2009 01:11:10 +0200
+
+grub2 (1.96+20090627-2) unstable; urgency=low
+
+ * Disable QEMU port untill it goes through NEW.
+ * Upload to unstable.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Sat, 27 Jun 2009 18:40:17 +0200
+
+grub2 (1.96+20090627-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Fix parsing of --output in grub-mkconfig. (Closes: #532956)
+
+ [ Felix Zielcke ]
+ * Use ucfr --force in grub-ieee1275.postinst in case we're upgrading
+ from previous version. It registered /etc/default/grub wrongly with
+ package iee1275.
+ * Drop the build dependency on libc6-dev-i386.
+ * Remove ppc64 from the Architectures. It's totally dead.
+ * Add a note to /etc/default/grub that update-grub needs to be run to
+ update grub.cfg. (Closes: #533026)
+ * Fix the svn-snapshot rule.
+ * Update Standards version to 3.8.2. No changes needed.
+
+ [ Robert Millan ]
+ * legacy/upgrade-from-grub-legacy: Invoke grub-pc.postinst directly rather
+ than dpkg-reconfigure. Since we pretend we're upgrading, it will DTRT.
+ * Add grub-firmware-qemu package.
+ - patches/008_qemu.diff: QEMU port (patch from upstream).
+ - control (grub-firmware-qemu): New package.
+ - rules: Add grub-firmware-qemu targets.
+ - debian/grub-firmware-qemu.dirs
+ - debian/grub-firmware-qemu.install
+ * patches/906_revert_to_linux16.diff: Remove, now that gfxpayload is
+ supported.
+
+ -- Robert Millan <rmh.debian@aybabtu.com> Sat, 27 Jun 2009 00:46:23 +0200
+
+grub2 (1.96+20090611-1) experimental; urgency=low
+
+ * New SVN snapshot.
+
+ * Append .diff to patches/01_uuids_and_lvm_dont_play_along_nicely so
+ it gets really applied.
+ * Drop completely the build dependency on gcc-multilib.
+ * Instead of arborting in the preinst if /etc/kernel-img.conf still
+ contains /sbin/update-grub, change the file with sed. Policy allows
+ thisi, because it's not a conffile, according to Colin Watson.
+ * Change /etc/default/grub to an ucf managed file instead of dpkg
+ conffile.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Fri, 12 Jun 2009 11:46:24 +0200
+
+grub2 (1.96+20090609-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Fix variable parsing inside strings. (Closes: #486180)
+ - Add `true' command. (Closes: #530736)
+
+ [ Robert Millan ]
+ * Split grub-efi in grub-efi-ia32 and grub-efi-amd64, both available
+ on i386 and amd64. (Closes: #524756)
+ * Add kopensolaris-i386 to arch list.
+
+ [ Felix Zielcke ]
+ * Add a NEWS entry about the grub-efi split.
+ * Drop the build dependency on gcc-multilib for all *i386.
+ * Change upgrade-from-grub-legacy to use `dpkg-reconfigure grub-pc' to
+ install grub2 into MBR.
+
+ [ New translations ]
+ * Catalan (ca.po) by Jordi Mallach.
+
+ [ Updated translations ]
+ * Spanish (es.po) by Francisco Javier Cuadrado. (Closes: #532407)
+
+ -- Jordi Mallach <jordi@debian.org> Tue, 09 Jun 2009 19:21:15 +0200
+
+grub2 (1.96+20090603-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ * Abort the install of grub-pc if /etc/kernel-img.conf still contains
+ /sbin/update-grub (Closes: #500631).
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 03 Jun 2009 20:01:11 +0200
+
+grub2 (1.96+20090602-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ [ Felix Zielcke ]
+ * Skip floopies in the grub-install debconf prompt in grub-pc postinst.
+ Patch by Fabian Greffrath. (Closes: #530848)
+
+ [ Robert Millan ]
+ * Change Vcs-Browser field to viewsvn.
+
+ [ Felix Zielcke ]
+ * Change Vcs-Svn field to point to the trunk. (Closes: #531391)
+ * patches/01_uuids_and_lvm_dont_play_along_nicely: New patch.
+ On Debian root=UUID= with lvm still doestn't work so disable it.
+ (Closes: #530357)
+ * Remove Otavio Salvador from Uploaders with his permission.
+ * add grub-pc.preinst
+
+ -- Felix Zielcke <fzielcke@z-51.de> Wed, 03 Jun 2009 14:42:11 +0200
+
+grub2 (1.96+20090523-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Add drivemap command, similar to grub-legacy's map command.
+ (Closes: 503630)
+ - Export GRUB_TERMINAL_INPUT in grub-mkconfig. (Closes: #526741)
+
+ [ Robert Millan ]
+ * rules: Set GRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 in CFLAGS.
+ * patches/905_setup_force.diff: Relax blocklist warnings.
+ * patches/906_revert_to_linux16.diff: Keep using linux16 for now.
+
+ [ Felix Zielcke ]
+ * patches/07_core_in_fs.diff: Updated.
+ * Remove /etc/grub.d/10_hurd on non-Hurd systems in the grub-common
+ preinst. Likewise for 10_freebsd for non kFreebsd and 10_linux on
+ kFreebsd and Hurd. (Closes: #523777)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sat, 23 May 2009 20:05:10 +0200
+
+grub2 (1.96+20090504-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Add support for parttool command, which can be used to hide partitions.
+ (Closes: #505905)
+ - Fix a segfault with LVM on RAID. (Closes: #520637)
+ - Add support for char devices on (k)FreeBSD. (Closes: #521292)
+ - patches/08_powerpc-ieee1275_build_fix.patch: Remove (merged).
+
+ [ Updated translations ]
+ * Basque (eu.po) by Piarres Beobide. (Closes: #522457)
+ * German (de.po) by Helge Kreutzmann. (Closes: #522815)
+
+ [ Robert Millan ]
+ * Update my email address.
+ * Remove 04_uuids_and_abstraction_dont_play_along_nicely.diff now that
+ bugs #435983 and #455746 in mdadm and dmsetup have been fixed.
+
+ [ Felix Zielcke ]
+ * Place new grub-dumpbios in grub-common.
+ * Add lpia to the archictectures to reduce the ubuntu delta.
+ * Add a manpage for the update-grub and update-grub2 stubs, written by
+ me. (Closes: #523876)
+ * Suggest genisoimage on grub-pc and grub-ieee1275, because grub-mkrescue
+ needs it to create a cd image. (Closes: #525845)
+ * Add a dependency on $(AUTOGEN_FILES) for the configure/grub-common target,
+ this is needed now that upstream removed the autogenerated files from SVN.
+ * Add `--enable-efiemu to' `./configure' flags.
+ * Add a build dependency on gcc-multilib for i386.
+ * Drop alternate build dependency on gcc-4.1 (<< 4.1.2).
+
+ -- Felix Zielcke <fzielcke@z-51.de> Mon, 04 May 2009 21:01:22 +0200
+
+grub2 (1.96+20090402-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Fix regression in disk/raid.c. (Closes: #521897, #514338)
+ - Fix handling of filename string lengths in HFS.
+ (Really closes: #516458).
+ * Add myself to Uploaders.
+ * Add patch 08_powerpc-ieee1275_build_fix.patch to fix powerpc-ieee1275
+ builds which were lacking header files for kernel_elf_HEADERS. Thanks
+ Vladimir Serbinenko.
+
+ -- Jordi Mallach <jordi@debian.org> Fri, 03 Apr 2009 20:58:37 +0200
+
+grub2 (1.96+20090401-1) experimental; urgency=low
+
+ [ Felix Zielcke ]
+ * New SVN snapshot.
+ - Pass grub's gfxterm mode to Linux kernel. (Closes: #519506)
+ - Fix ext4 extents on powerpc. (Closes: #520286)
+
+ [ Robert Millan ]
+ * Remove grub-of transitional package (Lenny had grub-ieee1275 already).
+ * Fix kopt parsing in grub-pc.config. Thanks Marcus Obst. (Closes: #514837)
+ * Add debconf template to automatically run grub-install during upgrades
+ (prior user confirmation). (Closes: #514705)
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 01 Apr 2009 01:19:45 +0200
+
+grub2 (1.96+20090317-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Fix loading of files with underscore in HFS. (Closes: #516458)
+
+ * Update Standards version to 3.8.1. No changes needed.
+
+ [ Updated translations ]
+ * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. (Closes: #519417)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 17 Mar 2009 14:42:10 +0100
+
+grub2 (1.96+20090309-1) unstable; urgency=low
+
+ * New SVN snapshot.
+
+ -- Felix Zielcke <fzielcke@z-51.de> Mon, 09 Mar 2009 10:03:13 +0100
+
+grub2 (1.96+20090307-1) unstable; urgency=low
+
+ * New SVN snapshot.
+ - Add support for /dev/md/dNNpNN mdraid devices. (Closes: #509960)
+ - Add new PF2 fontengine. (Closes: #510344)
+ - Avoid mounting ext2 partitions with backward-incompatible features.
+ (Closes: #502333)
+ - Try to avoid false positives with FAT. (Closes: #514263)
+
+ [ Felix Zielcke ]
+ * Remove build-dependency on unifont package and add one for bf-utf-source
+ package and libfreetype6-dev
+ * grub-pc.postinst: Copy new ascii.pf2 instead of old ascii.pff to /boot/grub.
+ * Add `--enable-grub-mkfont' to configure flags.
+ * Put new grub-mkfont in grub-common package.
+ * Add a dependency for ${misc:Depends} to all packages to make lintian a bit
+ more happy.
+ * Detect when grub-setup leaves core.img in filesystem, and include that
+ info in bug report templates.
+ - debian/patches/07_core_in_fs.diff
+ - debian/script
+ * Add myself to Uploads and add `DM-Upload-Allowed: yes' tag.
+
+ [ Updated translations ]
+ * Asturian (ast.po) by Marcos Alvarez Costales. (Closes: #511144)
+ * Traditional Chinese (zh_TW.po) by Tetralet. (Closes: #513918)
+ * Belarusian (be.po) by Pavel Piatruk. (Closes: #516243)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Sat, 07 Mar 2009 11:54:43 +0100
+
+grub2 (1.96+20081201-1) experimental; urgency=low
+
+ * New SVN snapshot.
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 1 Dec 2008 00:07:31 +0100
+
+grub2 (1.96+20081120-1) experimental; urgency=low
+
+ * New SVN snapshot.
+
+ * Update to new debian theme.
+ - grub-pc.postinst: Switch to moreblue-orbit-grub.png.
+ - grub.d/05_debian_theme: Likewise.
+ * grub.d/05_debian_theme:
+ - Update to use new grub-mkconfig_lib instead of the deprecated
+ update-grub_lib.
+ - Update to check if `GRUB_TERMINAL_OUTPUT' is `gfxterm' instead of
+ `GRUB_TERMINAL'.
+
+ [ Updated translations ]
+ * Romanien (ro.po) by Eddy Petrișor. (Closes: #506039)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Thu, 20 Nov 2008 20:25:56 +0100
+
+grub2 (1.96+20081108-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Add support for /dev/md/N style mdraid devices. (Closes: #475585)
+ - Handle LVM dash escaping. (Closes: #464215)
+ - Use case insensitive match in NTFS. (Closes: #497889)
+ - Use hd%d drive names in grub-mkdevicemap for all architectures.
+ (Closes: #465365)
+ - Handle LVM circular metadata. (Closes: #462835, #502953)
+ - Fix NULL dereference and failure paths in LVM. Thanks Guillem Jover.
+ (Closes: #500482)
+ - Provides GRUB header files (only in grub-common).
+
+ [ Updated translations ]
+ * Dutch (nl.po) by Paul Gevers. (Closes: #500514)
+ * French (fr.po) by Christian Perrier. (Closes: #503708)
+ * Georgian (ka.po) by Aiet Kolkhi. (Closes: #503715)
+ * Czech (cs.po) by Miroslav Kure. (Closes: #503809)
+ * German (de.po) by Helge Kreutzmann. (Closes: #503841)
+ * Japanese (ja.po) by Hideki Yamane. (Closes: #503869)
+ * Italian (it.po) by Luca Monducci. (Closes: #504076)
+ * Swedish (sv.po) by Martin Ågren. (Closes: #504207)
+ * Arabic (ar.po) by Ossama Khayat. (Closes: #504254)
+ * Portuguese (pt.po) by Miguel Figueiredo. (Closes: #504280)
+ * Russian (ru.po) by Yuri Kozlov. (Closes: #504324)
+ * Finnish (fi.po) by Esko Arajärvi. (Closes: #504310)
+ * Basque (eu.po) by Piarres Beobide. (Closes: #504466)
+ * Dutch (nl.po) by Paul Gevers. (Closes: #504683)
+
+ [ Felix Zielcke ]
+ * patches/01_grub_legacy_0_based_partitions.diff: Rename to
+ * patches/903_grub_legacy_0_based_partitions.diff: this and adapt for
+ s/biosdisk.c/hostdisk.c/ rename upstream.
+ * patches/03_disable_floppies.diff
+ patches/904_disable_floppies.diff: Likewise.
+ * update-grub has been renamed to grub-mkconfig, so provide a stub for
+ compatibility.
+ * Make grub-pc/linux_cmdline debconf template translatable. (Closes: #503478)
+ * Remove ro.po and ta.po. They don't contain a single translated
+ message.
+
+ [ Robert Millan ]
+ * control: Make grub-common dependency = ${binary:Version}.
+ * default/grub: Set GRUB_CMDLINE_LINUX=quiet to syncronize with
+ default D-I settings.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 8 Nov 2008 13:54:10 +0100
+
+grub2 (1.96+20080831-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - patches/00_fix_double_prefix.diff: Remove (merged). (Closes: #487565)
+ - patches/00_getline.diff: Remove (merged). (Closes: #493289)
+ - Handle errors in RAID/LVM scan routine (rather than letting the upper
+ layer cope with them). (Closes: #494501, #495049)
+ - patches/901_linux_coreboot.diff: Remove (replaced).
+ - Add support for GFXMODE variable (Closes: #493106)
+ - Skips /dev/.* in grub-probe. (Closes: #486624)
+ - RAID code has various fixes. (Closes: #496573)
+ - Buffered file read is now used to read the background image faster.
+ (Closes: #490584)
+
+ * We are already using LZMA, because upstream includes it's own lzma encoder,
+ so drop completely the liblzo handling in control and rules files.
+
+ [ Felix Zielcke ]
+ * Remove the 1.95 partition numbering transition debconf warning
+ from grub2 package and removed it from all languages (*.po).
+ (Closes: #493744)
+ * Add a comment for the new GFXMODE in default/grub.
+ * debian/rules:
+ - Remove 2 ./configure options which it didn't understand.
+ - New grub-mkelfimage belongs to grub-common.
+ * debian/control:
+ - Change debhelper compat level to 7 and build depend on it >= 7.
+ - Remove ${misc:Depend} dependency on all packages except grub-pc which is
+ the only one using debconf.
+ - Replace deprecated ${Source-Version} with ${source:Version} for <<
+ dependency and with ${build:Version} for = ones.
+ - Remove versioned dependency of Build-Depends patchutils and cdbs,
+ because etch has newer versions then the one used.
+ - Remove dpkg-dev completely from Build-Depends because it's
+ build-essentail and a non versioned dependency results in a lintian error.
+ - Remove Conflict/Replaces pupa, it has been removed from Debian 2004.
+ - Change build-dependency of unifont-bin to unifont (>= 1:5.1.20080820),
+ it's the new package containing unifont.hex and that version to avoid
+ licensing problems (Closes: #496061)
+ - Remove Jason Thomas from Uploaders with his permission.
+ * Preserve arguments in update-grub2 stub. (Closes: #496610)
+
+ [ Updated translations ]
+ * Japanese (ja.po) by Hideki Yamane (Closes: #493347)
+
+ [ Robert Millan ]
+ * Move a few files to grub-common and remove them from the arch-
+ specific packages.
+ * patches/02_old_linux_version_comparison.diff: Replace with ...
+ * patches/901_dpkg_version_comparison.diff: ... this.
+ Use dpkg --compare-versions in update-grub. (Closes: #494158)
+ * patches/03_disable_floppies.diff: Free .drive struct member when skipping
+ floppy drives. (Closes: #496040)
+ * patches/902_boot_blocklist_hack.diff: Support separate /boot when using
+ blocklists. (Closes: #496820, #489287, #494589)
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 31 Aug 2008 18:40:09 +0200
+
+grub2 (1.96+20080730-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - patches/00_fix_overflow.diff: Remove (merged).
+ - patches/00_uuid_boot.diff: Remove (merged).
+ - patches/00_raid_duped_disks.diff: Remove (merged).
+ - patches/00_xfs.diff: Remove (merged).
+ - patches/00_strengthen_apple_partmap_check.diff: Remove (merged).
+ - patches/00_skip_dev_dm.diff: Remove (merged).
+
+ * patches/901_linux_coreboot.diff: Implements Linux load on Coreboot
+ (patch from Coresystems).
+
+ * grub-linuxbios -> grub-coreboot rename again.
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 30 Jul 2008 22:12:07 +0200
+
+grub2 (1.96+20080724-4) unstable; urgency=high
+
+ * patches/00_fix_overflow.diff: fix overflow with a big grub.cfg.
+ (Closes: #473543)
+
+ -- Felix Zielcke <fzielcke@z-51.de> Tue, 29 Jul 2008 17:10:59 +0200
+
+grub2 (1.96+20080724-3) unstable; urgency=low
+
+ [ Felix Zielcke ]
+ * changed dependency for debconf to also support debconf-2.0. (Closes: #492543)
+ * patches/00_xfs.diff: Fix "out of partition" error with XFS.
+ (Closes: #436943)
+
+ [ Robert Millan ]
+ * patches/00_raid_duped_disks.diff: Do not abort when two RAID disks with
+ the same number are found. (Closes: #492656)
+ * patches/00_strengthen_apple_partmap_check.diff: Be more strict when probing
+ for Apple partition maps (this prevents false positives on i386-pc
+ installs). (Closes: #475718)
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 29 Jul 2008 00:48:01 +0200
+
+grub2 (1.96+20080724-2) unstable; urgency=high
+
+ [ Felix Zielcke ]
+ * fixed lintian override for kernel.elf
+ * debian/rules: changed cvs targets to use svn
+
+ [ Robert Millan ]
+ * patches/00_skip_dev_dm.diff: Skip /dev/dm-[0-9] devices also (implicitly)
+ for RAID. (Closes: #491977)
+ * patches/00_uuid_boot.diff: Fix cross-disk installs by using UUIDs.
+ (Closes: #492204)
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 26 Jul 2008 01:06:07 +0200
+
+grub2 (1.96+20080724-1) unstable; urgency=high
+
+ * New SVN snapshot.
+ - Support for ext4dev extents.
+ - patches/00_speed_up_font_load.diff: Remove (merged).
+
+ [ Felix Zielcke ]
+ * upgrade-from-grub-legacy now calls update-grub if grub.cfg doestn't exist
+ and prints a big warning if it failed.
+ * Update Standards version to 3.8.0. No changes need.
+ * Added Build-Dep for po-debconf and a lintian override, to make it happy.
+
+ [ Updated translations ]
+ * Swedish (sv.po) by Martin Ågren (Closes: #492056)
+
+ [ Robert Millan ]
+ * Revert r844. grub-coreboot is stuck on NEW, and it was too early
+ for branching.
+
+ -- Robert Millan <rmh@aybabtu.com> Thu, 24 Jul 2008 13:27:53 +0200
+
+grub2 (1.96+20080717-1) experimental; urgency=low
+
+ * New SVN snapshot.
+ - Provides LZMA support (not yet used in the package).
+ - Fix grub-mkrescue manpage generation. (Closes: #489440)
+
+ * Rename grub-linuxbios to grub-coreboot (and leave a dummy grub-linuxbios
+ package to handle upgrades).
+
+ [ Updated translations ]
+ * Spanish (es.po) by Maria Germana Oliveira Blazetic (Closes: #489877)
+ * Portuguese (pt.po) by Ricardo Silva (Closes: #489807)
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 12 Jul 2008 17:47:09 +0200
+
+grub2 (1.96+20080704-2) unstable; urgency=high
+
+ * patches/02_old_linux_version_comparison.diff: Set interpreter to /bin/bash.
+ (Closes: #489426, #489446)
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 7 Jul 2008 15:17:58 +0200
+
+grub2 (1.96+20080704-1) unstable; urgency=high
+
+ * New SVN snapshot.
+ * default/grub: Add commented example to disable graphical terminal.
+ * Use substvars to support linking with liblzo1.
+ * Bring 03_disable_floppies.diff to pre-r805 state. (Closes: #488375)
+ * patches/02_old_linux_version_comparison.diff: New patch. Steal version
+ comparison code from GRUB Legacy's update-grub. (Closes: #464086, #489133)
+ * patches/00_speed_up_font_load.diff: New patch. Generate font files with
+ only the needed characters. (Closes: #476479, #477083)
+
+ -- Robert Millan <rmh@aybabtu.com> Fri, 4 Jul 2008 21:39:07 +0200
+
+grub2 (1.96+20080626-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Avoids passing UUID to Linux when not using initrd. (Closes: #484228)
+ - patches/04_uuids_and_abstraction_dont_play_along_nicely.diff: Resync.
+
+ -- Robert Millan <rmh@aybabtu.com> Thu, 26 Jun 2008 16:43:48 +0200
+
+grub2 (1.96+20080621-1) unstable; urgency=high
+
+ * Urgency set to "high" because of #482688.
+ * New CVS snapshot.
+ - Fix module load hook in prepare_grub_to_access_device().
+ (Closes: #486804)
+ - Call prepare_grub_to_access_device() before accessing devices, never
+ afterwards. (Closes: #487198)
+ * grub.d/05_debian_theme: Prefer /boot/grub over /usr for image
+ loading, since chances are it's less LVMed.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 21 Jun 2008 15:52:48 +0200
+
+grub2 (1.96+20080617-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Supports IDA block devices. (Closes: #483858)
+ - Fixes some problems in ext2/ext3. (Closes: #485068, #485065)
+ - Uses EUID instead of UID in update-grub. (Closes: #486043, #486039,
+ #486040, #486041).
+ - Fixes incomplete I2O device support. Thanks Sven Mueller.
+ (Closes: #486505)
+ - Fixes recent regressions in fs/ext2.c. (Closes: #485279)
+ - Only use UUIDs when requested device is not the same as the one
+ providing /boot. (Closes: #486119)
+ - patches/02_libgcc_powerpc_hack.diff: Remove. Probably not needed
+ anymore.
+ - patches/04_uuids_and_abstraction_dont_play_along_nicely.diff: Update.
+ * patches/06_olpc_prefix_hack.diff: Hardcode prefix to (sd,1) on OLPC.
+ * Refurbish 03_disable_floppy_support_in_util_biosdisk.diff into
+ 03_disable_floppies.diff.
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 17 Jun 2008 01:07:52 +0200
+
+grub2 (1.96+20080601-2) unstable; urgency=low
+
+ * 04_run_grub_mkdevicemap_when_grub_probe_fails.diff: Remove. Argueably
+ makes grub-probe unreliable and is quite annoying.
+ * 04_uuids_and_abstraction_dont_play_along_nicely.diff: New patch. Disable
+ UUID parameter to Linux when LVM or dmRAID is in use. (Closes: #484228)
+ This is a workaround for bug #484297 in udev.
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 3 Jun 2008 16:29:53 +0200
+
+grub2 (1.96+20080601-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - patches/06_backward_compat_in_uuid_support.diff: Merged.
+ - Fixes NULL pointer dereference in biosdisk.c. (Closes: #483895, #483900)
+ - Extends UUID support for XFS and ReiserFS.
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 1 Jun 2008 15:44:08 +0200
+
+grub2 (1.96+20080531-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Work around BIOS bug affecting keyboard on macbooks. (Closes: #482860)
+ - Adjust grub.d/05_debian_theme to use the new UUID-compatible API.
+ - default/grub: Add commented GRUB_DISABLE_LINUX_UUID variable.
+ - patches/06_backward_compat_in_uuid_support.diff: New. Make update-grub
+ generate code that is compatible with older GRUB installs.
+ - util/biosdisk.c no longer complains about duplicated device.map entries.
+ (Closes: #481236)
+
+ [ Updated translations ]
+ * Galician (gl.po) by Jacobo Tarrio (Closes: #480977)
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 31 May 2008 00:02:54 +0200
+
+grub2 (1.96+20080512-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Adds support for default-only Linux cmdline options. (Closes: #460843)
+ - Supports Xen virtual block devices. (Closes: #456777)
+ - Supports Virtio block devices. (Closes: #479056)
+ - Supports CCISS block devices. (Closes: #479735)
+ - Fixes handling of more LVM abnormal conditions. (Closes: #474343,
+ #474931, #477175)
+
+ * Switch to liblzo2 now that it's GPLv3-compatible. (Closes: #466375)
+ * grub-pc.postinst: Escape \ and / in cmdline sed invokation.
+ (Closes: #479279)
+
+ [ Updated translations ]
+ * Italian (it.po) by Luca Monducci (Closes: #480740)
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 12 May 2008 17:46:38 +0200
+
+grub2 (1.96+20080429-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Includes sample grub.cfg file; we use it for grub-rescue-pc.
+ (Closes: #478324)
+ * grub-common: Upgrade Replaces to << 1.96+20080426-3. (Closes: #478224,
+ #478353, #478144)
+
+ [ Updated translations ]
+ * French (fr.po) by Christian Perrier (Closes: #471291)
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 29 Apr 2008 13:27:52 +0200
+
+grub2 (1.96+20080426-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Fixes syntax error when setting GRUB_PRELOAD_MODULES. (Closes: #476517)
+ * Move os-prober to Suggests, to avoid trouble with #476184.
+ (Closes: #476684)
+ * patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff: New patch,
+ does what its name says. (Closes: #467127)
+ - Also move grub-mkdevicemap from grub-pc to grub-common, so that GRUB
+ Legacy can use it.
+
+ [ Updated translations ]
+ * Basque (eu.po) by Piarres Beobide (Closes: #476708)
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 26 Apr 2008 20:06:55 +0200
+
+grub2 (1.96+20080413-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Provides 30_os-prober update-grub add-on. Thanks Fabian Greffrath.
+ (Closes: #461442)
+ - Improves robustness when handling LVM.
+ (Closes: #474931, #474343)
+ * patches/03_disable_floppy_support_in_util_biosdisk.diff: New. Does
+ what its name says. (Closes: #475177)
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 13 Apr 2008 13:53:28 +0200
+
+grub2 (1.96+20080408-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - grub-probe skips non-existant devices when processing device.map.
+ (Closes: #473209)
+ * control: Fix syntax error.
+
+ [ Updated translations ]
+ * Finnish (fi.po) by Esko Arajärvi (Closes: #468641)
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 8 Apr 2008 15:45:25 +0200
+
+grub2 (1.96+20080228-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ * Split grub-probe into grub-common package. Make all flavours depend on it.
+ (Closes: #241972)
+ * Suggest multiboot-doc.
+ * patches/01_grub_legacy_0_based_partitions.diff: New patch. Add a hack that
+ tells grub-probe you want 0-based partition count
+ (GRUB_LEGACY_0_BASED_PARTITIONS variable)
+ * Stop depending on lsb-release (too heavy! we don't need python in base).
+ Instead of assuming it's there, try calling it and otherwise just echo
+ Debian.
+
+ -- Robert Millan <rmh@aybabtu.com> Thu, 28 Feb 2008 16:43:40 +0100
+
+grub2 (1.96+20080219-3) unstable; urgency=low
+
+ * default/grub: Use lsb_release to support Debian derivatives.
+ (Closes: #466561)
+ * grub.d/05_debian_theme: Only setup background image when a reader for it
+ is present in /boot/grub. (Closes: #467111)
+
+ [ Updated translations ]
+ * Russian (ru.po) by Yuri Kozlov (Closes: #467181)
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 24 Feb 2008 15:39:50 +0100
+
+grub2 (1.96+20080219-2) unstable; urgency=high
+
+ * grub-pc.postinst: Create /boot/grub if it doesn't exist.
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 20 Feb 2008 07:15:14 +0100
+
+grub2 (1.96+20080219-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Improves GPT support, allowing it to work without blocklists.
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 19 Feb 2008 15:05:10 +0100
+
+grub2 (1.96+20080216-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Fixes offset calculation issue when installing on GPT (urgency set
+ to high because of this).
+ * Fix Vcs-Browser tag. Thanks James. (Closes: #465697)
+ * Only process grub-pc/linux_cmdline if /boot/grub/menu.lst exists.
+ (Closes: #465708)
+
+ [ Updated translations ]
+ * French (fr.po) by Christian Perrier (Closes: #465706)
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 16 Feb 2008 23:30:55 +0100
+
+grub2 (1.96+20080213-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Failure to read one device in a RAID-1 array no longer causes boot
+ to fail (so long as there's a member that works). (Closes: #426341)
+ * script: For /proc/mounts, only report lines that start with /dev/.
+ * Add new upgrade-from-grub-legacy script for the user to complete the upgrade
+ process from GRUB Legacy, and advertise it prominently in menu.lst.
+ (Closes: #464912)
+ * Add a hack to support gfxterm / background_image on systems where /usr
+ isn't accessible. (Closes: #464911, #463144)
+ - grub-pc.postinst
+ - grub.d/05_debian_theme
+ * Fix a pair of spelling mistakes in debconf. (Closes: #465296)
+ * Migrate kopt from menu.lst. (Closes: #461164, #464918)
+
+ [ Updated translations ]
+ * Portuguese (pt.po) by Ricardo Silva (Closes: #465137)
+ * German (de.po) by Helge Kreutzmann (Closes: #465295)
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 13 Feb 2008 16:37:13 +0100
+
+grub2 (1.96+20080210-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Errors that cause GRUB to enter rescue mode are displayed now.
+ (Closes: #425149)
+ - Build LVM/RAID modules into a few commands that were missing them
+ (notably, grub-setup). (Closes: #465033)
+ * Fix license violation (incompatibility between GRUB and LZO2).
+ (Closes: #465056)
+ - Urgency set to high.
+ - control: Move liblzo2-dev from Build-Depends to Build-Conflicts
+ (leaving liblzo-dev as the only option).
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 10 Feb 2008 17:09:15 +0100
+
+grub2 (1.96+20080209-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Fix a root device setting issue in grub-setup. (Closes: #463391)
+ - Fix partmap detection under LVM/RAID.
+ - Add scripting commands that would allow user to implement hiddenmenu-like
+ functionality (http://grub.enbug.org/Hiddenmenu).
+ - Provide manpages for grub-setup, grub-emu, grub-mkimage and others.
+ (Closes: #333516, #372890)
+ * Fix a pair of spelling errors in debconf templates. Thanks Christian
+ Perrier. (Closes: #464133)
+ * Run debconf-updatepo. (Closes: #463918)
+ * Lower base-files versioned dependency to >= 4.0.1~bpo40+1.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 9 Feb 2008 13:43:49 +0100
+
+grub2 (1.96+20080203-1) unstable; urgency=low
+
+ * New CVS snapshot (and release, but we skipped that ;-))
+ - patches/01_regparm.diff: Delete.
+ - Improved XFS support.
+ - util/grub.d/00_header.in: Add runtime error detection (for gfxterm).
+ - Fixes problem when chainloading to Vista.
+ * Fix po-debconf errors. Thanks Thomas Huriaux. (Closes: #402972)
+ * grub.d/05_debian_theme:
+ - Add runtime error detection.
+ - Detect/Enable PNG background when it is present.
+ * control (grub-ieee1275): Remove versioned dependency on powerpc-ibm-utils.
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 3 Feb 2008 19:31:23 +0100
+
+grub2 (1.95+20080201-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ * presubj: Improve notice.
+ * patches/01_regparm.diff: Fix CPU context corruption affecting fs/xfs.c.
+ (Closes: #463081, #419766, #462159)
+ * patches/02_libgcc_powerpc_hack.diff: Fix FTBFS on powerpc. (Closes: #457491)
+ * patches/disable_xfs.diff: Actually remove this time...
+
+ -- Robert Millan <rmh@aybabtu.com> Fri, 1 Feb 2008 17:06:00 +0100
+
+grub2 (1.95+20080128-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Fixes bogus CLAIM problems on Apple firmware. (Closes: #449135, #422729)
+ - grub-probe performs sanity checks to make sure our filesystem drivers
+ are usable. (Closes: #462449)
+ - patches/disable_ata.diff: Remove. ATA module isn't auto-loaded in
+ rescue floppies now.
+ - patches/disable_xfs.diff: Remove. See above (about grub-probe).
+ * Bring back grub-emu; it can help a lot with debugging feedback.
+ - control
+ - rules
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 28 Jan 2008 00:01:11 +0100
+
+grub2 (1.95+20080116-2) unstable; urgency=low
+
+ * grub.d/05_debian_theme: Enable swirlish beauty.
+ * rules: Obtain debian/legacy/update-grub dynamicaly from GRUB Legacy svn.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 19 Jan 2008 13:16:18 +0100
+
+grub2 (1.95+20080116-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - update-grub ignores stale *.dpkg-* files. (Closes: #422708, #424223)
+ - LVM/RAID now working properly (except when it affects /boot).
+ (Closes: #425666)
+ - Fixes flickery in timeout message. (Closes: #437275)
+ * grub-pc.postinst: Use `--no-floppy' whenever possible. Die, floppies,
+ die!
+ * Resync with latest version of GRUB Legacy's update-grub. This time,
+ using the $LET_US_TRY_GRUB_2 hack to reuse the same script both for
+ addition of core.img and its removal.
+ * grub-*.install: Add update-grub2 stub. Packages providing /etc/grub.d/
+ scripts should invoke update-grub2 in both postinst and postrm (whenever
+ it is found, of course).
+ * control: Reorganize a bit, including a complete rewrite of the
+ package descriptions.
+ * control (grub-ieee1275): Enable for i386/amd64.
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 16 Jan 2008 15:00:54 +0100
+
+grub2 (1.95+20080107-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Supports ReiserFS. (Closes: #430742)
+ - patches/disable_ata.diff: Resync.
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 7 Jan 2008 12:46:39 +0100
+
+grub2 (1.95+20080105-2) unstable; urgency=low
+
+ * grub-pc.postinst: Fix covered assumption that menu.lst exists.
+ (Closes: #459247)
+ * copyright: Fix copyright/license reference.
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 6 Jan 2008 18:02:28 +0100
+
+grub2 (1.95+20080105-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Fixes install on non-devfs systems with devfs-style paths (ouch).
+ (Closes: #450709).
+ - Fixes boot of "Linux" zImages (including memtest86+). (Closes: #436113).
+ - Corrects usage message in grub-setup. (Closes: #458600).
+ - patches/menu_color.diff: Remove. Made obsolete by `menu_color_normal'
+ and `menu_color_highlight' variables. Add/install grub.d/05_debian_theme
+ to make use of them.
+ * Reestructure grub-pc.postinst. Notably:
+ - Do not touch menu.lst unless user has confirmed it (via debconf).
+ (Closes: #459247)
+ - When we do, keep a backup in /boot/grub/menu.lst_backup_by_grub2_postinst.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 5 Jan 2008 17:55:37 +0100
+
+grub2 (1.95+20080101-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - patches/disable_xfs.diff: Rewrite in a way that won't collide with
+ upstream changes so often.
+ - unifont.hex now processed by upstream.
+ - rules: Disable build of unifont.pff.
+ - *.install: Remove build/unifont.pff line.
+ - patches/menu_color.diff: Change menu color to our traditional blue theme.
+ * Support new dpkg fields (Homepage, Vcs-Svn, Vcs-Browser).
+ * patches/disable_ata.diff: Prevent ATA module from being built on i386-pc.
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 1 Jan 2008 19:45:30 +0100
+
+grub2 (1.95+20071101-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - patches/linuxbios.diff: Remove (supported in upstream now).
+
+ -- Robert Millan <rmh@aybabtu.com> Thu, 1 Nov 2007 13:18:51 +0100
+
+grub2 (1.95+20071004-2) unstable; urgency=low
+
+ * Rename debian/grub-of.* to debian/grub-ieee1275.*.
+ * Add debian/grub-linuxbios.{postinst,dirs,install}.
+ * rules: Fix/Overrride lintian warnings (unstripped-binary-or-object).
+ * Remove grub-linuxbios.postinst.
+
+ -- Robert Millan <rmh@aybabtu.com> Wed, 10 Oct 2007 23:56:35 +0200
+
+grub2 (1.95+20071004-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ * Add grub-linuxbios package.
+ - patches/linuxbios.diff
+ - control
+ - rules
+ * Rename grub-of to grub-ieee1275 to match with upstream conventions.
+ - control
+ - rules
+
+ -- Robert Millan <rmh@aybabtu.com> Thu, 4 Oct 2007 14:42:30 +0200
+
+grub2 (1.95+20070829-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Includes fix for parallel builds.
+ * rules: Append -j flag to $(MAKE) to take advantage of >1 processors.
+ * Add reference to /usr/share/common-licenses.
+ - debian/copyright
+ - debian/control (all packages): Add base-files (>= 4.0.1) dependency.
+
+ -- Robert Millan <rmh@debian.org> Sat, 1 Sep 2007 19:00:22 +0200
+
+grub2 (1.95+20070828-2) unstable; urgency=low
+
+ * control (grub-of): Make depends on powerpc-ibm-utils versioned as
+ >= 1.0.6 (older versions don't have -a flag).
+
+ -- Robert Millan <rmh@debian.org> Tue, 28 Aug 2007 23:32:32 +0200
+
+grub2 (1.95+20070828-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Adds ntfs support.
+ - Fixes a pair of issues indirectly breaking grub-probe on powerpc.
+ (Closes: #431488)
+ - patches/disable_xfs.diff: Resync.
+ - copyright: License upgraded to GPLv3.
+ * control (grub-of Depends): Add powerpc-utils (for nvsetenv) and bc.
+
+ -- Robert Millan <rmh@debian.org> Tue, 28 Aug 2007 21:24:14 +0200
+
+grub2 (1.95+20070626-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - More fixes to cope with unreadable /. (Closes: #427289)
+ - update-grub supports multiple terminals.
+ * control (Build-Depends): Add genisoimage.
+ * patches/partmap_fallback.diff: Remove. It didn't archieve anything as
+ it also needs support for proper identification of raid / lvm (this is
+ being worked on).
+ * patches/disable_xfs.diff: Disable xfs in grub-probe.
+ * grub-rescue-pc.README.Debian: New. Explain how to use the rescue
+ images.
+
+ -- Robert Millan <rmh@debian.org> Tue, 26 Jun 2007 08:39:14 +0200
+
+grub2 (1.95+20070614-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - update-grub is tollerant to unreadable / (as long as /boot is
+ accessible). (Closes: #427289)
+ * grub-pc.postinst: Generate new grub.cfg when menu.lst exists.
+ * New package grub-rescue-pc.
+ - control: Add it.
+ - README.Debian.in: Remove obsolete documentation.
+ - rules: Build rescue images using grub-mkrescue.
+ - grub-rescue-pc.dirs: Prepare their directory.
+ - grub-rescue-pc.install: Install them.
+ * legacy/update-grub: Fix core.img detection on separate /boot.
+
+ -- Robert Millan <rmh@debian.org> Thu, 14 Jun 2007 08:17:21 +0200
+
+grub2 (1.95+20070604-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - patches/grub_probe_for_everyone.diff: Remove (merged).
+ - update-grub exports user-defined GRUB_CMDLINE_LINUX. (Closes: #425453)
+ - Fix those nasty powerpc bugs. (Closes: #422729)
+
+ -- Robert Millan <rmh@aybabtu.com> Mon, 4 Jun 2007 21:30:55 +0200
+
+grub2 (1.95+20070520-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - LVM / RAID fixes. (Closes: #423648, #381150)
+ - Fix memory management bug. (Closes: #423409)
+ - patches/efi.diff: Remove (merged).
+ - patches/grub_probe_for_everyone.diff: Use the new paths for
+ util/grub-probe.c, util/biosdisk.c, util/getroot.c. Enable
+ grub-mkdevicemap. (Closes: #424985)
+ * legacy/update-grub: Get rid of all grub-set-default calls. (Closes: #425054)
+ * grub-{pc,efi,of}.postinst: Only run update-grub if grub.cfg already exists.
+ * grub-pc.postinst: Only run GRUB Legacy compat stuff if menu.lst is found.
+ * patches/partmap_fallback.diff: New. Implement fallback "pc gpt" for partmap
+ detection failures. (Closes: #423022)
+ * control: Update XS-Vcs-* fields. Thanks Sam Morris <sam@robots.org.uk>.
+ (Closes: #425146)
+ * grub-{pc,efi,of}.{dirs,postinst}: Move unifont.pff to /usr/share/grub.
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 20 May 2007 11:13:03 +0200
+
+grub2 (1.95+20070515-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Fix assumptions about /, /boot and /boot/grub being the same device.
+ (Closes: #423268, #422459)
+ - Proper sorting of Linux images. (Closes: #422580)
+ - update-grub lets /etc/default/grub override its variables now.
+ (Closes: #423649)
+ - update-grub mentions /etc/default/grub in the grub.cfg header.
+ (Closes: #423651)
+ - update-grub sets 800x600x16 as the default gfxmode. (Closes: #422794)
+ - update-grub runs grub-mkdevicemap before attempting to use grub-probe
+ (part of #423217)
+
+ [ Otavio Salvador ]
+ * Add support to DEB_BUILD_OPTIONS=noopt. Thanks to Sam Morris
+ <sam@robots.org.uk> for the patch. (Closes: #423005)
+ * Add Robert Millan as uploader.
+ * Change build-dependency from liblzo-dev to liblzo2-dev. (Closes: #423358)
+
+ [ Robert Millan ]
+ * grub-pc.postinst:
+ - Remove /boot/grub/device.map before running grub-install.
+ (Closes: #422851)
+ - Always run update-grub after grub-install. (part of #423217)
+ - Use grub-mkdevicemap instead of removing device.map, since update-grub
+ needs it but grub-install is not run unconditionaly.
+ - Redirect grub-install invocation to /dev/null, since it can mislead
+ users into thinking that MBR was overwritten. (part of #423217)
+ * default/grub: Stop exporting the variables (update-grub does that now).
+ * Misc EFI fixes, including new grub-install.
+ - patches/efi.diff: New.
+ - patches/grub_probe_for_everyone.diff: Move some bits to efi.diff.
+ - grub-efi.install: Stop installing dummy grub-install.
+ - grub-install: Remove.
+ * grub-pc.postinst: Avoid generating core.img when menu.lst is not present,
+ to avoid duplicated work (this is specialy important for d-i). (part of
+ #423217).
+ * See multiple references above. (Closes: #423217)
+ * grub-{pc,efi,of}.{dirs,install}: Install presubj in the right directory
+ to make it work again (oops).
+ * Add reportbug script to gather debugging information. (Closes: #423218)
+ - script: New.
+ - grub-{pc,efi,of}.install: Install it.
+ * Install the reportbug scripts for grub2 too, since users might still use
+ it for bugfiling.
+ - grub2.dirs
+ - grub2.install
+ * Fix some lintian warnings.
+ - control (grub2): Depend on debconf.
+ - README.Debian.in: Fix mispell.
+ - grub2.templates: Remove extra dot.
+
+ -- Robert Millan <rmh@aybabtu.com> Tue, 15 May 2007 22:08:53 +0200
+
+grub2 (1.95+20070507-1) unstable; urgency=low
+
+ [ Robert Millan ]
+ * New CVS snapshot.
+ - patches/build_neq_src.diff: Remove (merged).
+ * Fix debhelper files to ensure each package gets the right thing.
+ * Enable gfxterm/unifont support.
+ * On grub-pc, if there's no core.img setup, create one (but do not
+ risk writing to MBR).
+ * On grub-pc, if menu.lst is found, regenerate it to include our
+ core.img.
+
+ [ Otavio Salvador ]
+ * Move debian/update-grub to debian/legacy/update-grub otherwise the
+ source gets messy.
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Mon, 07 May 2007 18:48:14 -0300
+
+grub2 (1.95+20070505.1-3) unstable; urgency=low
+
+ * Split postinst into grub2.postinst (with the transition warning) and
+ postinst.in, with update-grub invocation for grub-{pc,efi,of}.
+ - postinst.in
+ - grub2.postinst
+ - rules
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 6 May 2007 01:20:04 +0200
+
+grub2 (1.95+20070505.1-2) unstable; urgency=low
+
+ * Add EFI build of GRUB.
+ - control: Restructure to provide 3 packages: grub-pc (x86),
+ grub-efi (x86) and grub-of (powerpc).
+ - rules: Handle a separate build for each package.
+ - patches/build_neq_src.diff: Fix builddir == srcdir assumptions.
+ - patches/grub_probe_for_everyone.diff: New (superceds
+ powerpc_probe.diff). Enable grub-probe on powerpc and i386-efi.
+ - grub-install: Dummy informational grub-install for EFI.
+ - grub-efi.install: Installs it.
+
+ -- Robert Millan <rmh@aybabtu.com> Sun, 6 May 2007 00:23:56 +0200
+
+grub2 (1.95+20070505.1-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ * patches/powerpc_probe.diff: Add partmap/gpt.c to grub-probe.
+ * control (Architecture): Temporarily disable powerpc. Sorry, but runtime
+ is currently broken and we don't have the hardware to debug it. Will be
+ re-enabled in next upload.
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 5 May 2007 21:52:49 +0200
+
+grub2 (1.95+20070505-1) unstable; urgency=low
+
+ * New CVS snapshot.
+ - Improved grub.cfg parser. (Closes: #381215)
+ - patches/fix-grub-install.diff: Remove (merged).
+ - control (Build-Depends): Remove libncurses5-dev (no longer needed).
+ - provides update-grub2. (Closes: #419151)
+ - Supports GPT in PC/BIOS systems. (Closes: #409073)
+ * control (Build-Depends): Add gcc-multilib to fix FTBFS.
+ * control (Description): Make it less scary, and more informative.
+ * postinst: Run update-grub to ensure the latest improvements always are
+ applied.
+ * patches/powerpc_probe.diff: Attempt at making grub-probe build/install
+ on powerpc (and hopefuly update-grub).
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 5 May 2007 01:49:07 +0200
+
+grub2 (1.95-5) unstable; urgency=low
+
+ * Fix FTBFS on kFreeBSD. Thanks to Aurelien Jarno <aurel32@debian.org>
+ by providing the patch. Closes: #416408
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Fri, 30 Mar 2007 19:20:48 -0300
+
+grub2 (1.95-4) unstable; urgency=low
+
+ * Fix powerpc grub-install binary path. Closes: #402838
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Thu, 22 Mar 2007 23:45:56 -0300
+
+grub2 (1.95-3) unstable; urgency=low
+
+ [ Christian Perrier ]
+ * Switch to po-debconf for debconf templates. Closes: #402972
+ * Depend on ${misc:Depends} and not "debconf" to allow cdebconf to be used
+ * Debconf translations:
+ - French
+ - Czech. Closes: #413327
+ - Galician. Closes: #413323
+ - Swedish. Closes: #413325
+ - Portuguese. Closes: #413332
+ - German. Closes: #413365
+ - Tamil. Closes: #413478
+ - Russian. Closes: #413542
+ - Italian. Closes: #413904
+ - Romanian. Closes: #414443
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Tue, 20 Mar 2007 23:46:38 -0300
+
+grub2 (1.95-2) unstable; urgency=low
+
+ [ Robert Millan ]
+ * update-grub: Fix for Xen hypervisor entries, thanks Aaron Schrab.
+ (Closes: #394706)
+ * Transition to new numbering scheme for partitions. (Closes: #395019)
+ - update-grub: Don't substract 1 when converting partition device names to
+ grub drives.
+ - Add debconf warning explaining the situation.
+ * Rewrite Architecture line back to hardcoded list :(. (Closes: #398060)
+
+ -- Otavio Salvador <otavio@debian.org> Mon, 11 Dec 2006 05:08:41 -0200
+
+grub2 (1.95-1) unstable; urgency=low
+
+ * New upstream release.
+ - patches/03_revert_partition_numbering.diff: Delete (obsoleted).
+
+ -- Robert Millan <rmh@aybabtu.com> Sat, 14 Oct 2006 21:19:21 +0200
+
+grub2 (1.94+20061003-1) unstable; urgency=high
+
+ * New CVS snapshot.
+
+ [ Otavio Salvador ]
+ * Change debhelper compatibility mode to 5:
+ - debian/compat: setted to 5;
+ * control (Build-Depends): Add lib32ncurses5-dev for ppc64.
+ Closes: #389873
+ * Set urgency=high since it's experimental stuff and tagged likewise. It
+ also solved a serious bug on PowerPC that leave users with a black
+ screen.
+
+ [ Robert Millan ]
+ * control (Depends): Add powerpc-ibm-utils for powerpc/ppc64.
+ (Closes: #372186)
+
+ -- Otavio Salvador <otavio@debian.org> Tue, 3 Oct 2006 16:49:32 -0300
+
+grub2 (1.94+20060926-1) unstable; urgency=high
+
+ * New CVS snapshot.
+ - Command-line editting fix (Closes: #381214).
+ - Fixes runtime breakage on amd64 (not in BTS).
+ - Delete a few patches (merged).
+
+ [ Robert Millan ]
+ * Set urgency=high. Might seem like a rush, but it can't possibly be worse than
+ 1.94-5 (broken on systems that use udev, broken on amd64...).
+ * Pure ppc64 support.
+ - control (Architecture): Add any-ppc64.
+ - control (Build-Depends): Add libc6-dev-powerpc [ppc64].
+ * rules: Remove moddep.lst install command (no longer needed).
+ * patches/03_revert_partition_numbering.diff: New. Revert a commit that
+ broke grub-probefs.
+ * Add bug template to encourage sending upstream stuff directly to
+ upstream.
+ - presubj: New.
+
+ [ Otavio Salvador ]
+ * Add XS-X-Vcs-Svn on control file and point it to our current svn
+ repository.
+ * Add cvs-snapshot to rules.
+
+ -- Otavio Salvador <otavio@debian.org> Tue, 26 Sep 2006 16:14:36 -0300
+
+grub2 (1.94-6) unstable; urgency=low
+
+ [ Robert Millan ]
+ * update-grub: Set interpreter to /bin/bash to cope with non-POSIX
+ extensions. (mentioned in #361929)
+ * patches/03_avoid_recursing_into_dot_static.diff: New. Avoid recursing into
+ dotdirs (e.g. ".static").
+ * patches/04_mkdevicemap_dont_assume_floppies.diff: New. Don't assume
+ /dev/fd0 exists when generating device.map.
+
+ -- Otavio Salvador <otavio@debian.org> Thu, 14 Sep 2006 16:07:30 -0300
+
+grub2 (1.94-5) unstable; urgency=low
+
+ [ Robert Millan ]
+ * control (Build-Depends): s/any-amd64/amd64 kfreebsd-amd64/g (this seems to
+ confuse buildds).
+ * 02_not_remove_menu_lst.patch: New patch. Skip menu.lst removal in
+ grub-install. (Closes: #372934)
+
+ -- Otavio Salvador <otavio@debian.org> Sun, 20 Aug 2006 12:02:13 -0300
+
+grub2 (1.94-4) unstable; urgency=low
+
+ [ Otavio Salvador ]
+ * 01_fix_amd64_building.patch: dropped since it now supports amd64
+ native building.
+ * Remove convert_kernel26 usage since it's not necessary anymore and due
+ initramfs-tools changes it's bug too.
+
+ [ Robert Millan ]
+ * Fork update-grub from grub legacy, and tweak a few commands in output to
+ make it work for grub2.
+ * Update README.Debian.in with more recent (and easier) install instructions.
+ * Add grub to Conflicts/Replaces. Too many commands with the same name,
+ even if they don't use the same path yet (but will likely do in the
+ future, see #361929).
+ * Get rid of control.in, which I introduced in 0.6+20040805-1 and turned out
+ to be an endless source of problems (and forbidden by policy as well).
+ * Fix FTBFS on amd64. Really closes: #372548.
+
+ -- Otavio Salvador <otavio@debian.org> Fri, 18 Aug 2006 15:38:25 -0300
+
+grub2 (1.94-3) unstable; urgency=low
+
+ * Fix FTBFS in amd64. Closes: 372548
+
+ -- Otavio Salvador <otavio@debian.org> Sat, 10 Jun 2006 19:57:01 -0300
+
+grub2 (1.94-2) unstable; urgency=low
+
+ * Update grub images paths in README.Debian
+ * 01_fix_grub-install.patch: add to fix a problem with PowerPC
+ installation. Refs: #371069
+ * Fix FTBFS in amd64. Closes: #370803
+
+ -- Otavio Salvador <otavio@debian.org> Fri, 9 Jun 2006 09:29:40 -0300
+
+grub2 (1.94-1) unstable; urgency=low
+
+ * New upstream release.
+ - Fix powerpc building. Closes: #370259
+ - 01_fix_grub-install.patch: merged upstream.
+ - Moved modules to /usr/lib/grub since they are architecture
+ dependent.
+ * Leave CDBS set debhelper compatibility level.
+ * Allow amd64 build to happen. Closes: #364956
+ * Enforce building in 32bits while running in x86_64 machines.
+ * Update Standards version to 3.7.2. No changes need.
+
+ -- Otavio Salvador <otavio@debian.org> Mon, 5 Jun 2006 12:49:09 -0300
+
+grub2 (1.93-1) unstable; urgency=low
+
+ * New upstream release.
+ - Added support to PowerPC. Closes: #357853
+ - 01_fix_grub-install.patch: rediff.
+ * Update Standards version to 3.6.2. No changes need.
+ * Start to use new dpkg architecture definition. Closes: #360134
+
+ -- Otavio Salvador <otavio@debian.org> Sat, 1 Apr 2006 10:07:17 -0300
+
+grub2 (1.92-2) unstable; urgency=low
+
+ * Add bison on build-depends field. Closes: #346178
+ * Add more fixes in 01_fix_grub-install.patch. Closes: #346177
+
+ -- Otavio Salvador <otavio@debian.org> Fri, 6 Jan 2006 09:48:08 -0200
+
+grub2 (1.92-1) unstable; urgency=low
+
+ * New upstream release.
+ - Add support for GPT partition table format.
+ - Add a new command "play" to play an audio file on PC.
+ - Add support for Linux/ADFS partition table format.
+ - Add support for BASH-like scripting.
+ - Add support for Apple HFS+ filesystems.
+ * 01_fix_grub-install.patch: Added. Fix grub-install to use
+ /bin/grub-mkimage instead of /sbin/grub-mkimage. Closes: #338824
+ * Do not use CDBS tarball mode anymore. Closes: #344272
+
+ -- Otavio Salvador <otavio@debian.org> Thu, 5 Jan 2006 15:20:40 -0200
+
+grub2 (1.91-0) unstable; urgency=low
+
+ * New upstream release. Closes: #331211
+ * debian/watch: added.
+ * debian/control.in, debian/control: Add libncurses5-dev in
+ Build-Depends. Closes: #304638
+ * Remove Robert Millan as uploader;
+ * Add myself as uploader;
+
+ -- Otavio Salvador <otavio@debian.org> Sat, 12 Nov 2005 16:35:18 -0200
+
+grub2 (0.6+20050203-2) unstable; urgency=low
+
+ * Disable for powerpc. Reportedly it fails to boot.
+
+ -- Robert Millan <rmh@debian.org> Fri, 4 Feb 2005 01:52:09 +0100
+
+grub2 (0.6+20050203-1) unstable; urgency=low
+
+ * New upstream snapshot.
+ * Install moddep.lst properly in a cpu-independant way. (Closes: #264115)
+ * Use cdbs debian/control autogeneration.
+ - Set DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes.
+ - Move control to control.in.
+ - Add a @cdbs@ tag and replace Architecture with Cpu/System.
+ * control.in (Build-Depends): Add ruby.
+
+ -- Robert Millan <rmh@debian.org> Thu, 3 Feb 2005 22:33:39 +0100
+
+grub2 (0.6+20040805-1) unstable; urgency=low
+
+ * New upstream snapshot.
+ * Uploading to unstable so that powerpc users can be blessed by GRUB too.
+ * Use type-handling to generate dpkg arch list.
+ - control.in
+ - rules
+
+ -- Robert Millan <rmh@debian.org> Thu, 5 Aug 2004 20:50:16 +0200
+
+grub2 (0.6+20040502-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ - Fix FTBFS on powerpc.
+
+ -- Robert Millan <rmh@debian.org> Sun, 2 May 2004 18:16:29 +0200
+
+grub2 (0.6+20040429-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ - control (Architecture): Add powerpc.
+
+ -- Robert Millan <rmh@debian.org> Thu, 29 Apr 2004 20:41:31 +0200
+
+grub2 (0.6+20031125-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ - patches/multiboot.diff: Nuked.
+ - install,docs: Update directory name.
+ * control (Maintainer): Set to pkg-grub-devel mailing list.
+ * control (Uploaders): Add myself.
+ * control (Architecture): Add freebsd-i386 and netbsd-i386.
+
+ -- Robert Millan <rmh@debian.org> Tue, 25 Nov 2003 23:48:18 +0100
+
+grub2 (0.6+20031114-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ - README.Debian: s/fat/ext2/g (We now have ext2fs support).
+ * Add multiboot support, thanks to Jeroen Dekkers for his patch.
+ - patches/multiboot.diff: New.
+ - control (Architecture): Add hurd-i386 (which needed multiboot).
+ * Rename package to grub2 (to follow upstream tendency).
+ - control: Ditto.
+ - README.Debian: Likewise.
+ * Switch to tarball mode.
+ - rules: Ditto.
+ - docs: Prefix paths in order to workaround dh_installdocs bug.
+ - install: Likewise, but not because of bug (should be in rules, actualy).
+ * Fix FTBFS. (Closes: #213868)
+ - control (Build-Depends): Add autoconf.
+ - control (Build-Conflicts): Add autoconf2.13.
+
+ -- Robert Millan <rmh@debian.org> Fri, 14 Nov 2003 13:16:12 +0100
+
+pupa (0.6+20031008-1) experimental; urgency=low
+
+ * New upstream snapshot.
+ * Uploading to experimental.
+ * debian/control: Add Jason Thomas to Uploaders.
+
+ -- Robert Millan <rmh@debian.org> Wed, 8 Oct 2003 13:22:50 +0000
+
+pupa (0.6+20030915-1) unstable; urgency=low
+
+ * Initial Release. (Closes: #211030)
+
+ -- Robert Millan <rmh@debian.org> Mon, 15 Sep 2003 14:58:42 +0000
--- /dev/null
- Files-Excluded: grub-core/lib/libgcrypt*/cipher/crc.c
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: GNU GRUB
+Source: https://www.gnu.org/software/grub/
+
+Files: *
+Copyright: 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc
+License: GPL-3+
+
+
+Files: debian/*
+Copyright: 2003, 2004, 2005, 2006, 2007, 2008, 2009, Robert Millan
+ 2005, 2006, 2007, Otavio Salvador
+ 2008, 2009, Felix Zielcke
+ 2009, Jordi Mallach
+License: GPL-3+
+
+Files: debian/grub-extras/*
+Copyright: Nathan Coulson
+ 2003, 2007 Free Software Foundation, Inc
+ 2003 NIIBE Yutaka
+License: GPL-3+
+
+Files: themes/starfield/*
+Copyright: 2012 Free Software Foundation, Inc
+License: CC-BY-SA-3.0
+
+Files: themes/starfield/theme.txt
+Copyright: 2011 Daniel Tschudi
+License: Expat
+
+License: GPL-3+
+ On Debian systems the full text of the GNU General Public
+ License can be found in the `/usr/share/common-licenses/GPL-3'
+ file.
+
+License: CC-BY-SA-3.0
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
+ SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT
+ RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS"
+ BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION
+ PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+ .
+ License
+ .
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+ COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+ COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+ AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+ .
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO
+ BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE
+ CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED
+ HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+ .
+ 1. Definitions
+ "Adaptation" means a work based upon the Work, or upon the Work and
+ other pre-existing works, such as a translation, adaptation, derivative
+ work, arrangement of music or other alterations of a literary or
+ artistic work, or phonogram or performance and includes cinematographic
+ adaptations or any other form in which the Work may be recast,
+ transformed, or adapted including in any form recognizably derived from
+ the original, except that a work that constitutes a Collection will not
+ be considered an Adaptation for the purpose of this License. For the
+ avoidance of doubt, where the Work is a musical work, performance or
+ phonogram, the synchronization of the Work in timed-relation with a
+ moving image ("synching") will be considered an Adaptation for the
+ purpose of this License.
+ "Collection" means a collection of literary or artistic works, such as
+ encyclopedias and anthologies, or performances, phonograms or
+ broadcasts, or other works or subject matter other than works listed in
+ Section 1(f) below, which, by reason of the selection and arrangement of
+ their contents, constitute intellectual creations, in which the Work is
+ included in its entirety in unmodified form along with one or more other
+ contributions, each constituting separate and independent works in
+ themselves, which together are assembled into a collective whole. A work
+ that constitutes a Collection will not be considered an Adaptation (as
+ defined below) for the purposes of this License.
+ "Creative Commons Compatible License" means a license that is listed at
+ http://creativecommons.org/compatiblelicenses that has been approved by
+ Creative Commons as being essentially equivalent to this License,
+ including, at a minimum, because that license: (i) contains terms that
+ have the same purpose, meaning and effect as the License Elements of
+ this License; and, (ii) explicitly permits the relicensing of
+ adaptations of works made available under that license under this
+ License or a Creative Commons jurisdiction license with the same License
+ Elements as this License.
+ "Distribute" means to make available to the public the original and
+ copies of the Work or Adaptation, as appropriate, through sale or other
+ transfer of ownership.
+ "License Elements" means the following high-level license attributes as
+ selected by Licensor and indicated in the title of this License:
+ Attribution, ShareAlike.
+ "Licensor" means the individual, individuals, entity or entities that
+ offer(s) the Work under the terms of this License.
+ "Original Author" means, in the case of a literary or artistic work, the
+ individual, individuals, entity or entities who created the Work or if
+ no individual or entity can be identified, the publisher; and in
+ addition (i) in the case of a performance the actors, singers,
+ musicians, dancers, and other persons who act, sing, deliver, declaim,
+ play in, interpret or otherwise perform literary or artistic works or
+ expressions of folklore; (ii) in the case of a phonogram the producer
+ being the person or legal entity who first fixes the sounds of a
+ performance or other sounds; and, (iii) in the case of broadcasts, the
+ organization that transmits the broadcast.
+ "Work" means the literary and/or artistic work offered under the terms
+ of this License including without limitation any production in the
+ literary, scientific and artistic domain, whatever may be the mode or
+ form of its expression including digital form, such as a book, pamphlet
+ and other writing; a lecture, address, sermon or other work of the same
+ nature; a dramatic or dramatico-musical work; a choreographic work or
+ entertainment in dumb show; a musical composition with or without words;
+ a cinematographic work to which are assimilated works expressed by a
+ process analogous to cinematography; a work of drawing, painting,
+ architecture, sculpture, engraving or lithography; a photographic work
+ to which are assimilated works expressed by a process analogous to
+ photography; a work of applied art; an illustration, map, plan, sketch
+ or three-dimensional work relative to geography, topography,
+ architecture or science; a performance; a broadcast; a phonogram; a
+ compilation of data to the extent it is protected as a copyrightable
+ work; or a work performed by a variety or circus performer to the extent
+ it is not otherwise considered a literary or artistic work.
+ "You" means an individual or entity exercising rights under this License
+ who has not previously violated the terms of this License with respect
+ to the Work, or who has received express permission from the Licensor to
+ exercise rights under this License despite a previous violation.
+ "Publicly Perform" means to perform public recitations of the Work and
+ to communicate to the public those public recitations, by any means or
+ process, including by wire or wireless means or public digital
+ performances; to make available to the public Works in such a way that
+ members of the public may access these Works from a place and at a place
+ individually chosen by them; to perform the Work to the public by any
+ means or process and the communication to the public of the performances
+ of the Work, including by public digital performance; to broadcast and
+ rebroadcast the Work by any means including signs, sounds or images.
+ "Reproduce" means to make copies of the Work by any means including
+ without limitation by sound or visual recordings and the right of
+ fixation and reproducing fixations of the Work, including storage of a
+ protected performance or phonogram in digital form or other electronic
+ medium.
+ .
+ 2. Fair Dealing Rights. Nothing in this License is intended to reduce,
+ limit, or restrict any uses free from copyright or rights arising from
+ limitations or exceptions that are provided for in connection with the
+ copyright protection under copyright law or other applicable laws.
+ .
+ 3. License Grant. Subject to the terms and conditions of this License,
+ Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+ perpetual (for the duration of the applicable copyright) license to
+ exercise the rights in the Work as stated below:
+ .
+ to Reproduce the Work, to incorporate the Work into one or more
+ Collections, and to Reproduce the Work as incorporated in the
+ Collections;
+ to create and Reproduce Adaptations provided that any such Adaptation,
+ including any translation in any medium, takes reasonable steps to
+ clearly label, demarcate or otherwise identify that changes were made to
+ the original Work. For example, a translation could be marked "The
+ original work was translated from English to Spanish," or a modification
+ could indicate "The original work has been modified.";
+ to Distribute and Publicly Perform the Work including as incorporated in
+ Collections; and,
+ to Distribute and Publicly Perform Adaptations.
+ .
+ For the avoidance of doubt:
+ Non-waivable Compulsory License Schemes. In those jurisdictions in
+ which the right to collect royalties through any statutory or
+ compulsory licensing scheme cannot be waived, the Licensor reserves
+ the exclusive right to collect such royalties for any exercise by
+ You of the rights granted under this License;
+ Waivable Compulsory License Schemes. In those jurisdictions in which
+ the right to collect royalties through any statutory or compulsory
+ licensing scheme can be waived, the Licensor waives the exclusive
+ right to collect such royalties for any exercise by You of the
+ rights granted under this License; and,
+ Voluntary License Schemes. The Licensor waives the right to collect
+ royalties, whether individually or, in the event that the Licensor
+ is a member of a collecting society that administers voluntary
+ licensing schemes, via that society, from any exercise by You of the
+ rights granted under this License.
+ .
+ The above rights may be exercised in all media and formats whether now
+ known or hereafter devised. The above rights include the right to make such
+ modifications as are technically necessary to exercise the rights in other
+ media and formats. Subject to Section 8(f), all rights not expressly
+ granted by Licensor are hereby reserved.
+ .
+ 4. Restrictions. The license granted in Section 3 above is expressly made
+ subject to and limited by the following restrictions:
+ .
+ You may Distribute or Publicly Perform the Work only under the terms of
+ this License. You must include a copy of, or the Uniform Resource
+ Identifier (URI) for, this License with every copy of the Work You
+ Distribute or Publicly Perform. You may not offer or impose any terms on
+ the Work that restrict the terms of this License or the ability of the
+ recipient of the Work to exercise the rights granted to that recipient
+ under the terms of the License. You may not sublicense the Work. You
+ must keep intact all notices that refer to this License and to the
+ disclaimer of warranties with every copy of the Work You Distribute or
+ Publicly Perform. When You Distribute or Publicly Perform the Work, You
+ may not impose any effective technological measures on the Work that
+ restrict the ability of a recipient of the Work from You to exercise the
+ rights granted to that recipient under the terms of the License. This
+ Section 4(a) applies to the Work as incorporated in a Collection, but
+ this does not require the Collection apart from the Work itself to be
+ made subject to the terms of this License. If You create a Collection,
+ upon notice from any Licensor You must, to the extent practicable,
+ remove from the Collection any credit as required by Section 4(c), as
+ requested. If You create an Adaptation, upon notice from any Licensor
+ You must, to the extent practicable, remove from the Adaptation any
+ credit as required by Section 4(c), as requested.
+ You may Distribute or Publicly Perform an Adaptation only under the
+ terms of: (i) this License; (ii) a later version of this License with
+ the same License Elements as this License; (iii) a Creative Commons
+ jurisdiction license (either this or a later license version) that
+ contains the same License Elements as this License (e.g.,
+ Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible
+ License. If you license the Adaptation under one of the licenses
+ mentioned in (iv), you must comply with the terms of that license. If
+ you license the Adaptation under the terms of any of the licenses
+ mentioned in (i), (ii) or (iii) (the "Applicable License"), you must
+ comply with the terms of the Applicable License generally and the
+ following provisions: (I) You must include a copy of, or the URI for,
+ the Applicable License with every copy of each Adaptation You Distribute
+ or Publicly Perform; (II) You may not offer or impose any terms on the
+ Adaptation that restrict the terms of the Applicable License or the
+ ability of the recipient of the Adaptation to exercise the rights
+ granted to that recipient under the terms of the Applicable License;
+ (III) You must keep intact all notices that refer to the Applicable
+ License and to the disclaimer of warranties with every copy of the Work
+ as included in the Adaptation You Distribute or Publicly Perform; (IV)
+ when You Distribute or Publicly Perform the Adaptation, You may not
+ impose any effective technological measures on the Adaptation that
+ restrict the ability of a recipient of the Adaptation from You to
+ exercise the rights granted to that recipient under the terms of the
+ Applicable License. This Section 4(b) applies to the Adaptation as
+ incorporated in a Collection, but this does not require the Collection
+ apart from the Adaptation itself to be made subject to the terms of the
+ Applicable License.
+ If You Distribute, or Publicly Perform the Work or any Adaptations or
+ Collections, You must, unless a request has been made pursuant to
+ Section 4(a), keep intact all copyright notices for the Work and
+ provide, reasonable to the medium or means You are utilizing: (i) the
+ name of the Original Author (or pseudonym, if applicable) if supplied,
+ and/or if the Original Author and/or Licensor designate another party or
+ parties (e.g., a sponsor institute, publishing entity, journal) for
+ attribution ("Attribution Parties") in Licensor's copyright notice,
+ terms of service or by other reasonable means, the name of such party or
+ parties; (ii) the title of the Work if supplied; (iii) to the extent
+ reasonably practicable, the URI, if any, that Licensor specifies to be
+ associated with the Work, unless such URI does not refer to the
+ copyright notice or licensing information for the Work; and (iv) ,
+ consistent with Ssection 3(b), in the case of an Adaptation, a credit
+ identifying the use of the Work in the Adaptation (e.g., "French
+ translation of the Work by Original Author," or "Screenplay based on
+ original Work by Original Author"). The credit required by this Section
+ 4(c) may be implemented in any reasonable manner; provided, however,
+ that in the case of a Adaptation or Collection, at a minimum such credit
+ will appear, if a credit for all contributing authors of the Adaptation
+ or Collection appears, then as part of these credits and in a manner at
+ least as prominent as the credits for the other contributing authors.
+ For the avoidance of doubt, You may only use the credit required by this
+ Section for the purpose of attribution in the manner set out above and,
+ by exercising Your rights under this License, You may not implicitly or
+ explicitly assert or imply any connection with, sponsorship or
+ endorsement by the Original Author, Licensor and/or Attribution Parties,
+ as appropriate, of You or Your use of the Work, without the separate,
+ express prior written permission of the Original Author, Licensor and/or
+ Attribution Parties.
+ Except as otherwise agreed in writing by the Licensor or as may be
+ otherwise permitted by applicable law, if You Reproduce, Distribute or
+ Publicly Perform the Work either by itself or as part of any Adaptations
+ or Collections, You must not distort, mutilate, modify or take other
+ derogatory action in relation to the Work which would be prejudicial to
+ the Original Author's honor or reputation. Licensor agrees that in those
+ jurisdictions (e.g. Japan), in which any exercise of the right granted
+ in Section 3(b) of this License (the right to make Adaptations) would be
+ deemed to be a distortion, mutilation, modification or other derogatory
+ action prejudicial to the Original Author's honor and reputation, the
+ Licensor will waive or not assert, as appropriate, this Section, to the
+ fullest extent permitted by the applicable national law, to enable You
+ to reasonably exercise Your right under Section 3(b) of this License
+ (right to make Adaptations) but not otherwise.
+ .
+ 5. Representations, Warranties and Disclaimer
+ .
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+ OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
+ KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT
+ OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER
+ OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF
+ IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+ .
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
+ LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+ SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING
+ OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ .
+ 7. Termination
+ .
+ This License and the rights granted hereunder will terminate
+ automatically upon any breach by You of the terms of this License.
+ Individuals or entities who have received Adaptations or Collections
+ from You under this License, however, will not have their licenses
+ terminated provided such individuals or entities remain in full
+ compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+ survive any termination of this License.
+ Subject to the above terms and conditions, the license granted here is
+ perpetual (for the duration of the applicable copyright in the Work).
+ Notwithstanding the above, Licensor reserves the right to release the
+ Work under different license terms or to stop distributing the Work at
+ any time; provided, however that any such election will not serve to
+ withdraw this License (or any other license that has been, or is
+ required to be, granted under the terms of this License), and this
+ License will continue in full force and effect unless terminated as
+ stated above.
+ .
+ 8. Miscellaneous
+ .
+ Each time You Distribute or Publicly Perform the Work or a Collection,
+ the Licensor offers to the recipient a license to the Work on the same
+ terms and conditions as the license granted to You under this License.
+ Each time You Distribute or Publicly Perform an Adaptation, Licensor
+ offers to the recipient a license to the original Work on the same terms
+ and conditions as the license granted to You under this License.
+ If any provision of this License is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of
+ the remainder of the terms of this License, and without further action
+ by the parties to this agreement, such provision shall be reformed to
+ the minimum extent necessary to make such provision valid and
+ enforceable.
+ No term or provision of this License shall be deemed waived and no
+ breach consented to unless such waiver or consent shall be in writing
+ and signed by the party to be charged with such waiver or consent.
+ This License constitutes the entire agreement between the parties with
+ respect to the Work licensed here. There are no understandings,
+ agreements or representations with respect to the Work not specified
+ here. Licensor shall not be bound by any additional provisions that may
+ appear in any communication from You. This License may not be modified
+ without the mutual written agreement of the Licensor and You.
+ The rights granted under, and the subject matter referenced, in this
+ License were drafted utilizing the terminology of the Berne Convention
+ for the Protection of Literary and Artistic Works (as amended on
+ September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
+ Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and
+ the Universal Copyright Convention (as revised on July 24, 1971). These
+ rights and subject matter take effect in the relevant jurisdiction in
+ which the License terms are sought to be enforced according to the
+ corresponding provisions of the implementation of those treaty
+ provisions in the applicable national law. If the standard suite of
+ rights granted under applicable copyright law includes additional rights
+ not granted under this License, such additional rights are deemed to be
+ included in the License; this License is not intended to restrict the
+ license of any rights under applicable law.
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
--- /dev/null
- From 98e5faf41eb40e287dc00c79f461f5afa92d8a34 Mon Sep 17 00:00:00 2001
++From 878c8d3485c6e3a1abba6e636fe2580a716bc3f7 Mon Sep 17 00:00:00 2001
+From: Alexander Graf <agraf@csgraf.de>
+Date: Tue, 30 Apr 2019 22:43:57 +0200
+Subject: arm: Align section alignment with manual relocation offset code
+
+The arm relocation code has a manual special case for EFI binaries to
+add the natural alignment to its own relocation awareness.
+
+Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
+boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
+the change in that branch that we forgot as well.
+
+This fixes running 32bit arm grub efi binaries for me again.
+
+Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
+Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
+Reported-by: Steve McIntyre <steve@einval.com>
+Signed-off-by: Alexander Graf <agraf@csgraf.de>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
+Tested-by: Julien ROBIN <julien.robin28@free.fr>
+Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
+
+Bug-Debian: https://bugs.debian.org/927269
+Origin: other, https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00132.html
+Last-Update: 2019-05-03
+
+Patch-Name: arm-align-section-alignment-with-manual-reloc-offset.patch
+---
+ util/grub-mkimagexx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
- index 2f80e5abc..740b30483 100644
++index 470fbf4dd..bc087c2b5 100644
+--- a/util/grub-mkimagexx.c
++++ b/util/grub-mkimagexx.c
- @@ -1105,7 +1105,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
++@@ -1137,7 +1137,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
+ (int) sym_addr, (int) sym_addr);
+ /* Data will be naturally aligned */
+ if (image_target->id == IMAGE_EFI)
+- sym_addr += 0x400;
++ sym_addr += GRUB_PE32_SECTION_ALIGNMENT;
+ *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr);
+ }
+ break;
--- /dev/null
- From 61f1b949b4b9302b664553cdc5c77cb6fea8f897 Mon Sep 17 00:00:00 2001
++From 71074c74c1fa3cd956bfbee5e87078a4dccda3f9 Mon Sep 17 00:00:00 2001
+From: Alexander Graf <agraf@csgraf.de>
+Date: Tue, 30 Apr 2019 22:43:56 +0200
+Subject: arm: Move trampolines into code section
+
+When creating T32->A32 transition jumps, the relocation code in grub
+will generate trampolines. These trampolines live in the .data section
+of our PE binary which means they are not marked as executable.
+
+This misbehavior was unmasked by commit a51f953f4ee87 ("mkimage: Align
+efi sections on 4k boundary") which made the X/NX boundary more obvious
+because everything became page aligned.
+
+To put things into proper order, let's move the arm trampolines into the
+.text section instead. That way everyone knows they are executable.
+
+Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
+Reported-by: Julien ROBIN <julien.robin28@free.fr>
+Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
+Signed-off-by: Alexander Graf <agraf@csgraf.de>
+Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
+Tested-by: Julien ROBIN <julien.robin28@free.fr>
+Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
+
+Bug-Debian: https://bugs.debian.org/927269
+Origin: other, https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00131.html
+Last-Update: 2019-05-03
+
+Patch-Name: arm-move-trampolines-into-code-section.patch
+---
- util/grub-mkimagexx.c | 32 +++++++++++++++-----------------
- 1 file changed, 15 insertions(+), 17 deletions(-)
++ util/grub-mkimagexx.c | 28 +++++++++++++---------------
++ 1 file changed, 13 insertions(+), 15 deletions(-)
+
+diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
- index 6c02faffb..2f80e5abc 100644
++index a79034e7b..470fbf4dd 100644
+--- a/util/grub-mkimagexx.c
++++ b/util/grub-mkimagexx.c
- @@ -1860,6 +1860,21 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
++@@ -2197,25 +2197,10 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
+ }
+ }
+
- +#ifdef MKIMAGE_ELF32
- + if (image_target->elf_target == EM_ARM)
- + {
- + grub_size_t tramp;
- +
- + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16);
- +
- + tramp = arm_get_trampoline_size (e, sections, section_entsize,
- + num_sections, image_target);
- +
- + layout->tramp_off = layout->kernel_size;
- + layout->kernel_size += ALIGN_UP (tramp, 16);
- + }
- +#endif
- +
- layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset,
- image_target->section_align)
- - image_target->vaddr_offset;
- @@ -1876,23 +1891,6 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
- strtab,
- image_target);
-
- -#ifdef MKIMAGE_ELF32
- - if (image_target->elf_target == EM_ARM)
- - {
- - grub_size_t tramp;
- - layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset,
- - image_target->section_align) - image_target->vaddr_offset;
- -
- - layout->kernel_size = ALIGN_UP (layout->kernel_size, 16);
++- layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset,
++- image_target->section_align)
++- - image_target->vaddr_offset;
++- layout->exec_size = layout->kernel_size;
+-
- - tramp = arm_get_trampoline_size (e, sections, section_entsize,
- - num_sections, image_target);
- -
- - layout->tramp_off = layout->kernel_size;
- - layout->kernel_size += ALIGN_UP (tramp, 16);
- - }
- -#endif
++- /* .data */
++- for (i = 0, s = smd->sections;
++- i < smd->num_sections;
++- i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize))
++- if (SUFFIX (is_data_section) (s, image_target))
++- layout->kernel_size = SUFFIX (put_section) (s, i, layout->kernel_size, smd,
++- image_target);
+-
++ #ifdef MKIMAGE_ELF32
++ if (image_target->elf_target == EM_ARM)
++ {
++ grub_size_t tramp;
++- layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset,
++- image_target->section_align) - image_target->vaddr_offset;
++
++ layout->kernel_size = ALIGN_UP (layout->kernel_size, 16);
++
++@@ -2227,6 +2212,19 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
++ }
++ #endif
++
+++ layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset,
+++ image_target->section_align)
+++ - image_target->vaddr_offset;
+++ layout->exec_size = layout->kernel_size;
+++
+++ /* .data */
+++ for (i = 0, s = smd->sections;
+++ i < smd->num_sections;
+++ i++, s = (Elf_Shdr *) ((char *) s + smd->section_entsize))
+++ if (SUFFIX (is_data_section) (s, image_target))
+++ layout->kernel_size = SUFFIX (put_section) (s, i, layout->kernel_size, smd,
+++ image_target);
+++
+ layout->bss_start = layout->kernel_size;
+ layout->end = layout->kernel_size;
+
--- /dev/null
--- /dev/null
++From edb24709113248a222705695b9b047669c13c144 Mon Sep 17 00:00:00 2001
++From: Jeroen Dekkers <jeroen@dekkers.ch>
++Date: Sat, 12 Jan 2019 21:02:18 +0100
++Subject: at_keyboard: initialize keyboard in module init if keyboard is ready
++
++The change in 0c62a5b2 caused at_keyboard to fail on some
++machines. Immediately initializing the keyboard in the module init if
++the keyboard is ready makes the problem go away.
++
++Bug-Debian: https://bugs.debian.org/741464
++Last-Update: 2019-02-09
++
++Patch-Name: at_keyboard-module-init.patch
++---
++ grub-core/term/at_keyboard.c | 9 +++++++++
++ 1 file changed, 9 insertions(+)
++
++diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
++index f0a986eb1..d4395c201 100644
++--- a/grub-core/term/at_keyboard.c
+++++ b/grub-core/term/at_keyboard.c
++@@ -244,6 +244,14 @@ grub_at_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
++ return ret;
++ }
++
+++static grub_err_t
+++grub_keyboard_controller_mod_init (struct grub_term_input *term __attribute__ ((unused))) {
+++ if (KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
+++ grub_keyboard_controller_init ();
+++
+++ return GRUB_ERR_NONE;
+++}
+++
++ static void
++ grub_keyboard_controller_init (void)
++ {
++@@ -314,6 +322,7 @@ grub_at_restore_hw (void)
++ static struct grub_term_input grub_at_keyboard_term =
++ {
++ .name = "at_keyboard",
+++ .init = grub_keyboard_controller_mod_init,
++ .fini = grub_keyboard_controller_fini,
++ .getkey = grub_at_keyboard_getkey
++ };
--- /dev/null
- From 68d1db98f854eb96429757ac98714ce953241994 Mon Sep 17 00:00:00 2001
++From 128878e7826639336cb28616996888ee968dc5d2 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Fri, 16 Nov 2018 16:37:02 +0000
+Subject: bash-completion: Drop "have" checks
+
+These don't work with and aren't needed by dynamically-loaded
+completions.
+
+Bug-Debian: https://bugs.debian.org/912852
+Forwarded: no
+Last-Update: 2018-11-16
+
+Patch-Name: bash-completion-drop-have-checks.patch
+---
+ .../bash-completion.d/grub-completion.bash.in | 39 +++++++------------
+ 1 file changed, 13 insertions(+), 26 deletions(-)
+
+diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in
+index 44bf135b9..d4235e7ef 100644
+--- a/util/bash-completion.d/grub-completion.bash.in
++++ b/util/bash-completion.d/grub-completion.bash.in
+@@ -166,13 +166,11 @@ _grub_set_entry () {
+ }
+
+ __grub_set_default_program="@grub_set_default@"
+-have ${__grub_set_default_program} && \
+- complete -F _grub_set_entry -o filenames ${__grub_set_default_program}
++complete -F _grub_set_entry -o filenames ${__grub_set_default_program}
+ unset __grub_set_default_program
+
+ __grub_reboot_program="@grub_reboot@"
+-have ${__grub_reboot_program} && \
+- complete -F _grub_set_entry -o filenames ${__grub_reboot_program}
++complete -F _grub_set_entry -o filenames ${__grub_reboot_program}
+ unset __grub_reboot_program
+
+
+@@ -198,8 +196,7 @@ _grub_editenv () {
+ }
+
+ __grub_editenv_program="@grub_editenv@"
+-have ${__grub_editenv_program} && \
+- complete -F _grub_editenv -o filenames ${__grub_editenv_program}
++complete -F _grub_editenv -o filenames ${__grub_editenv_program}
+ unset __grub_editenv_program
+
+
+@@ -219,8 +216,7 @@ _grub_mkconfig () {
+ fi
+ }
+ __grub_mkconfig_program="@grub_mkconfig@"
+-have ${__grub_mkconfig_program} && \
+- complete -F _grub_mkconfig -o filenames ${__grub_mkconfig_program}
++complete -F _grub_mkconfig -o filenames ${__grub_mkconfig_program}
+ unset __grub_mkconfig_program
+
+
+@@ -254,13 +250,11 @@ _grub_setup () {
+ }
+
+ __grub_bios_setup_program="@grub_bios_setup@"
+-have ${__grub_bios_setup_program} && \
+- complete -F _grub_setup -o filenames ${__grub_bios_setup_program}
++complete -F _grub_setup -o filenames ${__grub_bios_setup_program}
+ unset __grub_bios_setup_program
+
+ __grub_sparc64_setup_program="@grub_sparc64_setup@"
+-have ${__grub_sparc64_setup_program} && \
+- complete -F _grub_setup -o filenames ${__grub_sparc64_setup_program}
++complete -F _grub_setup -o filenames ${__grub_sparc64_setup_program}
+ unset __grub_sparc64_setup_program
+
+
+@@ -305,8 +299,7 @@ _grub_install () {
+ fi
+ }
+ __grub_install_program="@grub_install@"
+-have ${__grub_install_program} && \
+- complete -F _grub_install -o filenames ${__grub_install_program}
++complete -F _grub_install -o filenames ${__grub_install_program}
+ unset __grub_install_program
+
+
+@@ -327,8 +320,7 @@ _grub_mkfont () {
+ fi
+ }
+ __grub_mkfont_program="@grub_mkfont@"
+-have ${__grub_mkfont_program} && \
+- complete -F _grub_mkfont -o filenames ${__grub_mkfont_program}
++complete -F _grub_mkfont -o filenames ${__grub_mkfont_program}
+ unset __grub_mkfont_program
+
+
+@@ -358,8 +350,7 @@ _grub_mkrescue () {
+ fi
+ }
+ __grub_mkrescue_program="@grub_mkrescue@"
+-have ${__grub_mkrescue_program} && \
+- complete -F _grub_mkrescue -o filenames ${__grub_mkrescue_program}
++complete -F _grub_mkrescue -o filenames ${__grub_mkrescue_program}
+ unset __grub_mkrescue_program
+
+
+@@ -400,8 +391,7 @@ _grub_mkimage () {
+ fi
+ }
+ __grub_mkimage_program="@grub_mkimage@"
+-have ${__grub_mkimage_program} && \
+- complete -F _grub_mkimage -o filenames ${__grub_mkimage_program}
++complete -F _grub_mkimage -o filenames ${__grub_mkimage_program}
+ unset __grub_mkimage_program
+
+
+@@ -422,8 +412,7 @@ _grub_mkpasswd_pbkdf2 () {
+ fi
+ }
+ __grub_mkpasswd_pbkdf2_program="@grub_mkpasswd_pbkdf2@"
+-have ${__grub_mkpasswd_pbkdf2_program} && \
+- complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program}
++complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program}
+ unset __grub_mkpasswd_pbkdf2_program
+
+
+@@ -460,8 +449,7 @@ _grub_probe () {
+ fi
+ }
+ __grub_probe_program="@grub_probe@"
+-have ${__grub_probe_program} && \
+- complete -F _grub_probe -o filenames ${__grub_probe_program}
++complete -F _grub_probe -o filenames ${__grub_probe_program}
+ unset __grub_probe_program
+
+
+@@ -482,8 +470,7 @@ _grub_script_check () {
+ fi
+ }
+ __grub_script_check_program="@grub_script_check@"
+-have ${__grub_script_check_program} && \
+- complete -F _grub_script_check -o filenames ${__grub_script_check_program}
++complete -F _grub_script_check -o filenames ${__grub_script_check_program}
+
+
+ # Local variables:
--- /dev/null
--- /dev/null
++From 593a2e09c6d1d953846ecb75864f2cd2809db391 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:11 +0000
++Subject: Blacklist 1440x900x32 from VBE preferred mode handling
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/701111
++Forwarded: no
++Last-Update: 2013-11-14
++
++Patch-Name: blacklist-1440x900x32.patch
++---
++ grub-core/video/i386/pc/vbe.c | 9 +++++++++
++ 1 file changed, 9 insertions(+)
++
++diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c
++index b7f911926..4b1bd7d5e 100644
++--- a/grub-core/video/i386/pc/vbe.c
+++++ b/grub-core/video/i386/pc/vbe.c
++@@ -1054,6 +1054,15 @@ grub_video_vbe_setup (unsigned int width, unsigned int height,
++ || vbe_mode_info.y_resolution > height)
++ /* Resolution exceeds that of preferred mode. */
++ continue;
+++
+++ /* Blacklist 1440x900x32 from preferred mode handling until a
+++ better solution is available. This mode causes problems on
+++ many Thinkpads. See:
+++ https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/701111 */
+++ if (vbe_mode_info.x_resolution == 1440 &&
+++ vbe_mode_info.y_resolution == 900 &&
+++ vbe_mode_info.bits_per_pixel == 32)
+++ continue;
++ }
++ else
++ {
--- /dev/null
--- /dev/null
++From 34b0bb7382013ac091a4d36730aeaa1f99f59bf8 Mon Sep 17 00:00:00 2001
++From: Michael Chang <mchang@suse.com>
++Date: Thu, 27 Oct 2016 17:41:04 -0400
++Subject: bootp: New net_bootp6 command
++
++Implement new net_bootp6 command for IPv6 network auto configuration via the
++DHCPv6 protocol (RFC3315).
++
++Signed-off-by: Michael Chang <mchang@suse.com>
++Signed-off-by: Ken Lin <ken.lin@hpe.com>
++
++Patch-Name: bootp-new-net_bootp6-command.patch
++---
++ grub-core/net/bootp.c | 908 +++++++++++++++++++++++++++++++++++++++++-
++ grub-core/net/ip.c | 39 ++
++ include/grub/net.h | 72 ++++
++ 3 files changed, 1018 insertions(+), 1 deletion(-)
++
++diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
++index 04cfbb045..21c1824ef 100644
++--- a/grub-core/net/bootp.c
+++++ b/grub-core/net/bootp.c
++@@ -24,6 +24,98 @@
++ #include <grub/net/netbuff.h>
++ #include <grub/net/udp.h>
++ #include <grub/datetime.h>
+++#include <grub/time.h>
+++#include <grub/list.h>
+++
+++static int
+++dissect_url (const char *url, char **proto, char **host, char **path)
+++{
+++ const char *p, *ps;
+++ grub_size_t l;
+++
+++ *proto = *host = *path = NULL;
+++ ps = p = url;
+++
+++ while ((p = grub_strchr (p, ':')))
+++ {
+++ if (grub_strlen (p) < sizeof ("://") - 1)
+++ break;
+++ if (grub_memcmp (p, "://", sizeof ("://") - 1) == 0)
+++ {
+++ l = p - ps;
+++ *proto = grub_malloc (l + 1);
+++ if (!*proto)
+++ {
+++ grub_print_error ();
+++ return 0;
+++ }
+++
+++ grub_memcpy (*proto, ps, l);
+++ (*proto)[l] = '\0';
+++ p += sizeof ("://") - 1;
+++ break;
+++ }
+++ ++p;
+++ }
+++
+++ if (!*proto)
+++ {
+++ grub_dprintf ("bootp", "url: %s is not valid, protocol not found\n", url);
+++ return 0;
+++ }
+++
+++ ps = p;
+++ p = grub_strchr (p, '/');
+++
+++ if (!p)
+++ {
+++ grub_dprintf ("bootp", "url: %s is not valid, host/path not found\n", url);
+++ grub_free (*proto);
+++ *proto = NULL;
+++ return 0;
+++ }
+++
+++ l = p - ps;
+++
+++ if (l > 2 && ps[0] == '[' && ps[l - 1] == ']')
+++ {
+++ *host = grub_malloc (l - 1);
+++ if (!*host)
+++ {
+++ grub_print_error ();
+++ grub_free (*proto);
+++ *proto = NULL;
+++ return 0;
+++ }
+++ grub_memcpy (*host, ps + 1, l - 2);
+++ (*host)[l - 2] = 0;
+++ }
+++ else
+++ {
+++ *host = grub_malloc (l + 1);
+++ if (!*host)
+++ {
+++ grub_print_error ();
+++ grub_free (*proto);
+++ *proto = NULL;
+++ return 0;
+++ }
+++ grub_memcpy (*host, ps, l);
+++ (*host)[l] = 0;
+++ }
+++
+++ *path = grub_strdup (p);
+++ if (!*path)
+++ {
+++ grub_print_error ();
+++ grub_free (*host);
+++ grub_free (*proto);
+++ *host = NULL;
+++ *proto = NULL;
+++ return 0;
+++ }
+++ return 1;
+++}
++
++ struct grub_dhcp_discover_options
++ {
++@@ -563,6 +655,578 @@ out:
++ return err;
++ }
++
+++/* The default netbuff size for sending DHCPv6 packets which should be
+++ large enough to hold the information */
+++#define GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE 512
+++
+++struct grub_dhcp6_options
+++{
+++ grub_uint8_t *client_duid;
+++ grub_uint16_t client_duid_len;
+++ grub_uint8_t *server_duid;
+++ grub_uint16_t server_duid_len;
+++ grub_uint32_t iaid;
+++ grub_uint32_t t1;
+++ grub_uint32_t t2;
+++ grub_net_network_level_address_t *ia_addr;
+++ grub_uint32_t preferred_lifetime;
+++ grub_uint32_t valid_lifetime;
+++ grub_net_network_level_address_t *dns_server_addrs;
+++ grub_uint16_t num_dns_server;
+++ char *boot_file_proto;
+++ char *boot_file_server_ip;
+++ char *boot_file_path;
+++};
+++
+++typedef struct grub_dhcp6_options *grub_dhcp6_options_t;
+++
+++struct grub_dhcp6_session
+++{
+++ struct grub_dhcp6_session *next;
+++ struct grub_dhcp6_session **prev;
+++ grub_uint32_t iaid;
+++ grub_uint32_t transaction_id:24;
+++ grub_uint64_t start_time;
+++ struct grub_net_dhcp6_option_duid_ll duid;
+++ struct grub_net_network_level_interface *iface;
+++
+++ /* The associated dhcpv6 options */
+++ grub_dhcp6_options_t adv;
+++ grub_dhcp6_options_t reply;
+++};
+++
+++typedef struct grub_dhcp6_session *grub_dhcp6_session_t;
+++
+++typedef void (*dhcp6_option_hook_fn) (const struct grub_net_dhcp6_option *opt, void *data);
+++
+++static void
+++foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size,
+++ dhcp6_option_hook_fn hook, void *hook_data);
+++
+++static void
+++parse_dhcp6_iaaddr (const struct grub_net_dhcp6_option *opt, void *data)
+++{
+++ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t )data;
+++
+++ grub_uint16_t code = grub_be_to_cpu16 (opt->code);
+++ grub_uint16_t len = grub_be_to_cpu16 (opt->len);
+++
+++ if (code == GRUB_NET_DHCP6_OPTION_IAADDR)
+++ {
+++ const struct grub_net_dhcp6_option_iaaddr *iaaddr;
+++ iaaddr = (const struct grub_net_dhcp6_option_iaaddr *)opt->data;
+++
+++ if (len < sizeof (*iaaddr))
+++ {
+++ grub_dprintf ("bootp", "DHCPv6: code %u with insufficient length %u\n", code, len);
+++ return;
+++ }
+++ if (!dhcp6->ia_addr)
+++ {
+++ dhcp6->ia_addr = grub_malloc (sizeof(*dhcp6->ia_addr));
+++ dhcp6->ia_addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
+++ dhcp6->ia_addr->ipv6[0] = grub_get_unaligned64 (iaaddr->addr);
+++ dhcp6->ia_addr->ipv6[1] = grub_get_unaligned64 (iaaddr->addr + 8);
+++ dhcp6->preferred_lifetime = grub_be_to_cpu32 (iaaddr->preferred_lifetime);
+++ dhcp6->valid_lifetime = grub_be_to_cpu32 (iaaddr->valid_lifetime);
+++ }
+++ }
+++}
+++
+++static void
+++parse_dhcp6_option (const struct grub_net_dhcp6_option *opt, void *data)
+++{
+++ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t)data;
+++ grub_uint16_t code = grub_be_to_cpu16 (opt->code);
+++ grub_uint16_t len = grub_be_to_cpu16 (opt->len);
+++
+++ switch (code)
+++ {
+++ case GRUB_NET_DHCP6_OPTION_CLIENTID:
+++
+++ if (dhcp6->client_duid || !len)
+++ {
+++ grub_dprintf ("bootp", "Skipped DHCPv6 CLIENTID with length %u\n", len);
+++ break;
+++ }
+++ dhcp6->client_duid = grub_malloc (len);
+++ grub_memcpy (dhcp6->client_duid, opt->data, len);
+++ dhcp6->client_duid_len = len;
+++ break;
+++
+++ case GRUB_NET_DHCP6_OPTION_SERVERID:
+++
+++ if (dhcp6->server_duid || !len)
+++ {
+++ grub_dprintf ("bootp", "Skipped DHCPv6 SERVERID with length %u\n", len);
+++ break;
+++ }
+++ dhcp6->server_duid = grub_malloc (len);
+++ grub_memcpy (dhcp6->server_duid, opt->data, len);
+++ dhcp6->server_duid_len = len;
+++ break;
+++
+++ case GRUB_NET_DHCP6_OPTION_IA_NA:
+++ {
+++ const struct grub_net_dhcp6_option_iana *ia_na;
+++ grub_uint16_t data_len;
+++
+++ if (dhcp6->iaid || len < sizeof (*ia_na))
+++ {
+++ grub_dprintf ("bootp", "Skipped DHCPv6 IA_NA with length %u\n", len);
+++ break;
+++ }
+++ ia_na = (const struct grub_net_dhcp6_option_iana *)opt->data;
+++ dhcp6->iaid = grub_be_to_cpu32 (ia_na->iaid);
+++ dhcp6->t1 = grub_be_to_cpu32 (ia_na->t1);
+++ dhcp6->t2 = grub_be_to_cpu32 (ia_na->t2);
+++
+++ data_len = len - sizeof (*ia_na);
+++ if (data_len)
+++ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)ia_na->data, data_len, parse_dhcp6_iaaddr, dhcp6);
+++ }
+++ break;
+++
+++ case GRUB_NET_DHCP6_OPTION_DNS_SERVERS:
+++ {
+++ const grub_uint8_t *po;
+++ grub_uint16_t ln;
+++ grub_net_network_level_address_t *la;
+++
+++ if (!len || len & 0xf)
+++ {
+++ grub_dprintf ("bootp", "Skip invalid length DHCPv6 DNS_SERVERS \n");
+++ break;
+++ }
+++ dhcp6->num_dns_server = ln = len >> 4;
+++ dhcp6->dns_server_addrs = la = grub_zalloc (ln * sizeof (*la));
+++
+++ for (po = opt->data; ln > 0; po += 0x10, la++, ln--)
+++ {
+++ la->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
+++ la->ipv6[0] = grub_get_unaligned64 (po);
+++ la->ipv6[1] = grub_get_unaligned64 (po + 8);
+++ la->option = DNS_OPTION_PREFER_IPV6;
+++ }
+++ }
+++ break;
+++
+++ case GRUB_NET_DHCP6_OPTION_BOOTFILE_URL:
+++ dissect_url ((const char *)opt->data,
+++ &dhcp6->boot_file_proto,
+++ &dhcp6->boot_file_server_ip,
+++ &dhcp6->boot_file_path);
+++ break;
+++
+++ default:
+++ break;
+++ }
+++}
+++
+++static void
+++foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size, dhcp6_option_hook_fn hook, void *hook_data)
+++{
+++ while (size)
+++ {
+++ grub_uint16_t code, len;
+++
+++ if (size < sizeof (*opt))
+++ {
+++ grub_dprintf ("bootp", "DHCPv6: Options stopped with remaining size %" PRIxGRUB_SIZE "\n", size);
+++ break;
+++ }
+++ size -= sizeof (*opt);
+++ len = grub_be_to_cpu16 (opt->len);
+++ code = grub_be_to_cpu16 (opt->code);
+++ if (size < len)
+++ {
+++ grub_dprintf ("bootp", "DHCPv6: Options stopped at out of bound length %u for option %u\n", len, code);
+++ break;
+++ }
+++ if (!len)
+++ {
+++ grub_dprintf ("bootp", "DHCPv6: Options stopped at zero length option %u\n", code);
+++ break;
+++ }
+++ else
+++ {
+++ if (hook)
+++ hook (opt, hook_data);
+++ size -= len;
+++ opt = (const struct grub_net_dhcp6_option *)((grub_uint8_t *)opt + len + sizeof (*opt));
+++ }
+++ }
+++}
+++
+++static grub_dhcp6_options_t
+++grub_dhcp6_options_get (const struct grub_net_dhcp6_packet *v6h,
+++ grub_size_t size)
+++{
+++ grub_dhcp6_options_t options;
+++
+++ if (size < sizeof (*v6h))
+++ {
+++ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("DHCPv6 packet size too small"));
+++ return NULL;
+++ }
+++
+++ options = grub_zalloc (sizeof(*options));
+++ if (!options)
+++ return NULL;
+++
+++ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)v6h->dhcp_options,
+++ size - sizeof (*v6h), parse_dhcp6_option, options);
+++
+++ return options;
+++}
+++
+++static void
+++grub_dhcp6_options_free (grub_dhcp6_options_t options)
+++{
+++ if (options->client_duid)
+++ grub_free (options->client_duid);
+++ if (options->server_duid)
+++ grub_free (options->server_duid);
+++ if (options->ia_addr)
+++ grub_free (options->ia_addr);
+++ if (options->dns_server_addrs)
+++ grub_free (options->dns_server_addrs);
+++ if (options->boot_file_proto)
+++ grub_free (options->boot_file_proto);
+++ if (options->boot_file_server_ip)
+++ grub_free (options->boot_file_server_ip);
+++ if (options->boot_file_path)
+++ grub_free (options->boot_file_path);
+++
+++ grub_free (options);
+++}
+++
+++static grub_dhcp6_session_t grub_dhcp6_sessions;
+++#define FOR_DHCP6_SESSIONS(var) FOR_LIST_ELEMENTS (var, grub_dhcp6_sessions)
+++
+++static void
+++grub_net_configure_by_dhcp6_info (const char *name,
+++ struct grub_net_card *card,
+++ grub_dhcp6_options_t dhcp6,
+++ int is_def,
+++ int flags,
+++ struct grub_net_network_level_interface **ret_inf)
+++{
+++ grub_net_network_level_netaddress_t netaddr;
+++ struct grub_net_network_level_interface *inf;
+++
+++ if (dhcp6->ia_addr)
+++ {
+++ inf = grub_net_add_addr (name, card, dhcp6->ia_addr, &card->default_address, flags);
+++
+++ netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
+++ netaddr.ipv6.base[0] = dhcp6->ia_addr->ipv6[0];
+++ netaddr.ipv6.base[1] = 0;
+++ netaddr.ipv6.masksize = 64;
+++ grub_net_add_route (name, netaddr, inf);
+++
+++ if (ret_inf)
+++ *ret_inf = inf;
+++ }
+++
+++ if (dhcp6->dns_server_addrs)
+++ {
+++ grub_uint16_t i;
+++
+++ for (i = 0; i < dhcp6->num_dns_server; ++i)
+++ grub_net_add_dns_server (dhcp6->dns_server_addrs + i);
+++ }
+++
+++ if (dhcp6->boot_file_path)
+++ grub_env_set_net_property (name, "boot_file", dhcp6->boot_file_path,
+++ grub_strlen (dhcp6->boot_file_path));
+++
+++ if (is_def && dhcp6->boot_file_server_ip)
+++ {
+++ grub_net_default_server = grub_strdup (dhcp6->boot_file_server_ip);
+++ grub_env_set ("net_default_interface", name);
+++ grub_env_export ("net_default_interface");
+++ }
+++}
+++
+++static void
+++grub_dhcp6_session_add (struct grub_net_network_level_interface *iface,
+++ grub_uint32_t iaid)
+++{
+++ grub_dhcp6_session_t se;
+++ struct grub_datetime date;
+++ grub_err_t err;
+++ grub_int32_t t = 0;
+++
+++ se = grub_malloc (sizeof (*se));
+++
+++ err = grub_get_datetime (&date);
+++ if (err || !grub_datetime2unixtime (&date, &t))
+++ {
+++ grub_errno = GRUB_ERR_NONE;
+++ t = 0;
+++ }
+++
+++ se->iface = iface;
+++ se->iaid = iaid;
+++ se->transaction_id = t;
+++ se->start_time = grub_get_time_ms ();
+++ se->duid.type = grub_cpu_to_be16_compile_time (3) ;
+++ se->duid.hw_type = grub_cpu_to_be16_compile_time (1);
+++ grub_memcpy (&se->duid.hwaddr, &iface->hwaddress.mac, sizeof (se->duid.hwaddr));
+++ se->adv = NULL;
+++ se->reply = NULL;
+++ grub_list_push (GRUB_AS_LIST_P (&grub_dhcp6_sessions), GRUB_AS_LIST (se));
+++}
+++
+++static void
+++grub_dhcp6_session_remove (grub_dhcp6_session_t se)
+++{
+++ grub_list_remove (GRUB_AS_LIST (se));
+++ if (se->adv)
+++ grub_dhcp6_options_free (se->adv);
+++ if (se->reply)
+++ grub_dhcp6_options_free (se->reply);
+++ grub_free (se);
+++}
+++
+++static void
+++grub_dhcp6_session_remove_all (void)
+++{
+++ grub_dhcp6_session_t se;
+++
+++ FOR_DHCP6_SESSIONS (se)
+++ {
+++ grub_dhcp6_session_remove (se);
+++ se = grub_dhcp6_sessions;
+++ }
+++}
+++
+++static grub_err_t
+++grub_dhcp6_session_configure_network (grub_dhcp6_session_t se)
+++{
+++ char *name;
+++
+++ name = grub_xasprintf ("%s:dhcp6", se->iface->card->name);
+++ if (!name)
+++ return grub_errno;
+++
+++ grub_net_configure_by_dhcp6_info (name, se->iface->card, se->reply, 1, 0, 0);
+++ grub_free (name);
+++
+++ return GRUB_ERR_NONE;
+++}
+++
+++static grub_err_t
+++grub_dhcp6_session_send_request (grub_dhcp6_session_t se)
+++{
+++ struct grub_net_buff *nb;
+++ struct grub_net_dhcp6_option *opt;
+++ struct grub_net_dhcp6_packet *v6h;
+++ struct grub_net_dhcp6_option_iana *ia_na;
+++ struct grub_net_dhcp6_option_iaaddr *iaaddr;
+++ struct udphdr *udph;
+++ grub_net_network_level_address_t multicast;
+++ grub_net_link_level_address_t ll_multicast;
+++ grub_uint64_t elapsed;
+++ struct grub_net_network_level_interface *inf = se->iface;
+++ grub_dhcp6_options_t dhcp6 = se->adv;
+++ grub_err_t err = GRUB_ERR_NONE;
+++
+++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
+++ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48);
+++ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL);
+++
+++ err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast);
+++ if (err)
+++ return err;
+++
+++ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE);
+++
+++ if (!nb)
+++ return grub_errno;
+++
+++ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE);
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ err = grub_netbuff_push (nb, dhcp6->client_duid_len + sizeof (*opt));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID);
+++ opt->len = grub_cpu_to_be16 (dhcp6->client_duid_len);
+++ grub_memcpy (opt->data, dhcp6->client_duid , dhcp6->client_duid_len);
+++
+++ err = grub_netbuff_push (nb, dhcp6->server_duid_len + sizeof (*opt));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_SERVERID);
+++ opt->len = grub_cpu_to_be16 (dhcp6->server_duid_len);
+++ grub_memcpy (opt->data, dhcp6->server_duid , dhcp6->server_duid_len);
+++
+++ err = grub_netbuff_push (nb, sizeof (*ia_na) + sizeof (*opt));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ if (dhcp6->ia_addr)
+++ {
+++ err = grub_netbuff_push (nb, sizeof(*iaaddr) + sizeof (*opt));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++ }
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA);
+++ opt->len = grub_cpu_to_be16 (sizeof (*ia_na));
+++ if (dhcp6->ia_addr)
+++ opt->len += grub_cpu_to_be16 (sizeof(*iaaddr) + sizeof (*opt));
+++
+++ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data;
+++ ia_na->iaid = grub_cpu_to_be32 (dhcp6->iaid);
+++
+++ ia_na->t1 = grub_cpu_to_be32 (dhcp6->t1);
+++ ia_na->t2 = grub_cpu_to_be32 (dhcp6->t2);
+++
+++ if (dhcp6->ia_addr)
+++ {
+++ opt = (struct grub_net_dhcp6_option *)ia_na->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR);
+++ opt->len = grub_cpu_to_be16 (sizeof (*iaaddr));
+++ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)opt->data;
+++ grub_set_unaligned64 (iaaddr->addr, dhcp6->ia_addr->ipv6[0]);
+++ grub_set_unaligned64 (iaaddr->addr + 8, dhcp6->ia_addr->ipv6[1]);
+++
+++ iaaddr->preferred_lifetime = grub_cpu_to_be32 (dhcp6->preferred_lifetime);
+++ iaaddr->valid_lifetime = grub_cpu_to_be32 (dhcp6->valid_lifetime);
+++ }
+++
+++ err = grub_netbuff_push (nb, sizeof (*opt) + 2 * sizeof (grub_uint16_t));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ opt = (struct grub_net_dhcp6_option*) nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ORO);
+++ opt->len = grub_cpu_to_be16_compile_time (2 * sizeof (grub_uint16_t));
+++ grub_set_unaligned16 (opt->data, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL));
+++ grub_set_unaligned16 (opt->data + 2, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS));
+++
+++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++ opt = (struct grub_net_dhcp6_option*) nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME);
+++ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t));
+++
+++ /* the time is expressed in hundredths of a second */
+++ elapsed = grub_divmod64 (grub_get_time_ms () - se->start_time, 10, 0);
+++
+++ if (elapsed > 0xffff)
+++ elapsed = 0xffff;
+++
+++ grub_set_unaligned16 (opt->data, grub_cpu_to_be16 ((grub_uint16_t)elapsed));
+++
+++ err = grub_netbuff_push (nb, sizeof (*v6h));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ v6h = (struct grub_net_dhcp6_packet *) nb->data;
+++ v6h->message_type = GRUB_NET_DHCP6_REQUEST;
+++ v6h->transaction_id = se->transaction_id;
+++
+++ err = grub_netbuff_push (nb, sizeof (*udph));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ udph = (struct udphdr *) nb->data;
+++ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT);
+++ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT);
+++ udph->chksum = 0;
+++ udph->len = grub_cpu_to_be16 (nb->tail - nb->data);
+++
+++ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP,
+++ &inf->address,
+++ &multicast);
+++ err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb,
+++ GRUB_NET_IP_UDP);
+++
+++ grub_netbuff_free (nb);
+++
+++ return err;
+++}
+++
+++struct grub_net_network_level_interface *
+++grub_net_configure_by_dhcpv6_reply (const char *name,
+++ struct grub_net_card *card,
+++ grub_net_interface_flags_t flags,
+++ const struct grub_net_dhcp6_packet *v6h,
+++ grub_size_t size,
+++ int is_def,
+++ char **device, char **path)
+++{
+++ struct grub_net_network_level_interface *inf;
+++ grub_dhcp6_options_t dhcp6;
+++
+++ dhcp6 = grub_dhcp6_options_get (v6h, size);
+++ if (!dhcp6)
+++ {
+++ grub_print_error ();
+++ return NULL;
+++ }
+++
+++ grub_net_configure_by_dhcp6_info (name, card, dhcp6, is_def, flags, &inf);
+++
+++ if (device && dhcp6->boot_file_proto && dhcp6->boot_file_server_ip)
+++ {
+++ *device = grub_xasprintf ("%s,%s", dhcp6->boot_file_proto, dhcp6->boot_file_server_ip);
+++ grub_print_error ();
+++ }
+++ if (path && dhcp6->boot_file_path)
+++ {
+++ *path = grub_strdup (dhcp6->boot_file_path);
+++ grub_print_error ();
+++ if (*path)
+++ {
+++ char *slash;
+++ slash = grub_strrchr (*path, '/');
+++ if (slash)
+++ *slash = 0;
+++ else
+++ **path = 0;
+++ }
+++ }
+++
+++ grub_dhcp6_options_free (dhcp6);
+++ return inf;
+++}
+++
++ /*
++ * This is called directly from net/ip.c:handle_dgram(), because those
++ * BOOTP/DHCP packets are a bit special due to their improper
++@@ -631,6 +1295,77 @@ grub_net_process_dhcp (struct grub_net_buff *nb,
++ }
++ }
++
+++grub_err_t
+++grub_net_process_dhcp6 (struct grub_net_buff *nb,
+++ struct grub_net_card *card __attribute__ ((unused)))
+++{
+++ const struct grub_net_dhcp6_packet *v6h;
+++ grub_dhcp6_session_t se;
+++ grub_size_t size;
+++ grub_dhcp6_options_t options;
+++
+++ v6h = (const struct grub_net_dhcp6_packet *) nb->data;
+++ size = nb->tail - nb->data;
+++
+++ options = grub_dhcp6_options_get (v6h, size);
+++ if (!options)
+++ return grub_errno;
+++
+++ if (!options->client_duid || !options->server_duid || !options->ia_addr)
+++ {
+++ grub_dhcp6_options_free (options);
+++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Bad DHCPv6 Packet");
+++ }
+++
+++ FOR_DHCP6_SESSIONS (se)
+++ {
+++ if (se->transaction_id == v6h->transaction_id &&
+++ grub_memcmp (options->client_duid, &se->duid, sizeof (se->duid)) == 0 &&
+++ se->iaid == options->iaid)
+++ break;
+++ }
+++
+++ if (!se)
+++ {
+++ grub_dprintf ("bootp", "DHCPv6 session not found\n");
+++ grub_dhcp6_options_free (options);
+++ return GRUB_ERR_NONE;
+++ }
+++
+++ if (v6h->message_type == GRUB_NET_DHCP6_ADVERTISE)
+++ {
+++ if (se->adv)
+++ {
+++ grub_dprintf ("bootp", "Skipped DHCPv6 Advertised .. \n");
+++ grub_dhcp6_options_free (options);
+++ return GRUB_ERR_NONE;
+++ }
+++
+++ se->adv = options;
+++ return grub_dhcp6_session_send_request (se);
+++ }
+++ else if (v6h->message_type == GRUB_NET_DHCP6_REPLY)
+++ {
+++ if (!se->adv)
+++ {
+++ grub_dprintf ("bootp", "Skipped DHCPv6 Reply .. \n");
+++ grub_dhcp6_options_free (options);
+++ return GRUB_ERR_NONE;
+++ }
+++
+++ se->reply = options;
+++ grub_dhcp6_session_configure_network (se);
+++ grub_dhcp6_session_remove (se);
+++ return GRUB_ERR_NONE;
+++ }
+++ else
+++ {
+++ grub_dhcp6_options_free (options);
+++ }
+++
+++ return GRUB_ERR_NONE;
+++}
+++
++ static char
++ hexdigit (grub_uint8_t val)
++ {
++@@ -864,7 +1599,174 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
++ return err;
++ }
++
++-static grub_command_t cmd_getdhcp, cmd_bootp, cmd_dhcp;
+++static grub_err_t
+++grub_cmd_bootp6 (struct grub_command *cmd __attribute__ ((unused)),
+++ int argc, char **args)
+++{
+++ struct grub_net_card *card;
+++ grub_uint32_t iaid = 0;
+++ int interval;
+++ grub_err_t err;
+++ grub_dhcp6_session_t se;
+++
+++ err = GRUB_ERR_NONE;
+++
+++ FOR_NET_CARDS (card)
+++ {
+++ struct grub_net_network_level_interface *iface;
+++
+++ if (argc > 0 && grub_strcmp (card->name, args[0]) != 0)
+++ continue;
+++
+++ iface = grub_net_ipv6_get_link_local (card, &card->default_address);
+++ if (!iface)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ return grub_errno;
+++ }
+++
+++ grub_dhcp6_session_add (iface, iaid++);
+++ }
+++
+++ for (interval = 200; interval < 10000; interval *= 2)
+++ {
+++ int done = 1;
+++
+++ FOR_DHCP6_SESSIONS (se)
+++ {
+++ struct grub_net_buff *nb;
+++ struct grub_net_dhcp6_option *opt;
+++ struct grub_net_dhcp6_packet *v6h;
+++ struct grub_net_dhcp6_option_duid_ll *duid;
+++ struct grub_net_dhcp6_option_iana *ia_na;
+++ grub_net_network_level_address_t multicast;
+++ grub_net_link_level_address_t ll_multicast;
+++ struct udphdr *udph;
+++
+++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
+++ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48);
+++ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL);
+++
+++ err = grub_net_link_layer_resolve (se->iface,
+++ &multicast, &ll_multicast);
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ return err;
+++ }
+++
+++ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE);
+++
+++ if (!nb)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ return grub_errno;
+++ }
+++
+++ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE);
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t));
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME);
+++ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t));
+++ grub_set_unaligned16 (opt->data, 0);
+++
+++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*duid));
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID);
+++ opt->len = grub_cpu_to_be16 (sizeof (*duid));
+++
+++ duid = (struct grub_net_dhcp6_option_duid_ll *) opt->data;
+++ grub_memcpy (duid, &se->duid, sizeof (*duid));
+++
+++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*ia_na));
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->data;
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA);
+++ opt->len = grub_cpu_to_be16 (sizeof (*ia_na));
+++ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data;
+++ ia_na->iaid = grub_cpu_to_be32 (se->iaid);
+++ ia_na->t1 = 0;
+++ ia_na->t2 = 0;
+++
+++ err = grub_netbuff_push (nb, sizeof (*v6h));
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ v6h = (struct grub_net_dhcp6_packet *)nb->data;
+++ v6h->message_type = GRUB_NET_DHCP6_SOLICIT;
+++ v6h->transaction_id = se->transaction_id;
+++
+++ grub_netbuff_push (nb, sizeof (*udph));
+++
+++ udph = (struct udphdr *) nb->data;
+++ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT);
+++ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT);
+++ udph->chksum = 0;
+++ udph->len = grub_cpu_to_be16 (nb->tail - nb->data);
+++
+++ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP,
+++ &se->iface->address, &multicast);
+++
+++ err = grub_net_send_ip_packet (se->iface, &multicast,
+++ &ll_multicast, nb, GRUB_NET_IP_UDP);
+++ done = 0;
+++ grub_netbuff_free (nb);
+++
+++ if (err)
+++ {
+++ grub_dhcp6_session_remove_all ();
+++ return err;
+++ }
+++ }
+++ if (!done)
+++ grub_net_poll_cards (interval, 0);
+++ }
+++
+++ FOR_DHCP6_SESSIONS (se)
+++ {
+++ grub_error_push ();
+++ err = grub_error (GRUB_ERR_FILE_NOT_FOUND,
+++ N_("couldn't autoconfigure %s"),
+++ se->iface->card->name);
+++ }
+++
+++ grub_dhcp6_session_remove_all ();
+++
+++ return err;
+++}
+++
+++static grub_command_t cmd_getdhcp, cmd_bootp, cmd_dhcp, cmd_bootp6;
++
++ void
++ grub_bootp_init (void)
++@@ -878,6 +1780,9 @@ grub_bootp_init (void)
++ cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt,
++ N_("VAR INTERFACE NUMBER DESCRIPTION"),
++ N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value."));
+++ cmd_bootp6 = grub_register_command ("net_bootp6", grub_cmd_bootp6,
+++ N_("[CARD]"),
+++ N_("perform a DHCPv6 autoconfiguration"));
++ }
++
++ void
++@@ -886,4 +1791,5 @@ grub_bootp_fini (void)
++ grub_unregister_command (cmd_getdhcp);
++ grub_unregister_command (cmd_bootp);
++ grub_unregister_command (cmd_dhcp);
+++ grub_unregister_command (cmd_bootp6);
++ }
++diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c
++index ea5edf8f1..01410798b 100644
++--- a/grub-core/net/ip.c
+++++ b/grub-core/net/ip.c
++@@ -239,6 +239,45 @@ handle_dgram (struct grub_net_buff *nb,
++ {
++ struct udphdr *udph;
++ udph = (struct udphdr *) nb->data;
+++
+++ if (proto == GRUB_NET_IP_UDP && udph->dst == grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT))
+++ {
+++ if (udph->chksum)
+++ {
+++ grub_uint16_t chk, expected;
+++ chk = udph->chksum;
+++ udph->chksum = 0;
+++ expected = grub_net_ip_transport_checksum (nb,
+++ GRUB_NET_IP_UDP,
+++ source,
+++ dest);
+++ if (expected != chk)
+++ {
+++ grub_dprintf ("net", "Invalid UDP checksum. "
+++ "Expected %x, got %x\n",
+++ grub_be_to_cpu16 (expected),
+++ grub_be_to_cpu16 (chk));
+++ grub_netbuff_free (nb);
+++ return GRUB_ERR_NONE;
+++ }
+++ udph->chksum = chk;
+++ }
+++
+++ err = grub_netbuff_pull (nb, sizeof (*udph));
+++ if (err)
+++ {
+++ grub_netbuff_free (nb);
+++ return err;
+++ }
+++
+++ err = grub_net_process_dhcp6 (nb, card);
+++ if (err)
+++ grub_print_error ();
+++
+++ grub_netbuff_free (nb);
+++ return GRUB_ERR_NONE;
+++ }
+++
++ if (proto == GRUB_NET_IP_UDP && grub_be_to_cpu16 (udph->dst) == 68)
++ {
++ const struct grub_net_bootp_packet *bootp;
++diff --git a/include/grub/net.h b/include/grub/net.h
++index cc114286e..58cff96d2 100644
++--- a/include/grub/net.h
+++++ b/include/grub/net.h
++@@ -448,6 +448,66 @@ struct grub_net_bootp_packet
++ grub_uint8_t vendor[0];
++ } GRUB_PACKED;
++
+++struct grub_net_dhcp6_packet
+++{
+++ grub_uint32_t message_type:8;
+++ grub_uint32_t transaction_id:24;
+++ grub_uint8_t dhcp_options[0];
+++} GRUB_PACKED;
+++
+++struct grub_net_dhcp6_option {
+++ grub_uint16_t code;
+++ grub_uint16_t len;
+++ grub_uint8_t data[0];
+++} GRUB_PACKED;
+++
+++struct grub_net_dhcp6_option_iana {
+++ grub_uint32_t iaid;
+++ grub_uint32_t t1;
+++ grub_uint32_t t2;
+++ grub_uint8_t data[0];
+++} GRUB_PACKED;
+++
+++struct grub_net_dhcp6_option_iaaddr {
+++ grub_uint8_t addr[16];
+++ grub_uint32_t preferred_lifetime;
+++ grub_uint32_t valid_lifetime;
+++ grub_uint8_t data[0];
+++} GRUB_PACKED;
+++
+++struct grub_net_dhcp6_option_duid_ll
+++{
+++ grub_uint16_t type;
+++ grub_uint16_t hw_type;
+++ grub_uint8_t hwaddr[6];
+++} GRUB_PACKED;
+++
+++enum
+++ {
+++ GRUB_NET_DHCP6_SOLICIT = 1,
+++ GRUB_NET_DHCP6_ADVERTISE = 2,
+++ GRUB_NET_DHCP6_REQUEST = 3,
+++ GRUB_NET_DHCP6_REPLY = 7
+++ };
+++
+++enum
+++ {
+++ DHCP6_CLIENT_PORT = 546,
+++ DHCP6_SERVER_PORT = 547
+++ };
+++
+++enum
+++ {
+++ GRUB_NET_DHCP6_OPTION_CLIENTID = 1,
+++ GRUB_NET_DHCP6_OPTION_SERVERID = 2,
+++ GRUB_NET_DHCP6_OPTION_IA_NA = 3,
+++ GRUB_NET_DHCP6_OPTION_IAADDR = 5,
+++ GRUB_NET_DHCP6_OPTION_ORO = 6,
+++ GRUB_NET_DHCP6_OPTION_ELAPSED_TIME = 8,
+++ GRUB_NET_DHCP6_OPTION_DNS_SERVERS = 23,
+++ GRUB_NET_DHCP6_OPTION_BOOTFILE_URL = 59
+++ };
+++
++ #define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63
++ #define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82
++ #define GRUB_NET_BOOTP_RFC1048_MAGIC_2 0x53
++@@ -481,6 +541,14 @@ grub_net_configure_by_dhcp_ack (const char *name,
++ grub_size_t size,
++ int is_def, char **device, char **path);
++
+++struct grub_net_network_level_interface *
+++grub_net_configure_by_dhcpv6_reply (const char *name,
+++ struct grub_net_card *card,
+++ grub_net_interface_flags_t flags,
+++ const struct grub_net_dhcp6_packet *v6,
+++ grub_size_t size,
+++ int is_def, char **device, char **path);
+++
++ grub_err_t
++ grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
++ int mask);
++@@ -489,6 +557,10 @@ void
++ grub_net_process_dhcp (struct grub_net_buff *nb,
++ struct grub_net_network_level_interface *iface);
++
+++grub_err_t
+++grub_net_process_dhcp6 (struct grub_net_buff *nb,
+++ struct grub_net_card *card);
+++
++ int
++ grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a,
++ const grub_net_link_level_address_t *b);
--- /dev/null
--- /dev/null
++From b6eb3aa0d1254126ef869f785278de9eae73dec8 Mon Sep 17 00:00:00 2001
++From: Michael Chang <mchang@suse.com>
++Date: Thu, 27 Oct 2016 17:42:19 -0400
++Subject: bootp: Add processing DHCPACK packet from HTTP Boot
++
++The vendor class identifier with the string "HTTPClient" is used to denote the
++packet as responding to HTTP boot request. In DHCP4 config, the filename for
++HTTP boot is the URL of the boot file while for PXE boot it is the path to the
++boot file. As a consequence, the next-server becomes obseleted because the HTTP
++URL already contains the server address for the boot file. For DHCP6 config,
++there's no difference definition in existing config as dhcp6.bootfile-url can
++be used to specify URL for both HTTP and PXE boot file.
++
++This patch adds processing for "HTTPClient" vendor class identifier in DHCPACK
++packet by treating it as HTTP format, not as the PXE format.
++
++Signed-off-by: Michael Chang <mchang@suse.com>
++Signed-off-by: Ken Lin <ken.lin@hpe.com>
++
++Patch-Name: bootp-process-dhcpack-http-boot.patch
++---
++ grub-core/net/bootp.c | 60 ++++++++++++++++++++++++++++++++++++++++++-
++ include/grub/net.h | 1 +
++ 2 files changed, 60 insertions(+), 1 deletion(-)
++
++diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
++index 21c1824ef..558d97ba1 100644
++--- a/grub-core/net/bootp.c
+++++ b/grub-core/net/bootp.c
++@@ -154,7 +154,7 @@ struct grub_dhcp_request_options
++ {
++ grub_uint8_t type;
++ grub_uint8_t len;
++- grub_uint8_t data[7];
+++ grub_uint8_t data[8];
++ } GRUB_PACKED parameter_request;
++ grub_uint8_t end;
++ } GRUB_PACKED;
++@@ -498,6 +498,63 @@ grub_net_configure_by_dhcp_ack (const char *name,
++ if (opt && opt_len)
++ grub_env_set_net_property (name, "extensionspath", (const char *) opt, opt_len);
++
+++ opt = find_dhcp_option (bp, size, GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER,
+++ &opt_len);
+++ if (opt && opt_len)
+++ {
+++ grub_env_set_net_property (name, "vendor_class_identifier",
+++ (const char *) opt, opt_len);
+++ if (opt_len == sizeof ("HTTPClient") - 1 &&
+++ grub_memcmp (opt, "HTTPClient", sizeof ("HTTPClient") - 1) == 0)
+++ {
+++ char *proto, *ip, *pa;
+++
+++ if (!dissect_url (bp->boot_file, &proto, &ip, &pa))
+++ return inter;
+++
+++ grub_env_set_net_property (name, "boot_file", pa, grub_strlen (pa));
+++ if (is_def)
+++ {
+++ grub_net_default_server = grub_strdup (ip);
+++ grub_env_set ("net_default_interface", name);
+++ grub_env_export ("net_default_interface");
+++ }
+++ if (device && !*device)
+++ {
+++ *device = grub_xasprintf ("%s,%s", proto, ip);
+++ grub_print_error ();
+++ }
+++ if (path)
+++ {
+++ *path = grub_strdup (pa);
+++ grub_print_error ();
+++ if (*path)
+++ {
+++ char *slash;
+++ slash = grub_strrchr (*path, '/');
+++ if (slash)
+++ *slash = 0;
+++ else
+++ **path = 0;
+++ }
+++ }
+++ grub_net_add_ipv4_local (inter, mask);
+++ inter->dhcp_ack = grub_malloc (size);
+++ if (inter->dhcp_ack)
+++ {
+++ grub_memcpy (inter->dhcp_ack, bp, size);
+++ inter->dhcp_acklen = size;
+++ }
+++ else
+++ grub_errno = GRUB_ERR_NONE;
+++
+++ grub_free (proto);
+++ grub_free (ip);
+++ grub_free (pa);
+++ return inter;
+++ }
+++ }
+++
++ inter->dhcp_ack = grub_malloc (size);
++ if (inter->dhcp_ack)
++ {
++@@ -572,6 +629,7 @@ send_dhcp_packet (struct grub_net_network_level_interface *iface)
++ GRUB_NET_BOOTP_HOSTNAME,
++ GRUB_NET_BOOTP_ROOT_PATH,
++ GRUB_NET_BOOTP_EXTENSIONS_PATH,
+++ GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER,
++ },
++ },
++ GRUB_NET_BOOTP_END,
++diff --git a/include/grub/net.h b/include/grub/net.h
++index 58cff96d2..b5f9e617e 100644
++--- a/include/grub/net.h
+++++ b/include/grub/net.h
++@@ -523,6 +523,7 @@ enum
++ GRUB_NET_BOOTP_DOMAIN = 0x0f,
++ GRUB_NET_BOOTP_ROOT_PATH = 0x11,
++ GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12,
+++ GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER = 0x3C,
++ GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
++ GRUB_NET_DHCP_OVERLOAD = 52,
++ GRUB_NET_DHCP_MESSAGE_TYPE = 53,
--- /dev/null
--- /dev/null
++From c29a317056977f82b5255efddc7d8d846e6a1698 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:51 +0000
++Subject: Write marker if core.img was written to filesystem
++
++The Debian bug reporting script includes a warning in this case.
++
++Patch-Name: core-in-fs.patch
++---
++ util/setup.c | 8 ++++++++
++ 1 file changed, 8 insertions(+)
++
++diff --git a/util/setup.c b/util/setup.c
++index 6f88f3cc4..fbdf2fcc5 100644
++--- a/util/setup.c
+++++ b/util/setup.c
++@@ -58,6 +58,8 @@
++
++ #include <errno.h>
++
+++#define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem"
+++
++ /* On SPARC this program fills in various fields inside of the 'boot' and 'core'
++ * image files.
++ *
++@@ -666,6 +668,8 @@ SETUP (const char *dir,
++ #endif
++ grub_free (sectors);
++
+++ unlink (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS);
+++
++ goto finish;
++ }
++
++@@ -707,6 +711,10 @@ unable_to_embed:
++ /* The core image must be put on a filesystem unfortunately. */
++ grub_util_info ("will leave the core image on the filesystem");
++
+++ fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS,
+++ GRUB_UTIL_FD_O_WRONLY);
+++ grub_util_fd_close (fp);
+++
++ grub_util_biosdisk_flush (root_dev->disk);
++
++ /* Clean out the blocklists. */
--- /dev/null
--- /dev/null
++From c12382af9e3660748f150283f6ff1e1ca580619f Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:10 +0000
++Subject: Read /etc/default/grub.d/*.cfg after /etc/default/grub
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/901600
++Forwarded: no
++Last-Update: 2014-01-28
++
++Patch-Name: default-grub-d.patch
++---
++ grub-core/osdep/unix/config.c | 114 +++++++++++++++++++++++++++-------
++ util/grub-mkconfig.in | 5 ++
++ 2 files changed, 98 insertions(+), 21 deletions(-)
++
++diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c
++index 65effa9f3..5478030fd 100644
++--- a/grub-core/osdep/unix/config.c
+++++ b/grub-core/osdep/unix/config.c
++@@ -24,6 +24,8 @@
++ #include <grub/emu/config.h>
++ #include <grub/util/install.h>
++ #include <grub/util/misc.h>
+++#include <grub/list.h>
+++#include <assert.h>
++ #include <string.h>
++ #include <sys/types.h>
++ #include <sys/wait.h>
++@@ -61,13 +63,27 @@ grub_util_get_localedir (void)
++ return LOCALEDIR;
++ }
++
+++struct cfglist
+++{
+++ struct cfglist *next;
+++ struct cfglist *prev;
+++ char *path;
+++};
+++
++ void
++ grub_util_load_config (struct grub_util_config *cfg)
++ {
++ pid_t pid;
++ const char *argv[4];
++- char *script, *ptr;
+++ char *script = NULL, *ptr;
++ const char *cfgfile, *iptr;
+++ char *cfgdir;
+++ grub_util_fd_dir_t d;
+++ struct cfglist *cfgpaths = NULL, *cfgpath, *next_cfgpath;
+++ int num_cfgpaths = 0;
+++ size_t len_cfgpaths = 0;
+++ char **sorted_cfgpaths = NULL;
+++ int i;
++ FILE *f = NULL;
++ int fd;
++ const char *v;
++@@ -83,29 +99,75 @@ grub_util_load_config (struct grub_util_config *cfg)
++ cfg->grub_distributor = xstrdup (v);
++
++ cfgfile = grub_util_get_config_filename ();
++- if (!grub_util_is_regular (cfgfile))
++- return;
+++ if (grub_util_is_regular (cfgfile))
+++ {
+++ ++num_cfgpaths;
+++ len_cfgpaths += strlen (cfgfile) * 4 + sizeof (". ''; ") - 1;
+++ }
+++
+++ cfgdir = xasprintf ("%s.d", cfgfile);
+++ d = grub_util_fd_opendir (cfgdir);
+++ if (d)
+++ {
+++ grub_util_fd_dirent_t de;
+++
+++ while ((de = grub_util_fd_readdir (d)))
+++ {
+++ const char *ext = strrchr (de->d_name, '.');
+++
+++ if (!ext || strcmp (ext, ".cfg") != 0)
+++ continue;
+++
+++ cfgpath = xmalloc (sizeof (*cfgpath));
+++ cfgpath->path = grub_util_path_concat (2, cfgdir, de->d_name);
+++ grub_list_push (GRUB_AS_LIST_P (&cfgpaths), GRUB_AS_LIST (cfgpath));
+++ ++num_cfgpaths;
+++ len_cfgpaths += strlen (cfgpath->path) * 4 + sizeof (". ''; ") - 1;
+++ }
+++ grub_util_fd_closedir (d);
+++ }
+++
+++ if (num_cfgpaths == 0)
+++ goto out;
+++
+++ sorted_cfgpaths = xmalloc (num_cfgpaths * sizeof (*sorted_cfgpaths));
+++ i = 0;
+++ if (grub_util_is_regular (cfgfile))
+++ sorted_cfgpaths[i++] = xstrdup (cfgfile);
+++ FOR_LIST_ELEMENTS_SAFE (cfgpath, next_cfgpath, cfgpaths)
+++ {
+++ sorted_cfgpaths[i++] = cfgpath->path;
+++ free (cfgpath);
+++ }
+++ assert (i == num_cfgpaths);
+++ qsort (sorted_cfgpaths + 1, num_cfgpaths - 1, sizeof (*sorted_cfgpaths),
+++ (int (*) (const void *, const void *)) strcmp);
++
++ argv[0] = "sh";
++ argv[1] = "-c";
++
++- script = xmalloc (4 * strlen (cfgfile) + 300);
+++ script = xmalloc (len_cfgpaths + 300);
++
++ ptr = script;
++- memcpy (ptr, ". '", 3);
++- ptr += 3;
++- for (iptr = cfgfile; *iptr; iptr++)
+++ for (i = 0; i < num_cfgpaths; i++)
++ {
++- if (*iptr == '\\')
+++ memcpy (ptr, ". '", 3);
+++ ptr += 3;
+++ for (iptr = sorted_cfgpaths[i]; *iptr; iptr++)
++ {
++- memcpy (ptr, "'\\''", 4);
++- ptr += 4;
++- continue;
+++ if (*iptr == '\\')
+++ {
+++ memcpy (ptr, "'\\''", 4);
+++ ptr += 4;
+++ continue;
+++ }
+++ *ptr++ = *iptr;
++ }
++- *ptr++ = *iptr;
+++ memcpy (ptr, "'; ", 3);
+++ ptr += 3;
++ }
++
++- strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
+++ strcpy (ptr, "printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
++ "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"");
++
++ argv[2] = script;
++@@ -125,15 +187,25 @@ grub_util_load_config (struct grub_util_config *cfg)
++ waitpid (pid, NULL, 0);
++ }
++ if (f)
++- return;
+++ goto out;
++
++- f = grub_util_fopen (cfgfile, "r");
++- if (f)
+++ for (i = 0; i < num_cfgpaths; i++)
++ {
++- grub_util_parse_config (f, cfg, 0);
++- fclose (f);
+++ f = grub_util_fopen (sorted_cfgpaths[i], "r");
+++ if (f)
+++ {
+++ grub_util_parse_config (f, cfg, 0);
+++ fclose (f);
+++ }
+++ else
+++ grub_util_warn (_("cannot open configuration file `%s': %s"),
+++ cfgfile, strerror (errno));
++ }
++- else
++- grub_util_warn (_("cannot open configuration file `%s': %s"),
++- cfgfile, strerror (errno));
+++
+++out:
+++ free (script);
+++ for (i = 0; i < num_cfgpaths; i++)
+++ free (sorted_cfgpaths[i]);
+++ free (sorted_cfgpaths);
+++ free (cfgdir);
++ }
++diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
++index 12a1a5f72..90ec26d65 100644
++--- a/util/grub-mkconfig.in
+++++ b/util/grub-mkconfig.in
++@@ -164,6 +164,11 @@ fi
++ if test -f ${sysconfdir}/default/grub ; then
++ . ${sysconfdir}/default/grub
++ fi
+++for x in ${sysconfdir}/default/grub.d/*.cfg ; do
+++ if [ -e "${x}" ]; then
+++ . "${x}"
+++ fi
+++done
++
++ # XXX: should this be deprecated at some point?
++ if [ "x${GRUB_TERMINAL}" != "x" ] ; then
--- /dev/null
--- /dev/null
++From 069e6593fc700d24abc9735d3e7b2888d5143aea Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:54 +0000
++Subject: Disable use of floppy devices
++
++An ugly kludge. Should this be merged upstream?
++
++Author: Robert Millan
++
++Patch-Name: disable-floppies.patch
++---
++ grub-core/kern/emu/hostdisk.c | 12 ++++++++++++
++ 1 file changed, 12 insertions(+)
++
++diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c
++index e9ec680cd..8ac523953 100644
++--- a/grub-core/kern/emu/hostdisk.c
+++++ b/grub-core/kern/emu/hostdisk.c
++@@ -532,6 +532,18 @@ read_device_map (const char *dev_map)
++ continue;
++ }
++
+++ if (! strncmp (p, "/dev/fd", sizeof ("/dev/fd") - 1))
+++ {
+++ char *q = p + sizeof ("/dev/fd") - 1;
+++ if (*q >= '0' && *q <= '9')
+++ {
+++ free (map[drive].drive);
+++ map[drive].drive = NULL;
+++ grub_util_info ("`%s' looks like a floppy drive, skipping", p);
+++ continue;
+++ }
+++ }
+++
++ /* On Linux, the devfs uses symbolic links horribly, and that
++ confuses the interface very much, so use realpath to expand
++ symbolic links. */
--- /dev/null
--- /dev/null
++From 130799f3b8647f54590e4c86204073aa88672e54 Mon Sep 17 00:00:00 2001
++From: Robert Millan <rmh@aybabtu.com>
++Date: Mon, 13 Jan 2014 12:12:52 +0000
++Subject: Improve handling of Debian kernel version numbers
++
++Forwarded: not-needed
++Last-Update: 2013-12-20
++
++Patch-Name: dpkg-version-comparison.patch
++---
++ util/grub-mkconfig_lib.in | 7 ++++---
++ 1 file changed, 4 insertions(+), 3 deletions(-)
++
++diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
++index 0f801cab3..b6606c16e 100644
++--- a/util/grub-mkconfig_lib.in
+++++ b/util/grub-mkconfig_lib.in
++@@ -239,8 +239,9 @@ version_test_numeric ()
++
++ version_test_gt ()
++ {
++- version_test_gt_a="`echo "$1" | sed -e "s/[^-]*-//"`"
++- version_test_gt_b="`echo "$2" | sed -e "s/[^-]*-//"`"
+++ version_test_gt_sedexp="s/[^-]*-//;s/[._-]\(pre\|rc\|test\|git\|old\|trunk\)/~\1/g"
+++ version_test_gt_a="`echo "$1" | sed -e "$version_test_gt_sedexp"`"
+++ version_test_gt_b="`echo "$2" | sed -e "$version_test_gt_sedexp"`"
++ version_test_gt_cmp=gt
++ if [ "x$version_test_gt_b" = "x" ] ; then
++ return 0
++@@ -250,7 +251,7 @@ version_test_gt ()
++ *.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"
+++ dpkg --compare-versions "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b"
++ return "$?"
++ }
++
--- /dev/null
- From 3ddfe605a6a472100f529c3d7465bf4eb7fe954d Mon Sep 17 00:00:00 2001
++From 3b968756ecc7c4d97d63d65e3fe258a3df9652a0 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Mon, 11 Mar 2019 11:17:43 +0000
+Subject: Minimise writes to EFI variable storage
+
+Some UEFI firmware is easily provoked into running out of space in its
+variable storage. This is usually due to certain kernel drivers (e.g.
+pstore), but regardless of the cause it can cause grub-install to fail
+because it currently asks efibootmgr to delete and re-add entries, and
+the deletion often doesn't result in an immediate garbage collection.
+Writing variables frequently also increases wear on the NVRAM which may
+have limited write cycles. For these reasons, it's desirable to find a
+way to minimise writes while still allowing grub-install to ensure that
+a suitable boot entry exists.
+
+Unfortunately, efibootmgr doesn't offer an interface that would let
+grub-install do this. It doesn't in general make very much effort to
+minimise writes; it doesn't allow modifying an existing Boot* variable
+entry, except in certain limited ways; and current versions don't have a
+way to export the expected variable data so that grub-install can
+compare it to the current data. While it would be possible (and perhaps
+desirable?) to add at least some of this to efibootmgr, that would still
+leave the problem that there isn't a good upstreamable way for
+grub-install to guarantee that it has a new enough version of
+efibootmgr. In any case, it's cumbersome and slow for grub-install to
+have to fork efibootmgr to get things done.
+
+Fortunately, a few years ago Peter Jones helpfully factored out a
+substantial part of efibootmgr to the efivar and efiboot libraries, and
+so it's now possible to have grub-install use those directly. We still
+have to use some code from efibootmgr, but much less than would
+previously have been necessary.
+
+grub-install now reuses existing boot entries where possible, and avoids
+writing to variables when the new contents are the same as the old
+contents. In the common upgrade case where nothing needs to change, it
+no longer writes to NVRAM at all. It's also now slightly faster, since
+using libefivar is faster than forking efibootmgr.
+
+Fixes Debian bug #891434.
+
+Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
+
+Bug-Debian: https://bugs.debian.org/891434
+Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-03/msg00119.html
+Last-Update: 2019-03-23
+
+Patch-Name: efi-variable-storage-minimise-writes.patch
+---
+ INSTALL | 5 +
+ Makefile.util.def | 20 ++
+ configure.ac | 12 +
+ grub-core/osdep/efivar.c | 3 +
+ grub-core/osdep/unix/efivar.c | 508 ++++++++++++++++++++++++++++++++
+ grub-core/osdep/unix/platform.c | 100 +------
+ include/grub/util/install.h | 5 +
+ util/grub-install.c | 4 +-
+ 8 files changed, 562 insertions(+), 95 deletions(-)
+ create mode 100644 grub-core/osdep/efivar.c
+ create mode 100644 grub-core/osdep/unix/efivar.c
+
+diff --git a/INSTALL b/INSTALL
- index b370d7753..5862e458a 100644
++index 8acb40902..342c158e9 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -41,6 +41,11 @@ configuring the GRUB.
+ * Other standard GNU/Unix tools
+ * a libc with large file support (e.g. glibc 2.1 or later)
+
++On Unix-based systems, you also need:
++
++* libefivar (recommended)
++* libefiboot (recommended; your OS may ship this together with libefivar)
++
+ On GNU/Linux, you also need:
+
+ * libdevmapper 1.02.34 or later (recommended)
+diff --git a/Makefile.util.def b/Makefile.util.def
- index fa39d8bd1..58f8284cb 100644
++index 8a24b23f0..59e41423b 100644
+--- a/Makefile.util.def
++++ b/Makefile.util.def
- @@ -548,6 +548,8 @@ program = {
++@@ -558,6 +558,8 @@ program = {
+ common = grub-core/osdep/compress.c;
+ extra_dist = grub-core/osdep/unix/compress.c;
+ extra_dist = grub-core/osdep/basic/compress.c;
++ common = grub-core/osdep/efivar.c;
++ extra_dist = grub-core/osdep/unix/efivar.c;
+ common = util/editenv.c;
+ common = grub-core/osdep/blocklist.c;
+ common = grub-core/osdep/config.c;
- @@ -561,12 +563,15 @@ program = {
++@@ -571,12 +573,15 @@ program = {
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+
++ cflags = '$(EFIVAR_CFLAGS)';
++
+ ldadd = '$(LIBLZMA)';
+ ldadd = libgrubmods.a;
+ ldadd = libgrubgcry.a;
+ ldadd = libgrubkern.a;
- ldadd = grub-core/gnulib/libgnu.a;
++ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
++ ldadd = '$(EFIVAR_LIBS)';
+
+ condition = COND_HAVE_EXEC;
+ };
- @@ -595,6 +600,8 @@ program = {
++@@ -605,6 +610,8 @@ program = {
+ extra_dist = grub-core/osdep/basic/no_platform.c;
+ extra_dist = grub-core/osdep/unix/platform.c;
+ common = grub-core/osdep/compress.c;
++ common = grub-core/osdep/efivar.c;
++ extra_dist = grub-core/osdep/unix/efivar.c;
+ common = util/editenv.c;
+ common = grub-core/osdep/blocklist.c;
+ common = grub-core/osdep/config.c;
- @@ -608,12 +615,15 @@ program = {
++@@ -618,12 +625,15 @@ program = {
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+
++ cflags = '$(EFIVAR_CFLAGS)';
++
+ ldadd = '$(LIBLZMA)';
+ ldadd = libgrubmods.a;
+ ldadd = libgrubgcry.a;
+ ldadd = libgrubkern.a;
- ldadd = grub-core/gnulib/libgnu.a;
++ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
++ ldadd = '$(EFIVAR_LIBS)';
+ };
+
+ program = {
- @@ -635,6 +645,8 @@ program = {
++@@ -645,6 +655,8 @@ program = {
+ common = grub-core/osdep/platform.c;
+ common = grub-core/osdep/platform_unix.c;
+ common = grub-core/osdep/compress.c;
++ common = grub-core/osdep/efivar.c;
++ extra_dist = grub-core/osdep/unix/efivar.c;
+ common = util/editenv.c;
+ common = grub-core/osdep/blocklist.c;
+ common = grub-core/osdep/config.c;
- @@ -647,12 +659,15 @@ program = {
++@@ -657,12 +669,15 @@ program = {
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+
++ cflags = '$(EFIVAR_CFLAGS)';
++
+ ldadd = '$(LIBLZMA)';
+ ldadd = libgrubmods.a;
+ ldadd = libgrubgcry.a;
+ ldadd = libgrubkern.a;
- ldadd = grub-core/gnulib/libgnu.a;
++ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
++ ldadd = '$(EFIVAR_LIBS)';
+ };
+
+ program = {
- @@ -674,6 +689,8 @@ program = {
++@@ -684,6 +699,8 @@ program = {
+ common = grub-core/osdep/platform.c;
+ common = grub-core/osdep/platform_unix.c;
+ common = grub-core/osdep/compress.c;
++ common = grub-core/osdep/efivar.c;
++ extra_dist = grub-core/osdep/unix/efivar.c;
+ common = util/editenv.c;
+ common = grub-core/osdep/blocklist.c;
+ common = grub-core/osdep/config.c;
- @@ -683,12 +700,15 @@ program = {
++@@ -693,12 +710,15 @@ program = {
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+
++ cflags = '$(EFIVAR_CFLAGS)';
++
+ ldadd = '$(LIBLZMA)';
+ ldadd = libgrubmods.a;
+ ldadd = libgrubgcry.a;
+ ldadd = libgrubkern.a;
- ldadd = grub-core/gnulib/libgnu.a;
++ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
++ ldadd = '$(EFIVAR_LIBS)';
+ };
+
+ script = {
+diff --git a/configure.ac b/configure.ac
- index 5b7423be3..3b97f2ba1 100644
++index e3dca49fa..800c51ee1 100644
+--- a/configure.ac
++++ b/configure.ac
- @@ -426,6 +426,18 @@ AC_CHECK_HEADER([util.h], [
++@@ -443,6 +443,18 @@ AC_CHECK_HEADER([util.h], [
+ ])
+ AC_SUBST([LIBUTIL])
+
++case "$host_os" in
++ cygwin | windows* | mingw32* | aros*)
++ ;;
++ *)
++ # For setting EFI variables in grub-install.
++ PKG_CHECK_MODULES([EFIVAR], [efivar efiboot], [
++ AC_DEFINE([HAVE_EFIVAR], [1],
++ [Define to 1 if you have the efivar and efiboot libraries.])
++ ], [:])
++ ;;
++esac
++
+ AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror"
+diff --git a/grub-core/osdep/efivar.c b/grub-core/osdep/efivar.c
+new file mode 100644
+index 000000000..d2750e252
+--- /dev/null
++++ b/grub-core/osdep/efivar.c
+@@ -0,0 +1,3 @@
++#if !defined (__MINGW32__) && !defined (__CYGWIN__) && !defined (__AROS__)
++#include "unix/efivar.c"
++#endif
+diff --git a/grub-core/osdep/unix/efivar.c b/grub-core/osdep/unix/efivar.c
+new file mode 100644
+index 000000000..4a58328b4
+--- /dev/null
++++ b/grub-core/osdep/unix/efivar.c
+@@ -0,0 +1,508 @@
++/*
++ * GRUB -- GRand Unified Bootloader
++ * Copyright (C) 2013,2019 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 <http://www.gnu.org/licenses/>.
++ */
++
++/* Contains portions derived from efibootmgr, licensed as follows:
++ *
++ * Copyright (C) 2001-2004 Dell, Inc. <Matt_Domsch@dell.com>
++ * Copyright 2015-2016 Red Hat, Inc. <pjones@redhat.com>
++ *
++ * 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 2 of the License, or
++ * (at your option) any later version.
++ */
++
++#include <config.h>
++
++#ifdef HAVE_EFIVAR
++
++#include <grub/util/install.h>
++#include <grub/emu/hostdisk.h>
++#include <grub/util/misc.h>
++#include <grub/list.h>
++#include <grub/misc.h>
++#include <grub/emu/exec.h>
++#include <sys/types.h>
++#include <ctype.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include <efiboot.h>
++#include <efivar.h>
++
++struct efi_variable {
++ struct efi_variable *next;
++ struct efi_variable **prev;
++ char *name;
++ efi_guid_t guid;
++ uint8_t *data;
++ size_t data_size;
++ uint32_t attributes;
++ int num;
++};
++
++/* Boot option attributes. */
++#define LOAD_OPTION_ACTIVE 0x00000001
++
++/* GUIDs. */
++#define BLKX_UNKNOWN_GUID \
++ EFI_GUID (0x47c7b225, 0xc42a, 0x11d2, 0x8e57, 0x00, 0xa0, 0xc9, 0x69, \
++ 0x72, 0x3b)
++
++/* Log all errors recorded by libefivar/libefiboot. */
++static void
++show_efi_errors (void)
++{
++ int i;
++ int saved_errno = errno;
++
++ for (i = 0; ; ++i)
++ {
++ char *filename, *function, *message = NULL;
++ int line, error = 0, rc;
++
++ rc = efi_error_get (i, &filename, &function, &line, &message, &error);
++ if (rc < 0)
++ /* Give up. The caller is going to log an error anyway. */
++ break;
++ if (rc == 0)
++ /* No more errors. */
++ break;
++ grub_util_warn ("%s: %s: %s", function, message, strerror (error));
++ }
++
++ efi_error_clear ();
++ errno = saved_errno;
++}
++
++static struct efi_variable *
++new_efi_variable (void)
++{
++ struct efi_variable *new = xmalloc (sizeof (*new));
++ memset (new, 0, sizeof (*new));
++ return new;
++}
++
++static struct efi_variable *
++new_boot_variable (void)
++{
++ struct efi_variable *new = new_efi_variable ();
++ new->guid = EFI_GLOBAL_GUID;
++ new->attributes = EFI_VARIABLE_NON_VOLATILE |
++ EFI_VARIABLE_BOOTSERVICE_ACCESS |
++ EFI_VARIABLE_RUNTIME_ACCESS;
++ return new;
++}
++
++static void
++free_efi_variable (struct efi_variable *entry)
++{
++ if (entry)
++ {
++ free (entry->name);
++ free (entry->data);
++ free (entry);
++ }
++}
++
++static int
++read_efi_variable (const char *name, struct efi_variable **entry)
++{
++ struct efi_variable *new = new_efi_variable ();
++ int rc;
++
++ rc = efi_get_variable (EFI_GLOBAL_GUID, name,
++ &new->data, &new->data_size, &new->attributes);
++ if (rc < 0)
++ {
++ free_efi_variable (new);
++ new = NULL;
++ }
++
++ if (new)
++ {
++ /* Latest Apple firmware sets the high bit which appears invalid
++ to the Linux kernel if we write it back, so let's zero it out if it
++ is set since it would be invalid to set it anyway. */
++ new->attributes = new->attributes & ~(1 << 31);
++
++ new->name = xstrdup (name);
++ new->guid = EFI_GLOBAL_GUID;
++ }
++
++ *entry = new;
++ return rc;
++}
++
++/* Set an EFI variable, but only if it differs from the current value.
++ Some firmware implementations are liable to fill up flash space if we set
++ variables unnecessarily, so try to keep write activity to a minimum. */
++static int
++set_efi_variable (const char *name, struct efi_variable *entry)
++{
++ struct efi_variable *old = NULL;
++ int rc = 0;
++
++ read_efi_variable (name, &old);
++ efi_error_clear ();
++ if (old && old->attributes == entry->attributes &&
++ old->data_size == entry->data_size &&
++ memcmp (old->data, entry->data, entry->data_size) == 0)
++ grub_util_info ("skipping unnecessary update of EFI variable %s", name);
++ else
++ {
++ rc = efi_set_variable (EFI_GLOBAL_GUID, name,
++ entry->data, entry->data_size, entry->attributes,
++ 0644);
++ if (rc < 0)
++ grub_util_warn (_("Cannot set EFI variable %s"), name);
++ }
++ free_efi_variable (old);
++ return rc;
++}
++
++static int
++cmpvarbyname (const void *p1, const void *p2)
++{
++ const struct efi_variable *var1 = *(const struct efi_variable **)p1;
++ const struct efi_variable *var2 = *(const struct efi_variable **)p2;
++ return strcmp (var1->name, var2->name);
++}
++
++static int
++read_boot_variables (struct efi_variable **varlist)
++{
++ int rc;
++ efi_guid_t *guid = NULL;
++ char *name = NULL;
++ struct efi_variable **newlist = NULL;
++ int nentries = 0;
++ int i;
++
++ while ((rc = efi_get_next_variable_name (&guid, &name)) > 0)
++ {
++ const char *snum = name + sizeof ("Boot") - 1;
++ struct efi_variable *var = NULL;
++ unsigned int num;
++
++ if (memcmp (guid, &efi_guid_global, sizeof (efi_guid_global)) != 0 ||
++ strncmp (name, "Boot", sizeof ("Boot") - 1) != 0 ||
++ !grub_isxdigit (snum[0]) || !grub_isxdigit (snum[1]) ||
++ !grub_isxdigit (snum[2]) || !grub_isxdigit (snum[3]))
++ continue;
++
++ rc = read_efi_variable (name, &var);
++ if (rc < 0)
++ break;
++
++ if (sscanf (var->name, "Boot%04X-%*s", &num) == 1 && num < 65536)
++ var->num = num;
++
++ newlist = xrealloc (newlist, (++nentries) * sizeof (*newlist));
++ newlist[nentries - 1] = var;
++ }
++ if (rc == 0 && newlist)
++ {
++ qsort (newlist, nentries, sizeof (*newlist), cmpvarbyname);
++ for (i = nentries - 1; i >= 0; --i)
++ grub_list_push (GRUB_AS_LIST_P (varlist), GRUB_AS_LIST (newlist[i]));
++ }
++ else if (newlist)
++ {
++ for (i = 0; i < nentries; ++i)
++ free_efi_variable (newlist[i]);
++ free (newlist);
++ }
++ return rc;
++}
++
++#define GET_ORDER(data, i) \
++ ((uint16_t) ((data)[(i) * 2]) + ((data)[(i) * 2 + 1] << 8))
++#define SET_ORDER(data, i, num) \
++ do { \
++ (data)[(i) * 2] = (num) & 0xFF; \
++ (data)[(i) * 2 + 1] = ((num) >> 8) & 0xFF; \
++ } while (0)
++
++static void
++remove_from_boot_order (struct efi_variable *order, uint16_t num)
++{
++ unsigned int old_i, new_i;
++
++ /* We've got an array (in order->data) of the order. Squeeze out any
++ instance of the entry we're deleting by shifting the remainder down. */
++ for (old_i = 0, new_i = 0;
++ old_i < order->data_size / sizeof (uint16_t);
++ ++old_i)
++ {
++ uint16_t old_num = GET_ORDER (order->data, old_i);
++ if (old_num != num)
++ {
++ if (new_i != old_i)
++ SET_ORDER (order->data, new_i, old_num);
++ ++new_i;
++ }
++ }
++
++ order->data_size = new_i * sizeof (uint16_t);
++}
++
++static void
++add_to_boot_order (struct efi_variable *order, uint16_t num)
++{
++ int i;
++ size_t new_data_size;
++ uint8_t *new_data;
++
++ /* Check whether this entry is already in the boot order. If it is, leave
++ it alone. */
++ for (i = 0; i < order->data_size / sizeof (uint16_t); ++i)
++ if (GET_ORDER (order->data, i) == num)
++ return;
++
++ new_data_size = order->data_size + sizeof (uint16_t);
++ new_data = xmalloc (new_data_size);
++ SET_ORDER (new_data, 0, num);
++ memcpy (new_data + sizeof (uint16_t), order->data, order->data_size);
++ free (order->data);
++ order->data = new_data;
++ order->data_size = new_data_size;
++}
++
++static int
++find_free_boot_num (struct efi_variable *entries)
++{
++ int num_vars = 0, i;
++ struct efi_variable *entry;
++
++ FOR_LIST_ELEMENTS (entry, entries)
++ ++num_vars;
++
++ if (num_vars == 0)
++ return 0;
++
++ /* O(n^2), but n is small and this is easy. */
++ for (i = 0; i < num_vars; ++i)
++ {
++ int found = 0;
++ FOR_LIST_ELEMENTS (entry, entries)
++ {
++ if (entry->num == i)
++ {
++ found = 1;
++ break;
++ }
++ }
++ if (!found)
++ return i;
++ }
++
++ return i;
++}
++
++static int
++get_edd_version (void)
++{
++ efi_guid_t blkx_guid = BLKX_UNKNOWN_GUID;
++ uint8_t *data = NULL;
++ size_t data_size = 0;
++ uint32_t attributes;
++ efidp_header *path;
++ int rc;
++
++ rc = efi_get_variable (blkx_guid, "blk0", &data, &data_size, &attributes);
++ if (rc < 0)
++ return rc;
++
++ path = (efidp_header *) data;
++ if (path->type == 2 && path->subtype == 1)
++ return 3;
++ return 1;
++}
++
++static struct efi_variable *
++make_boot_variable (int num, const char *disk, int part, const char *loader,
++ const char *label)
++{
++ struct efi_variable *entry = new_boot_variable ();
++ uint32_t options;
++ uint32_t edd10_devicenum;
++ ssize_t dp_needed, loadopt_needed;
++ efidp dp = NULL;
++
++ options = EFIBOOT_ABBREV_HD;
++ switch (get_edd_version ()) {
++ case 1:
++ options = EFIBOOT_ABBREV_EDD10;
++ break;
++ case 3:
++ options = EFIBOOT_ABBREV_NONE;
++ break;
++ }
++
++ /* This may not be the right disk; but it's probably only an issue on very
++ old hardware anyway. */
++ edd10_devicenum = 0x80;
++
++ dp_needed = efi_generate_file_device_path_from_esp (NULL, 0, disk, part,
++ loader, options,
++ edd10_devicenum);
++ if (dp_needed < 0)
++ goto err;
++
++ dp = xmalloc (dp_needed);
++ dp_needed = efi_generate_file_device_path_from_esp ((uint8_t *) dp,
++ dp_needed, disk, part,
++ loader, options,
++ edd10_devicenum);
++ if (dp_needed < 0)
++ goto err;
++
++ loadopt_needed = efi_loadopt_create (NULL, 0, LOAD_OPTION_ACTIVE,
++ dp, dp_needed, (unsigned char *) label,
++ NULL, 0);
++ if (loadopt_needed < 0)
++ goto err;
++ entry->data_size = loadopt_needed;
++ entry->data = xmalloc (entry->data_size);
++ loadopt_needed = efi_loadopt_create (entry->data, entry->data_size,
++ LOAD_OPTION_ACTIVE, dp, dp_needed,
++ (unsigned char *) label, NULL, 0);
++ if (loadopt_needed < 0)
++ goto err;
++
++ entry->name = xasprintf ("Boot%04X", num);
++ entry->num = num;
++
++ return entry;
++
++err:
++ free_efi_variable (entry);
++ free (dp);
++ return NULL;
++}
++
++int
++grub_install_efivar_register_efi (grub_device_t efidir_grub_dev,
++ const char *efifile_path,
++ const char *efi_distributor)
++{
++ const char *efidir_disk;
++ int efidir_part;
++ struct efi_variable *entries = NULL, *entry;
++ struct efi_variable *order;
++ int entry_num = -1;
++ int rc;
++
++ efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk);
++ efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1;
++
++#ifdef __linux__
++ /*
++ * Linux uses efivarfs (mounted on /sys/firmware/efi/efivars) to access the
++ * EFI variable store. Some legacy systems may still use the deprecated
++ * efivars interface (accessed through /sys/firmware/efi/vars). Where both
++ * are present, libefivar will use the former in preference, so attempting
++ * to load efivars will not interfere with later operations.
++ */
++ grub_util_exec_redirect_all ((const char * []){ "modprobe", "efivars", NULL },
++ NULL, NULL, "/dev/null");
++#endif
++
++ if (!efi_variables_supported ())
++ {
++ grub_util_warn ("%s",
++ _("EFI variables are not supported on this system."));
++ /* Let the user continue. Perhaps they can still arrange to boot GRUB
++ manually. */
++ return 0;
++ }
++
++ rc = read_boot_variables (&entries);
++ if (rc < 0)
++ {
++ grub_util_warn ("%s", _("Cannot read EFI Boot* variables"));
++ goto err;
++ }
++ rc = read_efi_variable ("BootOrder", &order);
++ if (rc < 0)
++ {
++ order = new_boot_variable ();
++ order->name = xstrdup ("BootOrder");
++ efi_error_clear ();
++ }
++
++ /* Delete old entries from the same distributor. */
++ FOR_LIST_ELEMENTS (entry, entries)
++ {
++ efi_load_option *load_option = (efi_load_option *) entry->data;
++ const char *label;
++
++ if (entry->num < 0)
++ continue;
++ label = (const char *) efi_loadopt_desc (load_option, entry->data_size);
++ if (strcasecmp (label, efi_distributor) != 0)
++ continue;
++
++ /* To avoid problems with some firmware implementations, reuse the first
++ matching variable we find rather than deleting and recreating it. */
++ if (entry_num == -1)
++ entry_num = entry->num;
++ else
++ {
++ grub_util_info ("deleting superfluous EFI variable %s (%s)",
++ entry->name, label);
++ rc = efi_del_variable (EFI_GLOBAL_GUID, entry->name);
++ if (rc < 0)
++ {
++ grub_util_warn (_("Cannot delete EFI variable %s"), entry->name);
++ goto err;
++ }
++ }
++
++ remove_from_boot_order (order, (uint16_t) entry->num);
++ }
++
++ if (entry_num == -1)
++ entry_num = find_free_boot_num (entries);
++ entry = make_boot_variable (entry_num, efidir_disk, efidir_part,
++ efifile_path, efi_distributor);
++ if (!entry)
++ goto err;
++
++ grub_util_info ("setting EFI variable %s", entry->name);
++ rc = set_efi_variable (entry->name, entry);
++ if (rc < 0)
++ goto err;
++
++ add_to_boot_order (order, (uint16_t) entry_num);
++
++ grub_util_info ("setting EFI variable BootOrder");
++ rc = set_efi_variable ("BootOrder", order);
++ if (rc < 0)
++ goto err;
++
++ return 0;
++
++err:
++ show_efi_errors ();
++ return errno;
++}
++
++#endif /* HAVE_EFIVAR */
+diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c
- index f9c376c35..b561174ea 100644
++index 9c439326a..b561174ea 100644
+--- a/grub-core/osdep/unix/platform.c
++++ b/grub-core/osdep/unix/platform.c
+@@ -19,15 +19,12 @@
+ #include <config.h>
+
+ #include <grub/util/install.h>
+-#include <grub/emu/hostdisk.h>
+ #include <grub/util/misc.h>
+ #include <grub/misc.h>
+ #include <grub/i18n.h>
+ #include <grub/emu/exec.h>
+ #include <sys/types.h>
+-#include <dirent.h>
+ #include <string.h>
+-#include <errno.h>
+
+ static char *
+ get_ofpathname (const char *dev)
+@@ -78,102 +75,19 @@ get_ofpathname (const char *dev)
+ dev);
+ }
+
+-static int
+-grub_install_remove_efi_entries_by_distributor (const char *efi_distributor)
+-{
+- int fd;
+- pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd);
+- char *line = NULL;
+- size_t len = 0;
- - int error = 0;
++- int rc = 0;
+-
+- if (!pid)
+- {
+- grub_util_warn (_("Unable to open stream from %s: %s"),
+- "efibootmgr", strerror (errno));
+- return errno;
+- }
+-
+- FILE *fp = fdopen (fd, "r");
+- if (!fp)
+- {
+- grub_util_warn (_("Unable to open stream from %s: %s"),
+- "efibootmgr", strerror (errno));
+- return errno;
+- }
+-
+- line = xmalloc (80);
+- len = 80;
+- while (1)
+- {
+- int ret;
+- char *bootnum;
+- ret = getline (&line, &len, fp);
+- if (ret == -1)
+- break;
+- if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0
+- || line[sizeof ("Boot") - 1] < '0'
+- || line[sizeof ("Boot") - 1] > '9')
+- continue;
+- if (!strcasestr (line, efi_distributor))
+- continue;
+- bootnum = line + sizeof ("Boot") - 1;
+- bootnum[4] = '\0';
+- if (!verbosity)
- - error = grub_util_exec ((const char * []){ "efibootmgr", "-q",
++- rc = grub_util_exec ((const char * []){ "efibootmgr", "-q",
+- "-b", bootnum, "-B", NULL });
+- else
- - error = grub_util_exec ((const char * []){ "efibootmgr",
++- rc = grub_util_exec ((const char * []){ "efibootmgr",
+- "-b", bootnum, "-B", NULL });
+- }
+-
+- free (line);
- - return error;
++- return rc;
+-}
+-
+ int
+ grub_install_register_efi (grub_device_t efidir_grub_dev,
+ const char *efifile_path,
+ const char *efi_distributor)
+ {
+- const char * efidir_disk;
+- int efidir_part;
- - int error = 0;
++- int ret;
+- efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk);
+- efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1;
+-
+- if (grub_util_exec_redirect_null ((const char * []){ "efibootmgr", "--version", NULL }))
+- {
+- /* TRANSLATORS: This message is shown when required executable `%s'
+- isn't found. */
+- grub_util_error (_("%s: not found"), "efibootmgr");
+- }
+-
+- /* On Linux, we need the efivars kernel modules. */
+-#ifdef __linux__
+- grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL });
++#ifdef HAVE_EFIVAR
++ return grub_install_efivar_register_efi (efidir_grub_dev, efifile_path,
++ efi_distributor);
++#else
++ grub_util_error ("%s",
++ _("GRUB was not built with efivar support; "
++ "cannot register EFI boot entry"));
+ #endif
+- /* Delete old entries from the same distributor. */
- - error = grub_install_remove_efi_entries_by_distributor (efi_distributor);
- - if (error)
- - return error;
++- ret = grub_install_remove_efi_entries_by_distributor (efi_distributor);
++- if (ret)
++- return ret;
+-
+- char *efidir_part_str = xasprintf ("%d", efidir_part);
+-
+- if (!verbosity)
- - error = grub_util_exec ((const char * []){ "efibootmgr", "-q",
++- ret = grub_util_exec ((const char * []){ "efibootmgr", "-q",
+- "-c", "-d", efidir_disk,
+- "-p", efidir_part_str, "-w",
+- "-L", efi_distributor, "-l",
+- efifile_path, NULL });
+- else
- - error = grub_util_exec ((const char * []){ "efibootmgr",
++- ret = grub_util_exec ((const char * []){ "efibootmgr",
+- "-c", "-d", efidir_disk,
+- "-p", efidir_part_str, "-w",
+- "-L", efi_distributor, "-l",
+- efifile_path, NULL });
+- free (efidir_part_str);
- - return error;
++- return ret;
+ }
+
+ void
+diff --git a/include/grub/util/install.h b/include/grub/util/install.h
- index 5783cc4bc..961a2613b 100644
++index 8aeb5c4f2..a521f1663 100644
+--- a/include/grub/util/install.h
++++ b/include/grub/util/install.h
- @@ -213,6 +213,11 @@ grub_install_get_default_x86_platform (void);
++@@ -219,6 +219,11 @@ grub_install_get_default_x86_platform (void);
+ const char *
+ grub_install_get_default_powerpc_machtype (void);
+
++int
++grub_install_efivar_register_efi (grub_device_t efidir_grub_dev,
++ const char *efifile_path,
++ const char *efi_distributor);
++
+ int
+ grub_install_register_efi (grub_device_t efidir_grub_dev,
+ const char *efifile_path,
+diff --git a/util/grub-install.c b/util/grub-install.c
- index 55491589f..04d8250c9 100644
++index 6462d3c70..d66de7f8e 100644
+--- a/util/grub-install.c
++++ b/util/grub-install.c
- @@ -2031,7 +2031,7 @@ main (int argc, char *argv[])
- "\\System\\Library\\CoreServices",
- efi_distributor);
- if (error)
++@@ -2059,7 +2059,7 @@ main (int argc, char *argv[])
++ "\\System\\Library\\CoreServices",
++ efi_distributor);
++ if (ret)
+- grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
++ grub_util_error (_("failed to register the EFI boot entry: %s"),
- strerror (error));
++ strerror (ret));
+ }
+
- @@ -2143,7 +2143,7 @@ main (int argc, char *argv[])
- error = grub_install_register_efi (efidir_grub_dev,
- efifile_path, efi_distributor);
- if (error)
++@@ -2173,7 +2173,7 @@ main (int argc, char *argv[])
++ ret = grub_install_register_efi (efidir_grub_dev,
++ efifile_path, efi_distributor);
++ if (ret)
+- grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
++ grub_util_error (_("failed to register the EFI boot entry: %s"),
- strerror (error));
++ strerror (ret));
+ }
+ break;
--- /dev/null
--- /dev/null
++From a1e414a1f4aa7bae145b886632b523b2a93fdc0f Mon Sep 17 00:00:00 2001
++From: Michael Chang <mchang@suse.com>
++Date: Thu, 27 Oct 2016 17:43:21 -0400
++Subject: efinet: Setting DNS server from UEFI protocol
++
++In the URI device path node, any name rahter than address can be used for
++looking up the resources so that DNS service become needed to get answer of the
++name's address. Unfortunately the DNS is not defined in any of the device path
++nodes so that we use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL
++to obtain it.
++
++These two protcols are defined the sections of UEFI specification.
++
++ 27.5 EFI IPv4 Configuration II Protocol
++ 27.7 EFI IPv6 Configuration Protocol
++
++include/grub/efi/api.h:
++Add new structure and protocol UUID of EFI_IP4_CONFIG2_PROTOCOL and
++EFI_IP6_CONFIG_PROTOCOL.
++
++grub-core/net/drivers/efi/efinet.c:
++Use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL to obtain the list
++of DNS server address for IPv4 and IPv6 respectively. The address of DNS
++servers is structured into DHCPACK packet and feed into the same DHCP packet
++processing functions to ensure the network interface is setting up the same way
++it used to be.
++
++Signed-off-by: Michael Chang <mchang@suse.com>
++Signed-off-by: Ken Lin <ken.lin@hpe.com>
++
++Patch-Name: efinet-set-dns-from-uefi-proto.patch
++---
++ grub-core/net/drivers/efi/efinet.c | 163 +++++++++++++++++++++++++++++
++ include/grub/efi/api.h | 76 ++++++++++++++
++ 2 files changed, 239 insertions(+)
++
++diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
++index 2d3b00f0e..82a28fb6e 100644
++--- a/grub-core/net/drivers/efi/efinet.c
+++++ b/grub-core/net/drivers/efi/efinet.c
++@@ -30,6 +30,8 @@ GRUB_MOD_LICENSE ("GPLv3+");
++ /* GUID. */
++ static grub_efi_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID;
++ static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID;
+++static grub_efi_guid_t ip4_config_guid = GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID;
+++static grub_efi_guid_t ip6_config_guid = GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID;
++
++ static grub_err_t
++ send_card_buffer (struct grub_net_card *dev,
++@@ -325,6 +327,125 @@ grub_efinet_findcards (void)
++ grub_free (handles);
++ }
++
+++static grub_efi_handle_t
+++grub_efi_locate_device_path (grub_efi_guid_t *protocol, grub_efi_device_path_t *device_path,
+++ grub_efi_device_path_t **r_device_path)
+++{
+++ grub_efi_handle_t handle;
+++ grub_efi_status_t status;
+++
+++ status = efi_call_3 (grub_efi_system_table->boot_services->locate_device_path,
+++ protocol, &device_path, &handle);
+++
+++ if (status != GRUB_EFI_SUCCESS)
+++ return 0;
+++
+++ if (r_device_path)
+++ *r_device_path = device_path;
+++
+++ return handle;
+++}
+++
+++static grub_efi_ipv4_address_t *
+++grub_dns_server_ip4_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns)
+++{
+++ grub_efi_handle_t hnd;
+++ grub_efi_status_t status;
+++ grub_efi_ip4_config2_protocol_t *conf;
+++ grub_efi_ipv4_address_t *addrs;
+++ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv4_address_t);
+++
+++ hnd = grub_efi_locate_device_path (&ip4_config_guid, dp, NULL);
+++
+++ if (!hnd)
+++ return 0;
+++
+++ conf = grub_efi_open_protocol (hnd, &ip4_config_guid,
+++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+++
+++ if (!conf)
+++ return 0;
+++
+++ addrs = grub_malloc (data_size);
+++ if (!addrs)
+++ return 0;
+++
+++ status = efi_call_4 (conf->get_data, conf,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER,
+++ &data_size, addrs);
+++
+++ if (status == GRUB_EFI_BUFFER_TOO_SMALL)
+++ {
+++ grub_free (addrs);
+++ addrs = grub_malloc (data_size);
+++ if (!addrs)
+++ return 0;
+++
+++ status = efi_call_4 (conf->get_data, conf,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER,
+++ &data_size, addrs);
+++ }
+++
+++ if (status != GRUB_EFI_SUCCESS)
+++ {
+++ grub_free (addrs);
+++ return 0;
+++ }
+++
+++ *num_dns = data_size / sizeof (grub_efi_ipv4_address_t);
+++ return addrs;
+++}
+++
+++static grub_efi_ipv6_address_t *
+++grub_dns_server_ip6_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns)
+++{
+++ grub_efi_handle_t hnd;
+++ grub_efi_status_t status;
+++ grub_efi_ip6_config_protocol_t *conf;
+++ grub_efi_ipv6_address_t *addrs;
+++ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv6_address_t);
+++
+++ hnd = grub_efi_locate_device_path (&ip6_config_guid, dp, NULL);
+++
+++ if (!hnd)
+++ return 0;
+++
+++ conf = grub_efi_open_protocol (hnd, &ip6_config_guid,
+++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+++
+++ if (!conf)
+++ return 0;
+++
+++ addrs = grub_malloc (data_size);
+++ if (!addrs)
+++ return 0;
+++
+++ status = efi_call_4 (conf->get_data, conf,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER,
+++ &data_size, addrs);
+++
+++ if (status == GRUB_EFI_BUFFER_TOO_SMALL)
+++ {
+++ grub_free (addrs);
+++ addrs = grub_malloc (data_size);
+++ if (!addrs)
+++ return 0;
+++
+++ status = efi_call_4 (conf->get_data, conf,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER,
+++ &data_size, addrs);
+++ }
+++
+++ if (status != GRUB_EFI_SUCCESS)
+++ {
+++ grub_free (addrs);
+++ return 0;
+++ }
+++
+++ *num_dns = data_size / sizeof (grub_efi_ipv6_address_t);
+++ return addrs;
+++}
+++
++ static struct grub_net_buff *
++ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6)
++ {
++@@ -377,6 +498,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u
++ grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp;
++ struct grub_net_bootp_packet *bp;
++ grub_uint8_t *ptr;
+++ grub_efi_ipv4_address_t *dns;
+++ grub_efi_uintn_t num_dns;
++
++ bp = (struct grub_net_bootp_packet *) nb->tail;
++ err = grub_netbuff_put (nb, sizeof (*bp) + 4);
++@@ -438,6 +561,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u
++ *ptr++ = sizeof ("HTTPClient") - 1;
++ grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1);
++
+++ dns = grub_dns_server_ip4_address (dp, &num_dns);
+++ if (dns)
+++ {
+++ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns;
+++
+++ ptr = nb->tail;
+++ err = grub_netbuff_put (nb, size_dns + 2);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ *ptr++ = GRUB_NET_BOOTP_DNS;
+++ *ptr++ = size_dns;
+++ grub_memcpy (ptr, dns, size_dns);
+++ grub_free (dns);
+++ }
+++
++ ptr = nb->tail;
++ err = grub_netbuff_put (nb, 1);
++ if (err)
++@@ -470,6 +612,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u
++ struct grub_net_dhcp6_option *opt;
++ struct grub_net_dhcp6_option_iana *iana;
++ struct grub_net_dhcp6_option_iaaddr *iaaddr;
+++ grub_efi_ipv6_address_t *dns;
+++ grub_efi_uintn_t num_dns;
++
++ d6p = (struct grub_net_dhcp6_packet *)nb->tail;
++ err = grub_netbuff_put (nb, sizeof(*d6p));
++@@ -533,6 +677,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u
++ opt->len = grub_cpu_to_be16 (uri_len);
++ grub_memcpy (opt->data, uri_dp->uri, uri_len);
++
+++ dns = grub_dns_server_ip6_address (dp, &num_dns);
+++ if (dns)
+++ {
+++ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns;
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*opt) + size_dns);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS);
+++ opt->len = grub_cpu_to_be16 (size_dns);
+++ grub_memcpy (opt->data, dns, size_dns);
+++ grub_free (dns);
+++ }
+++
++ *use_ipv6 = 1;
++ }
++
++diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
++index 664cea37b..75befd10e 100644
++--- a/include/grub/efi/api.h
+++++ b/include/grub/efi/api.h
++@@ -334,6 +334,16 @@
++ { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
++ }
++
+++#define GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID \
+++ { 0x5b446ed1, 0xe30b, 0x4faa, \
+++ { 0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \
+++ }
+++
+++#define GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID \
+++ { 0x937fe521, 0x95ae, 0x4d1a, \
+++ { 0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \
+++ }
+++
++ struct grub_efi_sal_system_table
++ {
++ grub_uint32_t signature;
++@@ -1749,6 +1759,72 @@ struct grub_efi_block_io
++ };
++ typedef struct grub_efi_block_io grub_efi_block_io_t;
++
+++enum grub_efi_ip4_config2_data_type {
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_POLICY,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_GATEWAY,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER,
+++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MAXIMUM
+++};
+++typedef enum grub_efi_ip4_config2_data_type grub_efi_ip4_config2_data_type_t;
+++
+++struct grub_efi_ip4_config2_protocol
+++{
+++ grub_efi_status_t (*set_data) (struct grub_efi_ip4_config2_protocol *this,
+++ grub_efi_ip4_config2_data_type_t data_type,
+++ grub_efi_uintn_t data_size,
+++ void *data);
+++
+++ grub_efi_status_t (*get_data) (struct grub_efi_ip4_config2_protocol *this,
+++ grub_efi_ip4_config2_data_type_t data_type,
+++ grub_efi_uintn_t *data_size,
+++ void *data);
+++
+++ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip4_config2_protocol *this,
+++ grub_efi_ip4_config2_data_type_t data_type,
+++ grub_efi_event_t event);
+++
+++ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip4_config2_protocol *this,
+++ grub_efi_ip4_config2_data_type_t data_type,
+++ grub_efi_event_t event);
+++};
+++typedef struct grub_efi_ip4_config2_protocol grub_efi_ip4_config2_protocol_t;
+++
+++enum grub_efi_ip6_config_data_type {
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_ALT_INTERFACEID,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_POLICY,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DUP_ADDR_DETECT_TRANSMITS,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_GATEWAY,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER,
+++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MAXIMUM
+++};
+++typedef enum grub_efi_ip6_config_data_type grub_efi_ip6_config_data_type_t;
+++
+++struct grub_efi_ip6_config_protocol
+++{
+++ grub_efi_status_t (*set_data) (struct grub_efi_ip6_config_protocol *this,
+++ grub_efi_ip6_config_data_type_t data_type,
+++ grub_efi_uintn_t data_size,
+++ void *data);
+++
+++ grub_efi_status_t (*get_data) (struct grub_efi_ip6_config_protocol *this,
+++ grub_efi_ip6_config_data_type_t data_type,
+++ grub_efi_uintn_t *data_size,
+++ void *data);
+++
+++ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip6_config_protocol *this,
+++ grub_efi_ip6_config_data_type_t data_type,
+++ grub_efi_event_t event);
+++
+++ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip6_config_protocol *this,
+++ grub_efi_ip6_config_data_type_t data_type,
+++ grub_efi_event_t event);
+++};
+++typedef struct grub_efi_ip6_config_protocol grub_efi_ip6_config_protocol_t;
+++
++ #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \
++ || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) \
++ || defined(__riscv)
--- /dev/null
--- /dev/null
++From 41823ba5a2434f3d0805c1c63c980d1ff716dbe0 Mon Sep 17 00:00:00 2001
++From: Michael Chang <mchang@suse.com>
++Date: Thu, 27 Oct 2016 17:43:05 -0400
++Subject: efinet: Setting network from UEFI device path
++
++The PXE Base Code protocol used to obtain cached PXE DHCPACK packet is no
++longer provided for HTTP Boot. Instead, we have to get the HTTP boot
++information from the device path nodes defined in following UEFI Specification
++sections.
++
++ 9.3.5.12 IPv4 Device Path
++ 9.3.5.13 IPv6 Device Path
++ 9.3.5.23 Uniform Resource Identifiers (URI) Device Path
++
++This patch basically does:
++
++include/grub/efi/api.h:
++Add new structure of Uniform Resource Identifiers (URI) Device Path
++
++grub-core/net/drivers/efi/efinet.c:
++Check if PXE Base Code is available, if not it will try to obtain the netboot
++information from the device path where the image booted from. The DHCPACK
++packet is recoverd from the information in device patch and feed into the same
++DHCP packet processing functions to ensure the network interface is setting up
++the same way it used to be.
++
++Signed-off-by: Michael Chang <mchang@suse.com>
++Signed-off-by: Ken Lin <ken.lin@hpe.com>
++
++Patch-Name: efinet-set-network-from-uefi-devpath.patch
++---
++ grub-core/net/drivers/efi/efinet.c | 268 ++++++++++++++++++++++++++++-
++ include/grub/efi/api.h | 11 ++
++ 2 files changed, 270 insertions(+), 9 deletions(-)
++
++diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
++index fc90415f2..2d3b00f0e 100644
++--- a/grub-core/net/drivers/efi/efinet.c
+++++ b/grub-core/net/drivers/efi/efinet.c
++@@ -23,6 +23,7 @@
++ #include <grub/efi/api.h>
++ #include <grub/efi/efi.h>
++ #include <grub/i18n.h>
+++#include <grub/net/netbuff.h>
++
++ GRUB_MOD_LICENSE ("GPLv3+");
++
++@@ -324,6 +325,221 @@ grub_efinet_findcards (void)
++ grub_free (handles);
++ }
++
+++static struct grub_net_buff *
+++grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6)
+++{
+++ grub_efi_uint16_t uri_len;
+++ grub_efi_device_path_t *ldp, *ddp;
+++ grub_efi_uri_device_path_t *uri_dp;
+++ struct grub_net_buff *nb;
+++ grub_err_t err;
+++
+++ ddp = grub_efi_duplicate_device_path (dp);
+++ ldp = grub_efi_find_last_device_path (ddp);
+++
+++ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE
+++ || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)
+++ {
+++ grub_free (ddp);
+++ return NULL;
+++ }
+++
+++ uri_len = GRUB_EFI_DEVICE_PATH_LENGTH (ldp) > 4 ? GRUB_EFI_DEVICE_PATH_LENGTH (ldp) - 4 : 0;
+++
+++ if (!uri_len)
+++ {
+++ grub_free (ddp);
+++ return NULL;
+++ }
+++
+++ uri_dp = (grub_efi_uri_device_path_t *) ldp;
+++
+++ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
+++ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
+++ ldp->length = sizeof (*ldp);
+++
+++ ldp = grub_efi_find_last_device_path (ddp);
+++
+++ 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))
+++ {
+++ grub_free (ddp);
+++ return NULL;
+++ }
+++
+++ nb = grub_netbuff_alloc (512);
+++ if (!nb)
+++ return NULL;
+++
+++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE)
+++ {
+++ grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp;
+++ struct grub_net_bootp_packet *bp;
+++ grub_uint8_t *ptr;
+++
+++ bp = (struct grub_net_bootp_packet *) nb->tail;
+++ err = grub_netbuff_put (nb, sizeof (*bp) + 4);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++
+++ if (sizeof(bp->boot_file) < uri_len)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ grub_memcpy (bp->boot_file, uri_dp->uri, uri_len);
+++ grub_memcpy (&bp->your_ip, ipv4->local_ip_address, sizeof (bp->your_ip));
+++ grub_memcpy (&bp->server_ip, ipv4->remote_ip_address, sizeof (bp->server_ip));
+++
+++ bp->vendor[0] = GRUB_NET_BOOTP_RFC1048_MAGIC_0;
+++ bp->vendor[1] = GRUB_NET_BOOTP_RFC1048_MAGIC_1;
+++ bp->vendor[2] = GRUB_NET_BOOTP_RFC1048_MAGIC_2;
+++ bp->vendor[3] = GRUB_NET_BOOTP_RFC1048_MAGIC_3;
+++
+++ ptr = nb->tail;
+++ err = grub_netbuff_put (nb, sizeof (ipv4->subnet_mask) + 2);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ *ptr++ = GRUB_NET_BOOTP_NETMASK;
+++ *ptr++ = sizeof (ipv4->subnet_mask);
+++ grub_memcpy (ptr, ipv4->subnet_mask, sizeof (ipv4->subnet_mask));
+++
+++ ptr = nb->tail;
+++ err = grub_netbuff_put (nb, sizeof (ipv4->gateway_ip_address) + 2);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ *ptr++ = GRUB_NET_BOOTP_ROUTER;
+++ *ptr++ = sizeof (ipv4->gateway_ip_address);
+++ grub_memcpy (ptr, ipv4->gateway_ip_address, sizeof (ipv4->gateway_ip_address));
+++
+++ ptr = nb->tail;
+++ err = grub_netbuff_put (nb, sizeof ("HTTPClient") + 1);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ *ptr++ = GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER;
+++ *ptr++ = sizeof ("HTTPClient") - 1;
+++ grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1);
+++
+++ ptr = nb->tail;
+++ err = grub_netbuff_put (nb, 1);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ *ptr = GRUB_NET_BOOTP_END;
+++ *use_ipv6 = 0;
+++
+++ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
+++ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
+++ ldp->length = sizeof (*ldp);
+++ ldp = grub_efi_find_last_device_path (ddp);
+++
+++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE)
+++ {
+++ grub_efi_mac_address_device_path_t *mac = (grub_efi_mac_address_device_path_t *) ldp;
+++ bp->hw_type = mac->if_type;
+++ bp->hw_len = sizeof (bp->mac_addr);
+++ grub_memcpy (bp->mac_addr, mac->mac_address, bp->hw_len);
+++ }
+++ }
+++ else
+++ {
+++ grub_efi_ipv6_device_path_t *ipv6 = (grub_efi_ipv6_device_path_t *) ldp;
+++
+++ struct grub_net_dhcp6_packet *d6p;
+++ struct grub_net_dhcp6_option *opt;
+++ struct grub_net_dhcp6_option_iana *iana;
+++ struct grub_net_dhcp6_option_iaaddr *iaaddr;
+++
+++ d6p = (struct grub_net_dhcp6_packet *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*d6p));
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ d6p->message_type = GRUB_NET_DHCP6_REPLY;
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*opt));
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA);
+++ opt->len = grub_cpu_to_be16_compile_time (sizeof(*iana) + sizeof(*opt) + sizeof(*iaaddr));
+++
+++ err = grub_netbuff_put (nb, sizeof(*iana));
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*opt));
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR);
+++ opt->len = grub_cpu_to_be16_compile_time (sizeof (*iaaddr));
+++
+++ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*iaaddr));
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ grub_memcpy (iaaddr->addr, ipv6->local_ip_address, sizeof(ipv6->local_ip_address));
+++
+++ opt = (struct grub_net_dhcp6_option *)nb->tail;
+++ err = grub_netbuff_put (nb, sizeof(*opt) + uri_len);
+++ if (err)
+++ {
+++ grub_free (ddp);
+++ grub_netbuff_free (nb);
+++ return NULL;
+++ }
+++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL);
+++ opt->len = grub_cpu_to_be16 (uri_len);
+++ grub_memcpy (opt->data, uri_dp->uri, uri_len);
+++
+++ *use_ipv6 = 1;
+++ }
+++
+++ grub_free (ddp);
+++ return nb;
+++}
+++
++ static void
++ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
++ char **path)
++@@ -340,6 +556,11 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
++ grub_efi_device_path_t *cdp;
++ struct grub_efi_pxe *pxe;
++ struct grub_efi_pxe_mode *pxe_mode;
+++ grub_uint8_t *packet_buf;
+++ grub_size_t packet_bufsz ;
+++ int ipv6;
+++ struct grub_net_buff *nb = NULL;
+++
++ if (card->driver != &efidriver)
++ continue;
++ cdp = grub_efi_get_device_path (card->efi_handle);
++@@ -359,11 +580,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **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))
+++ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE
+++ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE))
++ continue;
++ dup_dp = grub_efi_duplicate_device_path (dp);
++ if (!dup_dp)
++ continue;
+++
+++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)
+++ {
+++ 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);
+++ }
+++
++ 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;
++@@ -375,16 +606,31 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
++ }
++ pxe = grub_efi_open_protocol (hnd, &pxe_io_guid,
++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
++- if (! pxe)
++- continue;
++- pxe_mode = pxe->mode;
+++ if (!pxe)
+++ {
+++ nb = grub_efinet_create_dhcp_ack_from_device_path (dp, &ipv6);
+++ if (!nb)
+++ {
+++ grub_print_error ();
+++ continue;
+++ }
+++ packet_buf = nb->head;
+++ packet_bufsz = nb->tail - nb->head;
+++ }
+++ else
+++ {
+++ pxe_mode = pxe->mode;
+++ packet_buf = (grub_uint8_t *) &pxe_mode->dhcp_ack;
+++ packet_bufsz = sizeof (pxe_mode->dhcp_ack);
+++ ipv6 = pxe_mode->using_ipv6;
+++ }
++
++- if (pxe_mode->using_ipv6)
+++ if (ipv6)
++ {
++ grub_net_configure_by_dhcpv6_reply (card->name, card, 0,
++ (struct grub_net_dhcp6_packet *)
++- &pxe_mode->dhcp_ack,
++- sizeof (pxe_mode->dhcp_ack),
+++ packet_buf,
+++ packet_bufsz,
++ 1, device, path);
++ if (grub_errno)
++ grub_print_error ();
++@@ -393,10 +639,14 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
++ {
++ grub_net_configure_by_dhcp_ack (card->name, card, 0,
++ (struct grub_net_bootp_packet *)
++- &pxe_mode->dhcp_ack,
++- sizeof (pxe_mode->dhcp_ack),
+++ packet_buf,
+++ packet_bufsz,
++ 1, device, path);
++ }
+++
+++ if (nb)
+++ grub_netbuff_free (nb);
+++
++ return;
++ }
++ }
++diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
++index ca6cdc159..664cea37b 100644
++--- a/include/grub/efi/api.h
+++++ b/include/grub/efi/api.h
++@@ -825,6 +825,8 @@ struct grub_efi_ipv4_device_path
++ grub_efi_uint16_t remote_port;
++ grub_efi_uint16_t protocol;
++ grub_efi_uint8_t static_ip_address;
+++ grub_efi_ipv4_address_t gateway_ip_address;
+++ grub_efi_ipv4_address_t subnet_mask;
++ } GRUB_PACKED;
++ typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t;
++
++@@ -879,6 +881,15 @@ struct grub_efi_sata_device_path
++ } GRUB_PACKED;
++ typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t;
++
+++#define GRUB_EFI_URI_DEVICE_PATH_SUBTYPE 24
+++
+++struct grub_efi_uri_device_path
+++{
+++ grub_efi_device_path_t header;
+++ grub_efi_uint8_t uri[0];
+++} GRUB_PACKED;
+++typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t;
+++
++ #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
++
++ /* Media Device Path. */
--- /dev/null
--- /dev/null
++From 710d4423d3b38c0882b366d0a2668dd8490b7f0c Mon Sep 17 00:00:00 2001
++From: Michael Chang <mchang@suse.com>
++Date: Thu, 27 Oct 2016 17:41:21 -0400
++Subject: efinet: UEFI IPv6 PXE support
++
++When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is
++cached in firmware buffer which can be obtained by PXE Base Code protocol. The
++network interface can be setup through the parameters in that obtained packet.
++
++Signed-off-by: Michael Chang <mchang@suse.com>
++Signed-off-by: Ken Lin <ken.lin@hpe.com>
++
++Patch-Name: efinet-uefi-ipv6-pxe-support.patch
++---
++ grub-core/net/drivers/efi/efinet.c | 24 ++++++++++---
++ include/grub/efi/api.h | 55 +++++++++++++++++++++++++++++-
++ 2 files changed, 73 insertions(+), 6 deletions(-)
++
++diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
++index 5388f952b..fc90415f2 100644
++--- a/grub-core/net/drivers/efi/efinet.c
+++++ b/grub-core/net/drivers/efi/efinet.c
++@@ -378,11 +378,25 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
++ if (! pxe)
++ continue;
++ pxe_mode = pxe->mode;
++- grub_net_configure_by_dhcp_ack (card->name, card, 0,
++- (struct grub_net_bootp_packet *)
++- &pxe_mode->dhcp_ack,
++- sizeof (pxe_mode->dhcp_ack),
++- 1, device, path);
+++
+++ if (pxe_mode->using_ipv6)
+++ {
+++ grub_net_configure_by_dhcpv6_reply (card->name, card, 0,
+++ (struct grub_net_dhcp6_packet *)
+++ &pxe_mode->dhcp_ack,
+++ sizeof (pxe_mode->dhcp_ack),
+++ 1, device, path);
+++ if (grub_errno)
+++ grub_print_error ();
+++ }
+++ else
+++ {
+++ grub_net_configure_by_dhcp_ack (card->name, card, 0,
+++ (struct grub_net_bootp_packet *)
+++ &pxe_mode->dhcp_ack,
+++ sizeof (pxe_mode->dhcp_ack),
+++ 1, device, path);
+++ }
++ return;
++ }
++ }
++diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
++index addcbfa8f..ca6cdc159 100644
++--- a/include/grub/efi/api.h
+++++ b/include/grub/efi/api.h
++@@ -1452,14 +1452,67 @@ typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output
++
++ typedef grub_uint8_t grub_efi_pxe_packet_t[1472];
++
+++typedef struct {
+++ grub_uint8_t addr[4];
+++} grub_efi_pxe_ipv4_address_t;
+++
+++typedef struct {
+++ grub_uint8_t addr[16];
+++} grub_efi_pxe_ipv6_address_t;
+++
+++typedef struct {
+++ grub_uint8_t addr[32];
+++} grub_efi_pxe_mac_address_t;
+++
+++typedef union {
+++ grub_uint32_t addr[4];
+++ grub_efi_pxe_ipv4_address_t v4;
+++ grub_efi_pxe_ipv6_address_t v6;
+++} grub_efi_pxe_ip_address_t;
+++
+++#define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8
+++typedef struct {
+++ grub_uint8_t filters;
+++ grub_uint8_t ip_cnt;
+++ grub_uint16_t reserved;
+++ grub_efi_pxe_ip_address_t ip_list[GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT];
+++} grub_efi_pxe_ip_filter_t;
+++
+++typedef struct {
+++ grub_efi_pxe_ip_address_t ip_addr;
+++ grub_efi_pxe_mac_address_t mac_addr;
+++} grub_efi_pxe_arp_entry_t;
+++
+++typedef struct {
+++ grub_efi_pxe_ip_address_t ip_addr;
+++ grub_efi_pxe_ip_address_t subnet_mask;
+++ grub_efi_pxe_ip_address_t gw_addr;
+++} grub_efi_pxe_route_entry_t;
+++
+++
+++#define GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
+++#define GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
+++
++ typedef struct grub_efi_pxe_mode
++ {
++- grub_uint8_t unused[52];
+++ grub_uint8_t started;
+++ grub_uint8_t ipv6_available;
+++ grub_uint8_t ipv6_supported;
+++ grub_uint8_t using_ipv6;
+++ grub_uint8_t unused[16];
+++ grub_efi_pxe_ip_address_t station_ip;
+++ grub_efi_pxe_ip_address_t subnet_mask;
++ grub_efi_pxe_packet_t dhcp_discover;
++ grub_efi_pxe_packet_t dhcp_ack;
++ grub_efi_pxe_packet_t proxy_offer;
++ grub_efi_pxe_packet_t pxe_discover;
++ grub_efi_pxe_packet_t pxe_reply;
+++ grub_efi_pxe_packet_t pxe_bis_reply;
+++ grub_efi_pxe_ip_filter_t ip_filter;
+++ grub_uint32_t arp_cache_entries;
+++ grub_efi_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
+++ grub_uint32_t route_table_entries;
+++ grub_efi_pxe_route_entry_t route_table[GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
++ } grub_efi_pxe_mode_t;
++
++ typedef struct grub_efi_pxe
--- /dev/null
--- /dev/null
++From 44953ee42a301019f2c0687e4472c8f7fa731a94 Mon Sep 17 00:00:00 2001
++From: Luca Boccassi <bluca@debian.org>
++Date: Tue, 15 May 2018 11:36:46 +0100
++Subject: Do not overwrite sentinel byte in boot_params, breaks lockdown
++
++grub currently copies the entire boot_params, which includes setting
++sentinel byte to 0xff, which triggers sanitize_boot_params in the kernel
++which in turn clears various boot_params variables, including the
++indication that the bootloader chain is verified and thus the kernel
++disables lockdown mode. According to the information on the Fedora bug
++tracker, only the information from byte 0x1f1 is necessary, so start
++copying from there instead.
++
++Author: Luca Boccassi <bluca@debian.org>
++Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1418360
++Forwarded: no
++
++Patch-Name: fix-lockdown.patch
++---
++ grub-core/loader/i386/efi/linux.c | 5 ++++-
++ 1 file changed, 4 insertions(+), 1 deletion(-)
++
++diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
++index b731b9201..7d94369be 100644
++--- a/grub-core/loader/i386/efi/linux.c
+++++ b/grub-core/loader/i386/efi/linux.c
++@@ -28,6 +28,7 @@
++ #include <grub/lib/cmdline.h>
++ #include <grub/linux.h>
++ #include <grub/efi/efi.h>
+++#include <stddef.h>
++
++ GRUB_MOD_LICENSE ("GPLv3+");
++
++@@ -328,7 +329,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
++ lh.code32_start = (grub_uint32_t)(grub_addr_t) kernel_mem;
++ }
++
++- grub_memcpy (params, &lh, 2 * 512);
+++ /* do not overwrite below boot_params->hdr to avoid setting the sentinel byte */
+++ start = offsetof (struct linux_kernel_params, setup_sects);
+++ grub_memcpy ((grub_uint8_t *)params + start, (grub_uint8_t *)&lh + start, 2 * 512 - start);
++
++ params->type_of_loader = 0x21;
++
--- /dev/null
--- /dev/null
++From 8d0176ec8c9d7d23daa960700650ff7f91604f0e Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:02 +0000
++Subject: Silence error messages when translations are unavailable
++
++Bug: https://savannah.gnu.org/bugs/?35880
++Forwarded: https://savannah.gnu.org/bugs/?35880
++Last-Update: 2013-11-14
++
++Patch-Name: gettext-quiet.patch
++---
++ grub-core/gettext/gettext.c | 5 +++++
++ 1 file changed, 5 insertions(+)
++
++diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
++index 4d02e62c1..2a19389f2 100644
++--- a/grub-core/gettext/gettext.c
+++++ b/grub-core/gettext/gettext.c
++@@ -427,6 +427,11 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx,
++ if (locale[0] == 'e' && locale[1] == 'n'
++ && (locale[2] == '\0' || locale[2] == '_'))
++ grub_errno = err = GRUB_ERR_NONE;
+++
+++ /* If no translations are available, fall back to untranslated text. */
+++ if (err == GRUB_ERR_FILE_NOT_FOUND)
+++ grub_errno = err = GRUB_ERR_NONE;
+++
++ return err;
++ }
++
--- /dev/null
--- /dev/null
++From 94409096751781ddb277b2442f0d516c4044f560 Mon Sep 17 00:00:00 2001
++From: Evan Broder <evan@ebroder.net>
++Date: Mon, 13 Jan 2014 12:13:29 +0000
++Subject: Add configure option to enable gfxpayload=keep dynamically
++
++Set GRUB_GFXPAYLOAD_LINUX=keep unless it's known to be unsupported on
++the current hardware. See
++https://blueprints.launchpad.net/ubuntu/+spec/packageselection-foundations-n-grub2-boot-framebuffer.
++
++Author: Colin Watson <cjwatson@ubuntu.com>
++Forwarded: no
++Last-Update: 2019-05-25
++
++Patch-Name: gfxpayload-dynamic.patch
++---
++ configure.ac | 11 ++
++ grub-core/Makefile.core.def | 8 ++
++ grub-core/commands/i386/pc/hwmatch.c | 146 +++++++++++++++++++++++++++
++ include/grub/file.h | 1 +
++ util/grub.d/10_linux.in | 37 ++++++-
++ 5 files changed, 200 insertions(+), 3 deletions(-)
++ create mode 100644 grub-core/commands/i386/pc/hwmatch.c
++
++diff --git a/configure.ac b/configure.ac
++index ebfcb618a..c061e3d19 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1879,6 +1879,17 @@ else
++ fi
++ AC_SUBST([QUICK_BOOT])
++
+++AC_ARG_ENABLE([gfxpayload-dynamic],
+++ [AS_HELP_STRING([--enable-gfxpayload-dynamic],
+++ [use GRUB_GFXPAYLOAD_LINUX=keep unless explicitly unsupported on current hardware (default=no)])],
+++ [], [enable_gfxpayload_dynamic=no])
+++if test x"$enable_gfxpayload_dynamic" = xyes ; then
+++ GFXPAYLOAD_DYNAMIC=1
+++else
+++ GFXPAYLOAD_DYNAMIC=0
+++fi
+++AC_SUBST([GFXPAYLOAD_DYNAMIC])
+++
++ LIBS=""
++
++ AC_SUBST([FONT_SOURCE])
++diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
++index 67a98abbb..836bf0a59 100644
++--- a/grub-core/Makefile.core.def
+++++ b/grub-core/Makefile.core.def
++@@ -971,6 +971,14 @@ module = {
++ common = lib/hexdump.c;
++ };
++
+++module = {
+++ name = hwmatch;
+++ i386_pc = commands/i386/pc/hwmatch.c;
+++ enable = i386_pc;
+++ cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
+++ cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
+++};
+++
++ module = {
++ name = keystatus;
++ common = commands/keystatus.c;
++diff --git a/grub-core/commands/i386/pc/hwmatch.c b/grub-core/commands/i386/pc/hwmatch.c
++new file mode 100644
++index 000000000..6de07cecc
++--- /dev/null
+++++ b/grub-core/commands/i386/pc/hwmatch.c
++@@ -0,0 +1,146 @@
+++/* hwmatch.c - Match hardware against a whitelist/blacklist. */
+++/*
+++ * GRUB -- GRand Unified Bootloader
+++ * Copyright (C) 2011 Free Software Foundation, Inc.
+++ *
+++ * GRUB is free software: you can redistribute it and/or modify
+++ * it under the terms of the GNU General Public License as published by
+++ * the Free Software Foundation, either version 3 of the License, or
+++ * (at your option) any later version.
+++ *
+++ * GRUB is distributed in the hope that it will be useful,
+++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+++ * GNU General Public License for more details.
+++ *
+++ * You should have received a copy of the GNU General Public License
+++ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+++ */
+++
+++#include <grub/dl.h>
+++#include <grub/misc.h>
+++#include <grub/command.h>
+++#include <grub/pci.h>
+++#include <grub/normal.h>
+++#include <grub/file.h>
+++#include <grub/env.h>
+++#include <grub/i18n.h>
+++#include <regex.h>
+++
+++GRUB_MOD_LICENSE ("GPLv3+");
+++
+++/* Context for grub_cmd_hwmatch. */
+++struct hwmatch_ctx
+++{
+++ grub_file_t matches_file;
+++ int class_match;
+++ int match;
+++};
+++
+++/* Helper for grub_cmd_hwmatch. */
+++static int
+++hwmatch_iter (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
+++{
+++ struct hwmatch_ctx *ctx = data;
+++ grub_pci_address_t addr;
+++ grub_uint32_t class, baseclass, vendor, device;
+++ grub_pci_id_t subpciid;
+++ grub_uint32_t subvendor, subdevice, subclass;
+++ char *id, *line;
+++
+++ addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
+++ class = grub_pci_read (addr);
+++ baseclass = class >> 24;
+++
+++ if (ctx->class_match != baseclass)
+++ return 0;
+++
+++ vendor = pciid & 0xffff;
+++ device = pciid >> 16;
+++
+++ addr = grub_pci_make_address (dev, GRUB_PCI_REG_SUBVENDOR);
+++ subpciid = grub_pci_read (addr);
+++
+++ subclass = (class >> 16) & 0xff;
+++ subvendor = subpciid & 0xffff;
+++ subdevice = subpciid >> 16;
+++
+++ id = grub_xasprintf ("v%04xd%04xsv%04xsd%04xbc%02xsc%02x",
+++ vendor, device, subvendor, subdevice,
+++ baseclass, subclass);
+++
+++ grub_file_seek (ctx->matches_file, 0);
+++ while ((line = grub_file_getline (ctx->matches_file)) != NULL)
+++ {
+++ char *anchored_line;
+++ regex_t regex;
+++ int ret;
+++
+++ if (! *line || *line == '#')
+++ {
+++ grub_free (line);
+++ continue;
+++ }
+++
+++ anchored_line = grub_xasprintf ("^%s$", line);
+++ ret = regcomp (®ex, anchored_line, REG_EXTENDED | REG_NOSUB);
+++ grub_free (anchored_line);
+++ if (ret)
+++ {
+++ grub_free (line);
+++ continue;
+++ }
+++
+++ ret = regexec (®ex, id, 0, NULL, 0);
+++ regfree (®ex);
+++ grub_free (line);
+++ if (! ret)
+++ {
+++ ctx->match = 1;
+++ return 1;
+++ }
+++ }
+++
+++ return 0;
+++}
+++
+++static grub_err_t
+++grub_cmd_hwmatch (grub_command_t cmd __attribute__ ((unused)),
+++ int argc, char **args)
+++{
+++ struct hwmatch_ctx ctx = { .match = 0 };
+++ char *match_str;
+++
+++ if (argc < 2)
+++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "list file and class required");
+++
+++ ctx.matches_file = grub_file_open (args[0], GRUB_FILE_TYPE_HWMATCH);
+++ if (! ctx.matches_file)
+++ return grub_errno;
+++
+++ ctx.class_match = grub_strtol (args[1], 0, 10);
+++
+++ grub_pci_iterate (hwmatch_iter, &ctx);
+++
+++ match_str = grub_xasprintf ("%d", ctx.match);
+++ grub_env_set ("match", match_str);
+++ grub_free (match_str);
+++
+++ grub_file_close (ctx.matches_file);
+++
+++ return GRUB_ERR_NONE;
+++}
+++
+++static grub_command_t cmd;
+++\f
+++GRUB_MOD_INIT(hwmatch)
+++{
+++ cmd = grub_register_command ("hwmatch", grub_cmd_hwmatch,
+++ N_("MATCHES-FILE CLASS"),
+++ N_("Match PCI devices."));
+++}
+++
+++GRUB_MOD_FINI(hwmatch)
+++{
+++ grub_unregister_command (cmd);
+++}
++diff --git a/include/grub/file.h b/include/grub/file.h
++index 31567483c..e3c4cae2b 100644
++--- a/include/grub/file.h
+++++ b/include/grub/file.h
++@@ -122,6 +122,7 @@ enum grub_file_type
++ GRUB_FILE_TYPE_FS_SEARCH,
++ GRUB_FILE_TYPE_AUDIO,
++ GRUB_FILE_TYPE_VBE_DUMP,
+++ GRUB_FILE_TYPE_HWMATCH,
++
++ GRUB_FILE_TYPE_LOADENV,
++ GRUB_FILE_TYPE_SAVEENV,
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 51cdb5e1d..2f5217358 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -23,6 +23,7 @@ datarootdir="@datarootdir@"
++ ubuntu_recovery="@UBUNTU_RECOVERY@"
++ quiet_boot="@QUIET_BOOT@"
++ quick_boot="@QUICK_BOOT@"
+++gfxpayload_dynamic="@GFXPAYLOAD_DYNAMIC@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
++@@ -145,9 +146,10 @@ linux_entry ()
++ if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
++ echo " load_video" | sed "s/^/$submenu_indentation/"
++ fi
++- if [ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]; then
++- echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
++- fi
+++ fi
+++ if ([ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]) && \
+++ ([ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 1 ]); then
+++ echo " set gfxpayload=\$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
++ fi
++
++ echo " insmod gzio" | sed "s/^/$submenu_indentation/"
++@@ -226,6 +228,35 @@ prepare_root_cache=
++ boot_device_id=
++ title_correction_code=
++
+++# Use ELILO's generic "efifb" when it's known to be available.
+++# FIXME: We need an interface to select vesafb in case efifb can't be used.
+++if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 0 ]; then
+++ echo "set linux_gfx_mode=$GRUB_GFXPAYLOAD_LINUX"
+++else
+++ cat << EOF
+++if [ "\${recordfail}" != 1 ]; then
+++ if [ -e \${prefix}/gfxblacklist.txt ]; then
+++ if hwmatch \${prefix}/gfxblacklist.txt 3; then
+++ if [ \${match} = 0 ]; then
+++ set linux_gfx_mode=keep
+++ else
+++ set linux_gfx_mode=text
+++ fi
+++ else
+++ set linux_gfx_mode=text
+++ fi
+++ else
+++ set linux_gfx_mode=keep
+++ fi
+++else
+++ set linux_gfx_mode=text
+++fi
+++EOF
+++fi
+++cat << EOF
+++export linux_gfx_mode
+++EOF
+++
++ # Extra indentation to add to menu entries in a submenu. We're not in a submenu
++ # yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
++ submenu_indentation=""
--- /dev/null
--- /dev/null
++From c94ab2404ae16169c2df86ba85ef60cfe5b2ca5b Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:57 +0000
++Subject: Disable gfxpayload=keep by default
++
++Setting gfxpayload=keep has been known to cause efifb to be
++inappropriately enabled. In any case, with the current Linux kernel the
++result of this option is that early kernelspace will be unable to print
++anything to the console, so (for example) if boot fails and you end up
++dumped to an initramfs prompt, you won't be able to see anything on the
++screen. As such it shouldn't be enabled by default in Debian, no matter
++what kernel options are enabled.
++
++gfxpayload=keep is a good idea but rather ahead of its time ...
++
++Bug-Debian: http://bugs.debian.org/567245
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: gfxpayload-keep-default.patch
++---
++ util/grub.d/10_linux.in | 4 ----
++ 1 file changed, 4 deletions(-)
++
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 4532266be..dd5a60c71 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -114,10 +114,6 @@ linux_entry ()
++ # FIXME: We need an interface to select vesafb in case efifb can't be used.
++ if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
++ echo " load_video" | sed "s/^/$submenu_indentation/"
++- if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
++- && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
++- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
++- fi
++ else
++ if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
++ echo " load_video" | sed "s/^/$submenu_indentation/"
--- /dev/null
- From c009126d6256205355a392dc7002ed1dac2dc59f Mon Sep 17 00:00:00 2001
++From c4cc2acf6bc4e3eb7ec57bbb613d21872bacf8ae Mon Sep 17 00:00:00 2001
+From: Steve McIntyre <93sam@debian.org>
+Date: Wed, 3 Dec 2014 01:25:12 +0000
+Subject: Add support for forcing EFI installation to the removable media path
+
+Add an extra option to grub-install "--force-extra-removable". On EFI
+platforms, this will cause an extra copy of the grub-efi image to be
+written to the appropriate removable media patch
+/boot/efi/EFI/BOOT/BOOT$ARCH.EFI as well. This will help with broken
+UEFI implementations where the firmware does not work when configured
+with new boot paths.
+
+Signed-off-by: Steve McIntyre <93sam@debian.org>
+
+Bug-Debian: https://bugs.debian.org/767037 https://bugs.debian.org/773092
+Forwarded: Not yet
+Last-Update: 2014-12-20
+
+Patch-Name: grub-install-extra-removable.patch
+---
+ util/grub-install.c | 110 +++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 108 insertions(+), 2 deletions(-)
+
+diff --git a/util/grub-install.c b/util/grub-install.c
- index 7a24767c1..1fbb4c7da 100644
++index f511cfc72..5f3217ae4 100644
+--- a/util/grub-install.c
++++ b/util/grub-install.c
+@@ -56,6 +56,7 @@
+
+ static char *target;
+ static int removable = 0;
++static int force_extra_removable = 0;
+ static int recheck = 0;
+ static int update_nvram = 1;
+ static char *install_device = NULL;
+@@ -113,7 +114,8 @@ enum
+ OPTION_LABEL_BGCOLOR,
+ OPTION_PRODUCT_VERSION,
+ OPTION_UEFI_SECURE_BOOT,
+- OPTION_NO_UEFI_SECURE_BOOT
++ OPTION_NO_UEFI_SECURE_BOOT,
++ OPTION_FORCE_EXTRA_REMOVABLE
+ };
+
+ static int fs_probe = 1;
+@@ -216,6 +218,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
+ removable = 1;
+ return 0;
+
++ case OPTION_FORCE_EXTRA_REMOVABLE:
++ force_extra_removable = 1;
++ return 0;
++
+ case OPTION_ALLOW_FLOPPY:
+ allow_floppy = 1;
+ return 0;
+@@ -322,6 +328,9 @@ static struct argp_option options[] = {
+ N_("do not install an image usable with UEFI Secure Boot, even if the "
+ "system was currently started using it. "
+ "This option is only available on EFI."), 2},
++ {"force-extra-removable", OPTION_FORCE_EXTRA_REMOVABLE, 0, 0,
++ N_("force installation to the removable media path also. "
++ "This option is only available on EFI."), 2},
+ {0, 0, 0, 0, 0, 0}
+ };
+
- @@ -835,6 +844,91 @@ fill_core_services (const char *core_services)
++@@ -839,6 +848,91 @@ fill_core_services (const char *core_services)
+ free (sysv_plist);
+ }
+
++/* Helper routine for also_install_removable() below. Walk through the
++ specified dir, looking to see if there is a file/dir that matches
++ the search string exactly, but in a case-insensitive manner. If so,
++ return a copy of the exact file/dir that *does* exist. If not,
++ return NULL */
++static char *
++check_component_exists(const char *dir,
++ const char *search)
++{
++ grub_util_fd_dir_t d;
++ grub_util_fd_dirent_t de;
++ char *found = NULL;
++
++ d = grub_util_fd_opendir (dir);
++ if (!d)
++ grub_util_error (_("cannot open directory `%s': %s"),
++ dir, grub_util_fd_strerror ());
++
++ while ((de = grub_util_fd_readdir (d)))
++ {
++ if (strcasecmp (de->d_name, search) == 0)
++ {
++ found = xstrdup (de->d_name);
++ break;
++ }
++ }
++ grub_util_fd_closedir (d);
++ return found;
++}
++
++/* Some complex directory-handling stuff in here, to cope with
++ * case-insensitive FAT/VFAT filesystem semantics. Ugh. */
++static void
++also_install_removable(const char *src,
++ const char *base_efidir,
++ const char *efi_suffix_upper)
++{
++ char *efi_file = NULL;
++ char *dst = NULL;
++ char *cur = NULL;
++ char *found = NULL;
++
++ if (!efi_suffix_upper)
++ grub_util_error ("%s", _("efi_suffix_upper not set"));
++ efi_file = xasprintf ("BOOT%s.EFI", efi_suffix_upper);
++
++ /* We need to install in $base_efidir/EFI/BOOT/$efi_file, but we
++ * need to cope with case-insensitive stuff here. Build the path one
++ * component at a time, checking for existing matches each time. */
++
++ /* Look for "EFI" in base_efidir. Make it if it does not exist in
++ * some form. */
++ found = check_component_exists(base_efidir, "EFI");
++ if (found == NULL)
++ found = xstrdup("EFI");
++ dst = grub_util_path_concat (2, base_efidir, found);
++ cur = xstrdup (dst);
++ free (dst);
++ free (found);
++ grub_install_mkdir_p (cur);
++
++ /* Now BOOT */
++ found = check_component_exists(cur, "BOOT");
++ if (found == NULL)
++ found = xstrdup("BOOT");
++ dst = grub_util_path_concat (2, cur, found);
++ cur = xstrdup (dst);
++ free (dst);
++ free (found);
++ grub_install_mkdir_p (cur);
++
++ /* Now $efi_file */
++ found = check_component_exists(cur, efi_file);
++ if (found == NULL)
++ found = xstrdup(efi_file);
++ dst = grub_util_path_concat (2, cur, found);
++ cur = xstrdup (dst);
++ free (dst);
++ free (found);
++ grub_install_copy_file (src, cur, 1);
++
++ free (cur);
++ free (efi_file);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
- @@ -852,6 +946,7 @@ main (int argc, char *argv[])
++@@ -856,6 +950,7 @@ main (int argc, char *argv[])
+ char *relative_grubdir;
+ char **efidir_device_names = NULL;
+ grub_device_t efidir_grub_dev = NULL;
++ char *base_efidir = NULL;
+ char *efidir_grub_devname;
+ int efidir_is_mac = 0;
+ int is_prep = 0;
- @@ -884,6 +979,9 @@ main (int argc, char *argv[])
++@@ -888,6 +983,9 @@ main (int argc, char *argv[])
+ bootloader_id = xstrdup ("grub");
+ }
+
++ if (removable && force_extra_removable)
++ grub_util_error (_("Invalid to use both --removable and --force_extra_removable"));
++
+ if (!grub_install_source_directory)
+ {
+ if (!target)
- @@ -1093,6 +1191,8 @@ main (int argc, char *argv[])
++@@ -1107,6 +1205,8 @@ main (int argc, char *argv[])
+ if (!efidir_is_mac && grub_strcmp (fs->name, "fat") != 0)
+ grub_util_error (_("%s doesn't look like an EFI partition"), efidir);
+
++ base_efidir = xstrdup(efidir);
++
+ /* The EFI specification requires that an EFI System Partition must
+ contain an "EFI" subdirectory, and that OS loaders are stored in
+ subdirectories below EFI. Vendors are expected to pick names that do
- @@ -1980,9 +2080,15 @@ main (int argc, char *argv[])
++@@ -2021,9 +2121,15 @@ main (int argc, char *argv[])
+ fprintf (config_dst_f, "configfile $prefix/grub.cfg\n");
+ fclose (config_dst_f);
+ free (config_dst);
++ if (force_extra_removable)
++ also_install_removable(efi_signed, base_efidir, efi_suffix_upper);
+ }
+ else
+- grub_install_copy_file (imgfile, dst, 1);
++ {
++ grub_install_copy_file (imgfile, dst, 1);
++ if (force_extra_removable)
++ also_install_removable(imgfile, base_efidir, efi_suffix_upper);
++ }
+ free (dst);
+ }
+ if (!removable && update_nvram)
--- /dev/null
- From a4b1e6234ba49999e4964462c948f163e97fcff0 Mon Sep 17 00:00:00 2001
++From 117f548a6265a96a9e522f97c4394ef8975aba76 Mon Sep 17 00:00:00 2001
+From: Ian Campbell <ijc@hellion.org.uk>
+Date: Sat, 6 Sep 2014 12:20:12 +0100
+Subject: grub-install: Install PV Xen binaries into the upstream specified
+ path
+
+Upstream have defined a specification for where guests ought to place their
+xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
+loaded from dom0.
+
+http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html
+
+The spec calls for installation into /boot/xen/pvboot-i386.elf or
+/boot/xen/pvboot-x86_64.elf.
+
+Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
+
+Bug-Debian: https://bugs.debian.org/762307
+Forwarded: http://lists.gnu.org/archive/html/grub-devel/2014-10/msg00041.html
+Last-Update: 2014-10-24
+
+Patch-Name: grub-install-pvxen-paths.patch
+
+---
+v2: Respect bootdir, create /boot/xen as needed.
+---
+ util/grub-install.c | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/util/grub-install.c b/util/grub-install.c
- index 57d6aab76..7a24767c1 100644
++index 73c623107..f511cfc72 100644
+--- a/util/grub-install.c
++++ b/util/grub-install.c
- @@ -2010,6 +2010,28 @@ main (int argc, char *argv[])
++@@ -2055,6 +2055,28 @@ main (int argc, char *argv[])
+ }
+ break;
+
++ case GRUB_INSTALL_PLATFORM_I386_XEN:
++ {
++ char *path = grub_util_path_concat (2, bootdir, "xen");
++ char *dst = grub_util_path_concat (2, path, "pvboot-i386.elf");
++ grub_install_mkdir_p (path);
++ grub_install_copy_file (imgfile, dst, 1);
++ free (dst);
++ free (path);
++ }
++ break;
++
++ case GRUB_INSTALL_PLATFORM_X86_64_XEN:
++ {
++ char *path = grub_util_path_concat (2, bootdir, "xen");
++ char *dst = grub_util_path_concat (2, path, "pvboot-x86_64.elf");
++ grub_install_mkdir_p (path);
++ grub_install_copy_file (imgfile, dst, 1);
++ free (dst);
++ free (path);
++ }
++ break;
++
+ case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
+ case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
+ case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
- @@ -2018,8 +2040,6 @@ main (int argc, char *argv[])
++@@ -2064,8 +2086,6 @@ main (int argc, char *argv[])
+ case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
+ case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
+ case GRUB_INSTALL_PLATFORM_I386_QEMU:
+- case GRUB_INSTALL_PLATFORM_I386_XEN:
+- case GRUB_INSTALL_PLATFORM_X86_64_XEN:
++ case GRUB_INSTALL_PLATFORM_I386_XEN_PVH:
+ grub_util_warn ("%s",
+ _("WARNING: no platform-specific install was performed"));
- break;
--- /dev/null
--- /dev/null
++From 6385ffa66da8d9c0134b62635bfb5256f9384cdb Mon Sep 17 00:00:00 2001
++From: Robert Millan <rmh@aybabtu.com>
++Date: Mon, 13 Jan 2014 12:12:53 +0000
++Subject: Support running grub-probe in grub-legacy's update-grub
++
++Author: Colin Watson <cjwatson@debian.org>
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: grub-legacy-0-based-partitions.patch
++---
++ util/getroot.c | 14 ++++++++++++++
++ 1 file changed, 14 insertions(+)
++
++diff --git a/util/getroot.c b/util/getroot.c
++index 847406fba..cdd41153c 100644
++--- a/util/getroot.c
+++++ b/util/getroot.c
++@@ -245,6 +245,20 @@ find_partition (grub_disk_t dsk __attribute__ ((unused)),
++
++ if (ctx->start == part_start)
++ {
+++ /* This is dreadfully hardcoded, but there's a limit to what GRUB
+++ Legacy was able to deal with anyway. */
+++ if (getenv ("GRUB_LEGACY_0_BASED_PARTITIONS"))
+++ {
+++ if (partition->parent)
+++ /* Probably a BSD slice. */
+++ ctx->partname = xasprintf ("%d,%d", partition->parent->number,
+++ partition->number + 1);
+++ else
+++ ctx->partname = xasprintf ("%d", partition->number);
+++
+++ return 1;
+++ }
+++
++ ctx->partname = grub_partition_get_name (partition);
++ return 1;
++ }
--- /dev/null
--- /dev/null
++From a9a2bf273cba3f81f3c4155329442740ff383953 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:55 +0000
++Subject: Make grub.cfg world-readable if it contains no passwords
++
++Patch-Name: grub.cfg-400.patch
++---
++ util/grub-mkconfig.in | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
++index 33332360e..72e0739eb 100644
++--- a/util/grub-mkconfig.in
+++++ b/util/grub-mkconfig.in
++@@ -276,6 +276,10 @@ for i in "${grub_mkconfig_dir}"/* ; do
++ esac
++ done
++
+++if [ "x${grub_cfg}" != "x" ] && ! grep "^password" ${grub_cfg}.new >/dev/null; then
+++ chmod 444 ${grub_cfg}.new || true
+++fi
+++
++ if test "x${grub_cfg}" != "x" ; then
++ if ! ${grub_script_check} ${grub_cfg}.new; then
++ # TRANSLATORS: %s is replaced by filename
--- /dev/null
- From e31237aea5ee424d14fb8514692d12482ebd78f9 Mon Sep 17 00:00:00 2001
++From 4722c0c41cf52f621bce038b1108662dce99eb52 Mon Sep 17 00:00:00 2001
+From: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
+Date: Thu, 25 Sep 2014 18:41:29 -0300
+Subject: Include a text attribute reset in the clear command for ppc
+
+Always clear text attribute for clear command in order to avoid problems
+after it boots.
+
+* grub-core/term/terminfo.c: Add escape for text attribute reset
+
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1295255
+Origin: other, https://lists.gnu.org/archive/html/grub-devel/2014-09/msg00076.html
+Last-Update: 2014-09-26
+
+Patch-Name: ieee1275-clear-reset.patch
+---
+ grub-core/term/terminfo.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c
- index f0d3e3deb..7cb7909c8 100644
++index d317efa36..63892ad42 100644
+--- a/grub-core/term/terminfo.c
++++ b/grub-core/term/terminfo.c
+@@ -151,7 +151,7 @@ grub_terminfo_set_current (struct grub_term_output *term,
+ /* Clear the screen. Using serial console, screen(1) only recognizes the
+ * ANSI escape sequence. Using video console, Apple Open Firmware
+ * (version 3.1.1) only recognizes the literal ^L. So use both. */
+- data->cls = grub_strdup ("\f\e[2J");
++ data->cls = grub_strdup ("\f\e[2J\e[m");
+ data->reverse_video_on = grub_strdup ("\e[7m");
+ data->reverse_video_off = grub_strdup ("\e[m");
+ if (grub_strcmp ("ieee1275", str) == 0)
--- /dev/null
--- /dev/null
++From 2bc1567153c9f53b128aa13dcc7e087e7d302a61 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:13:32 +0000
++Subject: Ignore functional test failures for now as they are broken
++
++See: https://lists.gnu.org/archive/html/grub-devel/2013-11/msg00242.html
++
++Forwarded: not-needed
++Last-Update: 2013-11-19
++
++Patch-Name: ignore-grub_func_test-failures.patch
++---
++ tests/grub_func_test.in | 4 +++-
++ 1 file changed, 3 insertions(+), 1 deletion(-)
++
++diff --git a/tests/grub_func_test.in b/tests/grub_func_test.in
++index c67f9e422..728cd6e06 100644
++--- a/tests/grub_func_test.in
+++++ b/tests/grub_func_test.in
++@@ -16,6 +16,8 @@ out=`echo all_functional_test | @builddir@/grub-shell --timeout=3600 --files="/b
++
++ if [ "$(echo "$out" | tail -n 1)" != "ALL TESTS PASSED" ]; then
++ echo "Functional test failure: $out"
++- exit 1
+++ # Disabled temporarily due to unrecognised video checksum failures.
+++ #exit 1
+++ exit 0
++ fi
++
--- /dev/null
- From 02d10b47f2e7625712397f03f25bdcd0d04dda39 Mon Sep 17 00:00:00 2001
++From e1e7ed8a92a246194b095c5c70e8222ca7e90125 Mon Sep 17 00:00:00 2001
+From: Ian Campbell <ijc@debian.org>
+Date: Sun, 30 Nov 2014 12:12:52 +0000
+Subject: Arrange to insmod xzio and lzopio when booting a kernel as a Xen
+ guest
+
+This is needed in case the Linux kernel is compiled with CONFIG_KERNEL_XZ or
+CONFIG_KERNEL_LZO rather than CONFIG_KERNEL_GZ (gzio is already loaded by
+grub.cfg today).
+
+Signed-off-by: Ian Campbell <ijc@debian.org>
+
+Bug-Debian: https://bugs.debian.org/755256
+Forwarded: http://lists.gnu.org/archive/html/grub-devel/2014-11/msg00091.html
+Last-Update: 2014-11-30
+
+Patch-Name: insmod-xzio-and-lzopio-on-xen.patch
+---
+ util/grub.d/10_linux.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
- index 704e834d5..d344f05e6 100644
++index ba945582e..8a74c677b 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
- @@ -152,6 +152,7 @@ linux_entry ()
++@@ -162,6 +162,7 @@ linux_entry ()
+ fi
+
+ echo " insmod gzio" | sed "s/^/$submenu_indentation/"
++ echo " if [ x\$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi" | sed "s/^/$submenu_indentation/"
+
+ if [ x$dirname = x/ ]; then
+ if [ -z "${prepare_root_cache}" ]; then
--- /dev/null
--- /dev/null
++From b3538bf90302da0972ec2290fb5686023c8659b1 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:05 +0000
++Subject: Fall back to non-EFI if booted using EFI but -efi is missing
++
++It may be possible, particularly in recovery situations, to be booted
++using EFI on x86 when only the i386-pc target is installed, or on ARM
++when only the arm-uboot target is installed. There's nothing actually
++stopping us installing i386-pc or arm-uboot from an EFI environment, and
++it's better than returning a confusing error.
++
++Author: Steve McIntyre <93sam@debian.org>
++Forwarded: no
++Last-Update: 2019-05-24
++
++Patch-Name: install-efi-fallback.patch
++---
++ grub-core/osdep/linux/platform.c | 40 ++++++++++++++++++++++++++++----
++ 1 file changed, 35 insertions(+), 5 deletions(-)
++
++diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c
++index e28a79dab..2e7f72086 100644
++--- a/grub-core/osdep/linux/platform.c
+++++ b/grub-core/osdep/linux/platform.c
++@@ -19,10 +19,12 @@
++ #include <config.h>
++
++ #include <grub/util/install.h>
+++#include <grub/emu/config.h>
++ #include <grub/emu/exec.h>
++ #include <grub/emu/misc.h>
++ #include <sys/types.h>
++ #include <dirent.h>
+++#include <stdlib.h>
++ #include <string.h>
++
++ #include <sys/utsname.h>
++@@ -128,9 +130,24 @@ const char *
++ grub_install_get_default_arm_platform (void)
++ {
++ if (is_efi_system())
++- return "arm-efi";
++- else
++- return "arm-uboot";
+++ {
+++ const char *pkglibdir = grub_util_get_pkglibdir ();
+++ const char *platform;
+++ char *pd;
+++ int found;
+++
+++ platform = "arm-efi";
+++
+++ pd = grub_util_path_concat (2, pkglibdir, platform);
+++ found = grub_util_is_directory (pd);
+++ free (pd);
+++ if (found)
+++ return platform;
+++ else
+++ grub_util_info ("... but %s platform not available", platform);
+++ }
+++
+++ return "arm-uboot";
++ }
++
++ const char *
++@@ -138,10 +155,23 @@ grub_install_get_default_x86_platform (void)
++ {
++ if (is_efi_system())
++ {
+++ const char *pkglibdir = grub_util_get_pkglibdir ();
+++ const char *platform;
+++ char *pd;
+++ int found;
+++
++ if (read_platform_size() == 64)
++- return "x86_64-efi";
+++ platform = "x86_64-efi";
+++ else
+++ platform = "i386-efi";
+++
+++ pd = grub_util_path_concat (2, pkglibdir, platform);
+++ found = grub_util_is_directory (pd);
+++ free (pd);
+++ if (found)
+++ return platform;
++ else
++- return "i386-efi";
+++ grub_util_info ("... but %s platform not available", platform);
++ }
++
++ grub_util_info ("Looking for /proc/device-tree ..");
--- /dev/null
--- /dev/null
++From b0ce69ebf1a5e85969a358f49b67b84db500bec8 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:27 +0000
++Subject: Cope with Kubuntu setting GRUB_DISTRIBUTOR
++
++This is not a very good approach, and certainly not sanely upstreamable;
++we probably need to split GRUB_DISTRIBUTOR into a couple of different
++variables.
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/1242417
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: install-efi-ubuntu-flavours.patch
++---
++ util/grub-install.c | 2 ++
++ 1 file changed, 2 insertions(+)
++
++diff --git a/util/grub-install.c b/util/grub-install.c
++index b0c7c7c37..e5e9e439d 100644
++--- a/util/grub-install.c
+++++ b/util/grub-install.c
++@@ -1115,6 +1115,8 @@ main (int argc, char *argv[])
++ */
++ char *t;
++ efi_distributor = bootloader_id;
+++ if (strcmp (efi_distributor, "kubuntu") == 0)
+++ efi_distributor = "ubuntu";
++ switch (platform)
++ {
++ case GRUB_INSTALL_PLATFORM_I386_EFI:
--- /dev/null
--- /dev/null
++From c19186b6c1d4cc2ea8a8848a6ffcf810a36e5574 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:07 +0000
++Subject: Prefer translations from Ubuntu language packs if available
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/537998
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: install-locale-langpack.patch
++---
++ util/grub-install-common.c | 37 ++++++++++++++++++++++++++++++-------
++ 1 file changed, 30 insertions(+), 7 deletions(-)
++
++diff --git a/util/grub-install-common.c b/util/grub-install-common.c
++index ca0ac612a..fdfe2c7ea 100644
++--- a/util/grub-install-common.c
+++++ b/util/grub-install-common.c
++@@ -609,17 +609,25 @@ get_localedir (void)
++ }
++
++ static void
++-copy_locales (const char *dstd)
+++copy_locales (const char *dstd, int langpack)
++ {
++ grub_util_fd_dir_t d;
++ grub_util_fd_dirent_t de;
++ const char *locale_dir = get_localedir ();
+++ char *dir;
++
++- d = grub_util_fd_opendir (locale_dir);
+++ if (langpack)
+++ dir = xasprintf ("%s-langpack", locale_dir);
+++ else
+++ dir = xstrdup (locale_dir);
+++
+++ d = grub_util_fd_opendir (dir);
++ if (!d)
++ {
++- grub_util_warn (_("cannot open directory `%s': %s"),
++- locale_dir, grub_util_fd_strerror ());
+++ if (!langpack)
+++ grub_util_warn (_("cannot open directory `%s': %s"),
+++ dir, grub_util_fd_strerror ());
+++ free (dir);
++ return;
++ }
++
++@@ -636,14 +644,14 @@ copy_locales (const char *dstd)
++ if (ext && (grub_strcmp (ext, ".mo") == 0
++ || grub_strcmp (ext, ".gmo") == 0))
++ {
++- srcf = grub_util_path_concat (2, locale_dir, de->d_name);
+++ srcf = grub_util_path_concat (2, dir, de->d_name);
++ dstf = grub_util_path_concat (2, dstd, de->d_name);
++ ext = grub_strrchr (dstf, '.');
++ grub_strcpy (ext, ".mo");
++ }
++ else
++ {
++- srcf = grub_util_path_concat_ext (4, locale_dir, de->d_name,
+++ srcf = grub_util_path_concat_ext (4, dir, de->d_name,
++ "LC_MESSAGES", PACKAGE, ".mo");
++ dstf = grub_util_path_concat_ext (2, dstd, de->d_name, ".mo");
++ }
++@@ -652,6 +660,7 @@ copy_locales (const char *dstd)
++ free (dstf);
++ }
++ grub_util_fd_closedir (d);
+++ free (dir);
++ }
++ #endif
++
++@@ -670,13 +679,15 @@ grub_install_copy_nls(const char *src __attribute__ ((unused)),
++ {
++ char *srcd = grub_util_path_concat (2, src, "po");
++ copy_by_ext (srcd, dst_locale, ".mo", 0);
++- copy_locales (dst_locale);
+++ copy_locales (dst_locale, 0);
+++ copy_locales (dst_locale, 1);
++ free (srcd);
++ }
++ else
++ {
++ size_t i;
++ const char *locale_dir = get_localedir ();
+++ char *locale_langpack_dir = xasprintf ("%s-langpack", locale_dir);
++
++ for (i = 0; i < install_locales.n_entries; i++)
++ {
++@@ -693,6 +704,16 @@ grub_install_copy_nls(const char *src __attribute__ ((unused)),
++ continue;
++ }
++ free (srcf);
+++ srcf = grub_util_path_concat_ext (4, locale_langpack_dir,
+++ install_locales.entries[i],
+++ "LC_MESSAGES", PACKAGE, ".mo");
+++ if (grub_install_compress_file (srcf, dstf, 0))
+++ {
+++ free (srcf);
+++ free (dstf);
+++ continue;
+++ }
+++ free (srcf);
++ srcf = grub_util_path_concat_ext (4, locale_dir,
++ install_locales.entries[i],
++ "LC_MESSAGES", PACKAGE, ".mo");
++@@ -702,6 +723,8 @@ grub_install_copy_nls(const char *src __attribute__ ((unused)),
++ free (srcf);
++ free (dstf);
++ }
+++
+++ free (locale_langpack_dir);
++ }
++ free (dst_locale);
++ #endif
--- /dev/null
--- /dev/null
++From 3bfd737c83dad19e527ffd65698c477ada2bdd3c Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Tue, 28 Jan 2014 14:40:02 +0000
++Subject: Port yaboot logic for various powerpc machine types
++
++Some powerpc machines require not updating the NVRAM. This can be handled
++by existing grub-install command-line options, but it's friendlier to detect
++this automatically.
++
++On chrp_ibm machines, use the nvram utility rather than nvsetenv. (This
++is possibly suitable for other machines too, but that needs to be
++verified.)
++
++Forwarded: no
++Last-Update: 2014-10-15
++
++Patch-Name: install-powerpc-machtypes.patch
++---
++ grub-core/osdep/basic/platform.c | 5 +++
++ grub-core/osdep/linux/platform.c | 72 ++++++++++++++++++++++++++++++
++ grub-core/osdep/unix/platform.c | 28 +++++++++---
++ grub-core/osdep/windows/platform.c | 6 +++
++ include/grub/util/install.h | 3 ++
++ util/grub-install.c | 11 +++++
++ 6 files changed, 119 insertions(+), 6 deletions(-)
++
++diff --git a/grub-core/osdep/basic/platform.c b/grub-core/osdep/basic/platform.c
++index a7dafd85a..6c293ed2d 100644
++--- a/grub-core/osdep/basic/platform.c
+++++ b/grub-core/osdep/basic/platform.c
++@@ -30,3 +30,8 @@ grub_install_get_default_x86_platform (void)
++ return "i386-pc";
++ }
++
+++const char *
+++grub_install_get_default_powerpc_machtype (void)
+++{
+++ return "generic";
+++}
++diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c
++index 2e7f72086..5b37366d4 100644
++--- a/grub-core/osdep/linux/platform.c
+++++ b/grub-core/osdep/linux/platform.c
++@@ -24,6 +24,7 @@
++ #include <grub/emu/misc.h>
++ #include <sys/types.h>
++ #include <dirent.h>
+++#include <stdio.h>
++ #include <stdlib.h>
++ #include <string.h>
++
++@@ -184,3 +185,74 @@ grub_install_get_default_x86_platform (void)
++ grub_util_info ("... not found");
++ return "i386-pc";
++ }
+++
+++const char *
+++grub_install_get_default_powerpc_machtype (void)
+++{
+++ FILE *fp;
+++ char *buf = NULL;
+++ size_t len = 0;
+++ const char *machtype = "generic";
+++
+++ fp = grub_util_fopen ("/proc/cpuinfo", "r");
+++ if (! fp)
+++ return machtype;
+++
+++ while (getline (&buf, &len, fp) > 0)
+++ {
+++ if (strncmp (buf, "pmac-generation",
+++ sizeof ("pmac-generation") - 1) == 0)
+++ {
+++ if (strstr (buf, "NewWorld"))
+++ {
+++ machtype = "pmac_newworld";
+++ break;
+++ }
+++ if (strstr (buf, "OldWorld"))
+++ {
+++ machtype = "pmac_oldworld";
+++ break;
+++ }
+++ }
+++
+++ if (strncmp (buf, "motherboard", sizeof ("motherboard") - 1) == 0 &&
+++ strstr (buf, "AAPL"))
+++ {
+++ machtype = "pmac_oldworld";
+++ break;
+++ }
+++
+++ if (strncmp (buf, "machine", sizeof ("machine") - 1) == 0 &&
+++ strstr (buf, "CHRP IBM"))
+++ {
+++ if (strstr (buf, "qemu"))
+++ {
+++ machtype = "chrp_ibm_qemu";
+++ break;
+++ }
+++ else
+++ {
+++ machtype = "chrp_ibm";
+++ break;
+++ }
+++ }
+++
+++ if (strncmp (buf, "platform", sizeof ("platform") - 1) == 0)
+++ {
+++ if (strstr (buf, "Maple"))
+++ {
+++ machtype = "maple";
+++ break;
+++ }
+++ if (strstr (buf, "Cell"))
+++ {
+++ machtype = "cell";
+++ break;
+++ }
+++ }
+++ }
+++
+++ free (buf);
+++ fclose (fp);
+++ return machtype;
+++}
++diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c
++index 55b8f4016..9c439326a 100644
++--- a/grub-core/osdep/unix/platform.c
+++++ b/grub-core/osdep/unix/platform.c
++@@ -218,13 +218,29 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device,
++ else
++ boot_device = get_ofpathname (install_device);
++
++- if (grub_util_exec ((const char * []){ "nvsetenv", "boot-device",
++- boot_device, NULL }))
+++ if (strcmp (grub_install_get_default_powerpc_machtype (), "chrp_ibm") == 0)
++ {
++- char *cmd = xasprintf ("setenv boot-device %s", boot_device);
++- grub_util_error (_("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"),
++- cmd);
++- free (cmd);
+++ char *arg = xasprintf ("boot-device=%s", boot_device);
+++ if (grub_util_exec ((const char * []){ "nvram",
+++ "--update-config", arg, NULL }))
+++ {
+++ char *cmd = xasprintf ("setenv boot-device %s", boot_device);
+++ grub_util_error (_("`nvram' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"),
+++ cmd);
+++ free (cmd);
+++ }
+++ free (arg);
+++ }
+++ else
+++ {
+++ if (grub_util_exec ((const char * []){ "nvsetenv", "boot-device",
+++ boot_device, NULL }))
+++ {
+++ char *cmd = xasprintf ("setenv boot-device %s", boot_device);
+++ grub_util_error (_("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"),
+++ cmd);
+++ free (cmd);
+++ }
++ }
++
++ free (boot_device);
++diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
++index 7eb53fe01..e19a3d9a8 100644
++--- a/grub-core/osdep/windows/platform.c
+++++ b/grub-core/osdep/windows/platform.c
++@@ -128,6 +128,12 @@ grub_install_get_default_x86_platform (void)
++ return "i386-efi";
++ }
++
+++const char *
+++grub_install_get_default_powerpc_machtype (void)
+++{
+++ return "generic";
+++}
+++
++ static void *
++ get_efi_variable (const wchar_t *varname, ssize_t *len)
++ {
++diff --git a/include/grub/util/install.h b/include/grub/util/install.h
++index 2631b1074..8aeb5c4f2 100644
++--- a/include/grub/util/install.h
+++++ b/include/grub/util/install.h
++@@ -216,6 +216,9 @@ grub_install_get_default_arm_platform (void);
++ const char *
++ grub_install_get_default_x86_platform (void);
++
+++const char *
+++grub_install_get_default_powerpc_machtype (void);
+++
++ int
++ grub_install_register_efi (grub_device_t efidir_grub_dev,
++ const char *efifile_path,
++diff --git a/util/grub-install.c b/util/grub-install.c
++index e5e9e439d..73c623107 100644
++--- a/util/grub-install.c
+++++ b/util/grub-install.c
++@@ -1177,7 +1177,18 @@ main (int argc, char *argv[])
++
++ if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
++ {
+++ const char *machtype = grub_install_get_default_powerpc_machtype ();
++ int is_guess = 0;
+++
+++ if (strcmp (machtype, "pmac_oldworld") == 0)
+++ update_nvram = 0;
+++ else if (strcmp (machtype, "cell") == 0)
+++ update_nvram = 0;
+++ else if (strcmp (machtype, "generic") == 0)
+++ update_nvram = 0;
+++ else if (strcmp (machtype, "chrp_ibm_qemu") == 0)
+++ update_nvram = 0;
+++
++ if (!macppcdir)
++ {
++ char *d;
--- /dev/null
--- /dev/null
++From a07d946a0bed7c81e71e713a920acf2b58f9c812 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:22 +0000
++Subject: Install signed images if UEFI Secure Boot is enabled
++MIME-Version: 1.0
++Content-Type: text/plain; charset=UTF-8
++Content-Transfer-Encoding: 8bit
++
++Author: Stéphane Graber <stgraber@ubuntu.com>
++Author: Steve Langasek <steve.langasek@ubuntu.com>
++Author: Linn Crosetto <linn@hpe.com>
++Author: Mathieu Trudel-Lapierre <cyphermox@ubuntu.com>
++Forwarded: no
++Last-Update: 2016-11-01
++
++Patch-Name: install-signed.patch
++---
++ util/grub-install.c | 212 ++++++++++++++++++++++++++++++++------------
++ 1 file changed, 153 insertions(+), 59 deletions(-)
++
++diff --git a/util/grub-install.c b/util/grub-install.c
++index 3b4606eef..b0c7c7c37 100644
++--- a/util/grub-install.c
+++++ b/util/grub-install.c
++@@ -80,6 +80,7 @@ static char *label_color;
++ static char *label_bgcolor;
++ static char *product_version;
++ static int add_rs_codes = 1;
+++static int uefi_secure_boot = 1;
++
++ enum
++ {
++@@ -110,7 +111,9 @@ enum
++ OPTION_LABEL_FONT,
++ OPTION_LABEL_COLOR,
++ OPTION_LABEL_BGCOLOR,
++- OPTION_PRODUCT_VERSION
+++ OPTION_PRODUCT_VERSION,
+++ OPTION_UEFI_SECURE_BOOT,
+++ OPTION_NO_UEFI_SECURE_BOOT
++ };
++
++ static int fs_probe = 1;
++@@ -234,6 +237,14 @@ argp_parser (int key, char *arg, struct argp_state *state)
++ bootloader_id = xstrdup (arg);
++ return 0;
++
+++ case OPTION_UEFI_SECURE_BOOT:
+++ uefi_secure_boot = 1;
+++ return 0;
+++
+++ case OPTION_NO_UEFI_SECURE_BOOT:
+++ uefi_secure_boot = 0;
+++ return 0;
+++
++ case ARGP_KEY_ARG:
++ if (install_device)
++ grub_util_error ("%s", _("More than one install device?"));
++@@ -303,6 +314,14 @@ static struct argp_option options[] = {
++ {"label-color", OPTION_LABEL_COLOR, N_("COLOR"), 0, N_("use COLOR for label"), 2},
++ {"label-bgcolor", OPTION_LABEL_BGCOLOR, N_("COLOR"), 0, N_("use COLOR for label background"), 2},
++ {"product-version", OPTION_PRODUCT_VERSION, N_("STRING"), 0, N_("use STRING as product version"), 2},
+++ {"uefi-secure-boot", OPTION_UEFI_SECURE_BOOT, 0, 0,
+++ N_("install an image usable with UEFI Secure Boot. "
+++ "This option is only available on EFI and if the grub-efi-amd64-signed "
+++ "package is installed."), 2},
+++ {"no-uefi-secure-boot", OPTION_NO_UEFI_SECURE_BOOT, 0, 0,
+++ N_("do not install an image usable with UEFI Secure Boot, even if the "
+++ "system was currently started using it. "
+++ "This option is only available on EFI."), 2},
++ {0, 0, 0, 0, 0, 0}
++ };
++
++@@ -825,7 +844,8 @@ main (int argc, char *argv[])
++ {
++ int is_efi = 0;
++ const char *efi_distributor = NULL;
++- const char *efi_file = NULL;
+++ const char *efi_suffix = NULL, *efi_suffix_upper = NULL;
+++ char *efi_file = NULL;
++ char **grub_devices;
++ grub_fs_t grub_fs;
++ grub_device_t grub_dev = NULL;
++@@ -1095,6 +1115,39 @@ main (int argc, char *argv[])
++ */
++ char *t;
++ efi_distributor = bootloader_id;
+++ switch (platform)
+++ {
+++ case GRUB_INSTALL_PLATFORM_I386_EFI:
+++ efi_suffix = "ia32";
+++ efi_suffix_upper = "IA32";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_X86_64_EFI:
+++ efi_suffix = "x64";
+++ efi_suffix_upper = "X64";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_IA64_EFI:
+++ efi_suffix = "ia64";
+++ efi_suffix_upper = "IA64";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_ARM_EFI:
+++ efi_suffix = "arm";
+++ efi_suffix_upper = "ARM";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_ARM64_EFI:
+++ efi_suffix = "aa64";
+++ efi_suffix_upper = "AA64";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_RISCV32_EFI:
+++ efi_suffix = "riscv32";
+++ efi_suffix_upper = "RISCV32";
+++ break;
+++ case GRUB_INSTALL_PLATFORM_RISCV64_EFI:
+++ efi_suffix = "riscv64";
+++ efi_suffix_upper = "RISCV64";
+++ break;
+++ default:
+++ break;
+++ }
++ if (removable)
++ {
++ /* The specification makes stricter requirements of removable
++@@ -1103,66 +1156,16 @@ main (int argc, char *argv[])
++ must have a specific file name depending on the architecture.
++ */
++ efi_distributor = "BOOT";
++- switch (platform)
++- {
++- case GRUB_INSTALL_PLATFORM_I386_EFI:
++- efi_file = "BOOTIA32.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_X86_64_EFI:
++- efi_file = "BOOTX64.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_IA64_EFI:
++- efi_file = "BOOTIA64.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_ARM_EFI:
++- efi_file = "BOOTARM.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_ARM64_EFI:
++- efi_file = "BOOTAA64.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_RISCV32_EFI:
++- efi_file = "BOOTRISCV32.EFI";
++- break;
++- case GRUB_INSTALL_PLATFORM_RISCV64_EFI:
++- efi_file = "BOOTRISCV64.EFI";
++- break;
++- default:
++- grub_util_error ("%s", _("You've found a bug"));
++- break;
++- }
+++ if (!efi_suffix)
+++ grub_util_error ("%s", _("You've found a bug"));
+++ efi_file = xasprintf ("BOOT%s.EFI", efi_suffix_upper);
++ }
++ else
++ {
++ /* It is convenient for each architecture to have a different
++ efi_file, so that different versions can be installed in parallel.
++ */
++- switch (platform)
++- {
++- case GRUB_INSTALL_PLATFORM_I386_EFI:
++- efi_file = "grubia32.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_X86_64_EFI:
++- efi_file = "grubx64.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_IA64_EFI:
++- efi_file = "grubia64.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_ARM_EFI:
++- efi_file = "grubarm.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_ARM64_EFI:
++- efi_file = "grubaa64.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_RISCV32_EFI:
++- efi_file = "grubriscv32.efi";
++- break;
++- case GRUB_INSTALL_PLATFORM_RISCV64_EFI:
++- efi_file = "grubriscv64.efi";
++- break;
++- default:
++- efi_file = "grub.efi";
++- break;
++- }
+++ efi_file = xasprintf ("grub%s.efi", efi_suffix);
++ }
++ t = grub_util_path_concat (3, efidir, "EFI", efi_distributor);
++ free (efidir);
++@@ -1368,14 +1371,41 @@ main (int argc, char *argv[])
++ }
++ }
++
++- if (!have_abstractions)
+++ char *efi_signed = NULL;
+++ switch (platform)
+++ {
+++ case GRUB_INSTALL_PLATFORM_I386_EFI:
+++ case GRUB_INSTALL_PLATFORM_X86_64_EFI:
+++ case GRUB_INSTALL_PLATFORM_ARM_EFI:
+++ case GRUB_INSTALL_PLATFORM_ARM64_EFI:
+++ case GRUB_INSTALL_PLATFORM_IA64_EFI:
+++ {
+++ char *dir = xasprintf ("%s-signed", grub_install_source_directory);
+++ char *signed_image;
+++ if (removable)
+++ signed_image = xasprintf ("gcd%s.efi.signed", efi_suffix);
+++ else
+++ signed_image = xasprintf ("grub%s.efi.signed", efi_suffix);
+++ efi_signed = grub_util_path_concat (2, dir, signed_image);
+++ break;
+++ }
+++
+++ default:
+++ break;
+++ }
+++
+++ if (!efi_signed || !grub_util_is_regular (efi_signed))
+++ uefi_secure_boot = 0;
+++
+++ if (!have_abstractions || uefi_secure_boot)
++ {
++ if ((disk_module && grub_strcmp (disk_module, "biosdisk") != 0)
++ || grub_drives[1]
++ || (!install_drive
++ && platform != GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
++ || (install_drive && !is_same_disk (grub_drives[0], install_drive))
++- || !have_bootdev (platform))
+++ || !have_bootdev (platform)
+++ || uefi_secure_boot)
++ {
++ char *uuid = NULL;
++ /* generic method (used on coreboot and ata mod). */
++@@ -1916,7 +1946,71 @@ main (int argc, char *argv[])
++ case GRUB_INSTALL_PLATFORM_IA64_EFI:
++ {
++ char *dst = grub_util_path_concat (2, efidir, efi_file);
++- grub_install_copy_file (imgfile, dst, 1);
+++ if (uefi_secure_boot)
+++ {
+++ char *shim_signed = NULL;
+++ char *mok_signed = NULL, *mok_file = NULL;
+++ char *fb_signed = NULL, *fb_file = NULL;
+++ char *config_dst;
+++ FILE *config_dst_f;
+++
+++ shim_signed = xasprintf ("/usr/lib/shim/shim%s.efi.signed", efi_suffix);
+++ mok_signed = xasprintf ("mm%s.efi.signed", efi_suffix);
+++ mok_file = xasprintf ("mm%s.efi", efi_suffix);
+++ fb_signed = xasprintf ("fb%s.efi.signed", efi_suffix);
+++ fb_file = xasprintf ("fb%s.efi", efi_suffix);
+++
+++ if (grub_util_is_regular (shim_signed))
+++ {
+++ char *chained_base, *chained_dst;
+++ char *mok_src, *mok_dst, *fb_src, *fb_dst;
+++ if (!removable)
+++ {
+++ free (efi_file);
+++ efi_file = xasprintf ("shim%s.efi", efi_suffix);
+++ free (dst);
+++ dst = grub_util_path_concat (2, efidir, efi_file);
+++ }
+++ grub_install_copy_file (shim_signed, dst, 1);
+++ chained_base = xasprintf ("grub%s.efi", efi_suffix);
+++ chained_dst = grub_util_path_concat (2, efidir, chained_base);
+++ grub_install_copy_file (efi_signed, chained_dst, 1);
+++ free (chained_dst);
+++ free (chained_base);
+++
+++ /* Not critical, so not an error if they are not present (as it
+++ won't be for older releases); but if we have them, make
+++ sure they are installed. */
+++ mok_src = grub_util_path_concat (2, "/usr/lib/shim/",
+++ mok_signed);
+++ mok_dst = grub_util_path_concat (2, efidir,
+++ mok_file);
+++ grub_install_copy_file (mok_src,
+++ mok_dst, 0);
+++ free (mok_src);
+++ free (mok_dst);
+++
+++ fb_src = grub_util_path_concat (2, "/usr/lib/shim/",
+++ fb_signed);
+++ fb_dst = grub_util_path_concat (2, efidir,
+++ fb_file);
+++ grub_install_copy_file (fb_src,
+++ fb_dst, 0);
+++ free (fb_src);
+++ free (fb_dst);
+++ }
+++ else
+++ grub_install_copy_file (efi_signed, dst, 1);
+++
+++ config_dst = grub_util_path_concat (2, efidir, "grub.cfg");
+++ grub_install_copy_file (load_cfg, config_dst, 1);
+++ config_dst_f = grub_util_fopen (config_dst, "ab");
+++ fprintf (config_dst_f, "configfile $prefix/grub.cfg\n");
+++ fclose (config_dst_f);
+++ free (config_dst);
+++ }
+++ else
+++ grub_install_copy_file (imgfile, dst, 1);
++ free (dst);
++ }
++ if (!removable && update_nvram)
--- /dev/null
--- /dev/null
++From a01550b68bb3240d88b86f4fcf4ffc77e4bb2095 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:58 +0000
++Subject: If GRUB Legacy is still around, tell packaging to ignore it
++
++Bug-Debian: http://bugs.debian.org/586143
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: install-stage2-confusion.patch
++---
++ util/grub-install.c | 14 ++++++++++++++
++ 1 file changed, 14 insertions(+)
++
++diff --git a/util/grub-install.c b/util/grub-install.c
++index 8a55ad4b8..3b4606eef 100644
++--- a/util/grub-install.c
+++++ b/util/grub-install.c
++@@ -42,6 +42,7 @@
++ #include <grub/emu/config.h>
++ #include <grub/util/ofpath.h>
++ #include <grub/hfsplus.h>
+++#include <grub/emu/hostfile.h>
++
++ #include <string.h>
++
++@@ -1714,6 +1715,19 @@ main (int argc, char *argv[])
++ grub_util_bios_setup (platdir, "boot.img", "core.img",
++ install_drive, force,
++ fs_probe, allow_floppy, add_rs_codes);
+++
+++ /* If vestiges of GRUB Legacy still exist, tell the Debian packaging
+++ that they can ignore them. */
+++ if (!rootdir && grub_util_is_regular ("/boot/grub/stage2") &&
+++ grub_util_is_regular ("/boot/grub/menu.lst"))
+++ {
+++ grub_util_fd_t fd;
+++
+++ fd = grub_util_fd_open ("/boot/grub/grub2-installed",
+++ GRUB_UTIL_FD_O_WRONLY);
+++ grub_util_fd_close (fd);
+++ }
+++
++ break;
++ }
++ case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
--- /dev/null
- From 614ea0626131fc49f82d80e6459a200b8bc8e591 Mon Sep 17 00:00:00 2001
++From 07aa820944e43e3e01a4ce9fcadd907e6986df73 Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <mjg59@google.com>
+Date: Wed, 5 Dec 2018 15:07:21 -0800
+Subject: Don't enforce Shim signature validation if Secure Boot is disabled
+
+The linuxefi command fails if used on a system without shim, even if
+Secure Boot is disabled. There's no need to do the validation if we're
+not in Secure Boot mode (an attacker could just boot a modified grub),
+so skip this to make it easier to use the Linux EFI entry point even on
+non-Secure Boot systems.
+
+Last-Update: 2018-12-07
+
+Patch-Name: linuxefi-skip-validation-without-secure-boot.patch
+---
+ grub-core/loader/i386/efi/linux.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
- index c2d77510f..0f4b0b4ab 100644
++index 7d94369be..34605dfed 100644
+--- a/grub-core/loader/i386/efi/linux.c
++++ b/grub-core/loader/i386/efi/linux.c
- @@ -58,6 +58,12 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
++@@ -59,6 +59,12 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
+ grub_efi_shim_lock_t *shim_lock;
+ grub_efi_status_t status;
+
++ if (! grub_efi_secure_boot())
++ {
++ grub_dprintf ("linuxefi", "secure boot not enabled, not validating");
++ return 1;
++ }
++
+ grub_dprintf ("linuxefi", "Locating shim protocol\n");
+ shim_lock = grub_efi_locate_protocol(&guid, NULL);
+
--- /dev/null
--- /dev/null
++From 153f7d223ea89a53e014ce57b5438de593ad1947 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:20 +0000
++Subject: If running under UEFI secure boot, use linuxefi loader
++
++If linuxefi fails to verify the kernel's signature, then refuse to boot.
++
++Author: Steve Langasek <steve.langasek@canonical.com>
++Author: Linn Crosetto <linn@hpe.com>
++Forwarded: no
++Last-Update: 2019-05-24
++
++Patch-Name: linuxefi-use-if-secure-boot.patch
++---
++ grub-core/loader/i386/efi/linux.c | 2 +-
++ grub-core/loader/i386/linux.c | 41 +++++++++++++++++++++++++++++++
++ 2 files changed, 42 insertions(+), 1 deletion(-)
++
++diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
++index dd376ce03..b731b9201 100644
++--- a/grub-core/loader/i386/efi/linux.c
+++++ b/grub-core/loader/i386/efi/linux.c
++@@ -208,7 +208,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
++
++ if (! grub_linuxefi_secure_validate (kernel, filelen))
++ {
++- grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]);
+++ grub_error (GRUB_ERR_ACCESS_DENIED, N_("%s has invalid signature"), argv[0]);
++ grub_free (kernel);
++ goto fail;
++ }
++diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
++index d0501e229..2eab9bb10 100644
++--- a/grub-core/loader/i386/linux.c
+++++ b/grub-core/loader/i386/linux.c
++@@ -76,6 +76,8 @@ static grub_size_t maximal_cmdline_size;
++ static struct linux_kernel_params linux_params;
++ static char *linux_cmdline;
++ #ifdef GRUB_MACHINE_EFI
+++static int using_linuxefi;
+++static grub_command_t initrdefi_cmd;
++ static grub_efi_uintn_t efi_mmap_size;
++ #else
++ static const grub_size_t efi_mmap_size = 0;
++@@ -651,6 +653,39 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
++
++ grub_dl_ref (my_mod);
++
+++#ifdef GRUB_MACHINE_EFI
+++ using_linuxefi = 0;
+++ if (grub_efi_secure_boot ())
+++ {
+++ /* linuxefi requires a successful signature check and then hand over
+++ to the kernel without calling ExitBootServices. */
+++ grub_dl_t mod;
+++ grub_command_t linuxefi_cmd;
+++
+++ grub_dprintf ("linux", "Secure Boot enabled: trying linuxefi\n");
+++
+++ mod = grub_dl_load ("linuxefi");
+++ if (mod)
+++ {
+++ grub_dl_ref (mod);
+++ linuxefi_cmd = grub_command_find ("linuxefi");
+++ initrdefi_cmd = grub_command_find ("initrdefi");
+++ if (linuxefi_cmd && initrdefi_cmd)
+++ {
+++ (linuxefi_cmd->func) (linuxefi_cmd, argc, argv);
+++ if (grub_errno == GRUB_ERR_NONE)
+++ {
+++ grub_dprintf ("linux", "Handing off to linuxefi\n");
+++ using_linuxefi = 1;
+++ return GRUB_ERR_NONE;
+++ }
+++ grub_dprintf ("linux", "linuxefi failed (%d)\n", grub_errno);
+++ goto fail;
+++ }
+++ }
+++ }
+++#endif
+++
++ if (argc == 0)
++ {
++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
++@@ -1036,6 +1071,12 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
++ grub_err_t err;
++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 };
++
+++#ifdef GRUB_MACHINE_EFI
+++ /* If we're using linuxefi, just forward to initrdefi. */
+++ if (using_linuxefi && initrdefi_cmd)
+++ return (initrdefi_cmd->func) (initrdefi_cmd, argc, argv);
+++#endif
+++
++ if (argc == 0)
++ {
++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
--- /dev/null
- From 72da0de7449b8eada6a23f9a5e4b48f07955a368 Mon Sep 17 00:00:00 2001
++From 3b2f0fe2c4f9d1f4734ad33d0b57a77e0036a68d Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <mjg@redhat.com>
+Date: Mon, 13 Jan 2014 12:13:15 +0000
+Subject: Add "linuxefi" loader which avoids ExitBootServices
+
+Origin: vendor, http://pkgs.fedoraproject.org/cgit/grub2.git/tree/grub2-linuxefi.patch
+Forwarded: no
- Last-Update: 2016-09-19
++Last-Update: 2019-05-26
+
+Patch-Name: linuxefi.patch
+---
- grub-core/Makefile.core.def | 8 +
++ grub-core/Makefile.core.def | 7 +
+ grub-core/kern/efi/mm.c | 32 +++
- grub-core/loader/i386/efi/linux.c | 371 ++++++++++++++++++++++++++++++
++ grub-core/loader/i386/efi/linux.c | 375 ++++++++++++++++++++++++++++++
+ include/grub/efi/efi.h | 3 +
- include/grub/i386/linux.h | 1 +
- 5 files changed, 415 insertions(+)
++ 4 files changed, 417 insertions(+)
+ 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 2dfa22a92..68e47a727 100644
++index 474a63e68..67a98abbb 100644
+--- a/grub-core/Makefile.core.def
++++ b/grub-core/Makefile.core.def
- @@ -1733,6 +1733,14 @@ module = {
++@@ -1849,6 +1849,13 @@ module = {
+ enable = x86_64_efi;
+ };
+
++module = {
++ name = linuxefi;
++ efi = loader/i386/efi/linux.c;
- + efi = lib/cmdline.c;
++ enable = i386_efi;
++ enable = x86_64_efi;
++};
++
+ module = {
+ name = chain;
+ efi = loader/efi/chainloader.c;
+diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
- index 20a47aaf5..efb15cc1b 100644
++index b02fab1b1..a9e37108c 100644
+--- a/grub-core/kern/efi/mm.c
++++ b/grub-core/kern/efi/mm.c
- @@ -49,6 +49,38 @@ static grub_efi_uintn_t finish_desc_size;
- static grub_efi_uint32_t finish_desc_version;
- int grub_efi_is_finished = 0;
++@@ -113,6 +113,38 @@ grub_efi_drop_alloc (grub_efi_physical_address_t address,
++ }
++ }
+
++/* Allocate pages below a specified address */
++void *
++grub_efi_allocate_pages_max (grub_efi_physical_address_t max,
++ grub_efi_uintn_t pages)
++{
++ grub_efi_status_t status;
++ grub_efi_boot_services_t *b;
++ grub_efi_physical_address_t address = max;
++
++ if (max > 0xffffffff)
++ return 0;
++
++ b = grub_efi_system_table->boot_services;
++ status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address);
++
++ if (status != GRUB_EFI_SUCCESS)
++ return 0;
++
++ if (address == 0)
++ {
++ /* Uggh, the address 0 was allocated... This is too annoying,
++ so reallocate another one. */
++ address = max;
++ status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address);
++ grub_efi_free_pages (0, pages);
++ if (status != GRUB_EFI_SUCCESS)
++ return 0;
++ }
++
++ return (void *) ((grub_addr_t) address);
++}
++
+ /* Allocate pages. Return the pointer to the first of allocated pages. */
+ void *
- grub_efi_allocate_pages (grub_efi_physical_address_t address,
++ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
+diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
+new file mode 100644
- index 000000000..b622b3b71
++index 000000000..dd376ce03
+--- /dev/null
++++ b/grub-core/loader/i386/efi/linux.c
- @@ -0,0 +1,371 @@
++@@ -0,0 +1,375 @@
++/*
++ * GRUB -- GRand Unified Bootloader
++ * Copyright (C) 2012 Free Software Foundation, Inc.
++ *
++ * GRUB is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * GRUB is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <grub/loader.h>
++#include <grub/file.h>
++#include <grub/err.h>
+++#include <grub/misc.h>
++#include <grub/types.h>
++#include <grub/mm.h>
++#include <grub/cpu/linux.h>
++#include <grub/command.h>
++#include <grub/i18n.h>
++#include <grub/lib/cmdline.h>
+++#include <grub/linux.h>
++#include <grub/efi/efi.h>
++
++GRUB_MOD_LICENSE ("GPLv3+");
++
++static grub_dl_t my_mod;
++static int loaded;
++static void *kernel_mem;
++static grub_uint64_t kernel_size;
++static grub_uint8_t *initrd_mem;
++static grub_uint32_t handover_offset;
++struct linux_kernel_params *params;
++static char *linux_cmdline;
++
++#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12)
++
++#define SHIM_LOCK_GUID \
++ { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
++
++struct grub_efi_shim_lock
++{
++ grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size);
++};
++typedef struct grub_efi_shim_lock grub_efi_shim_lock_t;
++
++static grub_efi_boolean_t
++grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
++{
++ grub_efi_guid_t guid = SHIM_LOCK_GUID;
++ grub_efi_shim_lock_t *shim_lock;
+++ grub_efi_status_t status;
++
+++ grub_dprintf ("linuxefi", "Locating shim protocol\n");
++ shim_lock = grub_efi_locate_protocol(&guid, NULL);
++
++ if (!shim_lock)
- + return 1;
+++ {
+++ grub_dprintf ("linuxefi", "shim not available\n");
+++ return 0;
+++ }
++
- + if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS)
- + return 1;
+++ grub_dprintf ("linuxefi", "Asking shim to verify kernel signature\n");
+++ status = shim_lock->verify(data, size);
+++ if (status == GRUB_EFI_SUCCESS)
+++ {
+++ grub_dprintf ("linuxefi", "Kernel signature verification passed\n");
+++ return 1;
+++ }
++
+++ grub_dprintf ("linuxefi", "Kernel signature verification failed (0x%lx)\n",
+++ (unsigned long) status);
++ return 0;
++}
++
++typedef void(*handover_func)(void *, grub_efi_system_table_t *, struct linux_kernel_params *);
++
++static grub_err_t
++grub_linuxefi_boot (void)
++{
++ handover_func hf;
++ int offset = 0;
++
++#ifdef __x86_64__
++ offset = 512;
++#endif
++
++ hf = (handover_func)((char *)kernel_mem + handover_offset + offset);
++
++ asm volatile ("cli");
++
++ hf (grub_efi_image_handle, grub_efi_system_table, params);
++
++ /* Not reached */
++ return GRUB_ERR_NONE;
++}
++
++static grub_err_t
++grub_linuxefi_unload (void)
++{
++ grub_dl_unref (my_mod);
++ loaded = 0;
++ if (initrd_mem)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size));
++ if (linux_cmdline)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1));
++ if (kernel_mem)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
++ if (params)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)params, BYTES_TO_PAGES(16384));
++ return GRUB_ERR_NONE;
++}
++
++static grub_err_t
++grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
++ int argc, char *argv[])
++{
- + grub_file_t *files = 0;
- + int i, nfiles = 0;
++ grub_size_t size = 0;
- + grub_uint8_t *ptr;
+++ struct grub_linux_initrd_context initrd_ctx;
++
++ if (argc == 0)
++ {
++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
++ goto fail;
++ }
++
++ if (!loaded)
++ {
++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first"));
++ goto fail;
++ }
++
- + files = grub_zalloc (argc * sizeof (files[0]));
- + if (!files)
+++ if (grub_initrd_init (argc, argv, &initrd_ctx))
++ goto fail;
++
- + for (i = 0; i < argc; i++)
- + {
- + grub_file_filter_disable_compression ();
- + files[i] = grub_file_open (argv[i]);
- + if (! files[i])
- + goto fail;
- + nfiles++;
- + size += ALIGN_UP (grub_file_size (files[i]), 4);
- + }
+++ size = grub_get_initrd_size (&initrd_ctx);
++
++ initrd_mem = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(size));
++
++ if (!initrd_mem)
++ {
++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate initrd"));
++ goto fail;
++ }
++
+++ grub_dprintf ("linuxefi", "initrd_mem = %lx\n", (unsigned long) initrd_mem);
+++
++ params->ramdisk_size = size;
++ params->ramdisk_image = (grub_uint32_t)(grub_addr_t) initrd_mem;
++
- + ptr = initrd_mem;
- +
- + for (i = 0; i < nfiles; i++)
- + {
- + grub_ssize_t cursize = grub_file_size (files[i]);
- + if (grub_file_read (files[i], ptr, cursize) != cursize)
- + {
- + if (!grub_errno)
- + grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
- + argv[i]);
- + goto fail;
- + }
- + ptr += cursize;
- + grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4));
- + ptr += ALIGN_UP_OVERHEAD (cursize, 4);
- + }
+++ if (grub_initrd_load (&initrd_ctx, argv, initrd_mem))
+++ goto fail;
++
++ params->ramdisk_size = size;
++
++ fail:
- + for (i = 0; i < nfiles; i++)
- + grub_file_close (files[i]);
- + grub_free (files);
+++ grub_initrd_close (&initrd_ctx);
++
++ if (initrd_mem && grub_errno)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)initrd_mem, BYTES_TO_PAGES(size));
++
++ return grub_errno;
++}
++
++static grub_err_t
++grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
++ int argc, char *argv[])
++{
++ grub_file_t file = 0;
- + struct linux_kernel_header lh;
+++ struct linux_i386_kernel_header lh;
++ grub_ssize_t len, start, filelen;
++ void *kernel;
++
++ grub_dl_ref (my_mod);
++
++ if (argc == 0)
++ {
++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
++ goto fail;
++ }
++
- + file = grub_file_open (argv[0]);
+++ file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
++ if (! file)
++ goto fail;
++
++ filelen = grub_file_size (file);
++
++ kernel = grub_malloc(filelen);
++
++ if (!kernel)
++ {
++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer"));
++ goto fail;
++ }
++
++ if (grub_file_read (file, kernel, filelen) != filelen)
++ {
++ grub_error (GRUB_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), argv[0]);
++ goto fail;
++ }
++
++ if (! grub_linuxefi_secure_validate (kernel, filelen))
++ {
++ grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]);
++ grub_free (kernel);
++ goto fail;
++ }
++
++ grub_file_seek (file, 0);
++
++ grub_free(kernel);
++
++ params = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384));
++
++ if (! params)
++ {
++ grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate kernel parameters");
++ goto fail;
++ }
++
+++ grub_dprintf ("linuxefi", "params = %lx\n", (unsigned long) params);
+++
++ 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;
++ }
++
++ if (lh.boot_flag != grub_cpu_to_le16 (0xaa55))
++ {
++ grub_error (GRUB_ERR_BAD_OS, N_("invalid magic number"));
++ goto fail;
++ }
++
++ if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS)
++ {
++ grub_error (GRUB_ERR_BAD_OS, N_("too many setup sectors"));
++ goto fail;
++ }
++
++ if (lh.version < grub_cpu_to_le16 (0x020b))
++ {
++ grub_error (GRUB_ERR_BAD_OS, N_("kernel too old"));
++ goto fail;
++ }
++
++ if (!lh.handover_offset)
++ {
++ grub_error (GRUB_ERR_BAD_OS, N_("kernel doesn't support EFI handover"));
++ goto fail;
++ }
++
++ linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff,
++ BYTES_TO_PAGES(lh.cmdline_size + 1));
++
++ if (!linux_cmdline)
++ {
++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline"));
++ goto fail;
++ }
++
+++ grub_dprintf ("linuxefi", "linux_cmdline = %lx\n",
+++ (unsigned long) linux_cmdline);
+++
++ grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE));
- + grub_create_loader_cmdline (argc, argv,
- + linux_cmdline + sizeof (LINUX_IMAGE) - 1,
- + lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1));
+++ {
+++ grub_err_t err;
+++ err = grub_create_loader_cmdline (argc, argv,
+++ linux_cmdline
+++ + sizeof (LINUX_IMAGE) - 1,
+++ lh.cmdline_size
+++ - (sizeof (LINUX_IMAGE) - 1),
+++ GRUB_VERIFY_KERNEL_CMDLINE);
+++ if (err)
+++ goto fail;
+++ }
++
++ lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline;
++
++ handover_offset = lh.handover_offset;
++
++ start = (lh.setup_sects + 1) * 512;
++ len = grub_file_size(file) - start;
++
- + kernel_mem = grub_efi_allocate_pages(lh.pref_address,
+++ kernel_mem = grub_efi_allocate_fixed(lh.pref_address,
++ BYTES_TO_PAGES(lh.init_size));
++
++ if (!kernel_mem)
++ kernel_mem = grub_efi_allocate_pages_max(0x3fffffff,
++ BYTES_TO_PAGES(lh.init_size));
++
++ if (!kernel_mem)
++ {
++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate kernel"));
++ goto fail;
++ }
++
+++ grub_dprintf ("linuxefi", "kernel_mem = %lx\n", (unsigned long) kernel_mem);
+++
++ 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;
++ }
++
++ 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_addr_t) kernel_mem;
++ }
++
++ grub_memcpy (params, &lh, 2 * 512);
++
++ params->type_of_loader = 0x21;
++
++ fail:
++
++ if (file)
++ grub_file_close (file);
++
++ if (grub_errno != GRUB_ERR_NONE)
++ {
++ grub_dl_unref (my_mod);
++ loaded = 0;
++ }
++
++ if (linux_cmdline && !loaded)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1));
++
++ if (kernel_mem && !loaded)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
++
++ if (params && !loaded)
++ grub_efi_free_pages((grub_efi_physical_address_t)(grub_addr_t)params, BYTES_TO_PAGES(16384));
++
++ return grub_errno;
++}
++
++static grub_command_t cmd_linux, cmd_initrd;
++
++GRUB_MOD_INIT(linuxefi)
++{
++ cmd_linux =
++ grub_register_command ("linuxefi", grub_cmd_linux,
++ 0, N_("Load Linux."));
++ cmd_initrd =
++ grub_register_command ("initrdefi", grub_cmd_initrd,
++ 0, N_("Load initrd."));
++ my_mod = mod;
++}
++
++GRUB_MOD_FINI(linuxefi)
++{
++ grub_unregister_command (cmd_linux);
++ grub_unregister_command (cmd_initrd);
++}
+diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
- index 5e87950fd..62a3d9726 100644
++index a237952b3..085ee0524 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);
- void *
- EXPORT_FUNC(grub_efi_allocate_pages) (grub_efi_physical_address_t address,
++@@ -47,6 +47,9 @@ EXPORT_FUNC(grub_efi_allocate_fixed) (grub_efi_physical_address_t address,
+ grub_efi_uintn_t pages);
++ void *
++ EXPORT_FUNC(grub_efi_allocate_any_pages) (grub_efi_uintn_t pages);
++void *
++EXPORT_FUNC(grub_efi_allocate_pages_max) (grub_efi_physical_address_t max,
++ grub_efi_uintn_t pages);
+ void EXPORT_FUNC(grub_efi_free_pages) (grub_efi_physical_address_t address,
+ grub_efi_uintn_t pages);
- int
- diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h
- index da0ca3b83..fc36bdaf3 100644
- --- a/include/grub/i386/linux.h
- +++ b/include/grub/i386/linux.h
- @@ -139,6 +139,7 @@ struct linux_kernel_header
- grub_uint64_t setup_data;
- grub_uint64_t pref_address;
- grub_uint32_t init_size;
- + grub_uint32_t handover_offset;
- } GRUB_PACKED;
-
- /* Boot parameters for Linux based on 2.6.12. This is used by the setup
++ grub_efi_uintn_t EXPORT_FUNC(grub_efi_find_mmap_size) (void);
--- /dev/null
--- /dev/null
++From 81c13db420ab11ac368e02b0fe67ae1f871c3c76 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:26 +0000
++Subject: Add configure option to reduce visual clutter at boot time
++
++If this option is enabled, then do all of the following:
++
++Don't display introductory message about line editing unless we're
++actually offering a shell prompt. (This is believed to be a workaround
++for a different bug. We'll go with this for now, but will drop this in
++favour of a better fix upstream if somebody figures out what that is.)
++
++Don't clear the screen just before booting if we never drew the menu in
++the first place.
++
++Remove verbose messages printed before reading configuration. In some
++ways this is awkward because it makes debugging harder, but it's a
++requirement for a smooth-looking boot process; we may be able to do
++better in future. Upstream doesn't want this, though.
++
++Disable the cursor as well, for similar reasons of tidiness.
++
++Suppress kernel/initrd progress messages, except in recovery mode.
++
++Suppress "GRUB loading" message unless Shift is held down. Upstream
++doesn't want this, as it makes debugging harder. Ubuntu wants it to
++provide a cleaner boot experience.
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/386922
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/861048
++Forwarded: (partial) http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00056.html
++Last-Update: 2019-05-24
++
++Patch-Name: maybe-quiet.patch
++---
++ config.h.in | 2 ++
++ configure.ac | 16 ++++++++++++++++
++ grub-core/boot/i386/pc/boot.S | 11 +++++++++++
++ grub-core/boot/i386/pc/diskboot.S | 26 ++++++++++++++++++++++++++
++ grub-core/kern/main.c | 17 +++++++++++++++++
++ grub-core/kern/rescue_reader.c | 2 ++
++ grub-core/normal/main.c | 11 +++++++++++
++ grub-core/normal/menu.c | 17 +++++++++++++++--
++ util/grub.d/10_linux.in | 15 +++++++++++----
++ 9 files changed, 111 insertions(+), 6 deletions(-)
++
++diff --git a/config.h.in b/config.h.in
++index 9e8f9911b..d2c4ce8e5 100644
++--- a/config.h.in
+++++ b/config.h.in
++@@ -12,6 +12,8 @@
++ /* Define to 1 to enable disk cache statistics. */
++ #define DISK_CACHE_STATS @DISK_CACHE_STATS@
++ #define BOOT_TIME_STATS @BOOT_TIME_STATS@
+++/* Define to 1 to make GRUB quieter at boot time. */
+++#define QUIET_BOOT @QUIET_BOOT@
++
++ /* We don't need those. */
++ #define MINILZO_CFG_SKIP_LZO_PTR 1
++diff --git a/configure.ac b/configure.ac
++index 47102bfb5..4ddee8a7c 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1857,6 +1857,17 @@ else
++ fi
++ AC_SUBST([UBUNTU_RECOVERY])
++
+++AC_ARG_ENABLE([quiet-boot],
+++ [AS_HELP_STRING([--enable-quiet-boot],
+++ [emit fewer messages at boot time (default=no)])],
+++ [], [enable_quiet_boot=no])
+++if test x"$enable_quiet_boot" = xyes ; then
+++ QUIET_BOOT=1
+++else
+++ QUIET_BOOT=0
+++fi
+++AC_SUBST([QUIET_BOOT])
+++
++ LIBS=""
++
++ AC_SUBST([FONT_SOURCE])
++@@ -2114,5 +2125,10 @@ echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excus
++ else
++ echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
++ fi
+++if [ x"$enable_quiet_boot" = xyes ]; then
+++echo With quiet boot: Yes
+++else
+++echo With quiet boot: No
+++fi
++ echo "*******************************************************"
++ ]
++diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S
++index 2bd0b2d28..451c8bea5 100644
++--- a/grub-core/boot/i386/pc/boot.S
+++++ b/grub-core/boot/i386/pc/boot.S
++@@ -19,6 +19,9 @@
++
++ #include <grub/symbol.h>
++ #include <grub/machine/boot.h>
+++#if defined(QUIET_BOOT) && !defined(HYBRID_BOOT)
+++#include <grub/machine/memory.h>
+++#endif
++
++ /*
++ * defines for the code go here
++@@ -249,9 +252,17 @@ real_start:
++ /* save drive reference first thing! */
++ pushw %dx
++
+++#if defined(QUIET_BOOT) && !defined(HYBRID_BOOT)
+++ /* is either shift key held down? */
+++ movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx
+++ testb $3, (%bx)
+++ jz 2f
+++#endif
+++
++ /* print a notification message on the screen */
++ MSG(notification_string)
++
+++2:
++ /* set %si to the disk address packet */
++ movw $disk_address_packet, %si
++
++diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S
++index c1addc0df..c6fd50bea 100644
++--- a/grub-core/boot/i386/pc/diskboot.S
+++++ b/grub-core/boot/i386/pc/diskboot.S
++@@ -18,6 +18,9 @@
++
++ #include <grub/symbol.h>
++ #include <grub/machine/boot.h>
+++#ifdef QUIET_BOOT
+++#include <grub/machine/memory.h>
+++#endif
++
++ /*
++ * defines for the code go here
++@@ -25,6 +28,12 @@
++
++ #define MSG(x) movw $x, %si; call LOCAL(message)
++
+++#ifdef QUIET_BOOT
+++#define SILENT(x) call LOCAL(check_silent); jz LOCAL(x)
+++#else
+++#define SILENT(x)
+++#endif
+++
++ .file "diskboot.S"
++
++ .text
++@@ -50,11 +59,14 @@ _start:
++ /* save drive reference first thing! */
++ pushw %dx
++
+++ SILENT(after_notification_string)
+++
++ /* print a notification message on the screen */
++ pushw %si
++ MSG(notification_string)
++ popw %si
++
+++LOCAL(after_notification_string):
++ /* this sets up for the first run through "bootloop" */
++ movw $LOCAL(firstlist), %di
++
++@@ -279,7 +291,10 @@ LOCAL(copy_buffer):
++ /* restore addressing regs and print a dot with correct DS
++ (MSG modifies SI, which is saved, and unused AX and BX) */
++ popw %ds
+++ SILENT(after_notification_step)
++ MSG(notification_step)
+++
+++LOCAL(after_notification_step):
++ popa
++
++ /* check if finished with this dataset */
++@@ -295,8 +310,11 @@ LOCAL(copy_buffer):
++ /* END OF MAIN LOOP */
++
++ LOCAL(bootit):
+++ SILENT(after_notification_done)
++ /* print a newline */
++ MSG(notification_done)
+++
+++LOCAL(after_notification_done):
++ popw %dx /* this makes sure %dl is our "boot" drive */
++ ljmp $0, $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
++
++@@ -320,6 +338,14 @@ LOCAL(general_error):
++ /* go here when you need to stop the machine hard after an error condition */
++ LOCAL(stop): jmp LOCAL(stop)
++
+++#ifdef QUIET_BOOT
+++LOCAL(check_silent):
+++ /* is either shift key held down? */
+++ movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx
+++ testb $3, (%bx)
+++ ret
+++#endif
+++
++ notification_string: .asciz "loading"
++
++ notification_step: .asciz "."
++diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
++index 9cad0c448..5613cd553 100644
++--- a/grub-core/kern/main.c
+++++ b/grub-core/kern/main.c
++@@ -264,15 +264,25 @@ reclaim_module_space (void)
++ void __attribute__ ((noreturn))
++ grub_main (void)
++ {
+++#ifdef QUIET_BOOT
+++ struct grub_term_output *term;
+++#endif
+++
++ /* First of all, initialize the machine. */
++ grub_machine_init ();
++
++ grub_boot_time ("After machine init.");
++
+++#ifdef QUIET_BOOT
+++ /* Disable the cursor until we need it. */
+++ FOR_ACTIVE_TERM_OUTPUTS(term)
+++ grub_term_setcursor (term, 0);
+++#else
++ /* Hello. */
++ grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
++ grub_printf ("Welcome to GRUB!\n\n");
++ grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
+++#endif
++
++ grub_load_config ();
++
++@@ -308,5 +318,12 @@ grub_main (void)
++ grub_boot_time ("After execution of embedded config. Attempt to go to normal mode");
++
++ grub_load_normal_mode ();
+++
+++#ifdef QUIET_BOOT
+++ /* If we have to enter rescue mode, enable the cursor again. */
+++ FOR_ACTIVE_TERM_OUTPUTS(term)
+++ grub_term_setcursor (term, 1);
+++#endif
+++
++ grub_rescue_run ();
++ }
++diff --git a/grub-core/kern/rescue_reader.c b/grub-core/kern/rescue_reader.c
++index dcd7d4439..03826cf63 100644
++--- a/grub-core/kern/rescue_reader.c
+++++ b/grub-core/kern/rescue_reader.c
++@@ -78,7 +78,9 @@ grub_rescue_read_line (char **line, int cont,
++ void __attribute__ ((noreturn))
++ grub_rescue_run (void)
++ {
+++#ifdef QUIET_BOOT
++ grub_printf ("Entering rescue mode...\n");
+++#endif
++
++ while (1)
++ {
++diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
++index 1b03dfd57..7c269a5e4 100644
++--- a/grub-core/normal/main.c
+++++ b/grub-core/normal/main.c
++@@ -389,6 +389,15 @@ static grub_err_t
++ grub_normal_read_line_real (char **line, int cont, int nested)
++ {
++ const char *prompt;
+++#ifdef QUIET_BOOT
+++ static int displayed_intro;
+++
+++ if (! displayed_intro)
+++ {
+++ grub_normal_reader_init (nested);
+++ displayed_intro = 1;
+++ }
+++#endif
++
++ if (cont)
++ /* TRANSLATORS: it's command line prompt. */
++@@ -441,7 +450,9 @@ grub_cmdline_run (int nested, int force_auth)
++ return;
++ }
++
+++#ifndef QUIET_BOOT
++ grub_normal_reader_init (nested);
+++#endif
++
++ while (1)
++ {
++diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
++index 3611ee9ea..bc0f173f6 100644
++--- a/grub-core/normal/menu.c
+++++ b/grub-core/normal/menu.c
++@@ -827,12 +827,18 @@ 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 entry
+++#ifdef QUIET_BOOT
+++ __attribute__((unused))
+++#endif
+++ ,
++ void *userdata __attribute__((unused)))
++ {
+++#ifndef QUIET_BOOT
++ grub_printf (" ");
++ grub_printf_ (N_("Booting `%s'"), entry->title);
++ grub_printf ("\n\n");
+++#endif
++ }
++
++ /* Callback invoked when a default menu entry executed because of a timeout
++@@ -880,6 +886,9 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
++ int boot_entry;
++ grub_menu_entry_t e;
++ int auto_boot;
+++#ifdef QUIET_BOOT
+++ int initial_timeout = grub_menu_get_timeout ();
+++#endif
++
++ boot_entry = run_menu (menu, nested, &auto_boot);
++ if (boot_entry < 0)
++@@ -889,7 +898,11 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
++ if (! e)
++ continue; /* Menu is empty. */
++
++- grub_cls ();
+++#ifdef QUIET_BOOT
+++ /* Only clear the screen if we drew the menu in the first place. */
+++ if (initial_timeout != 0)
+++#endif
+++ grub_cls ();
++
++ if (auto_boot)
++ grub_menu_execute_with_fallback (menu, e, autobooted,
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 61335e908..2e4dff9fb 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -21,6 +21,7 @@ prefix="@prefix@"
++ exec_prefix="@exec_prefix@"
++ datarootdir="@datarootdir@"
++ ubuntu_recovery="@UBUNTU_RECOVERY@"
+++quiet_boot="@QUIET_BOOT@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
++@@ -158,10 +159,12 @@ linux_entry ()
++ fi
++ printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
++ fi
++- message="$(gettext_printf "Loading Linux %s ..." ${version})"
++- sed "s/^/$submenu_indentation/" << EOF
+++ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
+++ message="$(gettext_printf "Loading Linux %s ..." ${version})"
+++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ EOF
+++ fi
++ if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then
++ sed "s/^/$submenu_indentation/" << EOF
++ linux ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
++@@ -173,13 +176,17 @@ EOF
++ fi
++ if test -n "${initrd}" ; then
++ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
++- message="$(gettext_printf "Loading initial ramdisk ...")"
+++ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
+++ message="$(gettext_printf "Loading initial ramdisk ...")"
+++ sed "s/^/$submenu_indentation/" << EOF
+++ echo '$(echo "$message" | grub_quote)'
+++EOF
+++ fi
++ initrd_path=
++ for i in ${initrd}; do
++ initrd_path="${initrd_path} ${rel_dirname}/${i}"
++ done
++ sed "s/^/$submenu_indentation/" << EOF
++- echo '$(echo "$message" | grub_quote)'
++ initrd $(echo $initrd_path)
++ EOF
++ fi
--- /dev/null
--- /dev/null
++From 070efced2f9e4d990291c8ffdbaa8bbd5b377ff4 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:13:00 +0000
++Subject: Handle filesystems loop-mounted on file images
++
++Improve prepare_grub_to_access_device to emit appropriate commands for
++such filesystems, and ignore them in Linux grub.d scripts.
++
++This is needed for Ubuntu's Wubi installation method.
++
++This patch isn't inherently Debian/Ubuntu-specific. losetup and
++/proc/mounts are Linux-specific, though, so we might need to refine this
++before sending it upstream. The changes to the Linux grub.d scripts
++might be better handled by integrating 10_lupin properly instead.
++
++Patch-Name: mkconfig-loopback.patch
++---
++ util/grub-mkconfig_lib.in | 24 ++++++++++++++++++++++++
++ util/grub.d/10_linux.in | 5 +++++
++ util/grub.d/20_linux_xen.in | 5 +++++
++ 3 files changed, 34 insertions(+)
++
++diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
++index b6606c16e..b05df554d 100644
++--- a/util/grub-mkconfig_lib.in
+++++ b/util/grub-mkconfig_lib.in
++@@ -133,6 +133,22 @@ prepare_grub_to_access_device ()
++ esac
++ done
++
+++ loop_file=
+++ case $1 in
+++ /dev/loop/*|/dev/loop[0-9])
+++ grub_loop_device="${1#/dev/}"
+++ loop_file=`losetup "$1" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+++ case $loop_file in
+++ /dev/*) ;;
+++ *)
+++ loop_device="$1"
+++ shift
+++ set -- `"${grub_probe}" --target=device "${loop_file}"` "$@"
+++ ;;
+++ esac
+++ ;;
+++ esac
+++
++ # Abstraction modules aren't auto-loaded.
++ abstraction="`"${grub_probe}" --device $@ --target=abstraction`"
++ for module in ${abstraction} ; do
++@@ -165,6 +181,14 @@ prepare_grub_to_access_device ()
++ echo "fi"
++ fi
++ IFS="$old_ifs"
+++
+++ if [ "x${loop_file}" != x ]; then
+++ loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
+++ if [ "x${loop_mountpoint}" != x ]; then
+++ echo "loopback ${grub_loop_device} ${loop_file#$loop_mountpoint}"
+++ echo "set root=(${grub_loop_device})"
+++ fi
+++ fi
++ }
++
++ grub_get_device_id ()
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index dd5a60c71..8c22c79f6 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -40,6 +40,11 @@ fi
++ case ${GRUB_DEVICE} in
++ /dev/loop/*|/dev/loop[0-9])
++ GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+++ # We can't cope with devices loop-mounted from files here.
+++ case ${GRUB_DEVICE} in
+++ /dev/*) ;;
+++ *) exit 0 ;;
+++ esac
++ ;;
++ esac
++
++diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
++index 96179ea61..9a8d42fb5 100644
++--- a/util/grub.d/20_linux_xen.in
+++++ b/util/grub.d/20_linux_xen.in
++@@ -40,6 +40,11 @@ fi
++ case ${GRUB_DEVICE} in
++ /dev/loop/*|/dev/loop[0-9])
++ GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+++ # We can't cope with devices loop-mounted from files here.
+++ case ${GRUB_DEVICE} in
+++ /dev/*) ;;
+++ *) exit 0 ;;
+++ esac
++ ;;
++ esac
++
--- /dev/null
--- /dev/null
++From 7f62293eea2c575b4063f473282599ac60f7199b Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:03 +0000
++Subject: Bail out if trying to run grub-mkconfig during upgrade to 2.00
++
++Since files in /etc/grub.d/ are conffiles, they are not put in place
++until grub-common is configured, meaning that they may be out of sync
++with the parts of grub-mkconfig that reside in /usr/. In GRUB 1.99,
++/etc/grub.d/00_header contained a reference to ${GRUB_PREFIX}/video.lst.
++This and other code from 1.99 breaks with 2.00's grub-mkconfig.
++Deferring this to when grub-PLATFORM.postinst eventually runs is safe
++and avoids this problem.
++
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: mkconfig-mid-upgrade.patch
++---
++ util/grub-mkconfig.in | 7 +++++++
++ 1 file changed, 7 insertions(+)
++
++diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
++index 72e0739eb..12a1a5f72 100644
++--- a/util/grub-mkconfig.in
+++++ b/util/grub-mkconfig.in
++@@ -102,6 +102,13 @@ do
++ esac
++ done
++
+++if fgrep -qs '${GRUB_PREFIX}/video.lst' "${grub_mkconfig_dir}/00_header"; then
+++ echo "GRUB >= 2.00 has been unpacked but not yet configured." >&2
+++ echo "grub-mkconfig will not work until the upgrade is complete." >&2
+++ echo "It should run later as part of configuring the new GRUB packages." >&2
+++ exit 0
+++fi
+++
++ if [ "x$EUID" = "x" ] ; then
++ EUID=`id -u`
++ fi
--- /dev/null
--- /dev/null
++From e071a7bbf280f9c8a95def7b0569741969c5722a Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:08 +0000
++Subject: Avoid getting confused by inaccessible loop device backing paths
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/938724
++Forwarded: no
++Last-Update: 2013-12-20
++
++Patch-Name: mkconfig-nonexistent-loopback.patch
++---
++ util/grub-mkconfig_lib.in | 2 +-
++ util/grub.d/30_os-prober.in | 9 +++++----
++ 2 files changed, 6 insertions(+), 5 deletions(-)
++
++diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
++index b05df554d..fe6319abe 100644
++--- a/util/grub-mkconfig_lib.in
+++++ b/util/grub-mkconfig_lib.in
++@@ -143,7 +143,7 @@ prepare_grub_to_access_device ()
++ *)
++ loop_device="$1"
++ shift
++- set -- `"${grub_probe}" --target=device "${loop_file}"` "$@"
+++ set -- `"${grub_probe}" --target=device "${loop_file}"` "$@" || return 0
++ ;;
++ esac
++ ;;
++diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
++index 775ceb2e0..b7e1147c4 100644
++--- a/util/grub.d/30_os-prober.in
+++++ b/util/grub.d/30_os-prober.in
++@@ -219,6 +219,11 @@ EOF
++ LINITRD="${LINITRD#/boot}"
++ fi
++
+++ if [ -z "${prepare_boot_cache}" ]; then
+++ prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
+++ [ "${prepare_boot_cache}" ] || continue
+++ fi
+++
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++ recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
++ counter=1
++@@ -230,10 +235,6 @@ EOF
++ fi
++ used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"
++
++- if [ -z "${prepare_boot_cache}" ]; then
++- prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
++- fi
++-
++ if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
++ cat << EOF
++ menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
--- /dev/null
--- /dev/null
++From 21aed74f55d60e79b744374465225eaaf939da66 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Sat, 3 Jan 2015 12:04:59 +0000
++Subject: Generate alternative init entries in advanced menu
++
++Add fallback boot entries for alternative installed init systems. Based
++on patches from Michael Biebl and Didier Roche.
++
++Bug-Debian: https://bugs.debian.org/757298
++Bug-Debian: https://bugs.debian.org/773173
++Forwarded: no
++Last-Update: 2017-06-23
++
++Patch-Name: mkconfig-other-inits.patch
++---
++ util/grub.d/10_linux.in | 10 ++++++++++
++ util/grub.d/20_linux_xen.in | 11 +++++++++++
++ 2 files changed, 21 insertions(+)
++
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 8a74c677b..0cd4cf5c0 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -32,6 +32,7 @@ export TEXTDOMAIN=@PACKAGE@
++ export TEXTDOMAINDIR="@localedir@"
++
++ CLASS="--class gnu-linux --class gnu --class os"
+++SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
++
++ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
++ OS=GNU/Linux
++@@ -127,6 +128,8 @@ linux_entry ()
++ case $type in
++ recovery)
++ title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" ;;
+++ init-*)
+++ title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "${type#init-}")" ;;
++ *)
++ title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
++ esac
++@@ -381,6 +384,13 @@ while [ "x$list" != "x" ] ; do
++
++ linux_entry "${OS}" "${version}" advanced \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+++ for supported_init in ${SUPPORTED_INITS}; do
+++ init_path="${supported_init#*:}"
+++ if [ -x "${init_path}" ] && [ "$(readlink -f /sbin/init)" != "$(readlink -f "${init_path}")" ]; then
+++ linux_entry "${OS}" "${version}" "init-${supported_init%%:*}" \
+++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=${init_path}"
+++ fi
+++ done
++ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
++ linux_entry "${OS}" "${version}" recovery \
++ "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
++diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
++index f2ee0532b..81e5f0d7e 100644
++--- a/util/grub.d/20_linux_xen.in
+++++ b/util/grub.d/20_linux_xen.in
++@@ -27,6 +27,7 @@ export TEXTDOMAIN=@PACKAGE@
++ export TEXTDOMAINDIR="@localedir@"
++
++ CLASS="--class gnu-linux --class gnu --class os --class xen"
+++SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
++
++ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
++ OS=GNU/Linux
++@@ -106,6 +107,8 @@ linux_entry ()
++ if [ x$type != xsimple ] ; then
++ if [ x$type = xrecovery ] ; then
++ title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
+++ elif [ "${type#init-}" != "$type" ] ; then
+++ title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "${type#init-}")"
++ else
++ title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
++ fi
++@@ -310,6 +313,14 @@ while [ "x${xen_list}" != "x" ] ; do
++
++ linux_entry "${OS}" "${version}" "${xen_version}" advanced \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
+++ for supported_init in ${SUPPORTED_INITS}; do
+++ init_path="${supported_init#*:}"
+++ if [ -x "${init_path}" ] && [ "$(readlink -f /sbin/init)" != "$(readlink -f "${init_path}")" ]; then
+++ linux_entry "${OS}" "${version}" "${xen_version}" "init-${supported_init%%:*}" \
+++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=${init_path}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
+++
+++ fi
+++ done
++ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
++ linux_entry "${OS}" "${version}" "${xen_version}" recovery \
++ "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
--- /dev/null
--- /dev/null
++From 340ad19a4f4d76a3a249d505e4a036fbb2c7990f Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:33 +0000
++Subject: Add GRUB_RECOVERY_TITLE option
++
++This allows the controversial "recovery mode" text to be customised.
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/1240360
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: mkconfig-recovery-title.patch
++---
++ docs/grub.texi | 5 +++++
++ util/grub-mkconfig.in | 7 ++++++-
++ util/grub.d/10_hurd.in | 4 ++--
++ util/grub.d/10_kfreebsd.in | 2 +-
++ util/grub.d/10_linux.in | 2 +-
++ util/grub.d/10_netbsd.in | 2 +-
++ util/grub.d/20_linux_xen.in | 2 +-
++ 7 files changed, 17 insertions(+), 7 deletions(-)
++
++diff --git a/docs/grub.texi b/docs/grub.texi
++index 6736032d7..f002cb97f 100644
++--- a/docs/grub.texi
+++++ b/docs/grub.texi
++@@ -1536,6 +1536,11 @@ a console is restricted or limited.
++ This option is only effective when GRUB was configured with the
++ @option{--enable-quick-boot} option.
++
+++@item GRUB_RECOVERY_TITLE
+++This option sets the English text of the string that will be displayed in
+++parentheses to indicate that a boot option is provided to help users recover
+++a broken system. The default is "recovery mode".
+++
++ @end table
++
++ The following options are still accepted for compatibility with existing
++diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
++index 871e7fb21..4134b6feb 100644
++--- a/util/grub-mkconfig.in
+++++ b/util/grub-mkconfig.in
++@@ -196,6 +196,10 @@ GRUB_ACTUAL_DEFAULT="$GRUB_DEFAULT"
++
++ if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi
++
+++if [ "x${GRUB_RECOVERY_TITLE}" = "x" ]; then
+++ GRUB_RECOVERY_TITLE="recovery mode"
+++fi
+++
++
++ # These are defined in this script, export them here so that user can
++ # override them.
++@@ -251,7 +255,8 @@ export GRUB_DEFAULT \
++ GRUB_BADRAM \
++ GRUB_OS_PROBER_SKIP_LIST \
++ GRUB_DISABLE_SUBMENU \
++- GRUB_RECORDFAIL_TIMEOUT
+++ GRUB_RECORDFAIL_TIMEOUT \
+++ GRUB_RECOVERY_TITLE
++
++ if test "x${grub_cfg}" != "x"; then
++ rm -f "${grub_cfg}.new"
++diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
++index 59a9a48a2..7fa3a3fbd 100644
++--- a/util/grub.d/10_hurd.in
+++++ b/util/grub.d/10_hurd.in
++@@ -88,8 +88,8 @@ hurd_entry () {
++
++ if [ x$type != xsimple ] ; then
++ if [ x$type = xrecovery ] ; then
++- title="$(gettext_printf "%s, with Hurd %s (recovery mode)" "${OS}" "${kernel_base}")"
++- oldtitle="$OS using $kernel_base (recovery mode)"
+++ title="$(gettext_printf "%s, with Hurd %s (%s)" "${OS}" "${kernel_base}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
+++ oldtitle="$OS using $kernel_base ($GRUB_RECOVERY_TITLE)"
++ else
++ title="$(gettext_printf "%s, with Hurd %s" "${OS}" "${kernel_base}")"
++ oldtitle="$OS using $kernel_base"
++diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
++index 9d8e8fd85..8301d361a 100644
++--- a/util/grub.d/10_kfreebsd.in
+++++ b/util/grub.d/10_kfreebsd.in
++@@ -76,7 +76,7 @@ kfreebsd_entry ()
++ fi
++ if [ x$type != xsimple ] ; then
++ if [ x$type = xrecovery ] ; then
++- title="$(gettext_printf "%s, with kFreeBSD %s (recovery mode)" "${os}" "${version}")"
+++ title="$(gettext_printf "%s, with kFreeBSD %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
++ else
++ title="$(gettext_printf "%s, with kFreeBSD %s" "${os}" "${version}")"
++ fi
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 174d547bb..ba945582e 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -126,7 +126,7 @@ linux_entry ()
++ if [ x$type != xsimple ] ; then
++ case $type in
++ recovery)
++- title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
+++ title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" ;;
++ *)
++ title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
++ esac
++diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in
++index 874f59969..bb29cc046 100644
++--- a/util/grub.d/10_netbsd.in
+++++ b/util/grub.d/10_netbsd.in
++@@ -102,7 +102,7 @@ netbsd_entry ()
++
++ if [ x$type != xsimple ] ; then
++ if [ x$type = xrecovery ] ; then
++- title="$(gettext_printf "%s, with kernel %s (via %s, recovery mode)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}")"
+++ title="$(gettext_printf "%s, with kernel %s (via %s, %s)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
++ else
++ title="$(gettext_printf "%s, with kernel %s (via %s)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}")"
++ fi
++diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
++index 9a8d42fb5..f2ee0532b 100644
++--- a/util/grub.d/20_linux_xen.in
+++++ b/util/grub.d/20_linux_xen.in
++@@ -105,7 +105,7 @@ linux_entry ()
++ fi
++ if [ x$type != xsimple ] ; then
++ if [ x$type = xrecovery ] ; then
++- title="$(gettext_printf "%s, with Xen %s and Linux %s (recovery mode)" "${os}" "${xen_version}" "${version}")"
+++ title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
++ else
++ title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
++ fi
--- /dev/null
--- /dev/null
++From c023aa3cf6b04cb45cd6503f48311e61fe84dd15 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:21 +0000
++Subject: Generate configuration for signed UEFI kernels if available
++
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: mkconfig-signed-kernel.patch
++---
++ util/grub.d/10_linux.in | 15 +++++++++++++++
++ 1 file changed, 15 insertions(+)
++
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index fd87a124d..61335e908 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -161,8 +161,16 @@ linux_entry ()
++ message="$(gettext_printf "Loading Linux %s ..." ${version})"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
+++EOF
+++ if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then
+++ sed "s/^/$submenu_indentation/" << EOF
+++ linux ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
+++EOF
+++ else
+++ sed "s/^/$submenu_indentation/" << EOF
++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
++ EOF
+++ fi
++ if test -n "${initrd}" ; then
++ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading initial ramdisk ...")"
++@@ -214,6 +222,13 @@ submenu_indentation=""
++ is_top_level=true
++ while [ "x$list" != "x" ] ; do
++ linux=`version_find_latest $list`
+++ case $linux in
+++ *.efi.signed)
+++ # We handle these in linux_entry.
+++ list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+++ continue
+++ ;;
+++ esac
++ gettext_printf "Found linux image: %s\n" "$linux" >&2
++ basename=`basename $linux`
++ dirname=`dirname $linux`
--- /dev/null
--- /dev/null
++From 60a721a3a4cd7eea7edd177579e99a2c73fdffbc Mon Sep 17 00:00:00 2001
++From: Mario Limonciello <Mario_Limonciello@dell.com>
++Date: Mon, 13 Jan 2014 12:13:14 +0000
++Subject: Remove GNU/Linux from default distributor string for Ubuntu
++
++Ubuntu is called "Ubuntu", not "Ubuntu GNU/Linux".
++
++Author: Colin Watson <cjwatson@debian.org>
++Author: Harald Sitter <apachelogger@kubuntu.org>
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: mkconfig-ubuntu-distributor.patch
++---
++ util/grub.d/10_linux.in | 9 ++++++++-
++ 1 file changed, 8 insertions(+), 1 deletion(-)
++
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 0509ac680..fd87a124d 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -32,7 +32,14 @@ CLASS="--class gnu-linux --class gnu --class os"
++ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
++ OS=GNU/Linux
++ else
++- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+++ case ${GRUB_DISTRIBUTOR} in
+++ Ubuntu|Kubuntu)
+++ OS="${GRUB_DISTRIBUTOR}"
+++ ;;
+++ *)
+++ OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+++ ;;
+++ esac
++ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
++ fi
++
--- /dev/null
--- /dev/null
++From 397ab153295533147505cbe40f49f648e73a0ae8 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:06 +0000
++Subject: "single" -> "recovery" when friendly-recovery is installed
++MIME-Version: 1.0
++Content-Type: text/plain; charset=UTF-8
++Content-Transfer-Encoding: 8bit
++
++If configured with --enable-ubuntu-recovery, also set nomodeset for
++recovery mode, and disable 'set gfxpayload=keep' even if the system
++normally supports it. See
++https://launchpad.net/ubuntu/+spec/desktop-o-xorg-tools-and-processes.
++
++Author: Stéphane Graber <stgraber@ubuntu.com>
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: mkconfig-ubuntu-recovery.patch
++---
++ configure.ac | 11 +++++++++++
++ util/grub.d/10_linux.in | 16 ++++++++++++++--
++ util/grub.d/30_os-prober.in | 2 +-
++ 3 files changed, 26 insertions(+), 3 deletions(-)
++
++diff --git a/configure.ac b/configure.ac
++index 08b518fcc..47102bfb5 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1846,6 +1846,17 @@ fi
++ AC_SUBST([LIBZFS])
++ AC_SUBST([LIBNVPAIR])
++
+++AC_ARG_ENABLE([ubuntu-recovery],
+++ [AS_HELP_STRING([--enable-ubuntu-recovery],
+++ [adjust boot options for the Ubuntu recovery mode (default=no)])],
+++ [], [enable_ubuntu_recovery=no])
+++if test x"$enable_ubuntu_recovery" = xyes ; then
+++ UBUNTU_RECOVERY=1
+++else
+++ UBUNTU_RECOVERY=0
+++fi
+++AC_SUBST([UBUNTU_RECOVERY])
+++
++ LIBS=""
++
++ AC_SUBST([FONT_SOURCE])
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 8c22c79f6..0509ac680 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -20,6 +20,7 @@ set -e
++ prefix="@prefix@"
++ exec_prefix="@exec_prefix@"
++ datarootdir="@datarootdir@"
+++ubuntu_recovery="@UBUNTU_RECOVERY@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
++@@ -84,6 +85,15 @@ esac
++
++ title_correction_code=
++
+++if [ -x /lib/recovery-mode/recovery-menu ]; then
+++ GRUB_CMDLINE_LINUX_RECOVERY=recovery
+++else
+++ GRUB_CMDLINE_LINUX_RECOVERY=single
+++fi
+++if [ "$ubuntu_recovery" = 1 ]; then
+++ GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
+++fi
+++
++ linux_entry ()
++ {
++ os="$1"
++@@ -123,7 +133,9 @@ linux_entry ()
++ if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
++ echo " load_video" | sed "s/^/$submenu_indentation/"
++ fi
++- echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
+++ if [ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]; then
+++ echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
+++ fi
++ fi
++
++ echo " insmod gzio" | sed "s/^/$submenu_indentation/"
++@@ -280,7 +292,7 @@ while [ "x$list" != "x" ] ; do
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
++ linux_entry "${OS}" "${version}" recovery \
++- "single ${GRUB_CMDLINE_LINUX}"
+++ "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
++ fi
++
++ list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
++diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
++index 515a68c7a..775ceb2e0 100644
++--- a/util/grub.d/30_os-prober.in
+++++ b/util/grub.d/30_os-prober.in
++@@ -220,7 +220,7 @@ EOF
++ fi
++
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++- recovery_params="$(echo "${LPARAMS}" | grep single)" || true
+++ recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
++ counter=1
++ while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
++ counter=$((counter+1));
--- /dev/null
--- /dev/null
++From 97da65e3172740d31c5bfd15df7756dfbc13629b Mon Sep 17 00:00:00 2001
++From: Mario Limonciello <Mario_Limonciello@dell.com>
++Date: Mon, 13 Jan 2014 12:12:59 +0000
++Subject: Build vfat into EFI boot images
++
++Author: Colin Watson <cjwatson@ubuntu.com>
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/677758
++Forwarded: http://lists.gnu.org/archive/html/grub-devel/2011-01/msg00028.html
++Last-Update: 2016-09-18
++
++Patch-Name: mkrescue-efi-modules.patch
++---
++ util/grub-mkrescue.c | 2 ++
++ 1 file changed, 2 insertions(+)
++
++diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c
++index 21e5ce4e4..e92be0800 100644
++--- a/util/grub-mkrescue.c
+++++ b/util/grub-mkrescue.c
++@@ -750,6 +750,7 @@ main (int argc, char *argv[])
++
++ grub_install_push_module ("part_gpt");
++ grub_install_push_module ("part_msdos");
+++ grub_install_push_module ("fat");
++
++ imgname = grub_util_path_concat (2, efidir_efi_boot, "bootia64.efi");
++ make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_IA64_EFI, "ia64-efi", imgname);
++@@ -827,6 +828,7 @@ main (int argc, char *argv[])
++ free (efidir);
++ grub_install_pop_module ();
++ grub_install_pop_module ();
+++ grub_install_pop_module ();
++ }
++
++ grub_install_push_module ("part_apple");
--- /dev/null
--- /dev/null
++From 2b5d382b5506ddf1e476a0696e0c8cb0a501baee Mon Sep 17 00:00:00 2001
++From: Aaron Miller <aaronmiller@fb.com>
++Date: Thu, 27 Oct 2016 17:39:49 -0400
++Subject: net: read bracketed ipv6 addrs and port numbers
++
++Allow specifying port numbers for http and tftp paths, and allow ipv6 addresses
++to be recognized with brackets around them, which is required to specify a port
++number
++
++Patch-Name: net-read-bracketed-ipv6-addr.patch
++---
++ grub-core/net/http.c | 21 ++++++++--
++ grub-core/net/net.c | 93 +++++++++++++++++++++++++++++++++++++++++---
++ grub-core/net/tftp.c | 6 ++-
++ include/grub/net.h | 1 +
++ 4 files changed, 110 insertions(+), 11 deletions(-)
++
++diff --git a/grub-core/net/http.c b/grub-core/net/http.c
++index 5aa4ad3be..f182d7b87 100644
++--- a/grub-core/net/http.c
+++++ b/grub-core/net/http.c
++@@ -312,12 +312,14 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
++ int i;
++ struct grub_net_buff *nb;
++ grub_err_t err;
+++ char* server = file->device->net->server;
+++ int port = file->device->net->port;
++
++ nb = grub_netbuff_alloc (GRUB_NET_TCP_RESERVE_SIZE
++ + sizeof ("GET ") - 1
++ + grub_strlen (data->filename)
++ + sizeof (" HTTP/1.1\r\nHost: ") - 1
++- + grub_strlen (file->device->net->server)
+++ + grub_strlen (server) + sizeof (":XXXXXXXXXX")
++ + sizeof ("\r\nUser-Agent: " PACKAGE_STRING
++ "\r\n") - 1
++ + sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX"
++@@ -356,7 +358,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
++ sizeof (" HTTP/1.1\r\nHost: ") - 1);
++
++ ptr = nb->tail;
++- err = grub_netbuff_put (nb, grub_strlen (file->device->net->server));
+++ err = grub_netbuff_put (nb, grub_strlen (server));
++ if (err)
++ {
++ grub_netbuff_free (nb);
++@@ -365,6 +367,15 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
++ grub_memcpy (ptr, file->device->net->server,
++ grub_strlen (file->device->net->server));
++
+++ if (port)
+++ {
+++ ptr = nb->tail;
+++ grub_snprintf ((char *) ptr,
+++ sizeof (":XXXXXXXXXX"),
+++ ":%d",
+++ port);
+++ }
+++
++ ptr = nb->tail;
++ err = grub_netbuff_put (nb,
++ sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n")
++@@ -390,8 +401,10 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
++ grub_netbuff_put (nb, 2);
++ grub_memcpy (ptr, "\r\n", 2);
++
++- data->sock = grub_net_tcp_open (file->device->net->server,
++- HTTP_PORT, http_receive,
+++ grub_dprintf ("http", "opening path %s on host %s TCP port %d\n",
+++ data->filename, server, port ? port : HTTP_PORT);
+++ data->sock = grub_net_tcp_open (server,
+++ port ? port : HTTP_PORT, http_receive,
++ http_err, http_err,
++ file);
++ if (!data->sock)
++diff --git a/grub-core/net/net.c b/grub-core/net/net.c
++index d5d726a31..b917a75d5 100644
++--- a/grub-core/net/net.c
+++++ b/grub-core/net/net.c
++@@ -437,6 +437,12 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest)
++ grub_uint16_t newip[8];
++ const char *ptr = val;
++ int word, quaddot = -1;
+++ int bracketed = 0;
+++
+++ if (ptr[0] == '[') {
+++ bracketed = 1;
+++ ptr++;
+++ }
++
++ if (ptr[0] == ':' && ptr[1] != ':')
++ return 0;
++@@ -475,6 +481,9 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest)
++ grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0]));
++ }
++ grub_memcpy (ip, newip, 16);
+++ if (bracketed && *ptr == ']') {
+++ ptr++;
+++ }
++ if (rest)
++ *rest = ptr;
++ return 1;
++@@ -1260,8 +1269,10 @@ grub_net_open_real (const char *name)
++ {
++ grub_net_app_level_t proto;
++ const char *protname, *server;
+++ char *host;
++ grub_size_t protnamelen;
++ int try;
+++ int port = 0;
++
++ if (grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0)
++ {
++@@ -1299,6 +1310,72 @@ grub_net_open_real (const char *name)
++ return NULL;
++ }
++
+++ char* port_start;
+++ /* ipv6 or port specified? */
+++ if ((port_start = grub_strchr (server, ':')))
+++ {
+++ char* ipv6_begin;
+++ if((ipv6_begin = grub_strchr (server, '[')))
+++ {
+++ char* ipv6_end = grub_strchr (server, ']');
+++ if(!ipv6_end)
+++ {
+++ grub_error (GRUB_ERR_NET_BAD_ADDRESS,
+++ N_("mismatched [ in address"));
+++ return NULL;
+++ }
+++ /* port number after bracketed ipv6 addr */
+++ if(ipv6_end[1] == ':')
+++ {
+++ port = grub_strtoul (ipv6_end + 2, NULL, 10);
+++ if(port > 65535)
+++ {
+++ grub_error (GRUB_ERR_NET_BAD_ADDRESS,
+++ N_("bad port number"));
+++ return NULL;
+++ }
+++ }
+++ host = grub_strndup (ipv6_begin, (ipv6_end - ipv6_begin) + 1);
+++ }
+++ else
+++ {
+++ if (grub_strchr (port_start + 1, ':'))
+++ {
+++ int iplen = grub_strlen (server);
+++ /* bracket bare ipv6 addrs */
+++ host = grub_malloc (iplen + 3);
+++ if(!host)
+++ {
+++ return NULL;
+++ }
+++ host[0] = '[';
+++ grub_memcpy (host + 1, server, iplen);
+++ host[iplen + 1] = ']';
+++ host[iplen + 2] = '\0';
+++ }
+++ else
+++ {
+++ /* hostname:port or ipv4:port */
+++ port = grub_strtol (port_start + 1, NULL, 10);
+++ if(port > 65535)
+++ {
+++ grub_error (GRUB_ERR_NET_BAD_ADDRESS,
+++ N_("bad port number"));
+++ return NULL;
+++ }
+++ host = grub_strndup (server, port_start - server);
+++ }
+++ }
+++ }
+++ else
+++ {
+++ host = grub_strdup (server);
+++ }
+++ if (!host)
+++ {
+++ return NULL;
+++ }
+++
++ for (try = 0; try < 2; try++)
++ {
++ FOR_NET_APP_LEVEL (proto)
++@@ -1308,15 +1385,19 @@ grub_net_open_real (const char *name)
++ {
++ grub_net_t ret = grub_zalloc (sizeof (*ret));
++ if (!ret)
++- return NULL;
++- ret->protocol = proto;
++- ret->server = grub_strdup (server);
++- if (!ret->server)
+++ grub_free (host);
+++ if (host)
++ {
++- grub_free (ret);
++- return NULL;
+++ ret->server = grub_strdup (host);
+++ if (!ret->server)
+++ {
+++ grub_free (ret);
+++ return NULL;
+++ }
++ }
++ ret->fs = &grub_net_fs;
+++ ret->protocol = proto;
+++ ret->port = port;
++ return ret;
++ }
++ }
++diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
++index 7d90bf66e..a0817a075 100644
++--- a/grub-core/net/tftp.c
+++++ b/grub-core/net/tftp.c
++@@ -314,6 +314,7 @@ tftp_open (struct grub_file *file, const char *filename)
++ grub_err_t err;
++ grub_uint8_t *nbd;
++ grub_net_network_level_address_t addr;
+++ int port = file->device->net->port;
++
++ data = grub_zalloc (sizeof (*data));
++ if (!data)
++@@ -382,13 +383,16 @@ tftp_open (struct grub_file *file, const char *filename)
++ err = grub_net_resolve_address (file->device->net->server, &addr);
++ if (err)
++ {
+++ grub_dprintf ("tftp", "file_size is %llu, block_size is %llu\n",
+++ (unsigned long long)data->file_size,
+++ (unsigned long long)data->block_size);
++ destroy_pq (data);
++ grub_free (data);
++ return err;
++ }
++
++ data->sock = grub_net_udp_open (addr,
++- TFTP_SERVER_PORT, tftp_receive,
+++ port ? port : TFTP_SERVER_PORT, tftp_receive,
++ file);
++ if (!data->sock)
++ {
++diff --git a/include/grub/net.h b/include/grub/net.h
++index 4a9069a14..cc114286e 100644
++--- a/include/grub/net.h
+++++ b/include/grub/net.h
++@@ -270,6 +270,7 @@ typedef struct grub_net
++ {
++ char *server;
++ char *name;
+++ int port;
++ grub_net_app_level_t protocol;
++ grub_net_packets_t packs;
++ grub_off_t offset;
--- /dev/null
- From 9569221816a2a1a832be106440375a612e0121b7 Mon Sep 17 00:00:00 2001
++From 54d1130537fbc5438d078e646a00b47a75384061 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Wed, 24 Apr 2019 10:03:04 -0400
+Subject: Forbid the "devicetree" command when Secure Boot is enabled.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+Signed-off-by: Steve McIntyre <93sam@debian.org>
+
+Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927888#15
+Bug-Debian: https://bugs.debian.org/927888
+Last-Update: 2019-05-04
+
+Patch-Name: no-devicetree-if-secure-boot.patch
+---
- grub-core/loader/arm/linux.c | 14 +++++++++++++-
++ grub-core/loader/arm/linux.c | 12 ++++++++++++
+ grub-core/loader/efi/fdt.c | 8 ++++++++
- 2 files changed, 21 insertions(+), 1 deletion(-)
++ 2 files changed, 20 insertions(+)
+
+diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c
- index 9300adc8f..72d747578 100644
++index 51684914c..092e8e307 100644
+--- a/grub-core/loader/arm/linux.c
++++ b/grub-core/loader/arm/linux.c
- @@ -29,6 +29,10 @@
- #include <grub/lib/cmdline.h>
++@@ -30,6 +30,10 @@
+ #include <grub/linux.h>
++ #include <grub/verify.h>
+
++#ifdef GRUB_MACHINE_EFI
++#include <grub/efi/efi.h>
++#endif
++
+ GRUB_MOD_LICENSE ("GPLv3+");
+
+ static grub_dl_t my_mod;
- @@ -433,9 +437,17 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
++@@ -471,6 +475,14 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
+ if (argc != 1)
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
+
++#ifdef GRUB_MACHINE_EFI
++ if (grub_efi_secure_boot ())
++ {
++ return grub_error (GRUB_ERR_ACCESS_DENIED,
++ "Secure Boot forbids loading devicetree from %s", argv[0]);
++ }
++#endif
++
- dtb = grub_file_open (argv[0]);
++ dtb = grub_file_open (argv[0], GRUB_FILE_TYPE_DEVICE_TREE_IMAGE);
+ if (!dtb)
- - goto out;
- + return grub_errno;
-
- size = grub_file_size (dtb);
- if (size == 0)
++ return grub_errno;
+diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
- index c9aee74ef..2def3dc5d 100644
++index ee9c5592c..f0c2d91be 100644
+--- a/grub-core/loader/efi/fdt.c
++++ b/grub-core/loader/efi/fdt.c
+@@ -123,6 +123,14 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
+ return GRUB_ERR_NONE;
+ }
+
++#ifdef GRUB_MACHINE_EFI
++ if (grub_efi_secure_boot ())
++ {
++ return grub_error (GRUB_ERR_ACCESS_DENIED,
++ "Secure Boot forbids loading devicetree from %s", argv[0]);
++ }
++#endif
++
- dtb = grub_file_open (argv[0]);
++ dtb = grub_file_open (argv[0], GRUB_FILE_TYPE_DEVICE_TREE_IMAGE);
+ if (!dtb)
+ goto out;
--- /dev/null
--- /dev/null
++From 28ae9272853b2db956faa566dd9d25dd64c72a47 Mon Sep 17 00:00:00 2001
++From: Matthew Garrett <mjg@redhat.com>
++Date: Mon, 13 Jan 2014 12:13:09 +0000
++Subject: Don't permit loading modules on UEFI secure boot
++
++Author: Colin Watson <cjwatson@ubuntu.com>
++Origin: vendor, http://pkgs.fedoraproject.org/cgit/grub2.git/tree/grub-2.00-no-insmod-on-sb.patch
++Forwarded: no
++Last-Update: 2013-12-25
++
++Patch-Name: no-insmod-on-sb.patch
++---
++ grub-core/kern/dl.c | 13 +++++++++++++
++ grub-core/kern/efi/efi.c | 28 ++++++++++++++++++++++++++++
++ include/grub/efi/efi.h | 1 +
++ 3 files changed, 42 insertions(+)
++
++diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
++index 48eb5e7b6..074dfc3c6 100644
++--- a/grub-core/kern/dl.c
+++++ b/grub-core/kern/dl.c
++@@ -38,6 +38,10 @@
++ #define GRUB_MODULES_MACHINE_READONLY
++ #endif
++
+++#ifdef GRUB_MACHINE_EFI
+++#include <grub/efi/efi.h>
+++#endif
+++
++ \f
++
++ #pragma GCC diagnostic ignored "-Wcast-align"
++@@ -686,6 +690,15 @@ grub_dl_load_file (const char *filename)
++ void *core = 0;
++ grub_dl_t mod = 0;
++
+++#ifdef GRUB_MACHINE_EFI
+++ if (grub_efi_secure_boot ())
+++ {
+++ grub_error (GRUB_ERR_ACCESS_DENIED,
+++ "Secure Boot forbids loading module from %s", filename);
+++ return 0;
+++ }
+++#endif
+++
++ grub_boot_time ("Loading module %s", filename);
++
++ file = grub_file_open (filename, GRUB_FILE_TYPE_GRUB_MODULE);
++diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
++index 708581fcb..3673c2f45 100644
++--- a/grub-core/kern/efi/efi.c
+++++ b/grub-core/kern/efi/efi.c
++@@ -273,6 +273,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
++ return NULL;
++ }
++
+++grub_efi_boolean_t
+++grub_efi_secure_boot (void)
+++{
+++ grub_efi_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
+++ grub_size_t datasize;
+++ char *secure_boot = NULL;
+++ char *setup_mode = NULL;
+++ grub_efi_boolean_t ret = 0;
+++
+++ secure_boot = grub_efi_get_variable ("SecureBoot", &efi_var_guid, &datasize);
+++
+++ if (datasize != 1 || !secure_boot)
+++ goto out;
+++
+++ setup_mode = grub_efi_get_variable ("SetupMode", &efi_var_guid, &datasize);
+++
+++ if (datasize != 1 || !setup_mode)
+++ goto out;
+++
+++ if (*secure_boot && !*setup_mode)
+++ ret = 1;
+++
+++ out:
+++ grub_free (secure_boot);
+++ grub_free (setup_mode);
+++ return ret;
+++}
+++
++ #pragma GCC diagnostic ignored "-Wcast-align"
++
++ /* 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 e90e00dc4..a237952b3 100644
++--- a/include/grub/efi/efi.h
+++++ b/include/grub/efi/efi.h
++@@ -82,6 +82,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var,
++ const grub_efi_guid_t *guid,
++ void *data,
++ grub_size_t datasize);
+++grub_efi_boolean_t EXPORT_FUNC (grub_efi_secure_boot) (void);
++ int
++ EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1,
++ const grub_efi_device_path_t *dp2);
--- /dev/null
--- /dev/null
++From f5a0c855c8f25ff1f6df59a524a438d3f39485a8 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:12:50 +0000
++Subject: Hack prefix for OLPC
++
++This sucks, but it's better than what OFW was giving us.
++
++Patch-Name: olpc-prefix-hack.patch
++---
++ grub-core/kern/ieee1275/init.c | 11 +++++++++++
++ 1 file changed, 11 insertions(+)
++
++diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
++index d483e35ee..8b089b48d 100644
++--- a/grub-core/kern/ieee1275/init.c
+++++ b/grub-core/kern/ieee1275/init.c
++@@ -76,6 +76,7 @@ grub_exit (void)
++ grub_ieee1275_exit ();
++ }
++
+++#ifndef __i386__
++ /* Translate an OF filesystem path (separated by backslashes), into a GRUB
++ path (separated by forward slashes). */
++ static void
++@@ -90,9 +91,18 @@ grub_translate_ieee1275_path (char *filepath)
++ backslash = grub_strchr (filepath, '\\');
++ }
++ }
+++#endif
++
++ void (*grub_ieee1275_net_config) (const char *dev, char **device, char **path,
++ char *bootpath);
+++#ifdef __i386__
+++void
+++grub_machine_get_bootlocation (char **device __attribute__ ((unused)),
+++ char **path __attribute__ ((unused)))
+++{
+++ grub_env_set ("prefix", "(sd,1)/");
+++}
+++#else
++ void
++ grub_machine_get_bootlocation (char **device, char **path)
++ {
++@@ -146,6 +156,7 @@ grub_machine_get_bootlocation (char **device, char **path)
++ }
++ grub_free (bootpath);
++ }
+++#endif
++
++ /* Claim some available memory in the first /memory node. */
++ #ifdef __sparc__
--- /dev/null
- From 670711393c4f958b9bd0669b4118376fccd56446 Mon Sep 17 00:00:00 2001
++From be135f4bc0dadac21ac27df2a6d270d297cc6efb Mon Sep 17 00:00:00 2001
+From: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
+Date: Thu, 25 Sep 2014 19:33:39 -0300
+Subject: Disable VSX instruction
+
+VSX bit is enabled by default for Power7 and Power8 CPU models,
+so we need to disable them in order to avoid instruction exceptions.
+Kernel will activate it when necessary.
+
+* grub-core/kern/powerpc/ieee1275/startup.S: Disable VSX.
+
+Also-By: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+Also-By: Colin Watson <cjwatson@debian.org>
+
+Origin: other, https://lists.gnu.org/archive/html/grub-devel/2014-09/msg00078.html
+Last-Update: 2015-01-27
+
+Patch-Name: ppc64el-disable-vsx.patch
+---
+ grub-core/kern/powerpc/ieee1275/startup.S | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/grub-core/kern/powerpc/ieee1275/startup.S b/grub-core/kern/powerpc/ieee1275/startup.S
+index 21c884b43..de9a9601a 100644
+--- a/grub-core/kern/powerpc/ieee1275/startup.S
++++ b/grub-core/kern/powerpc/ieee1275/startup.S
+@@ -20,6 +20,8 @@
+ #include <grub/symbol.h>
+ #include <grub/offsets.h>
+
++#define MSR_VSX 0x80
++
+ .extern __bss_start
+ .extern _end
+
+@@ -28,6 +30,16 @@
+ .globl start, _start
+ start:
+ _start:
++ _start:
++
++ /* Disable VSX instruction */
++ mfmsr 0
++ oris 0,0,MSR_VSX
++ /* The "VSX Available" bit is in the lower half of the MSR, so we
++ don't need mtmsrd, which in any case won't work in 32-bit mode. */
++ mtmsr 0
++ isync
++
+ li 2, 0
+ li 13, 0
+
--- /dev/null
--- /dev/null
++From a9b9f543af16d0f00b936f26b09878949230654c Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:31 +0000
++Subject: Probe FusionIO devices
++
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519
++Forwarded: no
++Last-Update: 2016-09-18
++
++Patch-Name: probe-fusionio.patch
++---
++ grub-core/osdep/linux/getroot.c | 13 +++++++++++++
++ util/deviceiter.c | 19 +++++++++++++++++++
++ 2 files changed, 32 insertions(+)
++
++diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
++index 90d92d3ad..7adc0f30e 100644
++--- a/grub-core/osdep/linux/getroot.c
+++++ b/grub-core/osdep/linux/getroot.c
++@@ -950,6 +950,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
++ *pp = '\0';
++ return path;
++ }
+++
+++ /* If this is a FusionIO disk. */
+++ if ((strncmp ("fio", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
+++ {
+++ char *pp = p + 3;
+++ while (*pp >= 'a' && *pp <= 'z')
+++ pp++;
+++ if (*pp)
+++ *is_part = 1;
+++ /* /dev/fio[a-z]+[0-9]* */
+++ *pp = '\0';
+++ return path;
+++ }
++ }
++
++ return path;
++diff --git a/util/deviceiter.c b/util/deviceiter.c
++index a4971ef42..dddc50da7 100644
++--- a/util/deviceiter.c
+++++ b/util/deviceiter.c
++@@ -383,6 +383,12 @@ get_nvme_disk_name (char *name, int controller, int namespace)
++ {
++ sprintf (name, "/dev/nvme%dn%d", controller, namespace);
++ }
+++
+++static void
+++get_fio_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/fio%c", unit + 'a');
+++}
++ #endif
++
++ static struct seen_device
++@@ -923,6 +929,19 @@ grub_util_iterate_devices (int (*hook) (const char *, int, void *), void *hook_d
++ }
++ }
++
+++ /* FusionIO. */
+++ for (i = 0; i < 26; i++)
+++ {
+++ char name[16];
+++
+++ get_fio_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
++ # ifdef HAVE_DEVICE_MAPPER
++ # define dmraid_check(cond, ...) \
++ if (! (cond)) \
--- /dev/null
--- /dev/null
++From b46c93ffc3568a186c5326c86abfbd87a1c52680 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:28 +0000
++Subject: Add configure option to bypass boot menu if possible
++
++If other operating systems are installed, then automatically unhide the
++menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if
++available to check whether Shift is pressed. If it is, show the menu,
++otherwise boot immediately. If keystatus is not available, then fall
++back to a short delay interruptible with Escape.
++
++This may or may not remain Ubuntu-specific, although it's not obviously
++wanted upstream. It implements a requirement of
++https://wiki.ubuntu.com/DesktopExperienceTeam/KarmicBootExperienceDesignSpec#Bootloader.
++
++If the previous boot failed (defined as failing to get to the end of one
++of the normal runlevels), then show the boot menu regardless.
++
++Author: Richard Laager <rlaager@wiktel.com>
++Author: Robie Basak <robie.basak@ubuntu.com>
++Forwarded: no
++Last-Update: 2015-09-04
++
++Patch-Name: quick-boot.patch
++---
++ configure.ac | 11 ++++++
++ docs/grub.texi | 14 +++++++
++ grub-core/normal/menu.c | 24 ++++++++++++
++ util/grub-mkconfig.in | 3 +-
++ util/grub.d/00_header.in | 77 +++++++++++++++++++++++++++++++------
++ util/grub.d/10_linux.in | 4 ++
++ util/grub.d/30_os-prober.in | 21 ++++++++++
++ 7 files changed, 141 insertions(+), 13 deletions(-)
++
++diff --git a/configure.ac b/configure.ac
++index 4ddee8a7c..ebfcb618a 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1868,6 +1868,17 @@ else
++ fi
++ AC_SUBST([QUIET_BOOT])
++
+++AC_ARG_ENABLE([quick-boot],
+++ [AS_HELP_STRING([--enable-quick-boot],
+++ [bypass boot menu if possible (default=no)])],
+++ [], [enable_quick_boot=no])
+++if test x"$enable_quick_boot" = xyes ; then
+++ QUICK_BOOT=1
+++else
+++ QUICK_BOOT=0
+++fi
+++AC_SUBST([QUICK_BOOT])
+++
++ LIBS=""
++
++ AC_SUBST([FONT_SOURCE])
++diff --git a/docs/grub.texi b/docs/grub.texi
++index 308b25074..6736032d7 100644
++--- a/docs/grub.texi
+++++ b/docs/grub.texi
++@@ -1522,6 +1522,20 @@ This option may be set to a list of GRUB module names separated by spaces.
++ Each module will be loaded as early as possible, at the start of
++ @file{grub.cfg}.
++
+++@item GRUB_RECORDFAIL_TIMEOUT
+++If this option is set, it overrides the default recordfail setting. A
+++setting of -1 causes GRUB to wait for user input indefinitely. However, a
+++false positive in the recordfail mechanism may occur if power is lost during
+++boot before boot success is recorded in userspace. The default setting is
+++30, which causes GRUB to wait for user input for thirty seconds before
+++continuing. This default allows interactive users the opportunity to switch
+++to a different, working kernel, while avoiding a false positive causing the
+++boot to block indefinitely on headless and appliance systems where access to
+++a console is restricted or limited.
+++
+++This option is only effective when GRUB was configured with the
+++@option{--enable-quick-boot} option.
+++
++ @end table
++
++ The following options are still accepted for compatibility with existing
++diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
++index bc0f173f6..68415a669 100644
++--- a/grub-core/normal/menu.c
+++++ b/grub-core/normal/menu.c
++@@ -604,6 +604,30 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
++ static struct grub_term_coordinate *pos;
++ int entry = -1;
++
+++ if (timeout == 0)
+++ {
+++ /* If modifier key statuses can't be detected without a delay,
+++ then a hidden timeout of zero cannot be interrupted in any way,
+++ which is not very helpful. Bump it to three seconds in this
+++ case to give the user a fighting chance. */
+++ grub_term_input_t term;
+++ int nterms = 0;
+++ int mods_detectable = 1;
+++
+++ FOR_ACTIVE_TERM_INPUTS(term)
+++ {
+++ if (!term->getkeystatus)
+++ {
+++ mods_detectable = 0;
+++ break;
+++ }
+++ else
+++ nterms++;
+++ }
+++ if (!mods_detectable || !nterms)
+++ timeout = 3;
+++ }
+++
++ if (timeout_style == TIMEOUT_STYLE_COUNTDOWN && timeout)
++ {
++ pos = grub_term_save_pos ();
++diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
++index 90ec26d65..871e7fb21 100644
++--- a/util/grub-mkconfig.in
+++++ b/util/grub-mkconfig.in
++@@ -250,7 +250,8 @@ export GRUB_DEFAULT \
++ GRUB_ENABLE_CRYPTODISK \
++ GRUB_BADRAM \
++ GRUB_OS_PROBER_SKIP_LIST \
++- GRUB_DISABLE_SUBMENU
+++ GRUB_DISABLE_SUBMENU \
+++ GRUB_RECORDFAIL_TIMEOUT
++
++ if test "x${grub_cfg}" != "x"; then
++ rm -f "${grub_cfg}.new"
++diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
++index 93a90233e..674a76140 100644
++--- a/util/grub.d/00_header.in
+++++ b/util/grub.d/00_header.in
++@@ -21,6 +21,8 @@ prefix="@prefix@"
++ exec_prefix="@exec_prefix@"
++ datarootdir="@datarootdir@"
++ grub_lang=`echo $LANG | cut -d . -f 1`
+++grubdir="`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`"
+++quick_boot="@QUICK_BOOT@"
++
++ export TEXTDOMAIN=@PACKAGE@
++ export TEXTDOMAINDIR="@localedir@"
++@@ -44,6 +46,7 @@ if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT
++
++ cat << EOF
++ if [ -s \$prefix/grubenv ]; then
+++ set have_grubenv=true
++ load_env
++ fi
++ EOF
++@@ -96,7 +99,50 @@ function savedefault {
++ save_env saved_entry
++ fi
++ }
+++EOF
+++
+++if [ "$quick_boot" = 1 ]; then
+++ cat <<EOF
+++function recordfail {
+++ set recordfail=1
+++EOF
+++
+++ check_writable () {
+++ abstractions="$(grub-probe --target=abstraction "${grubdir}")"
+++ for abstraction in $abstractions; do
+++ case "$abstraction" in
+++ diskfilter | lvm)
+++ cat <<EOF
+++ # GRUB lacks write support for $abstraction, so recordfail support is disabled.
+++EOF
+++ return
+++ ;;
+++ esac
+++ done
+++
+++ FS="$(grub-probe --target=fs "${grubdir}")"
+++ case "$FS" in
+++ btrfs | cpiofs | newc | odc | romfs | squash4 | tarfs | zfs)
+++ cat <<EOF
+++ # GRUB lacks write support for $FS, so recordfail support is disabled.
+++EOF
+++ return
+++ ;;
+++ esac
+++
+++ cat <<EOF
+++ if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi
+++EOF
+++ }
+++
+++ check_writable
++
+++ cat <<EOF
+++}
+++EOF
+++fi
+++
+++cat <<EOF
++ function load_video {
++ EOF
++ if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
++@@ -282,10 +328,16 @@ fi
++
++ make_timeout ()
++ {
+++ cat << EOF
+++if [ "\${recordfail}" = 1 ] ; then
+++ set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
+++else
+++EOF
++ if [ "x${3}" != "x" ] ; then
++ timeout="${2}"
++ style="${3}"
++- elif [ "x${1}" != "x" ] && [ "x${1}" != "x0" ] ; then
+++ elif [ "x${1}" != "x" ] && \
+++ ([ "$quick_boot" = 1 ] || [ "x${1}" != "x0" ]) ; then
++ # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme.
++ timeout="${1}"
++ if [ "x${2}" != "x0" ] ; then
++@@ -304,26 +356,27 @@ make_timeout ()
++ style="menu"
++ fi
++ cat << EOF
++-if [ x\$feature_timeout_style = xy ] ; then
++- set timeout_style=${style}
++- set timeout=${timeout}
+++ if [ x\$feature_timeout_style = xy ] ; then
+++ set timeout_style=${style}
+++ set timeout=${timeout}
++ EOF
++ if [ "x${style}" = "xmenu" ] ; then
++ cat << EOF
++-# Fallback normal timeout code in case the timeout_style feature is
++-# unavailable.
++-else
++- set timeout=${timeout}
+++ # Fallback normal timeout code in case the timeout_style feature is
+++ # unavailable.
+++ else
+++ set timeout=${timeout}
++ EOF
++ else
++ cat << EOF
++-# Fallback hidden-timeout code in case the timeout_style feature is
++-# unavailable.
++-elif sleep${verbose} --interruptible ${timeout} ; then
++- set timeout=0
+++ # Fallback hidden-timeout code in case the timeout_style feature is
+++ # unavailable.
+++ elif sleep${verbose} --interruptible ${timeout} ; then
+++ set timeout=0
++ EOF
++ fi
++ cat << EOF
+++ fi
++ fi
++ EOF
++ }
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 2e4dff9fb..51cdb5e1d 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -22,6 +22,7 @@ exec_prefix="@exec_prefix@"
++ datarootdir="@datarootdir@"
++ ubuntu_recovery="@UBUNTU_RECOVERY@"
++ quiet_boot="@QUIET_BOOT@"
+++quick_boot="@QUICK_BOOT@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
++@@ -129,6 +130,9 @@ linux_entry ()
++ else
++ echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
++ fi
+++ if [ "$quick_boot" = 1 ]; then
+++ echo " recordfail" | sed "s/^/$submenu_indentation/"
+++ fi
++ if [ x$type != xrecovery ] ; then
++ save_default_entry | grub_add_tab
++ fi
++diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
++index 271044f59..da5f28876 100644
++--- a/util/grub.d/30_os-prober.in
+++++ b/util/grub.d/30_os-prober.in
++@@ -20,12 +20,26 @@ set -e
++ prefix="@prefix@"
++ exec_prefix="@exec_prefix@"
++ datarootdir="@datarootdir@"
+++quick_boot="@QUICK_BOOT@"
++
++ export TEXTDOMAIN=@PACKAGE@
++ export TEXTDOMAINDIR="@localedir@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
+++found_other_os=
+++
+++adjust_timeout () {
+++ if [ "$quick_boot" = 1 ] && [ "x${found_other_os}" != "x" ]; then
+++ cat << EOF
+++set timeout_style=menu
+++if [ "\${timeout}" = 0 ]; then
+++ set timeout=10
+++fi
+++EOF
+++ fi
+++}
+++
++ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
++ exit 0
++ fi
++@@ -42,6 +56,7 @@ if [ -z "${OSPROBED}" ] ; then
++ fi
++
++ osx_entry() {
+++ found_other_os=1
++ if [ x$2 = x32 ]; then
++ # TRANSLATORS: it refers to kernel architecture (32-bit)
++ bitstr="$(gettext "(32-bit)")"
++@@ -165,6 +180,7 @@ for OS in ${OSPROBED} ; do
++ ;;
++ esac
++
+++ found_other_os=1
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++ cat << EOF
++ menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
++@@ -195,6 +211,7 @@ EOF
++ ;;
++ efi)
++
+++ found_other_os=1
++ EFIPATH=${DEVICE#*@}
++ DEVICE=${DEVICE%@*}
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++@@ -243,6 +260,7 @@ EOF
++ [ "${prepare_boot_cache}" ] || continue
++ fi
++
+++ found_other_os=1
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++ recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
++ counter=1
++@@ -311,6 +329,7 @@ EOF
++ fi
++ ;;
++ hurd)
+++ found_other_os=1
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++ cat << EOF
++ menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
++@@ -353,3 +372,5 @@ EOF
++ ;;
++ esac
++ done
+++
+++adjust_timeout
--- /dev/null
--- /dev/null
++From daf0bee3fa3d2b20e54ba9eb3dae9bccd9031486 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@debian.org>
++Date: Mon, 13 Jan 2014 12:13:01 +0000
++Subject: Restore grub-mkdevicemap
++
++This is kind of a mess, requiring lots of OS-specific code to iterate
++over all possible devices. However, we use it in a number of scripts to
++discover devices and reimplementing those in terms of something else
++would be very complicated.
++
++Author: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
++Forwarded: no
++Last-Update: 2019-05-25
++
++Patch-Name: restore-mkdevicemap.patch
++---
++ Makefile.util.def | 17 +
++ docs/man/grub-mkdevicemap.h2m | 4 +
++ include/grub/util/deviceiter.h | 14 +
++ util/deviceiter.c | 1021 ++++++++++++++++++++++++++++++++
++ util/devicemap.c | 13 +
++ util/grub-mkdevicemap.c | 181 ++++++
++ 6 files changed, 1250 insertions(+)
++ create mode 100644 docs/man/grub-mkdevicemap.h2m
++ create mode 100644 include/grub/util/deviceiter.h
++ create mode 100644 util/deviceiter.c
++ create mode 100644 util/devicemap.c
++ create mode 100644 util/grub-mkdevicemap.c
++
++diff --git a/Makefile.util.def b/Makefile.util.def
++index 969d32f00..0029b9000 100644
++--- a/Makefile.util.def
+++++ b/Makefile.util.def
++@@ -324,6 +324,23 @@ program = {
++ condition = COND_GRUB_MKFONT;
++ };
++
+++program = {
+++ name = grub-mkdevicemap;
+++ installdir = sbin;
+++ mansection = 8;
+++
+++ common = util/grub-mkdevicemap.c;
+++ common = util/deviceiter.c;
+++ common = util/devicemap.c;
+++ common = grub-core/osdep/init.c;
+++
+++ ldadd = libgrubmods.a;
+++ ldadd = libgrubgcry.a;
+++ ldadd = libgrubkern.a;
+++ ldadd = grub-core/lib/gnulib/libgnu.a;
+++ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
+++};
+++
++ program = {
++ name = grub-probe;
++ installdir = sbin;
++diff --git a/docs/man/grub-mkdevicemap.h2m b/docs/man/grub-mkdevicemap.h2m
++new file mode 100644
++index 000000000..96cd6ee72
++--- /dev/null
+++++ b/docs/man/grub-mkdevicemap.h2m
++@@ -0,0 +1,4 @@
+++[NAME]
+++grub-mkdevicemap \- make a device map file automatically
+++[SEE ALSO]
+++.BR grub-probe (8)
++diff --git a/include/grub/util/deviceiter.h b/include/grub/util/deviceiter.h
++new file mode 100644
++index 000000000..85374978c
++--- /dev/null
+++++ b/include/grub/util/deviceiter.h
++@@ -0,0 +1,14 @@
+++#ifndef GRUB_DEVICEITER_MACHINE_UTIL_HEADER
+++#define GRUB_DEVICEITER_MACHINE_UTIL_HEADER 1
+++
+++#include <config.h>
+++
+++typedef int (*grub_util_iterate_devices_hook_t) (const char *name,
+++ int is_floppy, void *data);
+++
+++void grub_util_iterate_devices (grub_util_iterate_devices_hook_t hook,
+++ void *hook_data, int floppy_disks);
+++void grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy,
+++ int *num_fd, int *num_hd);
+++
+++#endif /* ! GRUB_DEVICEITER_MACHINE_UTIL_HEADER */
++diff --git a/util/deviceiter.c b/util/deviceiter.c
++new file mode 100644
++index 000000000..a4971ef42
++--- /dev/null
+++++ b/util/deviceiter.c
++@@ -0,0 +1,1021 @@
+++/* deviceiter.c - iterate over system devices */
+++/*
+++ * GRUB -- GRand Unified Bootloader
+++ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2011 Free Software Foundation, Inc.
+++ *
+++ * GRUB is free software: you can redistribute it and/or modify
+++ * it under the terms of the GNU General Public License as published by
+++ * the Free Software Foundation, either version 3 of the License, or
+++ * (at your option) any later version.
+++ *
+++ * GRUB is distributed in the hope that it will be useful,
+++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+++ * GNU General Public License for more details.
+++ *
+++ * You should have received a copy of the GNU General Public License
+++ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+++ */
+++
+++#include <config.h>
+++
+++#include <stdio.h>
+++#include <unistd.h>
+++#include <string.h>
+++#include <stdlib.h>
+++#include <sys/types.h>
+++#include <sys/stat.h>
+++#include <errno.h>
+++#include <fcntl.h>
+++#include <limits.h>
+++#include <dirent.h>
+++
+++#include <grub/util/misc.h>
+++#include <grub/util/deviceiter.h>
+++#include <grub/list.h>
+++#include <grub/misc.h>
+++#include <grub/emu/misc.h>
+++
+++#ifdef __linux__
+++# if !defined(__GLIBC__) || \
+++ ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
+++/* Maybe libc doesn't have large file support. */
+++# include <linux/unistd.h> /* _llseek */
+++# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
+++# include <sys/ioctl.h> /* ioctl */
+++# ifndef HDIO_GETGEO
+++# define HDIO_GETGEO 0x0301 /* get device geometry */
+++/* If HDIO_GETGEO is not defined, it is unlikely that hd_geometry is
+++ defined. */
+++struct hd_geometry
+++{
+++ unsigned char heads;
+++ unsigned char sectors;
+++ unsigned short cylinders;
+++ unsigned long start;
+++};
+++# endif /* ! HDIO_GETGEO */
+++# ifndef FLOPPY_MAJOR
+++# define FLOPPY_MAJOR 2 /* the major number for floppy */
+++# endif /* ! FLOPPY_MAJOR */
+++# ifndef MAJOR
+++# define MAJOR(dev) \
+++ ({ \
+++ unsigned long long __dev = (dev); \
+++ (unsigned) ((__dev >> 8) & 0xfff) \
+++ | ((unsigned int) (__dev >> 32) & ~0xfff); \
+++ })
+++# endif /* ! MAJOR */
+++# ifndef MINOR
+++# define MINOR(dev) \
+++ ({ \
+++ unsigned long long __dev = (dev); \
+++ (unsigned) (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); \
+++ })
+++# endif /* ! MINOR */
+++# ifndef CDROM_GET_CAPABILITY
+++# define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
+++# endif /* ! CDROM_GET_CAPABILITY */
+++# ifndef BLKGETSIZE
+++# define BLKGETSIZE _IO(0x12,96) /* return device size */
+++# endif /* ! BLKGETSIZE */
+++
+++#ifdef HAVE_DEVICE_MAPPER
+++# include <libdevmapper.h>
+++# pragma GCC diagnostic ignored "-Wcast-align"
+++#endif
+++#endif /* __linux__ */
+++
+++/* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
+++ kFreeBSD-based non-FreeBSD systems (e.g. GNU/kFreeBSD) */
+++#if defined(__FreeBSD__) && ! defined(__FreeBSD_kernel__)
+++# define __FreeBSD_kernel__
+++#endif
+++#ifdef __FreeBSD_kernel__
+++ /* Obtain version of kFreeBSD headers */
+++# include <osreldate.h>
+++# ifndef __FreeBSD_kernel_version
+++# define __FreeBSD_kernel_version __FreeBSD_version
+++# endif
+++
+++ /* Runtime detection of kernel */
+++# include <sys/utsname.h>
+++static int
+++get_kfreebsd_version (void)
+++{
+++ struct utsname uts;
+++ int major;
+++ int minor;
+++ int v[2];
+++
+++ uname (&uts);
+++ sscanf (uts.release, "%d.%d", &major, &minor);
+++
+++ if (major >= 9)
+++ major = 9;
+++ if (major >= 5)
+++ {
+++ v[0] = minor/10; v[1] = minor%10;
+++ }
+++ else
+++ {
+++ v[0] = minor%10; v[1] = minor/10;
+++ }
+++ return major*100000+v[0]*10000+v[1]*1000;
+++}
+++#endif /* __FreeBSD_kernel__ */
+++
+++#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+++# include <sys/ioctl.h> /* ioctl */
+++# include <sys/disklabel.h>
+++# include <sys/cdio.h> /* CDIOCCLRDEBUG */
+++# if defined(__FreeBSD_kernel__)
+++# include <sys/param.h>
+++# if __FreeBSD_kernel_version >= 500040
+++# include <sys/disk.h>
+++# endif
+++# endif /* __FreeBSD_kernel__ */
+++#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */
+++
+++#ifdef HAVE_OPENDISK
+++# include <util.h>
+++#endif /* HAVE_OPENDISK */
+++
+++#ifdef __linux__
+++/* Check if we have devfs support. */
+++static int
+++have_devfs (void)
+++{
+++ struct stat st;
+++ return stat ("/dev/.devfsd", &st) == 0;
+++}
+++#endif /* __linux__ */
+++
+++/* These three functions are quite different among OSes. */
+++static void
+++get_floppy_disk_name (char *name, int unit)
+++{
+++#if defined(__linux__)
+++ /* GNU/Linux */
+++ if (have_devfs ())
+++ sprintf (name, "/dev/floppy/%d", unit);
+++ else
+++ sprintf (name, "/dev/fd%d", unit);
+++#elif defined(__GNU__)
+++ /* GNU/Hurd */
+++ sprintf (name, "/dev/fd%d", unit);
+++#elif defined(__FreeBSD_kernel__)
+++ /* kFreeBSD */
+++ if (get_kfreebsd_version () >= 400000)
+++ sprintf (name, "/dev/fd%d", unit);
+++ else
+++ sprintf (name, "/dev/rfd%d", unit);
+++#elif defined(__NetBSD__)
+++ /* NetBSD */
+++ /* opendisk() doesn't work for floppies. */
+++ sprintf (name, "/dev/rfd%da", unit);
+++#elif defined(__OpenBSD__)
+++ /* OpenBSD */
+++ sprintf (name, "/dev/rfd%dc", unit);
+++#elif defined(__QNXNTO__)
+++ /* QNX RTP */
+++ sprintf (name, "/dev/fd%d", unit);
+++#elif defined(__CYGWIN__)
+++ /* Cygwin */
+++ sprintf (name, "/dev/fd%d", unit);
+++#elif defined(__MINGW32__)
+++ (void) unit;
+++ *name = 0;
+++#else
+++# warning "BIOS floppy drives cannot be guessed in your operating system."
+++ /* Set NAME to a bogus string. */
+++ *name = 0;
+++#endif
+++}
+++
+++static void
+++get_ide_disk_name (char *name, int unit)
+++{
+++#if defined(__linux__)
+++ /* GNU/Linux */
+++ sprintf (name, "/dev/hd%c", unit + 'a');
+++#elif defined(__GNU__)
+++ /* GNU/Hurd */
+++ sprintf (name, "/dev/hd%d", unit);
+++#elif defined(__FreeBSD_kernel__)
+++ /* kFreeBSD */
+++ if (get_kfreebsd_version () >= 400000)
+++ sprintf (name, "/dev/ad%d", unit);
+++ else
+++ sprintf (name, "/dev/rwd%d", unit);
+++#elif defined(__NetBSD__) && defined(HAVE_OPENDISK)
+++ /* NetBSD */
+++ char shortname[16];
+++ int fd;
+++
+++ sprintf (shortname, "wd%d", unit);
+++ fd = opendisk (shortname, O_RDONLY, name,
+++ 16, /* length of NAME */
+++ 0 /* char device */
+++ );
+++ close (fd);
+++#elif defined(__OpenBSD__)
+++ /* OpenBSD */
+++ sprintf (name, "/dev/rwd%dc", unit);
+++#elif defined(__QNXNTO__)
+++ /* QNX RTP */
+++ /* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could
+++ contain SCSI disks. */
+++ sprintf (name, "/dev/hd%d", unit);
+++#elif defined(__CYGWIN__)
+++ /* Cygwin emulates all disks as /dev/sdX. */
+++ (void) unit;
+++ *name = 0;
+++#elif defined(__MINGW32__)
+++ sprintf (name, "//./PHYSICALDRIVE%d", unit);
+++#else
+++# warning "BIOS IDE drives cannot be guessed in your operating system."
+++ /* Set NAME to a bogus string. */
+++ *name = 0;
+++#endif
+++}
+++
+++static void
+++get_scsi_disk_name (char *name, int unit)
+++{
+++#if defined(__linux__)
+++ /* GNU/Linux */
+++ sprintf (name, "/dev/sd%c", unit + 'a');
+++#elif defined(__GNU__)
+++ /* GNU/Hurd */
+++ sprintf (name, "/dev/sd%d", unit);
+++#elif defined(__FreeBSD_kernel__)
+++ /* kFreeBSD */
+++ if (get_kfreebsd_version () >= 400000)
+++ sprintf (name, "/dev/da%d", unit);
+++ else
+++ sprintf (name, "/dev/rda%d", unit);
+++#elif defined(__NetBSD__) && defined(HAVE_OPENDISK)
+++ /* NetBSD */
+++ char shortname[16];
+++ int fd;
+++
+++ sprintf (shortname, "sd%d", unit);
+++ fd = opendisk (shortname, O_RDONLY, name,
+++ 16, /* length of NAME */
+++ 0 /* char device */
+++ );
+++ close (fd);
+++#elif defined(__OpenBSD__)
+++ /* OpenBSD */
+++ sprintf (name, "/dev/rsd%dc", unit);
+++#elif defined(__QNXNTO__)
+++ /* QNX RTP */
+++ /* QNX RTP doesn't distinguish SCSI from IDE, so it is better to
+++ disable the detection of SCSI disks here. */
+++ *name = 0;
+++#elif defined(__CYGWIN__)
+++ /* Cygwin emulates all disks as /dev/sdX. */
+++ sprintf (name, "/dev/sd%c", unit + 'a');
+++#elif defined(__MINGW32__)
+++ (void) unit;
+++ *name = 0;
+++#else
+++# warning "BIOS SCSI drives cannot be guessed in your operating system."
+++ /* Set NAME to a bogus string. */
+++ *name = 0;
+++#endif
+++}
+++
+++#ifdef __FreeBSD_kernel__
+++static void
+++get_ada_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/ada%d", unit);
+++}
+++
+++static void
+++get_ataraid_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/ar%d", unit);
+++}
+++
+++static void
+++get_mfi_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/mfid%d", unit);
+++}
+++
+++static void
+++get_virtio_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/vtbd%d", unit);
+++}
+++
+++static void
+++get_xvd_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/xbd%d", unit);
+++}
+++#endif
+++
+++#ifdef __linux__
+++static void
+++get_virtio_disk_name (char *name, int unit)
+++{
+++#ifdef __sparc__
+++ sprintf (name, "/dev/vdisk%c", unit + 'a');
+++#else
+++ sprintf (name, "/dev/vd%c", unit + 'a');
+++#endif
+++}
+++
+++static void
+++get_dac960_disk_name (char *name, int controller, int drive)
+++{
+++ sprintf (name, "/dev/rd/c%dd%d", controller, drive);
+++}
+++
+++static void
+++get_acceleraid_disk_name (char *name, int controller, int drive)
+++{
+++ sprintf (name, "/dev/rs/c%dd%d", controller, drive);
+++}
+++
+++static void
+++get_ataraid_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/ataraid/d%c", unit + '0');
+++}
+++
+++static void
+++get_i2o_disk_name (char *name, char unit)
+++{
+++ sprintf (name, "/dev/i2o/hd%c", unit);
+++}
+++
+++static void
+++get_cciss_disk_name (char *name, int controller, int drive)
+++{
+++ sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
+++}
+++
+++static void
+++get_ida_disk_name (char *name, int controller, int drive)
+++{
+++ sprintf (name, "/dev/ida/c%dd%d", controller, drive);
+++}
+++
+++static void
+++get_mmc_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/mmcblk%d", unit);
+++}
+++
+++static void
+++get_xvd_disk_name (char *name, int unit)
+++{
+++ sprintf (name, "/dev/xvd%c", unit + 'a');
+++}
+++
+++static void
+++get_nvme_disk_name (char *name, int controller, int namespace)
+++{
+++ sprintf (name, "/dev/nvme%dn%d", controller, namespace);
+++}
+++#endif
+++
+++static struct seen_device
+++{
+++ struct seen_device *next;
+++ struct seen_device **prev;
+++ const char *name;
+++} *seen;
+++
+++/* Check if DEVICE can be read. Skip any DEVICE that we have already seen.
+++ If an error occurs, return zero, otherwise return non-zero. */
+++static int
+++check_device_readable_unique (const char *device)
+++{
+++ char *real_device;
+++ char buf[512];
+++ FILE *fp;
+++ struct seen_device *seen_elt;
+++
+++ /* If DEVICE is empty, just return error. */
+++ if (*device == 0)
+++ return 0;
+++
+++ /* Have we seen this device already? */
+++ real_device = canonicalize_file_name (device);
+++ if (! real_device)
+++ return 0;
+++ if (grub_named_list_find (GRUB_AS_NAMED_LIST (seen), real_device))
+++ {
+++ grub_dprintf ("deviceiter", "Already seen %s (%s)\n",
+++ device, real_device);
+++ goto fail;
+++ }
+++
+++ fp = fopen (device, "r");
+++ if (! fp)
+++ {
+++ switch (errno)
+++ {
+++#ifdef ENOMEDIUM
+++ case ENOMEDIUM:
+++# if 0
+++ /* At the moment, this finds only CDROMs, which can't be
+++ read anyway, so leave it out. Code should be
+++ reactivated if `removable disks' and CDROMs are
+++ supported. */
+++ /* Accept it, it may be inserted. */
+++ return 1;
+++# endif
+++ break;
+++#endif /* ENOMEDIUM */
+++ default:
+++ /* Break case and leave. */
+++ break;
+++ }
+++ /* Error opening the device. */
+++ goto fail;
+++ }
+++
+++ /* Make sure CD-ROMs don't get assigned a BIOS disk number
+++ before SCSI disks! */
+++#ifdef __linux__
+++# ifdef CDROM_GET_CAPABILITY
+++ if (ioctl (fileno (fp), CDROM_GET_CAPABILITY, 0) >= 0)
+++ goto fail;
+++# else /* ! CDROM_GET_CAPABILITY */
+++ /* Check if DEVICE is a CD-ROM drive by the HDIO_GETGEO ioctl. */
+++ {
+++ struct hd_geometry hdg;
+++ struct stat st;
+++
+++ if (fstat (fileno (fp), &st))
+++ goto fail;
+++
+++ /* If it is a block device and isn't a floppy, check if HDIO_GETGEO
+++ succeeds. */
+++ if (S_ISBLK (st.st_mode)
+++ && MAJOR (st.st_rdev) != FLOPPY_MAJOR
+++ && ioctl (fileno (fp), HDIO_GETGEO, &hdg))
+++ goto fail;
+++ }
+++# endif /* ! CDROM_GET_CAPABILITY */
+++#endif /* __linux__ */
+++
+++#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+++# ifdef CDIOCCLRDEBUG
+++ if (ioctl (fileno (fp), CDIOCCLRDEBUG, 0) >= 0)
+++ goto fail;
+++# endif /* CDIOCCLRDEBUG */
+++#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */
+++
+++ /* Attempt to read the first sector. */
+++ if (fread (buf, 1, 512, fp) != 512)
+++ {
+++ fclose (fp);
+++ goto fail;
+++ }
+++
+++ /* Remember that we've seen this device. */
+++ seen_elt = xmalloc (sizeof (*seen_elt));
+++ seen_elt->name = real_device; /* steal memory */
+++ grub_list_push (GRUB_AS_LIST_P (&seen), GRUB_AS_LIST (seen_elt));
+++
+++ fclose (fp);
+++ return 1;
+++
+++fail:
+++ free (real_device);
+++ return 0;
+++}
+++
+++static void
+++clear_seen_devices (void)
+++{
+++ while (seen)
+++ {
+++ struct seen_device *seen_elt = seen;
+++ seen = seen->next;
+++ free (seen_elt);
+++ }
+++ seen = NULL;
+++}
+++
+++#ifdef __linux__
+++struct device
+++{
+++ char *stable;
+++ char *kernel;
+++};
+++
+++/* Sort by the kernel name for preference since that most closely matches
+++ older device.map files, but sort by stable by-id names as a fallback.
+++ This is because /dev/disk/by-id/ usually has a few alternative
+++ identifications of devices (e.g. ATA vs. SATA).
+++ check_device_readable_unique will ensure that we only get one for any
+++ given disk, but sort the list so that the choice of which one we get is
+++ stable. */
+++static int
+++compare_devices (const void *a, const void *b)
+++{
+++ const struct device *left = (const struct device *) a;
+++ const struct device *right = (const struct device *) b;
+++
+++ if (left->kernel && right->kernel)
+++ {
+++ int ret = strcmp (left->kernel, right->kernel);
+++ if (ret)
+++ return ret;
+++ }
+++
+++ return strcmp (left->stable, right->stable);
+++}
+++#endif /* __linux__ */
+++
+++void
+++grub_util_iterate_devices (int (*hook) (const char *, int, void *), void *hook_data,
+++ int floppy_disks)
+++{
+++ int i;
+++
+++ clear_seen_devices ();
+++
+++ /* Floppies. */
+++ for (i = 0; i < floppy_disks; i++)
+++ {
+++ char name[32];
+++ struct stat st;
+++
+++ get_floppy_disk_name (name, i);
+++ if (stat (name, &st) < 0)
+++ break;
+++ /* In floppies, write the map, whether check_device_readable_unique
+++ succeeds or not, because the user just may not insert floppies. */
+++ if (hook (name, 1, hook_data))
+++ goto out;
+++ }
+++
+++#ifdef __linux__
+++ {
+++ DIR *dir = opendir ("/dev/disk/by-id");
+++
+++ if (dir)
+++ {
+++ struct dirent *entry;
+++ struct device *devs;
+++ size_t devs_len = 0, devs_max = 1024, dev;
+++
+++ devs = xmalloc (devs_max * sizeof (*devs));
+++
+++ /* Dump all the directory entries into names, resizing if
+++ necessary. */
+++ for (entry = readdir (dir); entry; entry = readdir (dir))
+++ {
+++ /* Skip current and parent directory entries. */
+++ if (strcmp (entry->d_name, ".") == 0 ||
+++ strcmp (entry->d_name, "..") == 0)
+++ continue;
+++ /* Skip partition entries. */
+++ if (strstr (entry->d_name, "-part"))
+++ continue;
+++ /* Skip device-mapper entries; we'll handle the ones we want
+++ later. */
+++ if (strncmp (entry->d_name, "dm-", sizeof ("dm-") - 1) == 0)
+++ continue;
+++ /* Skip RAID entries; they are handled by upper layers. */
+++ if (strncmp (entry->d_name, "md-", sizeof ("md-") - 1) == 0)
+++ continue;
+++ if (devs_len >= devs_max)
+++ {
+++ devs_max *= 2;
+++ devs = xrealloc (devs, devs_max * sizeof (*devs));
+++ }
+++ devs[devs_len].stable =
+++ xasprintf ("/dev/disk/by-id/%s", entry->d_name);
+++ devs[devs_len].kernel =
+++ canonicalize_file_name (devs[devs_len].stable);
+++ devs_len++;
+++ }
+++
+++ qsort (devs, devs_len, sizeof (*devs), &compare_devices);
+++
+++ closedir (dir);
+++
+++ /* Now add all the devices in sorted order. */
+++ for (dev = 0; dev < devs_len; ++dev)
+++ {
+++ if (check_device_readable_unique (devs[dev].stable))
+++ {
+++ if (hook (devs[dev].stable, 0, hook_data))
+++ goto out;
+++ }
+++ free (devs[dev].stable);
+++ free (devs[dev].kernel);
+++ }
+++ free (devs);
+++ }
+++ }
+++
+++ if (have_devfs ())
+++ {
+++ i = 0;
+++ while (1)
+++ {
+++ char discn[32];
+++ char name[PATH_MAX];
+++ struct stat st;
+++
+++ /* Linux creates symlinks "/dev/discs/discN" for convenience.
+++ The way to number disks is the same as GRUB's. */
+++ sprintf (discn, "/dev/discs/disc%d", i++);
+++ if (stat (discn, &st) < 0)
+++ break;
+++
+++ if (realpath (discn, name))
+++ {
+++ strcat (name, "/disc");
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ goto out;
+++ }
+++#endif /* __linux__ */
+++
+++ /* IDE disks. */
+++ for (i = 0; i < 96; i++)
+++ {
+++ char name[16];
+++
+++ get_ide_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++#ifdef __FreeBSD_kernel__
+++ /* IDE disks using ATA Direct Access driver. */
+++ if (get_kfreebsd_version () >= 800000)
+++ for (i = 0; i < 96; i++)
+++ {
+++ char name[16];
+++
+++ get_ada_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* ATARAID disks. */
+++ for (i = 0; i < 8; i++)
+++ {
+++ char name[20];
+++
+++ get_ataraid_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* LSI MegaRAID SAS. */
+++ for (i = 0; i < 32; i++)
+++ {
+++ char name[20];
+++
+++ get_mfi_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* Virtio disks. */
+++ for (i = 0; i < 96; i++)
+++ {
+++ char name[16];
+++
+++ get_virtio_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* Xen virtual block devices. */
+++ for (i = 0; i < 96; i++)
+++ {
+++ char name[16];
+++
+++ get_xvd_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++#endif
+++
+++#ifdef __linux__
+++ /* Virtio disks. */
+++ for (i = 0; i < 26; i++)
+++ {
+++ char name[16];
+++
+++ get_virtio_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* ATARAID disks. */
+++ for (i = 0; i < 8; i++)
+++ {
+++ char name[20];
+++
+++ get_ataraid_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* Xen virtual block devices. */
+++ for (i = 0; i < 26; i++)
+++ {
+++ char name[16];
+++
+++ get_xvd_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++#endif /* __linux__ */
+++
+++ /* The rest is SCSI disks. */
+++ for (i = 0; i < 48; i++)
+++ {
+++ char name[16];
+++
+++ get_scsi_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++#ifdef __linux__
+++ /* This is for DAC960 - we have
+++ /dev/rd/c<controller>d<logical drive>p<partition>.
+++
+++ DAC960 driver currently supports up to 8 controllers, 32 logical
+++ drives, and 7 partitions. */
+++ {
+++ int controller, drive;
+++
+++ for (controller = 0; controller < 8; controller++)
+++ {
+++ for (drive = 0; drive < 15; drive++)
+++ {
+++ char name[24];
+++
+++ get_dac960_disk_name (name, controller, drive);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++ }
+++
+++ /* This is for Mylex Acceleraid - we have
+++ /dev/rd/c<controller>d<logical drive>p<partition>. */
+++ {
+++ int controller, drive;
+++
+++ for (controller = 0; controller < 8; controller++)
+++ {
+++ for (drive = 0; drive < 15; drive++)
+++ {
+++ char name[24];
+++
+++ get_acceleraid_disk_name (name, controller, drive);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++ }
+++
+++ /* This is for CCISS - we have
+++ /dev/cciss/c<controller>d<logical drive>p<partition>. */
+++ {
+++ int controller, drive;
+++
+++ for (controller = 0; controller < 3; controller++)
+++ {
+++ for (drive = 0; drive < 16; drive++)
+++ {
+++ char name[24];
+++
+++ get_cciss_disk_name (name, controller, drive);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++ }
+++
+++ /* This is for Compaq Intelligent Drive Array - we have
+++ /dev/ida/c<controller>d<logical drive>p<partition>. */
+++ {
+++ int controller, drive;
+++
+++ for (controller = 0; controller < 3; controller++)
+++ {
+++ for (drive = 0; drive < 16; drive++)
+++ {
+++ char name[24];
+++
+++ get_ida_disk_name (name, controller, drive);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++ }
+++
+++ /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
+++ {
+++ char unit;
+++
+++ for (unit = 'a'; unit < 'f'; unit++)
+++ {
+++ char name[24];
+++
+++ get_i2o_disk_name (name, unit);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++
+++ /* MultiMediaCard (MMC). */
+++ for (i = 0; i < 10; i++)
+++ {
+++ char name[16];
+++
+++ get_mmc_disk_name (name, i);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++
+++ /* This is for standard NVMe controllers
+++ /dev/nvme<controller>n<namespace>p<partition>. No idea about
+++ actual limits of how many controllers a system can have and/or
+++ how many namespace that would be, 10 for now. */
+++ {
+++ int controller, namespace;
+++
+++ for (controller = 0; controller < 10; controller++)
+++ {
+++ for (namespace = 0; namespace < 10; namespace++)
+++ {
+++ char name[16];
+++
+++ get_nvme_disk_name (name, controller, namespace);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ goto out;
+++ }
+++ }
+++ }
+++ }
+++
+++# ifdef HAVE_DEVICE_MAPPER
+++# define dmraid_check(cond, ...) \
+++ if (! (cond)) \
+++ { \
+++ grub_dprintf ("deviceiter", __VA_ARGS__); \
+++ goto dmraid_end; \
+++ }
+++
+++ /* DM-RAID. */
+++ if (grub_device_mapper_supported ())
+++ {
+++ struct dm_tree *tree = NULL;
+++ struct dm_task *task = NULL;
+++ struct dm_names *names = NULL;
+++ unsigned int next = 0;
+++ void *top_handle, *second_handle;
+++ struct dm_tree_node *root, *top, *second;
+++
+++ /* Build DM tree for all devices. */
+++ tree = dm_tree_create ();
+++ dmraid_check (tree, "dm_tree_create failed\n");
+++ task = dm_task_create (DM_DEVICE_LIST);
+++ dmraid_check (task, "dm_task_create failed\n");
+++ dmraid_check (dm_task_run (task), "dm_task_run failed\n");
+++ names = dm_task_get_names (task);
+++ dmraid_check (names, "dm_task_get_names failed\n");
+++ dmraid_check (names->dev, "No DM devices found\n");
+++ do
+++ {
+++ names = (struct dm_names *) ((char *) names + next);
+++ dmraid_check (dm_tree_add_dev (tree, MAJOR (names->dev),
+++ MINOR (names->dev)),
+++ "dm_tree_add_dev (%s) failed\n", names->name);
+++ next = names->next;
+++ }
+++ while (next);
+++
+++ /* Walk the second-level children of the inverted tree; that is, devices
+++ which are directly composed of non-DM devices such as hard disks.
+++ This class includes all DM-RAID disks and excludes all DM-RAID
+++ partitions. */
+++ root = dm_tree_find_node (tree, 0, 0);
+++ top_handle = NULL;
+++ top = dm_tree_next_child (&top_handle, root, 1);
+++ while (top)
+++ {
+++ second_handle = NULL;
+++ second = dm_tree_next_child (&second_handle, top, 1);
+++ while (second)
+++ {
+++ const char *node_name, *node_uuid;
+++ char *name;
+++
+++ node_name = dm_tree_node_get_name (second);
+++ dmraid_check (node_name, "dm_tree_node_get_name failed\n");
+++ node_uuid = dm_tree_node_get_uuid (second);
+++ dmraid_check (node_uuid, "dm_tree_node_get_uuid failed\n");
+++ if (strstr (node_uuid, "DMRAID-") == 0)
+++ {
+++ grub_dprintf ("deviceiter", "%s is not DM-RAID\n", node_name);
+++ goto dmraid_next_child;
+++ }
+++
+++ name = xasprintf ("/dev/mapper/%s", node_name);
+++ if (check_device_readable_unique (name))
+++ {
+++ if (hook (name, 0, hook_data))
+++ {
+++ free (name);
+++ if (task)
+++ dm_task_destroy (task);
+++ if (tree)
+++ dm_tree_free (tree);
+++ goto out;
+++ }
+++ }
+++ free (name);
+++
+++dmraid_next_child:
+++ second = dm_tree_next_child (&second_handle, top, 1);
+++ }
+++ top = dm_tree_next_child (&top_handle, root, 1);
+++ }
+++
+++dmraid_end:
+++ if (task)
+++ dm_task_destroy (task);
+++ if (tree)
+++ dm_tree_free (tree);
+++ }
+++# endif /* HAVE_DEVICE_MAPPER */
+++#endif /* __linux__ */
+++
+++out:
+++ clear_seen_devices ();
+++}
++diff --git a/util/devicemap.c b/util/devicemap.c
++new file mode 100644
++index 000000000..c61864420
++--- /dev/null
+++++ b/util/devicemap.c
++@@ -0,0 +1,13 @@
+++#include <stdio.h>
+++
+++#include <grub/util/deviceiter.h>
+++
+++void
+++grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy,
+++ int *num_fd, int *num_hd)
+++{
+++ if (is_floppy)
+++ fprintf (fp, "(fd%d)\t%s\n", (*num_fd)++, name);
+++ else
+++ fprintf (fp, "(hd%d)\t%s\n", (*num_hd)++, name);
+++}
++diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c
++new file mode 100644
++index 000000000..c4bbdbf69
++--- /dev/null
+++++ b/util/grub-mkdevicemap.c
++@@ -0,0 +1,181 @@
+++/* grub-mkdevicemap.c - make a device map file automatically */
+++/*
+++ * GRUB -- GRand Unified Bootloader
+++ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc.
+++ *
+++ * GRUB is free software: you can redistribute it and/or modify
+++ * it under the terms of the GNU General Public License as published by
+++ * the Free Software Foundation, either version 3 of the License, or
+++ * (at your option) any later version.
+++ *
+++ * GRUB is distributed in the hope that it will be useful,
+++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+++ * GNU General Public License for more details.
+++ *
+++ * You should have received a copy of the GNU General Public License
+++ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+++ */
+++
+++#include <config.h>
+++
+++#include <stdio.h>
+++#include <unistd.h>
+++#include <string.h>
+++#include <stdlib.h>
+++#include <sys/types.h>
+++#include <sys/stat.h>
+++#include <errno.h>
+++#include <fcntl.h>
+++#include <limits.h>
+++
+++#include <grub/emu/misc.h>
+++#include <grub/emu/hostdisk.h>
+++#include <grub/util/misc.h>
+++#include <grub/util/deviceiter.h>
+++#include <grub/env.h>
+++#include <grub/i18n.h>
+++
+++#define _GNU_SOURCE 1
+++#include <getopt.h>
+++
+++#include "progname.h"
+++
+++/* Context for make_device_map. */
+++struct make_device_map_ctx
+++{
+++ FILE *fp;
+++ int num_fd;
+++ int num_hd;
+++};
+++
+++/* Helper for make_device_map. */
+++static int
+++process_device (const char *name, int is_floppy, void *data)
+++{
+++ struct make_device_map_ctx *ctx = data;
+++
+++ grub_util_emit_devicemap_entry (ctx->fp, (char *) name,
+++ is_floppy, &ctx->num_fd, &ctx->num_hd);
+++ return 0;
+++}
+++
+++static void
+++make_device_map (const char *device_map, int floppy_disks)
+++{
+++ struct make_device_map_ctx ctx = {
+++ .num_fd = 0,
+++ .num_hd = 0
+++ };
+++
+++ if (strcmp (device_map, "-") == 0)
+++ ctx.fp = stdout;
+++ else
+++ ctx.fp = fopen (device_map, "w");
+++
+++ if (! ctx.fp)
+++ grub_util_error (_("cannot open %s"), device_map);
+++
+++ grub_util_iterate_devices (process_device, &ctx, floppy_disks);
+++
+++ if (ctx.fp != stdout)
+++ fclose (ctx.fp);
+++}
+++
+++static struct option options[] =
+++ {
+++ {"device-map", required_argument, 0, 'm'},
+++ {"probe-second-floppy", no_argument, 0, 's'},
+++ {"no-floppy", no_argument, 0, 'n'},
+++ {"help", no_argument, 0, 'h'},
+++ {"version", no_argument, 0, 'V'},
+++ {"verbose", no_argument, 0, 'v'},
+++ {0, 0, 0, 0}
+++ };
+++
+++static void
+++usage (int status)
+++{
+++ if (status)
+++ fprintf (stderr,
+++ _("Try `%s --help' for more information.\n"), program_name);
+++ else
+++ printf (_("\
+++Usage: %s [OPTION]...\n\
+++\n\
+++Generate a device map file automatically.\n\
+++\n\
+++ -n, --no-floppy do not probe any floppy drive\n\
+++ -s, --probe-second-floppy probe the second floppy drive\n\
+++ -m, --device-map=FILE use FILE as the device map [default=%s]\n\
+++ -h, --help display this message and exit\n\
+++ -V, --version print version information and exit\n\
+++ -v, --verbose print verbose messages\n\
+++\n\
+++Report bugs to <%s>.\n\
+++"), program_name,
+++ DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
+++
+++ exit (status);
+++}
+++
+++int
+++main (int argc, char *argv[])
+++{
+++ char *dev_map = 0;
+++ int floppy_disks = 1;
+++
+++ grub_util_host_init (&argc, &argv);
+++
+++ /* Check for options. */
+++ while (1)
+++ {
+++ int c = getopt_long (argc, argv, "snm:r:hVv", options, 0);
+++
+++ if (c == -1)
+++ break;
+++ else
+++ switch (c)
+++ {
+++ case 'm':
+++ if (dev_map)
+++ free (dev_map);
+++
+++ dev_map = xstrdup (optarg);
+++ break;
+++
+++ case 'n':
+++ floppy_disks = 0;
+++ break;
+++
+++ case 's':
+++ floppy_disks = 2;
+++ break;
+++
+++ case 'h':
+++ usage (0);
+++ break;
+++
+++ case 'V':
+++ printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
+++ return 0;
+++
+++ case 'v':
+++ verbosity++;
+++ break;
+++
+++ default:
+++ usage (1);
+++ break;
+++ }
+++ }
+++
+++ if (verbosity > 1)
+++ grub_env_set ("debug", "all");
+++
+++ make_device_map (dev_map ? : DEFAULT_DEVICE_MAP, floppy_disks);
+++
+++ free (dev_map);
+++
+++ return 0;
+++}
--- /dev/null
- replace-libgcrypt-crc.patch
- olpc_prefix_hack.patch
- core_in_fs.patch
- dpkg_version_comparison.patch
- grub_legacy_0_based_partitions.patch
- disable_floppies.patch
- grub.cfg_400.patch
- gfxpayload_keep_default.patch
- install_stage2_confusion.patch
- mkrescue_efi_modules.patch
- mkconfig_loopback.patch
- restore_mkdevicemap.patch
- gettext_quiet.patch
- mkconfig_mid_upgrade.patch
- install_efi_fallback.patch
- mkconfig_ubuntu_recovery.patch
- install_locale_langpack.patch
- mkconfig_nonexistent_loopback.patch
- no_insmod_on_sb.patch
- default_grub_d.patch
- blacklist_1440x900x32.patch
- uefi_firmware_setup.patch
- mkconfig_ubuntu_distributor.patch
++olpc-prefix-hack.patch
++core-in-fs.patch
++dpkg-version-comparison.patch
++grub-legacy-0-based-partitions.patch
++disable-floppies.patch
++grub.cfg-400.patch
++gfxpayload-keep-default.patch
++install-stage2-confusion.patch
++mkrescue-efi-modules.patch
++mkconfig-loopback.patch
++restore-mkdevicemap.patch
++gettext-quiet.patch
++mkconfig-mid-upgrade.patch
++install-efi-fallback.patch
++mkconfig-ubuntu-recovery.patch
++install-locale-langpack.patch
++mkconfig-nonexistent-loopback.patch
++no-insmod-on-sb.patch
++default-grub-d.patch
++blacklist-1440x900x32.patch
++uefi-firmware-setup.patch
++mkconfig-ubuntu-distributor.patch
+linuxefi.patch
- linuxefi_debug.patch
- linuxefi_require_shim.patch
- linuxefi_non_sb_fallback.patch
- mkconfig_signed_kernel.patch
- install_signed.patch
- sleep_shift.patch
- wubi_no_windows.patch
- maybe_quiet.patch
- install_efi_ubuntu_flavours.patch
- quick_boot.patch
- gfxpayload_dynamic.patch
- vt_handoff.patch
- probe_fusionio.patch
- ignore_grub_func_test_failures.patch
- mkconfig_recovery_title.patch
- skip_gettext_strings_test.patch
- install_powerpc_machtypes.patch
++linuxefi-use-if-secure-boot.patch
++mkconfig-signed-kernel.patch
++install-signed.patch
++sleep-shift.patch
++wubi-no-windows.patch
++maybe-quiet.patch
++install-efi-ubuntu-flavours.patch
++quick-boot.patch
++gfxpayload-dynamic.patch
++vt-handoff.patch
++probe-fusionio.patch
++ignore-grub_func_test-failures.patch
++mkconfig-recovery-title.patch
++install-powerpc-machtypes.patch
+ieee1275-clear-reset.patch
+ppc64el-disable-vsx.patch
+grub-install-pvxen-paths.patch
+insmod-xzio-and-lzopio-on-xen.patch
+grub-install-extra-removable.patch
- mkconfig_other_inits.patch
- syslinux-test-out-of-tree.patch
- zpool_full_device_name.patch
- misc-fix-invalid-char-strtol.patch
- net_read_bracketed_ipv6_addr.patch
- bootp_new_net_bootp6_command.patch
- efinet_uefi_ipv6_pxe_support.patch
- bootp_process_dhcpack_http_boot.patch
- efinet_set_network_from_uefi_devpath.patch
- efinet_set_dns_from_uefi_proto.patch
- grub-install-efibootmgr-check.patch
- ext4_feature_encrypt.patch
- tsc_efi_default_to_pmtimer.patch
- freetype-capitalise-variables.patch
- freetype-pkg-config.patch
- fix-yylex-build.patch
- sparc64-support.patch
- printf-unit-test-gcc7.patch
- xen-multiboot2.patch
- linuxefi_disable_sb_fallback.patch
- fix_lockdown.patch
- tests-disable-sercon-in-seabios.patch
- tests-fix-uhci-qemu-options.patch
- R_X86_64_PLT32.patch
++mkconfig-other-inits.patch
++zpool-full-device-name.patch
++net-read-bracketed-ipv6-addr.patch
++bootp-new-net_bootp6-command.patch
++efinet-uefi-ipv6-pxe-support.patch
++bootp-process-dhcpack-http-boot.patch
++efinet-set-network-from-uefi-devpath.patch
++efinet-set-dns-from-uefi-proto.patch
++fix-lockdown.patch
+skip-grub_cmd_set_date.patch
- add_ext_lfb_base_support.patch
- zfs-root-dataset.patch
+bash-completion-drop-have-checks.patch
- efi-refactor-grub_efi_allocate_pages.patch
- efi-remove-grub_efi_allocate_pages.patch
- efi-move-fdt-helper-library.patch
- efi-add-GRUB_PE32_MAGIC-definition.patch
- arm64-linux-loader-improve-type-portability.patch
- efi-change-heap-allocation-type.patch
- arm64-efi-move-EFI_PAGE-definitions.patch
- linux-h-guards.patch
- GRUB_LINUX_MAGIC_SIGNATURE-arch-specific.patch
- i386-linux_kernel_header-arch-specific.patch
- arm64-align-linux_kernel_header-with-i386.patch
- arm64-align-linux-magic-macro-with-i386.patch
- arm-switch-linux-loader-to-linux_arm_kernel_header.patch
- arm-linux-h-safe-for-non-native.patch
- file-definitions-from-arm-linux-h.patch
- file-definitions-from-arm64-linux-h.patch
- efi-add-central-copy-of-grub_efi_find_mmap_size.patch
- efi-add-grub_efi_get_ram_base-for-arm64.patch
- arm64-linux-loader-renames.patch
- arm-efi-switch-to-arm64-linux-loader.patch
- arm-delete-unused-efi-support-from-loader-arm.patch
- efi-restrict-arm-arm64-linux-loader-initrd-placement.patch
- fdt-move-prop_entry_size-to-fdt-h.patch
- efi-fdt-set-address-size-cells-to-2-for-empty-tree.patch
- linuxefi-update-to-new-interfaces.patch
- gcc-8-packed-not-aligned.patch
+linuxefi-skip-validation-without-secure-boot.patch
- efi-fdt-do-not-copy-random-memory.patch
- xen-pvh-add-headers.patch
- xen-pvh-rsdp-boot-params.patch
- xen-pvh-refactor-grant-tab-init.patch
- xen-pvh-prepare-common-code.patch
- xen-pvh-add-dummy-headers.patch
- xen-pvh-rearrange-init.patch
- xen-pvh-ptr2mfn.patch
- xen-pvh-offsets.patch
- xen-pvh-basic-hooks.patch
- xen-pvh-boot-entry.patch
- xen-pvh-setup-hypercall-page.patch
- xen-pvh-get-memory-map.patch
- xen-pvh-setup-data.patch
- xen-pvh-init-memory-regions.patch
- xen-pvh-build.patch
- xen-pvh-module-verifier.patch
- xen-pvh-elfnote-defines.patch
- xen-pvh-mkimage.patch
- xen-pvh-install.patch
- xen-pvh-configure.patch
- mkimage_arm-efi_Use_EFI32_HEADER_SIZE.patch
- mkimage_Align_efi_sections_on_4k_boundary.patch
- mkimage_clarify_file_alignment_efi.patch
- at-keyboard-module-init.patch
- sparc64-aout-fix.patch
++at_keyboard-module-init.patch
+uefi-secure-boot-cryptomount.patch
- arm64-fix-grub_efi_get_ram_base.patch
- grub-install-arm-default-target.patch
- install_efi_fallback_arm.patch
- freebsd-ebr-partition-offset.patch
- util-check-errors.patch
- xfs-sparse-inodes.patch
+vsnprintf-upper-case-hex.patch
+efi-variable-storage-minimise-writes.patch
+arm-move-trampolines-into-code-section.patch
+arm-align-section-alignment-with-manual-reloc-offset.patch
+no-devicetree-if-secure-boot.patch
--- /dev/null
- From 756b9b2aeb74618320652905bc366995ed84d683 Mon Sep 17 00:00:00 2001
++From a53c3d6bccafaf82c16e9302aeb423b20110611a Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Sun, 28 Oct 2018 19:45:56 +0000
+Subject: Skip flaky grub_cmd_set_date test
+
+Bug-Debian: https://bugs.debian.org/906470
+Last-Update: 2018-10-28
+
+Patch-Name: skip-grub_cmd_set_date.patch
+---
+ tests/grub_cmd_set_date.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in
- index c594ae3fc..0b62b9854 100644
++index aac120a6c..1bb5be4ca 100644
+--- a/tests/grub_cmd_set_date.in
++++ b/tests/grub_cmd_set_date.in
+@@ -1,6 +1,9 @@
- #! /bin/bash
++ #! @BUILD_SHEBANG@
+ set -e
+
++echo "Skipping flaky test."
++exit 77
++
+ . "@builddir@/grub-core/modinfo.sh"
+
+ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
--- /dev/null
--- /dev/null
++From acd50e83519f8fb28aaf8943b05fb731984ea539 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:23 +0000
++Subject: Allow Shift to interrupt 'sleep --interruptible'
++
++Upstream would like to consider this at more length. See
++http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00718.html, and
++the rest of the thread for context.
++
++Forwarded: http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00694.html
++Last-Update: 2013-12-04
++
++Patch-Name: sleep-shift.patch
++---
++ grub-core/commands/sleep.c | 27 ++++++++++++++++++++++++++-
++ grub-core/normal/menu.c | 19 +++++++++++++++++++
++ 2 files changed, 45 insertions(+), 1 deletion(-)
++
++diff --git a/grub-core/commands/sleep.c b/grub-core/commands/sleep.c
++index e77e7900f..3906b1410 100644
++--- a/grub-core/commands/sleep.c
+++++ b/grub-core/commands/sleep.c
++@@ -46,6 +46,31 @@ do_print (int n)
++ grub_refresh ();
++ }
++
+++static int
+++grub_check_keyboard (void)
+++{
+++ int mods = 0;
+++ grub_term_input_t term;
+++
+++ if (grub_term_poll_usb)
+++ grub_term_poll_usb (0);
+++
+++ FOR_ACTIVE_TERM_INPUTS(term)
+++ {
+++ if (term->getkeystatus)
+++ mods |= term->getkeystatus (term);
+++ }
+++
+++ if (mods >= 0 &&
+++ (mods & (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT)) != 0)
+++ return 1;
+++
+++ if (grub_getkey_noblock () == GRUB_TERM_ESC)
+++ return 1;
+++
+++ return 0;
+++}
+++
++ /* Based on grub_millisleep() from kern/generic/millisleep.c. */
++ static int
++ grub_interruptible_millisleep (grub_uint32_t ms)
++@@ -55,7 +80,7 @@ grub_interruptible_millisleep (grub_uint32_t ms)
++ start = grub_get_time_ms ();
++
++ while (grub_get_time_ms () - start < ms)
++- if (grub_getkey_noblock () == GRUB_TERM_ESC)
+++ if (grub_check_keyboard ())
++ return 1;
++
++ return 0;
++diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
++index d5e0c79a7..3611ee9ea 100644
++--- a/grub-core/normal/menu.c
+++++ b/grub-core/normal/menu.c
++@@ -615,8 +615,27 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
++ saved_time = grub_get_time_ms ();
++ while (1)
++ {
+++ int mods = 0;
+++ grub_term_input_t term;
++ int key;
++
+++ if (grub_term_poll_usb)
+++ grub_term_poll_usb (0);
+++
+++ FOR_ACTIVE_TERM_INPUTS(term)
+++ {
+++ if (term->getkeystatus)
+++ mods |= term->getkeystatus (term);
+++ }
+++
+++ if (mods >= 0 &&
+++ (mods & (GRUB_TERM_STATUS_LSHIFT
+++ | GRUB_TERM_STATUS_RSHIFT)) != 0)
+++ {
+++ timeout = -1;
+++ break;
+++ }
+++
++ key = grub_getkey_noblock ();
++ if (key != GRUB_TERM_NO_KEY)
++ {
--- /dev/null
--- /dev/null
++From a0bc8f585d0d98f600f22a93c9cda3dd4229ccd3 Mon Sep 17 00:00:00 2001
++From: Steve Langasek <steve.langasek@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:12 +0000
++Subject: Output a menu entry for firmware setup on UEFI FastBoot systems
++
++Forwarded: no
++Last-Update: 2015-09-04
++
++Patch-Name: uefi-firmware-setup.patch
++---
++ Makefile.util.def | 6 +++++
++ util/grub.d/30_uefi-firmware.in | 46 +++++++++++++++++++++++++++++++++
++ 2 files changed, 52 insertions(+)
++ create mode 100644 util/grub.d/30_uefi-firmware.in
++
++diff --git a/Makefile.util.def b/Makefile.util.def
++index 0029b9000..8a24b23f0 100644
++--- a/Makefile.util.def
+++++ b/Makefile.util.def
++@@ -519,6 +519,12 @@ script = {
++ installdir = grubconf;
++ };
++
+++script = {
+++ name = '30_uefi-firmware';
+++ common = util/grub.d/30_uefi-firmware.in;
+++ installdir = grubconf;
+++};
+++
++ script = {
++ name = '40_custom';
++ common = util/grub.d/40_custom.in;
++diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in
++new file mode 100644
++index 000000000..3c9f533d8
++--- /dev/null
+++++ b/util/grub.d/30_uefi-firmware.in
++@@ -0,0 +1,46 @@
+++#! /bin/sh
+++set -e
+++
+++# grub-mkconfig helper script.
+++# Copyright (C) 2012 Free Software Foundation, Inc.
+++#
+++# GRUB is free software: you can redistribute it and/or modify
+++# it under the terms of the GNU General Public License as published by
+++# the Free Software Foundation, either version 3 of the License, or
+++# (at your option) any later version.
+++#
+++# GRUB is distributed in the hope that it will be useful,
+++# but WITHOUT ANY WARRANTY; without even the implied warranty of
+++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+++# GNU General Public License for more details.
+++#
+++# You should have received a copy of the GNU General Public License
+++# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+++
+++prefix="@prefix@"
+++exec_prefix="@exec_prefix@"
+++datarootdir="@datarootdir@"
+++
+++export TEXTDOMAIN=@PACKAGE@
+++export TEXTDOMAINDIR="@localedir@"
+++
+++. "@datadir@/@PACKAGE@/grub-mkconfig_lib"
+++
+++efi_vars_dir=/sys/firmware/efi/vars
+++EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
+++OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data"
+++
+++if [ -e "$OsIndications" ] && \
+++ [ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then
+++ LABEL="System setup"
+++
+++ gettext_printf "Adding boot menu entry for EFI firmware configuration\n" >&2
+++
+++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
+++
+++ cat << EOF
+++menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
+++ fwsetup
+++}
+++EOF
+++fi
--- /dev/null
- From ec85b3d37cd12b4121a286a47e84ecb79a714df8 Mon Sep 17 00:00:00 2001
++From 2380478993cad409ef5890634d93c1ae5e7e3c9b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Herv=C3=A9=20Werner?= <dud225@hotmail.com>
+Date: Mon, 28 Jan 2019 17:24:23 +0100
+Subject: Fix setup on Secure Boot systems where cryptodisk is in use
+
+On full-encrypted systems, including /boot, the current code omits
+cryptodisk commands needed to open the drives if Secure Boot is enabled.
+This prevents grub2 from reading any further configuration residing on
+the encrypted disk.
+This patch fixes this issue by adding the needed "cryptomount" commands in
+the load.cfg file that is then copied in the EFI partition.
+
+Bug-Debian: https://bugs.debian.org/917117
+Last-Update: 2019-02-10
+
+Patch-Name: uefi-secure-boot-cryptomount.patch
+---
+ util/grub-install.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/util/grub-install.c b/util/grub-install.c
- index 6bc96fc8f..81b648efc 100644
++index 5f3217ae4..6462d3c70 100644
+--- a/util/grub-install.c
++++ b/util/grub-install.c
- @@ -1502,6 +1502,23 @@ main (int argc, char *argv[])
++@@ -1521,6 +1521,23 @@ main (int argc, char *argv[])
+ || uefi_secure_boot)
+ {
+ char *uuid = NULL;
++
++ if (uefi_secure_boot && config.is_cryptodisk_enabled)
++ {
++ if (grub_dev->disk)
++ probe_cryptodisk_uuid (grub_dev->disk);
++
++ for (curdrive = grub_drives + 1; *curdrive; curdrive++)
++ {
++ grub_device_t dev = grub_device_open (*curdrive);
++ if (!dev)
++ continue;
++ if (dev->disk)
++ probe_cryptodisk_uuid (dev->disk);
++ grub_device_close (dev);
++ }
++ }
++
+ /* generic method (used on coreboot and ata mod). */
- if (!force_file_id && grub_fs->uuid && grub_fs->uuid (grub_dev,
- &uuid))
++ if (!force_file_id
++ && grub_fs->fs_uuid && grub_fs->fs_uuid (grub_dev, &uuid))
--- /dev/null
- From 27f1a9c448678f5d354957e0ebad0a2c310f53d1 Mon Sep 17 00:00:00 2001
++From d2ddbffc95447a2f567c81c725ade8e858832e04 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Mon, 11 Mar 2019 11:15:12 +0000
+Subject: Add %X to grub_vsnprintf_real and friends
+
+This is needed for UEFI Boot* variables, which the standard says are
+named using upper-case hexadecimal.
+
+Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
+
+Bug-Debian: https://bugs.debian.org/891434
+Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-03/msg00121.html
+Last-Update: 2019-03-23
+
+Patch-Name: vsnprintf-upper-case-hex.patch
+---
+ 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 3a14d679e..1e5bd2411 100644
++index 3b633d51f..18cad5803 100644
+--- a/grub-core/kern/misc.c
++++ b/grub-core/kern/misc.c
- @@ -591,7 +591,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
++@@ -588,7 +588,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)
+ {
+- unsigned base = (c == 'x') ? 16 : 10;
++ unsigned base = (c == 'x' || c == 'X') ? 16 : 10;
+ char *p;
+
+ if ((long long) n < 0 && c == 'd')
- @@ -606,7 +606,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
++@@ -603,7 +603,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
+ do
+ {
+ unsigned d = (unsigned) (n & 0xf);
+- *p++ = (d > 9) ? d + 'a' - 10 : d + '0';
++ *p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0';
+ }
+ while (n >>= 4);
+ else
- @@ -679,6 +679,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args,
++@@ -676,6 +676,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args,
+ {
+ case 'p':
+ case 'x':
++ case 'X':
+ case 'u':
+ case 'd':
+ case 'c':
- @@ -765,6 +766,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args,
++@@ -762,6 +763,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args,
+ switch (c)
+ {
+ case 'x':
++ case 'X':
+ case 'u':
+ args->ptr[curn].type = UNSIGNED_INT + longfmt;
+ break;
- @@ -903,6 +905,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0,
++@@ -900,6 +902,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0,
+ c = 'x';
+ /* Fall through. */
+ case 'x':
++ case 'X':
+ case 'u':
+ case 'd':
+ {
--- /dev/null
--- /dev/null
++From c4747ac75138eabdaa74b5b53cdfb99f5ee8dec0 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:30 +0000
++Subject: Add configure option to use vt.handoff=7
++
++This is used for non-recovery Linux entries only; it enables
++flicker-free booting if gfxpayload=keep is in use and a suitable kernel
++is present.
++
++Author: Andy Whitcroft <apw@canonical.com>
++Forwarded: not-needed
++Last-Update: 2013-12-25
++
++Patch-Name: vt-handoff.patch
++---
++ configure.ac | 11 +++++++++++
++ util/grub.d/10_linux.in | 28 +++++++++++++++++++++++++++-
++ 2 files changed, 38 insertions(+), 1 deletion(-)
++
++diff --git a/configure.ac b/configure.ac
++index c061e3d19..e3dca49fa 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1890,6 +1890,17 @@ else
++ fi
++ AC_SUBST([GFXPAYLOAD_DYNAMIC])
++
+++AC_ARG_ENABLE([vt-handoff],
+++ [AS_HELP_STRING([--enable-vt-handoff],
+++ [use Linux vt.handoff option for flicker-free booting (default=no)])],
+++ [], [enable_vt_handoff=no])
+++if test x"$enable_vt_handoff" = xyes ; then
+++ VT_HANDOFF=1
+++else
+++ VT_HANDOFF=0
+++fi
+++AC_SUBST([VT_HANDOFF])
+++
++ LIBS=""
++
++ AC_SUBST([FONT_SOURCE])
++diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
++index 2f5217358..174d547bb 100644
++--- a/util/grub.d/10_linux.in
+++++ b/util/grub.d/10_linux.in
++@@ -24,6 +24,7 @@ ubuntu_recovery="@UBUNTU_RECOVERY@"
++ quiet_boot="@QUIET_BOOT@"
++ quick_boot="@QUICK_BOOT@"
++ gfxpayload_dynamic="@GFXPAYLOAD_DYNAMIC@"
+++vt_handoff="@VT_HANDOFF@"
++
++ . "$pkgdatadir/grub-mkconfig_lib"
++
++@@ -104,6 +105,14 @@ if [ "$ubuntu_recovery" = 1 ]; then
++ GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
++ fi
++
+++if [ "$vt_handoff" = 1 ]; then
+++ for word in $GRUB_CMDLINE_LINUX_DEFAULT; do
+++ if [ "$word" = splash ]; then
+++ GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \$vt_handoff"
+++ fi
+++ done
+++fi
+++
++ linux_entry ()
++ {
++ os="$1"
++@@ -149,7 +158,7 @@ linux_entry ()
++ fi
++ if ([ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]) && \
++ ([ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 1 ]); then
++- echo " set gfxpayload=\$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
+++ echo " gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
++ fi
++
++ echo " insmod gzio" | sed "s/^/$submenu_indentation/"
++@@ -228,6 +237,23 @@ prepare_root_cache=
++ boot_device_id=
++ title_correction_code=
++
+++cat << 'EOF'
+++function gfxmode {
+++ set gfxpayload="${1}"
+++EOF
+++if [ "$vt_handoff" = 1 ]; then
+++ cat << 'EOF'
+++ if [ "${1}" = "keep" ]; then
+++ set vt_handoff=vt.handoff=7
+++ else
+++ set vt_handoff=
+++ fi
+++EOF
+++fi
+++cat << EOF
+++}
+++EOF
+++
++ # Use ELILO's generic "efifb" when it's known to be available.
++ # FIXME: We need an interface to select vesafb in case efifb can't be used.
++ if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 0 ]; then
--- /dev/null
--- /dev/null
++From 338052cd7ba9119e9180b49d195aa179e867d871 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson@ubuntu.com>
++Date: Mon, 13 Jan 2014 12:13:24 +0000
++Subject: Skip Windows os-prober entries on Wubi systems
++
++Since we're already being booted from the Windows boot loader, including
++entries that take us back to it mostly just causes confusion, and stops
++us from being able to hide the menu if there are no other OSes
++installed.
++
++https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-wubi
++
++Forwarded: not-needed
++Last-Update: 2013-11-26
++
++Patch-Name: wubi-no-windows.patch
++---
++ util/grub.d/30_os-prober.in | 19 +++++++++++++++++++
++ 1 file changed, 19 insertions(+)
++
++diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
++index b7e1147c4..271044f59 100644
++--- a/util/grub.d/30_os-prober.in
+++++ b/util/grub.d/30_os-prober.in
++@@ -110,6 +110,8 @@ EOF
++
++ used_osprober_linux_ids=
++
+++wubi=
+++
++ for OS in ${OSPROBED} ; do
++ DEVICE="`echo ${OS} | cut -d ':' -f 1`"
++ LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
++@@ -146,6 +148,23 @@ for OS in ${OSPROBED} ; do
++ case ${BOOT} in
++ chain)
++
+++ case ${LONGNAME} in
+++ Windows*)
+++ if [ -z "$wubi" ]; then
+++ if [ -x /usr/share/lupin-support/grub-mkimage ] && \
+++ /usr/share/lupin-support/grub-mkimage --test; then
+++ wubi=yes
+++ else
+++ wubi=no
+++ fi
+++ fi
+++ if [ "$wubi" = yes ]; then
+++ echo "Skipping ${LONGNAME} on Wubi system" >&2
+++ continue
+++ fi
+++ ;;
+++ esac
+++
++ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
++ cat << EOF
++ menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
--- /dev/null
--- /dev/null
++From 41f00350c5f4c36417cfda816e055eaa0ac5dad1 Mon Sep 17 00:00:00 2001
++From: Chad MILLER <chad.miller@canonical.com>
++Date: Thu, 27 Oct 2016 17:15:07 -0400
++Subject: Tell zpool to emit full device names
++
++zfs-initramfs currently provides extraneous, undesired symlinks to
++devices directly underneath /dev/ to satisfy zpool's historical output
++of unqualified device names. By including this environment variable to
++signal our intent to zpool, zfs-linux packages can drop the symlink
++behavior when updating to its upstream or backported output behavior.
++
++Bug: https://savannah.gnu.org/bugs/?43653
++Bug-Debian: https://bugs.debian.org/824974
++Bug-Ubuntu: https://bugs.launchpad.net/bugs/1527727
++Last-Update: 2016-11-01
++
++Patch-Name: zpool-full-device-name.patch
++---
++ grub-core/osdep/unix/getroot.c | 1 +
++ 1 file changed, 1 insertion(+)
++
++diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
++index 46d7116c6..da102918d 100644
++--- a/grub-core/osdep/unix/getroot.c
+++++ b/grub-core/osdep/unix/getroot.c
++@@ -243,6 +243,7 @@ grub_util_find_root_devices_from_poolname (char *poolname)
++ argv[2] = poolname;
++ argv[3] = NULL;
++
+++ setenv ("ZPOOL_VDEV_NAME_PATH", "YES", 1);
++ pid = grub_util_exec_pipe (argv, &fd);
++ if (!pid)
++ return NULL;
--- /dev/null
+#!/usr/bin/make -f
+SHELL := bash
+
+deb_version := $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
+upstream_version := $(shell echo $(deb_version) | sed -e "s/-[^-]*$$//")
+
+package := grub2
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
+DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
+
+HOST_CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
+# -O3 (default on Ubuntu ppc64el) introduces various -Werror failures, and
+# isn't worth it here.
+HOST_CFLAGS := -Wall -Wno-error=unused-result $(shell dpkg-buildflags --get CFLAGS | perl -pe 's/-O3\b/-O2/')
+HOST_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+
+export DEB_HOST_ARCH
+export HOST_CPPFLAGS
+export HOST_CFLAGS
+export HOST_LDFLAGS
+export TARGET_CPPFLAGS := -Wno-unused-but-set-variable
+export TARGET_LDFLAGS := -no-pie
+
+ifneq (,$(filter sparc sparc64,$(DEB_HOST_ARCH_CPU)))
+export TARGET_CCASFLAGS := -fno-PIE
+endif
+
+# Ensure that debhelper doesn't try to set these; we need to be careful
+# about HOST_* vs. TARGET_*.
+export CPPFLAGS :=
+export CFLAGS :=
+export LDFLAGS :=
+
+ifeq (,$(shell which qemu-system-i386 2>/dev/null))
+with_check := no
+else
+with_check := yes
+endif
+
+CC := gcc-8
+
+confflags = \
+ PACKAGE_VERSION="$(deb_version)" PACKAGE_STRING="GRUB $(deb_version)" \
+ CC=$(CC) TARGET_CC=$(CC) \
+ --libdir=\$${prefix}/lib --libexecdir=\$${prefix}/lib \
+ --enable-grub-mkfont \
+ --disable-grub-emu-usb
+substvars =
+
+AUTOGEN_DEB_FILES = config templates preinst postinst postrm dirs install links maintscript bash-completion
+
+BUILD_PACKAGES := $(strip $(shell dh_listpackages))
+# REAL_PACKAGES build an actual grub variant (and therefore have both configure
+# and build stages). EXTRA_PACKAGES do not build grub but may depend on a
+# REAL_PACKAGE (and therefore only have a build stage)
+REAL_PACKAGES = grub-common grub-emu grub-pc grub-coreboot grub-efi-ia32 grub-efi-amd64 grub-efi-ia64 grub-efi-arm grub-efi-arm64 grub-ieee1275 grub-firmware-qemu grub-uboot grub-xen grub-yeeloong
+EXTRA_PACKAGES = grub-rescue-pc grub-xen-host
+
+ifneq (,$(filter i386 amd64,$(DEB_HOST_ARCH_CPU)))
+COMMON_PLATFORM := pc
+else ifneq (,$(filter powerpc ppc64 ppc64el sparc sparc64,$(DEB_HOST_ARCH_CPU)))
+COMMON_PLATFORM := ieee1275
+else ifeq (mipsel,$(DEB_HOST_ARCH_CPU))
+COMMON_PLATFORM := yeeloong
+else ifeq (ia64,$(DEB_HOST_ARCH_CPU))
+COMMON_PLATFORM := efi-ia64
+else ifeq (arm,$(DEB_HOST_ARCH_CPU))
+COMMON_PLATFORM := uboot
+else ifeq (arm64,$(DEB_HOST_ARCH_CPU))
+COMMON_PLATFORM := efi-arm64
+else
+COMMON_PLATFORM := none
+BUILD_PACKAGES += grub-none
+endif
+
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+DEFAULT_CMDLINE := quiet splash
+DEFAULT_TIMEOUT := 10
+ifeq ($(DEB_HOST_ARCH_CPU),ppc64el)
+FLICKER_FREE_BOOT := no
+else
+FLICKER_FREE_BOOT := yes
+endif
+confflags += --enable-ubuntu-recovery
+else ifeq (yes,$(shell dpkg-vendor --derives-from Tanglu && echo yes))
+DEFAULT_CMDLINE := quiet splash
+DEFAULT_TIMEOUT := 10
+FLICKER_FREE_BOOT := yes
+else
+DEFAULT_CMDLINE := quiet
+DEFAULT_TIMEOUT := 5
+FLICKER_FREE_BOOT := no
+endif
+
+ifeq ($(FLICKER_FREE_BOOT),yes)
+DEFAULT_HIDDEN_TIMEOUT := 0
+DEFAULT_HIDDEN_TIMEOUT_BOOL := true
+confflags += \
+ --enable-quiet-boot \
+ --enable-quick-boot \
+ --enable-gfxpayload-dynamic \
+ --enable-vt-handoff
+substvars += \
+ -Vlsb-base-depends="lsb-base (>= 3.0-6)" \
+ -Vgfxpayload-depends="grub-gfxpayload-lists [any-i386 any-amd64]"
+else
+DEFAULT_HIDDEN_TIMEOUT :=
+DEFAULT_HIDDEN_TIMEOUT_BOOL := false
+endif
+
+# Secure Boot
+debian/stamps/build-grub-efi-ia32 install/grub-efi-ia32: export SB_PLATFORM := i386-efi
+debian/stamps/build-grub-efi-ia32 install/grub-efi-ia32: export SB_EFI_NAME := ia32
+debian/stamps/build-grub-efi-amd64 install/grub-efi-amd64: export SB_PLATFORM := x86_64-efi
+debian/stamps/build-grub-efi-amd64 install/grub-efi-amd64: export SB_EFI_NAME := x64
+debian/stamps/build-grub-efi-arm64 install/grub-efi-arm64: export SB_PLATFORM := arm64-efi
+debian/stamps/build-grub-efi-arm64 install/grub-efi-arm64: export SB_EFI_NAME := aa64
+SB_PACKAGE :=
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+ifeq ($(DEB_HOST_ARCH),amd64)
+SB_PACKAGE := grub-efi-amd64
+endif
+ifeq ($(DEB_HOST_ARCH),arm64)
+SB_PACKAGE := grub-efi-arm64
+endif
+endif
+
+# Downstream distributions that want to support SB and build images, but do not
+# rebuild grub, need a programmatic way to get the vendor, as it's used by build-efi-images
+# to create the monolithic Grub image and thus is needed to create the partitions on the EFI
+# media. Add it to the control file user metadata: XB-Efi-Vendor: $vendor
+SB_EFI_VENDOR ?= $(shell dpkg-vendor --query vendor | tr '[:upper:]' '[:lower:]')
+
+%:
+ dh $@ --with=bash_completion
+
+override_dh_auto_configure: $(patsubst %,configure/%,$(BUILD_PACKAGES))
+
+override_dh_auto_build: $(patsubst %,build/%,$(BUILD_PACKAGES))
+
+override_dh_auto_install: $(patsubst %,install/%,$(BUILD_PACKAGES))
+
+$(patsubst %,configure/%,$(REAL_PACKAGES)) :: configure/% : debian/stamps/configure-%
+$(patsubst %,build/%,$(REAL_PACKAGES) $(EXTRA_PACKAGES)) :: build/% : debian/stamps/build-%
+
+debian/stamps/configure-%: package = $(subst debian/stamps/configure-,,$@)
+debian/stamps/configure-%: export DH_OPTIONS = -p$(package) -Bobj/$(package)
+
+debian/stamps/build-%: package = $(subst debian/stamps/build-,,$@)
+debian/stamps/build-%: export DH_OPTIONS = -p$(package) -Bobj/$(package)
+
+install/%: package = $(subst install/,,$@)
+install/%: package_bin = $(package)-bin
+install/%: package_dbg = $(package)-dbg
+install/grub-emu: package_bin = grub-emu
+install/grub-emu: package_dbg = grub-emu-dbg
+install/%: export DH_OPTIONS = -p$(package) -Bobj/$(patsubst grub-common,grub-$(COMMON_PLATFORM),$(package))
+
+override_dh_autoreconf:
+ mkdir -p debian/stamps
+ rm -rf debian/grub-extras-enabled
+ mkdir debian/grub-extras-enabled
+ set -e; for extra in 915resolution ntldr-img; do \
+ cp -a debian/grub-extras/$$extra debian/grub-extras-enabled/; \
+ done
+ env -u DH_OPTIONS GRUB_CONTRIB=$(CURDIR)/debian/grub-extras-enabled \
+ dh_autoreconf -- ./autogen.sh
+
+debian/stamps/configure-grub-common: debian/stamps/configure-grub-$(COMMON_PLATFORM)
+ touch $@
+
+debian/stamps/build-grub-common: debian/stamps/build-grub-$(COMMON_PLATFORM)
+ touch $@
+
+debian/stamps/configure-grub-none debian/stamps/configure-grub-pc debian/stamps/configure-grub-ieee1275 debian/stamps/configure-grub-coreboot debian/stamps/configure-grub-emu debian/stamps/configure-grub-uboot debian/stamps/configure-grub-yeeloong:
+ mkdir -p debian/stamps obj/$(package)
+ dh_auto_configure -- $(confflags) --with-platform=$(subst grub-,,$(package))
+ touch $@
+
+# This name scheme leaves room for things like amd32 someday
+debian/stamps/configure-grub-efi-ia32:
+ mkdir -p debian/stamps obj/$(package)
+ dh_auto_configure -- $(confflags) --with-platform=efi --target=i386-pe --program-prefix=""
+ touch $@
+debian/stamps/configure-grub-efi-amd64:
+ mkdir -p debian/stamps $(subst debian/stamps/configure-,obj/,$@)
+ dh_auto_configure -- $(confflags) --with-platform=efi --target=amd64-pe --program-prefix=""
+ touch $@
+debian/stamps/configure-grub-efi-ia64 debian/stamps/configure-grub-efi-arm debian/stamps/configure-grub-efi-arm64:
+ mkdir -p debian/stamps $(subst debian/stamps/configure-,obj/,$@)
+ dh_auto_configure -- $(confflags) --with-platform=efi
+ touch $@
+
+debian/stamps/configure-grub-xen-i386 debian/stamps/configure-grub-xen-amd64:
+ mkdir -p debian/stamps obj/$(package)
+ dh_auto_configure -- $(confflags) --with-platform=xen --target=$(subst debian/stamps/configure-grub-xen-,,$@) --program-prefix=""
+ touch $@
+debian/stamps/configure-grub-xen-pvh-i386:
+ mkdir -p debian/stamps obj/$(package)
+ dh_auto_configure -- $(confflags) --with-platform=xen_pvh --target=i386 --program-prefix=""
+ touch $@
+debian/stamps/configure-grub-xen: debian/stamps/configure-grub-xen-i386 debian/stamps/configure-grub-xen-amd64 debian/stamps/configure-grub-xen-pvh-i386
+ touch $@
+
+debian/stamps/configure-grub-firmware-qemu:
+ mkdir -p debian/stamps $(subst debian/stamps/configure-,obj/,$@)
+ dh_auto_configure -- $(confflags) --with-platform=qemu
+ touch $@
+
+debian/stamps/build-grub-none debian/stamps/build-grub-efi-ia64 debian/stamps/build-grub-efi-arm debian/stamps/build-grub-coreboot debian/stamps/build-grub-emu debian/stamps/build-grub-uboot debian/stamps/build-grub-xen-i386 debian/stamps/build-grub-xen-amd64 debian/stamps/build-grub-xen-pvh-i386 debian/stamps/build-grub-yeeloong: debian/stamps/build-%: debian/stamps/configure-%
+ dh_auto_build
+ touch $@
+
+debian/stamps/build-grub-efi-ia32 debian/stamps/build-grub-efi-amd64 debian/stamps/build-grub-efi-arm64: debian/stamps/build-%: debian/stamps/configure-% debian/stamps/build-grub-$(COMMON_PLATFORM)
+ dh_auto_build
+ debian/build-efi-images \
+ obj/grub-$(COMMON_PLATFORM)/grub-mkimage \
+ obj/$(package)/grub-core \
+ obj/monolithic/$(package) \
+ $(SB_PLATFORM) $(SB_EFI_NAME) $(SB_EFI_VENDOR)
+ touch $@
+
+debian/stamps/build-grub-xen-host-i386: PVBOOT_ARCH := i386
+debian/stamps/build-grub-xen-host-i386: debian/stamps/build-grub-xen-i386
+debian/stamps/build-grub-xen-host-amd64: PVBOOT_ARCH := x86_64
+debian/stamps/build-grub-xen-host-amd64: debian/stamps/build-grub-xen-amd64
+debian/stamps/build-grub-xen-host-i386 debian/stamps/build-grub-xen-host-amd64:
+ target=$(subst debian/stamps/build-grub-xen-host-,,$@) ; \
+ obj_dir=$(CURDIR)/obj/grub-xen-$${target} ; \
+ grub_dir=`mktemp -d` ; \
+ grub_memdisk=`mktemp` ; \
+ trap "rm -rf $${grub_dir} $${grub_memdisk}" EXIT HUP INT QUIT TERM ; \
+ mkdir -p $${grub_dir}/boot/grub ; \
+ mkdir -p $(CURDIR)/obj/$(package) ; \
+ sed -e "s/@@PVBOOT_ARCH@@/$(PVBOOT_ARCH)/g" \
+ <debian/grub-xen-host_grub.cfg \
+ >$${grub_dir}/grub.cfg ; \
+ tar -cf - -C $${grub_dir} grub.cfg > $${grub_memdisk} ; \
+ $${obj_dir}/grub-mkimage \
+ -O $(PVBOOT_ARCH)-xen \
+ -c $(CURDIR)/debian/grub-xen-host_grub-bootstrap.cfg \
+ -d $${obj_dir}/grub-core \
+ $${obj_dir}/grub-core/*.mod \
+ -m $${grub_memdisk} \
+ -o $(CURDIR)/obj/$(package)/grub-$(PVBOOT_ARCH)-xen.bin
+ touch $@
+
+debian/stamps/build-grub-xen-host-pvh-i386: debian/stamps/build-grub-xen-pvh-i386
+ target=$(subst debian/stamps/build-grub-xen-host-,,$@) ; \
+ obj_dir=$(CURDIR)/obj/grub-xen-$${target} ; \
+ grub_dir=`mktemp -d` ; \
+ grub_memdisk=`mktemp` ; \
+ trap "rm -rf $${grub_dir} $${grub_memdisk}" EXIT HUP INT QUIT TERM ; \
+ mkdir -p $${grub_dir}/boot/grub ; \
+ mkdir -p $(CURDIR)/obj/$(package) ; \
+ cp -a debian/grub-xen-host_grub-pvh.cfg $${grub_dir}/grub.cfg ; \
+ tar -cf - -C $${grub_dir} grub.cfg > $${grub_memdisk} ; \
+ $${obj_dir}/grub-mkimage \
+ -O i386-xen_pvh \
+ -c $(CURDIR)/debian/grub-xen-host_grub-bootstrap.cfg \
+ -d $${obj_dir}/grub-core \
+ $${obj_dir}/grub-core/*.mod \
+ -m $${grub_memdisk} \
+ -o $(CURDIR)/obj/$(package)/grub-i386-xen_pvh.bin
+ touch $@
+
+debian/stamps/build-grub-xen-host: debian/stamps/build-grub-xen-host-i386 debian/stamps/build-grub-xen-host-amd64 debian/stamps/build-grub-xen-host-pvh-i386
+ touch $@
+
+debian/stamps/build-grub-pc: debian/stamps/configure-grub-pc
+ dh_auto_build
+ifeq ($(with_check), yes)
+ LC_MESSAGES=C.UTF-8 LC_CTYPE=C.UTF-8 PATH="$$PATH:/sbin:/usr/sbin" VERBOSE=1 dh_auto_test --max-parallel=1
+endif
+ touch $@
+
+debian/stamps/build-grub-ieee1275: debian/stamps/configure-grub-ieee1275
+ dh_auto_build
+ifneq (,$(filter powerpc ppc64 ppc64el,$(DEB_HOST_ARCH_CPU)))
+ $(CC) $(HOST_CFLAGS) debian/prep-bootdev.c -o debian/prep-bootdev -lparted
+endif
+ touch $@
+
+debian/stamps/build-grub-xen: debian/stamps/build-grub-xen-i386 debian/stamps/build-grub-xen-amd64 debian/stamps/build-grub-xen-pvh-i386
+ touch $@
+
+debian/stamps/build-grub-firmware-qemu: debian/stamps/configure-grub-firmware-qemu
+ dh_auto_build
+ grub_dir=`mktemp -d` ; \
+ grub_memdisk=`mktemp` ; \
+ trap "rm -rf $${grub_dir} $${grub_memdisk}" EXIT HUP INT QUIT TERM ; \
+ mkdir -p $${grub_dir}/boot/grub ; \
+ cp debian/grub-firmware-qemu_grub.cfg $${grub_dir}/boot/grub/grub.cfg ; \
+ tar -cf - -C $${grub_dir} boot > $${grub_memdisk} ; \
+ obj/$(package)/grub-mkimage \
+ -O i386-qemu \
+ -d $(CURDIR)/obj/$(package)/grub-core \
+ $(CURDIR)/obj/$(package)/grub-core/*.mod \
+ -m $${grub_memdisk} \
+ -o $(CURDIR)/obj/$(package)/grub.bin
+ touch $@
+
+debian/stamps/build-grub-rescue-pc: debian/stamps/build-grub-pc
+ mkdir -p obj/grub-rescue-pc/rescue-disk/boot/grub
+ cp docs/grub.cfg obj/grub-rescue-pc/rescue-disk/boot/grub/
+ rm -rf obj/grub-rescue-pc/grub-core
+ cp -a obj/grub-pc/grub-core obj/grub-rescue-pc/grub-core
+ cp -a obj/grub-pc/unicode.pf2 obj/grub-rescue-pc/
+ pkgdatadir=$(CURDIR)/obj/grub-rescue-pc \
+ obj/grub-pc/grub-mkrescue \
+ --directory=$(CURDIR)/obj/grub-rescue-pc/grub-core \
+ --locale-directory=$(CURDIR)/obj/grub-rescue-pc/grub-core/po \
+ --output=$(CURDIR)/obj/grub-rescue-pc/grub-rescue-cdrom.iso \
+ $(CURDIR)/obj/grub-rescue-pc/rescue-disk
+ # save space for floppy image
+ rm -rf obj/grub-rescue-pc/grub-core/po obj/grub-rescue-pc/unicode.pf2
+ pkgdatadir=$(CURDIR)/obj/grub-rescue-pc \
+ obj/grub-pc/grub-mkrescue \
+ --directory=$(CURDIR)/obj/grub-rescue-pc/grub-core \
+ --locale-directory=$(CURDIR)/obj/grub-rescue-pc/grub-core/po \
+ --output=$(CURDIR)/obj/grub-rescue-pc/grub-rescue-floppy.img \
+ --compress=xz \
+ -no-pad \
+ $(CURDIR)/obj/grub-rescue-pc/rescue-disk
+ touch $@
+
+platform_subst = \
+ if [ -e debian/$(1) ]; then \
+ debian/platform-subst \
+ PACKAGE="$(2)" \
+ DEFAULT_CMDLINE="$(DEFAULT_CMDLINE)" \
+ DEFAULT_TIMEOUT="$(DEFAULT_TIMEOUT)" \
+ DEFAULT_HIDDEN_TIMEOUT_BOOL="$(DEFAULT_HIDDEN_TIMEOUT_BOOL)" \
+ debian/$(1) >> debian/$(2).$(3); \
+ fi
+
+install/grub-none:
+ dh_auto_install --destdir=debian/tmp-$(package)
+
+ # Avoid failures later if we're building from a tree with no .po
+ # files.
+ mkdir -p debian/tmp-$(package)/usr/share/locale
+
+install/grub-pc install/grub-efi-ia32 install/grub-efi-amd64 install/grub-efi-ia64 install/grub-efi-arm install/grub-efi-arm64 install/grub-ieee1275 install/grub-coreboot install/grub-emu install/grub-uboot install/grub-xen install/grub-yeeloong:
+ set -e ; \
+ if [ "$@" = "install/grub-xen" ] ; then \
+ dh_auto_install -Bobj/grub-xen-i386 --destdir=debian/tmp-$(package); \
+ dh_auto_install -Bobj/grub-xen-amd64 --destdir=debian/tmp-$(package); \
+ dh_auto_install -Bobj/grub-xen-pvh-i386 --destdir=debian/tmp-$(package); \
+ else \
+ dh_auto_install --destdir=debian/tmp-$(package); \
+ fi
+
+ set -e ; \
+ if [ -d "obj/monolithic/$(package)" ] ; then \
+ install -m 0755 -d debian/$(package_bin)/usr/lib/grub/$(SB_PLATFORM)/monolithic ; \
+ install -m 0644 -t debian/$(package_bin)/usr/lib/grub/$(SB_PLATFORM)/monolithic obj/monolithic/$(package)/*.efi ; \
+ debian/signing-template.generate "$(package)" ; \
+ fi
+
+ set -e ; \
+ for i in $(AUTOGEN_DEB_FILES) ; do \
+ > debian/$(package).$$i; \
+ if [ "$@" != "install/grub-emu" ] ; then \
+ $(call platform_subst,$$i.in,$(package),$$i); \
+ fi ; \
+ $(call platform_subst,$(package).$$i.in,$(package),$$i); \
+ $(call platform_subst,$(package).$$i.$(DEB_HOST_ARCH_CPU).in,$(package),$$i); \
+ $(call platform_subst,$(package).$$i.$(DEB_HOST_ARCH_OS).in,$(package),$$i); \
+ $(call platform_subst,$(package).$$i.$(DEB_HOST_ARCH_OS)-$(DEB_HOST_ARCH_CPU).in,$(package),$$i); \
+ [ -s debian/$(package).$$i ] || rm -f debian/$(package).$$i; \
+ if [ "$@" != "install/grub-emu" ] ; then \
+ > debian/$(package_bin).$$i; \
+ $(call platform_subst,$$i-bin.in,$(package_bin),$$i); \
+ $(call platform_subst,$(package_bin).$$i.in,$(package_bin),$$i); \
+ $(call platform_subst,$(package_bin).$$i.$(DEB_HOST_ARCH_CPU).in,$(package_bin),$$i); \
+ $(call platform_subst,$(package_bin).$$i.$(DEB_HOST_ARCH_OS).in,$(package_bin),$$i); \
+ $(call platform_subst,$(package_bin).$$i.$(DEB_HOST_ARCH_OS)-$(DEB_HOST_ARCH_CPU).in,$(package_bin),$$i); \
+ [ -s debian/$(package_bin).$$i ] || rm -f debian/$(package_bin).$$i; \
+ fi ; \
+ > debian/$(package_dbg).$$i; \
+ if [ "$@" != "install/grub-emu" ] ; then \
+ $(call platform_subst,$$i-dbg.in,$(package_dbg),$$i); \
+ fi ; \
+ $(call platform_subst,$(package_dbg).$$i.in,$(package_dbg),$$i); \
+ $(call platform_subst,$(package_dbg).$$i.$(DEB_HOST_ARCH_CPU).in,$(package_dbg),$$i); \
+ $(call platform_subst,$(package_dbg).$$i.$(DEB_HOST_ARCH_OS).in,$(package_dbg),$$i); \
+ $(call platform_subst,$(package_dbg).$$i.$(DEB_HOST_ARCH_OS)-$(DEB_HOST_ARCH_CPU).in,$(package_dbg),$$i); \
+ [ -s debian/$(package_dbg).$$i ] || rm -f debian/$(package_dbg).$$i; \
+ done
+
+ find debian/tmp-$(package)/usr/lib/grub -name modinfo.sh -print0 | \
+ xargs -0r chmod +x
+ find debian/tmp-$(package)/usr/lib/grub -name gdb_grub -print0 | \
+ xargs -0r chmod -x
+ find debian/tmp-$(package)/usr/lib/grub -name gmodule.pl -print0 | \
+ xargs -0r chmod -x
+
+ mkdir -p debian/$(package_bin)/usr/share/lintian/overrides
+ echo "$(package_bin): unstripped-binary-or-object *.mod" \
+ >> debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin)
+ cd debian/tmp-$(package) && find usr/lib/grub -name kernel.img \
+ | sed -e "s%.*%$(package_bin): statically-linked-binary &%g" \
+ >> $(CURDIR)/debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin)
+ cd debian/tmp-$(package) && find ./usr/lib/grub -name kernel.img \
+ | sed -e "s%.*%$(package_bin): statically-linked-binary &%g" \
+ >> $(CURDIR)/debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin)
+ cd debian/tmp-$(package) && find usr/lib/grub -name kernel.img \
+ | sed -e "s%.*%$(package_bin): unstripped-binary-or-object &%g" \
+ >> $(CURDIR)/debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin)
+ if ([ "$@" = "install/grub-efi-amd64" ] && [ "$(DEB_HOST_ARCH_CPU)" = "i386" ]) || \
+ ([ "$@" != "install/grub-emu" ] && [ "$(DEB_HOST_ARCH_CPU):$(DEB_HOST_ARCH_BITS)" = "amd64:32" ]) || \
+ [ "$@" = "install/grub-xen" ]; then \
+ echo "$(package_bin): binary-from-other-architecture *.mod" \
+ >> debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin) ; \
+ cd debian/tmp-$(package) && find usr/lib/grub -name kernel.img \
+ | sed -e "s%.*%$(package_bin): binary-from-other-architecture &%g" \
+ >> $(CURDIR)/debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin) ; \
+ fi
+ if ([ "$@" = "install/grub-pc" ] || \
+ [ "$@" = "install/grub-ieee1275" ] || \
+ [ "$@" = "install/grub-coreboot" ] || \
+ [ "$@" = "install/grub-xen" ] || \
+ [ "$@" = "install/grub-emu" ]) && \
+ [ "$(DEB_HOST_ARCH_OS)" = "linux" ] && \
+ [ "$(DEB_HOST_ARCH_CPU):$(DEB_HOST_ARCH_BITS)" != "amd64:64" ] ; then \
+ echo "$(package_bin): binary-from-other-architecture *efiemu64.o" \
+ >> debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin) ; \
+ fi
++ case $@ in \
++ install/grub-efi*) \
++ (echo "# These aren't Windows executables, and these features wouldn't be very useful." \
++ echo "$(package_bin): portable-executable-missing-security-features *.efi ASLR DEP/NX") \
++ >> debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin) ;; \
++ esac
++ if [ "$@" = "install/grub-emu" ]; then \
++ (echo "# This seems to be due to a readelf bug: https://bugs.debian.org/929585"; \
++ echo "$(package_bin): binary-or-shlib-defines-rpath usr/lib/grub/*-emu/macho.mod 0x0") \
++ >> debian/$(package_bin)/usr/share/lintian/overrides/$(package_bin); \
++ fi
+
+ mkdir -p debian/$(package_dbg)/usr/share/lintian/overrides
+ echo "$(package_dbg): unstripped-binary-or-object *.module" \
+ >> debian/$(package_dbg)/usr/share/lintian/overrides/$(package_dbg)
+ echo "$(package_dbg): statically-linked-binary *.image" \
+ >> debian/$(package_dbg)/usr/share/lintian/overrides/$(package_dbg)
+ cd debian/tmp-$(package) && find usr/lib/grub -name kernel.exec \
+ | sed -e "s%.*%$(package_dbg): statically-linked-binary &%g" \
+ >> $(CURDIR)/debian/$(package_dbg)/usr/share/lintian/overrides/$(package_dbg)
+ if ([ "$@" = "install/grub-efi-amd64" ] && [ "$(DEB_HOST_ARCH_CPU)" = "i386" ]) || \
+ ([ "$@" != "install/grub-emu" ] && [ "$(DEB_HOST_ARCH_CPU):$(DEB_HOST_ARCH_BITS)" = "amd64:32" ]) || \
+ [ "$@" = "install/grub-xen" ] ; then \
+ echo "$(package_dbg): binary-from-other-architecture *.module" \
+ >> debian/$(package_dbg)/usr/share/lintian/overrides/$(package_dbg) ; \
+ cd debian/tmp-$(package) && find usr/lib/grub -name kernel.exec \
+ | sed -e "s%.*%$(package_dbg): binary-from-other-architecture &%g" \
+ >> $(CURDIR)/debian/$(package_dbg)/usr/share/lintian/overrides/$(package_dbg) ; \
+ fi
+
+ # Avoid failures later if we're building from a tree with no .po
+ # files.
+ mkdir -p debian/tmp-$(package)/usr/share/locale
+
+common_subst = \
+ if [ -e debian/grub-common.$(1) ]; then \
+ sed 's/@COMMON_PLATFORM@/$(COMMON_PLATFORM)/g' \
+ debian/grub-common.$(1) >> debian/grub-common.$(2).new; \
+ fi
+
+install/grub-common:
+ set -e ; for i in $(AUTOGEN_DEB_FILES) ; do \
+ > debian/grub-common.$$i.new; \
+ $(call common_subst,$$i.in,$$i); \
+ $(call common_subst,$$i.$(DEB_HOST_ARCH_CPU).in,$$i); \
+ $(call common_subst,$$i.$(DEB_HOST_ARCH_OS).in,$$i); \
+ if [ -s debian/grub-common.$$i.new ] ; then \
+ mv debian/grub-common.$$i.new debian/grub-common.$$i; \
+ else \
+ rm -f debian/grub-common.$$i.new; \
+ fi; \
+ done
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+ install -D -m 0755 debian/grub-common.pm-sleep \
+ $(CURDIR)/debian/$(package)/etc/pm/sleep.d/10_grub-common
+endif
+
+NON_PLATFORM_PACKAGES = $(filter grub2 grub-linuxbios grub-efi grub-rescue-pc grub-firmware-qemu grub-xen-host,$(BUILD_PACKAGES))
+COMMON_PLATFORM_PACKAGES = $(filter grub-common grub2-common grub-theme-starfield grub-mount-udeb,$(BUILD_PACKAGES))
+PLATFORM_PACKAGES = $(filter grub-pc grub-efi-ia32 grub-efi-amd64 grub-efi-ia64 grub-efi-arm grub-efi-arm64 grub-ieee1275 grub-coreboot grub-uboot grub-xen grub-yeeloong,$(BUILD_PACKAGES))
+
+override_dh_install:
+ifneq (,$(NON_PLATFORM_PACKAGES))
+ dh_install $(patsubst %,-p%,$(NON_PLATFORM_PACKAGES))
+endif
+ dh_install $(patsubst %,-p%,$(COMMON_PLATFORM_PACKAGES)) --sourcedir=debian/tmp-grub-$(COMMON_PLATFORM)
+ rm -f debian/grub2-common/usr/share/info/dir*
+ rm -f debian/grub-theme-starfield/usr/share/grub/themes/starfield/COPYING.CC-BY-SA-3.0
+ifneq (,$(PLATFORM_PACKAGES))
+ set -e; for package in $(PLATFORM_PACKAGES); do \
+ dh_install -p$$package --sourcedir=debian/tmp-$$package; \
+ dh_install -p$$package-bin --sourcedir=debian/tmp-$$package; \
+ dh_install -p$$package-dbg --sourcedir=debian/tmp-$$package; \
+ done
+endif
+ifneq (,$(filter grub-emu,$(BUILD_PACKAGES)))
+ dh_install -pgrub-emu --sourcedir=debian/tmp-grub-emu
+ dh_install -pgrub-emu-dbg --sourcedir=debian/tmp-grub-emu
+endif
+ifneq (,$(filter grub2-common,$(BUILD_PACKAGES)))
+ sed -i \
+ -e "s/@DEFAULT_CMDLINE@/$(DEFAULT_CMDLINE)/g" \
+ -e "s/@DEFAULT_TIMEOUT@/$(DEFAULT_TIMEOUT)/g" \
+ debian/grub2-common/usr/share/grub/default/grub
+ifneq (,$(DEFAULT_HIDDEN_TIMEOUT))
+ perl -pi -e 's/^GRUB_TIMEOUT=.*/GRUB_HIDDEN_TIMEOUT=0\nGRUB_HIDDEN_TIMEOUT_QUIET=true\n$$&/' \
+ debian/grub2-common/usr/share/grub/default/grub
+endif
+endif
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+ifneq (,$(filter grub-pc,$(BUILD_PACKAGES)))
+ patch debian/grub-pc/usr/lib/grub-legacy/update-grub \
+ < debian/legacy/update-grub.ubuntu.patch
+endif
+endif
+
+override_dh_installdocs:
+ dh_installdocs $(patsubst %,-p%,$(filter grub-common grub-rescue-pc grub-firmware-qemu grub-xen-host,$(BUILD_PACKAGES))) -A AUTHORS NEWS README THANKS TODO
+ dh_installdocs $(patsubst %,-p%,$(filter grub-efi-%-signed-template,$(BUILD_PACKAGES)))
+ dh_installdocs --remaining-packages --link-doc=grub-common
+
+ifeq ($(FLICKER_FREE_BOOT),yes)
+override_dh_installinit:
+ dh_installinit -- start 99 2 3 4 5 .
+else
+override_dh_installinit:
+ :
+endif
+
+override_dh_bugfiles:
+ dh_bugfiles $(patsubst %,-N%,$(filter grub-efi-%-signed-template,$(BUILD_PACKAGES))) -A
+
+override_dh_strip:
+ dh_strip -X/usr/bin/grub-emu
+
+override_dh_shlibdeps:
+ dh_shlibdeps -X.module
+
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+LEGACY_DOC_BR := grub-doc (<< 0.97-29ubuntu60), grub-legacy-doc (<< 0.97-29ubuntu60)
+else
+LEGACY_DOC_BR := grub-doc (<< 0.97-32), grub-legacy-doc (<< 0.97-59)
+endif
+
+override_dh_gencontrol:
+ dh_gencontrol -- -Vlegacy-doc-br="$(LEGACY_DOC_BR)" -V"efi:Vendor=$(SB_EFI_VENDOR)" $(substvars)
+
+TARNAME := grub2_$(deb_version)_$(DEB_HOST_ARCH).tar.gz
+
+override_dh_builddeb:
+ dh_builddeb
+ifneq (,$(SB_PACKAGE))
+ echo $(deb_version) > obj/monolithic/$(SB_PACKAGE)/version
+ tar -c -f ../$(TARNAME) -a -C obj/monolithic/$(SB_PACKAGE) -v .
+ dpkg-distaddfile $(TARNAME) raw-uefi -
+endif
+
+override_dh_auto_clean:
+ -rm -rf debian/grub-extras-enabled debian/stamps obj
+ -rm -f contrib grub-core/contrib
+
+override_dh_clean:
+ dh_clean
+
+ chmod +x debian/{bug-script,grub.d/*,legacy/*,kernel/*}
+
+ for i in $(AUTOGEN_DEB_FILES) ; do \
+ rm -f debian/grub-{pc,efi-*,ieee1275,coreboot,uboot,xen,yeeloong,emu}{,-bin,-dbg}.$$i ; \
+ done
+ rm -f debian/grub-common.bash-completion debian/grub-common.maintscript
+ rm -rf debian/tmp-*/
+
+ # make sure PO files are always up-to-date
+ debconf-updatepo
+
+.PHONY: $(patsubst %,configure/%,$(BUILD_PACKAGES)) $(patsubst %,build/%,$(BUILD_PACKAGES)) $(patsubst %,install/%,$(BUILD_PACKAGES))
--- /dev/null
- opts=pgpsigurlmangle=s/$/.sig/,dversionmangle=s/\+dfsg\d*$//,repacksuffix=+dfsg1 \
- https://ftp.gnu.org/gnu/grub/grub-([a-z0-9.~]+).tar.xz debian uupdate
+version=3
+
+# Official releases:
- #opts=pgpsigurlmangle=s/$/.sig/,dversionmangle=s/\+dfsg\d*$//,repacksuffix=+dfsg1 \
- #https://alpha.gnu.org/gnu/grub/grub-([a-z0-9.~]+).tar.xz debian uupdate
++#opts=pgpsigurlmangle=s/$/.sig/,dversionmangle=s/\+dfsg\d*$//,repacksuffix=+dfsg1 \
++#https://ftp.gnu.org/gnu/grub/grub-([a-z0-9.~]+).tar.xz debian uupdate
+
+# Betas and pre-releases:
++opts=pgpsigurlmangle=s/$/.sig/,dversionmangle=s/\+dfsg\d*$// \
++https://alpha.gnu.org/gnu/grub/grub-([a-z0-9.~]+).tar.xz debian uupdate