summaryrefslogtreecommitdiff
path: root/vmdb/plugins/grub_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'vmdb/plugins/grub_plugin.py')
-rw-r--r--vmdb/plugins/grub_plugin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/vmdb/plugins/grub_plugin.py b/vmdb/plugins/grub_plugin.py
index 64522ec..4c06d40 100644
--- a/vmdb/plugins/grub_plugin.py
+++ b/vmdb/plugins/grub_plugin.py
@@ -139,6 +139,7 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
self.bind_mount_many(chroot, ['/dev', '/proc', '/sys'], state)
if efi_dev:
self.mount(chroot, efi_dev, '/boot/efi', state)
+ self.apt_update(chroot)
self.install_package(chroot, grub_package)
kernel_params = [
@@ -225,6 +226,11 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
def chroot_path(self, chroot, path):
return os.path.normpath(os.path.join(chroot, '.' + path))
+ def apt_update(self, chroot):
+ env = os.environ.copy()
+ env['DEBIAN_FRONTEND'] = 'noninteractive'
+ vmdb.runcmd_chroot(chroot, ['apt-get', 'update'], env=env)
+
def install_package(self, chroot, package):
env = os.environ.copy()
env['DEBIAN_FRONTEND'] = 'noninteractive'