Merge pull request #1421 from helios-4/helios4
[ mvebu ] Put back Armada temperature tweak in motd
This commit is contained in:
commit
b8f89196b1
@ -66,4 +66,10 @@ family_tweaks_s()
|
||||
# copy and enable helios4-wol.service
|
||||
cp $SRC/packages/bsp/helios4/helios4-wol.service $SDCARD/lib/systemd/system/
|
||||
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable helios4-wol.service >/dev/null 2>&1"
|
||||
|
||||
### Other tweaks
|
||||
|
||||
# add custom motd default conf file
|
||||
cp $SRC/packages/bsp/helios4/armbian-motd $SDCARD/etc/default/
|
||||
|
||||
}
|
||||
|
||||
@ -17,6 +17,9 @@ MOTD_DISABLE=""
|
||||
STORAGE=/dev/sda1
|
||||
SHOW_IP_PATTERN="^[ewr].*|^br.*|^lt.*|^umts.*"
|
||||
|
||||
CPU_TEMP_LIMIT=45
|
||||
AMB_TEMP_LIMIT=40
|
||||
|
||||
[[ -f /etc/default/armbian-motd ]] && . /etc/default/armbian-motd
|
||||
|
||||
for f in $MOTD_DISABLE; do
|
||||
@ -45,7 +48,10 @@ function getboardtemp() {
|
||||
# Allwinner legacy kernels output degree C
|
||||
board_temp=${raw_temp}
|
||||
else
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
# Tweak for Marvell Armada error in the default value of Tc trim (Errata #132698)
|
||||
grep -qi Armada /proc/cpuinfo && \
|
||||
board_temp=$(( $(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) - 20 )) || \
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
fi
|
||||
elif [ -f /etc/armbianmonitor/datasources/pmictemp ]; then
|
||||
# fallback to PMIC temperature
|
||||
@ -197,8 +203,8 @@ printf "IP: "
|
||||
printf "\x1B[92m%s\x1B[0m" "$ip_address"
|
||||
echo "" # fixed newline
|
||||
a=0;b=0;c=0
|
||||
display "CPU temp" "$board_temp" "45" "0" "°C" "" ; a=$?
|
||||
display "Ambient temp" "$amb_temp" "40" "0" "°C" "" ; b=$?
|
||||
display "CPU temp" "$board_temp" $CPU_TEMP_LIMIT "0" "°C" "" ; a=$?
|
||||
display "Ambient temp" "$amb_temp" $AMB_TEMP_LIMIT "0" "°C" "" ; b=$?
|
||||
(( ($a+$b) >0 )) && echo "" # new line only if some value is displayed
|
||||
display "Usage of /" "$root_usage" "90" "1" "%" " of $root_total"
|
||||
display "storage/" "$storage_usage" "90" "1" "%" " of $storage_total"
|
||||
|
||||
10
packages/bsp/helios4/armbian-motd
Normal file
10
packages/bsp/helios4/armbian-motd
Normal file
@ -0,0 +1,10 @@
|
||||
# add space-separated list of MOTD script names (without number) to exclude them from MOTD
|
||||
# Example:
|
||||
# MOTD_DISABLE="header tips updates"
|
||||
|
||||
MOTD_DISABLE=""
|
||||
ONE_WIRE="" # yes = show 1-wire temperature sensor if attached
|
||||
|
||||
# Helios4 temperature display warning threshold
|
||||
CPU_TEMP_LIMIT=65
|
||||
AMB_TEMP_LIMIT=50
|
||||
Loading…
Reference in New Issue
Block a user