aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/insserv
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:11 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:57 +0100
commitd62ee7eaf2ba025c3f64b2d4e10dc7cec4637612 (patch)
treef36fe3008f36ff75cbdd31b630f8f13f1f205ebb /meta/recipes-devtools/insserv
parentcaab7fc509bf27706ff3248689f6afd04225cfda (diff)
downloadopenembedded-core-contrib-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.gz
packages: Separate out most of the remaining packages into recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/insserv')
-rw-r--r--meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch89
-rw-r--r--meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch20
-rw-r--r--meta/recipes-devtools/insserv/files/crosscompile_fix.patch22
-rw-r--r--meta/recipes-devtools/insserv/files/insserv.conf41
-rw-r--r--meta/recipes-devtools/insserv/files/make.patch58
-rw-r--r--meta/recipes-devtools/insserv/insserv_1.11.0.bb17
6 files changed, 247 insertions, 0 deletions
diff --git a/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch b/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch
new file mode 100644
index 0000000000..9b0081307a
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch
@@ -0,0 +1,89 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40_segfault_virtprov.dpatch by Petter Reinholdtsen
+
+Avoid segfault when an enabled service provide a virtual system
+facility.
+
+@DPATCH@
+--- insserv/insserv.c
++++ insserv/insserv.c 2008-02-01 11:43:45.634618329 +0100
+@@ -166,7 +166,7 @@ typedef struct pwd_struct {
+
+ static list_t pwd = { &(pwd), &(pwd) }, * topd = &(pwd);
+
+-static void pushd(const char *const __restrict path);
++static void pushd(const char *const __restrict path) __attribute__((nonnull(1)));
+ static void pushd(const char *const path)
+ {
+ pwd_t * dir;
+@@ -305,13 +305,13 @@ out:
+ return getserv(ptr);
+ }
+
+-static serv_t * findserv(const char *const __restrict serv) __attribute__((nonnull(1)));
++static serv_t * findserv(const char *const __restrict serv);
+ static serv_t * findserv(const char *const serv)
+ {
+ list_t * ptr;
+ serv_t * ret = (serv_t*)0;
+
+- if (!serv)
++ if (serv == (const char*)0)
+ goto out;
+
+ list_for_each(ptr, serv_start) {
+@@ -334,6 +334,9 @@ static void rememberreq(serv_t *serv, ui
+ list_t * ptr;
+ uint old = bit;
+
++ if (!tmp)
++ error("%s", strerror(errno));
++
+ while ((token = strsep(&tmp, delimeter))) {
+ boolean found = false;
+ req_t * this;
+@@ -399,6 +402,9 @@ static void reversereq(const serv_t * se
+ char * rev = strdupa(list);
+ uint old = bit;
+
++ if (!rev)
++ error("%s", strerror(errno));
++
+ while ((dep = strsep(&rev, delimeter)) && *dep) {
+ serv_t * tmp;
+ list_t * ptr;
+@@ -437,7 +443,7 @@ static void reversereq(const serv_t * se
+ /*
+ * Check required services for name
+ */
+-static boolean chkrequired(const char *const __restrict name) __attribute__((nonnull(1)));
++static boolean chkrequired(const char *const __restrict name);
+ static boolean chkrequired(const char *const name)
+ {
+ serv_t * serv = findserv(name);
+--- insserv/listing.h
++++ insserv/listing.h 2008-02-01 11:40:45.347748072 +0100
+@@ -97,11 +97,11 @@ extern int makeprov(const char *__restri
+ extern void setorder(const char *__restrict script, const int order, boolean recursive) __attribute__((nonnull(1)));
+ extern int getorder(const char *__restrict script) __attribute__((nonnull(1)));
+ extern boolean notincluded(const char *__restrict script, const int runlevel) __attribute__((nonnull(1)));
+-extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(1,2)));
+-extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1,2)));
++extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(2)));
++extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1)));
+ extern const char * getscript(const char *__restrict prov) __attribute__((nonnull(1)));
+ extern const char * getprovides(const char *__restrict script) __attribute__((nonnull(1)));
+-extern boolean listscripts(const char **__restrict script, const int lvl) __attribute__((nonnull(1)));
++extern boolean listscripts(const char **__restrict script, const int lvl);
+ extern int maxorder;
+ extern boolean is_loop_detected(void);
+
+@@ -116,7 +116,7 @@ extern int map_has_runlevels(void);
+ extern int map_runlevel_to_lvl (const int runlevel);
+ extern int map_key_to_lvl(const char key);
+
+-static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline,nonnull(1)));
++static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline));
+ static inline char * xstrdup(const char * s)
+ {
+ char * r;
diff --git a/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch b/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch
new file mode 100644
index 0000000000..4a15f58312
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40_loopnochangemsg.dpatch by Petter Reinholdtsen
+
+Make it more obvious that introducing a loop will not change the
+existing boot sequence. Thanks to Frans Pop for the rationale for
+this change.
+
+@DPATCH@
+
+--- insserv-1.11.0.orig/insserv.c
++++ insserv-1.11.0/insserv.c
+@@ -2647,7 +2647,7 @@
+ follow_all();
+
+ if (is_loop_detected() && !ignore)
+- error("exiting now!\n");
++ error("exiting without changing boot order!\n");
+
+ /*
+ * Re-order some well known scripts to get
diff --git a/meta/recipes-devtools/insserv/files/crosscompile_fix.patch b/meta/recipes-devtools/insserv/files/crosscompile_fix.patch
new file mode 100644
index 0000000000..14d8db468f
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/crosscompile_fix.patch
@@ -0,0 +1,22 @@
+Index: insserv-1.11.0/Makefile
+===================================================================
+--- insserv-1.11.0.orig/Makefile 2008-08-25 16:00:00.000000000 +0100
++++ insserv-1.11.0/Makefile 2008-08-25 16:00:25.000000000 +0100
+@@ -18,16 +18,7 @@
+ #
+ # Architecture
+ #
+-ifdef RPM_OPT_FLAGS
+- COPTS = -g $(RPM_OPT_FLAGS)
+-else
+- ARCH = $(shell uname -i)
+-ifeq ($(ARCH),i386)
+- COPTS = -O2 -mcpu=i586 -mtune=i686
+-else
+- COPTS = -O2
+-endif
+-endif
++COPTS = -O2
+ COPTS += -g
+
+ MY_CFLAGS = $(CFLAGS) -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
diff --git a/meta/recipes-devtools/insserv/files/insserv.conf b/meta/recipes-devtools/insserv/files/insserv.conf
new file mode 100644
index 0000000000..4858f85b69
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/insserv.conf
@@ -0,0 +1,41 @@
+#
+# All local filesystems are mounted (done during boot phase)
+#
+$local_fs mountall
+
+#
+# Low level networking (ethernet card)
+#
+$network networking +pcmcia +hotplug
+
+#
+# Named is operational
+#
+$named +named +dnsmasq +lwresd $network
+
+#
+# All remote filesystems are mounted (note in some cases /usr may
+# be remote. Most applications that care will probably require
+# both $local_fs and $remote_fs)
+#
+$remote_fs $local_fs +mountnfs
+
+#
+# System logger is operational
+#
+$syslog sysklogd
+
+#
+# SunRPC portmapper available
+#
+$portmap portmap
+
+#
+# The system time has been set correctly
+#
+$time hwclock
+
+#
+# Services which need to be interactive
+#
+<interactive> hostname udev
diff --git a/meta/recipes-devtools/insserv/files/make.patch b/meta/recipes-devtools/insserv/files/make.patch
new file mode 100644
index 0000000000..bb3b51a8ca
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/make.patch
@@ -0,0 +1,58 @@
+=== modified file 'Makefile'
+--- old/Makefile 2008-06-24 14:49:47 +0000
++++ new/Makefile 2008-06-24 15:56:15 +0000
+@@ -7,10 +7,10 @@
+ INITDIR = /etc/init.d
+ INSCONF = /etc/insserv.conf
+ #DESTDIR = /tmp/root
+-#DEBUG = -DDEBUG=1 -Wpacked
++DEBUG = -DDEBUG=1 -Wpacked
+ #LOOPS = -DIGNORE_LOOPS=1
+ DEBUG =
+-ISSUSE = -DSUSE
++#ISSUSE = -DSUSE
+ DESTDIR =
+ VERSION = 1.11.0
+ DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
+@@ -28,7 +28,9 @@
+ COPTS = -O2
+ endif
+ endif
+- CFLAGS = -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
++COPTS += -g
++
++ MY_CFLAGS = $(CFLAGS) -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
+ $(ISSUSE) -DINITDIR=\"$(INITDIR)\" -DINSCONF=\"$(INSCONF)\" -pipe
+ CLOOP = -falign-loops=0
+ CC = gcc
+@@ -58,13 +60,13 @@
+ all: $(TODO)
+
+ listing.o: listing.c listing.h .system
+- $(CC) $(CFLAGS) $(CLOOP) -c $<
++ $(CC) $(MY_CFLAGS) $(CLOOP) -c $<
+
+ insserv.o: insserv.c listing.h .system
+- $(CC) $(CFLAGS) $(CLOOP) -c $<
++ $(CC) $(MY_CFLAGS) $(CLOOP) -c $<
+
+ insserv: insserv.o listing.o
+- $(CC) $(CFLAGS) -Wl,-O,3,--relax -o $@ $^
++ $(CC) $(MY_CFLAGS) -Wl,-O,3,--relax -o $@ $^
+
+ ifeq ($(ISSUSE),-DSUSE)
+ insserv.8: insserv.8.in .system
+@@ -86,10 +88,10 @@
+ -include .depend.listing .depend.insserv
+
+ .depend.listing:
+- @$(CC) $(CFLAGS) -M listing.c >$@ 2>/dev/null
++ @$(CC) $(MY_CFLAGS) -M listing.c >$@ 2>/dev/null
+
+ .depend.insserv:
+- @$(CC) $(CFLAGS) -M insserv.c >$@ 2>/dev/null
++ @$(CC) $(MY_CFLAGS) -M insserv.c >$@ 2>/dev/null
+
+ install: $(TODO)
+ $(MKDIR) $(SBINDIR)
+
diff --git a/meta/recipes-devtools/insserv/insserv_1.11.0.bb b/meta/recipes-devtools/insserv/insserv_1.11.0.bb
new file mode 100644
index 0000000000..a45ccda48f
--- /dev/null
+++ b/meta/recipes-devtools/insserv/insserv_1.11.0.bb
@@ -0,0 +1,17 @@
+LICENSE = "GPL"
+SECTION = "base"
+PR = "r1"
+
+SRC_URI = "ftp://ftp.suse.com/pub/projects/init/${BPN}-${PV}.tar.gz \
+ file://40_segfault_virtprov.dpatch;patch=1 \
+ file://42_loopnochangemsg.dpatch;patch=1 \
+ file://make.patch;patch=1 \
+ file://crosscompile_fix.patch;patch=1 \
+ file://insserv.conf"
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+ install -m0644 ${WORKDIR}/insserv.conf ${D}${sysconfdir}/insserv.conf
+}
+
+BBCLASSEXTEND = "native"