summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/kea
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/kea')
-rw-r--r--meta/recipes-connectivity/kea/files/0001-kea-fix-reproducible-build-failure.patch62
-rw-r--r--meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch96
-rw-r--r--meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch28
-rw-r--r--meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch12
-rw-r--r--meta/recipes-connectivity/kea/kea_2.6.3.bb (renamed from meta/recipes-connectivity/kea/kea_2.4.1.bb)14
5 files changed, 140 insertions, 72 deletions
diff --git a/meta/recipes-connectivity/kea/files/0001-kea-fix-reproducible-build-failure.patch b/meta/recipes-connectivity/kea/files/0001-kea-fix-reproducible-build-failure.patch
deleted file mode 100644
index 8a5bd00302..0000000000
--- a/meta/recipes-connectivity/kea/files/0001-kea-fix-reproducible-build-failure.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1From f9bcfed5a1d44d9211c5f6eba403a9898c8c9057 Mon Sep 17 00:00:00 2001
2From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
3Date: Tue, 8 Aug 2023 19:03:13 +0100
4Subject: [PATCH] kea: fix reproducible build failure
5
6New version of Kea has started using path of build-dir instead of
7src-dir which results in reproducible builds failure.
8Use src-dir as is used in v2.2.0
9
10Upstream-Status: Pending
11https://gitlab.isc.org/isc-projects/kea/-/issues/3007
12
13Upstream has confirmed the patch will not be accepted but discussions
14with upstream is still going on, we might have a proper solution later.
15
16Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
17---
18 src/bin/admin/kea-admin.in | 8 ++++----
19 1 file changed, 4 insertions(+), 4 deletions(-)
20
21diff --git a/src/bin/admin/kea-admin.in b/src/bin/admin/kea-admin.in
22index 034a0ee..8ab11ab 100644
23--- a/src/bin/admin/kea-admin.in
24+++ b/src/bin/admin/kea-admin.in
25@@ -51,14 +51,14 @@ dump_qry=""
26 if test -f "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh"; then
27 . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh"
28 else
29- . "@abs_top_builddir@/src/bin/admin/admin-utils.sh"
30+ . "@abs_top_srcdir@/src/bin/admin/admin-utils.sh"
31 fi
32
33 # Find the installed kea-lfc if available. Fallback to sources otherwise.
34 if test -x "@sbindir@/kea-lfc"; then
35 kea_lfc="@sbindir@/kea-lfc"
36 else
37- kea_lfc="@abs_top_builddir@/src/bin/lfc/kea-lfc"
38+ kea_lfc="@abs_top_srcdir@/src/bin/lfc/kea-lfc"
39 fi
40
41 # Prints out usage version.
42@@ -355,7 +355,7 @@ mysql_upgrade() {
43 # Check if there are any files in it
44 num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l)
45 if [ "$num_files" -eq 0 ]; then
46- upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/mysql
47+ upgrade_scripts_dir=@abs_top_srcdir@/src/share/database/scripts/mysql
48
49 # Check if the scripts directory exists at all.
50 if [ ! -d ${upgrade_scripts_dir} ]; then
51@@ -405,7 +405,7 @@ pgsql_upgrade() {
52 # Check if there are any files in it
53 num_files=$(find "${upgrade_scripts_dir}" -name 'upgrade*.sh' -type f | wc -l)
54 if [ "$num_files" -eq 0 ]; then
55- upgrade_scripts_dir=@abs_top_builddir@/src/share/database/scripts/pgsql
56+ upgrade_scripts_dir=@abs_top_srcdir@/src/share/database/scripts/pgsql
57
58 # Check if the scripts directory exists at all.
59 if [ ! -d ${upgrade_scripts_dir} ]; then
60--
612.39.2
62
diff --git a/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch b/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch
new file mode 100644
index 0000000000..15c09d4c41
--- /dev/null
+++ b/meta/recipes-connectivity/kea/files/0001-make-kea-environment-available-to-lfc.patch
@@ -0,0 +1,96 @@
1From 72d7e6c0b6b5af4fea2e4db9ed33757984ccdc5b Mon Sep 17 00:00:00 2001
2From: Razvan Becheriu <razvan@isc.org>
3Date: Fri, 14 Jun 2024 17:09:50 +0300
4Subject: [PATCH] make kea environment available to lfc
5
6Upstream-Status: Backport
7[https://gitlab.isc.org/isc-projects/kea/-/commit/f477e8ebcc8b8e1f1adaad4d55031084c0ff6f40]
8
9Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
10---
11 configure.ac | 2 ++
12 src/lib/dhcpsrv/memfile_lease_mgr.cc | 3 ++-
13 .../tests/memfile_lease_mgr_unittest.cc | 26 +++++++++++++++++++
14 src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in | 6 +++++
15 4 files changed, 36 insertions(+), 1 deletion(-)
16 create mode 100644 src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in
17
18diff --git a/configure.ac b/configure.ac
19index c00edb5..7b572b0 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -1629,6 +1629,8 @@ AC_CONFIG_FILES([src/lib/dhcp_ddns/tests/Makefile])
23 AC_CONFIG_FILES([src/lib/dhcpsrv/Makefile])
24 AC_CONFIG_FILES([src/lib/dhcpsrv/tests/Makefile])
25 AC_CONFIG_FILES([src/lib/dhcpsrv/tests/test_libraries.h])
26+AC_CONFIG_FILES([src/lib/dhcpsrv/tests/test_kea_lfc_env.sh],
27+ [chmod +x src/lib/dhcpsrv/tests/test_kea_lfc_env.sh])
28 AC_CONFIG_FILES([src/lib/dhcpsrv/testutils/Makefile])
29 AC_CONFIG_FILES([src/lib/dns/Makefile])
30 AC_CONFIG_FILES([src/lib/dns/tests/Makefile])
31diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc
32index db4f5d5..0ecf3e7 100644
33--- a/src/lib/dhcpsrv/memfile_lease_mgr.cc
34+++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc
35@@ -209,7 +209,8 @@ LFCSetup::setup(const uint32_t lfc_interval,
36 args.push_back("ignored-path");
37
38 // Create the process (do not start it yet).
39- process_.reset(new ProcessSpawn(ProcessSpawn::ASYNC, executable, args));
40+ process_.reset(new ProcessSpawn(ProcessSpawn::ASYNC, executable, args,
41+ ProcessEnvVars(), true));
42
43 // If we've been told to run it once now, invoke the callback directly.
44 if (run_once_now) {
45diff --git a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
46index 034f1f5..9edf637 100644
47--- a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
48+++ b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
49@@ -534,6 +534,32 @@ TEST_F(MemfileLeaseMgrTest, lfcTimer) {
50 EXPECT_EQ(2, lease_mgr->getLFCCount());
51 }
52
53+/// @brief Check that the kea environment is accesible to the Lease
54+/// File Cleanup process.
55+TEST_F(MemfileLeaseMgrTest, lfcEnv) {
56+ DatabaseConnection::ParameterMap pmap;
57+ pmap["type"] = "memfile";
58+ pmap["universe"] = "4";
59+ pmap["name"] = getLeaseFilePath("leasefile4_0.csv");
60+ pmap["lfc-interval"] = "1";
61+
62+ std::ostringstream s;
63+ s << DHCP_DATA_DIR << "/test_kea_lfc_env.sh";
64+ setenv("KEA_LFC_EXECUTABLE", s.str().c_str(), 1);
65+
66+ boost::scoped_ptr<NakedMemfileLeaseMgr> lease_mgr(new NakedMemfileLeaseMgr(pmap));
67+
68+ // Try to run the lease file cleanup.
69+ ASSERT_NO_THROW(lease_mgr->lfcCallback());
70+
71+ // Wait for the LFC process to complete.
72+ ASSERT_TRUE(waitForProcess(*lease_mgr, 1));
73+
74+ // And make sure it has returned an exit status of 0.
75+ EXPECT_EQ(0, lease_mgr->getLFCExitStatus())
76+ << "environment not available to LFC";
77+}
78+
79 /// @brief This test checks if the LFC timer is disabled (doesn't trigger)
80 /// cleanups when the lfc-interval is set to 0.
81 TEST_F(MemfileLeaseMgrTest, lfcTimerDisabled) {
82diff --git a/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in b/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in
83new file mode 100644
84index 0000000..3eb71d5
85--- /dev/null
86+++ b/src/lib/dhcpsrv/tests/test_kea_lfc_env.sh.in
87@@ -0,0 +1,6 @@
88+#!/bin/sh
89+
90+if [ $(env | grep -c KEA_LFC_EXECUTABLE) != 0 ]; then
91+ exit 0
92+fi
93+exit 1
94--
952.25.1
96
diff --git a/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch b/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch
index 5b135b3aee..763639327a 100644
--- a/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch
+++ b/meta/recipes-connectivity/kea/files/fix-multilib-conflict.patch
@@ -8,17 +8,21 @@ Subject: [PATCH] There are conflict of config files between kea and lib32-kea:
8 lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 8 lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64
9| file /etc/kea/kea-dhcp4.conf conflicts between attempted installs of 9| file /etc/kea/kea-dhcp4.conf conflicts between attempted installs of
10 lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64 10 lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64
11| file /etc/kea/kea-dhcp6.conf conflicts between attempted installs of
12 lib32-kea-2.6.1-r0.core2_32 and kea-2.6.1-r0.core2_64
11 13
12Because they are all commented out, replace the expanded libdir path with 14Because they are all commented out, replace the expanded libdir path with
13'$libdir' in the config files to avoid conflict. 15'$libdir' in the config files to avoid conflict.
14 16
15Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/2602] 17Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/2602]
16Signed-off-by: Kai Kang <kai.kang@windriver.com> 18Signed-off-by: Kai Kang <kai.kang@windriver.com>
19Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
17 20
18--- 21---
19 src/bin/keactrl/kea-ctrl-agent.conf.pre | 3 ++- 22 src/bin/keactrl/kea-ctrl-agent.conf.pre | 3 ++-
20 src/bin/keactrl/kea-dhcp4.conf.pre | 4 ++-- 23 src/bin/keactrl/kea-dhcp4.conf.pre | 4 ++--
21 2 files changed, 4 insertions(+), 3 deletions(-) 24 src/bin/keactrl/kea-dhcp6.conf.pre | 4 ++--
25 3 files changed, 6 insertions(+), 5 deletions(-)
22 26
23diff --git a/src/bin/keactrl/kea-ctrl-agent.conf.pre b/src/bin/keactrl/kea-ctrl-agent.conf.pre 27diff --git a/src/bin/keactrl/kea-ctrl-agent.conf.pre b/src/bin/keactrl/kea-ctrl-agent.conf.pre
24index e6ae8b8..50a3092 100644 28index e6ae8b8..50a3092 100644
@@ -56,3 +60,25 @@ index 6edb8a1..b2a7385 100644
56 // "parameters": { 60 // "parameters": {
57 // "identifier-expression": "relay4[2].hex" 61 // "identifier-expression": "relay4[2].hex"
58 // } 62 // }
63diff --git a/src/bin/keactrl/kea-dhcp6.conf.pre b/src/bin/keactrl/kea-dhcp6.conf.pre
64index 271021b..5b85854 100644
65--- a/src/bin/keactrl/kea-dhcp6.conf.pre
66+++ b/src/bin/keactrl/kea-dhcp6.conf.pre
67@@ -201,7 +201,7 @@
68 // // of all devices serviced by Kea, including their identifiers
69 // // (like MAC address), their location in the network, times
70 // // when they were active etc.
71- // "library": "@libdir@/kea/hooks/libdhcp_legal_log.so",
72+ // "library": "$libdir/kea/hooks/libdhcp_legal_log.so",
73 // "parameters": {
74 // "path": "/var/lib/kea",
75 // "base-name": "kea-forensic6"
76@@ -218,7 +218,7 @@
77 // // of specific options or perhaps even a combination of several
78 // // options and fields to uniquely identify a client. Those scenarios
79 // // are addressed by the Flexible Identifiers hook application.
80- // "library": "@libdir@/kea/hooks/libdhcp_flex_id.so",
81+ // "library": "$libdir/kea/hooks/libdhcp_flex_id.so",
82 // "parameters": {
83 // "identifier-expression": "relay6[0].option[37].hex"
84 // }
diff --git a/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch
index 63a6a2805b..2f5a217d3f 100644
--- a/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch
+++ b/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch
@@ -1,4 +1,4 @@
1From c878a356712606549f7f188b62f7d1cae08a176e Mon Sep 17 00:00:00 2001 1From f5125725e4e2e250ccc78a17a8b77431100e7c15 Mon Sep 17 00:00:00 2001
2From: Armin kuster <akuster808@gmail.com> 2From: Armin kuster <akuster808@gmail.com>
3Date: Wed, 14 Oct 2020 22:48:31 -0700 3Date: Wed, 14 Oct 2020 22:48:31 -0700
4Subject: [PATCH] Busybox does not support ps -p so use pgrep 4Subject: [PATCH] Busybox does not support ps -p so use pgrep
@@ -8,15 +8,18 @@ Based on changes from Diego Sueiro <Diego.Sueiro@arm.com>
8 8
9Signed-off-by: Armin kuster <akuster808@gmail.com> 9Signed-off-by: Armin kuster <akuster808@gmail.com>
10 10
11Refresh to apply on top of 2.6.1.
12
13Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
11--- 14---
12 src/bin/keactrl/keactrl.in | 4 ++-- 15 src/bin/keactrl/keactrl.in | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-) 16 1 file changed, 2 insertions(+), 2 deletions(-)
14 17
15diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in 18diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in
16index 450e997..c353ca9 100644 19index cccfdac303..20ae2e6ec5 100644
17--- a/src/bin/keactrl/keactrl.in 20--- a/src/bin/keactrl/keactrl.in
18+++ b/src/bin/keactrl/keactrl.in 21+++ b/src/bin/keactrl/keactrl.in
19@@ -149,8 +149,8 @@ check_running() { 22@@ -146,8 +146,8 @@ check_running() {
20 # Get the PID from the PID file (if it exists) 23 # Get the PID from the PID file (if it exists)
21 get_pid_from_file "${proc_name}" 24 get_pid_from_file "${proc_name}"
22 if [ ${_pid} -gt 0 ]; then 25 if [ ${_pid} -gt 0 ]; then
@@ -27,3 +30,6 @@ index 450e997..c353ca9 100644
27 # No error, so PID IS ALIVE 30 # No error, so PID IS ALIVE
28 _running=1 31 _running=1
29 fi 32 fi
33--
342.39.2
35
diff --git a/meta/recipes-connectivity/kea/kea_2.4.1.bb b/meta/recipes-connectivity/kea/kea_2.6.3.bb
index c3aa4dc8f0..1df91e4522 100644
--- a/meta/recipes-connectivity/kea/kea_2.4.1.bb
+++ b/meta/recipes-connectivity/kea/kea_2.6.3.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Kea is the next generation of DHCP software developed by ISC. It
3HOMEPAGE = "http://kea.isc.org" 3HOMEPAGE = "http://kea.isc.org"
4SECTION = "connectivity" 4SECTION = "connectivity"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://COPYING;md5=ea061fa0188838072c4248c1318ec131" 6LIC_FILES_CHKSUM = "file://COPYING;md5=ee16e7280a6cf2a1487717faf33190dc"
7 7
8DEPENDS = "boost log4cplus openssl" 8DEPENDS = "boost log4cplus openssl"
9 9
@@ -17,9 +17,9 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \
17 file://fix-multilib-conflict.patch \ 17 file://fix-multilib-conflict.patch \
18 file://fix_pid_keactrl.patch \ 18 file://fix_pid_keactrl.patch \
19 file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ 19 file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \
20 file://0001-kea-fix-reproducible-build-failure.patch \ 20 file://0001-make-kea-environment-available-to-lfc.patch \
21 " 21 "
22SRC_URI[sha256sum] = "815c61f5c271caa4a1db31dd656eb50a7f6ea973da3690f7c8581408e180131a" 22SRC_URI[sha256sum] = "00241a5955ffd3d215a2c098c4527f9d7f4b203188b276f9a36250dd3d9dd612"
23 23
24inherit autotools systemd update-rc.d upstream-version-is-even 24inherit autotools systemd update-rc.d upstream-version-is-even
25 25
@@ -39,6 +39,7 @@ DEBUG_OPTIMIZATION:append:mipsel = " -O"
39BUILD_OPTIMIZATION:remove:mipsel = " -Og" 39BUILD_OPTIMIZATION:remove:mipsel = " -Og"
40BUILD_OPTIMIZATION:append:mipsel = " -O" 40BUILD_OPTIMIZATION:append:mipsel = " -O"
41 41
42CXXFLAGS:remove = "-fvisibility-inlines-hidden"
42EXTRA_OECONF = "--with-boost-libs=-lboost_system \ 43EXTRA_OECONF = "--with-boost-libs=-lboost_system \
43 --with-log4cplus=${STAGING_DIR_TARGET}${prefix} \ 44 --with-log4cplus=${STAGING_DIR_TARGET}${prefix} \
44 --with-openssl=${STAGING_DIR_TARGET}${prefix}" 45 --with-openssl=${STAGING_DIR_TARGET}${prefix}"
@@ -47,7 +48,7 @@ do_configure:prepend() {
47 # replace abs_top_builddir to avoid introducing the build path 48 # replace abs_top_builddir to avoid introducing the build path
48 # don't expand the abs_top_builddir on the target as the abs_top_builddir is meanlingless on the target 49 # don't expand the abs_top_builddir on the target as the abs_top_builddir is meanlingless on the target
49 find ${S} -type f -name *.sh.in | xargs sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g" 50 find ${S} -type f -name *.sh.in | xargs sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g"
50 sed -i "s:@abs_top_srcdir@:@abs_top_srcdir_placeholder@:g" ${S}/src/bin/admin/kea-admin.in 51 sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g" ${S}/src/bin/admin/kea-admin.in
51} 52}
52 53
53# patch out build host paths for reproducibility 54# patch out build host paths for reproducibility
@@ -59,11 +60,12 @@ do_install:append() {
59 install -d ${D}${sysconfdir}/init.d 60 install -d ${D}${sysconfdir}/init.d
60 install -d ${D}${systemd_system_unitdir} 61 install -d ${D}${systemd_system_unitdir}
61 62
62 install -m 0644 ${WORKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir} 63 install -m 0644 ${UNPACKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir}
63 install -m 0755 ${WORKDIR}/kea-*-server ${D}${sysconfdir}/init.d 64 install -m 0755 ${UNPACKDIR}/kea-*-server ${D}${sysconfdir}/init.d
64 sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \ 65 sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \
65 -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \ 66 -e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \
66 ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl 67 ${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl
68 sed -i "s:${B}:@abs_top_builddir_placeholder@:g" ${D}${sbindir}/kea-admin
67} 69}
68 70
69do_install:append() { 71do_install:append() {