From c780bda553d4e6c7dfca1682d456058c9a98f789 Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Tue, 18 Aug 2026 18:55:02 -0700 Subject: [PATCH] motd: show CPU core state and power saving status --- userspace/root/etc/update-motd.d/25-cpu-state | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 userspace/root/etc/update-motd.d/25-cpu-state diff --git a/userspace/root/etc/update-motd.d/25-cpu-state b/userspace/root/etc/update-motd.d/25-cpu-state new file mode 100644 index 0000000..8e19813 --- /dev/null +++ b/userspace/root/etc/update-motd.d/25-cpu-state @@ -0,0 +1,22 @@ +#!/bin/bash +GREEN=$'\033[0;32m' +RED=$'\033[0;31m' +NC=$'\033[0m' + +online=$(cat /sys/devices/system/cpu/online) +offline=$(cat /sys/devices/system/cpu/offline) +isolated=$(cat /sys/devices/system/cpu/isolated) + +# power saving is enabled when the big cluster (cpu4) is offline +if [ "$(cat /sys/devices/system/cpu/cpu4/online 2>/dev/null)" = "0" ]; then + ps="enabled"; color=$RED +else + ps="disabled"; color=$GREEN +fi + +printf "\n CPU cores: online %s" "$online" +[ -n "$offline" ] && printf " | offline %s" "$offline" || true +[ -n "$isolated" ] && printf " | isolated %s" "$isolated" || true +printf "\n${color} Power saving: %s${NC} (fast cores 4-7 offline when powersaving enabled)\n" "$ps" +[ "$ps" = "enabled" ] && printf " Disable power saving with:\n └── /data/openpilot/.venv/bin/python /data/openpilot/scripts/disable-powersave.py\n" +true