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

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")
(From OE-Core rev: bea9ea64820a86c4d01671087b706beca1ccdf26)

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Stefan Eichenberger 2025-05-29 10:55:36 -03:00 committed by Richard Purdie
parent ee6d8de39b
commit b204576403

View File

@ -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)}"