Skip to contentSkip to conversation

connman: Set connman resolv.conf as fallback when using systemd-resolved

PATCH New Hiago De Franco 1 participant 1 message May 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 connman: Set connman resolv.conf as fallback when using systemd-resolved

From: Stefan Eichenberger <[email protected]>

Commit bec0cfc9b215 ("connman: Set dns-backend automatically") introduced support for using systemd-resolved as the DNS backend. However, connman's resolv.conf was assigned a higher update-alternatives priority. This caused connman's configuration to override systemd-resolved, resulting in a broken DNS setup. /etc/resolv.conf -> /etc/resolv-conf.connman

This commit corrects the issue by lowering the priority for connman's resolv.conf when systemd-resolved is enabled, ensuring it acts as a fallback. The higher priority is now only applied when systemd-resolved is not used.

Fixes bec0cfc9b215 ("connman: Set dns-backend automatically")
---
 meta/recipes-connectivity/connman/connman_1.44.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman_1.44.bb +1 -1
index 02c5be929e0a..1b0fbe438c7a 100644
@@ -92,7 +92,7 @@ SYSTEMD_SERVICE:${PN} = "connman.service"
 SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service"
 SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service"
 
-ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd-resolved','10','100',d)}"
 ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
 ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
Signature · 1 line
2.39.5