Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,28 @@
From 841924e1fe8db2bff3eab8d37634ef08f86c00ec Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 10 Nov 2020 15:57:03 +0000
Subject: [PATCH] src/lib/log/logger_unittest_support.cc: do not write build
path into binary
This breaks reproducibility and is needed only in unit testing.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
src/lib/log/logger_unittest_support.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/log/logger_unittest_support.cc b/src/lib/log/logger_unittest_support.cc
index fc01c6e..f46d17e 100644
--- a/src/lib/log/logger_unittest_support.cc
+++ b/src/lib/log/logger_unittest_support.cc
@@ -84,7 +84,7 @@ void initLogger(isc::log::Severity severity, int dbglevel) {
const char* localfile = getenv("KEA_LOGGER_LOCALMSG");
// Set a directory for creating lockfiles when running tests
- setenv("KEA_LOCKFILE_DIR", TOP_BUILDDIR, 0);
+ //setenv("KEA_LOCKFILE_DIR", TOP_BUILDDIR, 0);
// Initialize logging
initLogger(root, severity, dbglevel, localfile);
@@ -0,0 +1,58 @@
From d027b1d85a8c1a0193b6e4a00083d3038d699a59 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Tue, 22 Sep 2020 15:02:33 +0800
Subject: [PATCH] There are conflict of config files between kea and lib32-kea:
| Error: Transaction test error:
| file /etc/kea/kea-ctrl-agent.conf conflicts between attempted installs of
lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64
| file /etc/kea/kea-dhcp4.conf conflicts between attempted installs of
lib32-kea-1.7.10-r0.core2_32 and kea-1.7.10-r0.core2_64
Because they are all commented out, replace the expanded libdir path with
'$libdir' in the config files to avoid conflict.
Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/2602]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/bin/keactrl/kea-ctrl-agent.conf.pre | 3 ++-
src/bin/keactrl/kea-dhcp4.conf.pre | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/bin/keactrl/kea-ctrl-agent.conf.pre b/src/bin/keactrl/kea-ctrl-agent.conf.pre
index e6ae8b8..50a3092 100644
--- a/src/bin/keactrl/kea-ctrl-agent.conf.pre
+++ b/src/bin/keactrl/kea-ctrl-agent.conf.pre
@@ -51,7 +51,8 @@
// Agent will fail to start.
"hooks-libraries": [
// {
-// "library": "@libdir@/kea/hooks/control-agent-commands.so",
+// // Replace $libdir with real library path /usr/lib or /usr/lib64
+// "library": "$libdir/kea/hooks/control-agent-commands.so",
// "parameters": {
// "param1": "foo"
// }
diff --git a/src/bin/keactrl/kea-dhcp4.conf.pre b/src/bin/keactrl/kea-dhcp4.conf.pre
index 26bf163..49ddb0a 100644
--- a/src/bin/keactrl/kea-dhcp4.conf.pre
+++ b/src/bin/keactrl/kea-dhcp4.conf.pre
@@ -252,7 +252,7 @@
// // of all devices serviced by Kea, including their identifiers
// // (like MAC address), their location in the network, times
// // when they were active etc.
- // "library": "@libdir@/kea/hooks/libdhcp_legal_log.so",
+ // "library": "$libdir/kea/hooks/libdhcp_legal_log.so",
// "parameters": {
// "path": "/var/lib/kea",
// "base-name": "kea-forensic4"
@@ -269,7 +269,7 @@
// // of specific options or perhaps even a combination of several
// // options and fields to uniquely identify a client. Those scenarios
// // are addressed by the Flexible Identifiers hook application.
- // "library": "@libdir@/kea/hooks/libdhcp_flex_id.so",
+ // "library": "$libdir/kea/hooks/libdhcp_flex_id.so",
// "parameters": {
// "identifier-expression": "relay4[2].hex"
// }
@@ -0,0 +1,29 @@
From 18f4f6206c248d6169aa67b3ecf16bf54e9292e8 Mon Sep 17 00:00:00 2001
From: Armin kuster <akuster808@gmail.com>
Date: Wed, 14 Oct 2020 22:48:31 -0700
Subject: [PATCH] Busybox does not support ps -p so use pgrep
Upstream-Status: Inappropriate [embedded specific]
Based on changes from Diego Sueiro <Diego.Sueiro@arm.com>
Signed-off-by: Armin kuster <akuster808@gmail.com>
---
src/bin/keactrl/keactrl.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in
index ae5bd8e..e9f9b73 100644
--- a/src/bin/keactrl/keactrl.in
+++ b/src/bin/keactrl/keactrl.in
@@ -151,8 +151,8 @@ check_running() {
# Get the PID from the PID file (if it exists)
get_pid_from_file "${proc_name}"
if [ ${_pid} -gt 0 ]; then
- # Use ps to check if PID is alive
- if ps -p ${_pid} 1>/dev/null; then
+ # Use pgrep and grep to check if PID is alive
+ if pgrep -v 1 | grep ${_pid} 1>/dev/null; then
# No error, so PID IS ALIVE
_running=1
fi
@@ -0,0 +1,46 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: kea-dhcp-ddns-server
# Required-Start: $local_fs $network $remote_fs $syslog
# Required-Stop: $local_fs $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ISC KEA DHCP IPv6 Server
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp-ddns-server"
NAME=kea-dhcp-ddns
DAEMON=/usr/sbin/keactrl
DAEMON_ARGS=" -s dhcp_ddns"
set -e
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Source function library.
. /etc/init.d/functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
kpid=`pidof $NAME`
kill $kpid
echo "done."
;;
restart|force-reload)
#
$0 stop
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
@@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCP-DDNS Server
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/kea
ExecStart=@SBINDIR@/kea-dhcp-ddns -c @SYSCONFDIR@/kea/kea-dhcp-ddns.conf
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,46 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: kea-dhcp4-server
# Required-Start: $local_fs $network $remote_fs $syslog
# Required-Stop: $local_fs $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ISC KEA DHCP IPv6 Server
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp4-server"
NAME=kea-dhcp4
DAEMON=/usr/sbin/keactrl
DAEMON_ARGS=" -s dhcp4"
set -e
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Source function library.
. /etc/init.d/functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
kpid=`pidof $NAME`
kill $kpid
echo "done."
;;
restart|force-reload)
#
$0 stop
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
@@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCPv4 Server
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/lib/kea
ExecStart=@SBINDIR@/kea-dhcp4 -c @SYSCONFDIR@/kea/kea-dhcp4.conf
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,47 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: kea-dhcp6-server
# Required-Start: $local_fs $network $remote_fs $syslog
# Required-Stop: $local_fs $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ISC KEA DHCP IPv6 Server
### END INIT INFO
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp6-server"
NAME=kea-dhcp6
DAEMON=/usr/sbin/keactrl
DAEMON_ARGS=" -s dhcp6"
set -e
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Source function library.
. /etc/init.d/functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
kpid=`pidof $NAME`
kill $kpid
echo "done."
;;
restart|force-reload)
#
$0 stop
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
@@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCPv6 Server
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/lib/kea
ExecStart=@SBINDIR@/kea-dhcp6 -c @SYSCONFDIR@/kea/kea-dhcp6.conf
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,77 @@
SUMMARY = "ISC Kea DHCP Server"
DESCRIPTION = "Kea is the next generation of DHCP software developed by ISC. It supports both DHCPv4 and DHCPv6 protocols along with their extensions, e.g. prefix delegation and dynamic updates to DNS."
HOMEPAGE = "http://kea.isc.org"
SECTION = "connectivity"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=97ce14bdd2733f5b84ab5e29380d057d"
DEPENDS = "boost log4cplus openssl"
SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \
file://kea-dhcp4.service \
file://kea-dhcp6.service \
file://kea-dhcp-ddns.service \
file://kea-dhcp4-server \
file://kea-dhcp6-server \
file://kea-dhcp-ddns-server \
file://fix-multilib-conflict.patch \
file://fix_pid_keactrl.patch \
file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \
"
SRC_URI[sha256sum] = "da7d90ca62a772602dac6e77e507319038422895ad68eeb142f1487d67d531d2"
inherit autotools systemd update-rc.d upstream-version-is-even
INITSCRIPT_NAME = "kea-dhcp4-server"
INITSCRIPT_PARAMS = "defaults 30"
SYSTEMD_SERVICE:${PN} = "kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service"
SYSTEMD_AUTO_ENABLE = "disable"
DEBUG_OPTIMIZATION:remove:mips = " -Og"
DEBUG_OPTIMIZATION:append:mips = " -O"
BUILD_OPTIMIZATION:remove:mips = " -Og"
BUILD_OPTIMIZATION:append:mips = " -O"
DEBUG_OPTIMIZATION:remove:mipsel = " -Og"
DEBUG_OPTIMIZATION:append:mipsel = " -O"
BUILD_OPTIMIZATION:remove:mipsel = " -Og"
BUILD_OPTIMIZATION:append:mipsel = " -O"
EXTRA_OECONF = "--with-boost-libs=-lboost_system \
--with-log4cplus=${STAGING_DIR_TARGET}${prefix} \
--with-openssl=${STAGING_DIR_TARGET}${prefix}"
do_configure:prepend() {
# replace abs_top_builddir to avoid introducing the build path
# don't expand the abs_top_builddir on the target as the abs_top_builddir is meanlingless on the target
find ${S} -type f -name *.sh.in | xargs sed -i "s:@abs_top_builddir@:@abs_top_builddir_placeholder@:g"
sed -i "s:@abs_top_srcdir@:@abs_top_srcdir_placeholder@:g" ${S}/src/bin/admin/kea-admin.in
}
# patch out build host paths for reproducibility
do_compile:prepend:class-target() {
sed -i -e "s,${WORKDIR},,g" ${B}/config.report
}
do_install:append() {
install -d ${D}${sysconfdir}/init.d
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/kea-dhcp*service ${D}${systemd_system_unitdir}
install -m 0755 ${WORKDIR}/kea-*-server ${D}${sysconfdir}/init.d
sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@LOCALSTATEDIR@,${localstatedir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${systemd_system_unitdir}/kea-dhcp*service ${D}${sbindir}/keactrl
}
do_install:append() {
rm -rf "${D}${localstatedir}"
}
CONFFILES:${PN} = "${sysconfdir}/kea/keactrl.conf"
FILES:${PN}-staticdev += "${libdir}/kea/hooks/*.a ${libdir}/hooks/*.a"
FILES:${PN} += "${libdir}/hooks/*.so"
PARALLEL_MAKEINST = ""