tcwg-tk1-cpucore: Fix disablement of CPU idle in /etc/rc.local
Cores 0 and 1 are always online, and "echo 1" fails for them, which
causes the script to exit due to "set -e".
Change-Id: Id52912a87f2124795c4351e58915227fe4336676
diff --git a/playbooks/roles/tcwg-tk1-cpucore/files/rc.local b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
index 68497d5..a55d5e8 100644
--- a/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
+++ b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
@@ -11,11 +11,18 @@
#
# By default this script does nothing.
+trap "touch /tmp/rc_local_failed" EXIT
+
+rm -f /tmp/rc_local_failed
+
echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
-echo 1 > /sys/devices/system/cpu/cpu0/online
-echo 1 > /sys/devices/system/cpu/cpu1/online
-echo 1 > /sys/devices/system/cpu/cpu2/online
-echo 1 > /sys/devices/system/cpu/cpu3/online
+for cpu in /sys/devices/system/cpu/cpu*; do
+ if [ x"$(cat $cpu/online)" = x"0" ]; then
+ echo 1 > $cpu/online
+ fi
+done
+
+trap "" EXIT
exit 0