summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/daemontools/daemontools/0001-error.h-include-errno.h-instead-of-extern-int.diff25
-rw-r--r--meta-oe/recipes-support/daemontools/daemontools/0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.diff47
-rw-r--r--meta-oe/recipes-support/daemontools/daemontools/cross-compile.patch45
-rw-r--r--meta-oe/recipes-support/daemontools/daemontools_0.76.bb47
4 files changed, 164 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/daemontools/daemontools/0001-error.h-include-errno.h-instead-of-extern-int.diff b/meta-oe/recipes-support/daemontools/daemontools/0001-error.h-include-errno.h-instead-of-extern-int.diff
new file mode 100644
index 000000000..ce1959782
--- /dev/null
+++ b/meta-oe/recipes-support/daemontools/daemontools/0001-error.h-include-errno.h-instead-of-extern-int.diff
@@ -0,0 +1,25 @@
1From d3e7651e2f2492dd1031d09a99713644b604cab5 Mon Sep 17 00:00:00 2001
2From: Gerrit Pape <pape@smarden.org>
3Date: Wed, 12 Dec 2007 13:44:15 +0000
4Subject: [PATCH] error.h: '#include <errno.h>' instead of 'extern int errno;'
5
6---
7 daemontools-0.76/src/error.h | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git daemontools-0.76.orig/src/error.h daemontools-0.76/src/error.h
11index 086fb55..f7e8273 100644
12--- daemontools-0.76.orig/src/error.h
13+++ daemontools-0.76/src/error.h
14@@ -3,7 +3,7 @@
15 #ifndef ERROR_H
16 #define ERROR_H
17
18-extern int errno;
19+#include <errno.h>
20
21 extern int error_intr;
22 extern int error_nomem;
23--
241.5.4.2
25
diff --git a/meta-oe/recipes-support/daemontools/daemontools/0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.diff b/meta-oe/recipes-support/daemontools/daemontools/0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.diff
new file mode 100644
index 000000000..73dce9072
--- /dev/null
+++ b/meta-oe/recipes-support/daemontools/daemontools/0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.diff
@@ -0,0 +1,47 @@
1From 7ee585cab1d5b68f804a5601a66ae87799c8a7c3 Mon Sep 17 00:00:00 2001
2From: Gerrit Pape <pape@smarden.org>
3Date: Sun, 24 Feb 2008 10:54:26 +0000
4Subject: [PATCH] supervise.c: ./supervise may be a symlink, if it's dangling, create link target
5
6---
7 daemontools-0.76/src/supervise.c | 17 ++++++++++++++++-
8 1 files changed, 16 insertions(+), 1 deletions(-)
9
10diff --git daemontools-0.76.orig/src/supervise.c daemontools-0.76/src/supervise.c
11index 2482ad2..f43cabf 100644
12--- daemontools-0.76.orig/src/supervise.c
13+++ daemontools-0.76/src/supervise.c
14@@ -208,6 +208,8 @@ void doit(void)
15 int main(int argc,char **argv)
16 {
17 struct stat st;
18+ int r;
19+ char buf[256];
20
21 dir = argv[1];
22 if (!dir || argv[2])
23@@ -232,7 +234,20 @@ int main(int argc,char **argv)
24 if (errno != error_noent)
25 strerr_die4sys(111,FATAL,"unable to stat ",dir,"/down: ");
26
27- mkdir("supervise",0700);
28+ if (mkdir("supervise",0700) == -1) {
29+ if ((r = readlink("supervise", buf, 256)) != -1) {
30+ if (r == 256) {
31+ errno = EOVERFLOW;
32+ strerr_die1sys(111,"unable to readlink ./supervise: ");
33+ }
34+ buf[r] = 0;
35+ mkdir(buf, 0700);
36+ }
37+ else {
38+ if ((errno != ENOENT) && (errno != EINVAL))
39+ strerr_die1sys(111, "unable to readlink ./supervise: ");
40+ }
41+ }
42 fdlock = open_append("supervise/lock");
43 if ((fdlock == -1) || (lock_exnb(fdlock) == -1))
44 strerr_die4sys(111,FATAL,"unable to acquire ",dir,"/supervise/lock: ");
45--
461.5.4.2
47
diff --git a/meta-oe/recipes-support/daemontools/daemontools/cross-compile.patch b/meta-oe/recipes-support/daemontools/daemontools/cross-compile.patch
new file mode 100644
index 000000000..f164c2d10
--- /dev/null
+++ b/meta-oe/recipes-support/daemontools/daemontools/cross-compile.patch
@@ -0,0 +1,45 @@
1make sure it can be compiled for cross target
2
31. never try to compile target binary by native gcc
42. target's chkshsgr doesn't work on native.
53. it's wrong to do target tests on native.
6
7Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
8
9diff -Nurp daemontools-0.76.orig/src/conf-cc daemontools-0.76/src/conf-cc
10--- daemontools-0.76.orig/src/conf-cc 2001-07-13 00:49:49.000000000 +0800
11+++ daemontools-0.76/src/conf-cc 2014-11-26 09:34:38.828812162 +0800
12@@ -1,3 +1,3 @@
13-gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings
14+${CC} -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings
15
16 This will be used to compile .c files.
17diff -Nurp daemontools-0.76.orig/src/conf-ld daemontools-0.76/src/conf-ld
18--- daemontools-0.76.orig/src/conf-ld 2001-07-13 00:49:49.000000000 +0800
19+++ daemontools-0.76/src/conf-ld 2014-11-26 09:34:49.880811730 +0800
20@@ -1,3 +1,3 @@
21-gcc -s
22+${CC}
23
24 This will be used to link .o files into an executable.
25diff -Nurp daemontools-0.76.orig/src/Makefile daemontools-0.76/src/Makefile
26--- daemontools-0.76.orig/src/Makefile 2001-07-13 00:49:49.000000000 +0800
27+++ daemontools-0.76/src/Makefile 2014-11-26 09:38:47.120802459 +0800
28@@ -165,7 +165,7 @@ hassgprm.h: choose compile hassgprm.h1 h
29
30 hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \
31 tryshsgr.c warn-shsgr
32- ./chkshsgr || ( cat warn-shsgr; exit 1 )
33+ chkshsgr || ( cat warn-shsgr; exit 1 )
34 ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
35
36 haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
37@@ -265,7 +265,7 @@ readproctitle.o: compile error.h readpro
38 rts: envdir envuidgid fghack matchtest multilog pgrphack \
39 readproctitle rts.tests setlock setuidgid softlimit supervise svc \
40 svok svscan svscanboot svstat tai64n tai64nlocal
41- env - /bin/sh rts.tests 2>&1 | cat -v > rts
42+ echo "Warning: We can not run test on cross target."
43
44 scan_ulong.o: compile scan.h scan_ulong.c
45 ./compile scan_ulong.c
diff --git a/meta-oe/recipes-support/daemontools/daemontools_0.76.bb b/meta-oe/recipes-support/daemontools/daemontools_0.76.bb
new file mode 100644
index 000000000..fb87ea8ad
--- /dev/null
+++ b/meta-oe/recipes-support/daemontools/daemontools_0.76.bb
@@ -0,0 +1,47 @@
1SUMMARY = "DJB daemontools"
2DESCRIPTION = "supervise monitors a service. It starts the service and restarts the \
3service if it dies. The companion svc program stops, pauses, or restarts \
4the service on sysadmin request. The svstat program prints a one-line \
5status report. \
6multilog saves error messages to one or more logs. It optionally timestamps \
7each line and, for each log, includes or excludes lines matching specified \
8patterns. It automatically rotates logs to limit the amount of disk space \
9used. If the disk fills up, it pauses and tries again, without losing any \
10data."
11
12SECTION = "System/Servers"
13
14LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/PD;md5=b3597d12946881e13cb3b548d1173851"
15LICENSE = "PD"
16
17SRC_URI = "http://cr.yp.to/daemontools/${BPN}-${PV}.tar.gz \
18 file://0001-error.h-include-errno.h-instead-of-extern-int.diff \
19 file://0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.diff "
20
21SRC_URI_append_class-target = "file://cross-compile.patch"
22
23SRC_URI[md5sum] = "1871af2453d6e464034968a0fbcb2bfc"
24SRC_URI[sha256sum] = "a55535012b2be7a52dcd9eccabb9a198b13be50d0384143bd3b32b8710df4c1f"
25
26S = "${WORKDIR}/admin/${BPN}-${PV}"
27
28DEPENDS += "daemontools-native"
29DEPENDS_virtclass-native = ""
30
31do_compile() {
32 ./package/compile
33}
34
35do_install() {
36 install -d ${D}/${bindir}
37}
38
39do_install_append_class-native() {
40 install -m 755 ${S}/compile/chkshsgr ${D}/${bindir}
41}
42
43do_install_append_class-target() {
44 install -m755 ${S}/command/* ${D}/${bindir}
45}
46
47BBCLASSEXTEND = "native"