dhcpcd: add --dbdir and --disable-privesp to EXTRA_OECONF

Submitted by Yi Zhao on Sept. 15, 2020, 9:15 a.m. | Patch ID: 176530

Details

Message ID 20200915091523.31005-1-yi.zhao@windriver.com
State New
Headers show

Commit Message

Yi Zhao Sept. 15, 2020, 9:15 a.m.
* Disable service start at boot time. This may conflict with connman.
* Set --dbdir to /var/lib/dhcpcd rather than /var/db/dhcpcd to satisfy
  FHS compliance.
* Pass --disable-privsep to configure to eliminate dhcpcd start warning:
  no such user dhcpcd.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
index 292cb5b008..4b5f4d7766 100644
--- a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
+++ b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
@@ -22,13 +22,14 @@  SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2
 inherit pkgconfig autotools-brokensep systemd
 
 SYSTEMD_SERVICE_${PN} = "dhcpcd.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
 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 --disable-privsep --dbdir=${localstatedir}/lib/${BPN}"
 
 do_install_append () {
     # install systemd unit files

Comments

Ricardo Salveti Sept. 18, 2020, 1:14 a.m.
On Tue, Sep 15, 2020 at 6:15 AM Yi Zhao <yi.zhao@windriver.com> wrote:
>
> * Disable service start at boot time. This may conflict with connman.
> * Set --dbdir to /var/lib/dhcpcd rather than /var/db/dhcpcd to satisfy
>   FHS compliance.
> * Pass --disable-privsep to configure to eliminate dhcpcd start warning:
>   no such user dhcpcd.

Isn't it better to just create the missing user at the system level?

You could leverage systemd sysusers.d as done by arch at
https://github.com/archlinux/svntogit-packages/blob/packages/dhcpcd/trunk/dhcpcd.sysusers
(in case systemd is enabled).

> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
> ---
>  meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
> index 292cb5b008..4b5f4d7766 100644
> --- a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
> +++ b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb
> @@ -22,13 +22,14 @@ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2
>  inherit pkgconfig autotools-brokensep systemd
>
>  SYSTEMD_SERVICE_${PN} = "dhcpcd.service"
> +SYSTEMD_AUTO_ENABLE_${PN} = "disable"
>
>  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 --disable-privsep --dbdir=${localstatedir}/lib/${BPN}"
>
>  do_install_append () {
>      # install systemd unit files
> --
> 2.17.1
>
> 

Cheers,
Ross Burton Sept. 18, 2020, 9:12 a.m.
On Tue, 15 Sep 2020 at 10:15, Yi Zhao <yi.zhao@windriver.com> wrote:
> * Disable service start at boot time. This may conflict with connman.

Maybe we should just stop people installing multiple DHCP clients at
the same time.

> * Pass --disable-privsep to configure to eliminate dhcpcd start warning:
>   no such user dhcpcd.

Create the user instead please.

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#142643): https://lists.openembedded.org/g/openembedded-core/message/142643
Mute This Topic: https://lists.openembedded.org/mt/76861136/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-