diff mbox series

[2/4] systemd: Simplify code to handle resolv.conf with resolved

Message ID fa22f8137bed27504223bc3ee58a2f88eec502dc.1783357184.git.joerg.sommer@navimatix.de
State New
Headers show
Series [1/4] files/fs-perms.txt: Replace /srv by $servicedir | expand

Commit Message

Jörg Sommer July 6, 2026, 4:59 p.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-core/systemd/systemd_259.5.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_259.5.bb b/meta/recipes-core/systemd/systemd_259.5.bb
index f3ec0edae7..0fbfcaba42 100644
--- a/meta/recipes-core/systemd/systemd_259.5.bb
+++ b/meta/recipes-core/systemd/systemd_259.5.bb
@@ -330,9 +330,9 @@  do_install() {
 		echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
 		ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
 	else
-		resolv_conf="${@bb.utils.contains('RESOLV_CONF', 'stub-resolv', 'run/systemd/resolve/stub-resolv.conf', 'run/systemd/resolve/resolv.conf', d)}"
-		sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../${resolv_conf}%g" ${D}${exec_prefix}/lib/tmpfiles.d/systemd-resolve.conf
-		ln -s ../${resolv_conf} ${D}${sysconfdir}/resolv-conf.systemd
+		rc="../run/systemd/resolve/${@bb.utils.contains('RESOLV_CONF', 'stub-resolv', 'stub-', '', d)}resolv.conf"
+		sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - $rc%" ${D}${exec_prefix}/lib/tmpfiles.d/systemd-resolve.conf
+		ln -s $rc ${D}${sysconfdir}/resolv-conf.systemd
 	fi
 	if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
 		rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf