From eb71e3d85c9bdda60d9d6b13c546beb0a1d4188d Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 14 Jan 2020 18:28:23 +0100 Subject: [PATCH] assembler/qemu: grub prefix relative to mountpoint The grub prefix ("/boot/grub2") should be defined as relative to the mountpoint of the filesystem containing it, i.e. /boot/grub2 if it is on the root filesystem or /grub2 if boot is on a separate partition. --- assemblers/org.osbuild.qemu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assemblers/org.osbuild.qemu b/assemblers/org.osbuild.qemu index 12b1cc9d..22cec419 100755 --- a/assemblers/org.osbuild.qemu +++ b/assemblers/org.osbuild.qemu @@ -513,11 +513,14 @@ def install_grub2(image: str, pt: PartitionTable, options): partid = grub2_partition_id(pt) + str(boot_part.index + 1) print(f"grub2 prefix {partid}") + # the path containing the grub files relative partition + grub_path = os.path.relpath("/boot/grub2", boot_part.mountpoint) + # now created the core image subprocess.run(["grub2-mkimage", "--verbose", "--directory", f"/usr/lib/grub/{platform}", - "--prefix", f"(,{partid})/boot/grub2", + "--prefix", f"(,{partid})/{grub_path}", "--format", platform, "--compression", "auto", "--output", core_path] +