summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/insserv/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/insserv/files')
-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
5 files changed, 230 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 @@
1#! /bin/sh /usr/share/dpatch/dpatch-run
2## 40_segfault_virtprov.dpatch by Petter Reinholdtsen
3
4Avoid segfault when an enabled service provide a virtual system
5facility.
6
7@DPATCH@
8--- insserv/insserv.c
9+++ insserv/insserv.c 2008-02-01 11:43:45.634618329 +0100
10@@ -166,7 +166,7 @@ typedef struct pwd_struct {
11
12 static list_t pwd = { &(pwd), &(pwd) }, * topd = &(pwd);
13
14-static void pushd(const char *const __restrict path);
15+static void pushd(const char *const __restrict path) __attribute__((nonnull(1)));
16 static void pushd(const char *const path)
17 {
18 pwd_t * dir;
19@@ -305,13 +305,13 @@ out:
20 return getserv(ptr);
21 }
22
23-static serv_t * findserv(const char *const __restrict serv) __attribute__((nonnull(1)));
24+static serv_t * findserv(const char *const __restrict serv);
25 static serv_t * findserv(const char *const serv)
26 {
27 list_t * ptr;
28 serv_t * ret = (serv_t*)0;
29
30- if (!serv)
31+ if (serv == (const char*)0)
32 goto out;
33
34 list_for_each(ptr, serv_start) {
35@@ -334,6 +334,9 @@ static void rememberreq(serv_t *serv, ui
36 list_t * ptr;
37 uint old = bit;
38
39+ if (!tmp)
40+ error("%s", strerror(errno));
41+
42 while ((token = strsep(&tmp, delimeter))) {
43 boolean found = false;
44 req_t * this;
45@@ -399,6 +402,9 @@ static void reversereq(const serv_t * se
46 char * rev = strdupa(list);
47 uint old = bit;
48
49+ if (!rev)
50+ error("%s", strerror(errno));
51+
52 while ((dep = strsep(&rev, delimeter)) && *dep) {
53 serv_t * tmp;
54 list_t * ptr;
55@@ -437,7 +443,7 @@ static void reversereq(const serv_t * se
56 /*
57 * Check required services for name
58 */
59-static boolean chkrequired(const char *const __restrict name) __attribute__((nonnull(1)));
60+static boolean chkrequired(const char *const __restrict name);
61 static boolean chkrequired(const char *const name)
62 {
63 serv_t * serv = findserv(name);
64--- insserv/listing.h
65+++ insserv/listing.h 2008-02-01 11:40:45.347748072 +0100
66@@ -97,11 +97,11 @@ extern int makeprov(const char *__restri
67 extern void setorder(const char *__restrict script, const int order, boolean recursive) __attribute__((nonnull(1)));
68 extern int getorder(const char *__restrict script) __attribute__((nonnull(1)));
69 extern boolean notincluded(const char *__restrict script, const int runlevel) __attribute__((nonnull(1)));
70-extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(1,2)));
71-extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1,2)));
72+extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(2)));
73+extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1)));
74 extern const char * getscript(const char *__restrict prov) __attribute__((nonnull(1)));
75 extern const char * getprovides(const char *__restrict script) __attribute__((nonnull(1)));
76-extern boolean listscripts(const char **__restrict script, const int lvl) __attribute__((nonnull(1)));
77+extern boolean listscripts(const char **__restrict script, const int lvl);
78 extern int maxorder;
79 extern boolean is_loop_detected(void);
80
81@@ -116,7 +116,7 @@ extern int map_has_runlevels(void);
82 extern int map_runlevel_to_lvl (const int runlevel);
83 extern int map_key_to_lvl(const char key);
84
85-static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline,nonnull(1)));
86+static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline));
87 static inline char * xstrdup(const char * s)
88 {
89 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 @@
1#! /bin/sh /usr/share/dpatch/dpatch-run
2## 40_loopnochangemsg.dpatch by Petter Reinholdtsen
3
4Make it more obvious that introducing a loop will not change the
5existing boot sequence. Thanks to Frans Pop for the rationale for
6this change.
7
8@DPATCH@
9
10--- insserv-1.11.0.orig/insserv.c
11+++ insserv-1.11.0/insserv.c
12@@ -2647,7 +2647,7 @@
13 follow_all();
14
15 if (is_loop_detected() && !ignore)
16- error("exiting now!\n");
17+ error("exiting without changing boot order!\n");
18
19 /*
20 * 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 @@
1Index: insserv-1.11.0/Makefile
2===================================================================
3--- insserv-1.11.0.orig/Makefile 2008-08-25 16:00:00.000000000 +0100
4+++ insserv-1.11.0/Makefile 2008-08-25 16:00:25.000000000 +0100
5@@ -18,16 +18,7 @@
6 #
7 # Architecture
8 #
9-ifdef RPM_OPT_FLAGS
10- COPTS = -g $(RPM_OPT_FLAGS)
11-else
12- ARCH = $(shell uname -i)
13-ifeq ($(ARCH),i386)
14- COPTS = -O2 -mcpu=i586 -mtune=i686
15-else
16- COPTS = -O2
17-endif
18-endif
19+COPTS = -O2
20 COPTS += -g
21
22 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 @@
1#
2# All local filesystems are mounted (done during boot phase)
3#
4$local_fs mountall
5
6#
7# Low level networking (ethernet card)
8#
9$network networking +pcmcia +hotplug
10
11#
12# Named is operational
13#
14$named +named +dnsmasq +lwresd $network
15
16#
17# All remote filesystems are mounted (note in some cases /usr may
18# be remote. Most applications that care will probably require
19# both $local_fs and $remote_fs)
20#
21$remote_fs $local_fs +mountnfs
22
23#
24# System logger is operational
25#
26$syslog sysklogd
27
28#
29# SunRPC portmapper available
30#
31$portmap portmap
32
33#
34# The system time has been set correctly
35#
36$time hwclock
37
38#
39# Services which need to be interactive
40#
41<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 @@
1=== modified file 'Makefile'
2--- old/Makefile 2008-06-24 14:49:47 +0000
3+++ new/Makefile 2008-06-24 15:56:15 +0000
4@@ -7,10 +7,10 @@
5 INITDIR = /etc/init.d
6 INSCONF = /etc/insserv.conf
7 #DESTDIR = /tmp/root
8-#DEBUG = -DDEBUG=1 -Wpacked
9+DEBUG = -DDEBUG=1 -Wpacked
10 #LOOPS = -DIGNORE_LOOPS=1
11 DEBUG =
12-ISSUSE = -DSUSE
13+#ISSUSE = -DSUSE
14 DESTDIR =
15 VERSION = 1.11.0
16 DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
17@@ -28,7 +28,9 @@
18 COPTS = -O2
19 endif
20 endif
21- CFLAGS = -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
22+COPTS += -g
23+
24+ MY_CFLAGS = $(CFLAGS) -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
25 $(ISSUSE) -DINITDIR=\"$(INITDIR)\" -DINSCONF=\"$(INSCONF)\" -pipe
26 CLOOP = -falign-loops=0
27 CC = gcc
28@@ -58,13 +60,13 @@
29 all: $(TODO)
30
31 listing.o: listing.c listing.h .system
32- $(CC) $(CFLAGS) $(CLOOP) -c $<
33+ $(CC) $(MY_CFLAGS) $(CLOOP) -c $<
34
35 insserv.o: insserv.c listing.h .system
36- $(CC) $(CFLAGS) $(CLOOP) -c $<
37+ $(CC) $(MY_CFLAGS) $(CLOOP) -c $<
38
39 insserv: insserv.o listing.o
40- $(CC) $(CFLAGS) -Wl,-O,3,--relax -o $@ $^
41+ $(CC) $(MY_CFLAGS) -Wl,-O,3,--relax -o $@ $^
42
43 ifeq ($(ISSUSE),-DSUSE)
44 insserv.8: insserv.8.in .system
45@@ -86,10 +88,10 @@
46 -include .depend.listing .depend.insserv
47
48 .depend.listing:
49- @$(CC) $(CFLAGS) -M listing.c >$@ 2>/dev/null
50+ @$(CC) $(MY_CFLAGS) -M listing.c >$@ 2>/dev/null
51
52 .depend.insserv:
53- @$(CC) $(CFLAGS) -M insserv.c >$@ 2>/dev/null
54+ @$(CC) $(MY_CFLAGS) -M insserv.c >$@ 2>/dev/null
55
56 install: $(TODO)
57 $(MKDIR) $(SBINDIR)
58