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 # runlevels: openelec, installer, textmode
progress "mounting needed filesystems" case $RUNLEVEL in
mount -n -t ramfs none /var boot)
progress "mounting needed filesystems"
mount -n -t ramfs none /var
;;
poweroff|reboot)
;;
esac

View File

@ -23,38 +23,47 @@
# #
# runlevels: openelec, installer, textmode # runlevels: openelec, installer, textmode
progress "make variable directory structure" case $RUNLEVEL in
mkdir -p /var/cache \ boot)
/var/lock \ progress "make variable directory structure"
/var/media \ mkdir -p /var/cache \
/var/run \ /var/lock \
/var/tmp \ /var/media \
/var/run/sepermit \ /var/run \
/var/run/lirc /var/tmp \
/var/run/sepermit \
/var/run/lirc
chmod 1777 /var/run /var/tmp chmod 1777 /var/run /var/tmp
touch /var/run/utmp touch /var/run/utmp
chmod 1777 /var/run/utmp chmod 1777 /var/run/utmp
if test "$DEBUG" = "yes"; then if test "$DEBUG" = "yes"; then
mkdir -p $HOME/log mkdir -p $HOME/log
ln -sf $HOME/log /var/log ln -sf $HOME/log /var/log
else else
mkdir -p /var/log mkdir -p /var/log
fi fi
touch /var/log/wtmp touch /var/log/wtmp
chmod 1777 /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" TTY="3"
if [ "$DEBUG" = "yes" ]; then 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 "###########################################" openvt -w -c $TTY /bin/sh &
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 &
poweroff|reboot)
;;
esac
fi fi

View File

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

View File

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

View File

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

View File

@ -23,5 +23,12 @@
# #
# runlevels: openelec, installer, textmode # runlevels: openelec, installer, textmode
progress "Setup some CDROM settings" case $RUNLEVEL in
sysctl -w dev.cdrom.lock=0 > /dev/null 2>&1 & 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" TTY="1"
echo "###########################################" case $RUNLEVEL in
echo "## it seems we are running in Text mode. ##" boot)
echo "## .... starting shell on console $TTY .... ##" echo "###########################################"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##" echo "## it seems we are running in Text mode. ##"
echo "###########################################" echo "## .... starting shell on console $TTY .... ##"
echo "## ...... switch with ctrl-alt-f$TTY ...... ##"
echo "###########################################"
while true; do while true; do
openvt -w -c $TTY /bin/sh openvt -w -c $TTY /bin/sh
done done
;;
poweroff|reboot)
;;
esac