Files
Arch-R/packages/sysutils/busybox/scripts/init
Stephan Raue c3146ef194 busybox:
- reorganisation of init scripts
- cleanup
- remove fbsplash
2009-11-06 14:59:42 +01:00

69 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
# mounting needed filesystems
/bin/mount -t devtmpfs none /dev
/bin/mount -t proc none /proc
/bin/mount -t sysfs none /sys
/bin/mount -t ramfs none /var
# read config
. /etc/sysconfig
# make variable directory structure
install -m 755 -d /var/log
install -m 755 -d /var/log/gdm
install -m 755 -d /var/lock
install -m 755 -d /var/media
install -m 1777 -d /var/run
install -m 1777 -d /var/tmp
# starting Xorg
start_xorg
# starting Splash
# start_splash &
# copying config into storage
mkdir -p $HOME/.config
for i in `ls /usr/config`; do
[ ! -f "$HOME/.config/$i" ] && \
cp -PR /usr/config/$i $HOME/.config
done
# setting hostname
echo localhost > /proc/sys/kernel/hostname
# starting debugging shell
# if test "$DEBUG" = yes; then
echo "### starting debugging shell on console 3 ###"
echo "### ...... switch with ctrl-alt-f3 ...... ###"
exec /bin/sh </dev/tty3 >/dev/tty3 2>&1 &
# fi
RUNLEVEL="openelec"
if test "$TEXTMODE" = yes; then
RUNLEVEL="text"
elif test "$CONFIGURE" = yes; then
RUNLEVEL="configure"
fi
count=0
for script in /sbin/init.d/*; do
grep -q -e "^# runlevels:.*$RUNLEVEL" $script && count=$(($count+1));
done
RET=0
for script in /sbin/init.d/*; do
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
/bin/sh $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
# exit $RET
echo "starting emergency shell"
exec /bin/sh </dev/tty3 >/dev/tty3 2>&1