diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-03-16 12:30:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-16 12:30:28 +0100 |
commit | 22345e61da3d513b492326884bb5e2030b6f041c (patch) | |
tree | 4609a8e340cbdd15be4b9d70842b8696deeda148 /scripts/build-vyos-image | |
parent | cbd25180f5a18a2e8afe16c4e980b31bff9d4cc5 (diff) | |
parent | b406b4a107a1e74057b56b1387a18468693d6357 (diff) | |
download | vyos-build-22345e61da3d513b492326884bb5e2030b6f041c.tar.gz vyos-build-22345e61da3d513b492326884bb5e2030b6f041c.zip |
Merge pull request #532 from dmbaturin/T1449-default-config-field-sagitta
build: T1449: add default_config field support in flavor files to allow people to easily include a custom default config
Diffstat (limited to 'scripts/build-vyos-image')
-rwxr-xr-x | scripts/build-vyos-image | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index 94fedf62..d26c8a65 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -428,6 +428,14 @@ DOCUMENTATION_URL="{build_config['documentation_url']}" with open(file_path, 'w') as f: f.write(i["data"]) + ## Create the default config + ## Technically it's just another includes.chroot entry, + ## but it's special enough to warrant making it easier for flavor writers + if has_nonempty_key(build_config, "default_config"): + file_path = os.path.join(chroot_includes_dir, "opt/vyatta/etc/config.boot.default") + os.makedirs(os.path.dirname(file_path), exist_ok=True) + with open(file_path, 'w') as f: + f.write(build_config["default_config"]) ## Configure live-build lb_config_tmpl = jinja2.Template(""" |