From: Alexander Sverdlin <[email protected]>

Currently pni-names PACKAGECONFIG option adds "mac" names policy if
selected, but nothing otherwise. In systemd Predictable Network Interface
Names are applied by default which leads to inconsistend behaviour.

One could think that pni-names in DISTRO_FEATURES would enable or disable
Predictable Network Interface Names, but currently if not present it's
only actively disabled for QEMU via kernel command line
(commit 9e9c33d51e40
("qemuboot/runqemu: Fix 6.2 and later kernel network device naming")).
It has no effect on the real HW. If the option is present, it merely adds
"mac" into default NamePolicy, which may or may not have observable
effects.

Make pni-names semantics more consistent by actively suppressing
Predictable Network Interface Names if the feature is not present.

Signed-off-by: Alexander Sverdlin <[email protected]>
---
 meta/recipes-core/systemd/systemd_256.8.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_256.8.bb 
b/meta/recipes-core/systemd/systemd_256.8.bb
index c1915d7e941..2b5a90aacbc 100644
--- a/meta/recipes-core/systemd/systemd_256.8.bb
+++ b/meta/recipes-core/systemd/systemd_256.8.bb
@@ -390,6 +390,9 @@ do_install() {
                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
+       else
+               # Actively disable Predictable Network Interface Names
+               sed -i 
's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/'
 ${D}${nonarch_libdir}/systemd/network/99-default.link
        fi
 }
 
-- 
2.47.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208536): 
https://lists.openembedded.org/g/openembedded-core/message/208536
Mute This Topic: https://lists.openembedded.org/mt/110024857/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to