/usr/share/checkbox/scripts/cpu_offlining 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 28 29 30 | #!/bin/bash
echo "Beginning CPU Offlining Test"
# Turn CPU cores off
for cpu_num in `ls /sys/devices/system/cpu | grep -o cpu[0-9]*`;
do
if [ -f /sys/devices/system/cpu/$cpu_num/online ]; then
echo "Offlining $cpu_num"
echo 0 > /sys/devices/system/cpu/$cpu_num/online
grep -i -q $cpu_num /proc/interrupts
if [ $? == 0 ]; then
exit 1
fi
fi
done
# Back on again
for cpu_num in `ls /sys/devices/system/cpu | grep -o cpu[0-9]*`;
do
if [ -f /sys/devices/system/cpu/$cpu_num/online ]; then
echo "Onlining $cpu_num"
echo 1 > /sys/devices/system/cpu/$cpu_num/online
grep -i -q $cpu_num /proc/interrupts
if [ $? == 1 ]; then
exit 1
fi
fi
done
|