aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2023-01-17 22:57:46 +0000
committerKhem Raj <raj.khem@gmail.com>2023-01-17 15:16:36 -0800
commit0c5afec7780f1c02433aeb06b47fa9bc1851f94d (patch)
tree323a3538aa288098cb8afd62f472ac2bacd3df4d /meta-networking
parent2041c8bd3bfdf89d6cfb99f72c124f99142023d4 (diff)
downloadmeta-openembedded-contrib-0c5afec7780f1c02433aeb06b47fa9bc1851f94d.tar.gz
dnsmasq: Expand configuration options
Expose all current dnsmasq configuration options in PACKAGECONFIG, enable i18n generation, filter supplementary systemd files against DISTRO_FEATURES. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb75
1 files changed, 58 insertions, 17 deletions
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
index 43d48490a8..4bf1dd8954 100644
--- a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
+++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
@@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504 \
"
+DEPENDS += "gettext-native"
+
#at least versions 2.69 and prior are moved to the archive folder on the server
SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz \
file://lua.patch \
@@ -23,34 +25,62 @@ inherit pkgconfig update-rc.d systemd
INITSCRIPT_NAME = "dnsmasq"
INITSCRIPT_PARAMS = "defaults"
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[dbus] = ",,dbus"
-PACKAGECONFIG[idn] = ",,libidn"
-PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack"
-PACKAGECONFIG[lua] = ",,lua"
+# dnsmasq defaults
+PACKAGECONFIG ?= "auth dhcp dhcp6 dumpfile inotify ipset loop script tftp"
+
+PACKAGECONFIG[auth] = "-DHAVE_AUTH,-DNO_AUTH"
+PACKAGECONFIG[broken-rtc] = "-DHAVE_BROKEN_RTC,"
+PACKAGECONFIG[conntrack] = "-DHAVE_CONNTRACK,,libnetfilter-conntrack"
+PACKAGECONFIG[dbus] = "-DHAVE_DBUS,,dbus"
+PACKAGECONFIG[dhcp] = "-DHAVE_DHCP,-DNO_DHCP"
+PACKAGECONFIG[dhcp6] = "-DHAVE_DHCP6,-DNO_DHCP6"
+PACKAGECONFIG[dnssec] = "-DHAVE_DNSSEC,,nettle"
+PACKAGECONFIG[dumpfile] = "-DHAVE_DUMPFILE,-DNO_DUMPFILE"
+PACKAGECONFIG[idn] = "-DHAVE_LIBIDN,,libidn,,,idn2"
+PACKAGECONFIG[idn2] = "-DHAVE_LIBIDN2,,libidn2,,,idn"
+PACKAGECONFIG[inotify] = "-DHAVE_INOTIFY,-DNO_INOTIFY"
+PACKAGECONFIG[ipset] = "-DHAVE_IPSET,-DNO_IPSET"
+PACKAGECONFIG[loop] = "-DHAVE_LOOP,-DNO_LOOP"
+PACKAGECONFIG[lua] = "-DHAVE_LUASCRIPT -DHAVE_SCRIPT,,lua"
+PACKAGECONFIG[nftset] = "-DHAVE_NFTSET,,nftables"
+PACKAGECONFIG[no-gmp] = "-DNO_GMP,"
+PACKAGECONFIG[no-id] = "-DNO_ID,"
PACKAGECONFIG[resolvconf] = ",,,resolvconf"
+PACKAGECONFIG[script] = "-DHAVE_SCRIPT,-DNO_SCRIPT"
+PACKAGECONFIG[tftp] = "-DHAVE_TFTP,-DNO_TFTP"
+PACKAGECONFIG[ubus] = "-DHAVE_UBUS,,ubus"
+
+DNSMASQ_LEASEFILE ?= "${localstatedir}/lib/misc/dnsmasq.leases"
+DNSMASQ_CONFFILE ?= "${sysconfdir}/dnsmasq.conf"
+DNSMASQ_RESOLVFILE ?= "${sysconfdir}/resolv.conf"
+
+COPTS = "${PACKAGECONFIG_CONFARGS} \
+ -DLEASEFILE=\"${DNSMASQ_LEASEFILE}\" \
+ -DCONFFILE=\"${DNSMASQ_CONFFILE}\" \
+ -DRESOLVFILE=\"${DNSMASQ_RESOLVFILE}\" \
+ -DLOCALEDIR=\"${localedir}\""
+
EXTRA_OEMAKE = "\
- 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \
+ 'COPTS=${COPTS}' \
'CFLAGS=${CFLAGS}' \
'LDFLAGS=${LDFLAGS}' \
"
SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}"
-do_compile:append() {
- # build dhcp_release
- cd ${S}/contrib/lease-tools
- oe_runmake
+do_compile () {
+ oe_runmake all-i18n
+ if ${@bb.utils.contains_any('PACKAGECONFIG', ['dhcp', 'dhcp6'], 'true', 'false', d)}; then
+ # build dhcp_release
+ oe_runmake -C ${S}/contrib/lease-tools
+ fi
}
do_install () {
oe_runmake "PREFIX=${D}${prefix}" \
"BINDIR=${D}${bindir}" \
"MANDIR=${D}${mandir}" \
- install
+ install-i18n
install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d
install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/
install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq
@@ -62,15 +92,26 @@ do_install () {
else
install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
fi
- install -d ${D}${sysconfdir}/systemd/resolved.conf.d/
- install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/
- install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
+ install -d ${D}${sysconfdir}/systemd/resolved.conf.d/
+ install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/
+ fi
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'dhcp', d)}" ]; then
+ install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
+ install -m 0755 ${S}/contrib/lease-tools/dhcp_lease_time ${D}${bindir}
+ fi
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'dhcp6', d)}" ]; then
+ install -m 0755 ${S}/contrib/lease-tools/dhcp_release6 ${D}${bindir}
+ fi
if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then
install -d ${D}${sysconfdir}/dbus-1/system.d
install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
fi
+
if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
install -d ${D}${sysconfdir}/resolvconf/update.d/
install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq