commit
ccf7f50b9b
@ -3,7 +3,8 @@ BOARD_NAME="Helios4"
|
||||
BOARDFAMILY="mvebu"
|
||||
BOOTCONFIG="armada_38x_helios4_config"
|
||||
BOOTCONFIG_NEXT="helios4_defconfig"
|
||||
MODULES="mv_cesa"
|
||||
MODULES="marvell_cesa"
|
||||
MODULES_NEXT="marvell_cesa"
|
||||
BUILD_DESKTOP="no"
|
||||
FORCE_BOOTSCRIPT_UPDATE="yes"
|
||||
|
||||
|
||||
@ -45,10 +45,7 @@ function getboardtemp() {
|
||||
# Allwinner legacy kernels output degree C
|
||||
board_temp=${raw_temp}
|
||||
else
|
||||
# Marvell gets special treatment for whatever reasons
|
||||
grep -qi Marvell /proc/cpuinfo && \
|
||||
board_temp=$(( $(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) - 20 )) || \
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
fi
|
||||
elif [ -f /etc/armbianmonitor/datasources/pmictemp ]; then
|
||||
# fallback to PMIC temperature
|
||||
@ -91,20 +88,26 @@ function batteryinfo() {
|
||||
} # batteryinfo
|
||||
|
||||
function ambienttemp() {
|
||||
# read ambient temperature from USB device if available
|
||||
if [[ ! -f /usr/bin/temper ]]; then
|
||||
echo ""
|
||||
return
|
||||
fi
|
||||
amb_temp=$(temper -c 2>/dev/null)
|
||||
case ${amb_temp} in
|
||||
*"find the USB device"*)
|
||||
if [ -f /etc/armbianmonitor/datasources/ambienttemp ]; then
|
||||
read raw_temp </etc/armbianmonitor/datasources/ambienttemp 2>/dev/null
|
||||
amb_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
echo $amb_temp
|
||||
else
|
||||
# read ambient temperature from USB device if available
|
||||
if [[ ! -f /usr/bin/temper ]]; then
|
||||
echo ""
|
||||
;;
|
||||
*)
|
||||
amb_temp=$(awk '{print $NF}' <<<$amb_temp | sed 's/C//g')
|
||||
echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+\.[[:digit:]]"
|
||||
esac
|
||||
return
|
||||
fi
|
||||
amb_temp=$(temper -c 2>/dev/null)
|
||||
case ${amb_temp} in
|
||||
*"find the USB device"*)
|
||||
echo ""
|
||||
;;
|
||||
*)
|
||||
amb_temp=$(awk '{print $NF}' <<<$amb_temp | sed 's/C//g')
|
||||
echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+\.[[:digit:]]"
|
||||
esac
|
||||
fi
|
||||
} # ambienttemp
|
||||
|
||||
#function get_ip_addresses() {
|
||||
|
||||
@ -40,7 +40,7 @@ prepare_temp_monitoring() {
|
||||
if [[ -d "/sys/devices/platform/a20-tp-hwmon" ]]; then
|
||||
# sun7i legacy
|
||||
ln -fs /sys/devices/platform/a20-tp-hwmon/temp1_input /etc/armbianmonitor/datasources/soctemp
|
||||
elif [[ -f /sys/class/hwmon/hwmon0/temp1_input ]]; then
|
||||
elif [[ -f /sys/class/hwmon/hwmon0/temp1_input && ${BOARDFAMILY} != "mvebu" ]]; then
|
||||
# usual convention with modern kernels
|
||||
ln -fs /sys/class/hwmon/hwmon0/temp1_input /etc/armbianmonitor/datasources/soctemp
|
||||
else
|
||||
@ -48,6 +48,11 @@ prepare_temp_monitoring() {
|
||||
[[ ${BOARDFAMILY} == s500 ]] && THERMAL_ZONE="thermal_zone1" || THERMAL_ZONE="thermal_zone0"
|
||||
ln -fs /sys/devices/virtual/thermal/${THERMAL_ZONE}/temp /etc/armbianmonitor/datasources/soctemp
|
||||
fi
|
||||
|
||||
# Ambient temp
|
||||
if [[ ${BOARD} == "helios4" && -f /dev/thermal-board/temp1_input ]]; then
|
||||
ln -fs /dev/thermal-board/temp1_input /etc/armbianmonitor/datasources/ambienttemp
|
||||
fi
|
||||
} # prepare_temp_monitoring
|
||||
|
||||
log_hardware_info() {
|
||||
@ -136,7 +141,7 @@ case $1 in
|
||||
*start*)
|
||||
# check sd card speed once on 3rd boot too warn for too slow media
|
||||
check_sd_card_speed &
|
||||
|
||||
|
||||
# prepare correct temperature readouts
|
||||
prepare_temp_monitoring &
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user