diffstat of debian/ for grub2_2.02~beta2-36 grub2_2.02~beta2-36ubuntu3.17co1 .git-dpm | 4 build-efi-images | 6 changelog | 263 ++ config.in | 5 control | 5 kernel/zz-update-grub | 6 patches/Fix-exit-to-EFI-firmware.patch | 55 patches/Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch | 279 ++ patches/arm-efi-Reduce-timer-event-frequency-by-10.patch | 40 patches/bootp_new_net_bootp6_command.patch | 1113 +++++++++ patches/bootp_process_dhcpack_http_boot.patch | 125 + patches/efi-fix-warnings-with-recent-GCC.patch | 27 patches/efinet_set_dns_from_uefi_proto.patch | 335 ++ patches/efinet_set_network_from_uefi_devpath.patch | 384 +++ patches/efinet_uefi_ipv6_pxe_support.patch | 122 + patches/git_fix_tsc_calibration_pit_a03c1034.patch | 28 patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch | 80 patches/git_pmem_mmap_handle_pmem_c79c59f1.patch | 179 + patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch | 65 patches/git_pmem_translate_persistent_type_76ce1de7.patch | 97 patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch | 161 + patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch | 940 +++++++ patches/install_signed.patch | 42 patches/ip6_fix_routing_eb9f401f.patch | 314 ++ patches/ip6_send_router_solicitation_7c4b6b7b.patch | 157 + patches/linuxefi.patch | 50 patches/linuxefi_arm_sb_support.patch | 438 +++ patches/linuxefi_backport_arm64.patch | 1189 ++++++++++ patches/linuxefi_chainloader_path.patch | 34 patches/linuxefi_chainloader_pe_fixes.patch | 350 ++ patches/linuxefi_chainloader_sb.patch | 820 ++++++ patches/linuxefi_debug.patch | 92 patches/linuxefi_fix_validation_race.patch | 89 patches/linuxefi_loaders_enforce_sb.patch | 531 ++++ patches/linuxefi_non_sb_fallback.patch | 28 patches/linuxefi_re-enable_linux_cmd.patch | 37 patches/linuxefi_require_shim.patch | 4 patches/linuxefi_rework_non-sb_cases.patch | 378 +++ patches/misc-fix-invalid-char-strtol.patch | 31 patches/net_add_grub_env_set_net_property.patch | 179 + patches/net_read_bracketed_ipv6_addr.patch | 248 ++ patches/series | 35 patches/support_initrd-less_boot.patch | 82 patches/tsc_efi_default_to_pmtimer.patch | 34 patches/zpool_full_device_name.patch | 31 po/ar.po | 35 po/ast.po | 35 po/be.po | 35 po/bg.po | 35 po/ca.po | 35 po/cs.po | 39 po/cy.po | 35 po/da.po | 39 po/de.po | 40 po/dz.po | 35 po/el.po | 75 po/eo.po | 35 po/es.po | 35 po/eu.po | 35 po/fa.po | 35 po/fi.po | 35 po/fr.po | 35 po/gl.po | 35 po/gu.po | 35 po/he.po | 46 po/hr.po | 35 po/hu.po | 35 po/id.po | 35 po/is.po | 35 po/it.po | 35 po/ja.po | 64 po/ka.po | 35 po/kk.po | 35 po/km.po | 35 po/ko.po | 35 po/lt.po | 35 po/lv.po | 35 po/mr.po | 35 po/nb.po | 35 po/nl.po | 35 po/pl.po | 48 po/pt.po | 35 po/pt_BR.po | 35 po/ro.po | 35 po/ru.po | 46 po/si.po | 35 po/sk.po | 35 po/sl.po | 302 +- po/sv.po | 47 po/ta.po | 35 po/templates.pot | 37 po/th.po | 35 po/tr.po | 35 po/ug.po | 35 po/uk.po | 35 po/vi.po | 35 po/zh_CN.po | 35 po/zh_TW.po | 35 postinst.in | 33 rules | 2 templates.in | 10 101 files changed, 11092 insertions(+), 718 deletions(-) diff -Nru grub2-2.02~beta2/debian/.git-dpm grub2-2.02~beta2/debian/.git-dpm --- grub2-2.02~beta2/debian/.git-dpm 2016-01-22 11:00:23.000000000 +0000 +++ grub2-2.02~beta2/debian/.git-dpm 2018-02-26 20:17:22.000000000 +0000 @@ -1,6 +1,6 @@ # see git-dpm(1) from git-dpm package -3bae3b8527b938db6413e0d9062c74fe0c0278e7 -3bae3b8527b938db6413e0d9062c74fe0c0278e7 +12559a2581e8517f35c142b04bd7ed7830307b9d +12559a2581e8517f35c142b04bd7ed7830307b9d e8f07821cce1bd0ab6d5622c2a42440f15f4fd71 e8f07821cce1bd0ab6d5622c2a42440f15f4fd71 grub2_2.02~beta2.orig.tar.xz diff -Nru grub2-2.02~beta2/debian/build-efi-images grub2-2.02~beta2/debian/build-efi-images --- grub2-2.02~beta2/debian/build-efi-images 2016-02-05 15:39:28.000000000 +0000 +++ grub2-2.02~beta2/debian/build-efi-images 2018-02-26 20:17:23.000000000 +0000 @@ -70,10 +70,10 @@ fi EOF -mkfs.msdos -C "$workdir/memdisk.fat" 64 +/sbin/mkfs.msdos -C "$workdir/memdisk.fat" 64 mcopy -i "$workdir/memdisk.fat" "$workdir/grub.cfg" ::grub.cfg -mkfs.msdos -C "$workdir/memdisk-netboot.fat" 64 +/sbin/mkfs.msdos -C "$workdir/memdisk-netboot.fat" 64 mcopy -i "$workdir/memdisk-netboot.fat" "$workdir/grub-netboot.cfg" ::grub.cfg CD_MODULES=" @@ -100,6 +100,7 @@ jpeg keystatus loadenv + loopback linux lsefi lsefimmap @@ -119,6 +120,7 @@ search_fs_file search_label sleep + squash4 test true video diff -Nru grub2-2.02~beta2/debian/changelog grub2-2.02~beta2/debian/changelog --- grub2-2.02~beta2/debian/changelog 2016-02-05 15:41:06.000000000 +0000 +++ grub2-2.02~beta2/debian/changelog 2018-02-27 07:51:06.000000000 +0000 @@ -1,3 +1,265 @@ +grub2 (2.02~beta2-36ubuntu3.17co1) 18.03; urgency=low + + [ Merge-o-Matic ] + * Merge from Ubuntu xenial-updates. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Andrew Lee (李健秋) Tue, 27 Feb 2018 15:51:06 +0800 + +grub2 (2.02~beta2-36ubuntu3.17) xenial; urgency=medium + + * Signal to zpool that it should emit full names of constituent devices. + (LP: #1527727) + + -- Scott Moser Wed, 24 Jan 2018 16:21:35 -0500 + +grub2 (2.02~beta2-36ubuntu3.16co1) 18.03; urgency=low + + [ Merge-o-Matic ] + * Merge from Ubuntu xenial-updates. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Andrew Lee (李健秋) Fri, 23 Feb 2018 17:02:19 +0800 + +grub2 (2.02~beta2-36ubuntu3.16) xenial; urgency=medium + + [ dann frazier ] + * Use EFI_SIMPLE_TEXT_INPUT_EX to support key combinations. + (LP: #722950) + + [ Mathieu Trudel-Lapierre ] + * util/grub-install.c: Use MokManager EFI binary name without + the .signed extension now that shim handles signing via sbsigntool + natively. (LP: #1708245) + - debian/patches/install_signed.patch + * debian/control: Breaks shim << 13 due to the renamed MokManager binary. + + -- dann frazier Wed, 10 Jan 2018 17:04:34 -0700 + +grub2 (2.02~beta2-36ubuntu3.15) xenial; urgency=medium + + [ Ike Panhc ] + * Fix grub crash when exit on arm64-platform. (LP: #1731241) + + [ Mathieu Trudel-Lapierre ] + * Cherry-pick upstream patch to change the default TSC calibration method + to pmtimer on EFI systems (LP: #1734278) + + -- Mathieu Trudel-Lapierre Mon, 11 Dec 2017 10:25:22 -0500 + +grub2 (2.02~beta2-36ubuntu3.14co1) 17.12; urgency=medium + + * Merge from Ubuntu xenial-updates. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Andrew Lee (李健秋) Mon, 13 Nov 2017 22:12:19 +0800 + +grub2 (2.02~beta2-36ubuntu3.14) xenial; urgency=medium + + * Add grub2/update_nvram template to allow users to disable NVRAM + updates during package upgrades (LP: #1642298). + + -- dann frazier Thu, 14 Sep 2017 16:13:39 -0600 + +grub2 (2.02~beta2-36ubuntu3.13) xenial; urgency=medium + + * Fix EFIPersistentMemory (PMEM) support; incorrectly handled as "standard" + reserved memory without really marking it reserved: (LP: #1716424) + - debian/patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch + - debian/patches/git_pmem_translate_persistent_type_76ce1de7.patch + - debian/patches/git_pmem_mmap_handle_pmem_c79c59f1.patch + - debian/patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch + + -- Mathieu Trudel-Lapierre Sun, 10 Sep 2017 20:08:16 -0400 + +grub2 (2.02~beta2-36ubuntu3.12) xenial; urgency=medium + + * debian/patches: Rework linuxefi/SecureBoot support and sync with upstream + SB patch set: (LP: #1696599) + - linuxefi_backport_arm64.patch: backport basic arm64 chainload/linux + command support from 17.04. + - linuxefi_arm_sb_support.patch: add Secure Boot support for arm for its + chainloader. + - linuxefi_fix_validation_race.patch: Fix a race in validating images. + - linuxefi_chainloader_path.patch: honor the starting path for grub, so + images do not need to be started from $root. + - linuxefi_chainloader_sb.patch: Fix some more issues in chainloader use + when Secure Boot is enabled. + - linuxefi_loaders_enforce_sb.patch: Enforce Secure Boot policy for all + loaders: don't load the commands when Secure Boot is enabled. + - linuxefi_re-enable_linux_cmd.patch: Since we rely on the linux and + initrd commands to automatically hand-off to linuxefi/initrdefi; re- + enable the linux loader. + - linuxefi_chainloader_pe_fixes.patch: PE parsing fixes for chainloading + "special" PE images, such as Windows'. + - linuxefi_rework_non-sb_cases.patch: rework cases where Secure Boot is + disabled or shim validation is disabled so loading works as EFI binaries + when it is supposed to. + - Removed linuxefi_require_shim.patch; superseded by the above. + (LP: #1689687) + * debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch: refreshed. + * debian/patches/arm64-set-correct-length-of-device-path-end-entry.patch: + dropped; included in linuxefi_backport_arm64.patch. + + -- Mathieu Trudel-Lapierre Thu, 08 Jun 2017 10:16:17 -0700 + +grub2 (2.02~beta2-36ubuntu3.11) xenial; urgency=medium + + * Fix syntax error in debian/postinst.in. (LP #1692181) + + -- Steve Langasek Sat, 20 May 2017 12:59:17 -0700 + +grub2 (2.02~beta2-36ubuntu3.10) xenial; urgency=medium + + * debian/patches/install_signed.patch: don't install fb$arch.efi; it breaks + "removable" installs where files are all installed to /EFI/BOOT; and it + also doesn't belong in the /EFI/ubuntu path for the default case. Fallback + install simply needs more work and isn't ready for SRU. (LP: #1684341) + * debian/postinst.in: clean up fb$arch.efi. + + -- Mathieu Trudel-Lapierre Fri, 19 May 2017 16:54:14 -0400 + +grub2 (2.02~beta2-36ubuntu3.9) xenial; urgency=medium + + * debian/patches/install_signed.patch: update to use the new names for the + shim binary (shim$arch), MokManager (mm$arch) and add fallback (fb$arch). + (LP: #1637290) + * debian/control: Breaks shim (<< 0.9+1474479173.6c180c6-0ubuntu1~) for the + renamed EFI binaries. + + -- Mathieu Trudel-Lapierre Tue, 08 Nov 2016 14:42:24 -0500 + +grub2 (2.02~beta2-36ubuntu3.8) xenial; urgency=medium + + * debian/patches/support_initrd-less_boot.patch: Added knobs to allow + non-initrd boot config. Thanks Chris Glass! (LP: #1640878) + + -- Mathieu Trudel-Lapierre Wed, 01 Mar 2017 12:36:16 -0500 + +grub2 (2.02~beta2-36ubuntu3.7) xenial; urgency=medium + + [ Mauricio Faria de Oliveira ] + * Disable os-prober for ppc64el on the PowerNV platform, to reduce the + number of entries/clutter from other OSes in Petitboot (LP: #1447500) + + -- Mathieu Trudel-Lapierre Wed, 11 Jan 2017 19:07:05 -0500 + +grub2 (2.02~beta2-36ubuntu3.6) xenial; urgency=medium + + * Fix support for IPv6 PXE booting under UEFI: (LP: #1229458) + - grub_add_grub_env_set_net_property.patch: add grub_env_set_net_property. + - 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. + * Fix booting on Hyper-V gen 2 VMs due to the lack of PIT there; we can deal + with this by using other timers when PIT aren't available. (LP: #1519836) + - debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch + - debian/patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch + - debian/patches/git_fix_tsc_calibration_pit_a03c1034.patch + + -- Mathieu Trudel-Lapierre Thu, 15 Sep 2016 13:56:55 -0400 + +grub2 (2.02~beta2-36ubuntu3.3) xenial; urgency=medium + + * debian/patches/ip6_send_router_solicitation_7c4b6b7b.patch: handle long + RA intervals by explicitly sending a SOLICIT. + * debian/patches/ip6_fix_routing_eb9f401f.patch: fix IPv6 routing; we should + be able to talk to things outside of link-local addresses; to do this, + allow specifying a gateway and interface. (LP: #1229458) + + -- Mathieu Trudel-Lapierre Wed, 03 Aug 2016 16:46:41 -0400 + +grub2 (2.02~beta2-36ubuntu3.2co1) 16.09; urgency=low + + [ Merge-o-Matic ] + * Merge from Ubuntu xenial-updates. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Andrew Lee (李健秋) Wed, 10 Aug 2016 00:41:15 +0800 + +grub2 (2.02~beta2-36ubuntu3.2) xenial; urgency=medium + + * Add loopback and squash4 modules to the signed EFI images. LP: #1604499. + + -- Steve Langasek Fri, 22 Jul 2016 15:29:24 -0700 + +grub2 (2.02~beta2-36ubuntu3.1co1) 16.09; urgency=low + + [ Merge-o-Matic ] + * Merge from Ubuntu xenial-updates. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Andrew Lee (李健秋) Tue, 26 Jul 2016 23:45:08 +0800 + +grub2 (2.02~beta2-36ubuntu3.1) xenial; urgency=medium + + * debian/postinst.in: replace setup_mok_validation with a call to + update-secureboot-policy, a script shipped by shim-signed. + (LP: #1574727) + * debian/control: drop Depends on mokutil, we're not calling it directly. + + -- Mathieu Trudel-Lapierre Fri, 20 May 2016 15:04:00 -0400 + +grub2 (2.02~beta2-36ubuntu3co1) 16.06; urgency=medium + + * Merge from Ubuntu xenial. Remaining changes: + - debian/build-efi-images: Don't assume mkfs.msdos is in the path. + - debian/kernel/zz-update-grub: run if not in a chroot. + - debian/rules: build tests with "|| true". + + -- Héctor Orón Martínez Wed, 27 Apr 2016 13:59:32 +0200 + +grub2 (2.02~beta2-36ubuntu3) xenial; urgency=medium + + * No-change rebuild to correctly build our unicode font against libfreetype6. + (LP: #1559933) + + -- Mathieu Trudel-Lapierre Fri, 15 Apr 2016 17:21:17 -0400 + +grub2 (2.02~beta2-36ubuntu2) xenial; urgency=medium + + * debian/postinst.in: (LP: #1558438) + - fix quoting variables for setup_mok_validation() to account for passwords + that might have special characters. + - use printf rather than straight echo to pass values to mokutil. + - ask the user to confirm password; not just write it once, this will avoid + issues with typos in the Secure Boot keys. + + -- Mathieu Trudel-Lapierre Fri, 18 Mar 2016 21:35:50 -0400 + +grub2 (2.02~beta2-36ubuntu1) xenial; urgency=medium + + [ Debconf translations ] + * [ja] Japanese (Takuma Yamada; closes: #815203, #817084). + + [ Mathieu Trudel-Lapierre ] + * debian/postinst.in: add MOK validation support; so that it's possible on + upgrade to disable validation in shim if the user has dkms packages + installed. + * debian/control: add mokutil to grub-efi-$arch packages to deal with + toggling MOK validation. + + [ dann frazier ] + * Cherry-pick fix for slow timer events on ARM/UEFI (LP: #1553390). + + -- Mathieu Trudel-Lapierre Tue, 15 Mar 2016 12:57:08 -0400 + grub2 (2.02~beta2-36) unstable; urgency=medium [ Colin Watson ] @@ -4499,3 +4761,4 @@ * Initial Release. (Closes: #211030) -- Robert Millan Mon, 15 Sep 2003 14:58:42 +0000 + diff -Nru grub2-2.02~beta2/debian/config.in grub2-2.02~beta2/debian/config.in --- grub2-2.02~beta2/debian/config.in 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/config.in 2018-02-26 20:17:23.000000000 +0000 @@ -78,4 +78,9 @@ db_input low grub2/force_efi_extra_removable || true ;; esac +case @PACKAGE@ in + grub-*efi*|grub-ieee1275) + db_input low grub2/update_nvram || true + ;; +esac db_go diff -Nru grub2-2.02~beta2/debian/control grub2-2.02~beta2/debian/control --- grub2-2.02~beta2/debian/control 2016-01-27 11:51:07.000000000 +0000 +++ grub2-2.02~beta2/debian/control 2018-02-26 20:17:23.000000000 +0000 @@ -1,7 +1,8 @@ Source: grub2 Section: admin Priority: extra -Maintainer: GRUB Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: GRUB Maintainers Uploaders: Felix Zielcke , Jordi Mallach , Colin Watson , Ian Campbell Build-Depends: debhelper (>= 7.4.2~), patchutils, @@ -93,7 +94,7 @@ Depends: grub-common (= ${binary:Version}), dpkg (>= 1.15.4) | install-info, ${shlibs:Depends}, ${misc:Depends} Replaces: grub, grub-legacy, ${legacy-doc-br}, grub-common (<< 1.99-1), grub-pc (<< 2.00-4), grub-ieee1275 (<< 2.00-4), grub-efi (<< 1.99-1), grub-coreboot (<< 2.00-4), grub-linuxbios (<< 1.99-1), grub-efi-ia32 (<< 2.00-4), grub-efi-amd64 (<< 2.00-4), grub-efi-ia64 (<< 2.00-4), grub-yeeloong (<< 2.00-4) Conflicts: grub-legacy -Breaks: grub (<< 0.97-54), ${legacy-doc-br} +Breaks: grub (<< 0.97-54), ${legacy-doc-br}, shim (<< 13) Multi-Arch: foreign Description: GRand Unified Bootloader (common files for version 2) This package contains common files shared by the distinct flavours of GRUB. diff -Nru grub2-2.02~beta2/debian/kernel/zz-update-grub grub2-2.02~beta2/debian/kernel/zz-update-grub --- grub2-2.02~beta2/debian/kernel/zz-update-grub 2016-01-28 14:07:16.000000000 +0000 +++ grub2-2.02~beta2/debian/kernel/zz-update-grub 2018-02-26 20:17:24.000000000 +0000 @@ -1,6 +1,12 @@ #! /bin/sh set -e +## apertis fixup to avoid updating grub when in chroot. +if `ischroot` ; then + echo "running in a chroot, exiting..." + exit 0 +fi + which update-grub >/dev/null 2>&1 || exit 0 if type systemd-detect-virt >/dev/null 2>&1 && diff -Nru grub2-2.02~beta2/debian/patches/Fix-exit-to-EFI-firmware.patch grub2-2.02~beta2/debian/patches/Fix-exit-to-EFI-firmware.patch --- grub2-2.02~beta2/debian/patches/Fix-exit-to-EFI-firmware.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/Fix-exit-to-EFI-firmware.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,55 @@ +From c945ca75c3b2b900040b905323b1226cb60a1166 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Fri, 15 Aug 2014 12:22:43 -0400 +Subject: [PATCH] Fix exit to EFI firmware + +The current code for EFI grub_exit() calls grub_efi_fini() before +returning to firmware. In the case of ARM, this leaves a timer +event running which could lead to a firmware crash. This patch +changes this so that grub_machine_fini() is called with a NORETURN +flag. This allows machine-specific shutdown to happen as well +as the shutdown done by grub_efi_fini(). + +Signed-off-by: Mark Salter +--- + grub-core/kern/arm/efi/init.c | 2 +- + grub-core/kern/efi/efi.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c +index a6ae034..2572ca8 100644 +--- a/grub-core/kern/arm/efi/init.c ++++ b/grub-core/kern/arm/efi/init.c +@@ -67,7 +67,7 @@ grub_machine_fini (int flags) + + b = grub_efi_system_table->boot_services; + +- efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0); ++ efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0); + efi_call_1 (b->close_event, tmr_evt); + + grub_efi_fini (); +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index 49a1501..2e77834 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* The handle of GRUB itself. Filled in by the startup code. */ + grub_efi_handle_t grub_efi_image_handle; +@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) + void + grub_exit (void) + { +- grub_efi_fini (); ++ grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + efi_call_4 (grub_efi_system_table->boot_services->exit, + grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); + for (;;) ; +-- +2.7.4 + diff -Nru grub2-2.02~beta2/debian/patches/Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch grub2-2.02~beta2/debian/patches/Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch --- grub2-2.02~beta2/debian/patches/Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,279 @@ +From 9e5f70174ec960a0077f20bb74cb9f4da9b57e7b Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Sun, 25 Oct 2015 16:36:28 +0100 +Subject: [PATCH] Use EFI_SIMPLE_TEXT_INPUT_EX to support key combinations. + +--- + grub-core/term/efi/console.c | 120 +++++++++++++++++++++++++++++++++++-------- + include/grub/efi/api.h | 65 ++++++++++++++++++++++- + 2 files changed, 163 insertions(+), 22 deletions(-) + +Index: grub2-2.02~beta2/grub-core/term/efi/console.c +=================================================================== +--- grub2-2.02~beta2.orig/grub-core/term/efi/console.c ++++ grub2-2.02~beta2/grub-core/term/efi/console.c +@@ -104,26 +104,12 @@ const unsigned efi_codes[] = + GRUB_TERM_KEY_DC, GRUB_TERM_KEY_PPAGE, GRUB_TERM_KEY_NPAGE, GRUB_TERM_KEY_F1, + GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, GRUB_TERM_KEY_F5, + GRUB_TERM_KEY_F6, GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KEY_F9, +- GRUB_TERM_KEY_F10, 0, 0, '\e' ++ GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, GRUB_TERM_KEY_F12, '\e' + }; + +- + static int +-grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) ++grub_efi_translate_key (grub_efi_input_key_t key) + { +- grub_efi_simple_input_interface_t *i; +- grub_efi_input_key_t key; +- grub_efi_status_t status; +- +- if (grub_efi_is_finished) +- return 0; +- +- i = grub_efi_system_table->con_in; +- status = efi_call_2 (i->read_key_stroke, i, &key); +- +- if (status != GRUB_EFI_SUCCESS) +- return GRUB_TERM_NO_KEY; +- + if (key.scan_code == 0) + { + /* Some firmware implementations use VT100-style codes against the spec. +@@ -139,9 +125,100 @@ grub_console_getkey (struct grub_term_in + else if (key.scan_code < ARRAY_SIZE (efi_codes)) + return efi_codes[key.scan_code]; + ++ if (key.unicode_char >= 0x20 && key.unicode_char <= 0x7f ++ || key.unicode_char == '\t' || key.unicode_char == '\b' ++ || key.unicode_char == '\n' || key.unicode_char == '\r') ++ return key.unicode_char; ++ + return GRUB_TERM_NO_KEY; + } + ++static int ++grub_console_getkey_con (struct grub_term_input *term __attribute__ ((unused))) ++{ ++ grub_efi_simple_input_interface_t *i; ++ grub_efi_input_key_t key; ++ grub_efi_status_t status; ++ ++ i = grub_efi_system_table->con_in; ++ status = efi_call_2 (i->read_key_stroke, i, &key); ++ ++ if (status != GRUB_EFI_SUCCESS) ++ return GRUB_TERM_NO_KEY; ++ ++ return grub_efi_translate_key(key); ++} ++ ++static int ++grub_console_getkey_ex(struct grub_term_input *term) ++{ ++ grub_efi_key_data_t key_data; ++ grub_efi_status_t status; ++ grub_efi_uint32_t kss; ++ int key = -1; ++ ++ grub_efi_simple_text_input_ex_interface_t *text_input = term->data; ++ ++ status = efi_call_2 (text_input->read_key_stroke, text_input, &key_data); ++ ++ if (status != GRUB_EFI_SUCCESS) ++ return GRUB_TERM_NO_KEY; ++ ++ kss = key_data.key_state.key_shift_state; ++ key = grub_efi_translate_key(key_data.key); ++ ++ if (key == GRUB_TERM_NO_KEY) ++ return GRUB_TERM_NO_KEY; ++ ++ if (kss & GRUB_EFI_SHIFT_STATE_VALID) ++ { ++ if ((kss & GRUB_EFI_LEFT_SHIFT_PRESSED ++ || kss & GRUB_EFI_RIGHT_SHIFT_PRESSED) ++ && (key & GRUB_TERM_EXTENDED)) ++ key |= GRUB_TERM_SHIFT; ++ if (kss & GRUB_EFI_LEFT_ALT_PRESSED || kss & GRUB_EFI_RIGHT_ALT_PRESSED) ++ key |= GRUB_TERM_ALT; ++ if (kss & GRUB_EFI_LEFT_CONTROL_PRESSED ++ || kss & GRUB_EFI_RIGHT_CONTROL_PRESSED) ++ key |= GRUB_TERM_CTRL; ++ } ++ ++ return key; ++} ++ ++static grub_err_t ++grub_efi_console_input_init (struct grub_term_input *term) ++{ ++ grub_efi_guid_t text_input_ex_guid = ++ GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; ++ ++ if (grub_efi_is_finished) ++ return 0; ++ ++ grub_efi_simple_text_input_ex_interface_t *text_input = term->data; ++ if (text_input) ++ return 0; ++ ++ text_input = grub_efi_open_protocol(grub_efi_system_table->console_in_handler, ++ &text_input_ex_guid, ++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); ++ term->data = (void *)text_input; ++ ++ return 0; ++} ++ ++static int ++grub_console_getkey (struct grub_term_input *term) ++{ ++ if (grub_efi_is_finished) ++ return 0; ++ ++ if (term->data) ++ return grub_console_getkey_ex(term); ++ else ++ return grub_console_getkey_con(term); ++} ++ + static struct grub_term_coordinate + grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) + { +@@ -243,7 +320,7 @@ grub_console_setcursor (struct grub_term + } + + static grub_err_t +-grub_efi_console_init (struct grub_term_output *term) ++grub_efi_console_output_init (struct grub_term_output *term) + { + grub_efi_set_text_mode (1); + grub_console_setcursor (term, 1); +@@ -251,7 +328,7 @@ grub_efi_console_init (struct grub_term_ + } + + static grub_err_t +-grub_efi_console_fini (struct grub_term_output *term) ++grub_efi_console_output_fini (struct grub_term_output *term) + { + grub_console_setcursor (term, 0); + grub_efi_set_text_mode (0); +@@ -262,13 +339,14 @@ static struct grub_term_input grub_conso + { + .name = "console", + .getkey = grub_console_getkey, ++ .init = grub_efi_console_input_init, + }; + + static struct grub_term_output grub_console_term_output = + { + .name = "console", +- .init = grub_efi_console_init, +- .fini = grub_efi_console_fini, ++ .init = grub_efi_console_output_init, ++ .fini = grub_efi_console_output_fini, + .putchar = grub_console_putchar, + .getwh = grub_console_getwh, + .getxy = grub_console_getxy, +@@ -291,8 +369,8 @@ grub_console_init (void) + return; + } + +- grub_term_register_input ("console", &grub_console_term_input); + grub_term_register_output ("console", &grub_console_term_output); ++ grub_term_register_input ("console", &grub_console_term_input); + } + + void +Index: grub2-2.02~beta2/include/grub/efi/api.h +=================================================================== +--- grub2-2.02~beta2.orig/include/grub/efi/api.h ++++ grub2-2.02~beta2/include/grub/efi/api.h +@@ -114,7 +114,7 @@ + { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } + +-#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ ++#define GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ + { 0xdd9e7534, 0x7762, 0x4698, \ + { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } \ + } +@@ -977,6 +977,32 @@ struct grub_efi_input_key + }; + typedef struct grub_efi_input_key grub_efi_input_key_t; + ++typedef grub_efi_uint8_t grub_efi_key_toggle_state_t; ++struct grub_efi_key_state ++{ ++ grub_efi_uint32_t key_shift_state; ++ grub_efi_key_toggle_state_t key_toggle_state; ++}; ++typedef struct grub_efi_key_state grub_efi_key_state_t; ++ ++#define GRUB_EFI_SHIFT_STATE_VALID 0x80000000 ++#define GRUB_EFI_RIGHT_SHIFT_PRESSED 0x00000001 ++#define GRUB_EFI_LEFT_SHIFT_PRESSED 0x00000002 ++#define GRUB_EFI_RIGHT_CONTROL_PRESSED 0x00000004 ++#define GRUB_EFI_LEFT_CONTROL_PRESSED 0x00000008 ++#define GRUB_EFI_RIGHT_ALT_PRESSED 0x00000010 ++#define GRUB_EFI_LEFT_ALT_PRESSED 0x00000020 ++#define GRUB_EFI_RIGHT_LOGO_PRESSED 0x00000040 ++#define GRUB_EFI_LEFT_LOGO_PRESSED 0x00000080 ++#define GRUB_EFI_MENU_KEY_PRESSED 0x00000100 ++#define GRUB_EFI_SYS_REQ_PRESSED 0x00000200 ++ ++#define GRUB_EFI_TOGGLE_STATE_VALID 0x80 ++#define GRUB_EFI_KEY_STATE_EXPOSED 0x40 ++#define GRUB_EFI_SCROLL_LOCK_ACTIVE 0x01 ++#define GRUB_EFI_NUM_LOCK_ACTIVE 0x02 ++#define GRUB_EFI_CAPS_LOCK_ACTIVE 0x04 ++ + struct grub_efi_simple_text_output_mode + { + grub_efi_int32_t max_mode; +@@ -1319,6 +1345,43 @@ struct grub_efi_simple_input_interface + }; + typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t; + ++struct grub_efi_key_data { ++ grub_efi_input_key_t key; ++ grub_efi_key_state_t key_state; ++}; ++typedef struct grub_efi_key_data grub_efi_key_data_t; ++ ++typedef grub_efi_status_t (*grub_efi_key_notify_function_t) ( ++ grub_efi_key_data_t *key_data ++ ); ++ ++struct grub_efi_simple_text_input_ex_interface ++{ ++ grub_efi_status_t ++ (*reset) (struct grub_efi_simple_text_input_ex_interface *this, ++ grub_efi_boolean_t extended_verification); ++ ++ grub_efi_status_t ++ (*read_key_stroke) (struct grub_efi_simple_text_input_ex_interface *this, ++ grub_efi_key_data_t *key_data); ++ ++ grub_efi_event_t wait_for_key; ++ ++ grub_efi_status_t ++ (*set_state) (struct grub_efi_simple_text_input_ex_interface *this, ++ grub_efi_key_toggle_state_t *key_toggle_state); ++ ++ grub_efi_status_t ++ (*register_key_notify) (struct grub_efi_simple_text_input_ex_interface *this, ++ grub_efi_key_data_t *key_data, ++ grub_efi_key_notify_function_t key_notification_function); ++ ++ grub_efi_status_t ++ (*unregister_key_notify) (struct grub_efi_simple_text_input_ex_interface *this, ++ void *notification_handle); ++}; ++typedef struct grub_efi_simple_text_input_ex_interface grub_efi_simple_text_input_ex_interface_t; ++ + struct grub_efi_simple_text_output_interface + { + grub_efi_status_t diff -Nru grub2-2.02~beta2/debian/patches/arm-efi-Reduce-timer-event-frequency-by-10.patch grub2-2.02~beta2/debian/patches/arm-efi-Reduce-timer-event-frequency-by-10.patch --- grub2-2.02~beta2/debian/patches/arm-efi-Reduce-timer-event-frequency-by-10.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/arm-efi-Reduce-timer-event-frequency-by-10.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,40 @@ +From 12559a2581e8517f35c142b04bd7ed7830307b9d Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Thu, 7 Jan 2016 20:53:41 +0100 +Subject: arm-efi: Reduce timer event frequency by 10 + +Timer event to keep grub msec counter was running at 1000HZ. This was too +fast for UEFI timer driver and resulted in a 10x slowdown in grub time +versus wallclock. Reduce the timer event frequency and increase tick +increment accordingly to keep better time. + +Origin: upstream, http://git.savannah.gnu.org/cgit/grub.git/commit/?id=7eb27a49e92623587f400ff58de3e9b1a31ba894 +Last-Update: 2016-03-04 + +Patch-Name: arm-efi-Reduce-timer-event-frequency-by-10.patch +--- + grub-core/kern/arm/efi/init.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c +index a6ae034..0c17d83 100644 +--- a/grub-core/kern/arm/efi/init.c ++++ b/grub-core/kern/arm/efi/init.c +@@ -38,7 +38,7 @@ static void + increment_timer (grub_efi_event_t event __attribute__ ((unused)), + void *context __attribute__ ((unused))) + { +- tmr++; ++ tmr += 10; + } + + void +@@ -52,7 +52,7 @@ grub_machine_init (void) + + efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL, + GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); +- efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 10000); ++ efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000); + + grub_install_get_time_ms (grub_efi_get_time_ms); + } diff -Nru grub2-2.02~beta2/debian/patches/bootp_new_net_bootp6_command.patch grub2-2.02~beta2/debian/patches/bootp_new_net_bootp6_command.patch --- grub2-2.02~beta2/debian/patches/bootp_new_net_bootp6_command.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/bootp_new_net_bootp6_command.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,1113 @@ +From: Michael Chang +Subject: [PATCH 3/8] 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 +Signed-off-by: Ken Lin +--- + grub-core/net/bootp.c | 908 +++++++++++++++++++++++++++++++++++++++++++++++++- + grub-core/net/ip.c | 39 ++ + include/grub/net.h | 72 +++ + 3 files changed, 1018 insertions(+), 1 deletion(-) + +Index: b/grub-core/net/bootp.c +=================================================================== +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -24,6 +24,98 @@ + #include + #include + #include ++#include ++#include ++ ++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; ++} + + static void + parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) +@@ -256,6 +348,578 @@ grub_net_configure_by_dhcp_ack (const ch + return inter; + } + ++/* 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; ++} ++ + void + grub_net_process_dhcp (struct grub_net_buff *nb, + struct grub_net_card *card) +@@ -288,6 +952,77 @@ grub_net_process_dhcp (struct grub_net_b + } + } + ++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) + { +@@ -564,7 +1299,174 @@ grub_cmd_bootp (struct grub_command *cmd + return err; + } + +-static grub_command_t cmd_getdhcp, cmd_bootp; ++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_bootp6; + + void + grub_bootp_init (void) +@@ -575,6 +1477,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 +@@ -582,4 +1487,5 @@ grub_bootp_fini (void) + { + grub_unregister_command (cmd_getdhcp); + grub_unregister_command (cmd_bootp); ++ grub_unregister_command (cmd_bootp6); + } +Index: b/grub-core/net/ip.c +=================================================================== +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -235,6 +235,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; +Index: b/include/grub/net.h +=================================================================== +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -442,6 +442,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 +@@ -468,6 +528,14 @@ grub_net_configure_by_dhcp_ack (const ch + 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); +@@ -476,6 +544,10 @@ void + grub_net_process_dhcp (struct grub_net_buff *nb, + struct grub_net_card *card); + ++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); diff -Nru grub2-2.02~beta2/debian/patches/bootp_process_dhcpack_http_boot.patch grub2-2.02~beta2/debian/patches/bootp_process_dhcpack_http_boot.patch --- grub2-2.02~beta2/debian/patches/bootp_process_dhcpack_http_boot.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/bootp_process_dhcpack_http_boot.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,125 @@ +From: Michael Chang +Subject: [PATCH 6/8] 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 +Signed-off-by: Ken Lin +--- + grub-core/net/bootp.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-- + include/grub/net.h | 1 + 2 files changed, 66 insertions(+), 2 deletions(-) + +Index: b/grub-core/net/bootp.c +=================================================================== +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -207,6 +207,11 @@ parse_dhcp_vendor (const char *name, con + taglength); + break; + ++ case GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER: ++ grub_env_set_net_property (name, "vendor_class_identifier", (const char *) ptr, ++ taglength); ++ break; ++ + case GRUB_NET_BOOTP_EXTENSIONS_PATH: + grub_env_set_net_property (name, "extensionspath", (const char *) ptr, + taglength); +@@ -271,6 +276,66 @@ grub_net_configure_by_dhcp_ack (const ch + grub_net_add_route (name, target, inter); + } + ++ if (size > OFFSET_OF (vendor, bp)) ++ { ++ char *cidvar; ++ const char *cid; ++ ++ parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); ++ cidvar = grub_xasprintf ("net_%s_%s", name, "vendor_class_identifier"); ++ cid = grub_env_get (cidvar); ++ grub_free (cidvar); ++ ++ if (cid && grub_strcmp (cid, "HTTPClient") == 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; ++ } ++ } ++ + if (size > OFFSET_OF (boot_file, bp)) + grub_env_set_net_property (name, "boot_file", bp->boot_file, + sizeof (bp->boot_file)); +@@ -332,8 +397,6 @@ grub_net_configure_by_dhcp_ack (const ch + **path = 0; + } + } +- if (size > OFFSET_OF (vendor, bp)) +- parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); + grub_net_add_ipv4_local (inter, mask); + + inter->dhcp_ack = grub_malloc (size); +Index: b/include/grub/net.h +=================================================================== +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -517,6 +517,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_BOOTP_END = 0xff + }; + diff -Nru grub2-2.02~beta2/debian/patches/efi-fix-warnings-with-recent-GCC.patch grub2-2.02~beta2/debian/patches/efi-fix-warnings-with-recent-GCC.patch --- grub2-2.02~beta2/debian/patches/efi-fix-warnings-with-recent-GCC.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/efi-fix-warnings-with-recent-GCC.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,27 @@ +From 5fcde03bf1e8cf74c186bcef6d705734f2d002c5 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Tue, 27 Oct 2015 23:30:54 +0300 +Subject: [PATCH] efi: fix warnings with recent GCC + +../../grub-core/term/efi/console.c:128:32: error: suggest parentheses around '&&' within '||' [-Werror=parentheses] + if (key.unicode_char >= 0x20 && key.unicode_char <= 0x7f +--- + grub-core/term/efi/console.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c +index 8b2096f..7d31095 100644 +--- a/grub-core/term/efi/console.c ++++ b/grub-core/term/efi/console.c +@@ -125,7 +125,7 @@ grub_efi_translate_key (grub_efi_input_key_t key) + else if (key.scan_code < ARRAY_SIZE (efi_codes)) + return efi_codes[key.scan_code]; + +- if (key.unicode_char >= 0x20 && key.unicode_char <= 0x7f ++ if ((key.unicode_char >= 0x20 && key.unicode_char <= 0x7f) + || key.unicode_char == '\t' || key.unicode_char == '\b' + || key.unicode_char == '\n' || key.unicode_char == '\r') + return key.unicode_char; +-- +2.7.4 + diff -Nru grub2-2.02~beta2/debian/patches/efinet_set_dns_from_uefi_proto.patch grub2-2.02~beta2/debian/patches/efinet_set_dns_from_uefi_proto.patch --- grub2-2.02~beta2/debian/patches/efinet_set_dns_from_uefi_proto.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/efinet_set_dns_from_uefi_proto.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,335 @@ +From: Michael Chang +Subject: [PATCH 8/8] 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 +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 163 +++++++++++++++++++++++++++++++++++++ + include/grub/efi/api.h | 76 +++++++++++++++++ + 2 files changed, 239 insertions(+) + +Index: b/grub-core/net/drivers/efi/efinet.c +=================================================================== +--- 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, +@@ -312,6 +314,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) + { +@@ -364,6 +485,8 @@ grub_efinet_create_dhcp_ack_from_device_ + 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); +@@ -425,6 +548,25 @@ grub_efinet_create_dhcp_ack_from_device_ + *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) +@@ -457,6 +599,8 @@ grub_efinet_create_dhcp_ack_from_device_ + 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)); +@@ -520,6 +664,25 @@ grub_efinet_create_dhcp_ack_from_device_ + 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; + } + +Index: b/include/grub/efi/api.h +=================================================================== +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -286,6 +286,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; +@@ -1637,6 +1647,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__) + diff -Nru grub2-2.02~beta2/debian/patches/efinet_set_network_from_uefi_devpath.patch grub2-2.02~beta2/debian/patches/efinet_set_network_from_uefi_devpath.patch --- grub2-2.02~beta2/debian/patches/efinet_set_network_from_uefi_devpath.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/efinet_set_network_from_uefi_devpath.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,384 @@ +From: Michael Chang +Subject: [PATCH 7/8] 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 +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 268 +++++++++++++++++++++++++++++++++++-- + include/grub/efi/api.h | 11 + + 2 files changed, 270 insertions(+), 9 deletions(-) + +Index: b/grub-core/net/drivers/efi/efinet.c +=================================================================== +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -311,6 +312,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) +@@ -327,6 +543,11 @@ grub_efi_net_config_real (grub_efi_handl + 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); +@@ -346,11 +567,21 @@ grub_efi_net_config_real (grub_efi_handl + 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; +@@ -362,16 +593,31 @@ grub_efi_net_config_real (grub_efi_handl + } + 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 (); +@@ -380,10 +626,14 @@ grub_efi_net_config_real (grub_efi_handl + { + 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; + } + } +Index: b/include/grub/efi/api.h +=================================================================== +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -776,6 +776,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; + +@@ -830,6 +832,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. */ diff -Nru grub2-2.02~beta2/debian/patches/efinet_uefi_ipv6_pxe_support.patch grub2-2.02~beta2/debian/patches/efinet_uefi_ipv6_pxe_support.patch --- grub2-2.02~beta2/debian/patches/efinet_uefi_ipv6_pxe_support.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/efinet_uefi_ipv6_pxe_support.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,122 @@ +From: Michael Chang +Subject: [PATCH 4/8] efinet: UEFI IPv6 PXE support + +When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is +cached in firmware buffer which can be obtained by PXE Base Code protocol. The +network interface can be setup through the parameters in that obtained packet. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 24 ++++++++++++---- + include/grub/efi/api.h | 55 ++++++++++++++++++++++++++++++++++++- + 2 files changed, 73 insertions(+), 6 deletions(-) + +Index: b/grub-core/net/drivers/efi/efinet.c +=================================================================== +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -365,11 +365,25 @@ grub_efi_net_config_real (grub_efi_handl + 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; + } + } +Index: b/include/grub/efi/api.h +=================================================================== +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -1340,14 +1340,67 @@ typedef struct grub_efi_simple_text_outp + + 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 diff -Nru grub2-2.02~beta2/debian/patches/git_fix_tsc_calibration_pit_a03c1034.patch grub2-2.02~beta2/debian/patches/git_fix_tsc_calibration_pit_a03c1034.patch --- grub2-2.02~beta2/debian/patches/git_fix_tsc_calibration_pit_a03c1034.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_fix_tsc_calibration_pit_a03c1034.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,28 @@ +From a03c1034f6062e69075056c8f31b90e159ce5244 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 01 Dec 2015 15:49:38 +0000 +Subject: i386: fix TSC calibration using PIT + +Condition was accidentally reversed, so PIT calibration always failed +when PIT was present and always succeeded when PIT was missing, but in +the latter case resulted in absurdly fast clock. + +Reported and tested by Vitaly Kuznetsov +--- +--- + grub-core/kern/i386/tsc_pit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: b/grub-core/kern/i386/tsc_pit.c +=================================================================== +--- a/grub-core/kern/i386/tsc_pit.c ++++ b/grub-core/kern/i386/tsc_pit.c +@@ -49,7 +49,7 @@ grub_pit_wait (void) + | GRUB_PIT_SPK_TMR2, + GRUB_PIT_SPEAKER_PORT); + +- if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH)) { ++ if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00) { + ret = 1; + /* Wait. */ + while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00); diff -Nru grub2-2.02~beta2/debian/patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch grub2-2.02~beta2/debian/patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch --- grub2-2.02~beta2/debian/patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_pmem_efiemu_handle_pmem_ae3b83a4.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,80 @@ +From ae3b83a4d4df75a01198a2fed7542391e7c449e0 Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Fri, 22 Jan 2016 13:32:30 +0100 +Subject: efiemu: Handle persistent RAM and unknown possible future additions. + +--- + grub-core/efiemu/mm.c | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +Index: b/grub-core/efiemu/mm.c +=================================================================== +--- a/grub-core/efiemu/mm.c ++++ b/grub-core/efiemu/mm.c +@@ -99,7 +99,8 @@ grub_efiemu_request_memalign (grub_size_ + grub_size_t align_overhead; + struct grub_efiemu_memrequest *ret, *cur, *prev; + /* Check that the request is correct */ +- if (type >= GRUB_EFI_MAX_MEMORY_TYPE || type <= GRUB_EFI_LOADER_CODE) ++ if (type <= GRUB_EFI_LOADER_CODE || type == GRUB_EFI_PERSISTENT_MEMORY || ++ type >= GRUB_EFI_MAX_MEMORY_TYPE) + return -2; + + /* Add new size to requested size */ +@@ -166,6 +167,13 @@ efiemu_alloc_requests (void) + GRUB_EFI_MEMORY_MAPPED_IO, + GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + GRUB_EFI_PAL_CODE ++ ++ /* ++ * These are not allocatable: ++ * GRUB_EFI_RESERVED_MEMORY_TYPE ++ * GRUB_EFI_PERSISTENT_MEMORY ++ * >= GRUB_EFI_MAX_MEMORY_TYPE ++ */ + }; + + /* Compute total memory needed */ +@@ -402,6 +410,10 @@ fill_hook (grub_uint64_t addr, grub_uint + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_ACPI_MEMORY_NVS); + ++ case GRUB_MEMORY_PERSISTENT: ++ case GRUB_MEMORY_PERSISTENT_LEGACY: ++ return grub_efiemu_add_to_mmap (addr, size, ++ GRUB_EFI_PERSISTENT_MEMORY); + default: + grub_dprintf ("efiemu", + "Unknown memory type %d. Assuming unusable\n", type); +@@ -445,7 +457,7 @@ grub_efiemu_mmap_iterate (grub_memory_ho + case GRUB_EFI_MEMORY_MAPPED_IO: + case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case GRUB_EFI_PAL_CODE: +- case GRUB_EFI_MAX_MEMORY_TYPE: ++ default: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_RESERVED, hook_data); + break; +@@ -468,6 +480,12 @@ grub_efiemu_mmap_iterate (grub_memory_ho + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_NVS, hook_data); + break; ++ ++ case GRUB_EFI_PERSISTENT_MEMORY: ++ hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, ++ GRUB_MEMORY_PERSISTENT, hook_data); ++ break; ++ + } + + return 0; +@@ -503,7 +521,8 @@ grub_efiemu_mmap_sort_and_uniq (void) + [GRUB_EFI_ACPI_MEMORY_NVS] = 3, + [GRUB_EFI_MEMORY_MAPPED_IO] = 4, + [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, +- [GRUB_EFI_PAL_CODE] = 4 ++ [GRUB_EFI_PAL_CODE] = 4, ++ [GRUB_EFI_PERSISTENT_MEMORY] = 4 + }; + + int i, j, k, done; diff -Nru grub2-2.02~beta2/debian/patches/git_pmem_mmap_handle_pmem_c79c59f1.patch grub2-2.02~beta2/debian/patches/git_pmem_mmap_handle_pmem_c79c59f1.patch --- grub2-2.02~beta2/debian/patches/git_pmem_mmap_handle_pmem_c79c59f1.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_pmem_mmap_handle_pmem_c79c59f1.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,179 @@ +From c79c59f1295df8ea660f8a858f9532d76a5f67b7 Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Thu, 17 Dec 2015 10:53:32 -0600 +Subject: lsefimmap: support persistent memory and other UEFI 2.5 features + +This should accompany + 76ce1de740 Translate UEFI persistent memory type + +1. Add a string for the EfiPersistentMemory type 14 that was +added in UEFI 2.5. + +2. Decode the memory attributes that were added in UEFI 2.5: +* NV (non-volatile) +* MORE_RELIABLE (higher reliable, e.g., mirrored memory in a system + with partial memory mirroring) +* RO (read-only) + +3. Use proper IEC binary units (KiB, MiB, etc.) for power-of-two +values rather than misusing SI power-of-ten units (KB, MB, etc.) + +4. The lsmmap command only decodes memory ranges sizes up to GiB scale +units. Persistent memory ranges will reach into the TiB scale. +Since 64-bit size field supports TiB, PiB, and EiB, decode all of +them for completeness. + +5. In the lsefimmap command, rewrite the print statements to +* avoid rounding +* avoid a big nested if/else tree. + +For example: In the sixth entry below, the value of 309MB implies +316416KB but is really reporting 316436KB. + +Widen the size column to 6 digits to accommodate typical cases. +The worst case value would require 14 digits; if that happens, +let the columns get out of sync. + +Old format: +Type Physical start - end #Pages Size Attributes +conv-mem 0000000000000000-0000000000092fff 00000093 588KB UC WC WT WB +reserved 0000000000093000-0000000000093fff 00000001 4KB UC WC WT WB +conv-mem 0000000000094000-000000000009ffff 0000000c 48KB UC WC WT WB +conv-mem 0000000000100000-000000000fffffff 0000ff00 255MB UC WC WT WB +BS-code 0000000010000000-0000000010048fff 00000049 292KB UC WC WT WB +conv-mem 0000000010049000-000000002354dfff 00013505 309MB UC WC WT WB +ldr-data 000000002354e000-000000003ecfffff 0001b7b2 439MB UC WC WT WB +BS-data 000000003ed00000-000000003ed7ffff 00000080 512KB UC WC WT WB +conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 705MB UC WC WT WB +reserved 000000006af60000-000000006b55ffff 00000600 6MB UC WC WT WB +BS-data 000000006b560000-000000006b560fff 00000001 4KB UC WC WT WB +RT-data 000000006b561000-000000006b5e1fff 00000081 516KB RT UC WC WT WB +BS-data 000000006b5e2000-000000006ecfafff 00003719 55MB UC WC WT WB +BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KB UC WC WT WB +conv-mem 000000006ecfc000-00000000711fafff 000024ff 36MB UC WC WT WB +BS-data 00000000711fb000-000000007128dfff 00000093 588KB UC WC WT WB +Unk 0d 0000000880000000-0000000e7fffffff 00600000 24GB UC WC WT WB NV +reserved 0000001680000000-0000001c7fffffff 00600000 24GB UC WC WT WB NV + +New format: +Type Physical start - end #Pages Size Attributes +conv-mem 0000000000000000-0000000000092fff 00000093 588KiB UC WC WT WB +reserved 0000000000093000-0000000000093fff 00000001 4KiB UC WC WT WB +conv-mem 0000000000094000-000000000009ffff 0000000c 48KiB UC WC WT WB +conv-mem 0000000000100000-000000000fffffff 0000ff00 255MiB UC WC WT WB +BS-code 0000000010000000-0000000010048fff 00000049 292KiB UC WC WT WB +conv-mem 0000000010049000-000000002354dfff 00013505 316436KiB UC WC WT WB +ldr-data 000000002354e000-000000003ecfffff 0001b7b2 450248KiB UC WC WT WB +BS-data 000000003ed00000-000000003ed7ffff 00000080 512KiB UC WC WT WB +conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 722816KiB UC WC WT WB +reserved 000000006af60000-000000006b55ffff 00000600 6MiB UC WC WT WB +BS-data 000000006b560000-000000006b560fff 00000001 4KiB UC WC WT WB +RT-data 000000006b561000-000000006b5e1fff 00000081 516KiB RT UC WC WT WB +BS-data 000000006b5e2000-000000006ecfafff 00003719 56420KiB UC WC WT WB +BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KiB UC WC WT WB +conv-mem 000000006ecfc000-0000000071222fff 00002527 38044KiB UC WC WT WB +BS-data 0000000071223000-00000000712ddfff 000000bb 748KiB UC WC WT WB +persist 0000000880000000-0000000e7fffffff 00600000 24GiB UC WC WT WB NV +reserved 0000001680000000-0000001c7fffffff 00600000 24GiB UC WC WT WB NV +--- + grub-core/commands/efi/lsefimmap.c | 47 +++++++++++++++++++++++++------------- + include/grub/efi/api.h | 3 +++ + 2 files changed, 34 insertions(+), 16 deletions(-) + +diff --git a/grub-core/commands/efi/lsefimmap.c b/grub-core/commands/efi/lsefimmap.c +index 215b45b..c85ff7f 100644 +--- a/grub-core/commands/efi/lsefimmap.c ++++ b/grub-core/commands/efi/lsefimmap.c +@@ -51,7 +51,7 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + + grub_printf + ("Type Physical start - end #Pages " +- " Size Attributes\n"); ++ " Size Attributes\n"); + memory_map_end = ADD_MEMORY_DESCRIPTOR (memory_map, map_size); + for (desc = memory_map; + desc < memory_map_end; +@@ -74,7 +74,8 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + "ACPI-nvs", + "MMIO ", + "IO-ports", +- "PAL-code" ++ "PAL-code", ++ "persist ", + }; + if (desc->type < ARRAY_SIZE (types_str)) + grub_printf ("%s ", types_str[desc->type]); +@@ -87,21 +88,29 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + desc->physical_start + (desc->num_pages << 12) - 1, + desc->num_pages); + +- size = desc->num_pages; +- size <<= (12 - 10); +- if (size < 1024) +- grub_printf (" %4" PRIuGRUB_UINT64_T "KB", size); ++ size = desc->num_pages << 12; /* 4 KiB page size */ ++ /* ++ * Since size is a multiple of 4 KiB, no need to handle units ++ * of just Bytes (which would use a mask of 0x3ff). ++ * ++ * 14 characters would support the largest possible number of 4 KiB ++ * pages that are not a multiple of larger units (e.g., MiB): ++ * 17592186044415 (0xffffff_fffff000), but that uses a lot of ++ * whitespace for a rare case. 6 characters usually suffices; ++ * columns will be off if not, but this is preferable to rounding. ++ */ ++ if (size & 0xfffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "KiB", size >> 10); ++ else if (size & 0x3fffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "MiB", size >> 20); ++ else if (size & 0xffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "GiB", size >> 30); ++ else if (size & 0x3ffffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "TiB", size >> 40); ++ else if (size & 0xfffffffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "PiB", size >> 50); + else +- { +- size /= 1024; +- if (size < 1024) +- grub_printf (" %4" PRIuGRUB_UINT64_T "MB", size); +- else +- { +- size /= 1024; +- grub_printf (" %4" PRIuGRUB_UINT64_T "GB", size); +- } +- } ++ grub_printf (" %6" PRIuGRUB_UINT64_T "EiB", size >> 60); + + attr = desc->attribute; + if (attr & GRUB_EFI_MEMORY_RUNTIME) +@@ -122,6 +131,12 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + grub_printf (" RP"); + if (attr & GRUB_EFI_MEMORY_XP) + grub_printf (" XP"); ++ if (attr & GRUB_EFI_MEMORY_NV) ++ grub_printf (" NV"); ++ if (attr & GRUB_EFI_MEMORY_MORE_RELIABLE) ++ grub_printf (" MR"); ++ if (attr & GRUB_EFI_MEMORY_RO) ++ grub_printf (" RO"); + + grub_printf ("\n"); + } +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index 2bbfe34..c7c9f0e 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -49,6 +49,9 @@ + #define GRUB_EFI_MEMORY_WP 0x0000000000001000LL + #define GRUB_EFI_MEMORY_RP 0x0000000000002000LL + #define GRUB_EFI_MEMORY_XP 0x0000000000004000LL ++#define GRUB_EFI_MEMORY_NV 0x0000000000008000LL ++#define GRUB_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL ++#define GRUB_EFI_MEMORY_RO 0x0000000000020000LL + #define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL + + #define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +-- +cgit v1.0-41-gc330 + diff -Nru grub2-2.02~beta2/debian/patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch grub2-2.02~beta2/debian/patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch --- grub2-2.02~beta2/debian/patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_pmem_really_mark_mem_reserved_3d2c8048.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,65 @@ +From 3d2c8048da7db334fd6d57b27304ac765fd4cd67 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 26 Nov 2015 19:50:42 +0300 +Subject: efi: really mark memory of unknown type as reserved + +9be4c45dbe3c877d1f4856e99ee15133c6cd2261 added switch case between +fall through cases, causing all memory regions of unknown type to be +marked as available. + +Move default case into its own block and add explicit FALLTHROUGH +annotation. + +Reported by Elliott, Robert (Persistent Memory) +--- + grub-core/mmap/efi/mmap.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c +index a77efe8..900a4d6 100644 +--- a/grub-core/mmap/efi/mmap.c ++++ b/grub-core/mmap/efi/mmap.c +@@ -73,6 +73,7 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_AVAILABLE, hook_data); + break; + } ++ /* FALLTHROUGH */ + case GRUB_EFI_RUNTIME_SERVICES_CODE: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MEMORY_CODE, hook_data); +@@ -83,10 +84,6 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_BADRAM, hook_data); + break; + +- default: +- grub_printf ("Unknown memory type %d, considering reserved\n", +- desc->type); +- + case GRUB_EFI_BOOT_SERVICES_DATA: + if (!avoid_efi_boot_services) + { +@@ -94,6 +91,7 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_AVAILABLE, hook_data); + break; + } ++ /* FALLTHROUGH */ + case GRUB_EFI_RESERVED_MEMORY_TYPE: + case GRUB_EFI_RUNTIME_SERVICES_DATA: + case GRUB_EFI_MEMORY_MAPPED_IO: +@@ -119,6 +117,13 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MEMORY_NVS, hook_data); + break; ++ ++ default: ++ grub_printf ("Unknown memory type %d, considering reserved\n", ++ desc->type); ++ hook (desc->physical_start, desc->num_pages * 4096, ++ GRUB_MEMORY_RESERVED, hook_data); ++ break; + } + } + +-- +cgit v1.0-41-gc330 + diff -Nru grub2-2.02~beta2/debian/patches/git_pmem_translate_persistent_type_76ce1de7.patch grub2-2.02~beta2/debian/patches/git_pmem_translate_persistent_type_76ce1de7.patch --- grub2-2.02~beta2/debian/patches/git_pmem_translate_persistent_type_76ce1de7.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_pmem_translate_persistent_type_76ce1de7.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,97 @@ +From 76ce1de740f202985ffd7b2e980cf34c75a2dac3 Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Thu, 3 Dec 2015 11:38:36 -0600 +Subject: Translate UEFI persistent memory type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define +* GRUB_EFI_PERSISTENT_MEMORY (UEFI memory map type 14) per UEFI 2.5 +* GRUB_MEMORY_PERSISTENT (E820 type 7) per ACPI 3.0 +* GRUB_MEMORY_PERSISTENT_LEGACY (E820 unofficial type 12) per ACPI 3.0 + +and translate GRUB_EFI_PERSISTENT_MEMORY to GRUB_MEMORY_PERSISTENT in +grub_efi_mmap_iterate(). + +Includes +* adding the E820 names to lsmmap +* handling the E820 types in make_efi_memtype() + +Suggested-by: Vladimir 'φ-coder/phcoder' Serbinenko +Suggested-by: Andrei Borzenkov +--- + grub-core/commands/lsmmap.c | 2 ++ + grub-core/mmap/efi/mmap.c | 12 ++++++++++++ + include/grub/efi/api.h | 1 + + include/grub/memory.h | 2 ++ + 4 files changed, 17 insertions(+) + +Index: b/grub-core/commands/lsmmap.c +=================================================================== +--- a/grub-core/commands/lsmmap.c ++++ b/grub-core/commands/lsmmap.c +@@ -37,6 +37,8 @@ static const char *names[] = + is required to save accross hibernations. */ + [GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"), + [GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"), ++ [GRUB_MEMORY_PERSISTENT] = N_("persistent RAM"), ++ [GRUB_MEMORY_PERSISTENT_LEGACY] = N_("persistent RAM (legacy)"), + [GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"), + [GRUB_MEMORY_CODE] = N_("RAM holding firmware code") + }; +Index: b/grub-core/mmap/efi/mmap.c +=================================================================== +--- a/grub-core/mmap/efi/mmap.c ++++ b/grub-core/mmap/efi/mmap.c +@@ -118,6 +118,11 @@ grub_efi_mmap_iterate (grub_memory_hook_ + GRUB_MEMORY_NVS, hook_data); + break; + ++ case GRUB_EFI_PERSISTENT_MEMORY: ++ hook (desc->physical_start, desc->num_pages * 4096, ++ GRUB_MEMORY_PERSISTENT, hook_data); ++ break; ++ + default: + grub_printf ("Unknown memory type %d, considering reserved\n", + desc->type); +@@ -147,6 +152,13 @@ make_efi_memtype (int type) + /* No way to remove a chunk of memory from EFI mmap. + So mark it as unusable. */ + case GRUB_MEMORY_HOLE: ++ /* ++ * AllocatePages() does not support GRUB_EFI_PERSISTENT_MEMORY, ++ * so no translation for GRUB_MEMORY_PERSISTENT or ++ * GRUB_MEMORY_PERSISTENT_LEGACY. ++ */ ++ case GRUB_MEMORY_PERSISTENT: ++ case GRUB_MEMORY_PERSISTENT_LEGACY: + case GRUB_MEMORY_RESERVED: + return GRUB_EFI_UNUSABLE_MEMORY; + +Index: b/include/grub/efi/api.h +=================================================================== +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -441,6 +441,7 @@ enum grub_efi_memory_type + GRUB_EFI_MEMORY_MAPPED_IO, + GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + GRUB_EFI_PAL_CODE, ++ GRUB_EFI_PERSISTENT_MEMORY, + GRUB_EFI_MAX_MEMORY_TYPE + }; + typedef enum grub_efi_memory_type grub_efi_memory_type_t; +Index: b/include/grub/memory.h +=================================================================== +--- a/include/grub/memory.h ++++ b/include/grub/memory.h +@@ -30,6 +30,8 @@ typedef enum grub_memory_type + GRUB_MEMORY_ACPI = 3, + GRUB_MEMORY_NVS = 4, + GRUB_MEMORY_BADRAM = 5, ++ GRUB_MEMORY_PERSISTENT = 7, ++ GRUB_MEMORY_PERSISTENT_LEGACY = 12, + GRUB_MEMORY_COREBOOT_TABLES = 16, + GRUB_MEMORY_CODE = 20, + /* This one is special: it's used internally but is never reported diff -Nru grub2-2.02~beta2/debian/patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch grub2-2.02~beta2/debian/patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch --- grub2-2.02~beta2/debian/patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_split_pmtimer_wait_tsc_d9a3bfea.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,161 @@ +From d9a3bfead8236377c2f46eb75c4fd7fef93696ea Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 12 Feb 2016 10:40:51 +0000 +Subject: Split pmtimer wait and tsc measurement from pmtimer tsc calibration. + +--- +--- + grub-core/Makefile.am | 2 + + grub-core/kern/i386/tsc_pmtimer.c | 47 ++++++++++++++++++++++++-------------- + include/grub/i386/pmtimer.h | 37 +++++++++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 17 deletions(-) + +Index: b/grub-core/Makefile.am +=================================================================== +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -100,6 +100,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h + endif + + if COND_i386_coreboot +@@ -155,6 +156,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h + endif + + if COND_ia64_efi +Index: b/grub-core/kern/i386/tsc_pmtimer.c +=================================================================== +--- a/grub-core/kern/i386/tsc_pmtimer.c ++++ b/grub-core/kern/i386/tsc_pmtimer.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -112,41 +113,31 @@ grub_acpi_find_fadt (void) + return 0; + } + +-int +-grub_tsc_calibrate_from_pmtimer (void) ++grub_uint64_t ++grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, ++ grub_uint16_t num_pm_ticks) + { + grub_uint32_t start; + grub_uint32_t last; + grub_uint32_t cur, end; +- struct grub_acpi_fadt *fadt; +- grub_port_t p; + grub_uint64_t start_tsc; + grub_uint64_t end_tsc; + int num_iter = 0; + +- fadt = grub_acpi_find_fadt (); +- if (!fadt) +- return 0; +- p = fadt->pmtimer; +- if (!p) +- return 0; +- +- start = grub_inl (p) & 0xffffff; ++ start = grub_inl (pmtimer) & 0xffffff; + last = start; +- /* It's 3.579545 MHz clock. Wait 1 ms. */ +- end = start + 3580; ++ end = start + num_pm_ticks; + start_tsc = grub_get_tsc (); + while (1) + { +- cur = grub_inl (p) & 0xffffff; ++ cur = grub_inl (pmtimer) & 0xffffff; + if (cur < last) + cur |= 0x1000000; + num_iter++; + if (cur >= end) + { + end_tsc = grub_get_tsc (); +- grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); +- return 1; ++ return end_tsc - start_tsc; + } + /* Check for broken PM timer. + 50000000 TSCs is between 5 ms (10GHz) and 200 ms (250 MHz) +@@ -158,3 +149,25 @@ grub_tsc_calibrate_from_pmtimer (void) + } + } + } ++ ++int ++grub_tsc_calibrate_from_pmtimer (void) ++{ ++ struct grub_acpi_fadt *fadt; ++ grub_port_t pmtimer; ++ grub_uint64_t tsc_diff; ++ ++ fadt = grub_acpi_find_fadt (); ++ if (!fadt) ++ return 0; ++ pmtimer = fadt->pmtimer; ++ if (!pmtimer) ++ return 0; ++ ++ /* It's 3.579545 MHz clock. Wait 1 ms. */ ++ tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer, 3580); ++ if (tsc_diff == 0) ++ return 0; ++ grub_tsc_rate = grub_divmod64 ((1ULL << 32), tsc_diff, 0); ++ return 1; ++} +Index: b/include/grub/i386/pmtimer.h +=================================================================== +--- /dev/null ++++ b/include/grub/i386/pmtimer.h +@@ -0,0 +1,37 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008,2009 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#ifndef KERNEL_CPU_PMTIMER_HEADER ++#define KERNEL_CPU_PMTIMER_HEADER 1 ++ ++#include ++#include ++ ++/* ++ Preconditions: ++ * Caller has ensured that both pmtimer and tsc are supported ++ * 1 <= num_pm_ticks <= 3580 ++ Return: ++ * Number of TSC ticks elapsed ++ * 0 on failure. ++*/ ++grub_uint64_t ++EXPORT_FUNC(grub_pmtimer_wait_count_tsc) (grub_port_t pmtimer, ++ grub_uint16_t num_pm_ticks); ++ ++#endif diff -Nru grub2-2.02~beta2/debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch grub2-2.02~beta2/debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch --- grub2-2.02~beta2/debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/git_tsc_use_alt_delay_sources_d43a5ee6.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,940 @@ +From d43a5ee65143f384357fbfdcace4258e3537c214 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 13 Nov 2015 15:14:53 +0000 +Subject: tsc: Use alternative delay sources whenever appropriate. + +PIT isn't available on some of new hardware including Hyper-V. So +use pmtimer for calibration. Moreover pmtimer calibration is faster, so +use it on coreboor where booting time is important. + +Based on patch by Michael Chang. +--- +--- + grub-core/Makefile.am | 7 + + grub-core/Makefile.core.def | 19 +++- + grub-core/commands/acpi.c | 12 -- + grub-core/kern/acpi.c | 34 ++++++++ + grub-core/kern/efi/acpi.c | 59 ++++++++++++++ + grub-core/kern/i386/efi/tsc.c | 40 +++++++++ + grub-core/kern/i386/pc/acpi.c | 83 +++++++++++++++++++ + grub-core/kern/i386/tsc.c | 121 ++++++---------------------- + grub-core/kern/i386/tsc_pit.c | 84 +++++++++++++++++++ + grub-core/kern/i386/tsc_pmtimer.c | 160 ++++++++++++++++++++++++++++++++++++++ + grub-core/kern/i386/xen/tsc.c | 40 +++++++++ + include/grub/acpi.h | 17 ++-- + include/grub/i386/tsc.h | 26 ++++++ + 13 files changed, 589 insertions(+), 113 deletions(-) + +Index: b/grub-core/Makefile.am +=================================================================== +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -99,6 +99,7 @@ if COND_i386_efi + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h + endif + +@@ -110,10 +111,12 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_i386_multiboot + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_i386_qemu +@@ -152,11 +155,13 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_ia64_efi + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_mips +@@ -231,11 +236,13 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_arm64_efi + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h + endif + + if COND_emu +Index: b/grub-core/Makefile.core.def +=================================================================== +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -174,9 +174,21 @@ kernel = { + efi = kern/efi/init.c; + efi = kern/efi/mm.c; + efi = term/efi/console.c; ++ efi = kern/acpi.c; ++ efi = kern/efi/acpi.c; ++ i386_coreboot = kern/i386/pc/acpi.c; ++ i386_multiboot = kern/i386/pc/acpi.c; ++ i386_coreboot = kern/acpi.c; ++ i386_multiboot = kern/acpi.c; + common = kern/efi/sb.c; + + x86 = kern/i386/tsc.c; ++ x86 = kern/i386/tsc_pit.c; ++ i386_efi = kern/i386/efi/tsc.c; ++ x86_64_efi = kern/i386/efi/tsc.c; ++ i386_efi = kern/i386/tsc_pmtimer.c; ++ i386_coreboot = kern/i386/tsc_pmtimer.c; ++ x86_64_efi = kern/i386/tsc_pmtimer.c; + + i386_efi = kern/i386/efi/init.c; + i386_efi = bus/pci.c; +@@ -188,6 +200,7 @@ kernel = { + x86_64_efi = bus/pci.c; + + xen = kern/i386/tsc.c; ++ xen = kern/i386/xen/tsc.c; + x86_64_xen = kern/x86_64/xen/hypercall.S; + i386_xen = kern/i386/xen/hypercall.S; + xen = kern/xen/init.c; +@@ -686,10 +699,8 @@ module = { + name = acpi; + + common = commands/acpi.c; +- efi = commands/efi/acpi.c; +- i386_pc = commands/i386/pc/acpi.c; +- i386_coreboot = commands/i386/pc/acpi.c; +- i386_multiboot = commands/i386/pc/acpi.c; ++ i386_pc = kern/acpi.c; ++ i386_pc = kern/i386/pc/acpi.c; + + enable = efi; + enable = i386_pc; +Index: b/grub-core/commands/acpi.c +=================================================================== +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -61,18 +61,6 @@ static const struct grub_arg_option opti + {0, 0, 0, 0, 0, 0} + }; + +-/* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */ +-grub_uint8_t +-grub_byte_checksum (void *base, grub_size_t size) +-{ +- grub_uint8_t *ptr; +- grub_uint8_t ret = 0; +- for (ptr = (grub_uint8_t *) base; ptr < ((grub_uint8_t *) base) + size; +- ptr++) +- ret += *ptr; +- return ret; +-} +- + /* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. + rev2 contains the revision of ACPIv2+ to generate or 0 if none. */ + static int rev1, rev2; +Index: b/grub-core/kern/acpi.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/acpi.c +@@ -0,0 +1,34 @@ ++/* ++ * 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 . ++ */ ++ ++#include ++#include ++#include ++#include ++ ++/* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */ ++grub_uint8_t ++grub_byte_checksum (void *base, grub_size_t size) ++{ ++ grub_uint8_t *ptr; ++ grub_uint8_t ret = 0; ++ for (ptr = (grub_uint8_t *) base; ptr < ((grub_uint8_t *) base) + size; ++ ptr++) ++ ret += *ptr; ++ return ret; ++} +Index: b/grub-core/kern/efi/acpi.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/efi/acpi.c +@@ -0,0 +1,59 @@ ++/* acpi.c - get acpi tables. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2009 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++ ++struct grub_acpi_rsdp_v10 * ++grub_machine_acpi_get_rsdpv1 (void) ++{ ++ unsigned i; ++ static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; ++ ++ for (i = 0; i < grub_efi_system_table->num_table_entries; i++) ++ { ++ grub_efi_packed_guid_t *guid = ++ &grub_efi_system_table->configuration_table[i].vendor_guid; ++ ++ if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_packed_guid_t))) ++ return (struct grub_acpi_rsdp_v10 *) ++ grub_efi_system_table->configuration_table[i].vendor_table; ++ } ++ return 0; ++} ++ ++struct grub_acpi_rsdp_v20 * ++grub_machine_acpi_get_rsdpv2 (void) ++{ ++ unsigned i; ++ static grub_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID; ++ ++ for (i = 0; i < grub_efi_system_table->num_table_entries; i++) ++ { ++ grub_efi_packed_guid_t *guid = ++ &grub_efi_system_table->configuration_table[i].vendor_guid; ++ ++ if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_packed_guid_t))) ++ return (struct grub_acpi_rsdp_v20 *) ++ grub_efi_system_table->configuration_table[i].vendor_table; ++ } ++ return 0; ++} +Index: b/grub-core/kern/i386/efi/tsc.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/i386/efi/tsc.c +@@ -0,0 +1,40 @@ ++/* kern/i386/tsc.c - x86 TSC time source implementation ++ * Requires Pentium or better x86 CPU that supports the RDTSC instruction. ++ * This module uses the PIT to calibrate the TSC to ++ * real time. ++ * ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int ++grub_tsc_calibrate_from_efi (void) ++{ ++ grub_uint64_t start_tsc, end_tsc; ++ /* Use EFI Time Service to calibrate TSC */ ++ start_tsc = grub_get_tsc (); ++ efi_call_1 (grub_efi_system_table->boot_services->stall, 1000); ++ end_tsc = grub_get_tsc (); ++ grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); ++ return 1; ++} +Index: b/grub-core/kern/i386/pc/acpi.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/i386/pc/acpi.c +@@ -0,0 +1,83 @@ ++/* acpi.c - get acpi tables. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2009 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++ ++struct grub_acpi_rsdp_v10 * ++grub_machine_acpi_get_rsdpv1 (void) ++{ ++ int ebda_len; ++ grub_uint8_t *ebda, *ptr; ++ ++ grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ++ ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ++ ebda_len = * (grub_uint16_t *) ebda; ++ if (! ebda_len) /* FIXME do we really need this check? */ ++ goto scan_bios; ++ for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) ++ if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 ++ && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 ++ && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) ++ return (struct grub_acpi_rsdp_v10 *) ptr; ++ ++scan_bios: ++ grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); ++ for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ++ ptr += 16) ++ if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 ++ && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 ++ && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) ++ return (struct grub_acpi_rsdp_v10 *) ptr; ++ return 0; ++} ++ ++struct grub_acpi_rsdp_v20 * ++grub_machine_acpi_get_rsdpv2 (void) ++{ ++ int ebda_len; ++ grub_uint8_t *ebda, *ptr; ++ ++ grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ++ ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ++ ebda_len = * (grub_uint16_t *) ebda; ++ if (! ebda_len) /* FIXME do we really need this check? */ ++ goto scan_bios; ++ for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) ++ if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 ++ && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 ++ && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 ++ && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 ++ && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) ++ == 0) ++ return (struct grub_acpi_rsdp_v20 *) ptr; ++ ++scan_bios: ++ grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); ++ for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ++ ptr += 16) ++ if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 ++ && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 ++ && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 ++ && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 ++ && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) ++ == 0) ++ return (struct grub_acpi_rsdp_v20 *) ptr; ++ return 0; ++} +Index: b/grub-core/kern/i386/tsc_pit.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/i386/tsc_pit.c +@@ -0,0 +1,84 @@ ++/* kern/i386/tsc.c - x86 TSC time source implementation ++ * Requires Pentium or better x86 CPU that supports the RDTSC instruction. ++ * This module uses the PIT to calibrate the TSC to ++ * real time. ++ * ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static int ++grub_pit_wait (void) ++{ ++ int ret = 0; ++ ++ /* Disable timer2 gate and speaker. */ ++ grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) ++ & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), ++ GRUB_PIT_SPEAKER_PORT); ++ ++ /* Set tics. */ ++ grub_outb (GRUB_PIT_CTRL_SELECT_2 | GRUB_PIT_CTRL_READLOAD_WORD, ++ GRUB_PIT_CTRL); ++ /* 0xffff ticks: 55ms. */ ++ grub_outb (0xff, GRUB_PIT_COUNTER_2); ++ grub_outb (0xff, GRUB_PIT_COUNTER_2); ++ ++ /* Enable timer2 gate, keep speaker disabled. */ ++ grub_outb ((grub_inb (GRUB_PIT_SPEAKER_PORT) & ~ GRUB_PIT_SPK_DATA) ++ | GRUB_PIT_SPK_TMR2, ++ GRUB_PIT_SPEAKER_PORT); ++ ++ if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH)) { ++ ret = 1; ++ /* Wait. */ ++ while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00); ++ } ++ ++ /* Disable timer2 gate and speaker. */ ++ grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) ++ & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), ++ GRUB_PIT_SPEAKER_PORT); ++ ++ return ret; ++} ++ ++/* Calibrate the TSC based on the RTC. */ ++int ++grub_tsc_calibrate_from_pit (void) ++{ ++ /* First calibrate the TSC rate (relative, not absolute time). */ ++ grub_uint64_t start_tsc, end_tsc; ++ ++ start_tsc = grub_get_tsc (); ++ if (!grub_pit_wait ()) ++ return 0; ++ end_tsc = grub_get_tsc (); ++ ++ grub_tsc_rate = 0; ++ if (end_tsc > start_tsc) ++ grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - start_tsc, 0); ++ if (grub_tsc_rate == 0) ++ return 0; ++ return 1; ++} +Index: b/grub-core/kern/i386/tsc_pmtimer.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/i386/tsc_pmtimer.c +@@ -0,0 +1,160 @@ ++/* kern/i386/tsc.c - x86 TSC time source implementation ++ * Requires Pentium or better x86 CPU that supports the RDTSC instruction. ++ * This module uses the PIT to calibrate the TSC to ++ * real time. ++ * ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static void * ++grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) ++{ ++ grub_size_t s; ++ grub_uint32_t *ptr; ++ ++ if (!rsdt) ++ return 0; ++ ++ if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) ++ return 0; ++ ++ ptr = (grub_uint32_t *) (rsdt + 1); ++ s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); ++ for (; s; s--, ptr++) ++ { ++ struct grub_acpi_table_header *tbl; ++ tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; ++ if (grub_memcmp (tbl->signature, sig, 4) == 0) ++ return tbl; ++ } ++ return 0; ++} ++ ++static void * ++grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) ++{ ++ grub_size_t s; ++ grub_uint64_t *ptr; ++ ++ if (!xsdt) ++ return 0; ++ ++ if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) ++ return 0; ++ ++ ptr = (grub_uint64_t *) (xsdt + 1); ++ s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); ++ for (; s; s--, ptr++) ++ { ++ struct grub_acpi_table_header *tbl; ++#if GRUB_CPU_SIZEOF_VOID_P != 8 ++ if (*ptr >> 32) ++ continue; ++#endif ++ tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; ++ if (grub_memcmp (tbl->signature, sig, 4) == 0) ++ return tbl; ++ } ++ return 0; ++} ++ ++struct grub_acpi_fadt * ++grub_acpi_find_fadt (void) ++{ ++ struct grub_acpi_fadt *fadt = 0; ++ struct grub_acpi_rsdp_v10 *rsdpv1; ++ struct grub_acpi_rsdp_v20 *rsdpv2; ++ rsdpv1 = grub_machine_acpi_get_rsdpv1 (); ++ if (rsdpv1) ++ fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) ++ (grub_addr_t) rsdpv1->rsdt_addr, ++ GRUB_ACPI_FADT_SIGNATURE); ++ if (fadt) ++ return fadt; ++ rsdpv2 = grub_machine_acpi_get_rsdpv2 (); ++ if (rsdpv2) ++ fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) ++ (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, ++ GRUB_ACPI_FADT_SIGNATURE); ++ if (fadt) ++ return fadt; ++ if (rsdpv2 ++#if GRUB_CPU_SIZEOF_VOID_P != 8 ++ && !(rsdpv2->xsdt_addr >> 32) ++#endif ++ ) ++ fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) ++ (grub_addr_t) rsdpv2->xsdt_addr, ++ GRUB_ACPI_FADT_SIGNATURE); ++ if (fadt) ++ return fadt; ++ return 0; ++} ++ ++int ++grub_tsc_calibrate_from_pmtimer (void) ++{ ++ grub_uint32_t start; ++ grub_uint32_t last; ++ grub_uint32_t cur, end; ++ struct grub_acpi_fadt *fadt; ++ grub_port_t p; ++ grub_uint64_t start_tsc; ++ grub_uint64_t end_tsc; ++ int num_iter = 0; ++ ++ fadt = grub_acpi_find_fadt (); ++ if (!fadt) ++ return 0; ++ p = fadt->pmtimer; ++ if (!p) ++ return 0; ++ ++ start = grub_inl (p) & 0xffffff; ++ last = start; ++ /* It's 3.579545 MHz clock. Wait 1 ms. */ ++ end = start + 3580; ++ start_tsc = grub_get_tsc (); ++ while (1) ++ { ++ cur = grub_inl (p) & 0xffffff; ++ if (cur < last) ++ cur |= 0x1000000; ++ num_iter++; ++ if (cur >= end) ++ { ++ end_tsc = grub_get_tsc (); ++ grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); ++ return 1; ++ } ++ /* Check for broken PM timer. ++ 50000000 TSCs is between 5 ms (10GHz) and 200 ms (250 MHz) ++ if after this time we still don't have 1 ms on pmtimer, then ++ pmtimer is broken. ++ */ ++ if ((num_iter & 0xffffff) == 0 && grub_get_tsc () - start_tsc > 5000000) { ++ return 0; ++ } ++ } ++} +Index: b/grub-core/kern/i386/xen/tsc.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/i386/xen/tsc.c +@@ -0,0 +1,40 @@ ++/* kern/i386/tsc.c - x86 TSC time source implementation ++ * Requires Pentium or better x86 CPU that supports the RDTSC instruction. ++ * This module uses the PIT to calibrate the TSC to ++ * real time. ++ * ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++int ++grub_tsc_calibrate_from_xen (void) ++{ ++ grub_uint64_t t; ++ t = grub_xen_shared_info->vcpu_info[0].time.tsc_to_system_mul; ++ if (grub_xen_shared_info->vcpu_info[0].time.tsc_shift > 0) ++ t <<= grub_xen_shared_info->vcpu_info[0].time.tsc_shift; ++ else ++ t >>= -grub_xen_shared_info->vcpu_info[0].time.tsc_shift; ++ grub_tsc_rate = grub_divmod64 (t, 1000000, 0); ++ return 1; ++} +Index: b/include/grub/acpi.h +=================================================================== +--- a/include/grub/acpi.h ++++ b/include/grub/acpi.h +@@ -67,10 +67,14 @@ struct grub_acpi_fadt + grub_uint32_t dsdt_addr; + grub_uint8_t somefields1[20]; + grub_uint32_t pm1a; +- grub_uint8_t somefields2[64]; ++ grub_uint8_t somefields2[8]; ++ grub_uint32_t pmtimer; ++ grub_uint8_t somefields3[32]; ++ grub_uint32_t flags; ++ grub_uint8_t somefields4[16]; + grub_uint64_t facs_xaddr; + grub_uint64_t dsdt_xaddr; +- grub_uint8_t somefields3[96]; ++ grub_uint8_t somefields5[96]; + } GRUB_PACKED; + + #define GRUB_ACPI_MADT_SIGNATURE "APIC" +@@ -176,9 +180,9 @@ enum + #ifndef GRUB_DSDT_TEST + struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void); + struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void); +-struct grub_acpi_rsdp_v10 *grub_machine_acpi_get_rsdpv1 (void); +-struct grub_acpi_rsdp_v20 *grub_machine_acpi_get_rsdpv2 (void); +-grub_uint8_t grub_byte_checksum (void *base, grub_size_t size); ++struct grub_acpi_rsdp_v10 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv1) (void); ++struct grub_acpi_rsdp_v20 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv2) (void); ++grub_uint8_t EXPORT_FUNC(grub_byte_checksum) (void *base, grub_size_t size); + + grub_err_t grub_acpi_create_ebda (void); + +@@ -235,4 +239,7 @@ enum + GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP = 0x87, + }; + ++struct grub_acpi_fadt * ++grub_acpi_find_fadt (void); ++ + #endif /* ! GRUB_ACPI_HEADER */ +Index: b/include/grub/i386/tsc.h +=================================================================== +--- a/include/grub/i386/tsc.h ++++ b/include/grub/i386/tsc.h +@@ -20,9 +20,35 @@ + #define KERNEL_CPU_TSC_HEADER 1 + + #include ++#include + + void grub_tsc_init (void); + /* In ms per 2^32 ticks. */ + extern grub_uint32_t EXPORT_VAR(grub_tsc_rate); ++int ++grub_tsc_calibrate_from_xen (void); ++int ++grub_tsc_calibrate_from_efi (void); ++int ++grub_tsc_calibrate_from_pmtimer (void); ++int ++grub_tsc_calibrate_from_pit (void); ++ ++/* Read the TSC value, which increments with each CPU clock cycle. */ ++static __inline grub_uint64_t ++grub_get_tsc (void) ++{ ++ grub_uint32_t lo, hi; ++ grub_uint32_t a,b,c,d; ++ ++ /* The CPUID instruction is a 'serializing' instruction, and ++ avoids out-of-order execution of the RDTSC instruction. */ ++ grub_cpuid (0,a,b,c,d); ++ /* Read TSC value. We cannot use "=A", since this would use ++ %rax on x86_64. */ ++ __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi)); ++ ++ return (((grub_uint64_t) hi) << 32) | lo; ++} + + #endif /* ! KERNEL_CPU_TSC_HEADER */ +Index: b/grub-core/kern/i386/tsc.c +=================================================================== +--- a/grub-core/kern/i386/tsc.c ++++ b/grub-core/kern/i386/tsc.c +@@ -1,7 +1,6 @@ + /* kern/i386/tsc.c - x86 TSC time source implementation + * Requires Pentium or better x86 CPU that supports the RDTSC instruction. +- * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to +- * real time. ++ * This module calibrates the TSC to real time. + * + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. +@@ -25,12 +24,6 @@ + #include + #include + #include +-#ifdef GRUB_MACHINE_XEN +-#include +-#else +-#include +-#endif +-#include + + /* This defines the value TSC had at the epoch (that is, when we calibrated it). */ + static grub_uint64_t tsc_boot_time; +@@ -40,26 +33,20 @@ static grub_uint64_t tsc_boot_time; + in 32-bit. */ + grub_uint32_t grub_tsc_rate; + +-/* Read the TSC value, which increments with each CPU clock cycle. */ +-static __inline grub_uint64_t +-grub_get_tsc (void) ++static grub_uint64_t ++grub_tsc_get_time_ms (void) + { +- grub_uint32_t lo, hi; +- grub_uint32_t a,b,c,d; +- +- /* The CPUID instruction is a 'serializing' instruction, and +- avoids out-of-order execution of the RDTSC instruction. */ +- grub_cpuid (0,a,b,c,d); +- /* Read TSC value. We cannot use "=A", since this would use +- %rax on x86_64. */ +- __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi)); +- +- return (((grub_uint64_t) hi) << 32) | lo; ++ grub_uint64_t a = grub_get_tsc () - tsc_boot_time; ++ grub_uint64_t ah = a >> 32; ++ grub_uint64_t al = a & 0xffffffff; ++ ++ return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; + } + + static __inline int + grub_cpu_is_tsc_supported (void) + { ++#ifndef GRUB_MACHINE_XEN + grub_uint32_t a,b,c,d; + if (! grub_cpu_is_cpuid_supported ()) + return 0; +@@ -67,91 +54,41 @@ grub_cpu_is_tsc_supported (void) + grub_cpuid(1,a,b,c,d); + + return (d & (1 << 4)) != 0; +-} +- +-#ifndef GRUB_MACHINE_XEN +- +-static void +-grub_pit_wait (grub_uint16_t tics) +-{ +- /* Disable timer2 gate and speaker. */ +- grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) +- & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), +- GRUB_PIT_SPEAKER_PORT); +- +- /* Set tics. */ +- grub_outb (GRUB_PIT_CTRL_SELECT_2 | GRUB_PIT_CTRL_READLOAD_WORD, +- GRUB_PIT_CTRL); +- grub_outb (tics & 0xff, GRUB_PIT_COUNTER_2); +- grub_outb (tics >> 8, GRUB_PIT_COUNTER_2); +- +- /* Enable timer2 gate, keep speaker disabled. */ +- grub_outb ((grub_inb (GRUB_PIT_SPEAKER_PORT) & ~ GRUB_PIT_SPK_DATA) +- | GRUB_PIT_SPK_TMR2, +- GRUB_PIT_SPEAKER_PORT); +- +- /* Wait. */ +- while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00); +- +- /* Disable timer2 gate and speaker. */ +- grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) +- & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), +- GRUB_PIT_SPEAKER_PORT); +-} ++#else ++ return 1; + #endif +- +-static grub_uint64_t +-grub_tsc_get_time_ms (void) +-{ +- grub_uint64_t a = grub_get_tsc () - tsc_boot_time; +- grub_uint64_t ah = a >> 32; +- grub_uint64_t al = a & 0xffffffff; +- +- return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; + } + +-#ifndef GRUB_MACHINE_XEN +-/* Calibrate the TSC based on the RTC. */ +-static void +-calibrate_tsc (void) ++static int ++calibrate_tsc_hardcode (void) + { +- /* First calibrate the TSC rate (relative, not absolute time). */ +- grub_uint64_t end_tsc; +- +- tsc_boot_time = grub_get_tsc (); +- grub_pit_wait (0xffff); +- end_tsc = grub_get_tsc (); +- +- grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); ++ grub_tsc_rate = 5368;/* 800 MHz */ ++ return 1; + } +-#endif + + void + grub_tsc_init (void) + { +-#ifdef GRUB_MACHINE_XEN +- grub_uint64_t t; +- tsc_boot_time = grub_get_tsc (); +- t = grub_xen_shared_info->vcpu_info[0].time.tsc_to_system_mul; +- if (grub_xen_shared_info->vcpu_info[0].time.tsc_shift > 0) +- t <<= grub_xen_shared_info->vcpu_info[0].time.tsc_shift; +- else +- t >>= -grub_xen_shared_info->vcpu_info[0].time.tsc_shift; +- grub_tsc_rate = grub_divmod64 (t, 1000000, 0); +- grub_install_get_time_ms (grub_tsc_get_time_ms); +-#else +- if (grub_cpu_is_tsc_supported ()) +- { +- calibrate_tsc (); +- grub_install_get_time_ms (grub_tsc_get_time_ms); +- } +- else ++ if (!grub_cpu_is_tsc_supported ()) + { + #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_IEEE1275) + grub_install_get_time_ms (grub_rtc_get_time_ms); + #else + grub_fatal ("no TSC found"); + #endif ++ return; + } ++ ++ tsc_boot_time = grub_get_tsc (); ++ ++#ifdef GRUB_MACHINE_XEN ++ (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); ++#elif defined (GRUB_MACHINE_EFI) ++ (void) (grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); ++#elif defined (GRUB_MACHINE_COREBOOT) ++ (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); ++#else ++ (void) (grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); + #endif ++ grub_install_get_time_ms (grub_tsc_get_time_ms); + } diff -Nru grub2-2.02~beta2/debian/patches/install_signed.patch grub2-2.02~beta2/debian/patches/install_signed.patch --- grub2-2.02~beta2/debian/patches/install_signed.patch 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/install_signed.patch 2018-02-26 20:17:23.000000000 +0000 @@ -14,11 +14,11 @@ Patch-Name: install_signed.patch --- - util/grub-install.c | 170 +++++++++++++++++++++++++++++++++++++--------------- - 1 file changed, 123 insertions(+), 47 deletions(-) + util/grub-install.c | 180 ++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 133 insertions(+), 47 deletions(-) -diff --git a/util/grub-install.c b/util/grub-install.c -index 3275209..c15aa8c 100644 +Index: b/util/grub-install.c +=================================================================== --- a/util/grub-install.c +++ b/util/grub-install.c @@ -80,6 +80,7 @@ static char *label_color; @@ -40,7 +40,7 @@ }; static int fs_probe = 1; -@@ -235,6 +238,14 @@ argp_parser (int key, char *arg, struct argp_state *state) +@@ -235,6 +238,14 @@ argp_parser (int key, char *arg, struct bootloader_id = xstrdup (arg); return 0; @@ -215,20 +215,25 @@ { char *uuid = NULL; /* generic method (used on coreboot and ata mod). */ -@@ -1857,7 +1891,49 @@ main (int argc, char *argv[]) +@@ -1857,7 +1891,59 @@ 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) + { -+ const char *shim_signed = "/usr/lib/shim/shim.efi.signed"; ++ char *shim_signed = NULL; ++ char *mok_file = NULL; + char *config_dst; + FILE *config_dst_f; + ++ shim_signed = xasprintf ("/usr/lib/shim/shim%s.efi.signed", efi_suffix); ++ mok_file = xasprintf ("mm%s.efi", efi_suffix); ++ + if (grub_util_is_regular (shim_signed)) + { -+ char *chained_base, *chained_dst, *mok_signed; ++ char *chained_base, *chained_dst; ++ char *mok_src, *mok_dst; + if (!removable) + { + free (efi_file); @@ -240,16 +245,21 @@ + 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); -+ /* Not critical, so not an error if it's not present (as it -+ won't be for older releases); but if we have it, make -+ sure it's installed. */ -+ mok_signed = grub_util_path_concat (2, efidir, -+ "MokManager.efi"); -+ grub_install_copy_file ("/usr/lib/shim/MokManager.efi.signed", -+ mok_signed, 0); -+ free (mok_signed); + 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_file); ++ 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); ++ + } + else + grub_install_copy_file (efi_signed, dst, 1); diff -Nru grub2-2.02~beta2/debian/patches/ip6_fix_routing_eb9f401f.patch grub2-2.02~beta2/debian/patches/ip6_fix_routing_eb9f401f.patch --- grub2-2.02~beta2/debian/patches/ip6_fix_routing_eb9f401f.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/ip6_fix_routing_eb9f401f.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,314 @@ +From eb9f401fc1e919fa29602d4d7b9b4378338e16e9 Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Wed, 10 Feb 2016 21:21:00 +0000 +Subject: net: fix ipv6 routing + +ipv6 routing in grub2 is broken, we cannot talk to anything outside our local +network or anything that doesn't route in our global namespace. This patch +fixes this by doing a couple of things + +1) Read the router information off of the router advertisement. If we have a +router lifetime we need to take the source address and create a route from it. + +2) Changes the routing stuff slightly to allow you to specify a gateway _and_ an +interface. Since the router advertisements come in on the link local address we +need to associate it with the global address on the card. So when we are +processing the router advertisement, either use the SLAAC interface we create +and add the route to that interface, or loop through the global addresses we +currently have on our interface and associate it with one of those addresses. +We need to have a special case here for the default route so that it gets used, +we do this by setting the masksize to 0 to mean it encompasses all networks. +The routing code will automatically select the best route so if there is a +closer match we will use that. + +With this patch I can now talk to ipv6 addresses outside of my local network. +Thanks, + + +Modified to drop changes for ieee1275; which can't be applied due to missing +ieee1275 network code. ~cyphermox + + +Signed-off-by: Josef Bacik +--- +--- + grub-core/net/bootp.c | 4 +-- + grub-core/net/icmp6.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++- + grub-core/net/net.c | 40 +++++++++++-------------------- + include/grub/net.h | 25 +++++++++++++++++++ + 4 files changed, 102 insertions(+), 30 deletions(-) + +Index: b/grub-core/net/bootp.c +=================================================================== +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -117,7 +117,7 @@ parse_dhcp_vendor (const char *name, con + grub_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4)); + rname = grub_xasprintf ("%s:default", name); + if (rname) +- grub_net_add_route_gw (rname, target, gw); ++ grub_net_add_route_gw (rname, target, gw, NULL); + grub_free (rname); + } + break; +@@ -201,7 +201,7 @@ grub_net_configure_by_dhcp_ack (const ch + gw.ipv4 = bp->gateway_ip; + rname = grub_xasprintf ("%s:gw", name); + if (rname) +- grub_net_add_route_gw (rname, target, gw); ++ grub_net_add_route_gw (rname, target, gw, inter); + grub_free (rname); + + target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +Index: b/grub-core/net/icmp6.c +=================================================================== +--- a/grub-core/net/icmp6.c ++++ b/grub-core/net/icmp6.c +@@ -115,6 +115,7 @@ grub_net_recv_icmp6_packet (struct grub_ + grub_uint8_t ttl) + { + struct icmp_header *icmph; ++ struct grub_net_network_level_interface *orig_inf = inf; + grub_err_t err; + grub_uint16_t checksum; + +@@ -345,14 +346,31 @@ grub_net_recv_icmp6_packet (struct grub_ + { + grub_uint8_t *ptr; + struct option_header *ohdr; ++ struct router_adv *radv; ++ struct grub_net_network_level_interface *route_inf = NULL; ++ int default_route = 0; + if (icmph->code) + break; ++ radv = (struct router_adv *)nb->data; + err = grub_netbuff_pull (nb, sizeof (struct router_adv)); + if (err) + { + grub_netbuff_free (nb); + return err; + } ++ if (grub_be_to_cpu16 (radv->router_lifetime) > 0) ++ { ++ struct grub_net_route *route; ++ ++ FOR_NET_ROUTES (route) ++ { ++ if (!grub_memcmp (&route->gw, source, sizeof (route->gw))) ++ break; ++ } ++ if (route == NULL) ++ default_route = 1; ++ } ++ + for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; + ptr += ohdr->len * 8) + { +@@ -413,7 +431,11 @@ grub_net_recv_icmp6_packet (struct grub_ + /* Update lease time if needed here once we have + lease times. */ + if (inf) +- continue; ++ { ++ if (!route_inf) ++ route_inf = inf; ++ continue; ++ } + + grub_dprintf ("net", "creating slaac\n"); + +@@ -429,12 +451,51 @@ grub_net_recv_icmp6_packet (struct grub_ + inf = grub_net_add_addr (name, + card, &addr, + &slaac->address, 0); ++ if (!route_inf) ++ route_inf = inf; + grub_net_add_route (name, netaddr, inf); + grub_free (name); + } + } + } + } ++ if (default_route) ++ { ++ char *name; ++ grub_net_network_level_netaddress_t netaddr; ++ name = grub_xasprintf ("%s:ra:default6", card->name); ++ if (!name) ++ { ++ grub_errno = GRUB_ERR_NONE; ++ goto next; ++ } ++ /* Default routes take alll of the traffic, so make the mask huge */ ++ netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ netaddr.ipv6.masksize = 0; ++ netaddr.ipv6.base[0] = 0; ++ netaddr.ipv6.base[1] = 0; ++ ++ /* May not have gotten slaac info, find a global address on this ++ card. */ ++ if (route_inf == NULL) ++ { ++ FOR_NET_NETWORK_LEVEL_INTERFACES (inf) ++ { ++ if (inf->card == card && inf != orig_inf ++ && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 ++ && grub_net_hwaddr_cmp(&inf->hwaddress, ++ &orig_inf->hwaddress) == 0) ++ { ++ route_inf = inf; ++ break; ++ } ++ } ++ } ++ if (route_inf != NULL) ++ grub_net_add_route_gw (name, netaddr, *source, route_inf); ++ grub_free (name); ++ } ++next: + if (ptr != nb->tail) + break; + } +Index: b/grub-core/net/net.c +=================================================================== +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -37,21 +37,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); + + char *grub_net_default_server; + +-struct grub_net_route +-{ +- struct grub_net_route *next; +- struct grub_net_route **prev; +- grub_net_network_level_netaddress_t target; +- char *name; +- struct grub_net_network_level_protocol *prot; +- int is_gateway; +- union +- { +- struct grub_net_network_level_interface *interface; +- grub_net_network_level_address_t gw; +- }; +-}; +- + struct grub_net_route *grub_net_routes = NULL; + struct grub_net_network_level_interface *grub_net_network_level_interfaces = NULL; + struct grub_net_card *grub_net_cards = NULL; +@@ -410,14 +395,6 @@ grub_cmd_ipv6_autoconf (struct grub_comm + return err; + } + +-static inline void +-grub_net_route_register (struct grub_net_route *route) +-{ +- grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), +- GRUB_AS_LIST (route)); +-} +- +-#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) + + static int + parse_ip (const char *val, grub_uint32_t *ip, const char **rest) +@@ -524,6 +501,8 @@ match_net (const grub_net_network_level_ + case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + { + grub_uint64_t mask[2]; ++ if (net->ipv6.masksize == 0) ++ return 1; + if (net->ipv6.masksize <= 64) + { + mask[0] = 0xffffffffffffffffULL << (64 - net->ipv6.masksize); +@@ -687,7 +666,14 @@ grub_net_route_address (grub_net_network + return GRUB_ERR_NONE; + } + if (depth == 0) +- *gateway = bestroute->gw; ++ { ++ *gateway = bestroute->gw; ++ if (bestroute->interface != NULL) ++ { ++ *interf = bestroute->interface; ++ return GRUB_ERR_NONE; ++ } ++ } + curtarget = bestroute->gw; + } + +@@ -1109,7 +1095,8 @@ grub_net_add_route (const char *name, + grub_err_t + grub_net_add_route_gw (const char *name, + grub_net_network_level_netaddress_t target, +- grub_net_network_level_address_t gw) ++ grub_net_network_level_address_t gw, ++ struct grub_net_network_level_interface *inter) + { + struct grub_net_route *route; + +@@ -1127,6 +1114,7 @@ grub_net_add_route_gw (const char *name, + route->target = target; + route->is_gateway = 1; + route->gw = gw; ++ route->interface = inter; + + grub_net_route_register (route); + +@@ -1152,7 +1140,7 @@ grub_cmd_addroute (struct grub_command * + err = grub_net_resolve_address (args[3], &gw); + if (err) + return err; +- return grub_net_add_route_gw (args[0], target, gw); ++ return grub_net_add_route_gw (args[0], target, gw, NULL); + } + else + { +Index: b/include/grub/net.h +=================================================================== +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -191,6 +191,18 @@ typedef struct grub_net_network_level_ne + }; + } grub_net_network_level_netaddress_t; + ++struct grub_net_route ++{ ++ struct grub_net_route *next; ++ struct grub_net_route **prev; ++ grub_net_network_level_netaddress_t target; ++ char *name; ++ struct grub_net_network_level_protocol *prot; ++ int is_gateway; ++ struct grub_net_network_level_interface *interface; ++ grub_net_network_level_address_t gw; ++}; ++ + #define FOR_PACKETS(cont,var) for (var = (cont).first; var; var = var->next) + + static inline grub_err_t +@@ -367,6 +379,16 @@ grub_net_card_unregister (struct grub_ne + #define FOR_NET_CARDS_SAFE(var, next) for (var = grub_net_cards, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) + + ++extern struct grub_net_route *grub_net_routes; ++ ++static inline void ++grub_net_route_register (struct grub_net_route *route) ++{ ++ grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), ++ GRUB_AS_LIST (route)); ++} ++ ++#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) + struct grub_net_session * + grub_net_open_tcp (char *address, grub_uint16_t port); + +@@ -392,7 +414,8 @@ grub_net_add_route (const char *name, + grub_err_t + grub_net_add_route_gw (const char *name, + grub_net_network_level_netaddress_t target, +- grub_net_network_level_address_t gw); ++ grub_net_network_level_address_t gw, ++ struct grub_net_network_level_interface *inter); + + + #define GRUB_NET_BOOTP_MAC_ADDR_LEN 16 diff -Nru grub2-2.02~beta2/debian/patches/ip6_send_router_solicitation_7c4b6b7b.patch grub2-2.02~beta2/debian/patches/ip6_send_router_solicitation_7c4b6b7b.patch --- grub2-2.02~beta2/debian/patches/ip6_send_router_solicitation_7c4b6b7b.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/ip6_send_router_solicitation_7c4b6b7b.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,157 @@ +From 7c4b6b7bb476963ca7e86f79d32036e7f80d27f6 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 18 Nov 2014 08:03:08 +0000 +Subject: send router solicitation for ipv6 address autoconf v2 + +Many routers have long router advertisment interval configured by +default. The Neighbor Discovery protocol (RFC4861) has defined default +MaxRtrAdvInterval value as 600 seconds and +MinRtrAdvInterval as 0.33*MaxRtrAdvInterval. This makes +net_ipv6_autoconf fails more often than not as currently it passively +listens the RA message to perfom address autoconfiguration. + +This patch tries to send router solicitation to overcome the problem of +long RA interval. + +v2: +use cpu_to_be macro for network byte order conversion +add missing error handling +--- +diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c +index 796d549..7822394 100644 +--- a/grub-core/net/icmp6.c ++++ b/grub-core/net/icmp6.c +@@ -72,6 +72,11 @@ struct neighbour_advertise + grub_uint64_t target[2]; + } GRUB_PACKED; + ++struct router_solicit ++{ ++ grub_uint32_t reserved; ++} GRUB_PACKED; ++ + enum + { + FLAG_SLAAC = 0x40 +@@ -81,6 +86,7 @@ enum + { + ICMP6_ECHO = 128, + ICMP6_ECHO_REPLY = 129, ++ ICMP6_ROUTER_SOLICIT = 133, + ICMP6_ROUTER_ADVERTISE = 134, + ICMP6_NEIGHBOUR_SOLICIT = 135, + ICMP6_NEIGHBOUR_ADVERTISE = 136, +@@ -533,3 +539,80 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, + grub_netbuff_free (nb); + return err; + } ++ ++grub_err_t ++grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf) ++{ ++ struct grub_net_buff *nb; ++ grub_err_t err = GRUB_ERR_NONE; ++ grub_net_network_level_address_t multicast; ++ grub_net_link_level_address_t ll_multicast; ++ struct option_header *ohdr; ++ struct router_solicit *sol; ++ struct icmp_header *icmphr; ++ ++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ multicast.ipv6[0] = grub_cpu_to_be64 (0xff02ULL << 48); ++ multicast.ipv6[1] = grub_cpu_to_be64 (0x02ULL); ++ ++ err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); ++ if (err) ++ return err; ++ ++ nb = grub_netbuff_alloc (sizeof (struct router_solicit) ++ + sizeof (struct option_header) ++ + 6 ++ + sizeof (struct icmp_header) ++ + GRUB_NET_OUR_IPV6_HEADER_SIZE ++ + GRUB_NET_MAX_LINK_HEADER_SIZE); ++ if (!nb) ++ return grub_errno; ++ err = grub_netbuff_reserve (nb, ++ sizeof (struct router_solicit) ++ + sizeof (struct option_header) ++ + 6 ++ + sizeof (struct icmp_header) ++ + GRUB_NET_OUR_IPV6_HEADER_SIZE ++ + GRUB_NET_MAX_LINK_HEADER_SIZE); ++ if (err) ++ goto fail; ++ ++ err = grub_netbuff_push (nb, 6); ++ if (err) ++ goto fail; ++ ++ grub_memcpy (nb->data, inf->hwaddress.mac, 6); ++ ++ err = grub_netbuff_push (nb, sizeof (*ohdr)); ++ if (err) ++ goto fail; ++ ++ ohdr = (struct option_header *) nb->data; ++ ohdr->type = OPTION_SOURCE_LINK_LAYER_ADDRESS; ++ ohdr->len = 1; ++ ++ err = grub_netbuff_push (nb, sizeof (*sol)); ++ if (err) ++ goto fail; ++ ++ sol = (struct router_solicit *) nb->data; ++ sol->reserved = 0; ++ ++ err = grub_netbuff_push (nb, sizeof (*icmphr)); ++ if (err) ++ goto fail; ++ ++ icmphr = (struct icmp_header *) nb->data; ++ icmphr->type = ICMP6_ROUTER_SOLICIT; ++ icmphr->code = 0; ++ icmphr->checksum = 0; ++ icmphr->checksum = grub_net_ip_transport_checksum (nb, ++ GRUB_NET_IP_ICMPV6, ++ &inf->address, ++ &multicast); ++ err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, ++ GRUB_NET_IP_ICMPV6); ++ fail: ++ grub_netbuff_free (nb); ++ return err; ++} +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 82af3a0..21a4e94 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -380,12 +380,14 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), + + for (interval = 200; interval < 10000; interval *= 2) + { +- /* FIXME: send router solicitation. */ + int done = 1; + for (j = 0; j < ncards; j++) + { + if (slaacs[j]->slaac_counter) + continue; ++ err = grub_net_icmp6_send_router_solicit (ifaces[j]); ++ if (err) ++ err = GRUB_ERR_NONE; + done = 0; + } + if (done) +diff --git a/include/grub/net/ip.h b/include/grub/net/ip.h +index 7a8e614..dcceaa5 100644 +--- a/include/grub/net/ip.h ++++ b/include/grub/net/ip.h +@@ -92,4 +92,6 @@ grub_err_t + grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, + const grub_net_network_level_address_t *proto_addr); + ++grub_err_t ++grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf); + #endif +-- +cgit v0.9.0.2 diff -Nru grub2-2.02~beta2/debian/patches/linuxefi.patch grub2-2.02~beta2/debian/patches/linuxefi.patch --- grub2-2.02~beta2/debian/patches/linuxefi.patch 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi.patch 2018-02-26 20:17:23.000000000 +0000 @@ -1,27 +1,27 @@ -From 275e1976bb46405ac6fc7e1da7d769dfebba9576 Mon Sep 17 00:00:00 2001 +From 5cd20151112bfde11cf3ed8b9920797d7cabe325 Mon Sep 17 00:00:00 2001 From: Matthew Garrett 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: 2014-11-18 +Last-Update: 2016-09-19 Patch-Name: linuxefi.patch --- - grub-core/Makefile.core.def | 8 + - grub-core/kern/efi/mm.c | 32 ++++ - grub-core/loader/i386/efi/linux.c | 371 ++++++++++++++++++++++++++++++++++++++ - include/grub/efi/efi.h | 3 + - include/grub/i386/linux.h | 1 + - 5 files changed, 415 insertions(+) + grub-core/Makefile.core.def | 8 + grub-core/kern/efi/mm.c | 32 +++ + grub-core/loader/i386/efi/linux.c | 370 ++++++++++++++++++++++++++++++++++++++ + include/grub/efi/efi.h | 3 + include/grub/i386/linux.h | 1 + 5 files changed, 414 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 c916246..8c246c6 100644 +Index: b/grub-core/Makefile.core.def +=================================================================== --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1706,6 +1706,14 @@ module = { +@@ -1731,6 +1731,14 @@ module = { }; module = { @@ -36,11 +36,11 @@ name = chain; efi = loader/efi/chainloader.c; i386_pc = loader/i386/pc/chainloader.c; -diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index be37afd..ddeca60 100644 +Index: b/grub-core/kern/efi/mm.c +=================================================================== --- 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; +@@ -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; @@ -79,12 +79,11 @@ /* Allocate pages. Return the pointer to the first of allocated pages. */ void * grub_efi_allocate_pages (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 0000000..ebaf1db +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== --- /dev/null +++ b/grub-core/loader/i386/efi/linux.c -@@ -0,0 +1,371 @@ +@@ -0,0 +1,370 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2012 Free Software Foundation, Inc. @@ -307,7 +306,6 @@ + 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; + } + @@ -323,7 +321,7 @@ + goto fail; + } + -+ memset (params, 0, 16384); ++ grub_memset (params, 0, 16384); + + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + { @@ -411,7 +409,7 @@ + lh.code32_start = (grub_uint32_t)(grub_addr_t) kernel_mem; + } + -+ memcpy(params, &lh, 2 * 512); ++ grub_memcpy (params, &lh, 2 * 512); + + params->type_of_loader = 0x21; + @@ -456,11 +454,11 @@ + 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 db2169e..a000c38 100644 +Index: b/include/grub/efi/efi.h +=================================================================== --- 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); +@@ -40,6 +40,9 @@ void EXPORT_FUNC(grub_efi_stall) (grub_e void * EXPORT_FUNC(grub_efi_allocate_pages) (grub_efi_physical_address_t address, grub_efi_uintn_t pages); @@ -470,8 +468,8 @@ 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 da0ca3b..fc36bda 100644 +Index: b/include/grub/i386/linux.h +=================================================================== --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -139,6 +139,7 @@ struct linux_kernel_header diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_arm_sb_support.patch grub2-2.02~beta2/debian/patches/linuxefi_arm_sb_support.patch --- grub2-2.02~beta2/debian/patches/linuxefi_arm_sb_support.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_arm_sb_support.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,438 @@ +From 69cfd0fbd4838c43f0cc34324372bbc23b68b418 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 18 Sep 2014 11:26:14 -0400 +Subject: [PATCH] Load arm with SB enabled. + +Make sure we actually try to validate secure boot on this platform (even +though we're not shipping it enabled by default.) + +This means giving the kernel grub's loaded image as the vehicle for the +kernel command line, because we can't call systab->bs->LoadImage() if SB +is enabled. +--- + grub-core/Makefile.core.def | 3 + grub-core/loader/arm/linux.c | 1 + grub-core/loader/arm64/linux.c | 117 ++++++++++++++++++++------------------ + grub-core/loader/efi/linux.c | 66 +++++++++++++++++++++ + grub-core/loader/i386/efi/linux.c | 39 ------------ + include/grub/arm64/linux.h | 8 ++ + include/grub/efi/linux.h | 31 ++++++++++ + 7 files changed, 175 insertions(+), 90 deletions(-) + create mode 100644 grub-core/loader/efi/linux.c + create mode 100644 include/grub/efi/linux.h + +Index: b/grub-core/Makefile.core.def +=================================================================== +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1673,6 +1673,8 @@ module = { + ia64_efi = loader/ia64/efi/linux.c; + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; ++ arm64 = loader/efi/linux.c; ++ fdt = lib/fdt.c; + common = loader/linux.c; + common = lib/cmdline.c; + enable = noemu; +@@ -1715,6 +1717,7 @@ module = { + name = linuxefi; + efi = loader/i386/efi/linux.c; + efi = lib/cmdline.c; ++ efi = loader/efi/linux.c; + enable = i386_efi; + enable = x86_64_efi; + }; +Index: b/grub-core/loader/arm64/linux.c +=================================================================== +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -39,6 +40,7 @@ static int loaded; + + static void *kernel_addr; + static grub_uint64_t kernel_size; ++static grub_uint32_t handover_offset; + + static char *linux_args; + static grub_uint32_t cmdline_size; +@@ -67,7 +69,8 @@ grub_arm64_uefi_check_image (struct grub + static grub_err_t + finalize_params_linux (void) + { +- int node, retval; ++ grub_efi_loaded_image_t *loaded_image = NULL; ++ int node, retval, len; + + void *fdt; + +@@ -102,6 +105,26 @@ finalize_params_linux (void) + if (grub_fdt_install() != GRUB_ERR_NONE) + goto failure; + ++ grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", ++ fdt); ++ ++ /* Convert command line to UCS-2 */ ++ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (!loaded_image) ++ goto failure; ++ ++ loaded_image->load_options_size = len = ++ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); ++ loaded_image->load_options = ++ grub_efi_allocate_pages (0, ++ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); ++ if (!loaded_image->load_options) ++ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters"); ++ ++ loaded_image->load_options_size = ++ 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, ++ (grub_uint8_t *) linux_args, len, NULL); ++ + return GRUB_ERR_NONE; + + failure: +@@ -109,73 +132,49 @@ failure: + return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); + } + ++static void ++free_params (void) ++{ ++ grub_efi_loaded_image_t *loaded_image = NULL; ++ ++ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (loaded_image) ++ { ++ if (loaded_image->load_options) ++ grub_efi_free_pages ((grub_efi_physical_address_t) ++ loaded_image->load_options, ++ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); ++ loaded_image->load_options = NULL; ++ loaded_image->load_options_size = 0; ++ } ++} ++ + grub_err_t + grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) + { +- grub_efi_memory_mapped_device_path_t *mempath; +- grub_efi_handle_t image_handle; +- grub_efi_boot_services_t *b; +- grub_efi_status_t status; +- grub_efi_loaded_image_t *loaded_image; +- int len; ++ grub_err_t retval; + +- mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); +- if (!mempath) ++ retval = finalize_params_linux (); ++ if (retval != GRUB_ERR_NONE) + return grub_errno; + +- mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE; +- mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; +- mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); +- mempath[0].memory_type = GRUB_EFI_LOADER_DATA; +- mempath[0].start_address = addr; +- mempath[0].end_address = addr + size; +- +- mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; +- mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; +- mempath[1].header.length = sizeof (grub_efi_device_path_t); +- +- b = grub_efi_system_table->boot_services; +- status = b->load_image (0, grub_efi_image_handle, +- (grub_efi_device_path_t *) mempath, +- (void *) addr, size, &image_handle); +- if (status != GRUB_EFI_SUCCESS) +- return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); +- + grub_dprintf ("linux", "linux command line: '%s'\n", args); ++ grub_dprintf ("linux", "using kernel addr %p (was 0x%08lx); offset 0x%08x (size %zd)", ++ kernel_addr, addr, handover_offset, size); + +- /* Convert command line to UCS-2 */ +- loaded_image = grub_efi_get_loaded_image (image_handle); +- loaded_image->load_options_size = len = +- (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); +- loaded_image->load_options = +- grub_efi_allocate_pages (0, +- GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); +- if (!loaded_image->load_options) +- return grub_errno; +- +- loaded_image->load_options_size = +- 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, +- (grub_uint8_t *) args, len, NULL); ++ retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, ++ kernel_addr); + +- grub_dprintf ("linux", "starting image %p\n", image_handle); +- status = b->start_image (image_handle, 0, NULL); +- +- /* When successful, not reached */ +- b->unload_image (image_handle); +- grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, +- GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); +- +- return grub_errno; ++ /* Never reached... */ ++ free_params(); ++ return retval; + } + + static grub_err_t + grub_linux_boot (void) + { +- if (finalize_params_linux () != GRUB_ERR_NONE) +- return grub_errno; +- +- return (grub_arm64_uefi_boot_image((grub_addr_t)kernel_addr, +- kernel_size, linux_args)); ++ return grub_arm64_uefi_boot_image ((grub_addr_t)kernel_addr, ++ kernel_size, linux_args); + } + + static grub_err_t +@@ -253,6 +252,7 @@ grub_cmd_linux (grub_command_t cmd __att + { + grub_file_t file = 0; + struct grub_arm64_linux_kernel_header lh; ++ struct grub_arm64_linux_pe_header *pe; + + grub_dl_ref (my_mod); + +@@ -297,6 +297,15 @@ grub_cmd_linux (grub_command_t cmd __att + + grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); + ++ if (!grub_linuxefi_secure_validate (kernel_addr, kernel_size)) ++ { ++ grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); ++ goto fail; ++ } ++ ++ pe = (void *)((unsigned long)kernel_addr + lh.hdr_offset); ++ handover_offset = pe->opt.entry_addr; ++ + cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE); + linux_args = grub_malloc (cmdline_size); + if (!linux_args) +Index: b/grub-core/loader/efi/linux.c +=================================================================== +--- /dev/null ++++ b/grub-core/loader/efi/linux.c +@@ -0,0 +1,66 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define SHIM_LOCK_GUID \ ++ { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} } ++ ++struct grub_efi_shim_lock ++{ ++ grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size); ++}; ++typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; ++ ++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; ++ ++ shim_lock = grub_efi_locate_protocol(&guid, NULL); ++ ++ if (!shim_lock) ++ return 1; ++ ++ if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS) ++ return 1; ++ ++ return 0; ++} ++ ++typedef void (*handover_func) (void *, grub_efi_system_table_t *, void *); ++ ++grub_err_t ++grub_efi_linux_boot (void *kernel_addr, grub_off_t offset, ++ void *kernel_params) ++{ ++ handover_func hf; ++ ++ hf = (handover_func)((char *)kernel_addr + offset); ++ hf (grub_efi_image_handle, grub_efi_system_table, kernel_params); ++ ++ return GRUB_ERR_BUG; ++} ++ +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -40,52 +41,18 @@ 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; +- +- shim_lock = grub_efi_locate_protocol(&guid, NULL); +- +- if (!shim_lock) +- return 1; +- +- if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS) +- return 1; +- +- 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; ++ return grub_efi_linux_boot ((char *)kernel_mem, handover_offset + offset, ++ params); + } + + static grub_err_t +Index: b/include/grub/arm64/linux.h +=================================================================== +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -20,6 +20,7 @@ + #define GRUB_LINUX_CPU_HEADER 1 + + #include ++#include + + #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + +@@ -45,4 +46,11 @@ grub_err_t grub_arm64_uefi_check_image ( + grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, + char *args); + ++struct grub_arm64_linux_pe_header ++{ ++ grub_uint32_t magic; ++ struct grub_pe32_coff_header coff; ++ struct grub_pe64_optional_header opt; ++}; ++ + #endif /* ! GRUB_LINUX_CPU_HEADER */ +Index: b/include/grub/efi/linux.h +=================================================================== +--- /dev/null ++++ b/include/grub/efi/linux.h +@@ -0,0 +1,31 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++#ifndef GRUB_EFI_LINUX_HEADER ++#define GRUB_EFI_LINUX_HEADER 1 ++ ++#include ++#include ++#include ++ ++grub_efi_boolean_t ++EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); ++grub_err_t ++EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, ++ void *kernel_param); ++ ++#endif /* ! GRUB_EFI_LINUX_HEADER */ +Index: b/grub-core/loader/arm/linux.c +=================================================================== +--- a/grub-core/loader/arm/linux.c ++++ b/grub-core/loader/arm/linux.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_backport_arm64.patch grub2-2.02~beta2/debian/patches/linuxefi_backport_arm64.patch --- grub2-2.02~beta2/debian/patches/linuxefi_backport_arm64.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_backport_arm64.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,1189 @@ +--- + grub-core/Makefile.core.def | 8 + grub-core/lib/fdt.c | 3 + grub-core/loader/arm64/fdt.c | 185 ++++++++++++++ + grub-core/loader/arm64/linux.c | 219 +++------------- + grub-core/loader/arm64/xen_boot.c | 499 ++++++++++++++++++++++++++++++++++++++ + include/grub/arm64/fdtload.h | 35 ++ + include/grub/arm64/linux.h | 7 + 7 files changed, 779 insertions(+), 177 deletions(-) + +Index: b/grub-core/loader/arm64/linux.c +=================================================================== +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -33,12 +34,6 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + +-#define GRUB_EFI_PAGE_SHIFT 12 +-#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) +-#define GRUB_EFI_PE_MAGIC 0x5A4D +- +-static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; +- + static grub_dl_t my_mod; + static int loaded; + +@@ -51,76 +46,15 @@ static grub_uint32_t cmdline_size; + static grub_addr_t initrd_start; + static grub_addr_t initrd_end; + +-static void *loaded_fdt; +-static void *fdt; +- +-static void * +-get_firmware_fdt (void) +-{ +- grub_efi_configuration_table_t *tables; +- void *firmware_fdt = NULL; +- unsigned int i; +- +- /* Look for FDT in UEFI config tables. */ +- tables = grub_efi_system_table->configuration_table; +- +- for (i = 0; i < grub_efi_system_table->num_table_entries; i++) +- if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) +- { +- firmware_fdt = tables[i].vendor_table; +- grub_dprintf ("linux", "found registered FDT @ 0x%p\n", firmware_fdt); +- break; +- } +- +- return firmware_fdt; +-} +- +-static void +-get_fdt (void) +-{ +- void *raw_fdt; +- grub_size_t size; +- +- if (fdt) +- { +- size = BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)); +- grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size); +- } +- +- if (loaded_fdt) +- raw_fdt = loaded_fdt; +- else +- raw_fdt = get_firmware_fdt(); +- +- size = +- raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; +- size += 0x400; +- +- grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size); +- fdt = grub_efi_allocate_pages (0, BYTES_TO_PAGES (size)); +- if (!fdt) +- return; +- +- if (raw_fdt) +- { +- grub_memmove (fdt, raw_fdt, size); +- grub_fdt_set_totalsize (fdt, size); +- } +- else +- { +- grub_fdt_create_empty_tree (fdt, size); +- } +-} +- +-static grub_err_t +-check_kernel (struct grub_arm64_linux_kernel_header *lh) ++grub_err_t ++grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) + { + if (lh->magic != GRUB_ARM64_LINUX_MAGIC) + return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); + + if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, +- N_("plain Image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); ++ N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); + + grub_dprintf ("linux", "UEFI stub kernel:\n"); + grub_dprintf ("linux", "text_offset = 0x%012llx\n", +@@ -131,13 +65,14 @@ check_kernel (struct grub_arm64_linux_ke + } + + static grub_err_t +-finalize_params (void) ++finalize_params_linux (void) + { +- grub_efi_boot_services_t *b; +- grub_efi_status_t status; + int node, retval; + +- get_fdt (); ++ void *fdt; ++ ++ fdt = grub_fdt_load (0x400); ++ + if (!fdt) + goto failure; + +@@ -164,97 +99,26 @@ finalize_params (void) + goto failure; + } + +- b = grub_efi_system_table->boot_services; +- status = b->install_configuration_table (&fdt_guid, fdt); +- if (status != GRUB_EFI_SUCCESS) ++ if (grub_fdt_install() != GRUB_ERR_NONE) + goto failure; + +- grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", +- fdt); +- + return GRUB_ERR_NONE; + + failure: +- grub_efi_free_pages ((grub_efi_physical_address_t) fdt, +- BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt))); +- fdt = NULL; ++ grub_fdt_unload(); + return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); + } + +-static grub_err_t +-grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), +- int argc, char *argv[]) +-{ +- grub_file_t dtb; +- void *blob = NULL; +- int size; +- +- if (!loaded) +- { +- grub_error (GRUB_ERR_BAD_ARGUMENT, +- N_("you need to load the kernel first")); +- return GRUB_ERR_BAD_OS; +- } +- +- if (argc != 1) +- return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +- +- if (loaded_fdt) +- grub_free (loaded_fdt); +- loaded_fdt = NULL; +- +- dtb = grub_file_open (argv[0]); +- if (!dtb) +- goto out; +- +- size = grub_file_size (dtb); +- blob = grub_malloc (size); +- if (!blob) +- goto out; +- +- if (grub_file_read (dtb, blob, size) < size) +- { +- if (!grub_errno) +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); +- goto out; +- } +- +- if (grub_fdt_check_header (blob, size) != 0) +- { +- grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree")); +- goto out; +- } +- +-out: +- if (dtb) +- grub_file_close (dtb); +- +- if (blob) +- { +- if (grub_errno == GRUB_ERR_NONE) +- loaded_fdt = blob; +- else +- grub_free (blob); +- } +- +- return grub_errno; +-} +- +-static grub_err_t +-grub_linux_boot (void) ++grub_err_t ++grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) + { + grub_efi_memory_mapped_device_path_t *mempath; + grub_efi_handle_t image_handle; + grub_efi_boot_services_t *b; + grub_efi_status_t status; +- grub_err_t retval; + grub_efi_loaded_image_t *loaded_image; + int len; + +- retval = finalize_params(); +- if (retval != GRUB_ERR_NONE) +- return retval; +- + mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); + if (!mempath) + return grub_errno; +@@ -263,64 +127,71 @@ grub_linux_boot (void) + mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; + mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); + mempath[0].memory_type = GRUB_EFI_LOADER_DATA; +- mempath[0].start_address = (grub_addr_t) kernel_addr; +- mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size; ++ mempath[0].start_address = addr; ++ mempath[0].end_address = addr + size; + + mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; + mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; +- mempath[1].header.length = 0; ++ mempath[1].header.length = sizeof (grub_efi_device_path_t); + + b = grub_efi_system_table->boot_services; + status = b->load_image (0, grub_efi_image_handle, + (grub_efi_device_path_t *) mempath, +- kernel_addr, kernel_size, &image_handle); ++ (void *) addr, size, &image_handle); + if (status != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); + +- grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); ++ grub_dprintf ("linux", "linux command line: '%s'\n", args); + + /* Convert command line to UCS-2 */ + loaded_image = grub_efi_get_loaded_image (image_handle); + loaded_image->load_options_size = len = +- (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); ++ (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); + loaded_image->load_options = + grub_efi_allocate_pages (0, +- BYTES_TO_PAGES (loaded_image->load_options_size)); ++ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); + if (!loaded_image->load_options) + return grub_errno; + + loaded_image->load_options_size = + 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, +- (grub_uint8_t *) linux_args, len, NULL); ++ (grub_uint8_t *) args, len, NULL); + +- grub_dprintf("linux", "starting image %p\n", image_handle); ++ grub_dprintf ("linux", "starting image %p\n", image_handle); + status = b->start_image (image_handle, 0, NULL); + + /* When successful, not reached */ + b->unload_image (image_handle); + grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, +- BYTES_TO_PAGES (loaded_image->load_options_size)); ++ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); + + return grub_errno; + } + + static grub_err_t ++grub_linux_boot (void) ++{ ++ if (finalize_params_linux () != GRUB_ERR_NONE) ++ return grub_errno; ++ ++ return (grub_arm64_uefi_boot_image((grub_addr_t)kernel_addr, ++ kernel_size, linux_args)); ++} ++ ++static grub_err_t + grub_linux_unload (void) + { + grub_dl_unref (my_mod); + loaded = 0; + if (initrd_start) + grub_efi_free_pages ((grub_efi_physical_address_t) initrd_start, +- BYTES_TO_PAGES (initrd_end - initrd_start)); ++ GRUB_EFI_BYTES_TO_PAGES (initrd_end - initrd_start)); + initrd_start = initrd_end = 0; + grub_free (linux_args); + if (kernel_addr) + grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, +- BYTES_TO_PAGES (kernel_size)); +- if (fdt) +- grub_efi_free_pages ((grub_efi_physical_address_t) fdt, +- BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt))); +- ++ GRUB_EFI_BYTES_TO_PAGES (kernel_size)); ++ grub_fdt_unload (); + return GRUB_ERR_NONE; + } + +@@ -328,7 +199,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + int initrd_size, initrd_pages; + void *initrd_mem = NULL; + +@@ -351,7 +222,7 @@ grub_cmd_initrd (grub_command_t cmd __at + initrd_size = grub_get_initrd_size (&initrd_ctx); + grub_dprintf ("linux", "Loading initrd\n"); + +- initrd_pages = (BYTES_TO_PAGES (initrd_size)); ++ initrd_pages = (GRUB_EFI_BYTES_TO_PAGES (initrd_size)); + initrd_mem = grub_efi_allocate_pages (0, initrd_pages); + if (!initrd_mem) + { +@@ -400,15 +271,15 @@ grub_cmd_linux (grub_command_t cmd __att + if (grub_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh)) + return grub_errno; + +- if (check_kernel (&lh) != GRUB_ERR_NONE) ++ if (grub_arm64_uefi_check_image (&lh) != GRUB_ERR_NONE) + goto fail; + + grub_loader_unset(); + + grub_dprintf ("linux", "kernel file size: %lld\n", (long long) kernel_size); +- kernel_addr = grub_efi_allocate_pages (0, BYTES_TO_PAGES (kernel_size)); ++ kernel_addr = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (kernel_size)); + grub_dprintf ("linux", "kernel numpages: %lld\n", +- (long long) BYTES_TO_PAGES (kernel_size)); ++ (long long) GRUB_EFI_BYTES_TO_PAGES (kernel_size)); + if (!kernel_addr) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); +@@ -459,13 +330,13 @@ fail: + + if (kernel_addr && !loaded) + grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, +- BYTES_TO_PAGES (kernel_size)); ++ GRUB_EFI_BYTES_TO_PAGES (kernel_size)); + + return grub_errno; + } + + +-static grub_command_t cmd_linux, cmd_initrd, cmd_devicetree; ++static grub_command_t cmd_linux, cmd_initrd; + + GRUB_MOD_INIT (linux) + { +@@ -473,9 +344,6 @@ GRUB_MOD_INIT (linux) + N_("Load Linux.")); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0, + N_("Load initrd.")); +- cmd_devicetree = +- grub_register_command ("devicetree", grub_cmd_devicetree, 0, +- N_("Load DTB file.")); + my_mod = mod; + } + +@@ -483,5 +351,4 @@ GRUB_MOD_FINI (linux) + { + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); +- grub_unregister_command (cmd_devicetree); + } +Index: b/include/grub/arm64/linux.h +=================================================================== +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -23,6 +23,8 @@ + + #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + ++#define GRUB_EFI_PE_MAGIC 0x5A4D ++ + /* From linux/Documentation/arm64/booting.txt */ + struct grub_arm64_linux_kernel_header + { +@@ -38,4 +40,9 @@ struct grub_arm64_linux_kernel_header + grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ + }; + ++grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header ++ *lh); ++grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, ++ char *args); ++ + #endif /* ! GRUB_LINUX_CPU_HEADER */ +Index: b/grub-core/loader/arm64/fdt.c +=================================================================== +--- /dev/null ++++ b/grub-core/loader/arm64/fdt.c +@@ -0,0 +1,185 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2013-2015 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static void *loaded_fdt; ++static void *fdt; ++ ++static void * ++get_firmware_fdt (void) ++{ ++ grub_efi_configuration_table_t *tables; ++ grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; ++ void *firmware_fdt = NULL; ++ unsigned int i; ++ ++ /* Look for FDT in UEFI config tables. */ ++ tables = grub_efi_system_table->configuration_table; ++ ++ for (i = 0; i < grub_efi_system_table->num_table_entries; i++) ++ if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) ++ { ++ firmware_fdt = tables[i].vendor_table; ++ grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); ++ break; ++ } ++ ++ return firmware_fdt; ++} ++ ++void * ++grub_fdt_load (grub_size_t additional_size) ++{ ++ void *raw_fdt; ++ grub_size_t size; ++ ++ if (fdt) ++ { ++ size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)); ++ grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size); ++ } ++ ++ if (loaded_fdt) ++ raw_fdt = loaded_fdt; ++ else ++ raw_fdt = get_firmware_fdt(); ++ ++ size = ++ raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; ++ size += additional_size; ++ ++ grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size); ++ fdt = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (size)); ++ if (!fdt) ++ return NULL; ++ ++ if (raw_fdt) ++ { ++ grub_memmove (fdt, raw_fdt, size); ++ grub_fdt_set_totalsize (fdt, size); ++ } ++ else ++ { ++ grub_fdt_create_empty_tree (fdt, size); ++ } ++ return fdt; ++} ++ ++grub_err_t ++grub_fdt_install (void) ++{ ++ grub_efi_boot_services_t *b; ++ grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; ++ grub_efi_status_t status; ++ ++ b = grub_efi_system_table->boot_services; ++ status = b->install_configuration_table (&fdt_guid, fdt); ++ if (status != GRUB_EFI_SUCCESS) ++ return grub_error (GRUB_ERR_IO, "failed to install FDT"); ++ ++ grub_dprintf ("fdt", "Installed/updated FDT configuration table @ %p\n", ++ fdt); ++ return GRUB_ERR_NONE; ++} ++ ++void ++grub_fdt_unload (void) { ++ if (!fdt) { ++ return; ++ } ++ grub_efi_free_pages ((grub_efi_physical_address_t) fdt, ++ GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt))); ++ fdt = NULL; ++} ++ ++static grub_err_t ++grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), ++ int argc, char *argv[]) ++{ ++ grub_file_t dtb; ++ void *blob = NULL; ++ int size; ++ ++ if (loaded_fdt) ++ grub_free (loaded_fdt); ++ loaded_fdt = NULL; ++ ++ /* No arguments means "use firmware FDT". */ ++ if (argc == 0) ++ { ++ return GRUB_ERR_NONE; ++ } ++ ++ dtb = grub_file_open (argv[0]); ++ if (!dtb) ++ goto out; ++ ++ size = grub_file_size (dtb); ++ blob = grub_malloc (size); ++ if (!blob) ++ goto out; ++ ++ if (grub_file_read (dtb, blob, size) < size) ++ { ++ if (!grub_errno) ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); ++ goto out; ++ } ++ ++ if (grub_fdt_check_header (blob, size) != 0) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree")); ++ goto out; ++ } ++ ++out: ++ if (dtb) ++ grub_file_close (dtb); ++ ++ if (blob) ++ { ++ if (grub_errno == GRUB_ERR_NONE) ++ loaded_fdt = blob; ++ else ++ grub_free (blob); ++ } ++ ++ return grub_errno; ++} ++ ++static grub_command_t cmd_devicetree; ++ ++GRUB_MOD_INIT (fdt) ++{ ++ cmd_devicetree = ++ grub_register_command ("devicetree", grub_cmd_devicetree, 0, ++ N_("Load DTB file.")); ++} ++ ++GRUB_MOD_FINI (fdt) ++{ ++ grub_unregister_command (cmd_devicetree); ++} +Index: b/grub-core/loader/arm64/xen_boot.c +=================================================================== +--- /dev/null ++++ b/grub-core/loader/arm64/xen_boot.c +@@ -0,0 +1,499 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* required by struct xen_hypervisor_header */ ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++#define XEN_HYPERVISOR_NAME "xen_hypervisor" ++#define MODULE_CUSTOM_COMPATIBLE "multiboot,module" ++ ++/* This maximum size is defined in Power.org ePAPR V1.1 ++ * https://www.power.org/documentation/epapr-version-1-1/ ++ * 2.2.1.1 Node Name Requirements ++ * node-name@unit-address ++ * 31 + 1(@) + 16(64bit address in hex format) + 1(\0) = 49 ++ */ ++#define FDT_NODE_NAME_MAX_SIZE (49) ++ ++struct compat_string_struct ++{ ++ grub_size_t size; ++ const char *compat_string; ++}; ++typedef struct compat_string_struct compat_string_struct_t; ++#define FDT_COMPATIBLE(x) {.size = sizeof(x), .compat_string = (x)} ++ ++enum module_type ++{ ++ MODULE_IMAGE, ++ MODULE_INITRD, ++ MODULE_XSM, ++ MODULE_CUSTOM ++}; ++typedef enum module_type module_type_t; ++ ++struct xen_hypervisor_header ++{ ++ struct grub_arm64_linux_kernel_header efi_head; ++ ++ /* This is always PE\0\0. */ ++ grub_uint8_t signature[GRUB_PE32_SIGNATURE_SIZE]; ++ /* The COFF file header. */ ++ struct grub_pe32_coff_header coff_header; ++ /* The Optional header. */ ++ struct grub_pe64_optional_header optional_header; ++}; ++ ++struct xen_boot_binary ++{ ++ struct xen_boot_binary *next; ++ struct xen_boot_binary **prev; ++ int is_hypervisor; ++ ++ grub_addr_t start; ++ grub_size_t size; ++ grub_size_t align; ++ ++ char *cmdline; ++ int cmdline_size; ++}; ++ ++static grub_dl_t my_mod; ++ ++static int loaded; ++ ++static struct xen_boot_binary *xen_hypervisor; ++static struct xen_boot_binary *module_head; ++ ++static __inline grub_addr_t ++xen_boot_address_align (grub_addr_t start, grub_size_t align) ++{ ++ return (align ? (ALIGN_UP (start, align)) : start); ++} ++ ++static grub_err_t ++prepare_xen_hypervisor_params (void *xen_boot_fdt) ++{ ++ int chosen_node = 0; ++ int retval; ++ ++ chosen_node = grub_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); ++ if (chosen_node < 0) ++ chosen_node = grub_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); ++ if (chosen_node < 1) ++ return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); ++ ++ grub_dprintf ("xen_loader", ++ "Xen Hypervisor cmdline : %s @ %p size:%d\n", ++ xen_hypervisor->cmdline, xen_hypervisor->cmdline, ++ xen_hypervisor->cmdline_size); ++ ++ retval = grub_fdt_set_prop (xen_boot_fdt, chosen_node, "bootargs", ++ xen_hypervisor->cmdline, ++ xen_hypervisor->cmdline_size); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to install/update FDT"); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) ++{ ++ int retval, chosen_node = 0, module_node = 0; ++ char module_name[FDT_NODE_NAME_MAX_SIZE]; ++ ++ retval = grub_snprintf (module_name, FDT_NODE_NAME_MAX_SIZE, "module@%lx", ++ xen_boot_address_align (module->start, ++ module->align)); ++ grub_dprintf ("xen_loader", "Module node name %s \n", module_name); ++ ++ if (retval < (int) sizeof ("module@")) ++ return grub_error (GRUB_ERR_IO, N_("failed to get FDT")); ++ ++ chosen_node = grub_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); ++ if (chosen_node < 0) ++ chosen_node = grub_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); ++ if (chosen_node < 1) ++ return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); ++ ++ module_node = ++ grub_fdt_find_subnode (xen_boot_fdt, chosen_node, module_name); ++ if (module_node < 0) ++ module_node = ++ grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name); ++ ++ retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible", ++ MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to update FDT"); ++ ++ grub_dprintf ("xen_loader", "Module\n"); ++ ++ retval = grub_fdt_set_reg64 (xen_boot_fdt, module_node, ++ xen_boot_address_align (module->start, ++ module->align), ++ module->size); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to update FDT"); ++ ++ if (module->cmdline && module->cmdline_size > 0) ++ { ++ grub_dprintf ("xen_loader", ++ "Module cmdline : %s @ %p size:%d\n", ++ module->cmdline, module->cmdline, module->cmdline_size); ++ ++ retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "bootargs", ++ module->cmdline, module->cmdline_size + 1); ++ if (retval) ++ return grub_error (GRUB_ERR_IO, "failed to update FDT"); ++ } ++ else ++ { ++ grub_dprintf ("xen_loader", "Module has no bootargs!\n"); ++ } ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++finalize_params_xen_boot (void) ++{ ++ struct xen_boot_binary *module; ++ void *xen_boot_fdt; ++ grub_size_t additional_size = 0x1000; ++ ++ /* Hypervisor. */ ++ additional_size += FDT_NODE_NAME_MAX_SIZE + xen_hypervisor->cmdline_size; ++ FOR_LIST_ELEMENTS (module, module_head) ++ { ++ additional_size += 6 * FDT_NODE_NAME_MAX_SIZE + sizeof(MODULE_CUSTOM_COMPATIBLE) - 1 ++ + module->cmdline_size; ++ } ++ ++ xen_boot_fdt = grub_fdt_load (additional_size); ++ if (!xen_boot_fdt) ++ return grub_error (GRUB_ERR_IO, "failed to get FDT"); ++ ++ if (xen_hypervisor) ++ { ++ if (prepare_xen_hypervisor_params (xen_boot_fdt) != GRUB_ERR_NONE) ++ goto fail; ++ } ++ else ++ { ++ grub_dprintf ("xen_loader", "Failed to get Xen Hypervisor info!\n"); ++ goto fail; ++ } ++ ++ /* Set module params info */ ++ FOR_LIST_ELEMENTS (module, module_head) ++ { ++ if (module->start && module->size > 0) ++ { ++ grub_dprintf ("xen_loader", "Module @ 0x%lx size:0x%lx\n", ++ xen_boot_address_align (module->start, module->align), ++ module->size); ++ if (prepare_xen_module_params (module, xen_boot_fdt) != GRUB_ERR_NONE) ++ goto fail; ++ } ++ else ++ { ++ grub_dprintf ("xen_loader", "Module info error!\n"); ++ goto fail; ++ } ++ } ++ ++ if (grub_fdt_install() == GRUB_ERR_NONE) ++ return GRUB_ERR_NONE; ++ ++fail: ++ grub_fdt_unload (); ++ ++ return grub_error (GRUB_ERR_IO, "failed to install/update FDT"); ++} ++ ++ ++static grub_err_t ++xen_boot (void) ++{ ++ grub_err_t err = finalize_params_xen_boot (); ++ if (err) ++ return err; ++ ++ return grub_arm64_uefi_boot_image (xen_hypervisor->start, ++ xen_hypervisor->size, ++ xen_hypervisor->cmdline); ++} ++ ++static void ++single_binary_unload (struct xen_boot_binary *binary) ++{ ++ if (!binary) ++ return; ++ ++ if (binary->start && binary->size > 0) ++ { ++ grub_efi_free_pages ((grub_efi_physical_address_t) binary->start, ++ GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); ++ } ++ ++ if (binary->cmdline && binary->cmdline_size > 0) ++ { ++ grub_free (binary->cmdline); ++ grub_dprintf ("xen_loader", ++ "Module cmdline memory free @ %p size: %d\n", ++ binary->cmdline, binary->cmdline_size); ++ } ++ ++ if (!binary->is_hypervisor) ++ grub_list_remove (GRUB_AS_LIST (binary)); ++ ++ grub_dprintf ("xen_loader", ++ "Module struct memory free @ %p size: 0x%lx\n", ++ binary, sizeof (binary)); ++ grub_free (binary); ++ ++ return; ++} ++ ++static void ++all_binaries_unload (void) ++{ ++ struct xen_boot_binary *binary; ++ ++ FOR_LIST_ELEMENTS (binary, module_head) ++ { ++ single_binary_unload (binary); ++ } ++ ++ if (xen_hypervisor) ++ single_binary_unload (xen_hypervisor); ++ ++ return; ++} ++ ++static grub_err_t ++xen_unload (void) ++{ ++ loaded = 0; ++ all_binaries_unload (); ++ grub_fdt_unload (); ++ grub_dl_unref (my_mod); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static void ++xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, ++ int argc, char *argv[]) ++{ ++ binary->size = grub_file_size (file); ++ grub_dprintf ("xen_loader", "Xen_boot file size: 0x%lx\n", binary->size); ++ ++ binary->start ++ = (grub_addr_t) grub_efi_allocate_pages (0, ++ GRUB_EFI_BYTES_TO_PAGES ++ (binary->size + ++ binary->align)); ++ if (!binary->start) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); ++ return; ++ } ++ ++ grub_dprintf ("xen_loader", "Xen_boot numpages: 0x%lx\n", ++ GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); ++ ++ if (grub_file_read (file, (void *) xen_boot_address_align (binary->start, ++ binary->align), ++ binary->size) != (grub_ssize_t) binary->size) ++ { ++ single_binary_unload (binary); ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); ++ return; ++ } ++ ++ if (argc > 1) ++ { ++ binary->cmdline_size = grub_loader_cmdline_size (argc - 1, argv + 1); ++ binary->cmdline = grub_zalloc (binary->cmdline_size); ++ if (!binary->cmdline) ++ { ++ single_binary_unload (binary); ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); ++ return; ++ } ++ grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, ++ binary->cmdline_size); ++ grub_dprintf ("xen_loader", ++ "Xen_boot cmdline @ %p %s, size: %d\n", ++ binary->cmdline, binary->cmdline, binary->cmdline_size); ++ } ++ else ++ { ++ binary->cmdline_size = 0; ++ binary->cmdline = NULL; ++ } ++ ++ grub_errno = GRUB_ERR_NONE; ++ return; ++} ++ ++static grub_err_t ++grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), ++ int argc, char *argv[]) ++{ ++ ++ struct xen_boot_binary *module = NULL; ++ grub_file_t file = 0; ++ ++ if (!argc) ++ { ++ 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 Xen Hypervisor first")); ++ goto fail; ++ } ++ ++ module = ++ (struct xen_boot_binary *) grub_zalloc (sizeof (struct xen_boot_binary)); ++ if (!module) ++ return grub_errno; ++ ++ module->is_hypervisor = 0; ++ module->align = 4096; ++ ++ grub_dprintf ("xen_loader", "Init module and node info\n"); ++ ++ file = grub_file_open (argv[0]); ++ if (!file) ++ goto fail; ++ ++ xen_boot_binary_load (module, file, argc, argv); ++ if (grub_errno == GRUB_ERR_NONE) ++ grub_list_push (GRUB_AS_LIST_P (&module_head), GRUB_AS_LIST (module)); ++ ++ fail: ++ if (file) ++ grub_file_close (file); ++ if (grub_errno != GRUB_ERR_NONE) ++ single_binary_unload (module); ++ ++ return grub_errno; ++} ++ ++static grub_err_t ++grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), ++ int argc, char *argv[]) ++{ ++ struct xen_hypervisor_header sh; ++ grub_file_t file = NULL; ++ ++ grub_dl_ref (my_mod); ++ ++ if (!argc) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ goto fail; ++ } ++ ++ file = grub_file_open (argv[0]); ++ if (!file) ++ goto fail; ++ ++ if (grub_file_read (file, &sh, sizeof (sh)) != (long) sizeof (sh)) ++ goto fail; ++ if (grub_arm64_uefi_check_image ++ ((struct grub_arm64_linux_kernel_header *) &sh) != GRUB_ERR_NONE) ++ goto fail; ++ grub_file_seek (file, 0); ++ ++ /* if another module has called grub_loader_set, ++ we need to make sure that another module is unloaded properly */ ++ grub_loader_unset (); ++ ++ xen_hypervisor = ++ (struct xen_boot_binary *) grub_zalloc (sizeof (struct xen_boot_binary)); ++ if (!xen_hypervisor) ++ return grub_errno; ++ ++ xen_hypervisor->is_hypervisor = 1; ++ xen_hypervisor->align = (grub_size_t) sh.optional_header.section_alignment; ++ ++ xen_boot_binary_load (xen_hypervisor, file, argc, argv); ++ if (grub_errno == GRUB_ERR_NONE) ++ { ++ grub_loader_set (xen_boot, xen_unload, 0); ++ loaded = 1; ++ } ++ ++fail: ++ if (file) ++ grub_file_close (file); ++ if (grub_errno != GRUB_ERR_NONE) ++ { ++ loaded = 0; ++ all_binaries_unload (); ++ grub_dl_unref (my_mod); ++ } ++ ++ return grub_errno; ++} ++ ++static grub_command_t cmd_xen_hypervisor; ++static grub_command_t cmd_xen_module; ++ ++GRUB_MOD_INIT (xen_boot) ++{ ++ cmd_xen_hypervisor = ++ grub_register_command ("xen_hypervisor", grub_cmd_xen_hypervisor, 0, ++ N_("Load a xen hypervisor.")); ++ cmd_xen_module = ++ grub_register_command ("xen_module", grub_cmd_xen_module, 0, ++ N_("Load a xen module.")); ++ my_mod = mod; ++} ++ ++GRUB_MOD_FINI (xen_boot) ++{ ++ grub_unregister_command (cmd_xen_hypervisor); ++ grub_unregister_command (cmd_xen_module); ++} +Index: b/include/grub/arm64/fdtload.h +=================================================================== +--- /dev/null ++++ b/include/grub/arm64/fdtload.h +@@ -0,0 +1,35 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2013-2015 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#ifndef GRUB_FDTLOAD_CPU_HEADER ++#define GRUB_FDTLOAD_CPU_HEADER 1 ++ ++#include ++#include ++ ++void * ++grub_fdt_load (grub_size_t additional_size); ++void ++grub_fdt_unload (void); ++grub_err_t ++grub_fdt_install (void); ++ ++#define GRUB_EFI_PAGE_SHIFT 12 ++#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) ++ ++#endif +Index: b/grub-core/Makefile.core.def +=================================================================== +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1673,13 +1673,19 @@ module = { + ia64_efi = loader/ia64/efi/linux.c; + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; +- fdt = lib/fdt.c; + common = loader/linux.c; + common = lib/cmdline.c; + enable = noemu; + }; + + module = { ++ name = fdt; ++ arm64 = loader/arm64/fdt.c; ++ common = lib/fdt.c; ++ enable = fdt; ++}; ++ ++module = { + name = xnu; + x86 = loader/xnu_resume.c; + x86 = loader/i386/xnu.c; +Index: b/grub-core/lib/fdt.c +=================================================================== +--- a/grub-core/lib/fdt.c ++++ b/grub-core/lib/fdt.c +@@ -19,6 +19,9 @@ + #include + #include + #include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); + + #define FDT_SUPPORTED_VERSION 17 + diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_chainloader_path.patch grub2-2.02~beta2/debian/patches/linuxefi_chainloader_path.patch --- grub2-2.02~beta2/debian/patches/linuxefi_chainloader_path.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_chainloader_path.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,34 @@ +From 4b30b1a7b7eac0981b91fd76b21e8bd674b4d7fc Mon Sep 17 00:00:00 2001 +From: Raymund Will +Date: Fri, 10 Apr 2015 01:45:02 -0400 +Subject: [PATCH] Use device part of chainloader target, if present. + +Otherwise chainloading is restricted to '$root', which might not even +be readable by EFI! + +v1. use grub_file_get_device_name() to get device name + +Signed-off-by: Michael Chang +Signed-off-by: Peter Jones +--- + grub-core/loader/efi/chainloader.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +Index: b/grub-core/loader/efi/chainloader.c +=================================================================== +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -219,8 +219,11 @@ grub_cmd_chainloader (grub_command_t cmd + if (! file) + goto fail; + +- /* Get the root device's device path. */ +- dev = grub_device_open (0); ++ /* Get the device path from filename. */ ++ char *devname = grub_file_get_device_name (filename); ++ dev = grub_device_open (devname); ++ if (devname) ++ grub_free (devname); + if (! dev) + goto fail; + diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_chainloader_pe_fixes.patch grub2-2.02~beta2/debian/patches/linuxefi_chainloader_pe_fixes.patch --- grub2-2.02~beta2/debian/patches/linuxefi_chainloader_pe_fixes.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_chainloader_pe_fixes.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,350 @@ +From 8170e902e9c48cee1dc727445656a1c4b802b70e Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 9 Jun 2016 12:22:29 -0400 +Subject: [PATCH] Re-work some intricacies of PE loading. + +The PE spec is not a well written document, and awesomely every place +where there's an ambiguous way to read something, Windows' bootmgfw.efi +takes a different read than either of them. +--- + grub-core/loader/efi/chainloader.c | 156 +++++++++++++++++++++++++++++-------- + include/grub/efi/pe32.h | 32 ++++++- + 2 files changed, 152 insertions(+), 36 deletions(-) + +Index: b/grub-core/loader/efi/chainloader.c +=================================================================== +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -297,7 +297,7 @@ image_is_64_bit (grub_pe_header_t *pe_hd + return 0; + } + +-static const grub_uint16_t machine_type = ++static const grub_uint16_t machine_type __attribute__((__unused__)) = + #if defined(__x86_64__) + GRUB_PE32_MACHINE_X86_64; + #elif defined(__aarch64__) +@@ -363,10 +363,10 @@ relocate_coff (pe_coff_loader_image_cont + + reloc_base = image_address (orig, size, section->raw_data_offset); + reloc_base_end = image_address (orig, size, section->raw_data_offset +- + section->virtual_size - 1); ++ + section->virtual_size); + +- grub_dprintf ("chain", "reloc_base %p reloc_base_end %p\n", reloc_base, +- reloc_base_end); ++ grub_dprintf ("chain", "relocate_coff(): reloc_base %p reloc_base_end %p\n", ++ reloc_base, reloc_base_end); + + if (!reloc_base && !reloc_base_end) + return GRUB_EFI_SUCCESS; +@@ -503,12 +503,13 @@ handle_image (void *data, grub_efi_uint3 + grub_efi_status_t efi_status; + char *buffer = NULL; + char *buffer_aligned = NULL; +- grub_efi_uint32_t i, size; ++ grub_efi_uint32_t i; + struct grub_pe32_section_table *section; + char *base, *end; + pe_coff_loader_image_context_t context; + grub_uint32_t section_alignment; + grub_uint32_t buffer_size; ++ int found_entry_point = 0; + + b = grub_efi_system_table->boot_services; + +@@ -522,8 +523,28 @@ handle_image (void *data, grub_efi_uint3 + goto error_exit; + } + ++ /* ++ * The spec says, uselessly, of SectionAlignment: ++ * ===== ++ * The alignment (in bytes) of sections when they are loaded into ++ * memory. It must be greater than or equal to FileAlignment. The ++ * default is the page size for the architecture. ++ * ===== ++ * Which doesn't tell you whose responsibility it is to enforce the ++ * "default", or when. It implies that the value in the field must ++ * be > FileAlignment (also poorly defined), but it appears visual ++ * studio will happily write 512 for FileAlignment (its default) and ++ * 0 for SectionAlignment, intending to imply PAGE_SIZE. ++ * ++ * We only support one page size, so if it's zero, nerf it to 4096. ++ */ + section_alignment = context.section_alignment; ++ if (section_alignment == 0) ++ section_alignment = 4096; ++ + buffer_size = context.image_size + section_alignment; ++ grub_dprintf ("chain", "image size is %08lx, datasize is %08x\n", ++ context.image_size, datasize); + + efi_status = efi_call_3 (b->allocate_pool, GRUB_EFI_LOADER_DATA, + buffer_size, (void **) &buffer); +@@ -535,7 +556,6 @@ handle_image (void *data, grub_efi_uint3 + } + + buffer_aligned = (char *)ALIGN_UP ((grub_addr_t)buffer, section_alignment); +- + if (!buffer_aligned) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); +@@ -544,27 +564,62 @@ handle_image (void *data, grub_efi_uint3 + + grub_memcpy (buffer_aligned, data, context.size_of_headers); + ++ entry_point = image_address (buffer_aligned, context.image_size, ++ context.entry_point); ++ ++ grub_dprintf ("chain", "entry_point: %p\n", entry_point); ++ if (!entry_point) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid entry point"); ++ goto error_exit; ++ } ++ + char *reloc_base, *reloc_base_end; +- reloc_base = image_address (buffer_aligned, datasize, ++ grub_dprintf ("chain", "reloc_dir: %p reloc_size: 0x%08x\n", ++ context.reloc_dir->rva, ++ context.reloc_dir->size); ++ reloc_base = image_address (buffer_aligned, context.image_size, + context.reloc_dir->rva); + /* RelocBaseEnd here is the address of the last byte of the table */ +- reloc_base_end = image_address (buffer_aligned, datasize, ++ reloc_base_end = image_address (buffer_aligned, context.image_size, + context.reloc_dir->rva + + context.reloc_dir->size - 1); ++ grub_dprintf ("chain", "reloc_base: %p reloc_base_end: %p\n", ++ reloc_base, reloc_base_end); ++ + struct grub_pe32_section_table *reloc_section = NULL; + + section = context.first_section; + for (i = 0; i < context.number_of_sections; i++, section++) + { +- size = section->virtual_size; +- if (size > section->raw_data_size) +- size = section->raw_data_size; ++ char name[9]; + + base = image_address (buffer_aligned, context.image_size, + section->virtual_address); + end = image_address (buffer_aligned, context.image_size, +- section->virtual_address + size - 1); ++ section->virtual_address + section->virtual_size -1); + ++ grub_strncpy(name, section->name, 9); ++ name[8] = '\0'; ++ grub_dprintf ("chain", "Section %d \"%s\" at %p..%p\n", i, ++ name, base, end); ++ ++ if (end < base) ++ { ++ grub_dprintf ("chain", " base is %p but end is %p... bad.\n", ++ base, end); ++ grub_error (GRUB_ERR_BAD_ARGUMENT, ++ "Image has invalid negative size"); ++ goto error_exit; ++ } ++ ++ if (section->virtual_address <= context.entry_point && ++ (section->virtual_address + section->raw_data_size - 1) ++ > context.entry_point) ++ { ++ found_entry_point++; ++ grub_dprintf ("chain", " section contains entry point\n"); ++ } + + /* We do want to process .reloc, but it's often marked + * discardable, so we don't want to memcpy it. */ +@@ -583,21 +638,46 @@ handle_image (void *data, grub_efi_uint3 + if (section->raw_data_size && section->virtual_size && + base && end && reloc_base == base && reloc_base_end == end) + { ++ grub_dprintf ("chain", " section is relocation section\n"); + reloc_section = section; + } ++ else ++ { ++ grub_dprintf ("chain", " section is not reloc section?\n"); ++ grub_dprintf ("chain", " rds: 0x%08x, vs: %08x\n", ++ section->raw_data_size, section->virtual_size); ++ grub_dprintf ("chain", " base: %p end: %p\n", base, end); ++ grub_dprintf ("chain", " reloc_base: %p reloc_base_end: %p\n", ++ reloc_base, reloc_base_end); ++ } + } + +- if (section->characteristics && GRUB_PE32_SCN_MEM_DISCARDABLE) +- continue; ++ grub_dprintf ("chain", " Section characteristics are %08x\n", ++ section->characteristics); ++ grub_dprintf ("chain", " Section virtual size: %08x\n", ++ section->virtual_size); ++ grub_dprintf ("chain", " Section raw_data size: %08x\n", ++ section->raw_data_size); ++ if (section->characteristics & GRUB_PE32_SCN_MEM_DISCARDABLE) ++ { ++ grub_dprintf ("chain", " Discarding section\n"); ++ continue; ++ } + + if (!base || !end) + { ++ grub_dprintf ("chain", " section is invalid\n"); + grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid section size"); + goto error_exit; + } + +- if (section->virtual_address < context.size_of_headers || +- section->raw_data_offset < context.size_of_headers) ++ if (section->characteristics & GRUB_PE32_SCN_CNT_UNINITIALIZED_DATA) ++ { ++ if (section->raw_data_size != 0) ++ grub_dprintf ("chain", " UNINITIALIZED_DATA section has data?\n"); ++ } ++ else if (section->virtual_address < context.size_of_headers || ++ section->raw_data_offset < context.size_of_headers) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, + "Section %d is inside image headers", i); +@@ -605,13 +685,24 @@ handle_image (void *data, grub_efi_uint3 + } + + if (section->raw_data_size > 0) +- grub_memcpy (base, (grub_efi_uint8_t*)data + section->raw_data_offset, +- size); ++ { ++ grub_dprintf ("chain", " copying 0x%08x bytes to %p\n", ++ section->raw_data_size, base); ++ grub_memcpy (base, ++ (grub_efi_uint8_t*)data + section->raw_data_offset, ++ section->raw_data_size); ++ } + +- if (size < section->virtual_size) +- grub_memset (base + size, 0, section->virtual_size - size); ++ if (section->raw_data_size < section->virtual_size) ++ { ++ grub_dprintf ("chain", " padding with 0x%08x bytes at %p\n", ++ section->virtual_size - section->raw_data_size, ++ base + section->raw_data_size); ++ grub_memset (base + section->raw_data_size, 0, ++ section->virtual_size - section->raw_data_size); ++ } + +- grub_dprintf ("chain", "copied section %s\n", section->name); ++ grub_dprintf ("chain", " finished section %s\n", name); + } + + /* 5 == EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC */ +@@ -634,12 +725,15 @@ handle_image (void *data, grub_efi_uint3 + } + } + +- entry_point = image_address (buffer_aligned, context.image_size, +- context.entry_point); +- +- if (!entry_point) ++ if (!found_entry_point) + { +- grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid entry point"); ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "entry point is not within sections"); ++ goto error_exit; ++ } ++ if (found_entry_point > 1) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "%d sections contain entry point", ++ found_entry_point); + goto error_exit; + } + +@@ -657,26 +751,24 @@ handle_image (void *data, grub_efi_uint3 + li->load_options_size = cmdline_len; + li->file_path = grub_efi_get_media_file_path (file_path); + li->device_handle = dev_handle; +- if (li->file_path) +- { +- grub_printf ("file path: "); +- grub_efi_print_device_path (li->file_path); +- } +- else ++ if (!li->file_path) + { + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching file path found"); + goto error_exit; + } + ++ grub_dprintf ("chain", "booting via entry point\n"); + efi_status = efi_call_2 (entry_point, grub_efi_image_handle, + grub_efi_system_table); + ++ grub_dprintf ("chain", "entry_point returned %ld\n", efi_status); + grub_memcpy (li, &li_bak, sizeof (grub_efi_loaded_image_t)); + efi_status = efi_call_1 (b->free_pool, buffer); + + return 1; + + error_exit: ++ grub_dprintf ("chain", "error_exit: grub_errno: %d\n", grub_errno); + if (buffer) + efi_call_1 (b->free_pool, buffer); + +Index: b/include/grub/efi/pe32.h +=================================================================== +--- a/include/grub/efi/pe32.h ++++ b/include/grub/efi/pe32.h +@@ -227,12 +227,18 @@ struct grub_pe32_section_table + grub_uint32_t characteristics; + }; + ++#define GRUB_PE32_SCN_TYPE_NO_PAD 0x00000008 + #define GRUB_PE32_SCN_CNT_CODE 0x00000020 + #define GRUB_PE32_SCN_CNT_INITIALIZED_DATA 0x00000040 +-#define GRUB_PE32_SCN_MEM_DISCARDABLE 0x02000000 +-#define GRUB_PE32_SCN_MEM_EXECUTE 0x20000000 +-#define GRUB_PE32_SCN_MEM_READ 0x40000000 +-#define GRUB_PE32_SCN_MEM_WRITE 0x80000000 ++#define GRUB_PE32_SCN_CNT_UNINITIALIZED_DATA 0x00000080 ++#define GRUB_PE32_SCN_LNK_OTHER 0x00000100 ++#define GRUB_PE32_SCN_LNK_INFO 0x00000200 ++#define GRUB_PE32_SCN_LNK_REMOVE 0x00000800 ++#define GRUB_PE32_SCN_LNK_COMDAT 0x00001000 ++#define GRUB_PE32_SCN_GPREL 0x00008000 ++#define GRUB_PE32_SCN_MEM_16BIT 0x00020000 ++#define GRUB_PE32_SCN_MEM_LOCKED 0x00040000 ++#define GRUB_PE32_SCN_MEM_PRELOAD 0x00080000 + + #define GRUB_PE32_SCN_ALIGN_1BYTES 0x00100000 + #define GRUB_PE32_SCN_ALIGN_2BYTES 0x00200000 +@@ -241,10 +247,28 @@ struct grub_pe32_section_table + #define GRUB_PE32_SCN_ALIGN_16BYTES 0x00500000 + #define GRUB_PE32_SCN_ALIGN_32BYTES 0x00600000 + #define GRUB_PE32_SCN_ALIGN_64BYTES 0x00700000 ++#define GRUB_PE32_SCN_ALIGN_128BYTES 0x00800000 ++#define GRUB_PE32_SCN_ALIGN_256BYTES 0x00900000 ++#define GRUB_PE32_SCN_ALIGN_512BYTES 0x00A00000 ++#define GRUB_PE32_SCN_ALIGN_1024BYTES 0x00B00000 ++#define GRUB_PE32_SCN_ALIGN_2048BYTES 0x00C00000 ++#define GRUB_PE32_SCN_ALIGN_4096BYTES 0x00D00000 ++#define GRUB_PE32_SCN_ALIGN_8192BYTES 0x00E00000 + + #define GRUB_PE32_SCN_ALIGN_SHIFT 20 + #define GRUB_PE32_SCN_ALIGN_MASK 7 + ++#define GRUB_PE32_SCN_LNK_NRELOC_OVFL 0x01000000 ++#define GRUB_PE32_SCN_MEM_DISCARDABLE 0x02000000 ++#define GRUB_PE32_SCN_MEM_NOT_CACHED 0x04000000 ++#define GRUB_PE32_SCN_MEM_NOT_PAGED 0x08000000 ++#define GRUB_PE32_SCN_MEM_SHARED 0x10000000 ++#define GRUB_PE32_SCN_MEM_EXECUTE 0x20000000 ++#define GRUB_PE32_SCN_MEM_READ 0x40000000 ++#define GRUB_PE32_SCN_MEM_WRITE 0x80000000 ++ ++ ++ + #define GRUB_PE32_SIGNATURE_SIZE 4 + + struct grub_pe32_header diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_chainloader_sb.patch grub2-2.02~beta2/debian/patches/linuxefi_chainloader_sb.patch --- grub2-2.02~beta2/debian/patches/linuxefi_chainloader_sb.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_chainloader_sb.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,820 @@ +From 6cb5703868e185c60b3cb5e78bd84288dd41f275 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 6 Oct 2015 13:04:37 -0400 +Subject: [PATCH] Add secureboot support on efi chainloader + +Expand the chainloader to be able to verify the image by means of shim +lock protocol. The PE/COFF image is loaded and relocated by the +chainloader instead of calling LoadImage and StartImage UEFI boot +Service as they require positive verification result from keys enrolled +in KEK or DB. The shim will use MOK in addition to firmware enrolled +keys to verify the image. + +The chainloader module could be used to load other UEFI bootloaders, +such as xen.efi, and could be signed by any of MOK, KEK or DB. + +Based on https://build.opensuse.org/package/view_file/openSUSE:Factory/grub2/grub2-secureboot-chainloader.patch + +Signed-off-by: Peter Jones +--- + grub-core/Makefile.core.def | 3 + grub-core/loader/efi/chainloader.c | 612 ++++++++++++++++++++++++++++++++++--- + include/grub/efi/pe32.h | 20 + + 3 files changed, 598 insertions(+), 37 deletions(-) + +Index: b/grub-core/loader/efi/chainloader.c +=================================================================== +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -32,6 +32,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -46,9 +48,14 @@ static grub_dl_t my_mod; + + static grub_efi_physical_address_t address; + static grub_efi_uintn_t pages; ++static grub_ssize_t fsize; + static grub_efi_device_path_t *file_path; + static grub_efi_handle_t image_handle; + static grub_efi_char16_t *cmdline; ++static grub_ssize_t cmdline_len; ++static grub_efi_handle_t dev_handle; ++ ++static grub_efi_status_t (*entry_point) (grub_efi_handle_t image_handle, grub_efi_system_table_t *system_table); + + static grub_err_t + grub_chainloader_unload (void) +@@ -63,6 +70,7 @@ grub_chainloader_unload (void) + grub_free (cmdline); + cmdline = 0; + file_path = 0; ++ dev_handle = 0; + + grub_dl_unref (my_mod); + return GRUB_ERR_NONE; +@@ -187,12 +195,523 @@ make_file_path (grub_efi_device_path_t * + return file_path; + } + ++#define SHIM_LOCK_GUID \ ++ { 0x605dab50, 0xe046, 0x4300, { 0xab,0xb6,0x3d,0xd8,0x10,0xdd,0x8b,0x23 } } ++ ++typedef union ++{ ++ struct grub_pe32_header_32 pe32; ++ struct grub_pe32_header_64 pe32plus; ++} grub_pe_header_t; ++ ++struct pe_coff_loader_image_context ++{ ++ grub_efi_uint64_t image_address; ++ grub_efi_uint64_t image_size; ++ grub_efi_uint64_t entry_point; ++ grub_efi_uintn_t size_of_headers; ++ grub_efi_uint16_t image_type; ++ grub_efi_uint16_t number_of_sections; ++ grub_efi_uint32_t section_alignment; ++ struct grub_pe32_section_table *first_section; ++ struct grub_pe32_data_directory *reloc_dir; ++ struct grub_pe32_data_directory *sec_dir; ++ grub_efi_uint64_t number_of_rva_and_sizes; ++ grub_pe_header_t *pe_hdr; ++}; ++ ++typedef struct pe_coff_loader_image_context pe_coff_loader_image_context_t; ++ ++struct grub_efi_shim_lock ++{ ++ grub_efi_status_t (*verify)(void *buffer, ++ grub_efi_uint32_t size); ++ grub_efi_status_t (*hash)(void *data, ++ grub_efi_int32_t datasize, ++ pe_coff_loader_image_context_t *context, ++ grub_efi_uint8_t *sha256hash, ++ grub_efi_uint8_t *sha1hash); ++ grub_efi_status_t (*context)(void *data, ++ grub_efi_uint32_t size, ++ pe_coff_loader_image_context_t *context); ++}; ++ ++typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; ++ ++static grub_efi_boolean_t ++read_header (void *data, grub_efi_uint32_t size, ++ pe_coff_loader_image_context_t *context) ++{ ++ grub_efi_guid_t guid = SHIM_LOCK_GUID; ++ grub_efi_shim_lock_t *shim_lock; ++ grub_efi_status_t status; ++ ++ shim_lock = grub_efi_locate_protocol (&guid, NULL); ++ ++ if (!shim_lock) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "no shim lock protocol"); ++ return 0; ++ } ++ ++ status = shim_lock->context (data, size, context); ++ ++ if (status == GRUB_EFI_SUCCESS) ++ { ++ grub_dprintf ("chain", "context success\n"); ++ return 1; ++ } ++ ++ switch (status) ++ { ++ case GRUB_EFI_UNSUPPORTED: ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "context error unsupported"); ++ break; ++ case GRUB_EFI_INVALID_PARAMETER: ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "context error invalid parameter"); ++ break; ++ default: ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "context error code"); ++ break; ++ } ++ ++ return 0; ++} ++ ++static void* ++image_address (void *image, grub_efi_uint64_t sz, grub_efi_uint64_t adr) ++{ ++ if (adr > sz) ++ return NULL; ++ ++ return ((grub_uint8_t*)image + adr); ++} ++ ++static int ++image_is_64_bit (grub_pe_header_t *pe_hdr) ++{ ++ /* .Magic is the same offset in all cases */ ++ if (pe_hdr->pe32plus.optional_header.magic == GRUB_PE32_PE64_MAGIC) ++ return 1; ++ return 0; ++} ++ ++static const grub_uint16_t machine_type = ++#if defined(__x86_64__) ++ GRUB_PE32_MACHINE_X86_64; ++#elif defined(__aarch64__) ++ GRUB_PE32_MACHINE_ARM64; ++#elif defined(__arm__) ++ GRUB_PE32_MACHINE_ARMTHUMB_MIXED; ++#elif defined(__i386__) || defined(__i486__) || defined(__i686__) ++ GRUB_PE32_MACHINE_I386; ++#elif defined(__ia64__) ++ GRUB_PE32_MACHINE_IA64; ++#else ++#error this architecture is not supported by grub2 ++#endif ++ ++static grub_efi_status_t ++relocate_coff (pe_coff_loader_image_context_t *context, ++ struct grub_pe32_section_table *section, ++ void *orig, void *data) ++{ ++ struct grub_pe32_data_directory *reloc_base, *reloc_base_end; ++ grub_efi_uint64_t adjust; ++ struct grub_pe32_fixup_block *reloc, *reloc_end; ++ char *fixup, *fixup_base, *fixup_data = NULL; ++ grub_efi_uint16_t *fixup_16; ++ grub_efi_uint32_t *fixup_32; ++ grub_efi_uint64_t *fixup_64; ++ grub_efi_uint64_t size = context->image_size; ++ void *image_end = (char *)orig + size; ++ int n = 0; ++ ++ if (image_is_64_bit (context->pe_hdr)) ++ context->pe_hdr->pe32plus.optional_header.image_base = ++ (grub_uint64_t)(unsigned long)data; ++ else ++ context->pe_hdr->pe32.optional_header.image_base = ++ (grub_uint32_t)(unsigned long)data; ++ ++ /* Alright, so here's how this works: ++ * ++ * context->reloc_dir gives us two things: ++ * - the VA the table of base relocation blocks are (maybe) to be ++ * mapped at (reloc_dir->rva) ++ * - the virtual size (reloc_dir->size) ++ * ++ * The .reloc section (section here) gives us some other things: ++ * - the name! kind of. (section->name) ++ * - the virtual size (section->virtual_size), which should be the same ++ * as RelocDir->Size ++ * - the virtual address (section->virtual_address) ++ * - the file section size (section->raw_data_size), which is ++ * a multiple of optional_header->file_alignment. Only useful for image ++ * validation, not really useful for iteration bounds. ++ * - the file address (section->raw_data_offset) ++ * - a bunch of stuff we don't use that's 0 in our binaries usually ++ * - Flags (section->characteristics) ++ * ++ * and then the thing that's actually at the file address is an array ++ * of struct grub_pe32_fixup_block structs with some values packed behind ++ * them. The block_size field of this structure includes the ++ * structure itself, and adding it to that structure's address will ++ * yield the next entry in the array. ++ */ ++ ++ reloc_base = image_address (orig, size, section->raw_data_offset); ++ reloc_base_end = image_address (orig, size, section->raw_data_offset ++ + section->virtual_size - 1); ++ ++ grub_dprintf ("chain", "reloc_base %p reloc_base_end %p\n", reloc_base, ++ reloc_base_end); ++ ++ if (!reloc_base && !reloc_base_end) ++ return GRUB_EFI_SUCCESS; ++ ++ if (!reloc_base || !reloc_base_end) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "Reloc table overflows binary"); ++ return GRUB_EFI_UNSUPPORTED; ++ } ++ ++ adjust = (grub_uint64_t)(unsigned long)data - context->image_address; ++ if (adjust == 0) ++ return GRUB_EFI_SUCCESS; ++ ++ while (reloc_base < reloc_base_end) ++ { ++ grub_uint16_t *entry; ++ reloc = (struct grub_pe32_fixup_block *)((char*)reloc_base); ++ ++ if ((reloc_base->size == 0) || ++ (reloc_base->size > context->reloc_dir->size)) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, ++ "Reloc %d block size %d is invalid\n", n, ++ reloc_base->size); ++ return GRUB_EFI_UNSUPPORTED; ++ } ++ ++ entry = &reloc->entries[0]; ++ reloc_end = (struct grub_pe32_fixup_block *) ++ ((char *)reloc_base + reloc_base->size); ++ ++ if ((void *)reloc_end < data || (void *)reloc_end > image_end) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "Reloc entry %d overflows binary", ++ n); ++ return GRUB_EFI_UNSUPPORTED; ++ } ++ ++ fixup_base = image_address(data, size, reloc_base->rva); ++ ++ if (!fixup_base) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "Reloc %d Invalid fixupbase", n); ++ return GRUB_EFI_UNSUPPORTED; ++ } ++ ++ while ((void *)entry < (void *)reloc_end) ++ { ++ fixup = fixup_base + (*entry & 0xFFF); ++ switch ((*entry) >> 12) ++ { ++ case GRUB_PE32_REL_BASED_ABSOLUTE: ++ break; ++ case GRUB_PE32_REL_BASED_HIGH: ++ fixup_16 = (grub_uint16_t *)fixup; ++ *fixup_16 = (grub_uint16_t) ++ (*fixup_16 + ((grub_uint16_t)((grub_uint32_t)adjust >> 16))); ++ if (fixup_data != NULL) ++ { ++ *(grub_uint16_t *) fixup_data = *fixup_16; ++ fixup_data = fixup_data + sizeof (grub_uint16_t); ++ } ++ break; ++ case GRUB_PE32_REL_BASED_LOW: ++ fixup_16 = (grub_uint16_t *)fixup; ++ *fixup_16 = (grub_uint16_t) (*fixup_16 + (grub_uint16_t)adjust); ++ if (fixup_data != NULL) ++ { ++ *(grub_uint16_t *) fixup_data = *fixup_16; ++ fixup_data = fixup_data + sizeof (grub_uint16_t); ++ } ++ break; ++ case GRUB_PE32_REL_BASED_HIGHLOW: ++ fixup_32 = (grub_uint32_t *)fixup; ++ *fixup_32 = *fixup_32 + (grub_uint32_t)adjust; ++ if (fixup_data != NULL) ++ { ++ fixup_data = (char *)ALIGN_UP ((grub_addr_t)fixup_data, sizeof (grub_uint32_t)); ++ *(grub_uint32_t *) fixup_data = *fixup_32; ++ fixup_data += sizeof (grub_uint32_t); ++ } ++ break; ++ case GRUB_PE32_REL_BASED_DIR64: ++ fixup_64 = (grub_uint64_t *)fixup; ++ *fixup_64 = *fixup_64 + (grub_uint64_t)adjust; ++ if (fixup_data != NULL) ++ { ++ fixup_data = (char *)ALIGN_UP ((grub_addr_t)fixup_data, sizeof (grub_uint64_t)); ++ *(grub_uint64_t *) fixup_data = *fixup_64; ++ fixup_data += sizeof (grub_uint64_t); ++ } ++ break; ++ default: ++ grub_error (GRUB_ERR_BAD_ARGUMENT, ++ "Reloc %d unknown relocation type %d", ++ n, (*entry) >> 12); ++ return GRUB_EFI_UNSUPPORTED; ++ } ++ entry += 1; ++ } ++ reloc_base = (struct grub_pe32_data_directory *)reloc_end; ++ n++; ++ } ++ ++ return GRUB_EFI_SUCCESS; ++} ++ ++static grub_efi_device_path_t * ++grub_efi_get_media_file_path (grub_efi_device_path_t *dp) ++{ ++ while (1) ++ { ++ grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); ++ grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); ++ ++ if (type == GRUB_EFI_END_DEVICE_PATH_TYPE) ++ break; ++ else if (type == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE ++ && subtype == GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE) ++ return dp; ++ ++ dp = GRUB_EFI_NEXT_DEVICE_PATH (dp); ++ } ++ ++ return NULL; ++} ++ ++static grub_efi_boolean_t ++handle_image (void *data, grub_efi_uint32_t datasize) ++{ ++ grub_efi_boot_services_t *b; ++ grub_efi_loaded_image_t *li, li_bak; ++ grub_efi_status_t efi_status; ++ char *buffer = NULL; ++ char *buffer_aligned = NULL; ++ grub_efi_uint32_t i, size; ++ struct grub_pe32_section_table *section; ++ char *base, *end; ++ pe_coff_loader_image_context_t context; ++ grub_uint32_t section_alignment; ++ grub_uint32_t buffer_size; ++ ++ b = grub_efi_system_table->boot_services; ++ ++ if (read_header (data, datasize, &context)) ++ { ++ grub_dprintf ("chain", "Succeed to read header\n"); ++ } ++ else ++ { ++ grub_dprintf ("chain", "Failed to read header\n"); ++ goto error_exit; ++ } ++ ++ section_alignment = context.section_alignment; ++ buffer_size = context.image_size + section_alignment; ++ ++ efi_status = efi_call_3 (b->allocate_pool, GRUB_EFI_LOADER_DATA, ++ buffer_size, (void **) &buffer); ++ ++ if (efi_status != GRUB_EFI_SUCCESS) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); ++ goto error_exit; ++ } ++ ++ buffer_aligned = (char *)ALIGN_UP ((grub_addr_t)buffer, section_alignment); ++ ++ if (!buffer_aligned) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); ++ goto error_exit; ++ } ++ ++ grub_memcpy (buffer_aligned, data, context.size_of_headers); ++ ++ char *reloc_base, *reloc_base_end; ++ reloc_base = image_address (buffer_aligned, datasize, ++ context.reloc_dir->rva); ++ /* RelocBaseEnd here is the address of the last byte of the table */ ++ reloc_base_end = image_address (buffer_aligned, datasize, ++ context.reloc_dir->rva ++ + context.reloc_dir->size - 1); ++ struct grub_pe32_section_table *reloc_section = NULL; ++ ++ section = context.first_section; ++ for (i = 0; i < context.number_of_sections; i++, section++) ++ { ++ size = section->virtual_size; ++ if (size > section->raw_data_size) ++ size = section->raw_data_size; ++ ++ base = image_address (buffer_aligned, context.image_size, ++ section->virtual_address); ++ end = image_address (buffer_aligned, context.image_size, ++ section->virtual_address + size - 1); ++ ++ ++ /* We do want to process .reloc, but it's often marked ++ * discardable, so we don't want to memcpy it. */ ++ if (grub_memcmp (section->name, ".reloc\0\0", 8) == 0) ++ { ++ if (reloc_section) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, ++ "Image has multiple relocation sections"); ++ goto error_exit; ++ } ++ ++ /* If it has nonzero sizes, and our bounds check ++ * made sense, and the VA and size match RelocDir's ++ * versions, then we believe in this section table. */ ++ if (section->raw_data_size && section->virtual_size && ++ base && end && reloc_base == base && reloc_base_end == end) ++ { ++ reloc_section = section; ++ } ++ } ++ ++ if (section->characteristics && GRUB_PE32_SCN_MEM_DISCARDABLE) ++ continue; ++ ++ if (!base || !end) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid section size"); ++ goto error_exit; ++ } ++ ++ if (section->virtual_address < context.size_of_headers || ++ section->raw_data_offset < context.size_of_headers) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, ++ "Section %d is inside image headers", i); ++ goto error_exit; ++ } ++ ++ if (section->raw_data_size > 0) ++ grub_memcpy (base, (grub_efi_uint8_t*)data + section->raw_data_offset, ++ size); ++ ++ if (size < section->virtual_size) ++ grub_memset (base + size, 0, section->virtual_size - size); ++ ++ grub_dprintf ("chain", "copied section %s\n", section->name); ++ } ++ ++ /* 5 == EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC */ ++ if (context.number_of_rva_and_sizes <= 5) ++ { ++ grub_dprintf ("chain", "image has no relocation entry\n"); ++ goto error_exit; ++ } ++ ++ if (context.reloc_dir->size && reloc_section) ++ { ++ /* run the relocation fixups */ ++ efi_status = relocate_coff (&context, reloc_section, data, ++ buffer_aligned); ++ ++ if (efi_status != GRUB_EFI_SUCCESS) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "relocation failed"); ++ goto error_exit; ++ } ++ } ++ ++ entry_point = image_address (buffer_aligned, context.image_size, ++ context.entry_point); ++ ++ if (!entry_point) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid entry point"); ++ goto error_exit; ++ } ++ ++ li = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (!li) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, "no loaded image available"); ++ goto error_exit; ++ } ++ ++ grub_memcpy (&li_bak, li, sizeof (grub_efi_loaded_image_t)); ++ li->image_base = buffer_aligned; ++ li->image_size = context.image_size; ++ li->load_options = cmdline; ++ li->load_options_size = cmdline_len; ++ li->file_path = grub_efi_get_media_file_path (file_path); ++ li->device_handle = dev_handle; ++ if (li->file_path) ++ { ++ grub_printf ("file path: "); ++ grub_efi_print_device_path (li->file_path); ++ } ++ else ++ { ++ grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching file path found"); ++ goto error_exit; ++ } ++ ++ efi_status = efi_call_2 (entry_point, grub_efi_image_handle, ++ grub_efi_system_table); ++ ++ grub_memcpy (li, &li_bak, sizeof (grub_efi_loaded_image_t)); ++ efi_status = efi_call_1 (b->free_pool, buffer); ++ ++ return 1; ++ ++error_exit: ++ if (buffer) ++ efi_call_1 (b->free_pool, buffer); ++ ++ return 0; ++} ++ ++static grub_err_t ++grub_secureboot_chainloader_unload (void) ++{ ++ grub_efi_boot_services_t *b; ++ ++ b = grub_efi_system_table->boot_services; ++ efi_call_2 (b->free_pages, address, pages); ++ grub_free (file_path); ++ grub_free (cmdline); ++ cmdline = 0; ++ file_path = 0; ++ dev_handle = 0; ++ ++ grub_dl_unref (my_mod); ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_secureboot_chainloader_boot (void) ++{ ++ handle_image ((void *)address, fsize); ++ grub_loader_unset (); ++ return grub_errno; ++} ++ + static grub_err_t + grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { + grub_file_t file = 0; +- grub_ssize_t size; + grub_efi_status_t status; + grub_efi_boot_services_t *b; + grub_device_t dev = 0; +@@ -200,7 +719,6 @@ grub_cmd_chainloader (grub_command_t cmd + grub_efi_loaded_image_t *loaded_image; + char *filename; + void *boot_image = 0; +- grub_efi_handle_t dev_handle = 0; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +@@ -212,9 +730,36 @@ grub_cmd_chainloader (grub_command_t cmd + address = 0; + image_handle = 0; + file_path = 0; ++ dev_handle = 0; + + b = grub_efi_system_table->boot_services; + ++ if (argc > 1) ++ { ++ int i; ++ grub_efi_char16_t *p16; ++ ++ for (i = 1, cmdline_len = 0; i < argc; i++) ++ cmdline_len += grub_strlen (argv[i]) + 1; ++ ++ cmdline_len *= sizeof (grub_efi_char16_t); ++ cmdline = p16 = grub_malloc (cmdline_len); ++ if (! cmdline) ++ goto fail; ++ ++ for (i = 1; i < argc; i++) ++ { ++ char *p8; ++ ++ p8 = argv[i]; ++ while (*p8) ++ *(p16++) = *(p8++); ++ ++ *(p16++) = ' '; ++ } ++ *(--p16) = 0; ++ } ++ + file = grub_file_open (filename); + if (! file) + goto fail; +@@ -263,14 +808,14 @@ grub_cmd_chainloader (grub_command_t cmd + grub_printf ("file path: "); + grub_efi_print_device_path (file_path); + +- size = grub_file_size (file); +- if (!size) ++ fsize = grub_file_size (file); ++ if (!fsize) + { + grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + filename); + goto fail; + } +- pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); ++ pages = (((grub_efi_uintn_t) fsize + ((1 << 12) - 1)) >> 12); + + status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES, + GRUB_EFI_LOADER_CODE, +@@ -284,7 +829,7 @@ grub_cmd_chainloader (grub_command_t cmd + } + + boot_image = (void *) ((grub_addr_t) address); +- if (grub_file_read (file, boot_image, size) != size) ++ if (grub_file_read (file, boot_image, fsize) != fsize) + { + if (grub_errno == GRUB_ERR_NONE) + grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +@@ -294,7 +839,7 @@ grub_cmd_chainloader (grub_command_t cmd + } + + #if defined (__i386__) || defined (__x86_64__) +- if (size >= (grub_ssize_t) sizeof (struct grub_macho_fat_header)) ++ if (fsize >= (grub_ssize_t) sizeof (struct grub_macho_fat_header)) + { + struct grub_macho_fat_header *head = boot_image; + if (head->magic +@@ -303,6 +848,14 @@ grub_cmd_chainloader (grub_command_t cmd + grub_uint32_t i; + struct grub_macho_fat_arch *archs + = (struct grub_macho_fat_arch *) (head + 1); ++ ++ if (grub_efi_secure_boot()) ++ { ++ grub_error (GRUB_ERR_BAD_OS, ++ "MACHO binaries are forbidden with Secure Boot"); ++ goto fail; ++ } ++ + for (i = 0; i < grub_cpu_to_le32 (head->nfat_arch); i++) + { + if (GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT (archs[i].cputype)) +@@ -317,21 +870,28 @@ grub_cmd_chainloader (grub_command_t cmd + > ~grub_cpu_to_le32 (archs[i].size) + || grub_cpu_to_le32 (archs[i].offset) + + grub_cpu_to_le32 (archs[i].size) +- > (grub_size_t) size) ++ > (grub_size_t) fsize) + { + grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + filename); + goto fail; + } + boot_image = (char *) boot_image + grub_cpu_to_le32 (archs[i].offset); +- size = grub_cpu_to_le32 (archs[i].size); ++ fsize = grub_cpu_to_le32 (archs[i].size); + } + } + #endif + ++ if (grub_linuxefi_secure_validate((void *)address, fsize)) ++ { ++ grub_file_close (file); ++ grub_loader_set (grub_secureboot_chainloader_boot, ++ grub_secureboot_chainloader_unload, 0); ++ return 0; ++ } ++ + status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path, +- boot_image, size, +- &image_handle); ++ boot_image, fsize, &image_handle); + if (status != GRUB_EFI_SUCCESS) + { + if (status == GRUB_EFI_OUT_OF_RESOURCES) +@@ -355,33 +915,10 @@ grub_cmd_chainloader (grub_command_t cmd + + grub_file_close (file); + +- if (argc > 1) ++ if (cmdline) + { +- int i, len; +- grub_efi_char16_t *p16; +- +- for (i = 1, len = 0; i < argc; i++) +- len += grub_strlen (argv[i]) + 1; +- +- len *= sizeof (grub_efi_char16_t); +- cmdline = p16 = grub_malloc (len); +- if (! cmdline) +- goto fail; +- +- for (i = 1; i < argc; i++) +- { +- char *p8; +- +- p8 = argv[i]; +- while (*p8) +- *(p16++) = *(p8++); +- +- *(p16++) = ' '; +- } +- *(--p16) = 0; +- + loaded_image->load_options = cmdline; +- loaded_image->load_options_size = len; ++ loaded_image->load_options_size = cmdline_len; + } + + grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); +@@ -400,6 +937,9 @@ grub_cmd_chainloader (grub_command_t cmd + if (address) + efi_call_2 (b->free_pages, address, pages); + ++ if (cmdline) ++ grub_free (cmdline); ++ + grub_dl_unref (my_mod); + + return grub_errno; +Index: b/include/grub/efi/pe32.h +=================================================================== +--- a/include/grub/efi/pe32.h ++++ b/include/grub/efi/pe32.h +@@ -212,7 +212,11 @@ struct grub_pe64_optional_header + struct grub_pe32_section_table + { + char name[8]; +- grub_uint32_t virtual_size; ++ union ++ { ++ grub_uint32_t physical_address; ++ grub_uint32_t virtual_size; ++ }; + grub_uint32_t virtual_address; + grub_uint32_t raw_data_size; + grub_uint32_t raw_data_offset; +@@ -263,6 +267,20 @@ struct grub_pe32_header + #endif + }; + ++struct grub_pe32_header_32 ++{ ++ char signature[GRUB_PE32_SIGNATURE_SIZE]; ++ struct grub_pe32_coff_header coff_header; ++ struct grub_pe32_optional_header optional_header; ++}; ++ ++struct grub_pe32_header_64 ++{ ++ char signature[GRUB_PE32_SIGNATURE_SIZE]; ++ struct grub_pe32_coff_header coff_header; ++ struct grub_pe64_optional_header optional_header; ++}; ++ + struct grub_pe32_fixup_block + { + grub_uint32_t page_rva; +Index: b/grub-core/Makefile.core.def +=================================================================== +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1708,6 +1708,7 @@ module = { + + module = { + name = linuxefi; ++ cflags = '-Wno-error=format= -Wno-error=cast-align -Wno-error=int-to-pointer-cast -Wno-error=pointer-to-int-cast -Wno-error=unused-parameter'; + efi = loader/i386/efi/linux.c; + efi = lib/cmdline.c; + efi = loader/efi/linux.c; +@@ -1717,7 +1718,9 @@ module = { + + module = { + name = chain; ++ cflags = '-Wno-error=format= -Wno-error=cast-align -Wno-error=int-to-pointer-cast -Wno-error=pointer-to-int-cast -Wno-error=unused-parameter'; + efi = loader/efi/chainloader.c; ++ efi = loader/efi/linux.c; + i386_pc = loader/i386/pc/chainloader.c; + i386_coreboot = loader/i386/coreboot/chainloader.c; + i386_coreboot = lib/LzmaDec.c; diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_debug.patch grub2-2.02~beta2/debian/patches/linuxefi_debug.patch --- grub2-2.02~beta2/debian/patches/linuxefi_debug.patch 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_debug.patch 2018-02-26 20:17:24.000000000 +0000 @@ -1,18 +1,19 @@ -From a8f1ec0423c5dc99485e2a2db538b2c89f9f415d Mon Sep 17 00:00:00 2001 +From 519c28e1053a5d5e398120a577384d5162b48c77 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 13 Jan 2014 12:13:18 +0000 Subject: Add more debugging to linuxefi Forwarded: no -Last-Update: 2013-01-29 +Last-Update: 2016-09-19 Patch-Name: linuxefi_debug.patch --- - grub-core/loader/i386/efi/linux.c | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) + grub-core/loader/efi/linux.c | 15 +++++++++++++-- + grub-core/loader/i386/efi/linux.c | 8 ++++++++ + 2 files changed, 21 insertions(+), 2 deletions(-) -diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index ebaf1db..2bf38fa 100644 +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -19,6 +19,7 @@ @@ -23,38 +24,7 @@ #include #include #include -@@ -54,15 +55,27 @@ 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 1; -+ } - -- 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; - } - -@@ -147,6 +160,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +@@ -114,6 +115,8 @@ grub_cmd_initrd (grub_command_t cmd __at goto fail; } @@ -63,16 +33,16 @@ params->ramdisk_size = size; params->ramdisk_image = (grub_uint32_t)(grub_addr_t) initrd_mem; -@@ -236,6 +251,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -201,6 +204,8 @@ grub_cmd_linux (grub_command_t cmd __att goto fail; } + grub_dprintf ("linuxefi", "params = %lx\n", (unsigned long) params); + - memset (params, 0, 16384); + grub_memset (params, 0, 16384); - if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) -@@ -279,6 +296,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + grub_memcpy (&lh, kernel, sizeof (lh)); +@@ -238,6 +243,9 @@ grub_cmd_linux (grub_command_t cmd __att goto fail; } @@ -82,12 +52,36 @@ grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); grub_create_loader_cmdline (argc, argv, linux_cmdline + sizeof (LINUX_IMAGE) - 1, -@@ -304,6 +324,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - goto fail; - } +Index: b/grub-core/loader/efi/linux.c +=================================================================== +--- a/grub-core/loader/efi/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -40,15 +40,26 @@ grub_linuxefi_secure_validate (void *dat + 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); + grub_dprintf ("secureboot", "shim_lock: %p\n", shim_lock); + if (!shim_lock) +- return 0; ++ { ++ grub_dprintf ("linuxefi", "shim not available\n"); ++ return 0; ++ } -+ grub_dprintf ("linuxefi", "kernel_mem = %lx\n", (unsigned long) kernel_mem); ++ grub_dprintf ("linuxefi", "Asking shim to verify kernel signature\n"); + status = shim_lock->verify(data, size); + grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", status); + if (status == GRUB_EFI_SUCCESS) +- return 1; ++ { ++ grub_dprintf ("linuxefi", "Kernel signature verification passed\n"); ++ return 1; ++ } + - if (grub_file_seek (file, start) == (grub_off_t) -1) - { - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ grub_dprintf ("linuxefi", "Kernel signature verification failed (0x%lx)\n", ++ (unsigned long) status); + + return -1; + } diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_fix_validation_race.patch grub2-2.02~beta2/debian/patches/linuxefi_fix_validation_race.patch --- grub2-2.02~beta2/debian/patches/linuxefi_fix_validation_race.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_fix_validation_race.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,89 @@ +From 93ff3333a3fbd26e07cd425166b7d7fb243f033f Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 14 Jul 2015 16:58:51 -0700 +Subject: [PATCH] Fix race in EFI validation + +--- + grub-core/loader/i386/efi/linux.c | 40 ++++++++------------------------------ + 1 file changed, 9 insertions(+), 31 deletions(-) + +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -154,7 +154,7 @@ grub_cmd_linux (grub_command_t cmd __att + grub_file_t file = 0; + struct linux_kernel_header lh; + grub_ssize_t len, start, filelen; +- void *kernel; ++ void *kernel = NULL; + + grub_dl_ref (my_mod); + +@@ -190,10 +190,6 @@ grub_cmd_linux (grub_command_t cmd __att + goto fail; + } + +- grub_file_seek (file, 0); +- +- grub_free(kernel); +- + params = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384)); + + if (! params) +@@ -204,13 +200,7 @@ grub_cmd_linux (grub_command_t cmd __att + + grub_memset (params, 0, 16384); + +- if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) +- { +- if (!grub_errno) +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +- argv[0]); +- goto fail; +- } ++ grub_memcpy (&lh, kernel, sizeof (lh)); + + if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + { +@@ -270,26 +260,11 @@ grub_cmd_linux (grub_command_t cmd __att + goto fail; + } + +- if (grub_file_seek (file, start) == (grub_off_t) -1) +- { +- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), +- argv[0]); +- goto fail; +- } +- +- 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 (kernel_mem, (char *)kernel + start, len); ++ grub_loader_set (grub_linuxefi_boot, grub_linuxefi_unload, 0); ++ loaded=1; + ++ lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; + grub_memcpy (params, &lh, 2 * 512); + + params->type_of_loader = 0x21; +@@ -299,6 +274,9 @@ grub_cmd_linux (grub_command_t cmd __att + if (file) + grub_file_close (file); + ++ if (kernel) ++ grub_free (kernel); ++ + if (grub_errno != GRUB_ERR_NONE) + { + grub_dl_unref (my_mod); diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_loaders_enforce_sb.patch grub2-2.02~beta2/debian/patches/linuxefi_loaders_enforce_sb.patch --- grub2-2.02~beta2/debian/patches/linuxefi_loaders_enforce_sb.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_loaders_enforce_sb.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,531 @@ +From e9ed48bb0a655886f26dfa5f4b8aa318513b7a51 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 6 Oct 2015 16:09:25 -0400 +Subject: [PATCH] Make any of the loaders that link in efi mode honor secure + boot. + +And in this case "honor" means "even if somebody does link this in, they +won't register commands if SB is enabled." + +Signed-off-by: Peter Jones +--- + grub-core/Makefile.am | 1 + + grub-core/Makefile.core.def | 1 + + grub-core/commands/iorw.c | 7 +++++ + grub-core/commands/memrw.c | 7 +++++ + grub-core/kern/dl.c | 1 + + grub-core/kern/efi/efi.c | 28 ------------------ + grub-core/kern/efi/sb.c | 58 ++++++++++++++++++++++++++++++++++++++ + grub-core/loader/efi/appleloader.c | 7 +++++ + grub-core/loader/efi/chainloader.c | 1 + + grub-core/loader/i386/bsd.c | 7 +++++ + grub-core/loader/i386/linux.c | 7 +++++ + grub-core/loader/i386/pc/linux.c | 7 +++++ + grub-core/loader/multiboot.c | 7 +++++ + grub-core/loader/xnu.c | 7 +++++ + include/grub/efi/efi.h | 1 - + include/grub/efi/sb.h | 29 +++++++++++++++++++ + include/grub/ia64/linux.h | 0 + include/grub/mips/linux.h | 0 + include/grub/powerpc/linux.h | 0 + include/grub/sparc64/linux.h | 0 + grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 1 + grub-core/commands/iorw.c | 7 ++++ + grub-core/commands/memrw.c | 7 ++++ + grub-core/kern/dl.c | 1 + grub-core/kern/efi/efi.c | 28 ----------------- + grub-core/kern/efi/sb.c | 58 +++++++++++++++++++++++++++++++++++++ + grub-core/loader/efi/appleloader.c | 7 ++++ + grub-core/loader/efi/chainloader.c | 1 + grub-core/loader/i386/bsd.c | 7 ++++ + grub-core/loader/i386/linux.c | 7 ++++ + grub-core/loader/i386/pc/linux.c | 7 ++++ + grub-core/loader/multiboot.c | 7 ++++ + grub-core/loader/xnu.c | 7 ++++ + include/grub/efi/efi.h | 1 + include/grub/efi/sb.h | 29 ++++++++++++++++++ + include/grub/powerpc/linux.h | 19 ++++++++++++ + 17 files changed, 166 insertions(+), 29 deletions(-) + create mode 100644 grub-core/kern/efi/sb.c + create mode 100644 include/grub/efi/sb.h + create mode 100644 include/grub/ia64/linux.h + create mode 100644 include/grub/mips/linux.h + create mode 100644 include/grub/powerpc/linux.h + create mode 100644 include/grub/sparc64/linux.h + +Index: b/grub-core/Makefile.am +=================================================================== +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -65,6 +65,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/inc + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h +Index: b/grub-core/Makefile.core.def +=================================================================== +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -173,6 +173,7 @@ kernel = { + efi = kern/efi/init.c; + efi = kern/efi/mm.c; + efi = term/efi/console.c; ++ common = kern/efi/sb.c; + + x86 = kern/i386/tsc.c; + +Index: b/grub-core/commands/iorw.c +=================================================================== +--- a/grub-core/commands/iorw.c ++++ b/grub-core/commands/iorw.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -118,6 +119,9 @@ grub_cmd_write (grub_command_t cmd, int + + GRUB_MOD_INIT(memrw) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_read_byte = + grub_register_extcmd ("inb", grub_cmd_read, 0, + N_("PORT"), N_("Read 8-bit value from PORT."), +@@ -146,6 +150,9 @@ GRUB_MOD_INIT(memrw) + + GRUB_MOD_FINI(memrw) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_extcmd (cmd_read_byte); + grub_unregister_extcmd (cmd_read_word); + grub_unregister_extcmd (cmd_read_dword); +Index: b/grub-core/commands/memrw.c +=================================================================== +--- a/grub-core/commands/memrw.c ++++ b/grub-core/commands/memrw.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -120,6 +121,9 @@ grub_cmd_write (grub_command_t cmd, int + + GRUB_MOD_INIT(memrw) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_read_byte = + grub_register_extcmd ("read_byte", grub_cmd_read, 0, + N_("ADDR"), N_("Read 8-bit value from ADDR."), +@@ -148,6 +152,9 @@ GRUB_MOD_INIT(memrw) + + GRUB_MOD_FINI(memrw) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_extcmd (cmd_read_byte); + grub_unregister_extcmd (cmd_read_word); + grub_unregister_extcmd (cmd_read_dword); +Index: b/grub-core/kern/dl.c +=================================================================== +--- a/grub-core/kern/dl.c ++++ b/grub-core/kern/dl.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + /* Platforms where modules are in a readonly area of memory. */ + #if defined(GRUB_MACHINE_QEMU) +Index: b/grub-core/kern/efi/sb.c +=================================================================== +--- /dev/null ++++ b/grub-core/kern/efi/sb.c +@@ -0,0 +1,58 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int ++grub_efi_secure_boot (void) ++{ ++#ifdef GRUB_MACHINE_EFI ++ 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; ++#else ++ return 0; ++#endif ++} +Index: b/grub-core/loader/efi/appleloader.c +=================================================================== +--- a/grub-core/loader/efi/appleloader.c ++++ b/grub-core/loader/efi/appleloader.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -227,6 +228,9 @@ static grub_command_t cmd; + + GRUB_MOD_INIT(appleloader) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd = grub_register_command ("appleloader", grub_cmd_appleloader, + N_("[OPTS]"), + /* TRANSLATORS: This command is used on EFI to +@@ -238,5 +242,8 @@ GRUB_MOD_INIT(appleloader) + + GRUB_MOD_FINI(appleloader) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_command (cmd); + } +Index: b/grub-core/loader/efi/chainloader.c +=================================================================== +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include + #include + #include +Index: b/grub-core/loader/i386/bsd.c +=================================================================== +--- a/grub-core/loader/i386/bsd.c ++++ b/grub-core/loader/i386/bsd.c +@@ -38,6 +38,7 @@ + #ifdef GRUB_MACHINE_PCBIOS + #include + #endif ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -2101,6 +2102,9 @@ static grub_command_t cmd_netbsd_module_ + + GRUB_MOD_INIT (bsd) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + /* Net and OpenBSD kernels are often compressed. */ + grub_dl_load ("gzio"); + +@@ -2140,6 +2144,9 @@ GRUB_MOD_INIT (bsd) + + GRUB_MOD_FINI (bsd) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_extcmd (cmd_freebsd); + grub_unregister_extcmd (cmd_openbsd); + grub_unregister_extcmd (cmd_netbsd); +Index: b/grub-core/loader/i386/linux.c +=================================================================== +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -1137,6 +1138,9 @@ static grub_command_t cmd_linux, cmd_ini + + GRUB_MOD_INIT(linux) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, N_("Load Linux.")); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, +@@ -1146,6 +1150,9 @@ GRUB_MOD_INIT(linux) + + GRUB_MOD_FINI(linux) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); + } +Index: b/grub-core/loader/i386/pc/linux.c +=================================================================== +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -469,6 +470,9 @@ static grub_command_t cmd_linux, cmd_ini + + GRUB_MOD_INIT(linux16) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_linux = + grub_register_command ("linux16", grub_cmd_linux, + 0, N_("Load Linux.")); +@@ -480,6 +484,9 @@ GRUB_MOD_INIT(linux16) + + GRUB_MOD_FINI(linux16) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); + } +Index: b/grub-core/loader/multiboot.c +=================================================================== +--- a/grub-core/loader/multiboot.c ++++ b/grub-core/loader/multiboot.c +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -383,6 +384,9 @@ static grub_command_t cmd_multiboot, cmd + + GRUB_MOD_INIT(multiboot) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_multiboot = + #ifdef GRUB_USE_MULTIBOOT2 + grub_register_command ("multiboot2", grub_cmd_multiboot, +@@ -403,6 +407,9 @@ GRUB_MOD_INIT(multiboot) + + GRUB_MOD_FINI(multiboot) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + grub_unregister_command (cmd_multiboot); + grub_unregister_command (cmd_module); + } +Index: b/grub-core/loader/xnu.c +=================================================================== +--- a/grub-core/loader/xnu.c ++++ b/grub-core/loader/xnu.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -1466,6 +1467,9 @@ static grub_extcmd_t cmd_splash; + + GRUB_MOD_INIT(xnu) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0, + N_("Load XNU image.")); + cmd_kernel64 = grub_register_command ("xnu_kernel64", grub_cmd_xnu_kernel64, +@@ -1506,6 +1510,9 @@ GRUB_MOD_INIT(xnu) + + GRUB_MOD_FINI(xnu) + { ++ if (grub_efi_secure_boot()) ++ return; ++ + #ifndef GRUB_MACHINE_EMU + grub_unregister_command (cmd_resume); + #endif +Index: b/include/grub/efi/efi.h +=================================================================== +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -72,7 +72,6 @@ EXPORT_FUNC (grub_efi_set_variable) (con + 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); +Index: b/include/grub/efi/sb.h +=================================================================== +--- /dev/null ++++ b/include/grub/efi/sb.h +@@ -0,0 +1,29 @@ ++/* sb.h - declare functions for EFI Secure Boot support */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#ifndef GRUB_EFI_SB_HEADER ++#define GRUB_EFI_SB_HEADER 1 ++ ++#include ++#include ++ ++/* Functions. */ ++int EXPORT_FUNC (grub_efi_secure_boot) (void); ++ ++#endif /* ! GRUB_EFI_SB_HEADER */ +Index: b/include/grub/powerpc/linux.h +=================================================================== +--- /dev/null ++++ b/include/grub/powerpc/linux.h +@@ -0,0 +1,19 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++/* sb.c (via dl.c) requires grub/cpu/linux.h */ +Index: b/grub-core/kern/efi/efi.c +=================================================================== +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -259,34 +259,6 @@ grub_efi_get_variable (const char *var, + 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 -Nru grub2-2.02~beta2/debian/patches/linuxefi_non_sb_fallback.patch grub2-2.02~beta2/debian/patches/linuxefi_non_sb_fallback.patch --- grub2-2.02~beta2/debian/patches/linuxefi_non_sb_fallback.patch 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_non_sb_fallback.patch 2018-02-26 20:17:23.000000000 +0000 @@ -1,4 +1,4 @@ -From bbee35754c088eca0ffada3ed7457a2fe674de69 Mon Sep 17 00:00:00 2001 +From e022bb4a1aef299debfbb9dbe85413303d71e77f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 13 Jan 2014 12:13:20 +0000 Subject: If running under UEFI secure boot, attempt to use linuxefi loader @@ -9,28 +9,28 @@ Patch-Name: linuxefi_non_sb_fallback.patch --- - grub-core/loader/i386/efi/linux.c | 2 +- - grub-core/loader/i386/linux.c | 43 +++++++++++++++++++++++++++++++++++++++ + grub-core/loader/i386/efi/linux.c | 2 - + grub-core/loader/i386/linux.c | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) -diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index f764f49..88e2d34 100644 +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c -@@ -234,7 +234,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - - if (! grub_linuxefi_secure_validate (kernel, filelen)) +@@ -192,7 +192,7 @@ grub_cmd_linux (grub_command_t cmd __att + rc = grub_linuxefi_secure_validate (kernel, filelen); + if (rc < 0) { - 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 31fb91e..2380642 100644 + +Index: b/grub-core/loader/i386/linux.c +=================================================================== --- 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; +@@ -77,6 +77,8 @@ static grub_size_t maximal_cmdline_size; static struct linux_kernel_params linux_params; static char *linux_cmdline; #ifdef GRUB_MACHINE_EFI @@ -39,7 +39,7 @@ static grub_efi_uintn_t efi_mmap_size; #else static const grub_size_t efi_mmap_size = 0; -@@ -690,6 +692,41 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -691,6 +693,41 @@ grub_cmd_linux (grub_command_t cmd __att grub_dl_ref (my_mod); @@ -81,7 +81,7 @@ if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -@@ -1052,6 +1089,12 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +@@ -1053,6 +1090,12 @@ grub_cmd_initrd (grub_command_t cmd __at grub_err_t err; struct grub_linux_initrd_context initrd_ctx; diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_re-enable_linux_cmd.patch grub2-2.02~beta2/debian/patches/linuxefi_re-enable_linux_cmd.patch --- grub2-2.02~beta2/debian/patches/linuxefi_re-enable_linux_cmd.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_re-enable_linux_cmd.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,37 @@ +From: Mathieu Trudel-Lapierre +Subject: Temporarily re-enable the generic linux loader + +We're currently relying on it and an automatic hand-off to linuxefi for EFI +booting; so we need the linux command to start to be able to do the hand-off +correctly. + +This is a temporary measure until we switch to calling linuxefi directly. + +--- + grub-core/loader/i386/linux.c | 6 ------ + 1 file changed, 6 deletions(-) + +Index: b/grub-core/loader/i386/linux.c +=================================================================== +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -1138,9 +1138,6 @@ static grub_command_t cmd_linux, cmd_ini + + GRUB_MOD_INIT(linux) + { +- if (grub_efi_secure_boot()) +- return; +- + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, N_("Load Linux.")); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, +@@ -1150,9 +1147,6 @@ GRUB_MOD_INIT(linux) + + GRUB_MOD_FINI(linux) + { +- if (grub_efi_secure_boot()) +- return; +- + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); + } diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_require_shim.patch grub2-2.02~beta2/debian/patches/linuxefi_require_shim.patch --- grub2-2.02~beta2/debian/patches/linuxefi_require_shim.patch 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_require_shim.patch 2018-02-26 20:17:24.000000000 +0000 @@ -1,4 +1,4 @@ -From f393f2edf39bc9fc12cd6e6dab6cd1e40b149ac2 Mon Sep 17 00:00:00 2001 +From 4224acc6c0fb2fdd86018b736fda19a7a21f3952 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 13 Jan 2014 12:13:19 +0000 Subject: Make linuxefi refuse to boot without shim @@ -14,7 +14,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 2bf38fa..f764f49 100644 +index 1995a50..ff29316 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -63,7 +63,7 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) diff -Nru grub2-2.02~beta2/debian/patches/linuxefi_rework_non-sb_cases.patch grub2-2.02~beta2/debian/patches/linuxefi_rework_non-sb_cases.patch --- grub2-2.02~beta2/debian/patches/linuxefi_rework_non-sb_cases.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/linuxefi_rework_non-sb_cases.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,378 @@ +From a741a53e352513787aadb6c933bf1e3bc1dbe83c Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 10 Jun 2016 14:06:15 -0400 +Subject: [PATCH] Rework even more of efi chainload so non-sb cases work right. + +This ensures that if shim protocol is not loaded, or is loaded but shim +is disabled, we will fall back to a correct load method for the efi +chain loader. + +Here's what I tested with this version: + +results expected actual +------------------------------------------------------------ +sb + enabled + shim + fedora success success +sb + enabled + shim + win success success +sb + enabled + grub + fedora fail fail +sb + enabled + grub + win fail fail + +sb + mokdisabled + shim + fedora success success +sb + mokdisabled + shim + win success success +sb + mokdisabled + grub + fedora fail fail +sb + mokdisabled + grub + win fail fail + +sb disabled + shim + fedora success success* +sb disabled + shim + win success success* +sb disabled + grub + fedora success success +sb disabled + grub + win success success + +nosb + shim + fedora success success* +nosb + shim + win success success* +nosb + grub + fedora success success +nosb + grub + win success success + +* for some reason shim protocol is being installed in these cases, and I + can't see why, but I think it may be this firmware build returning an + erroneous value. But this effectively falls back to the mokdisabled + behavior, which works correctly, and the presence of the "grub" (i.e. + no shim) tests effectively tests the desired behavior here. + +Resolves: rhbz#1344512 + +Signed-off-by: Peter Jones +--- + grub-core/kern/efi/sb.c | 14 +++- + grub-core/loader/arm64/linux.c | 4 - + grub-core/loader/efi/chainloader.c | 117 ++++++++++++++++++++++--------------- + grub-core/loader/efi/linux.c | 13 ++-- + grub-core/loader/i386/efi/linux.c | 7 +- + include/grub/efi/linux.h | 2 + 6 files changed, 98 insertions(+), 59 deletions(-) + +Index: b/grub-core/kern/efi/sb.c +=================================================================== +--- a/grub-core/kern/efi/sb.c ++++ b/grub-core/kern/efi/sb.c +@@ -36,14 +36,20 @@ grub_efi_secure_boot (void) + grub_efi_boolean_t ret = 0; + + secure_boot = grub_efi_get_variable("SecureBoot", &efi_var_guid, &datasize); +- + if (datasize != 1 || !secure_boot) +- goto out; ++ { ++ grub_dprintf ("secureboot", "No SecureBoot variable\n"); ++ goto out; ++ } ++ grub_dprintf ("secureboot", "SecureBoot: %d\n", *secure_boot); + + setup_mode = grub_efi_get_variable("SetupMode", &efi_var_guid, &datasize); +- + if (datasize != 1 || !setup_mode) +- goto out; ++ { ++ grub_dprintf ("secureboot", "No SetupMode variable\n"); ++ goto out; ++ } ++ grub_dprintf ("secureboot", "SetupMode: %d\n", *setup_mode); + + if (*secure_boot && !*setup_mode) + ret = 1; +Index: b/grub-core/loader/arm64/linux.c +=================================================================== +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -253,6 +253,7 @@ grub_cmd_linux (grub_command_t cmd __att + grub_file_t file = 0; + struct grub_arm64_linux_kernel_header lh; + struct grub_arm64_linux_pe_header *pe; ++ int rc; + + grub_dl_ref (my_mod); + +@@ -297,7 +298,8 @@ grub_cmd_linux (grub_command_t cmd __att + + grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); + +- if (!grub_linuxefi_secure_validate (kernel_addr, kernel_size)) ++ rc = grub_linuxefi_secure_validate (kernel_addr, kernel_size); ++ if (rc < 0) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); + goto fail; +Index: b/grub-core/loader/efi/chainloader.c +=================================================================== +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -178,7 +178,6 @@ make_file_path (grub_efi_device_path_t * + /* Fill the file path for the directory. */ + d = (grub_efi_device_path_t *) ((char *) file_path + + ((char *) d - (char *) dp)); +- grub_efi_print_device_path (d); + copy_file_path ((grub_efi_file_path_device_path_t *) d, + dir_start, dir_end - dir_start); + +@@ -248,10 +247,9 @@ read_header (void *data, grub_efi_uint32 + grub_efi_status_t status; + + shim_lock = grub_efi_locate_protocol (&guid, NULL); +- + if (!shim_lock) + { +- grub_error (GRUB_ERR_BAD_ARGUMENT, "no shim lock protocol"); ++ grub_dprintf ("chain", "no shim lock protocol"); + return 0; + } + +@@ -276,7 +274,7 @@ read_header (void *data, grub_efi_uint32 + break; + } + +- return 0; ++ return -1; + } + + static void* +@@ -510,17 +508,24 @@ handle_image (void *data, grub_efi_uint3 + grub_uint32_t section_alignment; + grub_uint32_t buffer_size; + int found_entry_point = 0; ++ int rc; + + b = grub_efi_system_table->boot_services; + +- if (read_header (data, datasize, &context)) ++ rc = read_header (data, datasize, &context); ++ if (rc < 0) + { +- grub_dprintf ("chain", "Succeed to read header\n"); ++ grub_dprintf ("chain", "Failed to read header\n"); ++ goto error_exit; ++ } ++ else if (rc == 0) ++ { ++ grub_dprintf ("chain", "Secure Boot is not enabled\n"); ++ return 0; + } + else + { +- grub_dprintf ("chain", "Failed to read header\n"); +- goto error_exit; ++ grub_dprintf ("chain", "Header read without error\n"); + } + + /* +@@ -793,9 +798,55 @@ grub_secureboot_chainloader_unload (void + } + + static grub_err_t ++grub_load_and_start_image(void *boot_image) ++{ ++ grub_efi_boot_services_t *b; ++ grub_efi_status_t status; ++ grub_efi_loaded_image_t *loaded_image; ++ ++ b = grub_efi_system_table->boot_services; ++ ++ status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path, ++ boot_image, fsize, &image_handle); ++ if (status != GRUB_EFI_SUCCESS) ++ { ++ if (status == GRUB_EFI_OUT_OF_RESOURCES) ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources"); ++ else ++ grub_error (GRUB_ERR_BAD_OS, "cannot load image"); ++ return -1; ++ } ++ ++ /* LoadImage does not set a device handler when the image is ++ loaded from memory, so it is necessary to set it explicitly here. ++ This is a mess. */ ++ loaded_image = grub_efi_get_loaded_image (image_handle); ++ if (! loaded_image) ++ { ++ grub_error (GRUB_ERR_BAD_OS, "no loaded image available"); ++ return -1; ++ } ++ loaded_image->device_handle = dev_handle; ++ ++ if (cmdline) ++ { ++ loaded_image->load_options = cmdline; ++ loaded_image->load_options_size = cmdline_len; ++ } ++ ++ return 0; ++} ++ ++static grub_err_t + grub_secureboot_chainloader_boot (void) + { +- handle_image ((void *)address, fsize); ++ int rc; ++ rc = handle_image ((void *)address, fsize); ++ if (rc == 0) ++ { ++ grub_load_and_start_image((void *)address); ++ } ++ + grub_loader_unset (); + return grub_errno; + } +@@ -809,9 +860,9 @@ grub_cmd_chainloader (grub_command_t cmd + grub_efi_boot_services_t *b; + grub_device_t dev = 0; + grub_efi_device_path_t *dp = 0; +- grub_efi_loaded_image_t *loaded_image; + char *filename; + void *boot_image = 0; ++ int rc; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +@@ -898,9 +949,6 @@ grub_cmd_chainloader (grub_command_t cmd + if (! file_path) + goto fail; + +- grub_printf ("file path: "); +- grub_efi_print_device_path (file_path); +- + fsize = grub_file_size (file); + if (!fsize) + { +@@ -975,50 +1023,27 @@ grub_cmd_chainloader (grub_command_t cmd + } + #endif + +- if (grub_linuxefi_secure_validate((void *)address, fsize)) ++ rc = grub_linuxefi_secure_validate((void *)(grub_addr_t)address, fsize); ++ grub_dprintf ("chain", "linuxefi_secure_validate: %d\n", rc); ++ if (rc > 0) + { + grub_file_close (file); + grub_loader_set (grub_secureboot_chainloader_boot, + grub_secureboot_chainloader_unload, 0); + return 0; + } +- +- status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path, +- boot_image, fsize, &image_handle); +- if (status != GRUB_EFI_SUCCESS) ++ else if (rc == 0) + { +- if (status == GRUB_EFI_OUT_OF_RESOURCES) +- grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources"); +- else +- grub_error (GRUB_ERR_BAD_OS, "cannot load image"); +- +- goto fail; +- } +- +- /* LoadImage does not set a device handler when the image is +- loaded from memory, so it is necessary to set it explicitly here. +- This is a mess. */ +- loaded_image = grub_efi_get_loaded_image (image_handle); +- if (! loaded_image) +- { +- grub_error (GRUB_ERR_BAD_OS, "no loaded image available"); +- goto fail; ++ grub_load_and_start_image(boot_image); ++ grub_file_close (file); ++ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); ++ return 0; + } +- loaded_image->device_handle = dev_handle; + + grub_file_close (file); ++ grub_device_close (dev); + +- if (cmdline) +- { +- loaded_image->load_options = cmdline; +- loaded_image->load_options_size = cmdline_len; +- } +- +- grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); +- return 0; +- +- fail: +- ++fail: + if (dev) + grub_device_close (dev); + +Index: b/grub-core/loader/efi/linux.c +=================================================================== +--- a/grub-core/loader/efi/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -33,21 +33,24 @@ struct grub_efi_shim_lock + }; + typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; + +-grub_efi_boolean_t ++int + grub_linuxefi_secure_validate (void *data, grub_uint32_t size) + { + grub_efi_guid_t guid = SHIM_LOCK_GUID; + grub_efi_shim_lock_t *shim_lock; ++ grub_efi_status_t status; + + shim_lock = grub_efi_locate_protocol(&guid, NULL); +- ++ grub_dprintf ("secureboot", "shim_lock: %p\n", shim_lock); + if (!shim_lock) +- return 1; ++ return 0; + +- if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS) ++ status = shim_lock->verify(data, size); ++ grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", status); ++ if (status == GRUB_EFI_SUCCESS) + return 1; + +- return 0; ++ return -1; + } + + typedef void (*handover_func) (void *, grub_efi_system_table_t *, void *); +Index: b/grub-core/loader/i386/efi/linux.c +=================================================================== +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -155,6 +155,7 @@ grub_cmd_linux (grub_command_t cmd __att + struct linux_kernel_header lh; + grub_ssize_t len, start, filelen; + void *kernel = NULL; ++ int rc; + + grub_dl_ref (my_mod); + +@@ -180,11 +181,13 @@ grub_cmd_linux (grub_command_t cmd __att + + if (grub_file_read (file, kernel, filelen) != filelen) + { +- grub_error (GRUB_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), argv[0]); ++ grub_error (GRUB_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), ++ argv[0]); + goto fail; + } + +- if (! grub_linuxefi_secure_validate (kernel, filelen)) ++ rc = grub_linuxefi_secure_validate (kernel, filelen); ++ if (rc < 0) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); + goto fail; +Index: b/include/grub/efi/linux.h +=================================================================== +--- a/include/grub/efi/linux.h ++++ b/include/grub/efi/linux.h +@@ -22,7 +22,7 @@ + #include + #include + +-grub_efi_boolean_t ++int + EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); + grub_err_t + EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, diff -Nru grub2-2.02~beta2/debian/patches/misc-fix-invalid-char-strtol.patch grub2-2.02~beta2/debian/patches/misc-fix-invalid-char-strtol.patch --- grub2-2.02~beta2/debian/patches/misc-fix-invalid-char-strtol.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/misc-fix-invalid-char-strtol.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,31 @@ +From: Michael Chang +From: Aaron Miller +Subject: [PATCH 1/8] misc: fix invalid character recongition in strto*l + +Would previously allow digits larger than the base and didn't check that +subtracting the difference from 0-9 to lowercase letters for characters +larger than 9 didn't result in a value lower than 9, which allowed the +parses: ` = 9, _ = 8, ^ = 7, ] = 6, \ = 5, and [ = 4 +--- + grub-core/kern/misc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: b/grub-core/kern/misc.c +=================================================================== +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -423,9 +423,13 @@ grub_strtoull (const char *str, char **e + if (digit > 9) + { + digit += '0' - 'a' + 10; +- if (digit >= (unsigned long) base) ++ /* digit <= 9 check is needed to keep chars larger than ++ '9' but less than 'a' from being read as numbers */ ++ if (digit >= (unsigned long) base || digit <= 9) + break; + } ++ if (digit >= (unsigned long) base) ++ break; + + found = 1; + diff -Nru grub2-2.02~beta2/debian/patches/net_add_grub_env_set_net_property.patch grub2-2.02~beta2/debian/patches/net_add_grub_env_set_net_property.patch --- grub2-2.02~beta2/debian/patches/net_add_grub_env_set_net_property.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/net_add_grub_env_set_net_property.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,179 @@ +From e4dbf247b656eb9577020af653ff37159fc340f2 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Tue, 4 Feb 2014 18:41:38 -0200 +Subject: add grub_env_set_net_property function + +* grub-core/net/bootp.c: Remove set_env_limn_ro. +* grub-core/net/net.c: Add grub_env_set_net_property. +* include/grub/net.h: Likewise. +--- + grub-core/net/bootp.c | 63 ++++++++++++-------------------------------------- + grub-core/net/net.c | 38 ++++++++++++++++++++++++++++++ + include/grub/net.h | 4 +++ + 3 files changed, 58 insertions(+), 47 deletions(-) + +Index: b/grub-core/net/bootp.c +=================================================================== +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -25,41 +25,6 @@ + #include + #include + +-static char * +-grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), +- const char *val __attribute__ ((unused))) +-{ +- return NULL; +-} +- +-static void +-set_env_limn_ro (const char *intername, const char *suffix, +- const char *value, grub_size_t len) +-{ +- char *varname, *varvalue; +- char *ptr; +- varname = grub_xasprintf ("net_%s_%s", intername, suffix); +- if (!varname) +- return; +- for (ptr = varname; *ptr; ptr++) +- if (*ptr == ':') +- *ptr = '_'; +- varvalue = grub_malloc (len + 1); +- if (!varvalue) +- { +- grub_free (varname); +- return; +- } +- +- grub_memcpy (varvalue, value, len); +- varvalue[len] = 0; +- grub_env_set (varname, varvalue); +- grub_register_variable_hook (varname, 0, grub_env_write_readonly); +- grub_env_export (varname); +- grub_free (varname); +- grub_free (varvalue); +-} +- + static void + parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) + { +@@ -136,20 +101,24 @@ parse_dhcp_vendor (const char *name, con + } + continue; + case GRUB_NET_BOOTP_HOSTNAME: +- set_env_limn_ro (name, "hostname", (const char *) ptr, taglength); +- break; ++ grub_env_set_net_property (name, "hostname", (const char *) ptr, ++ taglength); ++ break; + + case GRUB_NET_BOOTP_DOMAIN: +- set_env_limn_ro (name, "domain", (const char *) ptr, taglength); +- break; ++ grub_env_set_net_property (name, "domain", (const char *) ptr, ++ taglength); ++ break; + + case GRUB_NET_BOOTP_ROOT_PATH: +- set_env_limn_ro (name, "rootpath", (const char *) ptr, taglength); +- break; ++ grub_env_set_net_property (name, "rootpath", (const char *) ptr, ++ taglength); ++ break; + + case GRUB_NET_BOOTP_EXTENSIONS_PATH: +- set_env_limn_ro (name, "extensionspath", (const char *) ptr, taglength); +- break; ++ grub_env_set_net_property (name, "extensionspath", (const char *) ptr, ++ taglength); ++ break; + + /* If you need any other options please contact GRUB + development team. */ +@@ -211,8 +180,8 @@ grub_net_configure_by_dhcp_ack (const ch + } + + if (size > OFFSET_OF (boot_file, bp)) +- set_env_limn_ro (name, "boot_file", (char *) bp->boot_file, +- sizeof (bp->boot_file)); ++ grub_env_set_net_property (name, "boot_file", bp->boot_file, ++ sizeof (bp->boot_file)); + if (is_def) + grub_net_default_server = 0; + if (is_def && !grub_net_default_server && bp->server_ip) +@@ -243,8 +212,8 @@ grub_net_configure_by_dhcp_ack (const ch + if (size > OFFSET_OF (server_name, bp) + && bp->server_name[0]) + { +- set_env_limn_ro (name, "dhcp_server_name", (char *) bp->server_name, +- sizeof (bp->server_name)); ++ grub_env_set_net_property (name, "dhcp_server_name", bp->server_name, ++ sizeof (bp->server_name)); + if (is_def && !grub_net_default_server) + { + grub_net_default_server = grub_strdup (bp->server_name); +Index: b/grub-core/net/net.c +=================================================================== +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -1470,6 +1470,44 @@ receive_packets (struct grub_net_card *c + grub_print_error (); + } + ++static char * ++grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), ++ const char *val __attribute__ ((unused))) ++{ ++ return NULL; ++} ++ ++grub_err_t ++grub_env_set_net_property (const char *intername, const char *suffix, ++ const char *value, grub_size_t len) ++{ ++ char *varname, *varvalue; ++ char *ptr; ++ ++ varname = grub_xasprintf ("net_%s_%s", intername, suffix); ++ if (!varname) ++ return grub_errno; ++ for (ptr = varname; *ptr; ptr++) ++ if (*ptr == ':') ++ *ptr = '_'; ++ varvalue = grub_malloc (len + 1); ++ if (!varvalue) ++ { ++ grub_free (varname); ++ return grub_errno; ++ } ++ ++ grub_memcpy (varvalue, value, len); ++ varvalue[len] = 0; ++ grub_err_t ret = grub_env_set (varname, varvalue); ++ grub_register_variable_hook (varname, 0, grub_env_write_readonly); ++ grub_env_export (varname); ++ grub_free (varname); ++ grub_free (varvalue); ++ ++ return ret; ++} ++ + void + grub_net_poll_cards (unsigned time, int *stop_condition) + { +Index: b/include/grub/net.h +=================================================================== +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -503,6 +503,10 @@ grub_net_addr_to_str (const grub_net_net + void + grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str); + ++grub_err_t ++grub_env_set_net_property (const char *intername, const char *suffix, ++ const char *value, grub_size_t len); ++ + void + grub_net_poll_cards (unsigned time, int *stop_condition); + diff -Nru grub2-2.02~beta2/debian/patches/net_read_bracketed_ipv6_addr.patch grub2-2.02~beta2/debian/patches/net_read_bracketed_ipv6_addr.patch --- grub2-2.02~beta2/debian/patches/net_read_bracketed_ipv6_addr.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/net_read_bracketed_ipv6_addr.patch 2018-02-26 20:17:24.000000000 +0000 @@ -0,0 +1,248 @@ +From: Michael Chang +From: Aaron Miller +Subject: [PATCH 2/8] 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 +--- + grub-core/net/http.c | 21 ++++++++++-- + grub-core/net/net.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++--- + grub-core/net/tftp.c | 6 ++- + include/grub/net.h | 1 + 4 files changed, 105 insertions(+), 9 deletions(-) + +Index: b/grub-core/net/http.c +=================================================================== +--- a/grub-core/net/http.c ++++ b/grub-core/net/http.c +@@ -312,12 +312,14 @@ http_establish (struct grub_file *file, + 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, + 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_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") +@@ -391,8 +402,10 @@ http_establish (struct grub_file *file, + 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) +Index: b/grub-core/net/net.c +=================================================================== +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -437,6 +437,12 @@ parse_ip6 (const char *val, grub_uint64_ + 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_ + 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,11 +1385,10 @@ grub_net_open_real (const char *name) + { + grub_net_t ret = grub_zalloc (sizeof (*ret)); + if (!ret) +- return NULL; +- ret->protocol = proto; +- if (server) ++ grub_free (host); ++ if (host) + { +- ret->server = grub_strdup (server); ++ ret->server = grub_strdup (host); + if (!ret->server) + { + grub_free (ret); +@@ -1321,6 +1397,8 @@ grub_net_open_real (const char *name) + } + else + ret->server = NULL; ++ ret->protocol = proto; ++ ret->port = port; + ret->fs = &grub_net_fs; + ret->offset = 0; + ret->eof = 0; +Index: b/grub-core/net/tftp.c +=================================================================== +--- a/grub-core/net/tftp.c ++++ b/grub-core/net/tftp.c +@@ -314,6 +314,7 @@ tftp_open (struct grub_file *file, const + 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) +@@ -373,12 +374,15 @@ tftp_open (struct grub_file *file, const + 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); + 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) + { +Index: b/include/grub/net.h +=================================================================== +--- 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; diff -Nru grub2-2.02~beta2/debian/patches/series grub2-2.02~beta2/debian/patches/series --- grub2-2.02~beta2/debian/patches/series 2016-01-22 11:00:23.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/series 2018-02-26 20:17:23.000000000 +0000 @@ -21,8 +21,16 @@ uefi_firmware_setup.patch mkconfig_ubuntu_distributor.patch linuxefi.patch +linuxefi_backport_arm64.patch +linuxefi_arm_sb_support.patch +linuxefi_fix_validation_race.patch +linuxefi_chainloader_path.patch +linuxefi_chainloader_sb.patch +linuxefi_loaders_enforce_sb.patch +linuxefi_re-enable_linux_cmd.patch +linuxefi_chainloader_pe_fixes.patch +linuxefi_rework_non-sb_cases.patch linuxefi_debug.patch -linuxefi_require_shim.patch linuxefi_non_sb_fallback.patch mkconfig_signed_kernel.patch install_signed.patch @@ -72,7 +80,6 @@ fix_diskfilter_lv_name_dblfree.patch fix_disk-module_option_handling.patch ppc64el-avoid_unnecessary_optimizations.patch -arm64-set-correct-length-of-device-path-end-entry.patch progress_avoid_null_deref.patch arm64-setjmp-Add-missing-license-macro.patch xfs-fix-directory-iteration.patch @@ -97,3 +104,27 @@ zfs-zap-lookup-truncation.patch zfs-extensible-dataset-large-blocks.patch 0099-Work-around-unsupported-relocations-on-arm64.patch +arm-efi-Reduce-timer-event-frequency-by-10.patch +ip6_send_router_solicitation_7c4b6b7b.patch +ip6_fix_routing_eb9f401f.patch +misc-fix-invalid-char-strtol.patch +net_add_grub_env_set_net_property.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 +git_tsc_use_alt_delay_sources_d43a5ee6.patch +git_split_pmtimer_wait_tsc_d9a3bfea.patch +git_fix_tsc_calibration_pit_a03c1034.patch +support_initrd-less_boot.patch +git_pmem_really_mark_mem_reserved_3d2c8048.patch +git_pmem_translate_persistent_type_76ce1de7.patch +git_pmem_mmap_handle_pmem_c79c59f1.patch +git_pmem_efiemu_handle_pmem_ae3b83a4.patch +Fix-exit-to-EFI-firmware.patch +tsc_efi_default_to_pmtimer.patch +Use-EFI_SIMPLE_TEXT_INPUT_EX-to-support-key-combinat.patch +efi-fix-warnings-with-recent-GCC.patch +zpool_full_device_name.patch diff -Nru grub2-2.02~beta2/debian/patches/support_initrd-less_boot.patch grub2-2.02~beta2/debian/patches/support_initrd-less_boot.patch --- grub2-2.02~beta2/debian/patches/support_initrd-less_boot.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/support_initrd-less_boot.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,82 @@ +From 2ab7163936ead20f940be9bd7a9ad3280b8367d9 Mon Sep 17 00:00:00 2001 +From: Chris Glass +Date: Thu, 10 Nov 2016 13:44:25 -0500 +Subject: Added knobs to allow non-initrd boot config + +Added GRUB_FORCE_PARTUUID and GRUB_DISABLE_INITRD configuration knobs to allow +users to generate grub menu entries that boot directly to the kernel, without +using an initramfs. + +Signed-off-by: Mathieu Trudel-Lapierre + +Patch-Name: support_initrd-less_boot.patch +--- + docs/grub.texi | 13 +++++++++++++ + util/grub-mkconfig.in | 4 +++- + util/grub.d/10_linux.in | 12 +++++++++--- + 3 files changed, 25 insertions(+), 4 deletions(-) + +Index: b/docs/grub.texi +=================================================================== +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1509,6 +1509,19 @@ This option sets the English text of the + parentheses to indicate that a boot option is provided to help users recover + a broken system. The default is "recovery mode". + ++@item GRUB_FORCE_PARTUUID ++This option forces the root disk entry to be the specified PARTUUID instead ++of whatever would be used instead. This is useful when you control the ++partitioning of the disk but cannot guarantee what the actual hardware ++will be, for example in virtual machine images. ++Setting this option to @samp{12345678-01} will produce: ++root=PARTUUID=12345678-01 ++ ++@item GRUB_DISABLE_INITRD ++Then set to @samp{true}, this option prevents an initrd to be used at boot ++time, regardless of whether one is detected or not. @command{grub-mkconfig} ++will therefore not generate any initrd lines. ++ + @end table + + The following options are still accepted for compatibility with existing +Index: b/util/grub-mkconfig.in +=================================================================== +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -242,7 +242,9 @@ export GRUB_DEFAULT \ + GRUB_OS_PROBER_SKIP_LIST \ + GRUB_DISABLE_SUBMENU \ + GRUB_RECORDFAIL_TIMEOUT \ +- GRUB_RECOVERY_TITLE ++ GRUB_RECOVERY_TITLE \ ++ GRUB_FORCE_PARTUUID \ ++ GRUB_DISABLE_INITRD + + if test "x${grub_cfg}" != "x"; then + rm -f "${grub_cfg}.new" +Index: b/util/grub.d/10_linux.in +=================================================================== +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -177,11 +177,17 @@ 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} ++ if [ x"$GRUB_FORCE_PARTUUID" = x ]; then ++ sed "s/^/$submenu_indentation/" << EOF ++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + EOF ++ else ++ sed "s/^/$submenu_indentation/" << EOF ++ linux ${rel_dirname}/${basename} root=PARTUUID=${GRUB_FORCE_PARTUUID} ro ${args} ++EOF ++ fi + fi +- if test -n "${initrd}" ; then ++ if test -n "${initrd}" && [ x"$GRUB_DISABLE_INITRD" != xtrue ]; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" diff -Nru grub2-2.02~beta2/debian/patches/tsc_efi_default_to_pmtimer.patch grub2-2.02~beta2/debian/patches/tsc_efi_default_to_pmtimer.patch --- grub2-2.02~beta2/debian/patches/tsc_efi_default_to_pmtimer.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/tsc_efi_default_to_pmtimer.patch 2018-02-26 20:17:23.000000000 +0000 @@ -0,0 +1,34 @@ +From 70cd87708379d65593dfa1dd976479a9ea64791f Mon Sep 17 00:00:00 2001 +From: "David E. Box" +Date: Fri, 15 Sep 2017 15:37:05 -0700 +Subject: tsc: Change default tsc calibration method to pmtimer on EFI systems + +On efi systems, make pmtimer based tsc calibration the default over the +pit. This prevents Grub from hanging on Intel SoC systems that power gate +the pit. + +Signed-off-by: David E. Box +Reviewed-by: Daniel Kiper + +Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=446794de8da4329ea532cbee4ca877bcafd0e534 +Bug-Debian: https://bugs.debian.org/883193 +Last-Update: 2017-12-01 + +Patch-Name: tsc_efi_default_to_pmtimer.patch +--- + grub-core/kern/i386/tsc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: b/grub-core/kern/i386/tsc.c +=================================================================== +--- a/grub-core/kern/i386/tsc.c ++++ b/grub-core/kern/i386/tsc.c +@@ -84,7 +84,7 @@ grub_tsc_init (void) + #ifdef GRUB_MACHINE_XEN + (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); + #elif defined (GRUB_MACHINE_EFI) +- (void) (grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); ++ (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); + #elif defined (GRUB_MACHINE_COREBOOT) + (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); + #else diff -Nru grub2-2.02~beta2/debian/patches/zpool_full_device_name.patch grub2-2.02~beta2/debian/patches/zpool_full_device_name.patch --- grub2-2.02~beta2/debian/patches/zpool_full_device_name.patch 1970-01-01 00:00:00.000000000 +0000 +++ grub2-2.02~beta2/debian/patches/zpool_full_device_name.patch 2018-01-24 21:21:35.000000000 +0000 @@ -0,0 +1,31 @@ +From 4a35328805da7f65dd96405c8c2247b71156c0a4 Mon Sep 17 00:00:00 2001 +From: Chad MILLER +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(+) + +--- a/grub-core/osdep/unix/getroot.c ++++ b/grub-core/osdep/unix/getroot.c +@@ -243,6 +243,7 @@ grub_util_find_root_devices_from_poolnam + argv[2] = poolname; + argv[3] = NULL; + ++ setenv ("ZPOOL_VDEV_NAME_PATH", "YES", 1); + pid = grub_util_exec_pipe (argv, &fd); + if (!pid) + return NULL; diff -Nru grub2-2.02~beta2/debian/po/ar.po grub2-2.02~beta2/debian/po/ar.po --- grub2-2.02~beta2/debian/po/ar.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ar.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub.ar\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2010-07-16 02:38+0300\n" "Last-Translator: Ossama M. Khayat \n" "Language-Team: Arabic \n" @@ -362,15 +362,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "سطر أوامر KFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 #, fuzzy #| msgid "" #| "The following kFreeBSD command line was extracted from /etc/default/grub " @@ -387,13 +404,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "سطر أوامر KFreeBSD الافتراضي:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -403,13 +420,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "تم إعادة إنشاء /boot/grub/device.map" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -421,7 +438,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 #, fuzzy #| msgid "" #| "However, since you have more than one disk in your system, it is possible " @@ -441,7 +458,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 #, fuzzy #| msgid "" #| "If you do not understand this message, or if you do not have any custom " diff -Nru grub2-2.02~beta2/debian/po/ast.po grub2-2.02~beta2/debian/po/ast.po --- grub2-2.02~beta2/debian/po/ast.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ast.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-01-27 11:10+0100\n" "Last-Translator: Mikel González \n" "Language-Team: Asturian \n" @@ -349,15 +349,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Linia comandos kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -369,13 +386,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Llínia comandos por defeutu kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -385,13 +402,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map foi xeneráu" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -404,7 +421,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -418,7 +435,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/be.po grub2-2.02~beta2/debian/po/be.po --- grub2-2.02~beta2/debian/po/be.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/be.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: be\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-15 05:50+0300\n" "Last-Translator: Viktar Siarheichyk \n" "Language-Team: Debian l10n team for Belarusian \n" "Language-Team: Български \n" @@ -361,15 +361,32 @@ "път. В такъв случай трябва да се уверите, че GRUB е настроен да зарежда " "другите операционни системи." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Команден ред за kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -381,13 +398,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Параметри на Линукс по подразбиране:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -397,13 +414,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map е създаден наново" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -416,7 +433,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -430,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ca.po grub2-2.02~beta2/debian/po/ca.po --- grub2-2.02~beta2/debian/po/ca.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ca.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2 1.99-5\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2011-05-30 22:57+0200\n" "Last-Translator: Jordi Mallach \n" "Language-Team: Catalan \n" @@ -355,15 +355,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Línia d'ordres de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -376,13 +393,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Línia d'ordres de kFreeBSD per defecte:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -392,13 +409,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "S'ha regenerat el fitxer «/boot/grub/device.map»" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -411,7 +428,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -425,7 +442,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/cs.po grub2-2.02~beta2/debian/po/cs.po --- grub2-2.02~beta2/debian/po/cs.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/cs.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-21 10:32+0100\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -347,21 +347,38 @@ msgstr "" "Některé systémy používající EFI obsahují chyby a neumí správně pracovat s " "novými zavaděči. Vynutíte-li další instalaci GRUBu do EFI cesty pro výměnná, " -"média, mělo by to zajistit, že se na tomto systému bude Debian zavádět " -"i přes zmíněné chyby. Tím však můžete přijít o možnost zavádění jiných " +"média, mělo by to zajistit, že se na tomto systému bude Debian zavádět i " +"přes zmíněné chyby. Tím však můžete přijít o možnost zavádění jiných " "operačních systémů, které na této cestě také závisí. V takovém případě si " "budete muset pohlídat nastavení GRUBu, aby zvládlo zavést ostatní operační " "systémy." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Parametry pro kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -374,13 +391,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Výchozí parametry pro kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -390,13 +407,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map byl aktualizován" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -409,7 +426,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -423,7 +440,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/cy.po grub2-2.02~beta2/debian/po/cy.po --- grub2-2.02~beta2/debian/po/cy.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/cy.po 2018-02-26 20:17:27.000000000 +0000 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-06-16 22:25-0000\n" "Last-Translator: Dafydd Tomos \n" "Language-Team: Welsh\n" @@ -356,15 +356,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Llinell orchymyn kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -376,13 +393,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Llinell orchymyn ddiofyn kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -392,13 +409,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Mae'r ffeil /boot/grub/device.map wedi ei ail-greu" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -411,7 +428,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -425,7 +442,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/da.po grub2-2.02~beta2/debian/po/da.po --- grub2-2.02~beta2/debian/po/da.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/da.po 2018-02-26 20:17:27.000000000 +0000 @@ -20,7 +20,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2015-03-27 17:30+01:00\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" @@ -368,18 +368,35 @@ "starte Debian korrekt op på trods af et sådant problem. Det kan dog fjerne " "muligheden for at starte et andet operativsystem op, som også afhænger af " "denne sti. Hvis dette er tilfældet, så skal du sikre dig, at GRUB er " -"konfigureret succesfuldt for at kunne starte andre operativsystemer " -"op korrekt." +"konfigureret succesfuldt for at kunne starte andre operativsystemer op " +"korrekt." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Kommandolinje for kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -391,13 +408,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Standardkommandolinje i kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -407,13 +424,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map er blevet gendannet" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -426,7 +443,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -440,7 +457,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/de.po grub2-2.02~beta2/debian/po/de.po --- grub2-2.02~beta2/debian/po/de.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/de.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2 1.98+20100710-2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-21 18:29+0100\n" "Last-Translator: Martin Eberhard Schauer \n" "Language-Team: German \n" @@ -364,22 +364,39 @@ msgstr "" "Einige EFI-basierte Systeme haben einen Fehler und handhaben neue Bootloader " "nicht korrekt. Falls Sie eine zusätzliche Installation von GRUB in den Pfad " -"für EFI-Wechselmedien erzwingen, sollten Sie gewährleisten, dass das " -"System Debian trotz dieses Problems korrekt startet. Es besteht jedoch die " +"für EFI-Wechselmedien erzwingen, sollten Sie gewährleisten, dass das System " +"Debian trotz dieses Problems korrekt startet. Es besteht jedoch die " "Möglichkeit, dass ein anderes von diesem Pfad abhängiges Betriebssystem " "nicht mehr starten kann. In diesem Fall müssen Sie sicherstellen, dass GRUB " "erfolgreich konfiguriert wurde und Installationen beliebiger anderer " "Betriebssystem korrekt starten können." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Befehlszeile für kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -392,13 +409,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Standard-Befehlszeile für kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -408,13 +425,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map wurde neu erstellt." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -427,7 +444,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -441,11 +458,10 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." msgstr "" "Wenn Sie diese Nachricht nicht verstehen oder wenn keine modifizierten Boot-" "Menü-Einträge vorhanden sind, können Sie diese Nachricht ignorieren." - diff -Nru grub2-2.02~beta2/debian/po/dz.po grub2-2.02~beta2/debian/po/dz.po --- grub2-2.02~beta2/debian/po/dz.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/dz.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2001-12-31 19:57-0500\n" "Last-Translator: Dawa \n" "Language-Team: Dzongkha \n" @@ -343,15 +343,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD བརྡ་བཀོད་གྲལ་ཐིག་:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -363,13 +380,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD སྔོན་སྒྲིག་བརྡ་བཀོད་གྲལ་ཐིག་:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -379,13 +396,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map འདི་ ལོག་བཟོ་ཡོདཔ།" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -397,7 +414,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -410,7 +427,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/el.po grub2-2.02~beta2/debian/po/el.po --- grub2-2.02~beta2/debian/po/el.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/el.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-08-17 14:44+0300\n" "Last-Translator: pankgeorg\n" "Language-Team: Greek \n" @@ -67,8 +67,8 @@ "by issuing the following command as root:" msgstr "" "Όποια κι αν είναι η απόφασή σας, μπορείτε να αντικαταστήσετε αργότερα το " -"προηγούμενο αντίγραφο του MBR με τη βοήθεια του GRUB 2, εκτελώντας ως χρήστης " -"root την ακόλουθη εντολή: " +"προηγούμενο αντίγραφο του MBR με τη βοήθεια του GRUB 2, εκτελώντας ως " +"χρήστης root την ακόλουθη εντολή: " #. Type: multiselect #. Description @@ -143,10 +143,10 @@ msgstr "" "Ο φορτωτής εκκίνησης GRUB είχε εγκατασταθεί προηγουμένως σε έναν δίσκο που " "δεν είναι πλέον παρών στο σύστημα ή που ο μοναδικός κωδικός αναγνώρισής του " -"έχει για κάποιο λόγο αλλάξει. Είναι σημαντικό να βεβαιωθείτε ότι το " -"κύριο εγκατεστημένο αντίγραφο του GRUB παραμένει συγχρονισμένο με τις" -"ενότητεςτου GRUB στο αρχείο grub.cfg. Παρακαλώ ελέγξτε ξανά για να" -"σιγουρευτείτε ότι το GRUB έχει εγγραφεί στις κατάλληλες εκκινήσιμες συσκευές." +"έχει για κάποιο λόγο αλλάξει. Είναι σημαντικό να βεβαιωθείτε ότι το κύριο " +"εγκατεστημένο αντίγραφο του GRUB παραμένει συγχρονισμένο με τιςενότητεςτου " +"GRUB στο αρχείο grub.cfg. Παρακαλώ ελέγξτε ξανά για νασιγουρευτείτε ότι το " +"GRUB έχει εγγραφεί στις κατάλληλες εκκινήσιμες συσκευές." #. Type: text #. Description @@ -184,15 +184,14 @@ "Do you want to continue anyway? If you do, your computer may not start up " "properly." msgstr "" -"Θέλετε να συνεχίσετε παρόλα αυτά; Αν ναι, είναι πιθανόν ο υπολογιστής σας " -"να μην μπορεί να εκκινήσει κανονικά." +"Θέλετε να συνεχίσετε παρόλα αυτά; Αν ναι, είναι πιθανόν ο υπολογιστής σας να " +"μην μπορεί να εκκινήσει κανονικά." #. Type: boolean #. Description #: ../grub-pc.templates.in:8001 msgid "Writing GRUB to boot device failed - try again?" -msgstr "" -"Η εγγραφή του GRUB στη συσκευή εκκίνησης απέτυχε - Επανάληψη;" +msgstr "Η εγγραφή του GRUB στη συσκευή εκκίνησης απέτυχε - Επανάληψη;" #. Type: boolean #. Description @@ -227,8 +226,8 @@ "συνεχίσετε, το πρόγραμμα εκκίνησης πιθανόν να μην έχει ρυθμιστεί σωστά και " "στην επανεκκίνηση του υπολογιστή σας θα χρησιμοποιήσει οτιδήποτε υπήρχε από " "πριν στον τομέα εκκίνησης. Αν υπάρχει μια προηγούμενη έκδοση του GRUB 2 στον " -"τομέα εκκίνησης, πιθανόν να μην μπορεί να φορτώσει κάποιες ενότητες αλλά ούτε" -"να χειριστεί το τρέχον αρχείο ρυθμίσεων." +"τομέα εκκίνησης, πιθανόν να μην μπορεί να φορτώσει κάποιες ενότητες αλλά " +"ούτενα χειριστεί το τρέχον αρχείο ρυθμίσεων." #. Type: boolean #. Description @@ -307,9 +306,9 @@ "You should generally finish the conversion to GRUB 2 unless these boot " "records were created by a GRUB 2 installation on some other operating system." msgstr "" -"Στη γενική περίπτωση θα πρέπει να τελειώσετε την μετατροπή σε GRUB 2 εκτός" -"κι αν αυτά τα αρχεία εκκίνησης έχουν δημιουργηθεί από μια εγκατάσταση του " -"GRUB 2 σε ένα άλλο λειτουργικό σύστημα." +"Στη γενική περίπτωση θα πρέπει να τελειώσετε την μετατροπή σε GRUB 2 εκτόςκι " +"αν αυτά τα αρχεία εκκίνησης έχουν δημιουργηθεί από μια εγκατάσταση του GRUB " +"2 σε ένα άλλο λειτουργικό σύστημα." #. Type: string #. Description @@ -351,8 +350,7 @@ #. Description #: ../templates.in:3001 msgid "Force extra installation to the EFI removable media path?" -msgstr "" -"Να γίνει εξαναγκασμένη εγκατάσταση στην αποσπώμενη EFI συσκευή;" +msgstr "Να γίνει εξαναγκασμένη εγκατάσταση στην αποσπώμενη EFI συσκευή;" #. Type: boolean #. Description @@ -367,23 +365,40 @@ "OS installations correctly." msgstr "" "Μερικά συστήματα που βασίζουνται στο EFI είναι ελλειπώς ανεπτυγμένα και δεν " -"διαχειρίζονται τα νέα προγράμματα εκκίνησης σωστά. Αν εξαναγκάσετε το σύστημα " -"να κάνει εγκατάσταση του GRUB στην αποσπώμενη EFI συσκευή, είναι βέβαιο ότι " -"αυτό το σύστημα θα δύναται να εκκινεί το Debian σωστά, ακόμα και να " -"εμφανιστεί τέτοιο πρόβλημα. Παρόλα αυτά, ίσβς αφαιρέσει τη δυνατότητα να " +"διαχειρίζονται τα νέα προγράμματα εκκίνησης σωστά. Αν εξαναγκάσετε το " +"σύστημα να κάνει εγκατάσταση του GRUB στην αποσπώμενη EFI συσκευή, είναι " +"βέβαιο ότι αυτό το σύστημα θα δύναται να εκκινεί το Debian σωστά, ακόμα και " +"να εμφανιστεί τέτοιο πρόβλημα. Παρόλα αυτά, ίσβς αφαιρέσει τη δυνατότητα να " "εκκινείτε οποιοδήποτε άλλο λειτουργικό σύστημα που ίσως εξαρτάται από αυτή " "τη συσκευή. Αν υπάρχει άλλο λειτουργικό σύστημα, θα χρειαστεί να σιγουρέψετε " "ότι ο GRUB είναι σωστά ρυθμισμένος να φορτώνει όλα τα άλλα λειτουργικά. " -#. Type: string +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Γραμμή εντολών kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -396,13 +411,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Προκαθορισμένη γραμμή εντολών kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -413,13 +428,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Το αρχείο /boot/grub/device.map έχει αναδημιουργηθεί" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -432,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -447,7 +462,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/eo.po grub2-2.02~beta2/debian/po/eo.po --- grub2-2.02~beta2/debian/po/eo.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/eo.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2 2.02-18\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-13 21:14-0300\n" "Last-Translator: Felipe Castro \n" "Language-Team: Esperanto \n" @@ -354,15 +354,32 @@ "Tiaokaze, vi devas certigi ke GRUB estas sukcese agordita tiel ke ĝi " "kapablos ekŝargi iun ajn alian OS-instalon ĝuste." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Ordon-linio de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -375,13 +392,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Implicita komand-linio de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -391,13 +408,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map estas regenerita" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -410,7 +427,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -424,7 +441,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/es.po grub2-2.02~beta2/debian/po/es.po --- grub2-2.02~beta2/debian/po/es.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/es.po 2018-02-26 20:17:27.000000000 +0000 @@ -36,7 +36,7 @@ msgstr "" "Project-Id-Version: grub2 1.99-5\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-11 23:57+0100\n" "Last-Translator: Manuel \"Venturi\" Porras Peralta \n" @@ -397,15 +397,32 @@ "configurado correctamente para ser capaz de iniciar sin problemas cualquier " "otro sistema operativo instalado." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Línea de órdenes de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -418,13 +435,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Línea de órdenes predeterminada de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -434,13 +451,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Se ha regenerado el fichero «/boot/grub/device.map»" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -453,7 +470,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -467,7 +484,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/eu.po grub2-2.02~beta2/debian/po/eu.po --- grub2-2.02~beta2/debian/po/eu.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/eu.po 2018-02-26 20:17:27.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: grub2_2.02~beta2-18\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-16 09:10+0100\n" "Last-Translator: Iñaki Larrañaga Murgoitio \n" "Language-Team: Basque \n" @@ -361,15 +361,32 @@ "dezake. Horrela bada, ziurtatu zaitez GRUB ongi konfiguratuta dagoela beste " "edozer SE-ren instalazioak ongi abiatzeko." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "KFreeBSD-ko komando-lerroa:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -381,13 +398,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "KFreeBSD-ko komando-lerro lehenetsia:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -397,13 +414,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map berriro sortu da" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -415,7 +432,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -429,7 +446,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/fa.po grub2-2.02~beta2/debian/po/fa.po --- grub2-2.02~beta2/debian/po/fa.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/fa.po 2018-02-26 20:17:27.000000000 +0000 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: fa\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: \n" "Last-Translator: Behrad Eslamifar \n" "Language-Team: debian-l10n-persian \n" @@ -344,15 +344,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "خط فرمان kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -364,13 +381,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "خط فرمان پیش فرض kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -380,13 +397,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map بازسازی شده است." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -399,7 +416,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -413,7 +430,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/fi.po grub2-2.02~beta2/debian/po/fi.po --- grub2-2.02~beta2/debian/po/fi.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/fi.po 2018-02-26 20:17:27.000000000 +0000 @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-27 18:53+0200\n" "Last-Translator: Timo Jyrinki \n" "Language-Team: Finnish \n" @@ -360,15 +360,32 @@ "tulee varmistaa, että GRUBin asetukset on tehty niin, että GRUBista voidaan " "käynnistää nämä muut käyttöjärjestelmät oikein." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD:n komentorivi:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -381,13 +398,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD:n oletuskomentorivi:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -397,13 +414,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map on luotu uudelleen" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -416,7 +433,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -430,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/fr.po grub2-2.02~beta2/debian/po/fr.po --- grub2-2.02~beta2/debian/po/fr.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/fr.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-14 08:09+0100\n" "Last-Translator: Christian Perrier \n" "Language-Team: French \n" @@ -374,15 +374,32 @@ "devez vous assurer que GRUB lui-même est configuré pour démarrer les autres " "systèmes d'exploitation." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Ligne de commande de kFreeBSD :" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -395,13 +412,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Ligne de commande par défaut de kFreeBSD :" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -411,13 +428,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Recréation de /boot/grub/device.map" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -430,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -445,7 +462,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/gl.po grub2-2.02~beta2/debian/po/gl.po --- grub2-2.02~beta2/debian/po/gl.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/gl.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2_1.98+20100804-2_gl\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-06-13 16:13+0200\n" "Last-Translator: Jorge Barreiro \n" "Language-Team: Galician \n" @@ -359,15 +359,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Liña de comando de kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -380,13 +397,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Liña de comando por defecto para kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -396,13 +413,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map foi rexenerado." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -415,7 +432,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -429,7 +446,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/gu.po grub2-2.02~beta2/debian/po/gu.po --- grub2-2.02~beta2/debian/po/gu.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/gu.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub-gu\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-03-04 09:56+0530\n" "Last-Translator: Kartik Mistry \n" "Language-Team: Gujarati \n" @@ -336,15 +336,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD આદેશ:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -356,13 +373,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD મૂળભૂત આદેશ:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -372,13 +389,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map ફરી બનાવવામાં આવી છે" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -390,7 +407,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -403,7 +420,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/he.po grub2-2.02~beta2/debian/po/he.po --- grub2-2.02~beta2/debian/po/he.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/he.po 2018-02-26 20:17:27.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: grub_debian_po_he\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-17 18:35+0200\n" "Last-Translator: Omer Zak\n" "Language-Team: Hebrew \n" @@ -336,21 +336,38 @@ "make sure that GRUB is configured successfully to be able to boot any other " "OS installations correctly." msgstr "" -"כמה מערכות מבוססות EFI מכילות בגים ואינן מתמודדות נכונות עם מאתחלים חדשים. אם " -"הינך מאלץ התקנה נוספת של GRUB לנתיב מדיה EFI הניתן להסרה, הדבר אמור להבטיח " -"שהמערכת תאתחל נכון את Debian למרות בעיה כזו. עם זאת, הדבר עלול למנוע אתחול כל " -"מערכת הפעלה אחרת שתלויה גם כן בנתיב זה. אם זה המצב, תצטרך לוודא ש-GRUB הוגדר " -"בהצלחה כדי שתוכל לאתחל נכון כל מערכת הפעלה מותקנת אחרת." +"כמה מערכות מבוססות EFI מכילות בגים ואינן מתמודדות נכונות עם מאתחלים חדשים. " +"אם הינך מאלץ התקנה נוספת של GRUB לנתיב מדיה EFI הניתן להסרה, הדבר אמור " +"להבטיח שהמערכת תאתחל נכון את Debian למרות בעיה כזו. עם זאת, הדבר עלול למנוע " +"אתחול כל מערכת הפעלה אחרת שתלויה גם כן בנתיב זה. אם זה המצב, תצטרך לוודא ש-" +"GRUB הוגדר בהצלחה כדי שתוכל לאתחל נכון כל מערכת הפעלה מותקנת אחרת." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "שורת הפקודה של kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -362,13 +379,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "ברירת מחדל לשורת הפקודה של kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -378,13 +395,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "הקובץ ‎/boot/grub/device.map נוצר מחדש" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -396,7 +413,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -409,11 +426,10 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." msgstr "" "אם אינך מבין הודעה זו, או אם אין לך ברירות מותאמות אישית בתפריט האתחול, אזי " "ניתן להתעלם מהודעה זו." - diff -Nru grub2-2.02~beta2/debian/po/hr.po grub2-2.02~beta2/debian/po/hr.po --- grub2-2.02~beta2/debian/po/hr.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/hr.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2 1.97-2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-03-22 16:37+0100\n" "Last-Translator: Tomislav Krznar \n" "Language-Team: Hrvatski \n" @@ -350,15 +350,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD naredbeni redak:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -370,13 +387,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Pretpostavljeni kFreeBSD naredbeni redak:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -386,13 +403,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map je regeneriran" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -405,7 +422,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -419,7 +436,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/hu.po grub2-2.02~beta2/debian/po/hu.po --- grub2-2.02~beta2/debian/po/hu.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/hu.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2013-05-18 15:44+0200\n" "Last-Translator: Dr. Nagy Elemér Károly \n" "Language-Team: Hungarian \n" @@ -352,15 +352,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD parancssor:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -372,13 +389,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Az alapértelmezett kFreeBSD parancssor:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -388,13 +405,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "A /boot/grub/device.map fájlt újraépítettem." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -407,7 +424,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -421,7 +438,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/id.po grub2-2.02~beta2/debian/po/id.po --- grub2-2.02~beta2/debian/po/id.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/id.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-01-20 12:28+0700\n" "Last-Translator: Mahyuddin Susanto \n" "Language-Team: Debian Indonesian Translation Team \n" "Language-Team: Icelandic \n" @@ -358,15 +358,32 @@ "verður þú að ganga úr skugga um að GRUB sé sett upp á fullnægjandi máta til " "þess að geta ræst rétt öll önnur stýrikerfi." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD skipanalína:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -378,13 +395,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Sjálfgefin kFreeBSD skipanalína:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -394,13 +411,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map var endurskrifað" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -413,7 +430,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -427,7 +444,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/it.po grub2-2.02~beta2/debian/po/it.po --- grub2-2.02~beta2/debian/po/it.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/it.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: grub2 2.02~beta2-18 italian debconf templates\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-19 21:49+0100\n" "Last-Translator: Luca Monducci \n" "Language-Team: Italian \n" @@ -358,15 +358,32 @@ "occorre accertarsi che GRUB sia configurato in modo che possa avviare " "correttamente qualsiasi altro SO installato." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Riga di comando kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -379,13 +396,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Riga di comando kFreeBSD predefinita:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -395,13 +412,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map è stato rigenerato" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -414,7 +431,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -428,7 +445,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ja.po grub2-2.02~beta2/debian/po/ja.po --- grub2-2.02~beta2/debian/po/ja.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ja.po 2018-02-26 20:17:27.000000000 +0000 @@ -1,19 +1,22 @@ # Copyright (C) 2008-2010 GRUB Maintainers # This file is distributed under the same license as the grub2 package. # Hideki Yamane , , 2008-2011. +# Takuma Yamada , 2016. # msgid "" msgstr "" "Project-Id-Version: grub2 1.99-5\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" -"PO-Revision-Date: 2011-05-28 23:44+0900\n" -"Last-Translator: Hideki Yamane \n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" +"PO-Revision-Date: 2016-03-03 09:57+0900\n" +"Last-Translator: Takuma Yamada \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Gtranslator 2.91.6\n" #. Type: boolean #. Description @@ -52,7 +55,7 @@ msgstr "" "MBR (マスターブートレコード) に直接インストールする前に、GRUB 2 が menu.lst " "からチェーンロードするように設定し、新しい GRUB 2 の設定が動作するかどうかを" -"確認する事をお勧めします。" +"確認することをお勧めします。" #. Type: boolean #. Description @@ -103,8 +106,8 @@ "If you're unsure which drive is designated as boot drive by your BIOS, it is " "often a good idea to install GRUB to all of them." msgstr "" -"BIOS でどのドライブが起動ドライブとして設定されているのか判らないのであれば、" -"すべてに GRUB をインストールするのが大抵の場合良い考えです。" +"BIOS でどのドライブが起動ドライブとして設定されているのかわからないのであれ" +"ば、すべてに GRUB をインストールするのがたいていの場合良い考えです。" #. Type: multiselect #. Description @@ -132,7 +135,7 @@ "GRUB modules and grub.cfg. Please check again to make sure that GRUB is " "written to the appropriate boot devices." msgstr "" -"以前、GRUB ブートローダーは、すでに存在しない、あるいは何らかの理由で一意の識" +"以前、GRUB ブートローダーは、すでに存在しない、あるいは何らかの理由で固有の識" "別子が変更されたディスクにインストールされていました。インストールされている " "GRUB コアイメージが GRUB モジュールや grub.cfg と一致しているのを確認するのは" "重要です。もう一度、GRUB が適切な起動デバイスに書き込まれているか確かめてくだ" @@ -216,7 +219,7 @@ "ローダーが正しく設定されていない可能性があり、このまま続行するとこのコン" "ピュータの次回起動時には、以前に起動セクタにインストールされていたものを何で" "あろうとも利用しようとします。以前のバージョンの GRUB 2 が起動セクタにある場" -"合は、モジュールの読み込みや現在の設定ファイルの取り扱いが出来なくなる可能性" +"合は、モジュールの読み込みや現在の設定ファイルの取り扱いができなくなる可能性" "があります。" #. Type: boolean @@ -228,7 +231,7 @@ "then you should continue anyway. Otherwise, you should install GRUB " "somewhere." msgstr "" -"既に別のブートローダーを利用していてそれを使い続けたい場合、あるいはブート" +"すでに別のブートローダーを利用していてそれを使い続けたい場合、あるいはブート" "ローダーを必要としない特殊な環境の場合は、とにかく続行してしまって構いませ" "ん。そうでない場合は、どこかに GRUB をインストールしてください。" @@ -333,7 +336,7 @@ #. Description #: ../templates.in:3001 msgid "Force extra installation to the EFI removable media path?" -msgstr "" +msgstr "EFI リムーバブルメディアパスに特別インストールを強制しますか?" #. Type: boolean #. Description @@ -347,16 +350,39 @@ "make sure that GRUB is configured successfully to be able to boot any other " "OS installations correctly." msgstr "" +"一部の EFI ベースのシステムにはバグがあり、正しく新しいブートローダーを扱うこ" +"とができません。EFI リムーバブルメディアパスに GRUB の特別インストールを強制" +"すると、この問題にもかかわらず、このシステムで正常に Debian が起動するでしょ" +"う。しかし、それはまた、このパスに依存するすべてのほかのオペレーティングシス" +"テムを起動する機能を削除することがあります。その場合は、ほかにインストールさ" +"れた OS が正常に起動するよう GRUB を適切に設定する必要があります。" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD コマンドライン:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -368,13 +394,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD デフォルトコマンドライン:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -384,13 +410,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map が再生成されました" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -402,7 +428,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -416,10 +442,10 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." msgstr "" -"このメッセージの意味が分からない、あるいは変更した起動メニュー項目が無い場合" +"このメッセージの意味がわからない、あるいは変更した起動メニュー項目がない場合" "は、このメッセージを無視して構いません。" diff -Nru grub2-2.02~beta2/debian/po/ka.po grub2-2.02~beta2/debian/po/ka.po --- grub2-2.02~beta2/debian/po/ka.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ka.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2009-08-30 18:05+0400\n" "Last-Translator: Aiet Kolkhi \n" "Language-Team: Georgian \n" @@ -325,15 +325,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD ბრძანების სტრიქონი:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 #, fuzzy #| msgid "" #| "The following kFreeBSD command line was extracted from /etc/default/grub " @@ -350,13 +367,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD-ის სტანდარტული ბრძანების სტრიქონი:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -366,13 +383,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -381,7 +398,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -391,7 +408,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/kk.po grub2-2.02~beta2/debian/po/kk.po --- grub2-2.02~beta2/debian/po/kk.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/kk.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: master\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-14 20:02+0600\n" "Last-Translator: Baurzhan Muftakhidinov \n" "Language-Team: Kazakh \n" @@ -351,15 +351,32 @@ "мүмкін. Олай болса сізге GRUB барлық басқа ОЖ-ды жүктей алатындай етіп дұрыс " "бапталғанына көз жеткізу керек." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD командалық жолы:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -371,13 +388,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD бастапқы командалық жолы:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -387,13 +404,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map қайта құрылды" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -405,7 +422,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -418,7 +435,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/km.po grub2-2.02~beta2/debian/po/km.po --- grub2-2.02~beta2/debian/po/km.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/km.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: grub_debian_po\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-04-05 15:38+0700\n" "Last-Translator: Khoem Sokhem \n" "Language-Team: Khmer \n" @@ -336,15 +336,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "ពាក្យ​បញ្ជា kFreeBSD ៖" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -355,13 +372,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "ពាក្យ​បញ្ជា​លំនាំដើម​របស់ kFreeBSD ៖" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -371,13 +388,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map ត្រូវ​បាន​បង្កើត​ឡើង​វិញ" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -389,7 +406,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -402,7 +419,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ko.po grub2-2.02~beta2/debian/po/ko.po --- grub2-2.02~beta2/debian/po/ko.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ko.po 2018-02-26 20:17:27.000000000 +0000 @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: grub_debian\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-04-23 04:55+0900\n" "Last-Translator: Changwoo Ryu \n" "Language-Team: Korean \n" @@ -338,15 +338,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD 명령어:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -358,13 +375,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD 기본 명령어:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -374,13 +391,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map 파일을 다시 만들었습니다" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -392,7 +409,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -405,7 +422,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/lt.po grub2-2.02~beta2/debian/po/lt.po --- grub2-2.02~beta2/debian/po/lt.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/lt.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-14 10:37+0300\n" "Last-Translator: Rimas Kudelis \n" "Language-Team: Lithuanian \n" @@ -359,15 +359,32 @@ "kad „GRUB“ paleidyklė sukonfigūruota tinkamai ir geba korektiškai paleisti " "šias operacines sistemas." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "„kFreeBSD“ komandos eilutė:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -380,13 +397,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Numatytoji „kFreeBSD“ komandos eilutė:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -396,13 +413,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Failas „boot/grub/device.map“ pergeneruotas" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -414,7 +431,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -428,7 +445,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/lv.po grub2-2.02~beta2/debian/po/lv.po --- grub2-2.02~beta2/debian/po/lv.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/lv.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2015-02-10 21:14+0200\n" "Last-Translator: Rūdolfs Mazurs \n" "Language-Team: Latvian \n" @@ -355,15 +355,32 @@ "jāpārliecinās, ka GRUB ir veiksmīgi nokonfigurēts un varēs veiksmīgi ielādēt " "citas OS instalācijas." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD komandrinda:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -375,13 +392,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD noklusējuma komandrinda:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -391,13 +408,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map tika reģistrēts" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -410,7 +427,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -424,7 +441,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/mr.po grub2-2.02~beta2/debian/po/mr.po --- grub2-2.02~beta2/debian/po/mr.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/mr.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-24 20:56+0530\n" "Last-Translator: localuser \n" "Language-Team: C-DAC/Sampada\n" @@ -344,15 +344,32 @@ "होण्याची क्षमता काढून टाकली जाऊ शकते. असे असल्यास, अन्य एखादी प्रणाली योग्य रीतीने आरंभ " "होण्यासाठी ग्रब यशस्वीपणे संरचित केला गेला असल्याची खातरजमा तुम्ही करणे गरजेचे आहे." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "केफ्रीबीएसडी आदेश ओळ:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -364,13 +381,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "केफ्रीबीएसडी मूलनिर्धारीत आदेश ओळ:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -380,13 +397,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map पुनर्निर्मिला गेला आहे" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -398,7 +415,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -411,7 +428,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/nb.po grub2-2.02~beta2/debian/po/nb.po --- grub2-2.02~beta2/debian/po/nb.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/nb.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-03-12 02:14+0200\n" "Last-Translator: Hans Fredrik Nordhaug \n" "Language-Team: Norwegian Bokmål \n" @@ -352,15 +352,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Kommandolinje i kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -372,13 +389,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Standardkommandolinje i kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -388,13 +405,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map er regenerert" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -406,7 +423,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -420,7 +437,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/nl.po grub2-2.02~beta2/debian/po/nl.po --- grub2-2.02~beta2/debian/po/nl.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/nl.po 2018-02-26 20:17:27.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: grub2 1.99-14\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-18 16:14+0100\n" "Last-Translator: Frans Spiesschaert \n" "Language-Team: Debian Dutch l10n Team \n" @@ -371,15 +371,32 @@ "succesvol geconfigureerd wordt om eventueel andere geïnstalleerde " "besturingssystemen correct te kunnen opstarten." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD-commandoregel:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -392,13 +409,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Standaard kFreeBSD-commandoregel:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -408,13 +425,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map is opnieuw aangemaakt" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -427,7 +444,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -441,7 +458,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/pl.po grub2-2.02~beta2/debian/po/pl.po --- grub2-2.02~beta2/debian/po/pl.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/pl.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-14 10:28+0100\n" "Last-Translator: Łukasz Dulny \n" "Language-Team: Polish \n" @@ -359,22 +359,39 @@ "OS installations correctly." msgstr "" "Niektóre oparte na EFI systemy mają błędy i nie obsługują poprawnie nowych " -"programów rozruchowych. Jeśli wymusisz dodatkową instalację GRUB-a do ścieżki " -"nośników wymiennych EFI, powinno to zapewnić, że system załaduje Debiana " -"prawidłowo mimo tego problemu. Jednak może to także uniemożliwić ładowanie " -"innych systemów operacyjnych, które również zależą od tej ścieżki. W takiej " -"sytuacji będziesz musiał upewnić się, że GRUB jest skonfigurowany poprawnie i " -"będzie mógł ładować te systemy." +"programów rozruchowych. Jeśli wymusisz dodatkową instalację GRUB-a do " +"ścieżki nośników wymiennych EFI, powinno to zapewnić, że system załaduje " +"Debiana prawidłowo mimo tego problemu. Jednak może to także uniemożliwić " +"ładowanie innych systemów operacyjnych, które również zależą od tej ścieżki. " +"W takiej sytuacji będziesz musiał upewnić się, że GRUB jest skonfigurowany " +"poprawnie i będzie mógł ładować te systemy." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Wiersz poleceń do kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -387,13 +404,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Domyślny wiersz poleceń do kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -403,13 +420,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map został odtworzony" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -422,7 +439,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -436,11 +453,10 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." msgstr "" "Jeśli ta wiadomość jest niezrozumiała lub jeśli nie tworzono żadnych " "specjalnych wpisów menu, można ją zignorować." - diff -Nru grub2-2.02~beta2/debian/po/pt.po grub2-2.02~beta2/debian/po/pt.po --- grub2-2.02~beta2/debian/po/pt.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/pt.po 2018-02-26 20:17:27.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: grub2 1.98-1\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2011-09-11 20:39+0100\n" "Last-Translator: Miguel Figueiredo \n" "Language-Team: Portuguese \n" @@ -358,15 +358,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "linha de comandos kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -379,13 +396,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Linha de comandos padrão do kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -395,13 +412,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "O /boot/grub/device.map foi recriado" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -414,7 +431,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -429,7 +446,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/pt_BR.po grub2-2.02~beta2/debian/po/pt_BR.po --- grub2-2.02~beta2/debian/po/pt_BR.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/pt_BR.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2 2.02~beta2-18\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-21 21:37-0200\n" "Last-Translator: Adriano Rafael Gomes \n" "Language-Team: Brazilian Portuguese \n" "Language-Team: Romanian \n" @@ -364,15 +364,32 @@ "acest caz va trebui să vă asigurați că GRUB este configurat corect pentru a " "putea încărca și orice alte sisteme de operare." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Linia de comandă kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -385,13 +402,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Linia de comandă implicită kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -401,13 +418,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map a fost regenerat" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -420,7 +437,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -434,7 +451,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ru.po grub2-2.02~beta2/debian/po/ru.po --- grub2-2.02~beta2/debian/po/ru.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ru.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2 2.02~beta2-18\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-15 19:25+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" @@ -353,23 +353,39 @@ "make sure that GRUB is configured successfully to be able to boot any other " "OS installations correctly." msgstr "" -"Некоторые системы на основе EFI содержат ошибки и неправильно " -"работают с новыми системными загрузчиками. " -"Если выполнить принудительную установку GRUB в путь съёмных носителей EFI, " -"то на такой системе Debian будет запускаться несмотря на эту проблему. " -"Однако это может привести к отказу запуска всех остальных операционных " -"систем, которые также зависят от этого пути. " +"Некоторые системы на основе EFI содержат ошибки и неправильно работают с " +"новыми системными загрузчиками. Если выполнить принудительную установку GRUB " +"в путь съёмных носителей EFI, то на такой системе Debian будет запускаться " +"несмотря на эту проблему. Однако это может привести к отказу запуска всех " +"остальных операционных систем, которые также зависят от этого пути. " "Проверьте, что GRUB правильно настроен для загрузки любой другой ОС." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Командная строка kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -382,13 +398,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Командная строка kFreeBSD по умолчанию:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -398,13 +414,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Пересоздан файл /boot/grub/device.map" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -417,7 +433,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -431,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/si.po grub2-2.02~beta2/debian/po/si.po --- grub2-2.02~beta2/debian/po/si.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/si.po 2018-02-26 20:17:27.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2011-09-29 08:35+0530\n" "Last-Translator: Danishka Navin \n" "Language-Team: Sinhala \n" @@ -334,15 +334,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD විධාන රේඛාව:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -354,13 +371,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD පෙරනිමි විධාන රේඛාව:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -370,13 +387,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map නැවත ජනනය වී ඇත" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -388,7 +405,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -401,7 +418,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/sk.po grub2-2.02~beta2/debian/po/sk.po --- grub2-2.02~beta2/debian/po/sk.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/sk.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2 1.99-5\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2011-07-19 07:49+0200\n" "Last-Translator: Slavko \n" "Language-Team: Slovak \n" @@ -350,15 +350,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Príkazový riadok kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -370,13 +387,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Predvolený príkazový riadok kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -386,13 +403,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map bol aktualizovaný" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -404,7 +421,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -418,7 +435,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/sl.po grub2-2.02~beta2/debian/po/sl.po --- grub2-2.02~beta2/debian/po/sl.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/sl.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-19 11:58+0100\n" "Last-Translator: Vanja Cvelbar \n" "Language-Team: Slovenian \n" @@ -15,7 +15,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n" +"%100==4 ? 3 : 0);\n" "X-Poedit-Language: Slovenian\n" "X-Poedit-Country: SLOVENIA\n" "X-Poedit-SourceCharset: utf-8\n" @@ -35,65 +36,108 @@ #. Type: boolean #. Description #: ../grub-pc.templates.in:2001 -msgid "In order to replace the Legacy version of GRUB in your system, it is recommended that /boot/grub/menu.lst is adjusted to load a GRUB 2 boot image from your existing GRUB Legacy setup. This step can be automatically performed now." -msgstr "Da zamenjate različico GRUB Legacy na vašem sistemu vam priporočamo, da se /boot/grub/menu.lst spremeni tako, da verižno naloži GRUB 2 iz vaše obstoječe namestitve GRUB Legacy. To dejanje lahko zdaj izvedete samodejno." +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to load a GRUB 2 boot image " +"from your existing GRUB Legacy setup. This step can be automatically " +"performed now." +msgstr "" +"Da zamenjate različico GRUB Legacy na vašem sistemu vam priporočamo, da se /" +"boot/grub/menu.lst spremeni tako, da verižno naloži GRUB 2 iz vaše obstoječe " +"namestitve GRUB Legacy. To dejanje lahko zdaj izvedete samodejno." #. Type: boolean #. Description #: ../grub-pc.templates.in:2001 -msgid "It's recommended that you accept chainloading GRUB 2 from menu.lst, and verify that the new GRUB 2 setup works before it is written to the MBR (Master Boot Record)." -msgstr "Priporočamo vam, da sprejmete verižno nalaganje GRUB 2 iz datoteke menu.lst in preverite delovanje namestitve GRUB2 preden ga namestite na MBR (Master Boot Record)." +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that the new GRUB 2 setup works before it is written to the MBR " +"(Master Boot Record)." +msgstr "" +"Priporočamo vam, da sprejmete verižno nalaganje GRUB 2 iz datoteke menu.lst " +"in preverite delovanje namestitve GRUB2 preden ga namestite na MBR (Master " +"Boot Record)." #. Type: boolean #. Description #: ../grub-pc.templates.in:2001 -msgid "Whatever your decision, you can replace the old MBR image with GRUB 2 later by issuing the following command as root:" -msgstr "Kakorkoli se odločite, stari MBR lahko kasneje vedno zamenjate z GRUB 2, če izvedete kot root sledeči ukaz:" +msgid "" +"Whatever your decision, you can replace the old MBR image with GRUB 2 later " +"by issuing the following command as root:" +msgstr "" +"Kakorkoli se odločite, stari MBR lahko kasneje vedno zamenjate z GRUB 2, če " +"izvedete kot root sledeči ukaz:" #. Type: multiselect #. Description #. Type: multiselect #. Description -#: ../grub-pc.templates.in:3001 -#: ../grub-pc.templates.in:4001 +#: ../grub-pc.templates.in:3001 ../grub-pc.templates.in:4001 msgid "GRUB install devices:" msgstr "Namestitvene naprave za GRUB:" #. Type: multiselect #. Description #: ../grub-pc.templates.in:3001 -msgid "The grub-pc package is being upgraded. This menu allows you to select which devices you'd like grub-install to be automatically run for, if any." -msgstr "Nadgrajevanje paketa grub-pc. Ta meni vam omogoči izbiro naprav za katere želite samodejno zagnati grub-install." +msgid "" +"The grub-pc package is being upgraded. This menu allows you to select which " +"devices you'd like grub-install to be automatically run for, if any." +msgstr "" +"Nadgrajevanje paketa grub-pc. Ta meni vam omogoči izbiro naprav za katere " +"želite samodejno zagnati grub-install." #. Type: multiselect #. Description #: ../grub-pc.templates.in:3001 -msgid "Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with GRUB modules or grub.cfg." -msgstr "V večini primerov je priporočen samodejni zagon grub-install, da preprečite neskladja med jedrom GRUBa in moduli ali grub.cfg." +msgid "" +"Running grub-install automatically is recommended in most situations, to " +"prevent the installed GRUB core image from getting out of sync with GRUB " +"modules or grub.cfg." +msgstr "" +"V večini primerov je priporočen samodejni zagon grub-install, da preprečite " +"neskladja med jedrom GRUBa in moduli ali grub.cfg." #. Type: multiselect #. Description #. Type: multiselect #. Description -#: ../grub-pc.templates.in:3001 -#: ../grub-pc.templates.in:4001 -msgid "If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to install GRUB to all of them." -msgstr "V primeru, da niste prepričani kateri pogon je označuje vaš BIOS za zagonskega, je ponavadi dobro, da namestite GRUB kar na vse." +#: ../grub-pc.templates.in:3001 ../grub-pc.templates.in:4001 +msgid "" +"If you're unsure which drive is designated as boot drive by your BIOS, it is " +"often a good idea to install GRUB to all of them." +msgstr "" +"V primeru, da niste prepričani kateri pogon je označuje vaš BIOS za " +"zagonskega, je ponavadi dobro, da namestite GRUB kar na vse." #. Type: multiselect #. Description #. Type: multiselect #. Description -#: ../grub-pc.templates.in:3001 -#: ../grub-pc.templates.in:4001 -msgid "Note: it is possible to install GRUB to partition boot records as well, and some appropriate partitions are offered here. However, this forces GRUB to use the blocklist mechanism, which makes it less reliable, and therefore is not recommended." -msgstr "Opomba: GRUB je mogoče namestiti tudi na zagonski zapis razdelka. Primerni razdelki so na tem spisku. To pa zahteva uporabo mehanizma blocklist, ki je manj zanesljiv in zato ni priporočen." +#: ../grub-pc.templates.in:3001 ../grub-pc.templates.in:4001 +msgid "" +"Note: it is possible to install GRUB to partition boot records as well, and " +"some appropriate partitions are offered here. However, this forces GRUB to " +"use the blocklist mechanism, which makes it less reliable, and therefore is " +"not recommended." +msgstr "" +"Opomba: GRUB je mogoče namestiti tudi na zagonski zapis razdelka. Primerni " +"razdelki so na tem spisku. To pa zahteva uporabo mehanizma blocklist, ki je " +"manj zanesljiv in zato ni priporočen." #. Type: multiselect #. Description #: ../grub-pc.templates.in:4001 -msgid "The GRUB boot loader was previously installed to a disk that is no longer present, or whose unique identifier has changed for some reason. It is important to make sure that the installed GRUB core image stays in sync with GRUB modules and grub.cfg. Please check again to make sure that GRUB is written to the appropriate boot devices." -msgstr "Zagonski nalagalnik GRUB je bil nameščen na disku, ki ni več prisoten ali se mu je spremenil enolični identifikator. Važno je, da so jedro GRUBa in moduli ter grub.cfg skladni. Preverite prosim, da je GRUB zapisan na pravilno zagonsko napravo." +msgid "" +"The GRUB boot loader was previously installed to a disk that is no longer " +"present, or whose unique identifier has changed for some reason. It is " +"important to make sure that the installed GRUB core image stays in sync with " +"GRUB modules and grub.cfg. Please check again to make sure that GRUB is " +"written to the appropriate boot devices." +msgstr "" +"Zagonski nalagalnik GRUB je bil nameščen na disku, ki ni več prisoten ali se " +"mu je spremenil enolični identifikator. Važno je, da so jedro GRUBa in " +"moduli ter grub.cfg skladni. Preverite prosim, da je GRUB zapisan na " +"pravilno zagonsko napravo." #. Type: text #. Description @@ -120,28 +164,38 @@ #. Description #. Type: boolean #. Description -#: ../grub-pc.templates.in:7001 -#: ../grub-pc.templates.in:8001 +#: ../grub-pc.templates.in:7001 ../grub-pc.templates.in:8001 msgid "GRUB failed to install to the following devices:" msgstr "Napaka pri nameščanju GRUBa na sledeče naprave:" #. Type: boolean #. Description #: ../grub-pc.templates.in:7001 -msgid "Do you want to continue anyway? If you do, your computer may not start up properly." -msgstr "Želite vseeno nadaljevati? V primeru, da boste nadaljevali se računalnik mogoče ne bo pravilno zagnal." +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" +"Želite vseeno nadaljevati? V primeru, da boste nadaljevali se računalnik " +"mogoče ne bo pravilno zagnal." #. Type: boolean #. Description #: ../grub-pc.templates.in:8001 msgid "Writing GRUB to boot device failed - try again?" -msgstr "Nameščanje GRUBa na zagonsko napravo ni uspelo. Želite še enkrat poskusiti?" +msgstr "" +"Nameščanje GRUBa na zagonsko napravo ni uspelo. Želite še enkrat poskusiti?" #. Type: boolean #. Description #: ../grub-pc.templates.in:8001 -msgid "You may be able to install GRUB to some other device, although you should check that your system will boot from that device. Otherwise, the upgrade from GRUB Legacy will be canceled." -msgstr "Mogoče lahko namestite GRUB na katero drugo napravo, preveriti pa morate, da se bo lahko vaš sistem zagnal iz te naprave. Drugače bo posodobitev iz zastarelega GRUB prekinjena ." +msgid "" +"You may be able to install GRUB to some other device, although you should " +"check that your system will boot from that device. Otherwise, the upgrade " +"from GRUB Legacy will be canceled." +msgstr "" +"Mogoče lahko namestite GRUB na katero drugo napravo, preveriti pa morate, da " +"se bo lahko vaš sistem zagnal iz te naprave. Drugače bo posodobitev iz " +"zastarelega GRUB prekinjena ." #. Type: boolean #. Description @@ -152,14 +206,32 @@ #. Type: boolean #. Description #: ../grub-pc.templates.in:9001 -msgid "You chose not to install GRUB to any devices. If you continue, the boot loader may not be properly configured, and when this computer next starts up it will use whatever was previously in the boot sector. If there is an earlier version of GRUB 2 in the boot sector, it may be unable to load modules or handle the current configuration file." -msgstr "Izbrali ste, da ne boste namestili GRUBa na nobeno napravo. V primeru, da nadaljujete zagonski nalagalnik ne bo pravilno nastavljen. Računalnik bo ob naslednjem zagonu uporabil karkoli je bilo prej nameščeno na zagonskem sektorju. V primeru, da se tam nahaja starejša različica GRUB 2 mogoče ta ne bo uspela naložiti modulov ali brati sedanje nastavitvene datoteke." +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when this computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" +"Izbrali ste, da ne boste namestili GRUBa na nobeno napravo. V primeru, da " +"nadaljujete zagonski nalagalnik ne bo pravilno nastavljen. Računalnik bo ob " +"naslednjem zagonu uporabil karkoli je bilo prej nameščeno na zagonskem " +"sektorju. V primeru, da se tam nahaja starejša različica GRUB 2 mogoče ta ne " +"bo uspela naložiti modulov ali brati sedanje nastavitvene datoteke." #. Type: boolean #. Description #: ../grub-pc.templates.in:9001 -msgid "If you are already using a different boot loader and want to carry on doing so, or if this is a special environment where you do not need a boot loader, then you should continue anyway. Otherwise, you should install GRUB somewhere." -msgstr "V primeru, da že uporabljate različen zagonski nalagalnik in želite s tem nadaljevati ali pa je to posebno zagonsko okolje kjer ne rabite zagonskega nalagalnika lahko vsekakor nadaljujete. V ostalih primerih bi morali nekam namestiti GRUB." +msgid "" +"If you are already using a different boot loader and want to carry on doing " +"so, or if this is a special environment where you do not need a boot loader, " +"then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" +"V primeru, da že uporabljate različen zagonski nalagalnik in želite s tem " +"nadaljevati ali pa je to posebno zagonsko okolje kjer ne rabite zagonskega " +"nalagalnika lahko vsekakor nadaljujete. V ostalih primerih bi morali nekam " +"namestiti GRUB." #. Type: boolean #. Description @@ -171,13 +243,17 @@ #. Description #: ../grub-pc.templates.in:10001 msgid "Do you want to have all GRUB 2 files removed from /boot/grub?" -msgstr "Želite odstraniti iz /boot/grub vse datoteke, ki se nanašajo na GRUB 2?" +msgstr "" +"Želite odstraniti iz /boot/grub vse datoteke, ki se nanašajo na GRUB 2?" #. Type: boolean #. Description #: ../grub-pc.templates.in:10001 -msgid "This will make the system unbootable unless another boot loader is installed." -msgstr "Zaradi tega se sistem ne bo mogel zagnati, razen, če uporabite drugi zagonski nalagalnik." +msgid "" +"This will make the system unbootable unless another boot loader is installed." +msgstr "" +"Zaradi tega se sistem ne bo mogel zagnati, razen, če uporabite drugi " +"zagonski nalagalnik." #. Type: boolean #. Description @@ -188,20 +264,39 @@ #. Type: boolean #. Description #: ../grub-pc.templates.in:11001 -msgid "This system still has files from the GRUB Legacy boot loader installed, but it now also has GRUB 2 boot records installed on these disks:" -msgstr "Na tem sistemu so še nameščene datoteke iz zastarelega GRUBa, a zdaj je nameščen tudi zagonski zapis GRUB 2 na sledečih diskih:" +msgid "" +"This system still has files from the GRUB Legacy boot loader installed, but " +"it now also has GRUB 2 boot records installed on these disks:" +msgstr "" +"Na tem sistemu so še nameščene datoteke iz zastarelega GRUBa, a zdaj je " +"nameščen tudi zagonski zapis GRUB 2 na sledečih diskih:" #. Type: boolean #. Description #: ../grub-pc.templates.in:11001 -msgid "It seems likely that GRUB Legacy is no longer in use, and that you should instead upgrade the GRUB 2 images on these disks and finish the conversion to GRUB 2 by removing old GRUB Legacy files. If you do not upgrade these GRUB 2 images, then they may be incompatible with the new packages and cause your system to stop booting properly." -msgstr "Zdi se verjetno, da zastareli GRUB ni več v uporabi in da bi morali namesto tega nadgraditi te diske na GRUB 2 ter dokončati pretvorbo v GRUB 2 z odstranitvijo datotek za zastareli GRUB. V primeru, da ne boste izvedli nadgradnje na GRUB 2 lahko pride do nezdružljivosti z novimi paketi in težav pri zagonu." +msgid "" +"It seems likely that GRUB Legacy is no longer in use, and that you should " +"instead upgrade the GRUB 2 images on these disks and finish the conversion " +"to GRUB 2 by removing old GRUB Legacy files. If you do not upgrade these " +"GRUB 2 images, then they may be incompatible with the new packages and cause " +"your system to stop booting properly." +msgstr "" +"Zdi se verjetno, da zastareli GRUB ni več v uporabi in da bi morali namesto " +"tega nadgraditi te diske na GRUB 2 ter dokončati pretvorbo v GRUB 2 z " +"odstranitvijo datotek za zastareli GRUB. V primeru, da ne boste izvedli " +"nadgradnje na GRUB 2 lahko pride do nezdružljivosti z novimi paketi in težav " +"pri zagonu." #. Type: boolean #. Description #: ../grub-pc.templates.in:11001 -msgid "You should generally finish the conversion to GRUB 2 unless these boot records were created by a GRUB 2 installation on some other operating system." -msgstr "Običajno bi morali dokončati pretvorbo v GRUB 2 razen, če so bili ti zagonski zapisi ustvarjeni pri nameščanju GRUB 2 na drugem operacijskem sistemu." +msgid "" +"You should generally finish the conversion to GRUB 2 unless these boot " +"records were created by a GRUB 2 installation on some other operating system." +msgstr "" +"Običajno bi morali dokončati pretvorbo v GRUB 2 razen, če so bili ti " +"zagonski zapisi ustvarjeni pri nameščanju GRUB 2 na drugem operacijskem " +"sistemu." #. Type: string #. Description @@ -212,8 +307,14 @@ #. Type: string #. Description #: ../templates.in:1001 -msgid "The following Linux command line was extracted from /etc/default/grub or the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, and modify it if necessary. The command line is allowed to be empty." -msgstr "Sledeči ukaz za Linux je vzet iz datoteke /etc/default/grub ali iz parametra `kopt' v datoteki menu.lst sistema GRUB Legacy. Preverite prosim, da je točen in ga po potrebi popravite. Ukazna vrstica je lahko tudi prazna." +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary. The command line is allowed to be empty." +msgstr "" +"Sledeči ukaz za Linux je vzet iz datoteke /etc/default/grub ali iz parametra " +"`kopt' v datoteki menu.lst sistema GRUB Legacy. Preverite prosim, da je " +"točen in ga po potrebi popravite. Ukazna vrstica je lahko tudi prazna." #. Type: string #. Description @@ -224,8 +325,12 @@ #. Type: string #. Description #: ../templates.in:2001 -msgid "The following string will be used as Linux parameters for the default menu entry but not for the recovery mode." -msgstr "Sledeča vrstica bo uporabljena kot parameter Linuxa za privzeti vnos v meniju, ne pa za reševalni način." +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Sledeča vrstica bo uporabljena kot parameter Linuxa za privzeti vnos v " +"meniju, ne pa za reševalni način." #. Type: boolean #. Description @@ -236,56 +341,117 @@ #. Type: boolean #. Description #: ../templates.in:3001 -msgid "Some EFI-based systems are buggy and do not handle new bootloaders correctly. If you force an extra installation of GRUB to the EFI removable media path, this should ensure that this system will boot Debian correctly despite such a problem. However, it may remove the ability to boot any other operating systems that also depend on this path. If so, you will need to make sure that GRUB is configured successfully to be able to boot any other OS installations correctly." -msgstr "Nekateri sistemi na osnovi EFI imajo napake in ne morejo pravilno uporabljati novih zagonskih nalagalnikov. Če prisilno dodatno namestite GRUB v pot EFI na odstranljivem mediju, bi to moralo zadostovati, da bo, kljub tem težavam, lahko sistem zagnal Debian. Zaradi tega pa mogoče ne boste mogli več zagnati drugih operacijskih sistemov, ki so odvisni od te poti. V takem primeru morate preveriti, da je GRUB pravilno nastavljen in boste lahko zagnali tudi druge operacijske sisteme." +msgid "" +"Some EFI-based systems are buggy and do not handle new bootloaders " +"correctly. If you force an extra installation of GRUB to the EFI removable " +"media path, this should ensure that this system will boot Debian correctly " +"despite such a problem. However, it may remove the ability to boot any other " +"operating systems that also depend on this path. If so, you will need to " +"make sure that GRUB is configured successfully to be able to boot any other " +"OS installations correctly." +msgstr "" +"Nekateri sistemi na osnovi EFI imajo napake in ne morejo pravilno " +"uporabljati novih zagonskih nalagalnikov. Če prisilno dodatno namestite GRUB " +"v pot EFI na odstranljivem mediju, bi to moralo zadostovati, da bo, kljub " +"tem težavam, lahko sistem zagnal Debian. Zaradi tega pa mogoče ne boste " +"mogli več zagnati drugih operacijskih sistemov, ki so odvisni od te poti. V " +"takem primeru morate preveriti, da je GRUB pravilno nastavljen in boste " +"lahko zagnali tudi druge operacijske sisteme." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Ukazna vrstica kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 -msgid "The following kFreeBSD command line was extracted from /etc/default/grub or the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, and modify it if necessary. The command line is allowed to be empty." -msgstr "Sledeči ukaz za kFreeBSD je vzet iz datoteke /etc/default/grub ali iz parametra `kopt' v datoteki menu.lst sistema GRUB Legacy. Preverite prosim, da je točen in ga po potrebi popravite. Ukazna vrstica je lahko tudi prazna." +#: ../templates.in:5001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary. The command line is allowed to be empty." +msgstr "" +"Sledeči ukaz za kFreeBSD je vzet iz datoteke /etc/default/grub ali iz " +"parametra `kopt' v datoteki menu.lst sistema GRUB Legacy. Preverite " +"prosim, da je točen in ga po potrebi popravite. Ukazna vrstica je lahko tudi " +"prazna." #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Privzeta ukazna vrstica kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 -msgid "The following string will be used as kFreeBSD parameters for the default menu entry but not for the recovery mode." -msgstr "Sledeča vrstica bo uporabljena kot parameter kFreeBSD za privzeti vnos v meniju, ne pa za reševalni način." +#: ../templates.in:6001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Sledeča vrstica bo uporabljena kot parameter kFreeBSD za privzeti vnos v " +"meniju, ne pa za reševalni način." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "ustvarjena je bila datoteka /boot/grub/device.map" #. Type: note #. Description -#: ../templates.in:6001 -msgid "The file /boot/grub/device.map has been rewritten to use stable device names. In most cases, this should significantly reduce the need to change it in future, and boot menu entries generated by GRUB should not be affected." -msgstr "Datoteka /boot/grub/device.map je bila prepisana s stabilnimi imeni naprav. V večini primerov bo to v prihodnosti močno zmanjšalo potrebo po njenih spremembah. Na vnose v zagonskem meniju, ki jih ustvari GRUB to ne bi smelo imeti učinka." +#: ../templates.in:7001 +msgid "" +"The file /boot/grub/device.map has been rewritten to use stable device " +"names. In most cases, this should significantly reduce the need to change it " +"in future, and boot menu entries generated by GRUB should not be affected." +msgstr "" +"Datoteka /boot/grub/device.map je bila prepisana s stabilnimi imeni naprav. " +"V večini primerov bo to v prihodnosti močno zmanjšalo potrebo po njenih " +"spremembah. Na vnose v zagonskem meniju, ki jih ustvari GRUB to ne bi smelo " +"imeti učinka." #. Type: note #. Description -#: ../templates.in:6001 -msgid "However, since more than one disk is present in the system, it is possible that the system is depending on the old device map. Please check whether there are any custom boot menu entries that rely on GRUB's (hdN) drive numbering, and update them if necessary." -msgstr "Ker imate več kot en disk na vašem sistemu je možno, da ste bili odvisni od starega spiska naprav. Preverite prosim ali imate kakšen vnos po meri v zagonskem meniju, ki se naslanja na poimenovanje diskov (hdN) v GRUBu in ga posodobite, če je to potrebno." +#: ../templates.in:7001 +msgid "" +"However, since more than one disk is present in the system, it is possible " +"that the system is depending on the old device map. Please check whether " +"there are any custom boot menu entries that rely on GRUB's (hdN) drive " +"numbering, and update them if necessary." +msgstr "" +"Ker imate več kot en disk na vašem sistemu je možno, da ste bili odvisni od " +"starega spiska naprav. Preverite prosim ali imate kakšen vnos po meri v " +"zagonskem meniju, ki se naslanja na poimenovanje diskov (hdN) v GRUBu in ga " +"posodobite, če je to potrebno." #. Type: note #. Description -#: ../templates.in:6001 -msgid "If you do not understand this message, or if there are no custom boot menu entries, you can ignore this message." -msgstr "V primeru, da tega sporočila ne razumete ali nimate nobenih vnosov po meri v zagonskem meniju se za to sporočilo ne menite." +#: ../templates.in:7001 +msgid "" +"If you do not understand this message, or if there are no custom boot menu " +"entries, you can ignore this message." +msgstr "" +"V primeru, da tega sporočila ne razumete ali nimate nobenih vnosov po meri " +"v zagonskem meniju se za to sporočilo ne menite." #~ msgid "" #~ "In either case, whenever you want GRUB 2 to be loaded directly from MBR, " diff -Nru grub2-2.02~beta2/debian/po/sv.po grub2-2.02~beta2/debian/po/sv.po --- grub2-2.02~beta2/debian/po/sv.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/sv.po 2018-02-26 20:17:27.000000000 +0000 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: grub2_sv\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-15 16:53+0100\n" "Last-Translator: Martin Bagge / brother \n" "Language-Team: Swedish \n" @@ -354,22 +354,39 @@ "OS installations correctly." msgstr "" "Vissa EFI-baserade system beter sig felaktigt och kan inte hantera nyare " -"uppstartshanterare korrekt. Om Grub-installationen forceras in i en " -"flyttbar EFI-enhet så ska detta säkerställa att systemet kommer att starta " -"Debian korrekt oavsett sådana problem. Å andra sidan kan detta innebära att " -"andra operativsystem inte kan startas eftersom de är beroende av den " -"sökvägen. Om detta är fallet behöver du säkerställa att Grub ställts in " -"komplett för att kunna starta andra operativsystem korrekt." +"uppstartshanterare korrekt. Om Grub-installationen forceras in i en flyttbar " +"EFI-enhet så ska detta säkerställa att systemet kommer att starta Debian " +"korrekt oavsett sådana problem. Å andra sidan kan detta innebära att andra " +"operativsystem inte kan startas eftersom de är beroende av den sökvägen. Om " +"detta är fallet behöver du säkerställa att Grub ställts in komplett för att " +"kunna starta andra operativsystem korrekt." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Kommandorad för kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -381,13 +398,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Standardkommandorad för kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -397,13 +414,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map har skapats på nytt" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -416,7 +433,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -430,7 +447,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ta.po grub2-2.02~beta2/debian/po/ta.po --- grub2-2.02~beta2/debian/po/ta.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ta.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: ta\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-02-16 10:15+0530\n" "Last-Translator: Dr.T.Vasudevan \n" "Language-Team: Tamil \n" @@ -342,15 +342,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "கேப்ரீபிஎஸ்டி கட்டளை வரி:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -362,13 +379,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "கேப்ரீபிஎஸ்டி முன்னிருப்பு கட்டளை வரி:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -378,13 +395,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map மறு உருவாக்கப்பட்டது" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -396,7 +413,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -410,7 +427,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/templates.pot grub2-2.02~beta2/debian/po/templates.pot --- grub2-2.02~beta2/debian/po/templates.pot 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/templates.pot 2018-02-26 20:17:27.000000000 +0000 @@ -1,6 +1,6 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the grub2 package. # FIRST AUTHOR , YEAR. # #, fuzzy @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -293,15 +293,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -310,13 +327,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -324,13 +341,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -339,7 +356,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -349,7 +366,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/th.po grub2-2.02~beta2/debian/po/th.po --- grub2-2.02~beta2/debian/po/th.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/th.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-15 12:54+0700\n" "Last-Translator: Theppitak Karoonboonyanan \n" "Language-Team: Thai \n" @@ -339,15 +339,32 @@ "คุณจะต้องตรวจสอบให้แน่ใจว่าได้ตั้งค่า GRUB " "ได้สำเร็จเพื่อให้สามารถบูตระบบปฏิบัติการอื่นได้อย่างถูกต้องด้วย" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "พารามิเตอร์สำหรับบูต kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -359,13 +376,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "พารามิเตอร์สำหรับบูต kFreeBSD แบบปกติ:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -373,13 +390,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "สร้าง /boot/grub/device.map ใหม่เรียบร้อยแล้ว" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -391,7 +408,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -404,7 +421,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/tr.po grub2-2.02~beta2/debian/po/tr.po --- grub2-2.02~beta2/debian/po/tr.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/tr.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: debian-installer\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-21 21:54+0200\n" "Last-Translator: Mert Dirik \n" "Language-Team: Debian L10n Turkish \n" @@ -363,15 +363,32 @@ "de düzgün bir biçimde başlatabilecek şekilde başarı ile yapılandırıldığından " "emin olmalısınız." -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD komut satırı:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -383,13 +400,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Öntanımlı kFreeBSD komut satırı:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -399,13 +416,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map dosyası yeniden oluşturuldu" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -418,7 +435,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -432,7 +449,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/ug.po grub2-2.02~beta2/debian/po/ug.po --- grub2-2.02~beta2/debian/po/ug.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/ug.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub_debian\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-01-20 11:29+0600\n" "Last-Translator: Sahran \n" "Language-Team: Uyghur Computer Science Association \n" @@ -352,15 +352,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD بۇيرۇق قۇرى:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -372,13 +389,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD كۆڭۈلدىكى بۇيرۇق قۇرى:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -388,13 +405,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map ھاسىل قىلىندى" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -406,7 +423,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -420,7 +437,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/uk.po grub2-2.02~beta2/debian/po/uk.po --- grub2-2.02~beta2/debian/po/uk.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/uk.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2010-12-09 23:57+0200\n" "Last-Translator: Yatsenko Alexandr \n" "Language-Team: Ukrainian \n" @@ -351,15 +351,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Рядок параметрів ядра kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -372,13 +389,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Типовий рядок параметрів ядра kFreeBSD:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -388,13 +405,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map було створено наново" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -406,7 +423,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -420,7 +437,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/vi.po grub2-2.02~beta2/debian/po/vi.po --- grub2-2.02~beta2/debian/po/vi.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/vi.po 2018-02-26 20:17:27.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2012-04-23 20:48+0700\n" "Last-Translator: Hai Lang \n" "Language-Team: Vietnamese \n" @@ -350,15 +350,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "Dòng lệnh kFreeBSD:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -370,13 +387,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "Dòng lệnh kFreeBSD mặc định:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -386,13 +403,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "Tập tin /boot/grub/device.map đã được tạo lại." #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -405,7 +422,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -419,7 +436,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/zh_CN.po grub2-2.02~beta2/debian/po/zh_CN.po --- grub2-2.02~beta2/debian/po/zh_CN.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/zh_CN.po 2018-02-26 20:17:27.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub2-po-debconf master\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2011-05-28 17:29+0800\n" "Last-Translator: YunQiang Su \n" "Language-Team: Chinese (simplified) \n" @@ -327,15 +327,32 @@ "OS installations correctly." msgstr "" -#. Type: string +#. Type: boolean +#. Description +#: ../templates.in:4001 +msgid "Update NVRAM variables to automatically boot into Debian?" +msgstr "" + +#. Type: boolean #. Description #: ../templates.in:4001 +msgid "" +"GRUB can configure your platform's NVRAM variables so that it boots into " +"Debian automatically when powered on. However, you may prefer to disable " +"this behavior and avoid changes to your boot configuration. For example, if " +"your NVRAM variables have been setup such that your system contacts a PXE " +"server on every boot, this would preserve that behavior." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:5001 msgid "kFreeBSD command line:" msgstr "kFreeBSD 参数:" #. Type: string #. Description -#: ../templates.in:4001 +#: ../templates.in:5001 msgid "" "The following kFreeBSD command line was extracted from /etc/default/grub or " "the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " @@ -347,13 +364,13 @@ #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "kFreeBSD default command line:" msgstr "kFreeBSD 默认命令行:" #. Type: string #. Description -#: ../templates.in:5001 +#: ../templates.in:6001 msgid "" "The following string will be used as kFreeBSD parameters for the default " "menu entry but not for the recovery mode." @@ -361,13 +378,13 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "/boot/grub/device.map has been regenerated" msgstr "/boot/grub/device.map 已经生成" #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "The file /boot/grub/device.map has been rewritten to use stable device " "names. In most cases, this should significantly reduce the need to change it " @@ -378,7 +395,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "However, since more than one disk is present in the system, it is possible " "that the system is depending on the old device map. Please check whether " @@ -390,7 +407,7 @@ #. Type: note #. Description -#: ../templates.in:6001 +#: ../templates.in:7001 msgid "" "If you do not understand this message, or if there are no custom boot menu " "entries, you can ignore this message." diff -Nru grub2-2.02~beta2/debian/po/zh_TW.po grub2-2.02~beta2/debian/po/zh_TW.po --- grub2-2.02~beta2/debian/po/zh_TW.po 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/po/zh_TW.po 2018-02-26 20:17:27.000000000 +0000 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: grub2\n" "Report-Msgid-Bugs-To: grub2@packages.debian.org\n" -"POT-Creation-Date: 2014-12-13 20:23+0000\n" +"POT-Creation-Date: 2017-09-14 16:15-0600\n" "PO-Revision-Date: 2014-12-17 17:08-0800\n" "Last-Translator: Vincent Chen \n" "Language-Team: Debian-user in Chinese [Big5] /dev/null 2>&1 && systemd-detect-virt --quiet --container } +no_nvram_arg() { + db_get grub2/update_nvram + if [ "$RET" = false ]; then + echo "--no-nvram" + fi +} + run_grub_install() { if ! grub-install $@ ; then @@ -373,6 +380,15 @@ sed -i -e 's/^GRUB_HIDDEN_TIMEOUT=/#&/' "$tmp_default_grub" fi ;; + grub-ieee1275) + if grep ^platform /proc/cpuinfo | grep -q PowerNV; then + cat <<-EOF >>"$tmp_default_grub" + + # Disable os-prober for ppc64el on the PowerNV platform (for Petitboot) + GRUB_DISABLE_OS_PROBER=true + EOF + fi + ;; esac ucf --three-way --debconf-ok --sum-file=/usr/share/grub/default/grub.md5sum ${tmp_default_grub} /etc/default/grub @@ -686,6 +702,13 @@ case $bootloader_id in kubuntu) bootloader_id=ubuntu ;; esac + + if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10; then + if [ -e "/boot/efi/EFI/${bootloader_id}/fbx64.efi" ]; then + rm -f "/boot/efi/EFI/${bootloader_id}/fbx64.efi"; + fi + fi + if [ "$bootloader_id" ] && [ -d "/boot/efi/EFI/$bootloader_id" ]; then case @PACKAGE@ in grub-efi-ia32) target=i386-efi ;; @@ -698,7 +721,8 @@ if [ "$RET" = true ]; then FORCE_EXTRA_REMOVABLE="--force-extra-removable" fi - run_grub_install --target="$target" "$FORCE_EXTRA_REMOVABLE" + NO_NVRAM="$(no_nvram_arg)" + run_grub_install --target="$target" "$FORCE_EXTRA_REMOVABLE" "$NO_NVRAM" fi # /boot/grub/ has more chances of being accessible by GRUB @@ -708,6 +732,10 @@ cp $i /boot/grub/ fi done + + if type update-secureboot-policy >/dev/null 2>&1; then + update-secureboot-policy || true + fi ;; grub-ieee1275) @@ -716,7 +744,8 @@ # Output may be empty; if so, just update the core image but # don't install it to any PReP partition. prep_bootdev="$(/usr/lib/grub/powerpc-ieee1275/prep-bootdev)" - run_grub_install --target=powerpc-ieee1275 $prep_bootdev + NO_NVRAM="$(no_nvram_arg)" + run_grub_install --target=powerpc-ieee1275 $prep_bootdev "$NO_NVRAM" ;; esac ;; diff -Nru grub2-2.02~beta2/debian/rules grub2-2.02~beta2/debian/rules --- grub2-2.02~beta2/debian/rules 2016-01-22 11:00:40.000000000 +0000 +++ grub2-2.02~beta2/debian/rules 2018-02-26 20:17:23.000000000 +0000 @@ -218,7 +218,7 @@ 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 + LC_MESSAGES=C.UTF-8 LC_CTYPE=C.UTF-8 PATH="$$PATH:/sbin:/usr/sbin" VERBOSE=1 dh_auto_test --max-parallel=1 || true endif touch $@ diff -Nru grub2-2.02~beta2/debian/templates.in grub2-2.02~beta2/debian/templates.in --- grub2-2.02~beta2/debian/templates.in 2016-01-22 11:00:21.000000000 +0000 +++ grub2-2.02~beta2/debian/templates.in 2018-02-26 20:17:23.000000000 +0000 @@ -24,6 +24,16 @@ GRUB is configured successfully to be able to boot any other OS installations correctly. +Template: grub2/update_nvram +Type: boolean +Default: true +_Description: Update NVRAM variables to automatically boot into Debian? + GRUB can configure your platform's NVRAM variables so that it boots into + Debian automatically when powered on. However, you may prefer to disable + this behavior and avoid changes to your boot configuration. For example, + if your NVRAM variables have been setup such that your system contacts a + PXE server on every boot, this would preserve that behavior. + # still unused Template: grub2/kfreebsd_cmdline Type: string