assemblers/qemu: fix the partition UUID in the pipeline
Otherwise, sfdik would pick one at random. We want our images to be reproducible to the extent possible, so we must move all randomness out of the assemblers when we can. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
0be34c8bcc
commit
f470c3f3a3
4 changed files with 5 additions and 1 deletions
|
|
@ -47,6 +47,7 @@ assembles it into an image. Pipelines are defined as JSON files like this one:
|
|||
"options": {
|
||||
"format": "qcow2",
|
||||
"filename": "example.qcow2",
|
||||
"ptuuid": "0x7e83a7ba",
|
||||
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
|
||||
"size": 3221225472
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ def loop_device(loop_client, image, size, offset=0):
|
|||
def main(tree, output_dir, options, loop_client):
|
||||
fmt = options["format"]
|
||||
filename = options["filename"]
|
||||
ptuuid = options["ptuuid"]
|
||||
root_fs_uuid = options["root_fs_uuid"]
|
||||
size = options["size"]
|
||||
|
||||
|
|
@ -56,7 +57,7 @@ def main(tree, output_dir, options, loop_client):
|
|||
subprocess.run(["truncate", "--size", str(size), image], check=True)
|
||||
|
||||
# Set up the partition table of the image
|
||||
partition_table = "label: mbr\nbootable, type=83"
|
||||
partition_table = f"label: mbr\nlabel-id: {ptuuid}\nbootable, type=83"
|
||||
subprocess.run(["sfdisk", "-q", image], input=partition_table, encoding='utf-8', check=True)
|
||||
r = subprocess.run(["sfdisk", "--json", image], stdout=subprocess.PIPE, encoding='utf-8', check=True)
|
||||
partition_table = json.loads(r.stdout)
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
"options": {
|
||||
"format": "qcow2",
|
||||
"filename": "base.qcow2",
|
||||
"ptuuid": "0x14fc63d2",
|
||||
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
|
||||
"size": 3221225472
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@
|
|||
"options": {
|
||||
"format": "qcow2",
|
||||
"filename": "f30-boot.qcow2",
|
||||
"ptuuid": "0x1cd1d44b",
|
||||
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
|
||||
"size": 3221225472
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue