diff options
author | Daniil Baturin <daniil@vyos.io> | 2021-11-13 20:02:01 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 20:02:01 +0700 |
commit | 95eace9746c3de17d7e9b80b1f81cc8eaa0d7d53 (patch) | |
tree | f211229312f121a362cd537271ba4c8818047de2 /scripts/build-config | |
parent | ab8ae2fda8358f399aae1468f2a70377043aca3a (diff) | |
parent | 9b511bf61ff55282c38785d69d2e95d20db66aba (diff) | |
download | vyos-build-95eace9746c3de17d7e9b80b1f81cc8eaa0d7d53.tar.gz vyos-build-95eace9746c3de17d7e9b80b1f81cc8eaa0d7d53.zip |
Merge pull request #195 from runborg/multiarch
T3965: arm: build script: inheritence in flavor_configs and bootloade…
Diffstat (limited to 'scripts/build-config')
-rwxr-xr-x | scripts/build-config | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/build-config b/scripts/build-config index fa0b3512..4f4a8c08 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -48,14 +48,27 @@ def get_validator(optdict, name): except KeyError: return None +def load_config(filename): + with open(filename, 'r') as f: + print(f'Loading {filename}') + this_config = json.load(f) + + if not 'inherit_from' in this_config: + print(f'No inheritance detected') + return this_config + + inherited_config = load_config(this_config['inherit_from']) + del this_config['inherit_from'] + inherited_config.update(this_config) + return inherited_config + # Load the build flavor file build_flavor = os.getenv('VYOS_BUILD_FLAVOR') if build_flavor is None: build_flavor = defaults.DEFAULT_BUILD_FLAVOR try: - with open(build_flavor, 'r') as f: - build_defaults = json.load(f) + build_defaults = load_config(build_flavor) except Exception as e: print("Failed to open the build flavor file {0}: {1}".format(build_flavor, e)) sys.exit(1) @@ -143,6 +156,7 @@ if env_check_retval > 0: args['kernel_version'] = build_defaults['kernel_version'] args['kernel_flavor'] = build_defaults['kernel_flavor'] +args['bootloaders'] = build_defaults['bootloaders'] # Save to file |