summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2024-03-13 17:28:28 +0000
committerDaniil Baturin <daniil@baturin.org>2024-03-13 17:28:28 +0000
commitb406b4a107a1e74057b56b1387a18468693d6357 (patch)
treedd039e2901b7b00f9a25b10e2a06cd6f9b6b6e8e /scripts
parent213c9e34bff3ef72ac9fdc83863dd77db8193f0f (diff)
downloadvyos-build-b406b4a107a1e74057b56b1387a18468693d6357.tar.gz
vyos-build-b406b4a107a1e74057b56b1387a18468693d6357.zip
build: T1449: add default_config field support in flavor files
to allow people to easily include a custom default config
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-vyos-image8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image
index 6bfe3faa..1785ae22 100755
--- a/scripts/build-vyos-image
+++ b/scripts/build-vyos-image
@@ -424,6 +424,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("""