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.
This commit is contained in:
Christian Kellner 2020-01-14 18:28:23 +01:00 committed by Tom Gundersen
parent abfc4d6b5a
commit eb71e3d85c

View file

@ -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] +