T3965: arm: build script: inheritence in flavor_configs and bootloader options

This commit is contained in:
Runar Borge 2021-11-01 19:14:27 +01:00
parent 2264c8a812
commit 9b511bf61f
4 changed files with 24 additions and 3 deletions

View File

@ -8,6 +8,7 @@
"kernel_version": "5.10.76",
"kernel_flavor": "amd64-vyos",
"release_train": "sagitta",
"bootloaders": "syslinux,grub-efi",
"additional_repositories": [
"deb [arch=amd64] https://repo.saltproject.io/py3/debian/10/amd64/3003 buster main",
"deb [arch=amd64] http://repo.powerdns.com/debian bullseye-rec-45 main"

6
data/generic-arm64.json Normal file
View File

@ -0,0 +1,6 @@
{
"inherit_from": "data/defaults.json",
"architecture": "arm64",
"kernel_flavor": "v8-arm64-vyos",
"bootloaders": "grub-efi"
}

View File

@ -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

View File

@ -39,7 +39,7 @@ lb config noauto \
--bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console=ttyS0,115200 console=tty0 net.ifnames=0 biosdevname=0" \
--linux-flavours {{kernel_flavor}} \
--linux-packages linux-image-{{kernel_version}} \
--bootloader syslinux,grub-efi \
--bootloader {{bootloaders}} \
--binary-images iso-hybrid \
--checksums 'sha256 md5' \
--debian-installer none \