AC100

Attachment 'zramswap.conf'

Download

description "Initializes zram swaping"

start on runlevel [2345]
stop on runlevel [!2345]

pre-start script

# load dependency modules
modprobe zram num_devices=2

# Calculate memory to use for zram (1/2 of ram)
totalmem=`free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/  *.*//'`
mem=$(( (totalmem / 4) * 1024 ))

# initialize the devices
echo $mem > /sys/block/zram0/disksize
echo $mem > /sys/block/zram1/disksize

# Creating swap filesystems
mkswap /dev/zram0
mkswap /dev/zram1

# Switch the swaps on
swapon -p 5 /dev/zram0
swapon -p 5 /dev/zram1
end script

post-stop script

# Switching off swap
swapoff /dev/zram0
swapoff /dev/zram1

rmmod zram
end script

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2011-09-20 15:39:27, 27.9 KB) [[attachment:ac100-install.jpg]]
  • [get | view] (2011-09-20 07:23:41, 153.0 KB) [[attachment:ac100-install.png]]
  • [get | view] (2012-10-16 08:57:04, 75.0 KB) [[attachment:menu_shot.png]]
  • [get | view] (2012-10-16 08:57:14, 37.9 KB) [[attachment:sw_sources_shot.png]]
  • [get | view] (2011-08-08 15:32:45, 76.2 KB) [[attachment:toshiba-ac100_01.jpg]]
  • [get | view] (2011-09-26 10:48:10, 0.6 KB) [[attachment:zramswap.conf]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.