Browse Source

Add 200MB offset to RAM check (#257)

dashboard-v0.3.11
Luke Childs 4 years ago
committed by GitHub
parent
commit
06981a3b4c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      scripts/update/check-memory

5
scripts/update/check-memory

@ -5,11 +5,14 @@ RELEASE=$1
UMBREL_ROOT=$2 UMBREL_ROOT=$2
first_run=$3 first_run=$3
# We add a 200MB offset becuase the 2GB Pi actually only has ~1.9GB of RAM
MIN_RAM=2000000 MIN_RAM=2000000
OFFSET=200000
LIMIT=$((MIN_RAM-OFFSET))
# Abort on low memory devices # Abort on low memory devices
memory="$(awk '/MemTotal/{printf "%d\n", $2}' /proc/meminfo)" memory="$(awk '/MemTotal/{printf "%d\n", $2}' /proc/meminfo)"
if ((memory<MIN_RAM)); then if ((memory<LIMIT)); then
if [[ "${first_run}" == "firstrun" ]]; then if [[ "${first_run}" == "firstrun" ]]; then
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
{"state": "installing", "progress": 20, "description": "Checking device memory", "updateTo": "${RELEASE}"} {"state": "installing", "progress": 20, "description": "Checking device memory", "updateTo": "${RELEASE}"}

Loading…
Cancel
Save