Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ New software:

Enhancements:
- DietPi-Benchmark | The benchmark script has been moved to /boot/dietpi/dietpi-benchmark and a shell alias has been added, so it can now be called directly from the console as "dietpi-benchmark" without having to browse through dietpi-config first.
- DietPi-Tools | DietPi-Servarr_to_RAM: The original script dietpi-arr_to_RAM was renamed to dietpi-servarr_to_ram, got Prowlarr support, and protection against malicious symlinks when creating files and directories.
- DietPi-Servarr_to_RAM | The original script dietpi-arr_to_RAM was renamed to dietpi-servarr_to_ram, got Prowlarr support, and protection against malicious symlinks when creating files and directories.
- DietPi-Config | The performance options were expanded by a menu to select the CPU temperature sensor used across our scripts. It affects the CPU temperature shown in performance options, in "cpu" command output, the DietPi login banner, and elsewhere within our scripts and menus. Since the sysfs nodes for temperature sensors are not consistent across devices, the hardcoded logic we use does not always pick the right one. Now you can select from a list of detected sensor paths with their returned temperatures, or enter a custom path to read from. A related dietpi.txt setting "CONFIG_CPU_TEMP_PATH" has been added as well. Many thanks to @N7-BADA for adding this feature: https://github.com/MichaIng/DietPi/pull/8012
- DietPi-Software | A desktop selection menu was added to make it clearer and easier to get started for those who require a graphical desktop environment. A new dietpi.txt setting AUTO_SETUP_DESKTOP allows to pre-select a desktop for first boot. It takes textual values like "lxde" and "xfce", and serves as better accessible alternative to numerical software ID selections like AUTO_SETUP_INSTALL_SOFTWARE_ID=23.

Bug fixes:
Expand Down
6 changes: 6 additions & 0 deletions dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=40
# Throttle Up Percentage: Percentage of average CPU usage during sampling rate at which CPU will be throttled up/down
CONFIG_CPU_USAGE_THROTTLE_UP=50

# CPU Temperature Sensor Path
# - "auto" or empty uses auto-detection (default)
# - Set a specific path to override, e.g.: /sys/class/hwmon/hwmon1/temp1_input
# - Use "dietpi-config" > "Display Options" > "CPU Temp Sensor" to select
CONFIG_CPU_TEMP_PATH=auto

# CPU Frequency Limits: Disabled=disabled
# - Intel CPUs use a percentage value (%) from 0-100, e.g.: 55
# - All other devices must use a specific MHz value, e.g.: 1600
Expand Down
39 changes: 39 additions & 0 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,10 @@ Latest release notes: https://github.com/starfive-tech/VisionFive2/releases
G_WHIP_MENU_ARRAY+=('CPU Frequency Limits' ": Max = [$user_frequency_max_text] | Min = [$user_frequency_min_text]")
fi

# CPU Temp Sensor
local cpu_temp_sensor=$(sed -n '/^[[:blank:]]*CONFIG_CPU_TEMP_PATH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
G_WHIP_MENU_ARRAY+=('CPU Temp Sensor' ": [${cpu_temp_sensor:=auto}]")

# RPi extras
if (( $G_HW_MODEL < 10 ))
then
Expand Down Expand Up @@ -1530,6 +1534,41 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will
fi
;;

'CPU Temp Sensor')

G_WHIP_MENU_ARRAY=(
'auto' 'Auto-detect (default)'
'custom' 'Enter custom path'
'' '●─ Detected sensors '
)

local sfile stemp smark
for sfile in /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_input /sys/class/hwmon/hwmon*/temp*_input /sys/class/thermal/thermal_zone*/temp
do
[[ -f $sfile ]] || continue
read -r stemp < "$sfile" || continue
disable_error=1 G_CHECK_VALIDINT "$stemp" 1 || continue # trust only positive temperatures
(( $stemp > 200 )) && stemp=$(( $stemp / 1000 )) # m°C => °C

# Mark currently selected sensor node
[[ $sfile == "$cpu_temp_sensor" ]] && smark=' [*]' || smark=''

G_WHIP_MENU_ARRAY+=("$sfile" "$stemp °C$smark")
done

G_WHIP_DEFAULT_ITEM=$cpu_temp_sensor
G_WHIP_MENU "Select CPU temperature sensor:\n\nCurrent: $cpu_temp_sensor" || return 0

if [[ $G_WHIP_RETURNED_VALUE == 'custom' ]]
then
G_WHIP_DEFAULT_ITEM=$cpu_temp_sensor
G_WHIP_INPUTBOX 'Enter full sensor path:\n\nExample: /sys/class/hwmon/hwmon1/temp1_input' || return 0
[[ -f $G_WHIP_RETURNED_VALUE ]] || { G_WHIP_MSG "Path not found:\n\n$G_WHIP_RETURNED_VALUE"; return 0; }
fi

G_CONFIG_INJECT 'CONFIG_CPU_TEMP_PATH=' "CONFIG_CPU_TEMP_PATH=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt
;;

*) :;;
esac
}
Expand Down
3 changes: 3 additions & 0 deletions dietpi/func/dietpi-globals
Original file line number Diff line number Diff line change
Expand Up @@ -1763,8 +1763,11 @@ Press any key to continue...'
# - Others
else
# Array to store possible locations for temp read
: "${G_HW_CPU_TEMP_PATH:=$(sed -n 's/^CONFIG_CPU_TEMP_PATH=//p' /boot/dietpi.txt)}"
[[ $G_HW_CPU_TEMP_PATH == 'auto' ]] && G_HW_CPU_TEMP_PATH=
local i afp_temperature=(

${G_HW_CPU_TEMP_PATH:+"$G_HW_CPU_TEMP_PATH"} # User override from /boot/dietpi.txt
'/sys/devices/platform/coretemp.[0-9]/hwmon/hwmon[0-9]/temp[1-9]_input' # Intel Mini PCs: https://github.com/MichaIng/DietPi/issues/3172, https://github.com/MichaIng/DietPi/issues/3412
'/sys/class/thermal/thermal_zone0/temp'
'/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input'
Expand Down