From b406b4a107a1e74057b56b1387a18468693d6357 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 13 Mar 2024 17:28:28 +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 | 8 ++++++++ 1 file changed, 8 insertions(+) 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(""" -- cgit v1.2.3