From 38fbaed5dec555b83590e2bddc1ad18418a87038 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 1 Sep 2026 08:08:17 +0000 Subject: version: T9269: report "container image" as boot type A container is never booted on its own - is_live_boot() parses the Kernel cmdline of the host system, which on an installed host contains a BOOT_IMAGE pointing to /boot//vmlinuz. A container was thus reported to be running from an "installed image". Report "container image" for containers and keep the livecd against installed image distinction for everything else. --- python/vyos/version.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/version.py b/python/vyos/version.py index f949d588a..dcaec8817 100644 --- a/python/vyos/version.py +++ b/python/vyos/version.py @@ -90,11 +90,15 @@ def get_full_version_data(fname=version_file): else: version_data['system_type'] = f"{hypervisor} guest" - # Get boot type, it can be livecd or installed image + # Get boot type, it can be a container, livecd or installed image # In installed images, the squashfs image file is named after its image version, # while on livecd it's just "filesystem.squashfs", that's how we tell a livecd boot # from an installed image - if is_live_boot(): + if is_running_as_container(): + # A container is never booted on its own - is_live_boot() would parse the + # Kernel cmdline of the host system + boot_via = "container image" + elif is_live_boot(): boot_via = "livecd" else: boot_via = "installed image" -- cgit v1.2.3