From 11f4d356f6743fde6da8d5dfe0f924f26b46d6fd Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 13 Mar 2024 17:35:01 +0000 Subject: build: T1449: add default_config field support in flavor files to allow people to easily include a custom default config --- scripts/build-vyos-image | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') 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 \ -- cgit v1.2.3