diff options
author | Christian Breunig <christian@breunig.cc> | 2024-03-16 09:44:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-16 09:44:16 +0100 |
commit | d4dd9bfcfa39ba90a6cc19e93a22a7f8a0ed71f6 (patch) | |
tree | c14bb616656fa4e7aa7fc4686fad70db2db745e1 | |
parent | 7552e07320b990d87e3af589e00ec9b2b2241980 (diff) | |
parent | 11f4d356f6743fde6da8d5dfe0f924f26b46d6fd (diff) | |
download | vyos-build-d4dd9bfcfa39ba90a6cc19e93a22a7f8a0ed71f6.tar.gz vyos-build-d4dd9bfcfa39ba90a6cc19e93a22a7f8a0ed71f6.zip |
Merge pull request #533 from dmbaturin/T1449-default-config-field-current
build: T1449: add default_config field support in flavor files to allow people to easily include a custom default config
-rwxr-xr-x | scripts/build-vyos-image | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index 95ce3125..7cef0107 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -441,6 +441,15 @@ 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(""" lb config noauto \ |