diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-02-12 15:30:10 +0000 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-02-17 21:45:31 +0000 |
commit | d335f4c5833387e5e779d629086defa46818592c (patch) | |
tree | 868586422ff89d1524a0fae46d369e1af15cdd2a /src/shared | |
parent | 7eda2d7fa5a3e2ffa9b74945e51c564cb4a4bf0f (diff) | |
download | systemd-d335f4c5833387e5e779d629086defa46818592c.tar.gz |
os-util: allow missing VERSION_ID on the host
Rolling releases, like ArchLinux, do not set VERSION_ID in
their os-release files, so allow matching simply on ID if the host
does not provide anything.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/os-util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shared/os-util.c b/src/shared/os-util.c index 53679c9597..9aed3b5df4 100644 --- a/src/shared/os-util.c +++ b/src/shared/os-util.c @@ -205,7 +205,6 @@ int extension_release_validate( assert(name); assert(!isempty(host_os_release_id)); - assert(!isempty(host_os_release_version_id) || !isempty(host_os_release_sysext_level)); /* Now that we can look into the extension image, let's see if the OS version is compatible */ if (strv_isempty(extension_release)) { @@ -226,6 +225,12 @@ int extension_release_validate( return 0; } + /* Rolling releases do not typically set VERSION_ID (eg: ArchLinux) */ + if (isempty(host_os_release_version_id) && isempty(host_os_release_sysext_level)) { + log_debug("No version info on the host (rolling release?), but ID in %s matched.", name); + return 1; + } + /* If the extension has a sysext API level declared, then it must match the host API * level. Otherwise, compare OS version as a whole */ extension_release_sysext_level = strv_env_pairs_get(extension_release, "SYSEXT_LEVEL"); |