summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@oss.qualcomm.com>2025-09-02 11:09:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-08 14:05:11 +0100
commit9352450dfac4ac05fe4b9da415fedbdc070925c3 (patch)
tree0ac7a9103b71ac2ae48ba233ea8b03ca05b722fe /meta
parent918a0003e528746249b8eb5d54fa51d1307993e8 (diff)
downloadpoky-9352450dfac4ac05fe4b9da415fedbdc070925c3.tar.gz
systemd: stop enabling non-standard MAC policy when using the 'pni-names' DISTRO_FEATURE
This recipe enabled an additional, non-standard policy for predictable network names: the MAC policy. This is a deviation from upstream policies and in cases where no MAC address is available, it makes it actively worse by changing the name(s) every boot. Change the logic to disable predictable naming when the DISTRO_FEATURE isn't enabled and only use upstream logic with it *is* enabled. For DISTROs that wish to use non-standard policies, a DISTRO layer is the correct place. E.g. in DISTRO_LAYER/recipes-core/systemd/systemd_%.bbappend: do_install:append:DISTRO() { if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then if ! grep -q '^NamePolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then sed -i '/^NamePolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link fi if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link fi } (From OE-Core rev: 9b34a810496f4b769394aa6ba7c0f6013d18ccc8) Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd_257.8.bb11
1 files changed, 2 insertions, 9 deletions
diff --git a/meta/recipes-core/systemd/systemd_257.8.bb b/meta/recipes-core/systemd/systemd_257.8.bb
index 174372be03..6399c57640 100644
--- a/meta/recipes-core/systemd/systemd_257.8.bb
+++ b/meta/recipes-core/systemd/systemd_257.8.bb
@@ -400,15 +400,8 @@ do_install() {
400 ${D}/${sysconfdir}/systemd/system.conf 400 ${D}/${sysconfdir}/systemd/system.conf
401 fi 401 fi
402 402
403 if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then 403 # Actively disable Predictable Network Interface Names
404 if ! grep -q '^NamePolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then 404 if ${@ 'true' if not bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d) else 'false'}; then
405 sed -i '/^NamePolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
406 fi
407 if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
408 sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
409 fi
410 else
411 # Actively disable Predictable Network Interface Names
412 sed -i 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/' ${D}${nonarch_libdir}/systemd/network/99-default.link 405 sed -i 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/' ${D}${nonarch_libdir}/systemd/network/99-default.link
413 fi 406 fi
414} 407}