summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/busybox/busybox-1.7.2/run_parts.c174
-rwxr-xr-xmeta/packages/busybox/busybox-1.8.1/busybox-mdev.sh (renamed from meta/packages/busybox/busybox-1.7.2/busybox-mdev.sh)0
-rw-r--r--meta/packages/busybox/busybox-1.8.1/defconfig (renamed from meta/packages/busybox/busybox-1.7.2/defconfig)0
-rw-r--r--meta/packages/busybox/busybox-1.8.1/udhcpscript.patch (renamed from meta/packages/busybox/busybox-1.7.2/udhcpscript.patch)0
-rw-r--r--meta/packages/busybox/busybox_1.8.1.bb (renamed from meta/packages/busybox/busybox_1.7.2.bb)12
5 files changed, 1 insertions, 185 deletions
diff --git a/meta/packages/busybox/busybox-1.7.2/run_parts.c b/meta/packages/busybox/busybox-1.7.2/run_parts.c
deleted file mode 100644
index 56f70c6eea..0000000000
--- a/meta/packages/busybox/busybox-1.7.2/run_parts.c
+++ /dev/null
@@ -1,174 +0,0 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Mini run-parts implementation for busybox
4 *
5 * Copyright (C) 2007 Bernhard Fischer
6 *
7 * Based on a older version that was in busybox which was 1k big..
8 * Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it>
9 *
10 * Based on the Debian run-parts program, version 1.15
11 * Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>,
12 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org>
13 *
14 *
15 * Licensed under GPL v2 or later, see file LICENSE in this tarball for details.
16 */
17
18/* This is my first attempt to write a program in C (well, this is my first
19 * attempt to write a program! :-) . */
20
21/* This piece of code is heavily based on the original version of run-parts,
22 * taken from debian-utils. I've only removed the long options and a the
23 * report mode. As the original run-parts support only long options, I've
24 * broken compatibility because the BusyBox policy doesn't allow them.
25 * The supported options are:
26 * -t test. Print the name of the files to be executed, without
27 * execute them.
28 * -a ARG argument. Pass ARG as an argument the program executed. It can
29 * be repeated to pass multiple arguments.
30 * -u MASK umask. Set the umask of the program executed to MASK.
31 */
32
33#include <getopt.h>
34
35#include "libbb.h"
36
37struct globals {
38 char **names;
39 int cur;
40 char *cmd[1];
41};
42#define G (*(struct globals*)&bb_common_bufsiz1)
43#define names (G.names)
44#define cur (G.cur )
45#define cmd (G.cmd )
46
47enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(struct globals)) / sizeof(cmd[0]) };
48
49enum {
50 RUN_PARTS_OPT_a = (1 << 0),
51 RUN_PARTS_OPT_u = (1 << 1),
52 RUN_PARTS_OPT_t = (1 << 2),
53 RUN_PARTS_OPT_l = (1 << 3) * ENABLE_FEATURE_RUN_PARTS_FANCY,
54};
55
56#if ENABLE_FEATURE_RUN_PARTS_FANCY
57#define list_mode (option_mask32 & RUN_PARTS_OPT_l)
58#else
59#define list_mode 0
60#endif
61
62/* Is this a valid filename (upper/lower alpha, digits,
63 * underscores, and hyphens only?)
64 */
65static bool invalid_name(const char *c)
66{
67 c = bb_basename(c);
68
69 while (*c && (isalnum(*c) || *c == '_' || *c == '-'))
70 c++;
71
72 return *c; /* TRUE (!0) if terminating NUL is not reached */
73}
74
75static int bb_alphasort(const void *p1, const void *p2)
76{
77 return strcmp(*(char **) p1, *(char **) p2);
78}
79
80static int act(const char *file, struct stat *statbuf, void *args, int depth)
81{
82 if (depth == 1)
83 return TRUE;
84
85 if (depth == 2
86 && ( !(statbuf->st_mode & (S_IFREG | S_IFLNK))
87 || invalid_name(file)
88 || (!list_mode && access(file, X_OK) != 0))
89 ) {
90 return SKIP;
91 }
92
93 names = xrealloc(names, (cur + 2) * sizeof(names[0]));
94 names[cur++] = xstrdup(file);
95 names[cur] = NULL;
96
97 return TRUE;
98}
99
100#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
101static const char runparts_longopts[] ALIGN1 =
102 "arg\0" Required_argument "a"
103 "umask\0" Required_argument "u"
104 "test\0" No_argument "t"
105#if ENABLE_FEATURE_RUN_PARTS_FANCY
106 "list\0" No_argument "l"
107//TODO: "reverse\0" No_argument "r"
108//TODO: "verbose\0" No_argument "v"
109#endif
110 ;
111#endif
112
113int run_parts_main(int argc, char **argv);
114int run_parts_main(int argc, char **argv)
115{
116 const char *umask_p = "22";
117 llist_t *arg_list = NULL;
118 unsigned n;
119 int ret;
120
121#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
122 applet_long_options = runparts_longopts;
123#endif
124 /* We require exactly one argument: the directory name */
125 opt_complementary = "=1:a::";
126 getopt32(argv, "a:u:t"USE_FEATURE_RUN_PARTS_FANCY("l"), &arg_list, &umask_p);
127
128 umask(xstrtou_range(umask_p, 8, 0, 07777));
129
130 n = 1;
131 while (arg_list && n < NUM_CMD) {
132 cmd[n] = arg_list->data;
133 arg_list = arg_list->link;
134 n++;
135 }
136 /* cmd[n] = NULL; - is already zeroed out */
137
138 /* run-parts has to sort executables by name before running them */
139
140 recursive_action(argv[optind],
141 ACTION_RECURSE|ACTION_FOLLOWLINKS,
142 act, /* file action */
143 act, /* dir action */
144 NULL, /* user data */
145 1 /* depth */
146 );
147
148 if (!names)
149 return 0;
150
151 qsort(names, cur, sizeof(char *), bb_alphasort);
152
153 n = 0;
154 while (1) {
155 char *name = *names++;
156 if (!name)
157 break;
158 if (option_mask32 & (RUN_PARTS_OPT_t | RUN_PARTS_OPT_l)) {
159 puts(name);
160 continue;
161 }
162 cmd[0] = name;
163 ret = wait4pid(spawn(cmd));
164 if (ret == 0)
165 continue;
166 n = 1;
167 if (ret < 0)
168 bb_perror_msg("failed to exec %s", name);
169 else /* ret > 0 */
170 bb_error_msg("%s exited with return code %d", name, ret);
171 }
172
173 return n;
174}
diff --git a/meta/packages/busybox/busybox-1.7.2/busybox-mdev.sh b/meta/packages/busybox/busybox-1.8.1/busybox-mdev.sh
index 9744322fa9..9744322fa9 100755
--- a/meta/packages/busybox/busybox-1.7.2/busybox-mdev.sh
+++ b/meta/packages/busybox/busybox-1.8.1/busybox-mdev.sh
diff --git a/meta/packages/busybox/busybox-1.7.2/defconfig b/meta/packages/busybox/busybox-1.8.1/defconfig
index 19cfafab2c..19cfafab2c 100644
--- a/meta/packages/busybox/busybox-1.7.2/defconfig
+++ b/meta/packages/busybox/busybox-1.8.1/defconfig
diff --git a/meta/packages/busybox/busybox-1.7.2/udhcpscript.patch b/meta/packages/busybox/busybox-1.8.1/udhcpscript.patch
index fc21d440cd..fc21d440cd 100644
--- a/meta/packages/busybox/busybox-1.7.2/udhcpscript.patch
+++ b/meta/packages/busybox/busybox-1.8.1/udhcpscript.patch
diff --git a/meta/packages/busybox/busybox_1.7.2.bb b/meta/packages/busybox/busybox_1.8.1.bb
index e446a19d96..0cd757cc9b 100644
--- a/meta/packages/busybox/busybox_1.7.2.bb
+++ b/meta/packages/busybox/busybox_1.8.1.bb
@@ -15,21 +15,11 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
15 file://syslog.conf \ 15 file://syslog.conf \
16 file://udhcpscript.patch;patch=1 \ 16 file://udhcpscript.patch;patch=1 \
17 file://umount.busybox \ 17 file://umount.busybox \
18 file://run_parts.c" 18 file://defconfig"
19
20
21SRC_URI += "http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-ash.patch;patch=1 \
22 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-iptun.patch;patch=1 \
23 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-logger.patch;patch=1 \
24 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-tail.patch;patch=1 \
25 file://defconfig"
26 19
27EXTRA_OEMAKE_append = " V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}" 20EXTRA_OEMAKE_append = " V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
28 21
29do_configure () { 22do_configure () {
30 # default run-parts does not sort entries == X11 session broken
31 install -m 0644 ${WORKDIR}/run_parts.c ${S}/debianutils/
32
33 install -m 0644 ${WORKDIR}/defconfig ${S}/.config 23 install -m 0644 ${WORKDIR}/defconfig ${S}/.config
34 cml1_do_configure 24 cml1_do_configure
35} 25}