From 224524b6a998306c61bd44d9c1e2771989d1fead Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Fri, 1 May 2009 22:53:47 +0200 Subject: wdd: add 0.1.31 release from flxutils (+ stat option) --- sys-apps/wdd/Manifest | 8 ++- sys-apps/wdd/files/warning.patch | 34 --------- sys-apps/wdd/files/wdd-0-syslog.diff | 86 +++++++++++++++++++++++ sys-apps/wdd/files/wdd-0-warnings.diff | 34 +++++++++ sys-apps/wdd/files/wdd-0.1.31-syslog.diff | 112 ++++++++++++++++++++++++++++++ sys-apps/wdd/files/wdd-syslog-errors.diff | 86 ----------------------- sys-apps/wdd/wdd-0.1.31.ebuild | 47 +++++++++++++ sys-apps/wdd/wdd-0.ebuild | 4 +- 8 files changed, 286 insertions(+), 125 deletions(-) delete mode 100644 sys-apps/wdd/files/warning.patch create mode 100644 sys-apps/wdd/files/wdd-0-syslog.diff create mode 100644 sys-apps/wdd/files/wdd-0-warnings.diff create mode 100644 sys-apps/wdd/files/wdd-0.1.31-syslog.diff delete mode 100644 sys-apps/wdd/files/wdd-syslog-errors.diff create mode 100644 sys-apps/wdd/wdd-0.1.31.ebuild (limited to 'sys-apps') diff --git a/sys-apps/wdd/Manifest b/sys-apps/wdd/Manifest index b35737fb..57a1ecb0 100644 --- a/sys-apps/wdd/Manifest +++ b/sys-apps/wdd/Manifest @@ -1,7 +1,9 @@ -AUX warning.patch 774 RMD160 4c7147c373d8872cf35ddd4eb4b67f50b52749ac SHA1 6c84a76542769c001bc8912558f87a63b983e42e SHA256 918e0fcd1acadbc574f5bdb4e90e1a62a4f607497ec2a689498d0d89254ae7d6 -AUX wdd-syslog-errors.diff 2081 RMD160 ec41a668847bc800fe1c12a69b3aef1d5d1274c5 SHA1 4fd5641cfb7ace59dec9415352dd516bd6934ae2 SHA256 d89862596264cdbdab4fc9a7a788bb45c2a60a6faa3ec67ce5b11e0ba5d9402e +AUX wdd-0-syslog.diff 2081 RMD160 ec41a668847bc800fe1c12a69b3aef1d5d1274c5 SHA1 4fd5641cfb7ace59dec9415352dd516bd6934ae2 SHA256 d89862596264cdbdab4fc9a7a788bb45c2a60a6faa3ec67ce5b11e0ba5d9402e +AUX wdd-0-warnings.diff 774 RMD160 4c7147c373d8872cf35ddd4eb4b67f50b52749ac SHA1 6c84a76542769c001bc8912558f87a63b983e42e SHA256 918e0fcd1acadbc574f5bdb4e90e1a62a4f607497ec2a689498d0d89254ae7d6 +AUX wdd-0.1.31-syslog.diff 3082 RMD160 9ae6dfa27676a98c483bbabf1a93022be30a7427 SHA1 31369a22c906c6b20295b12f82fe850389b1e95b SHA256 5135d0cb127b8c1d3317f56aa1a69dc00104d00403d29e6684ee571a36669699 AUX wdd.confd 63 RMD160 0c72c3dc55da3c82231ecd4fc479fe64a1b49a66 SHA1 fe35c35f956e38f1ff18277838cb8741998af56a SHA256 bd66a212cb55fdf74bf967917f5d5a68e08ab855d3b44a97d3a634da19da8d88 AUX wdd.initd 413 RMD160 037acbece81cd93cb54baf5752b55fb261645c08 SHA1 af4ca52be2e7e79ab332b321b1a19116e0a4823e SHA256 41b52446d2b513a945e84a12fc303d2b2c75e1f31c8ce33e1dde23d395947d17 DIST wdd.8 3198 RMD160 34aa288bd79e0f15229ca75f8567bde8d45f76a1 SHA1 1f83bdc0fd2f8aaeb439ac60f1d79487a8e88f88 SHA256 7129d465b7fa4c96dd488f22a4dc265a0d2d343e1c40ac0aa6827e53dd8aec2b DIST wdd.c 2841 RMD160 f4555a2132545e371d7325bc71755c48f64a57b9 SHA1 b68d654ec1511bbce66a1a07d40bf9b7c3272243 SHA256 66be5e748b6199f7afbdbc7b6aaed6cbbfa2e0634aa90d3c0aefa743756ae6a7 -EBUILD wdd-0.ebuild 878 RMD160 7022b62096e5f49e946a87f1accca02b8c03a070 SHA1 3bbfa0c363788c690d216a7837e252072c0e503a SHA256 b9291813b609f2f8bc5bd83bf103c7e3c47fe3331dc57f231452c181ae1517fd +EBUILD wdd-0.1.31.ebuild 867 RMD160 29fa03297a75b4bda8903827b16e680ae0c57a53 SHA1 6043f3c54262429e2f0ba9f805c701f6db3aaf86 SHA256 b2e6e0f85f595ba76ff76a582e8efadde862e37931b554e464f8879b7c50cb23 +EBUILD wdd-0.ebuild 877 RMD160 3f300c88602b1b0a83eb063258696022a9ea9a56 SHA1 b8388fdd59cc657b405419089a17695da88ebdd3 SHA256 3147882c54f6326b7cc111b9b9f9d04e0b5492a08513b103d8a3f5ed48859063 diff --git a/sys-apps/wdd/files/warning.patch b/sys-apps/wdd/files/warning.patch deleted file mode 100644 index 0b93b73c..00000000 --- a/sys-apps/wdd/files/warning.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- wdd.c.ori 2007-07-18 18:03:18.000000000 +0200 -+++ wdd.c 2007-07-18 18:06:11.000000000 +0200 -@@ -3,9 +3,13 @@ - */ - - #include -+#include - #include - #include - #include -+#include -+#include -+#include - - const char dev_wd_str[] = "/dev/watchdog"; - const char root_str[] = "/"; -@@ -18,7 +22,7 @@ - static inline void try_malloc() { - void *heap; - -- heap = (void*)sbrk(NULL); -+ heap = (void*)sbrk(0); - if (brk(heap + 4096)) - exit(1); - memset(heap, 0, 4096); -@@ -52,7 +56,7 @@ - void *heap; - int ret; - -- heap = (void*)sbrk(NULL); -+ heap = (void*)sbrk(0); - if (brk(heap + sizeof (struct stat))) - exit(1); - memset(heap, 0, sizeof (struct stat)); diff --git a/sys-apps/wdd/files/wdd-0-syslog.diff b/sys-apps/wdd/files/wdd-0-syslog.diff new file mode 100644 index 00000000..28ef7727 --- /dev/null +++ b/sys-apps/wdd/files/wdd-0-syslog.diff @@ -0,0 +1,86 @@ +--- wdd.c 2009-04-24 10:48:29.753640442 +0200 ++++ wdd.c+warn+syslog 2009-04-24 10:47:52.505385951 +0200 +@@ -10,10 +10,22 @@ + #include + #include + #include ++#ifdef _USE_SYSLOG_ ++#include ++#endif /* _USE_SYSLOG_ */ + + const char dev_wd_str[] = "/dev/watchdog"; + const char root_str[] = "/"; + ++void do_exit_log (int ret, char* string) { ++ ++#ifdef _USE_SYSLOG_ ++ syslog(LOG_EMERG, "%s", string); ++#endif /* _USE_SYSLOG_ */ ++ ++ exit (ret); ++} ++ + /* + * This function checks if the system can allocate memory + * In case of failure, we exit so that the watchdog device +@@ -24,10 +36,10 @@ + + heap = (void*)sbrk(0); + if (brk(heap + 4096)) +- exit(1); ++ do_exit_log(1, "try_malloc: brk(heap + 4096) failed\n"); + memset(heap, 0, 4096); + if (brk(heap)) +- exit(1); ++ do_exit_log(1, "try_malloc: brk(heap) failed\n"); + } + + /* +@@ -39,7 +51,7 @@ + int pid; + pid = fork(); + if (pid < 0) /* exit on error */ +- exit(1); ++ do_exit_log(1, "try_fork: fork() failed\n"); + else if (pid == 0) /* child returns cleanly */ + exit(0); + if (waitpid(pid, NULL, 0) != pid) /* father checks child */ +@@ -58,15 +70,15 @@ + + heap = (void*)sbrk(0); + if (brk(heap + sizeof (struct stat))) +- exit(1); ++ do_exit_log(1, "try_stat: brk(heap + sizeof (struct stat)\n"); + memset(heap, 0, sizeof (struct stat)); + ret = stat(file, heap); + if (brk(heap)) +- exit(1); ++ do_exit_log(1, "try_stat: brk(heap) failed\n"); + + if (ret == -1) { + if (do_exit) +- exit(1); ++ do_exit_log(1, "try_stat: do_exit_log\n"); + else + return 0; + } +@@ -77,6 +89,11 @@ + int dev; + int curr_file; + ++#ifdef _USE_SYSLOG_ ++ openlog ("wdd", LOG_PID|LOG_NDELAY, LOG_DAEMON); ++ syslog(LOG_INFO, "wdd started\n"); ++#endif /* _USE_SYSLOG_ */ ++ + if (argc > 1) { + /* we'll do a quick check on all the arguments to + * ensure that they are valid at load time, and avoid +@@ -128,6 +145,7 @@ + sleep(1); + } + /* we never get there theorically... */ ++ do_exit_log(0, "main: return 0\n"); + return 0; + } + diff --git a/sys-apps/wdd/files/wdd-0-warnings.diff b/sys-apps/wdd/files/wdd-0-warnings.diff new file mode 100644 index 00000000..0b93b73c --- /dev/null +++ b/sys-apps/wdd/files/wdd-0-warnings.diff @@ -0,0 +1,34 @@ +--- wdd.c.ori 2007-07-18 18:03:18.000000000 +0200 ++++ wdd.c 2007-07-18 18:06:11.000000000 +0200 +@@ -3,9 +3,13 @@ + */ + + #include ++#include + #include + #include + #include ++#include ++#include ++#include + + const char dev_wd_str[] = "/dev/watchdog"; + const char root_str[] = "/"; +@@ -18,7 +22,7 @@ + static inline void try_malloc() { + void *heap; + +- heap = (void*)sbrk(NULL); ++ heap = (void*)sbrk(0); + if (brk(heap + 4096)) + exit(1); + memset(heap, 0, 4096); +@@ -52,7 +56,7 @@ + void *heap; + int ret; + +- heap = (void*)sbrk(NULL); ++ heap = (void*)sbrk(0); + if (brk(heap + sizeof (struct stat))) + exit(1); + memset(heap, 0, sizeof (struct stat)); diff --git a/sys-apps/wdd/files/wdd-0.1.31-syslog.diff b/sys-apps/wdd/files/wdd-0.1.31-syslog.diff new file mode 100644 index 00000000..248aaee9 --- /dev/null +++ b/sys-apps/wdd/files/wdd-0.1.31-syslog.diff @@ -0,0 +1,112 @@ +diff --git a/wd/Makefile b/wd/Makefile +index 6f1fa72..bd2d51b 100644 +--- a/wd/Makefile ++++ b/wd/Makefile +@@ -3,7 +3,7 @@ include ../include/rules.make + CFLAGS+=-fomit-frame-pointer + + %: %.c +- $(CC) $(LDFLAGS) $(CFLAGS) -W -Wall -U_FORTIFY_SOURCE -o $@ $< ++ $(CC) $(LDFLAGS) $(CFLAGS) -W -Wall -U_FORTIFY_SOURCE -D_USE_SYSLOG_ -o $@ $< + $(STRIP) -x --strip-unneeded -R .comment -R .note $@ + $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true + -if [ -n "$(SSTRIP)" ]; then $(SSTRIP) $@ ; fi +diff --git a/wd/wdd.c b/wd/wdd.c +index 9cd808a..85567af 100644 +--- a/wd/wdd.c ++++ b/wd/wdd.c +@@ -9,10 +9,24 @@ + #include + #include + ++#ifdef _USE_SYSLOG_ ++#include ++#include ++#endif /* _USE_SYSLOG_ */ ++ + const char dev_wd_str[] = "/dev/watchdog"; /* standard entry */ + const char dev_misc_str[] = "/dev/misc/watchdog"; /* devfs entry */ + const char root_str[] = "/"; + ++void do_exit_log (int ret, char* string) { ++ ++#ifdef _USE_SYSLOG_ ++ syslog(LOG_EMERG, "%s", string); ++#endif /* _USE_SYSLOG_ */ ++ ++ exit (ret); ++} ++ + /* + * This function checks if the system can allocate memory + * In case of failure, we exit so that the watchdog device +@@ -23,10 +37,10 @@ static inline void try_malloc() { + + heap = (void*)sbrk(0); + if (brk(heap + 4096)) +- exit(1); ++ do_exit_log(1, "try_malloc: brk(heap + 4096) failed\n"); + memset(heap, 0, 4096); + if (brk(heap)) +- exit(1); ++ do_exit_log(1, "try_malloc: brk(heap) failed\n"); + } + + /* +@@ -38,7 +52,7 @@ static inline void try_fork() { + int pid; + pid = fork(); + if (pid < 0) /* exit on error */ +- exit(1); ++ do_exit_log(1, "try_fork: fork() failed\n"); + else if (pid == 0) /* child returns cleanly */ + exit(0); + if (waitpid(pid, NULL, 0) != pid) /* father checks child */ +@@ -57,15 +71,15 @@ static inline int try_stat(const char *file, int do_exit) { + + heap = (void*)sbrk(0); + if (brk(heap + sizeof (struct stat))) +- exit(1); ++ do_exit_log(1, "try_stat: brk(heap + sizeof (struct stat)\n"); + memset(heap, 0, sizeof (struct stat)); + ret = stat(file, heap); + if (brk(heap)) +- exit(1); ++ do_exit_log(1, "try_stat: brk(heap) failed\n"); + + if (ret == -1) { + if (do_exit) +- exit(1); ++ do_exit_log(1, "try_stat: do_exit_log\n"); + else + return 0; + } +@@ -79,6 +93,11 @@ int main (int argc, char **argv) { + char *touch_file = NULL; + struct stat file_stat; + ++#ifdef _USE_SYSLOG_ ++ openlog ("wdd", LOG_PID|LOG_NDELAY, LOG_DAEMON); ++ syslog(LOG_INFO, "wdd started\n"); ++#endif /* _USE_SYSLOG_ */ ++ + if (argc > 1) { + /* we'll do a quick check on all the arguments to + * ensure that they are valid at load time, and avoid +@@ -168,7 +187,7 @@ int main (int argc, char **argv) { + /* still no change */ + curr_count--; + if (!curr_count) +- exit(1); ++ do_exit_log(1, "main: no stat\n"); + } + } + +@@ -176,6 +195,7 @@ int main (int argc, char **argv) { + sleep(1); + } + /* we never get there theorically... */ ++ do_exit_log(0, "main: return 0\n"); + return 0; + } + diff --git a/sys-apps/wdd/files/wdd-syslog-errors.diff b/sys-apps/wdd/files/wdd-syslog-errors.diff deleted file mode 100644 index 28ef7727..00000000 --- a/sys-apps/wdd/files/wdd-syslog-errors.diff +++ /dev/null @@ -1,86 +0,0 @@ ---- wdd.c 2009-04-24 10:48:29.753640442 +0200 -+++ wdd.c+warn+syslog 2009-04-24 10:47:52.505385951 +0200 -@@ -10,10 +10,22 @@ - #include - #include - #include -+#ifdef _USE_SYSLOG_ -+#include -+#endif /* _USE_SYSLOG_ */ - - const char dev_wd_str[] = "/dev/watchdog"; - const char root_str[] = "/"; - -+void do_exit_log (int ret, char* string) { -+ -+#ifdef _USE_SYSLOG_ -+ syslog(LOG_EMERG, "%s", string); -+#endif /* _USE_SYSLOG_ */ -+ -+ exit (ret); -+} -+ - /* - * This function checks if the system can allocate memory - * In case of failure, we exit so that the watchdog device -@@ -24,10 +36,10 @@ - - heap = (void*)sbrk(0); - if (brk(heap + 4096)) -- exit(1); -+ do_exit_log(1, "try_malloc: brk(heap + 4096) failed\n"); - memset(heap, 0, 4096); - if (brk(heap)) -- exit(1); -+ do_exit_log(1, "try_malloc: brk(heap) failed\n"); - } - - /* -@@ -39,7 +51,7 @@ - int pid; - pid = fork(); - if (pid < 0) /* exit on error */ -- exit(1); -+ do_exit_log(1, "try_fork: fork() failed\n"); - else if (pid == 0) /* child returns cleanly */ - exit(0); - if (waitpid(pid, NULL, 0) != pid) /* father checks child */ -@@ -58,15 +70,15 @@ - - heap = (void*)sbrk(0); - if (brk(heap + sizeof (struct stat))) -- exit(1); -+ do_exit_log(1, "try_stat: brk(heap + sizeof (struct stat)\n"); - memset(heap, 0, sizeof (struct stat)); - ret = stat(file, heap); - if (brk(heap)) -- exit(1); -+ do_exit_log(1, "try_stat: brk(heap) failed\n"); - - if (ret == -1) { - if (do_exit) -- exit(1); -+ do_exit_log(1, "try_stat: do_exit_log\n"); - else - return 0; - } -@@ -77,6 +89,11 @@ - int dev; - int curr_file; - -+#ifdef _USE_SYSLOG_ -+ openlog ("wdd", LOG_PID|LOG_NDELAY, LOG_DAEMON); -+ syslog(LOG_INFO, "wdd started\n"); -+#endif /* _USE_SYSLOG_ */ -+ - if (argc > 1) { - /* we'll do a quick check on all the arguments to - * ensure that they are valid at load time, and avoid -@@ -128,6 +145,7 @@ - sleep(1); - } - /* we never get there theorically... */ -+ do_exit_log(0, "main: return 0\n"); - return 0; - } - diff --git a/sys-apps/wdd/wdd-0.1.31.ebuild b/sys-apps/wdd/wdd-0.1.31.ebuild new file mode 100644 index 00000000..9d8d9fc8 --- /dev/null +++ b/sys-apps/wdd/wdd-0.1.31.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit git + +DESCRIPTION="Formilux Tools" +HOMEPAGE="http://master.formilux.org/git/dist/src/flxutils.git" +EGIT_REPO_URI="http://master.formilux.org/git/people/beber/flxutils.git" +#EGIT_TREE="v${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="syslog" + +DEPEND="dev-libs/dietlibc" +RDEPEND="" + +src_unpack () +{ + git_src_unpack + + cd ${S} + use syslog && epatch ${FILESDIR}/${P}-syslog.diff +} + +src_compile () +{ + export DIET="/usr/bin/diet" + export CC="$(tc-getCC)" + export OBJDUMP="$(tc-getPROG OBJDUMP objdump ${CHOST})" + export STRIP="$(tc-getSTRIP)" + + emake -C wd \ + SSTRIP=\"\" || die "emake wd failed" +} + +src_install () +{ + into / + dosbin wd/wdd + doman wd/wdd.8 + + newinitd ${FILESDIR}/wdd.initd wdd + newconfd ${FILESDIR}/wdd.confd wdd +} diff --git a/sys-apps/wdd/wdd-0.ebuild b/sys-apps/wdd/wdd-0.ebuild index 3d5573a1..b0449e2a 100644 --- a/sys-apps/wdd/wdd-0.ebuild +++ b/sys-apps/wdd/wdd-0.ebuild @@ -22,8 +22,8 @@ src_unpack () { mv ${DISTDIR}/wdd.{c,8} ${S} cd ${S} - epatch ${FILESDIR}/warning.patch - use syslog && epatch ${FILESDIR}/wdd-syslog-errors.diff + epatch ${FILESDIR}/${P}-warnings.diff + use syslog && epatch ${FILESDIR}/${P}-syslog.diff } src_compile () { -- cgit v1.2.3