summaryrefslogtreecommitdiff
path: root/package/watchdog
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/watchdog
Initial import
Diffstat (limited to 'package/watchdog')
-rw-r--r--package/watchdog/Config.in7
-rw-r--r--package/watchdog/Makefile35
-rw-r--r--package/watchdog/files/watchdog.init27
-rw-r--r--package/watchdog/ipkg/watchdog.conffiles1
-rw-r--r--package/watchdog/ipkg/watchdog.control4
-rw-r--r--package/watchdog/ipkg/watchdog.postinst3
-rw-r--r--package/watchdog/patches/01-fstab-sys_siglist.patch11
-rw-r--r--package/watchdog/patches/patch-src_mntent_c21
-rw-r--r--package/watchdog/patches/patch-src_umount_c12
9 files changed, 121 insertions, 0 deletions
diff --git a/package/watchdog/Config.in b/package/watchdog/Config.in
new file mode 100644
index 000000000..aae8b3ea8
--- /dev/null
+++ b/package/watchdog/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_WATCHDOG
+ prompt "watchdog.......................... configurable watchdog"
+ tristate
+ default n
+ help
+ watchdog
+
diff --git a/package/watchdog/Makefile b/package/watchdog/Makefile
new file mode 100644
index 000000000..bce8e4141
--- /dev/null
+++ b/package/watchdog/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= watchdog
+PKG_VERSION:= 5.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 66480128b9dabcced2e4c8db3e60fa50
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=watchdog/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WATCHDOG,watchdog,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+XAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" \
+ INCLS="-I. -I${STAGING_DIR}/usr/include" \
+ LIBS="-L${STAGING_DIR}/usr/lib"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/etc/
+ ${INSTALL_DATA} ${WRKINST}/etc/watchdog.conf ${IDIR_WATCHDOG}/etc/
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/etc/init.d/
+ ${INSTALL_BIN} ./files/watchdog.init \
+ ${IDIR_WATCHDOG}/etc/init.d/watchdog
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/watchdog \
+ ${WRKINST}/usr/sbin/wd_keepalive ${IDIR_WATCHDOG}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/watchdog/files/watchdog.init b/package/watchdog/files/watchdog.init
new file mode 100644
index 000000000..fba89afe5
--- /dev/null
+++ b/package/watchdog/files/watchdog.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 15
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${watchdog:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/watchdog
+ ;;
+stop)
+ killall watchdog
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 { start | stop | restart }"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/watchdog/ipkg/watchdog.conffiles b/package/watchdog/ipkg/watchdog.conffiles
new file mode 100644
index 000000000..3ef13592a
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.conffiles
@@ -0,0 +1 @@
+/etc/watchdog.conf
diff --git a/package/watchdog/ipkg/watchdog.control b/package/watchdog/ipkg/watchdog.control
new file mode 100644
index 000000000..1cde1974e
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.control
@@ -0,0 +1,4 @@
+Package: watchdog
+Priority: opt
+Section: sys
+Description: watchdog
diff --git a/package/watchdog/ipkg/watchdog.postinst b/package/watchdog/ipkg/watchdog.postinst
new file mode 100644
index 000000000..17d144395
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf watchdog watchdog NO
diff --git a/package/watchdog/patches/01-fstab-sys_siglist.patch b/package/watchdog/patches/01-fstab-sys_siglist.patch
new file mode 100644
index 000000000..604ecdcb6
--- /dev/null
+++ b/package/watchdog/patches/01-fstab-sys_siglist.patch
@@ -0,0 +1,11 @@
+--- watchdog-5.2.4.orig.orig/src/fstab.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/fstab.c 2008-10-16 12:56:40.000000000 +0200
+@@ -237,7 +237,7 @@ static int old_lockfile = 1;
+ /* Ensure that the lock is released if we are interrupted. */
+ static void
+ handler (int sig) {
+- die (EX_USER, "%s", sys_siglist[sig]);
++ die (EX_USER, "%s", "sys_siglist[sig]");
+ }
+
+ static void
diff --git a/package/watchdog/patches/patch-src_mntent_c b/package/watchdog/patches/patch-src_mntent_c
new file mode 100644
index 000000000..c00b6ff45
--- /dev/null
+++ b/package/watchdog/patches/patch-src_mntent_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- watchdog-5.2.4.orig.orig/src/mntent.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/mntent.c 2008-10-16 13:00:20.000000000 +0200
+@@ -6,7 +6,7 @@
+ #endif
+
+ #include <stdio.h>
+-#include <string.h> /* for index */
++#include <string.h> /* for strchr */
+ #include <ctype.h> /* for isdigit */
+ #include "wd_mntent.h"
+ #include "sundries.h" /* for xmalloc */
+@@ -155,7 +155,7 @@ my_getmntent (mntFILE *mfp) {
+ if (fgets (buf, sizeof(buf), mfp->mntent_fp) == NULL)
+ return NULL;
+
+- s = index (buf, '\n');
++ s = strchr (buf, '\n');
+ if (s == NULL) {
+ /* extremely long line - assume file was corrupted */
+ mfp->mntent_errs = 1;
diff --git a/package/watchdog/patches/patch-src_umount_c b/package/watchdog/patches/patch-src_umount_c
new file mode 100644
index 000000000..cf421ce79
--- /dev/null
+++ b/package/watchdog/patches/patch-src_umount_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- watchdog-5.2.4.orig.orig/src/umount.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/umount.c 2008-10-16 13:00:07.000000000 +0200
+@@ -210,7 +210,7 @@ umount_one (const char *spec, const char
+ if (res < 0)
+ umnt_err2 = errno;
+ /* Do not complain about remote NFS mount points */
+- if (errno == ENOENT && index(spec, ':'))
++ if (errno == ENOENT && strchr(spec, ':'))
+ umnt_err2 = 0;
+ }
+ }