Files
Arch-R/packages/sysutils/busybox/scripts/init

69 lines
1.5 KiB
Plaintext
Raw Normal View History

2009-03-18 13:02:53 +01:00
#!/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
2009-03-18 13:02:53 +01:00
# 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
2009-10-27 03:47:34 +01:00
# starting Xorg
start_xorg
2009-03-18 13:02:53 +01:00
# 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
2009-03-18 21:16:49 +01:00
done
2009-03-18 13:02:53 +01:00
# setting hostname
echo localhost > /proc/sys/kernel/hostname
# starting debugging shell
2009-10-27 03:47:34 +01:00
# 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 &
2009-10-27 03:47:34 +01:00
# fi
2009-03-18 21:16:49 +01:00
RUNLEVEL="openelec"
if test "$TEXTMODE" = yes; then
RUNLEVEL="text"
2009-03-18 21:16:49 +01:00
elif test "$CONFIGURE" = yes; then
RUNLEVEL="configure"
fi
2009-03-18 13:02:53 +01:00
count=0
for script in /sbin/init.d/*; do
2009-03-18 21:16:49 +01:00
grep -q -e "^# runlevels:.*$RUNLEVEL" $script && count=$(($count+1));
2009-03-18 13:02:53 +01:00
done
RET=0
for script in /sbin/init.d/*; do
2009-03-18 21:16:49 +01:00
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
2009-03-18 13:02:53 +01:00
/bin/sh $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
# exit $RET
2009-03-18 13:02:53 +01:00
echo "starting emergency shell"
exec /bin/sh </dev/tty3 >/dev/tty3 2>&1