From 5e8a44f6e8541103cdea5904f0ffe1fe64bcc618 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 00:27:32 +0200 Subject: [PATCH 001/182] META | DietPi-Survey_report: Add v6.30 and v6.31 support --- .meta/dietpi-survey_report | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 7e79797200..95e9a52066 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -441,6 +441,17 @@ done aSOFTWARE_NAME6_29[140]='Domoticz' + # v6.30 + v6.31 + aSOFTWARE_NAME6_30=() + aSOFTWARE_NAME6_31=() + for i in ${!aSOFTWARE_NAME6_29[@]} + do + + aSOFTWARE_NAME6_30[$i]=${aSOFTWARE_NAME6_29[$i]} + aSOFTWARE_NAME6_31[$i]=${aSOFTWARE_NAME6_30[$i]} + + done + Main(){ # Copy files to RAM to speed up grep From 5bf266e6ed20586eddd8df77aca7c589c66e9148 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 01:29:20 +0200 Subject: [PATCH 002/182] v6.31 + DietPi-Software | Code fixes and enhancements, based on CodeFactor scan --- dietpi/dietpi-software | 55 ++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index dd83a412a6..21183d5d36 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6066,7 +6066,7 @@ $ha_pyenv_activation pyenv install $ha_python_version pyenv local $ha_python_version pip3 install -U pip wheel -[ -z "$custom_pip_deps" ] || pip3 install $custom_pip_deps +[ -z \"$custom_pip_deps\" ] || pip3 install $custom_pip_deps pip3 install homeassistant" # Generate script to launch HA using pyenv @@ -7215,9 +7215,8 @@ _EOF_ while : do - G_WHIP_INPUTBOX "${invalid_entry}Please enter the IP address of your ${aSOFTWARE_NAME[$software_id]} client machine -This is required, since the ${aSOFTWARE_NAME[$software_id]} server node by default does not allow any remote connection." - if (( ! $? )) && [[ $G_WHIP_RETURNED_VALUE =~ ^[0-9.]+$ ]]; then + if G_WHIP_INPUTBOX "${invalid_entry}Please enter the IP address of your ${aSOFTWARE_NAME[$software_id]} client machine +This is required, since the ${aSOFTWARE_NAME[$software_id]} server node by default does not allow any remote connection." && [[ $G_WHIP_RETURNED_VALUE =~ ^[0-9.]+$ ]]; then ob_client_ip=$G_WHIP_RETURNED_VALUE break @@ -7828,9 +7827,8 @@ The install script will now exit. After applying one of the the above, rerun die do G_WHIP_DEFAULT_ITEM=$port - G_WHIP_INPUTBOX "${invalid_text}Please enter the network port, that should be used for your TURN server:\n -NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 3478" - if (( $? == 0 )) && disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then + if G_WHIP_INPUTBOX "${invalid_text}Please enter the network port, that should be used for your TURN server:\n +NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 3478" && disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then port=$G_WHIP_RETURNED_VALUE break @@ -8236,7 +8234,7 @@ _EOF_ local version=11 (( $G_DISTRO < 5 || G_HW_MODEL == 1 )) && version=8 - G_CONFIG_INJECT 'JAVA_HOME=' "JAVA_HOME=$(find /usr/lib/jvm/ -name java-$version-openjdk*)" /etc/default/tomcat8 + G_CONFIG_INJECT 'JAVA_HOME=' "JAVA_HOME=$(find /usr/lib/jvm/ -name "java-$version-openjdk*")" /etc/default/tomcat8 fi @@ -9492,8 +9490,7 @@ _EOF_ do G_WHIP_DEFAULT_ITEM=$domain - G_WHIP_INPUTBOX "${invalid_text}Please enter your servers public IP/domain for WireGuard client access:" - if (( $? == 0 )) && [[ $G_WHIP_RETURNED_VALUE ]]; then + if G_WHIP_INPUTBOX "${invalid_text}Please enter your servers public IP/domain for WireGuard client access:" && [[ $G_WHIP_RETURNED_VALUE ]]; then domain=${G_WHIP_RETURNED_VALUE#http*://} break @@ -9511,9 +9508,8 @@ _EOF_ do G_WHIP_DEFAULT_ITEM=$port - G_WHIP_INPUTBOX "${invalid_text}Please enter the network port, that should be used to access your WireGuard server:\n -NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 51820" - if (( $? == 0 )) && disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then + if G_WHIP_INPUTBOX "${invalid_text}Please enter the network port, that should be used to access your WireGuard server:\n +NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 51820" && disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then port=$G_WHIP_RETURNED_VALUE break @@ -12716,7 +12712,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if [[ '/etc/systemd/system/yacy.service' ]]; then + if [[ -f '/etc/systemd/system/yacy.service' ]]; then systemctl disable --now yacy rm -R /etc/systemd/system/yacy.service* @@ -12762,7 +12758,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if [[ '/etc/systemd/system/darkice.service' ]]; then + if [[ -f '/etc/systemd/system/darkice.service' ]]; then systemctl disable --now darkice rm -R /etc/systemd/system/darkice.service* @@ -14816,7 +14812,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// Input_Modes(){ - local input=$@ + local input=$* input=${input#*[[:blank:]]} # Process software and exit @@ -15232,14 +15228,12 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n while (( $USER_EMONHUB_APIKEY_COMPLETED == 0 )); do - G_WHIP_INPUTBOX "EmonHUB/EmonPi:\n\nPlease enter the \"Write API KEY\":\n - Visit https://emoncms.org to register an account and login. - - Select \"Setup\" from the top right of screen, then select \"My Account\"\n - Enter the \"Write API Key\" into the box below." - if (( $? == 0 )); then + if G_WHIP_INPUTBOX "EmonHUB/EmonPi:\n\nPlease enter the \"Write API KEY\":\n - Visit https://emoncms.org to register an account and login. + - Select \"Setup\" from the top right of screen, then select \"My Account\"\n - Enter the \"Write API Key\" into the box below."; then USER_EMONHUB_APIKEY_CURRENT=$G_WHIP_RETURNED_VALUE - G_WHIP_YESNO "The following \"Write API KEY\" will be applied during installation:\n$USER_EMONHUB_APIKEY_CURRENT\n\nIs this key correct?" - if (( $? == 0 )); then + if G_WHIP_YESNO "The following \"Write API KEY\" will be applied during installation:\n$USER_EMONHUB_APIKEY_CURRENT\n\nIs this key correct?"; then # - update dietpi.txt so the value will be applied during installation. sed -i "/^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=/c\SOFTWARE_EMONHUB_APIKEY=$USER_EMONHUB_APIKEY_CURRENT" /boot/dietpi.txt @@ -15595,11 +15589,10 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_DEFAULT_ITEM=$index_fileserver_text G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Please select desired fileserver:\n + if G_WHIP_MENU 'Please select desired fileserver:\n - None: Select this option if you do NOT require a method of accessing files and folders on this device, over a network.\n - ProFTPD (Recommended for RPi v1): Allows you to access/share files on this device efficiently with minimal cpu usage. Uses FTP protocol.\n -- Samba (Recommended for RPi v2): Allows you to easily access/share files on this device, at the cost of higher cpu usage.\n\nMore info: https://dietpi.com/phpbb/viewtopic.php?f=8&t=15#p19' - if (( $? == 0 )); then +- Samba (Recommended for RPi v2): Allows you to easily access/share files on this device, at the cost of higher cpu usage.\n\nMore info: https://dietpi.com/phpbb/viewtopic.php?f=8&t=15#p19'; then # - Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then @@ -15650,12 +15643,11 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_DEFAULT_ITEM=$index_logging_text G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Please select desired logging system:\n + if G_WHIP_MENU 'Please select desired logging system:\n - None: Selecting this option will uninstall DietPi-Ramlog, Logrotate, Rsyslog.\n - DietPi-Ramlog #1 (Max performance): Mounts /var/log to RAM, reducing filesystem IO. Logfiles are cleared every hour. Does NOT save logfiles to disk.\n - DietPi-Ramlog #2: Same as #1, with the added feature of saving logfile contents to disk (/root/logfile_storage/*), before being cleared.\n -- Full (Reduces performance): Mounts /var/log to DISK, reduces SDcard lifespan. Full logging system with Logrotate and Rsyslog.' - if (( $? == 0 )); then +- Full (Reduces performance): Mounts /var/log to DISK, reduces SDcard lifespan. Full logging system with Logrotate and Rsyslog.'; then # - Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then @@ -15712,9 +15704,8 @@ This will allow you to choose which program loads automatically, after the syste ) G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc.\n -More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087\n\n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.' - if (( $? == 0 )); then + if G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc.\n +More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087\n\n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.'; then # - DriveMan if [[ $G_WHIP_RETURNED_VALUE == 'Drive' ]]; then @@ -16206,10 +16197,10 @@ Do you wish to continue with DietPi as a pure minimal image?'; then if [[ $keep_serial0 == 1 && -L '/dev/serial0' ]]; then - tty=$(readlink -f /dev/serial0); tty={tty#\/dev\/} + tty=$(readlink -f /dev/serial0); tty={tty#/dev/} if [[ $( Date: Mon, 11 May 2020 01:34:04 +0200 Subject: [PATCH 003/182] v6.31 + DietPi-Patch | Minor code enhancements based on CodeFactor scan --- dietpi/patch_file | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index ed62380d6e..abf41a9f13 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -798,7 +798,7 @@ _EOF_' [[ -f $fp_new ]] || /boot/dietpi/dietpi-services stop cron # Transfer existing entries over - while read line + while read -r line do [[ $line != '#'* ]] && echo "+ $line" >> $fp_new @@ -945,11 +945,10 @@ _EOF_ ) G_WHIP_DEFAULT_ITEM=0 - G_WHIP_MENU '[WARNING] IPv6 is disabled via kernel module blacklist or boot cmd line.\n + if G_WHIP_MENU '[WARNING] IPv6 is disabled via kernel module blacklist or boot cmd line.\n This feature was previously offered via DietPi-Config and has since been removed.\n Since more and more software requires and expects IPv6 kernel settings to be available. If you keep the current settings, this might lead to APT install errors and/or general system instability.\n -We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing so, IPv6 will remain disabled for the interfaces at sysctl level, and, no IPv6 addresses will be assigned to your network devices.\n\nTLDR: Select option "0" :)' - if (( ! $? && ! $G_WHIP_RETURNED_VALUE )); then +We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing so, IPv6 will remain disabled for the interfaces at sysctl level, and, no IPv6 addresses will be assigned to your network devices.\n\nTLDR: Select option "0" :)' && (( $G_WHIP_RETURNED_VALUE == 0 )); then # Remove kernel module blacklisting [[ -f '/etc/modprobe.d/99-dietpi-blacklist-ipv6.conf' ]] && rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf From 7fb8b09e0a3161289368b4a09142c97691304e08 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 12:15:27 +0200 Subject: [PATCH 004/182] v6.31 + DietPi-Boot | Run network time sync before estimating network details. Waiting for network only checks for a default route, but especially in case of DHCP this can be present before a valid IP has been assigned. Network time sync is done anyway and, if not a local NTP server or custom method has been chosen, serves as an additional prove for internet connectivity. The non-interactive DietPi-Run_NTPD call does not require or use /run/dietpi/.network at all, hence no regression is implied. All services which require internet connectivity, especially those which read /run/dietpi/.network, should start "After=dietpi-boot.service", those which read /run/dietpi/.network additionally should call "ExecStartPre=/boot/dietpi/func/obtain_network_details" to have updated network info, e.g. on service restarts (ToDo). --- dietpi/boot | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index 8f70c88c61..e84a9dd00e 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -51,26 +51,22 @@ } - Run_Init(){ - - #---------------------------------------------------------------- - # network-online.target should be an alternative, but ifup@.service is Type=simple which means that hotplug interfaces might not be fully configured before the target is reached. - Wait_For_Valid_Network_Connection - #---------------------------------------------------------------- - # Write network details to /run/dietpi/.network - /boot/dietpi/func/obtain_network_details - # - Make file world-writeable initially, required for DietPi-Login to update it as non-root user - chmod 666 /run/dietpi/.network - #---------------------------------------------------------------- - - } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #---------------------------------------------------------------- - # Init - Run_Init + # Wait for network + # - network-online.target should be an alternative, but ifup@.service is Type=simple which means that hotplug interfaces might not be fully configured before the target is reached. + Wait_For_Valid_Network_Connection + #---------------------------------------------------------------- + # Network time sync + # - Do not run before firstrun setup has finished, since related dietpi.txt settings are applied during first DietPi-Software run. + (( $G_DIETPI_INSTALL_STAGE > 1 )) && /boot/dietpi/func/run_ntpd 1 + #---------------------------------------------------------------- + # Write network details to /run/dietpi/.network + /boot/dietpi/func/obtain_network_details + # - Make file world-writeable initially, required for DietPi-Login to update it as non-root user + chmod 666 /run/dietpi/.network #---------------------------------------------------------------- # Pre-installed image, 1st run if (( $G_DIETPI_INSTALL_STAGE == 10 )); then @@ -90,10 +86,6 @@ echo $G_DIETPI_INSTALL_STAGE > /boot/dietpi/.install_stage fi - #---------------------------------------------------------------- - # Normal boot - # - Run time sync - (( $G_DIETPI_INSTALL_STAGE == 2 )) && /boot/dietpi/func/run_ntpd 1 #----------------------------------------------------------------------------------- exit #----------------------------------------------------------------------------------- From e5fc3bb195ffa99d0116ab741222803b7b9df327 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 14:37:29 +0200 Subject: [PATCH 005/182] v6.31 + DietPi-Software | GMediaRender/WireGuard: Update network info before reading info file on service start. This prevents invalid IP info if DHCP lease on boot finishes before obtain_network_details is called or if during session the device is connected to a different network or DHCP applies a new IP and services are (re)started afterwards. Planned long-term solution is a set of functions to read network info directly from system instead of relying on correct /run/dietpi/.network content (ToDo). --- dietpi/dietpi-software | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 21183d5d36..21901be3a6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4627,7 +4627,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- mkdir -p /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn - G_WHIP_MSG "DietPi-NordVPN has been installed.\nOnce DietPi-Software has finished all other installations, you can run the GUI using the following command:\n - dietpi-nordvpn" + G_WHIP_MSG '[ INFO ] DietPi-NordVPN has been installed.\n\nOnce DietPi-Software has finished all other installations, you can run the GUI using the following command:\n - dietpi-nordvpn' fi @@ -9541,6 +9541,7 @@ Address = 10.9.0.1/24 PrivateKey = $( Date: Mon, 11 May 2020 14:53:39 +0200 Subject: [PATCH 006/182] v6.31 + CHANGELOG | Add v6.31 changelog + CHANGELOG | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 + CHANGELOG | After travelling back to the future 2030, we were able to apply bug fixes with alien technology to the v6.30 release back in 2020. --- CHANGELOG.txt | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ad0e62c17a..c26af39c65 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,17 +1,12 @@ -v6.30 -(10/05/30 Hotfix) +v6.31 +(XX/06/20) Changes / Improvements / Optimisations: -- DietPi-Software | qBittorrent: Changed default download file permissions so that Sonarr/Radarr/Lidarr/.. are able to manipulate the downloads after import. Many thanks to @compdealer for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3524 Bug Fixes: -- DietPi-Config | Resolved an issue where on RPi3/4/Zero W onboard WiFi could not be enabled. Many thanks to @elitearmedforce for reporting this issue: https://github.com/MichaIng/DietPi/issues/3510 -- DietPi-Drive_Manager | Resolved an issue on Raspberry Pi where, after running DietPi-Drive_Manager, the root file system was mount read-only. Many thanks to @Adsouza98 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3511 -- DietPi-Banner | Resolved an issue where non-root users were unable to download a new MOTD (message of the day). Many thanks to @PeterLacknase and @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3505, https://github.com/MichaIng/DietPi/issues/3520 -- DietPi-Boot | Resolved an issue where non-root users were unable to read or update DietPi-internal network info, which lead to e.g. error messages on login. Many thanks to @PeterLacknase for reporting this issue: https://github.com/MichaIng/DietPi/issues/3505 -- DietPi-Update | Resolved an issue where on DietPi pre-v6.16 system some DietPi scripts were accidentally removed during update. Many thanks to @Vec7or and @littis for reporting this issue: https://github.com/MichaIng/DietPi/issues/3509, https://github.com/MichaIng/DietPi/issues/3513 +- DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 -Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/3526 +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 Known/Outstanding Issues: - DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 @@ -29,6 +24,23 @@ For all additional issues that may appear after release, please see the followin ----------------------------------------------------------------------------------------------------------- +v6.30 +(10/05/20 Hotfix) + +Changes / Improvements / Optimisations: +- DietPi-Software | qBittorrent: Changed default download file permissions so that Sonarr/Radarr/Lidarr/.. are able to manipulate the downloads after import. Many thanks to @compdealer for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3524 + +Bug Fixes: +- DietPi-Config | Resolved an issue where on RPi3/4/Zero W onboard WiFi could not be enabled. Many thanks to @elitearmedforce for reporting this issue: https://github.com/MichaIng/DietPi/issues/3510 +- DietPi-Drive_Manager | Resolved an issue on Raspberry Pi where, after running DietPi-Drive_Manager, the root file system was mount read-only. Many thanks to @Adsouza98 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3511 +- DietPi-Banner | Resolved an issue where non-root users were unable to download a new MOTD (message of the day). Many thanks to @PeterLacknase and @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3505, https://github.com/MichaIng/DietPi/issues/3520 +- DietPi-Boot | Resolved an issue where non-root users were unable to read or update DietPi-internal network info, which lead to e.g. error messages on login. Many thanks to @PeterLacknase for reporting this issue: https://github.com/MichaIng/DietPi/issues/3505 +- DietPi-Update | Resolved an issue where on DietPi pre-v6.16 system some DietPi scripts were accidentally removed during update. Many thanks to @Vec7or and @littis for reporting this issue: https://github.com/MichaIng/DietPi/issues/3509, https://github.com/MichaIng/DietPi/issues/3513 + +Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/3526 + +----------------------------------------------------------------------------------------------------------- + v6.29 (03/05/20) From d3231a234b5146ccef4a7aec196cdb93f711b739 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 17:44:27 +0200 Subject: [PATCH 007/182] v6.31 + DietPi-Fan_control | Minor coding enhancements --- .meta/dietpi-fan_control | 100 +++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 56 deletions(-) diff --git a/.meta/dietpi-fan_control b/.meta/dietpi-fan_control index 5e26db3a32..1fe8baf5ac 100644 --- a/.meta/dietpi-fan_control +++ b/.meta/dietpi-fan_control @@ -33,7 +33,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # Import DietPi-Globals --------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - export G_PROGRAM_NAME='DietPi-Fan_control' + G_PROGRAM_NAME='DietPi-Fan_control' G_CHECK_ROOT_USER G_INIT # Import DietPi-Globals --------------------------------------------------------------- @@ -60,15 +60,15 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # Grab valid input INPUT=0 - if [[ $@ ]]; then + if [[ $* ]]; then - if disable_error=1 G_CHECK_VALIDINT "$@"; then + if disable_error=1 G_CHECK_VALIDINT "$*"; then - INPUT=$@ + INPUT=$* else - G_DIETPI-NOTIFY 1 "Invalid input argument ($@) found. Aborting...\n$AVAIABLE_COMMANDS" + G_DIETPI-NOTIFY 1 "Invalid input argument ($*) found. Aborting...\n$AVAIABLE_COMMANDS" exit 1 fi @@ -81,38 +81,37 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # Read currently applied fan control values Read_Control_Files(){ - # - Read current fan control toggle + # Read current fan control toggle TEMP_CONTROLLED_CURRENT=$(<$FP_TEMP_CONTROLLED) - # - Read current trip point temperatures, assuming values of CPU0 for all CPUs - local fp_target='' - local i=0 - TRIP_TEMPS_CURRENT='' + # Read current trip point temperatures, assuming values of CPU0 for all CPUs + local fp_target i=0 + TRIP_TEMPS_CURRENT= for fp_target in /sys/devices/virtual/thermal/thermal_zone0/trip_point_*_temp do - # - Convert "XY000" to XY°C + # Convert "XY000" to XY°C TRIP_TEMPS_CURRENT+=" $(( $( Non-interactively apply settings from $FP_SETTINGS. # Verify valid settings, before applying Verify_Settings(){ - # - $TEMP_CONTROLLED is expected to be either 0 or 1. - if ! [[ $TEMP_CONTROLLED == 0 || $TEMP_CONTROLLED == 1 ]]; then + # $TEMP_CONTROLLED is expected to be either 0 or 1. + if [[ $TEMP_CONTROLLED != [01] ]]; then G_DIETPI-NOTIFY 1 "Invalid setting: \$TEMP_CONTROLLED=$TEMP_CONTROLLED" return 1 elif (( $TEMP_CONTROLLED )); then - # - $TRIP_SPEEDS and $TRIP_TEMPS are expected to follow scheme: [0-9]+[[:blank:]][0-9]+... - # - $TRIP_TEMPS need to match than $TRIP_POINT_COUNT: Amount of actual CPU0 thermal zone control files - # - $TRIP_SPEEDS values need to be exactly one more: Min speed + one each temp trip + # $TRIP_SPEEDS and $TRIP_TEMPS are expected to follow scheme: [0-9]+[[:blank:]][0-9]+... + # $TRIP_TEMPS need to match than $TRIP_POINT_COUNT: Amount of actual CPU0 thermal zone control files + # $TRIP_SPEEDS values need to be exactly one more: Min speed + one each temp trip if ! [[ $TRIP_TEMPS =~ ^[0-9[:blank:]]+$ && $TRIP_SPEEDS =~ ^[0-9[:blank:]]+$ ]] || ! (( $(wc -w <<< "$TRIP_TEMPS") == $TRIP_POINT_COUNT && $(wc -w <<< "$TRIP_SPEEDS") == $TRIP_POINT_COUNT + 1 )); then @@ -146,10 +145,10 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. fi - elif (( ! $TEMP_CONTROLLED )); then + else - # - $STATIC_SPEED is expected to be an integer. - if ! disable_error=1 G_CHECK_VALIDINT $STATIC_SPEED; then + # $STATIC_SPEED is expected to be an integer. + if ! disable_error=1 G_CHECK_VALIDINT "$STATIC_SPEED"; then G_DIETPI-NOTIFY 1 "Invalid setting: \$STATIC_SPEED=$STATIC_SPEED" return 1 @@ -166,12 +165,12 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # Write settings to file Write_Settings(){ - # - Write fan control toggle to settings file + # Write fan control toggle to settings file echo "TEMP_CONTROLLED=$TEMP_CONTROLLED" > $FP_SETTINGS if (( $TEMP_CONTROLLED )); then - # - Write trip points and attached temperatures to settings file + # Write trip points and attached temperatures to settings file cat << _EOF_ >> $FP_SETTINGS TRIP_TEMPS='$TRIP_TEMPS' TRIP_SPEEDS='$TRIP_SPEEDS' @@ -200,10 +199,8 @@ _EOF_ local i=0 # Apply trip point temps - local j=0 - local temp=0 - local fp_target='' - for (( i=0; i<$G_HW_CPU_CORES; i++ )) + local j=0 temp=0 fp_target + for ((i=0; i<$G_HW_CPU_CORES; i++)) do j=0 @@ -223,7 +220,7 @@ _EOF_ done # Apply trip point fan speeds - local trip_speeds_target= + local trip_speeds_target for i in $TRIP_SPEEDS do @@ -250,8 +247,7 @@ _EOF_ #----------------------------------------------------------------------------------- Reset_Menu(){ - G_WHIP_YESNO 'Reset fan control settings\n\nYour fan control settings file will be removed and current selections purged. This will take effect after next reboot.\n\nDo you want to continue?' - if (( ! $? )); then + if G_WHIP_YESNO 'Reset fan control settings\n\nYour fan control settings file will be removed and current selections purged. This will take effect after next reboot.\n\nDo you want to continue?'; then [[ -f $FP_SETTINGS ]] && G_EXEC_DESC="Removing $FP_SETTINGS" G_EXEC rm $FP_SETTINGS G_EXEC_DESC='Resetting current selections' G_EXEC unset TEMP_CONTROLLED TRIP_TEMPS TRIP_SPEEDS STATIC_SPEED @@ -299,18 +295,18 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ Main_Menu(){ - local i='' + local i # Read currently applied fan controls, to generate status message Read_Control_Files - local whip_message='' + local whip_message if (( $TEMP_CONTROLLED_CURRENT )); then - # - Current control mode + # Current control mode whip_message+='Mode: Temperature controlled' - # - Current trip point temps + # Current trip point temps whip_message+='\nTemp points: ' for i in $TRIP_TEMPS_CURRENT do @@ -319,7 +315,7 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ done - # - Current trip point speeds + # Current trip point speeds whip_message+='\nFan speeds:' for i in $TRIP_SPEEDS_CURRENT do @@ -330,15 +326,15 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ else - # - Current control mode + # Current control mode whip_message+='Mode: Static fan speed' - # - Static fan speed + # Static fan speed whip_message+="\nFan speed: ${STATIC_SPEED_CURRENT}%" fi - # - Control mode setting + # Control mode setting TEMP_CONTROLLED=${TEMP_CONTROLLED:-$TEMP_CONTROLLED_CURRENT} local mode_text='Static fan speed' (( $TEMP_CONTROLLED )) && mode_text='Temperature controlled' @@ -351,9 +347,9 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ if (( $TEMP_CONTROLLED )); then - # - Trip point temperature settings + # Trip point temperature settings TRIP_TEMPS=${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT} - local trip_temps_text='' + local trip_temps_text for i in $TRIP_TEMPS do @@ -362,9 +358,9 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ done G_WHIP_MENU_ARRAY+=( 'Temp points' "Selected: $trip_temps_text" ) - # - Trip point speed settings + # Trip point speed settings TRIP_SPEEDS=${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT} - local trip_speeds_text='' + local trip_speeds_text for i in $TRIP_SPEEDS do @@ -392,15 +388,7 @@ EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_ elif [[ $G_WHIP_RETURNED_VALUE == 'Mode' ]]; then - if (( $TEMP_CONTROLLED )); then - - TEMP_CONTROLLED=0 - - else - - TEMP_CONTROLLED=1 - - fi + (( $TEMP_CONTROLLED )) && TEMP_CONTROLLED=0 || TEMP_CONTROLLED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'Temp points' ]]; then From 66039a213b8ec3444c70415efbbd27971d4827b8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 17:47:45 +0200 Subject: [PATCH 008/182] v6.31 + DietPi-Backup | Minor coding enhancements --- dietpi/dietpi-backup | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 46bb370f30..604f7ad5ad 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -166,10 +166,10 @@ _EOF_ G_WHIP_BUTTON_OK_TEXT='Ignore' G_WHIP_BUTTON_CANCEL_TEXT='Exit' - G_WHIP_YESNO 'The backup target location appears to have insufficient free space to successfully finish the backup.\nHowever, this check is a rough estimation in reasonable time, thus it could be marginally incorrect.\n\nWould you like to override this warning and continue with the backup?' - if (( $? )); then + if ! G_WHIP_YESNO 'The backup target location appears to have insufficient free space to successfully finish the backup.\nHowever, this check is a rough estimation in reasonable time, thus it could be marginally incorrect. +\nWould you like to override this warning and continue with the backup?'; then - echo -e "$RSYNC_MODE_TEXT canceled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + echo -e "$RSYNC_MODE_TEXT cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" break fi @@ -514,8 +514,7 @@ _EOF_ Input_User_Directory(){ G_WHIP_DEFAULT_ITEM=$FP_TARGET - G_WHIP_INPUTBOX "Please enter the filepath to your directory. \neg: /mnt/dietpi-backup\n - Must be located inside /mnt/* \n - Must be symlink compatible filesystem (ext2/3/4)" - (( $? == 0 )) && FP_TARGET=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX "Please enter the filepath to your directory. \neg: /mnt/dietpi-backup\n - Must be located inside /mnt/* \n - Must be symlink compatible filesystem (ext2/3/4)" && FP_TARGET=$G_WHIP_RETURNED_VALUE } @@ -525,7 +524,6 @@ _EOF_ Error_Filesystem_Not_Supported(){ G_DIETPI-NOTIFY 1 "Filesystem not supported in $FP_TARGET" - G_WHIP_MSG "Error:\n\n$FP_TARGET Has a filesystem of: $TARGET_FILESYSTEM_TYPE, and is not supported.\n\nThe filesystem must be EXT2/3/4 for symlink compatibility." } @@ -533,7 +531,6 @@ _EOF_ Error_Not_Mnt_Directory(){ G_DIETPI-NOTIFY 1 "Target directory is not inside /mnt ($FP_TARGET)" - G_WHIP_MSG "Directory not supported:\n- $FP_TARGET\n\nThe location must be inside the /mnt/* directory.\n - eg: /mnt/dietpi-backup" } @@ -541,7 +538,6 @@ _EOF_ Error_DietpiUserdata_Directory(){ G_DIETPI-NOTIFY 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET)" - G_WHIP_MSG "Directory not supported:\n- $FP_TARGET\n\nTarget directory can not be contained within DietPi user data location ($G_FP_DIETPI_USERDATA)" } @@ -549,9 +545,7 @@ _EOF_ Error_Rsync_Already_Running(){ G_DIETPI-NOTIFY 1 'Another Rsync process is already running.' - echo -e "$RSYNC_MODE_TEXT failed: $(date +"%d-%m-%Y_%H%M"). Rsync is already running." >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT Error:\n\nA $RSYNC_MODE_TEXT could not be started as rsync is already running." } From 16ec16e40e45dacd6a3e4d6ffe79f6ae06164ff1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 17:58:48 +0200 Subject: [PATCH 009/182] v6.31 + DietPi-Cleaner | Minor coding enhancements --- dietpi/dietpi-cleaner | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 8c27731045..120dd52350 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -77,8 +77,7 @@ ) G_WHIP_BUTTON_CANCEL_TEXT='Exit' - G_WHIP_MENU "Free up used space and system resources:\n - RootFS usage current = $ROOT_SPACE_USED_CURRENT MiB\n - RootFS space cleared = $ROOT_SPACE_FREE_DELTA MiB" - if (( $? == 0 )); then + if G_WHIP_MENU "Free up used space and system resources:\n - RootFS usage current = $ROOT_SPACE_USED_CURRENT MiB\n - RootFS space cleared = $ROOT_SPACE_FREE_DELTA MiB"; then case "$G_WHIP_RETURNED_VALUE" in @@ -313,7 +312,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners INCLUDE_MNT=0 DRY_RUN=0 - INFO_CLEAN_NAME='' + INFO_CLEAN_NAME= Run_Cleaners(){ @@ -361,7 +360,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." Banner_Cleaning # Find packages and convert into 1 line string - local string_package_names=$(echo $(dpkg --get-selections *-dev build-essential make automake autoconf 2> /dev/null | mawk '{print $1}')) + local string_package_names=$(dpkg --get-selections '*-dev' build-essential make automake autoconf 2> /dev/null | mawk '{print $1}' ORS=' ') # Mark for autoremoval if (( $DRY_RUN )); then @@ -387,7 +386,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." Banner_Cleaning # Find packages and convert into 1 line string - local string_package_names=$(echo $(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}')) + local string_package_names=$(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}' ORS=' ') # Mark for autoremoval if (( $DRY_RUN )); then @@ -473,7 +472,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." fi # Remove files - while read line + while read -r line do echo "- Filepath: $line" From 20a9d33a92a709702425edb2bf705f7eea21b5ca Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:00:00 +0200 Subject: [PATCH 010/182] v6.31 + DietPi-Cloudshell | Minor coding enhancements --- dietpi/dietpi-cloudshell | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 3b64d35ed5..084acced1e 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -1602,8 +1602,7 @@ _EOF_ ) G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Automatically power down the screen and disable DietPi-Cloudshell processing during a specific time.\n\nNB: This feature will only work if DietPi-Cloudshell was launched with the DietPi-Autostart option, or, launched from the main screen (tty1).' - if (( $? == 0 )); then + if G_WHIP_MENU 'Automatically power down the screen and disable DietPi-Cloudshell processing during a specific time.\n\nNB: This feature will only work if DietPi-Cloudshell was launched with the DietPi-Autostart option, or, launched from the main screen (tty1).'; then if [[ $G_WHIP_RETURNED_VALUE == 'Toggle' ]];then @@ -1659,8 +1658,7 @@ _EOF_ done G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Storage Device Mount Location:\n\nDietPi-Cloudshell pulls the storage stats from the drive mount location. If you have custom drives/mounts, please set them here to be displayed during storage scene updates.\n\n - Drive 1 = Displayed during main storage scene\n - Drive 2/3 = Displayed during additional storage scene\n - Drive 4/5 = Displayed during additional storage scene' - if (( $? == 0 )); then + if G_WHIP_MENU 'Storage Device Mount Location:\n\nDietPi-Cloudshell pulls the storage stats from the drive mount location. If you have custom drives/mounts, please set them here to be displayed during storage scene updates.\n\n - Drive 1 = Displayed during main storage scene\n - Drive 2/3 = Displayed during additional storage scene\n - Drive 4/5 = Displayed during additional storage scene'; then local index=$G_WHIP_RETURNED_VALUE From b793f20fe85b82e2066537f3b3a523bfc6f8bfdb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:13:01 +0200 Subject: [PATCH 011/182] v6.31 + DietPi-Config | Minor coding enhancements --- dietpi/dietpi-config | 59 ++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 6e4d040d77..2dcfd94998 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -650,8 +650,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin if disable_error=1 G_CHECK_VALIDINT "$current_brightness"; then G_WHIP_DEFAULT_ITEM=$current_brightness - G_WHIP_INPUTBOX "Please enter a brightness value:\n - Min = $MIN_VALUE | Max = $MAX_VALUE" - if (( $? == 0 )) && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then + if G_WHIP_INPUTBOX "Please enter a brightness value:\n - Min = $MIN_VALUE | Max = $MAX_VALUE" && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then echo $G_WHIP_RETURNED_VALUE > $fp_brightness/brightness @@ -2092,8 +2091,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR ) - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent : HDMI: [$display_output_text] | VPU: [$display_output_text]\nMemory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM\nNB: GPU/RAM figures require a reboot after a change is made." - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent : HDMI: [$display_output_text] | VPU: [$display_output_text]\nMemory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM\nNB: GPU/RAM figures require a reboot after a change is made."; then REBOOT_REQUIRED=1 @@ -3027,8 +3025,7 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then Net_Update_UsageStats eth$ETH_DEV_INDEX G_WHIP_DEFAULT_ITEM=$WHIP_SELECTION_PREVIOUS - G_WHIP_MENU "Ethernet Details:\nUsage : Sent = $NET_TX_MB | Recieved = $NET_RX_MB\nAddress : IP = $ETH_IP | Mask = $ETH_MASK | Gateway = $ETH_GATEWAY | DNS = $ETH_DNS" - if (( $? == 0 )); then + if G_WHIP_MENU "Ethernet Details:\nUsage : Sent = $NET_TX_MB | Recieved = $NET_RX_MB\nAddress : IP = $ETH_IP | Mask = $ETH_MASK | Gateway = $ETH_GATEWAY | DNS = $ETH_DNS"; then TARGETMENUID=9 # Return to this menu @@ -3249,8 +3246,7 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then 'Key') G_WHIP_DEFAULT_ITEM=$HOTSPOT_KEY - G_WHIP_INPUTBOX 'Please enter a key/password for the WiFi hotspot\n - NB: Minimum of 8 characters' - (( $? == 0 )) && HOTSPOT_KEY=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter a key/password for the WiFi hotspot\n - NB: Minimum of 8 characters' && HOTSPOT_KEY=$G_WHIP_RETURNED_VALUE ;; @@ -3484,8 +3480,7 @@ Additional benchmarks: ) - G_WHIP_MENU 'Please select an option:\n\n - Server: Run a server on the current device. Another system can then use the "Client" option to connect and begin the test.\n\n - Client: Connect to an existing server and begin the test.' - if (( $? == 0 )); then + if G_WHIP_MENU 'Please select an option:\n\n - Server: Run a server on the current device. Another system can then use the "Client" option to connect and begin the test.\n\n - Client: Connect to an existing server and begin the test.'; then if [[ $G_WHIP_RETURNED_VALUE == 'Server' ]]; then @@ -3588,10 +3583,10 @@ Additional benchmarks: TARGETMENUID=4 # Get Current Overclocking Settings - local over_voltage_value=$(grep -m1 'over_voltage=' /boot/config.txt | tr -d '#over_voltage=') - local arm_freq_value=$(grep -m1 'arm_freq=' /boot/config.txt | tr -d '#arm_freq=') - local core_freq_value=$(grep -m1 'core_freq=' /boot/config.txt | tr -d '#core_freq=') - (( $G_HW_MODEL == 4 )) || local sdram_freq_value=$(grep -m1 'sdram_freq=' /boot/config.txt | tr -d '#sdram_freq=') + local over_voltage_value=$(sed -n '/over_voltage=/{s/^[^=]*=//p;q}' /boot/config.txt) + local arm_freq_value=$(sed -n '/arm_freq=/{s/^[^=]*=//p;q}' /boot/config.txt) + local core_freq_value=$(sed -n '/core_freq=/{s/^[^=]*=//p;q}' /boot/config.txt) + (( $G_HW_MODEL == 4 )) || local sdram_freq_value=$(sed -n '/sdram_freq=/{s/^[^=]*=//p;q}' /boot/config.txt) # Overclocking RPi1 # - Zero @@ -3599,8 +3594,7 @@ Additional benchmarks: G_WHIP_MENU_ARRAY=('none' ': 1000 MHz ARM | 400 MHz core | 450 MHz SDRAM | 0 overvolt') - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt"; then TARGETMENUID=13 # Return to this menu @@ -3627,8 +3621,7 @@ Additional benchmarks: ) - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt"; then TARGETMENUID=13 # Return to this menu @@ -3690,8 +3683,7 @@ Additional benchmarks: ) - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt"; then TARGETMENUID=13 # Return to this menu @@ -3765,8 +3757,7 @@ Additional benchmarks: fi - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt"; then TARGETMENUID=13 # Return to this menu @@ -3836,8 +3827,7 @@ Additional benchmarks: ) - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $over_voltage_value overvolt" - if (( $? == 0 )); then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $over_voltage_value overvolt"; then TARGETMENUID=13 # Return to this menu Reset_Overclocking @@ -4276,16 +4266,12 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp [[ $ntp_mirror_current ]] || ntp_mirror_current='Unknown, no string from scrape' # Network boot wait - local boot_wait_for_network=$(grep -m1 '^[[:blank:]]*CONFIG_BOOT_WAIT_FOR_NETWORK=' /boot/dietpi.txt | sed 's/^[^=]*=//') - local boot_wait_for_network_text='' + local boot_wait_for_network=$(sed -n '/^[[:blank:]]*CONFIG_BOOT_WAIT_FOR_NETWORK=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + local boot_wait_for_network_text='10 Seconds MAX (default)' if (( $boot_wait_for_network == 0 )); then boot_wait_for_network_text+='Off' - elif (( $boot_wait_for_network == 1 )); then - - boot_wait_for_network_text+='10 Seconds MAX (default)' - elif (( $boot_wait_for_network == 2 )); then boot_wait_for_network_text+='Infinite wait' @@ -4344,8 +4330,7 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN 'Network Drives') - G_WHIP_YESNO 'The ability to mount and control networked drives has moved to:\n - DietPi-Drive_manager\n\nWould you like to launch the program now?' - (( $? == 0 )) && /boot/dietpi/dietpi-drive_manager + G_WHIP_YESNO 'The ability to mount and control networked drives has moved to:\n - DietPi-Drive_manager\n\nWould you like to launch the program now?' && /boot/dietpi/dietpi-drive_manager ;; @@ -4360,14 +4345,13 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN ) G_WHIP_DEFAULT_ITEM=$boot_wait_for_network - G_WHIP_MENU 'The following options will allow you to delay boot, until a valid network connection is available:' - (( $? == 0 )) && G_CONFIG_INJECT 'CONFIG_BOOT_WAIT_FOR_NETWORK=' "CONFIG_BOOT_WAIT_FOR_NETWORK=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt + G_WHIP_MENU 'The following options will allow you to delay boot, until a valid network connection is available:' && G_CONFIG_INJECT 'CONFIG_BOOT_WAIT_FOR_NETWORK=' "CONFIG_BOOT_WAIT_FOR_NETWORK=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt ;; 'APT Mirror') - local failure='' + local failure= while : do @@ -4439,12 +4423,11 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN ) G_WHIP_DEFAULT_ITEM=$ntp_mirror_current - G_WHIP_MENU 'Please select an NTP mirror:\n + if G_WHIP_MENU 'Please select an NTP mirror:\n "Gateway": Try to detect and use local router for time sync. Recommended, allows fastest sync and reduces load to the *.pool.ntp.org servers.\n "Custom": Manually enter local or external NTP server address(es).\n "Default": Leave mirror choice to system. Usually falls back to local gateway (Stretch+ only) or "debian.pool.ntp.org".\n -Use "*.pool.ntp.org" mirrors, if your device is mobile or should act as local NTP server. Further information: "http://www.pool.ntp.org/zone/@"' - if [[ $? == 0 && $G_WHIP_RETURNED_VALUE ]]; then +Use "*.pool.ntp.org" mirrors, if your device is mobile or should act as local NTP server. Further information: "http://www.pool.ntp.org/zone/@"' && [[ $G_WHIP_RETURNED_VALUE ]]; then case $G_WHIP_RETURNED_VALUE in From 6ad6f8ae9354e1a53159a6e70bd70997c1f7e029 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:17:46 +0200 Subject: [PATCH 012/182] v6.31 + DietPi-Drive_Manager | Tiny coding --- dietpi/dietpi-drive_manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 4f5fb5e760..9a7fa7e728 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -1177,7 +1177,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return for i in $(<$io_schedulers) do - if [[ $i == \[*\] ]]; then + if [[ $i == '['*']' ]]; then i=${i#[}; i=${i%]} local io_scheduler_current=$i From e5db997ec3c5bb8b78292166dde7e6ec757c8f4d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:23:33 +0200 Subject: [PATCH 013/182] v6.31 + DietPi-LED_control | Minor code enhancements --- dietpi/dietpi-led_control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control index f1e3ad06c8..ec9ccc3efe 100644 --- a/dietpi/dietpi-led_control +++ b/dietpi/dietpi-led_control @@ -124,9 +124,9 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Reset' ]]; then G_EXEC_NOHALT=1 G_EXEC sed -i "/KERNEL==\"${aNAME[$SELECTED_LED]}\"/d" $FP_UDEV_RULES || return 1 - unset aTRIGGER_SELECTED[$SELECTED_LED] + unset "aTRIGGER_SELECTED[$SELECTED_LED]" G_WHIP_MSG "LED trigger for ${aNAME[$SELECTED_LED]} has been reset to system defaults.\n\nThis will become active from next reboot." - [[ ${aTRIGGER_SELECTED[@]} || ! -f $FP_UDEV_RULES ]] || G_EXEC_NOHALT=1 G_EXEC rm $FP_UDEV_RULES || return 1 + [[ ${aTRIGGER_SELECTED[*]} || ! -f $FP_UDEV_RULES ]] || G_EXEC_NOHALT=1 G_EXEC rm $FP_UDEV_RULES || return 1 else From 3ce567875141a50f06157b0a875f1d6637e6d934 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:42:14 +0200 Subject: [PATCH 014/182] v6.31 + DietPi-Services | Minor coding enhancements --- dietpi/dietpi-services | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index ca39dfaa74..a8bfd75e8e 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -261,7 +261,7 @@ _EOF_ aSERVICE_EXCLUDED=() local i - while read line + while read -r line do # Include @@ -294,7 +294,7 @@ _EOF_ if [[ $INPUT_CMD ]]; then [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 2 "Excluding service: $line" - unset aSERVICE_NAME[$i] + unset "aSERVICE_NAME[$i]" else @@ -329,7 +329,7 @@ _EOF_ for i in ${!aSERVICE_NAME[@]} do - [[ ${aSERVICE_NAME[$i]} ]] || { unset aSERVICE_NAME[$i]; continue; } # Failsafe + [[ ${aSERVICE_NAME[$i]} ]] || { unset "aSERVICE_NAME[$i]"; continue; } # Failsafe # Check for sysvinit services from systemd-sysv-generator dir: /run/systemd/generator.late/ for j in /{{etc,usr/local/lib,lib,usr/lib}/systemd/system,run/systemd/generator.late}/"${aSERVICE_NAME[$i]}.service" @@ -346,7 +346,7 @@ _EOF_ done # Remove non-available services from array - [[ ${aFP_SERVICE[$i]} ]] || unset aSERVICE_NAME[$i] + [[ ${aFP_SERVICE[$i]} ]] || unset "aSERVICE_NAME[$i]" done @@ -384,7 +384,7 @@ _EOF_ # - start/restart: Standard service order else - services=${!aSERVICE_NAME[@]} + services=${!aSERVICE_NAME[*]} fi @@ -425,7 +425,7 @@ _EOF_ local index=$2 local services i - [[ $index ]] && services=$index || services=${!aSERVICE_NAME[@]} + [[ $index ]] && services=$index || services=${!aSERVICE_NAME[*]} # start/stop/restart if [[ $command == 'start' || $command == 'stop' || $command == 'restart' ]]; then @@ -540,14 +540,14 @@ _EOF_ # Reset all process tool settings if [[ $setting == 'reset' ]]; then - for i in {0..5}; do unset ${aarray[$i]}[$index]; done + for i in {0..5}; do unset "${aarray[$i]}[$index]"; done [[ -f $fp ]] && G_EXEC rm "$fp" [[ -d $dp ]] && G_EXEC rmdir --ignore-fail-on-non-empty "$dp" # Reset single process tool setting elif [[ $value == 'reset' ]]; then - unset ${aarray[$setting]}[$index] + unset "${aarray[$setting]}[$index]" [[ -f $fp ]] && G_EXEC sed -i "/^${asetting[$setting]}=/d" "$fp" # Apply process tool setting @@ -858,7 +858,7 @@ _EOF_ (( $SYSTEMD_RELOAD_REQUIRED )) && G_EXEC systemctl daemon-reload && SYSTEMD_RELOAD_REQUIRED=0 Set_Running_State $command $MENU_SERVICE_INDEX - unset aSERVICE_RESTART_REQUIRED[$MENU_SERVICE_INDEX] + unset "aSERVICE_RESTART_REQUIRED[$MENU_SERVICE_INDEX]" sleep 0.5 ;; @@ -913,7 +913,7 @@ This affects starts/stops/restarts during DietPi-Software installs, DietPi-Updat if grep -q "^+ ${aSERVICE_NAME[$MENU_SERVICE_INDEX]}" $FP_INCLUDE_EXCLUDE; then sed -i "/^+ ${aSERVICE_NAME[$MENU_SERVICE_INDEX]}/d" $FP_INCLUDE_EXCLUDE - unset aSERVICE_NAME[$MENU_SERVICE_INDEX] + unset "aSERVICE_NAME[$MENU_SERVICE_INDEX]" # Service needs to be re-added from main menu MENU_TARGETID=0 # Return to main menu From b1f44ac15b415f7a993dacb82aef8616ca961c83 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:43:05 +0200 Subject: [PATCH 015/182] v6.31 + DietPi-Survey | Tiny code enhancement --- dietpi/dietpi-survey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 1e308fa435..804856b44c 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -77,7 +77,7 @@ _EOF_ echo -e '# -------------------------\n# DietPi-Software installs\n# -------------------------' >> $FP_UPLOAD - while read software + while read -r software do software=${software##*[} From 957a933e4409684de738be00c6d65bcd15600380 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:43:59 +0200 Subject: [PATCH 016/182] v6.31 + DietPi-Change_hostname | Tiny code enhancement --- dietpi/func/change_hostname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname index f6c693d230..4f83b25c55 100644 --- a/dietpi/func/change_hostname +++ b/dietpi/func/change_hostname @@ -25,7 +25,7 @@ # Import DietPi-Globals -------------------------------------------------------------- # Grab input - INPUT=$@ + INPUT=$* #///////////////////////////////////////////////////////////////////////////////////// # Main Loop From a2bfe60db37c113203711ed9346117403f1b7cd4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:44:54 +0200 Subject: [PATCH 017/182] v6.31 + DietPi-Benchmark | Tiny code enhancement --- dietpi/func/dietpi-benchmark | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 2b443e1287..0e2f9ba8c6 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -285,8 +285,7 @@ You can compare results against other users and hardware using the following lin # - Additional checks if (( $G_HW_CPU_CORES < 3 )); then - G_WHIP_YESNO "We have detected a low CPU core count ($G_HW_CPU_CORES). The tests may take upto 5 minutes to complete (eg: RaspberryPi Zero).\n\nDo you wish to continue?" - (( $? )) && exit 0 + G_WHIP_YESNO "We have detected a low CPU core count ($G_HW_CPU_CORES). The tests may take upto 5 minutes to complete (eg: RaspberryPi Zero).\n\nDo you wish to continue?" || exit 0 fi From 36409091db33e4cfafef3ebce8b7a104d4876952 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 18:54:46 +0200 Subject: [PATCH 018/182] v6.31 + DietPi-Globals | Minor code enhancements --- dietpi/func/dietpi-globals | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 05f19d0035..6b7556a6ac 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -445,7 +445,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #----------------------------------------------------------------------------------- # DietPi scripts, moved from /etc/bash.bashrc # - sudo wrapper that ensures DietPi-Globals with G_* commands are loaded - G_SUDO(){ local input=$@; sudo bash -c ". /boot/dietpi/func/dietpi-globals && $input"; } + G_SUDO(){ local input=$*; sudo bash -c ". /boot/dietpi/func/dietpi-globals && $input"; } # - sudo alias that allows running other aliases with "sudo": https://github.com/MichaIng/DietPi/issues/424 alias sudo='sudo ' @@ -1116,7 +1116,7 @@ $log_content" || break # Exit error handler menu loop on cancel # Obtain IP local ip - if [[ ! $@ ]]; then + if [[ ! $* ]]; then ip=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_CONNECTION_IP=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ $ip ]] || ip='9.9.9.9' @@ -1166,7 +1166,7 @@ $log_content" || break # Exit error handler menu loop on cancel # Obtain IP local domain - if [[ ! $@ ]]; then + if [[ ! $* ]]; then domain=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_DNS_DOMAIN=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ $domain ]] || domain='dns9.quad9.net' @@ -1713,8 +1713,7 @@ $log_content" || break # Exit error handler menu loop on cancel if (( ! $G_PROMPT_BACKUP_DISABLED )); then - G_WHIP_YESNO 'Would you like to create (or update) a "DietPi-Backup" of the system, before proceeding?\n\n"DietPi-Backup" creates a system restore point, which can be recovered if unexpected issues occur.\n\nFor more information on "DietPi-Backup", please use the link below:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255' - if (( $? == 0 )); then + if G_WHIP_YESNO 'Would you like to create (or update) a "DietPi-Backup" of the system, before proceeding?\n\n"DietPi-Backup" creates a system restore point, which can be recovered if unexpected issues occur.\n\nFor more information on "DietPi-Backup", please use the link below:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255'; then /boot/dietpi/dietpi-backup 1 local exit_code=$? @@ -1788,7 +1787,7 @@ $log_content" || break # Exit error handler menu loop on cancel [[ $G_THREAD_COUNT =~ ^[0-9]+$ ]] || G_THREAD_COUNT=-1 ((G_THREAD_COUNT++)) - G_THREAD_COMMAND[$G_THREAD_COUNT]=$@ + G_THREAD_COMMAND[$G_THREAD_COUNT]=$* echo -1337 > /tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT { { G_INTERACTIVE=0 ${G_THREAD_COMMAND[$G_THREAD_COUNT]} &> /tmp/.G_THREAD_COMMAND_$G_THREAD_COUNT; echo $? > /tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT; } & disown; } &> /dev/null @@ -1798,7 +1797,7 @@ $log_content" || break # Exit error handler menu loop on cancel # Run in blocking mode else - local command=$@ + local command=$* G_DIETPI-NOTIFY 2 "G_THREADING disabled, running command in blocking mode | $command" $command From 848784d988260d5fcb6b1bd5045f411c04b221a2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:10:34 +0200 Subject: [PATCH 019/182] v6.31 + DietPi-Set_software | Minor code enhancements --- dietpi/func/dietpi-set_software | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 1da4eb04de..2fcb741d95 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -264,8 +264,8 @@ _EOF_ # Gateway, auto detect local gateway(s) (router) to use as NTP server. if [[ ${ntp_mirror,,} == 'gateway' ]]; then - # NB: Convert output to single line via echo - local gateway=$(echo $(ip r s 0.0.0.0/0 | mawk '{print $3}')) + # NB: Convert output to single line via ORS, remove trailing space afterwards + local gateway=$(ip r s 0.0.0.0/0 | mawk '{print $3}' ORS=' ') gateway=${gateway% } if [[ $gateway ]]; then G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)." @@ -484,9 +484,8 @@ _EOF_ else # DietPi-Software PW - G_WHIP_YESNO 'Do you want to adjust the default global software password for DietPi-Software installations? We especially recommend to change the default password "dietpi". This does not affect any existing software passwords.\n -NB: This password will be saved and encrypted within "/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin" to be useable by DietPi scripts for e.g. web application and database logins. We highly recommend to apply individual passwords for each software title after first login.' - if (( ! $? )); then + if G_WHIP_YESNO 'Do you want to adjust the default global software password for DietPi-Software installations? We especially recommend to change the default password "dietpi". This does not affect any existing software passwords.\n +NB: This password will be saved and encrypted within "/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin" to be useable by DietPi scripts for e.g. web application and database logins. We highly recommend to apply individual passwords for each software title after first login.'; then G_WHIP_PASSWORD "Please enter a new global software password:\nNB: The following characters are not supported \$|\\\"'" pw_dietpi_software=$result @@ -495,9 +494,8 @@ NB: This password will be saved and encrypted within "/var/lib/dietpi/dietpi-sof fi # Root/DietPi user PW - G_WHIP_YESNO 'Change existing unix user passwords?\n\nDietPi has two accounts by default "root" and "dietpi". On first boot, both share the global password "dietpi", respectively the one set in "dietpi.txt".\n -It is highly recommended to change this password, ideally, it should be different than the global software password.\n\nWould you like to change the login passwords for "root" and "dietpi"?' - if (( ! $? )); then + if G_WHIP_YESNO 'Change existing unix user passwords?\n\nDietPi has two accounts by default "root" and "dietpi". On first boot, both share the global password "dietpi", respectively the one set in "dietpi.txt".\n +It is highly recommended to change this password, ideally, it should be different than the global software password.\n\nWould you like to change the login passwords for "root" and "dietpi"?'; then G_WHIP_PASSWORD 'Please enter a new unix user password:' pw_root_dietpi_users=$result From 1d541eedf0a973edad28e0cd265a4865b4fc0ff9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:13:09 +0200 Subject: [PATCH 020/182] v6.31 + DietPi-WiFiDB | Tiny code enhancement --- dietpi/func/dietpi-wifidb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-wifidb b/dietpi/func/dietpi-wifidb index 8d3d67809a..92a7a1cd7b 100644 --- a/dietpi/func/dietpi-wifidb +++ b/dietpi/func/dietpi-wifidb @@ -18,7 +18,7 @@ $FP_SCRIPT 1 Applies WiFi creds from DB store to system " #//////////////////////////////////// # Grab Input - INPUT=${@,,} + INPUT=${*,,} ERROR_CODE=0 # Import DietPi-Globals -------------------------------------------------------------- From 338e689f90665dae7d54b696d7a66f16b87bd732 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:13:53 +0200 Subject: [PATCH 021/182] v6.31 + DietPi-Arr_to_RAM | Tiny code enhancement --- dietpi/misc/dietpi-arr_to_RAM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index 7cd98c7e24..384f9475af 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -45,7 +45,7 @@ Supported programs: unset error Print(){ - local message=$@ + local message=$* [[ $error ]] && { message="[ERROR] $message"; EXIT_CODE=$error; } unset error echo "$(date '+%Y-%m-%d %T') | $PROGRAM_NAME: $message" From c2028854ac849747e8fa2a75d47f3ff21d7cfe32 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:15:49 +0200 Subject: [PATCH 022/182] v6.31 + DietPi-Pre-patches | Satisfy CodeFactor --- dietpi/pre-patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 56c08e5871..0b55c50190 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -26,7 +26,7 @@ else echo -e "\e[90m[\e[0m\e[31mFAILED\e[0m\e[90m]\e[0m Invalid input argument ($1)" - exit -1 + exit 255 fi From 2eefa9641e0ba590bd61fabeea8f66c2710eb4fd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:17:54 +0200 Subject: [PATCH 023/182] v6.31 + DietPi-Drive_Manager | Minor code enhancement --- dietpi/dietpi-drive_manager | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9a7fa7e728..36815bd20c 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -159,7 +159,7 @@ $swap_mounts df -a --output=source --exclude-type=tmpfs --exclude-type=ecryptfs --exclude-type=vboxsf --exclude-type=glusterfs | mawk '/\// && !x[$0]++' > .df_out_tmp # Process df result - while read line + while read -r line do # Workaround for /dev/root under RPi, force physical location @@ -274,7 +274,7 @@ $swap_mounts # Check blkid for unmounted drives, if drive is not mounted, add entry as disabled/commented mount blkid -o device > .blkid_out_tmp - while read line + while read -r line do [[ $line ]] || continue @@ -316,7 +316,7 @@ $swap_mounts # Find unformated drives # - Exclude mtdblock devices: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-422400520 lsblk -nro NAME | sed '/^mtdblock[0-9]/d' > .lsblk_out_tmp - while read line + while read -r line do [[ $line ]] || continue @@ -1892,7 +1892,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u df -Ph | tail -n +2 | sed -E '/(^udev|tmpfs)/d' > .df_out_tmp - while read line + while read -r line do G_WHIP_MENU_ARRAY+=("$(mawk '{print $6}' <<< $line)" ": $(mawk '{print $1" | size: "$2"iB | available: "$4"iB"}' <<< $line)") From dc062f03c6759543094db7abab01d0e524125241 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:19:28 +0200 Subject: [PATCH 024/182] v6.31 + DietPi-Drive_Manager | Tiny code enhancement --- dietpi/dietpi-drive_manager | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 36815bd20c..a4535a40d9 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -1611,8 +1611,7 @@ Read more about I/O scheduling: https://wiki.archlinux.org/index.php/Improving_p G_WHIP_BUTTON_OK_TEXT='MBR' G_WHIP_BUTTON_CANCEL_TEXT='GPT' - G_WHIP_YESNO 'Would you like to use GPT or MBR parition table?\n - GPT is required for 2TB+ drives\n - MBR does NOT support 2TB+ drives\n\nIf unsure, select GPT (default)' - (( $? )) && FORMAT_GPT=1 || FORMAT_GPT=0 + G_WHIP_YESNO 'Would you like to use GPT or MBR parition table?\n - GPT is required for 2TB+ drives\n - MBR does NOT support 2TB+ drives\n\nIf unsure, select GPT (default)' && FORMAT_GPT=0 || FORMAT_GPT=1 elif [[ $G_WHIP_RETURNED_VALUE == 'Format Mode' ]]; then From ea0e202f47cb11aff52c03d798d1bd4ecbecf467 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:28:15 +0200 Subject: [PATCH 025/182] META | Add CodeFactor to DietPi source section and bash to 3rd party list --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bcf36dd895..8cc17b0900 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ along with this program. If not, see https://www.gnu.org/licenses/ - Source: https://github.com/MichaIng/DietPi - Build: Not applicable, as DietPi uses Bash scripts only, no building or compiling is required. +- [![CodeFactor](https://www.codefactor.io/repository/github/michaing/dietpi/badge)](https://www.codefactor.io/repository/github/michaing/dietpi) ### DietPi Files @@ -199,6 +200,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [Linux kernel](https://github.com/torvalds/linux) - [GNU operating system](https://www.gnu.org/) +- [Bash](https://git.savannah.gnu.org/cgit/bash.git) - [Debian distribution](https://salsa.debian.org/) - [Raspberry](https://github.com/raspberrypi) [Pi](https://github.com/RPi-Distro) - [Hardkernel](https://github.com/hardkernel?tab=repositories) From e8a51485c8e980f9f2a16921958fcf145adbae22 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:32:21 +0200 Subject: [PATCH 026/182] v6.31 + DietPi-PREP | Tiny code enhancement --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 753825adab..2ad8851d6e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -958,7 +958,7 @@ _EOF_' # - initscripts: Pre-installed on Jessie systems (?), superseded and masked by systemd, but never autoremoved # Jessie workaround: https://github.com/MichaIng/DietPi/issues/3462 (( $G_DISTRO < 4 )) && G_EXEC_PRE_FUNC(){ acommand[2]='--force-yes'; } - G_AGP dbus dhcpcd5 mountall initscripts *office* *xfce* *qt5* *xserver* *xorg* glib-networking libgtk-3-0 + G_AGP dbus dhcpcd5 mountall initscripts '*office*' '*xfce*' '*qt5*' '*xserver*' '*xorg*' glib-networking libgtk-3-0 # Remove any autoremove prevention rm -f /etc/apt/apt.conf.d/01autoremove* G_AGA From 51089c83050bd952613965588ab55d6a97313610 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 May 2020 19:33:52 +0200 Subject: [PATCH 027/182] v6.31 + DietPi-Software | Tiny code enhancement --- dietpi/dietpi-software | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 21901be3a6..d435283d67 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7808,8 +7808,7 @@ The install script will now exit. After applying one of the the above, rerun die do G_WHIP_DEFAULT_ITEM=$domain - G_WHIP_INPUTBOX "${invalid_text}Please enter your servers external domain to allow Nextcloud Talk access your TURN server:" - if [[ $? == 0 && $G_WHIP_RETURNED_VALUE ]]; then + if G_WHIP_INPUTBOX "${invalid_text}Please enter your servers external domain to allow Nextcloud Talk access your TURN server:" && [[ $G_WHIP_RETURNED_VALUE ]]; then domain=${G_WHIP_RETURNED_VALUE#http*://} break From d02d7e4977872176ba07abe9ca5c1c25e6275cdf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 May 2020 10:55:24 +0200 Subject: [PATCH 028/182] v6.31 + DietPi-Software | Always call curl with "-f" option to have it exiting with error code and meaningful short error message in case of webserver error responses, instead of printing the HTML error page with exit code zero. --- dietpi/dietpi-software | 64 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d435283d67..ad924d3323 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2629,7 +2629,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi # Update PHP variables after all software titles have been marked - # - Never install PHP7.2 if PHP7.3 is already present + # - Never install PHP7.2 if PHP7.3 or PHP7.4 is already present if (( ${aSOFTWARE_INSTALL_STATE[89]} > 0 )) && ! command -v php7.3 &> /dev/null && ! command -v php7.4 &> /dev/null; then # Do not upgrade PHP7.2, since we can support it for a long time @@ -3135,7 +3135,7 @@ _EOF_ G_EXEC ln -s $G_FP_DIETPI_USERDATA/mysql /var/lib/mysql local package_list='mariadb-server' - # Install php-mysql module, if PHP was already installed + # Install PHP module, if PHP was already installed (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-mysql" G_AGI $package_list @@ -3156,7 +3156,7 @@ _EOF_ Banner_Installing local package_list='sqlite3' - # Install php-sqlite module, if PHP was already installed + # Install PHP module, if PHP was already installed (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-sqlite3" G_AGI $package_list @@ -3167,7 +3167,7 @@ _EOF_ Banner_Installing local package_list='redis-server' - # Install php-redis module, if PHP was already installed + # Install PHP module, if PHP was already installed (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-redis" G_AGI $package_list @@ -3204,7 +3204,7 @@ Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/d INSTALL_URL_ADDRESS='https://packages.sury.org/php/apt.gpg' G_CHECK_URL "$INSTALL_URL_ADDRESS" # APT key - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - # APT source echo "deb https://packages.sury.org/php/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-php.list # Pin down libssl1.1 version from this repo on Stretch: https://github.com/MichaIng/DietPi/issues/2734 @@ -3264,7 +3264,7 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et # - Get latest version name INSTALL_URL_ADDRESS='https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - local version=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"name":' | cut -d \" -f 4) + local version=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"name":' | cut -d \" -f 4) local fallback_url='https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-english.tar.gz' Download_Install "https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-english.tar.gz" # - Reinstall: Clean install but preserve existing config file @@ -3842,19 +3842,19 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf if (( $G_HW_ARCH == 2 )); then local fallback_url="https://hndl.urbackup.org/Server/$latest/urbackup-server_${latest}_armhf.deb" - local file=$(curl -sL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server_.*_armhf\.deb' | cut -d \" -f 8) + local file=$(curl -sfL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server_.*_armhf\.deb' | cut -d \" -f 8) # x86_64 elif (( $G_HW_ARCH == 10 )); then local fallback_url="https://hndl.urbackup.org/Server/$latest/urbackup-server_${latest}_amd64.deb" - local file=$(curl -sL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server_.*_amd64\.deb' | cut -d \" -f 8) + local file=$(curl -sfL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server_.*_amd64\.deb' | cut -d \" -f 8) # ARMv8 elif (( $G_HW_ARCH == 3 )); then local fallback_url="https://hndl.urbackup.org/Server/$latest/urbackup-server_${latest}_arm64.deb" - local file=$(curl -sL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server-.*_arm64\.deb' | cut -d \" -f 8) + local file=$(curl -sfL "$INSTALL_URL_ADDRESS" | grep -m1 'urbackup-server-.*_arm64\.deb' | cut -d \" -f 8) fi @@ -3940,7 +3940,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf INSTALL_URL_ADDRESS='http://www.webmin.com/jcameron-key.asc' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - echo 'deb https://download.webmin.com/download/repository sarge contrib' > /etc/apt/sources.list.d/webmin.list G_AGUP G_AGI webmin @@ -3957,7 +3957,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf # - "wget --spider" and "curl -LI" fail with 403 Forbidden INSTALL_URL_ADDRESS='https://yt-dl.org/downloads/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_THREAD_START curl -sSL "$INSTALL_URL_ADDRESS/youtube-dl" -o /usr/local/bin/youtube-dl + G_THREAD_START curl -sSfL "$INSTALL_URL_ADDRESS/youtube-dl" -o /usr/local/bin/youtube-dl DEPS_LIST='python-requests' Download_Install 'https://github.com/ArturSierzant/OMPD/archive/master.tar.gz' /var/www @@ -4014,7 +4014,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf G_AGI $PHP_NAME-xml $PHP_NAME-sqlite3 $PHP_NAME-intl # Install - curl -sSL "$INSTALL_URL_ADDRESS" -o install.sh + curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh chmod +x install.sh # - Skip Lighttpd install, since we allow to choose and install prior to Pi-hole G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC ./install.sh --disable-install-webserver || aSOFTWARE_INSTALL_STATE[$software_id]=0 @@ -4029,7 +4029,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf INSTALL_URL_ADDRESS='https://api.github.com/repos/airsonic/airsonic/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*\.war"' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*\.war"' | cut -d \" -f 4) mkdir -p $G_FP_DIETPI_USERDATA/airsonic/transcode wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/airsonic/airsonic.war @@ -4068,7 +4068,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf fi - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" fi @@ -4162,7 +4162,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf # On Stretch and ARMv6 (RPi 1/Zero) use Java 8, else most current local java='[^a].' # Exclude "a" from jav[a]8 but allow "8" as this can be from version string (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && java='java8' - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) # Fallback URL if [[ ! $INSTALL_URL_ADDRESS ]]; then @@ -4211,7 +4211,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf # Get latest version: No Bullseye packages available yet local distro=$G_DISTRO_NAME (( $G_DISTRO > 5 )) && distro='buster' - local package=$(curl -s "$url/$distro/" | sed -n "/networkaudiod_.*_$arch.deb/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) + local package=$(curl -sf "$url/$distro/" | sed -n "/networkaudiod_.*_$arch.deb/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) # Check final URL before applying debconf settings G_CHECK_URL "$url/$distro/$package" @@ -4312,7 +4312,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Install, failsafe checking this URL again - Download_Install "$(curl -s "$INSTALL_URL_ADDRESS")" + Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS")" fi @@ -4402,7 +4402,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://repos.influxdata.com/influxdb.key' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - # Use Buster branch on Bullseye echo "deb https://repos.influxdata.com/debian/ ${G_DISTRO_NAME/bullseye/buster} stable" > /etc/apt/sources.list.d/influxdb.list G_AGUP @@ -4427,7 +4427,7 @@ _EOF_ # APT key INSTALL_URL_ADDRESS='https://packages.grafana.com/gpg.key' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - # APT list echo 'deb https://packages.grafana.com/oss/deb/ stable main' > /etc/apt/sources.list.d/grafana.list @@ -4902,7 +4902,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.4.0.40/emby-server-deb_4.4.0.40_$arch.deb" - no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*emby-server-deb_.*_$arch\.deb" | cut -d \" -f 4)" + no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*emby-server-deb_.*_$arch\.deb" | cut -d \" -f 4)" unset arch @@ -4916,7 +4916,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Apply APT key INSTALL_URL_ADDRESS='https://downloads.plex.tv/plex-keys/PlexSign.key' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - # Apply APT repo echo 'deb https://downloads.plex.tv/repo/deb/ public main' > /etc/apt/sources.list.d/plexmediaserver.list @@ -5013,7 +5013,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi G_CHECK_URL 'https://api.github.com/repos/gogs/gogs/releases/latest' - INSTALL_URL_ADDRESS=$(curl -s 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep -m1 "browser_download_url.*$file" | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep -m1 "browser_download_url.*$file" | cut -d \" -f 4) local no_check_url=1 # G_CHECK_URL faces 403 fi @@ -5054,7 +5054,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # - Grab current version INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - local version=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) + local version=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) local fallback_url='https://github.com/Novik/ruTorrent/archive/v3.9.tar.gz' Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" @@ -5158,7 +5158,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.4.0/syncthing-linux-$arch-v1.4.0.tar.gz" - no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" + no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" mv syncthing-* /opt/syncthing fi @@ -5340,7 +5340,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Grab latest release INSTALL_URL_ADDRESS='https://api.github.com/repos/koel/koel/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - local version=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) + local version=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) [[ $version ]] || version='v4.2.2' Download_Install "https://github.com/koel/koel/archive/$version.tar.gz" @@ -5425,7 +5425,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) local fallback_url='https://github.com/Radarr/Radarr/releases/download/v0.2.0.1480/Radarr.develop.0.2.0.1480.linux.tar.gz' DEPS_LIST='mediainfo' @@ -5451,7 +5451,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) local fallback_url='https://github.com/lidarr/Lidarr/releases/download/v0.7.1.1381/Lidarr.master.0.7.1.1381.linux.tar.gz' DEPS_LIST='mediainfo' @@ -5496,7 +5496,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_CHECK_URL "$INSTALL_URL_ADDRESS" # - ARMv6: Requires Mono: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) local fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.14.376/Jackett.Binaries.Mono.tar.gz' # - ARMv7 @@ -5771,7 +5771,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal fi - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "\"browser_download_url.*gitea-[0-9.]*-linux-$arch\"" | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "\"browser_download_url.*gitea-[0-9.]*-linux-$arch\"" | cut -d \" -f 4) # - Fallback URL [[ $INSTALL_URL_ADDRESS ]] || INSTALL_URL_ADDRESS="https://github.com/go-gitea/gitea/releases/download/v1.11.3/gitea-1.11.3-linux-$arch" wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/gitea/gitea @@ -5826,7 +5826,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSfL "$INSTALL_URL_ADDRESS" | apt-key add - echo 'deb https://dtcooper.github.io/raspotify/ raspotify main' > /etc/apt/sources.list.d/raspotify.list G_AGUP @@ -9354,7 +9354,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" fallback_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-v3.0.6.tgz' - no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '"browser_download_url.*EasyRSA-.*\.tgz' | cut -d \" -f 4)" + no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '"browser_download_url.*EasyRSA-.*\.tgz' | cut -d \" -f 4)" [[ -d '/etc/openvpn/easy-rsa' ]] && rm -R /etc/openvpn/easy-rsa mv EasyRSA-* /etc/openvpn/easy-rsa @@ -12459,7 +12459,7 @@ _EOF_ fi - software_id=87 + software_id=87 # SQLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling From 89ae778cc07cfeedd76b694214a8a596194f509f Mon Sep 17 00:00:00 2001 From: CedArctic Date: Wed, 13 May 2020 19:15:55 +0300 Subject: [PATCH 029/182] v6.31 (#3471) + DietPi-Software | Add Firefox Sync Server --- dietpi/dietpi-software | 108 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ad924d3323..a4e892639a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1032,6 +1032,18 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9863#p9863' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + #------------------ + software_id=177 + + aSOFTWARE_NAME[$software_id]='Firefox Sync Server' + aSOFTWARE_DESC[$software_id]='Sync bookmarks, tabs, history & passwords' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + # Bullseye: python(2)-virtualenv not available (yet): https://packages.debian.org/python-virtualenv + aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 # Emulation / Gaming #-------------------------------------------------------------------------------- @@ -5300,6 +5312,28 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi + software_id=177 # Firefox Sync Server + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + # Dependencies + DEPS_LIST='python-virtualenv python-dev' + # - Pre-compiling required on ARM + (( $G_HW_ARCH < 10 )) && DEPS_LIST+=' libffi-dev libssl-dev' + + # Download & Install + INSTALL_URL_ADDRESS='https://github.com/mozilla-services/syncserver/archive/master.tar.gz' + Download_Install "$INSTALL_URL_ADDRESS" + [[ -d '/opt/firefox-sync' ]] && rm -R /opt/firefox-sync + mv syncserver-master /opt/firefox-sync + + # Build + cd /opt/firefox-sync + make build + + fi + software_id=141 # Spotify Connect Web if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -11151,6 +11185,63 @@ _EOF_ fi + software_id=177 # Firefox Sync Server + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Configuration + + # User + local usercmd='useradd -rMU' + getent passwd ffsync &> /dev/null && usercmd='usermod' + $usercmd -d /opt/firefox-sync -s $(command -v nologin) ffsync + + # Create database directory + mkdir -p $G_FP_DIETPI_USERDATA/firefox-sync + + # Create database if it doesn't exist + if [[ ! -f $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db ]]; then + sqlite3 $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db "create table aTable(field1 int); drop table aTable;" + fi + + # Copy and modify config file + local ffsync_conf="$G_FP_DIETPI_USERDATA/firefox-sync/syncserver.ini" + if [[ ! -f $ffsync_conf ]]; then + + cp -a /opt/firefox-sync/syncserver.ini $ffsync_conf + local ffsync_ip=$(mawk 'NR==4' /run/dietpi/.network) + G_CONFIG_INJECT 'host =' "host = $ffsync_ip" $ffsync_conf + G_CONFIG_INJECT 'port =' 'port = 5000' $ffsync_conf # To be failsafe if the default changes in future releases + G_CONFIG_INJECT 'public_url =' "public_url = http://$ffsync_ip:5000/" $ffsync_conf + G_CONFIG_INJECT 'sqluri = sqlite:' "sqluri = sqlite:///$G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db" $ffsync_conf + # Modify make file to point to external config + sed -i "s|--paste ./syncserver.ini|--paste $ffsync_conf|" /opt/firefox-sync/Makefile + + fi + + cat << _EOF_ > /etc/systemd/system/firefox-sync.service +[Unit] +Description=Firefox Sync Server (DietPi) +Documentation=https://github.com/mozilla-services/syncserver +Wants=network-online.target +After=network-online.target dietpi-boot.service + +[Service] +User=ffsync +WorkingDirectory=/opt/firefox-sync +ExecStart=$(command -v make) serve + +[Install] +WantedBy=multi-user.target +_EOF_ + + # Permissions + chown -R ffsync:ffsync $G_FP_DIETPI_USERDATA/firefox-sync + + # Enable startup on boot by default + systemctl enable firefox-sync + + fi + software_id=141 # Spotify Connect Web if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12818,6 +12909,23 @@ _EOF_ fi + software_id=177 # Firefox Sync Server + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + Banner_Uninstalling + if [[ -f '/etc/systemd/system/firefox-sync.service' ]]; then + + systemctl disable --now firefox-sync + rm -R /etc/systemd/system/firefox-sync.service* + + fi + getent passwd ffsync &> /dev/null && userdel -rf ffsync + getent group ffsync &> /dev/null && groupdel ffsync + [[ -d '/opt/firefox-sync' ]] && rm -R /opt/firefox-sync + [[ -d $G_FP_DIETPI_USERDATA/firefox-sync ]] && rm -R $G_FP_DIETPI_USERDATA/firefox-sync + + fi + software_id=141 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then From 8aa7af2771a34f707e1d679b48977d9b38f58d3e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 13 May 2020 19:05:53 +0200 Subject: [PATCH 030/182] v6.31 (#3531) + DietPi-Software | rTorrent: Set default pieces.memory.max.set to total physical memory size in MiB as intended + DietPi-Software | rTorrent: Fix invalid dht.mode.set value, which must be "on" instead of "enable" --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c26af39c65..739fc3a4c6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 +- DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 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 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a4e892639a..7f8c2a4368 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10501,7 +10501,7 @@ schedule2 = session_save, 240, 300, ((session.save)) schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M)) system.umask.set = 002 # Max memory mapping size, not max physical RAM usage! -pieces.memory.max.set = $RAM_TOTAL +pieces.memory.max.set = ${RAM_TOTAL}M pieces.hash.on_completion.set = no ### Connection settings @@ -10537,7 +10537,7 @@ throttle.max_peers.seed.set = -1 trackers.numwant.set = $(Optimise_BitTorrent 2) # Public tracker support trackers.use_udp.set = yes -dht.mode.set = enable +dht.mode.set = on #dht.port.set = 6881 protocol.pex.set = yes protocol.encryption.set = allow_incoming,try_outgoing,enable_retry From 16a1e9f405ebe0746b3561b60f0c4143c819977f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 13:30:23 +0200 Subject: [PATCH 031/182] v6.31 + DietPi-Patch | Fix variable call --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2ad8851d6e..34e7e630a0 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -750,7 +750,7 @@ _EOF_' # - systemd-timesyncd: Network time sync daemon # Available as dedicated package since Bullseye: https://packages.debian.org/systemd-timesyncd # While the above needs to be checked against current distro to not break SSH or APT before distro upgrade, this one should be checked against target distro version. - (( $G_DISTRO_TARGET > 5 )) && aPACKAGES_REQUIRED_INSTALL+=('systemd-timesyncd') + (( $DISTRO_TARGET > 5 )) && aPACKAGES_REQUIRED_INSTALL+=('systemd-timesyncd') # G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273 if (( $G_HW_MODEL > 9 )); then From 30db40ac3f88b6d857abc41298bbbdf7a8589d80 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 13:56:18 +0200 Subject: [PATCH 032/182] v6.31 + DietPi-Imager | Store original directory path, before navigating into temporary working dir, so dietpi-explorer can start at intended location --- .meta/dietpi-imager | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index f927780035..e9a690d629 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -21,6 +21,7 @@ G_PROGRAM_NAME='DietPi-Imager' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + FP_ORIGIN=$PWD # Store original dir to open dietpi-explorer for image selection in G_INIT # Import DietPi-Globals --------------------------------------------------------------- @@ -120,7 +121,7 @@ # Open DietPi-Explorer for image file selection local fp_selected='/tmp/.dietpi-explorer_selected_location' [[ -f $fp_selected ]] && rm $fp_selected # Failsafe - /boot/dietpi/dietpi-explorer 1 $PWD + /boot/dietpi/dietpi-explorer 1 "$FP_ORIGIN" [[ -f $fp_selected && $(<$fp_selected) ]] || Exit_On_Fail FP_SOURCE_IMG=$(<$fp_selected) rm $fp_selected From d89c43c635f7cd304fb45c4c641f60dd9637ebb9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 14:07:27 +0200 Subject: [PATCH 033/182] v6.31 + DietPi-Imager | We must navigate to origin dir, otherwise the resulting image is removed with /tmp/$G_PROGRAM_NAME on exit --- .meta/dietpi-imager | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index e9a690d629..2d158a8157 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -21,8 +21,9 @@ G_PROGRAM_NAME='DietPi-Imager' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW - FP_ORIGIN=$PWD # Store original dir to open dietpi-explorer for image selection in + FP_ORIGIN=$PWD # Store origin dir G_INIT + cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME # Import DietPi-Globals --------------------------------------------------------------- FP_SOURCE_IMG= @@ -121,7 +122,7 @@ # Open DietPi-Explorer for image file selection local fp_selected='/tmp/.dietpi-explorer_selected_location' [[ -f $fp_selected ]] && rm $fp_selected # Failsafe - /boot/dietpi/dietpi-explorer 1 "$FP_ORIGIN" + /boot/dietpi/dietpi-explorer 1 [[ -f $fp_selected && $(<$fp_selected) ]] || Exit_On_Fail FP_SOURCE_IMG=$(<$fp_selected) rm $fp_selected From 795ac9c0bcbe11275b3ec0de0a8a45f40bbcf9db Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 14:21:34 +0200 Subject: [PATCH 034/182] v6.31 + DietPi-PREP | Install rng-tools5 as modern entropy daemon wherever it has been proven to work. Separate entropy daemon and initramfs package estimation for allow more flexible adjustments based on further tests. --- PREP_SYSTEM_FOR_DIETPI.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 34e7e630a0..a0efc82281 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -752,25 +752,29 @@ _EOF_' # While the above needs to be checked against current distro to not break SSH or APT before distro upgrade, this one should be checked against target distro version. (( $DISTRO_TARGET > 5 )) && aPACKAGES_REQUIRED_INSTALL+=('systemd-timesyncd') - # G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273 - if (( $G_HW_MODEL > 9 )); then + # G_HW_MODEL specific + # - initramfs: Required for generic bootloader, but not required/used by RPi bootloader, on VM install tiny-initramfs with limited features but sufficient and much smaller + faster + if (( $G_HW_MODEL == 20 )); then - # RAM file system initialisation, required for generic bootloader, but not required/used by RPi bootloader - # - On VM, install tiny-initramfs with limited features but sufficient and much smaller + faster - if (( $G_HW_MODEL == 20 )); then + aPACKAGES_REQUIRED_INSTALL+=('tiny-initramfs') - aPACKAGES_REQUIRED_INSTALL+=('tiny-initramfs') + elif (( $G_HW_MODEL > 9 )); then - else + aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools') - aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools') + fi + # - Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, on RPi rng-tools (default on Raspbian), else haveged: https://github.com/MichaIng/DietPi/issues/2806 + if (( $G_HW_MODEL == 51 )); then - fi - aPACKAGES_REQUIRED_INSTALL+=('haveged') # Entropy daemon: https://github.com/MichaIng/DietPi/issues/2806 + aPACKAGES_REQUIRED_INSTALL+=('rng-tools5') + + elif (( $G_HW_MODEL > 9 )); then + + aPACKAGES_REQUIRED_INSTALL+=('haveged') else - aPACKAGES_REQUIRED_INSTALL+=('rng-tools') # Entropy daemon: Alternative, that does not work on all devices, but is proven to work on RPi, is default on Raspbian and uses less RAM on idle. + aPACKAGES_REQUIRED_INSTALL+=('rng-tools') fi From f6f34c027d205673ccd525a4de106dc5980886fe Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 15:22:52 +0200 Subject: [PATCH 035/182] v6.31 + DietPi-PREP | Install rng-tools5 on all RK3399 SBCs --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a0efc82281..29ec74ce5b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -764,7 +764,7 @@ _EOF_' fi # - Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, on RPi rng-tools (default on Raspbian), else haveged: https://github.com/MichaIng/DietPi/issues/2806 - if (( $G_HW_MODEL == 51 )); then + if [[ $G_HW_MODEL =~ ^(14|42|58|68|69|72)$ ]]; then # RK3399 aPACKAGES_REQUIRED_INSTALL+=('rng-tools5') From 96b11b0f425efa4b060b32c34a4b78fa4360dee9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 May 2020 22:48:26 +0200 Subject: [PATCH 036/182] v6.31 (#3536) + DietPi-Services | Add support for new Firefox Sync Server + DietPi-Software | Firefox Sync Server: Add online docs URL: https://dietpi.com/phpbb/viewtopic.php?p=24713#p24713 + DietPi-Software | Firefox Sync Server: Do not edit Makefile to use our config, instead call gunicorn with correct option directly + DietPi-Software | Firefox Sync Server: Add strict service hardening to allow R/W only to our config+database dir, the ffsync users home + DietPi-Software | Firefox Sync Server: Do not enable service on install, since it is now controlled by DietPi-Services + DietPi-Patch | Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 --- CHANGELOG.txt | 1 + dietpi/dietpi-services | 3 ++- dietpi/dietpi-software | 28 +++++++++++++++------------- dietpi/patch_file | 6 ++++++ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 739fc3a4c6..214f3177bf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.31 (XX/06/20) Changes / Improvements / Optimisations: +- DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index a8bfd75e8e..6052d334e8 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -146,6 +146,7 @@ Available services: 'tonido' 'gogs' 'gitea' + 'firefox-sync' # - Emulation/Gaming 'supervisor' @@ -1064,7 +1065,7 @@ Info:\n - Negative values have a higher priority (eg: -10).\n - Positive values 'CPU Scheduling Priority') - # - 7 step description scale + # 7 step description scale local scale_value_lowest=1 local scale_value_highest=99 local scale_value_lower=$(( $scale_value_highest / 6 )) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7f8c2a4368..59a2f5ee25 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1039,7 +1039,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Sync bookmarks, tabs, history & passwords' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=24713#p24713' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 # Bullseye: python(2)-virtualenv not available (yet): https://packages.debian.org/python-virtualenv @@ -5331,6 +5331,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Build cd /opt/firefox-sync make build + cd /tmp/$G_PROGRAM_NAME fi @@ -11195,15 +11196,13 @@ _EOF_ getent passwd ffsync &> /dev/null && usercmd='usermod' $usercmd -d /opt/firefox-sync -s $(command -v nologin) ffsync - # Create database directory + # Create database and config directory mkdir -p $G_FP_DIETPI_USERDATA/firefox-sync # Create database if it doesn't exist - if [[ ! -f $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db ]]; then - sqlite3 $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db "create table aTable(field1 int); drop table aTable;" - fi + [[ -f $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db ]] || sqlite3 $G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db "create table aTable(field1 int); drop table aTable;" - # Copy and modify config file + # Copy and modify default config file if it doesn't exist local ffsync_conf="$G_FP_DIETPI_USERDATA/firefox-sync/syncserver.ini" if [[ ! -f $ffsync_conf ]]; then @@ -11213,8 +11212,6 @@ _EOF_ G_CONFIG_INJECT 'port =' 'port = 5000' $ffsync_conf # To be failsafe if the default changes in future releases G_CONFIG_INJECT 'public_url =' "public_url = http://$ffsync_ip:5000/" $ffsync_conf G_CONFIG_INJECT 'sqluri = sqlite:' "sqluri = sqlite:///$G_FP_DIETPI_USERDATA/firefox-sync/FF-Sync-DB.db" $ffsync_conf - # Modify make file to point to external config - sed -i "s|--paste ./syncserver.ini|--paste $ffsync_conf|" /opt/firefox-sync/Makefile fi @@ -11227,8 +11224,16 @@ After=network-online.target dietpi-boot.service [Service] User=ffsync -WorkingDirectory=/opt/firefox-sync -ExecStart=$(command -v make) serve +WorkingDirectory=$G_FP_DIETPI_USERDATA/firefox-sync +ExecStart=/opt/firefox-sync/local/bin/gunicorn --paste $ffsync_conf + +# Hardening +ProtectSystem=strict +ProtectHome=true +PrivateDevices=true +ProtectKernelTunables=true +ProtectControlGroups=true +ReadWritePaths=$G_FP_DIETPI_USERDATA/firefox-sync [Install] WantedBy=multi-user.target @@ -11237,9 +11242,6 @@ _EOF_ # Permissions chown -R ffsync:ffsync $G_FP_DIETPI_USERDATA/firefox-sync - # Enable startup on boot by default - systemctl enable firefox-sync - fi software_id=141 # Spotify Connect Web diff --git a/dietpi/patch_file b/dietpi/patch_file index abf41a9f13..9f17115113 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2417,6 +2417,12 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" /boot/dietpi/dietpi-drive_manager 3 fi + + elif (( $G_DIETPI_VERSION_SUB == 30 )); then + + #------------------------------------------------------------------------------- + # Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 + G_EXEC chmod a+x /mnt/dietpi_userdata #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls From 27ab73876da61c8d6c13997e09ac14120d115846 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 18:46:37 +0200 Subject: [PATCH 037/182] v6.31 + DietPi-Software | Deluge: Enhance uninstall to assure all service and user traces are removed --- dietpi/dietpi-software | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 59a2f5ee25..ee5593ed18 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13272,10 +13272,21 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling + if [[ -f '/etc/systemd/system/deluge-web.service' ]]; then + + systemctl disable --now deluge-web + rm -R /etc/systemd/system/deluge-web.service* + + fi + if [[ -f '/etc/systemd/system/deluged.service' ]]; then + + systemctl disable --now deluged + rm -R /etc/systemd/system/deluged.service* + + fi G_AGP deluged deluge-web deluge-console - userdel -rf debian-deluged - [[ -f '/etc/systemd/system/deluged.service' ]] && rm /etc/systemd/system/deluged.service - [[ -f '/etc/systemd/system/deluge-web.service' ]] && rm /etc/systemd/system/deluge-web.service + getent passwd debian-deluged &> /dev/null && userdel -rf debian-deluged + getent group debian-deluged &> /dev/null && groupdel debian-deluged [[ -d $G_FP_DIETPI_USERDATA/deluge ]] && rm -R $G_FP_DIETPI_USERDATA/deluge fi From 25a29780ff03f435a025589f2200c3be638d143f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 19:10:37 +0200 Subject: [PATCH 038/182] v6.31 + README | Add Syncthing and Firefox Sync Server to 3rd party sources list --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8cc17b0900..09fc14c695 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [qBittorrent](https://github.com/qbittorrent/qBittorrent) - [Nextcloud](https://github.com/nextcloud/server) - [ownCloud](https://github.com/owncloud/core) +- [Syncthing](https://github.com/syncthing/syncthing) - [MiniDLNA](https://sourceforge.net/p/minidlna/git/ci/master/tree/) - [MPD](https://github.com/MusicPlayerDaemon/MPD) - [YMPD](https://github.com/notandy/ympd) @@ -270,3 +271,4 @@ Links to hardware and software manufacturers, sources and build instructions use - [Home Assistant](https://github.com/home-assistant/core) - [TasmoAdmin](https://github.com/reloxx13/TasmoAdmin) - [Domoticz](https://github.com/domoticz/domoticz) +- [Firefox Sync Server](https://github.com/mozilla-services/syncserver) From 0dce3dde090255a2a553c2ad88ca9b55c2537880 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 19:44:43 +0200 Subject: [PATCH 039/182] v6.31 + DietPi-Set_hardware | Tiny --- dietpi/func/dietpi-set_hardware | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index b67f9fb5d7..e85129422a 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -543,8 +543,8 @@ _EOF_ if disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 1; then - local eth_force_speed=$INPUT_DEVICE_VALUE - local eth_adapter="eth$(mawk 'NR==1' /run/dietpi/.network)" + local speed_mbit=$INPUT_DEVICE_VALUE + local iface="eth$(mawk 'NR==1' /run/dietpi/.network)" cat << _EOF_ > /etc/systemd/system/ethtool_force_speed.service [Unit] @@ -554,15 +554,15 @@ After=network-online.target [Service] Type=oneshot -ExecStart=$(command -v ethtool) -s $eth_adapter speed $eth_force_speed duplex full autoneg off +ExecStart=$(command -v ethtool) -s $iface speed $speed_mbit duplex full autoneg off [Install] -WantedBy=ifup@$eth_adapter.service +WantedBy=ifup@$iface.service _EOF_ systemctl daemon-reload systemctl enable --now ethtool_force_speed - elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to 'disable' + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to "disable" if [[ -f '/etc/systemd/system/ethtool_force_speed.service' ]]; then From d54eaee466baeac321d234a81e04c1dec7ebbd2a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 22:31:28 +0200 Subject: [PATCH 040/182] v6.31 + DietPi-Config | Add Ethernet link speed selection to Network>Ethernet menu. The dietpi-set_hardware option and dietpi.txt entry exists for a long time, but it was only exposed as first run setup option. --- dietpi/dietpi-config | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 2dcfd94998..ea3d6494fd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3001,10 +3001,9 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then # Mode local mode_text='DHCP' (( $ETH_MODE_TARGET == 0 )) && mode_text='STATIC' - G_WHIP_MENU_ARRAY=('' '●─ DHCP/STATIC IP ') - G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_text]") + # Show static options if (( $ETH_MODE_TARGET == 0 )); then @@ -3017,6 +3016,9 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then fi G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') + local eth_speed='auto (default)' + [[ -f '/etc/systemd/system/ethtool_force_speed.service' ]] && eth_speed=$(mawk '/^ExecStart=/{print $5;exit}' /etc/systemd/system/ethtool_force_speed.service) + G_WHIP_MENU_ARRAY+=('Link Speed' ": [$eth_speed]") G_WHIP_MENU_ARRAY+=('Disable' ': Disable Ethernet adapter') G_WHIP_MENU_ARRAY+=('' '●─ Apply ') @@ -3040,6 +3042,23 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then ;; + 'Link Speed') + + G_AG_CHECK_INSTALL_PREREQ ethtool + G_WHIP_MENU_ARRAY=('0' ': Auto-negotiation (default, recommended)') + local aspeeds=( $(ethtool eth0 | sed -n '/Supported link modes:/,/^[[:blank:]]*[[:alpha:]]/p' | head -n -1 | mawk '{print $NF}') ) + for i in "${aspeeds[@]//[^0-9]}" + do + + G_WHIP_MENU_ARRAY+=("$i" ": Force $i Mbit link speed") + + done + G_WHIP_MENU 'Please select a supported Ethernet link speed to force or auto-negotiation. +NB: Auto-negotiation is highly recommended as long as you do not have issues with the auto estimated link speed. + This is mainly aimed at PINE A64 which may have a hardware issue that causes unstable 1000 Mbit link.' && /boot/dietpi/func/dietpi-set_hardware eth-forcespeed $G_WHIP_RETURNED_VALUE + + ;; + 'Disable') if G_WHIP_YESNO 'Would you like to disable the Ethernet adapter?\n - (NOTICE) All Ethernet connections will be dropped.'; then From f0f498379ff1c0ad4f03ad4d73430486ac7e3373 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 22:34:26 +0200 Subject: [PATCH 041/182] v6.31 + CHANGELOG | Added Ethernet link speed selection to Network>Ethernet menu --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 214f3177bf..b363357678 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.31 (XX/06/20) Changes / Improvements / Optimisations: +- DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 Bug Fixes: From ba45d2452ff68dcf9dd227ad4ff9cfcdf57d4354 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 May 2020 23:42:39 +0200 Subject: [PATCH 042/182] v6.31 + DietPi-Config | Fix Ethernet link speed menu if no link speed force option is supported by the network adapter --- dietpi/dietpi-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index ea3d6494fd..6a38680d46 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3047,7 +3047,7 @@ Would you like to disable WiFi?\n - NB: Connections may drop!'; then G_AG_CHECK_INSTALL_PREREQ ethtool G_WHIP_MENU_ARRAY=('0' ': Auto-negotiation (default, recommended)') local aspeeds=( $(ethtool eth0 | sed -n '/Supported link modes:/,/^[[:blank:]]*[[:alpha:]]/p' | head -n -1 | mawk '{print $NF}') ) - for i in "${aspeeds[@]//[^0-9]}" + for i in ${aspeeds[@]//[^0-9]} do G_WHIP_MENU_ARRAY+=("$i" ": Force $i Mbit link speed") From aa033a5300141a0c5c1a3cc135cc02ff64e9f1d9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 13:29:19 +0200 Subject: [PATCH 043/182] v6.31 + Odroid XU4 | Update boot.ini: Compact HDMI-PHY control settings and expose "new" (2017) DDR frequency as an optional setting: https://github.com/hardkernel/u-boot/commit/edb23d4ba7c402485929aa2777aeea67007b23b5 --- boot_xu4.ini | 153 ++++++++++++++++++--------------------------------- 1 file changed, 55 insertions(+), 98 deletions(-) diff --git a/boot_xu4.ini b/boot_xu4.ini index 223c918204..612ab534f3 100644 --- a/boot_xu4.ini +++ b/boot_xu4.ini @@ -1,116 +1,70 @@ ODROIDXU-UBOOT-CONFIG -# U-Boot Parameters +# U-Boot parameters setenv initrd_high "0xffffffff" setenv fdt_high "0xffffffff" # Mac address configuration setenv macaddr "00:1e:06:61:7a:72" -#------------------------------------------------------------------------------------------------------ -# Basic Ubuntu Setup. Don't touch unless you know what you are doing. -# -------------------------------- +# Kernel command-line parameters setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0" -# --- Screen Configuration for HDMI --- # +# HDMI config setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080.bin" -# --- HDMI / DVI Mode Selection --- -# ------------------------------------------ -# - HDMI Mode +# HDMI/DVI selection: "hdmi" or "dvi" +# - DVI mode disables HDMI sound setenv vout "hdmi" -# - DVI Mode (disables sound over HDMI as per DVI compat) -# setenv vout "dvi" -# --- CPU Governor Setup --- -# - DietPi will override this setting to user configured in dietpi-config > Performance Options > CPU gov. +# HDMI CEC: "false" or "true", defaults to "true" +#setenv cecenable "false" + +# CPU governor +# - DietPi will override this setting to user configured in dietpi-config > Performance Options > CPU governor setenv governor "performance" -#------------------------------------------------------------------------------ -# -# HDMI Hot Plug detection -# -#------------------------------------------------------------------------------ -# -# Forces the HDMI subsystem to ignore the check if the cable is connected or -# not. -# false : disable the detection and force it as connected. -# true : let cable, board and monitor decide the connection status. -# -# default: true -# -#------------------------------------------------------------------------------ +# ODROID-VU7 touchsreen: "false" or "true", defaults to "true" +#setenv disable_vu7 "false" + +# DDR frequency [MHz]: "933", "825", "728" or "633", defaults to "825" +#setenv ddr_freq "933" + +# HDMI Hot Plug detection: "false" or "true" +# - "true" enables HDMI detection based on cable connection. +# - "false" disables auto-detection and forces HDMI output. setenv HPD "true" -#------------------------------------------------------------------------------ -# -# TMDS data amplitude control. -# -#------------------------------------------------------------------------------ -# -# 1LSB corresponds to 20 mVdiff amplitude level. -# tx_amp_lvl : 0 = 760 mVdiff(Min), 31 = 1380 mVdiff(Max) -# -# Hardkernel default hdmi_tx_amp_lvl = 31(1380 mVdiff); -#------------------------------------------------------------------------------ -setenv hdmi_tx_amp_lvl "31" - -#------------------------------------------------------------------------------ -# -# TMDS data amplitude fine control for each channel. -# -#------------------------------------------------------------------------------ -# -# 1LSB corresponds to 20 mVdiff amplitude level. -# tx_lvl : 0 = 0 mVdiff(Min), 3 = 60 mVdiff(Max) -# -# Hardkernel default -# hdmi_tx_lvl_ch0 = 3, hdmi_tx_lvl_ch1 = 3, hdmi_tx_lvl_ch2 = 3, -#------------------------------------------------------------------------------ -setenv hdmi_tx_lvl_ch0 "3" -setenv hdmi_tx_lvl_ch1 "3" -setenv hdmi_tx_lvl_ch2 "3" - -#------------------------------------------------------------------------------ -# -# TMDS data pre-emphasis level control. -# -#------------------------------------------------------------------------------ -# -# 1LSB corresponds to -0.45dB emphasis level except for 1 -# tx_emp_lvl : 0 = 0 db(Min), 1 = -0.25 db, 2 = 0.7 db, 15 = -7.45 db(Max) -# -# Hardkernel default hdmi_tx_emp_lvl = 6 (-2.50 db); -#------------------------------------------------------------------------------ -setenv hdmi_tx_emp_lvl "6" - -#------------------------------------------------------------------------------ -# -# TMDS clock amplitude control. -# -#------------------------------------------------------------------------------ -# -# 1LSB corresponds to 20 mVdiff amplitude level. -# clk_amp_lvl : 0 = 790 mVdiff(Min), 31 = 1410 mVdiff(Max) -# -# Hardkernel default hdmi_clk_amp_lvl = 31 (1410 mVdiff) -#------------------------------------------------------------------------------ -setenv hdmi_clk_amp_lvl "31" - -#------------------------------------------------------------------------------ -# -# TMDS data source termination resistor control. -# -#------------------------------------------------------------------------------ -# -# tx_res : -# 0 = Source Termination OFF(Min), 1 = 200 ohm, 2 = 300 ohm, 3 = 120 ohm(Max) -# -# Hardkernrel default hdmi_tx_res = 0 (Source Termination OFF) -#------------------------------------------------------------------------------ -setenv hdmi_tx_res "0" - -#------------------------------------------------------------------------------ +# TMDS data amplitude control. +# - 1LSB corresponds to 20 mVdiff amplitude level +# - tx_amp_lvl : 0 = 760 mVdiff(Min), 31 = 1380 mVdiff(Max) +# - Hardkernel default: hdmi_tx_amp_lvl = 31(1380 mVdiff) +setenv hdmi_tx_amp_lvl "31" + +# TMDS data amplitude fine control for each channel +# - 1LSB corresponds to 20 mVdiff amplitude level +# - tx_lvl : 0 = 0 mVdiff(Min), 3 = 60 mVdiff(Max) +# - Hardkernel default: hdmi_tx_lvl_ch0=hdmi_tx_lvl_ch1=hdmi_tx_lvl_ch2 = 3 +setenv hdmi_tx_lvl_ch0 "3" +setenv hdmi_tx_lvl_ch1 "3" +setenv hdmi_tx_lvl_ch2 "3" + +# TMDS data pre-emphasis level control +# - 1LSB corresponds to -0.45dB emphasis level except for 1 +# - tx_emp_lvl : 0 = 0 db(Min), 1 = -0.25 db, 2 = 0.7 db, 15 = -7.45 db(Max) +# - Hardkernel default: hdmi_tx_emp_lvl = 6 (-2.50 db) +setenv hdmi_tx_emp_lvl "6" + +# TMDS clock amplitude control +# - 1LSB corresponds to 20 mVdiff amplitude level. +# - clk_amp_lvl : 0 = 790 mVdiff(Min), 31 = 1410 mVdiff(Max) +# - Hardkernel default hdmi_clk_amp_lvl = 31 (1410 mVdiff) +setenv hdmi_clk_amp_lvl "31" + +# TMDS data source termination resistor control +# - tx_res : 0 = Source Termination OFF(Min), 1 = 200 ohm, 2 = 300 ohm, 3 = 120 ohm(Max) +# - Hardkernrel default hdmi_tx_res = 0 (Source Termination OFF) +setenv hdmi_tx_res "0" setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hdmi_tx_lvl_ch0} hdmi_tx_lvl_ch1=${hdmi_tx_lvl_ch1} hdmi_tx_lvl_ch2=${hdmi_tx_lvl_ch2} hdmi_tx_emp_lvl=${hdmi_tx_emp_lvl} hdmi_clk_amp_lvl=${hdmi_clk_amp_lvl} hdmi_tx_res=${hdmi_tx_res} HPD=${HPD} vout=${vout}" @@ -120,16 +74,19 @@ fatload mmc 0:1 0x42000000 uInitrd if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi -#failsafe +# Fallback to XU4 dtb if board was not detected if test "x${board_name}" = "x"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; fi -# set FDT address +# Set FDT address fdt addr 0x44000000 if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi -# final boot args +# Set DDR frequency +if test "${ddr_freq}"; then dmc "${ddr_freq}"; fi + +# Final boot args setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${hid_quirks}" # drm.debug=0xff" # Boot the board From 16324ca4268f2774e3938b30add7d51a1179e5a7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 14:32:23 +0200 Subject: [PATCH 044/182] v6.31 + DietPi-Imager | Error handle some more commands which allows to retry and adjust them in case of error, before exiting --- .meta/dietpi-imager | 55 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 2d158a8157..4da0cf291d 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -134,11 +134,11 @@ fi # Create loopback device from .img file - modprobe loop || Exit_On_Fail + G_EXEC modprobe loop || Exit_On_Fail FP_SOURCE=$(losetup -f) - losetup $FP_SOURCE "$FP_SOURCE_IMG" || Exit_On_Fail - partprobe $FP_SOURCE || Exit_On_Fail - partx -u $FP_SOURCE || Exit_On_Fail + G_EXEC losetup $FP_SOURCE "$FP_SOURCE_IMG" || Exit_On_Fail + G_EXEC partprobe $FP_SOURCE || Exit_On_Fail + G_EXEC partx -u $FP_SOURCE || Exit_On_Fail G_DIETPI-NOTIFY 0 "Mounted the image ($FP_SOURCE_IMG) as loopback device: $FP_SOURCE" fi @@ -174,8 +174,10 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O Menu_Main - # Install required packages - G_AG_CHECK_INSTALL_PREREQ parted zerofree p7zip + # Install required packages: fdisk is an own package since Debian Buster: https://packages.debian.org/fdisk + local fdisk + (( $G_DISTRO < 5 )) || fdisk='fdisk' + G_AG_CHECK_INSTALL_PREREQ parted zerofree p7zip $fdisk # Auto detect partition table type, failsafe detection of MBR to debug possibly other/unknown wording/partition table types if [[ $(parted -s $FP_SOURCE print) == *'Partition Table: msdos'* ]]; then @@ -201,7 +203,7 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O fi - e2fsck -f $FP_ROOT_DEV || Exit_On_Fail + G_EXEC_OUTPUT=1 G_EXEC e2fsck -f $FP_ROOT_DEV || Exit_On_Fail # Remount image for any required edits fp_mnt='tmp_rootfs' @@ -259,25 +261,25 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O if (( $PART_END_CURRENT > $PART_END_TARGET )); then G_DIETPI-NOTIFY 2 "Shrinking root partition to: $(( $FS_SIZE / 2048 + 1 )) MiB" - parted $FP_SOURCE unit s resizepart $ROOT_PARTITION_INDEX $PART_END_TARGET - partprobe $FP_SOURCE - partx -u $FP_SOURCE + G_EXEC_OUTPUT=1 G_EXEC parted $FP_SOURCE unit s resizepart $ROOT_PARTITION_INDEX $PART_END_TARGET + G_EXEC partprobe $FP_SOURCE + G_EXEC partx -u $FP_SOURCE fi G_DIETPI-NOTIFY 2 'Overriding root partition free space with zeros to purge removed data and allow further archive size reduction...' - zerofree -v $FP_ROOT_DEV + G_EXEC_OUTPUT=1 G_EXEC zerofree -v $FP_ROOT_DEV sync # GPT images: # - "GPT PMBR size mismatch (4458495 != 15523839)" # - "Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used." # - gdisk will correct this - (( $GPT )) && sgdisk -g $FP_SOURCE + (( $GPT )) && G_EXEC_OUTPUT=1 G_EXEC sgdisk -g $FP_SOURCE # Finished: Derive final image size from last partition end + failsafe buffer - partprobe $FP_SOURCE - partx -u $FP_SOURCE + G_EXEC partprobe $FP_SOURCE + G_EXEC partx -u $FP_SOURCE IMAGE_SIZE=$(( ( $(sfdisk -qlo End $FP_SOURCE | tail -1) + 1 ) * 512 )) # 512 byte sectors => Byte IMAGE_SIZE=$(( $IMAGE_SIZE + ( 512 * 256 ) )) # 64 byte for secondary GPT + safety net @@ -288,7 +290,7 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O Delete_Loopback G_DIETPI-NOTIFY 2 "Truncating final image file to actually used size: $(( $IMAGE_SIZE / 1024 / 1024 + 1 )) MiB" - truncate --size=$IMAGE_SIZE "$FP_SOURCE_IMG" + G_EXEC truncate --size=$IMAGE_SIZE "$FP_SOURCE_IMG" # Rename, if source image != output image already [[ $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT != $FP_SOURCE_IMG ]] && mv "$FP_SOURCE_IMG" $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT @@ -305,7 +307,7 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || Exit_On_Fail # Assure +100 MiB left partition space G_DIETPI-NOTIFY 2 "Creating final image with actually used size: $(( $IMAGE_SIZE / 1024 / 1024 + 1 )) MiB" - dd if=$FP_SOURCE of=$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT bs=1M status=progress count=$(( $IMAGE_SIZE / 1024 / 1024 + 1 )) + G_EXEC dd if=$FP_SOURCE of=$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT bs=1M status=progress count=$(( $IMAGE_SIZE / 1024 / 1024 + 1 )) # Drive source, clone with Clonezilla else @@ -334,12 +336,12 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O if [[ ! -f $CLONEZILLA_ZIP || $(stat -c %s "$CLONEZILLA_ZIP") != $CLONEZILLA_ZIP_SIZE ]]; then G_DIETPI-NOTIFY 2 "Downloading Clonezilla Live v$CLONEZILLA_VERSION..." - wget "$CLONEZILLA_ZIP_URL" -O "$CLONEZILLA_ZIP" || Exit_On_Fail + G_EXEC wget "$CLONEZILLA_ZIP_URL" -O "$CLONEZILLA_ZIP" || Exit_On_Fail fi # Extract Clonezilla Live - unzip "$CLONEZILLA_ZIP" -d 'tmpiso' || Exit_On_Fail + G_EXEC unzip "$CLONEZILLA_ZIP" -d 'tmpiso' || Exit_On_Fail rm "$CLONEZILLA_ZIP" # Clone disk with Clonezilla @@ -359,8 +361,8 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O ocs-chkimg -or $PWD/tmpiso/home/partimag -nogui -b $OUTPUT_IMG_NAME || Exit_On_Fail # Prepare custom files used by the installer when booting in UEFI mode - wget "$DIETPI_REPO"/.meta/images/dietpi-background_768p.png -O tmpiso/boot/grub/dietpibg.png || Exit_On_Fail - wget "$DIETPI_REPO"/.meta/images/select_bkg_c.png -O tmpiso/boot/grub/select_bkg_c.png || Exit_On_Fail + G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_768p.png -O tmpiso/boot/grub/dietpibg.png || Exit_On_Fail + G_EXEC wget "$DIETPI_REPO"/.meta/images/select_bkg_c.png -O tmpiso/boot/grub/select_bkg_c.png || Exit_On_Fail cat << '_EOF_' > tmpiso/boot/grub/theme.txt title-text: "" desktop-image: "dietpibg.png" @@ -395,7 +397,7 @@ menuentry "Power off" { halt } _EOF_ # Prepare custom files used by the installer when booting in BIOS/CSM mode - wget "$DIETPI_REPO"/.meta/images/dietpi-background_480p.png -O tmpiso/syslinux/dietpibg.png || Exit_On_Fail + G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_480p.png -O tmpiso/syslinux/dietpibg.png || Exit_On_Fail cp /usr/lib/syslinux/modules/bios/poweroff.c32 tmpiso/syslinux/ mv tmpiso/syslinux/{syslinux,clonezilla}.cfg sed -i 's|\(MENU TITLE\) .*|\1 Clonezilla live|' tmpiso/syslinux/clonezilla.cfg @@ -454,18 +456,15 @@ _EOF_ G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSfL "$DIETPI_REPO"/README.md -o README.md || Exit_On_Fail # Generate 7z archive - # NB: LZMA2 ultra compression method requires 2G RAM + # NB: LZMA2 ultra compression requires much memory for usage and allocation, which is an issue on 32bit (ARM) devices. Use "-stm" to limit used CPU threads to "" and lower memory usage and allocation. [[ -f $OUTPUT_IMG_NAME.7z ]] && rm $OUTPUT_IMG_NAME.7z - G_DIETPI-NOTIFY 2 'Creating final 7zip archive...' - if 7zr a -m0=lzma2 -mx=9 $OUTPUT_IMG_NAME.7z $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT hash.txt README.md; then + G_EXEC_DESC='Creating final 7zip archive' G_EXEC_OUTPUT=1 G_EXEC 7zr a -m0=lzma2 -mx=9 $OUTPUT_IMG_NAME.7z $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT hash.txt README.md - rm hash.txt README.md - G_WHIP_MSG "[ OK ] DietPi-Imager has successfully finished.\n + rm hash.txt README.md + G_WHIP_MSG "[ OK ] DietPi-Imager has successfully finished.\n Final image file: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT Final 7z archive: $PWD/$OUTPUT_IMG_NAME.7z" - fi - } #///////////////////////////////////////////////////////////////////////////////////// From 510de2394279432462b211f69febec79a147891b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 14:59:02 +0200 Subject: [PATCH 045/182] v6.31 + DietPi-PREP | Install fdisk on Buster+ systems, where it has become an own package. On Bullseye it has been degraded from "required" to "important", which means that it would be autoremoved otherwise. This is used by DietPi-FS_partition_resize, parted cannot be used since it does not allow to resize a partition non-interactively, currently, and does not support max resizing but only to a defined end, which must be estimated first. + DietPi-PREP | Install gdisk on systems where the root file systems is on a GPT partition, used by DietPi-FS_partition_resize + DietPi-PREP | Fix "fat" file system detection it the it is the first file system on the list. This is a failsafe step only, since those are reported as "vfat" in all known cases. --- PREP_SYSTEM_FOR_DIETPI.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 29ec74ce5b..17d5be171d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -752,6 +752,10 @@ _EOF_' # While the above needs to be checked against current distro to not break SSH or APT before distro upgrade, this one should be checked against target distro version. (( $DISTRO_TARGET > 5 )) && aPACKAGES_REQUIRED_INSTALL+=('systemd-timesyncd') + # - fdisk: Partitioning tool used by DietPi-FS_partition_resize and DietPi-Imager + # This has become an own package since Debian Buster: https://packages.debian.org/fdisk + (( $DISTRO_TARGET > 4 )) && aPACKAGES_REQUIRED_INSTALL+=('fdisk') + # G_HW_MODEL specific # - initramfs: Required for generic bootloader, but not required/used by RPi bootloader, on VM install tiny-initramfs with limited features but sufficient and much smaller + faster if (( $G_HW_MODEL == 20 )); then @@ -796,8 +800,15 @@ _EOF_' fi + # Install gdisk if root file system is on a GPT partition, used by DietPi-FS_partition_resize + if [[ $(parted -s "$(lsblk -npo PKNAME "$(findmnt -no SOURCE /)")" print) == *'Partition Table: msdos'* ]]; then + + aPACKAGES_REQUIRED_INSTALL+=('gdisk') + + fi + # Install required filesystem packages - if [[ $(blkid -s TYPE -o value) =~ ([[:space:]]|v)'fat' ]]; then + if [[ $(blkid -s TYPE -o value) =~ (^|[[:space:]]|v)'fat' ]]; then aPACKAGES_REQUIRED_INSTALL+=('dosfstools') # DietPi-Drive_Manager + fat (boot) drive file system check and creation tools From 6aa59bb255580519f6e88b20eb8cafced47226ab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 16:17:57 +0200 Subject: [PATCH 046/182] v6.31 + DietPi-Imager | Remove obsolete exit calls, replace Exit_On_Fail with direct exit call and remove loopback device via G_EXIT_CUSTOM exit trap. --- .meta/dietpi-imager | 80 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 4da0cf291d..63d3117301 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -29,6 +29,7 @@ FP_SOURCE_IMG= FP_SOURCE= FP_ROOT_DEV= + FP_MNT_TMP='/tmp/tmp_rootfs' ROOT_PARTITION_INDEX=0 OUTPUT_IMG_NAME= OUTPUT_IMG_EXT='img' @@ -39,10 +40,10 @@ Delete_Loopback(){ [[ -b $FP_SOURCE ]] && G_EXEC losetup -d $FP_SOURCE; } - Exit_On_Fail(){ + G_EXIT_CUSTOM(){ + findmnt $FP_MNT_TMP &> /dev/null && umount -R $FP_MNT_TMP [[ $FP_SOURCE_IMG ]] && Delete_Loopback - exit 1 } @@ -56,7 +57,7 @@ ) G_WHIP_MENU 'Please select how the input OS is stored: -\nNB: If you want to create a Clonezilla-based installer image, the input OS needs to be attached as physical drive, since Clonezilla currently does neither support .img files nor loop devices.' || Exit_On_Fail +\nNB: If you want to create a Clonezilla-based installer image, the input OS needs to be attached as physical drive, since Clonezilla currently does neither support .img files nor loop devices.' || exit 1 if [[ $G_WHIP_RETURNED_VALUE == 'Drive' ]]; then G_WHIP_MENU_ARRAY=( @@ -73,7 +74,7 @@ - Clonezilla: An installer ISO image is created which must be flashed to an external/USB/removeable drive. Boot from the external drive will launch Clonezilla and allow you to install DietPi to any internal drive. This is required e.g. for UEFI images. - NB: Only compatible with x86_64 systems!' || Exit_On_Fail + NB: Only compatible with x86_64 systems!' || exit 1 CLONING_TOOL=$G_WHIP_RETURNED_VALUE if [[ $CLONING_TOOL == 'dd' ]]; then @@ -97,14 +98,14 @@ G_DIETPI-NOTIFY 1 'No drive with an ext4 partition found, aborting...' G_DIETPI-NOTIFY 2 'Hint: This is the list of available block devices' lsblk -npo NAME,SIZE,MAJ:MIN,FSTYPE,MOUNTPOINT,MODEL - Exit_On_Fail + exit 1 fi # Visually separate dev name and size and add model and serial for ((i=1;i<${#G_WHIP_MENU_ARRAY[@]};i+=2)); do G_WHIP_MENU_ARRAY[$i]=": $(lsblk -drno SIZE,MODEL,SERIAL ${G_WHIP_MENU_ARRAY[$i-1]})"; done G_WHIP_MENU 'Please select the drive you wish to create the image from: -\nNB: All mounted partitions of the selected drive will be unmounted.' || Exit_On_Fail +\nNB: All mounted partitions of the selected drive will be unmounted.' || exit 1 FP_SOURCE=$G_WHIP_RETURNED_VALUE G_DIETPI-NOTIFY 2 'Unmounting all mounted file systems of the selected source drive...' @@ -113,7 +114,7 @@ do mountpoint=$(findmnt -no TARGET $i) - [[ $mountpoint ]] && { umount -R $mountpoint || Exit_On_Fail; } + [[ $mountpoint ]] && G_EXEC umount -R $mountpoint done @@ -123,22 +124,22 @@ local fp_selected='/tmp/.dietpi-explorer_selected_location' [[ -f $fp_selected ]] && rm $fp_selected # Failsafe /boot/dietpi/dietpi-explorer 1 - [[ -f $fp_selected && $(<$fp_selected) ]] || Exit_On_Fail + [[ -f $fp_selected && $(<$fp_selected) ]] || exit 1 FP_SOURCE_IMG=$(<$fp_selected) rm $fp_selected if [[ ! -f $FP_SOURCE_IMG ]]; then G_DIETPI-NOTIFY 1 "Selected image file ($FP_SOURCE_IMG) does not exist, aborting..." - Exit_On_Fail + exit 1 fi # Create loopback device from .img file - G_EXEC modprobe loop || Exit_On_Fail + G_EXEC modprobe loop FP_SOURCE=$(losetup -f) - G_EXEC losetup $FP_SOURCE "$FP_SOURCE_IMG" || Exit_On_Fail - G_EXEC partprobe $FP_SOURCE || Exit_On_Fail - G_EXEC partx -u $FP_SOURCE || Exit_On_Fail + G_EXEC losetup $FP_SOURCE "$FP_SOURCE_IMG" + G_EXEC partprobe $FP_SOURCE + G_EXEC partx -u $FP_SOURCE G_DIETPI-NOTIFY 0 "Mounted the image ($FP_SOURCE_IMG) as loopback device: $FP_SOURCE" fi @@ -147,12 +148,12 @@ G_WHIP_MENU_ARRAY=($(lsblk -npo NAME,SIZE ${FP_SOURCE}?*)) # Visually separate dev name and size and add FS type for ((i=1;i<${#G_WHIP_MENU_ARRAY[@]};i+=2)); do G_WHIP_MENU_ARRAY[$i]=": $(lsblk -drno SIZE,FSTYPE ${G_WHIP_MENU_ARRAY[$i-1]})"; done - G_WHIP_MENU 'Please select the OS root partition:' || Exit_On_Fail + G_WHIP_MENU 'Please select the OS root partition:' || exit 1 FP_ROOT_DEV=$G_WHIP_RETURNED_VALUE ROOT_PARTITION_INDEX=${FP_ROOT_DEV: -1} G_WHIP_DEFAULT_ITEM='DietPi_--' - G_WHIP_INPUTBOX 'Please enter the filename for the new image:\n - DietPi_--\n - EG: DietPi_RPi-ARMv6-Buster' || Exit_On_Fail + G_WHIP_INPUTBOX 'Please enter the filename for the new image:\n - DietPi_--\n - EG: DietPi_RPi-ARMv6-Buster' || exit 1 OUTPUT_IMG_NAME=$G_WHIP_RETURNED_VALUE # Check for existing file, in case offer backup. Skip if source is image file and matches output file already. @@ -199,28 +200,27 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O else G_DIETPI-NOTIFY 1 "Unknown partition table type ($(parted -s $FP_SOURCE print | mawk '/^Partition Table:/ {print $3;exit}')), aborting..." - Exit_On_Fail + exit 1 fi - G_EXEC_OUTPUT=1 G_EXEC e2fsck -f $FP_ROOT_DEV || Exit_On_Fail + e2fsck -f $FP_ROOT_DEV || exit 1 # Remount image for any required edits - fp_mnt='tmp_rootfs' - mkdir -p /mnt/$fp_mnt - if G_EXEC_NOHALT=1 G_EXEC mount $FP_ROOT_DEV /mnt/$fp_mnt; then + mkdir -p $FP_MNT_TMP + if G_EXEC_NOHALT=1 G_EXEC mount $FP_ROOT_DEV $FP_MNT_TMP; then # Remove bash history, which is stored on shutdown, hence cannot be removed via DietPi-PREP - rm -fv /mnt/$fp_mnt/{root,home/*}/.bash_history - G_WHIP_MSG "Image mounted for file editing, make changes if required: $FP_ROOT_DEV > /mnt/$fp_mnt\n\nPress 'Ok' when you are finished." + rm -fv $FP_MNT_TMP/{root,home/*}/.bash_history + G_WHIP_MSG "Image mounted for file editing, make changes if required: $FP_ROOT_DEV > $FP_MNT_TMP\n\nPress 'Ok' when you are finished." sync - G_EXEC umount /mnt/$fp_mnt + G_EXEC umount $FP_MNT_TMP partprobe $FP_SOURCE # Failsafe partx -u $FP_SOURCE # Failsafe - e2fsck -f $FP_ROOT_DEV || Exit_On_Fail # Failsafe + e2fsck -f $FP_ROOT_DEV || exit 1 # Failsafe fi - rmdir /mnt/$fp_mnt + rmdir $FP_MNT_TMP # Shrink file system to minimum # - Run multiple times until no change is done any more @@ -246,7 +246,7 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O elif out=$(grep -im1 'no such file or directory' resize2fs_out); then G_DIETPI-NOTIFY 1 'Partition not found, aborting...' - Exit_On_Fail + exit 1 fi @@ -297,14 +297,14 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O # Check if there is enough free disk space to store the 7z file NEEDED_FREE_SPACE=$(( $IMAGE_SIZE / 100 * 15 / 1024 / 1024 )) - G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || Exit_On_Fail # Assure +100 MiB left partition space + G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || exit 1 # Assure +100 MiB left partition space # Drive source, clone with dd elif [[ $CLONING_TOOL == 'dd' ]]; then # Check if there is enough free disk space to store the image and the 7z file NEEDED_FREE_SPACE=$(( $IMAGE_SIZE / 100 * 115 / 1024 / 1024 )) - G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || Exit_On_Fail # Assure +100 MiB left partition space + G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || exit 1 # Assure +100 MiB left partition space G_DIETPI-NOTIFY 2 "Creating final image with actually used size: $(( $IMAGE_SIZE / 1024 / 1024 + 1 )) MiB" G_EXEC dd if=$FP_SOURCE of=$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT bs=1M status=progress count=$(( $IMAGE_SIZE / 1024 / 1024 + 1 )) @@ -314,14 +314,14 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O G_DIETPI-NOTIFY 2 'Creating final image with Clonezilla' # Install required packages - G_AG_CHECK_INSTALL_PREREQ clonezilla partclone xorriso isolinux syslinux-common unzip curl || Exit_On_Fail + G_AG_CHECK_INSTALL_PREREQ clonezilla partclone xorriso isolinux syslinux-common unzip curl # Download last version of Clonezilla Live CLONEZILLA_VERSION=$(curl -s "$CLONEZILLA_REPO/" | grep 'class="folder "' | head -n1 | cut -d\" -f2) if [[ -z "$CLONEZILLA_VERSION" ]]; then G_DIETPI-NOTIFY 1 'Could not retrieve version number of last Clonezilla Live, aborting...' - Exit_On_Fail + exit 1 fi CLONEZILLA_ZIP="clonezilla-live-${CLONEZILLA_VERSION}-amd64.zip" @@ -330,18 +330,18 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O # Check if there is enough free disk space to store Clonezilla, the final image and the 7z file NEEDED_FREE_SPACE=$(( ( $CLONEZILLA_ZIP_SIZE + $IMAGE_SIZE / 100 * 23 ) * 2 / 1024 / 1024 )) - G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || Exit_On_Fail # Assure +100 MiB left partition space + G_CHECK_FREESPACE . $(( $NEEDED_FREE_SPACE + 100 )) || exit 1 # Assure +100 MiB left partition space # Download Clonezilla Live if [[ ! -f $CLONEZILLA_ZIP || $(stat -c %s "$CLONEZILLA_ZIP") != $CLONEZILLA_ZIP_SIZE ]]; then G_DIETPI-NOTIFY 2 "Downloading Clonezilla Live v$CLONEZILLA_VERSION..." - G_EXEC wget "$CLONEZILLA_ZIP_URL" -O "$CLONEZILLA_ZIP" || Exit_On_Fail + G_EXEC wget "$CLONEZILLA_ZIP_URL" -O "$CLONEZILLA_ZIP" fi # Extract Clonezilla Live - G_EXEC unzip "$CLONEZILLA_ZIP" -d 'tmpiso' || Exit_On_Fail + G_EXEC unzip "$CLONEZILLA_ZIP" -d 'tmpiso' rm "$CLONEZILLA_ZIP" # Clone disk with Clonezilla @@ -349,7 +349,7 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O mkdir -p tmpiso/home/partimag G_DIETPI-NOTIFY 2 'Cloning disk with Clonezilla...' - ocs-sr -or $PWD/tmpiso/home/partimag -nogui -fsck -q2 -c -j2 -z1p -i 4096 -senc -sc savedisk $OUTPUT_IMG_NAME ${FP_SOURCE##*/} || Exit_On_Fail + ocs-sr -or $PWD/tmpiso/home/partimag -nogui -fsck -q2 -c -j2 -z1p -i 4096 -senc -sc savedisk $OUTPUT_IMG_NAME ${FP_SOURCE##*/} || exit 1 fi @@ -358,11 +358,11 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O # Check image G_DIETPI-NOTIFY 2 'Checking Clonezilla image...' - ocs-chkimg -or $PWD/tmpiso/home/partimag -nogui -b $OUTPUT_IMG_NAME || Exit_On_Fail + ocs-chkimg -or $PWD/tmpiso/home/partimag -nogui -b $OUTPUT_IMG_NAME || exit 1 # Prepare custom files used by the installer when booting in UEFI mode - G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_768p.png -O tmpiso/boot/grub/dietpibg.png || Exit_On_Fail - G_EXEC wget "$DIETPI_REPO"/.meta/images/select_bkg_c.png -O tmpiso/boot/grub/select_bkg_c.png || Exit_On_Fail + G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_768p.png -O tmpiso/boot/grub/dietpibg.png + G_EXEC wget "$DIETPI_REPO"/.meta/images/select_bkg_c.png -O tmpiso/boot/grub/select_bkg_c.png cat << '_EOF_' > tmpiso/boot/grub/theme.txt title-text: "" desktop-image: "dietpibg.png" @@ -397,7 +397,7 @@ menuentry "Power off" { halt } _EOF_ # Prepare custom files used by the installer when booting in BIOS/CSM mode - G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_480p.png -O tmpiso/syslinux/dietpibg.png || Exit_On_Fail + G_EXEC wget "$DIETPI_REPO"/.meta/images/dietpi-background_480p.png -O tmpiso/syslinux/dietpibg.png cp /usr/lib/syslinux/modules/bios/poweroff.c32 tmpiso/syslinux/ mv tmpiso/syslinux/{syslinux,clonezilla}.cfg sed -i 's|\(MENU TITLE\) .*|\1 Clonezilla live|' tmpiso/syslinux/clonezilla.cfg @@ -438,7 +438,7 @@ _EOF_ -A "clonezilla-live-${CLONEZILLA_VERSION}-amd64" \ -b syslinux/isolinux.bin -c syslinux/boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table -eltorito-alt-boot --efi-boot boot/grub/efi.img -isohybrid-gpt-basdat \ - -isohybrid-apm-hfsplus tmpiso > $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT || Exit_On_Fail + -isohybrid-apm-hfsplus tmpiso > $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT || exit 1 rm -rf tmpiso fi @@ -453,7 +453,7 @@ SHA256: $(sha256sum $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT | mawk '{print $1}') _EOF_ # Download current README - G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSfL "$DIETPI_REPO"/README.md -o README.md || Exit_On_Fail + G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSfL "$DIETPI_REPO"/README.md -o README.md # Generate 7z archive # NB: LZMA2 ultra compression requires much memory for usage and allocation, which is an issue on 32bit (ARM) devices. Use "-stm" to limit used CPU threads to "" and lower memory usage and allocation. From 1c2437f09e350d4961074c86b13cbdd076a976c2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 16:33:00 +0200 Subject: [PATCH 047/182] v6.31 + DietPi-Imager | Fix example about how to limit 7zr threads --- .meta/dietpi-imager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 63d3117301..22dc56dcda 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -456,7 +456,7 @@ _EOF_ G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSfL "$DIETPI_REPO"/README.md -o README.md # Generate 7z archive - # NB: LZMA2 ultra compression requires much memory for usage and allocation, which is an issue on 32bit (ARM) devices. Use "-stm" to limit used CPU threads to "" and lower memory usage and allocation. + # NB: LZMA2 ultra compression requires much memory for usage and allocation, which is an issue on 32bit (ARM) devices. Use "-mmt" to limit used CPU threads to "" and lower memory usage and allocation. [[ -f $OUTPUT_IMG_NAME.7z ]] && rm $OUTPUT_IMG_NAME.7z G_EXEC_DESC='Creating final 7zip archive' G_EXEC_OUTPUT=1 G_EXEC 7zr a -m0=lzma2 -mx=9 $OUTPUT_IMG_NAME.7z $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT hash.txt README.md From 5996c9d5a9ab8c34dbd0509a27f5e8958cc90d6e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 May 2020 19:48:45 +0200 Subject: [PATCH 048/182] v6.31 (#3545) + Odroid C4 | Add initial support --- .meta/dietpi-survey_report | 1 + CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 12 ++++++-- dietpi/dietpi-software | 48 +++++++++++++++++++++++------- dietpi/func/dietpi-obtain_hw_model | 7 ++++- dietpi/misc/start_kodi | 4 +-- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 95e9a52066..956dcf2687 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -20,6 +20,7 @@ aHW_NAME[13]='Odroid U3' aHW_NAME[14]='Odroid N1' aHW_NAME[15]='Odroid N2' + aHW_NAME[16]='Odroid C4' aHW_NAME[20]='x86_64 VM' aHW_NAME[21]='x86_64 PC' aHW_NAME[22]='Generic Device' diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b363357678..9e423baa58 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.31 (XX/06/20) Changes / Improvements / Optimisations: +- Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 17d5be171d..f96bf12893 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -394,6 +394,7 @@ #'4' ': Raspberry Pi 4' '11' ': Odroid XU3/XU4/MC1/HC1/HC2' '12' ': Odroid C2' + '15' ': Odroid N2' '44' ': Pinebook' '' '●─ x86_64 ' '21' ': x86_64 Native PC' @@ -402,7 +403,7 @@ '10' ': Odroid C1' '13' ': Odroid U3' '14' ': Odroid N1' - '15' ': Odroid N2' + '16' ': Odroid C4' '70' ': Sparky SBC' '52' ': ASUS Tinker Board' '40' ': PINE A64' @@ -706,7 +707,7 @@ _EOF_' 'curl' # Web address testing, downloading, uploading etc. 'debconf' # APT package pre-configuration, e.g. "debconf-set-selections" for non-interactive install 'dirmngr' # GNU key management required for some APT installs via additional repos - 'ethtool' # Ethernet link checking + 'ethtool' # Force Ethernet link speed 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'gnupg' # apt-key add 'htop' # System monitor @@ -768,7 +769,7 @@ _EOF_' fi # - Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, on RPi rng-tools (default on Raspbian), else haveged: https://github.com/MichaIng/DietPi/issues/2806 - if [[ $G_HW_MODEL =~ ^(14|42|58|68|69|72)$ ]]; then # RK3399 + if [[ $G_HW_MODEL =~ ^(14|16|42|58|68|69|72)$ ]]; then # RK3399, Odroid C4 aPACKAGES_REQUIRED_INSTALL+=('rng-tools5') @@ -876,6 +877,11 @@ _EOF_' G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills + # Odroid C4 + elif (( $G_HW_MODEL == 16 )); then + + G_AGI linux-image-arm64-odroid-c4 meveric-keyring + # Odroid N2 elif (( $G_HW_MODEL == 15 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ee5593ed18..94f9f2a781 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -461,8 +461,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - # Odroid N2 has not GPU support for Xserver, hence it's not required for Kodi - (( $G_HW_MODEL == 15 )) || aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + # Odroid N2+C4 have not GPU support for Xserver, hence it's not required for Kodi + [[ $G_HW_MODEL == 1[56] ]] || aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # Only RPi + Odroid + x86_64 for ((i=22; i<=$MAX_G_HW_MODEL; i++)) do @@ -483,8 +483,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='ympd' aSOFTWARE_DESC[$software_id]='lightweight web interface music player for mpd' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' #------------------ @@ -525,8 +525,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='Subsonic' aSOFTWARE_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 @@ -539,16 +539,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='Logitech Media Server' aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' #------------------ software_id=36 aSOFTWARE_NAME[$software_id]='SqueezeLite' aSOFTWARE_DESC[$software_id]='audio player for lms & squeezebox' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' #------------------ @@ -3660,13 +3660,16 @@ _EOF_ # Odroids if [[ $G_HW_MODEL == 1[0-9] ]]; then - # Odroid C2+N2: aml-libs-odroid - [[ $G_HW_MODEL == 1[25] ]] && package_list+=' aml-libs-odroid' + # Odroid C2+N2+C4: aml-libs-odroid + [[ $G_HW_MODEL == 1[256] ]] && package_list+=' aml-libs-odroid' + + # Odroid N1: librockchip-mpp1 + [[ $G_HW_MODEL == 11 ]] && package_list+=' librockchip-mpp1' # Odroid N2: https://github.com/MichaIng/DietPi/issues/3255 if (( $G_HW_MODEL == 15 )); then - package_list+=' malig52-fbdev-opencl-odroid kodi-n2-fbdev-odroid' + package_list+=' malig52-fbdev-opencl-odroid kodi-aml-fbdev-odroid' echo 'media_clock firmware decoder_common @@ -3686,6 +3689,29 @@ amvdec_real amvdec_vc1 amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf + # Odroid C4 + elif (( $G_HW_MODEL == 16 )); then + + package_list+=' malig31-fbdev-opencl-odroid kodi-aml-fbdev-odroid' + echo 'media_clock +firmware +decoder_common +stream_input +amvdec_avs +amvdec_h264 +amvdec_h264_4k2k +amvdec_mh264 +amvdec_h264mvc +amvdec_h265 +amvdec_mjpeg +amvdec_mmjpeg +amvdec_mpeg12 +amvdec_mpeg4 +amvdec_mmpeg4 +amvdec_real +amvdec_vc1 +amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf + else package_list+=' kodi-odroid' @@ -13207,12 +13233,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libcec4 libcurl3-gnutls libnfs* # Odroid N2: aml-libs-odroid malig52-fbdev-opencl-odroid - G_AGP kodi kodi-odroid kodi-n2-fbdev-odroid + G_AGP kodi kodi-odroid kodi-n2-fbdev-odroid kodi-aml-fbdev-odroid [[ -f '/usr/share/applications/kodi.desktop' ]] && rm /usr/share/applications/kodi.desktop rm -f /{root,home/*}/Desktop/kodi.desktop [[ -f '/etc/udev/rules.d/99-dietpi-kodi.rules' ]] && rm /etc/udev/rules.d/99-dietpi-kodi.rules [[ -f '/etc/modules-load.d/dietpi-n2-kodi.conf' ]] && rm /etc/modules-load.d/dietpi-n2-kodi.conf + [[ -f '/etc/modules-load.d/dietpi-c4-kodi.conf' ]] && rm /etc/modules-load.d/dietpi-c4-kodi.conf fi diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index ed6c40649e..d70df15d6d 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -57,6 +57,7 @@ # G_HW_MODEL 22 Generic Device # G_HW_MODEL 21 x86_64 PC # G_HW_MODEL 20 x86_64 VM + # G_HW_MODEL 16 Odroid C4 # G_HW_MODEL 15 Odroid N2 # G_HW_MODEL 14 Odroid N1 # G_HW_MODEL 13 Odroid U3 @@ -79,7 +80,7 @@ # G_HW_CPUID 1 Allwinner H3 # G_HW_CPUID 2 Allwinner H5 # G_HW_CPUID 3 Rockchip RK3399 - # G_HW_CPUID 4 Samsung S922X + # G_HW_CPUID 4 Amlogic S922X # G_HW_CPUID 5 Allwinner H6 # ---------------- # G_DISTRO 0 unknown/unsupported @@ -490,6 +491,10 @@ G_HW_MODEL_NAME='Virtual Machine' + elif (( $G_HW_MODEL == 16 )); then + + G_HW_MODEL_NAME='Odroid C4' + elif (( $G_HW_MODEL == 15 )); then G_HW_MODEL_NAME='Odroid N2' diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index 04d28e2bae..bc8f6cc7cf 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -23,8 +23,8 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # RPi + Odroid N2 - if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 15 )); then + # RPi + Odroid N2 + Odroid C4 + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 15 || $G_HW_MODEL == 16 )); then kodi --standalone From bff5112babbf595c16f008f470d02dae42b4773c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 10:26:50 +0200 Subject: [PATCH 049/182] v6.31 + DietPi-FirstBoot | Apply static DNS nameserver via /etc/resolv.conf directly, since resolvconf is not preinstalled anymore: https://github.com/MichaIng/DietPi/commit/22131fe4b63124bf9e93a229f45fc49380dd09b4#diff-0e127c4cad3f8401a925d13d05b5ae87 --- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 05a05550b0..6d95a9dc8e 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -263,7 +263,8 @@ sed -i "/address/c\address $static_ip" /etc/network/interfaces sed -i "/netmask/c\netmask $static_mask" /etc/network/interfaces sed -i "/gateway/c\gateway $static_gateway" /etc/network/interfaces - sed -i "/dns-nameservers/c\dns-nameservers $static_dns" /etc/network/interfaces + > /etc/resolv.conf + for i in $static_dns; do echo "nameserver $i" >> /etc/resolv.conf; done fi From 0b4a4d4ad860b30fafa0873acc0bee0eb0a817d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 11:15:44 +0200 Subject: [PATCH 050/182] v6.31 + DietPi-Imager | Remove the loopback device only if a file is attached, since the device file exists always --- .meta/dietpi-imager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 22dc56dcda..102cb35e98 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -38,7 +38,7 @@ CLONEZILLA_REPO='https://sourceforge.net/projects/clonezilla/files/clonezilla_live_alternative' DIETPI_REPO="https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH" - Delete_Loopback(){ [[ -b $FP_SOURCE ]] && G_EXEC losetup -d $FP_SOURCE; } + Delete_Loopback(){ losetup $FP_SOURCE &> /dev/null && G_EXEC losetup -d $FP_SOURCE; } G_EXIT_CUSTOM(){ From 95497cec8f0034a74459777d4d0d0f578fb1d303 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 11:22:19 +0200 Subject: [PATCH 051/182] v6.31 + DietPi-Explorer | Print some info when processing the content of the current dir, since this ("wc -c" on all files) can take some seconds on slower drives and/or when large files are contained. ToDo: Think about scraping "ls -Al" output instead! --- dietpi/dietpi-explorer | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/dietpi/dietpi-explorer b/dietpi/dietpi-explorer index e3281c0aa7..e8c6df5bba 100644 --- a/dietpi/dietpi-explorer +++ b/dietpi/dietpi-explorer @@ -17,7 +17,7 @@ # - dietpi-explorer 1 Select a file/folder mode, start from #//////////////////////////////////// - # Use $2, else current dir to start in, which needs to be stored before G_INIT navigates to /tmp/$G_PROGRAM_NAME + # Start in $2, else in current dir, which needs to be stored before G_INIT navigates to /tmp/$G_PROGRAM_NAME TARGET_FP=${2:-$PWD} # Import DietPi-Globals -------------------------------------------------------------- @@ -37,17 +37,13 @@ Process_Copy_Move(){ - if [[ $CP_TARGET ]]; then + if (( $CP_MODE == 0 )); then - if (( $CP_MODE == 0 )); then + G_EXEC_NOHALT=1 G_EXEC cp -a "$CP_SOURCE" "$CP_TARGET"/ - G_EXEC_NOHALT=1 G_EXEC cp -a "$CP_SOURCE" "$CP_TARGET"/ + elif (( $CP_MODE == 1 )); then - elif (( $CP_MODE == 1 )); then - - G_EXEC_NOHALT=1 G_EXEC mv "$CP_SOURCE" "$CP_TARGET"/ - - fi + G_EXEC_NOHALT=1 G_EXEC mv "$CP_SOURCE" "$CP_TARGET"/ fi @@ -71,7 +67,7 @@ G_WHIP_MENU_ARRAY=('' '●─ Navigation') if [[ -f $TARGET_FP && $INPUT != 1 ]]; then # Disable open of files in select mode. - G_WHIP_MENU_ARRAY+=('Open' " : Open '$TARGET_FP' in Nano (text edit)") + G_WHIP_MENU_ARRAY+=('Open' " : Open '$TARGET_FP' in nano (text editor)") elif [[ -d $TARGET_FP ]]; then @@ -186,22 +182,14 @@ done <<< "$(getent group | cut -d: -f1 | sort)" G_WHIP_DEFAULT_ITEM=$group_current - if G_WHIP_MENU 'Chown permissions:\n - Please select a Group'; then - - G_EXEC_NOHALT=1 G_EXEC chown -R $user_target:$G_WHIP_RETURNED_VALUE "$CURRENT_DIRECTORY/$TARGET_FP" - - fi + G_WHIP_MENU 'Chown permissions:\n - Please select a Group' && G_EXEC_NOHALT=1 G_EXEC chown -R "$user_target:$G_WHIP_RETURNED_VALUE" "$CURRENT_DIRECTORY/$TARGET_FP" fi elif [[ $G_WHIP_RETURNED_VALUE == 'Chmod' ]]; then G_WHIP_DEFAULT_ITEM=$chmod_current - if G_WHIP_INPUTBOX 'Chmod permissions:\n - Please enter a value'; then - - G_EXEC_NOHALT=1 G_EXEC chmod -R $G_WHIP_RETURNED_VALUE "$CURRENT_DIRECTORY/$TARGET_FP" - - fi + G_WHIP_INPUTBOX 'Chmod permissions:\n - Please enter a value' && G_EXEC_NOHALT=1 G_EXEC chmod -R "$G_WHIP_RETURNED_VALUE" "$CURRENT_DIRECTORY/$TARGET_FP" fi @@ -220,11 +208,11 @@ Menu_Main(){ CURRENT_DIRECTORY=$PWD - G_WHIP_MENU_ARRAY=() if [[ $CURRENT_DIRECTORY == '/' ]]; then CURRENT_DIRECTORY= + G_WHIP_MENU_ARRAY=() else @@ -237,12 +225,16 @@ fi + # Print info since this can take some seconds on slower drives and/or when large files are contained. + # - Probably we should better scrape "ls -Al" and e.g. show owner and modes as well? + echo -ne 'Scanning current directory...\r' + for item in "$CURRENT_DIRECTORY"/{..?,.[^.],}* do if [[ -f $item ]]; then - G_WHIP_MENU_ARRAY+=( "${item##*/}" " : $(wc -c < "$item") Bytes" ) + G_WHIP_MENU_ARRAY+=( "${item##*/}" ": $(wc -c < "$item") Bytes" ) elif [[ -e $item || -L $item ]]; then From edcce06ad0770a385ee5956bcf3b04af564e2895 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 12:52:55 +0200 Subject: [PATCH 052/182] v6.31 + DietPi-Software | Use new method clear terminal by moving existing content into history, thus preserving it --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 94f9f2a781..7bef72f85e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16377,7 +16377,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then # Start DietPi Menu while (( $TARGETMENUID > -1 )); do - printf '\ec' # clear current terminal screen + G_TERM_CLEAR Menu_Main done From 10eabd93d31092f6325c95ebc4b58bcaba9562c3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 13:59:49 +0200 Subject: [PATCH 053/182] v6.31 + DietPi-PREP | Revert /tmp tmpfs size to default after it has been set by DietPi-Set_swapfile --- PREP_SYSTEM_FOR_DIETPI.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index f96bf12893..93d28707a2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1680,6 +1680,8 @@ _EOF_ [[ -e '/var/swap' ]] && rm -v /var/swap # still exists on some images... # - Re-enable for next run G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_SIZE=' 'AUTO_SETUP_SWAPFILE_SIZE=1' /boot/dietpi.txt + # - Reset /tmp size to default (512 MiB) + sed -i '\|/tmp|s|size=[^,]*,||' /etc/fstab G_DIETPI-NOTIFY 2 'Resetting boot.ini, config.txt, cmdline.txt etc' From c39e0e07c8c82422cdfa4c45ec67d180893c4568 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 14:18:24 +0200 Subject: [PATCH 054/182] v6.31 + DietPi-PREP | Fix check for GPT partition table --- PREP_SYSTEM_FOR_DIETPI.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 93d28707a2..9a79479a0c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -795,18 +795,10 @@ _EOF_' fi # G_HW_MODEL specific - if (( $G_HW_MODEL != 20 )); then - - aPACKAGES_REQUIRED_INSTALL+=('hdparm') # Drive power management adjustments - - fi + (( $G_HW_MODEL == 20 )) || aPACKAGES_REQUIRED_INSTALL+=('hdparm') # Drive power management adjustments # Install gdisk if root file system is on a GPT partition, used by DietPi-FS_partition_resize - if [[ $(parted -s "$(lsblk -npo PKNAME "$(findmnt -no SOURCE /)")" print) == *'Partition Table: msdos'* ]]; then - - aPACKAGES_REQUIRED_INSTALL+=('gdisk') - - fi + [[ $(parted -s "$(lsblk -npo PKNAME "$(findmnt -no SOURCE /)")" print) == *'Partition Table: gpt'* ]] && aPACKAGES_REQUIRED_INSTALL+=('gdisk') # Install required filesystem packages if [[ $(blkid -s TYPE -o value) =~ (^|[[:space:]]|v)'fat' ]]; then From e9ae410ab1b8ad28afe4abb6e3246678fa8a831e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 May 2020 21:45:25 +0200 Subject: [PATCH 055/182] v6.31 + DietPi-Globals | G_OBTAIN_CPU_TEMP: Add support for new Odroid C1 Armbian legacy Linux 5.4.40 image: https://dietpi.com/phpbb/viewtopic.php?p=24860#p24860 + DietPi-Globals | Minor coding enhancements which i.a. removes the need to pre-create G_PROMPT_BACKUP_DISABLED and G_THREADING_ENABLED variables by directly checking against the default value --- dietpi/func/dietpi-globals | 83 +++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 6b7556a6ac..1ede542453 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1479,7 +1479,7 @@ $log_content" || break # Exit error handler menu loop on cancel # Read CPU temp from file local temp - # - Sparky/Asus: Requires special case as in others array this would break other SBC temp readouts with 2 zones + # - Sparky/ASUS: Requires special case as in others array this would break other SBC temp readouts with 2 zones if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then [[ -f '/sys/class/thermal/thermal_zone1/temp' ]] && temp=$(= 150 )) && temp=$(mawk '{print $1/1000}' <<< $temp | xargs printf "%0.0f") + (( $temp >= 200 )) && temp=$(mawk '{print $1/1000}' <<< $temp | xargs printf "%0.0f") if [[ $print_full_info == 1 ]]; then @@ -1708,28 +1709,22 @@ $log_content" || break # Exit error handler menu loop on cancel } # Prompt user to create a backup before system changes. Exit existing scripts if failed. - [[ $G_PROMPT_BACKUP_DISABLED == [01] ]] || G_PROMPT_BACKUP_DISABLED=0 G_PROMPT_BACKUP(){ - if (( ! $G_PROMPT_BACKUP_DISABLED )); then + [[ $G_PROMPT_BACKUP_DISABLED == 1 ]] && return 0 - if G_WHIP_YESNO 'Would you like to create (or update) a "DietPi-Backup" of the system, before proceeding?\n\n"DietPi-Backup" creates a system restore point, which can be recovered if unexpected issues occur.\n\nFor more information on "DietPi-Backup", please use the link below:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255'; then + G_WHIP_YESNO 'Would you like to create (or update) a "DietPi-Backup" of the system, before proceeding?\n\n"DietPi-Backup" creates a system restore point, which can be recovered if unexpected issues occur.\n\nFor more information on "DietPi-Backup", please use the link below:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255' || return 0 - /boot/dietpi/dietpi-backup 1 - local exit_code=$? - - G_DIETPI-NOTIFY -1 $exit_code 'DietPi-Backup' - if (( $exit_code )); then - - # Kill current scripts, excluding shell - G_WHIP_MSG 'DietPi-Backup was unable to complete sucessfully. To avoid issues, the current program will now be terminated.\n - logfile = /var/log/dietpi-backup.log' - kill -INT $$ - - fi + /boot/dietpi/dietpi-backup 1 + local exit_code=$? - fi + G_DIETPI-NOTIFY -1 $exit_code 'DietPi-Backup' + (( $exit_code )) || return 0 - fi + # Kill current scripts, excluding shell + G_WHIP_MSG '[FAILED] DietPi-Backup was unable to complete sucessfully.\n\nTo avoid issues, the current program will now be terminated.\n\nLog file: /var/log/dietpi-backup.log' + kill -INT $$ + return 1 } @@ -1744,30 +1739,28 @@ $log_content" || break # Exit error handler menu loop on cancel for i in "${ainput_string[@]}" do - if [[ -e $i ]]; then + [[ -e $i ]] || continue - local fp_backup_target="$i.bak_$(date +%d%m%y)" - local index=0 - while [[ -e ${fp_backup_target}_$index ]] - do - - ((index++)) - - done + local fp_backup_target="$i.bak_$(date +%d%m%y)" + local index=0 + while [[ -e ${fp_backup_target}_$index ]] + do - local notify_code=1 - if cp -a $i ${fp_backup_target}_$index; then + ((index++)) - notify_code=0 - print_fp_db_info=1 - echo "${fp_backup_target}_$index # $G_PROGRAM_NAME" >> $fp_db_log + done - fi + local notify_code=1 + if cp -a "$i" "${fp_backup_target}_$index"; then - G_DIETPI-NOTIFY $notify_code "$i: backup to ${fp_backup_target}_$index" + notify_code=0 + print_fp_db_info=1 + echo "${fp_backup_target}_$index # $G_PROGRAM_NAME" >> $fp_db_log fi + G_DIETPI-NOTIFY $notify_code "$i: backup to ${fp_backup_target}_$index" + done (( $print_fp_db_info )) && G_DIETPI-NOTIFY 2 "For a full list of backup items, please see $fp_db_log" @@ -1778,12 +1771,17 @@ $log_content" || break # Exit error handler menu loop on cancel # Multithreading handler #----------------------------------------------------------------------------------- # Not yet compatible with dietpi global commands. single bash commands only with no error handling. - [[ $G_THREADING_ENABLED == [01] ]] || G_THREADING_ENABLED=1 - G_THREAD_START(){ - # Launch as BG process - if (( $G_THREADING_ENABLED )); then + # Run in blocking mode + if [[ $G_THREADING_ENABLED == 0 ]]; then + + local command=$* + G_DIETPI-NOTIFY 2 "G_THREADING disabled, running command in blocking mode | $command" + $command + + # Launch as background process + else [[ $G_THREAD_COUNT =~ ^[0-9]+$ ]] || G_THREAD_COUNT=-1 ((G_THREAD_COUNT++)) @@ -1794,13 +1792,6 @@ $log_content" || break # Exit error handler menu loop on cancel G_DIETPI-NOTIFY 2 "G_THREAD_START_$G_THREAD_COUNT | ${G_THREAD_COMMAND[$G_THREAD_COUNT]}" - # Run in blocking mode - else - - local command=$* - G_DIETPI-NOTIFY 2 "G_THREADING disabled, running command in blocking mode | $command" - $command - fi } From 6d6e3d33aa610e7fdae8e68588665b79ab3c8b7d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 19 May 2020 17:17:25 +0200 Subject: [PATCH 056/182] v6.31 (#3546) + DietPi-Software | Folding@Home: Update to new v7.6.X + DietPi-Software | Folding@Home: Create default config file, prevent config backup on each change + DietPi-Software | Folding@Home: Disable file logging by default, "journalctl -u fahclient" can be used instead, reduce logging level to minimum + DietPi-Software | Folding@Home: Pause on initial service start. When folding is manually started, this is overridden per-slot for next service start but prevents us from pulling a work unit even on test installs. + DietPi-Software | Folding@Home: The previous package does not need to be purged anymore before the new one can be installed + DietPi-Software | Folding@Home: It is now possible to prevent the service start on package install + DietPi-Software | Folding@Home: FAHClient will not store given command line options to a new config file anymore, hence we need to create our own default config but can skip all command line options within the systemd unit + DietPi-Software | Folding@Home: Fix signing out from all work units on uninstall + DietPi-Patch| Folding@Home: Reinstall to apply v7.6.X update, remove obsolete files and purge installed package, since the old one caused issues on reinstall --- .conf/dps_2/config.xml | 27 ++++++++++++++++++++ CHANGELOG.txt | 2 ++ dietpi/dietpi-software | 56 +++++++++++++++++++++--------------------- dietpi/patch_file | 16 ++++++++++++ 4 files changed, 73 insertions(+), 28 deletions(-) create mode 100644 .conf/dps_2/config.xml diff --git a/.conf/dps_2/config.xml b/.conf/dps_2/config.xml new file mode 100644 index 0000000000..d6f21b38d5 --- /dev/null +++ b/.conf/dps_2/config.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9e423baa58..366fd71c8b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,8 @@ Changes / Improvements / Optimisations: - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 +- DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ + This update is applied to all systems with DietPi v6.31, existing config and data are preserved. Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7bef72f85e..28f938876a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1232,8 +1232,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='Folding@Home' aSOFTWARE_DESC[$software_id]='distributed disease research project' - aSOFTWARE_CATEGORY_INDEX[$software_id]=20 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=20 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13704#p13704' # x86_64 only for ((i=1; i<$MAX_G_HW_ARCH; i++)) @@ -3385,24 +3385,14 @@ _EOF_ Banner_Installing - # We must uninstall previous package for reinstall, else it will fail: https://github.com/MichaIng/DietPi/issue_comments#issuecomment-411688073 - if dpkg-query -s 'fahclient' &> /dev/null; then - - G_DIETPI-NOTIFY 2 'Removing previous package before installing the latest version' - G_AGP fahclient - - fi - G_DIETPI-NOTIFY 2 'Pre-configuring FAHClient deb package' - debconf-set-selections <<< 'fahclient fahclient/autostart boolean true' # external bug with setting false https://github.com/FoldingAtHome/fah-issues/issues/1193 + debconf-set-selections <<< 'fahclient fahclient/autostart boolean false' # Do not start SysV service after package install debconf-set-selections <<< 'fahclient fahclient/power select light' debconf-set-selections <<< 'fahclient fahclient/team string 234437' # Team "DietPi" - debconf-set-selections <<< 'fahclient fahclient/user string DietPi' # Default, until user chooses an own username - debconf-set-selections <<< 'fahclient fahclient/passkey string 06c869246e88c00cb05cc4d1758a97f9' - - Download_Install 'https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.5/latest.deb' + debconf-set-selections <<< 'fahclient fahclient/user string DietPi' # User "DietPi" + debconf-set-selections <<< 'fahclient fahclient/passkey string 06c869246e88c00cb05cc4d1758a97f9' # Passkey for user "DietPi" - killall -w FAHClient # Due to https://github.com/FoldingAtHome/fah-issues/issues/1193 + Download_Install 'https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/latest.deb' fi @@ -7338,33 +7328,39 @@ _EOF_ Banner_Configuration - # Remove old data + config directories and init.d service + # Remove obsolete config + data directories and SysV service + config [[ -d '/var/lib/fahclient' ]] && rm -R /var/lib/fahclient [[ -d '/etc/fahclient' ]] && rm -R /etc/fahclient + [[ -f '/etc/default/fahclient' ]] && rm /etc/default/fahclient [[ -f '/etc/init.d/FAHClient' ]] && rm /etc/init.d/FAHClient update-rc.d -f FAHClient remove - # Create new working (data + config) directory and log file - mkdir -p $G_FP_DIETPI_USERDATA/fahclient - > /var/log/fahclient.log + # Prepare our new config + data directory if not yet present + if [[ ! -f $G_FP_DIETPI_USERDATA/fahclient/config.xml ]]; then - # Create new systemd service - cat << _EOF_ > /lib/systemd/system/fahclient.service + mkdir -p $G_FP_DIETPI_USERDATA/fahclient + dps_index=$software_id Download_Install 'config.xml' $G_FP_DIETPI_USERDATA/fahclient/config.xml + + fi + + # Service + cat << _EOF_ > /etc/systemd/system/fahclient.service [Unit] Description=Folding@Home (DietPi) +Wants=network-online.target +After=network-online.target dietpi-boot.service [Service] User=fahclient -Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/fahclient -ExecStart=$(command -v FAHClient) --allow='0/0' --web-allow='0/0' --daemon=false --user=DietPi --team=234437 --passkey=06c869246e88c00cb05cc4d1758a97f9 --gpu=true --log-rotate=false --log=/var/log/fahclient.log --power=light --data-directory=$G_FP_DIETPI_USERDATA/fahclient +ExecStart=$(command -v FAHClient) [Install] WantedBy=multi-user.target _EOF_ # Permissions - chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log + chown -R fahclient $G_FP_DIETPI_USERDATA/fahclient fi @@ -12847,12 +12843,16 @@ _EOF_ Banner_Uninstalling # Un-check out all work units, so they can be picked up by other donors prior to timeout: https://github.com/FoldingAtHome/fah-issues/issues/1255 - FAHClient --dump + FAHClient --chdir $G_FP_DIETPI_USERDATA/fahclient --dump all + + if [[ -f '/etc/systemd/system/fahclient.service' ]]; then + systemctl disable --now fahclient + rm -R /etc/systemd/system/fahclient.service* + + fi G_AGP fahclient - rm -R $G_FP_DIETPI_USERDATA/fahclient - rm /lib/systemd/system/fahclient.service - rm /var/log/fahclient.log + [[ -d $G_FP_DIETPI_USERDATA/fahclient ]] && rm -R $G_FP_DIETPI_USERDATA/fahclient fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 9f17115113..b9265e510e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2424,6 +2424,22 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" # Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 G_EXEC chmod a+x /mnt/dietpi_userdata #------------------------------------------------------------------------------- + # Reinstalls + # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + + if grep -q '^aSOFTWARE_INSTALL_STATE\[2\]=2' /boot/dietpi/.installed; then + + G_DIETPI-NOTIFY 2 'Preparing Folding@Home update...' + [[ -f '/lib/systemd/system/fahclient.service' ]] && rm /etc/systemd/system/fahclient.service + [[ -f '/var/log/fahclient.log' ]] && rm /var/log/fahclient.log + dpkg-query -s 'fahclient' &> /dev/null && G_AGP fahclient + + fi + echo 2 >> /var/tmp/dietpi/dietpi-update_reinstalls + + fi + #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]]; then From 99caec8ea8cd043a16fe8e59319d729acec75d28 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 May 2020 14:11:59 +0200 Subject: [PATCH 057/182] v6.31 + DietPi-Patch | Assure that correct permissions for /run/dietpi and /run/dietpi/.network are applied when creating them (pre-v6.29) --- dietpi/patch_file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index b9265e510e..19b8907f2f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -93,9 +93,9 @@ fi # - Pre-create new DietPi runtime dir for later used scripts, created via /etc/tmpfiles.d/dietpi.conf from next boot on - [[ -d '/run/dietpi' ]] || mkdir -p /run/dietpi + [[ -d '/run/dietpi' ]] || { mkdir -p /run/dietpi; chmod 777 /run/dietpi; } # - Create network info file on new location - [[ -f '/run/dietpi/.network' ]] || /boot/dietpi/func/obtain_network_details && chmod 666 /run/dietpi/.network + [[ -f '/run/dietpi/.network' ]] || { /boot/dietpi/func/obtain_network_details; chmod 666 /run/dietpi/.network; } # Pre-v6.22: Update Git owner due to official lead transfer from Fourdee to MichaIng: https://github.com/MichaIng/DietPi/issues/2589 grep -q '^[[:blank:]]*DEV_GITOWNER=Fourdee' /boot/dietpi.txt && sed -i '/^[[:blank:]]*DEV_GITOWNER=/c\DEV_GITOWNER=MichaIng' /boot/dietpi.txt From b0c23fbf209f48a77bb50b3a80d5b55c31b1f833 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 May 2020 15:42:52 +0200 Subject: [PATCH 058/182] v6.31 + DietPi-Software | Plex Media Server: On uninstall, remove systemd unit which currently survives the package purging: https://github.com/MichaIng/DietPi/issues/3551 --- dietpi/dietpi-software | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 28f938876a..5c5e49afb7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13860,6 +13860,14 @@ _EOF_ Banner_Uninstalling G_AGP plexmediaserver + # Remove systemd unit which currently survives the package purging: https://github.com/MichaIng/DietPi/issues/3551 + if [[ -f '/lib/systemd/system/plexmediaserver.service' ]]; then + + systemctl unmask plexmediaserver + systemctl disable --now plexmediaserver + rm -R /lib/systemd/system/plexmediaserver.service* + + fi [[ -d '/var/lib/plexmediaserver' ]] && rm -R /var/lib/plexmediaserver # Left over from purging package, still... [[ -d '/etc/systemd/system/plexmediaserver.service.d' ]] && rm -R /etc/systemd/system/plexmediaserver.service.d From 5e8144b29fc703bdbeb4786d16ea99f68b6217c3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 May 2020 16:13:32 +0200 Subject: [PATCH 059/182] v6.31 + DietPi-PREP | Install modern rng-tools5 on Odroid XU4 as well: https://github.com/MichaIng/DietPi/issues/3544#issuecomment-632086158 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 9a79479a0c..be0e0ee0af 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -769,7 +769,7 @@ _EOF_' fi # - Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, on RPi rng-tools (default on Raspbian), else haveged: https://github.com/MichaIng/DietPi/issues/2806 - if [[ $G_HW_MODEL =~ ^(14|16|42|58|68|69|72)$ ]]; then # RK3399, Odroid C4 + if [[ $G_HW_MODEL =~ ^(11|14|16|42|58|68|69|72)$ ]]; then # Odroid XU4, RK3399, Odroid C4 aPACKAGES_REQUIRED_INSTALL+=('rng-tools5') From 6cd00ba620f8569104010dc922eb2e601cc48746 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 May 2020 17:22:50 +0200 Subject: [PATCH 060/182] v6.31 + DietPi-Cloudshell | Calling the external "clear" binary is quite slow. It is possible to redirect its output to use it later with only shell-internal commands, which is orders of magnitudes faster. We could use known escape sequences here but using the sequence the "clear" estimates to be the best for the current terminal type makes it most compatible and does not change the current behaviour in any way, besides performance ;). + DietPi-Cloudshell | Minor coding enhancement --- dietpi/dietpi-cloudshell | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 084acced1e..bd02b3600c 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -1184,6 +1184,10 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// Init(){ + #-------------------------------------------------------------------------------- + # Override (slow) external "clear" command with function that prints the pure control sequence, clearing the screen MUCH faster! + eval "clear(){ printf '$(clear)'; }" + #-------------------------------------------------------------------------------- # Storage array Init_STORAGE @@ -1202,27 +1206,9 @@ _EOF_ [[ -f '/etc/pihole/gravity.list' ]] || aEnabledScenes[8]=0 #-------------------------------------------------------------------------------- - # Ensure we have at least 1 Scene enabled in the settings file. - local enabled_scene=0 - for ((i=0; i<$MAX_SCENES; i++)) - do - - if (( ${aEnabledScenes[$i]} )); then - - enabled_scene=1 - break + # Ensure we have at least 1 scene (dietpi) enabled in the settings file. + [[ ${aEnabledScenes[*]} == *1* ]] || aEnabledScenes[4]=1 SCENE_CURRENT=4 - fi - - done - - # No Scenes selected! Override user setting and enable at least 1 scene (dietpi) - if (( $enabled_scene == 0 )); then - - aEnabledScenes[4]=1 - SCENE_CURRENT=4 - - fi #-------------------------------------------------------------------------------- # Update DietPi network shared data: https://github.com/MichaIng/DietPi/issues/359 /boot/dietpi/func/obtain_network_details From 4ee75d88a5a06e0552f2030792fe825eb200fa01 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 24 May 2020 18:36:01 +0200 Subject: [PATCH 061/182] v6.31 + DietPi-PREP | ROCK Pi S: rockpis-dtbo is not required as it doubles the overlays that are already provided (among others) with the kernel package --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index be0e0ee0af..7877e7bdd1 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -897,7 +897,7 @@ _EOF_' # ROCK Pi S (official Radxa Debian image) elif (( $G_HW_MODEL == 73 )) && grep -q 'apt\.radxa\.com' /etc/apt/sources.list.d/*.list; then - G_AGI rockpis-rk-u-boot-latest linux-4.4-rockpis-latest rockpis-dtbo rockchip-overlay + G_AGI rockpis-rk-u-boot-latest linux-4.4-rockpis-latest rockchip-overlay # - Auto detect kernel package incl. ARMbian/others DTB else From 16d105e1be9c920df56307c503630ccf47a7cacc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 25 May 2020 17:44:20 +0200 Subject: [PATCH 062/182] v6.31 + DietPi-PREP | Do not remove /home (recreated anyway) and /media but their content only, since their existence is required to fulfil FHS and their absence can hence lead to issues: https://github.com/MichaIng/DietPi/issues/3558, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956495#15 --- PREP_SYSTEM_FOR_DIETPI.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7877e7bdd1..51ccb014c2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1027,10 +1027,10 @@ _EOF_' G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' - [[ -d '/home' ]] && rm -vR /home - [[ -d '/media' ]] && rm -vR /media - [[ -d '/selinux' ]] && rm -vR /selinux - [[ -d '/var/cache/apparmor' ]] && rm -vR /var/cache/apparmor + [[ -d '/home' ]] && rm -Rfv /home/{,.??,.[^.]}* || mkdir /home + [[ -d '/media' ]] && rm -Rfv /media/{,.??,.[^.]}* || mkdir /media + [[ -d '/selinux' ]] && rm -Rv /selinux + [[ -d '/var/cache/apparmor' ]] && rm -Rv /var/cache/apparmor rm -Rfv /var/lib/dhcp/{,.??,.[^.]}* rm -Rfv /var/backups/{,.??,.[^.]}* From 7a4350f648d26215d46acb555223d31b6efc9d15 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 25 May 2020 19:56:39 +0200 Subject: [PATCH 063/182] v6.31 + DietPi-Software | Sonarr: Install from stable/master branch instead of develop + DietPi-Software | Sonarr/Radarr/Lidarr: Add /media to ReadWritePaths to not break instances where users use /media for their mounts: https://github.com/MichaIng/DietPi/issues/3561 + DietPi-Software | Sonarr/Radarr/Lidarr/Jackett: When enabling services for systemd-controlled startup at boot, wait for dietpi-boot.service which is a better measure to ensure network is up and time sync as well, required for any encrypted network access where certificates timestamps must match. --- dietpi/dietpi-software | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5c5e49afb7..8b5488fbe6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5444,7 +5444,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else DEPS_LIST='mediainfo' - Download_Install 'https://download.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz' /opt + Download_Install 'https://download.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz' /opt fi @@ -5452,7 +5452,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493 - echo 'deb https://apt.sonarr.tv/ develop main' > /etc/apt/sources.list.d/sonarr.list + echo 'deb https://apt.sonarr.tv/ master main' > /etc/apt/sources.list.d/sonarr.list G_AGUP G_AGI nzbdrone @@ -11381,7 +11381,7 @@ _EOF_ [Unit] Description=Sonarr Daemon (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] SyslogIdentifier=Sonarr @@ -11398,7 +11398,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/NzbDrone /mnt /var/log/sonarr /tmp +ReadWritePaths=/opt/NzbDrone /mnt /media /var/log/sonarr /tmp [Install] WantedBy=multi-user.target @@ -11435,7 +11435,7 @@ _EOF_ [Unit] Description=Radarr Daemon (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] SyslogIdentifier=Radarr @@ -11452,7 +11452,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/Radarr /mnt /var/log/radarr /tmp +ReadWritePaths=/opt/Radarr /mnt /media /var/log/radarr /tmp [Install] WantedBy=multi-user.target @@ -11489,7 +11489,7 @@ _EOF_ [Unit] Description=Lidarr Daemon (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] SyslogIdentifier=Lidarr @@ -11506,7 +11506,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/Lidarr /mnt /var/log/lidarr /tmp +ReadWritePaths=/opt/Lidarr /mnt /media /var/log/lidarr /tmp [Install] WantedBy=multi-user.target @@ -11579,7 +11579,7 @@ _EOF_ [Unit] Description=Jackett (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] SyslogIdentifier=jackett From 274434dd11d24da3cc6f068fa4e785f286147827 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 26 May 2020 21:00:50 +0200 Subject: [PATCH 064/182] v6.31 (#3565) + DietPi-Logclear | Resolve an issue where .db-shm and .db-wal files are were not excluded from processing, bug introduced with v6.29 --- CHANGELOG.txt | 2 ++ dietpi/func/dietpi-logclear | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 366fd71c8b..5cc7e56e5c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,10 +7,12 @@ Changes / Improvements / Optimisations: - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 - DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ This update is applied to all systems with DietPi v6.31, existing config and data are preserved. +- DietPi-Software | Sonarr/Radarr/Lidarr: The /media directory as second common mount point can now also be used as download/media directory without manually adding it to the systemd units ReadWritePaths list. Many thanks to @ricardoandren for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3561 Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 +- DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 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 diff --git a/dietpi/func/dietpi-logclear b/dietpi/func/dietpi-logclear index 0f4bccff1b..8c6e156fc9 100644 --- a/dietpi/func/dietpi-logclear +++ b/dietpi/func/dietpi-logclear @@ -49,7 +49,7 @@ INFO_BACKUPS_MADE=0 #//////////////////////////////////////////////////////////////// - # Process log files. + # Process log files #//////////////////////////////////////////////////////////////// Process_Logfiles(){ @@ -76,16 +76,16 @@ PROCESS_FILE=1 FILE_TYPE=0 - # Filetypes - # - Compessed files (zip etc) | FILE_TYPE 1 + # Special files + # - Compessed | FILE_TYPE 1 if [[ $FILE_NAME == *'.zip' || $FILE_NAME == *'.gz' ]]; then FILE_TYPE=1 - # - Normal Log Files - # Exclude <= 10 byte size - # Exclude .db* extentions SQLite (.db .db-shm .db.wal) - elif (( $FILESIZE_BYTES < 11 )) || [[ $FILE_NAME == *'.db' ]]; then + # - Excluded + # Size < 11 byte + # SQLite database files (Sonarr/Radarr/Lidarr): .db .db-shm .db-wal + elif (( $FILESIZE_BYTES < 11 )) || [[ $FILE_NAME == *'.db'* ]]; then PROCESS_FILE=0 @@ -114,15 +114,15 @@ fi - # Write current logfile contents to existing. + # Write current log file contents to existing cat "$i" >> "$FP_BACKUP/$FILE_NAME" ((INFO_BACKUPS_MADE++)) - # Clear logfile contents + # Clear log file contents > "$i" ((INFO_LOGS_CLEARED++)) - # Clear logfile contents + # Clear log file contents elif (( $INPUT == 1 )); then > "$i" @@ -136,7 +136,7 @@ fi - # Update Size cleared + # Update size cleared INFO_SIZE_CLEARED=$(($INFO_SIZE_CLEARED + $FILESIZE_BYTES)) fi @@ -169,7 +169,7 @@ Process_Logfiles - # Delete logfile backups + # Delete log file backups [[ $INPUT == 2 && -f $FP_BACKUP ]] && rm -R $FP_BACKUP # Print Info From 6106bd99ea665e19bb5a190a3fed14bef0b1bad8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 27 May 2020 12:36:23 +0200 Subject: [PATCH 065/182] v6.31 + DietPi-Patch | Assure /media exists to fulfil FHS, fix htpdate service startup and probably other issues: https://github.com/MichaIng/DietPi/issues/3558 --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 19b8907f2f..a36c6c1fde 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2424,6 +2424,9 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" # Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 G_EXEC chmod a+x /mnt/dietpi_userdata #------------------------------------------------------------------------------- + # Assure /media exists to fulfil FHS, fix htpdate service startup and probably other issues: https://github.com/MichaIng/DietPi/issues/3558 + [[ -d '/media' ]] || G_EXEC mkdir /media + #------------------------------------------------------------------------------- # Reinstalls # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then From 525d168a1309705ec412b4e863416e49ccfda466 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 27 May 2020 12:39:12 +0200 Subject: [PATCH 066/182] v6.31 + CHANGELOG | Resolved potential issues due to missing /media directory on DietPi images --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5cc7e56e5c..5ea46457a2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Sonarr/Radarr/Lidarr: The /media directory as second common mount point can now also be used as download/media directory without manually adding it to the systemd units ReadWritePaths list. Many thanks to @ricardoandren for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3561 Bug Fixes: +- System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 From b2be77ca84ca1bfc01e20913a6bbfd1c8b2340a4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 May 2020 15:37:06 +0200 Subject: [PATCH 067/182] v6.31 + DietPi-Globals | Some ordering, wording and explanation enhancements + DietPi-Globals | Set and export $LANG as well even that its effect is fully overwritten by $LC_ALL, since some 3rd party scripts/programs might check it to derive the used/default locale --- dietpi/func/dietpi-globals | 58 ++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 1ede542453..e408539e30 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -10,30 +10,31 @@ # # Info: # - Provides shared/global DietPi variables and functions for current bash session and DietPi scripts - # - CRITICAL, use local index variables in for/while loops, or unset them afterwards, else havoc: https://github.com/MichaIng/DietPi/issues/1454 - # - Sourced/Loaded in interactive bash sessions: /etc/bashrc.d/dietpi.bash - # - Sourced/Loaded as start of most DietPi script + # - CRITICAL: Use local index variables in for/while loops, or unset them afterwards, else havoc: https://github.com/MichaIng/DietPi/issues/1454 + # - Sourced/Loaded in interactive bash sessions via /etc/bashrc.d/dietpi.bash + # - Sourced/Loaded at start of most DietPi script #//////////////////////////////////// #----------------------------------------------------------------------------------- - # Core variables, functions and environment, used at start of all scripts + # Core variables, functions and environment, used at start of most DietPi scripts #----------------------------------------------------------------------------------- - # To be set by the originating script, after loading globals and before calling G_INIT() + # Script/Program name + # - Set this in originating script, after loading globals and before calling G_INIT() # - Used in G_EXEC, G_WHIP and G_DIETPI-NOTIFY functions unset -v G_PROGRAM_NAME # Debug mode - # - Do no pre-generate to reduce bash session variables => Needs to be checked via: [[ $G_DEBUG == 1 ]] + # - Set G_DEBUG=1 to enable additional debug output for some DietPi scripts and functions + # - This variable is not pre-generated but checked via: [[ $G_DEBUG == 1 ]] #[[ $G_DEBUG == [01] ] || G_DEBUG=0 - # Interactive mode - # - Affects whether G_EXEC and G_WHIP prompts are displayed or not - # - Run "export G_INTERACTIVE=0" prior to script call to force non-interactive/automated mode. - # - Run "unset -v G_INTERACTIVE" afterwards to return to auto detection. - # - If not set, check for STDIN availability: - # OK | systemd = no STDIN - # OK | Cron = no STDIN - # NB | /etc/profile, ~/.profile, /etc/profile.d/, /etc/bash.bashrc, ~/.bashrc and /etc/bashrc.d/ are interactive since those are sourced from originating shell/bash session. + # Non-interactive mode + # - Set G_INTERACTIVE=0 to disable interactive G_EXEC and G_WHIP dialogues + # - Set G_INTERACTIVE=1 to force interactive G_EXEC and G_WHIP dialogues + # - Default is based on whether STDIN is attached to an open terminal or not: [[ -t 0 ]] + # OK | systemd = [[ -t 0 ]] is false + # OK | Cron = [[ -t 0 ]] is false + # NB | /etc/profile, ~/.profile, /etc/profile.d/, /etc/bash.bashrc, ~/.bashrc and /etc/bashrc.d/ are usually interactive since those are sourced from originating shell/bash session. if [[ $G_INTERACTIVE != [01] ]]; then # Backwards compatibility to keep user scripts valid for a while @@ -49,9 +50,21 @@ fi - # DietPi First-Run Stage | -2 = PREP_SYSTEM/Unknown | -1 = 1st boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot + # Disable DietPi-Services + # - Set G_DIETPI_SERVICES_DISABLE=1 to disable DietPi-Services + # - This variable is not pre-generated but checked via: [[ $G_DIETPI_SERVICES_DISABLE == 1 ]] + #[[ $G_DIETPI_SERVICES_DISABLE == [01] ]] || G_DIETPI_SERVICES_DISABLE=0 + + # Default DietPi userdata location, which must NEVER change! + # - NB: In case of moved userdata location, a symlink stays here to keep this path valid. + G_FP_DIETPI_USERDATA='/mnt/dietpi_userdata' + + # DietPi first boot setup stage: -2 = PREP_SYSTEM/Unknown | -1 = 1st boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot [[ -f '/boot/dietpi/.install_stage' ]] && G_DIETPI_INSTALL_STAGE=$( /boot/dietpi/.version } - # Default DietPi userdata location, which must NEVER change! - # - NB: In case of moved userdata location, a symlink stays here to keep this path valid. - G_FP_DIETPI_USERDATA='/mnt/dietpi_userdata' - - # Allows to disable dietpi-services handling, e.g. if already handled within parent script. - # - Do no pre-generate to reduce bash session variables => Needs to be checked via: [[ $G_DIETPI_SERVICES_DISABLE == 1 ]] - #[[ $G_DIETPI_SERVICES_DISABLE == [01] ]] || G_DIETPI_SERVICES_DISABLE=0 - - # Hardware details - [[ -f '/boot/dietpi/.hw_model' ]] && . /boot/dietpi/.hw_model - - # Init functions for originating script + # Init function for originating script # - Stuff we can't init in main globals/funcs due to /etc/bashrc.d/ load into login session. # - Optional input variables: # G_INIT_ALLOW_CONCURRENT=1 = Allow concurrent DietPi script execution (default: 0) @@ -135,7 +137,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then disable_error=1 G_CHECK_VALIDINT "$HIERARCHY" 0 && export HIERARCHY=$((HIERARCHY+1)) || export HIERARCHY=0 # Set locale for scripts to prevent incorrect scraping due to translated command outputs - export LC_ALL='C.UTF-8' + export LC_ALL='C.UTF-8' LANG='C.UTF-8' # Declare exit trap, that runs on EXIT signal, which includes INT (interruption) and TERM (kill) G_EXIT(){ From 8c07e280be3d3742b6feff2d1c5db28bc48ace83 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 May 2020 15:57:01 +0200 Subject: [PATCH 068/182] v6.31 + DietPi-Set_software | locale: Minor wording enhancements + DietPi-Set_software | locale: Show output of dpkg-reconfigure call since it might be interesting which locales are actually generated and if any warnings appear + DietPi-Set_software | locale: Set and export $LANG as well, since errors can appear as well if this has an invalid value, even that its effect is fully overridden by $LC_ALL --- dietpi/func/dietpi-set_software | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 2fcb741d95..70017c4846 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -67,21 +67,23 @@ $FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=op if [[ $INPUT_MODE_VALUE == 'C.UTF-8' ]] || grep -q "^$INPUT_MODE_VALUE UTF-8$" /usr/share/i18n/SUPPORTED; then - # List of locales to generate, used by: dpkg-reconfigure => locale-gen + # Create list of locales to generate echo "$INPUT_MODE_VALUE UTF-8" > /etc/locale.gen - # - Add C.UTF-8 back in, if not chosen, as DietPi scripts require it + # - Add C.UTF-8 back in, if not chosen, required by DietPi scripts [[ $INPUT_MODE_VALUE == 'C.UTF-8' ]] || echo 'C.UTF-8 UTF-8' >> /etc/locale.gen - # Remove current defaults, will be recreated by dpkg-reconfigure with: LANG= + # Remove current defaults [[ -f '/etc/default/locale' ]] && rm /etc/default/locale - # Generate locales and set default LANG= - G_EXEC dpkg-reconfigure -f noninteractive locales + # Generate locales and set new default + # - 1. this calls locale-gen to regenerate locale cache with /etc/locale.gen entries. + # - 2. this calls update-locale LANG= to set the new default locale. + G_CHECK_OUTPUT=1 G_EXEC dpkg-reconfigure -f noninteractive locales - # Reassign override locale to current script, as in case of wrong locale variables update-locale command will produce ugly errors - export LC_ALL='C.UTF-8' + # Reassign locale to current script, as in case of wrong locale variables update-locale command will produce ugly errors + export LC_ALL='C.UTF-8' LANG='C.UTF-8' - # Add new override locale to /etc/default/locales which is effective on next shell session (logout+in/reboot) + # Additionally set new locale via override variable $LC_ALL in /etc/default/locales which is effective from next shell session on update-locale "LC_ALL=$INPUT_MODE_VALUE" # Update dietpi.txt entry From 2c95ce963c08006c8f10558a057973292f9814a7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 12:22:08 +0200 Subject: [PATCH 069/182] v6.31 + DietPi-Software | Pi-hole: Allow direct access to further local fonts types, used now by AdminLTE: https://github.com/pi-hole/pi-hole/pull/3403/files#diff-db31ccc9ffd35ede6f6bf7ba1e5c8407 --- .conf/dps_93/lighttpd.pihole.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_93/lighttpd.pihole.conf b/.conf/dps_93/lighttpd.pihole.conf index 4fe8db481a..3eddaefaf0 100644 --- a/.conf/dps_93/lighttpd.pihole.conf +++ b/.conf/dps_93/lighttpd.pihole.conf @@ -8,7 +8,7 @@ $HTTP["url"] =~ "^(/html)?/admin/" { "X-Frame-Options" => "DENY" ) - $HTTP["url"] =~ "\.ttf$" { + $HTTP["url"] =~ "\.(eot|otf|tt[cf]|woff2?)$" { # Allow Block Page access to local fonts setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } From ae27afc7dbbd6ae50b34e4753bf2f28976435bbb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 13:01:25 +0200 Subject: [PATCH 070/182] v6.31 + DietPi-Software | Pi-hole: Minor wording in Lighttpd config --- .conf/dps_93/lighttpd.pihole.conf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.conf/dps_93/lighttpd.pihole.conf b/.conf/dps_93/lighttpd.pihole.conf index 3eddaefaf0..d3fbd1c095 100644 --- a/.conf/dps_93/lighttpd.pihole.conf +++ b/.conf/dps_93/lighttpd.pihole.conf @@ -1,15 +1,15 @@ # Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian -# If the URL starts with /admin, it is the Web interface +# Admin panel $HTTP["url"] =~ "^(/html)?/admin/" { - # Create a response header for debugging using curl -I + # Create response header for Pi-hole debugger setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!", "X-Frame-Options" => "DENY" ) + # Allow admin panel access to local fonts $HTTP["url"] =~ "\.(eot|otf|tt[cf]|woff2?)$" { - # Allow Block Page access to local fonts setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } } @@ -19,11 +19,9 @@ $HTTP["url"] =~ "^(/html)?/admin/\." { url.access-deny = ("") } -# If it's a request to Pi-hole blocking page... +# Block public access to blocking page $HTTP["url"] =~ "^(/html)?/pihole/" { - # ... and the request isn't local $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." { - # block! url.access-deny = ("") } } From 44d1e5b1a99aef6f6a5435c2b4d2933484d008d4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 13:01:30 +0200 Subject: [PATCH 071/182] v6.31 + DietPi-Software | Pi-hole: Grant admin panel access to all local fonts types: https://github.com/pi-hole/pi-hole/pull/3403/files#r432926507 --- .conf/dps_93/apache.pihole.conf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.conf/dps_93/apache.pihole.conf b/.conf/dps_93/apache.pihole.conf index c91c176b1b..2c1f8be219 100644 --- a/.conf/dps_93/apache.pihole.conf +++ b/.conf/dps_93/apache.pihole.conf @@ -1,8 +1,15 @@ -# If the URL starts with /admin, it is the Web interface +# Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian + +# Admin panel - # Create a response header for debugging using curl -I + # Create response header for Pi-hole debugger Header set X-Pi-hole "The Pi-hole Web interface is working!" - Header set X-Frame-Options "deny" + Header set X-Frame-Options "DENY" + + # Allow access to local fonts + + Header set Access-Control-Allow-Origin "*" + # Block . files from being served, such as .git, .github, .gitignore From e3297f81e42c4d13e523f73e78f6ef348ef22f15 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 13:01:45 +0200 Subject: [PATCH 072/182] v6.31 + DietPi-Software | Pi-hole: Grant admin panel access to all local fonts types: https://github.com/pi-hole/pi-hole/pull/3403/files#r432926507 --- .conf/dps_93/nginx.pihole.conf | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.conf/dps_93/nginx.pihole.conf b/.conf/dps_93/nginx.pihole.conf index 04b05b36bf..40d6e3db80 100644 --- a/.conf/dps_93/nginx.pihole.conf +++ b/.conf/dps_93/nginx.pihole.conf @@ -1,16 +1,26 @@ +# Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian + # Admin panel location ~ ^(?:/html|)/admin(?:$|/) { # Block public access to admin page, if enabled # - To enable: cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.off dietpi-pihole-block_public_admin.on # - To disable: cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.on dietpi-pihole-block_public_admin.off include sites-dietpi/dietpi-pihole-block_public_admin.*on; + # Block . files from being served, such as .git, .github, .gitignore location ~ ^(?:/html|)/admin/\. { deny all; } - # Create a response header for debugging using curl -I + + # Create response header for Pi-hole debugger add_header X-Pi-hole "The Pi-hole Web interface is working!"; add_header X-Frame-Options "DENY"; + + # Allow access to local fonts + location ~ \.(?:eot|otf|tt[cf]|woff2?)$ { + add_header Access-Control-Allow-Origin "*"; + } + # Standard PHP handler block try_files $uri $uri/ =404; location ~ ^(?:/html|)/admin/.+\.php(?:$|/) { @@ -21,12 +31,13 @@ location ~ ^(?:/html|)/admin(?:$|/) { # Blocking page location ~ ^(?:/html|)/pihole(?:$|/) { - # Block public access to blocking page by default + # Block public access to blocking page allow 127.0.0.0/8; allow 192.168.0.0/16; allow 10.0.0.0/8; allow 172.16.0.0/12; deny all; + # Standard PHP handler block try_files $uri $uri/ =404; location ~ ^(?:/html|)/pihole/.+\.php(?:$|/) { From b7998cf25f15fb5c415699ba133f4c73f3993347 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 15:46:03 +0200 Subject: [PATCH 073/182] v6.31 + DietPi-PREP | Locales: Export $LANG as well as in case of invalid entry this causes an error message as well, even that it is effectively overridden by $LC_ALL. Export both after locale generation, before calling any other command. --- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 51ccb014c2..353b3ab8ca 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -138,12 +138,12 @@ fi + # - Export locale vars to assure the following whiptail being beautiful + export LC_ALL='C.UTF-8' LANG='C.UTF-8' + # - Update /etc/default/locales with new values (not effective until next load of bash session, eg: logout/in) update-locale 'LC_ALL=C.UTF-8' - # - Export locale vars to assure the following whiptail being beautiful - export LC_ALL='C.UTF-8' - # Set Git owner GITOWNER=${GITOWNER:-MichaIng} From 6b07d8c4eec1bb7ef1a64f715cc90a88b139b802 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 16:06:53 +0200 Subject: [PATCH 074/182] v6.31 + DietPi-PREP | Disable dpkg state translations and skip installing recommends already on initial dependency installs --- PREP_SYSTEM_FOR_DIETPI.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 353b3ab8ca..16ec398bf2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -54,6 +54,9 @@ # Allow PDiffs on RPi since the "slow implementation" argument is outdated and PDiffs allow lower download size and less disk I/O [[ -f '/etc/apt/apt.conf.d/50raspi' ]] && rm /etc/apt/apt.conf.d/50raspi + # Disable package state translation downloads + echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/98-dietpi-no_translations + # Removing conflicting /etc/apt/sources.list.d entries # - Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 [[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm /etc/apt/sources.list.d/deb-multimedia.list @@ -95,7 +98,7 @@ for i in "${aAPT_PREREQS[@]}" do - if ! dpkg-query -s $i &> /dev/null && ! apt-get -y install $i; then + if ! dpkg-query -s $i &> /dev/null && ! apt-get -y --no-install-recommends install $i; then echo -e "[FAILED] Unable to install $i, please try to install it manually:\n\t # apt install $i\n" exit 1 From d51514a68bbc9efeef36a32d3102546daea26f7b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 May 2020 20:40:15 +0200 Subject: [PATCH 075/182] v6.31 + DietPi-Software | WireGuard: Enable for Odroid N2 and C4, remove obsolete Rock64 implementation, we'll add a generic Armbian solution at a later date. + DietPi-Software | WireGuard: The package is now available via Debian backports, hence add Bullseye repo only on RPi (there are no Raspbian backports) or Stretch. --- dietpi/dietpi-software | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8b5488fbe6..d6614db94d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4599,10 +4599,15 @@ _EOF_ kernel_packages='linux-image-arm64-odroid-n1 linux-headers-arm64-odroid-n1' - # - Rock64 - elif (( $G_HW_MODEL == 43 )); then + # - Odroid N2 + elif (( $G_HW_MODEL == 15 )); then - kernel_packages='linux-image-rockchip64 linux-headers-rockchip64' + kernel_packages='linux-image-arm64-odroid-n2 linux-headers-arm64-odroid-n2' + + # - Odroid C4 + elif (( $G_HW_MODEL == 16 )); then + + kernel_packages='linux-image-arm64-odroid-c4 linux-headers-arm64-odroid-c4' fi @@ -4612,8 +4617,8 @@ _EOF_ # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. G_AGI $kernel_packages # apt-get install overrides hold state - # Add Bullseye repo, which contains the WireGuard packages - if (( $G_DISTRO < 6 )); then + # Package available on Buster backports and Bullseye: For Stretch and RPi Buster add Bullseye repo + if (( $G_DISTRO < 5 || ( $G_HW_MODEL < 10 && $G_DISTRO == 5 ) )); then # Raspbian or Debian? local url='http://raspbian.raspberrypi.org/raspbian/' From caec92e92e136a2f731f6d4c45db8463896fc80a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jun 2020 00:17:38 +0200 Subject: [PATCH 076/182] v6.31 + Network | Grant all users "ping" access without the need for sudo, setuid, CAP_NET_RAW or CAP_NET_ADMIN. Further infos and discussion about this: - https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange - https://github.com/systemd/systemd/pull/13141 - https://github.com/MichaIng/DietPi/issues/1012 --- rootfs/etc/sysctl.d/dietpi.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rootfs/etc/sysctl.d/dietpi.conf b/rootfs/etc/sysctl.d/dietpi.conf index e6dfc7c26a..177e2bb12d 100644 --- a/rootfs/etc/sysctl.d/dietpi.conf +++ b/rootfs/etc/sysctl.d/dietpi.conf @@ -1 +1,5 @@ +# Reduce swap file usage to a minimum vm.swappiness=1 + +# Allow all users to "ping" without further capabilities: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange +net.ipv4.ping_group_range = 0 2147483647 From e6c504d941a0b6af80f51f044169cee5cf03d7c2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jun 2020 00:30:54 +0200 Subject: [PATCH 077/182] v6.31 + DietPi-Patch | All users are permitted to "ping" now without any further capabilities, hence remove them for security reasons: https://github.com/MichaIng/DietPi/commit/caec92e92e136a2f731f6d4c45db8463896fc80a --- dietpi/patch_file | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index a36c6c1fde..94f20beae8 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2427,6 +2427,15 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" # Assure /media exists to fulfil FHS, fix htpdate service startup and probably other issues: https://github.com/MichaIng/DietPi/issues/3558 [[ -d '/media' ]] || G_EXEC mkdir /media #------------------------------------------------------------------------------- + # All users are permitted to "ping" now without any further capabilities, hence remove them for security reasons: https://github.com/MichaIng/DietPi/commit/caec92e92e136a2f731f6d4c45db8463896fc80a + if command -v ping &> /dev/null; then + + sysctl -p /etc/sysctl.d/dietpi.conf + setcap -r $(command -v ping) + chmod a-s $(command -v ping) + + fi + #------------------------------------------------------------------------------- # Reinstalls # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then From e16e82da318f0d89d731818305f2b25e97c18018 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jun 2020 00:41:50 +0200 Subject: [PATCH 078/182] v6.31 + CHANGELOG | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5ea46457a2..5d68d1356c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.31 Changes / Improvements / Optimisations: - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. +- Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 - DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ From 02896ef67e2e844c4c6a6aad5c53f7da8e694734 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jun 2020 22:16:11 +0200 Subject: [PATCH 079/182] v6.31 + README.md | Load logo from GitHub resource and the new myVirtualserver logo from their website --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 09fc14c695..53c53a0871 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- DietPi + DietPi

Lightweight justice for your single-board computer! @@ -16,9 +16,8 @@


- myVirtualServer -

- DietPi's web hosting is powered by myVirtualServer. + myVirtualserver
+ DietPi's web hosting is powered by myVirtualserver.

A wide range of SBCs and VMs are supported. Click here for the full list.

From d9daf32ccb479755e23596098b661f1dca2a277a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jun 2020 23:37:07 +0200 Subject: [PATCH 080/182] v6.31 + DietPi-Software | Samba Server: Change default server-side file permissions to 0664 (no execute permissions) --- .conf/dps_96/conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_96/conf b/.conf/dps_96/conf index cac23cf239..88da88576f 100644 --- a/.conf/dps_96/conf +++ b/.conf/dps_96/conf @@ -29,7 +29,7 @@ comment = DietPi Share path = /mnt/dietpi_userdata browseable = yes - create mask = 0775 + create mask = 0664 directory mask = 0775 valid users = dietpi writeable = yes From 7c4284b5a285000112c86f4a7577b17cca7e80a4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jun 2020 23:40:07 +0200 Subject: [PATCH 081/182] v6.31 + CHANGELOG | Samba Server: Changed default server-side file permissions from 0775 to 0664 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5d68d1356c..10c4b23a9e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ This update is applied to all systems with DietPi v6.31, existing config and data are preserved. - DietPi-Software | Sonarr/Radarr/Lidarr: The /media directory as second common mount point can now also be used as download/media directory without manually adding it to the systemd units ReadWritePaths list. Many thanks to @ricardoandren for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3561 +- DietPi-Software | Samba Server: Changed default server-side file permissions from 0775 to 0664, hence files on the server are by default created without execute permissions now, which suits usual standards. Many thanks to @maartenlangeveld for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3581 Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 From 98a43e5d3a8063000ac578d3dfb10fc94b888226 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jun 2020 23:49:23 +0200 Subject: [PATCH 082/182] v6.31 + DietPi-Survey_report | Prevent concurrent executions --- .meta/dietpi-survey_report | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 956dcf2687..b213cab8ee 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -455,6 +455,9 @@ Main(){ + # Prevent concurrent executions + pgrep -f dietpi-survey_report &> /dev/null && { echo 'Concurrent execution detected. Exiting...'; return; } + # Copy files to RAM to speed up grep #mkdir -p /tmp/dietpi-survey_report #cp /home/dietpi-survey/survey/*.txt /tmp/dietpi-survey_report/ # /etc/cron.minutely/dietpi-survey_report: line 310: /bin/cp: Argument list too long From 2b8ab912ae61b91a02108a9f3ff0b8f2bb74f3cc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jun 2020 00:11:37 +0200 Subject: [PATCH 083/182] v6.31 + DietPi-Cron_daily | MOTD: Error out if webserver answers with 40X error instead of storing the error response in the MOTD script --- rootfs/etc/cron.daily/dietpi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index 2ca5195f90..91e6015745 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -13,7 +13,7 @@ #---------------------------------------------------------------- # Main Loop #---------------------------------------------------------------- - # Sync system time, if mode 2 (daily) is detected + # Sync system time if mode 2 (daily) is detected grep -q '^[[:blank:]]*CONFIG_NTP_MODE=2' /boot/dietpi.txt && /boot/dietpi/func/run_ntpd 1 #---------------------------------------------------------------- # Check for DietPi updates @@ -22,7 +22,7 @@ # Refresh DietPi MOTD if [[ -f '/boot/dietpi/.dietpi-banner' ]] && grep -q '^[[:blank:]]*aENABLED\[12\]=1' /boot/dietpi/.dietpi-banner; then - curl -sSL https://dietpi.com/motd > /run/dietpi/.dietpi_motd + curl -sSfL https://dietpi.com/motd > /run/dietpi/.dietpi_motd fi #---------------------------------------------------------------- From 46fca0a1592eb97223e97bf51dd7328a5cb24c0f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jun 2020 01:39:30 +0200 Subject: [PATCH 084/182] v6,31 + DietPi-Banner | MOTD: (Re)download the MOTD not only if the file does not exist, but also if it is empty (and writable), e.g. due to a failed download before. This resolves an issue where the the first banner after a failing daily cron MOTD download did not show any MOTD. A failed download produced an empty file, hence the banner did not try a fresh download. + DietPi-Banner | MOTD: Initialise the $motd variable empty (local) to assure it is not e.g. exported from the parent shell --- dietpi/func/dietpi-banner | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index aac73a1bf7..07704b8a42 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -218,8 +218,8 @@ $GREEN_LINE" # MOTD if (( ${aENABLED[12]} == 1 )); then - local fp_motd='/run/dietpi/.dietpi_motd' - [[ -f $fp_motd ]] || curl -sSfLm 2 https://dietpi.com/motd > $fp_motd + local motd fp_motd='/run/dietpi/.dietpi_motd' + [[ -f $fp_motd ]] && [[ -s $fp_motd || ! -w $fp_motd ]] || curl -sSfLm 2 https://dietpi.com/motd > $fp_motd if [[ -f $fp_motd ]]; then if . $fp_motd &> /dev/null && [[ $motd ]]; then From 5f348ce8711a823a65e5118625fb4d83779a0a93 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jun 2020 18:03:23 +0200 Subject: [PATCH 085/182] v6.31 + DietPi-Globals | G_CHECK_URL_ATTEMPTS: Do not allow a value of "0" which would result in a single attempt but according to dietpi.txt it is invalid and reverted to default "2". + DietPi-Globals | Start implementation of default gateway, network interface and IP print functions, to replace DietPi-Obtain_network_details mid-term. Since network info can change during sessions, it makes sense to always estimate the current value required with an efficient function. --- dietpi/func/dietpi-globals | 67 +++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 9 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index e408539e30..66b325c7c7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1105,12 +1105,61 @@ $log_content" || break # Exit error handler menu loop on cancel #----------------------------------------------------------------------------------- # Network connection checks #----------------------------------------------------------------------------------- + # Print default gateway IP for IPv4 or IPv6 requests + # - By default it will check and print the IPv4 gateway only, if present, else check and print the IPv6 gateway, else returns 1. + # - Optional arguments: + # $* = "-4": Force check and print of IPv4 default gateway only, else return 1 + # $* = "-6": Force check and print of IPv6 default gateway only, else return 1 + G_GET_NET_GATEWAY(){ + + local ip + [[ $* == '-6' ]] || ip=$(ip -4 r l 0/0 | mawk '{print $3;exit}') + [[ $ip || $* == '-4' ]] || ip=$(ip -6 r l ::0/0 | mawk '{print $3;exit}') + [[ $ip ]] || return 1 + echo "$ip" + + } + + # Print default network interface name for IPv4 or IPv6 requests + # - "default" means the interface that holds the default gateway, hence which is used for www access. + # - If no default gateway exists, the first interface with state "UP" is selected instead. + # - If no interface with state "UP" exists, the first interface with an assigned IP is selected instead. + # - If no interface with an assigned IP exists, the first available interface is selected. + # - If no interface exists, the funtion returns 1 + # - Optional arguments: + # "-4": Force check and print of interfaces with IPv4 address only, else return 1 + # "-6": Force check and print of interfaces with IPv6 address only, else return 1 + # "eth": Force check and print of Ethernet interfaces only, else return 1 + # "wlan": Force check and print of WiFi interfaces only, else return 1 + G_GET_NET_IFACE(){ + + : # WIP + + } + + # Print default network interface IP for IPv4 or IPv6 requests + # - "default" means the interface that holds the default gateway, hence which is used for www access. + # - If no default gateway exists, the first interface with state "UP" is selected instead. + # - If no interface with state "UP" exists, the first interface with an assigned IP is selected instead. + # - If no interface with an assigned IP exists, the first available interface is selected. + # - If no interface exists, the funtion returns 1 + # - Optional arguments: + # "-4": Force check and print of interfaces with IPv4 address only, else return 1 + # "-6": Force check and print of interfaces with IPv6 address only, else return 1 + # "eth": Force check and print of Ethernet interfaces only, else return 1 + # "wlan": Force check and print of WiFi interfaces only, else return 1 + G_GET_NET_IP(){ + + : # WIP + + } + # General network connection check # - Checks general network connectivity by pinging a raw IP that must be publicly reachable at all time. # - Uses the given input argument as IP to test against, else CONFIG_CHECK_CONNECTION_IP from dietpi.txt, else defaults to 9.9.9.9 (Quad9 DNS IP). # - Uses G_CHECK_URL_TIMEOUT and G_CHECK_URL_ATTEMPTS variables, else CONFIG_G_CHECK_URL_TIMEOUT + CONFIG_G_CHECK_URL_ATTEMPTS from dietpi.txt, else defaults to 10 seconds and 2 attempts (1 retry). # - Optional arguments: - # $@ = IP + optional ping arguments + # $* = IP + optional ping arguments # - Optional variables: # G_CHECK_URL_TIMEOUT to override default and dietpi.txt set timeout # G_CHECK_URL_ATTEMPTS to override default and dietpi.txt set attempts @@ -1134,10 +1183,10 @@ $log_content" || break # Exit error handler menu loop on cancel fi # Obtain attempts - if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0; then + if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1; then G_CHECK_URL_ATTEMPTS=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0 || G_CHECK_URL_ATTEMPTS=2 + disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1 || G_CHECK_URL_ATTEMPTS=2 fi G_EXEC_RETRIES=$(( $G_CHECK_URL_ATTEMPTS - 1 )) # 2 attempts = 1 retry @@ -1160,7 +1209,7 @@ $log_content" || break # Exit error handler menu loop on cancel # - Uses the given input argument as domain to test against, else CONFIG_CHECK_DNS_DOMAIN from dietpi.txt, else defaults to dns9.quad9.net (Quad9 DNS domain). # - Uses G_CHECK_URL_TIMEOUT and G_CHECK_URL_ATTEMPTS variables, else CONFIG_G_CHECK_URL_TIMEOUT + CONFIG_G_CHECK_URL_ATTEMPTS from dietpi.txt, else defaults to 10 seconds and 2 attempts (1 retry). # - Optional arguments: - # $@ = domain + optional ping arguments + # $* = domain + optional ping arguments # - Optional variables: # G_CHECK_URL_TIMEOUT to override default and dietpi.txt set timeout # G_CHECK_URL_ATTEMPTS to override default and dietpi.txt set attempts @@ -1184,10 +1233,10 @@ $log_content" || break # Exit error handler menu loop on cancel fi # Obtain attempts - if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0; then + if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1; then G_CHECK_URL_ATTEMPTS=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0 || G_CHECK_URL_ATTEMPTS=2 + disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1 || G_CHECK_URL_ATTEMPTS=2 fi G_EXEC_RETRIES=$(( $G_CHECK_URL_ATTEMPTS - 1 )) # 2 attempts = 1 retry @@ -1208,7 +1257,7 @@ $log_content" || break # Exit error handler menu loop on cancel # URL connection test # - Checks a specific HTTP/HTTPS/FTP online resource via its URL # - Required arguments: - # $@ = URL + optional wget arguments + # $* = URL + optional wget arguments # - Optional variables: # G_CHECK_URL_TIMEOUT to override default and dietpi.txt set timeout # G_CHECK_URL_ATTEMPTS to override default and dietpi.txt set attempts @@ -1223,10 +1272,10 @@ $log_content" || break # Exit error handler menu loop on cancel fi # Obtain attempts - if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0; then + if ! disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1; then G_CHECK_URL_ATTEMPTS=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0 || G_CHECK_URL_ATTEMPTS=2 + disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 1 || G_CHECK_URL_ATTEMPTS=2 fi G_EXEC_RETRIES=$(( $G_CHECK_URL_ATTEMPTS - 1 )) # 2 attempts = 1 retry From 0f556d38a595f56e7b76b995f67f487c39e79ee9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jun 2020 00:14:19 +0200 Subject: [PATCH 086/182] v6.31 + DietPi-Survey_report | Fix concurrent execution detection --- .meta/dietpi-survey_report | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index b213cab8ee..40c3a1c304 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -456,7 +456,7 @@ Main(){ # Prevent concurrent executions - pgrep -f dietpi-survey_report &> /dev/null && { echo 'Concurrent execution detected. Exiting...'; return; } + (( $(pgrep -cf dietpi-survey_report) > 1 )) && { echo 'Concurrent execution detected. Exiting...'; return; } # Copy files to RAM to speed up grep #mkdir -p /tmp/dietpi-survey_report From b6b15d51d5160905e9fc42d298f2f313c54863ae Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jun 2020 19:34:21 +0200 Subject: [PATCH 087/182] v6.31 + DietPi-Survey_report | Simplify by avoid piping and sub processes --- .meta/dietpi-survey_report | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 40c3a1c304..4229d817d1 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -3,6 +3,9 @@ # Created by MichaIng / micha@dietpi.com / dietpi.com + # Prevent concurrent executions + (( $(pgrep -cf dietpi-survey_report) > 1 )) && { echo 'Concurrent execution detected. Exiting...'; exit 1; } + #----------------------------------------------------------- # Globals - benchmarks #----------------------------------------------------------- @@ -455,9 +458,6 @@ Main(){ - # Prevent concurrent executions - (( $(pgrep -cf dietpi-survey_report) > 1 )) && { echo 'Concurrent execution detected. Exiting...'; return; } - # Copy files to RAM to speed up grep #mkdir -p /tmp/dietpi-survey_report #cp /home/dietpi-survey/survey/*.txt /tmp/dietpi-survey_report/ # /etc/cron.minutely/dietpi-survey_report: line 310: /bin/cp: Argument list too long @@ -1027,9 +1027,9 @@ _EOF_ #----------------------------------------------------------- # Main #----------------------------------------------------------- - Main 2>&1 | tee /var/log/dietpi-survey_report.log + Main #----------------------------------------------------------- exit 0 #----------------------------------------------------------- -} +} &> /var/log/dietpi-survey_report.log From 92b24a07fd0a39b93041b9b078c4315a6941278c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jun 2020 19:35:32 +0200 Subject: [PATCH 088/182] v6.31 + DietPi-Survey_report | Keep track of previous output --- .meta/dietpi-survey_report | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 4229d817d1..c7676be730 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -1032,4 +1032,4 @@ _EOF_ exit 0 #----------------------------------------------------------- -} &> /var/log/dietpi-survey_report.log +} &>> /var/log/dietpi-survey_report.log From 689e15225cc898ec89385847b318fe3b8bfd537b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jun 2020 15:31:29 +0200 Subject: [PATCH 089/182] v6.31 + DietPi-Globals | G_EXEC: Force usage of originating tty for STDIN, STDERR and STDOUT when spawning subshell for error investigation. This assures that bash recognises itself as interactive shell, regardless of stream redirection of originating shell/script. This could be done via "-i" as well but re-binding streams to tty also fixes some interactive programs which rely on STDOUT and STDERR being detected as tty [[ -t [12] ]], e.g. nano being unusable otherwise, when streams are redirected or piped to file or "tee". This is relevant for dietpi-update and dietpi-software on first login. --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 66b325c7c7..20f8560556 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1039,7 +1039,7 @@ $log_content" || break # Exit error handler menu loop on cancel G_WHIP_MSG 'A bash subshell will now open which allows you to investigate and/or fix the issue. \nPlease use the "exit" command when you are finished, to return to this error handler menu.' - bash + bash &> /dev/tty < /dev/tty elif [[ $G_WHIP_RETURNED_VALUE == 'Send report' ]]; then From 35fadc45df47aecf94c995a5cfaaa8e5d2d2aba6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jun 2020 11:31:41 +0200 Subject: [PATCH 090/182] v6.31 + DietPi-PREP | Add u-boot to Odroid C4 requirements. N2 u-boot is currently pre-installed but not part of the C4 repo, as well it is not dependency of the C4 kernel. However lets assume the pre-installed N2 u-boot works, keep it to enable auto-upgrades once a dedicated C4 package has been added to the C4 repo. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 16ec398bf2..2ad0bc125c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -875,7 +875,7 @@ _EOF_' # Odroid C4 elif (( $G_HW_MODEL == 16 )); then - G_AGI linux-image-arm64-odroid-c4 meveric-keyring + G_AGI linux-image-arm64-odroid-c4 meveric-keyring u-boot # Odroid N2 elif (( $G_HW_MODEL == 15 )); then From 998c564d4dfc5d9c05ea34325e05d2742f5bea60 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jun 2020 12:01:32 +0200 Subject: [PATCH 091/182] v6.31 + DietPi-PREP | Force new config for vmtouch --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2ad0bc125c..3492e63818 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1239,7 +1239,7 @@ _EOF_ #----------------------------------------------------------------------------------- # Install vmtouch to lock DietPi scripts and config in file system cache G_EXEC wget https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vmtouch_$G_HW_ARCH_NAME.deb - G_EXEC dpkg --force-hold,confdef,confold -i vmtouch_$G_HW_ARCH_NAME.deb + G_EXEC dpkg --force-hold,confnew -i vmtouch_$G_HW_ARCH_NAME.deb rm vmtouch_$G_HW_ARCH_NAME.deb #----------------------------------------------------------------------------------- From 6a0d80e979ef4b79cc7f35339e3c62959ba4b130 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jun 2020 12:18:18 +0200 Subject: [PATCH 092/182] v6.31 + DietPi-Imager | Automatically limit lzma2 threads on low RAM systems --- .meta/dietpi-imager | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 102cb35e98..4020d0eee4 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -457,8 +457,10 @@ _EOF_ # Generate 7z archive # NB: LZMA2 ultra compression requires much memory for usage and allocation, which is an issue on 32bit (ARM) devices. Use "-mmt" to limit used CPU threads to "" and lower memory usage and allocation. + local limit_threads + (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads='-mmt2' [[ -f $OUTPUT_IMG_NAME.7z ]] && rm $OUTPUT_IMG_NAME.7z - G_EXEC_DESC='Creating final 7zip archive' G_EXEC_OUTPUT=1 G_EXEC 7zr a -m0=lzma2 -mx=9 $OUTPUT_IMG_NAME.7z $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT hash.txt README.md + G_EXEC_DESC='Creating final 7zip archive' G_EXEC_OUTPUT=1 G_EXEC 7zr a -m0=lzma2 $limit_threads -mx=9 $OUTPUT_IMG_NAME.7z $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT hash.txt README.md rm hash.txt README.md G_WHIP_MSG "[ OK ] DietPi-Imager has successfully finished.\n From fe170d5bec55974d3bcd2167085bd66ae8f677a9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jun 2020 14:17:26 +0200 Subject: [PATCH 093/182] v6.31 + DietPi-Software | On firstrun installs, flag DietPi-RAMlog for reinstall only if it is stilled marked to stay installed after all manual choices. Else this is overriding manual logging choice 0 and -3 since Apply_Logging_Choices() only touches "(( ${aSOFTWARE_INSTALL_STATE[103]} == 2 ))": https://github.com/MichaIng/DietPi/issues/3588 --- dietpi/dietpi-software | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d6614db94d..6ad5b5c812 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6521,7 +6521,7 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" fi - software_id=103 + software_id=103 # DietPi-RAMlog if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6682,8 +6682,8 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" # Check currently installed SSH servers via "dpkg --get-selections" to be failsafe local dpkg_out=$(dpkg --get-selections) - grep -q '^dropbear[^[:blank:]]*[[:blank:]]' <<< "$dpkg_out" && aSOFTWARE_INSTALL_STATE[104]=-1 && UNINSTALL_REQUIRED=1 - grep -q '^openssh-server[[:blank:]]' <<< "$dpkg_out" && aSOFTWARE_INSTALL_STATE[105]=-1 && UNINSTALL_REQUIRED=1 + grep -q '^dropbear[^[:blank:]]*[[:blank:]]' <<< "$dpkg_out" && aSOFTWARE_INSTALL_STATE[104]=-1 UNINSTALL_REQUIRED=1 + grep -q '^openssh-server[[:blank:]]' <<< "$dpkg_out" && aSOFTWARE_INSTALL_STATE[105]=-1 UNINSTALL_REQUIRED=1 # Dropbear elif (( $INDEX_SSHSERVER_TARGET == -1 )); then @@ -6739,8 +6739,8 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" Apply_Logging_Choices(){ - # Work out which Logging system needs installing from IDs (if any) - # Work out which Logging system needs removing (if any) + # Work out which logging system needs installing from IDs (if any) + # Work out which logging system needs removing (if any) if (( $INDEX_LOGGING_TARGET != $INDEX_LOGGING_CURRENT )); then # Run uninstall of old logging systems, after install loop @@ -6753,14 +6753,14 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 (( ${aSOFTWARE_INSTALL_STATE[103]} == 2 )) && aSOFTWARE_INSTALL_STATE[103]=-1 - # Ramlog - clear every hour + # RAMlog - clear every hour elif (( $INDEX_LOGGING_TARGET == -1 )); then aSOFTWARE_INSTALL_STATE[103]=1 (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - # Ramlog - backup every 1H to /root/logfile_storage, then clear. + # RAMlog - backup every hour to /root/logfile_storage, then clear elif (( $INDEX_LOGGING_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[103]=1 @@ -6781,6 +6781,9 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" fi + # Reinstall DietPi-RAMlog on firstrun installs, if enabled, to apply AUTO_SETUP_RAMLOG_MAXSIZE + (( $G_DIETPI_INSTALL_STAGE == 1 && ${aSOFTWARE_INSTALL_STATE[103]} == 2 )) && aSOFTWARE_INSTALL_STATE[103]=1 + } Apply_Webserver_Preference(){ @@ -14959,9 +14962,6 @@ _EOF_ INDEX_LOGGING_TARGET=$AUTOINSTALL_LOGGINGINDEX INDEX_WEBSERVER_TARGET=$AUTOINSTALL_WEBSERVERINDEX - # Re-flag RAMlog for install, if enabled, ensures AUTO_SETUP_RAMLOG_MAXSIZE gets applied - [[ $INDEX_LOGGING_TARGET == -[12] ]] && aSOFTWARE_INSTALL_STATE[103]=1 - # Set time sync mode /boot/dietpi/func/dietpi-set_software ntpd-mode $AUTOINSTALL_TIMESYNCMODE From f68580a74af77334631f64b4c57c96b5a588ff5e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jun 2020 14:21:17 +0200 Subject: [PATCH 094/182] v6.31 + CHANGELOG | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 10c4b23a9e..612d3bb650 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 +- DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 From e962936e6eedc454625aefaa8ef4524bb725cfc7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 9 Jun 2020 17:30:35 +0200 Subject: [PATCH 095/182] v6.31 + DietPi-Globals | Tiny --- dietpi/func/dietpi-globals | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 20f8560556..70382d5b8e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1114,7 +1114,7 @@ $log_content" || break # Exit error handler menu loop on cancel local ip [[ $* == '-6' ]] || ip=$(ip -4 r l 0/0 | mawk '{print $3;exit}') - [[ $ip || $* == '-4' ]] || ip=$(ip -6 r l ::0/0 | mawk '{print $3;exit}') + [[ $ip || $* == '-4' ]] || ip=$(ip -6 r l ::/0 | mawk '{print $3;exit}') [[ $ip ]] || return 1 echo "$ip" @@ -1141,8 +1141,7 @@ $log_content" || break # Exit error handler menu loop on cancel # - "default" means the interface that holds the default gateway, hence which is used for www access. # - If no default gateway exists, the first interface with state "UP" is selected instead. # - If no interface with state "UP" exists, the first interface with an assigned IP is selected instead. - # - If no interface with an assigned IP exists, the first available interface is selected. - # - If no interface exists, the funtion returns 1 + # - If no interface with an assigned IP exists, the funtion returns 1 # - Optional arguments: # "-4": Force check and print of interfaces with IPv4 address only, else return 1 # "-6": Force check and print of interfaces with IPv6 address only, else return 1 From a9d2ea33f3a546ec263377b769fb4aeaaef8d7f3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 13:17:29 +0200 Subject: [PATCH 096/182] v6.31 + DietPi-Drive_Manager | Move RootFS: Assure that DietPi userdata from rootfs, respectively its symlink, is copied to the target drive as well as all mountpoint directories (without content). This is achieved by excluding mounts content via tmp rootfs mountpoint and copying from there. This allows to skip excluding known tmpfs mountpoints manually and assures that source and target match 100% (aside of extended attributes and ACLs). rsync "-x" option prevents copying mounts content, but it copies permissions of mountpoint dirs according to mount options instead of those of the dir on the parent fs. This might be not wanted in cases. E.g. a shared drive or tmpfs has mounted with loose permissions to allow anyone access, but it is not wanted that everyone can access the directory below the mount point, when it is not mounted, e.g. to prevent a full rootfs and such. This might be a topic for rsync to add this behaviour by default when using "-x". --- dietpi/dietpi-drive_manager | 51 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index a4535a40d9..3d9d1babf3 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -711,56 +711,67 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return # Install rsync G_AG_CHECK_INSTALL_PREREQ rsync - # Update fstab - cp -a /etc/fstab /etc/fstab.bak # in case of rsync fail + # Disable swap + /boot/dietpi/func/dietpi-set_swapfile 0 + + # Create new fstab + G_EXEC cp -a /etc/fstab /etc/fstab_new # - Remove automatic entry for new UUID - sed -i "\@[[:blank:]]${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}[[:blank:]]@d" /etc/fstab + G_EXEC sed -i "\@[[:blank:]]${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}[[:blank:]]@d" /etc/fstab_new # - Replace old with new rootfs entry local dev_entry="UUID=${aDRIVE_UUID[$MENU_DRIVE_INDEX]}" (( $G_HW_MODEL < 10 )) && dev_entry="PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}" - sed -i "\@UUID=[^[:blank:]]*[[:blank:]][[:blank:]]*/[[:blank:]]@c $dev_entry / ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} noatime,lazytime,rw 0 1" /etc/fstab - - # Disable swap - /boot/dietpi/func/dietpi-set_swapfile 0 + G_EXEC sed -i "\@UUID=[^[:blank:]]*[[:blank:]]\+/[[:blank:]]@c$dev_entry / ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} noatime,lazytime,rw 0 1" /etc/fstab_new - # Exclude /var/log in case it is a mount point - local exclude_var_log - findmnt -no SOURCE /var/log &> /dev/null && exclude_var_log='--exclude /var/log/*' + # Mount rootfs to tmp mountpoint to allow rsync + # - rsync "-x" option prevents copying mounts content, but it copies permissions of mountpoint dirs according to mount options instead of those of the dir on the parent fs. + # - Since mount permissions might not be wanted for the underlying file system dir, we copy from a temporary mountpoint to assure that underlying rootfs content matches 100%. + G_EXEC mkdir -p /tmp/tmp_rootfs + G_EXEC mount $G_ROOTFS_DEV /tmp/tmp_rootfs - if ! rsync -aHv --delete --exclude '/dev/*' --exclude '/sys/*' --exclude '/proc/*' --exclude '/run/*' --exclude '/tmp/*' $exclude_var_log --exclude '/lost+found/' --exclude '/boot/*' --exclude '/mnt/*' --exclude "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/" / "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/"; then + # Start rsync + if ! G_EXEC_NOEXIT=1 G_EXEC rsync -aHv --delete /tmp/tmp_rootfs/ "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/"; then G_DIETPI-NOTIFY 1 'Rsync has failed, RootFS transfer has been aborted.' - # Revert fstab changes - cp -a /etc/fstab.bak /etc/fstab - exit 1 + rm /etc/fstab_new + umount /tmp/tmp_rootfs + rmdir /tmp/tmp_rootfs + return 1 fi + # Remove volatile systemd service PrivateTmp dirs in /var/tmp and target drive mountpoint dir + rm -Rf "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}"/var/tmp/systemd-private-* + rmdir "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}" + + # Move new fstab in place + G_EXEC mv /etc/fstab_new "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/etc/fstab" + # Recreate swap #/boot/dietpi/func/dietpi-set_swapfile 1 "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/var/swap" # - Manually update location #G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_LOCATION=' 'AUTO_SETUP_SWAPFILE_LOCATION=/var/swap' /boot/dietpi.txt - # RPi | /boot/cmdline.txt + # RPi: /boot/cmdline.txt if (( $G_HW_MODEL < 10 )); then # Find current root= and replace local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 '^root=') - sed -i "s#$rootfs_current#root=PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt + G_EXEC sed -i "s#$rootfs_current#root=PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt # Set FS type local rootfstype_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 '^rootfstype=') - sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt + G_EXEC sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt # Add root delay - grep -qE '(^|[[:blank:]])rootdelay=' /boot/cmdline.txt || sed -i "s#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]}#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} rootdelay=10#" /boot/cmdline.txt + grep -qE '(^|[[:blank:]])rootdelay=' /boot/cmdline.txt || G_EXEC sed -i "s#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]}#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} rootdelay=10#" /boot/cmdline.txt - # C2/XU4 | /boot/boot.ini + # C2/XU4: /boot/boot.ini elif [[ $G_HW_MODEL == 1[12] ]]; then # Find current root= to replace local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/boot.ini | grep -m1 '^root=' | sed 's/\"//') - sed -i "s#$rootfs_current#root=UUID=${aDRIVE_UUID[$MENU_DRIVE_INDEX]}#g" /boot/boot.ini + G_EXEC sed -i "s#$rootfs_current#root=UUID=${aDRIVE_UUID[$MENU_DRIVE_INDEX]}#g" /boot/boot.ini fi From 4efb3016e127bfbe8c2c42e668cedfb9f7b59444 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 13:30:47 +0200 Subject: [PATCH 097/182] v6.31 + CHANGELOG | DietPi-Drive_Manager: Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 612d3bb650..f7329fa630 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 +- DietPi-Drive_Manager | Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata. Many thanks to @sdomotica and @Joulinar for reporting this issue: https://github.com/MichaIng/DietPi/issues/3600#issuecomment-643261670 - DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 From 40ad8d3b40397c8ab4a11aa492ce48ba58e1f610 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 15:24:09 +0200 Subject: [PATCH 098/182] v6.31 + DietPi-Login | Allow prevention of dietpi-login call by setting/exporting $G_DIETPI_LOGIN. E.g. when shell is called as subshell of G_EXEC or dietpi-login itself, we don't want autostart programs to be launched. --- rootfs/etc/bashrc.d/dietpi.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index 7a2d828435..5c416aec58 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -56,5 +56,6 @@ Please change your SSH clients terminal, respectively the passed \$TERM string$n fi # DietPi-Login: First run setup, autostarts and login banner - /boot/dietpi/dietpi-login + # - Prevent call if $G_DIETPI_LOGIN has been set. E.g. when shell is called as subshell of G_EXEC or dietpi-login itself, we don't want autostart programs to be launched. + [[ $G_DIETPI_LOGIN ]] || /boot/dietpi/dietpi-login } From 4224ad6f8f982f54562aaf5f0d27d5f8d9ffefb5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 15:33:50 +0200 Subject: [PATCH 099/182] v6.31 + DietPi-Globals | G_EXEC: Prevent dietpi-login call in subshell. We do not want e.g. autostart programs to be launched, minimise overhead and the chance for nested error loops. --- dietpi/func/dietpi-globals | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 70382d5b8e..faa9dda399 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1039,7 +1039,12 @@ $log_content" || break # Exit error handler menu loop on cancel G_WHIP_MSG 'A bash subshell will now open which allows you to investigate and/or fix the issue. \nPlease use the "exit" command when you are finished, to return to this error handler menu.' + # Prevent dietpi-login call in subshell + local reallow_dietpi_login=1 + [[ $G_DIETPI_LOGIN ]] && reallow_dietpi_login=0 + export G_DIETPI_LOGIN=1 bash &> /dev/tty < /dev/tty + (( $reallow_dietpi_login )) && unset -v G_DIETPI_LOGIN elif [[ $G_WHIP_RETURNED_VALUE == 'Send report' ]]; then From 7b3633ed91d6d811bf14e8e1beccd8dbd33ae1e4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 15:37:16 +0200 Subject: [PATCH 100/182] v6.31 + DietPi-Login | Prevent automated nested dietpi-login calls from subshells --- dietpi/dietpi-login | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index c05e2385ae..5457157449 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -202,6 +202,9 @@ Please login again as user "root" with password "dietpi", respectively the one y Main(){ + # Prevent automated nested dietpi-login calls from subshells + export G_DIETPI_LOGIN=1 + # Wait for full system boot local i=0 while pgrep -f '/boot/dietpi/postboot' &> /dev/null From d56c027510b34116a39357e7a50f220ff34df486 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 15:42:11 +0200 Subject: [PATCH 101/182] v6.31 + CHANGELOG | DietPi-Login: Resolved an issue where the script called itself from within the error handler subshell. Generally the error handler subshell must never call dietpi-login (and related autostart programs) and dietpi-login must never call itself from an interactive subshell. Many thanks to @nosyaardvark for reporting this issue: https://github.com/MichaIng/DietPi/issues/3583#issuecomment-643583664 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f7329fa630..9565c915ac 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 +- DietPi-Login | Resolved an issue where the script called itself from within the error handler subshell. Generally the error handler subshell must never call dietpi-login (and related autostart programs) and dietpi-login must never call itself from an interactive subshell. Many thanks to @nosyaardvark for reporting this issue: https://github.com/MichaIng/DietPi/issues/3583#issuecomment-643583664 - DietPi-Drive_Manager | Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata. Many thanks to @sdomotica and @Joulinar for reporting this issue: https://github.com/MichaIng/DietPi/issues/3600#issuecomment-643261670 - DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 From 8c33bbae8f9d583369951c33eaed83014008d823 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 21:59:30 +0200 Subject: [PATCH 102/182] v6.31 + DietPi-Software | WireGuard: Installing resolvconf when choosing client setup, used by wg-quick to apply DNS --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6ad5b5c812..bdce4f9510 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9680,6 +9680,7 @@ _EOF_ # Client choice elif [[ $G_WHIP_RETURNED_VALUE == 'Client' ]]; then + G_AGI resolvconf # Use by wg-quick to apply DNS in client setup G_WHIP_MSG '[ INFO ] WireGuard client setup has been chosen\n Please follow the instructions of your VPN provider to configure WireGuard.\n If no WireGuard (auto)start is included, but you require it, please do the following: From aeb8b5e3a0000ca73c114fc8b5841fb98195d8a3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jun 2020 22:02:26 +0200 Subject: [PATCH 103/182] v6.31 + CHANGELOG | Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9565c915ac..e0dd987317 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,7 @@ Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 +- DietPi-Software | Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 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 From be14aff29e0dab8c7a2b8ec5b97e2083ca0022e3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 12:20:36 +0200 Subject: [PATCH 104/182] v6.31 + DietPi-Drive_Manager | Preserve SSHFS entries in fstab --- dietpi/dietpi-drive_manager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 3d9d1babf3..4a3adf9b63 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -121,8 +121,8 @@ tmpfs /var/log tmpfs size=${var_log_size:-50}M,noatime,lazytime,nodev,nosuid,mod tmpfs_mounts=$(grep '^[[:blank:]]*tmpfs[[:blank:]]' $fp_fstab_tmp) # ecryptfs, vboxsf, glusterfs, bind mounts misc_mounts=$(grep -E '^[[:blank:]]*[^#].*([[:blank:]](ecryptfs|vboxsf|glusterfs)[[:blank:]]|[[:blank:],]bind[[:blank:],])' $fp_fstab_tmp) - # CurlFtpFS, CIFS/SMB/Samba, NFS - net_mounts=$(grep -E '^[[:blank:]]*(curlftpfs|[^#].*[[:blank:]](cifs|nfs4?)[[:blank:]])' $fp_fstab_tmp) + # CurlFtpFS, CIFS/SMB/Samba, NFS, SSHFS + net_mounts=$(grep -E '^[[:blank:]]*(curlftpfs|sshfs#|[^#].*[[:blank:]](cifs|nfs4?|fuse.sshfs)[[:blank:]])' $fp_fstab_tmp) fi From 60d529685d8eaaea79ea7e2fc9d82e7371c29743 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 12:52:17 +0200 Subject: [PATCH 105/182] v6.31 + CHANGELOG | DietPi-Drive_Manager: SSHFS entries in fstab are now detected and preserved --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e0dd987317..279e8d69dc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v6.31 Changes / Improvements / Optimisations: - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange +- DietPi-Drive_Manager | SSHFS entries in fstab are now detected and preserved. Many thanks to @notwork for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7781 - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 - DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ From 81753f4f8eaa0ee0fa32d6ae0f7a7769596485e0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 15:06:16 +0200 Subject: [PATCH 106/182] v6.31 + DietPi-Cleaner | Enhance file search performance by skip traversing /mnt if not selected for inclusion + DietPi-Cleaner | Minor coding and wording --- dietpi/dietpi-cleaner | 66 ++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 120dd52350..b2033be16e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -31,7 +31,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Globals #///////////////////////////////////////////////////////////////////////////////////// - FP_TEMP='.dietpi-cleaner' + FP_TMP='.dietpi-cleaner' #///////////////////////////////////////////////////////////////////////////////////// # Banners @@ -417,51 +417,35 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." Banner_Cleaning # Generate list of files to include. Remove lines with (#) or (space) or (empty) from list - sed -E '/([#[:blank:]]|^$)/d' $FP_CUSTOM > $FP_TEMP + sed -E '/([#[:blank:]]|^$)/d' $FP_CUSTOM > $FP_TMP - # Check include file has at least one value/line to process. - local line_count=$(wc -l < $FP_TEMP) - if (( ! $line_count )); then + # Check if include file has any left content + if [[ ! -s $FP_TMP ]]; then - echo -e '\nNo files to find. Have you setup the Files options and added filename entries to match?\n' + echo -e '\nNo files to find. Have you setup the Files options and added file name entries to match?\n' else - # Create array to hold user includes - local aCustomFiles=() - readarray aCustomFiles < $FP_TEMP - # Generate the find string - local find_string='' - echo -e '\nSearching for filenames matching:' - local i - for i in ${!aCustomFiles[@]} + echo -e '\nSearching for file names matching:' + local find_string + while read -r line do - echo -e "- ${aCustomFiles[$i]}" - - if (( $i == 0 )); then - - find_string="-name ${aCustomFiles[$i]}" - - else + echo "- $line" + [[ $find_string ]] && find_string+=' -o ' - find_string+=" -or -name ${aCustomFiles[$i]}" - - fi - - done + done < $FP_TMP echo 'Please wait...' - # Find all matching filenames. - find / -type f $find_string > $FP_TEMP + # Find all matching files + # - Skip traversing /mnt if not selected for inclusion + local exclude_mnt + (( $INCLUDE_MNT )) || exclude_mnt='! \( -path /mnt -prune \)' + find / $exclude_mnt -type f $find_string > $FP_TMP - # Remove /mnt from find list - (( $INCLUDE_MNT )) || sed -i '/\/mnt/d' $FP_TEMP - - line_count=$(wc -l < $FP_TEMP) - if (( $line_count == 0 )); then + if [[ ! -s $FP_TMP ]]; then echo -e '\nNo matching filenames were found.\n' @@ -476,18 +460,16 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." do echo "- Filepath: $line" - if (( ! $DRY_RUN )); then - - echo -e 'Deleted.\n' - rm "$line" + (( $DRY_RUN )) && continue - fi + rm "$line" + echo -e 'Deleted.\n' - done < $FP_TEMP + done < $FP_TMP fi - rm $FP_TEMP + rm $FP_TMP } @@ -565,10 +547,10 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." # - Press Y # - Press Enter # ------------------------------------------------------------------ -# Uncomment line below to include temp files during scan. +# Uncomment line below to include tmp files during scan. #*.tmp -# Uncomment line below to include Windows Thumbnail cache during scan. +# Uncomment line below to include Windows thumbnail cache during scan. #Thumbs.db _EOF_ fi From 926cdf0fa7e298291039d6c45ad78f6192993141 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 15:27:18 +0200 Subject: [PATCH 107/182] v6.31 + DietPi-Cleaner | Add actually matched file to find_string + DietPi-Cleaner | Do not escape parenthesis for find command when added via variable since this is only relevant when typing it directly into the terminal. Else the backslash is interpreted literally. --- dietpi/dietpi-cleaner | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index b2033be16e..a96ed82e1e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -434,6 +434,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." echo "- $line" [[ $find_string ]] && find_string+=' -o ' + find_string+="-name $line" done < $FP_TMP @@ -442,7 +443,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." # Find all matching files # - Skip traversing /mnt if not selected for inclusion local exclude_mnt - (( $INCLUDE_MNT )) || exclude_mnt='! \( -path /mnt -prune \)' + (( $INCLUDE_MNT )) || exclude_mnt='! ( -path /mnt -prune )' find / $exclude_mnt -type f $find_string > $FP_TMP if [[ ! -s $FP_TMP ]]; then From 3969369ccd8ca78cd9faefd7ed9e89af15ade22b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 15:45:31 +0200 Subject: [PATCH 108/182] v6.31 + DietPi-Cleaner | Reduce output length, allowing better review in case of many matches --- dietpi/dietpi-cleaner | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index a96ed82e1e..30895e6d4d 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -448,23 +448,22 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." if [[ ! -s $FP_TMP ]]; then - echo -e '\nNo matching filenames were found.\n' + echo -e '\nNo matching files were found.\n' else - echo -e '\nFound the following matching files:\n' + echo -e '\nFound the following matching files:' fi - # Remove files + # Process matches while read -r line do - echo "- Filepath: $line" - (( $DRY_RUN )) && continue - - rm "$line" - echo -e 'Deleted.\n' + # Dry run: Print matches only + (( $DRY_RUN )) && { echo "- $line"; continue; } + # Else remove and print result + rm "$line" && echo "- $line ..Deleted!" || echo "- $line ..Failed!" done < $FP_TMP From a8626aded4654ce3c54ba9fc8bc78c576d3aa958 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 16:11:37 +0200 Subject: [PATCH 109/182] v6.31 + DietPi-Globals | Tiny --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index faa9dda399..d15d9081e3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -918,7 +918,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if [[ $G_EXEC_OUTPUT == 1 ]]; then # Print $G_EXEC_DESC if given, else raw input command string and show current non-interactive attempt count if $G_EXEC_RETRIES is given - G_DIETPI-NOTIFY 2 "${G_EXEC_DESC:-$*}, please wait... ${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" + G_DIETPI-NOTIFY 2 "${G_EXEC_DESC:-$*}, please wait...${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" [[ $G_EXEC_OUTPUT_COL ]] && printf "$G_EXEC_OUTPUT_COL" "${acommand[@]}" 2>&1 | tee $fp_log exit_code=${PIPESTATUS[0]} From 590ee877ff863a3ab6120c55ccca7ff021ef78d3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 17:25:39 +0200 Subject: [PATCH 110/182] v6.31 + CHANGELOG | DietPi-Cleaner: Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 279e8d69dc..4a43b4f909 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v6.31 Changes / Improvements / Optimisations: - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange +- DietPi-Cleaner | Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 - DietPi-Drive_Manager | SSHFS entries in fstab are now detected and preserved. Many thanks to @notwork for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7781 - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 From 8cc5ae386e4f3fe6138f936f7315fec5eb82e092 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jun 2020 23:08:06 +0200 Subject: [PATCH 111/182] v6.31 + DietPi-Benchmark | Minor performance enhancements --- dietpi/func/dietpi-benchmark | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 0e2f9ba8c6..51c7cb382b 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -48,7 +48,7 @@ BENCH_FILESIZE=${BENCH_FILESIZE:-0} # Optional input for automated FP_BENCHFILE=${FP_BENCHFILE:-/} # Optional input for automated - FP_TEMP="/tmp/$G_PROGRAM_NAME" # CPU benchmark files + FP_TMP="/tmp/$G_PROGRAM_NAME" # CPU benchmark files BENCH_ROOTFS_WRITE='Not tested' BENCH_ROOTFS_READ='Not tested' BENCH_RAM_WRITE='Not tested' @@ -92,7 +92,7 @@ _EOF_ Update_Survey_Opted_Status(){ - SURVEY_OPTED_IN=$(sed -n '/^[[:blank:]]*SURVEY_OPTED_IN=[01]$/{s/^[^=]*=//;p;q}' /boot/dietpi.txt) + SURVEY_OPTED_IN=$(sed -n '/^[[:blank:]]*SURVEY_OPTED_IN=[01]$/{s/^[^=]*=//p;q}' /boot/dietpi.txt) } @@ -116,7 +116,7 @@ _EOF_ G_DIETPI-NOTIFY 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $G_HW_CPU_CORES cores, please wait..." - cat << _EOF_ > $FP_TEMP/bench + cat << _EOF_ > $FP_TMP/bench #!/bin/bash target_max_int=$CPUBENCH_INT_MAX cores=$G_HW_CPU_CORES @@ -162,17 +162,17 @@ do done _EOF_ - chmod +x $FP_TEMP/bench + chmod +x $FP_TMP/bench sync sleep 1 BENCH_CPU_TEMP_START=$(G_OBTAIN_CPU_TEMP) - { time -p $FP_TEMP/bench; } 2> $FP_TEMP/bench_result + { time -p $FP_TMP/bench; } 2> $FP_TMP/bench_result BENCH_CPU_TEMP_END=$(G_OBTAIN_CPU_TEMP) - BENCH_CPU=$(mawk '/real/ {print $2;exit}' $FP_TEMP/bench_result) + BENCH_CPU=$(mawk '/real/{print $2;exit}' $FP_TMP/bench_result) if (( $SHOW_RESULTS )); then @@ -223,7 +223,7 @@ _EOF_ local temp_bytes_result=$(mawk '{print $1}' <<< "$bench_write_result") local temp_time_result=$(mawk '{print $8}' <<< "$bench_write_result") # - Convert results from bytes and time to MiB/s - bench_write_result=$(bc -l <<< "scale=0; $temp_bytes_result / $temp_time_result / 1024 / 1024") + bench_write_result=$(( $temp_bytes_result / $temp_time_result / 1024 / 1024 )) # - Clear cache sync @@ -235,7 +235,7 @@ _EOF_ temp_bytes_result=$(mawk '{print $1}' <<< "$bench_read_result") temp_time_result=$(mawk '{print $8}' <<< "$bench_read_result") # - Convert results from bytes and time to MiB/s - bench_read_result=$(bc -l <<< "scale=0; $temp_bytes_result / $temp_time_result / 1024 / 1024") + bench_read_result=$(( $temp_bytes_result / $temp_time_result / 1024 / 1024 )) # - RootFS if [[ $FP_BENCHFILE == '/'$benchmark_file_name ]]; then @@ -282,7 +282,7 @@ _EOF_ The test duration will depend on hardware specs, however, most devices will not exceed 40 seconds.\n\nIf you are opted in to the DietPi-Survey, your scores will uploaded automatically. You can compare results against other users and hardware using the following link:\n - https://dietpi.com/survey#benchmark\n\nPlease select 'Ok' to begin the benchmark tests."; then - # - Additional checks + # Additional checks if (( $G_HW_CPU_CORES < 3 )); then G_WHIP_YESNO "We have detected a low CPU core count ($G_HW_CPU_CORES). The tests may take upto 5 minutes to complete (eg: RaspberryPi Zero).\n\nDo you wish to continue?" || exit 0 From b64e9d62e5b7dfe15a15e5a2814330eaf6ac9864 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Jun 2020 11:40:25 +0200 Subject: [PATCH 112/182] v6.31 + DietPi-Globals | G_OBTAIN_CPU_TEMP: Revert earlier v6.31 change: ${afp_temperature[@]} must not be quoted to allow glob expansion + DietPi-Globals | G_OBTAIN_CPU_TEMP: We check for G_CHECK_VALIDINT on temp before accepting it, hence float handling is not required, especially not after "(( $temp >= 200 ))" which will always be false in case of present decimal point. --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d15d9081e3..1f294c5a12 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1554,7 +1554,7 @@ $log_content" || break # Exit error handler menu loop on cancel ) - for i in "${afp_temperature[@]}" + for i in ${afp_temperature[@]} do [[ -f $i ]] && { temp=$(<$i); break; } @@ -1572,7 +1572,7 @@ $log_content" || break # Exit error handler menu loop on cancel else # 2/5 digit output? - (( $temp >= 200 )) && temp=$(mawk '{print $1/1000}' <<< $temp | xargs printf "%0.0f") + (( $temp >= 200 )) && temp=$(( $temp / 1000 )) if [[ $print_full_info == 1 ]]; then From 21e93baf6b2e55d9eace0f2ae4d9419bf90faef7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Jun 2020 12:21:48 +0200 Subject: [PATCH 113/182] v6.31 + DietPi-Survey_report | Enhance performance significantly by handling CPU times as integers until calculating final results in chosen scale. This allows to use native bash arithmetic instead of bc which is orders of magnitude faster. This became relevant since with Debian Buster bc execution in this environment somehow became very slow. Preserve CPU times scale and CPU temp 5 digits format check from DietPi-Benchmark respectively DietPi-Globals. --- .meta/dietpi-survey_report | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index c7676be730..8f25dc3694 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -88,7 +88,7 @@ declare -A aBENCH_NET_LAN_SPEED # Results - BENCH_RESULTS_CPU_SCALE=1 + BENCH_RESULTS_CPU_SCALE=2 aBENCH_RESULT_CPU_MIN=() aBENCH_RESULT_CPU_MAX=() aBENCH_RESULT_CPU_AVG=() @@ -341,9 +341,8 @@ aSOFTWARE_NAME[168]=168 aSOFTWARE_NAME[169]='Google AIY' - # v6.14 (earliest version that uploads to ssh.dietpi.com) + # v6.14 (earliest version that uploads to ssh.dietpi.com) + v6.15 aSOFTWARE_NAME6_14=() - # v6.15 aSOFTWARE_NAME6_15=() for i in ${!aSOFTWARE_NAME[@]} do @@ -458,9 +457,9 @@ Main(){ - # Copy files to RAM to speed up grep + # Copy files to RAM to speed up sourcing #mkdir -p /tmp/dietpi-survey_report - #cp /home/dietpi-survey/survey/*.txt /tmp/dietpi-survey_report/ # /etc/cron.minutely/dietpi-survey_report: line 310: /bin/cp: Argument list too long + #cp /home/dietpi-survey/survey/*.txt /tmp/dietpi-survey_report/ # cp: Argument list too long [[ -e '/tmp/dietpi-survey_report' ]] && rm -R /tmp/dietpi-survey_report cp -R /home/dietpi-survey/survey /tmp/dietpi-survey_report @@ -486,16 +485,15 @@ if [[ $BENCH_HW_MODEL =~ ^[0-9]+$ ]]; then # CPU - # - Remove decimal places - BENCH_CPU_TEMP_START=${BENCH_CPU_TEMP_START%%.*} - BENCH_CPU_TEMP_END=${BENCH_CPU_TEMP_END%%.*} - if [[ ${BENCH_CPU%%.*} =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then + # - BENCH_CPU: Remove decimal point, equal times 100 since CPU time is always in x.xx + BENCH_CPU=${BENCH_CPU/.} + if [[ $BENCH_CPU =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU # - Patch for 5 digit CPU temps: https://github.com/MichaIng/DietPi/issues/2715 - (( $BENCH_CPU_TEMP_START > 130 )) && (( BENCH_CPU_TEMP_START /= 1000 )) - (( $BENCH_CPU_TEMP_END > 130 )) && (( BENCH_CPU_TEMP_END /= 1000 )) + (( $BENCH_CPU_TEMP_START > 200 )) && (( BENCH_CPU_TEMP_START /= 1000 )) + (( $BENCH_CPU_TEMP_END > 200 )) && (( BENCH_CPU_TEMP_END /= 1000 )) aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_START aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_END @@ -591,18 +589,17 @@ for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - # Use bc to allow floats - if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]}") )); then + if (( ${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]} )); then aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} fi - if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]}") )); then + if (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]} )); then aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} fi - aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_RESULT_CPU_AVG[$i]} + ${aBENCH_CPU[$i,$j]}") + (( aBENCH_RESULT_CPU_AVG[$i] += ${aBENCH_CPU[$i,$j]} )) if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then @@ -628,12 +625,13 @@ fi (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) - # Last item in current array. Scale and work out averages + # Last item in current array. Work out averages if (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )); then - aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MIN[$i]} / 1") - aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MAX[$i]} / 1") - aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]}") + # Devide CPU times by 100 and scale to compensate decimal point removal + aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MIN[$i]} / 100") + aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MAX[$i]} / 100") + aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} / 100") aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) From 8ab237f8d272f623bf982315ebdb6d696313ac77 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Jun 2020 15:08:41 +0200 Subject: [PATCH 114/182] v6.31 + DietPi-Software | Update HAProxy to lastest stable version: https://github.com/MichaIng/DietPi/issues/3604 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bdce4f9510..436387a100 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4301,7 +4301,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing - local version='2.1.3' + local version='2.1.7' DEPS_LIST='libpcre3-dev libssl-dev zlib1g-dev libsystemd-dev' Download_Install "https://www.haproxy.org/download/${version%.*}/src/haproxy-$version.tar.gz" From 8c0279ce4996f4c9490dcd436f9a4a3aaff5ef26 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Jun 2020 21:51:17 +0200 Subject: [PATCH 115/182] v6.31 (#3605) + DietPi-Software | Ubooquity: Download newest version from Vae Mendis Software directly + DietPi-Software | Ubooquity: Make comics and ebooks dirs writable for "dietpi" group members (downloaders, file servers, ...) by default. + DietPi-Software | Ubooquity: Set users home dir and move logs to /var/log/ubooquity (DietPi-RAMlog). Sadly we cannot disable the log file since "journalctl -u ubooquity" doubles it. + DietPi-Software | Ubooquity: Use G_EXEC thoroughly to be most verbose about what we're doing and prevent unexpected situations because of failed user/dir creation and such. --- CHANGELOG.txt | 3 ++- dietpi/dietpi-software | 31 +++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4a43b4f909..720937a1a1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,7 +21,8 @@ Bug Fixes: - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 -- DietPi-Software | Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 +- DietPi-Software | WireGuard: Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 +- DietPi-Software | Ubooquity: Updated the installer to pull the latest version from Vae Mendis Software directly and enhanced permissions to better integrate with other software. Many thanks to @Mr.Roboto for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=12&t=7786 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 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 436387a100..cc52a42a32 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4483,11 +4483,11 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/Ubooquity.jar' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - mkdir -p $G_FP_DIETPI_USERDATA/ubooquity - G_EXEC wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar + G_EXEC curl -sSfL https://vaemendis.net/ubooquity/service/download.php -o Ubooquity.zip + G_EXEC unzip -o Ubooquity.zip + G_EXEC_NOEXIT=1 G_EXEC rm Ubooquity.zip + G_EXEC mkdir -p $G_FP_DIETPI_USERDATA/ubooquity + G_EXEC mv {,$G_FP_DIETPI_USERDATA/ubooquity/}Ubooquity.jar fi @@ -9301,12 +9301,21 @@ _EOF_ Banner_Configuration + # User local usercmd='useradd -rMU' getent passwd ubooquity &> /dev/null && usercmd='usermod -a' - $usercmd -G dietpi -s $(command -v nologin) ubooquity + G_EXEC $usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/ubooquity -s $(command -v nologin) ubooquity + + # Data + G_EXEC mkdir -p $G_FP_DIETPI_USERDATA/{ebooks,comics} - mkdir -p $G_FP_DIETPI_USERDATA/{ebooks,comics} + # Logs + G_EXEC rm -Rf $G_FP_DIETPI_USERDATA/ubooquity/logs /var/log/ubooquity + G_EXEC mkdir -p /var/log/ubooquity + G_EXEC ln -s /var/log/ubooquity $G_FP_DIETPI_USERDATA/ubooquity/logs + # Service + G_DIETPI-NOTIFY 2 "Generating systemd service to start ${aSOFTWARE_NAME[$software_id]} on boot" cat << _EOF_ > /etc/systemd/system/ubooquity.service [Unit] Description=Ubooquity (DietPi) @@ -9321,10 +9330,11 @@ ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar [Install] WantedBy=multi-user.target _EOF_ - # Permissions - chmod +x $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar - chown -R ubooquity:dietpi $G_FP_DIETPI_USERDATA/ubooquity + G_EXEC chmod +x $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar + G_EXEC chown -R ubooquity {$G_FP_DIETPI_USERDATA,/var/log}/ubooquity + G_EXEC chown ubooquity:dietpi $G_FP_DIETPI_USERDATA/{ebooks,comics} + G_EXEC chmod 775 $G_FP_DIETPI_USERDATA/{ebooks,comics} fi @@ -14365,6 +14375,7 @@ _EOF_ fi getent passwd ubooquity &> /dev/null && userdel -rf ubooquity + getent group ubooquity &> /dev/null && groupdel ubooquity [[ -d $G_FP_DIETPI_USERDATA/ubooquity ]] && rm -R $G_FP_DIETPI_USERDATA/ubooquity fi From 13f88e71c15c4278461ee950611dce867423f2fd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jun 2020 14:44:57 +0200 Subject: [PATCH 116/182] v6.31 + DietPi-Obtain_HW_model | RPi: Always check newest unpublished commits on revision code docs and add potential compute module 4 support. Although no info about this has been published yet, the CM4 is the only model where info in upstream kernel/firmware can be found about already, so we assume it will be released next. Most importantly G_HW_MODEL=4 is detected correctly for next release, a wrong G_HW_MODEL_NAME would be visual-only. --- dietpi/func/dietpi-obtain_hw_model | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index d70df15d6d..df73ffb965 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -127,7 +127,7 @@ G_HW_MODEL=1 G_HW_MODEL_NAME='RPi (Unknown)' - # Obtain device info by revision code: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md + # Obtain device info by revision code: https://github.com/raspberrypi/documentation/tree/master/hardware/raspberrypi/revision-codes G_HW_REVISION=$(mawk '/^Revision/{print $3;exit}' /proc/cpuinfo) # New style revision codes: 6th hex char >= 8 @@ -152,6 +152,7 @@ 0e) G_HW_MODEL_NAME='RPi 3 Model A+' G_HW_MODEL=3 G_HW_ONBOARD_WIFI=1;; 10) G_HW_MODEL_NAME='RPi CM 3+' G_HW_MODEL=3;; 11) G_HW_MODEL_NAME='RPi 4 Model B' G_HW_MODEL=4 G_HW_ONBOARD_WIFI=1;; + 12) G_HW_MODEL_NAME='RPi CM 4' G_HW_MODEL=4;; esac # Manufacturer case ${G_HW_REVISION: -5:1} in From 95b8e7e33a1aa46baa088258d0c981673908e222 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Jun 2020 14:38:42 +0200 Subject: [PATCH 117/182] v6.31 + DietPi-Software | Node.js: libatomic1 is required to start Node since last year: https://github.com/MichaIng/DietPi/issues/3614 + DietPi-Software | Node.js: Increase install verbosity and error handling + DietPi-Software | Certbot: Minor wording, uninstall enhancement and use follow official notation "Certbot" with lower case "b". --- dietpi/dietpi-software | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cc52a42a32..c897f0c21f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1687,8 +1687,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=92 - aSOFTWARE_NAME[$software_id]='CertBot' - aSOFTWARE_DESC[$software_id]='free, ssl cert install allowing https://' + aSOFTWARE_NAME[$software_id]='Certbot' + aSOFTWARE_DESC[$software_id]="Obtain and renew Let's Encrypt SSL certs for HTTPS" aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1062#p1062' @@ -4664,7 +4664,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - software_id=92 # Let's Encrypt + software_id=92 # Certbot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6594,14 +6594,17 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" INSTALL_URL_ADDRESS='https://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' G_CHECK_URL "$INSTALL_URL_ADDRESS" - wget "$INSTALL_URL_ADDRESS" + G_EXEC wget "$INSTALL_URL_ADDRESS" # ARMv6 workaround: https://github.com/MichaIng/DietPi/issues/2755 (( $G_HW_ARCH == 1 )) && sed -i 's|nodejs.org/dist/latest/|nodejs.org/dist/latest-v11.x/|g' node-install.sh - mkdir -p /usr/local # failsafe - chmod +x node-install.sh - ./node-install.sh - rm node-install.sh + G_EXEC mkdir -p /usr/local # failsafe + G_EXEC chmod +x node-install.sh + G_EXEC_OUTPUT=1 G_EXEC ./node-install.sh + G_EXEC_NOHALT=1 G_EXEC rm node-install.sh + + # Deps: https://github.com/MichaIng/DietPi/issues/3614 + G_AGI libatomic1 fi @@ -13662,13 +13665,19 @@ _EOF_ fi - software_id=92 + software_id=92 # Certbot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP python3-certbot-apache python3-certbot-nginx certbot - [[ -f '/etc/systemd/system/certbot.service' ]] && rm /etc/systemd/system/certbot.service [[ -d '/etc/systemd/system/certbot.service.d' ]] && rm -R /etc/systemd/system/certbot.service.d + # Pre-v6.3 + if [[ -f '/etc/systemd/system/certbot.service' ]]; then + + systemctl disable --now certbot + rm /etc/systemd/system/certbot.service + + fi fi @@ -14674,14 +14683,14 @@ _EOF_ fi - software_id=9 + software_id=9 # Node.js if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling npm r -g n yarn npm - G_AGP nodejs # Old install via repo + G_AGP nodejs [[ -f '/etc/apt/sources.list.d/nodesource_nodejs.list' ]] && rm /etc/apt/sources.list.d/nodesource_nodejs.list [[ -f '/usr/local/bin/node' ]] && rm /usr/local/bin/node From 3b7712d75c11818cf5b9175653f767b85abc5502 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Jun 2020 14:40:44 +0200 Subject: [PATCH 118/182] v6.31 + CHANGELOG | Node.js: Resolved an issue where Node failed to start due to missing new libatmoic1 dependency. Many thanks to @larsno for reporting this issue: https://github.com/MichaIng/DietPi/issues/3614 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 720937a1a1..26ee906589 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,7 @@ Bug Fixes: - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 - DietPi-Software | WireGuard: Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 - DietPi-Software | Ubooquity: Updated the installer to pull the latest version from Vae Mendis Software directly and enhanced permissions to better integrate with other software. Many thanks to @Mr.Roboto for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=12&t=7786 +- DietPi-Software | Node.js: Resolved an issue where Node failed to start due to missing new libatmoic1 dependency. Many thanks to @larsno for reporting this issue: https://github.com/MichaIng/DietPi/issues/3614 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 From f22831b0241ec0e704291bf85b495ec28a0ae3fc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jun 2020 17:07:22 +0200 Subject: [PATCH 119/182] v6.31 + DietPi-Config | Remove obsolete spaces --- dietpi/dietpi-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 6a38680d46..b39d1af12b 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1330,7 +1330,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ': Install rpi-eeprom APT package') - fi + fi fi @@ -2641,7 +2641,7 @@ NB: All Ethernet connections will be dropped!' && Network_ApplyChanges WIFI_DNS='0.0.0.0' WIFI_MODE=1 WIFI_MODE_TARGET=$WIFI_MODE - + # Get extra WiFi stats command -v iwgetid &> /dev/null && WIFI_SSID_CURRENT=$(iwgetid -r) [[ $WIFI_SSID_CURRENT ]] || WIFI_SSID_CURRENT='Disconnected / No SSID' @@ -3854,7 +3854,7 @@ Additional benchmarks: case "$G_WHIP_RETURNED_VALUE" in 'energy saving') - + G_CONFIG_INJECT 'over_voltage=' 'over_voltage=-2' /boot/config.txt ;; From b105a4e0c1eafc2aa43cddffdfcc50e57515973d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jun 2020 23:15:13 +0200 Subject: [PATCH 120/182] v6.31 + DietPi-Survey_report | Add percentages to counts + DietPi-Survey_report | Sort benchmark results by average score + DietPi-Survey_report | Minor coding and wording --- .meta/dietpi-survey_report | 332 +++++++++++++------------------------ 1 file changed, 118 insertions(+), 214 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 8f25dc3694..df86f5a418 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -262,7 +262,7 @@ aSOFTWARE_NAME[89]='PHP' aSOFTWARE_NAME[90]='phpMyAdmin' aSOFTWARE_NAME[91]='Redis' - aSOFTWARE_NAME[92]='CertBot' + aSOFTWARE_NAME[92]='Certbot' aSOFTWARE_NAME[93]='Pi-hole' aSOFTWARE_NAME[94]='ProFTP' aSOFTWARE_NAME[95]='vsFTPD' @@ -477,89 +477,85 @@ fi # Source survey files - if [[ $(<$file) == '#!/bin/bash'* ]]; then + [[ $(<$file) == '#!/bin/bash'* ]] || continue - . $file + . $file - # Add bench to array - if [[ $BENCH_HW_MODEL =~ ^[0-9]+$ ]]; then + # Add bench to array + [[ $BENCH_HW_MODEL =~ ^[0-9]+$ ]] || continue - # CPU - # - BENCH_CPU: Remove decimal point, equal times 100 since CPU time is always in x.xx - BENCH_CPU=${BENCH_CPU/.} - if [[ $BENCH_CPU =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then + # CPU + # - BENCH_CPU: Remove decimal point, equals times 100 since CPU time is always in x.xx + BENCH_CPU=${BENCH_CPU/.} + if [[ $BENCH_CPU =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then - aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU + aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU - # - Patch for 5 digit CPU temps: https://github.com/MichaIng/DietPi/issues/2715 - (( $BENCH_CPU_TEMP_START > 200 )) && (( BENCH_CPU_TEMP_START /= 1000 )) - (( $BENCH_CPU_TEMP_END > 200 )) && (( BENCH_CPU_TEMP_END /= 1000 )) + # Patch for 5 digit CPU temps: https://github.com/MichaIng/DietPi/issues/2715 + (( $BENCH_CPU_TEMP_START > 200 )) && (( BENCH_CPU_TEMP_START /= 1000 )) + (( $BENCH_CPU_TEMP_END > 200 )) && (( BENCH_CPU_TEMP_END /= 1000 )) - aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_START - aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_END - ((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++)) + aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_START + aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_END + ((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++)) - fi - - # RootFS - # - Remove decimal places - BENCH_ROOTFS_WRITE=${BENCH_ROOTFS_WRITE%%.*} - BENCH_ROOTFS_READ=${BENCH_ROOTFS_READ%%.*} - if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]+$ && $BENCH_ROOTFS_READ =~ ^[0-9]+$ ]]; then - - aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_ROOTFS_WRITE - aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_ROOTFS_READ - ((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++)) - - fi + fi - # RAM - # - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing. - # - Remove decimal places - BENCH_RAM_WRITE=${BENCH_RAM_WRITE%%.*} - BENCH_RAM_READ=${BENCH_RAM_READ%%.*} - if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]+$ && $BENCH_RAM_READ =~ ^[0-9]+$ ]] && (( $BENCH_VERSION > 1 )); then + # RootFS + # - Remove decimal places + BENCH_ROOTFS_WRITE=${BENCH_ROOTFS_WRITE%%.*} + BENCH_ROOTFS_READ=${BENCH_ROOTFS_READ%%.*} + if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]+$ && $BENCH_ROOTFS_READ =~ ^[0-9]+$ ]]; then - aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_RAM_WRITE - aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=$BENCH_RAM_READ - ((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++)) + aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_ROOTFS_WRITE + aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_ROOTFS_READ + ((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++)) - fi + fi - # Custom FS - # - Remove decimal places - BENCH_CUSTOMFS_WRITE=${BENCH_CUSTOMFS_WRITE%%.*} - BENCH_CUSTOMFS_READ=${BENCH_CUSTOMFS_READ%%.*} - if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]+$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]+$ ]]; then + # RAM + # - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing. + # - Remove decimal places + BENCH_RAM_WRITE=${BENCH_RAM_WRITE%%.*} + BENCH_RAM_READ=${BENCH_RAM_READ%%.*} + if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]+$ && $BENCH_RAM_READ =~ ^[0-9]+$ ]] && (( $BENCH_VERSION > 1 )); then - aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CUSTOMFS_WRITE - aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CUSTOMFS_READ - ((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++)) + aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_RAM_WRITE + aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=$BENCH_RAM_READ + ((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++)) - fi + fi - # LAN - # - Remove decimal places - BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%%.*} - if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then + # Custom FS + # - Remove decimal places + BENCH_CUSTOMFS_WRITE=${BENCH_CUSTOMFS_WRITE%%.*} + BENCH_CUSTOMFS_READ=${BENCH_CUSTOMFS_READ%%.*} + if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]+$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]+$ ]]; then - aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_NET_LAN_SPEED - ((aBENCH_LAN_INDEX[$BENCH_HW_MODEL]++)) + aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CUSTOMFS_WRITE + aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CUSTOMFS_READ + ((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++)) - fi + fi - # Done, clear vars - unset BENCH_VERSION BENCH_HW_MODEL - unset BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END - unset BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ - unset BENCH_RAM_WRITE BENCH_RAM_READ - unset BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ - unset BENCH_NET_LAN_SPEED + # LAN + # - Remove decimal places + BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%%.*} + if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then - fi + aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_NET_LAN_SPEED + ((aBENCH_LAN_INDEX[$BENCH_HW_MODEL]++)) fi + # Done, clear vars + unset BENCH_VERSION BENCH_HW_MODEL + unset BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END + unset BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ + unset BENCH_RAM_WRITE BENCH_RAM_READ + unset BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ + unset BENCH_NET_LAN_SPEED + done # Navigate to parent /tmp @@ -568,6 +564,9 @@ # Clean up reports dir rm -R /tmp/dietpi-survey_report + # Optin count + SURVEY_COUNT_OPTIN=$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY )) + # Process all results, for later use in HTML printout # - NB: HW_MODEL array based local default_min_value=100000 @@ -589,53 +588,26 @@ for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - if (( ${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]} )); then - - aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} - - fi - if (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]} )); then - - aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} - - fi + (( ${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]} )) && aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} + (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]} )) && aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} (( aBENCH_RESULT_CPU_AVG[$i] += ${aBENCH_CPU[$i,$j]} )) - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then - - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} - - fi - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )); then - - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} - - fi + (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )) && aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )) && aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then - - aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} - - fi - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )); then - - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} - - fi + (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )) && aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )) && aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) # Last item in current array. Work out averages - if (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )); then - - # Devide CPU times by 100 and scale to compensate decimal point removal - aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MIN[$i]} / 100") - aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MAX[$i]} / 100") - aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} / 100") - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) - - fi + (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )) || continue + # - Devide CPU times by 100 and scale to revert decimal point removal + aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MIN[$i]} / 100") + aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MAX[$i]} / 100") + aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} / 100") + aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) + aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) done @@ -655,37 +627,18 @@ for (( j=0; j<${aBENCH_ROOTFS_INDEX[$i]}; j++ )) do - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )); then - - aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} - - fi - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )); then - - aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} - - fi + (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )) && aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )) && aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) - if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then - - aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - - fi - if (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )); then - - aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - - fi + (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )) && aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )) && aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) # Last item in current array. Work out averages - if (( $j == ${aBENCH_ROOTFS_INDEX[$i]} - 1 )); then - - aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) - aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) - - fi + (( $j == ${aBENCH_ROOTFS_INDEX[$i]} - 1 )) || continue + aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) + aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) done @@ -705,37 +658,18 @@ for (( j=0; j<${aBENCH_RAM_INDEX[$i]}; j++ )) do - if (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )); then - - aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} - - fi - if (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )); then - - aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} - - fi + (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )) && aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} + (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )) && aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then - - aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} - - fi - if (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )); then - - aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} - - fi + (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )) && aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} + (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )) && aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) # Last item in current array. Work out averages - if (( $j == ${aBENCH_RAM_INDEX[$i]} - 1 )); then - - aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) - aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) - - fi + (( $j == ${aBENCH_RAM_INDEX[$i]} - 1 )) || continue + aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) + aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) done @@ -752,24 +686,13 @@ for (( j=0; j<${aBENCH_LAN_INDEX[$i]}; j++ )) do - if (( ${aBENCH_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]} )); then - - aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} - - fi - if (( ${aBENCH_NET_LAN_SPEED[$i,$j]} > ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} )); then - - aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} - - fi + (( ${aBENCH_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]} )) && aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} + (( ${aBENCH_NET_LAN_SPEED[$i,$j]} > ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} )) && aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} (( aBENCH_RESULT_NET_LAN_SPEED_AVG[$i] += ${aBENCH_NET_LAN_SPEED[$i,$j]} )) # Last item in current array. Work out averages - if (( $j == ${aBENCH_LAN_INDEX[$i]} - 1 )); then - - aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]=$(( ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} / ${aBENCH_LAN_INDEX[$i]} )) - - fi + (( $j == ${aBENCH_LAN_INDEX[$i]} - 1 )) || continue + aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]=$(( ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} / ${aBENCH_LAN_INDEX[$i]} )) done @@ -789,37 +712,18 @@ for (( j=0; j<${aBENCH_CUSTOMFS_INDEX[$i]}; j++ )) do - if (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} )); then - - aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} - - fi - if (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} )); then - - aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} - - fi + (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} (( aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i] += ${aBENCH_CUSTOMFS_WRITE[$i,$j]} )) - if (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} )); then - - aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} - - fi - if (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]} )); then - - aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} - - fi + (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} )) && aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]} )) && aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} (( aBENCH_RESULT_CUSTOMFS_READ_AVG[$i] += ${aBENCH_CUSTOMFS_READ[$i,$j]} )) # Last item in current array. Work out averages - if (( $j == ${aBENCH_CUSTOMFS_INDEX[$i]} - 1 )); then - - aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) - aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) - - fi + (( $j == ${aBENCH_CUSTOMFS_INDEX[$i]} - 1 )) || continue + aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) + aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) done @@ -851,59 +755,59 @@ Last update: $(TZ=UTC date "+%Y-%m-%d %T UTC")

- - - + + +
Total install count$SURVEY_COUNT_TOTAL
Opted in installs$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY ))
Opted out installs$SURVEY_COUNT_EMPTY
Total system count$SURVEY_COUNT_TOTAL
Systems sending survey data$SURVEY_COUNT_OPTIN$(( $SURVEY_COUNT_OPTIN * 100 / $SURVEY_COUNT_TOTAL ))%
Systems opted out DietPi-Survey$SURVEY_COUNT_EMPTY$(( $SURVEY_COUNT_EMPTY * 100 / $SURVEY_COUNT_TOTAL ))%

DietPi versions:

- $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ') + $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ')
DietPi v$i ${aDIETPI_VERSION[$i]}
DietPi v$i ${aDIETPI_VERSION[$i]}$(( ${aDIETPI_VERSION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

Git branches:

- $(for i in "${!aGIT_BRANCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aGIT_BRANCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aGIT_BRANCH[$i]}
$i ${aGIT_BRANCH[$i]}$(( ${aGIT_BRANCH[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

Devices:

- $(for i in "${!aDEVICE_NAME[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aDEVICE_NAME[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aDEVICE_NAME[$i]}
$i ${aDEVICE_NAME[$i]}$(( ${aDEVICE_NAME[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

CPU architectures:

- $(for i in "${!aCPU_ARCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aCPU_ARCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aCPU_ARCH[$i]}
$i ${aCPU_ARCH[$i]}$(( ${aCPU_ARCH[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

CPU core counts:

- $(for i in ${!aCPU_COUNT[@]}; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in ${!aCPU_COUNT[@]}; do echo ""; done | sort -nrk 2 -t ' ')
$i Core(s) ${aCPU_COUNT[$i]}
$i Core(s) ${aCPU_COUNT[$i]}$(( ${aCPU_COUNT[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

Distro versions:

- $(for i in "${!aDISTRO_VERSION[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aDISTRO_VERSION[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aDISTRO_VERSION[$i]}
$i ${aDISTRO_VERSION[$i]}$(( ${aDISTRO_VERSION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

Autostart options:

- $(for i in "${!aAUTOSTART_OPTION[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aAUTOSTART_OPTION[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aAUTOSTART_OPTION[$i]}
$i ${aAUTOSTART_OPTION[$i]}$(( ${aAUTOSTART_OPTION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

DietPi-Automation:

- +
Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) installs
Used by${aAUTO_SETUP_AUTOMATED[1]} of $SURVEY_COUNT_OPTIN systems$(( ${aAUTO_SETUP_AUTOMATED[1]} * 100 / $SURVEY_COUNT_OPTIN ))%

Network interfaces:

- $(for i in "${!aNETWORK_INTERFACE[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aNETWORK_INTERFACE[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aNETWORK_INTERFACE[$i]}
$i ${aNETWORK_INTERFACE[$i]}$(( ${aNETWORK_INTERFACE[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

Installed software titles:

- $(for i in "${!aSOFTWARE[@]}"; do echo ""; done | sort -nrk 2 -t ' ') + $(for i in "${!aSOFTWARE[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aSOFTWARE[$i]}
$i ${aSOFTWARE[$i]}$(( ${aSOFTWARE[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%

DietPi-Benchmarks | CPU:

@@ -927,7 +831,7 @@ Lowest: Highest: - $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]}${aBENCH_RESULT_CPU_MIN[$i]}${aBENCH_RESULT_CPU_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}"; done | sort -nrk 2 -t ' ')

DietPi-Benchmarks | IO (RAM):

@@ -947,7 +851,7 @@ Fastest: Slowest: - $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}"; done ) + $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]}${aBENCH_RESULT_RAM_WRITE_MAX[$i]}${aBENCH_RESULT_RAM_WRITE_MIN[$i]}${aBENCH_RESULT_RAM_READ_AVG[$i]}${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}"; done | sort -nrk 2 -t ' ')

DietPi-Benchmarks | IO (RootFS):

@@ -967,7 +871,7 @@ Fastest: Slowest: - $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} "; done ) + $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]}${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]}${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]}"; done | sort -nrk 2 -t ' ')

DietPi-Benchmarks | IO (Custom FS):

@@ -987,7 +891,7 @@ Fastest: Slowest: - $(for i in "${!aBENCH_CUSTOMFS_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_CUSTOMFS_INDEX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} "; done ) + $(for i in "${!aBENCH_CUSTOMFS_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_CUSTOMFS_INDEX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]}${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]}${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]}"; done | sort -nrk 2 -t ' ')

DietPi-Benchmarks | IO (Network LAN):

@@ -1003,7 +907,7 @@ Fastest: Slowest: - $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]}${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}"; done ) + $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]}${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]}${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}"; done | sort -nrk 2 -t ' ') From a1367a02d1c09dadbcad3e163d22d7bbe160733e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jun 2020 23:53:02 +0200 Subject: [PATCH 121/182] v6.31 + DietPi-Survey_report | Sort CPU benchmark with shortest time (fastest CPU) on top + DietPi-Survey_report | Be precise on benchmark units --- .meta/dietpi-survey_report | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index df86f5a418..22fab7d76f 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -815,8 +815,8 @@ CPU time (seconds, lower is faster): - CPU idle temp ('c): - CPU full load temp ('c): + CPU idle temp (°C): + CPU full load temp (°C): Device: @@ -831,15 +831,15 @@ Lowest: Highest: - $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]}${aBENCH_RESULT_CPU_MIN[$i]}${aBENCH_RESULT_CPU_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}"; done | sort -nrk 2 -t ' ') + $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i}${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]}${aBENCH_RESULT_CPU_MIN[$i]}${aBENCH_RESULT_CPU_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}"; done | sort -nk 2 -t ' ')

DietPi-Benchmarks | IO (RAM):

- + + @@ -858,8 +858,8 @@
- RAM write (MB/s):RAM read (MB/s):RAM write (MiB/s):RAM read (MiB/s):
Device:
- + + @@ -878,8 +878,8 @@
- RootFS write (MB/s):RootFS read (MB/s):RootFS write (MiB/s):RootFS read (MiB/s):
Device:
- + + @@ -898,7 +898,7 @@
- Custom FS write (MB/s):Custom FS read (MB/s):Custom FS write (MiB/s):Custom FS read (MiB/s):
Device:
+ From 824917b1364df336caf3e3865e442e278c79ea4b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Jun 2020 22:23:53 +0200 Subject: [PATCH 122/182] v6.31 (#3617) + General | Add support for Raspberry Pi OS (64-bit) by separating RPi detection from Raspbian detection and adding new global variable: $G_RASPBIAN + DietPi-PREP | DietPi-Globals never creates .hw_model anymore, hence skip explicit script removal + DietPi-PREP | Since RPi can run Debian and Raspbian 32 and 64 bit images and kernel can be loaded in 64-bit mode on 32-bin image, we need to check if its a Debian or Raspbian image and if the primary deb package architecture is arm64 or not (armhf) to be sure what the target image should be. Override G_HW_ARCH with intended minimal CPU arch requirement and set + pass new G_RASPBIAN variable. + DietPi-PREP | raspi-copies-and-fills is only made for armhf hence skip it on 64-bit RPi images + DietPi-PREP | On RPi with Raspberry Pi OS (64-bit), armhf architecture is currently required to pull libraspberrypi packages and a few others. Keep armhf support until all expected packages have been ported to arm64. + DietPi-PREP | Prevent potential failure on u-boot install on C4 since it is pre-installed on the image but not yet present in the repo. The intention is to leave the package installed, if it was before, to allow automated upgrade to the actual C4 u-boot image once it is pushed to the repo. + DietPi-Config | Graphics driver: Add AMD graphics driver and firmware install to menu. ToDo: The Intel driver is recommended for pre~2007 chips only, this should be either made clear or the entry should be removed. Post~2007 Intel chips are better supported by native Xorg modesetting. + DietPi-Config | Display resolution: Add new RPi4 full KMS GL driver overlay. This has been added with Linux 5.4, which is at time of writing not yet released, but we'll add it now regardless to be prepared. + DietPi-Config | Audio options: Add new RPi sound card overlays + DietPi-Config | Minor coding and wording + DietPi-Globals | G_EXEC: Add info about Raspbian vs Debian RPi image to bug report printout + DietPi-Survey | Add new G_RASPBIAN to upload file on RPi, so we can watch the development of Raspberry Pi OS (64-bit) usage, or in theory other Debian images on RPi + DietPi-Survey_report | Add RPi Raspbian vs Debian stats + DietPi-Survey_report | Make table headers links to their ID for easier selection and references + DietPi-Config | Do not store none|N/A placeholder text in variables if it is used as inputbox default but not an actual valid value, instead start with an empty inputbox then. + DietPi-Config | Fix shown boot wait for network state + DietPi-Config | Align G_CHECK_URL timeout and attempts wording and value range with dietpi.txt info and what wget+ping commands allow. --- .meta/dietpi-survey_report | 62 ++++++----- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 42 +++++-- dietpi/dietpi-config | 104 ++++++++++-------- dietpi/dietpi-software | 36 +++--- dietpi/dietpi-survey | 3 + dietpi/func/dietpi-globals | 2 +- dietpi/func/dietpi-obtain_hw_model | 15 ++- dietpi/func/dietpi-set_hardware | 17 ++- dietpi/func/dietpi-set_software | 17 ++- dietpi/patch_file | 15 +-- dietpi/pre-patch_file | 4 +- .../lib/dietpi/services/dietpi-firstboot.bash | 2 +- 13 files changed, 189 insertions(+), 131 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 22fab7d76f..171f1f23a1 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -142,13 +142,12 @@ declare -A aDISTRO_VERSION declare -A aAUTOSTART_OPTION declare -A aSOFTWARE - aAUTO_SETUP_AUTOMATED=( - [0]=0 - [1]=0 - ) + aAUTO_SETUP_AUTOMATED=(0 0) declare -A aNETWORK_INTERFACE # v6.17 addition declare -A aGIT_BRANCH + # v6.31 addition + aRASPBIAN=(0 0) # Convert autostart index to name array aAUTOSTART_NAME=() @@ -341,7 +340,7 @@ aSOFTWARE_NAME[168]=168 aSOFTWARE_NAME[169]='Google AIY' - # v6.14 (earliest version that uploads to ssh.dietpi.com) + v6.15 + # v6.14 (earliest version that can currently upload) + v6.15 aSOFTWARE_NAME6_14=() aSOFTWARE_NAME6_15=() for i in ${!aSOFTWARE_NAME[@]} @@ -740,13 +739,13 @@ background-color: black; font-family: Verdana, Arial, Helvetica, sans-serif; } - th, td { - padding: 5px; - } + th, td { padding: 5px; } table, th, td { font-size: 14px; border: 1px solid grey; } + a { color: white; } + a:hover { color: #c5ff00; } @@ -760,57 +759,62 @@
- Transfer rate (MB/s):Transfer rate (MiB/s):
Device:
Systems opted out DietPi-Survey$SURVEY_COUNT_EMPTY$(( $SURVEY_COUNT_EMPTY * 100 / $SURVEY_COUNT_TOTAL ))%
-

DietPi versions:

+

DietPi versions:

$(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ')
DietPi v$i ${aDIETPI_VERSION[$i]}$(( ${aDIETPI_VERSION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Git branches:

+

Git branches:

$(for i in "${!aGIT_BRANCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aGIT_BRANCH[$i]}$(( ${aGIT_BRANCH[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Devices:

+

Devices:

$(for i in "${!aDEVICE_NAME[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aDEVICE_NAME[$i]}$(( ${aDEVICE_NAME[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

CPU architectures:

- - $(for i in "${!aCPU_ARCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ') -
$i ${aCPU_ARCH[$i]}$(( ${aCPU_ARCH[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
+

CPU architectures:

+ + $(for i in "${!aCPU_ARCH[@]}"; do echo ""; done | sort -nrk 2 -t ' ') +
$i ${aCPU_ARCH[$i]}$(( ${aCPU_ARCH[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

CPU core counts:

- - $(for i in ${!aCPU_COUNT[@]}; do echo ""; done | sort -nrk 2 -t ' ') -
$i Core(s) ${aCPU_COUNT[$i]}$(( ${aCPU_COUNT[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
+

CPU core counts:

+ + $(for i in ${!aCPU_COUNT[@]}; do echo ""; done | sort -nrk 2 -t ' ') +
$i Core(s) ${aCPU_COUNT[$i]}$(( ${aCPU_COUNT[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Distro versions:

+

Distro versions:

$(for i in "${!aDISTRO_VERSION[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aDISTRO_VERSION[$i]}$(( ${aDISTRO_VERSION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Autostart options:

+

RPi Debian (64-bit) vs Raspbian (32-bit):

+ + +
Debian (64-bit) is used by${aRASPBIAN[0]} of $(( ${aRASPBIAN[0]} + ${aRASPBIAN[1]} )) RPi systems$(( ${aRASPBIAN[0]} * 100 / ( ${aRASPBIAN[0]} + ${aRASPBIAN[1]} ) ))%
+ +

Autostart options:

$(for i in "${!aAUTOSTART_OPTION[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aAUTOSTART_OPTION[$i]}$(( ${aAUTOSTART_OPTION[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

DietPi-Automation:

+

DietPi-Automation:

Used by${aAUTO_SETUP_AUTOMATED[1]} of $SURVEY_COUNT_OPTIN systems$(( ${aAUTO_SETUP_AUTOMATED[1]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Network interfaces:

+

Network interfaces:

$(for i in "${!aNETWORK_INTERFACE[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aNETWORK_INTERFACE[$i]}$(( ${aNETWORK_INTERFACE[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

Installed software titles:

+

Installed software titles:

$(for i in "${!aSOFTWARE[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aSOFTWARE[$i]}$(( ${aSOFTWARE[$i]} * 100 / $SURVEY_COUNT_OPTIN ))%
-

DietPi-Benchmarks | CPU:

+

DietPi-Benchmarks | CPU:

"; done | sort -nk 2 -t ' ')
@@ -834,7 +838,7 @@ $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "
${aHW_NAME[$i]:=$i}${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]}${aBENCH_RESULT_CPU_MIN[$i]}${aBENCH_RESULT_CPU_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]}${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}
-

DietPi-Benchmarks | IO (RAM):

+

DietPi-Benchmarks | IO (RAM):

"; done | sort -nrk 2 -t ' ')
@@ -854,7 +858,7 @@ $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo "
${aHW_NAME[$i]:=$i}${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]}${aBENCH_RESULT_RAM_WRITE_MAX[$i]}${aBENCH_RESULT_RAM_WRITE_MIN[$i]}${aBENCH_RESULT_RAM_READ_AVG[$i]}${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}
-

DietPi-Benchmarks | IO (RootFS):

+

DietPi-Benchmarks | IO (RootFS):

"; done | sort -nrk 2 -t ' ')
@@ -874,7 +878,7 @@ $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo "
${aHW_NAME[$i]:=$i}${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]}${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]}${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]}
-

DietPi-Benchmarks | IO (Custom FS):

+

DietPi-Benchmarks | IO (Custom FS):

"; done | sort -nrk 2 -t ' ')
@@ -894,7 +898,7 @@ $(for i in "${!aBENCH_CUSTOMFS_INDEX[@]}"; do echo "
${aHW_NAME[$i]:=$i}${aBENCH_CUSTOMFS_INDEX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]}${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]}${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]}
-

DietPi-Benchmarks | IO (Network LAN):

+

DietPi-Benchmarks | IO (Network LAN):

- - + + From 529a785d693782db2bd77448856087b6deb91e50 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 30 Jun 2020 23:37:23 +0200 Subject: [PATCH 155/182] v6.31 + DietPi-FS_partition_resize | Use "DefaultDependencies=no" instead of "=false": https://github.com/systemd/systemd/commit/c13fb257343aaeaa5508152257b5c43cdf25cb49 --- rootfs/etc/systemd/system/dietpi-fs_partition_resize.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service index af4a8dee69..cb6d065f23 100644 --- a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service +++ b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service @@ -1,7 +1,7 @@ [Unit] Description=DietPi-FS_partition_resize # Order 0 -DefaultDependencies=false +DefaultDependencies=no Wants=local-fs-pre.target After=systemd-remount-fs.service -.mount Before=var-swap.swap swap.target local-fs-pre.target From 1cada641595ec78421bef2561fdde890b1f88e2e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 1 Jul 2020 18:04:46 +0200 Subject: [PATCH 156/182] v6.31 + DietPi-LED_control | Resolve an issue where LED triggers fail to become boot persistent if the related udev rules file does not yet exist --- dietpi/dietpi-led_control | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control index ec9ccc3efe..7912f2fe34 100644 --- a/dietpi/dietpi-led_control +++ b/dietpi/dietpi-led_control @@ -45,20 +45,14 @@ aTRIGGER_CURRENT[$i]=${aTRIGGERS_AVAILABLE[$i]##*[} aTRIGGER_CURRENT[$i]=${aTRIGGER_CURRENT[$i]%%]*} aTRIGGERS_AVAILABLE[$i]=${aTRIGGERS_AVAILABLE[$i]//[][]} - if [[ -f $FP_UDEV_RULES && $(<$FP_UDEV_RULES) == *KERNEL==\"${aNAME[$i]}\"* ]]; then - - aTRIGGER_SELECTED[$i]=$(sed -n "/KERNEL==\"${aNAME[$i]}\"/{s/^.*ATTR{trigger}=\"//;s/\".*$//p;q}" $FP_UDEV_RULES) - - fi + [[ -f $FP_UDEV_RULES && $(<$FP_UDEV_RULES) == *KERNEL==\"${aNAME[$i]}\"* ]] || continue + aTRIGGER_SELECTED[$i]=$(sed -n "/KERNEL==\"${aNAME[$i]}\"/{s/^.*ATTR{trigger}=\"//;s/\".*$//p;q}" $FP_UDEV_RULES) done - if (( $i == 0 )); then - - G_DIETPI-NOTIFY 1 'No LED devices found in /sys/class/leds/. Exiting...' - TARGETMENUID=-1 # Exit - - fi + (( $i == 0 )) || return + G_DIETPI-NOTIFY 1 'No LED devices found in /sys/class/leds/. Exiting...' + TARGETMENUID=-1 # Exit } @@ -90,7 +84,7 @@ [[ ! -f $FP_UDEV_RULES ]] || G_EXEC_NOHALT=1 G_EXEC rm $FP_UDEV_RULES || return 1 aTRIGGER_SELECTED=() - G_WHIP_MSG 'All LED triggers have been reset to system defaults.\n\nThis will become active from next reboot.' + G_WHIP_MSG 'All LED triggers have been reset to system defaults.\n\nThis will take effect from the next restart.' else @@ -133,7 +127,7 @@ G_DIETPI-NOTIFY 2 "Applying trigger \e[33m$G_WHIP_RETURNED_VALUE\e[90m to LED \e[33m${aNAME[$SELECTED_LED]}" echo "$G_WHIP_RETURNED_VALUE" > "/sys/class/leds/${aNAME[$SELECTED_LED]}/trigger" || return 1 aTRIGGER_CURRENT[$SELECTED_LED]=$G_WHIP_RETURNED_VALUE - [[ -f $FP_UDEV_RULES ]] || G_EXEC_NOHALT=1 G_EXEC $FP_UDEV_RULES || return 1 + [[ -f $FP_UDEV_RULES ]] || G_EXEC_NOHALT=1 G_EXEC touch $FP_UDEV_RULES || return 1 G_CONFIG_INJECT "SUBSYSTEM==\"leds\", KERNEL==\"${aNAME[$SELECTED_LED]}\"" "SUBSYSTEM==\"leds\", KERNEL==\"${aNAME[$SELECTED_LED]}\", ACTION==\"add\", ATTR{trigger}=\"${aTRIGGER_CURRENT[$SELECTED_LED]}\"" $FP_UDEV_RULES aTRIGGER_SELECTED[$SELECTED_LED]=aTRIGGER_CURRENT[$SELECTED_LED] From aca6f8ae32e7a1f9c1bba69470b8ea21a4dd9c5d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 1 Jul 2020 18:07:03 +0200 Subject: [PATCH 157/182] v6.31 + CHANGELOG | DietPi-LED_control | Resolved an issue where LED triggers fail to become boot persistent. Many thanks to @FrostyMisa for reporting this issue: https://github.com/MichaIng/DietPi/issues/3636 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 679db1d51c..95e17f5ccb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,7 @@ Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 - DietPi-Login | Resolved an issue where the script called itself from within the error handler subshell. Generally the error handler subshell must never call dietpi-login (and related autostart programs) and dietpi-login must never call itself from an interactive subshell. Many thanks to @nosyaardvark for reporting this issue: https://github.com/MichaIng/DietPi/issues/3583#issuecomment-643583664 - DietPi-Drive_Manager | Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata. Many thanks to @sdomotica and @Joulinar for reporting this issue: https://github.com/MichaIng/DietPi/issues/3600#issuecomment-643261670 +- DietPi-LED_control | Resolved an issue where LED triggers fail to become boot persistent. Many thanks to @FrostyMisa for reporting this issue: https://github.com/MichaIng/DietPi/issues/3636 - DietPi-Config | Resolved an issue where RPi3 non-plus overclocking profiles were shown on RPi3+ models. Many thanks to @lone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7804 - DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 From c9b6d535c62c5671c5c9ac092095ad07199d0a98 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 1 Jul 2020 18:36:04 +0200 Subject: [PATCH 158/182] v6.31 + DietPi-Config | Avoid exit code "1" when exiting dietpi-config the regular way without reboot --- dietpi/dietpi-config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index bfcf123df6..cd4ba98d99 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -151,14 +151,14 @@ G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - TARGETMENUID=-1 - # Disable reboot when run from dietpi-software pgrep 'dietpi-software' &> /dev/null && REBOOT_REQUIRED=0 # Reboot required (( $REBOOT_REQUIRED )) && G_WHIP_YESNO 'A reboot is required to apply your new settings.\nWould you like to reboot now?' && reboot + TARGETMENUID=-1 + # Return to DietPi-Config main menu elif (( ! $EXITONBACK )); then @@ -4537,10 +4537,10 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s } PROXY_ENABLED=0 - PROXY_ADDRESS='' - PROXY_PORT='' - PROXY_USERNAME='' - PROXY_PASSWORD='' + PROXY_ADDRESS= + PROXY_PORT= + PROXY_USERNAME= + PROXY_PASSWORD= # So we can call this in other menus (eg: submenu of this) Load_Proxy_Vars(){ From 1a2d514caa471308d590fac8f605fc213164e43d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 1 Jul 2020 23:58:40 +0200 Subject: [PATCH 159/182] v6.31 + DietPi-Config | Fix current RPi memory split estimation for > 1024 MiB models: https://github.com/MichaIng/DietPi/issues/3636#issuecomment-652467249 --- dietpi/dietpi-config | 47 ++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index cd4ba98d99..0e3b4a3e2f 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2034,26 +2034,20 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # TARGETMENUID=6 Menu_GpumemoryOptions(){ - TARGETMENUID=1 - - # Get current and/or total (depends on board) mem split settings - local gpu_mem_current=0 - local ram_mem_current=$(free -m | mawk '/Mem:/{print $2;exit}') - - if (( $G_HW_MODEL < 10 )); then - - gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem_$G_HW_MEMORY_SIZE=/{s/^[^=]*=//p;q}" /boot/config.txt) - ram_mem_current=$((G_HW_MEMORY_SIZE-gpu_mem_current)) - - elif (( $G_HW_MODEL == 12 )); then - - gpu_mem_current=$((2048-ram_mem_current)) - - fi + TARGETMENUID=1 # Return to Display Options # RPi if (( $G_HW_MODEL < 10 )); then + # Get current memory split + # - Get override setting: gpu_mem_1024 is effective for all models with >= 1 GiB + local value=$G_HW_MEMORY_SIZE + (( $value <= 1024 )) || value=1024 + local gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem_$value=/{s/^[^=]*=//p;q}" /boot/config.txt) # override setting + [[ $gpu_mem_current ]] || gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem=/{s/^[^=]*=//p;q}" /boot/config.txt) # base setting + [[ $gpu_mem_current ]] || gpu_mem_current=64 # default value + local ram_mem_current=$((G_HW_MEMORY_SIZE-gpu_mem_current)) + # Create array for storing menu selectable options. G_WHIP_MENU_ARRAY=( @@ -2079,36 +2073,36 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR fi G_WHIP_DEFAULT_ITEM=$gpu_mem_current - if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $gpu_mem_current MB GPU | $ram_mem_current MB RAM"; then + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $gpu_mem_current MiB GPU | $ram_mem_current MiB RAM"; then + TARGETMENUID=6 # Return to this menu /boot/dietpi/func/dietpi-set_hardware gpumemsplit $G_WHIP_RETURNED_VALUE REBOOT_REQUIRED=1 - TARGETMENUID=6 # Return to this menu - fi # Odroid C2 elif (( $G_HW_MODEL == 12 )); then - # Odroid HDMI/headless extra data + # Get current memory split + local ram_mem_current=$(free -m | mawk '/Mem:/{print $2;exit}') + local gpu_mem_current=$((2048-ram_mem_current)) + + # HDMI/headless extra data local display_output_enabled=$(grep -cm1 '^[[:blank:]]*setenv nographics "0"' /boot/boot.ini) local display_output_text='On' (( $display_output_enabled )) || display_output_text='Off' G_WHIP_MENU_ARRAY=( - 'Headless' ': HDMI: Disabled | VPU: Disabled | +300MB RAM' - 'Default' ': HDMI: Enabled | VPU: Enabled | -300MB RAM' + 'Headless' ': HDMI: Disabled | VPU: Disabled | +300 MiB RAM' + 'Default' ': HDMI: Enabled | VPU: Enabled | -300 MiB RAM' ) - if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent : HDMI: [$display_output_text] | VPU: [$display_output_text]\nMemory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM\nNB: GPU/RAM figures require a reboot after a change is made."; then - - REBOOT_REQUIRED=1 + if G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent : HDMI: [$display_output_text] | VPU: [$display_output_text]\nMemory : $gpu_mem_current MiB GPU | $ram_mem_current MiB RAM\nNB: GPU/RAM figures require a reboot after a change is made."; then TARGETMENUID=6 # Return to this menu - case "$G_WHIP_RETURNED_VALUE" in 'Headless') @@ -2124,6 +2118,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR ;; esac + REBOOT_REQUIRED=1 fi From 3a0853dbe427c653d93fef51cf78fd601a632915 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 00:03:00 +0200 Subject: [PATCH 160/182] v6.31 + CHANGELOG | DietPi-Config: Resolved an issue on RPi4 2/4/8 GiB RAM models where the current GPU memory split was not obtained correctly. Many thanks to @FrostyMisa for reporting this issue: https://github.com/MichaIng/DietPi/issues/3636#issuecomment-652467249 --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 95e17f5ccb..52e19b232a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,7 +22,8 @@ Bug Fixes: - DietPi-Login | Resolved an issue where the script called itself from within the error handler subshell. Generally the error handler subshell must never call dietpi-login (and related autostart programs) and dietpi-login must never call itself from an interactive subshell. Many thanks to @nosyaardvark for reporting this issue: https://github.com/MichaIng/DietPi/issues/3583#issuecomment-643583664 - DietPi-Drive_Manager | Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata. Many thanks to @sdomotica and @Joulinar for reporting this issue: https://github.com/MichaIng/DietPi/issues/3600#issuecomment-643261670 - DietPi-LED_control | Resolved an issue where LED triggers fail to become boot persistent. Many thanks to @FrostyMisa for reporting this issue: https://github.com/MichaIng/DietPi/issues/3636 -- DietPi-Config | Resolved an issue where RPi3 non-plus overclocking profiles were shown on RPi3+ models. Many thanks to @lone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7804 +- DietPi-Config | Resolved an issue on RPi3+ models where RPi3 non-plus overclocking profiles were shown. Many thanks to @lone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7804 +- DietPi-Config | Resolved an issue on RPi4 2/4/8 GiB RAM models where the current GPU memory split was not obtained correctly. Many thanks to @FrostyMisa for reporting this issue: https://github.com/MichaIng/DietPi/issues/3636#issuecomment-652467249 - DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 From b0a1bc5fe625488828982803e4aaa62a85570e77 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 12:10:22 +0200 Subject: [PATCH 161/182] v6.31 + DietPi-FirstBoot | Update RPi overclocking value comments if NO manual changes have been done, instead of if such have been done --- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index d0be0cd649..8002a0b8b0 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -28,7 +28,7 @@ RPi_Set_Clock_Speeds(){ # If no manual overclock settings have been applied by user, apply safe overclocking values (RPi1) or update comments to show model-specific defaults: https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md - grep -qE '^[[:blank:]]*(over_voltage|(arm|core|gpu|sdram)_freq)=' /boot/config.txt || return + grep -qE '^[[:blank:]]*(over_voltage|(arm|core|gpu|sdram)_freq)=' /boot/config.txt && return # RPi Zero if [[ $G_HW_MODEL_NAME == *'Zero'* ]]; then @@ -89,7 +89,6 @@ Apply_DietPi_FirstRun_Settings(){ - #---------------------------------------------------------------- # RPi: Apply safe overclocking values or update comments to show model-specific defaults (( $G_HW_MODEL < 10 )) && RPi_Set_Clock_Speeds @@ -134,7 +133,7 @@ # Apply language (locale) local autoinstall_language=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOCALE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) grep -q "^$autoinstall_language UTF-8$" /usr/share/i18n/SUPPORTED || autoinstall_language='C.UTF-8' - if ! locale | grep -qE "(LANG|LC_ALL)=[\'\"]?$autoinstall_language[\'\"]?" || ! locale -a | grep -qiE 'C.UTF-?8'; then + if ! locale | grep -qE "(LANG|LC_ALL)=[\'\"]?$autoinstall_language[\'\"]?" || ! locale -a | grep -qiE 'C\.UTF-?8'; then G_DIETPI-NOTIFY 2 "Setting locale $autoinstall_language. Please wait..." /boot/dietpi/func/dietpi-set_software locale "$autoinstall_language" From da4c5f78654474459be63403ad5394f2388e9127 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 12:14:19 +0200 Subject: [PATCH 162/182] v6.31 + DietPi-WiFi-Monitor | Tiny --- rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh index 6896edaa62..1f35c7cd6b 100644 --- a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh +++ b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh @@ -19,7 +19,7 @@ do # Get current gateway for ping - URL_PING=$(ip r s 0.0.0.0/0 dev $ADAPTER | mawk '{print $3}') + URL_PING=$(ip r l 0/0 dev $ADAPTER | mawk '{print $3}') [[ $G_DEBUG == 1 ]] && echo "Checking connection for: $ADAPTER via ping to $URL_PING" if [[ $URL_PING ]] && ping -qI $ADAPTER -c 1 $URL_PING &> /dev/null; then From 8cd235b36be7ba3f7a664118e17c0497fa8eabab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 18:30:23 +0200 Subject: [PATCH 163/182] v6.31 (#3635) + DietPi-Software | SqueezeLite: Install new self-compiled packages based upstream v1.9.7 + DietPi-Software | SqueezeLite: Remove now obsolete systemd service hosted on GitHub. This will break pre-v6.31 installs once merged, however installing new software with outdated DietPi version is anyway not something we can reasonably support as installers require regular maintenance/update due to upstream changes anyway. + DietPi-Patch | Reinstall SqueezeLite to update to new v1.9.7 + DietPi-Patch | If we already check /boot/dietpi/.installed for a certain install flag, add related software ID conditionally to reinstalls list to avoid unnecessary "XY not installed, nothing to do..." messages. + DietPi-Software | SqueezeLite: Skip download of test media since it is only a frontend for LMS which already pulls test media on install. + DietPi-Software | Logitech Media Server: If we already show previous names in software description, add the full list of names that were used for the SqueezeBox streaming server. + DietPi-Software | Logitech Media Server: Get latest 7.9 patch version (still 7.9.2 at time of writing) + DietPi-Software | Logitech Media Server: Do not add audio steaming server user to "render" group which is for DRM graphics device access only. --- .conf/dps_36/squeezelite.service | 8 ---- CHANGELOG.txt | 1 + dietpi/dietpi-software | 75 ++++++-------------------------- dietpi/patch_file | 11 ++++- 4 files changed, 24 insertions(+), 71 deletions(-) delete mode 100644 .conf/dps_36/squeezelite.service diff --git a/.conf/dps_36/squeezelite.service b/.conf/dps_36/squeezelite.service deleted file mode 100644 index 9971e7a702..0000000000 --- a/.conf/dps_36/squeezelite.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=SqueezeLite (DietPi) - -[Service] -ExecStart=/usr/bin/squeezelite -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log - -[Install] -WantedBy=multi-user.target diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 52e19b232a..260670e79b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Sonarr/Radarr/Lidarr: The /media directory as second common mount point can now also be used as download/media directory without manually adding it to the systemd units ReadWritePaths list. Many thanks to @ricardoandren for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3561 - DietPi-Software | Samba Server: Changed default server-side file permissions from 0775 to 0664, hence files on the server are by default created without execute permissions now, which suits usual standards. Many thanks to @maartenlangeveld for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3581 - DietPi-Software | QuiteRSS: Re-added the years ago accidentally removed install code block. If you ever wondered why there was no QuiteRSS after selecting it for install, now there will be. If it is marked as installed already, run either "dietpi-software install 22" or simply "apt install quiterss" to (really) get it. +- DietPi-Software | SqueezeLite: Updated to v1.9.7 and the service runs now as own user "squeezelite". Many thanks to @volpone for doing the update request: https://github.com/MichaIng/DietPi/issues/2386 Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1dcfeb1773..cefb20e9ca 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -539,7 +539,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=35 aSOFTWARE_NAME[$software_id]='Logitech Media Server' - aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server' + aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server, SqueezeCenter, SlimServer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' @@ -550,8 +550,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='audio player for lms & squeezebox' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=37 @@ -2283,7 +2283,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Additional software required by Allo Web Interface if (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 )); then - aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite + aSOFTWARE_INSTALL_STATE[36]=1 # SqueezeLite aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync aSOFTWARE_INSTALL_STATE[65]=1 # Netdata aSOFTWARE_INSTALL_STATE[96]=1 # Samba @@ -4327,18 +4327,17 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 - # Instructions: http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 - # - Grab architecture + # Grab architecture local arch='arm' (( $G_HW_ARCH == 10 )) && arch='amd64' - # - Grab URL for the latest package (nightly) - INSTALL_URL_ADDRESS="https://www.mysqueezebox.com/update/?version=7.9.2&revision=1&geturl=1&os=deb$arch" + # Grab URL for the latest package + INSTALL_URL_ADDRESS="https://www.mysqueezebox.com/update/?version=7.9&geturl=1&os=deb$arch" G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - Install, failsafe checking this URL again + # Install, failsafe checking this URL again Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS")" fi @@ -4825,37 +4824,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - DEPS_LIST='squeezelite' - Download_Install 'https://dietpi.com/downloads/binaries/all/squeezelite-1.8_all.7z' /usr/bin - - rm /usr/bin/squeezelite - - local target_binary= - - if (( $G_HW_ARCH == 1 )); then - - target_binary='squeezelite_armv6' - - # - ARMv7 - elif (( $G_HW_ARCH == 2 )); then - - target_binary='squeezelite_armv7' - - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then - - target_binary='squeezelite_arm64' - - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then - - target_binary='squeezelite_amd64' - - fi - - ln -sf /usr/bin/"$target_binary" /usr/bin/squeezelite - chmod +x /usr/bin/squeezelite + Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/squeezelite_$G_HW_ARCH_NAME.deb" fi @@ -9044,8 +9013,6 @@ _EOF_ # Grant user access to audio devices and DietPi media files usermod -aG audio,dietpi squeezeboxserver - # - Add to new "render" group on Buster - (( $G_DISTRO > 4 )) && usermod -aG render squeezeboxserver # systemd service cat << _EOF_ > /etc/systemd/system/logitechmediaserver.service @@ -9061,7 +9028,6 @@ RestartSec=5 [Install] WantedBy=multi-user.target _EOF_ - # Grab our test media for user Download_Test_Media @@ -9942,21 +9908,6 @@ _EOF_ fi - software_id=36 # SqueezeLite - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Replace sysvinit service with systemd - [[ -f '/etc/init.d/squeezelite' ]] && rm /etc/init.d/squeezelite - update-rc.d -f squeezelite remove - [[ -f '/etc/default/squeezelite' ]] && rm /etc/default/squeezelite - dps_index=$software_id Download_Install 'squeezelite.service' /etc/systemd/system/squeezelite.service - - Download_Test_Media - - fi - software_id=99 # EmonHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -13821,14 +13772,14 @@ _EOF_ fi - software_id=36 + software_id=36 # SqueezeLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP squeezelite - - rm -Rf /usr/bin/squeezelite* - rm /etc/systemd/system/squeezelite.service + rm -Rfv /etc/systemd/system/squeezelite.service* + getent passwd squeezelite > /dev/null && userdel -rf squeezelite + getent group squeezelite > /dev/null && groupdel squeezelite fi diff --git a/dietpi/patch_file b/dietpi/patch_file index d377a47964..61531cad6c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2436,20 +2436,29 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" #------------------------------------------------------------------------------- # Reinstalls # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 + # SqueezeLite: https://github.com/MichaIng/DietPi/issues/2386#issuecomment-651982127 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # Reset QuiteRSS install state if the package has not actually been installed: https://github.com/MichaIng/DietPi/commit/49f960a7953f44e5571ff2dde68a93efca37ec03 dpkg-query -s quiterss &> /dev/null || sed -i 's/aSOFTWARE_INSTALL_STATE\[22\]=2/aSOFTWARE_INSTALL_STATE\[22\]=0/' /boot/dietpi/.installed + if grep -q '^aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed; then + + G_DIETPI-NOTIFY 2 'Preparing SqueezeLite update...' + rm -Rfv /etc/systemd/system/squeezelite.service* /usr/bin/squeezelite* /etc/default/squeezelite + echo 36 >> /var/tmp/dietpi/dietpi-update_reinstalls + + fi + if grep -q '^aSOFTWARE_INSTALL_STATE\[2\]=2' /boot/dietpi/.installed; then G_DIETPI-NOTIFY 2 'Preparing Folding@Home update...' [[ -f '/lib/systemd/system/fahclient.service' ]] && rm /lib/systemd/system/fahclient.service [[ -f '/var/log/fahclient.log' ]] && rm /var/log/fahclient.log dpkg-query -s fahclient &> /dev/null && G_AGP fahclient + echo 2 >> /var/tmp/dietpi/dietpi-update_reinstalls fi - echo 2 >> /var/tmp/dietpi/dietpi-update_reinstalls fi #------------------------------------------------------------------------------- From d2eb2267d0882c9cd29fb8ccd7697b596b461fe5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 19:33:00 +0200 Subject: [PATCH 164/182] v6.31 + DietPi-Software | Logitech Media Server: Do not add user to "audio" group. Is does not access to audio devices directly but streams audio to SqueezeBox/SqueezeLite devices. --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cefb20e9ca..9a93a84dae 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9011,8 +9011,8 @@ _EOF_ update-rc.d -f logitechmediaserver remove [[ -f '/etc/default/logitechmediaserver' ]] && rm /etc/default/logitechmediaserver - # Grant user access to audio devices and DietPi media files - usermod -aG audio,dietpi squeezeboxserver + # Grant user access to DietPi media files + usermod -aG dietpi squeezeboxserver # systemd service cat << _EOF_ > /etc/systemd/system/logitechmediaserver.service From 192a7c96f0cc44036f7e38dc59da3a4eb8572060 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 19:34:04 +0200 Subject: [PATCH 165/182] v6.31 + RC up --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 43331cdd2e..0c373aade0 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 31 -0 +1 From a17d889365080eac0228e76b73680aa0844483cb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 19:34:47 +0200 Subject: [PATCH 166/182] v6.31 + DietPi-Globals | Default RC up --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 1ce5883c03..dfe9331b3e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -70,7 +70,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=6 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=31 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From e2506c041ce4eadeca933acdc45301bc5cec94c1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 19:55:22 +0200 Subject: [PATCH 167/182] v6.31 + DietPi-Patch | Do not remove /etc/systemd/system/squeezelite.service as it may contain custom user settings, instead just add/change running it as "squeezelite" user. --- dietpi/patch_file | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 61531cad6c..724270cc67 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2445,7 +2445,8 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" if grep -q '^aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed; then G_DIETPI-NOTIFY 2 'Preparing SqueezeLite update...' - rm -Rfv /etc/systemd/system/squeezelite.service* /usr/bin/squeezelite* /etc/default/squeezelite + rm -Rfv /usr/bin/squeezelite* /etc/default/squeezelite + [[ -f '/etc/systemd/system/squeezelite.service' ]] && G_CONFIG_INJECT 'User=' 'User=squeezelite' /etc/systemd/system/squeezelite.service '\[Service\]' echo 36 >> /var/tmp/dietpi/dietpi-update_reinstalls fi From 0604027d6aaab730a3e17b0e343b9c1fb59d3258 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 20:52:03 +0200 Subject: [PATCH 168/182] v6.31 + DietPi-Software | Change test media permissions to dietpi:dietpi 664 so all download/media software in "dietpi" group can (re)move it --- dietpi/dietpi-software | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9a93a84dae..56573e21e2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2754,12 +2754,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it Download_Test_Media(){ - if [[ ! -f $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg ]]; then - - wget https://dietpi.com/downloads/audio/fourdee_tech.ogg -O $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg - #wget https://dietpi.com/downloads/audio/fourdee_space.mp3 -O $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_space.mp3 - - fi + [[ -f $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg ]] && return + wget https://dietpi.com/downloads/audio/fourdee_tech.ogg -O $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg + chown dietpi:dietpi $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg + chmod 664 $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg } From 102c6842d503fb0969ff5867d64bde7dc88f7443 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 21:56:16 +0200 Subject: [PATCH 169/182] v6.31 + CHANGELOG | Set release PR and date --- CHANGELOG.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 260670e79b..9e25ef48d4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v6.31 -(XX/06/20) +(05/06/20) Changes / Improvements / Optimisations: - RPi | Support for Raspberry Pi OS (64-bit) has been added, including any other Debian pre-image on RPi. Many thanks to @FusionPlmH for doing this request: https://github.com/MichaIng/DietPi/issues/3570 @@ -36,7 +36,7 @@ Bug Fixes: - DietPi-Software | TigerVNC: Worked around an external bug where the VNC server crashed after client logout or failed to start at all. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 - DietPi-Software | XRDP: The above TigerVNC bug affected as well XRDP connections which have been resolved in the same turn: https://github.com/MichaIng/DietPi/issues/3615#issuecomment-650559035 -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 +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/3640 Known/Outstanding Issues: - DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 From c7fd2a9b6904e2a531423311ad56ea1ddfb21034 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 00:26:56 +0200 Subject: [PATCH 170/182] v6.31 + CHANGELOG | Fix release date --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9e25ef48d4..67ca1020ec 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v6.31 -(05/06/20) +(05/07/20) Changes / Improvements / Optimisations: - RPi | Support for Raspberry Pi OS (64-bit) has been added, including any other Debian pre-image on RPi. Many thanks to @FusionPlmH for doing this request: https://github.com/MichaIng/DietPi/issues/3570 From dc832f2c148983d18efee798a1df784a30bf201d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 15:55:19 +0200 Subject: [PATCH 171/182] v6.31 + DietPi-LED_control | Tiny consistency --- dietpi/dietpi-led_control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control index 7912f2fe34..62fd5e3158 100644 --- a/dietpi/dietpi-led_control +++ b/dietpi/dietpi-led_control @@ -17,7 +17,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-LED_Control' + G_PROGRAM_NAME='DietPi-LED_control' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT From 4e173d79778e945f26c5383f9d3c539db260c004 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 15:56:23 +0200 Subject: [PATCH 172/182] v6.31 + DietPi-Launcher | Add DietPi-LED_control; Silence shellcheck about "read" without "-r" even that here we do not actually parse input --- dietpi/dietpi-launcher | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-launcher b/dietpi/dietpi-launcher index 39af184f43..0347f313c6 100644 --- a/dietpi/dietpi-launcher +++ b/dietpi/dietpi-launcher @@ -10,7 +10,7 @@ # # Info: # - Location: /boot/dietpi/dietpi-launcher - # - Whiptail menu with list of all DietPi programs etc. + # - Whiptail menu with list of most DietPi programs # #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- @@ -35,6 +35,7 @@ 'DietPi-Drive_Manager' ': Setup and control multiple external drives' 'DietPi-AutoStart' ': Choose what software runs after boot' 'DietPi-Services' ': Service and process tool control' + 'DietPi-LED_control' ': Adjust board LED triggers' 'DietPi-Cron' ': Modify the start times of cron jobs' 'DietPi-JustBoom' ': Launch EQ and MPD audio options menu' @@ -95,13 +96,13 @@ else G_DIETPI-NOTIFY 1 "The chosen program $G_WHIP_RETURNED_VALUE could not be found on your system." - read -p " - Press any key to return to $G_PROGRAM_NAME..." + read -rp " - Press any key to return to $G_PROGRAM_NAME..." return fi # + Wait for user input - [[ $? != 0 || $command == 'dietpi-cpuinfo' || $command == 'dietpi-update' || $command == 'dietpi-morsecode' ]] && read -p " + [[ $? != 0 || $command == 'dietpi-cpuinfo' || $command == 'dietpi-update' || $command == 'dietpi-morsecode' ]] && read -rp " - Press any key to return to $G_PROGRAM_NAME..." else From 3f63e4d7497fd4dcae62a530bd2b2e3425a9db81 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 16:34:30 +0200 Subject: [PATCH 173/182] v6.31 (#3644) + Coding | https://github.com/koalaman/shellcheck/wiki/SC2162: Since we do not scrape input but only hand to hold script execution via "-p", "-r" has no affect. But lets mute spellcheck. + Coding | https://github.com/koalaman/shellcheck/wiki/SC1087: Since we do not want to expand an array use square brackets for regex matching, curtly braces are not required. But lets mute spellcheck. --- dietpi/dietpi-cleaner | 2 +- dietpi/dietpi-cloudshell | 2 +- dietpi/dietpi-config | 4 ++-- dietpi/dietpi-drive_manager | 8 ++++---- dietpi/dietpi-letsencrypt | 9 ++------- dietpi/dietpi-software | 2 +- dietpi/dietpi-update | 2 +- dietpi/func/dietpi-globals | 8 ++++---- dietpi/func/dietpi-set_hardware | 4 ++-- dietpi/func/dietpi-set_software | 2 +- dietpi/misc/dietpi-justboom | 2 +- rootfs/etc/bashrc.d/dietpi.bash | 2 +- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 2 +- 13 files changed, 22 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 45d01efcbd..26d482e18f 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -342,7 +342,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners if (( $DRY_RUN )); then - read -p " + read -rp " $G_PROGRAM_NAME simulation has finished: Press any key to continue..." else diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index bd02b3600c..0c27463b91 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -1256,7 +1256,7 @@ _EOF_ clear echo -e "$C_RESET" - read -p "Use CTRL+C to exit. Press any key to launch $G_PROGRAM_NAME..." + read -rp "Use CTRL+C to exit. Press any key to launch $G_PROGRAM_NAME..." Run_Cloudshell diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 0e3b4a3e2f..bfdaf75d9d 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1988,7 +1988,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR else - read -p 'Press any key to return to DietPi-Config...' + read -rp 'Press any key to return to DietPi-Config...' fi @@ -4507,7 +4507,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s # Failsafe: Directory required for "noip2 -C" to create the config file there mkdir -p /usr/local/etc noip2 -C - read -p 'Press any key to continue...' + read -rp 'Press any key to continue...' G_EXEC systemctl restart noip2 fi diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 4a3adf9b63..b178922aeb 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -522,7 +522,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return if G_EXEC_NOHALT=1 G_EXEC umount "$target"; then - sed -i "\#[[:blank:]]$target[[:blank:]]#d" /etc/fstab # Only needed for networked drives currently... + sed -i "\#[[:blank:]]${target}[[:blank:]]#d" /etc/fstab # Only needed for networked drives currently... rmdir "$target" Init_Drives_and_Refresh @@ -1768,7 +1768,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u if mount -t cifs -o username="$samba_clientuser",password="$samba_clientpassword",iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i "//$samba_clientname/$samba_clientshare" "$samba_fp_mount_target" &>> $fp_tmp; then # Apply to fstab - sed -i "\#[[:space:]]$samba_fp_mount_target[[:space:]]#d" /etc/fstab + sed -i "\#[[:space:]]${samba_fp_mount_target}[[:space:]]#d" /etc/fstab # - NB: Convert spaces to '\040': https://github.com/MichaIng/DietPi/issues/1201#issuecomment-339720271 echo "//$samba_clientname/${samba_clientshare//[[:space:]]/\\040} $samba_fp_mount_target cifs username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,_netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab @@ -1831,7 +1831,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u if mount -vt nfs -o port=2049 "$nfs_server_ip":/ $nfs_fp_mount_target &>> $fp_tmp; then # Apply to fstab - sed -i "\#[[:space:]]$nfs_fp_mount_target[[:space:]]#d" /etc/fstab + sed -i "\#[[:space:]]${nfs_fp_mount_target}[[:space:]]#d" /etc/fstab echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs _netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target @@ -1854,7 +1854,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u if mount -vt nfs -o port=2049 "$nfs_server_ip":"$nfs_fp_server_share" $nfs_fp_mount_target &>> $fp_tmp; then # Apply to fstab - sed -i "\#[[:space:]]$nfs_fp_mount_target[[:space:]]#d" /etc/fstab + sed -i "\#[[:space:]]${nfs_fp_mount_target}[[:space:]]#d" /etc/fstab echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs _netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index a5cd16232f..189a9df441 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -342,13 +342,8 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /b #------------------------------------------------------------------------------------------------------ - if (( ! $INPUT )); then - - read -p ' -Press any key to continue... -' - - fi + (( $INPUT )) || read -rp ' +Press any key to continue...' } diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 56573e21e2..3ddb48a1d5 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16372,7 +16372,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then tty=$(readlink -f /dev/serial0); tty={tty#/dev/} if [[ $( /dev/null && read -p 'Press any key to exit DietPi-Update...' + pgrep 'lxsession' &> /dev/null && read -rp 'Press any key to exit DietPi-Update...' fi #---------------------------------------------------------------- diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index dfe9331b3e..bc8a868e3b 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1064,7 +1064,7 @@ $log_content" || break # Exit error handler menu loop on cancel exit_code=$? G_DIETPI-NOTIFY -1 $exit_code 'Alternative command execution |' # Exit retry loop if alternative command succeeded, else stay in menu loop and wait for key press to allow reviewing alternative command output - [[ $exit_code == 0 ]] && break 2 || read -p 'Press any key to return to error handler menu...' + [[ $exit_code == 0 ]] && break 2 || read -rp 'Press any key to return to error handler menu...' fi @@ -1072,7 +1072,7 @@ $log_content" || break # Exit error handler menu loop on cancel elif [[ $G_WHIP_RETURNED_VALUE ]]; then ${G_EXEC_ARRAY_ACTION[$G_WHIP_RETURNED_VALUE]} - read -p 'Press any key to return to error handler menu...' + read -rp 'Press any key to return to error handler menu...' fi @@ -1926,8 +1926,8 @@ $log_content" || break # Exit error handler menu loop on cancel # Replace password string by asterisks in output string if [[ $GCI_PASSWORD == 1 ]]; then - local password=$(sed -E "s/^.*$pattern[[:blank:]]*//" <<< "$setting_raw") - setting_raw="$(sed -E "s/(^.*$pattern[[:blank:]]*).*$/\1/" <<< "$setting_raw")${password//?/*}" + local password=$(sed -E "s/^.*${pattern}[[:blank:]]*//" <<< "$setting_raw") + setting_raw="$(sed -E "s/(^.*${pattern}[[:blank:]]*).*$/\1/" <<< "$setting_raw")${password//?/*}" unset -v password fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 2bb0f5d6e4..1a9253ae10 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1566,12 +1566,12 @@ Do you want to continue and DISABLE Bluetooth now?'; then # - RPi if (( $G_HW_MODEL < 10 )); then - sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" /boot/cmdline.txt + sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" /boot/cmdline.txt # - Odroid C1/C2/XU4 elif (( $G_HW_MODEL < 12 )); then - sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" /boot/boot.ini + sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" /boot/boot.ini elif (( $ARMBIAN )); then diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index eced8a5d11..ea81888ebe 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -424,7 +424,7 @@ _EOF_ # Remove from sudoers [[ -f /etc/sudoers.d/$INPUT_MODE_VALUE ]] && rm /etc/sudoers.d/"$INPUT_MODE_VALUE" - sed -i "/^$INPUT_MODE_VALUE[[:blank:]]/d" /etc/sudoers.d/dietpi # pre-v6.29 + sed -i "/^${INPUT_MODE_VALUE}[[:blank:]]/d" /etc/sudoers.d/dietpi # pre-v6.29 else diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index b7f9821327..662f4cd3bd 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -301,7 +301,7 @@ Please select a soundcard via 'dietpi-config' or install ALSA, or ideally an aud [[ $stream_result == 'closed' ]] && G_DIETPI-NOTIFY 1 'Detailed info is only available when audio is being played, play some music first!' G_DIETPI-NOTIFY 0 'Completed, press any key to exit...\n' - read -p 'Press any key to exit...' + read -rp 'Press any key to exit...' elif [[ $G_WHIP_RETURNED_VALUE == 'Subwoofer Mode' ]]; then diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index 5c416aec58..1e9e0a4f96 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -33,7 +33,7 @@ fi # Workaround if SSH client sets an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034 - if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then + if [[ $SSH_TTY ]] && ! toe -a | grep -q "^${TERM}[[:blank:]]"; then TERM_old=$TERM [[ $TERM == *'256'* ]] && export TERM='xterm-256color' || export TERM='xterm' diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 8002a0b8b0..ba69d9ba2a 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -133,7 +133,7 @@ # Apply language (locale) local autoinstall_language=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOCALE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) grep -q "^$autoinstall_language UTF-8$" /usr/share/i18n/SUPPORTED || autoinstall_language='C.UTF-8' - if ! locale | grep -qE "(LANG|LC_ALL)=[\'\"]?$autoinstall_language[\'\"]?" || ! locale -a | grep -qiE 'C\.UTF-?8'; then + if ! locale | grep -qE "(LANG|LC_ALL)=[\'\"]?${autoinstall_language}[\'\"]?" || ! locale -a | grep -qiE 'C\.UTF-?8'; then G_DIETPI-NOTIFY 2 "Setting locale $autoinstall_language. Please wait..." /boot/dietpi/func/dietpi-set_software locale "$autoinstall_language" From 3e1fc6fc77aacefd639bf56753e19fe65bd9e9dc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 16:37:27 +0200 Subject: [PATCH 174/182] v6.31 + DietPi-Set_hardware | https://github.com/MichaIng/DietPi/pull/3644 --- dietpi/func/dietpi-set_hardware | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 1a9253ae10..0806cbb788 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1589,12 +1589,12 @@ Do you want to continue and DISABLE Bluetooth now?'; then # - Pine A64: On ARMbian ttyS0 boot output is forced and custom console is not possible via armbianEnv.txt elif (( $G_HW_MODEL == 40 )); then - sed -i "/^[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*$/d" $FP_UENV # New style: One variable each line - sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line + sed -i "/^[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*$/d" $FP_UENV # New style: One variable each line + sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line #elif (( $G_HW_MODEL == 70 )); then - # sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" $FP_UENV + # sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV fi From 1cf3b08dae2078a235d6bf0703b75219b88583ac Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 3 Jul 2020 23:05:53 +0200 Subject: [PATCH 175/182] v6.31 + DietPi-Patch | Copy correct license file: https://github.com/MichaIng/DietPi/issues/3628#issuecomment-653676563 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2626b757eb..8dd575f445 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -652,7 +652,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC mv "DietPi-$G_GITBRANCH/dietpi.txt" /boot/ G_EXEC mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md - G_EXEC mv "DietPi-$G_GITBRANCH/LICENSE.txt" /boot/dietpi-LICENSE.txt + G_EXEC mv "DietPi-$G_GITBRANCH/LICENSE" /boot/dietpi-LICENSE.txt G_EXEC mv "DietPi-$G_GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt # Reading version string for later use From 836b04f9c89850f5df8f1763ac442b622c9b564d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 4 Jul 2020 12:20:04 +0200 Subject: [PATCH 176/182] v6.31 + DietPi-PREP | Remove all autologin configs for all TTYs: https://github.com/MichaIng/DietPi/issues/3628#issuecomment-653693758 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8dd575f445..f3561389cc 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1201,7 +1201,8 @@ _EOF_ # Below required if DietPi-PREP is executed from chroot/container, so RPi firstrun scripts are not executed [[ -f '/etc/init.d/resize2fs_once' ]] && rm -v /etc/init.d/resize2fs_once # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/resize2fs_once [[ -f '/boot/cmdline.txt' ]] && sed -i 's| init=/usr/lib/raspi-config/init_resize\.sh||' /boot/cmdline.txt # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/00-patches/07-resize-init.diff - [[ -f '/etc/systemd/system/getty@tty1.service.d/autologin.conf' ]] && rm -v /etc/systemd/system/getty@tty1.service.d/autologin.conf # https://github.com/MichaIng/DietPi/issues/3570#issuecomment-648988475 + # - Remove all autologin configs for all TTYs: https://github.com/MichaIng/DietPi/issues/3570#issuecomment-648988475, https://github.com/MichaIng/DietPi/issues/3628#issuecomment-653693758 + rm -fv /etc/systemd/system/*getty@*.service.d/*autologin*.conf # - make_nas_processes_faster cron job on ROCK64 + NanoPi + PINE A64(?) images [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && rm /etc/cron.d/make_nas_processes_faster From 657b241439e3c9e405bffe63ea36184e664f8920 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 4 Jul 2020 14:40:27 +0200 Subject: [PATCH 177/182] v6.31 + DietPi-FirstBoot | Assure that root dir / permissions 755 root:root since this can be manipulated by flash method/program/user in rare cases: https://github.com/MichaIng/DietPi/issues/3646#issuecomment-653739919 --- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index ba69d9ba2a..513cdb82e7 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -289,6 +289,11 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// + + # Failsafe: https://github.com/MichaIng/DietPi/issues/3646#issuecomment-653739919 + chown root:root / + chmod 755 / + # Apply dietpi.txt settings, device specific workarounds and reset hardware ID + SSH host keys Apply_DietPi_FirstRun_Settings From 4252fc6a93525f2f213eb946946fa6deea46fbb4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Jul 2020 15:15:55 +0200 Subject: [PATCH 178/182] v6.31 + RC up --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 0c373aade0..e72506a847 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 31 -1 +2 From 52051984b04caa89530c7b960b812e0405818f63 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Jul 2020 15:18:12 +0200 Subject: [PATCH 179/182] v6.31 + DietPi-Globals | Default RC up --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index bc8a868e3b..a0af394747 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -70,7 +70,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=6 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=31 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From 8a4f49c02af3fa638eda1e84adbbeb4fb2c4cf08 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Jul 2020 15:36:00 +0200 Subject: [PATCH 180/182] v6.31 + CHANGELOG | Minor spelling fixes --- CHANGELOG.txt | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 67ca1020ec..19024521f7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,7 +3,7 @@ v6.31 Changes / Improvements / Optimisations: - RPi | Support for Raspberry Pi OS (64-bit) has been added, including any other Debian pre-image on RPi. Many thanks to @FusionPlmH for doing this request: https://github.com/MichaIng/DietPi/issues/3570 -- Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. +- Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meveric's Odroid repository, including Kodi support. - Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange - DietPi-Login | A new setting has been added which allows to skip the interactive GPLv2 license agreement on first login. Add/set "AUTO_SETUP_ACCEPT_LICENSE=1" in (/boot/)dietpi.txt in which case we assume you read and agreed the license text at least once. Many thanks to @mrbluecoat for reporting the urgent use-case of Chromium kiosk mode autostart without keyboard attached: https://github.com/MichaIng/DietPi/issues/3326 - DietPi-Cleaner | Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 @@ -78,7 +78,7 @@ API Changes: - DietPi-Globals | The global variables G_HW_ARCH_DESCRIPTION and G_HW_MODEL_DESCRIPTION have been renamed to G_HW_ARCH_NAME and G_HW_MODEL_NAME. The new variables G_HW_UUID (DietPi-internal device UUID) and G_ROOTFS_DEV (RootFS device path) are available. On RPi additionally G_HW_REVISION, G_HW_PCB_REVISION, G_HW_MEMORY_SIZE and G_HW_MANUFACTURER are available, the revision code and its decoded information: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md - DietPi-Globals | G_RUN_CMD and G_ERROR_HANDLER have been removed and replaced with G_EXEC. Basically G_EXEC can be used the same way G_RUN_CMD was before and it is wider configurable to make manual G_ERROR_HANDLER usage obsolete where custom solution menu entries or command output parsing is required, e.g. to check for errors that do not produce exit codes. Visual change for regular DietPi users is that every error handled command can be retried, a subshell can be opened to investigate or fix the originating issue and, for experienced users, the command can be altered, e.g. if a download link has changed or an expected file has been moved manually to a new path. Further details can be found in the script: /boot/dietpi/func/dietpi-globals - DietPi-Globals | G_FILE_EXISTS has been removed, as it was used only a single time in our code and usually it needs to be checked and handled explicitly, whether it is a file, directory, symlink with or without existing target. -- DietPi-Globals | The new global funktions G_CHECK_CON and G_CHECK_DNS have been added to test general network connectivity and DNS resolver based on dietpi.txt settings. +- DietPi-Globals | The new global functions G_CHECK_CON and G_CHECK_DNS have been added to test general network connectivity and DNS resolver based on dietpi.txt settings. Changes / Improvements / Optimisations: - NanoPi M4V2 | Initial hardware identifier (ID: 58) and support for this device has been added to DietPi. Many thanks to @purist doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=6451 @@ -272,7 +272,7 @@ Bug Fixes: - DietPi-Software | Plex Media Server: Resolved an issue where DietPi-Update failed for versions prior to v6.23, due to the obsolete Plex Media Server dev2day repository being offline now. This repo is now removed via pre-patches, prior to G_AGUP being called. During regular patches PMS is reinstalled, applying the new official APT repo. Many thanks to @p-roman for reporting this issue: https://github.com/MichaIng/DietPi/issues/3038 - DietPi-Software | Pi-hole: Resolved an issue, where the blocking page was only shown, if the blocked URL contained the domain only, without any appending path: https://github.com/MichaIng/DietPi/pull/3072 - DietPi-Software | TigerVNC: Resolved an issue on Debian Buster, where the VNC connection fails immediately due to an external bug, if no read-only password has been applied via vncpasswd. Many thanks to @Trunkzeh for reporting this issue and providing the workaround: https://github.com/MichaIng/DietPi/issues/3070 -- DietPi-Software | TigerVNC: Resolved minor error messages on login and in logs: "No session for PID ...", "DE is (null); No desktop environnement set, fallback to LXDE", "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver" +- DietPi-Software | TigerVNC: Resolved minor error messages on login and in logs: "No session for PID ...", "DE is (null); No desktop environment set, fallback to LXDE", "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver" - DietPi-Software | Netdata: Resolved an issue where install failed on Stretch systems. Many thanks to @Velociraptor85 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3062 - DietPi-Software | Amiberry: Resolved an issue where install failed on Buster due to changed library package version. The SDL2 library has been recompiled for Buster with minimal dependencies, thus X11 does not need to be installed anymore. Many thanks to @TuKo1982 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3104 @@ -368,7 +368,7 @@ Jessie support: - The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 - As a result we move Jessie systems to a dedicated "jessie-support" branch. Next DietPi v6.24 will still be merged into this branch as well, but for following updates it depends on how much additional related issues we face. - We highly recommend to migrate to Stretch as fast as possible. -- Odroid C1: We have updated the image to Stretch based on ARMbian 4.18 kernel. Existing Jessie installations will be moved to the jessie-support branch: https://github.com/MichaIng/DietPi/issues/2561 +- Odroid C1: We have updated the image to Stretch based on Armbian 4.18 kernel. Existing Jessie installations will be moved to the jessie-support branch: https://github.com/MichaIng/DietPi/issues/2561 Buster support: - DietPi-Software | Resolved the last failing installs on Debian Buster systems by either fixing or disabling them: phpMyAdmin and Tomcat8 are currently not available on non-RPi Buster systems. @@ -377,7 +377,7 @@ Buster support: Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 -- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime I/O with priority 0 (highest). +- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100 MiB (from 10 MiB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime I/O with priority 0 (highest). - DietPi-Cleaner | Added a confirmation prompt, before removal of offline docs and man pages, as this may cause APT issues in some circumstances. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2751 - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 @@ -411,7 +411,7 @@ Bug Fixes: - DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168 - DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691 - DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697 -- DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 +- DietPi-Software | Amiberry: Resolved an issue where no login prompt was present when exiting Amiberry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 - DietPi-Software | Logitech Media Server: Resolved an issue where certain plugins failed due to missing "libio-socket-ssl-perl". Many thanks to @noobian and @Edward for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5824 - DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 - DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 @@ -449,7 +449,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/MichaIng/DietPi/pull/2538 - DietPi-Software | UrBackup: Now installs updated version 2.3.7. Many thanks to @DeathIsUnknown for the information: https://github.com/MichaIng/DietPi/issues/2577 - DietPi-Software | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from official docs. Deluge now runs as user "debian-deluged", logs have been moved to "/var/log/deluged/" and the init.d service with its traces are removed, which are all pre-generated by the Debian APT package. The systemd units have been adjusted according to the official Deluge documentation. These changes are applied as well to existing installs during DietPi update, the old user "deluge" and obsolete configurations are removed. Your active configurations and data are preserved, the installer has been as well enhanced to better handle existing installs and never touch existing configs. Note that access to the Deluge console has to be done as user "debian-deluged" (sudo -u debian-deluged deluge-console). A related access issue to the console has been fixed by this as well. Many thanks to @seanmikhaels for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5525 -- DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 +- DietPi-Software | Amiberry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mount point will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 @@ -518,7 +518,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | RPi: Added info to "hifiberry-dacplus" sound device overlay that it supports the AMP2 DAC. Thanks to @Lat Dior for reporting the issue and testing the solution: https://dietpi.com/phpbb/viewtopic.php?t=5396 - DietPi-Config | WiFi Hotspot: You can now toggle support for 802.11 N. Please note this is device and compatibility dependent, mileage may vary. - DietPi-Drive_Manager | Now allows to check & repair the boot file system and trigger it for root file system on next reboot: https://github.com/MichaIng/DietPi/issues/1740#issuecomment-388325204 -- DietPi-Software | AmiBerry: Updated to v2.24, thanks @midwan! Brings several bug fixes, new features and improvements over the previous version (2.19). Please check the version history for full details on the changes made: https://github.com/midwan/amiberry/wiki/Version-history +- DietPi-Software | Amiberry: Updated to v2.24, thanks @midwan! Brings several bug fixes, new features and improvements over the previous version (2.19). Please check the version history for full details on the changes made: https://github.com/midwan/amiberry/wiki/Version-history - DietPi-Software | DietPi-NordVPN: Now available for installation. Includes a GUI which allows for easy connection to a list of NordVPN servers 'dietpi-nordvpn'. If you need a NordVPN subscription, please use this link: https://go.nordvpn.net/aff_c?offer_id=15&aff_id=5305&url_id=902 - DietPi-Software | WireGuard VPN is now available for installation. Is can be easily configured as client or as server, passing either all client traffic through the tunnel, local network access only, or server access only, e.g. as well in combination with Pi-hole, to have remote ad blocking. - DietPi-Software | SickRage has been replaced by Medusa, which is now available for install: https://github.com/MichaIng/DietPi/issues/2239 @@ -810,7 +810,7 @@ General | Sparky SBC: Added driver to support RTL8812AU WiFi based chipsets: htt DietPi-Globals | G_THREAD_WAIT: Now displays errors for each thread, if they occurred. DietPi-Config | NTP mirror selection has been reworked. It allows now to add local and external non-pool.ntp.org servers and local gateway auto detection: https://github.com/MichaIng/DietPi/issues/1688 DietPi-Config | Display Options > Backlight Brightness: Now available for Intel compatible backlight devices. -DietPi-Explorer | Whiptail based, minimial/lightweight file explorer and manager now available for use! +DietPi-Explorer | Whiptail based, minimal/lightweight file explorer and manager now available for use! DietPi-Services | You can now include custom services, and, exclude DietPi controlling services known to it. Please see the following file '/DietPi/dietpi/.dietpi-services_include_exclude' for more information: https://github.com/MichaIng/DietPi/issues/1114#issuecomment-411325075 DietPi-Software | A new unified download&install function is implemented, which allows more consistent download and install of software, using /tmp RAMFS as working directory and parallel dependencies installation via G_THREAD. DietPi-Software | Koel: Installation will now skip webserver, as Koel uses PHP-CLI instead. To not mess with webserver served pages, Koel install directory is moved to "/mnt/dietpi_userdata/koel", for existing installs as well. @@ -1009,7 +1009,7 @@ DietPi-LetsEncrypt | Minor code and error handling improvements, as well increas DietPi-Process_tool | Rewrite of save file, to allow for stringed entries. The save file will be cleared during the update, to support this feature: https://github.com/MichaIng/DietPi/issues/1750 DietPi-Process_tool | Added Plex Media Server to process tool, however, transcoding will not be affected by this: https://github.com/MichaIng/DietPi/issues/1750#issuecomment-386826317 DietPi-Set_Hardware | Allo Piano firmware is now installed on demand and will be removed on update, if not chosen as sound card: https://github.com/MichaIng/DietPi/issues/1656 -DietPi-Software | AmiBerry (Amiga Emulator): Updated to v2.19, contains bug fixes and improvements: https://github.com/MichaIng/DietPi/issues/1707#issue-314377609 +DietPi-Software | Amiberry (Amiga Emulator): Updated to v2.19, contains bug fixes and improvements: https://github.com/MichaIng/DietPi/issues/1707#issue-314377609 DietPi-Software | Chromium: No longer requires a desktop and can be installed as a lightweight single use program, using dietpi-autostart to run under kiosk mode. Many thanks to @AYapejian! 720p is the default window size, please see '/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh' for full options when running under 'dietpi-autostart' mode: https://github.com/MichaIng/DietPi/issues/1737 DietPi-Software | Readymedia (MiniDLNA): Removed ALSA pre-req as it is not required. Many thanks to @bokiroki: https://github.com/MichaIng/DietPi/issues/1712 DietPi-Software | Pi-hole: Enabled support for FTLDNS: https://github.com/MichaIng/DietPi/issues/1696 @@ -1017,7 +1017,7 @@ DietPi-Software | Gitea: Updated to latest version (1.4), for new installations DietPi-Software | PHPBB3: Latest version update (3.2.2), for new installations only. DietPi-Software | Docker: Enabled for ARMv8 devices: https://github.com/MichaIng/DietPi/issues/1736 PREP | G_HW_MODEL: Added for 'OrangePi PC Plus'. Many thanks to @SuBLiNeR: https://github.com/MichaIng/DietPi/pull/1704 -PREP | Optimized rootfs re-parition and resize. This will reduced the required inital system reboot count by one. Will take affect from official v6.8 DietPi images and onwards. +PREP | Optimized rootfs re-parition and resize. This will reduced the required initial system reboot count by one. Will take affect from official v6.8 DietPi images and onwards. Bug Fixes: General | Remote SCP/Rsync fix when running under 'dietpi' user: https://github.com/MichaIng/DietPi/issues/1703 @@ -1033,7 +1033,7 @@ DietPi-LetsEncrypt | Now skips any webserver configuration edit, if CertBot exec DietPi-Software | Pi-SPC: PATH fix for sds.sh. DietPi-Software | WiringPi: Now installed to '$HOME/WiringPi', previously this would be wiringPi-HEAD-8d188fa. DietPi-Software | XRDP: Resolved an issue with blue screen running under Xorg. VNC4 is now installed by default, and the new connection method is 'Xvnc': https://github.com/MichaIng/DietPi/issues/1727#issuecomment-383858979 -DietPi-Software | AmiBerry: Fix for standard boot SDL2 keyboard leaking to background. Please note fast boot is still affected by the SDL2 keyboard leak: https://github.com/MichaIng/DietPi/issues/1707 +DietPi-Software | Amiberry: Fix for standard boot SDL2 keyboard leaking to background. Please note fast boot is still affected by the SDL2 keyboard leak: https://github.com/MichaIng/DietPi/issues/1707 Allo GUI v7: - Resolved errors with swapfile display/change. @@ -1063,9 +1063,9 @@ DietPi-Config | (RPi) Resolved an issue where Samba client would fail to mount. DietPi-Software | OpenJDK (RPi): Resolved an external bug with installation of this package via RPi repo, that would error on installation: https://github.com/MichaIng/DietPi/issues/1682 DietPi-Software | Sonarr: Resolved failed installation for ARMv8 devices: https://github.com/MichaIng/DietPi/issues/1502 DietPi-Software | Mono: Uninstalling this program, will now also uninstall the mono APT packages. -DietPi-Software | NodeRed: User is now added to the GPIO group automatically: https://github.com/MichaIng/DietPi/issues/1687 +DietPi-Software | Node-RED: User is now added to the GPIO group automatically: https://github.com/MichaIng/DietPi/issues/1687 DietPi-Software | Deluge: Resolved multiple issues where the deluge service would sometimes fail to run: https://github.com/MichaIng/DietPi/issues/1689#issuecomment-379017388 -DietPi-Software | Pi-hole: Workaround applied to prevent lighttpd install during Pi-hole script, when Apache2/Nginx is installed: https://github.com/MichaIng/DietPi/issues/1696 +DietPi-Software | Pi-hole: Workaround applied to prevent Lighttpd install during Pi-hole script, when Apache2/Nginx is installed: https://github.com/MichaIng/DietPi/issues/1696 ----------------------------------------------------------------------------------------------------------- @@ -1111,7 +1111,7 @@ DietPi-Config | Sound cards (RPi): Added option for ApplePi DAC: https://github. DietPi-Process_Tool | Added ability to add custom process entries to "/DietPi/dietpi/.dietpi-process_tool_include". Add one process each line with the format :. Check via htop, e.g. "DHCP client:dhclient" DietPi-Software | NoMachine: Installation updated to 6.0.78 (new installations only): https://github.com/MichaIng/DietPi/issues/1340#issuecomment-372845397 DietPi-Software | Squeezebox server: Updated to systemd native service: https://github.com/MichaIng/DietPi/issues/1613 -DietPi-Software | AmiBerry: Updated to 2.18. Improved audio latency, Unique new feature: WHDLoad booter! (check the wiki for details), bug fixes: https://github.com/MichaIng/DietPi/issues/1410#issuecomment-374060452 +DietPi-Software | Amiberry: Updated to 2.18. Improved audio latency, Unique new feature: WHDLoad booter! (check the wiki for details), bug fixes: https://github.com/MichaIng/DietPi/issues/1410#issuecomment-374060452 DietPi-Software | RPi: For all software titles which require unrar, unrar-nonfree is now installed via Debian package (previously unrar-free): https://github.com/MichaIng/DietPi/issues/865#issuecomment-375315827 DietPi-Software | MPD: Resolved an issue where "libwrap0" (libwrap.so.0) was missing to start MPD service: https://dietpi.com/phpbb/viewtopic.php?f=9&t=2779 DietPi-Software | MPD: Updated to 0.20.18. Compiled with UPnP support enabled: https://github.com/MichaIng/DietPi/issues/1614 @@ -1216,7 +1216,7 @@ DietPi-Config | WiFi: Now supports connecting to hidden WiFi networks, thanks @s DietPi-LetsEncrypt | On Jessie, changed certificate auto renewal to native certbot renew command, to prevent certificate duplication: https://github.com/MichaIng/DietPi/issues/734 DietPi-LetsEncrypt | On Stretch, added automated Minio certificate renewal. Rerun "dietpi-letsencrypt" on your Stretch system to gain this feature. DietPi-Process_tool | Reduction of onscreen print. Additional status print will only occur when HIERARCHY is less than 2 and/or an error occurs. -DietPi-Software | AmiBerry: Massive update to v2.14 and SDL2, new installations only. Currently for RPi's under Stretch only, however, we have plans to implement for other devices: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=64#p64 https://github.com/MichaIng/DietPi/issues/1410 +DietPi-Software | Amiberry: Massive update to v2.14 and SDL2, new installations only. Currently for RPi's under Stretch only, however, we have plans to implement for other devices: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=64#p64 https://github.com/MichaIng/DietPi/issues/1410 DietPi-Software | LMS/Squeezebox: Has undergone an install review and re-write. All archs are now supported for Stretch + Jessie: https://github.com/MichaIng/DietPi/issues/1496 DietPi-Software | Pydio: Add PHP module 'intl' on installation, as requested via web ui warning: https://github.com/MichaIng/DietPi/issues/1240 DietPi-Software | Nginx: To further reduce resource usage, by default 'nginx-light' will be installed now: https://github.com/MichaIng/DietPi/issues/1240 @@ -1251,7 +1251,7 @@ DietPi-Software | qBitTorrent: Resolved issue with failed login on Debian Jessie DietPi-Software | dietpi-software install: Command line run will now prevent disabled G_HW_ARCH G_HW_MODEL software titles, from being installed. DietPi-Software | MQTT Mosquito: Resolved issue with ARMv6 installation/binary: https://github.com/MichaIng/DietPi/issues/1306#issuecomment-366228445 DietPi-Software | Automation - custom script: Resolved an issue with banners, where Google AIY would be incorrectly reported as installing: https://github.com/MichaIng/DietPi/issues/1514 -DietPi-Software | NodeRed: resolved an issue where the nodered user lacked a home dir, required for additional module installation: https://github.com/MichaIng/DietPi/issues/1446#issuecomment-366370800 +DietPi-Software | Node-RED: resolved an issue where the nodered user lacked a home dir, required for additional module installation: https://github.com/MichaIng/DietPi/issues/1446#issuecomment-366370800 Allo Web Interface v6: Sparky SBC: Resolved an issue where USB1.1 compatibility setting would always be applied, when usb-dac selected. @@ -1276,7 +1276,7 @@ Important Information: All DietPi images have been re-created. Existing installations (v159 or lower), can no longer be updated, or supported. To continue support, users must install the latest v6.0 image. - https://github.com/MichaIng/DietPi/issues/1385 - All images are now Debian Stretch (excluding Odroid's) - - ARMbian based images are now mainline kernel 4.13+. + - Armbian based images are now mainline kernel 4.13+. - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/MichaIng/DietPi/issues/1171#issuecomment-336522021 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. @@ -1312,7 +1312,7 @@ DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and DietPi-Software | ownCloud: Switch to non-package/archive installation. This allows usage of preferred web based updater. DietPi-Software | Nextcloud: Resolved OPcache admin panel warnings now also on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/MichaIng/DietPi/issues/1335 -DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/MichaIng/DietPi/issues/1294#issuecomment-354314318 +DietPi-Software | Node-RED: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/MichaIng/DietPi/issues/1294#issuecomment-354314318 DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/MichaIng/DietPi/issues/1124 DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB: https://github.com/MichaIng/DietPi/issues/1397 DietPi-Software | Ampache: MySQL DB and configs have been updated (adds correct userdata folder for music by default): https://github.com/MichaIng/DietPi/issues/1420 From 48db4f264f4743243cbcc2b7b75c0caaebbc1498 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Jul 2020 15:40:39 +0200 Subject: [PATCH 181/182] v6.31 + README.md | Remove /DietPi/ from files list, which is not used anymore --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 53c53a0871..f0dce87957 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,6 @@ along with this program. If not, see https://www.gnu.org/licenses/ ### DietPi Files - All files located in (recursively): - - `/DietPi/` - `/var/lib/dietpi/` - `/var/tmp/dietpi/` - `/boot/dietpi/` From c5d259eb45cfb025aed3dde0053270b3d9df8c8f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Jul 2020 16:24:09 +0200 Subject: [PATCH 182/182] v6.31 + DietPi-Survey_report | Uploads untouched since 2020 have been removed to give a more current stat picture --- .meta/dietpi-survey_report | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index b0d9acbf1c..4910cfada1 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -751,7 +751,7 @@

DietPi-Survey report page

- Uploads since: 2019-01-01 00:00:00 UTC
+ Uploads since: 2020-01-01 00:00:00 UTC
Last update: $(TZ=UTC date "+%Y-%m-%d %T UTC")

diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26ee906589..f5c502cb0d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.31 (XX/06/20) Changes / Improvements / Optimisations: +- RPi | Support for Raspberry Pi OS (64-bit) has been added, including any other Debian pre-image on RPi. Many thanks to @FusionPlmH for doing this request: https://github.com/MichaIng/DietPi/issues/3570 - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange - DietPi-Cleaner | Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3492e63818..3a98c87f4a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -14,6 +14,7 @@ # - G_HW_ARCH # - G_DISTRO # - G_DISTRO_NAME + # - G_RASPBIAN # # The following environment variables can be set to automate this script (adjust example values to your needs): # - GITOWNER='MichaIng' (optional, defaults to 'MichaIng') @@ -185,8 +186,8 @@ fi - # Assure no obsolete .hw_model is loaded or generated - rm -fv /boot/dietpi/{.,func/dietpi-obtain_}hw_model + # Assure no obsolete .hw_model is loaded + rm -fv /boot/dietpi/.hw_model # Load if ! . ./dietpi-globals; then @@ -289,7 +290,7 @@ # Delete any previous existing data # - /DietPi mount point: Pre-v6.29 - umount /DietPi # Failsafe + findmnt /DietPi &> /dev/null && umount /DietPi [[ -d '/DietPi' ]] && rm -R /DietPi rm -Rfv /{boot,mnt,etc,var/lib,var/tmp,run}/*dietpi* rm -fv /etc{,/cron.*,/{bashrc,profile,sysctl,network/if-up,udev/rules}.d}/{,.}*dietpi* @@ -479,8 +480,24 @@ G_HW_MODEL=$HW_MODEL unset HW_MODEL + # RPi: Detect Debian vs Raspbian and 64 vs 32 bit image + if (( $G_HW_MODEL < 10 )); then + + if grep -q '^ID=debian' /etc/os-release; then + + G_RASPBIAN=0 + [[ $(mawk 'NR==1' /var/lib/dpkg/arch) == 'arm64' ]] && G_HW_ARCH=3 || G_HW_ARCH=2 + + else + + G_RASPBIAN=1 G_HW_ARCH=1 + + fi + + fi + G_DIETPI-NOTIFY 2 "Selected hardware model ID: $G_HW_MODEL" - G_DIETPI-NOTIFY 2 "Detected CPU architecture: $G_HW_ARCH_NAME (ID: $G_HW_ARCH)" + G_DIETPI-NOTIFY 2 "Detected target CPU architecture: $G_HW_ARCH_NAME (ID: $G_HW_ARCH)" # WiFi selection if [[ $WIFI_REQUIRED != [01] ]]; then @@ -612,7 +629,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC_DESC='Extracting DietPi sourcecode' G_EXEC tar xf package.tar.gz rm package.tar.gz - [[ -d '/boot' ]] || G_EXEC_DESC='Creating /boot' G_EXEC mkdir -p /boot + [[ -d '/boot' ]] || G_EXEC_DESC='Creating /boot' G_EXEC mkdir /boot G_DIETPI-NOTIFY 2 'Moving kernel and boot configuration to /boot' @@ -620,6 +637,8 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then if (( $G_HW_MODEL < 10 )); then G_EXEC mv "DietPi-$G_GITBRANCH/config.txt" /boot/ + # Boot in 64-bit mode if this is a 64-bit image + [[ $G_HW_ARCH == 3 ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt elif (( $G_HW_MODEL == 11 )); then @@ -661,8 +680,8 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" - # We need to forward $DISTRO_TARGET* to dietpi-set_software, as well as $G_HW_MODEL for Debian vs Raspbian decision. - G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME G_HW_MODEL=$G_HW_MODEL G_EXEC /boot/dietpi/func/dietpi-set_software apt-mirror default + # We need to forward $DISTRO_TARGET* to dietpi-set_software, as well as $G_HW_MODEL + $G_RASPBIAN for Debian vs Raspbian decision. + G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME G_HW_MODEL=$G_HW_MODEL G_RASPBIAN=$G_RASPBIAN G_EXEC /boot/dietpi/func/dietpi-set_software apt-mirror default # Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302 sed -Ei 's@https?://oph\.mdrjr\.net@http://fuzon.co.uk@' /etc/apt/sources.list.d/meveric* &> /dev/null @@ -870,12 +889,15 @@ _EOF_' # RPi elif (( $G_HW_MODEL < 10 )); then - G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills + # Add raspi-copies-and-fills for 32-bit images only + [[ $G_HW_ARCH == 3 ]] && arm_mem= || arm_mem='raspi-copies-and-fills' + G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods $arm_mem # Odroid C4 elif (( $G_HW_MODEL == 16 )); then - G_AGI linux-image-arm64-odroid-c4 meveric-keyring u-boot + G_AGI linux-image-arm64-odroid-c4 meveric-keyring + G_EXEC_NOHALT=1 G_EXEC apt-mark manual u-boot # Workaround until C4 u-boot package has been added to repo # Odroid N2 elif (( $G_HW_MODEL == 15 )); then @@ -1486,7 +1508,7 @@ _EOF_ elif (( $G_HW_ARCH == 3 )); then - G_EXEC_DESC='Removing foreign armhf DPKG architecture' G_EXEC dpkg --remove-architecture armhf + (( $G_HW_MODEL > 9 )) && G_EXEC_DESC='Removing foreign armhf DPKG architecture' G_EXEC dpkg --remove-architecture armhf fi diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index b39d1af12b..8ecf44f687 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -251,20 +251,12 @@ # - Overscan sizes if (( ! $overscan_disabled )); then - local overscan_options=( - - 'overscan_left' - 'overscan_right' - 'overscan_top' - 'overscan_bottom' - - ) - + local overscan_options=('overscan_left' 'overscan_right' 'overscan_top' 'overscan_bottom') local overscan_left=$(grep -m1 '^[[:blank:]]*overscan_left=' /boot/config.txt || vcgencmd get_config overscan_left); overscan_left=${overscan_left#*=} local overscan_right=$(grep -m1 '^[[:blank:]]*overscan_right=' /boot/config.txt || vcgencmd get_config overscan_right); overscan_right=${overscan_right#*=} local overscan_top=$(grep -m1 '^[[:blank:]]*overscan_top=' /boot/config.txt || vcgencmd get_config overscan_top); overscan_top=${overscan_top#*=} local overscan_bottom=$(grep -m1 '^[[:blank:]]*overscan_bottom=' /boot/config.txt || vcgencmd get_config overscan_bottom); overscan_bottom=${overscan_bottom#*=} - G_WHIP_MENU_ARRAY+=('15' ": Overscan Compensation [L:${overscan_left:=N/A}] [R:${overscan_right:=N/A}] [T:${overscan_top:=N/A}] [B:${overscan_bottom:=N/A}]") + G_WHIP_MENU_ARRAY+=('15' ": Overscan Compensation [L:${overscan_left:-N/A}] [R:${overscan_right:-N/A}] [T:${overscan_top:-N/A}] [B:${overscan_bottom:-N/A}]") fi @@ -272,7 +264,7 @@ if (( $G_HW_MODEL < 4 )); then local hdmi_boost_current=$(grep -m1 '^[[:blank:]]*config_hdmi_boost=' /boot/config.txt || vcgencmd get_config config_hdmi_boost); hdmi_boost_current=${hdmi_boost_current#*=} - G_WHIP_MENU_ARRAY+=('7' ": HDMI Boost : [${hdmi_boost_current:=N/A}]") + G_WHIP_MENU_ARRAY+=('7' ": HDMI Boost : [${hdmi_boost_current:-N/A}]") fi @@ -286,7 +278,7 @@ local rpi_camera_led_disabled=$(grep -cm1 '^[[:blank:]]*disable_camera_led=1' /boot/config.txt) local rpi_camera_led_text='On' (( $rpi_camera_led_disabled )) && rpi_camera_led_text='Off' - G_WHIP_MENU_ARRAY+=('9' ": RPI Camera led : [$rpi_camera_led_text]") + G_WHIP_MENU_ARRAY+=('9' ": RPi Camera LED : [$rpi_camera_led_text]") # JustBoom IR Remote local justboom_ir_remote_text='Off' @@ -301,26 +293,24 @@ # VC1 key local vc1_key_current=$(sed -n '/^[[:blank:]]*decode_WVC1=/{s/^[^=]*=//p;q}' /boot/config.txt) - G_WHIP_MENU_ARRAY+=('12' ": VC1 Key : [${vc1_key_current:=none}]") + G_WHIP_MENU_ARRAY+=('12' ": VC1 Key : [${vc1_key_current:-none}]") # MPEG2 key local mpeg2_key_current=$(sed -n '/^[[:blank:]]*decode_MPG2=/{s/^[^=]*=//p;q}' /boot/config.txt) - G_WHIP_MENU_ARRAY+=('13' ": MPEG2 Key : [${mpeg2_key_current:=none}]") - - fi + G_WHIP_MENU_ARRAY+=('13' ": MPEG2 Key : [${mpeg2_key_current:-none}]") - # Odroid Remote - if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 13 )); then + # Odroids only + elif (( $G_HW_MODEL < 13 )); then + # Remote local odroid_remote_text='Off' local odroid_remote_enabled=0 - if [[ -f /etc/systemd/system/odroid-remote.service ]]; then + if [[ -f '/etc/systemd/system/odroid-remote.service' ]]; then odroid_remote_text='On' odroid_remote_enabled=1 fi - G_WHIP_MENU_ARRAY+=('10' ": Odroid remote : [$odroid_remote_text]") fi @@ -339,7 +329,7 @@ do G_WHIP_DEFAULT_ITEM=${!i} - G_WHIP_INPUTBOX "Please enter a value (pixel count) for $i\n - EG: 16" || break + G_WHIP_INPUTBOX "Please enter a value (pixel count) for $i\n - E.g.: 16" || break G_CONFIG_INJECT "$i=" "$i=$G_WHIP_RETURNED_VALUE" /boot/config.txt REBOOT_REQUIRED=1 @@ -631,8 +621,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin MIN_VALUE=0 MAX_VALUE=255 - local fp_brightness='' - local current_brightness='' + local fp_brightness current_brightness for fp_brightness in "${afp_current_set_brightness[@]}" do @@ -720,12 +709,12 @@ A long (or insufficiently manufactured) cable may required a higher boost settin G_WHIP_MENU_ARRAY=( + 'System default' '' '1600x1200' '' '1280x1024' '' '1152x864' '' '1024x768' '' '800x600' '' - 'System default' '' ) @@ -758,7 +747,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin if dpkg-query -s nvidia-driver &> /dev/null; then nvidia_installed=1 - nvidia_text='Uninstall GPU driver' + nvidia_text='[Installed] Uninstall GPU driver' fi @@ -767,7 +756,16 @@ A long (or insufficiently manufactured) cable may required a higher boost settin if dpkg-query -s xserver-xorg-video-intel &> /dev/null; then intel_installed=1 - intel_text='Uninstall GPU driver' + intel_text='[Installed] Uninstall GPU driver' + + fi + + local amd_installed=0 + local amd_text='Install GPU driver' + if dpkg-query -s xserver-xorg-video-amdgpu &> /dev/null; then + + amd_installed=1 + amd_text='[Installed] Uninstall GPU driver' fi @@ -775,6 +773,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin 'Nvidia' ": $nvidia_text" 'Intel' ": $intel_text" + 'AMD' ": $amd_text" ) @@ -808,6 +807,19 @@ A long (or insufficiently manufactured) cable may required a higher boost settin fi + elif [[ $G_WHIP_RETURNED_VALUE == 'AMD' ]]; then + + if (( $amd_installed )); then + + G_AGP firmware-amd-graphics xserver-xorg-video-amdgpu + + else + + G_AG_CHECK_INSTALL_PREREQ firmware-amd-graphics xserver-xorg-video-amdgpu libgl1-mesa-dri + Xorg_Configure + + fi + fi fi @@ -830,8 +842,8 @@ A long (or insufficiently manufactured) cable may required a higher boost settin fi - # RPi4 doesn't support full KMS driver currently - (( $G_HW_MODEL == 4 )) && G_WHIP_MENU_ARRAY=() || G_WHIP_MENU_ARRAY=('vc4-kms-v3d' ': OpenGL | 1920 x 1080') + # RPi4 has its own full KMS overlay + (( $G_HW_MODEL == 4 )) && G_WHIP_MENU_ARRAY=('vc4-kms-v3d-pi4' ': OpenGL | 1920 x 1080') || G_WHIP_MENU_ARRAY=('vc4-kms-v3d' ': OpenGL | 1920 x 1080') G_WHIP_MENU_ARRAY+=( @@ -1502,7 +1514,7 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr if (( $rpi_max_usb_current_enabled )); then if G_WHIP_YESNO "Current setting: [$rpi_max_usb_current_text] (1.2AMP)\nWould you like to disable this setting? -\nOnce Disabled:\n - Max USB current will be limited to 0.6AMP.\n - Shared by all USB ports."; then +\nOnce disabled:\n - Max USB current will be limited to 0.6AMP.\n - Shared by all USB ports."; then G_CONFIG_INJECT 'max_usb_current=' 'max_usb_current=0' /boot/config.txt REBOOT_REQUIRED=1 @@ -1510,7 +1522,7 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr fi elif G_WHIP_YESNO "Current setting: [$rpi_max_usb_current_text] (0.6AMP)\nWould you like to enable this setting? -\nOnce Enabled:\n - Max USB current will be set to 1.2AMP.\n - Shared by all USB ports."; then +\nOnce enabled:\n - Max USB current will be set to 1.2AMP.\n - Shared by all USB ports."; then G_CONFIG_INJECT 'max_usb_current=' 'max_usb_current=1' /boot/config.txt REBOOT_REQUIRED=1 @@ -4002,16 +4014,20 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp G_WHIP_MENU_ARRAY+=('hifiberry-dacplus' ': HifiBerry DAC+ / DAC+ Pro / AMP2') G_WHIP_MENU_ARRAY+=('hifiberry-dacplusadc' ': HifiBerry DAC+ADC') G_WHIP_MENU_ARRAY+=('hifiberry-dacplusadcpro' ': HifiBerry DAC+ADC Pro') + G_WHIP_MENU_ARRAY+=('hifiberry-dacplusdsp' ': HifiBerry DAC+DSP') + G_WHIP_MENU_ARRAY+=('hifiberry-dacplushd' ': HifiBerry DAC+ HD') G_WHIP_MENU_ARRAY+=('hifiberry-digi' ': HifiBerry Digi / Digi+') G_WHIP_MENU_ARRAY+=('hifiberry-digi-pro' ': HifiBerry Digi+ Pro') G_WHIP_MENU_ARRAY+=('i-sabre-q2m' ': AudioPhonics I-Sabre ES9028Q2M / ES9038Q2M') - G_WHIP_MENU_ARRAY+=('iqaudio-dac' ': IQaudio DAC audio card') - G_WHIP_MENU_ARRAY+=('iqaudio-dacplus' ': Pi-DAC+, Pi-DACZero, Pi-DAC Pro, Pi-DigiAMP+') - G_WHIP_MENU_ARRAY+=('iqaudio-digi-wm8804-audio' ': Pi-DIGI+') + G_WHIP_MENU_ARRAY+=('iqaudio-codec' ': IQaudIO Pi-Codec HAT') + G_WHIP_MENU_ARRAY+=('iqaudio-dac' ': IQaudIO DAC audio card') + G_WHIP_MENU_ARRAY+=('iqaudio-dacplus' ': Pi-DAC+, Pi-DACZero, Pi-DAC+ Pro, Pi-DigiAMP+') + G_WHIP_MENU_ARRAY+=('iqaudio-digi-wm8804-audio' ': Pi-Digi+') G_WHIP_MENU_ARRAY+=('iqaudio-dacplus,auto_mute_amp' ': Pi-DigiAMP+') G_WHIP_MENU_ARRAY+=('iqaudio-dacplus,unmute_amp' ': Pi-DigiAMP+') G_WHIP_MENU_ARRAY+=('justboom-dac' ': JustBoom: DAC HAT, Amp HAT, DAC Zero and Amp Zero') G_WHIP_MENU_ARRAY+=('justboom-digi' ': JustBoom: Digi HAT and Digi Zero') + G_WHIP_MENU_ARRAY+=('justboom-both' ': JustBoom: Simultaneous DAC and Digi usage') G_WHIP_MENU_ARRAY+=('rpi-dac' ': Soekris DAM1021 (pcm1794a)') # - C2 @@ -4287,18 +4303,20 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp # Network boot wait local boot_wait_for_network=$(sed -n '/^[[:blank:]]*CONFIG_BOOT_WAIT_FOR_NETWORK=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local boot_wait_for_network_text='10 Seconds MAX (default)' - if (( $boot_wait_for_network == 0 )); then + if [[ $boot_wait_for_network == 0 ]]; then - boot_wait_for_network_text+='Off' + boot_wait_for_network_text='Off' - elif (( $boot_wait_for_network == 2 )); then + elif [[ $boot_wait_for_network == 2 ]]; then - boot_wait_for_network_text+='Infinite wait' + boot_wait_for_network_text='Infinite wait' fi local check_url_timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + disable_error=1 G_CHECK_VALIDINT "$check_url_timeout" 0 || check_url_timeout=10 local check_url_attempts=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + disable_error=1 G_CHECK_VALIDINT "$check_url_attempts" 1 || check_url_attempts=2 G_WHIP_MENU_ARRAY=( @@ -4323,10 +4341,10 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp 'G_CHECK_URL Timeout') - local min=5 max=60 + local min=0 max=60 G_WHIP_DEFAULT_ITEM=$check_url_timeout - if G_WHIP_INPUTBOX "This setting tells DietPi how long to wait, before G_CHECK_URL assumes a dead connection attempt (and failure).\nIncrease this value if you have a 'flaky' connection.\n -Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $min $max; then + if G_WHIP_INPUTBOX "This setting tells DietPi how long to wait, before DietPi-internal connection and URL checks assume a dead connection attempt (and failure).\nIncrease this value if you have a 'flaky' connection.\n +Please enter a value in seconds between $min and $max. \"0\" means unlimited, however this is not recommended to avoid unlimited background job hang." && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $min $max; then G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_TIMEOUT=' "CONFIG_G_CHECK_URL_TIMEOUT=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt @@ -4336,9 +4354,9 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN 'G_CHECK_URL Attempts') - local min=2 max=10 + local min=1 max=10 G_WHIP_DEFAULT_ITEM=$check_url_attempts - if G_WHIP_INPUTBOX "This setting tells DietPi how many times to check a URL, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n + if G_WHIP_INPUTBOX "This setting tells DietPi how many times to test a connection or URL, before assuming a dead connection or URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $min $max; then G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_ATTEMPTS=' "CONFIG_G_CHECK_URL_ATTEMPTS=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt @@ -4378,7 +4396,7 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN G_WHIP_MENU_ARRAY=('Custom' ': Manually enter APT mirror') # - Raspbian - if (( $G_HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then local mirror_list='https://www.raspbian.org/RaspbianMirrors/' G_WHIP_MENU_ARRAY+=('http://raspbian.raspberrypi.org/raspbian/' ': Global mirror director (default)') diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c897f0c21f..e62ad60b8a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1701,8 +1701,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - # - non-RPi Buster: https://packages.debian.org/tomcat8 - (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 && aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + # - non-Raspbian Buster: https://packages.debian.org/tomcat8 + (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 # Pi-hole #-------------------------------------------------------------------------------- @@ -2926,7 +2926,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' G_CHECK_URL "$INSTALL_URL_ADDRESS" # APT deps: upower policykit-1 are needed for LXDE logout menu item to show shutdown/restart ... @@ -2943,7 +2943,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' G_CHECK_URL "$INSTALL_URL_ADDRESS" # Buster: No leafpad available, use featherpad instead: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-489319719 @@ -2960,7 +2960,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' G_CHECK_URL "$INSTALL_URL_ADDRESS" G_AGI mate-desktop-environment-extras upower policykit-1 firefox-esr @@ -2973,7 +2973,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' G_CHECK_URL "$INSTALL_URL_ADDRESS" G_AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 firefox-esr @@ -2986,7 +2986,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' G_CHECK_URL "$INSTALL_URL_ADDRESS" G_AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme upower policykit-1 firefox-esr @@ -3196,7 +3196,7 @@ _EOF_ # Debian (+sury.org) armhf is not ARMv6 compatible: https://github.com/MichaIng/DietPi/issues/2794 if (( $G_HW_ARCH < 2 )); then - INSTALL_URL_ADDRESS='http://raspbian.raspberrypi.org/raspbian' + INSTALL_URL_ADDRESS='http://raspbian.raspberrypi.org/raspbian/' # Actually we do not support any non-RPi ARMv6 devices currently, but lets be failsafe here (( $G_HW_MODEL > 9 )) && INSTALL_URL_ADDRESS='https://deb.debian.org/debian/' @@ -3899,10 +3899,12 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing - if (( $G_HW_MODEL > 9 )); then + # Debian + if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then G_AGI opentyrian + # Raspbian: No build available: http://raspbian.raspberrypi.org/raspbian/pool/contrib/o/opentyrian/ else DEPS_LIST='ibsdl1.2debian libsdl-net1.2' @@ -4617,12 +4619,12 @@ _EOF_ # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. G_AGI $kernel_packages # apt-get install overrides hold state - # Package available on Buster backports and Bullseye: For Stretch and RPi Buster add Bullseye repo - if (( $G_DISTRO < 5 || ( $G_HW_MODEL < 10 && $G_DISTRO == 5 ) )); then + # Package available on Buster backports and Bullseye: For Stretch and Raspbian Buster add Bullseye repo + if (( $G_DISTRO < 5 || ( $G_HW_MODEL < 10 && ${G_RASPBIAN:-1} && $G_DISTRO == 5 ) )); then # Raspbian or Debian? local url='http://raspbian.raspberrypi.org/raspbian/' - (( $G_HW_MODEL > 9 )) && url='https://deb.debian.org/debian/' + (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )) && url='https://deb.debian.org/debian/' echo "deb $url bullseye main" > /etc/apt/sources.list.d/dietpi-wireguard.list @@ -6168,7 +6170,7 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" # Enable defaults, if set to "none" if [[ $soundcard == 'none' ]]; then - # - RPi: Onboard auto, Others: default + # RPi: Onboard auto, Others: default (( $G_HW_MODEL < 10 )) && soundcard='rpi-bcm2835-auto' || soundcard='default' fi @@ -6636,7 +6638,7 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" # On RPi use separate Raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 # Use Buster branch on Bullseye - if (( $G_HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then echo "deb https://download.mono-project.com/repo/debian/ raspbian${G_DISTRO_NAME/bullseye/buster} main" > /etc/apt/sources.list.d/mono-xamarin.list @@ -6658,8 +6660,8 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" Banner_Installing - # On Raspbian, only "unrar-free" is available in repos, but does not support all rar formats, thus we use "unrar" [non-free] from Debian repo - if (( $G_HW_MODEL < 10 )); then + # On Raspbian, only "unrar-free" is available in repos, but does not support all rar formats, thus we use "unrar" [non-free] from Debian repo: http://raspbian.raspberrypi.org/raspbian/pool/non-free/u/unrar-nonfree/ + if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then Download_Install "https://dietpi.com/downloads/binaries/rpi/unrar-armhf-$G_DISTRO_NAME.deb" @@ -13281,7 +13283,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if (( $G_HW_MODEL >= 10 )); then + if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then G_AGP opentyrian diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 804856b44c..4657be4403 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -72,6 +72,9 @@ ((aNETWORK_INTERFACE[$network_interface]++)) _EOF_ + # RPi: Raspbian/Raspberry Pi OS (32-bt) or Debian/Raspberry Pi OS (64-bit)? + (( $G_HW_MODEL < 10 )) && echo "((aRASPBIAN[$G_RASPBIAN]++))" >> $FP_UPLOAD + # DietPi-Software installs if [[ -f '/boot/dietpi/.installed' ]]; then diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 1f294c5a12..da7d428b2d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -976,7 +976,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then - Pre-image | $preimage_name - Hardware | $G_HW_MODEL_NAME (ID=$G_HW_MODEL) - Kernel version | $(uname -a) -- Distro | $G_DISTRO_NAME (ID=$G_DISTRO) +- Distro | $G_DISTRO_NAME (ID=$G_DISTRO${G_RASPBIAN:+,RASPBIAN=$G_RASPBIAN}) - Command | $* - Exit code | $exit_code - Software title | $G_PROGRAM_NAME diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index df73ffb965..b63b919488 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -116,6 +116,7 @@ G_HW_UUID=${G_HW_UUID:-$( $FP_G_HW_MODEL_IDENTIFIER @@ -601,7 +605,8 @@ G_ROOTFS_DEV='$G_ROOTFS_DEV' G_HW_UUID='$G_HW_UUID'" > /boot/dietpi/.hw_model # - RPi extras - (( $G_HW_MODEL < 10 )) && echo "G_HW_ONBOARD_WIFI=$G_HW_ONBOARD_WIFI + (( $G_HW_MODEL < 10 )) && echo "G_RASPBIAN=$G_RASPBIAN +G_HW_ONBOARD_WIFI=$G_HW_ONBOARD_WIFI G_HW_REVISION='$G_HW_REVISION' G_HW_PCB_REVISION=$G_HW_PCB_REVISION G_HW_MEMORY_SIZE=$G_HW_MEMORY_SIZE diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index e85129422a..2bb0f5d6e4 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -27,7 +27,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) $FP_SCRIPT headless enable/disable $FP_SCRIPT gpumemsplit 64/128/256 # RPi only $FP_SCRIPT rpi-camera enable/disable -$FP_SCRIPT rpi-opengl vc4-kms-v3d/vc4-fkms-v3d/disable +$FP_SCRIPT rpi-opengl vc4-kms-v3d/vc4-kms-v3d-pi4/vc4-fkms-v3d/disable $FP_SCRIPT rpi3_usb_boot enable $FP_SCRIPT rpi-eeprom " #//////////////////////////////////// @@ -589,7 +589,11 @@ _EOF_ # Always remove previous vc4 overlay entry sed -i '/^[[:blank:]]*dtoverlay=vc4-/d' /boot/config.txt - if [[ $INPUT_DEVICE_VALUE == 'vc4-kms-v3d' || $INPUT_DEVICE_VALUE == 'vc4-fkms-v3d' ]]; then + if [[ $INPUT_DEVICE_VALUE == 'vc4-kms-v3d' || $INPUT_DEVICE_VALUE == 'vc4-kms-v3d-pi4' || $INPUT_DEVICE_VALUE == 'vc4-fkms-v3d' ]]; then + + # Failsafe: Switch to correct full KMS overlay based on RPi model + [[ $G_HW_MODEL != 4 && $INPUT_DEVICE_VALUE == 'vc4-kms-v3d-pi4' ]] && INPUT_DEVICE_VALUE='vc4-kms-v3d' + [[ $G_HW_MODEK == 4 && $INPUT_DEVICE_VALUE == 'vc4-kms-v3d' ]] && INPUT_DEVICE_VALUE='vc4-kms-v3d-pi4' # GL packages local libegl1='libegl1' @@ -1986,13 +1990,8 @@ _EOF_ ;; # dtoverlay - # hifiberry-dac - # hifiberry-dacplus - # hifiberry-digi - # hifiberry-digi-pro - # hifiberry-amp - # JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero - # JustBoom-digi: Digi HAT and Digi Zero + # hifiberry-* + # JustBoom-[dac|digi|both] # allo-boss-dac-pcm512x-audio # allo-digione # allo-katana-dac-audio diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 70017c4846..3163f9e836 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -104,17 +104,24 @@ $FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=op if [[ $INPUT_MODE_VALUE ]]; then - # Raspbian + # RPi if (( $G_HW_MODEL < 10 )); then + # Component "ui" is in use until Stretch + local components='main' + (( $G_DISTRO < 5 )) && components+=' ui' + # Bullseye is not yet available, revert to Buster + echo "deb https://archive.raspberrypi.org/debian/ ${G_DISTRO_NAME/bullseye/buster} $components" > /etc/apt/sources.list.d/raspi.list + + fi + + # Raspbian + if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then + # Default? [[ $INPUT_MODE_VALUE == 'default' ]] && INPUT_MODE_VALUE='http://raspbian.raspberrypi.org/raspbian/' echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free" > /etc/apt/sources.list - # Component "ui" is in use until Stretch - local components='main' - (( $G_DISTRO < 5 )) && components+=' ui' - echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME $components" > /etc/apt/sources.list.d/raspi.list # Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /boot/dietpi.txt diff --git a/dietpi/patch_file b/dietpi/patch_file index 94f20beae8..e33816778d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -489,10 +489,10 @@ _EOF_' #------------------------------------------------------------------------------- # RPi APT mirror fix: https://github.com/MichaIng/DietPi/issues/1659 - if (( $G_HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then G_AGDUG - /boot/dietpi/func/dietpi-set_software apt-mirror 'http://raspbian.raspberrypi.org/raspbian' + /boot/dietpi/func/dietpi-set_software apt-mirror 'http://raspbian.raspberrypi.org/raspbian/' G_AGUP fi @@ -970,7 +970,7 @@ We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing sed -i '/^[[:blank:]]*root=/s/ipv6.disable=1[[:blank:]]//' /boot/cmdline.txt # - Odroid - elif (( $G_HW_MODEL < 15 )); then + elif (( $G_HW_MODEL < 20 )); then sed -i '/^[[:blank:]]*setenv boot/s/[[:blank:]]ipv6.disable=1//' /boot/boot.ini sed -i '/^[[:blank:]]*setenv boot/s/ipv6.disable=1[[:blank:]]//' /boot/boot.ini @@ -1306,9 +1306,6 @@ Also have a look at "Sonarr", another alternative TV show manager, available for # Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 getent passwd mopidy &> /dev/null && usermod -aG dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy #------------------------------------------------------------------------------- - # Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/MichaIng/DietPi/issues/1286#issuecomment-463856159 - (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list - #------------------------------------------------------------------------------- # Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/MichaIng/DietPi/pull/2559 G_AGI p7zip if dpkg-query -s p7zip-full &> /dev/null && @@ -1757,16 +1754,16 @@ _EOF_ fi #------------------------------------------------------------------------------- - # RPi Buster: Re-apply firmware Buster-only repo, remove Stretch branch, reinstall raspi-copies-and-fills which is now compatible + # RPi Buster: Re-apply firmware Buster-only repo, remove Stretch branch, reinstall raspi-copies-and-fills (on ARMv6/7 models) which is now compatible if (( $G_HW_MODEL < 10 && $G_DISTRO > 4 )); then echo 'deb https://archive.raspberrypi.org/debian/ buster main ui' > /etc/apt/sources.list.d/raspi.list G_AGUP - G_AGI raspi-copies-and-fills + (( $G_HW_ARCH == 3 )) || G_AGI raspi-copies-and-fills fi #------------------------------------------------------------------------------- - # Install "haveged" entropy daemon by default on all DietPi systems: https://github.com/MichaIng/DietPi/issues/2806 + # Install "haveged" entropy daemon by default on all non-RPi systems: https://github.com/MichaIng/DietPi/issues/2806 (( $G_HW_MODEL > 9 )) && G_AGI haveged #------------------------------------------------------------------------------- # RPi3: Remove doubled config.txt temp_limit value due to: https://github.com/MichaIng/DietPi/commit/cafcbc599ef23c337e75003fb8eacc446877eaba#diff-68acf994541fd7b6ea4f6b02d04ee328L60 diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 0b55c50190..7ec69af258 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -180,8 +180,8 @@ _EOF_ if [[ -f '/etc/apt/sources.list.d/dietpi-wireguard.list' ]]; then echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 14 | Switch to "bullseye" repo for WireGuard installs' - # RPi - if (( $G_HW_MODEL < 10 )); then + # Raspbian + if (( $G_HW_MODEL < 10 )) && (( ${G_RASPBIAN:=1} )); then echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list || exit 14 diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 6d95a9dc8e..c81ef8fda4 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -177,7 +177,7 @@ # Set APT mirror local target_repo='CONFIG_APT_DEBIAN_MIRROR' - (( $G_HW_MODEL < 10 )) && target_repo='CONFIG_APT_RASPBIAN_MIRROR' + (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )) && target_repo='CONFIG_APT_RASPBIAN_MIRROR' /boot/dietpi/func/dietpi-set_software apt-mirror "$(sed -n "/^[[:blank:]]*$target_repo=/{s/^[^=]*=//p;q}" /boot/dietpi.txt)" # Regenerate unique Dropbear host keys From 772936ded72278c4f322cc7a2bc847c66b2358df Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 19:52:23 +0200 Subject: [PATCH 123/182] v6.31 + CHANGELOG | Remove obsolete known issues --- CHANGELOG.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f5c502cb0d..42586853a7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,12 +32,10 @@ Known/Outstanding Issues: - DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 - RPi | On TigerVNC virtual desktop, LXAppearance hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791 - Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955 -- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584 -- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522 - DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 - DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747 -- DietPi-Software | MATE desktop: When logging in as root, desktop items and right-clock context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 -- DietPi-Software | Sonarr/Mono: With current Mono version 6, import to a file system without UNIX permissions support (exFAT, FAT32/vfat and NTFS without "permissions" option) fails, regardless of user/umask mount options: https://github.com/MichaIng/DietPi/issues/3179 +- DietPi-Software | MATE desktop: When logging in as root, desktop items and right-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 +- DietPi-Software | Sonarr/Mono: With current Mono version 6, import to a file system without UNIX permissions support (exFAT, FAT32/vfat, CIFS mounts and NTFS without "permissions" option) fails, regardless of user/umask mount options: https://github.com/MichaIng/DietPi/issues/3179 - DietPi-Software | Transmission: On Raspbian/Debian Stretch, RAM usage raises unlimited over time: https://github.com/MichaIng/DietPi/issues/2413 For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues From 3f4cc7b0e14d275fe82b7974fce78e10a22e0eb2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 20:40:25 +0200 Subject: [PATCH 124/182] v6.31 + DietPi-PREP | Remove "pi" user autologin on Raspberry Pi OS (64-bit): https://github.com/MichaIng/DietPi/issues/3570#issuecomment-648988475 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3a98c87f4a..066f4b2874 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1200,8 +1200,9 @@ _EOF_ # Below required if DietPi-PREP is executed from chroot/container, so RPi firstrun scripts are not executed [[ -f '/etc/init.d/resize2fs_once' ]] && rm -v /etc/init.d/resize2fs_once # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/resize2fs_once [[ -f '/boot/cmdline.txt' ]] && sed -i 's| init=/usr/lib/raspi-config/init_resize\.sh||' /boot/cmdline.txt # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/00-patches/07-resize-init.diff + [[ -f '/etc/systemd/system/getty@tty1.service.d/autologin.conf' ]] && rm -v /etc/systemd/system/getty@tty1.service.d/autologin.conf # https://github.com/MichaIng/DietPi/issues/3570#issuecomment-648988475 - # - make_nas_processes_faster cron job on Rock64 + NanoPi + Pine64(?) images + # - make_nas_processes_faster cron job on ROCK64 + NanoPi + PINE A64(?) images [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && rm /etc/cron.d/make_nas_processes_faster #----------------------------------------------------------------------------------- From 4924679ae6a2ce23ea24edd09f78a9897127753f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 21:42:42 +0200 Subject: [PATCH 125/182] v6.31 + DietPi-Imager | Open interactive bash subshell for image content review/changes if user chooses to + DietPi-Imager | Wrap fsck into G_EXEC error handler to allow rerun in case of found errors, wrap more commands into G_EXEC to prevent unexpected states and increased verbosity --- .meta/dietpi-imager | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index 4020d0eee4..19132ad590 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -29,7 +29,7 @@ FP_SOURCE_IMG= FP_SOURCE= FP_ROOT_DEV= - FP_MNT_TMP='/tmp/tmp_rootfs' + FP_MNT_TMP="/tmp/$G_PROGRAM_NAME_rootfs" ROOT_PARTITION_INDEX=0 OUTPUT_IMG_NAME= OUTPUT_IMG_EXT='img' @@ -204,23 +204,34 @@ Do you want to overwrite or backup the existing file to $PWD/$OUTPUT_IMG_NAME.$O fi - e2fsck -f $FP_ROOT_DEV || exit 1 + G_EXEC_OUTPUT= 1 G_EXEC e2fsck -f $FP_ROOT_DEV # Remount image for any required edits - mkdir -p $FP_MNT_TMP - if G_EXEC_NOHALT=1 G_EXEC mount $FP_ROOT_DEV $FP_MNT_TMP; then - - # Remove bash history, which is stored on shutdown, hence cannot be removed via DietPi-PREP - rm -fv $FP_MNT_TMP/{root,home/*}/.bash_history - G_WHIP_MSG "Image mounted for file editing, make changes if required: $FP_ROOT_DEV > $FP_MNT_TMP\n\nPress 'Ok' when you are finished." - sync - G_EXEC umount $FP_MNT_TMP - partprobe $FP_SOURCE # Failsafe - partx -u $FP_SOURCE # Failsafe - e2fsck -f $FP_ROOT_DEV || exit 1 # Failsafe + G_EXEC mkdir -p $FP_MNT_TMP + G_EXEC mount $FP_ROOT_DEV $FP_MNT_TMP + # - Remove bash history, which is stored on shutdown, hence cannot be removed via DietPi-PREP + rm -fv $FP_MNT_TMP/{root,home/*}/.bash_history + if G_WHIP_YESNO "Do you want to review/edit contained files? +\nAn interactive bash subshell will open. +\nPlease use the \"exit\" command when you are finished, to return to $G_PROGRAM_NAME. +\nMount is: $FP_ROOT_DEV > $FP_MNT_TMP"; then + + # Prevent dietpi-login call in subshell + local reallow_dietpi_login=1 + [[ $G_DIETPI_LOGIN ]] && reallow_dietpi_login=0 + export G_DIETPI_LOGIN=1 + G_EXEC cd $FP_MNT_TMP + bash &> /dev/tty < /dev/tty + G_EXEC cd $FP_ORIGIN + (( $reallow_dietpi_login )) && unset -v G_DIETPI_LOGIN fi - rmdir $FP_MNT_TMP + sync + G_EXEC umount $FP_MNT_TMP + G_EXEC rmdir $FP_MNT_TMP + G_EXEC partprobe $FP_SOURCE # Failsafe + G_EXEC partx -u $FP_SOURCE # Failsafe + G_EXEC_OUTPUT= 1 G_EXEC e2fsck -f $FP_ROOT_DEV || exit 1 # Failsafe # Shrink file system to minimum # - Run multiple times until no change is done any more From 4e10fbb7e118b4e33eda45f71521fd8adaa0076f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 22:11:57 +0200 Subject: [PATCH 126/182] v6.31 + DietPi-Globals | Remove G_GET_NET* functions until concept has been finished, probably postpone to next release --- dietpi/func/dietpi-globals | 51 -------------------------------------- 1 file changed, 51 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index da7d428b2d..e01c4a1872 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1107,57 +1107,6 @@ $log_content" || break # Exit error handler menu loop on cancel } - #----------------------------------------------------------------------------------- - # Network connection checks - #----------------------------------------------------------------------------------- - # Print default gateway IP for IPv4 or IPv6 requests - # - By default it will check and print the IPv4 gateway only, if present, else check and print the IPv6 gateway, else returns 1. - # - Optional arguments: - # $* = "-4": Force check and print of IPv4 default gateway only, else return 1 - # $* = "-6": Force check and print of IPv6 default gateway only, else return 1 - G_GET_NET_GATEWAY(){ - - local ip - [[ $* == '-6' ]] || ip=$(ip -4 r l 0/0 | mawk '{print $3;exit}') - [[ $ip || $* == '-4' ]] || ip=$(ip -6 r l ::/0 | mawk '{print $3;exit}') - [[ $ip ]] || return 1 - echo "$ip" - - } - - # Print default network interface name for IPv4 or IPv6 requests - # - "default" means the interface that holds the default gateway, hence which is used for www access. - # - If no default gateway exists, the first interface with state "UP" is selected instead. - # - If no interface with state "UP" exists, the first interface with an assigned IP is selected instead. - # - If no interface with an assigned IP exists, the first available interface is selected. - # - If no interface exists, the funtion returns 1 - # - Optional arguments: - # "-4": Force check and print of interfaces with IPv4 address only, else return 1 - # "-6": Force check and print of interfaces with IPv6 address only, else return 1 - # "eth": Force check and print of Ethernet interfaces only, else return 1 - # "wlan": Force check and print of WiFi interfaces only, else return 1 - G_GET_NET_IFACE(){ - - : # WIP - - } - - # Print default network interface IP for IPv4 or IPv6 requests - # - "default" means the interface that holds the default gateway, hence which is used for www access. - # - If no default gateway exists, the first interface with state "UP" is selected instead. - # - If no interface with state "UP" exists, the first interface with an assigned IP is selected instead. - # - If no interface with an assigned IP exists, the funtion returns 1 - # - Optional arguments: - # "-4": Force check and print of interfaces with IPv4 address only, else return 1 - # "-6": Force check and print of interfaces with IPv6 address only, else return 1 - # "eth": Force check and print of Ethernet interfaces only, else return 1 - # "wlan": Force check and print of WiFi interfaces only, else return 1 - G_GET_NET_IP(){ - - : # WIP - - } - # General network connection check # - Checks general network connectivity by pinging a raw IP that must be publicly reachable at all time. # - Uses the given input argument as IP to test against, else CONFIG_CHECK_CONNECTION_IP from dietpi.txt, else defaults to 9.9.9.9 (Quad9 DNS IP). From 66f937ab3e4e2edba74918bd8107162c36078de0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 22:12:58 +0200 Subject: [PATCH 127/182] v6.31 + DietPi-Set_software | NTP mirror: Fix gateway detection --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 3163f9e836..eced8a5d11 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -274,7 +274,7 @@ _EOF_ if [[ ${ntp_mirror,,} == 'gateway' ]]; then # NB: Convert output to single line via ORS, remove trailing space afterwards - local gateway=$(ip r s 0.0.0.0/0 | mawk '{print $3}' ORS=' ') gateway=${gateway% } + local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' '); gateway=${gateway% } if [[ $gateway ]]; then G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)." From dd45e90b70bf723630f831c8e82e52097a9ee343 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jun 2020 22:19:23 +0200 Subject: [PATCH 128/182] v6.31 + DietPi-Boot | Tiny --- dietpi/boot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/boot b/dietpi/boot index e84a9dd00e..8e6a5c9c72 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -34,7 +34,7 @@ G_DIETPI-NOTIFY 2 "$(date) | Waiting for valid network connection before continuing boot | Mode=$mode" - if ip r s 0.0.0.0/0 &> /dev/null; then + if ip r l 0/0 &> /dev/null; then G_DIETPI-NOTIFY 0 "$(date) | Valid network connection found" return 0 From a1033d3f2aa15a72d9ff2f839992d3031f91b9c1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 16:15:50 +0200 Subject: [PATCH 129/182] v6.31 + DietPi-PREP | Ship full GPLv2 license text, being good practise --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 066f4b2874..2626b757eb 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -652,6 +652,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC mv "DietPi-$G_GITBRANCH/dietpi.txt" /boot/ G_EXEC mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md + G_EXEC mv "DietPi-$G_GITBRANCH/LICENSE.txt" /boot/dietpi-LICENSE.txt G_EXEC mv "DietPi-$G_GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt # Reading version string for later use @@ -1775,7 +1776,7 @@ $IMAGE_CREATOR $PREIMAGE_INFO _EOF_ - G_DIETPI-NOTIFY 2 'Generating GPL license readme' + G_DIETPI-NOTIFY 2 'Generating GPLv2 license readme' cat << _EOF_ > /var/lib/dietpi/license.txt ----------------------- DietPi - GPLv2 License: From 1a3dcac35379b91bddbb760ecc02010db177d118 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 16:20:50 +0200 Subject: [PATCH 130/182] v6.31 + dietpi.txt | Allow to skip the interactive license dialog via new setting AUTO_SETUP_ACCEPT_LICENSE=1. This resolves an issue where firstrun setup is done non-interactively (AUTO_SETUP_AUTOMATED=1) and a non-input autostart options is chosen, e.g. Chromium kiosk mode with no keyboard attached: https://github.com/MichaIng/DietPi/issues/3326 --- dietpi.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 45877fa03f..919435409b 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -6,6 +6,10 @@ # D I E T - P I # DietPi-Automation settings, applied on first boot of DietPi only, ONCE! #------------------------------------------------------------------------------------------------------ +# By setting this to "1" you accept the DietPi GPLv2 license and skip the related interactive dialog. +# - Full license text: /boot/dietpi-LICENSE.txt +AUTO_SETUP_ACCEPT_LICENSE=0 + ##### Language/Regional Options ##### # Locale: eg: "en_GB.UTF-8" / "de_DE.UTF-8" | One entry and UTF-8 ONLY! AUTO_SETUP_LOCALE=C.UTF-8 @@ -49,7 +53,7 @@ AUTO_SETUP_SWAPFILE_LOCATION=/var/swap # Disable HDMI output (and GPU/VPU where supported) for supported devices: RPi, Odroid C1, Odroid C2 AUTO_SETUP_HEADLESS=0 -# Unmask (enable) systemd-logind service, which is masked by default on DietPi +# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi AUTO_UNMASK_LOGIND=0 # Custom Script (pre-networking and pre-DietPi install) From adf1409c5a6a2f0584e3412a5bfaff76881be334 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 16:33:35 +0200 Subject: [PATCH 131/182] v6.31 + DietPi-Login | Skip interactive license dialog if it has been accepted via new dietpi.txt setting: AUTO_SETUP_ACCEPT_LICENSE=1 --- dietpi/dietpi-login | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 5457157449..9e71a57c1d 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,12 +21,9 @@ Show_License(){ - if [[ -f '/var/lib/dietpi/license.txt' ]] && (( $G_INTERACTIVE )); then - - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt - - fi + (( $G_INTERACTIVE )) && [[ -f '/var/lib/dietpi/license.txt' ]] || return + grep -q '^[[:blank:]]*AUTO_SETUP_ACCEPT_LICENSE=1' /boot/dietpi.txt || G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt } From dfbc502b415a754d6870ec226531ed96b5353b21 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 16:41:29 +0200 Subject: [PATCH 132/182] v6.31 + dietpi.txt | Clarify AUTO_SETUP_HEADLESS setting --- dietpi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 919435409b..71e0428c64 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -50,7 +50,7 @@ AUTO_SETUP_SWAPFILE_SIZE=1 # Swapfile location AUTO_SETUP_SWAPFILE_LOCATION=/var/swap -# Disable HDMI output (and GPU/VPU where supported) for supported devices: RPi, Odroid C1, Odroid C2 +# Set to "1" to disable HDMI output (and GPU/VPU where supported) for supported devices: RPi, Odroid C1, Odroid C2 AUTO_SETUP_HEADLESS=0 # Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi From 3d3dcfddd05709ff7a888de17ca52e4685488163 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 16:45:32 +0200 Subject: [PATCH 133/182] v6.31 + CHANGELOG | DietPi-Login | A new setting has been added which allows to skip the interactive GPLv2 license agreement on first login. Add/set "AUTO_SETUP_ACCEPT_LICENSE=1" in (/boot/)dietpi.txt in which case we assume you read and agreed the license text at least once. Many thanks to @mrbluecoat for reporting the urgent use-case of Chromium kiosk mode autostart without keyboard attached: https://github.com/MichaIng/DietPi/issues/3326 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 42586853a7..6e5d698152 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes / Improvements / Optimisations: - RPi | Support for Raspberry Pi OS (64-bit) has been added, including any other Debian pre-image on RPi. Many thanks to @FusionPlmH for doing this request: https://github.com/MichaIng/DietPi/issues/3570 - Odroid C4 | Support for this new Hardkernel SBC has been added to allow image creation based on Meverics Odroid repository, including Kodi support. - Network | "ping" can now be used by all users without any file capabilities, sudo or setuid. For this we allow all users to create native ICMP sockets which are available since Linux 3.X but disabled by default on Debian. Other distributions and systemd (upstream) have this enabled by default and for security and usability reasons we follow them: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange +- DietPi-Login | A new setting has been added which allows to skip the interactive GPLv2 license agreement on first login. Add/set "AUTO_SETUP_ACCEPT_LICENSE=1" in (/boot/)dietpi.txt in which case we assume you read and agreed the license text at least once. Many thanks to @mrbluecoat for reporting the urgent use-case of Chromium kiosk mode autostart without keyboard attached: https://github.com/MichaIng/DietPi/issues/3326 - DietPi-Cleaner | Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 - DietPi-Drive_Manager | SSHFS entries in fstab are now detected and preserved. Many thanks to @notwork for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7781 - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. From 49f960a7953f44e5571ff2dde68a93efca37ec03 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 21:06:41 +0200 Subject: [PATCH 134/182] v6.31 + DietPi-Software | TigerVNC: Workaround external bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499 + DietPi-Software | TigerVNC: Missing netbase dependency has been resolved since Bullseye + DietPi-Software | VNC Server: Check for RealVNC/TigerVNC binaries explicitly, else exit with error + DietPi-Software | XRDP: Do not apply backports rules on Raspbian + DietPi-Software | QuiteRSS: Re-add install code, which was (accidentally?) removed/left commented with DietPi v127 commit: https://github.com/MichaIng/DietPi/commit/7cb41f3a72cdaa370b12c65f0d3e916ddacc91de --- dietpi/dietpi-software | 108 +++++++++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 41 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e62ad60b8a..81000ebc86 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -412,8 +412,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='TigerVNC Server' aSOFTWARE_DESC[$software_id]='desktop for remote connection' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' #------------------ @@ -421,8 +421,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='XRDP' aSOFTWARE_DESC[$software_id]='remote desktop protocol (rdp) server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' #------------------ @@ -2117,8 +2117,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='QuiteRSS' aSOFTWARE_DESC[$software_id]='cross-platform, free rss reader' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2075#p2075' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #-------------------------------------------------------------------------------- @@ -2993,6 +2994,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + software_id=22 # QuiteRSS + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + G_AGI quiterss + + fi + software_id=174 # GIMP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -3014,7 +3023,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing # On Stretch, use backports, which resolves missing /etc/profile (e.g. $PATH) load and failing install+service if IPv6 is disabled: https://github.com/MichaIng/DietPi/issues/3017 - (( $G_DISTRO == 4 )) && cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp + (( $G_DISTRO == 4 )) && [[ $G_RASPBIAN != 1 ]] && cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp Package: xrdp Pin: release n=stretch-backports Pin-Priority: 500 @@ -4373,9 +4382,11 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing # TigerVNC allows connecting to a virtual desktop # X11VNC allows connecting to a real desktop session, thus shared desktop sessions as well - # netbase is required to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver" + # netbase is required until Bullseye to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver" # - It is a recommendation and no dependency of perl, but expected by some packages depending on perl only: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939055 - G_AGI tigervnc-standalone-server tigervnc-common x11vnc netbase + local netbase= + (( $G_DISTRO < 6 )) && netbase='netbase' + G_AGI tigervnc-standalone-server tigervnc-common x11vnc $netbase fi @@ -9124,64 +9135,79 @@ _EOF_ systemctl daemon-reload systemctl enable vncserver + # Workaround external bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499 + local ld_preload= + # - Be failsafe on Raspbian (armhf!) if 64-bit kernel mode has been enabled. + if (( $G_HW_ARCH < 3 )) || [[ $G_RASPBIAN == 1 ]]; then + + ld_preload='LD_PRELOAD=/lib/arm-linux-gnueabihf/libgcc_s.so.1 ' + + elif (( $G_HW_ARCH == 3 )); then + + ld_preload='LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 ' + + fi + cat << _EOF_ > /usr/local/bin/vncserver #!/bin/bash -# Check shared mode +# Shared or virtual desktop? SHARED_MODE=\$(grep -cm1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /boot/dietpi.txt) -# RealVNC | Slightly different launch method to TigerVNC -REALVNC=0 -if dpkg-query -s realvnc-vnc-server &> /dev/null; then +# RealVNC or TigerVNC? +if [[ -f '/usr/bin/vncserver-virtual' ]]; then REALVNC=1 + FP_BINARY='/usr/bin/vncserver-virtual' # Set shared desktop mode if autostart is enabled for desktops. This prevents another VNC server being launched on :1. [[ -f '/boot/dietpi/.dietpi-autostart_index' && \$( /dev/null + \$FP_BINARY -kill :\${DISPLAY:-1} &> /dev/null killall -qw x11vnc Xtigervnc ;; @@ -9191,7 +9217,7 @@ exit 0 _EOF_ chmod +x /usr/local/bin/vncserver - # + RealVNC | enable services + # RealVNC: Enable services if (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then systemctl enable vncserver-x11-serviced @@ -9199,7 +9225,7 @@ _EOF_ fi - # - Stretch + TigerVNC: Disable Localhost only by default + # Stretch + TigerVNC: Disable Localhost only by default [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf local cmd_launch_desktop= @@ -12399,7 +12425,7 @@ _EOF_ fi - software_id=22 + software_id=22 # QuiteRSS if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -12415,7 +12441,7 @@ _EOF_ fi - software_id=29 + software_id=29 # XRDP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling From bc21cfb218dfe84b00e9ddbf73ab6977d9c9fa2a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 21:22:16 +0200 Subject: [PATCH 135/182] v6.31 + CHANGELOG | QuiteRSS: Re-added the years ago accidentally removed install code block. If you ever wondered why there was no QuiteRSS after selecting it for install, now there will be. If it is marked as installed already, run either "dietpi-software install 22" or simply "apt install quiterss" to (really) get it. + CHANGELOG | TigerVNC: Worked around an external bug where the VNC server crashes after client logout. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6e5d698152..578ca60926 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Changes / Improvements / Optimisations: This update is applied to all systems with DietPi v6.31, existing config and data are preserved. - DietPi-Software | Sonarr/Radarr/Lidarr: The /media directory as second common mount point can now also be used as download/media directory without manually adding it to the systemd units ReadWritePaths list. Many thanks to @ricardoandren for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3561 - DietPi-Software | Samba Server: Changed default server-side file permissions from 0775 to 0664, hence files on the server are by default created without execute permissions now, which suits usual standards. Many thanks to @maartenlangeveld for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3581 +- DietPi-Software | QuiteRSS: Re-added the years ago accidentally removed install code block. If you ever wondered why there was no QuiteRSS after selecting it for install, now there will be. If it is marked as installed already, run either "dietpi-software install 22" or simply "apt install quiterss" to (really) get it. Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 @@ -26,6 +27,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 - DietPi-Software | Ubooquity: Updated the installer to pull the latest version from Vae Mendis Software directly and enhanced permissions to better integrate with other software. Many thanks to @Mr.Roboto for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=12&t=7786 - DietPi-Software | Node.js: Resolved an issue where Node failed to start due to missing new libatmoic1 dependency. Many thanks to @larsno for reporting this issue: https://github.com/MichaIng/DietPi/issues/3614 +- DietPi-Software | TigerVNC: Worked around an external bug where the VNC server crashes after client logout. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 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 From 59b2ccf0b54336c5f4d93c98c1a9349f8b4f4f92 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 22:38:11 +0200 Subject: [PATCH 136/182] v6.31 + DietPi-Patch | Avoid setcap error message by attempting capability removal only if any are present + DietPi-Patch | Reset QuiteRSS install state if the package has not actually been installed: https://github.com/MichaIng/DietPi/commit/49f960a7953f44e5571ff2dde68a93efca37ec03 + DietPi-Patch | Fix obsolete FAHClient service removal --- dietpi/patch_file | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index e33816778d..33b2468859 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2425,11 +2425,12 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" [[ -d '/media' ]] || G_EXEC mkdir /media #------------------------------------------------------------------------------- # All users are permitted to "ping" now without any further capabilities, hence remove them for security reasons: https://github.com/MichaIng/DietPi/commit/caec92e92e136a2f731f6d4c45db8463896fc80a - if command -v ping &> /dev/null; then + local fp_ping=$(readlink -e $(command -v ping)) + if [[ $fp_ping ]]; then sysctl -p /etc/sysctl.d/dietpi.conf - setcap -r $(command -v ping) - chmod a-s $(command -v ping) + getcap $fp_ping &> /dev/null && setcap -r $fp_ping + chmod a-s $fp_ping fi #------------------------------------------------------------------------------- @@ -2437,12 +2438,15 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + # Reset QuiteRSS install state if the package has not actually been installed: https://github.com/MichaIng/DietPi/commit/49f960a7953f44e5571ff2dde68a93efca37ec03 + dpkg-query -s quiterss &> /dev/null || sed -i 's/aSOFTWARE_INSTALL_STATE\[22\]=2/aSOFTWARE_INSTALL_STATE\[22\]=0/' /boot/dietpi/.installed + if grep -q '^aSOFTWARE_INSTALL_STATE\[2\]=2' /boot/dietpi/.installed; then G_DIETPI-NOTIFY 2 'Preparing Folding@Home update...' - [[ -f '/lib/systemd/system/fahclient.service' ]] && rm /etc/systemd/system/fahclient.service + [[ -f '/lib/systemd/system/fahclient.service' ]] && rm /lib/systemd/system/fahclient.service [[ -f '/var/log/fahclient.log' ]] && rm /var/log/fahclient.log - dpkg-query -s 'fahclient' &> /dev/null && G_AGP fahclient + dpkg-query -s fahclient &> /dev/null && G_AGP fahclient fi echo 2 >> /var/tmp/dietpi/dietpi-update_reinstalls From 938e537964bd30a2af8bf007a307b3e0d1820af1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 22:53:28 +0200 Subject: [PATCH 137/182] v6.31 + DietPi-Software | Tiny --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 81000ebc86..e501ef4c55 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9173,7 +9173,7 @@ else exit 1 fi - + case "\$1" in start) From 22d929bfea865e23076ec69f211efbc26d71729b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jun 2020 23:31:35 +0200 Subject: [PATCH 138/182] v6.31 + DietPi-Patch | getcap always returns true, so we need to check for output instead --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 33b2468859..57b4b8835e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2429,7 +2429,7 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" if [[ $fp_ping ]]; then sysctl -p /etc/sysctl.d/dietpi.conf - getcap $fp_ping &> /dev/null && setcap -r $fp_ping + [[ $(getcap $fp_ping) ]] && setcap -r $fp_ping chmod a-s $fp_ping fi From ca8ec0e49022d4132bbc7d23f7d5d3e591323bd3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jun 2020 01:12:15 +0200 Subject: [PATCH 139/182] v6.31 (#3620) + DietPi-Software | WireGuard: Enable support for all devices where the kernel module is shipped with the kernel package. This is e.g. true for all "current" Armbian images with 5.X kernel. WireGuard has been natively integrated into Linux since v5.6 hence this integration will be of raising importance and allows to skip DKMS and headers install. + DietPi-Software | WireGuard: Work around an issue with some Odroids where /lib/modules//build symlink is missing when headers are installed after the kernel package. If a matching kernel and headers dir pair is found but no symlink, it is created now manually: https://github.com/MichaIng/DietPi/issues/3577 --- CHANGELOG.txt | 2 + dietpi/dietpi-software | 127 +++++++++++++++++++++++++---------------- 2 files changed, 80 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 578ca60926..a09ba52184 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-Cleaner | Enhanced performance of the files cleaner if /mnt is skipped, especially in combination with large drives or network mounts. Many thanks to @maartenlangeveld for revealing the underlying issue: https://github.com/MichaIng/DietPi/issues/3609 - DietPi-Drive_Manager | SSHFS entries in fstab are now detected and preserved. Many thanks to @notwork for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7781 - DietPi-Config | Added Ethernet link speed selection to Network>Ethernet menu. The function and dietpi.txt entry exists for a long time but it was only exposed as first run setup option. +- DietPi-Software | WireGuard: Added generic support for all SBCs where the WireGuard kernel module is shipped together with the kernel package. This applies to most current Armbian-based images at the time of writing and will be the more regular case since Linux 5.6 has WireGuard natively integrated. - DietPi-Software | Firefox Sync Server has been added to our software list, which allows to sync your Firefox bookmarks, history, tabs and passwords via your self-hosted server. Many thanks and all credits to @CedArctic for implementing this software title: https://github.com/MichaIng/DietPi/pull/3471 - DietPi-Software | Folding@Home: Updated to latest v7.6.X, which includes an explicit option for prioritising COVID 19 projects: https://foldingathome.org/2020/04/17/new-foldinghome-software-with-the-option-to-prioritize-covid-19-projects/ This update is applied to all systems with DietPi v6.31, existing config and data are preserved. @@ -25,6 +26,7 @@ Bug Fixes: - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where those software services crashed once an hour due to faulty SQLite database log file clearing. Many thanks to @Taloth from Sonarr and all the others who reported, investigated and finally solved the mystery: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7598 - DietPi-Software | WireGuard: Resolved an issue where WireGuard in client mode failed to start due to missing resolvconf. It is now installed together with WireGuard when choosing client setup. Many thanks to @yahoo456 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=7783 +- DietPi-Software | WireGuard: Worked around an issue where on some Odroids install failed due to missing symlinks to the Linux headers. Many thanks to @repomanz for reporting this issue: https://github.com/MichaIng/DietPi/issues/3577 - DietPi-Software | Ubooquity: Updated the installer to pull the latest version from Vae Mendis Software directly and enhanced permissions to better integrate with other software. Many thanks to @Mr.Roboto for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=12&t=7786 - DietPi-Software | Node.js: Resolved an issue where Node failed to start due to missing new libatmoic1 dependency. Many thanks to @larsno for reporting this issue: https://github.com/MichaIng/DietPi/issues/3614 - DietPi-Software | TigerVNC: Worked around an external bug where the VNC server crashes after client logout. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e501ef4c55..791ebadd1e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -217,6 +217,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it WIFIHOTSPOT_RTL8188C_DEVICE=0 WIFIHOTSPOT_RTL8188C_PACKAGE=0 USER_LINUX_AUTOINSTALL_PROMPT_DISPLAYED=0 + WIREGUARD_BUILTIN=0 # Is the WireGuard kernel module natively shipped by the kernel package? # PHP version specific directories, APT package-, module- and command names PHP_NAME='php7.3' @@ -1782,6 +1783,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it done # - Odroid U3 aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,13]=0 + # Re-enable if module is shipped with (kernel) package, e.g. Armbian 5.X + for i in /lib/modules/*/kernel/net/wireguard/wireguard.ko + do + + [[ -f $i ]] || continue + dpkg-query -S "$i" &> /dev/null || continue + aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=1 WIREGUARD_BUILTIN=1 + break + + done #------------------ software_id=117 @@ -4585,81 +4596,99 @@ _EOF_ Banner_Installing - # Kernel headers and matching kernel image required for wireguard-dkms to build the wireguard kernel module - local kernel_packages= - # - x86_64 - if (( $G_HW_ARCH == 10 )); then + # Packages available on Buster backports and Bullseye: For Stretch and Raspbian Buster add Bullseye repo + if (( $G_DISTRO < 5 || ( $G_HW_MODEL < 10 && ${G_RASPBIAN:-1} && $G_DISTRO == 5 ) )); then - kernel_packages='linux-image-amd64 linux-headers-amd64' + # Raspbian or Debian? + local url='http://raspbian.raspberrypi.org/raspbian/' + (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )) && url='https://deb.debian.org/debian/' - # - RPi - elif (( $G_HW_MODEL < 10 )); then + echo "deb $url bullseye main" > /etc/apt/sources.list.d/dietpi-wireguard.list - kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers' + # Disable repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568 + # Enable but set WireGuard package priorities low enough to install only if not available in main repo(s) + echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n +Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard - # - Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then + G_AGUP - kernel_packages='linux-image-4.14-armhf-odroid-xu4 linux-headers-4.14-armhf-odroid-xu4' + fi - # - Odroid C2 - elif (( $G_HW_MODEL == 12 )); then + # If the kernel module is shipped with the kernel (e.g. Armbian 5.X) + if [[ $WIREGUARD_BUILTIN == 1 ]]; then - kernel_packages='linux-image-arm64-odroid-c2 linux-headers-arm64-odroid-c2' + # Purge DKMS as it is not required and might mess with available kernel module + dpkg-query -s wireguard-dkms &> /dev/null && G_AGP wireguard-dkms + # Install userspace tools only + G_AGI wireguard-tools iptables qrencode - # - Odroid N1 - elif (( $G_HW_MODEL == 14 )); then + # Else, kernel headers and matching kernel image is required for wireguard-dkms to build the WireGuard kernel module + else - kernel_packages='linux-image-arm64-odroid-n1 linux-headers-arm64-odroid-n1' + local kernel_packages= + # x86_64 + if (( $G_HW_ARCH == 10 )); then - # - Odroid N2 - elif (( $G_HW_MODEL == 15 )); then + kernel_packages='linux-image-amd64 linux-headers-amd64' - kernel_packages='linux-image-arm64-odroid-n2 linux-headers-arm64-odroid-n2' + # RPi + elif (( $G_HW_MODEL < 10 )); then - # - Odroid C4 - elif (( $G_HW_MODEL == 16 )); then + # Install bootloader package as well to assure we have a corretly booting system with intended kernel + kernel_packages='raspberrypi-kernel raspberrypi-kernel-headers raspberrypi-bootloader' - kernel_packages='linux-image-arm64-odroid-c4 linux-headers-arm64-odroid-c4' + # Odroid XU4 + elif (( $G_HW_MODEL == 11 )); then - fi + kernel_packages='linux-image-4.14-armhf-odroid-xu4 linux-headers-4.14-armhf-odroid-xu4' - # Odroids need to purge before we install, else, does not update to latest version... - (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages + # Odroid C2 + elif (( $G_HW_MODEL == 12 )); then - # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. - G_AGI $kernel_packages # apt-get install overrides hold state + kernel_packages='linux-image-arm64-odroid-c2 linux-headers-arm64-odroid-c2' - # Package available on Buster backports and Bullseye: For Stretch and Raspbian Buster add Bullseye repo - if (( $G_DISTRO < 5 || ( $G_HW_MODEL < 10 && ${G_RASPBIAN:-1} && $G_DISTRO == 5 ) )); then + # Odroid N1 + elif (( $G_HW_MODEL == 14 )); then - # Raspbian or Debian? - local url='http://raspbian.raspberrypi.org/raspbian/' - (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )) && url='https://deb.debian.org/debian/' + kernel_packages='linux-image-arm64-odroid-n1 linux-headers-arm64-odroid-n1' - echo "deb $url bullseye main" > /etc/apt/sources.list.d/dietpi-wireguard.list + # Odroid N2 + elif (( $G_HW_MODEL == 15 )); then - # Disable repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568 - # Enable but set WireGuard package priorities low enough to install only if not available in main repo(s) - echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard + kernel_packages='linux-image-arm64-odroid-n2 linux-headers-arm64-odroid-n2' - G_AGUP + # Odroid C4 + elif (( $G_HW_MODEL == 16 )); then - fi + kernel_packages='linux-image-arm64-odroid-c4 linux-headers-arm64-odroid-c4' + + fi + + # Odroids need to purge before we install, else, does not update to latest version... + (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages - # Check for existing WireGuard install - local existing_install=0 - dpkg-query -s wireguard-dkms &> /dev/null && existing_install=1 + # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. + G_AGI $kernel_packages # apt-get install overrides hold state + unset kernel_packages - # iptables required to forward incoming VPN traffic to local LAN/internet interface - # qrencode required to print client config QR code to console - G_AGI wireguard iptables qrencode + # Workaround for missing /lib/modules//build symlink: https://github.com/MichaIng/DietPi/issues/3577 + # - Known as issue currently on Odroid C2/N1/N2, check for new build system if linux-/ holds current headers instead of linux-source-/: http://fuzon.co.uk/meveric/pool/c2/l/ + for i in /lib/modules/* + do - # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers - (( $existing_install )) && G_EXEC dpkg-reconfigure wireguard-dkms + [[ -d $i/build ]] && continue + [[ -d /usr/src/linux-headers-${i##*/} ]] && ln -sfv "/usr/src/linux-headers-${i##*/}" "$i/build" - unset kernel_packages existing_install + done + + # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers + dpkg-query -s wireguard-dkms &> /dev/null && G_EXEC dpkg-reconfigure -f noninteractive wireguard-dkms + + # iptables required to forward incoming VPN traffic to local LAN/internet interface + # qrencode required to print client config QR code to console + G_AGI wireguard-dkms wireguard-tools iptables qrencode + + fi fi From 2039bcfd62157ff996c352da853eeab1ad54d997 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jun 2020 11:47:43 +0200 Subject: [PATCH 140/182] v6.31 + DietPi-Software | TigerVNC: Fix LD_PRELOAD assignment --- dietpi/dietpi-software | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 791ebadd1e..1c22579347 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9169,11 +9169,11 @@ _EOF_ # - Be failsafe on Raspbian (armhf!) if 64-bit kernel mode has been enabled. if (( $G_HW_ARCH < 3 )) || [[ $G_RASPBIAN == 1 ]]; then - ld_preload='LD_PRELOAD=/lib/arm-linux-gnueabihf/libgcc_s.so.1 ' + ld_preload='/lib/arm-linux-gnueabihf/libgcc_s.so.1 ' elif (( $G_HW_ARCH == 3 )); then - ld_preload='LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 ' + ld_preload='/lib/aarch64-linux-gnu/libgcc_s.so.1 ' fi @@ -9194,7 +9194,7 @@ if [[ -f '/usr/bin/vncserver-virtual' ]]; then elif [[ -f '/usr/bin/tigervncserver' ]]; then REALVNC=0 - FP_BINARY='$ld_preload/usr/bin/tigervncserver' + FP_BINARY='/usr/bin/tigervncserver' else @@ -9213,6 +9213,7 @@ case "\$1" in HEIGHT=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) DEPTH=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + (( \$REALVNC )) || export LD_PRELOAD=$ld_preload # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499 \$FP_BINARY :\${DISPLAY:-1} -geometry \${WIDTH:-1280}'x'\${HEIGHT:-720} -depth \${DEPTH:-16} || exit 1 # Shared mode: x11vnc, excluding RealVNC as it has its own services From 5aa2cac5def2bf88d4a6d80e57f02e7e889087a2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Jun 2020 01:51:03 +0200 Subject: [PATCH 141/182] v6.31 + DietPi-Software | Minor wording/comments and shortened forum URLs --- dietpi/dietpi-software | 99 +++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1c22579347..94baadecfa 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9169,11 +9169,11 @@ _EOF_ # - Be failsafe on Raspbian (armhf!) if 64-bit kernel mode has been enabled. if (( $G_HW_ARCH < 3 )) || [[ $G_RASPBIAN == 1 ]]; then - ld_preload='/lib/arm-linux-gnueabihf/libgcc_s.so.1 ' + ld_preload='/lib/arm-linux-gnueabihf/libgcc_s.so.1' elif (( $G_HW_ARCH == 3 )); then - ld_preload='/lib/aarch64-linux-gnu/libgcc_s.so.1 ' + ld_preload='/lib/aarch64-linux-gnu/libgcc_s.so.1' fi @@ -15461,9 +15461,9 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n # EmonHUB/EmonPi if (( ${aSOFTWARE_INSTALL_STATE[99]} == 1 )); then - # - Enter API KEY - # - Grab key from dietpi.txt - USER_EMONHUB_APIKEY_CURRENT=$(grep -m1 '^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=' /boot/dietpi.txt | sed 's/^.*=//') + # Enter API KEY + # Grab key from dietpi.txt + USER_EMONHUB_APIKEY_CURRENT=$(sed -n '/^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) while (( $USER_EMONHUB_APIKEY_COMPLETED == 0 )); do @@ -15474,7 +15474,7 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n if G_WHIP_YESNO "The following \"Write API KEY\" will be applied during installation:\n$USER_EMONHUB_APIKEY_CURRENT\n\nIs this key correct?"; then - # - update dietpi.txt so the value will be applied during installation. + # Update dietpi.txt so the value will be applied during installation. sed -i "/^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=/c\SOFTWARE_EMONHUB_APIKEY=$USER_EMONHUB_APIKEY_CURRENT" /boot/dietpi.txt USER_EMONHUB_APIKEY_COMPLETED=1 @@ -15490,7 +15490,7 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n # Pi-hole if (( ${aSOFTWARE_INSTALL_STATE[93]} == 1 )); then - # - prompt for static ip. + # Prompt for static IP if G_WHIP_YESNO 'A static IP address is essential for Pi-hole installations. DietPi-Config can be used to quickly setup your static IP address.\n If you have already setup your static IP, please ignore this message.\n\nWould you like to setup your static IP address now?'; then @@ -15509,12 +15509,13 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s # Enable WiFi modules /boot/dietpi/func/dietpi-set_hardware wifimodules enable - while :; do + while : + do local criteria_passed=1 local output_string='The following criteria must be met, for the installation of WiFi Hotspot to succeed:' - if ip r | grep -qi "eth$(mawk 'NR==1' /run/dietpi/.network)"; then + if ip r | grep -q "eth$(mawk 'NR==1' /run/dietpi/.network)"; then output_string+='\n\n - Ethernet online: PASSED' @@ -15527,12 +15528,12 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s if [[ -d /sys/class/net/wlan$(mawk 'NR==2' /run/dietpi/.network) ]]; then - output_string+='\n\n - Wifi adapter detected: PASSED' + output_string+='\n\n - WiFi adapter detected: PASSED' else criteria_passed=0 - output_string+='\n\n - Wifi adapter detected: FAILED.\nPlease connect a WiFi adapter and try again.' + output_string+='\n\n - WiFi adapter detected: FAILED.\nPlease connect a WiFi adapter and try again.' fi @@ -15566,23 +15567,23 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s if (( ${aSOFTWARE_INSTALL_STATE[68]} == 1 )); then G_WHIP_MSG 'Remot3.it requires you to create an online account, and, link it this device.\n -Once DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=188#p188' +Once DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/phpbb/viewtopic.php?p=188#p188' fi # Let's Encrypt if (( ${aSOFTWARE_INSTALL_STATE[92]} == 1 )); then - G_WHIP_MSG 'The DietPi installation of CertBot supports all offered web servers.\n\nOnce the installation has finished, you can setup your free SSL cert with: - - DietPi-LetsEncrypt\n\nThis is a easy to use frontend for CertBot and allows integration into DietPi systems.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=1061#p1062' + G_WHIP_MSG 'The DietPi installation of Certbot supports all offered web servers.\n\nOnce the installation has finished, you can setup your free SSL cert with: + - DietPi-LetsEncrypt\n\nThis is a easy to use frontend for Certbot and allows integration into DietPi systems.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?p=1062#p1062' fi # dietpi-config can be used to install/configure the following software. Ask user. - # - NoIp + # - No-IP if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then - if G_WHIP_YESNO 'NoIp can be setup and configured by using DietPi-Config. Would you like to complete this now? \n\n- Once finished, exit DietPi-Config to resume setup.\n + if G_WHIP_YESNO 'No-IP can be setup and configured by using DietPi-Config. Would you like to complete this now? \n\n- Once finished, exit DietPi-Config to resume setup.\n - More information:\nhttps://dietpi.com/phpbb/viewtopic.php?p=58#p58'; then # Write installed states to temp @@ -15767,9 +15768,9 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_MENU_ARRAY=( - 'None' ': Not required / manual setup.' - 'Dropbear' ': Lightweight SSH Server (Recommended).' - 'OpenSSH' ': Feature Rich SSH Server with SFTP/SCP support.' + 'None' ': Not required / manual setup' + 'Dropbear' ': Lightweight SSH Server (Recommended)' + 'OpenSSH' ': Feature rich SSH Server with SFTP/SCP support' ) @@ -15780,7 +15781,7 @@ This will allow you to choose which program loads automatically, after the syste - Dropbear (Recommended): Lightweight SSH server, installed by default on DietPi systems.\n - OpenSSH: A feature rich SSH server with SFTP/SCP support, at the cost of increased resource usage.'; then - # - Assign target index + # Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then INDEX_SSHSERVER_TARGET=0 @@ -15796,7 +15797,7 @@ This will allow you to choose which program loads automatically, after the syste INDEX_SSHSERVER_TARGET=-2 toberemoved_text='Dropbear' - # - Reset to current + # Reset to current else INDEX_SSHSERVER_TARGET=$INDEX_SSHSERVER_CURRENT @@ -15820,9 +15821,9 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_MENU_ARRAY=( - 'None' ': Not required / manual setup.' - 'ProFTPD' ': Efficient, lightweight fileserver (recommended).' - 'Samba' ': Feature-rich fileserver.' + 'None' ': Not required / manual setup' + 'ProFTPD' ': Efficient, lightweight fileserver (recommended)' + 'Samba' ': Feature rich fileserver' ) @@ -15833,7 +15834,7 @@ This will allow you to choose which program loads automatically, after the syste - ProFTPD (Recommended for RPi v1): Allows you to access/share files on this device efficiently with minimal cpu usage. Uses FTP protocol.\n - Samba (Recommended for RPi v2): Allows you to easily access/share files on this device, at the cost of higher cpu usage.\n\nMore info: https://dietpi.com/phpbb/viewtopic.php?f=8&t=15#p19'; then - # - Assign target index + # Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then INDEX_FILESERVER_TARGET=0 @@ -15849,7 +15850,7 @@ This will allow you to choose which program loads automatically, after the syste INDEX_FILESERVER_TARGET=-2 toberemoved_text='ProFTPD' - # - Reset to current + # Reset to current else INDEX_FILESERVER_TARGET=$INDEX_FILESERVER_CURRENT @@ -15873,10 +15874,10 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_MENU_ARRAY=( - 'None' ': Not required / manual setup.' - 'DietPi-Ramlog #1' ': Hourly clear (recommended).' - 'DietPi-Ramlog #2' ': Hourly save, then clear.' - 'Full' ': Logrotate and Rsyslog.' + 'None' ': Not required / manual setup' + 'DietPi-Ramlog #1' ': Hourly clear (recommended)' + 'DietPi-Ramlog #2' ': Hourly save, then clear' + 'Full' ': Logrotate and Rsyslog' ) @@ -15888,7 +15889,7 @@ This will allow you to choose which program loads automatically, after the syste - DietPi-Ramlog #2: Same as #1, with the added feature of saving logfile contents to disk (/root/logfile_storage/*), before being cleared.\n - Full (Reduces performance): Mounts /var/log to DISK, reduces SDcard lifespan. Full logging system with Logrotate and Rsyslog.'; then - # - Assign target index + # Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then INDEX_LOGGING_TARGET=0 @@ -15909,7 +15910,7 @@ This will allow you to choose which program loads automatically, after the syste INDEX_LOGGING_TARGET=-3 toberemoved_text='DietPi-Ramlog' - # - Reset to current + # Reset to current else INDEX_LOGGING_TARGET=$INDEX_LOGGING_CURRENT @@ -15946,12 +15947,12 @@ This will allow you to choose which program loads automatically, after the syste if G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc.\n More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087\n\n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.'; then - # - DriveMan + # DriveMan if [[ $G_WHIP_RETURNED_VALUE == 'Drive' ]]; then /boot/dietpi/dietpi-drive_manager - # - List + # List elif [[ $G_WHIP_RETURNED_VALUE == 'List' ]]; then /boot/dietpi/dietpi-drive_manager 1 @@ -15966,7 +15967,7 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p fi - # - Manual filepath entry + # Manual filepath entry elif [[ $G_WHIP_RETURNED_VALUE == 'Custom' ]]; then if G_WHIP_INPUTBOX 'Please input a location. Your user data will be stored inside this location.\n - eg: /mnt/MyDrive/MyData'; then @@ -15977,14 +15978,14 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p fi - # - Move data if the new entry has changed + # Move data if the new entry has changed if [[ $user_data_location_current != $move_data_target ]]; then - # - Ask before we begin + # Ask before we begin if G_WHIP_YESNO "DietPi will now attempt to transfer your existing user data to the new location: \n- From: $user_data_location_current\n- To: $move_data_target\n\nWould you like to begin?"; then - # - Move data, setup symlinks + # Move data, setup symlinks if /boot/dietpi/func/dietpi-set_userdata "$user_data_location_current" "$move_data_target"; then G_WHIP_MSG "User data transfer: Completed\n\nYour user data has been successfully moved:\n\n- From: $user_data_location_current\n- To: $move_data_target" @@ -16007,15 +16008,15 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p G_WHIP_MENU_ARRAY=( - 'Apache2' ': Popular webserver.' - 'Nginx' ': Lightweight webserver.' - 'Lighttpd' ': Extremely lightweight webserver.' + 'Apache2' ': Popular webserver' + 'Nginx' ': Lightweight webserver' + 'Lighttpd' ': Extremely lightweight webserver' ) G_WHIP_DEFAULT_ITEM=$index_webserver_text G_WHIP_BUTTON_CANCEL_TEXT='Back' - if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=1549#p1549:\n + if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/phpbb/viewtopic.php?p=1549#p1549:\n - Apache2: Feature-rich and popular. Recommended for beginners and users who are looking to follow Apache2 based guides.\n - Nginx: Lightweight alternative to Apache2. Nginx claims faster webserver performance compared to Apache2.\n - Lighttpd: Extremely lightweight and is generally considered to offer the \"best\" webserver performance for SBCs. Recommended for users who expect low webserver traffic.'; then @@ -16043,7 +16044,7 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p # Check for changes if (( $INDEX_WEBSERVER_TARGET != $INDEX_WEBSERVER_CURRENT )); then - # - Check for existing and compatible installed stacks before allowing the change + # Check for existing and compatible installed stacks before allowing the change local incompatible_webserver_preference=0 local info_currently_installed_webserver='None' @@ -16067,22 +16068,22 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p fi - # - Reset preference selection + # Reset preference selection if (( $incompatible_webserver_preference == 1 )); then INDEX_WEBSERVER_TARGET=$INDEX_WEBSERVER_CURRENT - # - inform user + # Inform user G_WHIP_MSG "Error: Incompatible Webserver Preference:\n\nUnable to change your webserver preference to $G_WHIP_RETURNED_VALUE.\n This is due to an existing and incompatible webserver installation on your system ($info_currently_installed_webserver). Please remove all webserver based software (using dietpi-software > uninstall), before trying again." - # - Apply preference selection + # Apply preference selection else - # - Inform user + # Inform user G_WHIP_MSG "Webserver Preference Changed:\n\n$G_WHIP_RETURNED_VALUE has been selected as your webserver preference.\n When you select any software for install that requires a webserver, DietPi will automatically install your prefered choice ($G_WHIP_RETURNED_VALUE)." - # - NB: INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET | is applied during installation with func Apply_Webserver_Preference(). + # NB: INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET | is applied during installation with func Apply_Webserver_Preference(). fi @@ -16114,7 +16115,7 @@ https://dietpi.com/software\n List of installed software and their URL links for online docs: ───────────────────────────────────────────────────────────────\n' - # - Installed software + # Installed software for i in ${!aSOFTWARE_INSTALL_STATE[@]} do From 62bbaad92a47c07b65402ec942fac9ff80f1c733 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Jun 2020 14:04:26 +0200 Subject: [PATCH 142/182] v6.31 + DietPi-Software | Desktops: Shared desktop entries/icons are hosted on GitHub for a while, hence remove the obsolete dietpi.com URL check. + DietPi-Software | MATE: Install the core package only, the extra package is a meta package that pulls (as dependency) only the base package which again pulls (as dependency) only the core package. Hence without explicitly pulling recommendations, we just install two meta packages + core and should instead install core only. --- dietpi/dietpi-software | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 94baadecfa..5e13179c11 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2937,10 +2937,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing - # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # APT deps: upower policykit-1 are needed for LXDE logout menu item to show shutdown/restart ... G_AGI lxde upower policykit-1 firefox-esr @@ -2954,10 +2950,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing - # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Buster: No leafpad available, use featherpad instead: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-489319719 local editor='leafpad' (( $G_DISTRO > 4 )) && editor='featherpad' @@ -2970,12 +2962,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - G_AGI mate-desktop-environment-extras upower policykit-1 firefox-esr + G_AGI mate-desktop-environment-core upower policykit-1 firefox-esr fi @@ -2983,11 +2970,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 firefox-esr fi @@ -2996,11 +2978,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - # For desktop entries/icons hosted on dietpi.com - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme upower policykit-1 firefox-esr fi @@ -6870,7 +6847,7 @@ sudo -u $ha_user dash -c '$ha_pyenv_activation; pip3 install -U homeassistant'" # Openbox config G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O /root/.config/openbox/lxde-rc.xml - # Remove Lxrandr Menu item (monitor configuration tool as we set res in dietpi-config) + # Remove Lxrandr menu item (monitor configuration tool as we set res in dietpi-config) [[ -f '/usr/share/applications/lxrandr.desktop' ]] && rm /usr/share/applications/lxrandr.desktop # Disable Trash From f96ad0909a2f93bb6c26d4850eb17757e26a0f5c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Jun 2020 20:45:33 +0200 Subject: [PATCH 143/182] v6.31 + DietPi-Software | TigerVNC: Apply libunwind workaround via binary patch, which fixes calls from other origins like XRDP + DietPi-Software | RealVNC: Do not enable enterprise subscription service vncserver-virtuald. If users have enterprise subscription, they should disable our vncserver.service and enable vncserver-virtuald.service to switch from static VNC session on screen 1 to ondemand RealVNC session spawn. + DietPi-Software | RealVNC: Integrate vncserver-x11-serviced.service start into vncserver.service in shared mode. Having it running concurrently to a virtual VNC session makes it attaching to the virtual VNC session, which allows connecting to it on port 5900 (no screen :1 required) but the overhead overhead of ~20 MiB + possible confusion is not worth it. + DietPi-Software | VNC Servers: Apply vncpasswd only on TigerVNC since RealVNC by default uses UNIX user authentication and does not support the "-f" option at all. + DietPi-Software | VNC Servers: Minor uninstall enhancements --- dietpi/dietpi-software | 87 ++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5e13179c11..b59c504294 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -440,11 +440,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='RealVNC Server' aSOFTWARE_DESC[$software_id]='desktop for remote connection' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' - # RPi only (archive.raspberrypi.org repo) + # RPi only (archive.raspberrypi.org repo, libraspberrypi dependency, license) for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -4376,6 +4376,19 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf (( $G_DISTRO < 6 )) && netbase='netbase' G_AGI tigervnc-standalone-server tigervnc-common x11vnc $netbase + # Patch binary on Buster + ARM due to external bug: https://github.com/MichaIng/DietPi/issues/3615 + if (( $G_DISTRO == 5 && $G_HW_ARCH < 4 )) && [[ $(ldd /usr/bin/Xtigervnc | grep -m1 'libgcc_s\|libunwind') =~ ^[[:blank:]]*'libunwind' ]]; then + + G_DIETPI-NOTIFY 2 'Patching Xtigervnc binary: https://github.com/MichaIng/DietPi/issues/3615' + local patchelf_installed=0 + dpkg-query -s patchelf && patchelf_installed=1 + (( $patchelf_installed )) || G_AGI patchelf + # Removing and re-adding libgcc_s will place it at the top of the list, as does LD_PRELOAD when executing X(tiger)vnc. + patchelf --remove-needed libgcc_s.so.1 /usr/bin/Xtigervnc + patchelf --add-needed libgcc_s.so.1 /usr/bin/Xtigervnc + + fi + fi software_id=120 # RealVNC Server @@ -9125,7 +9138,8 @@ _EOF_ [Unit] Description=Manage VNC Server (DietPi) Before=xrdp.service xrdp-sesman.service -After=dietpi-boot.service +Wants=network-online.target +After=network-online.target dietpi-boot.service [Service] RemainAfterExit=yes @@ -9141,19 +9155,6 @@ _EOF_ systemctl daemon-reload systemctl enable vncserver - # Workaround external bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499 - local ld_preload= - # - Be failsafe on Raspbian (armhf!) if 64-bit kernel mode has been enabled. - if (( $G_HW_ARCH < 3 )) || [[ $G_RASPBIAN == 1 ]]; then - - ld_preload='/lib/arm-linux-gnueabihf/libgcc_s.so.1' - - elif (( $G_HW_ARCH == 3 )); then - - ld_preload='/lib/aarch64-linux-gnu/libgcc_s.so.1' - - fi - cat << _EOF_ > /usr/local/bin/vncserver #!/bin/bash @@ -9190,14 +9191,13 @@ case "\$1" in HEIGHT=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) DEPTH=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - (( \$REALVNC )) || export LD_PRELOAD=$ld_preload # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499 \$FP_BINARY :\${DISPLAY:-1} -geometry \${WIDTH:-1280}'x'\${HEIGHT:-720} -depth \${DEPTH:-16} || exit 1 - # Shared mode: x11vnc, excluding RealVNC as it has its own services + # TigerVNC shared desktop mode elif (( ! \$REALVNC )); then # Wait for X to start - while ! pgrep Xorg + until pgrep Xorg do echo 'Waiting for X11 to start' @@ -9209,13 +9209,20 @@ case "\$1" in xset dpms force on # Disable screen blanking x11vnc -display :0 -usepw -forever || exit 1 + # RealVNC shared desktop mode + else + + # No need to wait for X, this service detects the first appearing X session and attaches to it. + systemctl start vncserver-x11-serviced || exit 1 + fi ;; stop) DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - \$FP_BINARY -kill :\${DISPLAY:-1} &> /dev/null - killall -qw x11vnc Xtigervnc + \$FP_BINARY -kill :\${DISPLAY:-1} 2> /dev/null + (( \$REALVNC )) && systemctl stop vncserver-x11-serviced + killall -qw x11vnc Xtigervnc /usr/bin/vncserver-x11-serviced vncserver-x11-serviced Xvnc-core ;; esac @@ -9224,14 +9231,6 @@ exit 0 _EOF_ chmod +x /usr/local/bin/vncserver - # RealVNC: Enable services - if (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then - - systemctl enable vncserver-x11-serviced - systemctl enable vncserver-virtuald - - fi - # Stretch + TigerVNC: Disable Localhost only by default [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf @@ -9275,12 +9274,16 @@ $cmd_launch_desktop & _EOF_ chmod +x /root/.vnc/xstartup - # Set control + read-only passwords - vncpasswd -f << _EOF_ > /root/.vnc/passwd + # TigerVNC: Set control + read-only passwords (RealVNC uses UNIX user authentication by default, does not support the "-f" option and uses different files!) + if command -v tigervncpasswd &> /dev/null; then + + tigervncpasswd -f << _EOF_ > /root/.vnc/passwd $GLOBAL_PW $GLOBAL_PW _EOF_ - chmod 600 /root/.vnc/passwd + chmod 600 /root/.vnc/passwd + + fi fi @@ -13595,6 +13598,13 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[28]} == -1 )) && software_id=28 || software_id=120 Banner_Uninstalling + + # RealVNC services + systemctl unmask vncserver-x11-serviced 2> /dev/null + systemctl disable --now vncserver-x11-serviced 2> /dev/null + systemctl unmask vncserver-virtuald 2> /dev/null + systemctl disable --now vncserver-virtuald 2> /dev/null + G_AGP tigervnc-* x11vnc realvnc-vnc-server if [[ -f '/etc/systemd/system/vncserver.service' ]]; then @@ -13603,13 +13613,14 @@ _EOF_ rm -R /etc/systemd/system/vncserver.service* fi - [[ -f '/etc/init.d/vncserver' ]] && rm /etc/init.d/vncserver - [[ -f '/usr/local/bin/vncserver' ]] && rm /usr/local/bin/vncserver - [[ -d '/root/.vnc' ]] && rm -R /root/.vnc + if [[ -f '/etc/init.d/vncserver' ]]; then - # + RealVNC services - systemctl disable vncserver-x11-serviced.service 2> /dev/null - systemctl disable vncserver-virtuald.service 2> /dev/null + rm /etc/init.d/vncserver + update-rc.d -f vncserver remove + + fi + [[ -f '/usr/local/bin/vncserver' ]] && rm /usr/local/bin/vncserver + rm -Rf /{root,home/*}/.vnc fi From c8d20a10fe59c3a4586f8880a629892b9ee2d513 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Jun 2020 21:04:21 +0200 Subject: [PATCH 144/182] v6.31 + DietPi-Software | TigerVNC: Hide "dpkg-query -s" output + DietPi-Software | TigerVNC: Print "'Waiting for X11 to start" only one on shared mode startup, then wait silently. As of service type, subsequent prints are no caught anymore by journal and otherwise would spam it in case of disabled desktop autologin. --- dietpi/dietpi-software | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b59c504294..28285ecb9b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4381,7 +4381,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf G_DIETPI-NOTIFY 2 'Patching Xtigervnc binary: https://github.com/MichaIng/DietPi/issues/3615' local patchelf_installed=0 - dpkg-query -s patchelf && patchelf_installed=1 + dpkg-query -s patchelf &> /dev/null && patchelf_installed=1 (( $patchelf_installed )) || G_AGI patchelf # Removing and re-adding libgcc_s will place it at the top of the list, as does LD_PRELOAD when executing X(tiger)vnc. patchelf --remove-needed libgcc_s.so.1 /usr/bin/Xtigervnc @@ -9196,14 +9196,8 @@ case "\$1" in # TigerVNC shared desktop mode elif (( ! \$REALVNC )); then - # Wait for X to start - until pgrep Xorg - do - - echo 'Waiting for X11 to start' - sleep 2 - - done + echo 'Waiting for X11 to start...' + until pgrep Xorg; do sleep 2; done sleep 5 # Give system some time to finish setting up X11 + desktop xset dpms force on # Disable screen blanking From e09fc033da94f32ee6e2d21270b14f8a9398491f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 02:18:44 +0200 Subject: [PATCH 145/182] v6.31 + CHANGELOG | XRDP: The TigerVNC bug affected as well XRDP connections which have been resolved in the same turn: https://github.com/MichaIng/DietPi/issues/3615#issuecomment-650559035 --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a09ba52184..557569fd4b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -29,7 +29,8 @@ Bug Fixes: - DietPi-Software | WireGuard: Worked around an issue where on some Odroids install failed due to missing symlinks to the Linux headers. Many thanks to @repomanz for reporting this issue: https://github.com/MichaIng/DietPi/issues/3577 - DietPi-Software | Ubooquity: Updated the installer to pull the latest version from Vae Mendis Software directly and enhanced permissions to better integrate with other software. Many thanks to @Mr.Roboto for doing this suggestion: https://dietpi.com/phpbb/viewtopic.php?f=12&t=7786 - DietPi-Software | Node.js: Resolved an issue where Node failed to start due to missing new libatmoic1 dependency. Many thanks to @larsno for reporting this issue: https://github.com/MichaIng/DietPi/issues/3614 -- DietPi-Software | TigerVNC: Worked around an external bug where the VNC server crashes after client logout. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 +- DietPi-Software | TigerVNC: Worked around an external bug where the VNC server crashed after client logout or failed to start at all. Many thanks to @Joulinar for investigating this issue and providing the workaround: https://dietpi.com/phpbb/viewtopic.php?p=25285#p25285 +- DietPi-Software | XRDP: The above TigerVNC bug affected as well XRDP connections which have been resolved in the same turn: https://github.com/MichaIng/DietPi/issues/3615#issuecomment-650559035 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 From c4a1dc3a4f72140b68c1fc7d6e54d278b3e7bc8d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 17:41:32 +0200 Subject: [PATCH 146/182] v6.31 + Subversion up --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 11c4d1b578..43331cdd2e 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -30 +31 0 From a6889207b2a5542c31f4804625d352fb17174dab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 17:42:07 +0200 Subject: [PATCH 147/182] v6.31 + DietPi-Globals | Default subversion up --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index e01c4a1872..1ce5883c03 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -69,7 +69,7 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=6 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=30 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=31 [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' From 7f5c40c8b47969f055ed70b9238dd16f6105d39b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 17:53:33 +0200 Subject: [PATCH 148/182] v6.31 + DietPi-Patch | On Stretch, libcap2-bin ist no dependency of iproute2 and can hence be missing. Skip ping binary capability removal, if getcap/setcap is missing anyway. No need to force its install, security implication is minimal anyway. --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 57b4b8835e..102772e3cb 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2429,7 +2429,7 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" if [[ $fp_ping ]]; then sysctl -p /etc/sysctl.d/dietpi.conf - [[ $(getcap $fp_ping) ]] && setcap -r $fp_ping + command -v getcap &> /dev/null && [[ $(getcap $fp_ping) ]] && setcap -r $fp_ping chmod a-s $fp_ping fi From d0b33bc3866d1d87549b9a7e39841fa04d7de4d7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 19:12:42 +0200 Subject: [PATCH 149/182] v6.31 + DietPi-FirstBoot | Network setup: Although we do not ship our images with resolvconf anymore, be more compatible and apply static DNS nameservers correctly when it is present. --- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index c81ef8fda4..637641f45f 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -263,8 +263,16 @@ sed -i "/address/c\address $static_ip" /etc/network/interfaces sed -i "/netmask/c\netmask $static_mask" /etc/network/interfaces sed -i "/gateway/c\gateway $static_gateway" /etc/network/interfaces - > /etc/resolv.conf - for i in $static_dns; do echo "nameserver $i" >> /etc/resolv.conf; done + if command -v resolvconf &> /dev/null; then + + sed -i "/dns-nameservers/c\dns-nameservers $static_dns" /etc/network/interfaces + + else + + > /etc/resolv.conf + for i in $static_dns; do echo "nameserver $i" >> /etc/resolv.conf; done + + fi fi From 01dafdd28e242f2e29f4a047d301e1d76a5adc9c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 20:13:09 +0200 Subject: [PATCH 150/182] v6.31 + DietPi-Cleaner | Only mark packages for autoremoval if any were found + DietPi-Cleaner | Do not mark git as as not installed since we do not autoremove it anymore, since is required by some software titles for their internal updaters. --- dietpi/dietpi-cleaner | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 30895e6d4d..45d01efcbd 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -362,7 +362,6 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." # Find packages and convert into 1 line string local string_package_names=$(dpkg --get-selections '*-dev' build-essential make automake autoconf 2> /dev/null | mawk '{print $1}' ORS=' ') - # Mark for autoremoval if (( $DRY_RUN )); then G_DIETPI-NOTIFY 0 "The following dev packages have been found: ${string_package_names:-}" @@ -370,10 +369,9 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." else - apt-mark auto $string_package_names - G_AGA - sed -i '/^aSOFTWARE_INSTALL_STATE\[16\]=/c\aSOFTWARE_INSTALL_STATE\[16\]=0' /boot/dietpi/.installed &> /dev/null - sed -i '/^aSOFTWARE_INSTALL_STATE\[17\]=/c\aSOFTWARE_INSTALL_STATE\[17\]=0' /boot/dietpi/.installed &> /dev/null + # Mark for autoremoval + [[ $string_package_names ]] && { apt-mark auto $string_package_names; G_AGA; } + sed -i '/^aSOFTWARE_INSTALL_STATE\[16\]=/c\aSOFTWARE_INSTALL_STATE\[16\]=0' /boot/dietpi/.installed fi @@ -388,7 +386,6 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." # Find packages and convert into 1 line string local string_package_names=$(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}' ORS=' ') - # Mark for autoremoval if (( $DRY_RUN )); then G_DIETPI-NOTIFY 0 "The following man page/docs packages have been found: ${string_package_names:-}" @@ -398,13 +395,10 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..." else - apt-mark auto $string_package_names - G_AGA - if G_WHIP_YESNO '[WARNING] Removing installed man pages and docs causes errors during "apt-get upgrade" in rare cases (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then - - rm -Rf /usr/share/{man,doc,doc-base} - - fi + # Mark for autoremoval + [[ $string_package_names ]] && { apt-mark auto $string_package_names; G_AGA; } + G_WHIP_YESNO '[WARNING] Removing installed man pages and docs causes errors during "apt-get upgrade" in rare cases: https://github.com/MichaIng/DietPi/issues/2751 +\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?' && rm -Rf /usr/share/{man,doc,doc-base} fi From e1c88c3a366af494fb51caf94a0362760929ce50 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jun 2020 22:26:32 +0200 Subject: [PATCH 151/182] v6.31 + DietPi-Software | WiFi Hotspot: In case of RTL8188C* adapter on RPi, stay with default driver, since the issue seems to have been resolved differently and "rtl871xdrv" is not supported: https://github.com/MichaIng/DietPi/issues/2531#issuecomment-650810121 --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 28285ecb9b..1dcfeb1773 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9817,7 +9817,8 @@ rsn_pairwise=CCMP _EOF_ # Check for RTL8188C* device, use the patched driver with compiled binary: https://github.com/pritambaral/hostapd-rtl871xdrv#why - (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf + # - Stay with default driver on RPi, where the issue seems to have been resolved differently and "rtl871xdrv" is not supported: https://github.com/MichaIng/DietPi/issues/2531#issuecomment-650810121 + (( $WIFIHOTSPOT_RTL8188C_DEVICE && $G_HW_MODEL < 10 )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf # Enable access point config echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"" > /etc/default/hostapd From f9232db99a995e7640d58e9ce7aa0159d749c856 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Mon, 29 Jun 2020 00:23:24 +0200 Subject: [PATCH 152/182] Update BRANCH_SYSTEM.md (#3629) * Update BRANCH_SYSTEM.md update /DietPi/dietpi.txt to /boot/dietpi.txt * v6.31 + BRANCH_SYSTEM.md | Typo Co-authored-by: MichaIng --- BRANCH_SYSTEM.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BRANCH_SYSTEM.md b/BRANCH_SYSTEM.md index 753fed6cab..67eb8c9c40 100644 --- a/BRANCH_SYSTEM.md +++ b/BRANCH_SYSTEM.md @@ -15,7 +15,7 @@ Beta on an existing installation: 1. Recommended: Backup your system with ```dietpi-backup``` (or backup quickly with ```dietpi-backup 1```) 2. Run the following command to switch to 'beta' branch: ``` -G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=beta' /DietPi/dietpi.txt +G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=beta' /boot/dietpi.txt ``` 3. Run ```dietpi-update``` to update the system, then reboot. 4. Test away, please report any issues on our GitHub page. Also ensure you mention "Beta branch" in your post: https://github.com/MichaIng/DietPi/issues From f7f889dae651ed82ce7c3a19362facc82b669652 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 29 Jun 2020 23:03:54 +0200 Subject: [PATCH 153/182] v6.31 (#3631) + Overclocking | Fix RPi3+ models detection --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 8 ++++---- dietpi/patch_file | 16 ++++++++-------- .../lib/dietpi/services/dietpi-firstboot.bash | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 557569fd4b..679db1d51c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,7 @@ Bug Fixes: - System | Resolved potential issues due to missing /media directory on DietPi images, which is not used by default but is part of FHS and can hence be expected by Linux software, e.g. htpdate. Many thanks to @jokoren for reporting this issue: https://github.com/MichaIng/DietPi/issues/3558 - DietPi-Login | Resolved an issue where the script called itself from within the error handler subshell. Generally the error handler subshell must never call dietpi-login (and related autostart programs) and dietpi-login must never call itself from an interactive subshell. Many thanks to @nosyaardvark for reporting this issue: https://github.com/MichaIng/DietPi/issues/3583#issuecomment-643583664 - DietPi-Drive_Manager | Resolved an issue where moving the RootFS to an external drive did not include DietPi userdata. Many thanks to @sdomotica and @Joulinar for reporting this issue: https://github.com/MichaIng/DietPi/issues/3600#issuecomment-643261670 +- DietPi-Config | Resolved an issue where RPi3 non-plus overclocking profiles were shown on RPi3+ models. Many thanks to @lone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7804 - DietPi-Software | Logging choice: Resolved an issue where manually choosing logging options "None" and "Full" during firstrun installs did not uninstall DietPi-RAMlog as intended. Many thanks to @Pain-Patate for reporting this issue: https://github.com/MichaIng/DietPi/issues/3588 - DietPi-Software | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3519 - DietPi-Software | rTorrent: Resolved an issue where startup fails because of invalid default config values. Many thanks to @PiTech and @vorrac for reporting and fixing this issue: https://dietpi.com/phpbb/viewtopic.php?f=15&t=7613, https://dietpi.com/phpbb/viewtopic.php?f=11&t=7607 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 8ecf44f687..bfcf123df6 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3560,16 +3560,16 @@ Additional benchmarks: elif (( $G_HW_MODEL == 3 )); then - if [[ $G_HW_MODEL_NAME == *'+' ]]; then + sed -i '/core_freq=/c\#core_freq=400' /boot/config.txt + + if [[ $G_HW_MODEL_NAME == *'+'* ]]; then sed -i '/arm_freq=/c\#arm_freq=1400' /boot/config.txt - sed -i '/core_freq=/c\#core_freq=400' /boot/config.txt sed -i '/sdram_freq=/c\#sdram_freq=500' /boot/config.txt else sed -i '/arm_freq=/c\#arm_freq=1200' /boot/config.txt - sed -i '/core_freq=/c\#core_freq=400' /boot/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /boot/config.txt fi @@ -3771,7 +3771,7 @@ Additional benchmarks: # Overclocking Pi3 elif (( $G_HW_MODEL == 3 )); then - if [[ $G_HW_MODEL_NAME == *'+' ]]; then + if [[ $G_HW_MODEL_NAME == *'+'* ]]; then G_WHIP_MENU_ARRAY=('none' ': 1400 MHz ARM | 400 MHz core | 500 MHz SDRAM | 0 overvolt') diff --git a/dietpi/patch_file b/dietpi/patch_file index 102772e3cb..d377a47964 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -464,14 +464,6 @@ _EOF_' [[ -f '/var/lib/dietpi/dietpi-software/services/squeezeboxserver.service' ]] && rm /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service echo 118 >> /var/tmp/dietpi/dietpi-update_reinstalls - fi - #------------------------------------------------------------------------------- - # RPi 3 B+: Set correct disabled clocks for B+ (scraped by dietpi-config > overclocking) - if [[ $G_HW_MODEL_NAME == 'RPi 3 Model B+' ]]; then - - sed -i '/arm_freq=/c\#arm_freq=1400' /boot/config.txt - sed -i '/sdram_freq=/c\#sdram_freq=500' /boot/config.txt - fi #------------------------------------------------------------------------------- # sudoers and sysctl adjustments moved to *.d/ files: https://github.com/MichaIng/DietPi/pull/1635 @@ -2432,6 +2424,14 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" command -v getcap &> /dev/null && [[ $(getcap $fp_ping) ]] && setcap -r $fp_ping chmod a-s $fp_ping + fi + #------------------------------------------------------------------------------- + # Fix default RPi3+ overclocking defaults: https://dietpi.com/phpbb/viewtopic.php?f=9&t=7804 + if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME == *'+'* ]]; then + + sed -i '/#arm_freq=/c\#arm_freq=1400' /boot/config.txt + sed -i '/#sdram_freq=/c\#sdram_freq=500' /boot/config.txt + fi #------------------------------------------------------------------------------- # Reinstalls diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 637641f45f..d0be0cd649 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -62,7 +62,7 @@ G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /boot/config.txt # https://github.com/MichaIng/DietPi/issues/356 # A+/B+ - if [[ $G_HW_MODEL_NAME == *'+' ]]; then + if [[ $G_HW_MODEL_NAME == *'+'* ]]; then sed -i '/arm_freq=/c\#arm_freq=1400' /boot/config.txt sed -i '/sdram_freq=/c\#sdram_freq=500' /boot/config.txt From ecfaa6e0256cf9fa3549b623ef8414fa630e1495 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 30 Jun 2020 11:02:32 +0200 Subject: [PATCH 154/182] v6.31 + DietPi-Survey_report | Add Firefox Sync server and fix degree sign in html page --- .meta/dietpi-survey_report | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 171f1f23a1..b0d9acbf1c 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -453,6 +453,7 @@ aSOFTWARE_NAME6_31[$i]=${aSOFTWARE_NAME6_30[$i]} done + aSOFTWARE_NAME6_31[177]='Firefox Sync Server' Main(){ @@ -819,8 +820,8 @@
CPU time (seconds, lower is faster):CPU idle temp (°C):CPU full load temp (°C):CPU idle temp (°C):CPU full load temp (°C):
Device: