aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/busybox/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/busybox/files')
-rw-r--r--recipes/busybox/files/50telnet16
-rw-r--r--recipes/busybox/files/busybox-appletlib-dependency.patch11
-rwxr-xr-xrecipes/busybox/files/busybox-cron39
-rwxr-xr-xrecipes/busybox/files/busybox-httpd44
-rwxr-xr-xrecipes/busybox/files/busybox-udhcpd43
-rw-r--r--recipes/busybox/files/default.script4
-rw-r--r--recipes/busybox/files/find-touchscreen.sh9
-rw-r--r--recipes/busybox/files/glibc2.4-icmp6.patch15
-rw-r--r--recipes/busybox/files/hwclock.sh76
-rw-r--r--recipes/busybox/files/install-should-unlink-dest-if-it-exists.patch53
-rw-r--r--recipes/busybox/files/login.failsafe19
-rwxr-xr-xrecipes/busybox/files/mdev11
-rw-r--r--recipes/busybox/files/mdev.conf33
-rwxr-xr-xrecipes/busybox/files/mount.busybox3
-rw-r--r--recipes/busybox/files/mountall1
-rw-r--r--recipes/busybox/files/postinst25
-rw-r--r--recipes/busybox/files/prerm10
-rw-r--r--recipes/busybox/files/run_parts.c174
-rw-r--r--recipes/busybox/files/syslog69
-rw-r--r--recipes/busybox/files/syslog.conf9
-rwxr-xr-xrecipes/busybox/files/umount.busybox3
21 files changed, 667 insertions, 0 deletions
diff --git a/recipes/busybox/files/50telnet b/recipes/busybox/files/50telnet
new file mode 100644
index 0000000000..3fb4a90494
--- /dev/null
+++ b/recipes/busybox/files/50telnet
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2008 Koen Kooi
+
+# This starts telnetd if the password for 'root' is empty. This is needed for devices without a screen or serial console (wifi router, NAS, etc).
+
+start() {
+ if awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null
+ then
+ telnetd -l /bin/login.failsafe
+ fi
+}
+
+stop() {
+ killall telnetd
+}
diff --git a/recipes/busybox/files/busybox-appletlib-dependency.patch b/recipes/busybox/files/busybox-appletlib-dependency.patch
new file mode 100644
index 0000000000..85a61e8cf5
--- /dev/null
+++ b/recipes/busybox/files/busybox-appletlib-dependency.patch
@@ -0,0 +1,11 @@
+--- a/libbb/Kbuild 2008-11-09 20:28:09.000000000 +0300
++++ b/libbb/Kbuild 2009-02-17 17:41:48.718747865 +0300
+@@ -147,3 +147,8 @@ lib-$(CONFIG_PGREP) += xregcomp.o
+ lib-$(CONFIG_PKILL) += xregcomp.o
+ lib-$(CONFIG_DEVFSD) += xregcomp.o
+ lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o
++
++libbb/appletlib.o: include/usage_compressed.h include/applet_tables.h
++
++include/usage_compressed.h include/applet_tables.h:
++ $(Q)$(MAKE) $(build)=applets $@
diff --git a/recipes/busybox/files/busybox-cron b/recipes/busybox/files/busybox-cron
new file mode 100755
index 0000000000..f0e6b15629
--- /dev/null
+++ b/recipes/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/usr/sbin/crond
+NAME=crond
+DESC="Busybox Periodic Command Scheduler"
+ARGS="-c /etc/cron/crontabs"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo -n "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/busybox/files/busybox-httpd b/recipes/busybox/files/busybox-httpd
new file mode 100755
index 0000000000..c8348e54a7
--- /dev/null
+++ b/recipes/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
+#!/bin/sh
+DAEMON=/usr/sbin/httpd
+NAME=httpd
+DESC="Busybox HTTP Daemon"
+HTTPROOT="/srv/www"
+ARGS="-h $HTTPROOT"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -d $HTTPROOT ]; then
+ echo "$HTTPROOT is missing."
+ exit 1
+ fi
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/busybox/files/busybox-udhcpd b/recipes/busybox/files/busybox-udhcpd
new file mode 100755
index 0000000000..c43903e8dc
--- /dev/null
+++ b/recipes/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
+#!/bin/sh
+DAEMON=/usr/sbin/udhcpd
+NAME=udhcpd
+DESC="Busybox UDHCP Server"
+ARGS="/etc/udhcpd.conf"
+
+test -f $DAEMON || exit 1
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -f /etc/udhcpd.conf ]; then
+ echo "error: /etc/udhcpd.conf is missing."
+ exit 1
+ fi
+ /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ /sbin/start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/busybox/files/default.script b/recipes/busybox/files/default.script
new file mode 100644
index 0000000000..f2ac987a27
--- /dev/null
+++ b/recipes/busybox/files/default.script
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec run-parts -a "$1" /etc/udhcpc.d
+
diff --git a/recipes/busybox/files/find-touchscreen.sh b/recipes/busybox/files/find-touchscreen.sh
new file mode 100644
index 0000000000..1582ea891c
--- /dev/null
+++ b/recipes/busybox/files/find-touchscreen.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
+ ln -sf /dev/input/$MDEV /dev/input/touchscreen0
+fi
+
+if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
+ ln -sf /dev/input/$MDEV /dev/input/touchscreen0
+fi
diff --git a/recipes/busybox/files/glibc2.4-icmp6.patch b/recipes/busybox/files/glibc2.4-icmp6.patch
new file mode 100644
index 0000000000..3cec1dd31a
--- /dev/null
+++ b/recipes/busybox/files/glibc2.4-icmp6.patch
@@ -0,0 +1,15 @@
+--- busybox-1.01/networking/ping6.c.orig 2006-03-15 15:43:21.000000000 +0100
++++ busybox-1.01/networking/ping6.c 2006-03-15 15:49:29.000000000 +0100
+@@ -56,6 +56,12 @@
+ #include <stddef.h> /* offsetof */
+ #include "busybox.h"
+
++#ifndef ICMP6_MEMBERSHIP_QUERY /* glibc >= 2.4 */
++#define ICMP6_MEMBERSHIP_QUERY MLD_LISTENER_QUERY
++#define ICMP6_MEMBERSHIP_REPORT MLD_LISTENER_REPORT
++#define ICMP6_MEMBERSHIP_REDUCTION MLD_LISTENER_REDUCTION
++#endif
++
+ static const int DEFDATALEN = 56;
+ static const int MAXIPLEN = 60;
+ static const int MAXICMPLEN = 76;
diff --git a/recipes/busybox/files/hwclock.sh b/recipes/busybox/files/hwclock.sh
new file mode 100644
index 0000000000..6c0af3422c
--- /dev/null
+++ b/recipes/busybox/files/hwclock.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+# hwclock.sh Set system clock to hardware clock, according to the UTC
+# setting in /etc/default/rcS (see also rcS(5)).
+#
+# WARNING: If your hardware clock is not in UTC/GMT, this script
+# must know the local time zone. This information is
+# stored in /etc/localtime. This might be a problem if
+# your /etc/localtime is a symlink to something in
+# /usr/share/zoneinfo AND /usr isn't in the root
+# partition! The workaround is to define TZ either
+# in /etc/default/rcS, or in the proper place below.
+
+[ ! -x /sbin/hwclock ] && exit 0
+
+. /etc/default/rcS
+
+[ "$UTC" = yes ] && UTC=--utc || UTC=--localtime
+
+case "$1" in
+ start)
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System time was `date`."
+ echo "Setting the System Clock using the Hardware Clock as reference..."
+ fi
+
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ if [ -z "$TZ" ]
+ then
+ hwclock -s $UTC;# --hctosys
+ else
+ TZ="$TZ" hwclock -s $UTC;# --hctosys
+ fi
+ fi
+
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System Clock set. System local time is now `date`."
+ fi
+ ;;
+ stop|restart|reload|force-reload)
+ #
+ # Updates the Hardware Clock with the System Clock time.
+ # This will *override* any changes made to the Hardware Clock.
+ #
+ # WARNING: If you disable this, any changes to the system
+ # clock will not be carried across reboots.
+ #
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Saving the System Clock time to the Hardware Clock..."
+ fi
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock -w $UTC;# --systohc
+ fi
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Hardware Clock updated to `date`."
+ fi
+ exit 0
+ ;;
+ show)
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock -r $UTC;# --show
+ fi
+ ;;
+ *)
+ echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
+ echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
+ echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
+ exit 1
+ ;;
+esac
diff --git a/recipes/busybox/files/install-should-unlink-dest-if-it-exists.patch b/recipes/busybox/files/install-should-unlink-dest-if-it-exists.patch
new file mode 100644
index 0000000000..4bec313f0e
--- /dev/null
+++ b/recipes/busybox/files/install-should-unlink-dest-if-it-exists.patch
@@ -0,0 +1,53 @@
+---
+ coreutils/install.c | 2 +-
+ include/libbb.h | 3 ++-
+ libbb/copy_file.c | 9 +++++++++
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+Index: busybox-1.2.1/coreutils/install.c
+===================================================================
+--- busybox-1.2.1.orig/coreutils/install.c 2006-10-19 16:33:48.000000000 +0200
++++ busybox-1.2.1/coreutils/install.c 2006-10-19 16:35:58.000000000 +0200
+@@ -59,7 +59,7 @@ int install_main(int argc, char **argv)
+ char *gid_str = "-1";
+ char *uid_str = "-1";
+ char *mode_str = "0755";
+- int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE;
++ int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE | FILEUTILS_NO_TRUNC;
+ int ret = EXIT_SUCCESS, flags, i, isdir;
+
+ #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS
+Index: busybox-1.2.1/include/libbb.h
+===================================================================
+--- busybox-1.2.1.orig/include/libbb.h 2006-10-19 16:24:50.000000000 +0200
++++ busybox-1.2.1/include/libbb.h 2006-10-19 16:32:40.000000000 +0200
+@@ -345,7 +345,8 @@ enum { /* DO NOT CHANGE THESE VALUES! c
+ FILEUTILS_DEREFERENCE = 2,
+ FILEUTILS_RECUR = 4,
+ FILEUTILS_FORCE = 8,
+- FILEUTILS_INTERACTIVE = 16
++ FILEUTILS_INTERACTIVE = 16,
++ FILEUTILS_NO_TRUNC = 32
+ };
+
+ extern const char *bb_applet_name;
+Index: busybox-1.2.1/libbb/copy_file.c
+===================================================================
+--- busybox-1.2.1.orig/libbb/copy_file.c 2006-10-19 16:26:53.000000000 +0200
++++ busybox-1.2.1/libbb/copy_file.c 2006-10-19 16:32:28.000000000 +0200
+@@ -136,6 +136,15 @@ int copy_file(const char *source, const
+ }
+ }
+
++ if (flags & FILEUTILS_NO_TRUNC) {
++ if (unlink(dest) < 0) {
++ bb_perror_msg("unable to remove `%s'", dest);
++ close(src_fd);
++ return -1;
++ }
++ goto dest_removed;
++ }
++
+ dst_fd = open(dest, O_WRONLY|O_TRUNC);
+ if (dst_fd == -1) {
+ if (!(flags & FILEUTILS_FORCE)) {
diff --git a/recipes/busybox/files/login.failsafe b/recipes/busybox/files/login.failsafe
new file mode 100644
index 0000000000..e7c12a27fb
--- /dev/null
+++ b/recipes/busybox/files/login.failsafe
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2008 Koen Kooi
+
+grep '^root:[^!]' /etc/passwd >&- 2>&-
+[ "$?" = "0" ] &&
+{
+ echo "Login failed."
+ exit 0
+} || {
+cat << EOF
+ === IMPORTANT ============================
+ Use 'passwd' to set your login password
+ this will disable telnet and enable SSH
+ ------------------------------------------
+EOF
+}
+
+exec /bin/sh --login
diff --git a/recipes/busybox/files/mdev b/recipes/busybox/files/mdev
new file mode 100755
index 0000000000..4eed51e94c
--- /dev/null
+++ b/recipes/busybox/files/mdev
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+mount -t tmpfs tmpfs /dev -o size=64k,mode=0755
+
+mkdir /dev/pts /dev/shm
+
+mount -t devpts devpts /dev/pts
+
+echo "/sbin/mdev" >/proc/sys/kernel/hotplug
+
+mdev -s
diff --git a/recipes/busybox/files/mdev.conf b/recipes/busybox/files/mdev.conf
new file mode 100644
index 0000000000..163ebfe45d
--- /dev/null
+++ b/recipes/busybox/files/mdev.conf
@@ -0,0 +1,33 @@
+console 0:0 0600
+cpu_dma_latency 0:0 0660
+fb0:0 44 0660
+full 0:0 0666
+initctl 0:0 0600
+ircomm[0-9].* 0:20 0660
+kmem 0:15 0640
+kmsg 0:0 0660
+log 0:0 0666
+loop[0-9].* 0:6 0640
+mem 0:15 0640
+network_latency 0:0 0660
+network_throughput 0:0 0660
+null 0:0 0666
+port 0:15 0640
+ptmx 0:5 0666
+ram[0-9].* 0:6 0640
+random 0:0 0666
+sda 0:6 0640
+tty 0:5 0666
+tty.* 0:0 0620
+urandom 0:0 0666
+usbdev.* 0:0 0660
+vcs.* 0:5 0660
+zero 0:0 0666
+
+pcm.* 0:0 0660 =snd/
+control.* 0:0 0660 =snd/
+timer 0:0 0660 =snd/
+
+event.* 0:0 0660 =input/ @/etc/mdev/find-touchscreen.sh
+mice 0:0 0660 =input/
+mouse.* 0:0 0660 =input/
diff --git a/recipes/busybox/files/mount.busybox b/recipes/busybox/files/mount.busybox
new file mode 100755
index 0000000000..fef945b7b2
--- /dev/null
+++ b/recipes/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox mount $@
diff --git a/recipes/busybox/files/mountall b/recipes/busybox/files/mountall
new file mode 100644
index 0000000000..d5408b8f8d
--- /dev/null
+++ b/recipes/busybox/files/mountall
@@ -0,0 +1 @@
+MOUNTALL="-t nonfs,nosmbfs,noncpfs"
diff --git a/recipes/busybox/files/postinst b/recipes/busybox/files/postinst
new file mode 100644
index 0000000000..36d8190f80
--- /dev/null
+++ b/recipes/busybox/files/postinst
@@ -0,0 +1,25 @@
+#!/bin/busybox ash
+
+action="$1"
+oldversion="$2"
+
+umask 022
+
+if /bin/busybox [ "$action" != configure ]
+then
+ exit 0
+fi
+
+. /etc/default/functions
+
+setup_init_hwclock() {
+ updatercd hwclock.sh start 50 S . stop 25 0 1 6 .
+ /etc/init.d/hwclock.sh restart
+}
+
+/bin/busybox ash /usr/bin/update-alternatives --install /bin/vi vi /bin/busybox 100
+/bin/busybox ash /usr/bin/update-alternatives --install /bin/sh sh /bin/busybox 100
+
+setup_init_hwclock
+
+exit 0
diff --git a/recipes/busybox/files/prerm b/recipes/busybox/files/prerm
new file mode 100644
index 0000000000..7ade4b1dec
--- /dev/null
+++ b/recipes/busybox/files/prerm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "$1" != "upgrade" ]; then
+ update-alternatives --remove sh /bin/busybox
+ update-alternatives --remove vi /bin/busybox
+ find /etc -name [SK][0-9][0-9]hwclock.sh | xargs rm -f
+ find /etc -name [SK][0-9][0-9]syslog | xargs rm -f
+fi
+
+exit 0
diff --git a/recipes/busybox/files/run_parts.c b/recipes/busybox/files/run_parts.c
new file mode 100644
index 0000000000..56f70c6eea
--- /dev/null
+++ b/recipes/busybox/files/run_parts.c
@@ -0,0 +1,174 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Mini run-parts implementation for busybox
+ *
+ * Copyright (C) 2007 Bernhard Fischer
+ *
+ * Based on a older version that was in busybox which was 1k big..
+ * Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it>
+ *
+ * Based on the Debian run-parts program, version 1.15
+ * Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>,
+ * Copyright (C) 1996-1999 Guy Maor <maor@debian.org>
+ *
+ *
+ * Licensed under GPL v2 or later, see file LICENSE in this tarball for details.
+ */
+
+/* This is my first attempt to write a program in C (well, this is my first
+ * attempt to write a program! :-) . */
+
+/* This piece of code is heavily based on the original version of run-parts,
+ * taken from debian-utils. I've only removed the long options and a the
+ * report mode. As the original run-parts support only long options, I've
+ * broken compatibility because the BusyBox policy doesn't allow them.
+ * The supported options are:
+ * -t test. Print the name of the files to be executed, without
+ * execute them.
+ * -a ARG argument. Pass ARG as an argument the program executed. It can
+ * be repeated to pass multiple arguments.
+ * -u MASK umask. Set the umask of the program executed to MASK.
+ */
+
+#include <getopt.h>
+
+#include "libbb.h"
+
+struct globals {
+ char **names;
+ int cur;
+ char *cmd[1];
+};
+#define G (*(struct globals*)&bb_common_bufsiz1)
+#define names (G.names)
+#define cur (G.cur )
+#define cmd (G.cmd )
+
+enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(struct globals)) / sizeof(cmd[0]) };
+
+enum {
+ RUN_PARTS_OPT_a = (1 << 0),
+ RUN_PARTS_OPT_u = (1 << 1),
+ RUN_PARTS_OPT_t = (1 << 2),
+ RUN_PARTS_OPT_l = (1 << 3) * ENABLE_FEATURE_RUN_PARTS_FANCY,
+};
+
+#if ENABLE_FEATURE_RUN_PARTS_FANCY
+#define list_mode (option_mask32 & RUN_PARTS_OPT_l)
+#else
+#define list_mode 0
+#endif
+
+/* Is this a valid filename (upper/lower alpha, digits,
+ * underscores, and hyphens only?)
+ */
+static bool invalid_name(const char *c)
+{
+ c = bb_basename(c);
+
+ while (*c && (isalnum(*c) || *c == '_' || *c == '-'))
+ c++;
+
+ return *c; /* TRUE (!0) if terminating NUL is not reached */
+}
+
+static int bb_alphasort(const void *p1, const void *p2)
+{
+ return strcmp(*(char **) p1, *(char **) p2);
+}
+
+static int act(const char *file, struct stat *statbuf, void *args, int depth)
+{
+ if (depth == 1)
+ return TRUE;
+
+ if (depth == 2
+ && ( !(statbuf->st_mode & (S_IFREG | S_IFLNK))
+ || invalid_name(file)
+ || (!list_mode && access(file, X_OK) != 0))
+ ) {
+ return SKIP;
+ }
+
+ names = xrealloc(names, (cur + 2) * sizeof(names[0]));
+ names[cur++] = xstrdup(file);
+ names[cur] = NULL;
+
+ return TRUE;
+}
+
+#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
+static const char runparts_longopts[] ALIGN1 =
+ "arg\0" Required_argument "a"
+ "umask\0" Required_argument "u"
+ "test\0" No_argument "t"
+#if ENABLE_FEATURE_RUN_PARTS_FANCY
+ "list\0" No_argument "l"
+//TODO: "reverse\0" No_argument "r"
+//TODO: "verbose\0" No_argument "v"
+#endif
+ ;
+#endif
+
+int run_parts_main(int argc, char **argv);
+int run_parts_main(int argc, char **argv)
+{
+ const char *umask_p = "22";
+ llist_t *arg_list = NULL;
+ unsigned n;
+ int ret;
+
+#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
+ applet_long_options = runparts_longopts;
+#endif
+ /* We require exactly one argument: the directory name */
+ opt_complementary = "=1:a::";
+ getopt32(argv, "a:u:t"USE_FEATURE_RUN_PARTS_FANCY("l"), &arg_list, &umask_p);
+
+ umask(xstrtou_range(umask_p, 8, 0, 07777));
+
+ n = 1;
+ while (arg_list && n < NUM_CMD) {
+ cmd[n] = arg_list->data;
+ arg_list = arg_list->link;
+ n++;
+ }
+ /* cmd[n] = NULL; - is already zeroed out */
+
+ /* run-parts has to sort executables by name before running them */
+
+ recursive_action(argv[optind],
+ ACTION_RECURSE|ACTION_FOLLOWLINKS,
+ act, /* file action */
+ act, /* dir action */
+ NULL, /* user data */
+ 1 /* depth */
+ );
+
+ if (!names)
+ return 0;
+
+ qsort(names, cur, sizeof(char *), bb_alphasort);
+
+ n = 0;
+ while (1) {
+ char *name = *names++;
+ if (!name)
+ break;
+ if (option_mask32 & (RUN_PARTS_OPT_t | RUN_PARTS_OPT_l)) {
+ puts(name);
+ continue;
+ }
+ cmd[0] = name;
+ ret = wait4pid(spawn(cmd));
+ if (ret == 0)
+ continue;
+ n = 1;
+ if (ret < 0)
+ bb_perror_msg("failed to exec %s", name);
+ else /* ret > 0 */
+ bb_error_msg("%s exited with return code %d", name, ret);
+ }
+
+ return n;
+}
diff --git a/recipes/busybox/files/syslog b/recipes/busybox/files/syslog
new file mode 100644
index 0000000000..61d273b7cb
--- /dev/null
+++ b/recipes/busybox/files/syslog
@@ -0,0 +1,69 @@
+#! /bin/sh
+#
+# syslog init.d script for busybox syslogd/klogd
+# Written by Robert Griebl <sandman@handhelds.org>
+# Configuration file added by <bruno.randolf@4g-systems.biz>
+set -e
+
+if [ -f /etc/syslog.conf ]; then
+ . /etc/syslog.conf
+ LOG_LOCAL=0
+ LOG_REMOTE=0
+ for D in $DESTINATION; do
+ if [ "$D" = "buffer" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
+ LOG_LOCAL=1
+ elif [ "$D" = "file" ]; then
+ if [ -n "$LOGFILE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
+ fi
+ if [ -n "$ROTATESIZE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
+ fi
+ if [ -n "$ROTATEGENS" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
+ fi
+ LOCAL=0
+ elif [ "$D" = "remote" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
+ LOG_REMOTE=1
+ fi
+ done
+ if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -L"
+ fi
+ if [ -n "$MARKINT" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -m $MARKINT"
+ fi
+ if [ "$REDUCE" = "yes" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -S"
+ fi
+else
+ # default: log to 16K shm circular buffer
+ SYSLOG_ARGS="-C"
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting syslogd/klogd: "
+ start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
+ start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
+ echo "done"
+ ;;
+ stop)
+ echo -n "Stopping syslogd/klogd: "
+ start-stop-daemon -K -n syslogd
+ start-stop-daemon -K -n klogd
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: syslog { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/busybox/files/syslog.conf b/recipes/busybox/files/syslog.conf
new file mode 100644
index 0000000000..fc7ff8b37a
--- /dev/null
+++ b/recipes/busybox/files/syslog.conf
@@ -0,0 +1,9 @@
+DESTINATION="buffer" # log destinations (buffer file remote)
+MARKINT=20 # interval between --mark-- entries [min]
+REDUCE=no # reduced-size logging
+BUFFERSIZE=64 # buffer: size of circular buffer [kByte]
+LOGFILE=/var/log/messages # file: where to log
+ROTATESIZE=32 # file: rotate log if grown beyond X [kByte] (busybox 1.2+)
+ROTATEGENS=1 # file: keep X generations of rotated logs (busybox 1.2+)
+REMOTE=loghost:514 # remote: where to log
+FOREGROUND=no # run in foreground (don't use!)
diff --git a/recipes/busybox/files/umount.busybox b/recipes/busybox/files/umount.busybox
new file mode 100755
index 0000000000..f3731626e6
--- /dev/null
+++ b/recipes/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@