mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
build-script: T3664: Added more options to the image format
Added two new options: - `image_ext`. Can be used if the file extension needs to be different than the image format - `image_opts`. Required if a target format needs extra options.
This commit is contained in:
parent
01d79fb3eb
commit
d144519a53
@ -639,6 +639,8 @@ if __name__ == "__main__":
|
||||
# Most other formats, thankfully, can be produced with just `qemu-img convert`
|
||||
other_formats = filter(lambda x: x not in ["iso", "raw"], build_config["image_format"])
|
||||
for f in other_formats:
|
||||
target = f"{os.path.splitext(raw_image)[0]}.{f}"
|
||||
image_ext = build_config.get("image_ext", f)
|
||||
image_opts = build_config.get("image_opts", "")
|
||||
target = f"{os.path.splitext(raw_image)[0]}.{image_ext}"
|
||||
print(f"I: Building {f} file {target}")
|
||||
cmd(f"qemu-img convert -f raw -O {f} {raw_image} {target}")
|
||||
cmd(f"qemu-img convert -f raw -O {f} {image_opts} {raw_image} {target}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user