Skip to contentSkip to conversation

systemd: Expose resolv-conf alternative only when resolved is built

PATCH New Alexandre Bard 1 participant 1 message Oct 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: Expose resolv-conf alternative only when resolved is built

When systemd is built without internal resolver, it does not make sense to expose it as a resolv-conf alternative and can even break images where this alternative would be chosen, because of an invalid symlink.

---
 meta/recipes-core/systemd/systemd_239.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_239.bb +1 -1
index 7fbd64ced7..0a3492f5b8 100644
@@ -614,7 +614,7 @@ python __anonymous() {
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
-ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
+ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
 
 ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
Signature · 1 line
2.20.1