Moduli se ne ucitaju u kernel, pogledaj ove teme
http://crunchbang.or…ic.php?id=15344
http://weirdfellow.w…-ram-with-zram/
Edit:
@Drinx, evo sadrzaj skripte , onako kako je kod mene, putanja /etc/init/zramswap.conf
description “Initializes zram swapping”
start on runlevel [2345]
stop on runlevel [!2345]
pre-start script
get_number_of_present_cpus() {
cpulist=$( cat /sys/devices/system/cpu/present | tr ‘,’ ’ ’ )
local num_cpus=0
for item in $cpulist; do
if ( echo $item | grep --silent ‘-’ ); then
greater_cpunum=$( echo $item | cut -d ‘-’ -f 2 )
lesser_cpunum=$( echo $item | cut -d ‘-’ -f 1 )
local num_cpus=$(( $num_cpus + $greater_cpunum - $lesser_cpunum + 1 ))
else
local num_cpus=$(( $num_cpus + 1 ))
fi
done
echo $num_cpus
}
get the number of CPUs
num_cpus=$(get_number_of_present_cpus)
set decremented number of CPUs
decr_num_cpus=$((num_cpus - 1))
get the amount of memory in the machine
mem_total_kb=$(grep MemTotal /proc/meminfo | grep -E --only-matching ‘[[:digit:]]+’)
mem_total=$((mem_total_kb * 1024))
determine modprobe parameter name, depending on kernel version
if (uname --release | grep -E --silent “^3.[123]”); then
num_devices_parameter=‘zram_num_devices’
else
num_devices_parameter=‘num_devices’
fi
load zram modules
modprobe zram $num_devices_parameter=$num_cpus
initialize the devices, set total size to 1/2 RAM
for i in $(seq 0 $decr_num_cpus); do
echo $((mem_total / 2 / num_cpus)) > /sys/block/zram$i/disksize
done
Creating swap filesystems
for i in $(seq 0 $decr_num_cpus); do
mkswap /dev/zram$i
done
Switch the swaps on
for i in $(seq 0 $decr_num_cpus); do
swapon -p 100 /dev/zram$i
done
end script
post-stop script
Switching off swap
for device in $(grep -E --only-matching ‘/dev/zram[[:digit:]]+’ /proc/swaps); do
swapoff “$device”
done
remove module, wait instead of failing if it’s busy
rmmod --wait zram
end script