]> git.proxmox.com Git - grub2.git/commitdiff
Add grub2/update_nvram template to allow users to disable NVRAM updates during packag...
authordann frazier <dann.frazier@canonical.com>
Thu, 19 Jan 2017 21:43:04 +0000 (14:43 -0700)
committerdann frazier <dann.frazier@canonical.com>
Thu, 19 Jan 2017 22:12:59 +0000 (15:12 -0700)
debian/changelog
debian/config.in
debian/postinst.in
debian/templates.in

index 361d310e3782464d414f9e9dd3fe80cd2e24de9f..2c56514642b2a92f89424f6bcec4adf125e36c01 100644 (file)
@@ -1,8 +1,13 @@
 grub2 (2.02~beta3-4) UNRELEASED; urgency=medium
 
+  [ Colin Watson ]
   * Drop build-dependency on libxen-dev, unnecessary now that upstream has
     taken a copy of the necessary public headers.
 
+  [ dann frazier ]
+  * Add grub2/update_nvram template to allow users to disable NVRAM
+    updates during package upgrades (LP: #1642298).
+
  -- Colin Watson <cjwatson@debian.org>  Sat, 05 Nov 2016 14:37:18 +0000
 
 grub2 (2.02~beta3-3) unstable; urgency=medium
index 27775c324e5484041463770a0d9fb190233270f1..aa774ba883781b99cfdf424cf549ffdee7acb5c6 100644 (file)
@@ -78,4 +78,9 @@ case @PACKAGE@ in
     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
index fa6d736bfa25c6b4ba90afef4cdac67a3b938b2e..1fe45ba0d8e92bbc1270d19bd157c939409ed817 100644 (file)
@@ -299,6 +299,13 @@ running_in_container()
   type systemd-detect-virt >/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
@@ -698,7 +705,8 @@ case "$1" in
           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
@@ -720,7 +728,8 @@ case "$1" in
             # 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
       ;;
index c71ae97b700a20ca22f7f1a55b6e4a156f03f65e..2a8a2dd24b7fc884c65206e0864c33bac3b7be7a 100644 (file)
@@ -24,6 +24,16 @@ _Description: Force extra installation to the EFI removable media path?
  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