From b8e182138afddfe6a1d20a0aa5d543eca99058df Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 7 Sep 2026 16:42:03 +0200 Subject: T9014: install flavor.json before Debian packages are installed The vyos-1x-smoketest maintainer script now queries the image flavor to implant the correct serial console device and speed into the configuration test data. This requires /usr/share/vyos/flavor.json to be present in the chroot before the Debian packages get installed, but config/includes.chroot is only copied into the chroot after package installation. Write flavor.json to config/includes.chroot_before_packages instead, which live-build copies into the chroot prior to installing packages. version.json and the activation hints are unaffected and remain in config/includes.chroot. Companion change to vyos-1x commit 2f9fe3e74 ("smoketest: T9014: make configtest serial console image flavor agnostic"). --- scripts/image-build/build-vyos-image | 8 +++++++- scripts/image-build/defaults.py | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image index 40d9cfdf..ea8d2f4c 100755 --- a/scripts/image-build/build-vyos-image +++ b/scripts/image-build/build-vyos-image @@ -541,7 +541,13 @@ DOCUMENTATION_URL="{build_config['documentation_url']}" os.makedirs(vyos_data_dir, exist_ok=True) with open(os.path.join(vyos_data_dir, 'version.json'), 'w') as f: json.dump(version_data, f) - with open(os.path.join(vyos_data_dir, 'flavor.json'), 'w') as f: + # The flavor data is required by the maintainer scripts of the Debian + # packages we install, thus it must be in place before the packages are + # installed and not only afterwards + vyos_data_dir_early = os.path.join(defaults.CHROOT_INCLUDES_EARLY_DIR, + "usr/share/vyos") + os.makedirs(vyos_data_dir_early, exist_ok=True) + with open(os.path.join(vyos_data_dir_early, 'flavor.json'), 'w') as f: json.dump(flavor_data, f) with open(os.path.join(binary_includes_dir, 'version.json'), 'w') as f: json.dump(version_data, f) diff --git a/scripts/image-build/defaults.py b/scripts/image-build/defaults.py index 29a6d59f..be417ca1 100644 --- a/scripts/image-build/defaults.py +++ b/scripts/image-build/defaults.py @@ -62,6 +62,9 @@ PBUILDER_DIR = 'pbuilder' LB_CONFIG_DIR = 'config' CHROOT_INCLUDES_DIR = 'config/includes.chroot' +# Files that must already be present while the Debian packages are installed, +# live-build copies this directory into the chroot before package installation +CHROOT_INCLUDES_EARLY_DIR = 'config/includes.chroot_before_packages' BINARY_INCLUDES_DIR = 'config/includes.binary' ARCHIVES_DIR = 'config/archives/' -- cgit v1.2.3