Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: T6653: add build/manifest.json file (backport #736) #747

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/image-build/build-vyos-image
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,13 @@ if __name__ == "__main__":
with open(file_path, 'w') as f:
f.write(build_config["default_config"])

## Initialize build manifest
manifest = {
'build_config' : build_config,
'artifacts' : [iso_file],
'pre_build_config' : pre_build_config
}

## Configure live-build
lb_config_tmpl = jinja2.Template("""
lb config noauto \
Expand Down Expand Up @@ -627,6 +634,7 @@ Pin-Priority: 600
# if the flavor calls for them
if build_config["image_format"] != ["iso"]:
raw_image = raw_image.create_raw_image(build_config, iso_file, "tmp/")
manifest['artifacts'].append(raw_image)

if has_nonempty_key(build_config, "post_build_hook"):
# Some flavors require special procedures that aren't covered by qemu-img
Expand All @@ -644,3 +652,7 @@ Pin-Priority: 600
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} {image_opts} {raw_image} {target}")
manifest['artifacts'].append(target)

with open('manifest.json', 'w') as f:
f.write(json.dumps(manifest))
Loading