Patch review
cover Patch review
Please review this set of changes for dunfell and have comments back by end of day Friday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/5460
The following changes since commit 96798603273bbab40a7e19bbb67a9a5398648c21:
openssh: Move sshdgenkeys.service to sshd.socket (2023-06-07 05:49:27 -1000)
are available in the Git repository at:
https://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut
Martin Siegumfeldt (1):
systemd-systemctl: fix instance template WantedBy symlink construction
Nikhil R (1):
libwebp: Fix CVE-2023-1999
Qiu Tingting (1):
e2fsprogs: fix ptest bug for second running
Randy MacLeod (1):
vim: upgrade 9.0.1429 -> 9.0.1527
Richard Purdie (1):
selftest/reproducible: Allow native/cross reuse in test
meta/lib/oeqa/selftest/cases/reproducible.py | 4 +- .../systemd/systemd-systemctl/systemctl | 13 ++++- .../e2fsprogs/e2fsprogs/run-ptest | 1 + .../e2fsprogs/e2fsprogs_1.45.7.bb | 3 + .../webp/files/CVE-2023-1999.patch | 55 +++++++++++++++++++ meta/recipes-multimedia/webp/libwebp_1.1.0.bb | 4 ++ meta/recipes-support/vim/vim.inc | 4 +- 7 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 meta/recipes-multimedia/webp/files/CVE-2023-1999.patch
Signature · 1 line
2.34.1
PATCH 1/5 libwebp: Fix CVE-2023-1999
From: Nikhil R <[email protected]>
Add patch to fix CVE-2023-1999
--- .../webp/files/CVE-2023-1999.patch | 55 +++++++++++++++++++ meta/recipes-multimedia/webp/libwebp_1.1.0.bb | 4 ++ 2 files changed, 59 insertions(+) create mode 100644 meta/recipes-multimedia/webp/files/CVE-2023-1999.patch
meta/recipes-multimedia/webp/files/CVE-2023-1999.patch new file +55 -0
@@ -0,0 +1,55 @@ +From a486d800b60d0af4cc0836bf7ed8f21e12974129 Mon Sep 17 00:00:00 2001 +From: James Zern <[email protected]> +Date: Wed, 22 Feb 2023 22:15:47 -0800 +Subject: [PATCH] EncodeAlphaInternal: clear result->bw on error + +This avoids a double free should the function fail prior to +VP8BitWriterInit() and a previous trial result's buffer carried over. +Previously in ApplyFiltersAndEncode() trial.bw (with a previous +iteration's buffer) would be freed, followed by best.bw pointing to the +same buffer. + +Since: +187d379d add a fallback to ALPHA_NO_COMPRESSION + +In addition, check the return value of VP8BitWriterInit() in this +function. + +Bug: webp:603 +Change-Id: Ic258381ee26c8c16bc211d157c8153831c8c6910 + +CVE: CVE-2023-1999 +Upstream-Status: Backport [https://github.com/webmproject/libwebp/commit/a486d800b60d0af4cc0836bf7ed8f21e12974129] +Signed-off-by: Nikhil R <[email protected]> +--- + src/enc/alpha_enc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/enc/alpha_enc.c b/src/enc/alpha_enc.c +index f7c02690e3..7d205586fe 100644 +--- a/src/enc/alpha_enc.c ++++ b/src/enc/alpha_enc.c +@@ -13,6 +13,7 @@ + + #include <assert.h> + #include <stdlib.h> ++#include <string.h> + + #include "src/enc/vp8i_enc.h" + #include "src/dsp/dsp.h" +@@ -148,6 +149,7 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height, + } + } else { + VP8LBitWriterWipeOut(&tmp_bw); ++ memset(&result->bw, 0, sizeof(result->bw)); + return 0; + } + } +@@ -162,7 +164,7 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height, + header = method | (filter << 2); + if (reduce_levels) header |= ALPHA_PREPROCESSED_LEVELS << 4; + +- VP8BitWriterInit(&result->bw, ALPHA_HEADER_LEN + output_size); ++ if (!VP8BitWriterInit(&result->bw, ALPHA_HEADER_LEN + output_size)) ok = 0; + ok = ok && VP8BitWriterAppend(&result->bw, &header, ALPHA_HEADER_LEN); + ok = ok && VP8BitWriterAppend(&result->bw, output, output_size);
meta/recipes-multimedia/webp/libwebp_1.1.0.bb +4 -0
@@ -19,6 +19,10 @@ SRC_URI[sha256sum] = "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f5 UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html" +SRC_URI += " \ + file://CVE-2023-1999.patch \ +" + EXTRA_OECONF = " \ --disable-wic \ --enable-libwebpmux \
Signature · 1 line
2.34.1
PATCH 2/5 vim: upgrade 9.0.1429 -> 9.0.1527
In reply to Steve SakomanFrom: Randy MacLeod <[email protected]>
Fixes: https://nvd.nist.gov/vuln/detail/CVE-2023-2426caf642c25 patch 9.0.1499: using uninitialized memory with fuzzy matching
--- meta/recipes-support/vim/vim.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/vim/vim.inc +2 -2
@@ -19,8 +19,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \ file://no-path-adjust.patch \ " -PV .= ".1429" -SRCREV = "1a08a3e2a584889f19b84a27672134649b73da58" +PV .= ".1527" +SRCREV = "c28e7a2b2f23dbd246a1ad7ad7aaa6f7ab2e5887" # Remove when 8.3 is out UPSTREAM_VERSION_UNKNOWN = "1"
Signature · 1 line
2.34.1
PATCH 3/5 systemd-systemctl: fix instance template WantedBy symlink construction
In reply to Steve SakomanFrom: Martin Siegumfeldt <[email protected]>
Fix issue of the below instance template systemd service dependency
[Install]
WantedBy=svc-wants@%i.service
creating the symlink (instance "a" example)
/etc/systemd/system/svc-wants@%i.service.wants/[email protected]
which should be
/etc/systemd/system/[email protected]/[email protected]
as implemented by this change.
The functionality appears regressed just after "thud" baseline when the logic was refactored from shell script into python (commit 925e30cb104ece7bfa48b78144e758a46dc9ec3f)
(From OE-Core rev: 308397f0bb3d6f3d4e9ec2c6a10823184049c9b5)
--- .../systemd/systemd-systemctl/systemctl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd-systemctl/systemctl +10 -3
@@ -182,12 +182,19 @@ class SystemdUnit(): raise SystemdUnitNotFoundError(self.root, unit) - def _process_deps(self, config, service, location, prop, dirstem): + def _process_deps(self, config, service, location, prop, dirstem, instance): systemdir = self.root / SYSCONFDIR / "systemd" / "system" target = ROOT / location.relative_to(self.root) try: for dependent in config.get('Install', prop): + # determine whether or not dependent is a template with an actual + # instance (i.e. a '@%i') + dependent_is_template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", dependent) + if dependent_is_template: + # if so, replace with the actual instance to achieve + # [email protected]/[email protected] + dependent = re.sub(dependent_is_template.group('instance'), instance, dependent, 1) wants = systemdir / "{}.{}".format(dependent, dirstem) / service add_link(wants, target)
@@ -227,8 +234,8 @@ class SystemdUnit(): else: service = self.unit - self._process_deps(config, service, path, 'WantedBy', 'wants') - self._process_deps(config, service, path, 'RequiredBy', 'requires') + self._process_deps(config, service, path, 'WantedBy', 'wants', instance) + self._process_deps(config, service, path, 'RequiredBy', 'requires', instance) try: for also in config.get('Install', 'Also'):
Signature · 1 line
2.34.1
PATCH 4/5 e2fsprogs: fix ptest bug for second running
In reply to Steve SakomanFrom: Qiu Tingting <[email protected]>
At second running, there are four new failed case:
d_loaddump f_bigalloc_badinode f_bigalloc_orphan_list f_dup_resize
The test_data.tmp is necessary, but it is deleted by run-ptest. So it should be restored after testing.
--- meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest | 1 + meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb | 3 +++ 2 files changed, 4 insertions(+)
meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest +1 -0
@@ -8,3 +8,4 @@ rm -f *.tmp rm -f *.ok rm -f *.failed rm -f *.log +cp ../data/test_data.tmp ./
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb +3 -0
@@ -144,4 +144,7 @@ do_install_ptest() { install -d ${D}${PTEST_PATH}/lib install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/ + + install -d ${D}${PTEST_PATH}/data + install -m 0644 ${B}/tests/test_data.tmp ${D}${PTEST_PATH}/data/ }
Signature · 1 line
2.34.1
PATCH 5/5 selftest/reproducible: Allow native/cross reuse in test
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
We don't compare reproducibility of the native/cross components, only the target ones. With the long build times of rust-native, the test now takes crazy lengths of time so this tweak should allow us to reuse native/cross artefacts from sstate whilst still testing the target output is reproducible.
--- meta/lib/oeqa/selftest/cases/reproducible.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/selftest/cases/reproducible.py +2 -2
@@ -188,7 +188,7 @@ class ReproducibleTests(OESelftestTestCase): def setUpLocal(self): super().setUpLocal() - needed_vars = ['TOPDIR', 'TARGET_PREFIX', 'BB_NUMBER_THREADS'] + needed_vars = ['TOPDIR', 'TARGET_PREFIX', 'BB_NUMBER_THREADS', 'BB_HASHSERVE'] bb_vars = get_bb_vars(needed_vars) for v in needed_vars: setattr(self, v.lower(), bb_vars[v])
@@ -259,7 +259,7 @@ class ReproducibleTests(OESelftestTestCase): # mirror, forcing a complete build from scratch config += textwrap.dedent('''\ SSTATE_DIR = "${TMPDIR}/sstate" - SSTATE_MIRRORS = "" + SSTATE_MIRRORS = "file://.*/.*-native.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH file://.*/.*-cross.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH" ''') self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
Signature · 1 line
2.34.1
RE: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template WantedBy symlink construction
In reply to Steve SakomanQuoted 79 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Steve Sakoman
Sent: den 14 juni 2023 16:05
To: [email protected]
Subject: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template WantedBy symlink constructionFrom: Martin Siegumfeldt <[email protected]>
Fix issue of the below instance template systemd service dependency
[Install]
WantedBy=svc-wants@%i.servicecreating the symlink (instance "a" example)
/etc/systemd/system/svc-wants@%i.service.wants/[email protected]
which should be
/etc/systemd/system/[email protected]/[email protected]as implemented by this change.
The functionality appears regressed just after "thud" baseline when the logic was refactored from shell script into python (commit
925e30cb104ece7bfa48b78144e758a46dc9ec3f)(From OE-Core rev:
308397f0bb3d6f3d4e9ec2c6a10823184049c9b5)Signed-off-by Martin Siegumfeldt <[email protected]>Signed-off-by Alexandre Belloni <[email protected]>Signed-off-by Richard Purdie <[email protected]>Signed-off-by Steve Sakoman <[email protected]>(cherry picked from commit 372b29c8ad270d4d430c26a4e614976c7029afaf)Signed-off-by Steve Sakoman <[email protected]>--- .../systemd/systemd-systemctl/systemctl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)meta/recipes-core/systemd/systemd-systemctl/systemctl +10
-4@@ -182,12 +182,19 @@ class SystemdUnit(): raise SystemdUnitNotFoundError(self.root, unit) - def _process_deps(self, config, service, location, prop, dirstem): + def _process_deps(self, config, service, location, prop, dirstem, instance): systemdir = self.root / SYSCONFDIR / "systemd" / "system" target = ROOT / location.relative_to(self.root) try: for dependent in config.get('Install', prop): + # determine whether or not dependent is a template with an actual + # instance (i.e. a '@%i') + dependent_is_template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", dependent) + if dependent_is_template: + # if so, replace with the actual instance to achieve + # [email protected]/[email protected] + dependent = re.sub(dependent_is_template.group('instance'), instance, dependent, 1) wants = systemdir / "{}.{}".format(dependent, dirstem) / service add_link(wants, target)@@ -227,8 +234,8 @@ class SystemdUnit(): else: service = self.unit - self._process_deps(config, service, path, 'WantedBy', 'wants') - self._process_deps(config, service, path, 'RequiredBy', 'requires') + self._process_deps(config, service, path, 'WantedBy', 'wants', instance) + self._process_deps(config, service, path, 'RequiredBy', 'requires', instance) try: for also in config.get('Install', 'Also'): --
Quoted 1 line
2.34.1
You might want to be careful with this one. It broke systemctl for us when it hit Mickledore and we have had to backport the version from Langdale for now.
The problem is that it does not handle non-instanced units depending on an instanced unit. In our case we have a unit foo.service that contains a [email protected], which causes an error like this:
Traceback (most recent call last):
File ".../recipe-sysroot-native/usr/bin/systemctl", line 366, in <module>
main()
File ".../recipe-sysroot-native/usr/bin/systemctl", line 352, in main
SystemdUnit(root, service).enable()
File ".../recipe-sysroot-native/usr/bin/systemctl", line 250, in enable
self._process_deps(config, service, path, 'WantedBy', 'wants', instance)
File ".../recipe-sysroot-native/usr/bin/systemctl", line 210, in _process_deps
dependent = re.sub(dependent_is_template.group('instance'), instance, dependent, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 317, in _subx
template = _compile_repl(template, pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 308, in _compile_repl
return _parser.parse_template(repl, pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 1000, in parse_template
s = Tokenizer(source)
^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 226, in __init__
string = str(string, 'latin1')
^^^^^^^^^^^^^^^^^^^^^
TypeError: decoding to str: need a bytes-like object, NoneType found
There are probably other cases too when different kinds of units are involved (at least as far as I could gather from the systemd manual).
We have an internal issue to fix this, but I am going on vacation on Monday, so I will unfortunately not have any time to look at it until after summer.
//Peter
Re: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template WantedBy symlink construction
Quoted 150 lines · Peter Kjellerstedt
Quoted 95 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Steve Sakoman
Sent: den 14 juni 2023 16:05
To: [email protected]
Subject: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template
WantedBy symlink constructionFrom: Martin Siegumfeldt <[email protected]>
Fix issue of the below instance template systemd service dependency
[Install]
WantedBy=svc-wants@%i.servicecreating the symlink (instance "a" example)
/etc/systemd/system/svc-
wants@%i.service.wants/[email protected]which should be
/etc/systemd/system/[email protected]
/[email protected]as implemented by this change.
The functionality appears regressed just after "thud" baseline when the
logic was refactored from shell script into python (commit925e30cb104ece7bfa48b78144e758a46dc9ec3f)(From OE-Core rev:
308397f0bb3d6f3d4e9ec2c6a10823184049c9b5)Signed-off-by Martin Siegumfeldt <[email protected]>Signed-off-by Alexandre Belloni <[email protected]>Signed-off-by Richard Purdie <[email protected]>Signed-off-by Steve Sakoman <[email protected]>(cherry picked from commit
372b29c8ad270d4d430c26a4e614976c7029afaf)Signed-off-by Steve Sakoman <[email protected]>---
.../systemd/systemd-systemctl/systemctl | 13
++++++++++---1 file changed, 10 insertions(+), 3 deletions(-)meta/recipes-core/systemd/systemd-systemctl/systemctl +0
-1@@ -182,12 +182,19 @@ class SystemdUnit(): raise SystemdUnitNotFoundError(self.root, unit) - def _process_deps(self, config, service, location, prop,dirstem):
+ def _process_deps(self, config, service, location, prop,
dirstem, instance):
systemdir = self.root / SYSCONFDIR / "systemd" / "system"target = ROOT /
location.relative_to(self.root)try:
for dependent inconfig.get('Install', prop):
+ # determine whether or not dependent is a template
with an actualmeta/recipes-core/systemd/systemd-systemctl/systemctl +2
-0+ # instance (i.e. a '@%i') + dependent_is_template =
re.match(r"[^@]+@(?P<instance>[^\.]*)\.", dependent)meta/recipes-core/systemd/systemd-systemctl/systemctl +2
-0+ if dependent_is_template: + # if so, replace with the actual instance toachieve
+ #
[email protected]/[email protected]
+ dependent =re.sub(dependent_is_template.group('instance'), instance, dependent, 1)
wants = systemdir / "{}.{}".format(dependent, dirstem) / service
add_link(wants, target)meta/recipes-core/systemd/systemd-systemctl/systemctl +0
-0@@ -227,8 +234,8 @@ class SystemdUnit():else:
service = self.unit- self._process_deps(config, service, path, 'WantedBy',
'wants')
- self._process_deps(config, service, path, 'RequiredBy',
'requires')
+ self._process_deps(config, service, path, 'WantedBy',
'wants', instance)
+ self._process_deps(config, service, path, 'RequiredBy',
'requires', instance)Quoted 4 lines
try:
for also inconfig.get('Install', 'Also'):
--
2.34.1You might want to be careful with this one. It broke systemctl for us when it
hit Mickledore and we have had to backport the version from Langdale for now.The problem is that it does not handle non-instanced units depending on
an instanced unit. In our case we have a unit foo.service that contains
a [email protected], which causes an error like this:Traceback (most recent call last):
File ".../recipe-sysroot-native/usr/bin/systemctl", line 366, in <module>
main()
File ".../recipe-sysroot-native/usr/bin/systemctl", line 352, in main
SystemdUnit(root, service).enable()
File ".../recipe-sysroot-native/usr/bin/systemctl", line 250, in enable
self._process_deps(config, service, path, 'WantedBy', 'wants', instance)
File ".../recipe-sysroot-native/usr/bin/systemctl", line 210, in_process_deps
dependent =re.sub(dependent_is_template.group('instance'), instance, dependent, 1)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 185, in sub
return_compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 317, in_subx
template =_compile_repl(template, pattern)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 308, in_compile_repl
return_parser.parse_template(repl, pattern)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 1000, inparse_template
s = Tokenizer(source)
^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 226, in__init__
string =str(string, 'latin1')
^^^^^^^^^^^^^^^^^^^^^
TypeError: decoding to str: need a bytes-like object, NoneType found
Quoted 6 lines
There are probably other cases too when different kinds of units are involved (at least as far as I could gather from the systemd manual).
We have an internal issue to fix this, but I am going on vacation on Monday, so I will unfortunately not have any time to look at it until after summer.
There is a patch in master recently which may help?
Cheers,
Richard
Re: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template WantedBy symlink construction
In reply to Peter KjellerstedtQuoted 77 lines · Peter Kjellerstedt
Quoted 77 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Steve Sakoman
Sent: den 14 juni 2023 16:05
To: [email protected]
Subject: [OE-core][dunfell 3/5] systemd-systemctl: fix instance template WantedBy symlink constructionFrom: Martin Siegumfeldt <[email protected]>
Fix issue of the below instance template systemd service dependency
[Install]
WantedBy=svc-wants@%i.servicecreating the symlink (instance "a" example)
/etc/systemd/system/svc-wants@%i.service.wants/[email protected]
which should be
/etc/systemd/system/[email protected]/[email protected]as implemented by this change.
The functionality appears regressed just after "thud" baseline when the logic was refactored from shell script into python (commit
925e30cb104ece7bfa48b78144e758a46dc9ec3f)(From OE-Core rev:
308397f0bb3d6f3d4e9ec2c6a10823184049c9b5)Signed-off-by Martin Siegumfeldt <[email protected]>Signed-off-by Alexandre Belloni <[email protected]>Signed-off-by Richard Purdie <[email protected]>Signed-off-by Steve Sakoman <[email protected]>(cherry picked from commit 372b29c8ad270d4d430c26a4e614976c7029afaf)Signed-off-by Steve Sakoman <[email protected]>--- .../systemd/systemd-systemctl/systemctl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)meta/recipes-core/systemd/systemd-systemctl/systemctl +10
-3@@ -182,12 +182,19 @@ class SystemdUnit(): raise SystemdUnitNotFoundError(self.root, unit) - def _process_deps(self, config, service, location, prop, dirstem): + def _process_deps(self, config, service, location, prop, dirstem, instance): systemdir = self.root / SYSCONFDIR / "systemd" / "system" target = ROOT / location.relative_to(self.root) try: for dependent in config.get('Install', prop): + # determine whether or not dependent is a template with an actual + # instance (i.e. a '@%i') + dependent_is_template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", dependent) + if dependent_is_template: + # if so, replace with the actual instance to achieve + # [email protected]/[email protected] + dependent = re.sub(dependent_is_template.group('instance'), instance, dependent, 1) wants = systemdir / "{}.{}".format(dependent, dirstem) / service add_link(wants, target)@@ -227,8 +234,8 @@ class SystemdUnit(): else: service = self.unit - self._process_deps(config, service, path, 'WantedBy', 'wants') - self._process_deps(config, service, path, 'RequiredBy', 'requires') + self._process_deps(config, service, path, 'WantedBy', 'wants', instance) + self._process_deps(config, service, path, 'RequiredBy', 'requires', instance)
Quoted 7 lines
Quoted 4 lines
meta/recipes-core/systemd/systemd-systemctl/systemctl +0
-1try: for also in config.get('Install', 'Also'): --2.34.1
You might want to be careful with this one. It broke systemctl for us when it hit Mickledore and we have had to backport the version from Langdale for now.
Thanks for reviewing. I'll drop this from dunfell for now and will look for the potential fix in master for mickledore.
Steve
Quoted 39 lines
The problem is that it does not handle non-instanced units depending on an instanced unit. In our case we have a unit foo.service that contains a [email protected], which causes an error like this:
Traceback (most recent call last):
File ".../recipe-sysroot-native/usr/bin/systemctl", line 366, in <module>main()File ".../recipe-sysroot-native/usr/bin/systemctl", line 352, in main
SystemdUnit(root, service).enable()
File ".../recipe-sysroot-native/usr/bin/systemctl", line 250, in enable
self._process_deps(config, service, path, 'WantedBy', 'wants', instance)
File ".../recipe-sysroot-native/usr/bin/systemctl", line 210, in_process_deps
dependent =re.sub(dependent_is_template.group('instance'), instance, dependent, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 185, in sub
return_compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 317, in_subx
template =_compile_repl(template, pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 308, in_compile_repl
return_parser.parse_template(repl, pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 1000, inparse_template
s = Tokenizer(source)
^^^^^^^^^^^^^^^^^
File ".../recipe-sysroot-native/usr/lib/python3.11/re/_parser.py", line 226, in__init__
string =str(string, 'latin1')
^^^^^^^^^^^^^^^^^^^^^
TypeError: decoding to str: need a bytes-like object, NoneType foundThere are probably other cases too when different kinds of units are involved (at least as far as I could gather from the systemd manual).
We have an internal issue to fix this, but I am going on vacation on Monday, so I will unfortunately not have any time to look at it until after summer.
//Peter