]> code.ossystems Code Review - openembedded-core.git/commitdiff
dhcpcd: add option to set DBDIR location
authorAndrej Valek <andrej.valek@siemens.com>
Tue, 1 Feb 2022 15:11:36 +0000 (16:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 Feb 2022 09:01:58 +0000 (09:01 +0000)
This will allow to use the different DBDIR location, because the /var/lib
could be used as a read-only location.

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb

index 4007a4bd2d7b8480c7266997cc4615a04b90695f..ab6ffe986c6c347bfc78e0403abfbb7f2f46e7b3 100644 (file)
@@ -32,8 +32,11 @@ PACKAGECONFIG[ntp] = "--with-hook=ntp, , ,ntp"
 PACKAGECONFIG[chrony] = "--with-hook=ntp, , ,chrony"
 PACKAGECONFIG[ypbind] = "--with-eghook=yp, , ,ypbind-mt"
 
+# add option to override DBDIR location
+DBDIR ?= "${localstatedir}/lib/${BPN}"
+
 EXTRA_OECONF = "--enable-ipv4 \
-                --dbdir=${localstatedir}/lib/${BPN} \
+                --dbdir=${DBDIR} \
                 --sbindir=${base_sbindir} \
                 --runstatedir=/run \
                 --enable-privsep \
@@ -43,15 +46,15 @@ EXTRA_OECONF = "--enable-ipv4 \
                "
 
 USERADD_PACKAGES = "${PN}"
-USERADD_PARAM:${PN} = "--system -d ${localstatedir}/lib/${BPN} -M -s /bin/false -U dhcpcd"
+USERADD_PARAM:${PN} = "--system -d ${DBDIR} -M -s /bin/false -U dhcpcd"
 
 do_install:append () {
     # install systemd unit files
     install -d ${D}${systemd_system_unitdir}
     install -m 0644 ${WORKDIR}/dhcpcd*.service ${D}${systemd_system_unitdir}
 
-    chmod 700 ${D}${localstatedir}/lib/${BPN}
-    chown dhcpcd:dhcpcd ${D}${localstatedir}/lib/${BPN}
+    chmod 700 ${D}${DBDIR}
+    chown dhcpcd:dhcpcd ${D}${DBDIR}
 }
 
 FILES:${PN}-dbg += "${libdir}/dhcpcd/dev/.debug"