diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-config | 18 | ||||
-rwxr-xr-x | scripts/check-qemu-install | 9 | ||||
-rwxr-xr-x | scripts/live-build-config | 2 |
3 files changed, 24 insertions, 5 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 diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 76540c73..87a34afd 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -118,8 +118,11 @@ def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, iso_img=None): cpu = "" uefi = "" + uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52" if enable_uefi: uefi = "-bios /usr/share/OVMF/OVMF_CODE.fd" + name = f"{name}-UEFI" + uuid = "d27cf29e-4419-4407-8f82-dc73d1acd184" cdrom = "" if iso_img: @@ -143,6 +146,7 @@ def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, iso_img=None): -netdev user,id=n6 -device virtio-net-pci,netdev=n6,mac={macbase}:06 \ -netdev user,id=n7 -device virtio-net-pci,netdev=n7,mac={macbase}:07 \ -machine accel=kvm \ + -uuid {uuid} \ -nographic {cpu} {cdrom} {kvm} \ -drive format=raw,file={disk_img}' @@ -199,6 +203,7 @@ if not os.path.isfile(args.disk): else: log.info('Diskimage already exists, using the existing one') +test_timeout = 7200 # seconds try: ################################################# # Installing image to disk @@ -352,7 +357,7 @@ try: log.info('Executing VyOS smoketests') c.sendline('/usr/bin/vyos-smoketest') i = c.expect(['\n +Invalid command:', '\n +Set failed', - 'No such file or directory', r'\n\S+@\S+[$#]'], timeout=7200) + 'No such file or directory', r'\n\S+@\S+[$#]'], timeout=test_timeout) if i == 0: raise Exception('Invalid command detected') @@ -415,7 +420,7 @@ try: log.info('Executing load config tests') c.sendline('/usr/bin/vyos-configtest') i = c.expect(['\n +Invalid command:', 'No such file or directory', - r'\n\S+@\S+[$#]'], timeout=3600) + r'\n\S+@\S+[$#]'], timeout=test_timeout) if i==0: raise Exception('Invalid command detected') diff --git a/scripts/live-build-config b/scripts/live-build-config index c9d6ee1d..1813e608 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -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 \ |