summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDirk2014-06-17 15:12:54 +0200
committerDirk2014-06-17 15:12:54 +0200
commitb3cc45050922781cc7c9373f945a6b3145c485bf (patch)
treea6f2f6d963643c20f90daed776e2edc0a8eb0d29 /src
parentUpdating PXE stuff ... (diff)
downloadcore-b3cc45050922781cc7c9373f945a6b3145c485bf.tar.gz
core-b3cc45050922781cc7c9373f945a6b3145c485bf.tar.xz
core-b3cc45050922781cc7c9373f945a6b3145c485bf.zip
...
Diffstat (limited to 'src')
-rwxr-xr-xsrc/boot-env/syslinux/pxechn.c32bin0 -> 12644 bytes
-rw-r--r--src/initramfs/scripts/etc/activate-swap30
2 files changed, 30 insertions, 0 deletions
diff --git a/src/boot-env/syslinux/pxechn.c32 b/src/boot-env/syslinux/pxechn.c32
new file mode 100755
index 00000000..d29390a8
--- /dev/null
+++ b/src/boot-env/syslinux/pxechn.c32
Binary files differ
diff --git a/src/initramfs/scripts/etc/activate-swap b/src/initramfs/scripts/etc/activate-swap
new file mode 100644
index 00000000..10cb42e9
--- /dev/null
+++ b/src/initramfs/scripts/etc/activate-swap
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (c) 2013 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found under http://openslx.org
+#
+# Initialize swap for OpenSLX linux stateless clients, both for swap on local
+# disk partitions as well as compressed ramzswap or similar
+
+#############################################################################
+
+# depends on mount-disk.sh
+# depends on availability of the appropriate kernel module/functionality
+
+# try to enable compressed RAM SWAP / ZRAM
+if modprobe ${MODPRV} ramzswap 2>/dev/null && [ -f /usr/bin/rzscontrol ] ; then
+ rzscontrol /dev/ramzswap0 --init
+ swapon /dev/ramzswap0 2>/dev/null
+ #hdswap="# disk swap disabled because of enabled compressed ramswap"
+elif modprobe ${MODPRV} zram 2>/dev/null ; then
+ # assign a quarter of total mem to zram
+ echo $(( $(free -k | awk '/^Mem:/ { print $2 }') * 256 )) > /sys/block/zram0/disksize
+ mkswap /dev/zram0 2>/dev/null
+ swapon /dev/zram0 2>/dev/null
+fi