From ea4a6d135e88f21df3fb4dbbad310e39a6645e46 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sat, 12 Oct 2019 17:53:22 +0200 Subject: [PATCH] assembler/qemu/grub: don't search for the root partition We know the root partition we want, as we are setting it up. There is no need to search for it by filesystem UUID. This simplifies the setup and means the level 1.5 bootloader is always the same, and not dependent on an embedded UUID. Signed-off-by: Tom Gundersen --- assemblers/org.osbuild.qemu | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/assemblers/org.osbuild.qemu b/assemblers/org.osbuild.qemu index 78d67a3f..644480cf 100755 --- a/assemblers/org.osbuild.qemu +++ b/assemblers/org.osbuild.qemu @@ -36,7 +36,6 @@ def main(tree, output_dir, options, loop_client): image = f"/var/tmp/osbuild-image.raw" grub2_core = "/var/tmp/grub2-core.img" - grub2_load = "/var/tmp/grub2-load.cfg" mountpoint = f"/tmp/osbuild-mnt" # Create an empty image file @@ -52,10 +51,6 @@ def main(tree, output_dir, options, loop_client): partition_offset = partition["start"] * 512 partition_size = partition["size"] * 512 - with open(grub2_load, "w") as load: - load.write(f"search.fs_uuid {root_fs_uuid} root \n" - "set prefix=($root)'/boot/grub2'\n") - # Create the level-2 bootloader # The purpose of this is to find the grub modules and configuration # to be able to start the level-3 bootloader. It contains the modules @@ -63,12 +58,11 @@ def main(tree, output_dir, options, loop_client): subprocess.run(["grub2-mkimage", "--verbose", "--directory", "/usr/lib/grub/i386-pc", - "--prefix", "/boot/grub2", + "--prefix", "(,msdos1)/boot/grub2", "--format", "i386-pc", "--compression", "auto", - "--config", grub2_load, "--output", grub2_core, - "part_msdos", "ext2", "biosdisk", "search_fs_uuid"], + "part_msdos", "ext2", "biosdisk"], check=True) assert os.path.getsize(grub2_core) < partition_offset - 512