#!/bin/sh

# new header not using prereqs
if [ "$1" = "prereqs" ]; then
  echo ""
  exit 0
fi

quiet=n

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

# Do not use compcache if we have more than 256M
if [ "${TOTAL_RAM}" -gt 262144 ]; then
    exit 0
fi

# add TCOS_COMPCACHE_PERCENT% of RAM (by default 20)
kbytes="$(($TOTAL_RAM * 20 / 100))"


modprobe -q --ignore-install ramzswap disksize_kb="$kbytes"

