#!/bin/sh

PREREQ=""
prereqs()
{
     echo "$PREREQ"
}

case $1 in
prereqs)
     prereqs
     exit 0
     ;;
esac

# find total amount of available ram
TOTAL_RAM=$( grep MemTotal /proc/meminfo |tr -d ': [A-Z][a-z]')

# Do not use compcache on the liveCD if we have more than 512M
if [ "${BOOT}" = "casper" ]; then
    if [ "${TOTAL_RAM}" -gt 524288 ]; then
        exit 0
    fi
fi

modprobe -q --ignore-install ramzswap disksize_kb="$(($(sed -nre 's/^MemTotal:\s*([0-9]+) kB$/\1/p' /proc/meminfo) * 25 / 100))"
