Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta v7.9.1 #5028

Merged
merged 14 commits into from
Dec 6, 2021
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
2 changes: 1 addition & 1 deletion .conf/desktop/apps/dietpi-justboom.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Version=1.0
Name=DietPi-JustBoom
Type=Application
Comment=Tweak audio options for your JustBoom (and others) soundcard
Comment=Tweak your sound card, MPD and CAVA settings
Terminal=true
Exec=/boot/dietpi/misc/dietpi-justboom
Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png
Expand Down
2 changes: 1 addition & 1 deletion .update/version
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Available DietPi version
G_REMOTE_VERSION_CORE=7
G_REMOTE_VERSION_SUB=9
G_REMOTE_VERSION_RC=0
G_REMOTE_VERSION_RC=1
# Minimum DietPi version to allow update
G_MIN_VERSION_CORE=6
G_MIN_VERSION_SUB=0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Fixes:
- DietPi-Software | Resolved a v7.8 regression where ReadyMedia, Deluge, Sonarr and Jellyfin installs failed with an error on "usermod", since the services were not stopped first. This has been loved via live patches for v7.8 as well.
- DietPi-Software | Transmission: Resolved a v7.8 regression where on fresh installs the intended configuration was not deployed. Many thanks to @kannz and @alessandro.psrt for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=9567, https://dietpi.com/phpbb/viewtopic.php?t=9683
- DietPi-Software | SABnzbd: Resolved an issue where installs failed on ARMv6 and ARMv7 Stretch systems. Many thanks to @bensp for reporting this issue: https://github.com/MichaIng/DietPi/issues/4997
- DietPi-Software | Deluge: Worked around an issue on Raspberry Pi ARMv6 userland systems where the service failed to start. Deluge has hence been re-enabled for this systems. Many thanks to @themagicbullet for providing the workaround: https://github.com/MichaIng/DietPi/issues/4944

As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX

Expand Down
21 changes: 14 additions & 7 deletions PREP_SYSTEM_FOR_DIETPI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,15 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then
[[ $(blkid -s PTTYPE -o value -c /dev/null "$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -M /)")") == 'gpt' ]] && aPACKAGES_REQUIRED_INSTALL+=('gdisk')

# Install file system tools required for file system resizing and fsck
local ae2fsprogs=('--allow-remove-essential' 'e2fsprogs')
while read -r line
do
if [[ $line == 'vfat' ]]
if [[ $line == 'ext'[2-4] ]]
then
aPACKAGES_REQUIRED_INSTALL+=('e2fsprogs')
ae2fsprogs=()

elif [[ $line == 'vfat' ]]
then
aPACKAGES_REQUIRED_INSTALL+=('dosfstools')

Expand Down Expand Up @@ -958,8 +964,8 @@ _EOF_

# Install Radxa APT repo cleanly: No Bullseye repo available yet
G_EXEC rm -Rf /etc/apt/{trusted.gpg,sources.list.d/{,.??,.[^.]}*}
G_EXEC eval "curl -sSfL https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes"
G_EXEC eval "echo -e 'deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/ ${DISTRO_TARGET_NAME/bullseye/buster} main\n#deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-testing/ ${DISTRO_TARGET_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-radxa.list"
G_EXEC eval "curl -sSfL 'https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/public.key' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes"
G_EXEC eval "echo 'deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/ ${DISTRO_TARGET_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-radxa.list"
G_AGUP

# Remove obsolete combined keyring
Expand All @@ -974,8 +980,8 @@ _EOF_

# Install Radxa APT repo cleanly: No Bullseye repo available yet
G_EXEC rm -Rf /etc/apt/{trusted.gpg,sources.list.d/{,.??,.[^.]}*}
G_EXEC eval "curl -sSfL https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes"
G_EXEC eval "echo -e 'deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/ ${DISTRO_TARGET_NAME/bullseye/buster} main\n#deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-testing/ ${DISTRO_TARGET_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-radxa.list"
G_EXEC eval "curl -sSfL 'https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/public.key' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes"
G_EXEC eval "echo 'deb https://apt.radxa.com/${DISTRO_TARGET_NAME/bullseye/buster}-stable/ ${DISTRO_TARGET_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-radxa.list"
G_AGUP

# Remove obsolete combined keyring
Expand Down Expand Up @@ -1056,13 +1062,14 @@ _EOF_
unset -v apackages

# Purging additional packages, that (in some cases) do not get autoremoved:
# - Purge the "important" e2fsprogs if no ext[2-4] filesystem is present on the root partition table
# - dbus: Not required for headless images, but sometimes marked as "important", thus not autoremoved.
# + Workaround for "The following packages have unmet dependencies: glib-networking libgtk-3-0" and alike
# - dhcpcd5: https://github.com/MichaIng/DietPi/issues/1560#issuecomment-370136642
# - mountall: https://github.com/MichaIng/DietPi/issues/2613
# - initscripts: Pre-installed on Jessie systems (?), superseded and masked by systemd, but never autoremoved
# - chrony: Found left with strange "deinstall ok installed" mark left on Armbian images
G_AGP dbus dhcpcd5 mountall initscripts chrony '*office*' '*xfce*' '*qt5*' '*xserver*' '*xorg*' glib-networking libgtk-3-0 libsoup2.4-1 libglib2.0-0
G_AGP "${ae2fsprogs[@]}" dbus dhcpcd5 mountall initscripts chrony '*office*' '*xfce*' '*qt5*' '*xserver*' '*xorg*' glib-networking libgtk-3-0 libsoup2.4-1 libglib2.0-0
# Remove any autoremove prevention
rm -fv /etc/apt/apt.conf.d/*autoremove*
G_AGA
Expand Down Expand Up @@ -1418,7 +1425,7 @@ _EOF_'
G_EXEC systemctl mask $i
done

if (( $G_DISTRO > 5 ))
if command -v e2scrub > /dev/null
then
G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed'
G_EXEC systemctl disable --now e2scrub_{all.timer,reap}
Expand Down
4 changes: 2 additions & 2 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

# Set "hdmi_blanking=1" to allow the display going into standby after 10 minutes without input.
# With default value "0", the display shows a blank screen instead, but will not go into standby.
# NB: With "1" some applications (e.g. Kodi, OMXPlayer) cannot prevent display standby due to missing DPMS signal.
#hdmi_blanking=1
# NB: With "1" some legacy OpenMAX applications (OMXPlayer) cannot prevent display standby due to missing DPMS signal.
hdmi_blanking=1

# Set to "1" if your display has a black border of unused pixels visible.
disable_overscan=1
Expand Down
2 changes: 1 addition & 1 deletion dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ AUTO_SETUP_SWAPFILE_SIZE=1
# Swap space location: "zram" => swap space on /dev/zram0 (auto-size = 50% of RAM size) | /path/to/file => swap file at location (auto-size = 2 GiB minus RAM size)
AUTO_SETUP_SWAPFILE_LOCATION=/var/swap

# Set to "1" to disable HDMI output (and GPU/VPU where supported) for supported devices: RPi, Odroid C1, Odroid C2
# Set to "1" to disable HDMI/video output and framebuffers on Raspberry Pi, to reduce power consumption and memory usage: Works on RPi only!
AUTO_SETUP_HEADLESS=0

# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi
Expand Down
209 changes: 90 additions & 119 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -1834,57 +1834,34 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR

}

Change_Hostname(){

local hostname_current=$(</etc/hostname)
G_WHIP_DEFAULT_ITEM=$hostname_current
if G_WHIP_INPUTBOX 'Please enter a new hostname:' && [[ $hostname_current != "$G_WHIP_RETURNED_VALUE" ]]; then

if /boot/dietpi/func/change_hostname "$G_WHIP_RETURNED_VALUE"; then

REBOOT_REQUIRED=1

else

read -rp 'Press any key to return to DietPi-Config...'

fi

# Aborted
else

G_WHIP_MSG 'Hostname change has been aborted. No changes have been applied.'

fi

}

# TARGETMENUID=5
Menu_SecurityOptions(){

TARGETMENUID=0

local hostname_current=$(</etc/hostname)

G_WHIP_MENU_ARRAY=(

'1' ': Change Passwords'
'2' ': Change Hostname'
'Passwords' ': Change software and user passwords'
'Hostname' ": [$hostname_current] Change the system hostname"

)

if G_WHIP_MENU 'Lock down your DietPi Install'; then
G_WHIP_MENU 'Please select an option:' || return 0

TARGETMENUID=5 # Return to this menu
TARGETMENUID=5 # Stay in this menu

if (( $G_WHIP_RETURNED_VALUE == 1 )); then

/boot/dietpi/func/dietpi-set_software passwords

elif (( $G_WHIP_RETURNED_VALUE == 2 )); then

Change_Hostname

fi
if [[ $G_WHIP_RETURNED_VALUE == 'Passwords' ]]
then
/boot/dietpi/func/dietpi-set_software passwords

elif [[ $G_WHIP_RETURNED_VALUE == 'Hostname' ]]
then
G_WHIP_DEFAULT_ITEM=$hostname_current
G_WHIP_INPUTBOX 'Please enter a new hostname:' || return 0
[[ $hostname_current == "$G_WHIP_RETURNED_VALUE" ]] && return 0
/boot/dietpi/func/change_hostname "$G_WHIP_RETURNED_VALUE" || read -rp 'Press any key to return to DietPi-Config...'
fi

}
Expand Down Expand Up @@ -3901,140 +3878,134 @@ Additional benchmarks:
}

# TARGETMENUID=15
STRESS_TEST_MODE=0 # 0=CPU only | 1=CPU/RAM 2=CPU/RAM/IO
STRESS_TEST_MODE=0 # 0=CPU only | 1=CPU/RAM | 2=CPU/RAM/disk
STRESS_TEST_DURATION=60
STRESS_TEST_RESULTS_TEMP_MIN=0
STRESS_TEST_RESULTS_TEMP_MAX=0

Menu_StressTest(){

TARGETMENUID=11
TARGETMENUID=11 # Return to Tools menu

local stress_test_mode_text='CPU Burn: (CPU only)'
local stress_test_mode_text='CPU burn only'
if (( $STRESS_TEST_MODE == 1 )); then

stress_test_mode_text='CPU & RAM: (CPU, RAM)'
stress_test_mode_text='CPU & RAM burn'

elif (( $STRESS_TEST_MODE == 2 )); then

stress_test_mode_text='Full: (CPU, DISK, RAM)'
stress_test_mode_text='CPU, RAM & disk'

fi

G_WHIP_MENU_ARRAY=(

'Mode' ": [$stress_test_mode_text]"
'Duration' ": [$(( $STRESS_TEST_DURATION / 60 )) Minutes]"
'Duration' ": [$(( $STRESS_TEST_DURATION / 60 )) minutes]"
'Start' ': Launch the stress test'

)

if G_WHIP_MENU 'Please select an option:'; then
G_WHIP_MENU 'Please select an option:' || return 0

TARGETMENUID=15 # Return to this menu
TARGETMENUID=15 # Stay in this menu

if [[ $G_WHIP_RETURNED_VALUE == 'Duration' ]]; then
if [[ $G_WHIP_RETURNED_VALUE == 'Duration' ]]; then

G_WHIP_MENU_ARRAY=(
G_WHIP_MENU_ARRAY=(

'60' ': 1 Minute'
'300' ': 5 Minutes'
'1800' ': 30 Minutes'
'3600' ': 1 Hour'
'21600' ': 6 Hours (Winter months?)'
'60' ': 1 minute'
'300' ': 5 minutes'
'1800' ': 30 minutes'
'3600' ': 1 hour'
'21600' ': 6 hours (Winter months?)'

)
)

G_WHIP_DEFAULT_ITEM=$STRESS_TEST_DURATION
G_WHIP_MENU 'Please select a duration for the test' && STRESS_TEST_DURATION=$G_WHIP_RETURNED_VALUE
G_WHIP_DEFAULT_ITEM=$STRESS_TEST_DURATION
G_WHIP_MENU 'Please select a duration for the test:' && STRESS_TEST_DURATION=$G_WHIP_RETURNED_VALUE

elif [[ $G_WHIP_RETURNED_VALUE == 'Mode' ]]; then
elif [[ $G_WHIP_RETURNED_VALUE == 'Mode' ]]; then

G_WHIP_MENU_ARRAY=(
G_WHIP_MENU_ARRAY=(

'0' ': CPU Burn: (CPU only)'
'1' ': CPU & RAM: (CPU, RAM)'
'2' ': Full: (CPU, DISK, RAM)'
'0' ': CPU burn only'
'1' ': CPU & RAM burn'
'2' ': CPU, RAM & disk'

)
)

G_WHIP_DEFAULT_ITEM=$STRESS_TEST_MODE
G_WHIP_MENU 'Please select a stress test type' && STRESS_TEST_MODE=$G_WHIP_RETURNED_VALUE
G_WHIP_DEFAULT_ITEM=$STRESS_TEST_MODE
G_WHIP_MENU 'Please select which components you want to stress:' && STRESS_TEST_MODE=$G_WHIP_RETURNED_VALUE

elif [[ $G_WHIP_RETURNED_VALUE == 'Start' ]]; then
elif [[ $G_WHIP_RETURNED_VALUE == 'Start' ]]; then

G_AG_CHECK_INSTALL_PREREQ stress || exit 1
G_AG_CHECK_INSTALL_PREREQ stress || exit 1

G_DIETPI-NOTIFY 3 Stress_Test "Running stress test for $STRESS_TEST_DURATION seconds"
G_DIETPI-NOTIFY 2 'To terminate, type: killall -w stress'
# Pre-create/clear log file
local fp_log='/root/dietpi-config_stress.log' log_text
> $fp_log

local start_time=$(date)
local start_time_epoch=$(date +%s)
local memory_per_thread=$(( $(free -m | mawk '/^Mem:/ {print $2;exit}') / ( $G_HW_CPU_CORES * 2 ) ))
local fp_log='/root/dietpi-config_stress.log'
[[ -f $fp_log ]] && rm $fp_log
# Check if system supports temp readouts
local cpu_supports_temp=0 cpu_temp=$(G_OBTAIN_CPU_TEMP)
disable_error=1 G_CHECK_VALIDINT "$cpu_temp" && cpu_supports_temp=1
STRESS_TEST_RESULTS_TEMP_MIN=$cpu_temp
STRESS_TEST_RESULTS_TEMP_MAX=$cpu_temp

if (( $STRESS_TEST_MODE == 0 )); then
G_DIETPI-NOTIFY 3 'Stress Test' "Running stress test for $STRESS_TEST_DURATION seconds"
G_DIETPI-NOTIFY 2 'To terminate, type: killall stress'

stress -c $(( $G_HW_CPU_CORES * 2 )) -t "$STRESS_TEST_DURATION"s &
local start_time=$(date) start_time_epoch=$(date '+%s')
local memory_per_thread=$(( $(free -m | mawk '/^Mem:/{print $2;exit}') / ( $G_HW_CPU_CORES * 2 ) ))

elif (( $STRESS_TEST_MODE == 1 )); then
if (( $STRESS_TEST_MODE == 0 )); then

stress -c $(( $G_HW_CPU_CORES * 2 )) -i "$G_HW_CPU_CORES" -m "$G_HW_CPU_CORES" --vm-bytes "$memory_per_thread"M -t "$STRESS_TEST_DURATION"s &
stress -t "$STRESS_TEST_DURATION"s -c $(( $G_HW_CPU_CORES * 2 )) &

elif (( $STRESS_TEST_MODE == 2 )); then
elif (( $STRESS_TEST_MODE == 1 )); then

stress -c $(( $G_HW_CPU_CORES * 2 )) -i "$G_HW_CPU_CORES" -m "$G_HW_CPU_CORES" --vm-bytes "$memory_per_thread"M -d 2 -t "$STRESS_TEST_DURATION"s &
stress -t "$STRESS_TEST_DURATION"s -c $(( $G_HW_CPU_CORES * 2 )) -i "$G_HW_CPU_CORES" -m "$G_HW_CPU_CORES" --vm-bytes "$memory_per_thread"M &

fi
elif (( $STRESS_TEST_MODE == 2 )); then

# Reset
STRESS_TEST_RESULTS_TEMP_MIN=1000
STRESS_TEST_RESULTS_TEMP_MAX=0
stress -t "$STRESS_TEST_DURATION"s -c $(( $G_HW_CPU_CORES * 2 )) -i "$G_HW_CPU_CORES" -m "$G_HW_CPU_CORES" --vm-bytes "$memory_per_thread"M -d 2 &

# Check if system supports temp readouts
local cpu_supports_temp=0
local cpu_temp=$(G_OBTAIN_CPU_TEMP)
disable_error=1 G_CHECK_VALIDINT "$cpu_temp" && cpu_supports_temp=1
fi

# Loop until stress completed
local remaning_time=0
while pgrep 'stress' &> /dev/null
do
# Loop until stress completed
while pgrep 'stress' &> /dev/null
do
log_text=$(date)
if (( $cpu_supports_temp ))
then
cpu_temp=$(G_OBTAIN_CPU_TEMP)
remaning_time=$(( $STRESS_TEST_DURATION + ( $start_time_epoch - $(date +%s) ) ))

echo -e "$(date) | $cpu_temp'c | $remaning_time seconds remaining"
echo -e "$(date) | $cpu_temp'c" >> "$fp_log"

if (( $cpu_supports_temp )); then

(( $cpu_temp > $STRESS_TEST_RESULTS_TEMP_MAX )) && STRESS_TEST_RESULTS_TEMP_MAX=$cpu_temp
(( $cpu_temp < $STRESS_TEST_RESULTS_TEMP_MIN )) && STRESS_TEST_RESULTS_TEMP_MIN=$cpu_temp
if (( $cpu_temp > $STRESS_TEST_RESULTS_TEMP_MAX ))
then
STRESS_TEST_RESULTS_TEMP_MAX=$cpu_temp

elif (( $cpu_temp < $STRESS_TEST_RESULTS_TEMP_MIN ))
then
STRESS_TEST_RESULTS_TEMP_MIN=$cpu_temp
fi
log_text+=" | $cpu_temp °C"
fi
log_text+=" | $(( $STRESS_TEST_DURATION + $start_time_epoch - $(date '+%s') )) seconds remaining"
echo "$log_text"
echo "$log_text" > $fp_log
sleep 1
done

sleep 1
((time_since_start++))
done

local end_time=$(date)
local end_time_epoch=$(date +%s)
local duration_seconds=$(( $end_time_epoch - $start_time_epoch ))

local output_string=" - Start Time: $start_time
- End Time : $end_time
- Duration : $duration_seconds seconds
- Min Temp : $STRESS_TEST_RESULTS_TEMP_MIN 'c
- Max Temp : $STRESS_TEST_RESULTS_TEMP_MAX 'c
- log : $fp_log"

G_DIETPI-NOTIFY 0 'Stress Test Completed'
G_DIETPI-NOTIFY 2 "$output_string"
local output_string=" - Start Time: $start_time
- End Time : $(date)
- Duration : $(( $(date '+%s') - $start_time_epoch )) seconds
- Min Temp : $STRESS_TEST_RESULTS_TEMP_MIN °C
- Max Temp : $STRESS_TEST_RESULTS_TEMP_MAX °C
- Log : $fp_log"

G_WHIP_MSG "Stress test results:\n$output_string"
G_DIETPI-NOTIFY 0 'Stress Test Completed'
G_DIETPI-NOTIFY 2 "$output_string"

fi
G_WHIP_MSG "Stress test results:\n$output_string"

fi

Expand Down
Loading