util-linux: add option to enable/disable swap per configfile, build RPi with swap support, but disable by default

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2014-01-04 00:08:43 +01:00
parent 841da507e2
commit c7036c38f4
8 changed files with 26 additions and 2 deletions

View File

@ -18,3 +18,4 @@
SWAPFILE="$HOME/.cache/swapfile" SWAPFILE="$HOME/.cache/swapfile"
SWAPFILESIZE="@SWAPFILESIZE@" SWAPFILESIZE="@SWAPFILESIZE@"
SWAP_ENABLED="@SWAP_ENABLED_DEFAULT@"

View File

@ -116,7 +116,10 @@ post_makeinstall_target() {
cp -PR $PKG_DIR/scripts/mount-swap $INSTALL/usr/lib/openelec cp -PR $PKG_DIR/scripts/mount-swap $INSTALL/usr/lib/openelec
mkdir -p $INSTALL/etc mkdir -p $INSTALL/etc
cat $PKG_DIR/config/swap.conf | sed -e "s,@SWAPFILESIZE@,$SWAPFILESIZE,g" > $INSTALL/etc/swap.conf cat $PKG_DIR/config/swap.conf | \
sed -e "s,@SWAPFILESIZE@,$SWAPFILESIZE,g" \
-e "s,@SWAP_ENABLED_DEFAULT@,$SWAP_ENABLED_DEFAULT,g" \
> $INSTALL/etc/swap.conf
fi fi
} }

View File

@ -29,6 +29,11 @@ if [ -e /dev/.storage_netboot ] ; then
exit 0 exit 0
fi fi
if [ ! "$SWAP_ENABLED" = yes ] ; then
logger -t Boot "### swap disabled via configfile ###"
exit 0
fi
SWAP=`blkid -t TYPE="swap" -o device` SWAP=`blkid -t TYPE="swap" -o device`
case $1 in case $1 in

View File

@ -312,6 +312,9 @@
# build with swap support (yes / no) # build with swap support (yes / no)
SWAP_SUPPORT="no" SWAP_SUPPORT="no"
# swap support enabled per default (yes / no)
SWAP_ENABLED_DEFAULT="no"
# swapfile size if SWAP_SUPPORT=yes in MB # swapfile size if SWAP_SUPPORT=yes in MB
SWAPFILESIZE="256" SWAPFILESIZE="256"

View File

@ -312,6 +312,9 @@
# build with swap support (yes / no) # build with swap support (yes / no)
SWAP_SUPPORT="yes" SWAP_SUPPORT="yes"
# swap support enabled per default (yes / no)
SWAP_ENABLED_DEFAULT="yes"
# swapfile size if SWAP_SUPPORT=yes in MB # swapfile size if SWAP_SUPPORT=yes in MB
SWAPFILESIZE="256" SWAPFILESIZE="256"

View File

@ -312,6 +312,9 @@
# build with swap support (yes / no) # build with swap support (yes / no)
SWAP_SUPPORT="no" SWAP_SUPPORT="no"
# swap support enabled per default (yes / no)
SWAP_ENABLED_DEFAULT="no"
# swapfile size if SWAP_SUPPORT=yes in MB # swapfile size if SWAP_SUPPORT=yes in MB
SWAPFILESIZE="256" SWAPFILESIZE="256"

View File

@ -311,7 +311,10 @@
SENSOR_SUPPORT="yes" SENSOR_SUPPORT="yes"
# build with swap support (yes / no) # build with swap support (yes / no)
SWAP_SUPPORT="no" SWAP_SUPPORT="yes"
# swap support enabled per default (yes / no)
SWAP_ENABLED_DEFAULT="no"
# swapfile size if SWAP_SUPPORT=yes in MB # swapfile size if SWAP_SUPPORT=yes in MB
SWAPFILESIZE="128" SWAPFILESIZE="128"

View File

@ -307,6 +307,9 @@
# build with swap support (yes / no) # build with swap support (yes / no)
SWAP_SUPPORT="no" SWAP_SUPPORT="no"
# swap support enabled per default (yes / no)
SWAP_ENABLED_DEFAULT="no"
# swapfile size if SWAP_SUPPORT=yes in MB # swapfile size if SWAP_SUPPORT=yes in MB
SWAPFILESIZE="256" SWAPFILESIZE="256"