dhcpcd fixes
v2 cover dhcpcd fixes
Yi Zhao (4):
dhcpcd: pass --dbdir to EXTRA_OECONF to set database directory
dhcpcd: set --runstatedir to /run
dhcpcd: add dhcpcd user to support priviledge separation
dhcpcd: disable service to start on boot automatically
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 14 ++++++++++++-- .../dhcpcd/files/[email protected] | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/4 dhcpcd: pass --dbdir to EXTRA_OECONF to set database directory
Set --dbdir to /var/lib/dhcpcd rather than /var/db/dhcpcd to satisfy FHS compliance
--- meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +3 -1
@@ -28,7 +28,9 @@ PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6" -EXTRA_OECONF = "--enable-ipv4" +EXTRA_OECONF = "--enable-ipv4 \ + --dbdir=${localstatedir}/lib/${BPN} \ + " do_install_append () { # install systemd unit files
Signature · 1 line
2.17.1
PATCH v2 2/4 dhcpcd: set --runstatedir to /run
In reply to Yi ZhaoSet --runstatedir to /run/dhcpcd rather than /var/run/dhcpcd
--- meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 1 + meta/recipes-connectivity/dhcpcd/files/[email protected] | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +1 -0
@@ -30,6 +30,7 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6" EXTRA_OECONF = "--enable-ipv4 \ --dbdir=${localstatedir}/lib/${BPN} \ + --runstatedir=/run \ " do_install_append () {
meta/recipes-connectivity/dhcpcd/files/[email protected] +1 -1
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device [Service] Type=forking -PIDFile=/run/dhcpcd-%I.pid +PIDFile=/run/dhcpcd/%I.pid ExecStart=/usr/sbin/dhcpcd -q %I ExecStop=/usr/sbin/dhcpcd -x %I
Signature · 1 line
2.17.1
PATCH v2 3/4 dhcpcd: add dhcpcd user to support priviledge separation
In reply to Yi ZhaoThe dhcpcd enables privsep by default. It requires a user added to the system. Add dhcpcd user and group to support it.
--- meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +7 -1
@@ -19,7 +19,7 @@ SRC_URI = "https://roy.marples.name/downloads/${BPN}/${BPN}-${PV}.tar.xz \ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2cb9666" -inherit pkgconfig autotools-brokensep systemd +inherit pkgconfig autotools-brokensep systemd useradd SYSTEMD_SERVICE_${PN} = "dhcpcd.service"
@@ -33,10 +33,16 @@ EXTRA_OECONF = "--enable-ipv4 \ --runstatedir=/run \ " +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system -d ${localstatedir}/lib/${BPN} -M -s /bin/false -U dhcpcd" + do_install_append () { # install systemd unit files install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/dhcpcd*.service ${D}${systemd_unitdir}/system + + chmod 700 ${D}${localstatedir}/lib/${BPN} + chown dhcpcd:dhcpcd ${D}${localstatedir}/lib/${BPN} } FILES_${PN}-dbg += "${libdir}/dhcpcd/dev/.debug"
Signature · 1 line
2.17.1
PATCH v2 4/4 dhcpcd: disable service to start on boot automatically
In reply to Yi ZhaoAs the default network manager, connman has its own internal DHCP implement. The dhcpcd may conflict with connman if the service start on boot automatically.
--- meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2 inherit pkgconfig autotools-brokensep systemd useradd SYSTEMD_SERVICE_${PN} = "dhcpcd.service" +SYSTEMD_AUTO_ENABLE_${PN} = "disable" PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
Signature · 1 line
2.17.1
Re: [OE-core] [PATCH 4/4] dhcpcd: disable service to start on boot automatically
Quoted 14 lines · Yi Zhao
As the default network manager, connman has its own internal DHCP implement. The dhcpcd may conflict with connman if the service start on boot automatically.
Signed-off-by Yi Zhao <[email protected]>--- meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 1 + 1 file changed, 1 insertion(+)meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +0
-0
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2 · line 28
Quoted 7 lines
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +1
-0@@ -22,6 +22,7 @@ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2 inherit pkgconfig autotools-brokensep systemd useradd SYSTEMD_SERVICE_${PN} = "dhcpcd.service" +SYSTEMD_AUTO_ENABLE_${PN} = "disable" PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
Rather than just disabling it, is there a way to "only enable if connman isn't present"? I'd imagine there is some kind of unit file setting for that?
(the other patches look good, thanks!)
Cheers,
Richard
PATCH v3 1/1 dhcpcd: set service to conflict with connman
As the default network manager, connman has its own internal DHCP implement. If run dhcpcd and connman simultaneously, they may conflict with each other.
--- meta/recipes-connectivity/dhcpcd/files/dhcpcd.service | 1 + meta/recipes-connectivity/dhcpcd/files/[email protected] | 1 + 2 files changed, 2 insertions(+)
meta/recipes-connectivity/dhcpcd/files/dhcpcd.service +1 -0
@@ -2,6 +2,7 @@ Description=A minimalistic network configuration daemon with DHCPv4, rdisc and DHCPv6 support Wants=network.target Before=network.target +Conflicts=connman.service [Service] ExecStart=/usr/sbin/dhcpcd -q --nobackground
meta/recipes-connectivity/dhcpcd/files/[email protected] +1 -0
@@ -4,6 +4,7 @@ Wants=network.target Before=network.target BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device +Conflicts=connman.service [Service] Type=forking
Signature · 1 line
2.17.1