M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,41 @@
diff --git a/include/libbb.h b/include/libbb.h
index 7c1db3f..5aacc17 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -31,6 +31,7 @@
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/sysinfo.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -100,25 +101,6 @@ int klogctl(int type, char *b, int len);
#if !defined __FreeBSD__
char *dirname(char *path);
#endif
-/* Include our own copy of struct sysinfo to avoid binary compatibility
- * problems with Linux 2.4, which changed things. Grumble, grumble. */
-struct sysinfo {
- long uptime; /* Seconds since boot */
- unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
- unsigned long totalram; /* Total usable main memory size */
- unsigned long freeram; /* Available memory size */
- unsigned long sharedram; /* Amount of shared memory */
- unsigned long bufferram; /* Memory used by buffers */
- unsigned long totalswap; /* Total swap space size */
- unsigned long freeswap; /* swap space still available */
- unsigned short procs; /* Number of current processes */
- unsigned short pad; /* Padding needed for m68k */
- unsigned long totalhigh; /* Total high memory size */
- unsigned long freehigh; /* Available high memory size */
- unsigned int mem_unit; /* Memory unit size in bytes */
- char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
-};
-int sysinfo(struct sysinfo* info);
#ifndef PATH_MAX
# define PATH_MAX 256
#endif
--
1.7.6
@@ -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
}
@@ -0,0 +1,21 @@
#! /bin/sh
if [ "$1" == "" ]; then
exit 1
fi
mmcblk=`ls /dev | grep $1 | wc -l`
mounted=`mount | grep $1 | wc -l`
if [ $mmcblk -ge 1 ]; then
if [ $mounted -le 0 ]; then
mount /dev/$1 /media/card
fi
fi
if [ $mmcblk -le 0 ]; then
if [ $mounted -ge 0 ]; then
umount /media/card
fi
fi
@@ -0,0 +1,15 @@
Index: busybox-1.13.2/Makefile
===================================================================
--- busybox-1.13.2.orig/Makefile 2009-03-19 15:44:37.419270265 +0300
+++ busybox-1.13.2/Makefile 2009-03-19 15:45:57.737521296 +0300
@@ -471,6 +471,10 @@
util-linux/ \
util-linux/volume_id/ \
+# Lib interdeps
+# libbb uses headers generated in applets
+libbb: applets
+
endif # KBUILD_EXTMOD
ifeq ($(dot-config),1)
+39
View File
@@ -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
+44
View File
@@ -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
+43
View File
@@ -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
@@ -0,0 +1,4 @@
#!/bin/sh
exec run-parts -a "$1" /etc/udhcpc.d
@@ -0,0 +1,11 @@
#!/bin/sh
MDEV=`echo $MDEV | sed 's#input/##g'`
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
@@ -0,0 +1 @@
proc /proc proc defaults 0 0
@@ -0,0 +1,34 @@
# Description of init RD.
dir dev 0755 0 0
nod dev/console 0600 0 0 c 5 1
nod dev/tty 0600 0 0 c 5 0
nod dev/tty0 0600 0 0 c 4 0
nod dev/tty1 0600 0 0 c 4 1
nod dev/tty2 0600 0 0 c 4 2
nod dev/tty3 0600 0 0 c 4 3
nod dev/tty4 0600 0 0 c 4 4
nod dev/zero 0600 0 0 c 1 5
dir dev/pts 0755 0 0
dir root 0700 0 0
dir proc 0700 0 0
dir sys 0700 0 0
slink sbin bin 0755 0 0
dir bin 0755 0 0
file bin/busybox bin/busybox 0755 0 0
slink bin/sh busybox 0755 0 0
slink bin/echo busybox 0755 0 0
slink bin/mount busybox 0755 0 0
slink bin/umount busybox 0755 0 0
slink init bin/busybox 0755 0 0
dir usr 0755 0 0
dir usr/bin 0755 0 0
dir usr/sbin 0755 0 0
# Simple initrd.
dir etc 0755 0 0
dir etc/init.d 0755 0 0
file etc/profile etc/profile 644 0 0
file etc/inittab etc/inittab 644 0 0
file etc/fstab etc/fstab 644 0 0
file etc/init.d/rcS etc/init.d/rcS 755 0 0
file sbin/adbd sbin/adbd 755 0 0
@@ -0,0 +1,12 @@
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
tty:x:5:
disk:x:6:
mail:x:8:
man:x:12:
www-data:x:33:
utmp:x:43:
nogroup:x:65534:
users:x:100:
@@ -0,0 +1,2 @@
# Can we use hwclock on this system?
HWCLOCKACCESS=yes
+84
View File
@@ -0,0 +1,84 @@
#!/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
. /etc/default/hwclock
[ "$UTC" = yes ] && UTC=-u || UTC=-l
if [ ! -z "$HWCLOCKDEVICE" ]; then
if [ -e $HWCLOCKDEVICE ]; then
DEVICE="-f $HWCLOCKDEVICE"
fi
fi
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 $DEVICE
else
TZ="$TZ" hwclock -s $UTC $DEVICE
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 $DEVICE
fi
if [ "$VERBOSE" != no ]
then
echo "Hardware Clock updated to `date`."
fi
exit 0
;;
show)
if [ "$HWCLOCKACCESS" != no ]
then
hwclock -r $UTC $DEVICE
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
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
#
# start/stop inetd super server.
if ! [ -x /usr/sbin/inetd ]; then
exit 0
fi
case "$1" in
start)
echo -n "Starting internet superserver:"
echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
echo "."
;;
stop)
echo -n "Stopping internet superserver:"
echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
echo "."
;;
restart)
echo -n "Restarting internet superserver:"
echo -n " inetd "
killall -HUP inetd
echo "."
;;
*)
echo "Usage: /etc/init.d/inetd {start|stop|restart}"
exit 1
;;
esac
exit 0
@@ -0,0 +1,20 @@
# /etc/inetd.conf: see inetd(8) for further informations.
#
# Internet server configuration database
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#echo stream tcp nowait root internal
#echo dgram udp wait root internal
#chargen stream tcp nowait root internal
#chargen dgram udp wait root internal
#discard stream tcp nowait root internal
#discard dgram udp wait root internal
#daytime stream tcp nowait root internal
#daytime dgram udp wait root internal
#time stream tcp nowait root internal
#time dgram udp wait root internal
@@ -0,0 +1,4 @@
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
tty2::askfirst:-/bin/sh
::ctrlaltdel:/bin/umount -a -r
@@ -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)) {
@@ -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
+7
View File
@@ -0,0 +1,7 @@
#!/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
@@ -0,0 +1,37 @@
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 */etc/mdev/usb.sh
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/
tun[0-9]* 0:0 0660 =net/
mmc.* 0:6 0660 */etc/mdev/automountsdcard.sh $MDEV
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec /bin/busybox mount $@
@@ -0,0 +1 @@
MOUNTALL="-t nonfs,nosmbfs,noncpfs"
@@ -0,0 +1,8 @@
root:x:0:0:root:/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
@@ -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
@@ -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
@@ -0,0 +1,12 @@
# /etc/profile: system-wide .profile file for the Bourne shells
echo
echo -n "Processing /etc/profile... "
# no-op
# Disable ls color as adb shell doesn't support it.
LS_COLORS=none
export LS_COLORS
echo "Done"
echo
+26
View File
@@ -0,0 +1,26 @@
#! /bin/sh
/bin/mount -a
/bin/busybox --install
/bin/mount -t sysfs none /sys
/bin/mount -t devpts devpts /dev/pts
if [ -d /sys/class/android_usb/android0 ]
then
echo "Starting USB Android Gadget"
echo hsusb > /sys/devices/platform/usb_bam/enable
echo 0 > /sys/class/android_usb/android0/enable
echo 0x9025 > /sys/class/android_usb/android0/idProduct
echo 0x05C6 > /sys/class/android_usb/android0/idVendor
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
echo smd,bam2bam > /sys/class/android_usb/android0/f_rmnet/transports
echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
fi
/sbin/mdev -s
/bin/ifconfig lo up
/sbin/mknod /dev/null c 1 3
/sbin/chmod 666 /dev/null
/sbin/adbd &
@@ -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;
}
@@ -0,0 +1,8 @@
root::14741:0:99999:7:::
daemon:*:14741:0:99999:7:::
bin:*:14741:0:99999:7:::
sys:*:14741:0:99999:7:::
man:*:14741:0:99999:7:::
mail:*:14741:0:99999:7:::
www-data:*:14741:0:99999:7:::
nobody:*:14741:0:99999:7:::
@@ -0,0 +1,72 @@
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
# return 0 if root is mounted on a network filesystem
root_is_nfs() {
grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
}
have_bin_ip=0
if [ -x /bin/ip ]; then
have_bin_ip=1
fi
case "$1" in
deconfig)
if ! root_is_nfs ; then
if [ $have_bin_ip -eq 1 ]; then
ip addr flush dev $interface
ip link set dev $interface up
else
/sbin/ifconfig $interface 0.0.0.0
fi
fi
;;
renew|bound)
if [ $have_bin_ip -eq 1 ]; then
ip addr add dev $interface local $ip/$mask $BROADCAST
else
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
fi
if [ -n "$router" ] ; then
if ! root_is_nfs ; then
if [ $have_bin_ip -eq 1 ]; then
while ip route del default 2>/dev/null ; do
:
done
else
while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
:
done
fi
fi
metric=0
for i in $router ; do
if [ $have_bin_ip -eq 1 ]; then
ip route add default via $i metric $((metric++))
else
route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
fi
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
@@ -0,0 +1,11 @@
diff -d -urpN busybox-1.18.5/include/libbb.h busybox-1.18.5/include/libbb.h
--- busybox-1.18.5/include/libbb.h 2011-07-25 11:05:18.000000000 +0200
+++ busybox-1.18.5/include/libbb.h 2011-07-26 13:38:04.967443220 +0200
@@ -52,10 +52,12 @@
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
-/* struct sysinfo is linux-specific */
-#ifdef __linux__
-# include <sys/sysinfo.h>
@@ -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/default/busybox-syslog ]; then
. /etc/default/busybox-syslog
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
@@ -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!)
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec /bin/busybox umount $@
@@ -0,0 +1,33 @@
#!/bin/sh
case "$ACTION" in
add|"")
for uevent in /sys/class/usb_device/usbdev?.*/*/uevent; do
. $uevent
if [ ! -e /dev/bus/usb/$BUSNUM/$DEVNUM ]; then
mkdir -p /dev/bus/usb/$BUSNUM
mknod /dev/bus/usb/$BUSNUM/$DEVNUM c 189 $MINOR
fi
done
;;
remove)
for device in /dev/bus/usb/*/*; do
REMOVED=1
dev=`basename $device`
bus=`basename $(dirname $device)`
for uevent in /sys/class/usb_device/usbdev?.*/*/uevent; do
. $uevent
if [ $dev -eq $DEVNUM ] && [ $bus -eq $BUSNUM ]; then
REMOVED=0
break;
fi
done
if [ $REMOVED -eq 1 ]; then
rm /dev/bus/usb/$bus/$dev
if [ -z $(ls /dev/bus/usb/$bus/) ]; then
rmdir /dev/bus/usb/$bus/
fi
fi
done
;;
esac