summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-03-30 22:05:45 +0200
committerChristian Breunig <christian@breunig.cc>2026-03-31 15:08:56 +0200
commit52c3ea6742aed4058464c8c9cc690b2acadd7cb0 (patch)
treea75411ea3da9052285190f4cd762e3c59b39611f /scripts
parentbd318b43f8b414af9da3f458071486cae2062077 (diff)
downloadvyos-build-52c3ea6742aed4058464c8c9cc690b2acadd7cb0.tar.gz
vyos-build-52c3ea6742aed4058464c8c9cc690b2acadd7cb0.zip
flavor: T8375: add flavor.json during build into resulting image
In order for amd64 or arm64 images to know their serial console settings, we embed a new file named "flavor.json" under "/usr/share/vyos" into the resulting image. The file holds configuration parameters unique to the build flavor. Corresponding library functions are available via a Python vyos.flavor module.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/image-build/build-vyos-image12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image
index a311c2d8..ee7905b4 100755
--- a/scripts/image-build/build-vyos-image
+++ b/scripts/image-build/build-vyos-image
@@ -439,6 +439,12 @@ def build():
build_config['version'] = version
+ flavor_data = {
+ 'console_type': build_config["console_type"],
+ 'console_num': build_config["console_num"],
+ 'console_speed': build_config["console_speed"]
+ }
+
version_data = {
'version': version,
'flavor': build_config["build_flavor"],
@@ -479,6 +485,8 @@ 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:
+ json.dump(flavor_data, f)
with open(os.path.join(binary_includes_dir, 'version.json'), 'w') as f:
json.dump(version_data, f)
@@ -631,8 +639,8 @@ DOCUMENTATION_URL="{build_config['documentation_url']}"
--archive-areas "{{debian_archive_areas}}" \
--backports true \
--binary-image iso-hybrid \
- --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{serial_interface}}" console=tty0 net.ifnames=0 biosdevname=0" \
- --bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console="{{serial_interface}}" console=tty0 net.ifnames=0 biosdevname=0" \
+ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{console_type}}{{console_num}},{{console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
+ --bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console="{{console_type}}{{console_num}},{{console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
--bootloaders "{{bootloaders}}" \
--checksums "sha256" \
--chroot-squashfs-compression-type "{{squashfs_compression_type}}" \