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 0000000..f0e6b15
--- /dev/null
+++ b/meta/recipes-core/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/meta/recipes-core/busybox/files/busybox-httpd b/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 0000000..c8348e5
--- /dev/null
+++ b/meta/recipes-core/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/meta/recipes-core/busybox/files/busybox-udhcpd b/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 0000000..c43903e
--- /dev/null
+++ b/meta/recipes-core/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/meta/recipes-core/busybox/files/default.script b/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 0000000..f2ac987
--- /dev/null
+++ b/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec run-parts -a "$1" /etc/udhcpc.d
+
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 0000000..1582ea8
--- /dev/null
+++ b/meta/recipes-core/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/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 0000000..2e50425
--- /dev/null
+++ b/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hwclock
+# Required-Start:
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Set system clock
+# Description: Set system clock to hardware clock, according to the UTC
+# setting in /etc/default/rcS (see also rcS(5)).
+### END INIT INFO
+#
+# 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
+
+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 --hctosys
+ else
+ TZ="$TZ" hwclock --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 --systohc
+ fi
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Hardware Clock updated to `date`."
+ fi
+ exit 0
+ ;;
+ show)
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock --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/meta/recipes-core/busybox/files/mount.busybox b/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 0000000..fef945b
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /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 0000000..5cc21b9
--- /dev/null
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -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
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 0000000..9edaa15
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,74 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+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/meta/recipes-core/busybox/files/syslog.conf b/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 0000000..d4a0e02
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1,9 @@
+DESTINATION="buffer" # log destinations (buffer file remote)
+MARKINT=20 # intervall between --mark-- entries
+LOGFILE=/var/log/messages # where to log (file)
+REMOTE=loghost:514 # where to log (syslog remote)
+REDUCE=no # reduce-size logging
+#ROTATESIZE=0 # rotate log if grown beyond X [kByte] (incompatible with busybox)
+#ROTATEGENS=3 # keep X generations of rotated logs (incompatible with busybox)
+BUFFERSIZE=64 # size of circular buffer [kByte]
+FOREGROUND=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 0000000..f373162
--- /dev/null
+++ b/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@
OpenPOWER on IntegriCloud