summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/busybox/files')
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-cron39
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-httpd44
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-udhcpd43
-rw-r--r--meta/recipes-core/busybox/files/default.script4
-rw-r--r--meta/recipes-core/busybox/files/find-touchscreen.sh9
-rw-r--r--meta/recipes-core/busybox/files/hwclock.sh82
-rwxr-xr-xmeta/recipes-core/busybox/files/mount.busybox3
-rw-r--r--meta/recipes-core/busybox/files/simple.script72
-rw-r--r--meta/recipes-core/busybox/files/syslog74
-rw-r--r--meta/recipes-core/busybox/files/syslog.conf9
-rwxr-xr-xmeta/recipes-core/busybox/files/umount.busybox3
11 files changed, 382 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/files/busybox-cron b/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 0000000000..f0e6b15629
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
1#!/bin/sh
2DAEMON=/usr/sbin/crond
3NAME=crond
4DESC="Busybox Periodic Command Scheduler"
5ARGS="-c /etc/cron/crontabs"
6
7test -f $DAEMON || exit 0
8
9set -e
10
11case "$1" in
12 start)
13 echo -n "starting $DESC: $NAME... "
14 start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
15 echo "done."
16 ;;
17 stop)
18 echo -n "stopping $DESC: $NAME... "
19 start-stop-daemon -K -n $NAME
20 echo "done."
21 ;;
22 restart)
23 echo -n "restarting $DESC: $NAME... "
24 $0 stop
25 $0 start
26 echo "done."
27 ;;
28 reload)
29 echo -n "reloading $DESC: $NAME... "
30 killall -HUP $(basename ${DAEMON})
31 echo "done."
32 ;;
33 *)
34 echo "Usage: $0 {start|stop|restart|reload}"
35 exit 1
36 ;;
37esac
38
39exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-httpd b/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 0000000000..c8348e54a7
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
1#!/bin/sh
2DAEMON=/usr/sbin/httpd
3NAME=httpd
4DESC="Busybox HTTP Daemon"
5HTTPROOT="/srv/www"
6ARGS="-h $HTTPROOT"
7
8test -f $DAEMON || exit 0
9
10set -e
11
12case "$1" in
13 start)
14 echo -n "starting $DESC: $NAME... "
15 if [ ! -d $HTTPROOT ]; then
16 echo "$HTTPROOT is missing."
17 exit 1
18 fi
19 start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
20 echo "done."
21 ;;
22 stop)
23 echo -n "stopping $DESC: $NAME... "
24 start-stop-daemon -K -n $NAME
25 echo "done."
26 ;;
27 restart)
28 echo "restarting $DESC: $NAME... "
29 $0 stop
30 $0 start
31 echo "done."
32 ;;
33 reload)
34 echo -n "reloading $DESC: $NAME... "
35 killall -HUP $(basename ${DAEMON})
36 echo "done."
37 ;;
38 *)
39 echo "Usage: $0 {start|stop|restart|reload}"
40 exit 1
41 ;;
42esac
43
44exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-udhcpd b/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 0000000000..c43903e8dc
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
1#!/bin/sh
2DAEMON=/usr/sbin/udhcpd
3NAME=udhcpd
4DESC="Busybox UDHCP Server"
5ARGS="/etc/udhcpd.conf"
6
7test -f $DAEMON || exit 1
8
9set -e
10
11case "$1" in
12 start)
13 echo -n "starting $DESC: $NAME... "
14 if [ ! -f /etc/udhcpd.conf ]; then
15 echo "error: /etc/udhcpd.conf is missing."
16 exit 1
17 fi
18 /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
19 echo "done."
20 ;;
21 stop)
22 echo -n "stopping $DESC: $NAME... "
23 /sbin/start-stop-daemon -K -n $NAME
24 echo "done."
25 ;;
26 restart)
27 echo "restarting $DESC: $NAME... "
28 $0 stop
29 $0 start
30 echo "done."
31 ;;
32 reload)
33 echo -n "reloading $DESC: $NAME... "
34 killall -HUP $(basename ${DAEMON})
35 echo "done."
36 ;;
37 *)
38 echo "Usage: $0 {start|stop|restart|reload}"
39 exit 1
40 ;;
41esac
42
43exit 0
diff --git a/meta/recipes-core/busybox/files/default.script b/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 0000000000..f2ac987a27
--- /dev/null
+++ b/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3exec run-parts -a "$1" /etc/udhcpc.d
4
diff --git a/meta/recipes-core/busybox/files/find-touchscreen.sh b/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 0000000000..1582ea891c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/find-touchscreen.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
4 ln -sf /dev/input/$MDEV /dev/input/touchscreen0
5fi
6
7if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
8 ln -sf /dev/input/$MDEV /dev/input/touchscreen0
9fi
diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 0000000000..2e50425ba8
--- /dev/null
+++ b/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,82 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: hwclock
4# Required-Start:
5# Required-Stop: $local_fs
6# Default-Start: S
7# Default-Stop: 0 6
8# Short-Description: Set system clock
9# Description: Set system clock to hardware clock, according to the UTC
10# setting in /etc/default/rcS (see also rcS(5)).
11### END INIT INFO
12#
13# WARNING: If your hardware clock is not in UTC/GMT, this script
14# must know the local time zone. This information is
15# stored in /etc/localtime. This might be a problem if
16# your /etc/localtime is a symlink to something in
17# /usr/share/zoneinfo AND /usr isn't in the root
18# partition! The workaround is to define TZ either
19# in /etc/default/rcS, or in the proper place below.
20
21[ ! -x /sbin/hwclock ] && exit 0
22
23. /etc/default/rcS
24
25case "$1" in
26 start)
27 if [ "$VERBOSE" != no ]
28 then
29 echo "System time was `date`."
30 echo "Setting the System Clock using the Hardware Clock as reference..."
31 fi
32
33 if [ "$HWCLOCKACCESS" != no ]
34 then
35 if [ -z "$TZ" ]
36 then
37 hwclock --hctosys
38 else
39 TZ="$TZ" hwclock --hctosys
40 fi
41 fi
42
43 if [ "$VERBOSE" != no ]
44 then
45 echo "System Clock set. System local time is now `date`."
46 fi
47 ;;
48 stop|restart|reload|force-reload)
49 #
50 # Updates the Hardware Clock with the System Clock time.
51 # This will *override* any changes made to the Hardware Clock.
52 #
53 # WARNING: If you disable this, any changes to the system
54 # clock will not be carried across reboots.
55 #
56 if [ "$VERBOSE" != no ]
57 then
58 echo "Saving the System Clock time to the Hardware Clock..."
59 fi
60 if [ "$HWCLOCKACCESS" != no ]
61 then
62 hwclock --systohc
63 fi
64 if [ "$VERBOSE" != no ]
65 then
66 echo "Hardware Clock updated to `date`."
67 fi
68 exit 0
69 ;;
70 show)
71 if [ "$HWCLOCKACCESS" != no ]
72 then
73 hwclock --show
74 fi
75 ;;
76 *)
77 echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
78 echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
79 echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
80 exit 1
81 ;;
82esac
diff --git a/meta/recipes-core/busybox/files/mount.busybox b/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 0000000000..fef945b7b2
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3exec /bin/busybox mount $@
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 0000000000..5cc21b9de2
--- /dev/null
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,72 @@
1#!/bin/sh
2
3# udhcpc script edited by Tim Riker <Tim@Rikers.org>
4
5[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
6
7RESOLV_CONF="/etc/resolv.conf"
8[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
9[ -n "$subnet" ] && NETMASK="netmask $subnet"
10
11# return 0 if root is mounted on a network filesystem
12root_is_nfs() {
13 grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
14}
15
16have_bin_ip=0
17if [ -x /bin/ip ]; then
18 have_bin_ip=1
19fi
20
21case "$1" in
22 deconfig)
23 if ! root_is_nfs ; then
24 if [ $have_bin_ip -eq 1 ]; then
25 ip addr flush dev $interface
26 ip link set dev $interface up
27 else
28 /sbin/ifconfig $interface 0.0.0.0
29 fi
30 fi
31 ;;
32
33 renew|bound)
34 if [ $have_bin_ip -eq 1 ]; then
35 ip addr add dev $interface local $ip/$mask $BROADCAST
36 else
37 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
38 fi
39
40 if [ -n "$router" ] ; then
41 if ! root_is_nfs ; then
42 if [ $have_bin_ip -eq 1 ]; then
43 while ip route del default 2>/dev/null ; do
44 :
45 done
46 else
47 while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
48 :
49 done
50 fi
51 fi
52
53 metric=0
54 for i in $router ; do
55 if [ $have_bin_ip -eq 1 ]; then
56 ip route add default via $i metric $((metric++))
57 else
58 route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
59 fi
60 done
61 fi
62
63 echo -n > $RESOLV_CONF
64 [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
65 for i in $dns ; do
66 echo adding dns $i
67 echo nameserver $i >> $RESOLV_CONF
68 done
69 ;;
70esac
71
72exit 0
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 0000000000..9edaa15053
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,74 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: sysklogd
4# Required-Start: $remote_fs $time
5# Required-Stop: $remote_fs $time
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: System logger
9### END INIT INFO
10
11set -e
12
13if [ -f /etc/syslog.conf ]; then
14 . /etc/syslog.conf
15 LOG_LOCAL=0
16 LOG_REMOTE=0
17 for D in $DESTINATION; do
18 if [ "$D" = "buffer" ]; then
19 SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
20 LOG_LOCAL=1
21 elif [ "$D" = "file" ]; then
22 if [ -n "$LOGFILE" ]; then
23 SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
24 fi
25 if [ -n "$ROTATESIZE" ]; then
26 SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
27 fi
28 if [ -n "$ROTATEGENS" ]; then
29 SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
30 fi
31 LOCAL=0
32 elif [ "$D" = "remote" ]; then
33 SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
34 LOG_REMOTE=1
35 fi
36 done
37 if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
38 SYSLOG_ARGS="$SYSLOG_ARGS -L"
39 fi
40 if [ -n "$MARKINT" ]; then
41 SYSLOG_ARGS="$SYSLOG_ARGS -m $MARKINT"
42 fi
43 if [ "$REDUCE" = "yes" ]; then
44 SYSLOG_ARGS="$SYSLOG_ARGS -S"
45 fi
46else
47 # default: log to 16K shm circular buffer
48 SYSLOG_ARGS="-C"
49fi
50
51case "$1" in
52 start)
53 echo -n "Starting syslogd/klogd: "
54 start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
55 start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
56 echo "done"
57 ;;
58 stop)
59 echo -n "Stopping syslogd/klogd: "
60 start-stop-daemon -K -n syslogd
61 start-stop-daemon -K -n klogd
62 echo "done"
63 ;;
64 restart)
65 $0 stop
66 $0 start
67 ;;
68 *)
69 echo "Usage: syslog { start | stop | restart }" >&2
70 exit 1
71 ;;
72esac
73
74exit 0
diff --git a/meta/recipes-core/busybox/files/syslog.conf b/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 0000000000..d4a0e02f5b
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1,9 @@
1DESTINATION="buffer" # log destinations (buffer file remote)
2MARKINT=20 # intervall between --mark-- entries
3LOGFILE=/var/log/messages # where to log (file)
4REMOTE=loghost:514 # where to log (syslog remote)
5REDUCE=no # reduce-size logging
6#ROTATESIZE=0 # rotate log if grown beyond X [kByte] (incompatible with busybox)
7#ROTATEGENS=3 # keep X generations of rotated logs (incompatible with busybox)
8BUFFERSIZE=64 # size of circular buffer [kByte]
9FOREGROUND=no # run in foreground (don't use!)
diff --git a/meta/recipes-core/busybox/files/umount.busybox b/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 0000000000..f3731626e6
--- /dev/null
+++ b/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3exec /bin/busybox umount $@