summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-16 09:44:16 +0100
committerGitHub <noreply@github.com>2024-03-16 09:44:16 +0100
commitd4dd9bfcfa39ba90a6cc19e93a22a7f8a0ed71f6 (patch)
treec14bb616656fa4e7aa7fc4686fad70db2db745e1
parent7552e07320b990d87e3af589e00ec9b2b2241980 (diff)
parent11f4d356f6743fde6da8d5dfe0f924f26b46d6fd (diff)
downloadvyos-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-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 \