From 4979de99decfe2747c692b3dd9582104a5b91660 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 28 Nov 2022 17:40:24 +0000 Subject: [PATCH] bootloaders: Map /dev into jail & generate config This fixes that GRUB could not be installed. Fixes: #13008 Signed-off-by: Michael Tremer --- src/python/bootloaders.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/python/bootloaders.py b/src/python/bootloaders.py index 42714db..d1cb69f 100644 --- a/src/python/bootloaders.py +++ b/src/python/bootloaders.py @@ -89,6 +89,9 @@ class Grub(Bootloader): for disk in self.bricklayer.disks.selected: self.install_on_disk(disk, pakfire) + # Install configuration + self.install_configuration(pakfire) + @property def grub_arch(self): return "i386-pc" @@ -102,7 +105,20 @@ class Grub(Bootloader): def install_on_disk(self, disk, pakfire): log.info("Installing GRUB on %s" % disk.path) - pakfire.execute(["grub-install"] + self.grub_args + [disk.path]) + # Make /dev available in the jail + # XXX this should be limited to the device nodes we need only + bind = ["/dev"] + + pakfire.execute(["grub-install"] + self.grub_args + [disk.path], bind=bind) + + def install_configuration(self, pakfire): + """ + Generates a GRUB configuration file + """ + # XXX see above + bind = ["/dev"] + + pakfire.execute(["grub-mkconfig", "-o", "/boot/grub/grub.cfg"], bind=bind) class GrubEFI(Grub): -- 2.47.3