summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-01 08:08:17 +0000
committerChristian Breunig <christian@breunig.cc>2026-09-01 17:28:54 +0200
commit38fbaed5dec555b83590e2bddc1ad18418a87038 (patch)
treea76df5fb427b9552733df18ad3f9ddc814f417b4 /python
parentdd7962cdcfb60ad6e57a5b041d91e0d1707d7e96 (diff)
downloadvyos-1x-38fbaed5dec555b83590e2bddc1ad18418a87038.tar.gz
vyos-1x-38fbaed5dec555b83590e2bddc1ad18418a87038.zip
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/<version>/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.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/version.py8
1 files changed, 6 insertions, 2 deletions
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"