summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2024-03-13 17:35:01 +0000
committerDaniil Baturin <daniil@baturin.org>2024-03-13 17:35:01 +0000
commit11f4d356f6743fde6da8d5dfe0f924f26b46d6fd (patch)
treec790b583b437e23de703da67965d9c50ca2f6b73
parent2ef1bded20c26dd759b696fa47897e4cc3132450 (diff)
downloadvyos-build-11f4d356f6743fde6da8d5dfe0f924f26b46d6fd.tar.gz
vyos-build-11f4d356f6743fde6da8d5dfe0f924f26b46d6fd.zip
build: T1449: add default_config field support in flavor files
to allow people to easily include a custom default config
-rwxr-xr-xscripts/build-vyos-image9
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 \