Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv into openelec-next

Conflicts:
	packages/initramfs/sysutils/busybox-initramfs/scripts/init
This commit is contained in:
Stephan Raue 2011-09-12 19:55:36 +02:00
commit 6f92ac534d
37 changed files with 555 additions and 846 deletions

View File

@ -172,8 +172,15 @@ NFS_OVERLAY="192.168.1.1:/var/lib/overlay"
[ ! -e /sysroot/sbin/init ] && /bin/busybox usleep 1000000
<<<<<<< HEAD
[ ${retry_nr} -gt 0 ]
done
=======
if [ -n "$disk" ]; then
mount_part "$disk" "/storage" "rw,noatime"
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL"
update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM"
>>>>>>> 32562d4fa964979f0879f096451a8bbc20b9f7d9
if [ ! -e /sysroot/sbin/init ]; then
error "INIT_2" "Could not mount NBD root from $NBD_ROOT_SERVER port $NBD_ROOT_PORT"
@ -236,6 +243,16 @@ NFS_OVERLAY="192.168.1.1:/var/lib/overlay"
mount_nbd
fi
<<<<<<< HEAD
=======
# move /flash and /storage to /sysroot
/bin/busybox mount --move /flash /sysroot/flash
if [ -n "$disk" ]; then
/bin/busybox mount --move /storage /sysroot/storage
fi
>>>>>>> 32562d4fa964979f0879f096451a8bbc20b9f7d9
# unmount all other filesystems
/bin/busybox umount /dev
/bin/busybox umount /proc

View File

@ -23,12 +23,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
progress "set cpu's to full power"
cpupower frequency-set -g performance > /dev/null 2>&1
;;
poweroff|reboot)
;;
esac
cpupower frequency-set -g performance > /dev/null 2>&1

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
progress "loading kernel modules"
@ -33,9 +31,5 @@ case $RUNLEVEL in
for module in `cat /etc/modules|grep "^[^#]"`; do
eval "modprobe $module" >/dev/null 2>&1
done
)&
;;
poweroff|reboot)
;;
esac
)&

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec
case $RUNLEVEL in
boot)
progress "setup XBMC"
#
@ -133,8 +131,3 @@ EOF
fi
echo "</settings>" >> $HOME/.xbmc/userdata/guisettings.xml
fi
;;
poweroff|reboot)
;;
esac

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec
case $RUNLEVEL in
boot)
LIRCDEV="/var/run/lirc/lircd"
[ -e /var/run/lirc/lircd.irtrans ] && LIRCDEV="/var/run/lirc/lircd.irtrans"
XBMC_ARGS="--standalone -fs --lircdev $LIRCDEV"
@ -68,13 +66,13 @@ case $RUNLEVEL in
case "$RET" in
0)
RUNLEVEL="poweroff"
poweroff -f
;;
64)
RUNLEVEL="poweroff"
poweroff -f
;;
66)
RUNLEVEL="reboot"
reboot
;;
255)
echo "Abnormal Exit. Exited with code $RET"
@ -87,8 +85,3 @@ case $RUNLEVEL in
usleep 250000
done
;;
poweroff|reboot)
;;
esac

View File

@ -22,19 +22,11 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
wait_for_network
progress "Starting Avahi Daemon"
mkdir -p /var/run/avahi-daemon
avahi-daemon -D
)&
;;
poweroff|reboot)
progress "Starting Avahi Daemon"
killall avahi-daemon
;;
esac

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
@ -196,8 +194,3 @@ case $RUNLEVEL in
usleep 250000
done
)&
;;
poweroff|reboot)
;;
esac

View File

@ -22,16 +22,9 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
wait_for_network
progress "mounting Network shares"
netmount > /dev/null 2>&1
)&
;;
poweroff|reboot)
;;
esac

View File

@ -22,6 +22,7 @@
#
# runlevels: openelec, textmode
(
RSA1_KEY="/storage/.cache/ssh/ssh_host_key"
RSA2_KEY="/storage/.cache/ssh/ssh_host_rsa_key"
DSA2_KEY="/storage/.cache/ssh/ssh_host_dsa_key"
@ -29,9 +30,6 @@
KEYGEN="/usr/bin/ssh-keygen"
SSHD="/usr/sbin/sshd"
case $RUNLEVEL in
boot)
(
# Check for the SSH1 RSA key
if [ ! -f $RSA1_KEY ] ; then
progress "SSH: generating SSH1 RSA key"
@ -74,11 +72,5 @@ case $RUNLEVEL in
mkdir -p /var/empty
chmod -R 600 /var/empty
$SSHD
)&
;;
poweroff|reboot)
progress "Stopping SSH Server"
killall sshd
;;
esac
)&

View File

@ -22,11 +22,6 @@
#
# runlevels: openelec, textmode
SMB_USERCONF="/storage/.config/samba.conf"
SMB_DEFCONF="/etc/samba/smb.conf"
case $RUNLEVEL in
boot)
(
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
@ -37,6 +32,9 @@ case $RUNLEVEL in
progress "Starting Samba server"
SMB_USERCONF="/storage/.config/samba.conf"
SMB_DEFCONF="/etc/samba/smb.conf"
if [ -f $SMB_USERCONF ]; then
SMB_ARG="--configfile=$SMB_USERCONF"
else
@ -49,11 +47,3 @@ case $RUNLEVEL in
fi
fi
)&
;;
poweroff|reboot)
progress "Stopping Samba server"
killall nmbd
killall smbd
;;
esac

View File

@ -22,14 +22,8 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
progress "starting ConsoleKit daemon"
install -m 755 -d /var/log/ConsoleKit
install -m 755 -d /var/run/ConsoleKit
;;
poweroff|reboot)
;;
esac

View File

@ -20,20 +20,4 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
progress "Reboot the syste"
RET=0
RUNLEVEL="reboot"
for script in `ls -r1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
sync
reboot

View File

@ -20,20 +20,4 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
progress "Poweroff the system"
RET=0
RUNLEVEL="poweroff"
for script in `ls -r1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
sync
poweroff -f
poweroff

View File

@ -23,31 +23,5 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
progress "mounting needed filesystems"
mount -n -t devtmpfs none /dev
mkdir -p /dev/pts
mount -n -t devpts -o gid=5,mode=620 none /dev/pts
mkdir -p /dev/shm
mount -n -t tmpfs none /dev/shm
mount -n -t tmpfs none /run
mount -n -t ramfs none /var
mount "$disk" /storage -o rw,noatime > /dev/null 2>&1
;;
poweroff|reboot)
progress "unmounting filesystems"
for i in 1 2 3 4 5 6 7 8 9 10; do
echo "umount /storage"
ERR_ENV=1
umount /storage
[ "$?" -eq "0" ] && ERR_ENV=0 && break
usleep 1000000
done
if [ "$ERR_ENV" -ne "0" ]; then
mount -o remount,ro /storage
umount -l /storage
fi
;;
esac

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
progress "make variable directory structure"
mkdir -p /var/cache \
/var/lock \
@ -60,10 +58,3 @@ case $RUNLEVEL in
mkdir -p /var/lib/udisks
mkdir -p /var/lib/upower
;;
poweroff|reboot)
;;
esac

View File

@ -25,8 +25,7 @@
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 ##"
@ -34,9 +33,5 @@ if [ "$DEBUG" = "yes" ]; then
echo "###########################################"
openvt -w -c $TTY /bin/sh &
;;
poweroff|reboot)
;;
esac
fi

View File

@ -25,16 +25,9 @@
OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml"
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
;;
poweroff|reboot)
;;
esac

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
if [ -d /usr/config ]; then
progress "copy userconfig and samples"
@ -45,8 +43,3 @@ case $RUNLEVEL in
cp $sample /storage/.config/$sample
done
fi
;;
poweroff|reboot)
;;
esac

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
(
progress "Starting Syslog daemon"
syslogd
@ -32,13 +30,3 @@ case $RUNLEVEL in
progress "Starting Kernellog daemon"
klogd
)&
;;
poweroff|reboot)
progress "Stopping Kernellog daemon"
killall klogd
progress "Stopping Syslog daemon"
killall syslogd
;;
esac

View File

@ -23,12 +23,5 @@
#
# runlevels: openelec, installer, textmode
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,8 +24,6 @@
TTY="1"
case $RUNLEVEL in
boot)
echo "###########################################"
echo "## it seems we are running in Text mode. ##"
echo "## .... starting shell on console $TTY .... ##"
@ -35,8 +33,3 @@ case $RUNLEVEL in
while true; do
openvt -w -c $TTY /bin/sh
done
;;
poweroff|reboot)
;;
esac

View File

@ -24,14 +24,14 @@
################################################################################
# getting runlevel
MODE="openelec"
RUNLEVEL="openelec"
if test "$TEXTMODE" = yes; then
MODE="textmode"
RUNLEVEL="textmode"
fi
if test "$INSTALLER" = yes; then
MODE="installer"
RUNLEVEL="installer"
fi
export MODE
export RUNLEVEL

View File

@ -26,6 +26,16 @@
echo 0 > /sys/devices/virtual/graphics/fbcon/cursor_blink
mount -n -t devtmpfs none /dev
mkdir -p /dev/pts
mount -n -t devpts -o gid=5,mode=620 none /dev/pts
mkdir -p /dev/shm
mount -n -t tmpfs none /dev/shm
mount -n -t tmpfs none /run
# showing version
lsb_release
@ -36,10 +46,8 @@
progress "Starting Init Scripts"
RET=0
RUNLEVEL="boot"
for script in `ls -1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
for script in /etc/init.d/*; do
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
progress "Starting D-BUS"
@ -32,10 +30,3 @@ case $RUNLEVEL in
dbus-uuidgen --ensure
dbus-daemon --system
)&
;;
poweroff|reboot)
progress "Stopping D-BUS"
killall dbus-daemon
;;
esac

View File

@ -23,14 +23,5 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
progress "Starting Fuse"
mount -t fusectl fusectl /sys/fs/fuse/connections >/dev/null 2>&1
;;
poweroff|reboot)
progress "Stopping Fuse"
umount /sys/fs/fuse/connections
;;
esac

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
@ -49,10 +47,3 @@ case $RUNLEVEL in
fi
fi
)&
;;
poweroff|reboot)
progress "Stopping LCD daemon"
killall LCDd
;;
esac

View File

@ -22,17 +22,8 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
progress "starting ATVclient"
mkdir -p /storage/.cache
atvclient -m > /dev/null 2>&1
)&
;;
poweroff|reboot)
progress "stopping ATVclient"
killall atvclient
;;
esac

View File

@ -22,17 +22,8 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
progress "starting eventlircd"
mkdir -p /var/run/lirc
eventlircd --evmap=/etc/eventlircd.d --socket=/var/run/lirc/lircd --release=_UP
)&
;;
poweroff|reboot)
progress "starting eventlircd"
killall eventlircd
;;
esac

View File

@ -25,8 +25,6 @@
[ -f /storage/.config/remote.conf ] && . /storage/.config/remote.conf
[ -f /storage/.config/lcd.conf ] && . /storage/.config/lcd.conf
case $RUNLEVEL in
boot)
if [ "$REMOTE_BACKEND" = "irtrans" -o "$LCD_DRIVER" = "irtrans" ]; then
progress "Starting IRtrans daemon"
@ -40,10 +38,3 @@ case $RUNLEVEL in
$IRSERVER_ARG -daemon /dev/irtrans0 > /dev/null 2>&1
fi
;;
poweroff|reboot)
progress "Stopping IRtrans daemon"
killall irserver
;;
esac

View File

@ -23,16 +23,7 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
progress "starting udev daemon"
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
mkdir -p /dev/rules.d
udevd --daemon
;;
poweroff|reboot)
progress "stopping udev daemon"
killall udevd
;;
esac

View File

@ -23,14 +23,7 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
(
progress "monitoring udev events"
udevadm monitor -e > /dev/udev.log &
;;
poweroff|reboot)
progress "Stopping udev monitor"
killall udevadm
;;
esac
udevadm monitor -e > /dev/udev.log
)&

View File

@ -23,15 +23,8 @@
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
(
progress "request udev events from the kernel"
udevadm trigger --action=add
udevadm settle
)&
;;
poweroff|reboot)
;;
esac

View File

@ -23,8 +23,6 @@
#
# runlevels: openelec, textmode
case $RUNLEVEL in
boot)
(
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
SWAP=`blkid -t TYPE="swap" -o device`
@ -51,8 +49,3 @@ case $RUNLEVEL in
fi
fi
)&
;;
poweroff|reboot)
;;
esac

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec
case $RUNLEVEL in
boot)
(
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
@ -45,8 +43,3 @@ case $RUNLEVEL in
fi
fi
)&
;;
poweroff|reboot)
;;
esac

View File

@ -22,8 +22,6 @@
#
# runlevels: openelec
case $RUNLEVEL in
boot)
(
progress "starting Windowmanager"
@ -33,8 +31,3 @@ case $RUNLEVEL in
# starting ratpoison
DISPLAY=:0.0 ratpoison > /dev/null 2>&1
)&
;;
poweroff|reboot)
;;
esac

View File

@ -1,34 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
#
# mounting needed filesystems
#
# runlevels: openelec, installer, textmode
case $RUNLEVEL in
boot)
# dont do anything here, we start xorg per udev
;;
poweroff|reboot)
progress "stopping Xorg"
killall Xorg
;;
esac

View File

@ -22,7 +22,7 @@
. /etc/profile
if [ "$MODE" = openelec ]; then
if [ "$RUNLEVEL" = openelec ]; then
logger -t Xorg "### starting Xorg with driver ${xorg_driver} ###"