diff options
Diffstat (limited to 'scripts/tcos-top/02check_ram')
-rwxr-xr-x | scripts/tcos-top/02check_ram | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/tcos-top/02check_ram b/scripts/tcos-top/02check_ram new file mode 100755 index 0000000..1512c7d --- /dev/null +++ b/scripts/tcos-top/02check_ram @@ -0,0 +1,41 @@ +#!/bin/sh +# +if [ "$1" = "prereqs" ]; then + exit 0 +fi + +quiet=n + + +. /scripts/functions +. /conf/tcos.conf +. /conf/tcos-run-functions + +echo 0 > /tmp/less_ram + +# read MemTotal (in MB) +have_mem=$(awk '/^MemTotal/ {print int($2/1000)}' /proc/meminfo) + +if [ ${have_mem} -lt ${TCOS_MIN_RAM} ]; then + # we have less than TCOS_MIN_RAM + # need to start in NFS mode + echo 1 > /tmp/less_ram +fi + + +# force boot without nfs if booting from disk +FORCE_NO_NFS=$(read_cmdline_var 'nonfs' '0') + +if [ $FORCE_NO_NFS = 1 ]; then + echo 0 > /tmp/less_ram +fi + +# force boot nfs +FORCE_NFS=$(read_cmdline_var 'forcenfs' '0') + +if [ $FORCE_NFS = 1 ]; then + echo 1 > /tmp/less_ram +fi + + +exit 0 |