busybox: start init scripts on RUNLEVEL=boot

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-09-07 23:13:37 +02:00
parent 0e5dfc0d71
commit 5a491d0429
8 changed files with 130 additions and 75 deletions

View File

@ -23,5 +23,11 @@
#
# runlevels: openelec, installer, textmode
progress "mounting needed filesystems"
mount -n -t ramfs none /var
case $RUNLEVEL in
boot)
progress "mounting needed filesystems"
mount -n -t ramfs none /var
;;
poweroff|reboot)
;;
esac

View File

@ -23,38 +23,47 @@
#
# runlevels: openelec, installer, textmode
progress "make variable directory structure"
mkdir -p /var/cache \
/var/lock \
/var/media \
/var/run \
/var/tmp \
/var/run/sepermit \
/var/run/lirc
case $RUNLEVEL in
boot)
progress "make variable directory structure"
mkdir -p /var/cache \
/var/lock \
/var/media \
/var/run \
/var/tmp \
/var/run/sepermit \
/var/run/lirc
chmod 1777 /var/run /var/tmp
chmod 1777 /var/run /var/tmp
touch /var/run/utmp
chmod 1777 /var/run/utmp
touch /var/run/utmp
chmod 1777 /var/run/utmp
if test "$DEBUG" = "yes"; then
mkdir -p $HOME/log
ln -sf $HOME/log /var/log
else
mkdir -p /var/log
fi
if test "$DEBUG" = "yes"; then
mkdir -p $HOME/log
ln -sf $HOME/log /var/log
else
mkdir -p /var/log
fi
touch /var/log/wtmp
chmod 1777 /var/log/wtmp
touch /var/log/wtmp
chmod 1777 /var/log/wtmp
# others:
mkdir -p /var/lib/polkit-1
chmod 700 /var/lib/polkit-1
mkdir -p /var/lib/polkit-1/localauthority/10-vendor.d
mkdir -p /var/lib/polkit-1/localauthority/20-org.d
mkdir -p /var/lib/polkit-1/localauthority/30-site.d
mkdir -p /var/lib/polkit-1/localauthority/50-local.d
mkdir -p /var/lib/polkit-1/localauthority/90-mandatory.d
mkdir -p /var/lib/udisks
mkdir -p /var/lib/upower
;;
poweroff|reboot)
;;
esac
# others:
mkdir -p /var/lib/polkit-1
chmod 700 /var/lib/polkit-1
mkdir -p /var/lib/polkit-1/localauthority/10-vendor.d
mkdir -p /var/lib/polkit-1/localauthority/20-org.d
mkdir -p /var/lib/polkit-1/localauthority/30-site.d
mkdir -p /var/lib/polkit-1/localauthority/50-local.d
mkdir -p /var/lib/polkit-1/localauthority/90-mandatory.d
mkdir -p /var/lib/udisks
mkdir -p /var/lib/upower

View File

@ -25,13 +25,18 @@
TTY="3"
if [ "$DEBUG" = "yes" ]; then
case $RUNLEVEL in
boot)
echo "###########################################"
echo "## it seems we are running in Debug mode ##"
echo "## starting debugging shell on console $TTY ##"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##"
echo "###########################################"
echo "###########################################"
echo "## it seems we are running in Debug mode ##"
echo "## starting debugging shell on console $TTY ##"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##"
echo "###########################################"
openvt -w -c $TTY /bin/sh &
openvt -w -c $TTY /bin/sh &
;;
poweroff|reboot)
;;
esac
fi

View File

@ -25,9 +25,16 @@
OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml"
if [ -f "$OPENELEC_SETTINGS" ]; then
progress "creating system settings"
case $RUNLEVEL in
boot)
if [ -f "$OPENELEC_SETTINGS" ]; then
progress "creating system settings"
mkdir -p /var/config
cat "$OPENELEC_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/settings.conf
fi
mkdir -p /var/config
cat "$OPENELEC_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/settings.conf
fi
;;
poweroff|reboot)
;;
esac

View File

@ -23,23 +23,30 @@
#
# runlevels: openelec, textmode
if [ -d /usr/config ]; then
progress "copy userconfig and samples"
case $RUNLEVEL in
boot)
if [ -d /usr/config ]; then
progress "copy userconfig and samples"
cd /usr/config
mkdir -p /storage/.config
cd /usr/config
mkdir -p /storage/.config
for dir in `find . -type d`; do
mkdir -p /storage/.config/$dir
done
for dir in `find . -type d`; do
mkdir -p /storage/.config/$dir
done
for config in `find . -type f -name "*.conf"`; do
if [ ! -f /storage/.config/$config ]; then
cp $config /storage/.config/$config
fi
done
for config in `find . -type f -name "*.conf"`; do
if [ ! -f /storage/.config/$config ]; then
cp $config /storage/.config/$config
fi
done
for sample in `find . -type f -name "*.sample"`; do
cp $sample /storage/.config/$sample
done
fi
for sample in `find . -type f -name "*.sample"`; do
cp $sample /storage/.config/$sample
done
fi
;;
poweroff|reboot)
;;
esac

View File

@ -23,10 +23,17 @@
#
# runlevels: openelec, installer, textmode
(
progress "Starting Syslog daemon"
syslogd
case $RUNLEVEL in
boot)
(
progress "Starting Syslog daemon"
syslogd
progress "Starting Kernellog daemon"
klogd
)&
progress "Starting Kernellog daemon"
klogd
)&
;;
poweroff|reboot)
;;
esac

View File

@ -23,5 +23,12 @@
#
# runlevels: openelec, installer, textmode
progress "Setup some CDROM settings"
sysctl -w dev.cdrom.lock=0 > /dev/null 2>&1 &
case $RUNLEVEL in
boot)
progress "Setup some CDROM settings"
sysctl -w dev.cdrom.lock=0 > /dev/null 2>&1 &
;;
poweroff|reboot)
;;
esac

View File

@ -24,12 +24,19 @@
TTY="1"
echo "###########################################"
echo "## it seems we are running in Text mode. ##"
echo "## .... starting shell on console $TTY .... ##"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##"
echo "###########################################"
case $RUNLEVEL in
boot)
echo "###########################################"
echo "## it seems we are running in Text mode. ##"
echo "## .... starting shell on console $TTY .... ##"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##"
echo "###########################################"
while true; do
openvt -w -c $TTY /bin/sh
done
while true; do
openvt -w -c $TTY /bin/sh
done
;;
poweroff|reboot)
;;
esac