From 24467dbc47b3e0f775f059b6263d3bab5640bac5 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Aug 12 2020 20:33:18 +0000 Subject: Avoid updating nvram when installing grub2 On certain environments, grub2-install fails trying to update nvram, even when it should not be updating it anyway. This is a temporary measure anyway, the longer term plan is to avoid calling grub2-install in UEFI environments. Before: Using GRUB2. Writing grub /var/tmp/imgcreate-_9hsu5qa/install_root/boot/grub2/device.map Installing grub2 to /dev/loop0 Installing for arm64-efi platform. Could not prepare Boot variable: No such file or directory grub2-install: error: efibootmgr failed to register the boot entry: Input/output error. Unable to create appliance : Unable to install grub2 bootloader After: Using GRUB2. Writing grub /var/tmp/imgcreate-5r27_2zx/install_root/boot/grub2/device.map Installing grub2 to /dev/loop0 Installing for arm64-efi platform. Installation finished. No error reported. Signed-off-by: Pablo Greco --- diff --git a/appcreate/appliance.py b/appcreate/appliance.py index 6ceac85..ef10481 100644 --- a/appcreate/appliance.py +++ b/appcreate/appliance.py @@ -473,7 +473,7 @@ class ApplianceImageCreator(ImageCreator): # mount full /dev filesystem subprocess.call(["mount", "--bind", "/dev", self._instroot + "/dev"]) - rc = subprocess.call(["chroot", self._instroot, "grub2-install", "--no-floppy", "--grub-mkdevicemap=/boot/grub2/device.map"] + self.grub2inst_params + [loopdev]) + rc = subprocess.call(["chroot", self._instroot, "grub2-install", "--no-floppy", "--no-nvram", "--grub-mkdevicemap=/boot/grub2/device.map"] + self.grub2inst_params + [loopdev]) if rc != 0: subprocess.call(["umount", self._instroot + "/dev"])