summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2024-04-12 15:43:17 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-14 06:28:02 +0100
commit0900258689537add2dfaf1d01b71e49939020234 (patch)
tree4545a90ba2008ac25c1c3c1892bfefe953bcef36 /meta/recipes-core
parent7c72dc09f06a83cc1753cb60d6a858fd9821d4d6 (diff)
downloadpoky-0900258689537add2dfaf1d01b71e49939020234.tar.gz
systemd: make predictable name mac policy opt-out
Even the patch says it's inappropriate for upstream, and it's also inappropriate for some downstream projects, too. So make it possible to opt-out on it by replacing the patch by sed and depend on distro feature pni-names. (From OE-Core rev: 858eb2bac132adbde851f6594eac4f2efc9c2f35) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/systemd/systemd/0001-NamePolicy.patch33
-rw-r--r--meta/recipes-core/systemd/systemd_255.4.bb13
2 files changed, 11 insertions, 35 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-NamePolicy.patch b/meta/recipes-core/systemd/systemd/0001-NamePolicy.patch
deleted file mode 100644
index 46955cbcbb..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-NamePolicy.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 9bb09886320eb286108fb370b2634a66b3e3b9ff Mon Sep 17 00:00:00 2001
2From: Joe Slater <joe.slater@windriver.com>
3Date: Thu, 21 Mar 2024 16:28:31 +0000
4Subject: [PATCH] systemd: enable mac based names in NamePolicy
5
6The default NamePolicy for network interface names does not
7include names based on mac addresses. Some BSPs, though, do
8not provide information to compute other names, so we enable
9mac names as a last resort.
10
11Upstream-Status: Inappropriate [enable feature]
12
13Signed-off-by: Joe Slater <joe.slater@windriver.com>
14---
15 network/99-default.link | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/network/99-default.link b/network/99-default.link
19index 429ac31e80..543ce54661 100644
20--- a/network/99-default.link
21+++ b/network/99-default.link
22@@ -15,6 +15,6 @@
23 OriginalName=*
24
25 [Link]
26-NamePolicy=keep kernel database onboard slot path
27-AlternativeNamesPolicy=database onboard slot path
28+NamePolicy=keep kernel database onboard slot path mac
29+AlternativeNamesPolicy=database onboard slot path mac
30 MACAddressPolicy=persistent
31--
322.35.5
33
diff --git a/meta/recipes-core/systemd/systemd_255.4.bb b/meta/recipes-core/systemd/systemd_255.4.bb
index 8a816c4bc1..e7498c802d 100644
--- a/meta/recipes-core/systemd/systemd_255.4.bb
+++ b/meta/recipes-core/systemd/systemd_255.4.bb
@@ -28,7 +28,6 @@ SRC_URI += " \
28 file://systemd-pager.sh \ 28 file://systemd-pager.sh \
29 file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ 29 file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
30 file://0008-implment-systemd-sysv-install-for-OE.patch \ 30 file://0008-implment-systemd-sysv-install-for-OE.patch \
31 file://0001-NamePolicy.patch \
32 " 31 "
33 32
34# patches needed by musl 33# patches needed by musl
@@ -66,7 +65,7 @@ PAM_PLUGINS = " \
66" 65"
67 66
68PACKAGECONFIG ??= " \ 67PACKAGECONFIG ??= " \
69 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit seccomp', d)} \ 68 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam pni-names selinux smack usrmerge polkit seccomp', d)} \
70 ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \ 69 ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \
71 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ 70 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
72 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ 71 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
@@ -197,6 +196,7 @@ PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
197PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit" 196PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
198PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false" 197PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
199PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false" 198PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false"
199PACKAGECONFIG[pni-names] = ",,,"
200PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode" 200PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode"
201PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false" 201PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
202PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false" 202PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
@@ -389,6 +389,15 @@ do_install() {
389 sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \ 389 sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
390 ${D}/${sysconfdir}/systemd/system.conf 390 ${D}/${sysconfdir}/systemd/system.conf
391 fi 391 fi
392
393 if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then
394 if ! grep -q '^NamePolicy=.*mac' ${D}${rootlibexecdir}/systemd/network/99-default.link; then
395 sed -i '/^NamePolicy=/s/$/ mac/' ${D}${rootlibexecdir}/systemd/network/99-default.link
396 fi
397 if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${rootlibexecdir}/systemd/network/99-default.link; then
398 sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${rootlibexecdir}/systemd/network/99-default.link
399 fi
400 fi
392} 401}
393 402
394python populate_packages:prepend (){ 403python populate_packages:prepend (){