diff options
author | Daniel Semkowicz <dse@thaumatec.com> | 2024-06-20 15:03:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-25 11:50:58 +0100 |
commit | 0ed32141fe26810e205943fe01735c3380b331a4 (patch) | |
tree | 1c74b21533317293727feed0f210dc2cf65471ee | |
parent | 8de3508743a147f65cd44b9abc6abccfeaeae929 (diff) | |
download | poky-0ed32141fe26810e205943fe01735c3380b331a4.tar.gz |
os-release: Fix VERSION_CODENAME in case it is empty
If DISTRO_CODENAME was not set, VERSION_CODENAME field was populated
with unparsed string. This resulted in the following line in os-release
file:
VERSION_CODENAME="${DISTRO_CODENAME}"
According to systemd documentation, this field is optional.
Fix the problem by setting VERSION_CODENAME conditionally, only if
DISTRO_CODENAME was set.
(From OE-Core rev: 70a0b8bc1d846c857be90ce2e97e60c5ee32558e)
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/os-release/os-release.bb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb index 8906906bc3..93af08c182 100644 --- a/meta/recipes-core/os-release/os-release.bb +++ b/meta/recipes-core/os-release/os-release.bb | |||
@@ -24,7 +24,7 @@ ID = "${DISTRO}" | |||
24 | NAME = "${DISTRO_NAME}" | 24 | NAME = "${DISTRO_NAME}" |
25 | VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}" | 25 | VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}" |
26 | VERSION_ID = "${DISTRO_VERSION}" | 26 | VERSION_ID = "${DISTRO_VERSION}" |
27 | VERSION_CODENAME = "${DISTRO_CODENAME}" | 27 | VERSION_CODENAME = "${@d.getVar('DISTRO_CODENAME') or ''}" |
28 | PRETTY_NAME = "${DISTRO_NAME} ${VERSION}" | 28 | PRETTY_NAME = "${DISTRO_NAME} ${VERSION}" |
29 | 29 | ||
30 | # The vendor field is hardcoded to "openembedded" deliberately. We'd | 30 | # The vendor field is hardcoded to "openembedded" deliberately. We'd |