Revert "util-linux: start init scripts on RUNLEVEL=boot"

This reverts commit afb6f13517d6d532a94d51e91ca9727cc58387a5.
This commit is contained in:
Stephan Raue 2011-09-12 19:26:05 +02:00
parent 9c3dc80354
commit 3bb5a505b4

View File

@ -23,36 +23,29 @@
# #
# runlevels: openelec, textmode # runlevels: openelec, textmode
case $RUNLEVEL in (
boot) INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
( SWAP=`blkid -t TYPE="swap" -o device`
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'` SWAPFILE="$HOME/.cache/swapfile"
SWAP=`blkid -t TYPE="swap" -o device`
SWAPFILE="$HOME/.cache/swapfile"
if [ "$INSTALLED_MEMORY" -le "500000" ]; then if [ "$INSTALLED_MEMORY" -le "500000" ]; then
if [ -z "$SWAP" -a ! -f "$SWAPFILE" ]; then if [ -z "$SWAP" -a ! -f "$SWAPFILE" ]; then
progress "creating swapfile" progress "creating swapfile"
mkdir -p $HOME/.cache mkdir -p $HOME/.cache
dd if=/dev/zero of=$SWAPFILE bs=1024 count=262144 2>&1 > /dev/null dd if=/dev/zero of=$SWAPFILE bs=1024 count=262144 2>&1 > /dev/null
mkswap $SWAPFILE 2>&1 > /dev/null mkswap $SWAPFILE 2>&1 > /dev/null
fi fi
progress "enable swap" progress "enable swap"
[ -z "$SWAP" -a -f "$SWAPFILE" ] && SWAP=$SWAPFILE [ -z "$SWAP" -a -f "$SWAPFILE" ] && SWAP=$SWAPFILE
for i in $SWAP; do for i in $SWAP; do
swapon -p 10000 $SWAP 2>&1 > /dev/null swapon -p 10000 $SWAP 2>&1 > /dev/null
done done
if [ "$INSTALLED_MEMORY" -le "260000" ]; then if [ "$INSTALLED_MEMORY" -le "260000" ]; then
sysctl -w vm.swappiness=100 2>&1 > /dev/null sysctl -w vm.swappiness=100 2>&1 > /dev/null
else else
sysctl -w vm.swappiness=60 2>&1 > /dev/null sysctl -w vm.swappiness=60 2>&1 > /dev/null
fi fi
fi fi
)& )&
;;
poweroff|reboot)
;;
esac