added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
# Uncomment to start SNMP subagent and enable CDP, SONMP and EDP protocol
#DAEMON_ARGS="-x -c -s -e"

View File

@@ -0,0 +1,128 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: lldpd
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LLDP daemon
# Description: lldpd is a 802.1AB implementation, a L2 network
# discovery protocol. It also supports CDP, EDP and
# various other protocols.
### END INIT INFO
# Do NOT "set -e"
log_daemon_msg() {
echo $*
}
log_end_msg() {
if [ $1 -eq 0 ]; then
success $*
else
failure $*
fi
}
log_failure_msg() {
echo $*
}
log_success_msg() {
echo $*
}
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="LLDP daemon"
NAME=lldpd
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
CHROOT=/var/run/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# LSB log_* functions
. /etc/init.d/functions
do_start()
{
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
do_stop()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
rm -f $PIDFILE
return "$RETVAL"
}
do_reload() {
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
status)
status_of_proc $DAEMON $NAME -p $PIDFILE && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
exit 3
;;
esac
:

View File

@@ -0,0 +1,16 @@
#!/bin/sh
num_fail=0
for test in tests/check*
do
./"$test" \
&& echo "PASS: $test" \
|| {
echo "FAIL: $test"
num_fail=$(( ${num_fail} + 1))
}
done
exit $num_fail

View File

@@ -0,0 +1,81 @@
SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
SECTION = "net/misc"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
DEPENDS = "libbsd libevent"
SRC_URI = "\
http://media.luffy.cx/files/${BPN}/${BP}.tar.gz \
file://lldpd.init.d \
file://lldpd.default \
file://run-ptest \
"
SRC_URI[sha256sum] = "e3b391650c7ba67cea2fe84d67fdb4d7fc8aa1ec5cf86eb8bb984711df8465a9"
inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases ptest
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd"
GROUPADD_PARAM:${PN} = "--system lldpd"
EXTRA_OECONF += "--without-embedded-libevent \
--disable-oldies \
--with-privsep-user=lldpd \
--with-privsep-group=lldpd \
--with-systemdsystemunitdir=${systemd_system_unitdir} \
--without-sysusersdir \
"
PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
INITSCRIPT_NAME = "lldpd"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE:${PN} = "lldpd.service"
do_install:append() {
install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
# Make an empty configuration file
touch ${D}${sysconfdir}/lldpd.conf
}
PACKAGES =+ "${PN}-zsh-completion"
FILES:${PN} += "${libdir}/sysusers.d"
RDEPENDS:${PN} += "os-release"
FILES:${PN}-zsh-completion += "${datadir}/zsh/"
# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
#RDEPENDS:${PN}-zsh-completion += "zsh"
RDEPENDS:${PN}-ptest = "libcheck"
DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'libcheck', '', d)}"
TESTDIR = "tests"
do_compile_ptest () {
# hack to remove the call to `make check-TESTS`
sed -i 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//g' ${TESTDIR}/Makefile
oe_runmake check
}
do_install_ptest () {
# install the tests
cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
# remove the object files
rm ${D}${PTEST_PATH}/${TESTDIR}/*.o
}