From fb2e1fd7d2df68d02f5da7dbf4390ea03e7eafdb Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Thu, 6 Nov 2014 16:19:44 -0800 Subject: watchdog: Upgrade to 5.14 Move the patches from generic files to watchdog Rebased the fix-ping due to code reorg on the source Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- .../watchdog/files/fix-ping-failure.patch | 65 ------------------ .../watchdog/files/fixsepbuild.patch | 27 -------- .../watchdog/watchdog/fix-ping-failure.patch | 79 ++++++++++++++++++++++ .../watchdog/watchdog/fixsepbuild.patch | 27 ++++++++ meta/recipes-extended/watchdog/watchdog_5.13.bb | 19 ------ meta/recipes-extended/watchdog/watchdog_5.14.bb | 20 ++++++ 6 files changed, 126 insertions(+), 111 deletions(-) delete mode 100644 meta/recipes-extended/watchdog/files/fix-ping-failure.patch delete mode 100644 meta/recipes-extended/watchdog/files/fixsepbuild.patch create mode 100644 meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch create mode 100644 meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch delete mode 100644 meta/recipes-extended/watchdog/watchdog_5.13.bb create mode 100644 meta/recipes-extended/watchdog/watchdog_5.14.bb diff --git a/meta/recipes-extended/watchdog/files/fix-ping-failure.patch b/meta/recipes-extended/watchdog/files/fix-ping-failure.patch deleted file mode 100644 index f5976eb5cf..0000000000 --- a/meta/recipes-extended/watchdog/files/fix-ping-failure.patch +++ /dev/null @@ -1,65 +0,0 @@ -Fix ping mode failure - -Upstream-Status: Pending - -When watchdog works on ping mode, the system will be rebooted since -watchdog can not receive the expected ECOREPLY on a setting interval. - -Ping mode uses a raw socket to send a ECO packet, then uses select() -to wait and recvfrom() to receive the ECOREPLY packet, if select() -shows the data is ready, and the data is not the expected ECOREPLY, -and waiting time is not overdue, it will continue use select() and -recvfrom(). - -Problem is that the raw socket can receive any icmp packets, if we do -not set filters, and there are many icmp packets on socket, this -program will not find its interested ECOREPLY packet in a special -interval, which makes the ping mode fail. - - -Other program is that watchdog sometime can not reach the call of -recvfrom to try to receive packets since tv_sec of struct timeval -of select parameter is 0. - -The timeout of select() is the result of ping interval minusing the -time of calling gettimeofday spending, when ping interval is 1 second, -and the call of gettimeofday() spends several useconds, the tv_sec of -struct timeval of select parameter must be 0, at that condition, we -should it is valid of tv_sec of struct timeval of select parameter be 0 - -Signed-off-by: Roy.Li ---- - src/net.c | 2 +- - src/watchdog.c | 5 ++++- - 2 files changed, 5 insertions(+), 2 deletions(-) - -Index: watchdog-5.13/src/watchdog.c -=================================================================== ---- watchdog-5.13.orig/src/watchdog.c 2013-02-01 03:15:44.000000000 -0800 -+++ watchdog-5.13/src/watchdog.c 2013-03-11 22:27:48.741657881 -0700 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -567,6 +568,8 @@ - pid_t child_pid; - int oom_adjusted = 0; - struct stat s; -+ struct icmp_filter filt; -+ filt.data = ~(1<sock_fp, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)); - /* this is necessary for broadcast pings to work */ - (void) setsockopt(net->sock_fp, SOL_SOCKET, SO_BROADCAST, (char *)&hold, sizeof(hold)); - diff --git a/meta/recipes-extended/watchdog/files/fixsepbuild.patch b/meta/recipes-extended/watchdog/files/fixsepbuild.patch deleted file mode 100644 index 2fad3a112f..0000000000 --- a/meta/recipes-extended/watchdog/files/fixsepbuild.patch +++ /dev/null @@ -1,27 +0,0 @@ -Fix out of tree build support: - -| installing /etc/watchdog.conf -| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5' -| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8' -| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.conf.5 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5' -| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_keepalive.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_identify.8 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8' -| /usr/bin/install: cannot stat `watchdog.conf': No such file or directory -| make[2]: *** [install-etc-local] Error 1 - -Upstream-Status: Pending - -RP 2013/03/21 - -Index: watchdog-5.13/Makefile.am -=================================================================== ---- watchdog-5.13.orig/Makefile.am 2013-02-01 11:15:44.000000000 +0000 -+++ watchdog-5.13/Makefile.am 2013-03-21 11:59:35.637139031 +0000 -@@ -16,7 +16,7 @@ - else \ - echo "installing $(CONFIG_FILENAME)"; \ - $(mkinstalldirs) `dirname $(DESTDIR)$(CONFIG_FILENAME)`; \ -- $(INSTALL_DATA) watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \ -+ $(INSTALL_DATA) $(srcdir)/watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \ - fi - - install-data-local: install-etc-local diff --git a/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch b/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch new file mode 100644 index 0000000000..14ab9c56ab --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch @@ -0,0 +1,79 @@ +Fix ping mode failure + +Upstream-Status: Pending + +When watchdog works on ping mode, the system will be rebooted since +watchdog can not receive the expected ECOREPLY on a setting interval. + +Ping mode uses a raw socket to send a ECO packet, then uses select() +to wait and recvfrom() to receive the ECOREPLY packet, if select() +shows the data is ready, and the data is not the expected ECOREPLY, +and waiting time is not overdue, it will continue use select() and +recvfrom(). + +Problem is that the raw socket can receive any icmp packets, if we do +not set filters, and there are many icmp packets on socket, this +program will not find its interested ECOREPLY packet in a special +interval, which makes the ping mode fail. + + +Other program is that watchdog sometime can not reach the call of +recvfrom to try to receive packets since tv_sec of struct timeval +of select parameter is 0. + +The timeout of select() is the result of ping interval minusing the +time of calling gettimeofday spending, when ping interval is 1 second, +and the call of gettimeofday() spends several useconds, the tv_sec of +struct timeval of select parameter must be 0, at that condition, we +should it is valid of tv_sec of struct timeval of select parameter be 0 + +Signed-off-by: Roy.Li +--- + src/net.c | 2 +- + src/watchdog.c | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +Index: watchdog-5.14/src/watchdog.c +=================================================================== +--- watchdog-5.14.orig/src/watchdog.c ++++ watchdog-5.14/src/watchdog.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: watchdog-5.14/src/net.c +=================================================================== +--- watchdog-5.14.orig/src/net.c ++++ watchdog-5.14/src/net.c +@@ -11,7 +11,8 @@ + #include + #include + #include +-#include ++#include ++//#include + #include + #include + #include /* for gethostname() etc */ +@@ -179,6 +180,9 @@ int open_netcheck(struct list *tlist) + { + struct list *act; + int hold = 0; ++ struct icmp_filter filt; ++ filt.data = ~(1<next) { +@@ -202,6 +206,7 @@ int open_netcheck(struct list *tlist) + fatal_error(EX_SYSERR, "error opening socket (%s)", strerror(errno)); + } + ++ setsockopt(net->sock_fp, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)); + /* this is necessary for broadcast pings to work */ + (void)setsockopt(net->sock_fp, SOL_SOCKET, SO_BROADCAST, (char *)&hold, sizeof(hold)); + diff --git a/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch b/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch new file mode 100644 index 0000000000..2fad3a112f --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch @@ -0,0 +1,27 @@ +Fix out of tree build support: + +| installing /etc/watchdog.conf +| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5' +| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8' +| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.conf.5 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5' +| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_keepalive.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_identify.8 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8' +| /usr/bin/install: cannot stat `watchdog.conf': No such file or directory +| make[2]: *** [install-etc-local] Error 1 + +Upstream-Status: Pending + +RP 2013/03/21 + +Index: watchdog-5.13/Makefile.am +=================================================================== +--- watchdog-5.13.orig/Makefile.am 2013-02-01 11:15:44.000000000 +0000 ++++ watchdog-5.13/Makefile.am 2013-03-21 11:59:35.637139031 +0000 +@@ -16,7 +16,7 @@ + else \ + echo "installing $(CONFIG_FILENAME)"; \ + $(mkinstalldirs) `dirname $(DESTDIR)$(CONFIG_FILENAME)`; \ +- $(INSTALL_DATA) watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \ ++ $(INSTALL_DATA) $(srcdir)/watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \ + fi + + install-data-local: install-etc-local diff --git a/meta/recipes-extended/watchdog/watchdog_5.13.bb b/meta/recipes-extended/watchdog/watchdog_5.13.bb deleted file mode 100644 index b9e29d22fc..0000000000 --- a/meta/recipes-extended/watchdog/watchdog_5.13.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "Software watchdog" -DESCRIPTION = "Watchdog is a daemon that checks if your system is still \ -working. If programs in user space are not longer executed \ -it will reboot the system." -HOMEPAGE = "http://watchdog.sourceforge.net/" -BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" - -LICENSE = "GPL-2.0+" -LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569" - -SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \ - file://fixsepbuild.patch \ - file://fix-ping-failure.patch" -SRC_URI[md5sum] = "153455f008f1cf8f65f6ad9586a21ff1" -SRC_URI[sha256sum] = "141e0faf3ee4d8187a6ff4e00b18ef7b7a4ce432a2d4c8a6e6fdc62507fc6eb0" - -inherit autotools - -RRECOMMENDS_${PN} = "kernel-module-softdog" diff --git a/meta/recipes-extended/watchdog/watchdog_5.14.bb b/meta/recipes-extended/watchdog/watchdog_5.14.bb new file mode 100644 index 0000000000..c77d91dcdd --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog_5.14.bb @@ -0,0 +1,20 @@ +SUMMARY = "Software watchdog" +DESCRIPTION = "Watchdog is a daemon that checks if your system is still \ +working. If programs in user space are not longer executed \ +it will reboot the system." +HOMEPAGE = "http://watchdog.sourceforge.net/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" + +LICENSE = "GPL-2.0+" +LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569" + +SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \ + file://fixsepbuild.patch \ + file://fix-ping-failure.patch" + +SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4" +SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1" + +inherit autotools + +RRECOMMENDS_${PN} = "kernel-module-softdog" -- cgit 1.2.3-korg