diff options
author | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2006-10-24 12:26:42 +0000 |
---|---|---|
committer | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2006-10-24 12:26:42 +0000 |
commit | c8b95b81b69af4a0f90340f5874dcfe6ff057a9d (patch) | |
tree | 94bc4f11d8c3466b02d5aee235ff15c4fed3c50f /init.d/rcS | |
download | alpine-baselayout-c8b95b81b69af4a0f90340f5874dcfe6ff057a9d.tar.bz2 alpine-baselayout-c8b95b81b69af4a0f90340f5874dcfe6ff057a9d.tar.xz |
initial import based on 1.0.1
Diffstat (limited to 'init.d/rcS')
-rwxr-xr-x | init.d/rcS | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/init.d/rcS b/init.d/rcS new file mode 100755 index 0000000..017d105 --- /dev/null +++ b/init.d/rcS @@ -0,0 +1,59 @@ +#!/bin/busybox sh + +# we need the proc to be able to install busybox +/bin/busybox mkdir -p /proc /usr/sbin /sys +/bin/busybox mount -t proc proc /proc +/bin/busybox mount -t sysfs none /sys + +# install busybox links +/bin/busybox --install -s + +[ -f /etc/alpine-release ] && read RELEASE BUILD < /etc/alpine-release +echo "Starting $RELEASE" + +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin + +# use dash if it exists +[ -x /bin/dash ] && ln -sf /bin/dash /bin/sh + +# define some default variables +export DEFAULT_CFG_MOUNTS="/media/cdrom /media/floppy /media/usb" +export DEFAULT_ALPINE_CONF="/alpine.conf" +export DEFAULT_ALPINE_PACKAGES="/packages.conf" +export DEFAULT_PKG_PATH="cdrom://apks" + +# start an rc script. Look if there are a no<service> in /proc/cmdline +start_script() { + local n + if [ -f $1 ] ; then + for n in `cat /proc/cmdline`; do + [ "$n" = "s" ] && SINGLEMODE=yes + case $1 in + S??no$n) return 1;; + esac + done + case $1 in + *.sh) . $1 start;; + *) $1 start;; + esac + fi +} + +# hide kernel messages +dmesg -n 1 + +for i in `cat /proc/cmdline` ;do + case $i in + 1|s|single) + echo "Entering single mode. Type 'exit' to continue booting." + sh + ;; + esac +done + +# Run all /etc/rcS.d scripts +for j in /etc/rcS.d/S* ; do + start_script $j +done +exit 0 + |