diff --git a/packages/sysutils/util-linux/config/swap.conf b/packages/sysutils/util-linux/config/swap.conf index 123c83f505..1b052f6b0f 100644 --- a/packages/sysutils/util-linux/config/swap.conf +++ b/packages/sysutils/util-linux/config/swap.conf @@ -18,3 +18,4 @@ SWAPFILE="$HOME/.cache/swapfile" SWAPFILESIZE="@SWAPFILESIZE@" +SWAP_ENABLED="@SWAP_ENABLED_DEFAULT@" \ No newline at end of file diff --git a/packages/sysutils/util-linux/package.mk b/packages/sysutils/util-linux/package.mk index 0dfda8dea5..adbe9931ac 100644 --- a/packages/sysutils/util-linux/package.mk +++ b/packages/sysutils/util-linux/package.mk @@ -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 } diff --git a/packages/sysutils/util-linux/scripts/mount-swap b/packages/sysutils/util-linux/scripts/mount-swap index 03fde37410..6d9397c605 100755 --- a/packages/sysutils/util-linux/scripts/mount-swap +++ b/packages/sysutils/util-linux/scripts/mount-swap @@ -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 diff --git a/projects/ARCTIC_MC/options b/projects/ARCTIC_MC/options index 2361399d88..cb6b4cebea 100755 --- a/projects/ARCTIC_MC/options +++ b/projects/ARCTIC_MC/options @@ -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" diff --git a/projects/ATV/options b/projects/ATV/options index cb3d86e7ff..0800bd00c7 100755 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -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" diff --git a/projects/Generic/options b/projects/Generic/options index 2282fb5a5f..d31991fffc 100755 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -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" diff --git a/projects/RPi/options b/projects/RPi/options index 7d8dd8f251..44e840d984 100755 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -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" diff --git a/projects/Virtual/options b/projects/Virtual/options index f56fb18777..78ca83041b 100755 --- a/projects/Virtual/options +++ b/projects/Virtual/options @@ -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"