[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#789798: Updated patch to "add option to _not_ install to UEFI boot order"



Attached new patch inverts the sense of the option after review of the
wording by debian-l10n-english and fixes the propagation of the setting
to the installed grub2 package.

Ian.
From 4e038e33ea681dde7cccb05ba5a1a6b1e3ae8d6f Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@hellion.org.uk>
Date: Fri, 19 Jun 2015 15:17:40 +0100
Subject: [PATCH] Allow avoiding installation to NVRAM on EFI or IEEE1275
 systems

On systems which demand greater control over the boot order (e.g. ones which
PXE boot) it is useful to avoid messing with this during installation.

(Closes: #789798)
---
 debian/changelog                |  2 ++
 debian/grub-installer.templates | 12 ++++++++++++
 grub-installer                  | 12 ++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 24873db..87f4d17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ grub-installer (1.125) UNRELEASED; urgency=medium
   [ Ian Campbell ]
   * Correctly propagate grub-installer/force-efi-extra-removable to installed
     system. (Closes: #792247).
+  * Add preseedable option to allow avoiding installation to NVRAM.
+    (Closes: #789798)
 
  -- Ian Campbell <ijc@debian.org>  Mon, 13 Jul 2015 09:01:46 +0100
 
diff --git a/debian/grub-installer.templates b/debian/grub-installer.templates
index e294afb..73cbff0 100644
--- a/debian/grub-installer.templates
+++ b/debian/grub-installer.templates
@@ -285,3 +285,15 @@ _Description: Force GRUB installation to the EFI removable media path?
  installing GRUB there will make that operating system temporarily
  unbootable. GRUB can be manually configured later to boot it if
  necessary.
+
+Template: grub-installer/install-to-nvram
+Type: boolean
+Default: true
+# :sl4:
+_Description: Add GRUB to firmware NVRAM configuration?
+ By default, GRUB will be registered into NVRAM on platforms where this is
+ required, such as UEFI Boot Manager or OpenFirmware boot devices.
+ .
+ Occasionally this is not desired (for instance on systems that PXE boot
+ and then chainload). If you reject this option, the NVRAM will be left
+ untouched.
diff --git a/grub-installer b/grub-installer
index c407cd1..296419e 100755
--- a/grub-installer
+++ b/grub-installer
@@ -813,6 +813,18 @@ $grub_package grub2/force_efi_extra_removable boolean true
 EOF
 		fi
 
+		# Should we avoid installing/registering GRUB in NVRAM?
+		db_input low grub-installer/install-to-nvram || [ $? -eq 30 ]
+		db_go || exit 10
+		db_get grub-installer/install-to-nvram
+		if [ "$RET" = false ]; then
+			grub_install_params="$grub_install_params --no-nvram"
+			# Make sure this happens on upgrades too
+			$chroot $ROOT 'debconf-set-selections' <<EOF
+$grub_package grub2/install_to_nvram boolean false
+EOF
+		fi
+
 		if [ "$ARCH" = "powerpc/chrp_pegasos" ] ; then
 			# nvram is broken here
 			grub_install_params="$grub_install_params --no-nvram"
-- 
2.1.4


Reply to: