diff options
Diffstat (limited to 'meta/recipes-extended/watchdog')
4 files changed, 99 insertions, 23 deletions
diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb index 8bf40f0f0e..e826a7d4a6 100644 --- a/meta/recipes-extended/watchdog/watchdog-config.bb +++ b/meta/recipes-extended/watchdog/watchdog-config.bb @@ -5,7 +5,7 @@ the system." HOMEPAGE = "http://watchdog.sourceforge.net/" BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" -LICENSE = "MIT-X" +LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" SRC_URI = " \ @@ -13,8 +13,15 @@ SRC_URI = " \ file://watchdog.conf \ " +# The default value is 60 seconds when null. +WATCHDOG_TIMEOUT ??= "" + do_install() { - install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog - install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf + install -Dm 0644 ${UNPACKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog + install -Dm 0644 ${UNPACKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf + + if [ -n "${WATCHDOG_TIMEOUT}" ]; then + echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf + fi } diff --git a/meta/recipes-extended/watchdog/watchdog/0001-shutdown-Do-not-guard-sys-quota.h-sys-swap.h-and-sys.patch b/meta/recipes-extended/watchdog/watchdog/0001-shutdown-Do-not-guard-sys-quota.h-sys-swap.h-and-sys.patch new file mode 100644 index 0000000000..8c419e1d11 --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog/0001-shutdown-Do-not-guard-sys-quota.h-sys-swap.h-and-sys.patch @@ -0,0 +1,37 @@ +From ca1d379fa13c4055d42d2ff3a647b4397768efcd Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 23 Aug 2022 19:23:26 -0700 +Subject: [PATCH] shutdown: Do not guard sys/quota.h sys/swap.h and + sys/reboot.h with __GLIBC__ + +These headers are provided by uclibc/musl/glibc and bionic so we can +assume they are not needed to be glibc specific includes. This also +ensures that we get proper declaration of reboot() API + +Upstream-Status: Submitted [https://sourceforge.net/p/watchdog/patches/12/] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/shutdown.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/src/shutdown.c b/src/shutdown.c +index 1d9a857..6aea0d0 100644 +--- a/src/shutdown.c ++++ b/src/shutdown.c +@@ -29,13 +29,9 @@ + #include "extern.h" + #include "ext2_mnt.h" + +-#if defined __GLIBC__ + #include <sys/quota.h> + #include <sys/swap.h> + #include <sys/reboot.h> +-#else /* __GLIBC__ */ +-#include <linux/quota.h> +-#endif /* __GLIBC__ */ + + #include <unistd.h> + +-- +2.37.2 + diff --git a/meta/recipes-extended/watchdog/watchdog/0001-wd_keepalive.service-use-run-instead-of-var-run.patch b/meta/recipes-extended/watchdog/watchdog/0001-wd_keepalive.service-use-run-instead-of-var-run.patch new file mode 100644 index 0000000000..5c5d2f4e44 --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog/0001-wd_keepalive.service-use-run-instead-of-var-run.patch @@ -0,0 +1,30 @@ +From b5cb6166dbfa57d1d94b19d4a098991a817f68f5 Mon Sep 17 00:00:00 2001 +From: Chen Qi <Qi.Chen@windriver.com> +Date: Thu, 15 Oct 2020 10:02:17 +0800 +Subject: [PATCH] wd_keepalive.service: use /run instead of /var/run + +/var/run is deprecated by systemd, use /run instead. + +Upstream-Status: Pending + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + debian/wd_keepalive.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/debian/wd_keepalive.service b/debian/wd_keepalive.service +index 7f8b1dc..0f2a153 100644 +--- a/debian/wd_keepalive.service ++++ b/debian/wd_keepalive.service +@@ -7,7 +7,7 @@ Type=forking + EnvironmentFile=/etc/default/watchdog + ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module' + ExecStart=/usr/sbin/wd_keepalive $watchdog_options +-PIDFile=/var/run/wd_keepalive.pid ++PIDFile=/run/wd_keepalive.pid + + [Install] + WantedBy=multi-user.target +-- +2.17.1 + diff --git a/meta/recipes-extended/watchdog/watchdog_5.16.bb b/meta/recipes-extended/watchdog/watchdog_5.16.bb index 0199487e2e..c88ea08ade 100644 --- a/meta/recipes-extended/watchdog/watchdog_5.16.bb +++ b/meta/recipes-extended/watchdog/watchdog_5.16.bb @@ -5,51 +5,53 @@ it will reboot the system." HOMEPAGE = "http://watchdog.sourceforge.net/" BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" -LICENSE = "GPL-2.0+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=084236108b1d4a9851bf5213fea586fd" SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \ file://0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch \ file://watchdog.init \ file://wd_keepalive.init \ + file://0001-wd_keepalive.service-use-run-instead-of-var-run.patch \ + file://0001-shutdown-Do-not-guard-sys-quota.h-sys-swap.h-and-sys.patch \ " SRC_URI[md5sum] = "1b4f51cabc64d1bee2fce7cdd626831f" SRC_URI[sha256sum] = "b8e7c070e1b72aee2663bdc13b5cc39f76c9232669cfbb1ac0adc7275a3b019d" +# Can be dropped when the output next changes, avoids failures after +# reproducibility issues + UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/" UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/" inherit autotools update-rc.d systemd pkgconfig -DEPENDS += "libtirpc" -CFLAGS += "-I${STAGING_INCDIR}/tirpc" -LDFLAGS += "-ltirpc" - EXTRA_OECONF += " --disable-nfs " +CACHED_CONFIGUREVARS += "ac_cv_path_PATH_SENDMAIL=${sbindir}/sendmail" INITSCRIPT_PACKAGES = "${PN} ${PN}-keepalive" -INITSCRIPT_NAME_${PN} = "watchdog" -INITSCRIPT_PARAMS_${PN} = "start 25 1 2 3 4 5 . stop 85 0 6 ." +INITSCRIPT_NAME:${PN} = "watchdog" +INITSCRIPT_PARAMS:${PN} = "start 25 1 2 3 4 5 . stop 85 0 6 ." -INITSCRIPT_NAME_${PN}-keepalive = "wd_keepalive" -INITSCRIPT_PARAMS_${PN}-keepalive = "start 25 1 2 3 4 5 . stop 85 0 6 ." +INITSCRIPT_NAME:${PN}-keepalive = "wd_keepalive" +INITSCRIPT_PARAMS:${PN}-keepalive = "start 25 1 2 3 4 5 . stop 85 0 6 ." SYSTEMD_PACKAGES = "${PN} ${PN}-keepalive" -SYSTEMD_SERVICE_${PN} = "watchdog.service" -SYSTEMD_SERVICE_${PN}-keepalive = "wd_keepalive.service" +SYSTEMD_SERVICE:${PN} = "watchdog.service" +SYSTEMD_SERVICE:${PN}-keepalive = "wd_keepalive.service" # When using systemd, consider making use of internal watchdog support of systemd. # See RuntimeWatchdogSec in /etc/systemd/system.conf. SYSTEMD_AUTO_ENABLE = "disable" -do_install_append() { +do_install:append() { install -d ${D}${systemd_system_unitdir} install -m 0644 ${S}/debian/watchdog.service ${D}${systemd_system_unitdir} install -m 0644 ${S}/debian/wd_keepalive.service ${D}${systemd_system_unitdir} - install -Dm 0755 ${WORKDIR}/watchdog.init ${D}/${sysconfdir}/init.d/watchdog - install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive + install -Dm 0755 ${UNPACKDIR}/watchdog.init ${D}/${sysconfdir}/init.d/watchdog + install -Dm 0755 ${UNPACKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive # watchdog.conf is provided by the watchdog-config recipe rm ${D}${sysconfdir}/watchdog.conf @@ -57,15 +59,15 @@ do_install_append() { PACKAGES =+ "${PN}-keepalive" -FILES_${PN}-keepalive = " \ +FILES:${PN}-keepalive = " \ ${sysconfdir}/init.d/wd_keepalive \ ${systemd_system_unitdir}/wd_keepalive.service \ ${sbindir}/wd_keepalive \ " -RDEPENDS_${PN} += "${PN}-config" -RRECOMMENDS_${PN} += "kernel-module-softdog" +RDEPENDS:${PN} += "${PN}-config" +RRECOMMENDS:${PN} += "kernel-module-softdog" -RDEPENDS_${PN}-keepalive += "${PN}-config" -RCONFLICTS_${PN}-keepalive += "${PN}" -RRECOMMENDS_${PN}-keepalive += "kernel-module-softdog" +RDEPENDS:${PN}-keepalive += "${PN}-config" +RCONFLICTS:${PN}-keepalive += "${PN}" +RRECOMMENDS:${PN}-keepalive += "kernel-module-softdog" |