mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 21:26:49 +00:00
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:
parent
841da507e2
commit
c7036c38f4
@ -18,3 +18,4 @@
|
||||
|
||||
SWAPFILE="$HOME/.cache/swapfile"
|
||||
SWAPFILESIZE="@SWAPFILESIZE@"
|
||||
SWAP_ENABLED="@SWAP_ENABLED_DEFAULT@"
|
@ -116,7 +116,10 @@ post_makeinstall_target() {
|
||||
cp -PR $PKG_DIR/scripts/mount-swap $INSTALL/usr/lib/openelec
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,11 @@ if [ -e /dev/.storage_netboot ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! "$SWAP_ENABLED" = yes ] ; then
|
||||
logger -t Boot "### swap disabled via configfile ###"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SWAP=`blkid -t TYPE="swap" -o device`
|
||||
|
||||
case $1 in
|
||||
|
@ -312,6 +312,9 @@
|
||||
# build with swap support (yes / no)
|
||||
SWAP_SUPPORT="no"
|
||||
|
||||
# swap support enabled per default (yes / no)
|
||||
SWAP_ENABLED_DEFAULT="no"
|
||||
|
||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||
SWAPFILESIZE="256"
|
||||
|
||||
|
@ -312,6 +312,9 @@
|
||||
# build with swap support (yes / no)
|
||||
SWAP_SUPPORT="yes"
|
||||
|
||||
# swap support enabled per default (yes / no)
|
||||
SWAP_ENABLED_DEFAULT="yes"
|
||||
|
||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||
SWAPFILESIZE="256"
|
||||
|
||||
|
@ -312,6 +312,9 @@
|
||||
# build with swap support (yes / no)
|
||||
SWAP_SUPPORT="no"
|
||||
|
||||
# swap support enabled per default (yes / no)
|
||||
SWAP_ENABLED_DEFAULT="no"
|
||||
|
||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||
SWAPFILESIZE="256"
|
||||
|
||||
|
@ -311,7 +311,10 @@
|
||||
SENSOR_SUPPORT="yes"
|
||||
|
||||
# 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
|
||||
SWAPFILESIZE="128"
|
||||
|
@ -307,6 +307,9 @@
|
||||
# build with swap support (yes / no)
|
||||
SWAP_SUPPORT="no"
|
||||
|
||||
# swap support enabled per default (yes / no)
|
||||
SWAP_ENABLED_DEFAULT="no"
|
||||
|
||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||
SWAPFILESIZE="256"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user