This file is indexed.

/usr/share/checkbox/scripts/memory_compare is in checkbox 0.13.7.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

MIN_LEVEL=90

meminfo_total=`grep 'MemTotal' /proc/meminfo | awk '{print $2}'`
meminfo_units=`grep 'MemTotal' /proc/meminfo | awk '{print $3}'`

echo "Meminfo total: $meminfo_total $meminfo_units"

dmi_total=0

for size in `dmidecode -t 17 | grep Size | grep -o [0-9]*`
do
    dmi_total=`echo $dmi_total + $size | bc`
done

dmi_total=`echo "$dmi_total * 1000" | bc`

echo "DMI total: $dmi_total $meminfo_units"
accuracy=`echo "scale=2; $meminfo_total / $dmi_total * 100" | bc`
echo "Accuracy: $accuracy"

if [ ${accuracy::-3} -lt $MIN_LEVEL ]
then
    echo "Memory totals not close enough"
    exit 1
fi