From 7b2d0d56adb2ced2894a20fb84060601894b2d5a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 20 Dec 2020 20:54:59 +0100 Subject: [PATCH 001/218] v6.35 (#3988) + Prepare v6.35 development cycle --- .meta/dietpi-survey_report | 33 ++++++++------------------------- CHANGELOG.txt | 31 ++++++++++++++++++++++--------- dietpi/func/dietpi-globals | 4 ++-- dietpi/server_version-6 | 4 ++-- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 55a7252525..ab17684674 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -349,10 +349,8 @@ aSOFTWARE_NAME6_15=() for i in "${!aSOFTWARE_NAME[@]}" do - aSOFTWARE_NAME6_14[$i]=${aSOFTWARE_NAME[$i]} aSOFTWARE_NAME6_15[$i]=${aSOFTWARE_NAME6_14[$i]} - done aSOFTWARE_NAME6_15[148]='myMPD' @@ -362,11 +360,9 @@ aSOFTWARE_NAME6_18=() for i in "${!aSOFTWARE_NAME6_15[@]}" do - aSOFTWARE_NAME6_16[$i]=${aSOFTWARE_NAME6_15[$i]} aSOFTWARE_NAME6_17[$i]=${aSOFTWARE_NAME6_16[$i]} aSOFTWARE_NAME6_18[$i]=${aSOFTWARE_NAME6_17[$i]} - done aSOFTWARE_NAME6_18[168]='Nextcloud Talk' @@ -375,10 +371,8 @@ aSOFTWARE_NAME6_20=() for i in "${!aSOFTWARE_NAME6_18[@]}" do - aSOFTWARE_NAME6_19[$i]=${aSOFTWARE_NAME6_18[$i]} aSOFTWARE_NAME6_20[$i]=${aSOFTWARE_NAME6_19[$i]} - done aSOFTWARE_NAME6_20[116]='Medusa' aSOFTWARE_NAME6_20[170]='UnRAR' @@ -391,11 +385,9 @@ aSOFTWARE_NAME6_23=() for i in "${!aSOFTWARE_NAME6_20[@]}" do - aSOFTWARE_NAME6_21[$i]=${aSOFTWARE_NAME6_20[$i]} aSOFTWARE_NAME6_22[$i]=${aSOFTWARE_NAME6_21[$i]} aSOFTWARE_NAME6_23[$i]=${aSOFTWARE_NAME6_22[$i]} - done aSOFTWARE_NAME6_23[173]='LXQt' aSOFTWARE_NAME6_23[174]='GIMP' @@ -406,10 +398,8 @@ aSOFTWARE_NAME6_25=() for i in "${!aSOFTWARE_NAME6_23[@]}" do - aSOFTWARE_NAME6_24[$i]=${aSOFTWARE_NAME6_23[$i]} aSOFTWARE_NAME6_25[$i]=${aSOFTWARE_NAME6_24[$i]} - done aSOFTWARE_NAME6_25[176]='Mycroft AI' @@ -417,9 +407,7 @@ aSOFTWARE_NAME6_26=() for i in "${!aSOFTWARE_NAME6_25[@]}" do - aSOFTWARE_NAME6_26[$i]=${aSOFTWARE_NAME6_25[$i]} - done aSOFTWARE_NAME6_26[27]=27 # TightVNC: Replaced by TigerVNC on Stretch+ aSOFTWARE_NAME6_26[140]=140 # SDL2: Merged into Amiberry for targeted minimal install @@ -429,9 +417,7 @@ aSOFTWARE_NAME6_27=() for i in "${!aSOFTWARE_NAME6_26[@]}" do - aSOFTWARE_NAME6_27[$i]=${aSOFTWARE_NAME6_26[$i]} - done aSOFTWARE_NAME6_27[27]='TasmoAdmin' @@ -440,10 +426,8 @@ aSOFTWARE_NAME6_29=() for i in "${!aSOFTWARE_NAME6_27[@]}" do - aSOFTWARE_NAME6_28[$i]=${aSOFTWARE_NAME6_27[$i]} aSOFTWARE_NAME6_29[$i]=${aSOFTWARE_NAME6_28[$i]} - done aSOFTWARE_NAME6_29[140]='Domoticz' @@ -452,10 +436,8 @@ 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 aSOFTWARE_NAME6_31[177]='Firefox Sync Server' @@ -463,9 +445,7 @@ aSOFTWARE_NAME6_32=() for i in "${!aSOFTWARE_NAME6_31[@]}" do - aSOFTWARE_NAME6_32[$i]=${aSOFTWARE_NAME6_31[$i]} - done aSOFTWARE_NAME6_32[178]='Jellyfin' aSOFTWARE_NAME6_32[179]='Komga' @@ -474,9 +454,7 @@ aSOFTWARE_NAME6_33=() for i in "${!aSOFTWARE_NAME6_32[@]}" do - aSOFTWARE_NAME6_33[$i]=${aSOFTWARE_NAME6_32[$i]} - done aSOFTWARE_NAME6_33[180]='Bazarr' @@ -484,9 +462,7 @@ aSOFTWARE_NAME6_34=() for i in "${!aSOFTWARE_NAME6_33[@]}" do - aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} - done aSOFTWARE_NAME6_34[134]='62' # DietPi-CloudShell aSOFTWARE_NAME6_34[134]='134' # Tonido @@ -495,9 +471,16 @@ aSOFTWARE_NAME6_34[182]='Unbound' aSOFTWARE_NAME6_34[183]='Bitwarden_RS' aSOFTWARE_NAME6_34[184]='Tor Relay' - # shellcheck disable=SC2034 aSOFTWARE_NAME6_34[185]='Portainer' + # v6.35 + aSOFTWARE_NAME6_35=() + for i in "${!aSOFTWARE_NAME6_34@]}" + do + # shellcheck disable=SC2034 + aSOFTWARE_NAME6_35[$i]=${aSOFTWARE_NAME6_34[$i]} + done + Main(){ # Copy files to RAM to speed up sourcing diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa80f40e13..3070ec1996 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,25 @@ +v6.35 +(2021-01-XX) + +Changes: + +New Software: + +Fixes: + +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/4XXX + +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 +- 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-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 +- DietPi-Software | Sonarr/Radarr/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 + +For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues + +----------------------------------------------------------------------------------------------------------- + v6.34 (20/12/20) @@ -60,15 +82,6 @@ Bug Fixes: 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/3982 -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 -- 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-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 -- DietPi-Software | Sonarr/Radarr/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 - -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v6.33 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f559dcbb3c..51960a65f4 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -65,8 +65,8 @@ [[ -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=34 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=3 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=35 + [[ $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 diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index bd1f64ef78..cbb92e1876 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -34 -3 +35 +-1 From f9ce83d5350b3836ea040828e07217fc0c6b2121 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 20 Dec 2020 21:49:24 +0100 Subject: [PATCH 002/218] v6.35 + DietPi-Survey_report | Syntax fix --- .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 ab17684674..6223de7a32 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -475,7 +475,7 @@ # v6.35 aSOFTWARE_NAME6_35=() - for i in "${!aSOFTWARE_NAME6_34@]}" + for i in "${!aSOFTWARE_NAME6_34[@]}" do # shellcheck disable=SC2034 aSOFTWARE_NAME6_35[$i]=${aSOFTWARE_NAME6_34[$i]} From 6fd7669fb1f06c2288447a18d188b140737b9731 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 20 Dec 2020 21:58:59 +0100 Subject: [PATCH 003/218] v6.35 + DietPi-Patch | Allow updating to v6.35 without endless loop xD --- dietpi/patch_file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 187381a736..c8f2f884ea 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2737,6 +2737,10 @@ _EOF_ G_CONFIG_INJECT 'memory_limit[[:blank:]]*=' 'memory_limit=512M' "$i" done #------------------------------------------------------------------------------- + + elif (( $G_DIETPI_VERSION_SUB == 34 )); then + + #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] From 9e8a6287e8871b39844753807e21faf467aae69c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 14:06:15 +0100 Subject: [PATCH 004/218] v6.35 + DietPi-PREP | Fix step headers, so that script name is on top of the HR and the step count and text below after "Step: " --- PREP_SYSTEM_FOR_DIETPI.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a08e4cb7bb..dde9266a86 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -256,7 +256,7 @@ _EOF_ # Init setup step headers SETUP_STEP=0 readonly G_NOTIFY_3_MODE='Step' - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Detecting existing DietPi system"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Detecting existing DietPi system"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ if [[ -d '/DietPi' || -d '/boot/dietpi' ]]; then @@ -294,7 +294,7 @@ _EOF_ fi #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Target system inputs"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Target system inputs"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ # Image creator @@ -597,7 +597,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 "Selected Debian version: $DISTRO_TARGET_NAME (ID: $DISTRO_TARGET)" #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Downloading and installing DietPi source code"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Downloading and installing DietPi source code"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ local url="https://github.com/$G_GITOWNER/DietPi/archive/$G_GITBRANCH.tar.gz" @@ -652,7 +652,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC systemctl daemon-reload #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] APT configuration"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] APT configuration"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" @@ -961,7 +961,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_AGA #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] APT installations"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] APT installations"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_AGDUG @@ -981,7 +981,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC_DESC='Preserving modified DEB package config files from now on' G_EXEC rm -v /etc/apt/apt.conf.d/98dietpi-forceconf #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Applying DietPi tweaks and cleanup"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Applying DietPi tweaks and cleanup"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 @@ -1690,7 +1690,7 @@ _EOF_ fi #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear From 9baa1af77146badea27a1c04511c69dcd47ae360 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 22:10:06 +0100 Subject: [PATCH 005/218] v6.35 + DietPi-Software | Rename "Minio" => "MinIO": https://min.io/ --- dietpi/dietpi-software | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfc51297f7..f0cb1fc962 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1013,7 +1013,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=158 - aSOFTWARE_NAME[$software_id]='Minio' + aSOFTWARE_NAME[$software_id]='MinIO' aSOFTWARE_DESC[$software_id]='S3 compatible distributed object server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 @@ -6019,7 +6019,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -12542,7 +12542,7 @@ _EOF_ fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12551,7 +12551,7 @@ _EOF_ [[ -f '/etc/default/minio' ]] || cat << '_EOF_' > /etc/default/minio # Default file path MINIO_VOLUMES="/mnt/dietpi_userdata/minio-data" -# Use if you want to run Minio on a custom port. +# Use if you want to run MinIO on a custom port. #MINIO_OPTS="--address :9199" # Access key of the server. #MINIO_ACCESS_KEY=Server-Access-Key @@ -15182,7 +15182,7 @@ _EOF_ fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling From fca150d22395737b75f3876bfe10d2b3e5622c30 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 22:14:36 +0100 Subject: [PATCH 006/218] v6.35 + DietPi-LetsEncrypt | Renamed "Minio" => "MinIO": https://min.io/ --- dietpi/dietpi-letsencrypt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 91c524e6d4..1b9d630ba2 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -19,7 +19,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-LetsEncrypt' + readonly G_PROGRAM_NAME='DietPi-LetsEncrypt' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -247,10 +247,10 @@ _EOF_ fi #------------------------------------------------------------------------------------------------------ - # Minio + # MinIO elif pgrep '[m]inio' > /dev/null; then - G_DIETPI-NOTIFY 0 'Minio S3 server detected' + G_DIETPI-NOTIFY 0 'MinIO S3 server detected' # Cert me up /boot/dietpi/dietpi-services stop @@ -298,7 +298,7 @@ _EOF_ # Create renewl script cat << _EOF_ > /home/minio-user/.minio/dietpi-cert-renewl.sh #!/bin/dash -# Minio only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned +# MinIO only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned systemctl stop minio # Ensure strict permissions while copying: @@ -318,15 +318,15 @@ _EOF_ # Change permissions on renewal script G_EXEC chmod +x /home/minio-user/.minio/dietpi-cert-renewl.sh - # Add Minio renewal to certbot system service + # Add MinIO renewal to certbot system service [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL" cat << _EOF_ > "$FP_RENEWAL"/dietpi-minio.conf [Service] ExecStartPost=/home/minio-user/.minio/dietpi-cert-renewl.sh &>> $FP_LOGFILE _EOF_ - # Inform user that HTTPS redirect and HSTS is not supported for Minio, if chosen - (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) && echo '[ INFO ] HTTPS redirect and HSTS is not supported for Minio, thus will be ignored.' | tee $FP_LOGFILE + # Inform user that HTTPS redirect and HSTS is not supported for MinIO, if chosen + (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) && echo '[ INFO ] HTTPS redirect and HSTS is not supported for MinIO, thus will be ignored.' | tee $FP_LOGFILE else @@ -336,7 +336,7 @@ Currently DietPi-LetsEncrypt configures the following web applications: - Apache2 (webserver) - Nginx (webserver) - Lighttpd (webserver) - - Minio S3 (object storage server)\n + - MinIO S3 (object storage server)\n Would you like to switch to DietPi-Software, to install one of the above?' && /boot/dietpi/dietpi-software return 1 From cbc4b49ccc3fe42f27c037f7ddcde6221be15515 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 22:15:13 +0100 Subject: [PATCH 007/218] v6.35 + DietPi-Survey_report | Renamed "Minio" => "MinIO": https://min.io/ --- .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 6223de7a32..81d3bf1bd8 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -331,7 +331,7 @@ aSOFTWARE_NAME[155]='HTPC Manager' aSOFTWARE_NAME[156]='Steam' aSOFTWARE_NAME[157]='Home Assistant' - aSOFTWARE_NAME[158]='Minio' + aSOFTWARE_NAME[158]='MinIO' aSOFTWARE_NAME[159]='Allo' aSOFTWARE_NAME[160]='Allo_update' aSOFTWARE_NAME[161]='FuguHub' From 55a89c88debeb0858f4dd564c754bb77be5367b6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 22:16:05 +0100 Subject: [PATCH 008/218] v6.35 + CHANGELOG | Renamed "Minio" => "MinIO": https://min.io/ --- CHANGELOG.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3070ec1996..73ce47ee07 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1354,8 +1354,8 @@ General | Resolved multiple issues with failed GNU key management during APT ins General | Resolved basic APT issues with Meveric's repo and failing dependencies. Debian repo is now used in the first instance: https://github.com/MichaIng/DietPi/pull/1571#issuecomment-369973745 General | DietPi-Globals are now loaded prior to login script. Ensures aliases are functional during exit of 1st run setup: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370149636 DietPi-Config | Resolved an issue with NTPD mode #4 (systemd) reporting dbus errors, dbus is now installed on demand: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370173703 -DietPi-LetsEncrypt | Lighttpd/Minio: Fixed auto renewal: https://github.com/MichaIng/DietPi/pull/1553 -DietPi-LetsEncrypt | Minio: Fixed an issue, where port 443 listening would fail due to missing libcap2-bin/setcap package: https://github.com/MichaIng/DietPi/pull/1553#issuecomment-368261474 +DietPi-LetsEncrypt | Lighttpd/MinIO: Fixed auto renewal: https://github.com/MichaIng/DietPi/pull/1553 +DietPi-LetsEncrypt | MinIO: Fixed an issue, where port 443 listening would fail due to missing libcap2-bin/setcap package: https://github.com/MichaIng/DietPi/pull/1553#issuecomment-368261474 DietPi-Software | Radarr/Sonarr: Reinstall patch, to bring binaries upto date, which resolves issues with the latest mono lib version: https://github.com/MichaIng/DietPi/issues/1566 DietPi-Software | Desktops: USB drive removed from .gtk-bookmarks as no longer used in DietPi. DietPi-Software | Shairport-Sync: Resolved ARMv6 binary Illegal instruction: https://github.com/MichaIng/DietPi/issues/1548 @@ -1379,7 +1379,7 @@ DietPi-Config | Display options > Resolution: Added fkms/kms (OpenGL) modes for DietPi-Config | Sparky SBC: Added option to select usb-dac-1.1 sound card, which will enable USB1.1 compatibility. DietPi-Config | WiFi: Now supports connecting to hidden WiFi networks, thanks @shahwahed : https://github.com/MichaIng/DietPi/pull/1497 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-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?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 From 1a10c45d60e5eea46d7df2e73d74a365cbe498eb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Dec 2020 22:24:17 +0100 Subject: [PATCH 009/218] v6.35 + DietPi-Patch | Renamed "Minio" => "MinIO": https://min.io/ + DietPi-Patch | Dropbear: Do not create DSS host key anymore. It is pretty outdated and should not be used anymore. Since Bullseye it is not shipped by default, but Ed25519 instead. --- dietpi/patch_file | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index c8f2f884ea..37e2676a9e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -359,7 +359,7 @@ APT::AutoRemove::SuggestsImportant "false"; _EOF_' #------------------------------------------------------------------------------- # Reinstalls: - # v6.5 Shairport-sync 3.1.7 + # v6.5 Shairport Sync 3.1.7 # RPi Cam # v6.26 Aria2 for .conf addition: https://github.com/MichaIng/DietPi/issues/1575#issuecomment-370248708 # v6.34 Sonarr/Radarr: https://github.com/MichaIng/DietPi/issues/1566#issuecomment-369334473 @@ -377,7 +377,7 @@ _EOF_' # Add certificate combining for Lighttpd to Certbot auto renewal: https://github.com/MichaIng/DietPi/pull/1553 if [[ -f '/boot/dietpi/.dietpi-letsencrypt' ]]; then - # Switch Minio to new certbot.service.d/ hook: + # Switch MinIO to new certbot.service.d/ hook: [[ -f '/etc/systemd/system/certbot.service' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[158\]=2' /boot/dietpi/.installed && rm /etc/systemd/system/certbot.service # Overall settings and config renewal, skip DietPi-Services: G_DIETPI_SERVICES_DISABLE=1 /boot/dietpi/dietpi-letsencrypt 1 @@ -489,12 +489,7 @@ _EOF_' [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && rm /etc/cron.d/make_nas_processes_faster #------------------------------------------------------------------------------- # Add Dropbear ecdsa and dss host keys, if missing: https://github.com/MichaIng/DietPi/issues/1670 - if command -v dropbearkey > /dev/null; then - - [[ -f '/etc/dropbear/dropbear_ecdsa_host_key' ]] || dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key - [[ -f '/etc/dropbear/dropbear_dss_host_key' ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key - - fi + command -v dropbearkey > /dev/null && [[ ! -f '/etc/dropbear/dropbear_ecdsa_host_key' ]] && dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key #------------------------------------------------------------------------------- # Reinstall firmware-misc-nonfree by default (Ralink): https://github.com/MichaIng/DietPi/issues/1675 (( $G_HW_MODEL == 21 )) || dpkg-query -s wpasupplicant &> /dev/null && G_AGI firmware-misc-nonfree From dc335bd76fbdd867b5c4f379a4c507d717d83094 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 23 Dec 2020 00:59:10 +0100 Subject: [PATCH 010/218] v6.35 + DietPi-PREP | Remove obsolete zsh configs from user profiles --- 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 dde9266a86..e22691e509 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1839,7 +1839,7 @@ _EOF_ G_EXEC rmdir /mnt/tmp_root G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' - rm -Rfv /{root,home/*}/.{bash_history,nano_history,wget-hsts,cache,local,config,gnupg,viminfo,dbus,gconf,nano,vim} + rm -Rfv /{root,home/*}/.{bash_history,nano_history,wget-hsts,cache,local,config,gnupg,viminfo,dbus,gconf,nano,vim,zshrc,oh-my-zsh} # Remove PREP script [[ -f $FP_PREP_SCRIPT ]] && rm -v "$FP_PREP_SCRIPT" From 3120ed5b241b64c60595ccb05cc1e4288d9cf564 Mon Sep 17 00:00:00 2001 From: ravenclaw900 <50060110+ravenclaw900@users.noreply.github.com> Date: Wed, 23 Dec 2020 06:40:55 -0600 Subject: [PATCH 011/218] v6.35 (#3995) + DietPi-Software | LXDE/LXQt: Allow configs to be pulled from custom GitHub repository owner instead of custom branch only --- dietpi/dietpi-software | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0cb1fc962..048874b63d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7166,10 +7166,10 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas # Openbox + PCmanFM + panel configs mkdir -p /root/.config/{openbox,pcmanfm/LXDE,lxpanel/LXDE/panels} - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -o /root/.config/openbox/lxde-rc.xml - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -o /root/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -o /root/.config/pcmanfm/LXDE/desktop-items-0.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -o /root/.config/lxpanel/LXDE/panels/panel + G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -o /root/.config/openbox/lxde-rc.xml + G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -o /root/.config/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -o /root/.config/pcmanfm/LXDE/desktop-items-0.conf + G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -o /root/.config/lxpanel/LXDE/panels/panel # Remove LXRandR menu item (monitor configuration tool as we set res in dietpi-config) [[ -f '/usr/share/applications/lxrandr.desktop' ]] && G_EXEC rm /usr/share/applications/lxrandr.desktop @@ -7217,7 +7217,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration # Configs - Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config + Download_Install "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config # Disable trash # - Skip on Buster since trash seems to be implemented differently: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-488085982 (( $G_DISTRO < 5 )) && G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf From 12052633fb99256ee695438f5c988cef8a62bba6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 23 Dec 2020 15:30:44 +0100 Subject: [PATCH 012/218] v6.35 + DietPi-Login | Create the "dietpi-nordvpn" alias unconditionally. The script handles a missing install gracefully and offers to do the install right away. It is especially unpleasing to not have the alias available after install, since it was needed to setup NordVPN server and credentials first, to have the service file created: https://github.com/MichaIng/DietPi/issues/3998 --- rootfs/etc/bashrc.d/dietpi.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index 8d54602fab..b92f243b7f 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -47,9 +47,9 @@ alias dietpi-wifidb='/boot/dietpi/func/dietpi-wifidb' alias dietpi-optimal_mtu='/boot/dietpi/func/dietpi-optimal_mtu' alias dietpi-cloudshell='/boot/dietpi/dietpi-cloudshell' + alias dietpi-nordvpn='/boot/dietpi/misc/dietpi-nordvpn' alias cpu='/boot/dietpi/dietpi-cpuinfo' # - Optional DietPi software aliases - [[ -f '/etc/systemd/system/dietpi-nordvpn.service' ]] && alias dietpi-nordvpn='/boot/dietpi/misc/dietpi-nordvpn' [[ -d '/mnt/dietpi_userdata/sonarr' || -d '/mnt/dietpi_userdata/radarr' || -d '/mnt/dietpi_userdata/lidarr' ]] && alias dietpi-arr_to_RAM='/boot/dietpi/misc/dietpi-arr_to_RAM' command -v kodi > /dev/null && alias startkodi='/boot/dietpi/misc/start_kodi' [[ -f '/usr/local/games/opentyrian/run' ]] && alias opentyrian='/usr/local/games/opentyrian/run' From 8a5d0931fcfb764511f941f3e8782573240ed991 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 25 Dec 2020 13:57:19 +0100 Subject: [PATCH 013/218] v6.34 + DietPi-Software | Bitwarden_RS: Add CA flag to self-signed certificate, required for iOS to allow import into trusted CA store: https://github.com/MichaIng/DietPi/issues/3724#issuecomment-750883187 --- dietpi/dietpi-software | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 048874b63d..6cd8f783fb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5525,11 +5525,11 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- [[ -d '/opt/bitwarden_rs' ]] && G_EXEC rm -R /opt/bitwarden_rs G_EXEC mv "bitwarden_rs-$version" /opt/bitwarden_rs - # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available and limit concurrent cargo build jobs to 2 if less than 3 GiB memory are available. + # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available and limit concurrent cargo build jobs to 2 if less than 3 GiB memory is available. local memory=$(free -tm | mawk '/^Total:/{print $2;exit}') jobs= if (( $memory < 1948 )) then - G_DIETPI-NOTIFY 2 'Bitwaden_RS build requires at least 2 GiB memory. We will now increase your swap file size to satisfy this requirement.' + G_DIETPI-NOTIFY 2 'Bitwaden_RS build requires at least 2 GiB memory. We will now increase your swap size to satisfy this requirement.' /boot/dietpi/func/dietpi-set_swapfile 1 (( $G_HW_CPU_CORES > 2 )) && jobs=2 @@ -5554,7 +5554,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_EXEC_NOHALT=1 G_EXEC rm rustup-init.sh G_EXEC . .cargo/env - # Build: Don't run multiple jobs concurrently, as one job can require > 500 MiB memory and can utilize all cores as well. + # Build G_EXEC cd /opt/bitwarden_rs G_EXEC_OUTPUT=1 G_EXEC cargo build ${jobs:+-j $jobs} --features sqlite --release G_EXEC cd /tmp/$G_PROGRAM_NAME @@ -5577,7 +5577,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' # Full path fails wget spider test... + INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz" /mnt/dietpi_userdata @@ -11852,6 +11852,7 @@ _EOF_ Banner_Configuration + # User Create_User -d /mnt/dietpi_userdata/bitwarden_rs bitwarden_rs # Data and config dir @@ -11863,7 +11864,7 @@ _EOF_ G_EXEC cp /opt/bitwarden_rs/.env.template /mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env G_CONFIG_INJECT 'DATA_FOLDER=' 'DATA_FOLDER=/mnt/dietpi_userdata/bitwarden_rs' /mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env # Create TLS certificate for web vault: Currently only RSA is supported. Add SAN with local IP and hostname, required for the client to accept the connection. - G_EXEC_OUTPUT=1 G_EXEC openssl req -reqexts SAN -subj '/CN=DietPi Bitwarden_RS' -config <(cat /etc/ssl/openssl.cnf <(echo -ne "[SAN]\nsubjectAltName=DNS:$( /etc/systemd/system/bitwarden_rs.service [Unit] Description=Bitwarden Server (Rust Edition) @@ -11934,7 +11935,6 @@ ExecStart=/mnt/dietpi_userdata/spotify-connect-web/spotify-connect-web [Install] WantedBy=multi-user.target _EOF_ - fi software_id=142 # CouchPotato From 4973b5202eeb86271126ba1f3e0d56549e023c9b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 25 Dec 2020 14:08:34 +0100 Subject: [PATCH 014/218] v6.35 + CHANGELOG | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 73ce47ee07..d99c55ae4f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes: New Software: Fixes: +- DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. 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/4XXX From 8eb0973a7dd8f3c6a7e58b8624a8509eea37fcf2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 25 Dec 2020 14:43:01 +0100 Subject: [PATCH 015/218] v6.35 + DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. --- dietpi/func/dietpi-set_swapfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-set_swapfile b/dietpi/func/dietpi-set_swapfile index 26688c9bef..51e5758cfb 100644 --- a/dietpi/func/dietpi-set_swapfile +++ b/dietpi/func/dietpi-set_swapfile @@ -38,14 +38,15 @@ SWAP_SIZE=$(mawk '$2=="file" {printf "%.0f",$3/1024;exit}' /proc/swaps) && disable_error=1 G_CHECK_VALIDINT "$SWAP_SIZE" || SWAP_SIZE=1 fi - # - Path: Store current saved (only absolute paths to exclude zram) and active paths for later use - SWAP_PATH_CURRENT=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=\//{s/^[^=]*=//p;q}' /boot/dietpi.txt) + # - Path: Store dietpi.txt entry (excluding zram-swap) and active swap files for disabling and removal before creating a new swap space + SWAP_PATH=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) read -ra SWAP_FILES_ACTIVE < <(mawk '$2=="file" {print $1}' /proc/swaps) + [[ $SWAP_PATH == '/'* && $SWAP_PATH != '/dev/zram0' ]] && SWAP_FILES_ACTIVE+=("$SWAP_PATH") if [[ $2 == '/'* || $2 == 'zram' || $2 == 'zram0' ]]; then SWAP_PATH=$2 - elif SWAP_PATH=$SWAP_PATH_CURRENT; [[ $SWAP_PATH != '/'* && $SWAP_PATH != 'zram' && $SWAP_PATH != 'zram0' ]]; then + elif [[ $SWAP_PATH != '/'* && $SWAP_PATH != 'zram' && $SWAP_PATH != 'zram0' ]]; then SWAP_PATH=$(mawk '$2=="file" {print $1;exit}' /proc/swaps) && [[ $SWAP_PATH == '/'* || $SWAP_PATH == 'zram' || $SWAP_PATH == 'zram0' ]] || SWAP_PATH='/var/swap' @@ -79,7 +80,7 @@ G_DIETPI-NOTIFY 2 'Disabling and deleting all existing swap files' G_EXEC_NOHALT=1 G_EXEC swapoff -a - rm -fv "$SWAP_PATH_CURRENT" "${SWAP_FILES_ACTIVE[@]}" + rm -fv "${SWAP_FILES_ACTIVE[@]}" sed -i '/[[:blank:]]swap[[:blank:]]/d' /etc/fstab # zram-swap [[ -f '/etc/modules-load.d/dietpi-zram-swap.conf' ]] && rm -v /etc/modules-load.d/dietpi-zram-swap.conf From c2a699612530c727aac3565e8c29b40b2152271b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 25 Dec 2020 14:44:23 +0100 Subject: [PATCH 016/218] v6.35 + CHANGELOG | DietPi-Set_swapfile: Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d99c55ae4f..7bf89fb2bf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes: New Software: Fixes: +- DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 - DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. 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/4XXX From 118627863eabdcdfeb5b87a54b5ec77f295a5007 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Sat, 26 Dec 2020 15:30:07 +0100 Subject: [PATCH 017/218] v6.35 (#4006) + DietPi-Software | Portainer: Ensure that post- and pre-v2.0 image versions of Portainer are detected during installation or removal --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6cd8f783fb..37cf3e94bb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12610,8 +12610,8 @@ _EOF_ # Check for existing portainer installation if [[ -d '/mnt/dietpi_userdata/docker-data/volumes/portainer_data' ]]; then G_DIETPI-NOTIFY 2 'Portainer detected, container will be dropped before reinstallation.' - G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer-ce/{print $1}')" --force - G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer-ce/{print $3}')" + G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1}')" --force + G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3}')" else # Create data directory G_EXEC docker volume create portainer_data @@ -15270,8 +15270,8 @@ _EOF_ G_EXEC systemctl restart docker # Remove portainer container, image & volume - G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer-ce/{print $1}')" --force - G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer-ce/{print $3}')" + G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1}')" --force + G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3}')" G_EXEC docker volume rm portainer_data fi From f0eae8ffb7bca1b1aa6779f4ad950ad0547f7569 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 26 Dec 2020 21:26:02 +0100 Subject: [PATCH 018/218] v6.35 + DietPi-Patch | Do not create dietpi-usb-storage_quirks.conf, as we do not statically apply USB quicks anymore + DietPi-Patch | Do not apply obsolete "ui" component on RPi Buster systems --- dietpi/patch_file | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 37e2676a9e..771632ac55 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1680,20 +1680,17 @@ Use "dietpi-config" to adjust these settings to your needs.' fi #------------------------------------------------------------------------------- - # Update x86_64 kernel module settings + # x86_64: Cleanup config files to disable nouveau if (( $G_HW_ARCH == 10 )); then - # Cleanup nouveau disabling rm -f /etc/modprobe.d/*nouveau* - cat << _EOF_ > /etc/modprobe.d/dietpi-disable_nouveau.conf + cat << '_EOF_' > /etc/modprobe.d/dietpi-disable_nouveau.conf blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off _EOF_ - # Apply usb-storage quirks to disable UAS for unsupported drives (Seagate ST5000LM000-2AN170): https://github.com/MichaIng/DietPi/issues/2905 - echo 'options usb-storage quirks=0bc2:ab30:u' > /etc/modprobe.d/dietpi-usb-storage_quirks.conf # Update initramfs with above changes if command -v update-tirfs > /dev/null; then @@ -1710,7 +1707,7 @@ _EOF_ # 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 + echo 'deb https://archive.raspberrypi.org/debian/ buster main' > /etc/apt/sources.list.d/raspi.list G_AGUP (( $G_HW_ARCH == 3 )) || G_AGI raspi-copies-and-fills From 9471b916f4c480b6f652f88e68abdd289837e113 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:09:58 +0100 Subject: [PATCH 019/218] v6.35 + DietPi-Services | Stop controlling obsolete CloudPrint but start controlling PHP8.0-FPM. Start HTPC Manager later, as it is a web UI frontend for various other software titles --- dietpi/dietpi-services | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 7fbd9831d3..00b5522e92 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -75,6 +75,7 @@ Available services: 'php7.2-fpm' 'php7.3-fpm' 'php7.4-fpm' + 'php8.0-fpm' # - Webservers 'apache2' @@ -133,7 +134,6 @@ Available services: 'radarr' 'lidarr' 'bazarr' - 'htpc-manager' 'deluge-web' # - Cloud/Backups @@ -157,7 +157,6 @@ Available services: 'raspimjpeg' # - Printing - 'cups' 'cloudprintd' # Remove in 2021 due to Google Cloud Print service shutdown 'octoprint' # - Social/Search @@ -189,6 +188,7 @@ Available services: 'netdata' 'rpimonitor' 'webmin' + 'htpc-manager' # - Misc 'docker' @@ -244,7 +244,7 @@ Available services: readonly FP_INCLUDE_EXCLUDE='/boot/dietpi/.dietpi-services_include_exclude' Process_Includes_Excludes(){ - [[ -f $FP_INCLUDE_EXCLUDE ]] || cat << _EOF_ > $FP_INCLUDE_EXCLUDE + [[ -f $FP_INCLUDE_EXCLUDE ]] || cat << '_EOF_' > $FP_INCLUDE_EXCLUDE # DietPi-Services Include/Exclude configuration # Include custom service (Use '+ servicename' without the comments to enable DietPi control of that service) From 9d34c2fe477fbc107c24a0f9cd15b8c642afba8e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:48:39 +0100 Subject: [PATCH 020/218] v6.35 + DietPi-Software | Pi-hole: Remove blocking page support, which will be removed from Pi-hole soon. It's implementation relies on fragile 404 handling, which means that actual 404 handling does not work. It means that every blocked request will instead be fully answered by the Pi-hole webserver, which means a massive overhead for both server and client. It cannot work on HTTPS resources since the certificate cannot match the domain which means that a shrinking minor part of the web is only supported anyway. Finally ads often open in small frames rather than full screen popups, which means that the blocking page is often practically not usable. Instead we revert to the Pi-hole developers recommended NULL blocking mode, which means that most clients won't even attempt to do any request to this domain, hence least overheads for clients, most time, battery and traffic savings. --- dietpi/dietpi-software | 55 ++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 37cf3e94bb..54d5d31273 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4184,10 +4184,10 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf INSTALL_URL_ADDRESS='https://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Check free available memory. Increase swap file size to prevent gravity running out of mem. + # Check free available memory. Increase swap size to prevent gravity running out of mem. if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )); then - G_DIETPI-NOTIFY 2 'Increasing swapfile size to 512 MiB for running gravity.sh, please wait...\n' + G_DIETPI-NOTIFY 2 'Increasing swap size to 512 MiB for running gravity.sh, please wait...\n' /boot/dietpi/func/dietpi-set_swapfile 512 fi @@ -4207,13 +4207,13 @@ _EOF_ fi # Install - curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh - chmod +x install.sh + G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh + G_EXEC chmod +x install.sh # - Skip Lighttpd install, since we allow to choose and install prior to Pi-hole # - Skip supported OS check. We do not support Debian testing suite but we are testing it already now. export PIHOLE_SKIP_OS_CHECK=true G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC ./install.sh --disable-install-webserver || aSOFTWARE_INSTALL_STATE[$software_id]=0 - rm install.sh + G_EXEC_NOHALT=1 G_EXEC rm install.sh fi @@ -4224,7 +4224,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/airsonic/airsonic/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" local fallback_url='https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*\.war"' | cut -d \" -f 4)" /mnt/dietpi_userdata/airsonic/airsonic.war + no_check_url=1 Download_Install "$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*\.war"/{print $4}')" /mnt/dietpi_userdata/airsonic/airsonic.war fi @@ -9340,11 +9340,11 @@ _EOF_ elif (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then # Enable required modules - a2enmod headers + G_EXEC a2enmod headers # Add and enable Pi-hole config dps_index=$software_id Download_Install 'apache.pihole.conf' /etc/apache2/sites-available/dietpi-pihole.conf - a2ensite dietpi-pihole + G_EXEC a2ensite dietpi-pihole # Optional config to block public access to admin panel dps_index=$software_id Download_Install 'apache.block_public_admin.conf' /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf @@ -9373,49 +9373,30 @@ You can always enable/disable this at a later point using the commands: - $disable_cmd\n Do you want to block public access to the admin panel now?" && eval "$enable_cmd" - # Create symlinks to align Pi-hole admin and blocking page relative to webroot + # Create symlinks to align Pi-hole admin and 404 page relative to webroot G_EXEC cd /var/www # - Move existing files/dirs out of the way [[ ! -L 'admin' && -e 'admin' ]] && mv -v admin admin.bak - ln -vsf html/admin admin + G_EXEC ln -sf html/admin admin [[ ! -L 'pihole' && -e 'pihole' ]] && mv -v pihole pihole.bak - ln -vsf html/pihole pihole + G_EXEC ln -sf html/pihole pihole - # Pi-hole v5: Add webserver user to dietpi group to allow gravity.db access: https://github.com/MichaIng/DietPi/issues/3391 + # Pi-hole v5: Add webserver user to pihole group to allow gravity.db access from web UI: https://github.com/MichaIng/DietPi/issues/3391 G_EXEC usermod -aG pihole www-data - # Ask user whether to show blocking page - G_WHIP_BUTTON_OK_TEXT='YES' - G_WHIP_BUTTON_CANCEL_TEXT='NO' - if G_WHIP_YESNO 'Pi-hole can show a blocking page, when clients access a blocked website. This allows you to whitelist domains directly from the blocking page and prevents the need to access the admin page or use the Pi-hole CLI for this.\n -The downside is additional traffic and less performance compared to a silent request block. Additional info can be found at: https://docs.pi-hole.net/ftldns/blockingmode/\n -Do you want to enable the Pi-hole blocking page?'; then - - G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf - # Enable 404 handler to rewrite all non-existent ad URL paths to blocking page - [[ -f '/etc/apache2/sites-available/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'ErrorDocument 404' 'ErrorDocument 404 /html/pihole/index.php' /etc/apache2/sites-available/dietpi-pihole.conf - [[ -f '/etc/nginx/sites-dietpi/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'error_page 404' 'error_page 404 /html/pihole/index.php;' /etc/nginx/sites-dietpi/dietpi-pihole.conf - [[ -f '/etc/lighttpd/conf-available/99-dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'server.error-handler-404' 'server.error-handler-404 = "/html/pihole/index.php"' /etc/lighttpd/conf-available/99-dietpi-pihole.conf - # Backup default index page to rewrite webroot ad URL paths to blocking page - [[ -f 'index.html' ]] && mv index.html index.html.bak - [[ -f 'index.lighttpd.html' ]] && mv index.lighttpd.html index.lighttpd.html.bak - [[ -f 'index.nginx-debian.html' ]] && mv index.nginx-debian.html index.nginx-debian.html.bak - - else - - G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=NULL' /etc/pihole/pihole-FTL.conf - - fi + # Apply most resource friendly and officially recommended NULL blocking: https://docs.pi-hole.net/ftldns/blockingmode/ + G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=NULL' /etc/pihole/pihole-FTL.conf # Failsafe: Reset permissions - cd /var/www/html/admin && git reset --hard HEAD + G_EXEC cd /var/www/html/admin + G_EXEC git reset --hard HEAD G_EXEC cd /tmp/$G_PROGRAM_NAME # Disable non-required dhcpcd, which is installed by Pi-hole installer systemctl disable --now dhcpcd # Disable pihole.log query logging: https://github.com/pi-hole/FTL/issues/614#issuecomment-510564476 - pihole -l off + G_EXEC pihole -l off # Set web interface PW: https://github.com/MichaIng/DietPi/issues/662 pihole -a -p "$GLOBAL_PW" @@ -14289,7 +14270,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - pihole uninstall + command -v pihole > /dev/null && pihole uninstall # pihole-FTL service+binary if [[ -f '/etc/init.d/pihole-FTL' ]]; then From ff0786b62230414b4a44bbab959027c648ad234a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:50:10 +0100 Subject: [PATCH 021/218] v6.35 + DietPi-Software | Pi-hole: Remove blocking page support which will be removed from Pi-hole --- .conf/dps_93/apache.pihole.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/.conf/dps_93/apache.pihole.conf b/.conf/dps_93/apache.pihole.conf index ac71caa7a0..289c886908 100644 --- a/.conf/dps_93/apache.pihole.conf +++ b/.conf/dps_93/apache.pihole.conf @@ -28,6 +28,3 @@ Require ip 127 192.168 10 172.16.0.0/12 - -# Enable blocking page via 404 handler -#ErrorDocument 404 /html/pihole/index.php From fa615c5a12bd9acd43cd2244118a58f021d8cc9c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:50:45 +0100 Subject: [PATCH 022/218] v6.35 + DietPi-Software | Pi-hole: Remove blocking page support which will be removed from Pi-hole --- .conf/dps_93/lighttpd.pihole.conf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.conf/dps_93/lighttpd.pihole.conf b/.conf/dps_93/lighttpd.pihole.conf index d3fbd1c095..981721aa2a 100644 --- a/.conf/dps_93/lighttpd.pihole.conf +++ b/.conf/dps_93/lighttpd.pihole.conf @@ -19,12 +19,9 @@ $HTTP["url"] =~ "^(/html)?/admin/\." { url.access-deny = ("") } -# Block public access to blocking page +# Block public access to 404 page $HTTP["url"] =~ "^(/html)?/pihole/" { $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." { url.access-deny = ("") } } - -# Enable blocking page via 404 handler -#server.error-handler-404 = "/html/pihole/index.php" From ad339d9da7e1f28715841bb2675564c420de38d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:52:40 +0100 Subject: [PATCH 023/218] v6.35 + DietPi-Software | Pi-hole: Remove blocking page support which will be removed from Pi-hole --- .conf/dps_93/nginx.pihole.conf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.conf/dps_93/nginx.pihole.conf b/.conf/dps_93/nginx.pihole.conf index 40d6e3db80..e3e77bd86d 100644 --- a/.conf/dps_93/nginx.pihole.conf +++ b/.conf/dps_93/nginx.pihole.conf @@ -29,9 +29,9 @@ location ~ ^(?:/html|)/admin(?:$|/) { } } -# Blocking page +# 404 page location ~ ^(?:/html|)/pihole(?:$|/) { - # Block public access to blocking page + # Block public access allow 127.0.0.0/8; allow 192.168.0.0/16; allow 10.0.0.0/8; @@ -45,6 +45,3 @@ location ~ ^(?:/html|)/pihole(?:$|/) { include snippets/fastcgi-php.conf; } } - -# Enable blocking page via 404 handler -#error_page 404 /html/pihole/index.php; From 9853df94c75558d18a5a8ab8c66132d988cea7f8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Dec 2020 13:53:23 +0100 Subject: [PATCH 024/218] v6.35 + DietPi-Software | Pi-hole: Tiny --- .conf/dps_93/apache.pihole.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_93/apache.pihole.conf b/.conf/dps_93/apache.pihole.conf index 289c886908..c9f87ac2a6 100644 --- a/.conf/dps_93/apache.pihole.conf +++ b/.conf/dps_93/apache.pihole.conf @@ -24,7 +24,7 @@ -# Block public access to blocking page +# Block public access to 404 page Require ip 127 192.168 10 172.16.0.0/12 From b15c110150e9e2aa1ffd1622f6ddcff2da5ee1aa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Dec 2020 16:42:54 +0100 Subject: [PATCH 025/218] v6.35 + DietPi-PREP | Make it clear that Odroid C4 and HC4 are cross-compatible --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e22691e509..15e965006f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -373,7 +373,7 @@ _EOF_ G_WHIP_MENU_ARRAY=( '' '●─ ARM ─ Core devices with GPU support ' - '0' ': Raspberry Pi (All models)' + '0' ': Raspberry Pi (all models)' #'0' ': Raspberry Pi 1 (256 MiB) #'1' ': Raspberry Pi 1/Zero (512 MiB)' #'2' ': Raspberry Pi 2' @@ -382,7 +382,7 @@ _EOF_ '11' ': Odroid XU3/XU4/MC1/HC1/HC2' '12' ': Odroid C2' '15' ': Odroid N2' - '16' ': Odroid C4' + '16' ': Odroid C4/HC4' '44' ': Pinebook' '' '●─ x86_64 ' '21' ': x86_64 Native PC' From 4d9cf8f51922bda6f7a6a465eaaa588257c47f8f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Dec 2020 16:44:14 +0100 Subject: [PATCH 026/218] v6.35 + DietPi-Obtain_HW_model | Make it clear by name that Odroid C4 and HC4 are cross-compatible --- dietpi/func/dietpi-obtain_hw_model | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index f40a8c845d..c32ff2e5ef 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -60,7 +60,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 16 Odroid C4/HC4 # G_HW_MODEL 15 Odroid N2 # G_HW_MODEL 14 Odroid N1 # G_HW_MODEL 13 Odroid U3 @@ -506,7 +506,7 @@ elif (( $G_HW_MODEL == 16 )); then - G_HW_MODEL_NAME='Odroid C4' + G_HW_MODEL_NAME='Odroid C4/HC4' elif (( $G_HW_MODEL == 15 )); then From a23d799a9c61c4b9c8df1a09a9b6a51a0e31e7c4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Dec 2020 18:43:16 +0100 Subject: [PATCH 027/218] v6.35 + DietPi-Software | Unbound: Add default config file as GitHub download --- .conf/dps_182/unbound.conf | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .conf/dps_182/unbound.conf diff --git a/.conf/dps_182/unbound.conf b/.conf/dps_182/unbound.conf new file mode 100644 index 0000000000..3b5ee5b804 --- /dev/null +++ b/.conf/dps_182/unbound.conf @@ -0,0 +1,81 @@ +server: + verbosity: 0 + + interface: 0.0.0.0 + port: 53 + do-ip4: yes + do-udp: yes + do-tcp: yes + + do-ip6: yes + prefer-ip6: no + + root-hints: "/var/lib/unbound/root.hints" + + harden-glue: yes + harden-large-queries: yes + + harden-dnssec-stripped: yes + + use-caps-for-id: yes + + edns-buffer-size: 1472 + + rrset-roundrobin: yes + + cache-min-ttl: 300 + cache-max-ttl: 86400 + + serve-expired: yes + + harden-algo-downgrade: yes + + harden-short-bufsize: yes + + hide-identity: yes + + identity: "Server" + + hide-version: yes + + do-daemonize: no + + neg-cache-size: 4M + + qname-minimisation: yes + + minimal-responses: yes + + prefetch: yes + prefetch-key: yes + + num-threads: 1 + + msg-cache-size: 50m + rrset-cache-size: 100m + + so-reuseport: yes + + so-rcvbuf: 4m + so-sndbuf: 4m + + unwanted-reply-threshold: 10000 + + ratelimit: 1000 + + log-queries: no + log-replies: no + logfile: '' + + access-control: 0.0.0.0/0 refuse + access-control: 10.0.0.0/8 allow + access-control: 127.0.0.1/8 allow + access-control: 172.16.0.0/12 allow + access-control: 192.168.0.0/16 allow + + private-address: 10.0.0.0/8 + private-address: 172.16.0.0/12 + private-address: 192.168.0.0/16 + private-address: 169.254.0.0/16 + private-address: fd00::/8 + private-address: fe80::/10 From d0d49f3573bd4bff34c4e0d0189164b54d4ee376 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Dec 2020 23:48:29 +0100 Subject: [PATCH 028/218] v6.35 + DietPi-Software | Unbound: Pre-configure Unbound before installing it to avoid port binding conflicts right from the start + DietPi-Software | Unbound: Install it before installing Pi-hole so that it can be used as upstream DNS directly + DietPi-Software | Unbound: Use port 5335 by default when configuring it for Pi-hole since port 5353 is used for mDNS (Multicast DNS) + DietPi-Software | Unbound: Whenever changing the Unbound port, assure that there is another upstream DNS server configured in /etc/resolv.conf + DietPi-Software | Unbound: Do not overwrite an existing configuration file. Config overrides do not in cases where the setting is allowed multiple times, hence in case of interface (IP bindings) private and allowed IP ranges, users might need to configure our base config, which must be preserved. + DietPi-Software | Pi-hole: When changing the upstream DNS, apply it directly via dnsmasq config and restart FTL to immediately use it. + DietPi-Software | Spotify Connect Web: Enhance uninstall --- dietpi/dietpi-software | 237 +++++++++++++++-------------------------- 1 file changed, 87 insertions(+), 150 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 54d5d31273..d3862ef39a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4176,45 +4176,99 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf fi - software_id=93 # Pi-hole - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + software_id=182 # Unbound + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + G_DIETPI-NOTIFY 2 'Pre-configuring Unbound to avoid port binding conflicts' + + # Download/update list of root hints + Download_Install 'https://www.internic.net/domain/named.root' /var/lib/unbound/root.hints + + # Download base configuration if it does not exist yet + [[ -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] || dps_index=$software_id Download_Install 'unbound.conf' /etc/unbound/unbound.conf.d/dietpi.conf + + # Toggle IPv6 preference based on dietpi.txt settings + if grep -q 'CONFIG_ENABLE_IPV6=0' /boot/dietpi.txt + then + G_CONFIG_INJECT 'do-ip6:[[:blank:]]' ' do-ip6: no' /etc/unbound/unbound.conf.d/dietpi.conf + + elif grep -q 'CONFIG_PREFER_IPV4=0' /boot/dietpi.txt + then + G_CONFIG_INJECT 'prefer-ip6:[[:blank:]]' ' prefer-ip6: yes' /etc/unbound/unbound.conf.d/dietpi.conf + fi + + # Stretch: Remove incompatile setting + (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf + + # Pi-hole + if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf + then + G_DIETPI-NOTIFY 2 'Configuring Unbound to work for Pi-hole' + grep '^[[:blank:]]*nameserver[[:blank:]]' /etc/resolv.conf | grep -qvE '[[:blank:]]127.0.0.1(:53)?$' || echo 'nameserver 9.9.9.9' >> /etc/resolv.conf # Failsafe + G_CONFIG_INJECT 'port:[[:blank:]]' ' port: 5335' /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'interface:[[:blank:]]' ' interface: 127.0.0.1' /etc/unbound/unbound.conf.d/dietpi.conf + fi + [[ -f '/lib/systemd/system/unbound.service' ]] && G_EXEC systemctl restart unbound + G_AGI unbound + G_EXEC systemctl enable --now unbound # failsafe + + # Pi-hole + if (( ${aSOFTWARE_INSTALL_STATE[93]} == 2 )) + then + G_DIETPI-NOTIFY 2 'Configuring Pi-hole to use Unbound' + if [[ -f '/etc/dnsmasq.d/01-pihole.conf' ]] + then + G_EXEC sed -i '/^[[:blank:]]*server=/d' /etc/dnsmasq.d/01-pihole.conf + G_CONFIG_INJECT 'server=' 'server=127.0.0.1#5335' /etc/dnsmasq.d/01-pihole.conf + systemctl -q is-active pihole-FTL && G_EXEC systemctl restart pihole-FTL + fi + if [[ -f '/etc/pihole/setupVars.conf' ]] + then + G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=127.0.0.1#5335' /etc/pihole/setupVars.conf + G_EXEC sed -i '/^[[:blank:]]*PIHOLE_DNS_2=/d' /etc/pihole/setupVars.conf + fi + fi + fi + + software_id=93 # Pi-hole + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then Banner_Installing INSTALL_URL_ADDRESS='https://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" # Check free available memory. Increase swap size to prevent gravity running out of mem. - if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )); then - + if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) + then G_DIETPI-NOTIFY 2 'Increasing swap size to 512 MiB for running gravity.sh, please wait...\n' /boot/dietpi/func/dietpi-set_swapfile 512 - fi # Dependencies: https://github.com/pi-hole/pi-hole/blob/development/automated%20install/basic-install.sh#L250 G_AGI $PHP_NAME-xml $PHP_NAME-sqlite3 $PHP_NAME-intl - # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[182]} > 1 )) && [[ ! -f '/etc/unbound/unbound.conf.d/dietpi-pihole.conf' ]] + # Unbound: Switch port to 5335 if it was installed before, else it got just configured within its install step above + if (( ${aSOFTWARE_INSTALL_STATE[182]} == 2 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf then - G_WHIP_MSG 'You are installing Pi-hole while Unbound is already installed. The Unbound port will be changed to 5353.\n\nTo add it to Pi-hole, change one of your DNS servers to 127.0.0.1:5353.' - cat << '_EOF_' > /etc/unbound/unbound.conf.d/dietpi-pihole.conf -port: 5353 -interface: 127.0.0.1 -_EOF_ + G_WHIP_MSG 'You are installing Pi-hole while Unbound is already installed. The Unbound port will be changed to 5335.\n\nTo add it to Pi-hole, set "127.0.0.1#5335" as only custom (IPv4) upstream DNS server.' + grep '^[[:blank:]]*nameserver[[:blank:]]' /etc/resolv.conf | grep -qvE '[[:blank:]]127.0.0.1(:53)?$' || echo 'nameserver 9.9.9.9' >> /etc/resolv.conf # Failsafe + G_CONFIG_INJECT 'port:[[:blank:]]' ' port: 5335' /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'interface:[[:blank:]]' ' interface: 127.0.0.1' /etc/unbound/unbound.conf.d/dietpi.conf G_EXEC systemctl restart unbound fi # Install G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh G_EXEC chmod +x install.sh - # - Skip Lighttpd install, since we allow to choose and install prior to Pi-hole + # - Skip web server install, since we allow to choose and install it prior to Pi-hole # - Skip supported OS check. We do not support Debian testing suite but we are testing it already now. export PIHOLE_SKIP_OS_CHECK=true G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC ./install.sh --disable-install-webserver || aSOFTWARE_INSTALL_STATE[$software_id]=0 G_EXEC_NOHALT=1 G_EXEC rm install.sh - fi software_id=33 # Airsonic @@ -7023,14 +7077,6 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) - then - Banner_Installing - G_AGI unbound - G_DIETPI-NOTIFY 2 'It is possible that Unbound just gave an error. This is safe to ignore.' - fi - } Apply_SSHServer_Choices(){ @@ -8690,123 +8736,6 @@ _EOF_ fi - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Download list of root hints - Download_Install https://www.internic.net/domain/named.root /var/lib/unbound/root.hints - - cat << _EOF_ > /etc/unbound/unbound.conf.d/dietpi.conf -server: - verbosity: 0 - - interface: 0.0.0.0 - port: 53 - do-ip4: yes - do-udp: yes - do-tcp: yes - - do-ip6: yes - - prefer-ip6: no - - root-hints: "/var/lib/unbound/root.hints" - - harden-glue: yes - harden-large-queries: yes - - harden-dnssec-stripped: yes - - use-caps-for-id: yes - - edns-buffer-size: 1472 - - rrset-roundrobin: yes - - cache-min-ttl: 300 - cache-max-ttl: 86400 - - serve-expired: yes - - harden-algo-downgrade: yes - - harden-short-bufsize: yes - - hide-identity: yes - - identity: "Server" - - hide-version: yes - - do-daemonize: no - - neg-cache-size: 4M - - qname-minimisation: yes - - minimal-responses: yes - - prefetch: yes - prefetch-key: yes - - num-threads: 1 - - msg-cache-size: 50m - rrset-cache-size: 100m - - so-reuseport: yes - - so-rcvbuf: 4m - so-sndbuf: 4m - - unwanted-reply-threshold: 10000 - - ratelimit: 1000 - - log-queries: no - log-replies: no - logfile: '' - - access-control: 0.0.0.0/0 refuse - access-control: 127.0.0.1 allow - access-control: $(hostname -I | grep -o '192.168.[[:digit:]]').0/24 allow - - private-address: 192.168.0.0/16 - private-address: 169.254.0.0/16 - private-address: 172.16.0.0/12 - private-address: 10.0.0.0/8 - private-address: fd00::/8 - private-address: fe80::/10 -_EOF_ - # Configuration - if grep -q 'CONFIG_ENABLE_IPV6=0' /boot/dietpi.txt - then - G_CONFIG_INJECT 'do-ip6:[[:blank:]]' ' do-ip6: no' /etc/unbound/unbound.conf.d/dietpi.conf - - elif grep -q 'CONFIG_PREFER_IPV4=0' /boot/dietpi.txt - then - G_CONFIG_INJECT 'prefer-ip6:[[:blank:]]' ' prefer-ip6: yes' /etc/unbound/unbound.conf.d/dietpi.conf - fi - - (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf - - if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) - then - G_DIETPI-NOTIFY 2 'Configuring Unbound to work with Pi-hole' - cat << '_EOF_' > /etc/unbound/unbound.conf.d/dietpi-pihole.conf -port: 5353 -interface: 127.0.0.1 -_EOF_ - G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=127.0.0.1#5353' /etc/pihole/setupVars.conf - G_CONFIG_INJECT 'PIHOLE_DNS_2=' 'PIHOLE_DNS_2=' /etc/pihole/setupVars.conf - fi - - G_EXEC systemctl restart unbound - - fi - software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -13785,25 +13714,33 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm -R /mnt/dietpi_userdata/spotify-connect-web - rm /etc/systemd/system/spotify-connect-web.service + if [[ -f '/etc/systemd/system/spotify-connect-web.service' ]]; then - fi + systemctl disable --now spotify-connect-web + rm -R /etc/systemd/system/spotify-connect-web.service* - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + fi + [[ -d '/etc/systemd/system/spotify-connect-web.service.d' ]] && rm -R /etc/systemd/system/spotify-connect-web.service.d + [[ -d '/mnt/dietpi_userdata/spotify-connect-web' ]] && rm -R /mnt/dietpi_userdata/spotify-connect-web - Banner_Uninstalling + fi - G_AGP unbound - [[ -d '/etc/unbound' ]] && rm -R /etc/unbound + software_id=182 # Unbound + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling - if [[ -f '/etc/pihole/setupVars.conf' ]] && grep -q 'PIHOLE_DNS_1=127.0.0.1#5353' /etc/pihole/setupVars.conf + # Pi-hole: Assure that it does not resolve via Unbound anymore + if [[ -f '/etc/dnsmasq.d/01-pihole.conf' ]] && grep -q '^[[:blank:]]*server=127.0.0.1' /etc/dnsmasq.d/01-pihole.conf then G_WHIP_MSG 'The Pi-hole upstream DNS server has been changed to Quad9 due to Unbound being uninstalled.' - G_CONFIG_INJECT 'PIHOLE_DNS_1=' "PIHOLE_DNS_1=9.9.9.9" /etc/pihole/setupVars.conf - fi + G_CONFIG_INJECT 'server=127.0.0.1' 'server=9.9.9.9' /etc/dnsmasq.d/01-pihole.conf + systemctl -q is-active pihole-FTL && G_EXEC systemctl restart pihole-FTL + if + [[ -f '/etc/pihole/setupVars.conf' ]] && grep -q '^[[:blank:]]*PIHOLE_DNS_1=127.0.0.1' /etc/pihole/setupVars.conf && G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=9.9.9.9' /etc/pihole/setupVars.conf + G_AGP unbound + [[ -d '/etc/unbound' ]] && rm -R /etc/unbound fi software_id=142 # CouchPotato From d6d8900677d1f4e7eb25db739f2fca930fb49431 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 1 Jan 2021 16:26:43 +0100 Subject: [PATCH 029/218] v6.35 + DietPi-Software | Unbound: Syntax --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d3862ef39a..e186d04780 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13736,7 +13736,7 @@ _EOF_ G_WHIP_MSG 'The Pi-hole upstream DNS server has been changed to Quad9 due to Unbound being uninstalled.' G_CONFIG_INJECT 'server=127.0.0.1' 'server=9.9.9.9' /etc/dnsmasq.d/01-pihole.conf systemctl -q is-active pihole-FTL && G_EXEC systemctl restart pihole-FTL - if + fi [[ -f '/etc/pihole/setupVars.conf' ]] && grep -q '^[[:blank:]]*PIHOLE_DNS_1=127.0.0.1' /etc/pihole/setupVars.conf && G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=9.9.9.9' /etc/pihole/setupVars.conf G_AGP unbound From 44d242943cc9ee7d2cf56b46cb4daba54b24bd84 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 1 Jan 2021 20:13:51 +0100 Subject: [PATCH 030/218] v6.35 + DietPi-Software | Unbound: Sort and comment default config file --- .conf/dps_182/unbound.conf | 115 ++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/.conf/dps_182/unbound.conf b/.conf/dps_182/unbound.conf index 3b5ee5b804..3ab28d61c2 100644 --- a/.conf/dps_182/unbound.conf +++ b/.conf/dps_182/unbound.conf @@ -1,81 +1,88 @@ +# https://nlnetlabs.nl/documentation/unbound/unbound.conf/ server: + # Do not daemonize, to allow proper systemd service control and status estimation. + do-daemonize: no + + # A single thread is pretty sufficient for home or small office instances. + num-threads: 1 + + # Logging: For the sake of privacy and performance, keep logging at a minimum! + # - Verbosity 2 and up practically contains query and reply logs. verbosity: 0 + log-queries: no + log-replies: no + # - If required, uncomment to log to a file, else logs are available via "journalctl -u unbound". + #logfile: "/var/log/unbound.log" + # Set interface to "0.0.0.0" to make Unbound listen on all network interfaces. + # Set it to "127.0.0.1" to listen on requests from the same machine only, useful in combination with Pi-hole. interface: 0.0.0.0 + # Default DNS port is "53", mDNS is "5353", so "5335" is best in combination with Pi-hole. port: 53 - do-ip4: yes + + # Control IP ranges which should be able to use this Unbound instance. + # The DietPi defaults permit access from official local network IP ranges only, hence requests from www are denied. + access-control: 0.0.0.0/0 refuse + access-control: 10.0.0.0/8 allow + access-control: 127.0.0.1/8 allow + access-control: 172.16.0.0/12 allow + access-control: 192.168.0.0/16 allow + + # Private IP ranges, which shall never be returned or forwarded as public DNS response. + # NB: 127.0.0.1/8 is sometimes used by adblock lists, hence DietPi by default allows those as response. + private-address: 10.0.0.0/8 + private-address: 172.16.0.0/12 + private-address: 192.168.0.0/16 + private-address: 169.254.0.0/16 + private-address: fd00::/8 + private-address: fe80::/10 + + # Define protocols for connections to and from Unbound. + # NB: Disabling IPv6 does not disable IPv6 IP resolving, which depends on the clients request. do-udp: yes do-tcp: yes - + do-ip4: yes do-ip6: yes prefer-ip6: no + # DNS root server information file. Update regularly via: "curl -# https://www.internic.net/domain/named.root > /var/lib/unbound/root.hints" root-hints: "/var/lib/unbound/root.hints" - harden-glue: yes - harden-large-queries: yes - - harden-dnssec-stripped: yes + # Maximum number of queries per second + ratelimit: 1000 - use-caps-for-id: yes + # Defend against and print warning when reaching unwanted reply limit. + unwanted-reply-threshold: 10000 - edns-buffer-size: 1472 + # Set EDNS reassembly buffer size to match new upstream default, as of DNS Flag Day 2020 recommendation. + edns-buffer-size: 1232 - rrset-roundrobin: yes - - cache-min-ttl: 300 - cache-max-ttl: 86400 - - serve-expired: yes + # Increase incoming and outgoing query buffer size to cover traffic peaks. + so-rcvbuf: 4m + so-sndbuf: 4m + # Hardening + harden-glue: yes + harden-dnssec-stripped: yes harden-algo-downgrade: yes - + harden-large-queries: yes harden-short-bufsize: yes + # Privacy + use-caps-for-id: yes # Spoof protection by randomising capitalisation + rrset-roundrobin: yes + qname-minimisation: yes + minimal-responses: yes hide-identity: yes - - identity: "Server" - + identity: "Server" # Purposefully a dummy identity name hide-version: yes - do-daemonize: no - + # Caching + cache-min-ttl: 300 + cache-max-ttl: 86400 + serve-expired: yes neg-cache-size: 4M - - qname-minimisation: yes - - minimal-responses: yes - prefetch: yes prefetch-key: yes - - num-threads: 1 - msg-cache-size: 50m rrset-cache-size: 100m - - so-reuseport: yes - - so-rcvbuf: 4m - so-sndbuf: 4m - - unwanted-reply-threshold: 10000 - - ratelimit: 1000 - - log-queries: no - log-replies: no - logfile: '' - - access-control: 0.0.0.0/0 refuse - access-control: 10.0.0.0/8 allow - access-control: 127.0.0.1/8 allow - access-control: 172.16.0.0/12 allow - access-control: 192.168.0.0/16 allow - - private-address: 10.0.0.0/8 - private-address: 172.16.0.0/12 - private-address: 192.168.0.0/16 - private-address: 169.254.0.0/16 - private-address: fd00::/8 - private-address: fe80::/10 From 771f3631b9a57c025b324736d376695fecf45c28 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 1 Jan 2021 22:24:40 +0100 Subject: [PATCH 031/218] v6.35 + DietPi-Survey_report | Uploads not updated since first half of 2020 have been achieved --- .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 81d3bf1bd8..548ad8240f 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -881,7 +881,7 @@

DietPi-Survey statistics

-

Uploads since: 2020-01-01 00:00:00 UTC

+

Uploads since: 2020-07-01 00:00:00 UTC +0100

Last update: $(TZ=UTC date '+%Y-%m-%d %T UTC')


From 6ce87bd57f2e81a714723c601846297da7ee1a73 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 3 Jan 2021 02:11:15 +0100 Subject: [PATCH 032/218] v6.35 + DietPi-Services | Remove dnsmasq completely. We show its status as being part of Pi-hole, but since v4 with FTLDNS, that is not the case anymore. --- dietpi/dietpi-services | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 00b5522e92..87d47d1dfe 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -211,14 +211,13 @@ Available services: # Misc aSERVICE_NAME+=('fail2ban') # Brute-force protection, which should not be stopped during updates/installs etc #aSERVICE_NAME+=('systemd-timesyncd') # Network time sync: DietPi stops this by default after success, may confuse user/prompt questions. - aSERVICE_NAME+=('dnsmasq') # https://github.com/MichaIng/DietPi/issues/1501 aSERVICE_NAME+=('pihole-FTL') # https://github.com/MichaIng/DietPi/issues/1696 aSERVICE_NAME+=('openvpn') # https://github.com/MichaIng/DietPi/issues/1501 aSERVICE_NAME+=('vncserver') # DietPi VNC Server aSERVICE_NAME+=('nxserver') # NoMachine Server aSERVICE_NAME+=('xrdp') # XRDP Server aSERVICE_NAME+=('amiberry') # DietPi Amiberry service - aSERVICE_NAME+=('unbound') # Unbound DNS server, could be currently used by machine + aSERVICE_NAME+=('unbound') # Unbound DNS server, could be currently used by machine #aSERVICE_NAME+=('wg-quick@wg0') # WireGuard: Currently instantiated services are not supported # DietPi From 2dca0267d310a4b0cf83ce71c06427258fcb7596 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Jan 2021 17:29:30 +0100 Subject: [PATCH 033/218] v6.35 + DietPi-Software | Unbound: Rephrase DNS port comment --- .conf/dps_182/unbound.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_182/unbound.conf b/.conf/dps_182/unbound.conf index 3ab28d61c2..0006fbfe6e 100644 --- a/.conf/dps_182/unbound.conf +++ b/.conf/dps_182/unbound.conf @@ -17,7 +17,7 @@ server: # Set interface to "0.0.0.0" to make Unbound listen on all network interfaces. # Set it to "127.0.0.1" to listen on requests from the same machine only, useful in combination with Pi-hole. interface: 0.0.0.0 - # Default DNS port is "53", mDNS is "5353", so "5335" is best in combination with Pi-hole. + # Default DNS port is "53". When used with Pi-hole, set this to e.g. "5335", since "5353" is used by mDNS already. port: 53 # Control IP ranges which should be able to use this Unbound instance. From 86efdd939417f2459d2392a6a076bc026998eb76 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Jan 2021 17:50:26 +0100 Subject: [PATCH 034/218] v6.35 + DietPi-Patch | Unbound: Merge dietpi-pihole.conf into dietpi.conf --- dietpi/patch_file | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 771632ac55..6bee7c1abe 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2732,6 +2732,17 @@ _EOF_ elif (( $G_DIETPI_VERSION_SUB == 34 )); then + #------------------------------------------------------------------------------- + # Unbound: Merge dietpi-pihole.conf into dietpi.conf + if [[ -f '/etc/unbound/unbound.conf.d/dietpi-pihole.conf' && -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] + then + G_DIETPI-NOTIFY 2 'Unbound: Merging dietpi-pihole.conf into dietpi.conf' + local interface=$(mawk '/^[ \t]*interface:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) + local port=$(mawk '/^[ \t]*port:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) + G_CONFIG_INJECT 'interface:[[:blank:]]' " interface: $interface" /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'port:[[:blank:]]' " port: $port" /etc/unbound/unbound.conf.d/dietpi.conf + G_EXEC rm /etc/unbound/unbound.conf.d/dietpi-pihole.conf + fi #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls From 979e7c3eb219fe0b08adc917038a0a18a4c08cf7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Jan 2021 18:11:06 +0100 Subject: [PATCH 035/218] v6.35 + CHANGELOG | Unbound: Add fixes and changes --- CHANGELOG.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7bf89fb2bf..4bd433d14a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,12 +2,15 @@ v6.35 (2021-01-XX) Changes: +- DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. New Software: Fixes: - DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 - DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. +- DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 +- DietPi-Software | Unbound: Resolved an issue where the service start failed if the host system had a local IP address outside of the 192.168.0.0/16 subnet. Many thanks to @faxesystem for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-749174984 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/4XXX From d1f131e5aaeec80131a99c27d575c47055d8eb91 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Jan 2021 18:27:31 +0100 Subject: [PATCH 036/218] v6.35 + DietPi-Software | Unbound: Add access control for IPv6, since we set "do-ip6: yes", if IPv6 is enabled, which does not only allow Unbound to connect via IPv6 to upstream/DNS root but allows clients to connect to it via IPv6 as well. --- .conf/dps_182/unbound.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.conf/dps_182/unbound.conf b/.conf/dps_182/unbound.conf index 0006fbfe6e..99e9140dc0 100644 --- a/.conf/dps_182/unbound.conf +++ b/.conf/dps_182/unbound.conf @@ -27,6 +27,10 @@ server: access-control: 127.0.0.1/8 allow access-control: 172.16.0.0/12 allow access-control: 192.168.0.0/16 allow + access-control: ::/0 refuse + access-control: ::1/128 allow + access-control: fd00::/8 allow + access-control: fe80::/10 allow # Private IP ranges, which shall never be returned or forwarded as public DNS response. # NB: 127.0.0.1/8 is sometimes used by adblock lists, hence DietPi by default allows those as response. From 44706045d5b9747b06e253f7ea3bea0e84716aa5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Jan 2021 18:30:56 +0100 Subject: [PATCH 037/218] v6.35 + CHANGELOG | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4bd433d14a..4a630698c3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.35 Changes: - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. +- DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. New Software: From 4e6c901e6ed85ebdc3a9395ed1b7a75ef3029afb Mon Sep 17 00:00:00 2001 From: StephanStS Date: Wed, 6 Jan 2021 22:14:47 +0100 Subject: [PATCH 038/218] v6.35 (#4042) + DietPi-Software | Change documentation links from phpBB to new MkDocs-based documentation pages --- dietpi/dietpi-software | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e186d04780..d1e0d4394a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16471,7 +16471,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[68]} == 1 )); then G_WHIP_MSG 'Remot3.it requires you to create an online account, and, link it this device. -\nOnce 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' +\nOnce DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/docs/software/remote_desktop/#remot3it' fi @@ -16479,7 +16479,7 @@ _EOF_ 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?p=1062#p1062' + - 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/docs/software/system_security/#lets-encrypt' fi @@ -16488,7 +16488,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then 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 +\n - More information:\nhttps://dietpi.com/docs/software/advanced_networking/#no-ip'; then # Write installed states to temp Write_InstallFileList temp @@ -16737,7 +16737,7 @@ _EOF_ \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. -\nMore info: https://dietpi.com/phpbb/viewtopic.php?p=19#p19'; then +\nMore info: https://dietpi.com/docs/dietpi_tools/#quick-selections'; then # Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then @@ -16850,7 +16850,7 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Back' if G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc. -\nMore information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087 +\nMore information on user data in DietPi:\n- https://dietpi.com/docs/dietpi_tools/#quick-selections \n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.'; then # DriveMan @@ -16922,7 +16922,7 @@ _EOF_ 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?p=1549#p1549: + if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/docs/dietpi_tools/#quick-selections: \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 @@ -17012,30 +17012,25 @@ _EOF_ Welcome to DietPi: ─────────────────────────────────────────────────────────────── Use PageUp/Down or Arrow Up/Down to scroll this help screen. -Press ESC, or TAB then enter to exit this help screen.\n +Press ESC, or TAB then ENTER to exit this help screen.\n Easy to follow, step by step guides for installing DietPi: -https://dietpi.com/phpbb/viewtopic.php?f=8&t=9\n +https://dietpi.com/docs/user-guide_installation/\n For a list of all installation options and their details: -https://dietpi.com/software\n +https://dietpi.com/docs/dietpi_optimised_software/\n ─────────────────────────────────────────────────────────────── -List of installed software and their URL links for online docs: +List of installed software and their online documentation URLs: ───────────────────────────────────────────────────────────────\n' # Installed software for i in "${!aSOFTWARE_INSTALL_STATE[@]}" do - - if (( ${aSOFTWARE_INSTALL_STATE[i]} > 0 )) && [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]]; then - - string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\n" - - fi - + # shellcheck disable=SC2015 + (( ${aSOFTWARE_INSTALL_STATE[i]} > 0 )) && [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] || continue + string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\n" done G_WHIP_SIZE_X_MAX=70 G_WHIP_MSG "$string" - unset string ;; From c53395851e99b12d95215c868eef991b23cbb455 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 7 Jan 2021 20:52:52 +0100 Subject: [PATCH 039/218] v6.35 + DietPi-PREP | Odroid C4/N2: Do kernel postinst steps manually, which depends on /proc/cpuinfo content, so allow correct install from within a container/chroot environment --- PREP_SYSTEM_FOR_DIETPI.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 15e965006f..e578179abb 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -852,11 +852,17 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then 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: https://dietpi.com/meveric/pool/c4/ + # Apply kernel postinst steps manually, that depend on /proc/cpuinfo content, not matching when running in a container. + [[ -f '/boot/Image' ]] && G_EXEC mv /boot/Image /boot/Image.gz + [[ -f '/boot/Image.gz.bak' ]] && G_EXEC rm /boot/Image.gz.bak # Odroid N2 elif (( $G_HW_MODEL == 15 )); then G_AGI linux-image-arm64-odroid-n2 meveric-keyring + # Apply kernel postinst steps manually, that depend on /proc/cpuinfo content, not matching when running in a container. + [[ -f '/boot/Image' ]] && G_EXEC mv /boot/Image /boot/Image.gz + [[ -f '/boot/Image.gz.bak' ]] && G_EXEC rm /boot/Image.gz.bak # Odroid N1 elif (( $G_HW_MODEL == 14 )); then From 9a74183f3f1afef7e34bd2c19b9365817a618da7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 8 Jan 2021 16:03:49 +0100 Subject: [PATCH 040/218] v6.35 + DietPi-Imager | Minor visual main menu enhancements --- .meta/dietpi-imager | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index aa5a7f4bbe..b3d92ed70c 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -160,16 +160,16 @@ { G_WHIP_MENU_ARRAY=( 'Source type' ": [$SOURCE_TYPE] Select how the input OS is stored" - 'Source path' ": [${FP_SOURCE_IMG:-${FP_SOURCE}}] Select the input $SOURCE_TYPE" + 'Source path' ": [${FP_SOURCE_IMG:-$FP_SOURCE}] Select the input $SOURCE_TYPE" ) [[ $FP_SOURCE ]] && G_WHIP_MENU_ARRAY+=('Source rootfs' ": [$FP_ROOT_DEV] Select input OS root partition") G_WHIP_MENU_ARRAY+=( 'Target type' ": [$CLONING_TOOL] Select output image type" - 'Target name' ": [${OUTPUT_IMG_NAME%.$OUTPUT_IMG_EXT}.$OUTPUT_IMG_EXT] Choose the output image name" + 'Target name' ": [$OUTPUT_IMG_NAME] Choose the output image name" '' '●─' 'Mount' ": [$MOUNT_IT] Review or edit drive content before image creation" ) - [[ $FP_SOURCE && $FP_ROOT_DEV ]] && G_WHIP_MENU_ARRAY+=('' '●─' 'Start' ": Start creating $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT from ${FP_SOURCE_IMG:-${FP_SOURCE}}") + [[ $FP_SOURCE && $FP_ROOT_DEV ]] && G_WHIP_MENU_ARRAY+=('' '●─' 'Start' ": Start creating $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT") G_WHIP_DEFAULT_ITEM=$main_menu_choice G_WHIP_BUTTON_CANCEL_TEXT='Exit' From 9c7dc8b5ec662f9345646997a406c0f0915acc5a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Jan 2021 14:21:15 +0100 Subject: [PATCH 041/218] v6.35 + DietPi-Software | ReadyMedia (MiniDLNA): Resolve an issue where the media database was not recreated on service restart as expected. Remove obsolete defaults config file and log directory, created on service start at package install. When starting the daemon in forground "-S", no log file is created but logging is done to STDOUT => "journalctl -u minidlna". Use G_EXEC error handler where possible. --- dietpi/dietpi-software | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d1e0d4394a..526c2dd4c2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8957,9 +8957,11 @@ _EOF_ Create_User -g dietpi -G minidlna -d /var/lib/minidlna minidlna # Remove obsolete service files - [[ -f '/etc/init.d/minidlna' ]] && rm -v /etc/init.d/minidlna - update-rc.d -f minidlna remove - [[ -f '/lib/systemd/system/minidlna.service' ]] && rm -v /lib/systemd/system/minidlna.service + [[ -f '/etc/init.d/minidlna' ]] && G_EXEC rm /etc/init.d/minidlna + G_EXEC update-rc.d -f minidlna remove + [[ -f '/lib/systemd/system/minidlna.service' ]] && G_EXEC rm /lib/systemd/system/minidlna.service + [[ -f '/etc/default/minidlna' ]] && G_EXEC rm /etc/default/minidlna + [[ -d '/var/log/minidlna' ]] && G_EXEC rm -R /var/log/minidlna # Service cat << _EOF_ > /etc/systemd/system/minidlna.service @@ -8971,7 +8973,7 @@ After=network-online.target dietpi-boot.service [Service] User=minidlna RuntimeDirectory=minidlna -ExecStart=$(command -v minidlnad) -SR -f /etc/minidlna.conf +ExecStart=$(command -v minidlnad) -S -R -f /etc/minidlna.conf [Install] WantedBy=multi-user.target @@ -8981,8 +8983,8 @@ _EOF_ dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf # Cache - mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache - chown -R minidlna:dietpi /mnt/dietpi_userdata/.MiniDLNA_Cache + G_EXEC mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache + G_EXEC chown -R minidlna:dietpi /mnt/dietpi_userdata/.MiniDLNA_Cache Download_Test_Media @@ -14072,7 +14074,6 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP minidlna if [[ -f '/etc/systemd/system/minidlna.service' ]]; then systemctl disable --now minidlna @@ -14080,6 +14081,7 @@ _EOF_ fi [[ -d '/etc/systemd/system/minidlna.service.d' ]] && rm -R /etc/systemd/system/minidlna.service.d + G_AGP minidlna getent passwd minidlna > /dev/null && userdel minidlna getent group minidlna > /dev/null && groupdel minidlna [[ -d '/mnt/dietpi_userdata/.MiniDLNA_Cache' ]] && rm -R /mnt/dietpi_userdata/.MiniDLNA_Cache From 35c56eb15f1eeb70eba3698edf53c4cb8758b748 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Jan 2021 14:24:18 +0100 Subject: [PATCH 042/218] v6.35 + DietPi-Software | MiniDLNA: Remove obsolete log_dir setting, since it is not used in combination with "-S" foreground flag with systemd and "/var/log" is the default anyway. Add info about how to access logs to avoid confusion. --- .conf/dps_39/minidlna.conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.conf/dps_39/minidlna.conf b/.conf/dps_39/minidlna.conf index 44b1544c7e..5f5d913b65 100644 --- a/.conf/dps_39/minidlna.conf +++ b/.conf/dps_39/minidlna.conf @@ -9,11 +9,9 @@ media_dir=V,/mnt/dietpi_userdata/Video # Path to the directory that should hold the database and album art cache. db_dir=/mnt/dietpi_userdata/.MiniDLNA_Cache -# Path to the directory that should hold the log file. -log_dir=/var/log - # Must be one of "off", "fatal", "error", "warn", "info" or "debug". -# "off" turns of logging entirely, "fatal" is the highest level of importance +# "off" turns of logging entirely, "fatal" is the highest level of importance. +# Access logs via: "journalctl -u minidlna" log_level=warn # Use a different container as the root of the directory tree presented to From 0f0ae4008f4e53dde13c3db9afd5c1da941a0df4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Jan 2021 14:25:52 +0100 Subject: [PATCH 043/218] Update CHANGELOG.txt --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4a630698c3..75a09d5ecf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Fixes: - DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. - DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 - DietPi-Software | Unbound: Resolved an issue where the service start failed if the host system had a local IP address outside of the 192.168.0.0/16 subnet. Many thanks to @faxesystem for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-749174984 +- DietPi-Software | ReadyMedia: Resolved an issue where the media library was not rescanned on service start. Many thanks to @AdamFarnsworth0 for reporting this issue: https://twitter.com/AdamFarnsworth0/status/1347977813635305475 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/4XXX From 7eaafb995c74d2080d49d17e336a61bd2c8200f7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 13 Jan 2021 13:52:19 +0100 Subject: [PATCH 044/218] v6.35 + DietPi-Patch | ReadyMedia: Fix database rebuild on service start --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 6bee7c1abe..b6cea158ac 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2744,6 +2744,9 @@ _EOF_ G_EXEC rm /etc/unbound/unbound.conf.d/dietpi-pihole.conf fi #------------------------------------------------------------------------------- + # ReadyMedia: Fix database rebuild on service start + [[ -f '/etc/systemd/system/minidlna.service' ]] && G_EXEC sed -i '/^ExecStart=/s/ -SR / -S -R /' /etc/systemd/system/minidlna.service + #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] From 3e18cd54a7bc5427de93c6c8a5dcaaf9ff05ad1d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 13 Jan 2021 14:02:22 +0100 Subject: [PATCH 045/218] v6.35 + DietPi-Software | Jellyfin: Disable install option for ARMv6 since it cannot work on this architecture as of .NET limitation. The "raspbian" distro in the repository exists, but is contains the same packages as the "debian" distro (symlink, rewrite), to allow using "ID" from /etc/os-release on Raspbian, but it does not contain Raspbian-like armv6hf binaries. --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 526c2dd4c2..8b8a7bd640 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -792,6 +792,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=26255#p26255' + # - ARMv6: https://github.com/jellyfin/jellyfin/issues/5011 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 # BitTorrent & Download #-------------------------------------------------------------------------------- @@ -6358,9 +6360,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u G_EXEC eval "curl -sSfL '$INSTALL_URL_ADDRESS' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg --yes" # Install APT repo - local distro='debian' - (( $G_HW_ARCH == 1 )) && distro='raspbian' - echo "deb https://repo.jellyfin.org/$distro/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-jellyfin.list + echo "deb https://repo.jellyfin.org/debian/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-jellyfin.list G_AGUP # Install Jellyfin + FFmpeg implementation @@ -15348,7 +15348,7 @@ _EOF_ Banner_Uninstalling G_AGP jellyfin jellyfin-ffmpeg - rm -f /usr/bin/jellyfin # Symlink created but left on package purge + rm -f /usr/bin/jellyfin # Symlink created but left on package purge: https://github.com/jellyfin/jellyfin/pull/3690 [[ -f '/etc/apt/sources.list.d/dietpi-jellyfin.list' ]] && G_EXEC_NOHALT=1 G_EXEC rm /etc/apt/sources.list.d/dietpi-jellyfin.list [[ -f '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg' ]] && G_EXEC_NOHALT=1 G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg [[ -d '/etc/systemd/system/jellyfin.service.d' ]] && G_EXEC_NOHALT=1 G_EXEC rm -R /etc/systemd/system/jellyfin.service.d From 7c9d91f2243531eb4c230c40e3c65b74160c4d3c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 13 Jan 2021 16:30:52 +0100 Subject: [PATCH 046/218] v6.35 + DietPi-Patch | Bring forward the haveged upgrade on ARMv7/8 as a new version with further fixes is available on Bullseye --- dietpi/patch_file | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index b6cea158ac..de088be299 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2434,18 +2434,6 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" fi #------------------------------------------------------------------------------- - # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 - if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] && $G_HW_MODEL -gt 9 ]] && dpkg-query -s haveged &> /dev/null; then - - G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM:' - G_DIETPI-NOTIFY 2 ' - https://github.com/jirka-h/haveged/pull/7' - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" - G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - G_EXEC_NOHALT=1 G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - - fi - #------------------------------------------------------------------------------- elif (( $G_DIETPI_VERSION_SUB == 32 )); then @@ -2747,6 +2735,18 @@ _EOF_ # ReadyMedia: Fix database rebuild on service start [[ -f '/etc/systemd/system/minidlna.service' ]] && G_EXEC sed -i '/^ExecStart=/s/ -SR / -S -R /' /etc/systemd/system/minidlna.service #------------------------------------------------------------------------------- + # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 + if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] && $G_HW_MODEL -gt 9 ]] && dpkg-query -s haveged &> /dev/null; then + + G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM:' + G_DIETPI-NOTIFY 2 ' - https://github.com/jirka-h/haveged/pull/7' + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" + G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" + G_EXEC_NOHALT=1 G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" + + fi + #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] From 90911f789d530467a2954a75e12606e1ac3fcead Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 13 Jan 2021 19:35:15 +0100 Subject: [PATCH 047/218] v6.35 + DietPi-Set_hardware | I2C: Do not error out when /boot/dietpi/.installed does not (yet) exist. This can be the case when on first boot dietpi-software prompt users enter dietpi-config and enable I2C from there. This means that the software ID will not be shown as installed, but it's a very minor visual issue only and cannot be easily solved as long as we do not ship /boot/dietpi/.installed with fresh images, which is planned. --- dietpi/func/dietpi-set_hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 6033444314..1cb9571915 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1015,7 +1015,7 @@ _EOF_ G_CONFIG_INJECT 'dtparam=i2c1=' 'dtparam=i2c1=on' /boot/config.txt # DietPi-Software, set installed - G_EXEC sed -i '/^aSOFTWARE_INSTALL_STATE\[72\]=/c\aSOFTWARE_INSTALL_STATE\[72\]=2' /boot/dietpi/.installed + [[ -f '/boot/dietpi/.installed' ]] && G_EXEC sed -i '/^aSOFTWARE_INSTALL_STATE\[72\]=/c\aSOFTWARE_INSTALL_STATE\[72\]=2' /boot/dietpi/.installed elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then From 57326c7d98ee3c56fd22cc5ab2de82c6b84699d7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Jan 2021 12:17:39 +0100 Subject: [PATCH 048/218] v6.35 + DietPi-Software | WiFi Hotspot: Typo --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8b8a7bd640..bfd3cf6ebe 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4950,7 +4950,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( $WIFIHOTSPOT_RTL8188C_DEVICE && $WIFIHOTSPOT_RTL8188C_PACKAGE )); then # shellcheck disable=SC2086 - G_AGI ${DEPS_LIST/hostapd/hostapt-realtek} + G_AGI ${DEPS_LIST/hostapd/hostapd-realtek} # RTL8188C* without special Realtek hostapd package: On non-RPi ARM, install our binaries with "rtl1871xdrv" driver. On RPi, a RTL8188C*-compatible hostapd package is shipped. elif (( $WIFIHOTSPOT_RTL8188C_DEVICE && $G_HW_MODEL > 9 && $G_HW_ARCH < 4 )); then From 364c32248d603010b4c70ad9e2c6e94b545d87f5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Jan 2021 12:19:55 +0100 Subject: [PATCH 049/218] v6.35 + CHANGELOG | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 75a09d5ecf..5c7f41d2a7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ Fixes: - DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 - DietPi-Software | Unbound: Resolved an issue where the service start failed if the host system had a local IP address outside of the 192.168.0.0/16 subnet. Many thanks to @faxesystem for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-749174984 - DietPi-Software | ReadyMedia: Resolved an issue where the media library was not rescanned on service start. Many thanks to @AdamFarnsworth0 for reporting this issue: https://twitter.com/AdamFarnsworth0/status/1347977813635305475 +- DietPi-Software | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed. Many thanks to @smogan71 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8523 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/4XXX From 5f77949fcc7115c2aff288eae05ae9b4f2723518 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Jan 2021 21:58:24 +0100 Subject: [PATCH 050/218] v6.35 + DietPi-Patch | Replace wget with curl --- dietpi/patch_file | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index de088be299..6457a8b185 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1624,7 +1624,7 @@ NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" if [[ -f '/usr/share/applications/dietpi-process_tool.desktop' ]]; then rm /usr/share/applications/dietpi-process_tool.desktop - G_EXEC wget https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/apps/dietpi-services.desktop -O /usr/share/applications/dietpi-services.desktop + G_EXEC curl -sSfL https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/apps/dietpi-services.desktop -o /usr/share/applications/dietpi-services.desktop chmod +x /usr/share/applications/dietpi-services.desktop fi @@ -1877,8 +1877,8 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t [[ -L '/var/www/index.php' && $(readlink -f '/var/www/index.php') == '/var/www/html/pihole/index.php' ]] && rm /var/www/index.php if command -v a2ensite > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /boot/dietpi/.installed; then - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -O /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -O /etc/apache2/sites-available/dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -o /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -o /etc/apache2/sites-available/dietpi-pihole.conf a2ensite dietpi-pihole if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then @@ -1890,8 +1890,8 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t fi if command -v lighttpd-enable-mod > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[84\]=2' /boot/dietpi/.installed; then - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole.conf lighttpd-enable-mod dietpi-pihole if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then @@ -1905,9 +1905,9 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t # Update Nginx default vhost, which is required to assure access restrictions for Pi-hole G_BACKUP_FP /etc/nginx/sites-available/default - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -O /etc/nginx/sites-available/default - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -o /etc/nginx/sites-available/default + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole.conf if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak @@ -1923,7 +1923,7 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t if (( $G_HW_MODEL == 12 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[6\]=2' /boot/dietpi/.installed; then G_BACKUP_FP /etc/X11/xorg.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -O /etc/X11/xorg.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -o /etc/X11/xorg.conf apt-mark auto xf86-video-mali-odroid # Kodi: Remove PulseAudio, not required by Kodi anymore, but ask user first if grep -q '^aSOFTWARE_INSTALL_STATE\[31\]=2' /boot/dietpi/.installed; then @@ -2162,7 +2162,7 @@ _EOF_ rm -fv /boot/dietpi/{.,func/}dietpi-led_control #------------------------------------------------------------------------------- G_DIETPI-NOTIFY 2 'Installing vmtouch as replacement for DietPi-RAMdisk' # https://github.com/MichaIng/DietPi/issues/3288 - G_EXEC wget "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vmtouch_$G_HW_ARCH_NAME.deb" + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vmtouch_$G_HW_ARCH_NAME.deb" G_AGI "./vmtouch_$G_HW_ARCH_NAME.deb" rm "vmtouch_$G_HW_ARCH_NAME.deb" #------------------------------------------------------------------------------- From 5689cbb90bd97321f4f4166e4a2712ee685e3af5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Jan 2021 22:00:20 +0100 Subject: [PATCH 051/218] v6.35 + DietPi-Set_software | Replace wget with curl --- 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 0f02a2b1f8..e8d97b173f 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -450,7 +450,7 @@ _EOF_ if G_CHECK_URL "$url"; then G_DIETPI-NOTIFY -2 'Channing dietpi.txt for missing entries' - G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC wget "$url" -O dietpi.txt_patch + G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC curl -sSfL "$url" -o dietpi.txt_patch sed -Ei '/^[[:blank:]]*(#|$)/d' dietpi.txt_patch local entry value From c24ffe874aca8e608f5d4a8fbf4c2882e271a7c3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 Jan 2021 17:51:51 +0100 Subject: [PATCH 052/218] Align survey page style with main website --- .meta/dietpi-survey_report | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 548ad8240f..a6516c26d1 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -575,12 +575,12 @@ 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 + unset -v BENCH_VERSION BENCH_HW_MODEL + unset -v BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END + unset -v BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ + unset -v BENCH_RAM_WRITE BENCH_RAM_READ + unset -v BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ + unset -v BENCH_NET_LAN_SPEED done @@ -820,7 +820,7 @@ body { color: #ffffff; background-color: #181a1c; - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, sans-serif; } td { border: 1px solid grey; padding: 5px; } a { color: #ffffff; text-decoration: none; } @@ -829,7 +829,7 @@ text-transform: uppercase; font-size: 15px; line-height: 40px; - padding: 10px 15px; + padding: 10px 14px; border: 1px solid #181a1c; border-radius: 5px; transition: border-color 1s; @@ -859,7 +859,7 @@ color: #181a1c; background-color: #c5ff00; border: 1px solid #181a1c; - border-radius: 5px; + border-radius: 4px; transition: color 0.5s, background-color 0.5s, border-color 0.5s; } a.scrollup:hover, From 46223b6c6fcf4266d09d2c3fc36d5a3fab36fa19 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 Jan 2021 19:15:35 +0100 Subject: [PATCH 053/218] v6.35 + DietPi-Software | Minor --- dietpi/dietpi-software | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bfd3cf6ebe..77f84a8c57 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3997,7 +3997,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf G_EXEC cp -a amiberry /mnt/dietpi_userdata/ # Cleanup - rm -R amiberry + G_EXEC_NOHALT=1 G_EXEC rm -R amiberry fi @@ -9022,7 +9022,7 @@ _EOF_ Banner_Configuration # Reinstall: Remove obsolete config file: https://github.com/midwan/amiberry/releases/tag/v2.25 - [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf + [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && G_EXEC rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf # Service cat << '_EOF_' > /etc/systemd/system/amiberry.service @@ -14908,6 +14908,7 @@ _EOF_ rm -R /etc/systemd/system/rtorrent.service* fi + [[ -d '/etc/systemd/system/rtorrent.service.d' ]] && rm -R /etc/systemd/system/rtorrent.service.d G_AGP rtorrent getent passwd rtorrent && userdel rtorrent getent group rtorrent && groupdel rtorrent # pre-v6.29 @@ -14927,6 +14928,7 @@ _EOF_ rm -R /etc/systemd/system/amiberry.service* fi + [[ -d '/etc/systemd/system/amiberry.service.d' ]] && rm -R /etc/systemd/system/amiberry.service.d # Files [[ -d '/mnt/dietpi_userdata/amiberry' ]] && rm -R /mnt/dietpi_userdata/amiberry # Autostart index: If currently Amiberry, revert to console login @@ -17380,12 +17382,14 @@ List of installed software and their online documentation URLs: # Start installations for software Run_Installations - # Unmask systemd-logind if set in dietpi.txt / libpam-systemd was installed / Kodi + # Unmask systemd-logind if Kodi is installed, it's set in dietpi.txt or libpam-systemd was installed if [[ $(readlink /etc/systemd/system/systemd-logind.service) == '/dev/null' ]] && - { grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /boot/dietpi.txt || dpkg-query -s 'libpam-systemd' &> /dev/null || (( ${aSOFTWARE_INSTALL_STATE[31]} > 0 )); }; then + { [[ ${aSOFTWARE_INSTALL_STATE[31]} == 1 ]] || grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /boot/dietpi.txt || dpkg-query -s 'libpam-systemd' &> /dev/null; }; then # dbus is required for systemd-logind to start dpkg-query -s dbus &> /dev/null || G_AGI dbus + G_EXEC systemctl unmask dbus + G_EXEC systemctl start dbus G_EXEC systemctl unmask systemd-logind G_EXEC systemctl start systemd-logind From bbff2627a512e38713aa9ed0db553ffc5b7cf521 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 Jan 2021 19:53:03 +0100 Subject: [PATCH 054/218] v6.35 + DietPi-Imager | Remove child mounts (e.g. boot) automatically after finishing the rootfs review mount. --- .meta/dietpi-imager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index b3d92ed70c..13ce29b6a9 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -244,7 +244,7 @@ fi sync sleep 1 # Give the system 1 second to avoid "mount is busy" - G_EXEC umount $FP_MNT_TMP + G_EXEC umount -R $FP_MNT_TMP G_EXEC rmdir $FP_MNT_TMP G_EXEC partprobe "$FP_SOURCE" # Failsafe G_EXEC partx -u "$FP_SOURCE" # Failsafe From c3a28dbc5d9b478bc06ac7d8c6743e797ce4257f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 18 Jan 2021 23:44:16 +0100 Subject: [PATCH 055/218] v6.35 + DietPi-Survey_report | Make tables scrollable on small screens instead making the page too large to read it without (auto-)zoom --- .meta/dietpi-survey_report | 1 + 1 file changed, 1 insertion(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index a6516c26d1..7aa58247d5 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -822,6 +822,7 @@ background-color: #181a1c; font-family: Arial, sans-serif; } + table { display: block; overflow-x: auto; } td { border: 1px solid grey; padding: 5px; } a { color: #ffffff; text-decoration: none; } a:hover, a:focus, a:active { color: #c5ff00; } From 884c2c098a5b3bc37d486efb1b257ab8e95e58f5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 19 Jan 2021 12:28:31 +0100 Subject: [PATCH 056/218] v6.35 + DietPi-PREP | Remove console auto-login, present on some Armbian images: https://github.com/MichaIng/DietPi/issues/1443#issuecomment-762773403 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e578179abb..3369da0231 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1160,6 +1160,9 @@ path-exclude /etc/profile.d/*armbian* #path-exclude /usr/lib/armbian # Required for Armbian root package upgrade #path-exclude /usr/share/armbian # Required for Armbian root package upgrade _EOF_ + # Armbian auto-login + [[ -f '/etc/systemd/system/getty@.service.d/override.conf' ]] && rm -v /etc/systemd/system/getty@.service.d/override.conf + [[ -d '/etc/systemd/system/getty@.service.d' ]] && rmdir --ignore-fail-on-non-empty -v /etc/systemd/system/getty@.service.d # - OMV: https://github.com/MichaIng/DietPi/issues/2994 [[ -d '/etc/openmediavault' ]] && rm -vR /etc/openmediavault From aaa6a5f66a094d7fb7e3ef4a2ef95e9174f20072 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 19 Jan 2021 22:01:56 +0100 Subject: [PATCH 057/218] v6.35 + DietPi-PREP | Remove auto-login override for serial console as well from Armbian-based images. Remove all console overrides and none of them is standard of required! --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3369da0231..5d4e7c449e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1161,8 +1161,8 @@ path-exclude /etc/profile.d/*armbian* #path-exclude /usr/share/armbian # Required for Armbian root package upgrade _EOF_ # Armbian auto-login - [[ -f '/etc/systemd/system/getty@.service.d/override.conf' ]] && rm -v /etc/systemd/system/getty@.service.d/override.conf - [[ -d '/etc/systemd/system/getty@.service.d' ]] && rmdir --ignore-fail-on-non-empty -v /etc/systemd/system/getty@.service.d + [[ -d '/etc/systemd/system/getty@.service.d' ]] && rm -Rv /etc/systemd/system/getty@.service.d + [[ -d '/etc/systemd/system/serial-getty@.service.d' ]] && rm -Rv /etc/systemd/system/serial-getty@.service.d # - OMV: https://github.com/MichaIng/DietPi/issues/2994 [[ -d '/etc/openmediavault' ]] && rm -vR /etc/openmediavault From 4bcfd52f41b7ca448ff877b6fd3907d10c7b32b6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Jan 2021 17:01:53 +0100 Subject: [PATCH 058/218] v6.35 + DietPi-Banner | @Camry2731 is our new Patreon Legend, many thanks for your support! + DietPi-Banner | Remove obsolete short image update notification, the long form has been removed with v6.34 already. --- dietpi/func/dietpi-banner | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 173e2f536c..575d4f7fa6 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -126,15 +126,7 @@ # DietPi update available? if Check_DietPi_Update; then - if [[ $AVAILABLE_UPDATE == '-1' ]]; then - - local text_update_available_date="${aCOLOUR[3]}Image available" - - else - - local text_update_available_date="${aCOLOUR[3]}Update available" - - fi + local text_update_available_date="${aCOLOUR[3]}Update available" # APT update available? elif Check_APT_Updates; then @@ -167,6 +159,7 @@ $GREEN_LINE" [[ -f '/boot/dietpi/.prep_info' ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /boot/dietpi/.prep_info echo -e " Web : https://dietpi.com | https://twitter.com/DietPi_ + Patreon Legends : Camry2731 Donate : https://dietpi.com/#donate DietPi Hosting : Powered by https://myvirtualserver.com$COLOUR_RESET\n" From 38174e7a57606c55251086983ac5227c598fefab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Jan 2021 23:37:11 +0100 Subject: [PATCH 059/218] v6.35 + DietPi-Software | Amiberry: libegl1 is installed now when enabling RPi KMS driver, hence it doesn't need to be installed explicitly as Amiberry dependency anymore --- dietpi/dietpi-software | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 77f84a8c57..7435ee6d9a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3947,7 +3947,6 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf local platform='rpi1' # Include ID -1 + 0 (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL" - (( $G_DISTRO > 4 )) && DEPS_LIST+=' libegl1' || DEPS_LIST+=' libegl1-mesa' /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d # - Odroid XU4: https://dietpi.com/meveric/pool/main/s/setup-odroid/ From ad559c37c83b6f8b6d2e72f731985ed61de81c1f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 15:58:42 +0100 Subject: [PATCH 060/218] v6.35 + DietPi-Set_hardware | RPi: Do not attempt to start hciuart service directly when enabling Bluetooth. A reboot is required to have the device enabled, otherwise the service start will fail. --- dietpi/func/dietpi-set_hardware | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 1cb9571915..4a4f664d24 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1067,7 +1067,7 @@ _EOF_ if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then systemctl disable --now hciuart 2> /dev/null - # Disable onboard BT via dtoverlay + # Disable onboard Bluetooth via device tree overlay G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /boot/config.txt # ASUS TB @@ -1084,12 +1084,12 @@ _EOF_ systemctl disable --now bluetooth 2> /dev/null - # Unload and blacklist modules, bluetooth last + # Unload and blacklist kernel modules, bluetooth last > /etc/modprobe.d/dietpi-disable_bluetooth.conf for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) do - modprobe -rf "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null + modprobe -r "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null echo "blacklist ${aBLUETOOTH_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_bluetooth.conf done @@ -1104,10 +1104,10 @@ _EOF_ elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - # Remove module blacklist - [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && rm /etc/modprobe.d/dietpi-disable_bluetooth.conf + # Remove kernel module blacklist + [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_bluetooth.conf - # Pre-Reqs + # RPi if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then # Login console on ttyAMA0 must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 @@ -1120,7 +1120,7 @@ Do you want to continue and disable the serial login console?' || return 1 fi # Remove dtoverlay - sed -i '/^[[:blank:]]*dtoverlay=disable-bt/d' /boot/config.txt + G_EXEC sed -i '/^[[:blank:]]*dtoverlay=disable-bt/d' /boot/config.txt G_AG_CHECK_INSTALL_PREREQ pi-bluetooth @@ -1128,14 +1128,14 @@ Do you want to continue and disable the serial login console?' || return 1 # ROCK Pi S: https://wiki.radxa.com/RockpiS/Debian#Bluetooth local rockpis - (( $G_HW_MODEL == 73 )) && apt-cache show rtl8723ds-firmware &> /dev/null && rockpis=rtl8723ds-firmware + (( $G_HW_MODEL == 73 )) && apt-cache show rtl8723ds-firmware &> /dev/null && rockpis='rtl8723ds-firmware' # bluez-firmware: BCM203x dongles: https://packages.debian.org/bluez-firmware G_AG_CHECK_INSTALL_PREREQ bluez bluez-firmware $rockpis fi - # Load modules, bluetooth first + # Load kernel modules, bluetooth first for i in "${aBLUETOOTH_MODULES[@]}" do @@ -1143,7 +1143,7 @@ Do you want to continue and disable the serial login console?' || return 1 done - # Failsafe, unblock all Bluetooth adapters + # Failsafe: Unblock all Bluetooth adapters if rfkill is installed command -v rfkill > /dev/null && rfkill unblock bluetooth # Broadcom-based models that need brcm_patchram_plus @@ -1156,7 +1156,7 @@ Do you want to continue and disable the serial login console?' || return 1 G_EXEC systemctl enable --now bluetooth # RPi - (( $G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || G_EXEC systemctl enable --now hciuart + (( $G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || G_EXEC systemctl enable hciuart else @@ -1508,10 +1508,6 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 [[ ! -f $FP_UENV ]] || grep -q "console=$INPUT_ADDITIONAL" $FP_UENV && return 0 echo "console=$INPUT_ADDITIONAL,115200n8" >> $FP_UENV - #elif (( $G_HW_MODEL == 70 )); then - - # grep -q "console=$INPUT_ADDITIONAL" $FP_UENV || sed -i "/bootargs=/s/$/ console=$INPUT_ADDITIONAL,115200n8/" $FP_UENV - fi # Enable for all detected Serial/UART devices @@ -1579,10 +1575,6 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 sed -i "/^[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*[[: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 - fi # Disable for all detected Serial/UART devices From 52c348eb73f5781f06a96918f5f134f2d1ed9876 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 16:31:44 +0100 Subject: [PATCH 061/218] v6.35 + DietPi-Config | Enable Bluetooth options on virtual machines. One can e.g. easily use a physical USB Bluetooth adapter from within the VM. Also for testing the options and scripts, this is good. + DietPi-Config | Do not force fake-hwclock to lower the system time on load or store timestamps even if those are lower than it's on release date. The chance that the initial system clock is in fact in the future is likely lower than the chance that this messes with other time sync daemons that updated the system clock prior to fake-hwclock, e.g. systemd-timesyncd which has the same feature implemented, when being enabled (dietpi-config time sync daemon + drift mode). + DietPi-Config | On RPi, when enabling onboard Bluetooth, a reboot is required to have the device tree changes taking effect. --- dietpi/dietpi-config | 50 +++++++++----------------------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index d207d20fbb..30d98e7abf 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1327,19 +1327,9 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before G_WHIP_MENU_ARRAY+=('Serial/UART' ': Manage available devices') # Bluetooth: Not for VM - if (( $G_HW_MODEL != 20 )); then - - local bluetooth_state_text='On' - local bluetooth_state=1 - if [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]]; then - - bluetooth_state=0 - bluetooth_state_text='Off' - - fi - G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") - - fi + local bluetooth_state=1 bluetooth_state_text='On' + [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && bluetooth_state=0 bluetooth_state_text='Off' + G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") # RPi specific if (( $G_HW_MODEL < 10 )); then @@ -1374,12 +1364,8 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before if [[ $G_WHIP_RETURNED_VALUE == 'Swapfile' ]]; then - if G_WHIP_YESNO 'Swapfile control has been moved to DietPi-Drive_Manager, would you like to run the application now? -\nOnce finished, exit to resume DietPi-Config'; then - - /boot/dietpi/dietpi-drive_manager - - fi + G_WHIP_YESNO 'Swapfile control has been moved to DietPi-Drive_Manager, would you like to run the application now? +\nOnce finished, exit to resume DietPi-Config' && /boot/dietpi/dietpi-drive_manager elif [[ $G_WHIP_RETURNED_VALUE == 'APT cache' ]]; then @@ -1407,9 +1393,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": if [[ $G_WHIP_RETURNED_VALUE == 'Emulated' ]]; then G_AGI fake-hwclock - # - Allow times in the past - G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock - systemctl restart fake-hwclock + G_EXEC systemctl enable --now fake-hwclock else @@ -1482,15 +1466,7 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr elif [[ $G_WHIP_RETURNED_VALUE == 'I2C state' ]]; then - if (( $rpi_i2c_enabled )); then - - /boot/dietpi/func/dietpi-set_hardware i2c disable - - else - - /boot/dietpi/func/dietpi-set_hardware i2c enable - - fi + /boot/dietpi/func/dietpi-set_hardware i2c $(( ! $rpi_i2c_enabled )) REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'I2C frequency' ]]; then @@ -1510,15 +1486,9 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr elif [[ $G_WHIP_RETURNED_VALUE == 'Bluetooth' ]]; then - if (( $bluetooth_state )); then - - /boot/dietpi/func/dietpi-set_hardware bluetooth disable - - else - - /boot/dietpi/func/dietpi-set_hardware bluetooth enable - - fi + /boot/dietpi/func/dietpi-set_hardware bluetooth $(( ! $bluetooth_state )) + # On RPi, when enabling onboard Bluetooth, a reboot is required to have the device tree changes taking effect. + (( $bluetooth_state || G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'USB boot support' && $rpi3_usb_boot_bit_enabled == 0 ]] && G_WHIP_YESNO 'The following will enable the RPi 3 to boot from USB mass storage devices. A hardware bit "17:3020000a", specific to the device is set to enable the feature. From e82ec72ff14b247b1751bb94424d154dcbdbe9a4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 16:42:30 +0100 Subject: [PATCH 062/218] v6.35 + DietPi-PREP | Do not force fake-hwclock to lower the system time on load or store timestamps even if those are lower than it's on release date. The chance that the initial system clock is in fact in the future is likely lower than the chance that this messes with other time sync daemons that update the system clock prior to fake-hwclock, e.g. systemd-timesyncd which has the same feature implemented, when being enabled (dietpi-config time sync daemon + drift mode). --- PREP_SYSTEM_FOR_DIETPI.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5d4e7c449e..91fec2387c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1429,12 +1429,6 @@ left_meter_modes=1 1 right_meters=Memory Swap Tasks LoadAverage Uptime right_meter_modes=1 1 2 2 2 _EOF_' - - G_DIETPI-NOTIFY 2 'Configuring fake-hwclock:' - # Allow times in the past - G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock - systemctl restart fake-hwclock # Failsafe, apply now if date is way far back... - G_DIETPI-NOTIFY 2 'Configuring serial login consoles:' # On virtual machines, serial consoles are not required if (( $G_HW_MODEL == 20 )); then @@ -1461,11 +1455,11 @@ _EOF_' fi - G_DIETPI-NOTIFY 2 'Reducing getty count and resource usage:' - systemctl mask --now getty-static - # - logind features disabled by default. Usually not needed and all features besides auto getty creation are not available without libpam-systemd package. - # - It will be unmasked, automatically if libpam-systemd got installed during dietpi-software install, usually with desktops. - systemctl mask --now systemd-logind + G_DIETPI-NOTIFY 2 'Disabling static and automatic login prompts on consoles tty2 to tty6:' + G_EXEC systemctl mask --now getty-static + # - logind features are usually not needed and (aside of automatic getty spawn) require the libpam-systemd package. + # - It will be unmasked automatically if libpam-systemd got installed during dietpi-software install, e.g. with desktops. + G_EXEC systemctl mask --now systemd-logind #G_DIETPI-NOTIFY 2 'Configuring locales:' # Runs at start of script From 317c35d9fe69f8105b3cab18a53b392797c8a9cd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 17:25:58 +0100 Subject: [PATCH 063/218] v6.35 + DietPi-Set_hardware | RPi: Do not add device tree overlays or parameters at runtime. We already know that this does not work in most cases but a reboot is required. + DietPi-Set_hardware | RPi4: The VC4 full KMS driver on RPi 4 additionally blocks card 1 with additional sound devices for the second HDMI port. Increment the target sound card hence additionally by 1 if this driver is enabled. --- dietpi/func/dietpi-set_hardware | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4a4f664d24..5ba70edcf4 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1810,8 +1810,11 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 fi - # - RPi: Quick workaround for dtoverlay=vc4-kms-v3d taking card 0: https://github.com/MichaIng/DietPi/issues/3356#issuecomment-578215611 + # Workaround for RPi VC4 full KMS driver + # - RPi: An additional HDMI sound device exists as card 0: https://github.com/MichaIng/DietPi/issues/3356#issuecomment-578215611 (( $G_HW_MODEL < 10 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-kms-v3d' /boot/config.txt && ((SOUNDCARD_TARGET_CARD++)) + # - RPi4: card 1 is additionally used for the second HDMI port: https://github.com/MichaIng/DietPi/issues/4059 + (( $G_HW_MODEL == 4 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-kms-v3d-pi4' /boot/config.txt && ((SOUNDCARD_TARGET_CARD++)) # - Cards case "$INPUT_DEVICE_VALUE" in @@ -1930,12 +1933,11 @@ _EOF_ # Onboard # rpi-bcm2835-auto # rpi-bcm2835-3.5mm - # rpi-bcm2835-hdmi (hdmi[01] on RPi4) + # rpi-bcm2835-hdmi rpi-bcm2835-*) - # Enable onboard audio dtparm + # Enable onboard audio G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' /boot/config.txt - dtparam audio=on # Force 3.5mm out? if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]]; then @@ -1955,6 +1957,7 @@ _EOF_ };'\''' G_CONFIG_INJECT 'dtoverlay=dietpi-disable_hdmi_audio' 'dtoverlay=dietpi-disable_hdmi_audio' /boot/config.txt + # Force HDMI output? elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]]; then # Disable headphones via dtoverlay @@ -1996,7 +1999,6 @@ _EOF_ fi G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;; @@ -2015,7 +2017,6 @@ _EOF_ # Enable dtoverlay G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;; @@ -2025,9 +2026,7 @@ _EOF_ # Enable dtoverlay + I2S G_CONFIG_INJECT 'dtparam=i2s=' 'dtparam=i2s=on' /boot/config.txt - dtparam i2s=on G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;; From 45ac1d93ae2fa56d510abcbee54814e558df9d89 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 17:55:55 +0100 Subject: [PATCH 064/218] v6.35 + DietPi-Config | When selecting a not auto-detected sound card, a reboot is required to apply device tree changes --- dietpi/dietpi-config | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 30d98e7abf..4b0894dab7 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2829,8 +2829,8 @@ NB: All Ethernet connections will be dropped!' && Network_ApplyChanges # Disabled elif (( $ETH_DISABLED )); then - if G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed.\n -Would you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then + if G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed. +\nWould you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then ETH_DISABLED=0 Network_ApplyChanges @@ -2851,8 +2851,8 @@ Would you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then # Disabled | Offer chance to enable (also enables WiFi modules) if (( $WIFI_DISABLED )); then - if G_WHIP_YESNO 'WiFi must be enabled before settings can be changed.\n -Would you like to enable WiFi now?\n - NB: Connections may drop!'; then + if G_WHIP_YESNO 'WiFi must be enabled before settings can be changed. +\nWould you like to enable WiFi now?\n - NB: Connections may drop!'; then WIFI_DISABLED=0 Network_ApplyChanges @@ -2862,8 +2862,8 @@ Would you like to enable WiFi now?\n - NB: Connections may drop!'; then # No hardware found elif (( ! $WIFI_HARDWARE )); then - if G_WHIP_YESNO 'No supported WiFi hardware was found.\n -Would you like to disable WiFi?\n - NB: Connections may drop!'; then + if G_WHIP_YESNO 'No supported WiFi hardware was found. +\nWould you like to disable WiFi?\n - NB: Connections may drop!'; then WIFI_DISABLED=1 Network_ApplyChanges @@ -3875,8 +3875,8 @@ Additional benchmarks: if [[ $psu_noise_reduction == 'Off' ]]; then - G_WHIP_YESNO 'PSU noise reduction:\n\nThis mode attempts to reduce power consumption on your SBC. In turn, this may reduce PSU inflicted noise, that may degrade audio output quality.\n -The following will now be applied:\n - CPU governor = Powersave\n - Display output = Disabled\n\nDo you want to continue?' || return + G_WHIP_YESNO 'PSU noise reduction:\n\nThis mode attempts to reduce power consumption on your SBC. In turn, this may reduce PSU inflicted noise, that may degrade audio output quality. +\nThe following will now be applied:\n - CPU governor = powersave\n - Display output = disabled\n\nDo you want to continue?' || return G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' 'CONFIG_CPU_GOVERNOR=powersave' /boot/dietpi.txt /boot/dietpi/func/dietpi-set_cpu @@ -4008,6 +4008,9 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp G_WHIP_MENU "Please select a soundcard\n - Current : $soundcard_current" || return /boot/dietpi/func/dietpi-set_hardware soundcard "$G_WHIP_RETURNED_VALUE" + # RPi: Reboot required to apply device tree changes, which applies to all but auto-detected selections + (( $G_HW_MODEL > 9 )) || [[ $G_WHIP_RETURNED_VALUE == 'hw:'[0-9]','[0-9] || $G_WHIP_RETURNED_VALUE == 'usb-dac' ]] || REBOOT_REQUIRED=1 + elif [[ $G_WHIP_RETURNED_VALUE == 'Auto-conversion' ]]; then # Remove equalizer and plug suffix @@ -4682,8 +4685,8 @@ _EOF_ else - G_WHIP_MSG "[FAILED] Unknown menu ID $TARGETMENUID, reverting to DietPi-Config main menu\n -This error should never show up. Please try to reproduce it. If it reappears, you found a coding bug. + G_WHIP_MSG "[FAILED] Unknown menu ID $TARGETMENUID, reverting to DietPi-Config main menu +\nThis error should never show up. Please try to reproduce it. If it reappears, you found a coding bug. Please report it to: https://github.com/MichaIng/DietPi/issues" TARGETMENUID=0 From 94ebce5ea0ed73c3f92433b288f284e46784d3dd Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Mon, 25 Jan 2021 01:43:39 +0100 Subject: [PATCH 065/218] v6.35 (#4020) + DietPi-Software | Added Docker-Compose software option with ID 134, with dependencies Docker and Python 3 pip + DietPi-Software | Python 3 pip: Add pipweels as additional pip repository for ARMv6 and ARMv7 --- dietpi/dietpi-software | 58 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7435ee6d9a..a28bb4f99d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1349,6 +1349,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_ONLINEDOC_URL[$software_id]='p=29377#p29377' # - Bullseye aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + #------------------ + software_id=134 + + aSOFTWARE_NAME[$software_id]='Docker Compose' + aSOFTWARE_DESC[$software_id]='Tool to defining and run multi-container Docker applications' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=xxx#pxxx' + # - Bullseye: https://download.docker.com/linux/debian/dists/ + aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 # Remote Access #-------------------------------------------------------------------------------- @@ -2240,8 +2250,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Docker # - Portainer (185) + # - Docker Compose (134) software_id=162 - if ((${aSOFTWARE_INSTALL_STATE[185]} == 1 && ${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )) + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )) && + (( ${aSOFTWARE_INSTALL_STATE[185]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 )) then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" @@ -2383,13 +2396,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it # - HTPC Manager (155) # - Google AIY (169) # - Bazarr (180) + # - Docker Compose (134) software_id=130 if (( ( ${aSOFTWARE_INSTALL_STATE[118]} == 1 && $G_DISTRO > 4 ) || ${aSOFTWARE_INSTALL_STATE[139]} == 1 || ( ${aSOFTWARE_INSTALL_STATE[153]} == 1 && $G_DISTRO > 4 ) || ${aSOFTWARE_INSTALL_STATE[155]} == 1 || ${aSOFTWARE_INSTALL_STATE[169]} == 1 || - ${aSOFTWARE_INSTALL_STATE[180]} == 1 )); then + ${aSOFTWARE_INSTALL_STATE[180]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" @@ -5777,7 +5792,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux\.tar\.gz/{print $4;exit}') local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux.tar.gz' - # ARMv/ + # ARMv7 elif (( $G_HW_ARCH == 2 )) then INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-arm\.tar\.gz/{print $4;exit}') @@ -6126,6 +6141,18 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u G_EXEC_NOFAIL=1 G_EXEC rm DockerInstall.sh fi + + software_id=134 # Docker Compose + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + # Python build dependencies for aarch64 + (( $G_HW_ARCH == 3 )) && G_AGI make gcc + + G_EXEC_OUTPUT=1 G_EXEC pip3 install docker-compose + + fi software_id=161 # FuguHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -7023,6 +7050,11 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + # Create piwheels config file for ARMv6 and ARMv7 + [[ $G_HW_ARCH != [12] || -f '/etc/pip.conf' ]] || G_EXEC eval "echo -e '[global]\nextra-index-url=https://www.piwheels.org/simple/' > /etc/pip.conf" + + # Perform pip3 installation INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' G_CHECK_URL "$INSTALL_URL_ADDRESS" G_AGI python3-dev @@ -15198,14 +15230,25 @@ _EOF_ fi - software_id=164 + software_id=134 # Docker Compose if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # Remove Service file - [[ -f '/etc/systemd/system/nukkit.service' ]] && rm /etc/systemd/system/nukkit.service + G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y docker-compose - # Remove nukkit java file/folder + fi + + software_id=164 # Nukkit + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + Banner_Uninstalling + if [[ -f '/etc/systemd/system/nukkit.service' ]]; then + + systemctl disable --now nukkit + rm -R /etc/systemd/system/nukkit.service* + + fi + [[ -d '/etc/systemd/system/nukkit.service.d' ]] && rm -R /etc/systemd/system/nukkit.service.d [[ -e '/usr/local/bin/nukkit' ]] && rm -R /usr/local/bin/nukkit fi @@ -15700,6 +15743,7 @@ _EOF_ Banner_Uninstalling pip3 uninstall -y pip G_AGP python3-pip # Pre-v6.32 + [[ -f '/etc/pip.conf' ]] && rm /etc/pip.conf fi From 13a0edf7b20710bee7d60cf637a3330e79fa4449 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 25 Jan 2021 13:03:12 +0100 Subject: [PATCH 066/218] v6.35 + DietPi-Globals | G_EXEC: Use a backslash-escaped command string whenever it is printed through G_DIETPI-NOTIFY to avoid expansion for escape sequences like colour codes and especially newlines --- dietpi/func/dietpi-globals | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 51960a65f4..f081fd5c33 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -864,7 +864,7 @@ $grey───────────────────────── # - $G_ECEC_ARRAY_ACTION[] | Associative array, containing uneven $G_EXEC_ARRAY_TEXT[] values as keys and related commands as values G_EXEC(){ - local exit_code fp_log='/tmp/G_EXEC_LOG' attempt=1 acommand=("$@") + local exit_code fp_log='/tmp/G_EXEC_LOG' attempt=1 acommand=("$@") ecommand=${*//\\/\\\\} # Enter retry loop while : @@ -877,7 +877,7 @@ $grey───────────────────────── 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:-$ecommand}, please wait...${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" [[ $G_EXEC_OUTPUT_COL ]] && echo -ne "$G_EXEC_OUTPUT_COL" "${acommand[@]}" 2>&1 | tee $fp_log exit_code=${PIPESTATUS[0]} @@ -886,7 +886,7 @@ $grey───────────────────────── # - Else print animated processing message only else - G_DIETPI-NOTIFY -2 "${G_EXEC_DESC:-$*}${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" + G_DIETPI-NOTIFY -2 "${G_EXEC_DESC:-$ecommand}${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" "${acommand[@]}" &> $fp_log exit_code=$? @@ -898,7 +898,7 @@ $grey───────────────────────── [[ $G_EXEC_NOFAIL == 1 ]] && exit_code=0 ### Success: Print OK and exit retry loop - [[ $exit_code == 0 ]] && { G_DIETPI-NOTIFY 0 "${G_EXEC_DESC:-$*}"; break; } + [[ $exit_code == 0 ]] && { G_DIETPI-NOTIFY 0 "${G_EXEC_DESC:-$ecommand}"; break; } ### Error @@ -906,7 +906,7 @@ $grey───────────────────────── [[ $attempt -le $G_EXEC_RETRIES ]] && { ((attempt++)) && continue; } # Print FAILED, append raw command string if $G_EXEC_DESC is given - G_DIETPI-NOTIFY 1 "${G_EXEC_DESC:+$G_EXEC_DESC\n - Command: }$*" + G_DIETPI-NOTIFY 1 "${G_EXEC_DESC:+$G_EXEC_DESC\n - Command: }$ecommand" # Exit retry loop if $G_EXEC_NOHALT=1 is given [[ $G_EXEC_NOHALT == 1 ]] && break @@ -1018,7 +1018,7 @@ $log_content" || break # Exit error handler menu loop on cancel \nNB: Please only use this solution if you know for sure that it will not cause follow up issues from the originating script. It will e.g. allow you to continue a certain software install, but if you edit the download link, the originating script might expect files which are not present. \nUse this work caution!'; then - G_DIETPI-NOTIFY 2 "Executing alternative command: $G_WHIP_RETURNED_VALUE" + G_DIETPI-NOTIFY 2 "Executing alternative command: ${G_WHIP_RETURNED_VALUE//\\/\\\\}" $G_WHIP_RETURNED_VALUE exit_code=$? G_DIETPI-NOTIFY -1 $exit_code 'Alternative command execution' From 3b201d96aa185b23a2274248e45fbc455863557a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 25 Jan 2021 19:22:09 +0100 Subject: [PATCH 067/218] v6.35 + DietPi-Set_hardware | soundcard: Avoid error messages when no sound card is currently registered. Apply G_EXEC and print a general message when resetting and applying new chosen settings so separate the additional output. + DietPi-Set_hardware | soundcard: Prefer /proc/asound/cards over "aplay -l" to gather sound card information --- dietpi/func/dietpi-set_hardware | 56 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 5ba70edcf4..a494ee12b1 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1621,6 +1621,8 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # Disable all sound cards and reset all settings Soundcard_Reset_All(){ + G_DIETPI-NOTIFY 2 'Resetting all sound card settings...' + # All SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=0 @@ -1628,13 +1630,13 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 ALSA_EQ_ENABLED=0 # - Remove previous asound.conf - [[ -f '/etc/asound.conf' ]] && rm /etc/asound.conf + [[ -f '/etc/asound.conf' ]] && G_EXEC rm /etc/asound.conf # - Remove stored amixer state - [[ -f '/var/lib/alsa/asound.state' ]] && rm /var/lib/alsa/asound.state + [[ -f '/var/lib/alsa/asound.state' ]] && G_EXEC rm /var/lib/alsa/asound.state # - Reset active amixer state - [[ $INPUT_DEVICE_VALUE == 'none' ]] || alsactl -g init + [[ $INPUT_DEVICE_VALUE != 'none' && -f '/proc/asound/cards' && $( Date: Tue, 26 Jan 2021 13:25:38 +0100 Subject: [PATCH 068/218] v6.35 + DietPi-Patch | Inform users of pre-v6.14 systems interactively about the global software password encryption and removal from dietpi.txt. This was done in dietpi-software previously but fits much better right into the update process where we inform about such changes and assume hence an interactive call anyway. Instead of applying the informational sentence as string to dietpi.txt, comment the setting as well so that it is not used accidentally a new input password, if that dietpi.txt is copied unchanged to a new DietPi system. --- dietpi/patch_file | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 6457a8b185..4991f764db 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -797,13 +797,15 @@ _EOF_' # Encrypt and secure GLOBAL_PW used by DietPi-Software: https://github.com/MichaIng/DietPi/issues/2021 if [[ ! -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - local pw_dietpi_software=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - # Failsafe, should never occur - [[ $pw_dietpi_software ]] || pw_dietpi_software='dietpi' - - G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /boot/dietpi.txt + G_WHIP_MSG '[ INFO ] For security reasons your global software password will be removed from dietpi.txt and instead ecrypted and saved to: + - /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin +\nDietPi-Software will decrypt and use it as default for software installs. You can change it via: + - dietpi-config > Security Options > Change Passwords' + G_EXEC mkdir -p /var/lib/dietpi/dietpi-software - mkdir -p /var/lib/dietpi/dietpi-software # Should already exist, failsafe + local pw_dietpi_software=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + G_EXEC sed -i '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/c\#AUTO_SETUP_GLOBAL_PASSWORD= # Password has been ecrypted and saved to rootfs' /boot/dietpi.txt + [[ $pw_dietpi_software ]] || pw_dietpi_software='dietpi' # Fallback to default # Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2=() From f37c9521a5b2597b1ca25c3f4a5b99d4f2a0d17d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 26 Jan 2021 13:53:13 +0100 Subject: [PATCH 069/218] v6.35 + DietPi-Software | Do not print info about password encryption anymore. This is not done as part of dietpi-update patches and on new images as part of dietpi-set_software call as part of first run setup. + DietPi-Software | When password fallback is used, always re-encrypt it and inform users how to change it. + DietPi-Software | When password decryption fails with an exit code, assure that the string is empty to allow fallback to the default, so that no unexpected string can be applied. + DietPi-Software | When encrypting the password, instead of applying the informational sentence as string to the dietpi.txt, comment the setting as well so that it is not used accidentally as new input password, e.g. if that dietpi.txt is copied unchanged to a new DietPi system. of the encrypted file got removed. --- dietpi/dietpi-software | 60 +++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a28bb4f99d..65e534096f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -150,52 +150,46 @@ _EOF_ # Global password for software installs GLOBAL_PW= - Update_Global_Pw(){ - - GLOBAL_PW= - + Update_Global_Pw() + { # Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 - local pbkdf2=() + local pbkdf2=() encrypt=0 (( $G_DISTRO > 4 )) && pbkdf2=('-iter' '10000') # Read encrypted password - if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - - GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc "${pbkdf2[@]}" -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) - # - Allow decryption without "-iter 10000" and re-encrypt on dist-upgraded Buster systems - if (( $? && $G_DISTRO > 4 )); then - - GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) - # shellcheck disable=SC2181 - [[ $? == 0 && $GLOBAL_PW ]] && openssl enc -e -a -md sha256 -aes-256-cbc -iter 10000 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< "$GLOBAL_PW" - + if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]] + then + if ! GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc "${pbkdf2[@]}" -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) + then + # Allow decryption without "-iter 10000" and re-encrypt on dist-upgraded Buster systems + encrypt=1 + # In case of error, assure empty password to fallback to default + (( $G_DISTRO > 4 )) && GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) || GLOBAL_PW= fi # If encryption has not yet been done, do it now! - elif GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt); then - - G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /boot/dietpi.txt - openssl enc -e -a -md sha256 -aes-256-cbc "${pbkdf2[@]}" -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< "$GLOBAL_PW" - # Inform user if encryption is done after update of an old DietPi instance, else firstrun setup does the job - (( $G_DIETPI_INSTALL_STAGE == 2 )) && G_WHIP_MSG '[ INFO ] For security reasons your global software password has been removed from dietpi.txt and instead ecrypted and saved to: - - /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin\n -DietPi-Software will decrypt and use it for software installs. You can change it via: - - dietpi-config > Security Options > Change Passwords' + else + encrypt=1 + GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + G_EXEC sed -i '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/c\#AUTO_SETUP_GLOBAL_PASSWORD= # Password has been ecrypted and saved to rootfs' /boot/dietpi.txt + fi + # Fallback + if [[ ! $GLOBAL_PW ]] + then + encrypt=1 + GLOBAL_PW='dietpi' + G_WHIP_MSG "[FAILED] Unable to obtain your global software password +\nThe following fallback password will be used:\n - $GLOBAL_PW +\nYou can change it via:\n - dietpi-config > Security Options > Change Passwords" fi + # Encrypt + [[ $encrypt == 1 ]] && openssl enc -e -a -md sha256 -aes-256-cbc "${pbkdf2[@]}" -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW + # Apply safe permissions chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - - # Failsafe - if [[ ! $GLOBAL_PW ]]; then - - GLOBAL_PW='dietpi' - G_WHIP_MSG "[FAILED] Unable to obtain your global software password\n\nThe following fallback password will be used:\n - $GLOBAL_PW" - - fi - } # Total system RAM: Used to calculate percentage based value for software cache limits, e.g.: OPcache/APCu From 027855b80779b259ef8378bf314a085d645fe119 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 26 Jan 2021 14:03:33 +0100 Subject: [PATCH 070/218] v6.35 + dietpi.txt | Add info that the global software password will be removed from the config file on first dietpi-software execution --- dietpi.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index de431e4d1d..66d5f80e9f 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -99,8 +99,9 @@ AUTO_SETUP_AUTOSTART_LOGIN_USER=root AUTO_SETUP_AUTOMATED=0 # Global Password to be applied for the system -# - Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a login password -# - WARN: Passwords with any of the following characters are not supported: \"$ +# - Affects "root" and "dietpi" users login passwords and is used by dietpi-software as default for software installs which require a password. +# - On first dietpi-software execution, the password is removed from this file and instead encrypted and saved to rootfs. +# - WARN: We cannot guarantee that all software options can handle special characters like \"$. AUTO_SETUP_GLOBAL_PASSWORD=dietpi # Software to automatically install From 4269c51dc32425e0838abf28b24f47641c5bbe82 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Jan 2021 13:19:12 +0100 Subject: [PATCH 071/218] v6.35 + DietPi-PREP | Remove various base files and all home directories (including /root) in one step and restore via base-files package reinstall + DietPi-PREP | Exclude another Armbian skeleton dir content which doubles with DietPi htoprc + DietPi-PREP | On post-v6.28 sytems, when a DietPi base system is detected, stop dietpi-preboot explicitly to have dietpi-boot and dietpi-postboot stopped with it as requisite --- PREP_SYSTEM_FOR_DIETPI.sh | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 91fec2387c..5726632927 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -262,29 +262,26 @@ _EOF_ G_DIETPI-NOTIFY 2 'DietPi system found, uninstalling old instance...' - # Stop services: RAMdisk includes (Pre|Post)Boot due to dependencies + # Stop services [[ -f '/boot/dietpi/dietpi-services' ]] && /boot/dietpi/dietpi-services stop [[ -f '/etc/systemd/system/dietpi-ramlog.service' ]] && systemctl stop dietpi-ramlog - [[ -f '/etc/systemd/system/dietpi-ramdisk.service' ]] && systemctl stop dietpi-ramdisk + [[ -f '/etc/systemd/system/dietpi-ramdisk.service' ]] && systemctl stop dietpi-ramdisk # Includes (Pre|Post)Boot on pre-v6.29 systems + [[ -f '/etc/systemd/system/dietpi-preboot.service' ]] && systemctl stop dietpi-preboot # Includes (Pre|Post)Boot on post-v6.28 systems # Disable DietPi services for i in /etc/systemd/system/dietpi-* do - [[ -f $i ]] && systemctl disable --now "${i##*/}" rm -Rfv "$i" - done # Delete any previous existing data - # - /DietPi mount point: Pre-v6.29 + # - Pre-v6.29: /DietPi mount point findmnt /DietPi > /dev/null && umount -R /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* rm -fv /etc/apt/apt.conf.d/{99-dietpi-norecommends,98-dietpi-no_translations,99-dietpi-forceconf} # Pre-v6.32 - - [[ -f '/root/DietPi-Automation.log' ]] && rm -v /root/DietPi-Automation.log [[ -f '/boot/Automation_Format_My_Usb_Drive' ]] && rm -v /boot/Automation_Format_My_Usb_Drive else @@ -1024,10 +1021,6 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' - # shellcheck disable=SC2015,SC2115 - [[ -d '/home' ]] && rm -Rfv /home/{,.??,.[^.]}* || mkdir /home - # shellcheck disable=SC2015,SC2115 - [[ -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/{,.??,.[^.]}* @@ -1134,8 +1127,6 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then [[ -f '/usr/local/sbin/log2ram' ]] && rm -v /usr/local/sbin/log2ram umount /var/log.hdd 2> /dev/null [[ -d '/var/log.hdd' ]] && rm -R /var/log.hdd - [[ -f '/root/.not_logged_in_yet' ]] && rm -v /root/.not_logged_in_yet - [[ -f '/root/.desktop_autologin' ]] && rm -v /root/.desktop_autologin rm -vf /etc/X11/xorg.conf.d/*armbian* #rm -vf /etc/armbian* armbian-release # Required for kernel/bootloader package upgrade (initramfs postinst) rm -vf /lib/systemd/system/*armbian* @@ -1145,6 +1136,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then #rm -vf /etc/default/*armbian* # Required for Armbian root package upgrade rm -vf /etc/update-motd.d/*armbian* rm -vf /etc/profile.d/*armbian* + rm -Rfv /etc/skel/.config #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for Armbian root package upgrade #[[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian # Required for Armbian root package upgrade # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi @@ -1154,6 +1146,7 @@ path-exclude /lib/systemd/system/*armbian* path-exclude /etc/systemd/system/logrotate.service path-exclude /etc/apt/apt.conf.d/*armbian* path-exclude /etc/cron.*/*armbian* +path-exclude /etc/skel/.config/htop/htoprc #path-exclude /etc/default/*armbian* # Required for Armbian root package upgrade path-exclude /etc/update-motd.d/*armbian* path-exclude /etc/profile.d/*armbian* @@ -1171,8 +1164,6 @@ _EOF_ # - Meveric specific [[ -f '/usr/local/sbin/setup-odroid' ]] && rm -v /usr/local/sbin/setup-odroid - [[ -d '/root/scripts' ]] && rm -R /root/scripts - [[ -f '/root/resize--log.txt' ]] && rm /root/resize--log.txt rm -fv /installed-packages*.txt # - RPi specific: https://github.com/MichaIng/DietPi/issues/1631#issuecomment-373965406 @@ -1207,11 +1198,6 @@ _EOF_ #----------------------------------------------------------------------------------- # Bash Profiles - # - Pre v6.9 cleaning: - [[ -f '/root/.bashrc' ]] && sed -i '/\/DietPi/d' /root/.bashrc - [[ -f '/home/dietpi/.bashrc' ]] && sed -i '/\/DietPi/d' /home/dietpi/.bashrc - rm -vf /etc/profile.d/99-dietpi* - # - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts: sed -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc # shellcheck disable=SC2016 @@ -1364,9 +1350,9 @@ _EOF_' echo -e "Samba client: $info_use_drive_manager" > /mnt/samba/readme.txt echo -e "NFS client: $info_use_drive_manager" > /mnt/nfs_client/readme.txt - G_DIETPI-NOTIFY 2 'Restoring original MOTD:' - rm -fv /etc/motd - cp -v /usr/share/base-files/motd /etc/motd + G_DIETPI-NOTIFY 2 'Restoring default base files:' + rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail + G_AGI --reinstall base-files # Restores /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail via postinst # Add pre-up lines for WiFi on OrangePi Zero if (( $G_HW_MODEL == 32 )); then @@ -1861,9 +1847,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Please delete outdated non-APT kernel modules:' ls -lAh /lib/modules - G_DIETPI-NOTIFY 2 'Please check and delete all non-required home diretory content:' - ls -lAh /root /home/*/ - G_DIETPI-NOTIFY 0 'Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi.' # Power off system From 20d0e6a6c5255fc4dc50a0f9c5e8e38dc87fdedc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Jan 2021 14:32:52 +0100 Subject: [PATCH 072/218] v6.35 + DietPi-PREP | Try to mute a perl locale error by exporting safe locale variables before reconfiguring the locale package --- PREP_SYSTEM_FOR_DIETPI.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5726632927..711d29b15a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -126,23 +126,23 @@ _EOF_ fi # Setup locale - # - Remove existing settings that could break dpkg-reconfigure locales + # - Reset existing configs > /etc/environment [[ -f '/etc/default/locale' ]] && rm /etc/default/locale - # - NB: DEV, any changes here must be also rolled into function '/boot/dietpi/func/dietpi-set_software locale', for future script use + # - Prepare C.UTF-8 generation only, statically shipped as /usr/lib/locale/C.UTF-8 via libc-bin essential package echo 'C.UTF-8 UTF-8' > /etc/locale.gen + # - Apply override LC_ALL and default LANG for current script + export LC_ALL='C.UTF-8' LANG='C.UTF-8' # - dpkg-reconfigure includes: # - "locale-gen": Generate locale(s) based on "/etc/locale.gen" or interactive selection. - # - "update-locale": Add $LANG to "/etc/default/locale" based on generated locale(s) or interactive default language selection. + # - "update-locale": Add LANG to "/etc/default/locale" based on generated locale(s) or interactive default language selection. if ! dpkg-reconfigure -f noninteractive locales; then echo -e '[FAILED] Locale generation failed. Aborting...\n' exit 1 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) + # - Add override LC_ALL to "/etc/default/locale" as well update-locale 'LC_ALL=C.UTF-8' # Set Git owner From 600d5b97dd43723566714c00160ffa690773af73 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Jan 2021 15:38:32 +0100 Subject: [PATCH 073/218] v6.35 + DietPi-PREP | Add dietpi.com SSH host key after cleaning /root home. Fix base-files reinstall not re-creating missing config files and call postinst manually, since on reinstall with a shipped arg $2 existing version, creating further base configs and dirs is skipped. --- PREP_SYSTEM_FOR_DIETPI.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 711d29b15a..154ef6d0dc 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1113,9 +1113,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then for i in "${aservices[@]}" do - G_EXEC update-rc.d -f "$i" remove - done unset -v aservices @@ -1277,10 +1275,6 @@ _EOF_' fi [[ -f '/etc/udev/rules.d/70-persistent-net.rules' ]] && rm -v /etc/udev/rules.d/70-persistent-net.rules # Jessie pre-image - G_DIETPI-NOTIFY 2 'Resetting and adding dietpi.com SSH pub host key for DietPi-Survey/Bugreport uploads:' - mkdir -pv /root/.ssh - echo 'ssh.dietpi.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' > /root/.ssh/known_hosts - G_DIETPI-NOTIFY 2 'Configuring DNS nameserver:' # Failsafe: Assure that /etc/resolv.conf is not a symlink and disable systemd-resolved systemctl disable --now systemd-resolved @@ -1352,7 +1346,12 @@ _EOF_' G_DIETPI-NOTIFY 2 'Restoring default base files:' rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail - G_AGI --reinstall base-files # Restores /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail via postinst + G_AGI -o 'Dpkg::Options::=--force-confmiss,confnew' --reinstall base-files base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home + G_EXEC /var/lib/dpkg/info/base-files.postinst configure # Restore /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail + + G_DIETPI-NOTIFY 2 'Resetting and adding dietpi.com SSH pub host key for DietPi-Survey/Bugreport uploads:' + mkdir -pv /root/.ssh + echo 'ssh.dietpi.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' > /root/.ssh/known_hosts # Add pre-up lines for WiFi on OrangePi Zero if (( $G_HW_MODEL == 32 )); then From 6e76c3c0a13b2fae47997eda99c89b5c43ef30f6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Jan 2021 15:10:58 +0100 Subject: [PATCH 074/218] v6.35 + DietPi-Software | Medusa: Disable on Stretch, since Medusa now requires Python 3 > 3.5, which is not available on Debian Stretch + DietPi-Software | Medusa: Prevent unlimited service restarts on failure: Permit up to three restarts in 10 minutes --- dietpi/dietpi-software | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 65e534096f..e272ffecb3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -832,6 +832,8 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327' + # - Stretch: Python 3 > 3.5 only: https://github.com/pymedusa/Medusa#dependencies + aSOFTWARE_AVAIL_G_DISTRO[$software_id,4]=0 #------------------ software_id=132 @@ -11342,7 +11344,12 @@ _EOF_ # Service: https://github.com/pymedusa/Medusa/blob/master/runscripts/init.systemd G_EXEC cp /mnt/dietpi_userdata/medusa/runscripts/init.systemd /etc/systemd/system/medusa.service - G_EXEC sed -i 's/^[[:blank:]]*Group=/#Group=/' /etc/systemd/system/medusa.service + # - Prevent unlimited restarts on failure: Permit up to three restarts in 10 minutes + G_CONFIG_INJECT 'StartLimitIntervalSec=' 'StartLimitIntervalSec=600' /etc/systemd/system/medusa.service '\[Unit\]' + G_CONFIG_INJECT 'StartLimitBurst=' 'StartLimitBurst=3' /etc/systemd/system/medusa.service 'StartLimitIntervalSec=' + # - Remove "Group=medusa" which does not exist, instead fallback to prinmary group "dietpi" + G_EXEC sed -i '/^[[:blank:]]*Group=/d' /etc/systemd/system/medusa.service + # - Launch from our install and data directory G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v python3) /mnt/dietpi_userdata/medusa/start.py -q --nolaunch --datadir=/mnt/dietpi_userdata/medusa" /etc/systemd/system/medusa.service # Permissions @@ -14894,20 +14901,18 @@ _EOF_ fi software_id=116 # Medusa - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling - if [[ -f '/etc/systemd/system/medusa.service' ]]; then - + if [[ -f '/etc/systemd/system/medusa.service' ]] + then systemctl disable --now medusa rm -R /etc/systemd/system/medusa.service* - fi [[ -d '/etc/systemd/system/medusa.service.d' ]] && rm -R /etc/systemd/system/medusa.service.d [[ -d '/mnt/dietpi_userdata/medusa' ]] && rm -R /mnt/dietpi_userdata/medusa getent passwd medusa > /dev/null && userdel medusa getent group medusa > /dev/null && groupdel medusa # Pre-v6.33 - fi software_id=107 # rTorrent From 556756d0a4690a5ddff1d4a9933df49a4600e2a0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Jan 2021 15:14:05 +0100 Subject: [PATCH 075/218] v6.35 + CHANGELOG | Medusa: This software option has been disabled on Stretch systems --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5c7f41d2a7..fb9c013587 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Fixes: - DietPi-Software | Unbound: Resolved an issue where the service start failed if the host system had a local IP address outside of the 192.168.0.0/16 subnet. Many thanks to @faxesystem for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-749174984 - DietPi-Software | ReadyMedia: Resolved an issue where the media library was not rescanned on service start. Many thanks to @AdamFarnsworth0 for reporting this issue: https://twitter.com/AdamFarnsworth0/status/1347977813635305475 - DietPi-Software | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed. Many thanks to @smogan71 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8523 +- DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 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/4XXX From 7ecb3a98b8e3479d31804a94a9198e716ad17982 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Tue, 2 Feb 2021 01:01:34 +0100 Subject: [PATCH 076/218] v6.35 (#4039) + DietPi-Software | PaperMC: Add memory parameter to the service to allow successful initial start of the service on low memory devices. + DietPi-Software | PaperMC: Ensure a memory setting of min 1.5 GiB (phys + swap). If needed, create a swap file + DietPi-Software | PaperMC: Show an information about long start time and swap use on software selection + DietPi-Software | PaperMC: Added new download URL to obtain latest PaperMC version + DietPi-Software | Create_Config: Allow to print service journal output to console for possible time consuming startups, so that users can follow the process. Additionally stop waiting if the service is not actively running anymore, e.g. due to a crash or other unexpected stop. + DietPi-Software | PaperMC: Print journal output of possible long taking service startup to console + DietPi-Software | PaperMC: Do not ask for EULA when it has been accepted before already --- dietpi/dietpi-software | 88 ++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e272ffecb3..f42d328a9f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -192,8 +192,10 @@ _EOF_ chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin } - # Total system RAM: Used to calculate percentage based value for software cache limits, e.g.: OPcache/APCu - RAM_TOTAL=$(free -m | mawk '/^Mem:/{print $2;exit}') + # Total physical system RAM: Used to calculate percentage based value for software cache limits, e.g.: OPcache/APCu + RAM_PHYS=$(free -m | mawk '/^Mem:/{print $2;exit}') + # Total RAM + swap space: Used to estimate whether the swap file size needs to be increased. + RAM_TOTAL=$(free -tm | mawk '/^Total:/{print $2;exit}') # Run Installation Flag (1 = run installs) GOSTARTINSTALL=0 @@ -2805,7 +2807,7 @@ _EOF_ # Cache size (MB) 1/10th of total mem if (( $1 == 0 )); then - output=$(( $RAM_TOTAL / 10 )) + output=$(( $RAM_PHYS / 10 )) # Max active downloads elif (( $1 == 1 )); then @@ -3004,6 +3006,7 @@ _EOF_ { local file=$1 service=$2 local timeout=${3:-25} # Optional + local output=$4 pid # Optional, if timeout is set, hence for startups which may take long so that showing some process becomes reasonable local content=$CREATE_CONFIG_CONTENT # Optional unset -v CREATE_CONFIG_CONTENT @@ -3014,16 +3017,24 @@ _EOF_ G_EXEC systemctl daemon-reload # File does not exist or does not contain required content: Start service - G_EXEC_DESC="Starting ${aSOFTWARE_NAME[$software_id]} to pre-create config file" G_EXEC systemctl start "$service" + G_EXEC_DESC="Starting ${aSOFTWARE_NAME[$software_id]} to pre-create config file in max $timeout seconds" G_EXEC systemctl start "$service" + + # Print and follow output of the service startup + [[ $output ]] && { journalctl -fu "$service" & pid=$!; } # Wait for max $timeout seconds until config file has been created and required content added, if given local i=0 - until [[ -f $file ]] && { [[ ! $content ]] || grep -q "$content" "$file"; } || (( $i >= $timeout )) + until [[ -f $file ]] && { [[ ! $content ]] || grep -q "$content" "$file"; } || (( $i >= $timeout )) || ! systemctl -q is-active "$service" do ((i++)) - G_DIETPI-NOTIFY -2 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file to be created ($i/$timeout)" + [[ $output ]] || G_DIETPI-NOTIFY -2 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file to be created ($i/$timeout)" sleep 1 done + + # Stop journal prints + [[ $output ]] && { kill $pid; wait $pid; } 2> /dev/null + + # Stop service sleep 1 G_EXEC_NOHALT=1 G_EXEC systemctl stop "$service" sleep 1 @@ -3035,7 +3046,7 @@ _EOF_ return 0 fi - G_DIETPI-NOTIFY 1 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file timed out, skipping pre-configuration" + G_DIETPI-NOTIFY 1 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file failed, skipping pre-configuration" return 1 } @@ -5592,14 +5603,14 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_EXEC mv "bitwarden_rs-$version" /opt/bitwarden_rs # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available and limit concurrent cargo build jobs to 2 if less than 3 GiB memory is available. - local memory=$(free -tm | mawk '/^Total:/{print $2;exit}') jobs= - if (( $memory < 1948 )) + local jobs= + if (( $RAM_TOTAL < 1948 )) then G_DIETPI-NOTIFY 2 'Bitwaden_RS build requires at least 2 GiB memory. We will now increase your swap size to satisfy this requirement.' /boot/dietpi/func/dietpi-set_swapfile 1 (( $G_HW_CPU_CORES > 2 )) && jobs=2 - elif (( $memory < 3072 && $G_HW_CPU_CORES > 2 )) + elif (( $RAM_TOTAL < 3072 && $G_HW_CPU_CORES > 2 )) then jobs=2 fi @@ -6339,7 +6350,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u G_EXEC eval "echo 'mycroft ALL=NOPASSWD: ALL' > /etc/sudoers.d/mycroft" # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available - if (( $(free -tm | mawk '/^Total:/{print $2;exit}') < 1948 )); then + if (( $RAM_TOTAL < 1948 )); then G_DIETPI-NOTIFY 2 '\e[33m[WARNING] Insufficient overall memory size: Mycroft AI requires at least 2 GiB memory on first start. We will now attempt to increase your swap size to satisfy this requirement.' /boot/dietpi/func/dietpi-set_swapfile 1 @@ -6541,9 +6552,15 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas # Make sure user agrees to the EULA G_WHIP_BUTTON_OK_TEXT='YES' G_WHIP_BUTTON_CANCEL_TEXT='NO' - if G_WHIP_YESNO 'Do you agree to the Minecraft EULA found at:\n\nhttps://account.mojang.com/documents/minecraft_eula' + if [[ -f '/mnt/dietpi_userdata/papermc/eula.txt' ]] || G_WHIP_YESNO 'Do you agree to the Minecraft EULA found at:\n\nhttps://account.mojang.com/documents/minecraft_eula' then - Download_Install 'https://papermc.io/ci/job/Paper-1.16/lastStableBuild/artifact/paperclip.jar' /opt/papermc/paperclip.jar + # Collect latest version of PaperMC + local url='https://papermc.io/api/v2/projects/paper' + local version=$(curl -sSfL "$url"); version=${version%\"*} version=${version##*\"} + local build=$(curl -sSfL "$url/versions/$version"); build=${build%]*} build=${build##*[,[]} + #local file=$(curl -sSfL "$url/versions/$version/builds/$build"); file=${file##*\"name\":\"} file=${file%%\"*} + # Download and install PaperMC + Download_Install "$url/versions/$version/builds/$build/downloads/paper-$version-$build.jar" /opt/papermc/paperclip.jar G_EXEC mkdir -p /mnt/dietpi_userdata/papermc G_EXEC eval 'echo "eula=true" > /mnt/dietpi_userdata/papermc/eula.txt' else @@ -7461,7 +7478,7 @@ _EOF_ # - Nginx: https://github.com/MichaIng/DietPi/issues/546 => https://github.com/MichaIng/DietPi/blob/dev/.conf/dps_85/nginx.conf # Cache settings - local target_php_cachesize=$(( $RAM_TOTAL / 30 )) + local target_php_cachesize=$(( $RAM_PHYS / 30 )) (( $target_php_cachesize < 10 )) && target_php_cachesize=10 # - OPcache G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini @@ -7956,7 +7973,7 @@ location = /.well-known/caldav { grep -q "^[[:blank:]]*'maintenance' => true," $config_php || occ maintenance:mode --on # On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293 - (( $RAM_TOTAL < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 + (( $RAM_PHYS < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 fi @@ -8217,7 +8234,7 @@ The install script will now exit. After applying one of the the above, rerun die grep -q "^[[:blank:]]*'maintenance' => true," $config_php || ncc maintenance:mode --on # On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293 - (( $RAM_TOTAL < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 + (( $RAM_PHYS < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 fi @@ -9370,7 +9387,7 @@ Do you want to block public access to the admin panel now?" && eval "$enable_cmd Create_User -g dietpi -G audio -d /mnt/dietpi_userdata/airsonic airsonic # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -9411,7 +9428,7 @@ _EOF_ # Config # - Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 G_CONFIG_INJECT 'SUBSONIC_USER=' 'SUBSONIC_USER=subsonic' /etc/default/subsonic G_CONFIG_INJECT 'SUBSONIC_ARGS=' "SUBSONIC_ARGS='--quiet --pidfile=/run/subsonic.pid --max-memory=$memory_limit --default-music-folder=/mnt/dietpi_userdata/Music --default-podcast-folder=/mnt/dietpi_userdata/Music --default-playlist-folder=/mnt/dietpi_userdata/Music'" /etc/default/subsonic @@ -9826,7 +9843,7 @@ _EOF_ G_EXEC ln -s /var/log/ubooquity /mnt/dietpi_userdata/ubooquity/logs # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -9890,7 +9907,7 @@ spring: url: jdbc:h2:/mnt/dietpi_userdata/komga/database.h2 _EOF_ # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -11119,7 +11136,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}M +pieces.memory.max.set = ${RAM_PHYS}M pieces.hash.on_completion.set = no ### Connection settings @@ -12859,6 +12876,19 @@ _EOF_ # Permissions G_EXEC chown -R papermc:papermc /{mnt/dietpi_userdata,var/log}/papermc + # Assure 1.5 GiB overall memory (-100 MiB to avoid tiny swap space) is available. + local heap_size='512' + if (( $RAM_TOTAL < 1436 )) + then + G_DIETPI-NOTIFY 2 'Stable PaperMC operation requires at least 1.5 GiB system memory. We will now increase your swap size to satisfy this requirement.' + /boot/dietpi/func/dietpi-set_swapfile $(( 1536 - $RAM_PHYS )) + + # On 2 GiB+ physical RAM devices, apply 1 GiB heap size by default + elif (( $RAM_PHYS > 1848 )) + then + heap_size='1024' + fi + # Service cat << _EOF_ > /etc/systemd/system/papermc.service [Unit] @@ -12869,7 +12899,7 @@ Documentation=https://paper.readthedocs.io/ User=papermc SyslogIdentifier=papermc WorkingDirectory=/mnt/dietpi_userdata/papermc -ExecStart=$(command -v java) -jar /opt/papermc/paperclip.jar --nogui --noconsole +ExecStart=$(command -v java) -Xmx${heap_size}m -jar /opt/papermc/paperclip.jar --nogui --noconsole [Install] WantedBy=multi-user.target @@ -12877,10 +12907,10 @@ _EOF_ # Config if [[ -f '/mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar' && -f '/mnt/dietpi_userdata/papermc/plugins/floodgate-bukkit.jar' ]] then - Create_Config /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml papermc 180 && + Create_Config /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml papermc 1800 1 && G_CONFIG_INJECT 'auth-type:[[:blank:]]' 'auth-type: floodgate' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml else - Create_Config /mnt/dietpi_userdata/papermc/permissions.yml papermc + Create_Config /mnt/dietpi_userdata/papermc/permissions.yml papermc 1800 1 fi G_CONFIG_INJECT 'enable-rcon=' 'enable-rcon=true' /mnt/dietpi_userdata/papermc/server.properties GCI_PASSWORD=1 G_CONFIG_INJECT 'rcon.password=' "rcon.password=$GLOBAL_PW" /mnt/dietpi_userdata/papermc/server.properties @@ -16360,6 +16390,16 @@ _EOF_ fi + # PaperMC: Inform user about long install/startup time and possible swap file usage + if (( ${aSOFTWARE_INSTALL_STATE[181]} == 1 )) + then + local swap_info= + (( $RAM_PHYS < 924 )) && swap_info='\n\nThe server will be started with with minimal required memory usage, but a swap file will be created to assure that no out-of-memory crash can happen. +On servers with less than 1 GiB physical memory, we strongly recommend to move the swap file to an external drive, if your system runs on an SD card, since during normal PaperMC operation this swap space will be heavily used.' + G_WHIP_MSG "PaperMC will be started during install to allow pre-configuring it's default configuration files. Especially on smaller SBCs, like Raspberry Pi Zero, this can take a long time. +We allow it to take up to 30 minutes, it's process can be followed, please be patient.$swap_info" + fi + # Gogs: Requires OpenSSH for ssh-keygen binary: https://github.com/MichaIng/DietPi/issues/442 if (( ${aSOFTWARE_INSTALL_STATE[49]} == 1 && $INDEX_SSHSERVER_TARGET != -2 )); then From 6ea4df15ff26f06b2ba5d417ce1008ba32493c7a Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Tue, 2 Feb 2021 15:59:02 +0100 Subject: [PATCH 077/218] v6.35 DietPi-Software | WiringPi: add a check for availability of /usr/local/bin --- dietpi/dietpi-software | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f42d328a9f..68383d3404 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4357,6 +4357,8 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + [[ -d '/usr/local/bin' ]] || G_EXEC mkdir -p /usr/local/bin # RPi if (( $G_HW_MODEL < 10 )); then From f2e39cf9b6086fce17d8219a7adfc090abfa2dbb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Feb 2021 16:37:09 +0100 Subject: [PATCH 078/218] v6.35 + CHANGELOG | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb9c013587..abf811fd50 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Fixes: - DietPi-Software | ReadyMedia: Resolved an issue where the media library was not rescanned on service start. Many thanks to @AdamFarnsworth0 for reporting this issue: https://twitter.com/AdamFarnsworth0/status/1347977813635305475 - DietPi-Software | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed. Many thanks to @smogan71 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8523 - DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 +- DietPi-Software | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present. Many thanks to @bruz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8609 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/4XXX From 478cbe27325c04228e0992df3b6eadc564dbd5a8 Mon Sep 17 00:00:00 2001 From: ravenclaw900 <50060110+ravenclaw900@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:52:23 +0000 Subject: [PATCH 079/218] v6.35 (#3989) + DietPi-Software | Box86: An i386 wrapper for ARMv7 systems is now available for install. Thanks to binfmt, i386 binaries are executed automatically through Box86, which is able to either wrap native ARMv7 system libraries to work with the i386 binary or find and emulate i386 libraries, installed on the system. Note that it is not able to run x86_64 binaries, nor load such system libaries. + DietPi-Software | Steam: It can now be installed on ARMv7 systems, which will pull in Box86 as dependency then. Note that features and stability are limited and not all games will run. You'll be able to read more about it in our documentation (TBD): https://dietpi.com/docs/ --- dietpi/dietpi-software | 170 +++++++++++++++++++++++++++++++---------- 1 file changed, 129 insertions(+), 41 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 68383d3404..e6c23a1133 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1136,19 +1136,16 @@ _EOF_ software_id=156 aSOFTWARE_NAME[$software_id]='Steam' - aSOFTWARE_DESC[$software_id]='client' + aSOFTWARE_DESC[$software_id]='Valve gaming platform client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8016#p8016' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - # Native PC only - for ((i=0; i<=$MAX_G_HW_MODEL; i++)) - do - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 - done - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + # x86_64 and ARMv7 only + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=164 @@ -1170,6 +1167,20 @@ _EOF_ aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 + #------------------ + software_id=62 + + aSOFTWARE_NAME[$software_id]='Box86' + aSOFTWARE_DESC[$software_id]='x86 userspace emulation' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=0#p0' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + # Only works on ARMv7 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 + # Social & Search #-------------------------------------------------------------------------------- software_id=54 @@ -2453,6 +2464,17 @@ _EOF_ fi + # Software that requires Box86 on ARM: Do not reinstall Box86 if present already! + # - Steam (156) + software_id=62 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} < 2 && $G_HW_ARCH == 2 && + ${aSOFTWARE_INSTALL_STATE[156]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" + + fi + #------------------------------------------------------------------------- # WEBSERVER - Manual stack install # - Define extra DietPi install flags for WEBSERVER_STACKS @@ -6081,21 +6103,25 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Enable foreign i386 architecture, since Steam is i386-only: https://packages.debian.org/steam - if [[ $(dpkg --print-foreign-architectures) != *'i386'* ]]; then - - dpkg --add-architecture i386 - G_AGUP + # Allow non-interactive install + G_EXEC eval "debconf-set-selections <<< 'steam steam/question select I AGREE'" + # x86_64: Install Debian i386 package + if [[ $G_HW_ARCH == 10 ]] + then + # Add i386 arch: https://packages.debian.org/bullseye/steam + [[ $(dpkg --print-foreign-architectures) == *'i386'* ]] || { G_EXEC dpkg --add-architecture i386; G_AGUP; } + # Add Nvidia i386 driver libs, if Nvidia driver is detected + local nvidia + [[ -e '/sys/module/nvidia/version' ]] && nvidia='nvidia-driver-libs:i386' + G_AGI steam $nvidia + + # ARM: Install repacked Debian i386 package for armhf + elif [[ $G_HW_ARCH == 2 ]] + then + Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/steam_$G_HW_ARCH_NAME.deb" fi - # Add Nvidia i386 driver libs, if Nvidia driver is installed - local nvidia= - dpkg-query -s nvidia-driver &> /dev/null && nvidia='nvidia-driver-libs-i386' - - debconf-set-selections <<< 'steam steam/question select I AGREE' - G_AGI steam $nvidia - fi software_id=158 # MinIO @@ -6403,6 +6429,50 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + # APT deps + DEPS_LIST='cmake python3-minimal' + + # Download + local version=$(curl -sSfL https://api.github.com/repos/ptitSeb/box86/tags | mawk '/"name": /{print $4;exit}') + [[ $version ]] || version='v0.2.0' # Fallback + Download_Install "https://github.com/ptitSeb/box86/archive/$version.tar.gz" + + # Build + G_EXEC mkdir box86-${version#v}/build + G_EXEC cd box86-${version#v}/build + # - RPi 2 + if [[ $G_HW_MODEL == 2 ]] + then + G_EXEC cmake .. -DRPI2=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 3 + elif [[ $G_HW_MODEL == 3 ]] + then + G_EXEC cmake .. -DRPI3=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 4 + elif [[ $G_HW_MODEL == 4 ]] + then + G_EXEC cmake .. -DRPI4=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Odroids + elif (( $G_HW_MODEL < 20 )) + then + G_EXEC cmake .. -DODROID=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Others + else + G_EXEC cmake .. -DARM_DYNAREC=ON -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi + G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' "-j$(nproc)" + G_EXEC strip --remove-section=.comment --remove-section=.note box86 + G_EXEC make install + + # Reload binfmt to have i386 binaries executed via box86 automatically from now on + (( $G_HW_ARCH < 10 )) && G_EXEC systemctl restart systemd-binfmt + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12407,20 +12477,21 @@ _EOF_ Banner_Configuration # Move data dir to dietpi_userdata - if [[ -d '/mnt/dietpi_userdata/steam' ]]; then - - rm -Rf /root/.steam - - elif [[ -d '/root/.steam' ]]; then + if [[ -d '/mnt/dietpi_userdata/steam' ]] + then + G_EXEC rm -Rf /root/.steam - mv /root/.steam /mnt/dietpi_userdata/steam + elif [[ -d '/root/.steam' ]] + then + G_EXEC mv /root/.steam /mnt/dietpi_userdata/steam else - - mkdir -p /mnt/dietpi_userdata/steam - + G_EXEC mkdir -p /mnt/dietpi_userdata/steam fi - ln -s /mnt/dietpi_userdata/steam /root/.steam + G_EXEC ln -s /mnt/dietpi_userdata/steam /root/.steam + + # Add Steam desktop shortcut + [[ -f '/root/Desktop/steam.desktop' ]] || G_EXEC ln -sf /usr/share/applications/steam.desktop /root/Desktop/steam.desktop fi @@ -13326,6 +13397,18 @@ _EOF_ fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling + [[ -f '/usr/local/bin/box86' ]] && rm -v /usr/local/bin/box86 + [[ -f '/etc/binfmt.d/box86.conf' ]] && rm -v /etc/binfmt.d/box86.conf + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.6' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.6 + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.5' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.5 + [[ -f '/usr/lib/i386-linux-gnu/libgcc_s.so.1' ]] && rm -v /usr/lib/i386-linux-gnu/libgcc_s.so.1 + [[ -d '/usr/lib/i386-linux-gnu' ]] && rmdir --ignore-fail-on-non-empty /usr/lib/i386-linux-gnu + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -13341,7 +13424,7 @@ _EOF_ fi - software_id=83 + software_id=83 # Apache2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13349,7 +13432,7 @@ _EOF_ fi - software_id=85 + software_id=85 # Nginx if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13357,7 +13440,7 @@ _EOF_ fi - software_id=84 + software_id=84 # Lighttpd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13610,6 +13693,7 @@ _EOF_ rm -R /etc/systemd/system/blynkserver.service* fi + [[ -d '/etc/systemd/system/blynkserver.service.d' ]] && rm -R /etc/systemd/system/blynkserver.service.d getent passwd blynk > /dev/null && userdel blynk getent group blynk > /dev/null && groupdel blynk # Pre-v6.33 [[ -d '/mnt/dietpi_userdata/blynk' ]] && rm -R /mnt/dietpi_userdata/blynk @@ -13629,6 +13713,7 @@ _EOF_ rm -R /etc/systemd/system/aria2.service* fi + [[ -d '/etc/systemd/system/aria2.service.d' ]] && rm -R /etc/systemd/system/aria2.service.d G_AGP aria2 getent passwd aria2 > /dev/null && userdel aria2 getent group aria2 > /dev/null && groupdel aria2 @@ -14087,22 +14172,19 @@ _EOF_ fi software_id=156 # Steam - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP steam - rm -Rf /{root,home/*}/.steam /mnt/dietpi_userdata/steam - + rm -Rf /{root,home/*}/{.steam{,path,pid},Desktop/steam.desktop} /mnt/dietpi_userdata/steam fi software_id=119 # CAVA - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP cava - rm -Rf /{root,home/*}/.config/cava - rm -f /{root,home/*}/cava.psf - + rm -Rf /{root,home/*}/{.config/cava,cava.psf} fi software_id=118 # Mopidy @@ -16571,6 +16653,12 @@ We allow it to take up to 30 minutes, it's process can be followed, please be pa fi + # Box86 warning + if (( ${aSOFTWARE_INSTALL_STATE[156]} == 1 && $G_HW_ARCH == 2 )) + then + G_WHIP_MSG 'WARNING: The piece of software you are about to install is meant for the x86 platform.\n\nBox86 will be used to run it on ARM, however there may be performance and compatibility issues.' + fi + # dietpi-config can be used to install/configure the following software. Ask user. # - No-IP if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then From 664fe3f8e707c7006c5acd40053db90cc819a2b3 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Thu, 4 Feb 2021 00:20:53 +0100 Subject: [PATCH 080/218] v6.35 (#4015) + DietPi-Software | Consequently use $G_GITBRANCH instead of hardcoded "MichaIng" Git owner + DietPi-Software | Add desktop configs system-wide instead of for root's desktop only + DietPi-Software | Desktop shortcuts are now created as follows: On first desktop install, a system-wide desktop autostart entry is created that links/copies user-level configs and desktop entries into the users home dir, once it logs in the first time. The autostart entry then disables itseld. This way only users which are actually used for desktop sessions get related configs and entries, and only a single time. Desktop shortcuts for later installed software titles are added only to users, which did already log into a desktop, hence have the autostart entry disabled. For now users, those are added by the autostart entry as well. + DietPi-Software | Further implement G_EXEC error handler where applicable and minor coding + DietPi-Software | DietPi-Desktop_setup: Replace /root in bookmarks with actual users home + DietPi-Software | MATE: Enable audio (playback and settings panel) by installing the mate-media package + DietPi-Software | MATE: Do not add a Caja desktop icon, since by default a user home icon is present already + DietPi-Software | Desktops: Simplify xcompmgr install, which is only used/compatible with LXDE and LXQt. All other desktops have one integrated so that either the integrated one or xcompmgr fails. To be failsafe on Xfce, actively remove the autostart entry as it breaks the internal one, leading to ugly results. + DietPi-Software | X server: Do not install xterm by default. Each desktop has an own terminal emulator which looks and works much better. Especially when starting terminal applications from desktop entries, xterm overrides the desktops emulator, but has limited colour and fonts set, which does not look good. If there is a non-desktop X application that can make use of a terminal emulator without shipping one, we can re-add it to the related X client install. + DietPi-Software | GNUstep: Add xterm as dependency as the GPUstep "Terminal" cannot launch scripts. Remove "x-window-system-core" => "xorg" and "libc-dbg" => "libc6-dbg" dependencies which are not required to launch any of the pre-installed desktop applications. --- dietpi/dietpi-autostart | 4 +- dietpi/dietpi-software | 267 ++++++++++++++++++++++++---------------- 2 files changed, 163 insertions(+), 108 deletions(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 3a44f3840d..ae2ca4f37d 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -18,7 +18,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - readonly G_PROGRAM_NAME='DietPi-Autostart' + readonly G_PROGRAM_NAME='DietPi-AutoStart' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -255,7 +255,7 @@ This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you ex elif [[ $ID_AUTOSTART == 14 && ! -f '/var/lib/dietpi/dietpi-autostart/custom.sh' ]]; then G_EXEC mkdir -p /var/lib/dietpi/dietpi-autostart - cat << _EOF_ > /var/lib/dietpi/dietpi-autostart/custom.sh + cat << '_EOF_' > /var/lib/dietpi/dietpi-autostart/custom.sh #!/bin/bash #---Examples--- diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e6c23a1133..f60d578d93 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2745,12 +2745,21 @@ _EOF_ Create_Desktop_Shared_Items(){ # Pre-create dirs - G_EXEC mkdir -p /root/Desktop /usr/share/applications /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers} + G_EXEC mkdir -p /usr/share/applications /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers} - # Copy DietPi favourite links - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks" -o /root/.gtk-bookmarks + # Icons + G_THREAD_START curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi-Website/master/images/dietpi-logo_128x128.png' -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png + + # Wallpapers + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png + + # File manager bookmarks + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks" -o /var/lib/dietpi/dietpi-software/installed/desktop/.gtk-bookmarks - # DietPi apps to download + # Desktop applications local adesktop_items=( 'dietpi-software' @@ -2773,34 +2782,80 @@ _EOF_ for i in "${adesktop_items[@]}" do - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i.desktop" -o "/usr/share/applications/$i.desktop" - done - # Icons - G_THREAD_START curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi-Website/master/images/dietpi-logo_128x128.png' -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png + # Create autostart script to add default desktop icons and configs to users that login the first time into a desktop + cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh +#!/bin/dash - # Wallpapers - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png +# Create desktop shortcuts +set 'opentyrian' 'kodi' 'steam' 'dxx-rebirth' 'chromium' 'chromium-browser' 'htop' +[ $USER = 'root' ] && set "$@" 'dietpi-launcher' 'dietpi-software' 'dietpi-config' +[ -d ~/Desktop ] || mkdir -p ~/Desktop +for i in "$@" +do + [ -f /usr/share/applications/$i.desktop ] && ! [ -f ~/Desktop/$i.desktop ] && ln -sf /usr/share/applications/$i.desktop ~/Desktop/$i.desktop +done - G_THREAD_WAIT +# Create file manager bookmarks +if ! [ -f ~/.gtk-bookmarks ] +then + cp /var/lib/dietpi/dietpi-software/installed/desktop/.gtk-bookmarks ~/.gtk-bookmarks + sed -i "s|/root|$HOME|g" ~/.gtk-bookmarks +fi - # Desktop app symlinks - ln -sf /usr/share/applications/htop.desktop /root/Desktop/htop.desktop - ln -sf /usr/share/applications/dietpi-software.desktop /root/Desktop/dietpi-software.desktop - ln -sf /usr/share/applications/dietpi-config.desktop /root/Desktop/dietpi-config.desktop - ln -sf /usr/share/applications/dietpi-launcher.desktop /root/Desktop/dietpi-launcher.desktop +# Disable this autostart entry +mkdir -p ~/.config/autostart +echo -e '[Desktop Entry]\nHidden=true' > ~/.config/autostart/dietpi-desktop_setup.desktop + +# Apply desktop-specific configs +if [ $XDG_CURRENT_DESKTOP = 'LXDE' ] +then + pcmanfm --desktop-off + sed -i '/^desktop_shadow=/c\desktop_shadow=#333333' ~/.config/pcmanfm/LXDE/desktop-items-0.conf + nohup pcmanfm --desktop -p LXDE & + pcmanfm -w /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png +fi +_EOF_ - # Set execute to prevent "untrusted" prompt in MATE, and possibily other desktops. - G_EXEC chmod +x /usr/share/applications/*.desktop + cat << '_EOF_' > /etc/xdg/autostart/dietpi-desktop_setup.desktop +[Desktop Entry] +Version=1.0 +Name=DietPi-Desktop_setup +Type=Application +Comment=Adds default desktop entries and configs to the users desktop +NoDisplay=true +Exec=/var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh +Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png +_EOF_ + + # Add execute permissions to prevent "untrusted" prompt in MATE and possibily other desktops + G_EXEC chmod +x /usr/share/applications/*.desktop /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh + + G_THREAD_WAIT } + # Add desktop entry for users which logged into a desktop already and hence have DietPi-Desktop_setup disabled. + # $1 = Application name + Create_Desktop_Shortcut() + { + local uid gid app=$1 + for i in /root /home/* + do + [[ -f $i/.config/autostart/dietpi-desktop_setup.desktop && ! -f $i/Desktop/$app.desktop ]] || continue + if [[ ! -d $i/Desktop ]] + then + # shellcheck disable=SC2012 + read -r uid gid <<< "$(ls -dn "$i" | mawk '{print $3" "$4}')" + G_EXEC mkdir -p "$i/Desktop" + G_EXEC chown "$uid:$gid" "$i/Desktop" + fi + G_EXEC ln -sf "/usr/share/applications/$app.desktop" "$i/Desktop/$app.desktop" + done + } + Create_UserContent_Folders(){ G_EXEC mkdir -p /mnt/dietpi_userdata/{Music,Pictures,Video,downloads} /var/www /opt @@ -3093,7 +3148,7 @@ _EOF_ # https://github.com/MichaIng/DietPi/issues/1558#issuecomment-701547904 local dbus_package= (( ${aSOFTWARE_INSTALL_STATE[28]} > 0 )) && dbus_package='dbus-user-session' - G_AGI lxde upower firefox-esr $dbus_package + G_AGI lxde upower firefox-esr $dbus_package xcompmgr fi @@ -3106,7 +3161,7 @@ _EOF_ local editor='leafpad' (( $G_DISTRO > 4 )) && editor='featherpad' - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch xcompmgr fi @@ -3114,7 +3169,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI mate-desktop-environment-core upower firefox-esr + G_AGI mate-desktop-environment-core mate-media upower firefox-esr fi @@ -3122,7 +3177,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 firefox-esr + G_AGI wmaker gnustep gnustep-devel gnustep-games upower policykit-1 firefox-esr xterm fi @@ -3131,9 +3186,6 @@ _EOF_ Banner_Installing G_AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme upower policykit-1 firefox-esr - # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 - [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && rm /etc/xdg/autostart/xcompmgr.desktop - dpkg-query -s xcompmgr &> /dev/null && G_AGP xcompmgr # Safe to purge as it has no single dependant fi @@ -6700,19 +6752,12 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing - # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 - local composition_manager= - (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )) || composition_manager='xcompmgr' - # Generic Xserver + Mesa OpenGL libraries and utilities - G_AGI xserver-xorg xinit $composition_manager xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra + G_AGI xserver-xorg xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra # Disable DPMS and screen blanking dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf - # Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions - (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )) || dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop - # RK3399 if (( $G_HW_CPUID == 3 )); then @@ -7305,15 +7350,10 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas } - Apply_Webserver_Preference(){ - - if (( $INDEX_WEBSERVER_TARGET != $INDEX_WEBSERVER_CURRENT )); then - - # Update current webserver index - INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET - - fi - + Apply_Webserver_Preference() + { + # Update current webserver index + INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET } # Configure marked software titles @@ -7327,12 +7367,11 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration # Openbox + PCmanFM + panel configs - mkdir -p /root/.config/{openbox,pcmanfm/LXDE,lxpanel/LXDE/panels} - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -o /root/.config/openbox/lxde-rc.xml - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -o /root/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -o /root/.config/pcmanfm/LXDE/desktop-items-0.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -o /root/.config/lxpanel/LXDE/panels/panel - + G_EXEC mkdir -p /etc/xdg/{openbox/LXDE,pcmanfm/LXDE,lxpanel/LXDE/panels} + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml" -o /etc/xdg/openbox/LXDE/rc.xml + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf" -o /etc/xdg/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel" -o /etc/xdg/lxpanel/LXDE/panels/panel + # Remove LXRandR menu item (monitor configuration tool as we set res in dietpi-config) [[ -f '/usr/share/applications/lxrandr.desktop' ]] && G_EXEC rm /usr/share/applications/lxrandr.desktop @@ -7351,10 +7390,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Create_Desktop_Shared_Items - # File manager desktop icon - G_EXEC ln -sf /usr/share/applications/pcmanfm.desktop /root/Desktop/pcmanfm.desktop - - G_THREAD_WAIT + # Composition manager: Enable limited server-side composition + dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop fi @@ -7364,12 +7401,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration Create_Desktop_Shared_Items - - # File manager desktop icon - ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop - + # Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 - (( $G_HW_MODEL == 12 )) && G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa + [[ $G_HW_MODEL == 12 && -f '/etc/pulse/default.pa' ]] && G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa fi @@ -7379,13 +7413,17 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration # Configs - Download_Install "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config + Download_Install "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /etc/xdg/ + # Disable trash # - Skip on Buster since trash seems to be implemented differently: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-488085982 (( $G_DISTRO < 5 )) && G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf Create_Desktop_Shared_Items + # Composition manager: Enable limited server-side composition + dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop + fi software_id=26 # GNUStep @@ -7402,6 +7440,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration Create_Desktop_Shared_Items + # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 + [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && G_EXEC rm /etc/xdg/autostart/xcompmgr.desktop + fi software_id=83 # Apache @@ -9054,13 +9095,17 @@ _EOF_ # Run Kodi as root [[ -f '/etc/default/kodi' ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi + # Desktop entry + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop" -o /usr/share/applications/kodi.desktop + # Copy udev rules, probably not needed for root, but we'll do it anyway dps_index=$software_id Download_Install '99-dietpi-kodi.rules' /etc/udev/rules.d/99-dietpi-kodi.rules - # Create .desktop symlink - mkdir -p /root/Desktop - G_EXEC curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -o /usr/share/applications/kodi.desktop - ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop + # Desktop shortcut + Create_Desktop_Shortcut kodi + + G_THREAD_WAIT fi @@ -9167,20 +9212,20 @@ _EOF_ # Symlink savegames to root # - Remove existing syslinks - rm -Rf /root/.d{1,2}x-rebirth + G_EXEC rm -Rf /root/.d{1,2}x-rebirth - ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth - ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth # +exe - chmod +x -R /mnt/dietpi_userdata/dxx-rebirth/* + G_EXEC chmod -R +x /mnt/dietpi_userdata/dxx-rebirth/* - # Create .Desktop SymLinks - mkdir -p /root/Desktop - mkdir -p /usr/share/applications + # Desktop menu entry + G_EXEC mkdir -p /usr/share/applications + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop - ln -s /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /root/Desktop/dxx-rebirth.desktop - ln -s /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop + # Desktop shortcut + Create_Desktop_Shortcut dxx-rebirth fi @@ -9189,15 +9234,17 @@ _EOF_ Banner_Configuration + # Desktop menu entry + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop" -o /usr/share/applications/opentyrian.desktop + # Copy the DietPi run file for OpenTyrian dps_index=$software_id Download_Install 'run' /usr/games/opentyrian/run - chmod +x /usr/games/opentyrian/run + G_EXEC chmod +x /usr/games/opentyrian/run - # Create .Desktop SymLinks - mkdir -p /root/Desktop - rm /usr/share/applications/opentyrian.desktop &> /dev/null - G_EXEC curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop -o /usr/share/applications/opentyrian.desktop - ln -s /usr/share/applications/opentyrian.desktop /root/Desktop/opentyrian.desktop + # Desktop shortcut + Create_Desktop_Shortcut opentyrian + + G_THREAD_WAIT fi @@ -11483,18 +11530,22 @@ _EOF_ export_options+='"' - mkdir -p /etc/chromium.d + G_EXEC mkdir -p /etc/chromium.d echo "$export_options" > /etc/chromium.d/custom_flags # Chromium 60+ - cp /etc/chromium.d/custom_flags /root/.chromium-browser.init + G_EXEC cp /etc/chromium.d/custom_flags /root/.chromium-browser.init - # Symlink to desktop - # - * for RPi Stretch due to chromium-browser.desktop - ln -sf /usr/share/applications/chromium*.desktop /root/Desktop/chromium.desktop + # Desktop shortcut: chromium-browser.desktop on RPi + if (( $G_HW_MODEL > 9 )) + then + Create_Desktop_Shortcut chromium + else + Create_Desktop_Shortcut chromium-browser + fi # Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 - cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh + cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh #!/bin/bash # Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 # - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options @@ -11505,29 +11556,29 @@ _EOF_ # --ash-host-window-bounds="400,300" # Resolution to use for kiosk mode, should ideally match current system resolution -RES_X=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -RES_Y=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +RES_X=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +RES_Y=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -CHROMIUM_OPTS="--kiosk --test-type --window-size=\$RES_X,\$RES_Y --start-fullscreen --start-maximized --window-position=0,0" +CHROMIUM_OPTS="--kiosk --test-type --window-size=$RES_X,$RES_Y --start-fullscreen --start-maximized --window-position=0,0" # If you want tablet mode, uncomment the next line. #CHROMIUM_OPTS+=' --force-tablet-mode --tablet-ui' # Add URL for first run: -URL=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -CHROMIUM_OPTS+=" --homepage \$URL" +URL=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +CHROMIUM_OPTS+=" --homepage $URL" # Find absolute filepath location of Chromium binary. -FP_CHROMIUM=\$(command -v chromium) -if [[ ! \$FP_CHROMIUM ]]; then +FP_CHROMIUM=$(command -v chromium) +if [[ ! $FP_CHROMIUM ]]; then # Assume RPi - FP_CHROMIUM="\$(command -v chromium-browser)" + FP_CHROMIUM="$(command -v chromium-browser)" fi -xinit \$FP_CHROMIUM \$CHROMIUM_OPTS +xinit $FP_CHROMIUM $CHROMIUM_OPTS _EOF_ - chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh fi @@ -12493,6 +12544,9 @@ _EOF_ # Add Steam desktop shortcut [[ -f '/root/Desktop/steam.desktop' ]] || G_EXEC ln -sf /usr/share/applications/steam.desktop /root/Desktop/steam.desktop + # Desktop shortcut + Create_Desktop_Shortcut steam + fi software_id=157 # Home Assistant @@ -13218,7 +13272,7 @@ _EOF_ Banner_Uninstalling apt-mark auto upower policykit-1 firefox-esr - G_AGP mate-desktop-environment-core + G_AGP mate-desktop-environment-core mate-media fi @@ -14248,9 +14302,9 @@ _EOF_ fi - rm /usr/share/applications/opentyrian.desktop - rm /root/Desktop/opentyrian.desktop - rm -R /usr/games/opentyrian + rm -f /usr/share/applications/opentyrian.desktop + rm -f /{root,home/*}/Desktop/opentyrian.desktop + rm -Rf /usr/games/opentyrian fi @@ -15080,19 +15134,20 @@ _EOF_ fi + # DXX-Rebirth software_id=112 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm /mnt/dietpi_userdata/dxx-rebirth/* + rm -f /mnt/dietpi_userdata/dxx-rebirth/* rm -R /mnt/dietpi_userdata/dxx-rebirth/descent_1_game rm -R /mnt/dietpi_userdata/dxx-rebirth/descent_2_game # Remove symlinks - rm /root/.d1x-rebirth - rm /root/.d2x-rebirth - rm /root/Desktop/dxx-rebirth.desktop - rm /usr/share/applications/dxx-rebirth.desktop + rm -f /root/.d1x-rebirth + rm -f /root/.d2x-rebirth + rm -f /{root,home/*}/Desktop/dxx-rebirth.desktop + rm -f /usr/share/applications/dxx-rebirth.desktop fi From 15ea56c51a3861ec5cff5fc5c9c6058267ba73c9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Feb 2021 00:25:23 +0100 Subject: [PATCH 081/218] v6.35 + DietPi-Software | Steam: Do no add Steam desktop shortcut for root user anymore, which is not done on first login: https://github.com/MichaIng/DietPi/pull/4015 --- dietpi/dietpi-software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f60d578d93..e0e2bb4e76 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12541,9 +12541,6 @@ _EOF_ fi G_EXEC ln -s /mnt/dietpi_userdata/steam /root/.steam - # Add Steam desktop shortcut - [[ -f '/root/Desktop/steam.desktop' ]] || G_EXEC ln -sf /usr/share/applications/steam.desktop /root/Desktop/steam.desktop - # Desktop shortcut Create_Desktop_Shortcut steam From 105f42b948c56c107b127b4f257267359b0f1d53 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Feb 2021 11:59:52 +0100 Subject: [PATCH 082/218] v6.35 + DietPi-PREP | Actively enable weekly TRIM on all mounted drives that support it + DietPi-PREP | Use error handler and be more transparent about disabling e2scrub and apt-daily + DietPi-PREP | Remove doubled "base-files" argument --- PREP_SYSTEM_FOR_DIETPI.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 154ef6d0dc..07a141efe2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1321,15 +1321,22 @@ _EOF_' G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock' for i in apt-daily{,-upgrade}.{service,timer} do - - systemctl disable --now $i 2> /dev/null - systemctl mask $i 2> /dev/null - + G_EXEC systemctl disable --now $i + G_EXEC systemctl mask $i done - G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed' - systemctl disable --now e2scrub_all.timer 2> /dev/null - systemctl disable --now e2scrub_reap 2> /dev/null + if (( $G_DISTRO > 5 )) + then + G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed' + G_EXEC systemctl disable --now e2scrub_all.timer + G_EXEC systemctl disable --now e2scrub_reap + fi + + if (( $G_DISTRO > 4 )) + then + G_DIETPI-NOTIFY 2 'Enabling weekly TRIM' + G_EXEC systemctl enable fstrim.timer + fi (( $G_HW_MODEL > 9 )) && echo "$G_HW_MODEL" > /etc/.dietpi_hw_model_identifier G_EXEC_DESC='Generating /boot/dietpi/.hw_model' G_EXEC /boot/dietpi/func/dietpi-obtain_hw_model @@ -1346,11 +1353,11 @@ _EOF_' G_DIETPI-NOTIFY 2 'Restoring default base files:' rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail - G_AGI -o 'Dpkg::Options::=--force-confmiss,confnew' --reinstall base-files base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home + G_AGI -o 'Dpkg::Options::=--force-confmiss,confnew' --reinstall base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home G_EXEC /var/lib/dpkg/info/base-files.postinst configure # Restore /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail G_DIETPI-NOTIFY 2 'Resetting and adding dietpi.com SSH pub host key for DietPi-Survey/Bugreport uploads:' - mkdir -pv /root/.ssh + G_EXEC mkdir -p /root/.ssh echo 'ssh.dietpi.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' > /root/.ssh/known_hosts # Add pre-up lines for WiFi on OrangePi Zero From 0aa2c577a29f670d007b8b13b0b794dd9ef2cd73 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Feb 2021 13:44:18 +0100 Subject: [PATCH 083/218] v6.35 + DietPi-Patch | RPi: Offer to remove the automatically added MS VS Code repository --- dietpi/patch_file | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 44f0cbac84..19ddf772a7 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2748,6 +2748,11 @@ _EOF_ G_EXEC_NOHALT=1 G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" fi + #------------------------------------------------------------------------------- + # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 + [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && ! G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. +\nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. +\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls From 2f864e46fa0569c1ba2d0b1749156d6e794a905a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Feb 2021 13:46:08 +0100 Subject: [PATCH 084/218] v6.35 + DietPi-PREP | RPi: Remove MS VS Code repository by default --- 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 07a141efe2..5a058f59d2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -55,6 +55,8 @@ # - Remove unwanted APT configs # RPi: Allow PDiffs 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 -v /etc/apt/apt.conf.d/50raspi + # https://github.com/MichaIng/DietPi/issues/4083 + rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg # Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 [[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm -v /etc/apt/sources.list.d/deb-multimedia.list [[ -f '/etc/apt/preferences.d/deb-multimedia-pin-99' ]] && rm -v /etc/apt/preferences.d/deb-multimedia-pin-99 From 9eea1456841a3f073d9f65c6a1ed1665b972f581 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Feb 2021 22:45:51 +0100 Subject: [PATCH 085/218] v6.35 (#4084) + DietPi-Survey_report | Add Box86 and Docker Compose recognition + CHANGELOG | Add Docker Compose, Box86 and Steam on ARM software implementation notes and PaperMC fixes + README | Add Docker Compose, Box86 and Steam repo/community URLs --- .meta/dietpi-survey_report | 6 ++++-- CHANGELOG.txt | 4 ++++ README.md | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 7aa58247d5..273f51e6f1 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -464,7 +464,7 @@ do aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} done - aSOFTWARE_NAME6_34[134]='62' # DietPi-CloudShell + aSOFTWARE_NAME6_34[62]='62' # DietPi-CloudShell aSOFTWARE_NAME6_34[134]='134' # Tonido aSOFTWARE_NAME6_34[137]='137' # CloudPrint aSOFTWARE_NAME6_34[181]='PaperMC' @@ -477,9 +477,11 @@ aSOFTWARE_NAME6_35=() for i in "${!aSOFTWARE_NAME6_34[@]}" do - # shellcheck disable=SC2034 aSOFTWARE_NAME6_35[$i]=${aSOFTWARE_NAME6_34[$i]} done + aSOFTWARE_NAME6_35[62]='Box86' + # shellcheck disable=SC2034 + aSOFTWARE_NAME6_35[134]='Docker Compose' Main(){ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index abf811fd50..e6fbbaff0a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,9 @@ Changes: - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. New Software: +- DietPi-Software | Docker Compose: A tool to define and run multi-container Docker applications can now be installed through our software selection. Docker will be pulled in as dependency automatically. +- DietPi-Software | Box86: An x86 wrapper/emulator for ARMv7 systems is now available for install. Thanks to it's ability to wrap ARMv7 shared system libraries to be used with i386 binaries, often no additional libraries need to be installed. Thanks to binfmt, it will be invoked automatically when an i386 binary is executed. +- DietPi-Software | Steam: By automatically pulling in Box86 as dependency, Steam can now be installed on ARMv7 boards. It won't run perfectly stable yet and has limited features and game support, but we're optimistic that further improvements will address this in the future. Check out our documentation about it: https://dietpi.com/docs/software/gaming/#steam Fixes: - DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 @@ -16,6 +19,7 @@ Fixes: - DietPi-Software | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed. Many thanks to @smogan71 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8523 - DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 - DietPi-Software | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present. Many thanks to @bruz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8609 +- DietPi-Software | PaperMC: Resolved an issue where the install failed due to changed download URLs and stabilised service start and config creation by setting the Java heap size and allowing more time for the startup on smaller SBCs. Many thanks to @omavoss for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191 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/4XXX diff --git a/README.md b/README.md index e0562244b6..6f8f21ad86 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,9 @@ Links to hardware and software manufacturers, sources and build instructions use - [Docker](https://github.com/docker/docker-ce) - [Portainer](https://github.com/portainer/portainer) - [Tor](https://gitlab.torproject.org/tpo/core/tor) +- [Docker Compose](https://github.com/docker/compose) +- [Box86](https://github.com/ptitSeb/box86) +- [Steam](https://steamcommunity.com/) --- From 30cd96c0bc2f8e8f5d392ff02a3af0b42be55a5f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Feb 2021 17:53:58 +0100 Subject: [PATCH 086/218] v6.35 (#4086) + DietPi-Software | Migrate documentation URLs shown by dietpi-software to our new documentation site and add a few missing URLs: https://dietpi.com/docs/ + DietPi-Software | Xfce Power Manager: Rename it so that it matches how the name is shown within its GUI + DietPi-Software | X.Org X Server: Rename it to include the actual implementation we install + DietPi-Software | Rephrase or extend a few software descriptions, which were a bit short or nor precise --- dietpi/dietpi-software | 332 ++++++++++++++++++++--------------------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e0e2bb4e76..36284c1c99 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -251,8 +251,6 @@ _EOF_ INDEX_WEBSERVER_CURRENT=-2 INDEX_WEBSERVER_TARGET=-2 - readonly FP_ONLINEDOC_URL='https://dietpi.com/phpbb/viewtopic.php?' - # Available for (need to match highest value in dietpi-obtain_hw_model) readonly MAX_G_HW_MODEL=73 readonly MAX_G_HW_ARCH=10 @@ -328,7 +326,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='ultra lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#lxde' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -338,7 +336,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#lxqt' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -348,7 +346,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='desktop enviroment' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#mate' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -358,7 +356,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#xfce' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -368,7 +366,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight desktop based on OpenStep' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#gnustep' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -378,7 +376,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web browser for desktop or autostart' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#chromium' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -388,15 +386,16 @@ _EOF_ aSOFTWARE_DESC[$software_id]='mspaint on steroids' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#gimp' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ software_id=175 - aSOFTWARE_NAME[$software_id]='Xfce4 Power' - aSOFTWARE_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' + aSOFTWARE_NAME[$software_id]='Xfce Power Manager' + aSOFTWARE_DESC[$software_id]='power manager with brightness control (recommended for LXDE/LXQt)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#xfce-power-manager' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # Remote Desktop @@ -407,7 +406,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='desktop for remote connection' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#tigervnc-server' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=29 @@ -416,7 +415,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='remote desktop protocol (rdp) server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#xrdp' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=30 @@ -425,7 +424,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='multi-platform server and client access' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2071#p2071' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#nomachine' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=120 @@ -434,7 +433,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='desktop for remote connection' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#realvnc-server' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 # RPi only (archive.raspberrypi.org repo, libraspberrypi dependency, license) for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -450,7 +449,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='the media centre for linux' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#kodi' aSOFTWARE_REQUIRES_ALSA[$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 @@ -475,7 +474,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight web interface music player for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ympd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=148 @@ -484,7 +483,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='fork of ympd with improved features' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#mympd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -494,7 +493,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='optional: console audio vis for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3928#p3928' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#cava' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=33 @@ -503,7 +502,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#airsonic' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -514,7 +513,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=213#p213' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#subsonic' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -528,7 +527,7 @@ _EOF_ 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' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#logitech-media-server' #------------------ software_id=36 @@ -545,7 +544,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='airplay audio player with multiroom sync' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1221#p1221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#shairport-sync' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=39 @@ -554,7 +553,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#readymedia' #------------------ software_id=40 @@ -562,7 +561,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ampache' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -572,11 +571,11 @@ _EOF_ #------------------ software_id=41 - aSOFTWARE_NAME[$software_id]='Emby Server' + aSOFTWARE_NAME[$software_id]='Emby' aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#emby' # - ARMv6: https://github.com/MichaIng/DietPi/issues/534#issuecomment-416405968 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -586,7 +585,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#plex-media-server' # - ARMv6: https://github.com/MichaIng/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -596,7 +595,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='mumble voip server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#murmur' #------------------ software_id=118 @@ -613,7 +612,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Turns device into Roon capable audio player' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-bridge' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -624,7 +623,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='signalyst network audio adaptor (naa)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#naa-daemon' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=128 @@ -641,7 +640,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='feature-rich, web interface audio player for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ompd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -653,7 +652,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Shoutcast streaming server (+DarkIce)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#icecast' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -664,7 +663,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface for spotify premium' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7013#p7013' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#spotify-connect-web' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # ARMv7 only for ((i=1; i<=$MAX_G_HW_ARCH; i++)) @@ -679,7 +678,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface audio streamer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#koel' aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 @@ -694,7 +693,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='monitoring and tracking tool for Plex' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7463#p7463' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#tautulli' aSOFTWARE_REQUIRES_GIT[$software_id]=1 #------------------ software_id=154 @@ -703,7 +702,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Roon capable audio player and core' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-server' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 # x86_64 only @@ -719,7 +718,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='t=2317' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/phpbb/viewtopic.php?t=2317' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -738,7 +737,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Resource efficient UPnP/DLNA renderer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#gmediarender' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=167 @@ -747,7 +746,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='spotify connect client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#raspotify' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - ARMv8 - x86_64 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -759,7 +758,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='free home server for your comics and ebooks library' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ubooquity' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=179 @@ -768,7 +767,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Free and open source comics/mangas media server with web UI' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=26858#p26858' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#komga' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=86 @@ -777,7 +776,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Manage extensions from within Roon' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-extension-manager' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 #------------------ @@ -787,7 +786,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='FOSS web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=26255#p26255' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#jellyfin' # - ARMv6: https://github.com/jellyfin/jellyfin/issues/5011 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -799,7 +798,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (c)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=46#p46' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#transmission' #------------------ software_id=45 @@ -807,7 +806,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (python)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#deluge' #------------------ software_id=46 @@ -823,7 +822,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='bittorrent server with rutorrent web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#rtorrent' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -833,7 +832,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Automatic Video Library Manager for TV Shows' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#medusa' # - Stretch: Python 3 > 3.5 only: https://github.com/pymedusa/Medusa#dependencies aSOFTWARE_AVAIL_G_DISTRO[$software_id,4]=0 #------------------ @@ -843,7 +842,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='download manager with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6177#p6177' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#arias' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 @@ -854,7 +853,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='nzb download manager' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#sabnzbd' # Pre-compiling required on ARM (( $G_HW_ARCH > 9 )) || aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -864,7 +863,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='automatically download movies' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7212#p7212' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#couchpotato' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 # Python 2 only, hence not supported on Bullseye @@ -876,7 +875,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='automatically download TV shows' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7455#p7455' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#sonarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=145 @@ -885,7 +884,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='automatically download movies' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7457#p7457' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#radarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=106 @@ -894,7 +893,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='automatically download music' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#lidarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=180 @@ -903,7 +902,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='automatically download subtitles' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=27577#p27577' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#bazarr' aSOFTWARE_REQUIRES_GIT[$software_id]=1 # FFmpeg required on ARM, x86_64 binaries are shipped with the Bazarr repo: https://github.com/morpheus65535/bazarr/tree/master/bin/Linux # build-essential required on ARM to assure all required Python modules build successfully: https://github.com/MichaIng/DietPi/pull/3796#issuecomment-706768323 @@ -917,7 +916,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='API support for your torrent trackers' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7503#p7503' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#jackett' #------------------ software_id=149 @@ -925,7 +924,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='nzb download manager' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7575#p7575' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#nzbget' #------------------ software_id=155 @@ -933,7 +932,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='manage your HTPC from anywhere' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8043#p8043' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#htpc-manager' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 @@ -945,7 +944,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=47#p47' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#owncloud' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -956,7 +955,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3026#p3026' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#nextcloud' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -967,7 +966,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Video calls with configured coTURN server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=15227#p15227' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#nextcloud-talk' # Currently requires manual domain and coTURN server port input. # - To resolve: Default port 5349 could be used, but reliable method to get external domain/static IP is required. aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -978,7 +977,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='feature-rich backup and sync server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#pydio' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -989,7 +988,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='full system backup server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#urbackup' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -999,7 +998,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='personal github server with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#gogs' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ @@ -1009,7 +1008,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='backup and sync server with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#syncthing' #------------------ software_id=158 @@ -1017,7 +1016,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='S3 compatible distributed object server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9121#p9121' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#minio' #------------------ software_id=161 @@ -1025,6 +1024,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#fuguhub' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ @@ -1034,7 +1034,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Git with a cup of tea' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9863#p9863' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#gitea' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ @@ -1044,7 +1044,7 @@ _EOF_ 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=24713#p24713' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#firefox-sync-server' 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 @@ -1056,7 +1056,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Unofficial Bitwarden password manager server written in Rust' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28903#p28903' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#bitwarden_rs' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 @@ -1068,7 +1068,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Optimised Amiga emulator for ARM-based SoCs' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#amiberry' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1086,7 +1086,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='a classic retro game, addictive' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#opentyrian' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # RPi only @@ -1103,7 +1103,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Descent 1/2' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2963#p2963' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#dxx-rebirth' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1117,7 +1117,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Minecraft server with web interface (C++)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#cuberite' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ @@ -1127,7 +1127,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Minecraft servers with web interface (Java/Node.js)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#mineos' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 @@ -1139,7 +1139,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Valve gaming platform client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8016#p8016' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#steam' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 @@ -1153,7 +1153,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10675#p10675' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#nukkit' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=181 @@ -1162,7 +1162,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Highly optimised Minecraft server with plugins, written in Java' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28177#p28177' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#papermc' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1174,7 +1174,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='x86 userspace emulation' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=0#p0' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#box86' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Only works on ARMv7 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -1189,7 +1189,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='bulletin board forum software' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#phpbb' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1200,7 +1200,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='website blog and publishing platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#wordpress' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1211,7 +1211,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='self-hosted RSS feed aggregator' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#freshrss' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1222,7 +1222,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='website to host and browse your images' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#single-file-php-gallery' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1232,7 +1232,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight caldav + carddav server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#baikal' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1243,7 +1243,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='decentralised peer to peer bitcoin market' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1796#p1796' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#openbazaar' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1254,7 +1254,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='decentralised open source search engine' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6202#p6202' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#yacy' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 # Camera & Surveillance @@ -1265,7 +1265,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface & controls for your rpi camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#rpi-cam-control' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 # RPi only @@ -1280,7 +1280,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface & surveillance for your camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6610#p6610' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#motioneye' aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Python 2 only, hence not supported on Bullseye @@ -1294,7 +1294,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#linuxdash' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1304,7 +1304,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=451#p451' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#phpsysinfo' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1314,7 +1314,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='real-time performance monitoring' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1611#p1611' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#netdata' # Node.js only required for our custom v1.11 package for Stretch ARMv6 RPi (( $G_HW_ARCH == 1 && $G_DISTRO < 5 )) && aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 #------------------ @@ -1324,7 +1324,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1503#p1503' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#rpi-monitor' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1337,7 +1337,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface system management' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#webmin' #------------------ software_id=162 @@ -1345,7 +1345,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Build, ship, and run distributed applications' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9120#p9120' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker' # - Bullseye: https://download.docker.com/linux/debian/dists/ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 #------------------ @@ -1355,7 +1355,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Simplifies container management in Docker (standalone host)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=29377#p29377' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#portainer' # - Bullseye aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 #------------------ @@ -1365,7 +1365,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Tool to defining and run multi-container Docker applications' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=xxx#pxxx' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' # - Bullseye: https://download.docker.com/linux/debian/dists/ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 @@ -1377,7 +1377,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='(Weaved) access your device over the internet' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#remot3it' #------------------ software_id=138 @@ -1385,7 +1385,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='server: share USB devices over the network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6709#p6709' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#virtualhere' # Hardware Projects #-------------------------------------------------------------------------------- @@ -1395,7 +1395,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='gpio interface library for rpi (python)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#rpigpio' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1408,7 +1408,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='gpio interface library (c)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1066#p1066' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#wiringpi' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # RPi + Odroids only for ((i=20; i<=$MAX_G_HW_MODEL; i++)) @@ -1424,7 +1424,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface to control rpi.gpio' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#webiopi' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # RPi1/2/Zero only for ((i=3; i<=$MAX_G_HW_MODEL; i++)) @@ -1450,7 +1450,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='pisupply ups' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10740#p10740' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#pijuice' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1463,7 +1463,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='tool for wiring devices, APIs and online services' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#node-red' aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -1473,7 +1473,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='MQTT messaging broker' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#mosquitto' #------------------ software_id=131 @@ -1481,7 +1481,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='msg controller for blynk mobile app and sbcs' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5901#p5901' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#blynk-server' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 @@ -1492,7 +1492,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='audiophonics pi-spc power control module' aSOFTWARE_CATEGORY_INDEX[$software_id]=10 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9359#p9359' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#audiophonics-pi-spc' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1505,7 +1505,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='voice kit' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9486#p9486' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#google-aiy' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 # RPi only @@ -1520,7 +1520,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Open Source Voice Assistant' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=18562#p18562' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#mycroft-ai' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1531,7 +1531,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='time-series database' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#influxdb' #------------------ software_id=77 @@ -1539,7 +1539,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='platform for analytics and monitoring' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12524#p12524' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#grafana' # System Security #-------------------------------------------------------------------------------- @@ -1549,7 +1549,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='prevents brute-force attacks with ip ban' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_security/#fail2ban' # Webserver Stacks #-------------------------------------------------------------------------------- @@ -1559,7 +1559,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='apache2 | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lasp-web-stack' #------------------ software_id=76 @@ -1567,7 +1567,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='apache2 | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lamp-web-stack' #------------------ software_id=78 @@ -1575,7 +1575,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='nginx | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lesp-web-stack' #------------------ software_id=79 @@ -1583,7 +1583,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='nginx | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lemp-web-stack' #------------------ software_id=81 @@ -1591,7 +1591,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lighttpd | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#llsp-web-stack' #------------------ software_id=82 @@ -1599,7 +1599,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lighttpd | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#llmp-web-stack' #------------------ software_id=83 @@ -1607,7 +1607,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#apache2' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=84 @@ -1616,7 +1616,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lighttpd' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=85 @@ -1625,7 +1625,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#nginx' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=87 @@ -1634,7 +1634,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='database' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#sqlite' #------------------ software_id=88 @@ -1642,7 +1642,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='database' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#mariadb' #------------------ software_id=89 @@ -1650,7 +1650,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Hypertext Preprocessor for dynamic web content' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#php' #------------------ software_id=90 @@ -1658,7 +1658,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='optional mysql admin tools' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#phpmyadmin' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1669,6 +1669,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='optional non-sql database store' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#redis' #------------------ software_id=92 @@ -1676,7 +1677,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]="Obtain and renew Let's Encrypt SSL certs for HTTPS" aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1062#p1062' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_security/#lets-encrypt' #------------------ software_id=125 @@ -1684,7 +1685,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='apache tomcat server' aSOFTWARE_CATEGORY_INDEX[$software_id]=12 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#tomcat' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 # - 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 @@ -1697,7 +1698,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='block adverts for any device on your network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/dns_servers/#pi-hole' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1710,7 +1711,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='validating, recursive, caching DNS resolver' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28779#p28779' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/dns_servers/#unbound' # File Servers #-------------------------------------------------------------------------------- @@ -1720,7 +1721,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='lightweight ftp server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#proftpd' #------------------ software_id=95 @@ -1728,7 +1729,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='alternative ftp server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2820#p2820' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#vsftpd' #------------------ software_id=96 @@ -1736,7 +1737,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='feature-rich file server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#samba' #------------------ software_id=109 @@ -1744,7 +1745,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='network file system server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#nfs' # VPN #-------------------------------------------------------------------------------- @@ -1754,7 +1755,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='vpn server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=613#p613' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#openvpn' #------------------ software_id=172 @@ -1762,7 +1763,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='an extremely simple yet fast and modern VPN' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=16308#p16308' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#wireguard' # Required to ask for public domain/IP and desired VPN server port aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 # RPi/Odroids/x86_64 only @@ -1789,7 +1790,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='openvpn/wireguard server install & management tool' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3469#p3469' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#pivpn' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_RECOMMENDS_AUTOMATED_UPGRADES[$software_id]=1 @@ -1800,7 +1801,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='vpn client with connection gui' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p15975#p15975' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#dietpi-nordvpn' # Advanced Networking #-------------------------------------------------------------------------------- @@ -1810,7 +1811,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='turn your device into a wifi hotspot' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#wifi-hotspot' #------------------ software_id=61 @@ -1818,7 +1819,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='optional: route hotspot traffic through tor' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#tor-hotspot' #------------------ software_id=67 @@ -1826,7 +1827,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Dynamic DNS update client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#no-ip' #------------------ software_id=98 @@ -1834,7 +1835,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='high performance tcp/http load balancer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#haproxy' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=184 @@ -1843,7 +1844,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='add a node to the Tor network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=29381#p29381' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#tor-relay' aSOFTWARE_RECOMMENDS_AUTOMATED_UPGRADES[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1855,7 +1856,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='energy usage addon board with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#emonpi' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1870,7 +1871,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='open-source home automation platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#home-assistant' #------------------ software_id=140 @@ -1878,7 +1879,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='open-source home automation platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=23065#p23065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#domoticz' #------------------ software_id=27 @@ -1886,7 +1887,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Website to manage ESP8266 devices flashed with Tasmota' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=20584#p20584' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#tasmoadmin' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1898,7 +1899,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='web interface for controlling 3d printers' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=18 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7958#p7958' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/printing/#octoprint' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Computational Science @@ -1909,7 +1910,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='distributed disease research project' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=19 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13704#p13704' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/computational_science/#foldinghome' # - ARMv6 - ARMv7 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 @@ -1966,21 +1967,21 @@ _EOF_ software_id=5 aSOFTWARE_NAME[$software_id]='ALSA' - aSOFTWARE_DESC[$software_id]='linux sound system' + aSOFTWARE_DESC[$software_id]='Advanced Linux Sound Architecture' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 #------------------ software_id=6 - aSOFTWARE_NAME[$software_id]='Xserver' - aSOFTWARE_DESC[$software_id]='linux display system' + aSOFTWARE_NAME[$software_id]='X.Org X Server' + aSOFTWARE_DESC[$software_id]='aka X11 - X Window System implementation' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 #------------------ software_id=151 aSOFTWARE_NAME[$software_id]='Nvidia' - aSOFTWARE_DESC[$software_id]='display driver' + aSOFTWARE_DESC[$software_id]='Proprietary display driver for Nvidia graphics cards' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 @@ -1996,21 +1997,21 @@ _EOF_ software_id=7 aSOFTWARE_NAME[$software_id]='FFmpeg' - aSOFTWARE_DESC[$software_id]='audio & visual libary' + aSOFTWARE_DESC[$software_id]='Audio & video codec libary and programs' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ software_id=8 aSOFTWARE_NAME[$software_id]='Java' - aSOFTWARE_DESC[$software_id]='OpenJDK + JRE libary' + aSOFTWARE_DESC[$software_id]='OpenJDK runtime environment and development kit' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ software_id=9 aSOFTWARE_NAME[$software_id]='Node.js' - aSOFTWARE_DESC[$software_id]='javascript runtime' + aSOFTWARE_DESC[$software_id]='JavaScript runtime environment' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ @@ -2031,7 +2032,7 @@ _EOF_ software_id=126 aSOFTWARE_NAME[$software_id]='LibSSL1.0.0' - aSOFTWARE_DESC[$software_id]='backwards compatibility (stretch, buster, bullseye)' + aSOFTWARE_DESC[$software_id]='for backwards compatibility on Stretch, Buster and Bullseye' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 @@ -2091,14 +2092,14 @@ _EOF_ software_id=16 aSOFTWARE_NAME[$software_id]='Build-Essentials' - aSOFTWARE_DESC[$software_id]='common packages for compile' + aSOFTWARE_DESC[$software_id]='common packages for compiling' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 #------------------ software_id=17 aSOFTWARE_NAME[$software_id]='Git Client' - aSOFTWARE_DESC[$software_id]='git clone etc' + aSOFTWARE_DESC[$software_id]='Clone and manage Git repositories locally' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 #------------------ @@ -2154,7 +2155,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='cross-platform, free rss reader' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2075#p2075' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#quiterss' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #-------------------------------------------------------------------------------- @@ -2166,7 +2167,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='rotates log files' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#full-logging' #------------------ software_id=102 @@ -2174,7 +2175,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='system logging' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#full-logging' #------------------ software_id=103 @@ -2182,7 +2183,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='minimal, optimised logging' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#dietpi-ramlog' #-------------------------------------------------------------------------------- # SSH Servers (hidden) @@ -2193,7 +2194,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Lightweight SSH server' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/ssh/#dropbear' #------------------ software_id=105 @@ -2201,7 +2202,7 @@ _EOF_ aSOFTWARE_DESC[$software_id]='Feature-rich SSH server with SFTP and SCP support' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/ssh/#openssh' #-------------------------------------------------------------------------------- # Init install state for defined software @@ -16342,7 +16343,7 @@ _EOF_ fi # - Online docs - [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] && string+=" | \e[90m$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\e[0m" + [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] && string+=" | \e[90m${aSOFTWARE_ONLINEDOC_URL[$i]}\e[0m" # - Convert string to lowercase echo -e "${string,,}" @@ -17252,9 +17253,8 @@ List of installed software and their online documentation URLs: # Installed software for i in "${!aSOFTWARE_INSTALL_STATE[@]}" do - # shellcheck disable=SC2015 - (( ${aSOFTWARE_INSTALL_STATE[i]} > 0 )) && [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] || continue - string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\n" + [[ ${aSOFTWARE_INSTALL_STATE[i]} -gt 0 && ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] || continue + string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n${aSOFTWARE_ONLINEDOC_URL[$i]}\n" done G_WHIP_SIZE_X_MAX=70 From 43e588081a3371f7ab29c5a65a47c1ec2df0e813 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Sat, 6 Feb 2021 22:28:16 +0100 Subject: [PATCH 087/218] Comment changed from dietpi.com/phpBB to dietpi.com/docs Old: https://dietpi.com/phpbb/viewtopic.php?p=34#p34 New: https://dietpi.com/docs/dietpi_tools/#miscellaneous (tab 'DietPi Survey') --- dietpi/dietpi-survey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 708ad0ae9b..56b4e17615 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -15,7 +15,7 @@ # - Runs after every dietpi-update and dietpi-software install, if user opted in # - Summary can be visited at: https://dietpi.com/survey/ # - Allows the DietPi project to focus development based on popularity - # - Further info: https://dietpi.com/phpbb/viewtopic.php?p=34#p34 + # - Further info: https://dietpi.com/docs/dietpi_tools/#miscellaneous (tab 'DietPi Survey') # # Usage: # - /boot/dietpi/dietpi-survey Interactive menu to opt in or out From 199bd10ea9d4a8fb1efd6ffc2de142f43275070f Mon Sep 17 00:00:00 2001 From: StephanStS Date: Sat, 6 Feb 2021 22:32:46 +0100 Subject: [PATCH 088/218] Update dietpi.txt --- dietpi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 66d5f80e9f..e7fabbc82b 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -115,7 +115,7 @@ AUTO_SETUP_GLOBAL_PASSWORD=dietpi ##### Misc DietPi program settings ##### #------------------------------------------------------------------------------------------------------ # DietPi-Survey: 1=opt in | 0=opt out | -1=ask on first call -# - https://dietpi.com/phpbb/viewtopic.php?p=34#p34 +# - https://dietpi.com/docs/dietpi_tools/#miscellaneous (see tab 'DietPi Survey') SURVEY_OPTED_IN=-1 #------------------------------------------------------------------------------------------------------ From 282a4fbcf92f6712b9c4b1c6764a905807a6151d Mon Sep 17 00:00:00 2001 From: StephanStS Date: Sat, 6 Feb 2021 22:33:24 +0100 Subject: [PATCH 089/218] Update dietpi-survey --- dietpi/dietpi-survey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 56b4e17615..db29e30408 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -15,7 +15,7 @@ # - Runs after every dietpi-update and dietpi-software install, if user opted in # - Summary can be visited at: https://dietpi.com/survey/ # - Allows the DietPi project to focus development based on popularity - # - Further info: https://dietpi.com/docs/dietpi_tools/#miscellaneous (tab 'DietPi Survey') + # - Further info: https://dietpi.com/docs/dietpi_tools/#miscellaneous (see tab 'DietPi Survey') # # Usage: # - /boot/dietpi/dietpi-survey Interactive menu to opt in or out From 60b4d348603e76f73f85b43cc691f5dab6474ed9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Feb 2021 13:08:38 +0100 Subject: [PATCH 090/218] v6.35 + DietPi-Patch | Only attempt to remove VS Code repository if we're on RPi and the file exists --- dietpi/patch_file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 19ddf772a7..44a82bb8ce 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2750,9 +2750,9 @@ _EOF_ fi #------------------------------------------------------------------------------- # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 - [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && ! G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. + [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { ! G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. \nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. -\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg +\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg; } #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls From 5ed3ba4ea9d7168d6db4582cdde504ab6efb0d68 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Feb 2021 19:50:06 +0100 Subject: [PATCH 091/218] v6.35 (#4091) + DietPi-Software | Add mjpg-streamer install option + DietPi-Survey_report | Add v6.35 mjpg-streamer support, migrate/apply new combined Odroid C4/HC4 SBC name and new X.Org X server naming + DietPi-Software | mjpg-streamer: Use RPi camera module input plugin by default, if it is enabled + DietPi-Software | mjpg-streamer: Inform users that the stream by default is unprotected and that security measures should hence be applied, e.g. allowing public access, if required, only via VPN. + DietPi-Software | mjpg-streamer: Disable camera stream commands by default. I'm currently not sure what can be done with it, but it requires some manual setup anyway. + DietPi-Software | mjpg-streamer: Since IP binding is perfectly possible and reasonable in certain cases, the service must not start before network interfaces have been configured. + DietPi-Software | mjpg-streamer: Apply additional service hardenings by default, which do not break the default camera input HTTP output use-case. The online documentation needs to contain info about how to allow R/W access to file system paths, e.g. for use with file input and/or output plugins. + DietPi-Software | mjpg-streamer: If it is installed along with OctoPrint, configure OctoPrint to use mjpg-streamer for it's webcam features. Also install FFmpeg, required it's time-lapse feature. --- .meta/dietpi-survey_report | 14 ++-- CHANGELOG.txt | 1 + README.md | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 135 +++++++++++++++++++++++++++++++++++-- 5 files changed, 141 insertions(+), 11 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 273f51e6f1..a942b82164 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -23,7 +23,7 @@ aHW_NAME[13]='Odroid U3' aHW_NAME[14]='Odroid N1' aHW_NAME[15]='Odroid N2' - aHW_NAME[16]='Odroid C4' + aHW_NAME[16]='Odroid C4/HC4' aHW_NAME[20]='x86_64 VM' aHW_NAME[21]='x86_64 PC' aHW_NAME[22]='Generic Device' @@ -179,7 +179,7 @@ aSOFTWARE_NAME[3]='MC' aSOFTWARE_NAME[4]='ViFM' aSOFTWARE_NAME[5]='ALSA' - aSOFTWARE_NAME[6]='Xserver' + aSOFTWARE_NAME[6]='X.Org X server' aSOFTWARE_NAME[7]='FFmpeg' aSOFTWARE_NAME[8]='Java' aSOFTWARE_NAME[9]='Node.js' @@ -464,9 +464,9 @@ do aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} done - aSOFTWARE_NAME6_34[62]='62' # DietPi-CloudShell - aSOFTWARE_NAME6_34[134]='134' # Tonido - aSOFTWARE_NAME6_34[137]='137' # CloudPrint + aSOFTWARE_NAME6_34[62]=62 # DietPi-CloudShell + aSOFTWARE_NAME6_34[134]=134 # Tonido + aSOFTWARE_NAME6_34[137]=137 # CloudPrint aSOFTWARE_NAME6_34[181]='PaperMC' aSOFTWARE_NAME6_34[182]='Unbound' aSOFTWARE_NAME6_34[183]='Bitwarden_RS' @@ -480,8 +480,9 @@ aSOFTWARE_NAME6_35[$i]=${aSOFTWARE_NAME6_34[$i]} done aSOFTWARE_NAME6_35[62]='Box86' - # shellcheck disable=SC2034 aSOFTWARE_NAME6_35[134]='Docker Compose' + # shellcheck disable=SC2034 + aSOFTWARE_NAME6_35[137]='mjpg-streamer' Main(){ @@ -603,6 +604,7 @@ [[ $i == 'RPi (armv6l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv6l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'RPi (armv7l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Odroid XU3/XU4/HC1/HC2 (armv7l)' ]] && ((aDEVICE_NAME['Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" + [[ $i == 'Odroid C4 (aarch64)' ]] && ((aDEVICE_NAME['Odroid C4/HC4 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" # v6.35 [[ $i == 'Asus Tinker Board (armv7l)' ]] && ((aDEVICE_NAME['ASUS Tinker Board (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Pine A64 (aarch64)' ]] && ((aDEVICE_NAME['PINE A64 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Pine H64 (aarch64)' ]] && ((aDEVICE_NAME['PINE H64 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e6fbbaff0a..82f6089830 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ New Software: - DietPi-Software | Docker Compose: A tool to define and run multi-container Docker applications can now be installed through our software selection. Docker will be pulled in as dependency automatically. - DietPi-Software | Box86: An x86 wrapper/emulator for ARMv7 systems is now available for install. Thanks to it's ability to wrap ARMv7 shared system libraries to be used with i386 binaries, often no additional libraries need to be installed. Thanks to binfmt, it will be invoked automatically when an i386 binary is executed. - DietPi-Software | Steam: By automatically pulling in Box86 as dependency, Steam can now be installed on ARMv7 boards. It won't run perfectly stable yet and has limited features and game support, but we're optimistic that further improvements will address this in the future. Check out our documentation about it: https://dietpi.com/docs/software/gaming/#steam +- DietPi-Software | mjpg-streamer: Lightweight multi-source and multi-output plugin JPEG streamer, now available for install. By default your attached camera capture will be streamed to a custom HTTP port. When installed along with OctoPrint, both will be automatically configured to work together. The Raspberry Pi camera module support is enabled by default, when installed on Raspberry Pi. Fixes: - DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 diff --git a/README.md b/README.md index 6f8f21ad86..5e206174d8 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [Docker Compose](https://github.com/docker/compose) - [Box86](https://github.com/ptitSeb/box86) - [Steam](https://steamcommunity.com/) +- [mjpg-streamer](https://github.com/jacksonliam/mjpg-streamer) --- diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 87d47d1dfe..e110ca3f7e 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -155,6 +155,7 @@ Available services: # - Camera/Surveillance 'motioneye' 'raspimjpeg' + 'mjpg-streamer' # - Printing 'octoprint' diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 36284c1c99..2651e02951 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -392,7 +392,7 @@ _EOF_ software_id=175 aSOFTWARE_NAME[$software_id]='Xfce Power Manager' - aSOFTWARE_DESC[$software_id]='power manager with brightness control (recommended for LXDE/LXQt)' + aSOFTWARE_DESC[$software_id]='with brightness control, recommended for LXDE/LXQt' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#xfce-power-manager' @@ -1262,7 +1262,7 @@ _EOF_ software_id=59 aSOFTWARE_NAME[$software_id]='RPi Cam Control' - aSOFTWARE_DESC[$software_id]='web interface & controls for your rpi camera' + aSOFTWARE_DESC[$software_id]='Web interface & controls for your RPi camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#rpi-cam-control' @@ -1277,7 +1277,7 @@ _EOF_ software_id=136 aSOFTWARE_NAME[$software_id]='MotionEye' - aSOFTWARE_DESC[$software_id]='web interface & surveillance for your camera' + aSOFTWARE_DESC[$software_id]='Web interface & surveillance for your camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#motioneye' @@ -1285,6 +1285,14 @@ _EOF_ aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Python 2 only, hence not supported on Bullseye aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + #------------------ + software_id=137 + + aSOFTWARE_NAME[$software_id]='mjpg-streamer' + aSOFTWARE_DESC[$software_id]='Steam JPEG frames from various sources to various possible outputs' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#mjpg-streamer' # System Stats & Management #-------------------------------------------------------------------------------- @@ -2300,6 +2308,14 @@ _EOF_ fi + # If OctoPrint and mjpg-streamer both are installed, OctoPrint is automatically configured to use mjpg-streamer. For the integrated time-lapse feature, FFmpeg is required. + software_id=7 + if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 && ${aSOFTWARE_INSTALL_STATE[153]} > 0 && ${aSOFTWARE_INSTALL_STATE[137]} + ${aSOFTWARE_INSTALL_STATE[153]} < 4 )) + then + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" + fi + # Software that requires WiringPi # - Audiophonics Pi-SPC (166) software_id=70 @@ -5575,6 +5591,39 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + # Build dependencies + DEPS_LIST='make cmake gcc libc6-dev libjpeg-dev' + # - On RPi, add RPi Camera support by default + (( $G_HW_MODEL > 9 )) || DEPS_LIST+='libraspberrypi-dev' + + # Download sources + Download_Install 'https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz' + + # Compile + G_EXEC cd mjpg-streamer-master/mjpg-streamer-experimental + G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' -j "$(nproc)" + G_EXEC strip --remove-section=.comment --remove-section=.note _build/mjpg_streamer + + # Move all plugin libraries into the executable's directory to avoid the need for LD_LIBRARY_PATH + G_EXEC mv _build/plugins/*/*.so _build/ + + # Remove all left build files + G_EXEC rm -R _build/{{,C,c}[Mm]ake*,plugins} + + # Install to system, in case remove previous installs + [[ -d '/opt/mjpg-streamer' ]] && G_EXEC rm -R /opt/mjpg-streamer + G_EXEC mv _build /opt/mjpg-streamer + + # Cleanup + G_EXEC cd /tmp/$G_PROGRAM_NAME + G_EXEC rm -R mjpg-streamer-master + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -11782,6 +11831,50 @@ _EOF_ fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Configuration + + # User + Create_User -g video -d /opt/mjpg-streamer mjpg-streamer + + # Service + # - On RPi, if the RPi camera module is enabled already, use it by default. + local input='input_uvc.so -d /dev/video0' + [[ $G_HW_MODEL -gt 9 || -f '/etc/modprobe.d/dietpi-disable_rpi_camera.conf' ]] || input='input_raspicam.so' + cat << _EOF_ > /etc/systemd/system/mjpg-streamer.service +[Unit] +Description=mjpg-streamer (DietPi) +Documentation=https://github.com/jacksonliam/mjpg-streamer/tree/master/mjpg-streamer-experimental +Wants=network-online.target +After=network-online.target dietpi-boot.service + +[Service] +User=mjpg-streamer +WorkingDirectory=/opt/mjpg-streamer +ExecStart=/opt/mjpg-streamer/mjpg_streamer -i '$input' -o 'output_http.so -p 8082 -n' + +# Hardening +ProtectSystem=strict +PrivateTmp=true +ProtectHome=true +ProtectKernelTunables=true +ProtectControlGroups=true + +[Install] +WantedBy=multi-user.target +_EOF_ + # OctoPrint: Configure it to use mjpg-streamer, if installed + if [[ ${aSOFTWARE_INSTALL_STATE[153]} == 2 && -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] + then + G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(mawk 'NR==4' /run/dietpi/.network):8082/?action=stream" + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + fi + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -11926,7 +12019,6 @@ ReadWritePaths=/mnt/dietpi_userdata/firefox-sync [Install] WantedBy=multi-user.target _EOF_ - # Permissions G_EXEC chown -R ffsync:ffsync /mnt/dietpi_userdata/firefox-sync @@ -12477,7 +12569,7 @@ _EOF_ Description=OctoPrint (DietPi) Documentation=https://dietpi.com/docs/software/printing/#octoprint Wants=network-online.target -After=network-online.target dietpi-boot.service +After=network-online.target dietpi-boot.service mjpg-streamer.service [Service] Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8" @@ -12495,6 +12587,15 @@ _EOF_ G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' + + # mjpg-streamer: Configure OctoPrint to use it, if installed + if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 )) + then + G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(mawk 'NR==4' /run/dietpi/.network):8082/?action=stream" + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + fi fi software_id=154 # Roon Server @@ -13841,6 +13942,20 @@ _EOF_ fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling + if [[ -f '/etc/systemd/system/mjpg-streamer.service' ]] + then + systemctl disable --now mjpg-streamer + rm -R /etc/systemd/system/mjpg-streamer.service* + fi + [[ -d '/etc/systemd/system/mjpg-streamer.service.d' ]] && rm -R /etc/systemd/system/mjpg-streamer.service.d + getent passwd mjpg-streamer > /dev/null && userdel mjpg-streamer + [[ -d '/opt/mjpg-streamer' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /opt/mjpg-streamer + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -16537,6 +16652,16 @@ On servers with less than 1 GiB physical memory, we strongly recommend to move t We allow it to take up to 30 minutes, it's process can be followed, please be patient.$swap_info" fi + # mjpg-streamer: Warn about unprotected stream and inform about additional plugins + (( ${aSOFTWARE_INSTALL_STATE[137]} == 1 )) && G_WHIP_MSG '[ WARN ] The mjpg-streamer camera stream will be accessible unprotected at port 8082 by default. +\nYou can configure a password protection, but this will break embedding the stream into other web interfaces, like OctoPrint. +\nWe hence recommend to not forward port 8082 through your NAT and/or block public access via firewall. +\nIf you require access from outside your local network to a web interface that embeds the camera stream, we recommend to setup a VPN connection for this. +\nRead more about this matter and how to configure mjpg-streamer at our online documentation: https://dietpi.com/docs/software/camera/#mjpg-streamer +\n[ INFO ] mjpg-streamer will not be compiled with all available plugins by default. +\nIf you require other input or output plugins, simply install the required dependencies. Plugins will be compiled automatically if dependencies are met. +\nFor available plugins and their dependencies, watch the info printed during the build and check out the official GitHub repository: https://github.com/jacksonliam/mjpg-streamer' + # Gogs: Requires OpenSSH for ssh-keygen binary: https://github.com/MichaIng/DietPi/issues/442 if (( ${aSOFTWARE_INSTALL_STATE[49]} == 1 && $INDEX_SSHSERVER_TARGET != -2 )); then From 690b01be8f34bc8a09f3524e945a8ff23bf75d3b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Feb 2021 22:03:50 +0100 Subject: [PATCH 092/218] v6.35 + DietPi-Software | Unbound: Create monthly cron job to keep root hints updated --- dietpi/dietpi-software | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2651e02951..59e772258b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4300,6 +4300,10 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Download/update list of root hints Download_Install 'https://www.internic.net/domain/named.root' /var/lib/unbound/root.hints + # Create monthly cron job to keep root hints updated + echo -e '#!/bin/dash\n# Update Unbound root hints\ncurl -sSfL https://www.internic.net/domain/named.root -o /var/lib/unbound/root.hints' > /etc/cron.monthly/dietpi-unbound + G_EXEC chmod +x /etc/cron.monthly/dietpi-unbound + # Download base configuration if it does not exist yet [[ -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] || dps_index=$software_id Download_Install 'unbound.conf' /etc/unbound/unbound.conf.d/dietpi.conf @@ -4316,7 +4320,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Stretch: Remove incompatile setting (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf - # Pi-hole + # Pi-hole part 1 if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf then G_DIETPI-NOTIFY 2 'Configuring Unbound to work for Pi-hole' @@ -4329,7 +4333,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf G_AGI unbound G_EXEC systemctl enable --now unbound # failsafe - # Pi-hole + # Pi-hole part 2 if (( ${aSOFTWARE_INSTALL_STATE[93]} == 2 )) then G_DIETPI-NOTIFY 2 'Configuring Pi-hole to use Unbound' From 98b5be8b7b1746b1e95963daa3911fd572c44b39 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Feb 2021 22:06:41 +0100 Subject: [PATCH 093/218] v6.35 + CHANGELOG | Unbound: A monthly cron job is now created to keep the root hints file updated --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 82f6089830..5afa33acf6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,9 +1,10 @@ v6.35 -(2021-01-XX) +(2021-02-XX) Changes: - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. +- DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 New Software: - DietPi-Software | Docker Compose: A tool to define and run multi-container Docker applications can now be installed through our software selection. Docker will be pulled in as dependency automatically. From aad108546c28940b7ec87bddbb2b02f7b5fe2b2e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Feb 2021 22:28:05 +0100 Subject: [PATCH 094/218] v6.35 + DietPi-Patch | Gracefully handle missing /mnt/dietpi_userdata: If it is required to apply migration steps, pre-create it, else apply changes to it conditionally. Do not create config file/dir backups in /mnt/dietpi_userdata, but instead just beside the original file/dir with .bak/_bak suffix. + DietPi-Patch | Apply G_EXEC further throughout the script --- dietpi/patch_file | 65 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 44a82bb8ce..5e8ed4007e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -127,7 +127,7 @@ _EOF_ # Pre-v6.29: Assure that C.UTF-8 locale is available if ! locale -a | grep -qiE '^C.UTF-?8'; then - apt-get -qq install --reinstall locales libc-bin + apt-get -qq install --reinstall libc-bin # libc-bin ships C.UTF-8 as static locale already but let's add it to memory-mapped archive as well localedef --add-to-archive /usr/lib/locale/C.UTF-8 @@ -279,10 +279,10 @@ _EOF_ #------------------------------------------------------------------------------- # locale rework/reset: https://github.com/MichaIng/DietPi/issues/1430#issuecomment-364763302 - [[ -f '/etc/environment' ]] && mv /etc/environment /mnt/dietpi_userdata/environment.bak + [[ -f '/etc/environment' ]] && G_EXEC mv /etc/environment{,.bak} > /etc/environment /boot/dietpi/func/dietpi-set_software locale C.UTF-8 - G_WHIP_MSG '[ INFO ] Locales reset\n\nTo resolve broken locales, they have been reset to "C.UTF-8".\n\nIf you had a different locale configured on this system, please use "dietpi-config" at a later date to re-configure.\n\nIn relation to that, DietPi does not use "/etc/environment" anymore, thus it is cleaned. In case you manually edited it, a backup was created: /mnt/dietpi_userdata/environment.bak' + G_WHIP_MSG '[ INFO ] Locales reset\n\nTo resolve broken locales, they have been reset to "C.UTF-8".\n\nIf you had a different locale configured on this system, please use "dietpi-config" at a later date to re-configure.\n\nIn relation to that, DietPi does not use "/etc/environment" anymore, thus it is cleaned. In case you manually edited it, a backup was created: /etc/environment.bak' #------------------------------------------------------------------------------ # Removed control from DietPi-Services: https://github.com/MichaIng/DietPi/issues/1501 systemctl enable --now dnsmasq 2> /dev/null @@ -324,8 +324,8 @@ _EOF_ systemctl enable dietpi-postboot if [[ -f '/etc/rc.local' ]]; then - G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/mnt/dietpi_userdata/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.' - mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak + G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/etc/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.' + G_EXEC mv /etc/rc.local{,.bak} cat << '_EOF_' > /etc/rc.local #!/bin/sh -e # @@ -366,9 +366,9 @@ _EOF_' if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # RPi cam pre-patch - [[ -d '/var/www/dietpicam' ]] && mv /var/www/dietpicam /var/www/rpicam - [[ -d '/mnt/dietpi_userdata/dietpicam' ]] && mv /mnt/dietpi_userdata/dietpicam /mnt/dietpi_userdata/rpicam - [[ -e '/var/www/rpicam/media' ]] && rm /var/www/rpicam/media + [[ -d '/var/www/dietpicam' ]] && G_EXEC mv /var/www/dietpicam /var/www/rpicam + [[ -d '/mnt/dietpi_userdata/dietpicam' ]] && G_EXEC mv /mnt/dietpi_userdata/dietpicam /mnt/dietpi_userdata/rpicam + [[ -e '/var/www/rpicam/media' ]] && G_EXEC rm -R /var/www/rpicam/media echo 59 >> /var/tmp/dietpi/dietpi-update_reinstalls @@ -686,11 +686,13 @@ _EOF_' then if [[ ! -d '/mnt/dietpi_userdata/sonarr' && -d '/root/.config/NzbDrone' ]] then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /root/.config/NzbDrone /mnt/dietpi_userdata/sonarr G_WHIP_MSG 'INFO:\n\nSonarr userdata has been moved to the DietPi userdata directory:\n\n - /root/.config/NzbDrone > /mnt/dietpi_userdata/sonarr' fi if [[ ! -d '/mnt/dietpi_userdata/radarr' && -d '/root/.config/Radarr' ]] then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /root/.config/Radarr /mnt/dietpi_userdata/radarr G_WHIP_MSG 'INFO:\n\nRadarr userdata has been moved to the DietPi userdata directory:\n\n - /root/.config/Radarr > /mnt/dietpi_userdata/radarr' fi @@ -741,8 +743,9 @@ _EOF_' # Move Koel from /var/www to /mnt/dietpi_userdata: https://github.com/MichaIng/DietPi/pull/1954 if [[ -d '/var/www/koel' ]]; then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /var/www/koel /mnt/dietpi_userdata/koel - chown -R koel:dietpi /mnt/dietpi_userdata/koel + G_EXEC chown -R koel:dietpi /mnt/dietpi_userdata/koel [[ -f '/etc/systemd/system/koel.service' ]] && sed -i 's|/var/www|/mnt/dietpi_userdata|g' /etc/systemd/system/koel.service G_WHIP_MSG 'INFO:\n\nKoel has been moved to the DietPi userdata directory:\n\n - /var/www/koel > /mnt/dietpi_userdata/koel' @@ -1133,11 +1136,11 @@ We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[131\]=2' /boot/dietpi/.installed && [[ -d '/mnt/dietpi_userdata/blynk' && ! -d '/mnt/dietpi_userdata/blynk/data' ]]; then - mv /mnt/dietpi_userdata/blynk /mnt/dietpi_userdata/blynk_bak - mv /etc/blynkserver /mnt/dietpi_userdata/blynk - mv /mnt/dietpi_userdata/blynk/server.jar /mnt/dietpi_userdata/blynk/blynkserver.jar - mv /mnt/dietpi_userdata/blynk_bak/server.properties /mnt/dietpi_userdata/blynk/ - mv /mnt/dietpi_userdata/blynk_bak /mnt/dietpi_userdata/blynk/data + G_EXEC mv /mnt/dietpi_userdata/blynk /mnt/dietpi_userdata/blynk_bak + G_EXEC mv /etc/blynkserver /mnt/dietpi_userdata/blynk + G_EXEC mv /mnt/dietpi_userdata/blynk/server.jar /mnt/dietpi_userdata/blynk/blynkserver.jar + G_EXEC mv /mnt/dietpi_userdata/blynk_bak/server.properties /mnt/dietpi_userdata/blynk/ + G_EXEC mv /mnt/dietpi_userdata/blynk_bak /mnt/dietpi_userdata/blynk/data G_CONFIG_INJECT 'data.folder=' 'data.folder=/mnt/dietpi_userdata/blynk/data' /mnt/dietpi_userdata/blynk/server.properties fi @@ -1278,7 +1281,7 @@ Also have a look at "Sonarr", another alternative TV show manager, available for rm -f /etc/bashrc.d/dietpi-*.sh #------------------------------------------------------------------------------- # Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 - getent passwd mopidy &> /dev/null && usermod -aG dietpi,audio -d /mnt/dietpi_userdata/mopidy mopidy + getent passwd mopidy > /dev/null && usermod -aG dietpi,audio -d /mnt/dietpi_userdata/mopidy mopidy #------------------------------------------------------------------------------- # Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/MichaIng/DietPi/pull/2559 G_AGI p7zip @@ -1392,23 +1395,22 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites- reinstall_indices+=' 107' G_CONFIG_INJECT 'system.umask.set[[:blank:]=]' 'system.umask.set = 002' /root/.rtorrent.rc - mkdir -p /mnt/dietpi_userdata/rtorrent - mv /root/.rtorrent.rc /mnt/dietpi_userdata/rtorrent/ + G_EXEC mkdir -p /mnt/dietpi_userdata/rtorrent + G_EXEC mv /root/.rtorrent.rc /mnt/dietpi_userdata/rtorrent/ fi - if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && - getent passwd deluge &> /dev/null; then # Only do this once, regardless of re-patches + if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && getent passwd deluge > /dev/null; then # Only do this once, regardless of re-patches reinstall_indices+=' 45' G_AGP deluge-webui - [[ -e ~deluge ]] && mv ~deluge /mnt/dietpi_userdata/deluge_home_backup - userdel -rf deluge - rm -Rf /{root,home/*}/.config/deluge - mkdir -p /var/log/deluged - [[ -f '/var/log/deluged.log' ]] && mv /var/log/deluged.log /var/log/deluged/daemon.log - [[ -f '/var/log/deluge-web.log' ]] && mv /var/log/deluge-web.log /var/log/deluged/web.log + G_EXEC mkdir -p /var/log/deluged /mnt/dietpi_userdata + [[ -e ~deluge ]] && G_EXEC mv ~deluge /mnt/dietpi_userdata/deluge_home_backup + G_EXEC userdel -rf deluge + G_EXEC rm -Rf /{root,home/*}/.config/deluge + [[ -f '/var/log/deluged.log' ]] && G_EXEC mv /var/log/deluged.log /var/log/deluged/daemon.log + [[ -f '/var/log/deluge-web.log' ]] && G_EXEC mv /var/log/deluge-web.log /var/log/deluged/web.log G_WHIP_MSG '[ INFO ] Deluge rework\n Our Deluge installer has been reworked to match Debian APT package defaults and official documentations. This also resolves an issue when attempting to access "deluge-console". @@ -1550,12 +1552,12 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?t=5828' G_WHIP_MSG "[ INFO ] PHP upgrade\n Your PHP instance will be upgraded to ${PHP_NAME^^}. This enhances security and performance of your web applications and is required to run some of the latest web application versions, e.g. Nextcloud 17, ownCloud 10.3, phpBB 3.3 and others.\n -We will update webserver configurations and backup the whole /etc/php directory to /mnt/dietpi_userdata/php_bak, so you can recover custom settings.\n +We will update webserver configurations and backup the whole /etc/php directory to /etc/php_bak, so you can recover custom settings.\n NB: For any custom PHP-dependent web applications, which you have installed manually (outside of DietPi-Software), you might need to adjust the used socket to: /run/php/$PHP_NAME-fpm.sock NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" # Backup config - [[ -d '/etc/php' ]] && G_EXEC cp -a /etc/php /mnt/dietpi_userdata/php_bak + [[ -d '/etc/php' ]] && G_EXEC cp -a /etc/php{,_bak} # Update PHP socket # - Lighttpd @@ -1983,7 +1985,7 @@ Would you like to switch back to the Nginx authentication method now?' && certbo # If aria2.conf exists on new location, it must have been installed with new code already, thus old file is obsolete. if [[ -f '/mnt/dietpi_userdata/aria2/aria2.conf' ]]; then - rm /var/lib/dietpi/dietpi-software/installed/aria2.conf + G_EXEC rm /var/lib/dietpi/dietpi-software/installed/aria2.conf else @@ -1993,8 +1995,8 @@ Would you like to switch back to the Nginx authentication method now?' && certbo GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session=' "save-session=$fp_input" /var/lib/dietpi/dietpi-software/installed/aria2.conf GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session-interval=' 'save-session-interval=60' /var/lib/dietpi/dietpi-software/installed/aria2.conf # Move aria2.conf to new location - mkdir -p /mnt/dietpi_userdata/aria2 - mv /var/lib/dietpi/dietpi-software/installed/aria2.conf /mnt/dietpi_userdata/aria2/ + G_EXEC mkdir -p /mnt/dietpi_userdata/aria2 + G_EXEC mv /var/lib/dietpi/dietpi-software/installed/aria2.conf /mnt/dietpi_userdata/aria2/ fi @@ -2346,7 +2348,7 @@ 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 + [[ -d '/mnt/dietpi_userdata' ]] && 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 @@ -2519,6 +2521,7 @@ opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.sav - /etc/cubrite > /mnt/dietpi_userdata/cuberite \nFor this, it will be reinstalled. A backup is stored at: - /mnt/dietpi_userdata/cuberite_bak' + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /etc/cubrite /mnt/dietpi_userdata/cuberite G_EXEC cp -a /mnt/dietpi_userdata/cuberite{,_bak} echo 52 >> /var/tmp/dietpi/dietpi-update_reinstalls From 788d7eca0da4e8913fe06c683f08c91dcff8d612 Mon Sep 17 00:00:00 2001 From: ravenclaw900 <50060110+ravenclaw900@users.noreply.github.com> Date: Mon, 8 Feb 2021 05:37:06 -0600 Subject: [PATCH 095/218] v6.35 (#4094) + DietPi-Backup | Do not apply and check the file system when "Cancel" was selected in any of the target location selection menus + DietPi-Backup | Coding: Instead of creating a variable to check back indirectly, make Check_Supported_Directory_Location return it's result via exit code and check it back directly. + DietPi-Backup | Coding: Instead of using a large indented if-then-else block in Backup and Restore functions for the Check_Supported_Directory_Location result, return to menu directly, when the file system is not supported. For readability, other check should be coded in the same way, but it's enough for today :). + DietPi-Backup | When searching for previous backups as target location and none could be found, skip the supported file system check and do not touch the target directory variable + DietPi-Backup | Pre-select "Help" main menu entry initially + DietPi-Backup | Since the exit menu verification requires interactive confirmation, show main menu only when interactivity is guaranteed. Else it is possible to run into an endless loop via "G_INTERACTIVE=0 dietpi-backup" or when calling the script without "1"/"-1" arguments from cron job, systemd unit or else without valid terminal at STDIN. + DietPi-Backup | Do not check for mounted dietpi_userdata during supported target location check. It cannot be used as target location anyway, regardless of mount state, and if it is a mount/symlink, it is currently excluded from backup anyway. If/when we change this behaviour, to (optionally) include external drives/userdata into the system backup, mount states in general should be checked, and in case unmounted drives need to be excluded for the backup/restore run to neither remove an intact backup of a currently unmounted drive, nor restore an external drive backup to the root file system. --- dietpi/dietpi-backup | 320 ++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 188 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 38c9876d4e..d42a0c5a07 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -53,8 +53,7 @@ readonly FP_FILTER_CUSTOM='/boot/dietpi/.dietpi-backup_inc_exc' # Supported filesystems - TARGET_FILESYSTEM_TYPE=0 - TARGET_DIRECTORY_SUPPORTED=0 + TARGET_FILESYSTEM_TYPE= readonly aSUPPORTED_FILESYSTEMS=('ext4' 'ext3' 'ext2' 'nfs' 'nfs4' 'btrfs' 'f2fs') # rsync options @@ -114,99 +113,94 @@ _EOF_ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" # Check valid FS - Check_Supported_Directory_Location + Check_Supported_Directory_Location || return 1 - # Filesystem supported - if (( $TARGET_DIRECTORY_SUPPORTED )); then + Services_Stop - Services_Stop + # Generate target dir + mkdir -p "$FP_TARGET" - # Generate target dir - mkdir -p "$FP_TARGET" + # Error: Unable to create target folder. + if [[ ! -d $FP_TARGET ]]; then - # Error: Unable to create target folder. - if [[ ! -d $FP_TARGET ]]; then + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\nUnable to create $FP_TARGET" - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\nUnable to create $FP_TARGET" + # Error: Rsync is already running + elif pgrep 'rsync' &> /dev/null; then - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then + Error_Rsync_Already_Running - Error_Rsync_Already_Running - - else + else - # Start Backup - echo -e "DietPi-Backup Log File. $(Print_Date)\n\n" > $FP_LOG + # Start Backup + echo -e "DietPi-Backup Log File. $(Print_Date)\n\n" > $FP_LOG - # Generate Exclude/Include lists - Create_Filter_Include_Exclude + # Generate Exclude/Include lists + Create_Filter_Include_Exclude - while : - do + while : + do - # System - mkdir -p "$FP_TARGET"/data + # System + G_EXEC mkdir -p "$FP_TARGET"/data - # Check for sufficient free space - # - NB: working in KiB until end MiB conversion, as, don't like using long long int, and, KiB should offer a good end result. - local old_backup_size=$(du -ks "$FP_TARGET"/data | mawk '{print $1}') # Actual disk space usage + # Check for sufficient free space + # - NB: working in KiB until end MiB conversion, as, don't like using long long int, and, KiB should offer a good end result. + local old_backup_size=$(du -ks "$FP_TARGET"/data | mawk '{print $1}') # Actual disk space usage - rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ > /tmp/dietpi-backup_result - local new_backup_size=$(( $(grep -m1 '^Total file size:' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') / 1024 +1 )) # Theoretical, data size only - local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local target_fs_blocksize=$(stat -fc %s "$FP_TARGET"/data) - new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize / 1024 + 1 )) # Add one block size to each file + dir as worst case result - local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024 + 1 )) - rm /tmp/dietpi-backup_result + rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ > /tmp/dietpi-backup_result + local new_backup_size=$(( $(grep -m1 '^Total file size:' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') / 1024 +1 )) # Theoretical, data size only + local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') + local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') + local target_fs_blocksize=$(stat -fc %s "$FP_TARGET"/data) + new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize / 1024 + 1 )) # Add one block size to each file + dir as worst case result + local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024 + 1 )) + rm /tmp/dietpi-backup_result - if ! G_CHECK_FREESPACE "$FP_TARGET"/data $end_result; then + if ! G_CHECK_FREESPACE "$FP_TARGET"/data $end_result; then - G_WHIP_BUTTON_OK_TEXT='Ignore' - G_WHIP_BUTTON_CANCEL_TEXT='Exit' - 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. + G_WHIP_BUTTON_OK_TEXT='Ignore' + G_WHIP_BUTTON_CANCEL_TEXT='Exit' + 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 cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - break - - fi + echo -e "$RSYNC_MODE_TEXT cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + break fi - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT to $FP_TARGET in progress, please wait..." - - rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ - EXIT_CODE=$? - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" - if (( $EXIT_CODE == 0 )); then + fi - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET" + G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT to $FP_TARGET in progress, please wait..." - else + rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ + EXIT_CODE=$? + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" + if (( $EXIT_CODE == 0 )); then - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." + echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET" - fi + else - # Done - break + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." - done + fi - log=1 G_WHIP_VIEWFILE $FP_LOG + # Done + break - # Return to main menu - TARGETMENUID=0 + done - fi + log=1 G_WHIP_VIEWFILE $FP_LOG - Services_Start + # Return to main menu + TARGETMENUID=0 fi + Services_Start + } Run_Restore(){ @@ -216,100 +210,84 @@ _EOF_ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" # Check valid FS - Check_Supported_Directory_Location + Check_Supported_Directory_Location || return 1 - # Filesystem supported - if (( $TARGET_DIRECTORY_SUPPORTED )); then + Services_Stop - Services_Stop + # Error: Backup not found + if [[ ! -f $FP_TARGET/$BACKUP_STATS_FILENAME ]]; then - # Error: Backup not found - if [[ ! -f $FP_TARGET/$BACKUP_STATS_FILENAME ]]; then + G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed.\n" - G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET" - G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed.\n" + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" + # Error: Rsync is already running + elif pgrep 'rsync' &> /dev/null; then - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then + Error_Rsync_Already_Running - Error_Rsync_Already_Running + # Restore + else - # Restore - else + # Generate Exclude/Include lists + Create_Filter_Include_Exclude - # Generate Exclude/Include lists - Create_Filter_Include_Exclude + G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT from $FP_TARGET in progress, please wait..." - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT from $FP_TARGET in progress, please wait..." + rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET"/data/ "$FP_SOURCE" + EXIT_CODE=$? + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" + if (( $EXIT_CODE == 0 )); then - rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET"/data/ "$FP_SOURCE" - EXIT_CODE=$? - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" - if (( $EXIT_CODE == 0 )); then - - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." - - else + echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." - - fi - - log=1 G_WHIP_VIEWFILE $FP_LOG + else - # Done - TARGETMENUID=0 + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." fi - Services_Start + log=1 G_WHIP_VIEWFILE $FP_LOG + + # Done + TARGETMENUID=0 fi + Services_Start + } Check_Supported_Directory_Location(){ - TARGET_DIRECTORY_SUPPORTED=0 - - # Userdata location verify - G_CHECK_USERDATA - - #Disallow dietpi_userdata location, due to includes in that location - if [[ $FP_TARGET == '/mnt/dietpi_userdata'* || $FP_TARGET == "$FP_DIETPI_USERDATA_ACTUAL"* ]] ; then + # Disallow dietpi_userdata location, due to includes in that location + if [[ $FP_TARGET == '/mnt/dietpi_userdata'* || $FP_TARGET == "$FP_DIETPI_USERDATA_ACTUAL"* ]]; then Error_DietpiUserdata_Directory # Check location contains /mnt/ elif [[ $FP_TARGET == '/mnt/'* ]]; then - # Generate the target directory if it doesnt exist. So we can check what filesystem it will be. - local directory_generated=0 - if [[ ! -d $FP_TARGET ]]; then - - mkdir -p "$FP_TARGET" - directory_generated=1 - + # Check file system type. Create directory temporarily, if necessary. + if [[ ! -d $FP_TARGET ]] + then + G_EXEC mkdir -p "$FP_TARGET" + TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR==2 {print $2}') + G_EXEC rmdir "$FP_TARGET" + else + TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR==2 {print $2}') fi - TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR == 2 {print $2}') for ((i=0; i<${#aSUPPORTED_FILESYSTEMS[@]}; i++)) do - [[ $TARGET_FILESYSTEM_TYPE == "${aSUPPORTED_FILESYSTEMS[$i]}" ]] || continue - TARGET_DIRECTORY_SUPPORTED=1 - break - + return 0 done - # Delete directory if tested - (( $directory_generated )) && rm -R "$FP_TARGET" - - # Not ext2/3/4 - (( $TARGET_DIRECTORY_SUPPORTED )) || Error_Filesystem_Not_Supported + # Not supported + Error_Filesystem_Not_Supported # Not inside /mnt else @@ -318,6 +296,8 @@ _EOF_ fi + return 1 + } #///////////////////////////////////////////////////////////////////////////////////// @@ -332,10 +312,9 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # MENUS #///////////////////////////////////////////////////////////////////////////////////// - MENU_LASTITEM= - TARGETMENUID=0 - - EXIT_CODE=-1 # Used for 1 time automated running only (eg: G_PROMPT_BACKUP) + MENU_LASTITEM='Help' # Select "Help" by default + TARGETMENUID=0 # Main menu + EXIT_CODE=-1 # Relevant for automated calls "dietpi-backup -1" and "dietpi-backup 1" e.g. via G_PROMPT_BACKUP # TARGETMENUID=0 Menu_Main(){ @@ -366,41 +345,20 @@ _EOF_ case "$G_WHIP_RETURNED_VALUE" in - 'Location') - - TARGETMENUID=1 - - ;; - - 'Custom Filters') - - nano $FP_FILTER_CUSTOM - - ;; - - 'Help') - - G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system.\n\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup.\n\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255" - - ;; - - 'Delete') - - G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && rm -R "$FP_TARGET" - - ;; + 'Location') TARGETMENUID=1;; - 'Backup') + 'Custom Filters') nano $FP_FILTER_CUSTOM;; - G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup + 'Help') G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system. +\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup. +\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore. +\nMore information: https://dietpi.com/docs/dietpi_tools/#update-backup";; - ;; + 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && rm -R "$FP_TARGET";; - 'Restore') + 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup;; - G_WHIP_YESNO "The system will be restored from:\n - $FP_TARGET\n\nDo you wish to continue and start the restore?" && Run_Restore - - ;; + 'Restore') G_WHIP_YESNO "The system will be restored from:\n - $FP_TARGET\n\nDo you wish to continue and start the restore?" && Run_Restore;; esac @@ -412,18 +370,11 @@ _EOF_ } - Menu_Exit(){ - - G_WHIP_SIZE_X_MAX=50 - G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 EXIT_CODE=0 - - } + Menu_Exit(){ G_WHIP_SIZE_X_MAX=50 G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 EXIT_CODE=0; } # TARGETMENUID=1 Menu_Set_Directory(){ - local current_directory=$FP_TARGET - G_WHIP_MENU_ARRAY=( 'Search' ': Find previous backups in /mnt/*' @@ -434,12 +385,14 @@ _EOF_ if G_WHIP_MENU "Please select the location where the backup will be saved, and restored from.\n\nYour current location:\n$FP_TARGET"; then + local current_directory=$FP_TARGET + case "$G_WHIP_RETURNED_VALUE" in 'Search') G_DIETPI-NOTIFY 2 'Searching /mnt/* for previous backups, please wait...' - local alist + local alist=() mapfile -t alist < <(find /mnt -type f -name "$BACKUP_STATS_FILENAME") # Do we have any results? @@ -456,11 +409,13 @@ _EOF_ done - G_WHIP_MENU 'Please select a previous backup to use:' && FP_TARGET=$G_WHIP_RETURNED_VALUE + G_WHIP_MENU 'Please select a previous backup to use:' || return + FP_TARGET=$G_WHIP_RETURNED_VALUE else G_WHIP_MSG 'No previous backups were found in /mnt/*' + return fi @@ -468,13 +423,15 @@ _EOF_ 'Manual') - Input_User_Directory + G_WHIP_DEFAULT_ITEM=$FP_TARGET + G_WHIP_INPUTBOX 'Please enter the filepath to your directory.\nE.g.: /mnt/dietpi-backup\n - Must be located inside /mnt/*\n - Must be a symlink and UNIX permissions compatible file system, like ext4, Btrfs, F2FS or valid NFS mount' || return + FP_TARGET=$G_WHIP_RETURNED_VALUE ;; 'List') - /boot/dietpi/dietpi-drive_manager 1 + /boot/dietpi/dietpi-drive_manager 1 || return FP_TARGET=$( $FP_FILTER_CUSTOM + # Create user inc/exc template, if missing + [[ -f $FP_FILTER_CUSTOM ]] || cat << _EOF_ > $FP_FILTER_CUSTOM # $G_PROGRAM_NAME | Custom include/exclude filters # # To INCLUDE (+) a file/directory: @@ -568,8 +514,6 @@ _EOF_ _EOF_ - fi - #----------------------------------------------------------------------------- # Run Backup if (( $INPUT == 1 )); then @@ -582,8 +526,8 @@ _EOF_ Run_Restore #----------------------------------------------------------------------------- - # Run menu - else + # Run menu, if interactive + elif (( $G_INTERACTIVE )); then until (( $TARGETMENUID < 0 )) do From a279d2eb88e1f97ab54041c4c52b229a9bbc503f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Feb 2021 21:07:11 +0100 Subject: [PATCH 096/218] v6.35 + DietPi-Patch | RPi: Remove additional APT preferences installed now together with the raspberrypi-sys-mods package, when user chooses to remove the VS Code repo, as it might cause conflicts with other repositories and at best is obsolete then. --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5e8ed4007e..ec38e02810 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2755,7 +2755,7 @@ _EOF_ # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { ! G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. \nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. -\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg; } +\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref; } #------------------------------------------------------------------------------- # Last subversion patch completed # - Apply reinstalls From 13fe64bc1cc180163b766be1780b0e4cd890c2ff Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Feb 2021 21:09:28 +0100 Subject: [PATCH 097/218] v6.35 + DietPi-PREP | RPi: Remove additional APT preferences installed now together with the raspberrypi-sys-mods package, as it might cause conflicts with other repositories and at best is obsolete then. --- 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 5a058f59d2..0ae98aba76 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -56,7 +56,7 @@ # RPi: Allow PDiffs 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 -v /etc/apt/apt.conf.d/50raspi # https://github.com/MichaIng/DietPi/issues/4083 - rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg + rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref # Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 [[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm -v /etc/apt/sources.list.d/deb-multimedia.list [[ -f '/etc/apt/preferences.d/deb-multimedia-pin-99' ]] && rm -v /etc/apt/preferences.d/deb-multimedia-pin-99 From bc5bde64358d98843504ee99f7eaedc79543fc88 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Mon, 8 Feb 2021 22:21:14 +0100 Subject: [PATCH 098/218] v6.35 (#4096) + DietPi-Software | Domoticz: Move scripts directory to data dir: https://dietpi.com/phpbb/viewtopic.php?t=8627 + DietPi-Software | Add a missing config banner + a few G_EXEC and missing service config dir removals --- dietpi/dietpi-software | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 59e772258b..f0cd4ead4c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6723,8 +6723,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi software_id=181 # PaperMC - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) - then + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Installing # Make sure user agrees to the EULA @@ -6749,6 +6749,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas software_id=140 # Domoticz if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing # APT deps DEPS_LIST='libusb-0.1 libcurl3-gnutls' @@ -11295,7 +11297,7 @@ _EOF_ # - Deprecated commands: # https://github.com/rakshasa/rtorrent/wiki/rTorrent-0.9-Comprehensive-Command-list-(WIP) # https://github.com/rakshasa/rtorrent/blob/master/doc/scripts/update_commands_0.9.sed - mkdir -p /mnt/dietpi_userdata/rtorrent + G_EXEC mkdir -p /mnt/dietpi_userdata/rtorrent [[ -f '/mnt/dietpi_userdata/rtorrent/.rtorrent.rc' ]] || cat << _EOF_ > /mnt/dietpi_userdata/rtorrent/.rtorrent.rc ### Miscellaneous settings #system.daemon.set = true @@ -12690,13 +12692,15 @@ _EOF_ software_id=140 # Domoticz: https://www.domoticz.com/wiki/Linux if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Configuration + # Data dir - mkdir -p /mnt/dietpi_userdata/domoticz + G_EXEC mkdir -p /mnt/dietpi_userdata/domoticz # Config file if [[ ! -f '/mnt/dietpi_userdata/domoticz/domoticz.conf' ]]; then - cp /opt/domoticz/scripts/domoticz.conf /mnt/dietpi_userdata/domoticz/domoticz.conf + G_EXEC cp /opt/domoticz/scripts/domoticz.conf /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'http_port=' 'http_port=8124' /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'ssl_port=' 'ssl_port=8424' /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'ssl_cert=' 'ssl_cert=/opt/domoticz/server_cert.pem' /mnt/dietpi_userdata/domoticz/domoticz.conf @@ -12714,14 +12718,17 @@ _EOF_ Create_User -G dialout -d /mnt/dietpi_userdata/domoticz domoticz # Permissions - chown -R domoticz:domoticz /opt/domoticz /mnt/dietpi_userdata/domoticz + G_EXEC chown -R domoticz:domoticz /opt/domoticz /mnt/dietpi_userdata/domoticz + + # Copy scripts directory to data dir: https://dietpi.com/phpbb/viewtopic.php?t=8627 + G_EXEC cp -a /opt/domoticz/scripts /mnt/dietpi_userdata/domoticz/ # Service cat << '_EOF_' > /etc/systemd/system/domoticz.service [Unit] Description=Domoticz (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] User=domoticz @@ -15315,6 +15322,7 @@ _EOF_ rm -R /etc/systemd/system/domoticz.service* fi + [[ -d '/etc/systemd/system/domoticz.service.d' ]] && rm -R /etc/systemd/system/domoticz.service.d getent passwd domoticz > /dev/null && userdel domoticz getent group domoticz > /dev/null && groupdel domoticz [[ -d '/opt/domoticz' ]] && rm -R /opt/domoticz @@ -15326,13 +15334,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # Remove systemd unit + # Remove service if [[ -f '/etc/systemd/system/gitea.service' ]]; then systemctl disable --now gitea rm -R /etc/systemd/system/gitea.service* fi + [[ -d '/etc/systemd/system/gitea.service.d' ]] && rm -R /etc/systemd/system/gitea.service.d # Delete data [[ -d '/mnt/dietpi_userdata/gitea' ]] && rm -R /mnt/dietpi_userdata/gitea @@ -15355,6 +15364,7 @@ _EOF_ rm -R /etc/systemd/system/pi-spc.service* fi + [[ -d '/etc/systemd/system/pi-spc.service.d' ]] && rm -R /etc/systemd/system/pi-spc.service.d rm -R /var/lib/dietpi/dietpi-software/installed/pi-spc sed -i '/^[[:blank:]]*dtoverlay=gpio-shutdown/d' /boot/config.txt From c88715023c4e1fcdb673e93ceb32a1b71bedbe65 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Feb 2021 22:24:25 +0100 Subject: [PATCH 099/218] v6.35 + CHANGELOG | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5afa33acf6..b4a43b9d52 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ Fixes: - DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 - DietPi-Software | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present. Many thanks to @bruz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8609 - DietPi-Software | PaperMC: Resolved an issue where the install failed due to changed download URLs and stabilised service start and config creation by setting the Java heap size and allowing more time for the startup on smaller SBCs. Many thanks to @omavoss for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191 +- DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 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/4XXX From 6a2634edb9a026c1348b4d31c04230f6b17c50de Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 9 Feb 2021 01:37:01 +0100 Subject: [PATCH 100/218] DietPi-Software | Several enhancements (#4095) + DietPi-Software | Remove mandatory reboot after installs, instead manually start up installed services, not controlled by DietPi-Services + DietPi-Software | GNUstep: Fix spelling + DietPi-Software | wiringPi / phpSysInfo: Gracefully handle reinstalls, i.e. when the install dir exists already, preserving config files + DietPi-Software | Do not upgrade all package on install. The daily APT update check helps now to inform users about available updates and the minimum required package versions we need to count on are ensured via dietpi-update. Since the package cache update function prints sufficient information, remove the related large "Banner_Apt_Update" banner. + DietPi-Software | Do not pre-create /var/lib/dietpi/dietpi-software/services directly, which is not used anymore since several DietPi updates + DietPi-Software | Do not re-apply dietpi-autostart non-interactively on installs. /boot/dietpi/.dietpi-autostart_index is not touched during installs, hence the step applies no change. On first run installs, the related dietpi.txt setting is applied. On interactive installs of software with autostart support, users are offered to interactively change the autostart option, which applies for next boot and includes some information and choices like the autostart user. + DietPi-Software | Remove the "Banner_Configs" banner. We have no "Banner_Installs" either, as every installed/configured software title prints its own banner already. + DietPi-Software | Apply G_EXEC further throughout the script where applicable + DietPi-Software | Raspimjpeg: Turn service into a bourne shell script, bash is overkill here + DietPi-Software | Raspimjpeg: Fix location info inside of shell script + DietPi-Patch | Remove obsolete /var/lib/dietpi/dietpi-software/services directory which was still pre-created on every dietpi-software install while not actually used since a few versions + DietPi-Software | LXDE/LXQt: Fix xcompmgr.service download, which is stored as X server config + DietPi-Software | LXDE: Replace single colour panel background image with solid background colour + DietPi-Software | LXDE: Slightly harden pcmanfm configuration by dietpi-desktop_setup + DietPi-Software | Desktops: Call users home dir in file manager bookmarks "Home" + DietPi-Software | OpenTyrian: Fix dependency typo, which was luckily accepted and correctly resolved by APT as regex match. Disable install on x86_64 system, as the Debian package has a very different file structure and required data build via dedicated "game-data-packager" package. Also disable for 64-bit RPi where functionality would need to be verified first, likely a 64-bit binary would need to be compiled. + DietPi-Set_hardware | soundcard: Do not error-handle "alsactl init", as it returns an error code even on success. Also do not use "-g" option (ignore if no sound card was found), which is valid for store and restore commands. --- .conf/desktop/gtk/.gtk-bookmarks | 2 +- .conf/desktop/lxde/panel | 41 +++-- .conf/dps_59/raspimjpeg.sh | 12 +- CHANGELOG.txt | 3 + dietpi/dietpi-software | 275 +++++++++++++------------------ dietpi/func/dietpi-set_hardware | 2 +- dietpi/patch_file | 3 + 7 files changed, 148 insertions(+), 190 deletions(-) diff --git a/.conf/desktop/gtk/.gtk-bookmarks b/.conf/desktop/gtk/.gtk-bookmarks index ec897e174b..34bfd7635f 100644 --- a/.conf/desktop/gtk/.gtk-bookmarks +++ b/.conf/desktop/gtk/.gtk-bookmarks @@ -1,5 +1,5 @@ file:/// / -file:///root /root +file:///root Home file:///mnt/dietpi_userdata DietPi User Data file:///mnt/samba Samba Client file:///mnt/nfs_client NFS Client diff --git a/.conf/desktop/lxde/panel b/.conf/desktop/lxde/panel index 0b2ff23450..81a2cc2b3b 100644 --- a/.conf/desktop/lxde/panel +++ b/.conf/desktop/lxde/panel @@ -1,25 +1,24 @@ Global { - edge=bottom - allign=left - margin=0 - widthtype=percent - width=100 - height=36 - transparent=0 - tintcolor=#434343 - alpha=255 - autohide=0 - heightwhenhidden=2 - setdocktype=1 - setpartialstrut=1 - usefontcolor=1 - fontsize=10 - fontcolor=#ffffff - usefontsize=0 - background=1 - backgroundfile=/var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png - iconsize=34 + edge=bottom + allign=left + margin=0 + widthtype=percent + width=100 + height=36 + transparent=1 + tintcolor=#313131 + alpha=255 + autohide=0 + heightwhenhidden=2 + setdocktype=1 + setpartialstrut=1 + usefontcolor=1 + fontsize=10 + fontcolor=#ffffff + usefontsize=0 + background=0 + iconsize=34 } Plugin { type=space @@ -109,7 +108,7 @@ Plugin { FlatButton=0 MaxTaskWidth=150 spacing=2 - UseSmallerIcons=-1 + UseSmallerIcons=-1 } } Plugin { diff --git a/.conf/dps_59/raspimjpeg.sh b/.conf/dps_59/raspimjpeg.sh index 0cd9161a73..65c7eb4c40 100644 --- a/.conf/dps_59/raspimjpeg.sh +++ b/.conf/dps_59/raspimjpeg.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/dash { #//////////////////////////////////// # DietPi Raspimjpeg control Script @@ -7,7 +7,7 @@ # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com # # Info: - # - Location: /var/lib/dietpi/dietpi-software/services/raspimjpeg.sh + # - Location: /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh # - Allows service control for Raspimjpeg and PHP schedule, used by RPi Camera Web # - Called from /etc/systemd/system/raspimjpeg.service # @@ -24,17 +24,17 @@ mkdir -p /dev/shm/mjpeg chown www-data:www-data /dev/shm/mjpeg chmod 777 /dev/shm/mjpeg - sudo -u www-data raspimjpeg &> /dev/null & + sudo -u www-data raspimjpeg > /dev/null 2>&1 & sleep 4 - sudo -u www-data php /var/www/rpicam/schedule.php &> /dev/null & + sudo -u www-data php /var/www/rpicam/schedule.php > /dev/null 2>&1 & } - if [[ $1 == 'stop' ]]; then + if [ "$1" = 'stop' ]; then Raspimjeg_Stop - elif [[ $1 == 'start' ]]; then + elif [ "$1" = 'start' ]; then Raspimjeg_Start diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b4a43b9d52..5aaed17049 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,8 @@ v6.35 (2021-02-XX) Changes: +- DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 +- DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 @@ -22,6 +24,7 @@ Fixes: - DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 - DietPi-Software | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present. Many thanks to @bruz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8609 - DietPi-Software | PaperMC: Resolved an issue where the install failed due to changed download URLs and stabilised service start and config creation by setting the Java heap size and allowing more time for the startup on smaller SBCs. Many thanks to @omavoss for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191 +- DietPi-Software | OpenTyrian: The install option has been disabled on x86_64, since the Debian package comes with a different file structure and it has been disabled on 64-bit RPi systems, since the binary has been compiled for armhf. - DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 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/4XXX diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0cd4ead4c..dcc459c674 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -142,8 +142,8 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Installation System #///////////////////////////////////////////////////////////////////////////////////// - # Reboot after installation has finished - DISABLE_REBOOT=0 + # Since no automated reboot is done anymore after installs, collect services to start manually, when not controlled by DietPi-Services + aSTART_SERVICES=() # Uninstall flag, used in software installations + removals, runs Uninstall_Software() UNINSTALL_REQUIRED=0 @@ -200,7 +200,7 @@ _EOF_ # Run Installation Flag (1 = run installs) GOSTARTINSTALL=0 - # Install variables + # Temporary placeholder variables INSTALL_URL_ADDRESS= UNINSTALL_URL_ADDRESS= DEPS_LIST= @@ -362,7 +362,7 @@ _EOF_ #------------------ software_id=26 - aSOFTWARE_NAME[$software_id]='GNUStep' + aSOFTWARE_NAME[$software_id]='GNUstep' aSOFTWARE_DESC[$software_id]='lightweight desktop based on OpenStep' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 @@ -1094,8 +1094,8 @@ _EOF_ do aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 done - # + x86_64 - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + # - ARMv8 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=112 @@ -2830,8 +2830,10 @@ echo -e '[Desktop Entry]\nHidden=true' > ~/.config/autostart/dietpi-desktop_setu if [ $XDG_CURRENT_DESKTOP = 'LXDE' ] then pcmanfm --desktop-off + sleep 0.2 sed -i '/^desktop_shadow=/c\desktop_shadow=#333333' ~/.config/pcmanfm/LXDE/desktop-items-0.conf nohup pcmanfm --desktop -p LXDE & + sleep 0.2 pcmanfm -w /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png fi _EOF_ @@ -3190,7 +3192,7 @@ _EOF_ fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3222,7 +3224,7 @@ _EOF_ fi - software_id=175 # Xfce4 Power + software_id=175 # Xfce Power Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3246,6 +3248,9 @@ _EOF_ G_CONFIG_INJECT 'Option "CoreKeyboard"' ' Option "CoreKeyboard"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpkeyb"' G_CONFIG_INJECT 'Option "CorePointer"' ' Option "CorePointer"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpmouse"' + G_EXEC systemctl enable xrdp + aSTART_SERVICES+=('xrdp') + fi software_id=30 # NoMachine @@ -3253,6 +3258,8 @@ _EOF_ Banner_Installing Download_Install "https://dietpi.com/downloads/binaries/all/nomachine_$G_HW_ARCH_NAME.deb" + G_EXEC systemctl enable nxserver + aSTART_SERVICES+=('nxserver') fi @@ -4113,7 +4120,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf fi - software_id=112 # DDX-Rebirth + software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4168,21 +4175,13 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing - # Debian - if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then - - G_AGI opentyrian + DEPS_LIST='libsdl1.2debian libsdl-net1.2' + Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - # Raspbian: No build available: http://raspbian.raspberrypi.org/raspbian/pool/contrib/o/opentyrian/ - else - - DEPS_LIST='ibsdl1.2debian libsdl-net1.2' - Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - cp -a /usr/local/games/opentyrian /usr/games/ # cp 'just does it', mv will fail if already exists. - rm -R /usr/local/games/opentyrian - chmod +x /usr/games/opentyrian/opentyrian - - fi + # Move to /usr/games + G_EXEC cp -a /usr/local/games/opentyrian /usr/games/ + G_EXEC rm -R /usr/local/games/opentyrian + G_EXEC chmod +x /usr/games/opentyrian/opentyrian fi @@ -4284,9 +4283,9 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing Download_Install 'https://github.com/afaqurk/linux-dash/archive/master.tar.gz' - mkdir -p /var/www/linuxdash - cp -a linux-dash-master/* /var/www/linuxdash/ - rm -R linux-dash-master + G_EXEC mkdir -p /var/www/linuxdash + G_EXEC cp -a linux-dash-master/* /var/www/linuxdash/ + G_EXEC_NOHALT=1 G_EXEC rm -R linux-dash-master fi @@ -4477,11 +4476,12 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf mv wiringPi* wiringPi &> /dev/null # eg: RPi, wiringPi-HEAD-8d188fa G_EXEC cd wiringPi - chmod +x build - ./build - + G_EXEC chmod +x build + G_EXEC_OUTPUT=1 G_EXEC ./build G_EXEC cd /tmp/$G_PROGRAM_NAME - mv wiringPi /root/ + + G_EXEC rm -Rf /root/wiringPi + G_EXEC mv wiringPi /root/ fi @@ -4501,11 +4501,11 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Pre-reqs local apackages=('python' 'python3') # - RPi: GPIO control for Node-RED - (( $G_HW_MODEL < 10 )) && apackages+=('python-rpi.gpio') + (( $G_HW_MODEL > 9 )) || apackages+=('python-rpi.gpio') G_AGI "${apackages[@]}" # Serialport fails to build unless below flags are provided - npm i -g --unsafe-perm node-red + G_EXEC_OUTPUT=1 G_EXEC npm i -g --unsafe-perm node-red fi @@ -4616,7 +4616,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf G_EXEC cd WebIOPi-0.7.1 # Automate Weaved prompt - sed -i '/read response/c\response="n"' setup.sh + G_EXEC sed -i '/read response/c\response="n"' setup.sh # Run setup script G_EXEC_OUTPUT=1 G_EXEC ./setup.sh @@ -4681,8 +4681,6 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing Download_Install 'https://wordpress.org/latest.tar.gz' /var/www - G_EXEC chown -R www-data:www-data /var/www/wordpress - fi software_id=38 # FreshRSS @@ -4820,8 +4818,16 @@ _EOF_ Banner_Installing - Download_Install 'https://github.com/phpsysinfo/phpsysinfo/archive/master.tar.gz' /var/www - mv /var/www/phpsysinfo-* /var/www/phpsysinfo + # Download + Download_Install 'https://github.com/phpsysinfo/phpsysinfo/archive/master.tar.gz' + + # Clean reinstall, but preserve previous config + if [[ -d '/var/www/phpsysinfo' ]] + then + G_EXEC mv /var/www/phpsysinfo/phpsysinfo.ini phpsysinfo-master/phpsysinfo.ini + G_EXEC rm -R /var/www/phpsysinfo + fi + G_EXEC mv phpsysinfo-master /var/www/phpsysinfo fi @@ -5030,7 +5036,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Download_Install 'https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip' /etc/openvpn - mkdir -p /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn + G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed/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' @@ -5798,8 +5804,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST='libffi-dev libssl-dev python-lxml python-pip python-dev' Download_Install 'https://github.com/CouchPotato/CouchPotatoServer/archive/master.tar.gz' - [[ -d /etc/couchpotato ]] && rm -R /etc/couchpotato - mv CouchPotato* /etc/couchpotato + [[ -d '/etc/couchpotato' ]] && rm -R /etc/couchpotato + G_EXEC mv CouchPotatoServer-master /etc/couchpotato pip2 install -U pip setuptools wheel pip2 install -U pyopenssl @@ -6803,7 +6809,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=6 # Xserver + software_id=6 # X.Org X server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -7108,7 +7114,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas G_CONFIG_INJECT 'NO_START=' 'NO_START=0' /etc/default/dropbear # Failsafe: Enable Dropbear service - systemctl enable dropbear + G_EXEC systemctl enable dropbear + aSTART_SERVICES+=('dropbear') # Mark OpenSSH for uninstall and update choice system dpkg-query -s 'openssh-server' &> /dev/null && aSOFTWARE_INSTALL_STATE[105]=-1 && UNINSTALL_REQUIRED=1 @@ -7138,7 +7145,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas systemctl reload ssh # Failsafe: Enable OpenSSH service - systemctl enable ssh + G_EXEC systemctl enable ssh + aSTART_SERVICES+=('ssh') # Mark Dropbear for uninstall and update choice system grep -q '^dropbear[^[:blank:]]*[[:blank:]]' <<< "$(dpkg --get-selections)" && aSOFTWARE_INSTALL_STATE[104]=-1 && UNINSTALL_REQUIRED=1 @@ -7185,9 +7193,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Workaround for dpkg failure on 1st install if service is already running but APT not installed: https://github.com/MichaIng/DietPi/pull/2277/#issuecomment-441460925 - systemctl stop rsyslog &> /dev/null + systemctl stop rsyslog 2> /dev/null G_AGI rsyslog - systemctl start rsyslog &> /dev/null + G_EXEC systemctl enable --now rsyslog fi @@ -7447,7 +7455,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Create_Desktop_Shared_Items # Composition manager: Enable limited server-side composition - dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop + dps_index=6 Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop fi @@ -7478,11 +7486,11 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Create_Desktop_Shared_Items # Composition manager: Enable limited server-side composition - dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop + dps_index=6 Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9261,7 +9269,7 @@ _EOF_ fi - software_id=112 # DDX-Rebirth + software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9741,6 +9749,9 @@ _EOF_ Banner_Configuration + # Permissions + G_EXEC chown -R www-data:www-data /var/www/wordpress + # Create MariaDB database /boot/dietpi/func/create_mysql_db wordpress wordpress "$GLOBAL_PW" @@ -9803,6 +9814,7 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 )) && software_id=28 || software_id=120 Banner_Configuration + # Service cat << '_EOF_' > /etc/systemd/system/vncserver.service [Unit] Description=Manage VNC Server (DietPi) @@ -9821,8 +9833,9 @@ ExecStop=/usr/local/bin/vncserver stop [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - systemctl enable vncserver + G_EXEC systemctl daemon-reload + G_EXEC systemctl enable vncserver + aSTART_SERVICES+=('vncserver') cat << '_EOF_' > /usr/local/bin/vncserver #!/bin/bash @@ -9892,41 +9905,41 @@ esac exit 0 _EOF_ - chmod +x /usr/local/bin/vncserver + G_EXEC chmod +x /usr/local/bin/vncserver # Stretch + TigerVNC: Disable Localhost only by default # shellcheck disable=SC2016 [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf local cmd_launch_desktop= - # DESKTOP_LXDE + # LXDE if (( ${aSOFTWARE_INSTALL_STATE[23]} > 0 )); then cmd_launch_desktop='lxsession -s LXDE -e LXDE' - # DESKTOP_MATE + # MATE elif (( ${aSOFTWARE_INSTALL_STATE[24]} > 0 )); then cmd_launch_desktop='mate-session' - # DESKTOP_GNUSTEP + # GNUstep elif (( ${aSOFTWARE_INSTALL_STATE[26]} > 0 )); then cmd_launch_desktop='x-window-manager' - # DESKTOP_XFCE + # Xfce elif (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )); then cmd_launch_desktop='xfce4-session' - # DESKTOP_LXQT + # LXQt elif (( ${aSOFTWARE_INSTALL_STATE[173]} > 0 )); then cmd_launch_desktop='startlxqt' fi - mkdir -p /root/.vnc + G_EXEC mkdir -p /root/.vnc cat << _EOF_ > /root/.vnc/xstartup #!/bin/dash export SHELL='/bin/bash' @@ -9936,7 +9949,7 @@ xsetroot -solid grey vncconfig -iconic & exec $cmd_launch_desktop _EOF_ - chmod +x /root/.vnc/xstartup + G_EXEC chmod +x /root/.vnc/xstartup # 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 @@ -9945,7 +9958,7 @@ _EOF_ $GLOBAL_PW $GLOBAL_PW _EOF_ - chmod 600 /root/.vnc/passwd + G_EXEC chmod 600 /root/.vnc/passwd fi @@ -10112,9 +10125,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - - G_BACKUP_FP /var/www/phpsysinfo/phpsysinfo.ini - dps_index=$software_id Download_Install 'phpsysinfo.ini' /var/www/phpsysinfo/phpsysinfo.ini + [[ -f '/var/www/phpsysinfo/phpsysinfo.ini' ]] || dps_index=$software_id Download_Install 'phpsysinfo.ini' /var/www/phpsysinfo/phpsysinfo.ini fi @@ -10228,12 +10239,12 @@ _EOF_ local fallback_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8.tgz' 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 + G_EXEC mv EasyRSA-* /etc/openvpn/easy-rsa # Cert and key generation via easy-rsa G_DIETPI-NOTIFY 2 'Generating unique OpenVPN certificates and keys. Please wait...\n' G_EXEC cd /etc/openvpn/easy-rsa - cat << _EOF_ > vars + cat << '_EOF_' > vars set_var EASYRSA_REQ_COUNTRY "UK" set_var EASYRSA_REQ_PROVINCE "DietPi" set_var EASYRSA_REQ_CITY "DietPi" @@ -10251,7 +10262,7 @@ _EOF_ # Server config cp -a pki/{ca.crt,dh.pem,issued/DietPi_OpenVPN_Server.crt,private/DietPi_OpenVPN_Server.key} /etc/openvpn/ G_EXEC cd /etc/openvpn - cat << _EOF_ > server.conf + cat << '_EOF_' > server.conf port 1194 proto udp dev tun @@ -10281,7 +10292,7 @@ verb 3 _EOF_ # Client config - cat << _EOF_ > DietPi_OpenVPN_Client.ovpn + cat << '_EOF_' > DietPi_OpenVPN_Client.ovpn client proto udp dev tun @@ -10309,9 +10320,9 @@ _EOF_ \n$(" >> DietPi_OpenVPN_Client.ovpn # - Copy to userdata - cp DietPi_OpenVPN_Client.ovpn /mnt/dietpi_userdata/ + G_EXEC cp DietPi_OpenVPN_Client.ovpn /mnt/dietpi_userdata/ # - and /boot partition - cp DietPi_OpenVPN_Client.ovpn /boot/ + G_EXEC cp DietPi_OpenVPN_Client.ovpn /boot/ G_EXEC cd /tmp/$G_PROGRAM_NAME break # Always break loop which is only for single wildcard file detection @@ -10325,11 +10336,15 @@ _EOF_ # Web Fowarding (Setup IPtables, must also be run during boot) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(mawk 'NR==3' /run/dietpi/.network)" -j MASQUERADE + aSTART_SERVICES+=('openvpn') + fi software_id=172 # WireGuard if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Configuration + # Try to enable module, if it fails, a reboot is required local module_active=0 modprobe wireguard 2> /dev/null && module_active=1 @@ -10503,13 +10518,13 @@ If no WireGuard (auto)start is included, but you require it, please do the follo fi - (( $module_active )) || { [[ $DISABLE_REBOOT == 1 ]] && G_WHIP_MSG '[ INFO ] WireGuard install finished\n\nNB: WireGuard has been successfully installed, but a reboot is required, before it can be started.'; } + (( $module_active )) || G_WHIP_MSG '[ INFO ] WireGuard install finished\n\nNB: WireGuard has been successfully installed, but a reboot is required, before it can be started.' unset -v module_active choice_required domain port invalid_text server_ip fi - software_id=60 # WiFi Hostspot + software_id=60 # WiFi Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10519,7 +10534,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo # DHCPD Config G_BACKUP_FP /etc/dhcp/dhcpd.conf - cat << _EOF_ > /etc/dhcp/dhcpd.conf + cat << '_EOF_' > /etc/dhcp/dhcpd.conf ddns-update-style none; default-lease-time 600; max-lease-time 7200; @@ -10539,7 +10554,7 @@ _EOF_ echo "INTERFACESv4=\"wlan$wifi_index\"" > /etc/default/isc-dhcp-server # Remove all entries below wlan, so we can recreate them - sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces + G_EXEC sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces # Enable up wlan G_CONFIG_INJECT 'allow-hotplug wlan' "allow-hotplug wlan$wifi_index" /etc/network/interfaces @@ -10556,7 +10571,6 @@ wireless-power off # IP tables up iptables-restore < /etc/iptables.ipv4.nat _EOF_ - # Assign static IP for wlan now ip a add 192.168.42.1 dev "wlan$wifi_index" @@ -10577,7 +10591,6 @@ wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP _EOF_ - # Check for RTL8188C* device, use the patched driver with compiled binary: https://github.com/pritambaral/hostapd-rtl871xdrv#why # - 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 > 9 && $G_HW_ARCH < 4 || $WIFIHOTSPOT_RTL8188C_PACKAGE )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf @@ -13369,7 +13382,7 @@ _EOF_ fi - software_id=175 # Xfce4 Power + software_id=175 # Xfce Power Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13386,7 +13399,7 @@ _EOF_ fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -14416,19 +14429,10 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then - - G_AGP opentyrian - - else - - G_AGP ibsdl1.2debian libsdl-net1.2 + apt-mark auto libsdl1.2debian libsdl-net1.2 - fi - - rm -f /usr/share/applications/opentyrian.desktop - rm -f /{root,home/*}/Desktop/opentyrian.desktop - rm -Rf /usr/games/opentyrian + rm -f /{usr/share/applications,{root,home/*}/Desktop}/opentyrian.desktop + [[ -d '/usr/games/opentyrian' ]] && rm -R /usr/games/opentyrian fi @@ -14671,7 +14675,7 @@ _EOF_ Banner_Uninstalling systemctl start mariadb mysqladmin drop wordpress -f - mysql -e "drop user 'wordpress'@'localhost'" + mysql -e 'drop user wordpress@localhost' rm -R /var/www/wordpress fi @@ -16109,16 +16113,11 @@ _EOF_ # Generate userdata folders Create_UserContent_Folders #------------------------------------------------------------ - # Update & upgrade APT - Banner_Apt_Update + # Update package cache G_AGUP - G_AGUG - # - Full upgrade on first run installs: https://github.com/MichaIng/DietPi/issues/3098 - (( $G_DIETPI_INSTALL_STAGE == 1 )) && G_AGDUG - # Generate dir for dietpi-software installed "non-service" based control scripts - G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/services - G_EXEC chmod -R +x /var/lib/dietpi/dietpi-software/services + # Full package upgrade on first run installs: https://github.com/MichaIng/DietPi/issues/3098 + (( $G_DIETPI_INSTALL_STAGE == 1 )) && G_AGDUG # Disable software installation for automated installs, if user input is required Install_Disable_Requires_UserInput @@ -16147,16 +16146,10 @@ _EOF_ # Apply Uninstall script, if required by e.g. DietPi choice system (( $UNINSTALL_REQUIRED )) && Uninstall_Software - # Apply DietPi configurations and optimizations + # Apply DietPi configurations and optimisations /boot/dietpi/dietpi-services stop - Banner_Configs Install_Apply_Configs - # Apply autostart index - local autostart_current=0 - [[ -f '/boot/dietpi/.dietpi-autostart_index' ]] && autostart_current=$(&1 | tee $fp_log if (( ${PIPESTATUS[0]} )); then @@ -16226,7 +16219,7 @@ _EOF_ fi - rm /root/AUTO_CustomScript.sh + G_EXEC rm /root/AUTO_CustomScript.sh fi @@ -17476,7 +17469,6 @@ List of installed software and their online documentation URLs: \nDo you wish to continue with DietPi as a pure minimal image?' || return 0 TARGETMENUID=-1 # Exit menu loop - DISABLE_REBOOT=1 # Skip reboot as no software will be installed GOSTARTINSTALL=1 # Set install start flag # After first run setup has finished, abort install without any selections @@ -17568,46 +17560,9 @@ List of installed software and their online documentation URLs: # Banner Print #///////////////////////////////////////////////////////////////////////////////////// - Banner_Installing(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Configuration(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Uninstalling(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Apt_Update(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Update & upgrade APT' - - } - - Banner_Reboot(){ - - local delay=3 - G_WHIP_MSG 'DietPi-Software installation is complete, however a reboot is required to finalise the installation.\n\nPlease select "Ok" to continue and reboot the system.' - G_DIETPI-NOTIFY 0 "System rebooting in $delay seconds to finalise DietPi-Software installations. Please wait..." - sleep $delay - - } - - Banner_Configs(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Optimise and configure software' - G_DIETPI-NOTIFY 2 "Applying DietPi optimisations and configurations for $G_HW_MODEL_NAME, please wait...\n" - - } - + Banner_Installing(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } + Banner_Configuration(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } + Banner_Uninstalling(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } Banner_Aborted(){ # 1st run abort @@ -17639,7 +17594,6 @@ List of installed software and their online documentation URLs: if [[ $1 ]]; then Input_Modes "$@" - DISABLE_REBOOT=1 # Skip reboot on automated (re)installs #-------------------------------------------------------------------------------------- # Standard launch @@ -17764,18 +17718,17 @@ List of installed software and their online documentation URLs: G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installation completed' - if (( $DISABLE_REBOOT )); then - - # Start services (restart to reload configs of possible running services) - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services restart - - else - - # Reboot - sync - Banner_Reboot - reboot + # Start services (restart to reload configs of possible running services) + [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services restart + # Start installed services, not controlled by DietPi-Services + if [[ ${aSTART_SERVICES[0]} ]] + then + G_DIETPI-NOTIFY 2 'Starting installed services, not controlled by DietPi-Services' + for i in "${aSTART_SERVICES[@]}" + do + G_EXEC_NOHALT=1 G_EXEC systemctl start "$i" + done fi fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index a494ee12b1..3ff136664f 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1636,7 +1636,7 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 [[ -f '/var/lib/alsa/asound.state' ]] && G_EXEC rm /var/lib/alsa/asound.state # - Reset active amixer state - [[ $INPUT_DEVICE_VALUE != 'none' && -f '/proc/asound/cards' && $( Date: Tue, 9 Feb 2021 22:30:46 +0100 Subject: [PATCH 101/218] v6.35 + DietPi-Software | Unbound: Since IP binding might be used, start service after network interfaces have been configured, not when they just start to be configured --- dietpi/dietpi-software | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index dcc459c674..f2c83a332b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4319,6 +4319,10 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Stretch: Remove incompatile setting (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf + # Since IP binding might be used, start after network interfaces have been configured, not when they just start to be configured + G_EXEC mkdir -p /etc/systemd/system/unbound.service.d + G_EXEC eval "echo -e '[Unit]\nWants=network-online.target\nAfter=network-online.target' > /etc/systemd/system/unbound.service.d/dietpi.conf" + # Pi-hole part 1 if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf then @@ -8430,7 +8434,7 @@ The install script will now exit. After applying one of the the above, rerun die [[ -f '/etc/default/coturn' ]] && rm /etc/default/coturn # Disable coturn logging by default, this can be overridden via /etc/turnserver.conf - mkdir -p /etc/systemd/system/coturn.service.d + G_EXEC mkdir -p /etc/systemd/system/coturn.service.d echo -e "[Service]\nExecStart=\n$(grep -m1 "^[[:blank:]]*ExecStart=" /lib/systemd/system/coturn.service) -l stdout --no-stdout-log --simple-log" > /etc/systemd/system/coturn.service.d/dietpi-logging.conf # Stretch: sysvinit service @@ -9534,9 +9538,9 @@ Do you want to block public access to the admin panel now?" && eval "$enable_cmd # Create symlinks to align Pi-hole admin and 404 page relative to webroot G_EXEC cd /var/www # - Move existing files/dirs out of the way - [[ ! -L 'admin' && -e 'admin' ]] && mv -v admin admin.bak + [[ ! -L 'admin' && -e 'admin' ]] && G_EXEC mv admin admin.bak G_EXEC ln -sf html/admin admin - [[ ! -L 'pihole' && -e 'pihole' ]] && mv -v pihole pihole.bak + [[ ! -L 'pihole' && -e 'pihole' ]] && G_EXEC mv pihole pihole.bak G_EXEC ln -sf html/pihole pihole # Pi-hole v5: Add webserver user to pihole group to allow gravity.db access from web UI: https://github.com/MichaIng/DietPi/issues/3391 From 02b04efff9d35d74993729ca32bb90e619d8c241 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Feb 2021 17:03:18 +0100 Subject: [PATCH 102/218] v6.35 + DietPi-CloudShell | Fix and simplify obtaining Pi-hole stats, by asking FTL via it's TCP port API directly, instead of querying any logs or database files manually. This matches the method how Pi-hole's Chronometer and PADD are doing it: https://github.com/pi-hole/pi-hole/blob/development/advanced/Scripts/chronometer.sh, https://docs.pi-hole.net/ftldns/telnet-api/ + DietPi-CloudShell | Massively simplify uptime estimation: Instead of looping through each minute, then each hour, then each day, calculate hours and days in a single step + DietPi-CloudShell | When obtaining drive data hangs, do not killall df executions but be more specific by storing the PID and killing the exact process only + DietPi-CloudShell | Do not initialise variables with "0" when they are not aimed to be integers --- dietpi/dietpi-cloudshell | 141 +++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 78 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index ed64365e59..688fcc1905 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -24,13 +24,13 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - # Grab Input (valid interger) - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab valid input + [[ $1 == [12] ]] && INPUT=$1 || INPUT=0 # Version - readonly DIETPI_CLOUDSHELL_VERSION=10 + readonly DIETPI_CLOUDSHELL_VERSION=11 - # /tmp/.* files used throughout this script. + # Temporary file used throughout the script readonly FP_TMP='.tmp' BLANK_SCREEN_ACTIVE=0 @@ -38,7 +38,7 @@ BLANK_SCREEN_TIME_HOUR_START=0 BLANK_SCREEN_TIME_HOUR_END=0 - # This will only work if dietpi-cloudshell was started by autostart (login script), as the setterm power options can only be applied when the command originates from the same terminal (no redirects). + # This will only work if dietpi-cloudshell was started via dietpi-autostart/dietpi-login, as the setterm power options can only be applied when the command originates from the same terminal without redirects. RUN_BLANK_SCREEN_AT_SPECIFIC_TIME(){ local current_hour=$(date +%-H) @@ -272,7 +272,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Obtain Stat Data #///////////////////////////////////////////////////////////////////////////////////// - TEMPERATURE_CONVERSION_VALUE=0 + TEMPERATURE_CONVERSION_VALUE= Obtain_Temperature_Conversion(){ if (( $TEMPERATURE_OUTPUT_TYPE == 0 )); then @@ -288,41 +288,14 @@ } - DATE_TIME=0 + DATE_TIME= Obtain_DATE_TIME(){ DATE_TIME=$(date +"%a %x - %R"); } - UPTIME=0 + UPTIME= Obtain_UPTIME(){ - local fSeconds=$(mawk '{print $1}' /proc/uptime) - - local seconds=${fSeconds%.*} - local minutes=0 - local hours=0 - local days=0 - - while (( $seconds >= 60 )); do - - ((minutes++)) - seconds=$(( $seconds - 60 )) - - done - - while (( $minutes >= 60 )); do - - ((hours++)) - minutes=$(( $minutes - 60 )) - - done - - while (( $hours >= 24 )); do - - ((days++)) - hours=$(( $hours - 24 )) - - done - - UPTIME="Uptime: $days Day, $hours Hour" + local seconds=$(mawk -F\. '{print $1}' /proc/uptime) + UPTIME="Uptime: $(( $seconds / 86400 )) Day, $(( $seconds % 86400 / 3600)) Hour" } @@ -428,9 +401,9 @@ # df will endless hang when NFS server is down: https://github.com/MichaIng/DietPi/issues/395 # - So lets run it as another thread so we can kill it if it hangs. - local df_failed=0 - rm $FP_TMP - df -Ph > $FP_TMP & + local df_failed=0 pid + [[ -f $FP_TMP ]] && rm $FP_TMP + df -Ph > $FP_TMP & pid=$! # - Wait X seconds before terminating the df thread local max_seconds=4 @@ -443,13 +416,9 @@ G_DIETPI-NOTIFY 1 'DF failed, unable to obtain drive data' sleep 2 - - killall -w df - + kill $pid df_failed=1 - echo -e "$(date) | df failed to respond" >> /var/log/dietpi-cloudshell.log - break else @@ -700,54 +669,68 @@ } - # PI-HOLE STATS! + # Pi-hole stats PIHOLE_QUERY_COUNT=0 PIHOLE_TOTAL_ADS=0 - PIHOLE_PERCENT_ADS=0 + PIHOLE_PERCENT_ADS= PIHOLE_TOTAL_DOMAINS=0 - PIHOLE_LAST_DOMAIN_BLOCKED=0 + PIHOLE_LAST_DOMAIN_BLOCKED= Obtain_PIHOLE(){ - local pihole_log_file='/var/log/pihole.log' + # Pi-hole FTL API: + # - https://github.com/pi-hole/pi-hole/blob/development/advanced/Scripts/chronometer.sh + # - https://docs.pi-hole.net/ftldns/telnet-api/ - # Lets pull the total number of blocked domains only once during 1st run, its quite cpu intensive. - if (( $PIHOLE_TOTAL_DOMAINS == 0 )); then + # Exit if Pi-hole FTL is not running + [[ -f '/run/pihole-FTL.port' ]] || return 1 - if [[ -f '/etc/pihole/gravity.list' ]]; then + # Get FTL port + local port=$("/dev/tcp/127.0.0.1/$port" - fi + # Exit if connection fails + >&3 || return 4 - fi - - local today=$(date +'%b %e') - - PIHOLE_QUERY_COUNT=$(grep "$today" $pihole_log_file | mawk '/query/{print $7}' | wc -l) - # Prevent / 0 on percentage - (( $PIHOLE_QUERY_COUNT > 0 )) || PIHOLE_QUERY_COUNT=1 + # Ask FTL for stats and to quit when finished + echo '>stats >recentBlocked >quit' >&3 - PIHOLE_TOTAL_ADS=$(grep "$today" $pihole_log_file | mawk '/\/etc\/pihole\/gravity.list/{print $7}' | wc -l) - PIHOLE_PERCENT_ADS=$(echo | mawk "{print $PIHOLE_TOTAL_ADS / $PIHOLE_QUERY_COUNT * 100}") - - # Convert to interger and graph it - Percent_To_Graph "$PIHOLE_PERCENT_ADS" - PIHOLE_PERCENT_ADS=$C_PERCENT_GRAPH + # Read output, allowing 1 second timeout per line, exit on empty string when connection is closed + while read -r -t 1 line <&3 && [[ $line || -t 3 ]] + do + if [[ $line == 'domains_being_blocked '* ]] + then + PIHOLE_TOTAL_DOMAINS=${line#* } - # Get last blocked domain - if (( $PIHOLE_TOTAL_ADS == 0 )); then + elif [[ $line == 'dns_queries_today '* ]] + then + PIHOLE_QUERY_COUNT=${line#* } - PIHOLE_LAST_DOMAIN_BLOCKED='None' + elif [[ $line == 'ads_blocked_today '* ]] + then + PIHOLE_TOTAL_ADS=${line#* } - else + # If the line does not contain a free space, it's the last blocked domain + elif [[ $line != *' '* ]] + then + PIHOLE_LAST_DOMAIN_BLOCKED=$line + fi + done - PIHOLE_LAST_DOMAIN_BLOCKED=$(tac /var/log/pihole.log | mawk '/gravity.list/{print $6;exit}' | cut -c 1-24 ) + # Close connection / Remove file descriptors + exec 3>&- + exec 3<&- - fi + # Calculate percentage of blocked queries and convert to graph + Percent_To_Graph $(( $PIHOLE_TOTAL_ADS * 100 / $PIHOLE_QUERY_COUNT )) + PIHOLE_PERCENT_ADS=$C_PERCENT_GRAPH } @@ -1038,14 +1021,16 @@ # Pi-hole Update_Scene_8(){ - # Update data - Obtain_PIHOLE + local first_line=" $BANNER_PRINT" + + # Update data, print warning if it fails + Obtain_PIHOLE || first_line="${aCOLOUR[1]}$C_REVERSE Updating data failed! " # Clear screen clear # Banner - echo -e "$C_RESET $BANNER_PRINT" + echo -e "$C_RESET$first_line" echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Pi-hole stats (TODAY): " echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Ads Blocked: $C_RESET$PIHOLE_TOTAL_ADS" echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} DNS Queries: $C_RESET$PIHOLE_QUERY_COUNT" From 1c6959bc91c0b237c9a9548464f433ea5fc9bd6f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Feb 2021 18:35:52 +0100 Subject: [PATCH 103/218] v6.35 + DietPi-CloudShell | Pi-hole scene: /dev/tcp/127.0.0.1/$port does not exist in the file system, but as possible file descriptor only, hence remove the existence check + DietPi-CloudShell | Pi-hole scene: The FTL API allows only one output command per time, hence get last blocked domain first, without closing the connection, then get the other stats and close the connection. + DietPi-CloudShell | Pi-hole scene: Fix syntax to parse one line per loop via read --- dietpi/dietpi-cloudshell | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 688fcc1905..6397517408 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -690,20 +690,21 @@ # Exit if no valid integer contained (( $port )) || return 2 - # Exit if connector foes not exist - [[ -e /dev/tcp/127.0.0.1/$port ]] || return 3 - # Establish connection / Create file descriptors exec 3<>"/dev/tcp/127.0.0.1/$port" # Exit if connection fails - >&3 || return 4 + >&3 || return 3 + + # Get last blocked domain + echo '>recentBlocked' >&3 + PIHOLE_LAST_DOMAIN_BLOCKED=$(<&3) # Ask FTL for stats and to quit when finished - echo '>stats >recentBlocked >quit' >&3 + echo '>stats >quit' >&3 # Read output, allowing 1 second timeout per line, exit on empty string when connection is closed - while read -r -t 1 line <&3 && [[ $line || -t 3 ]] + while read -r -t 1 line && [[ $line || -t 3 ]] do if [[ $line == 'domains_being_blocked '* ]] then @@ -716,13 +717,8 @@ elif [[ $line == 'ads_blocked_today '* ]] then PIHOLE_TOTAL_ADS=${line#* } - - # If the line does not contain a free space, it's the last blocked domain - elif [[ $line != *' '* ]] - then - PIHOLE_LAST_DOMAIN_BLOCKED=$line fi - done + done <&3 # Close connection / Remove file descriptors exec 3>&- From b48a0f27594370d908901d3167beb41a60e9ee82 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Feb 2021 19:35:21 +0100 Subject: [PATCH 104/218] v6.35 + DietPi-CloudShell | Pi-hole scene: Prevent division with zero, when no queries have been processed yet + DietPi-CloudShell | Pi-hole scene: FTL cannot handle a second command when the first commands output has not fully been read. Follow Chronometer/PADD in closing the connection after the first command and re-establishing it before sending the second command. + DietPi-CloudShell | Pi-hole scene: Show function exit code when FTL connection failed, for debugging purpose + DietPi-CloudShell | Pi-hole scene: Fix detection of Pi-hole install by checking for pihole-FTL command --- dietpi/dietpi-cloudshell | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 6397517408..7571f601bd 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -696,11 +696,13 @@ # Exit if connection fails >&3 || return 3 - # Get last blocked domain - echo '>recentBlocked' >&3 - PIHOLE_LAST_DOMAIN_BLOCKED=$(<&3) + # Ask FTL for last blocked domain and to quit when finished + echo '>recentBlocked >quit' >&3 + # Read last blocked domain, allowing 1 second timeout + read -r -t 1 PIHOLE_LAST_DOMAIN_BLOCKED <&3 - # Ask FTL for stats and to quit when finished + # Re-establish connection, then ask FTL for stats and to quit when finished + exec 3<>"/dev/tcp/127.0.0.1/$port" echo '>stats >quit' >&3 # Read output, allowing 1 second timeout per line, exit on empty string when connection is closed @@ -725,7 +727,7 @@ exec 3<&- # Calculate percentage of blocked queries and convert to graph - Percent_To_Graph $(( $PIHOLE_TOTAL_ADS * 100 / $PIHOLE_QUERY_COUNT )) + Percent_To_Graph $(( $PIHOLE_QUERY_COUNT ? $PIHOLE_TOTAL_ADS * 100 / $PIHOLE_QUERY_COUNT : 0 )) PIHOLE_PERCENT_ADS=$C_PERCENT_GRAPH } @@ -1020,7 +1022,7 @@ local first_line=" $BANNER_PRINT" # Update data, print warning if it fails - Obtain_PIHOLE || first_line="${aCOLOUR[1]}$C_REVERSE Updating data failed! " + Obtain_PIHOLE || first_line="${aCOLOUR[1]}$C_REVERSE Updating data failed! ($?)" # Clear screen clear @@ -1100,7 +1102,7 @@ _EOF_ #-------------------------------------------------------------------------------- # Check and disable scenes if software is not installed: # - 8 Pi-hole - [[ -f '/etc/pihole/gravity.list' ]] || aEnabledScenes[8]=0 + command -v pihole-FTL > /dev/null || aEnabledScenes[8]=0 # - 9 Tor Relay command -v tor > /dev/null && command -v nyx > /dev/null || aEnabledScenes[9]=0 From 0fec0a8ab8033ce3c13ed8e28fc8560d3346184c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Feb 2021 20:02:17 +0100 Subject: [PATCH 105/218] v6.35 + DietPi-CloudShell | Show more precise error message when Pi-hole FTL connection fails --- dietpi/dietpi-cloudshell | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 7571f601bd..11da8da78c 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -682,19 +682,19 @@ # - https://docs.pi-hole.net/ftldns/telnet-api/ # Exit if Pi-hole FTL is not running - [[ -f '/run/pihole-FTL.port' ]] || return 1 + [[ -f '/run/pihole-FTL.port' ]] || { first_line="${aCOLOUR[1]}$C_REVERSE Pi-hole not yet started "; return; } # Get FTL port local port=$("/dev/tcp/127.0.0.1/$port" # Exit if connection fails - >&3 || return 3 + >&3 || { first_line="${aCOLOUR[1]}$C_REVERSE Pi-hole connection failed"; return; } # Ask FTL for last blocked domain and to quit when finished echo '>recentBlocked >quit' >&3 @@ -1019,10 +1019,9 @@ # Pi-hole Update_Scene_8(){ + # Update data, replace first output line with error message in case of failure local first_line=" $BANNER_PRINT" - - # Update data, print warning if it fails - Obtain_PIHOLE || first_line="${aCOLOUR[1]}$C_REVERSE Updating data failed! ($?)" + Obtain_PIHOLE # Clear screen clear From a5a6b5826756bc2502d99c5d5f327360c4178881 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Feb 2021 21:02:03 +0100 Subject: [PATCH 106/218] v6.35 + DietPi-Update | Add new remote version file for updates and automatic branch migration from next version on --- .update/version | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .update/version diff --git a/.update/version b/.update/version new file mode 100644 index 0000000000..0981a0672d --- /dev/null +++ b/.update/version @@ -0,0 +1,13 @@ +# Available DietPi version +G_REMOTE_VERSION_CORE=7 +G_REMOTE_VERSION_SUB=0 +G_REMOTE_VERSION_RC=0 +# Minimum DietPi version to allow update +G_MIN_VERSION_CORE=6 +G_MIN_VERSION_SUB=-1 +# Alternative Git branch to automatically migrate to when version is too low +G_OLD_VERSION_BRANCH='master' +# Minimum Debian version to allow update +G_MIN_DEBIAN=4 +# Alternative Git branch to automatically migrate to when Debian version is too low +G_OLD_DEBIAN_BRANCH='jessie-support' From 677680c5308e96e3db34727b3d59d4ff01430cf4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Feb 2021 21:19:57 +0100 Subject: [PATCH 107/218] v6.35 + DietPi-Pre-patches | Create new pre-patches file in new separate update directory outside of DietPi core scripts directory --- .update/pre-patches | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .update/pre-patches diff --git a/.update/pre-patches b/.update/pre-patches new file mode 100644 index 0000000000..b8c4b9d3c5 --- /dev/null +++ b/.update/pre-patches @@ -0,0 +1,7 @@ +#!/bin/bash +{ +# DietPi-Update pre-patches that need to run before new scripts are downloaded and/or before APT upgrades +# Created by MichaIng / micha@dietpi.com / https://dietpi.com/ +# License: GPLv2 / https://github.com/MichaIng/DietPi#license +exit 0 +} From 9d0b10bc83ec2c1f79689f0e36b01fea5137262e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Feb 2021 22:34:44 +0100 Subject: [PATCH 108/218] v6.35 + DietPi-Update | Apply automatic branch migration and new remote version + pre-patches URLs --- dietpi/dietpi-update | 116 ++++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 46 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 78d86930b4..55f3c16e30 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -45,22 +45,36 @@ CHANGELOG_DOWNLOADED=0 # Prevent redownload of changelog if already done in this session + # Git repo to update from GITOWNER_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITOWNER_TARGET=${GITOWNER_TARGET:-MichaIng} GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITBRANCH_TARGET=${GITBRANCH_TARGET:-master} - COREVERSION_SERVER=0 - SUBVERSION_SERVER=0 - RCVERSION_SERVER=0 - + # Remote version variables + # - Available DietPi version + G_REMOTE_VERSION_CORE= + G_REMOTE_VERSION_SUB= + G_REMOTE_VERSION_RC= + # - Minimum DietPi version to allow update + G_MIN_VERSION_CORE= + G_MIN_VERSION_SUB= + # - Alternative Git branch to automatically migrate to when version is too low + G_OLD_VERSION_BRANCH= + # - Minimum Debian version to allow update + G_MIN_DEBIAN= + # - Alternative Git branch to automatically migrate to when Debian version is too low + G_OLD_DEBIAN_BRANCH= + + # Version info to print to console INFO_CURRENT_VERSION= INFO_SERVER_VERSION= INFO_VERSIONS_UPDATE(){ INFO_CURRENT_VERSION="Current version : v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" - INFO_SERVER_VERSION="Latest version : v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" + INFO_SERVER_VERSION="Latest version : v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" + # Show Git repo, when it changed if [[ $G_GITBRANCH != "$GITBRANCH_TARGET" || $G_GITOWNER != "$GITOWNER_TARGET" ]]; then INFO_CURRENT_VERSION+=" (branch: $G_GITOWNER/$G_GITBRANCH)" @@ -73,30 +87,26 @@ URL_MIRROR_INDEX=0 aURL_MIRROR_SERVERVERSION=( - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/server_version-6" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/server_version-6" - + "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/version" + "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/version" ) aURL_MIRROR_PREPATCH=( - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/pre-patch_file" - + "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" + "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/pre-patches" ) aURL_MIRROR_ARCHIVE=( "https://github.com/$GITOWNER_TARGET/DietPi/archive/$GITBRANCH_TARGET.tar.gz" "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/DietPi-$GITBRANCH_TARGET.tar.gz" - ) aURL_MIRROR_CHANGELOG=( "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/CHANGELOG.txt" - ) Get_Server_Version(){ @@ -106,17 +116,15 @@ do G_DIETPI-NOTIFY 2 "Checking mirror: ${aURL_MIRROR_SERVERVERSION[$i]}" - if curl -sSfL "${aURL_MIRROR_SERVERVERSION[$i]}" > server_version; then + if curl -sSfL "${aURL_MIRROR_SERVERVERSION[$i]}" -o version; then - # Get server version - COREVERSION_SERVER=$(mawk 'NR==1' server_version) - SUBVERSION_SERVER=$(mawk 'NR==2' server_version) - RCVERSION_SERVER=$(mawk 'NR==3' server_version) + # Source file + . version # Check if server version contains valid intergers - if disable_error=1 G_CHECK_VALIDINT "$COREVERSION_SERVER" && - disable_error=1 G_CHECK_VALIDINT "$SUBVERSION_SERVER" && - disable_error=1 G_CHECK_VALIDINT "$RCVERSION_SERVER"; then + if disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_CORE" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_SUB" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_RC"; then G_DIETPI-NOTIFY 0 "Using update server: ${aURL_MIRROR_SERVERVERSION[$i]}" URL_MIRROR_INDEX=$i @@ -124,7 +132,7 @@ else - G_DIETPI-NOTIFY 2 "Invalid server version string: ${COREVERSION_SERVER:-NULL}.${SUBVERSION_SERVER:-NULL}.${RCVERSION_SERVER:-NULL}" + G_DIETPI-NOTIFY 2 "Invalid server version string: ${G_REMOTE_VERSION_CORE:-NULL}.${G_REMOTE_VERSION_SUB:-NULL}.${G_REMOTE_VERSION_RC:-NULL}" fi @@ -145,6 +153,27 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss Apply_1st_Run_Update_Success(){ [[ $G_DIETPI_INSTALL_STAGE == [12] ]] || echo 1 > /boot/dietpi/.install_stage; } + Check_Git_Migration() + { + # Automatically migrate to alternative branch if Debian or DietPi version is too low. + if (( $G_DISTRO < $G_MIN_DEBIAN )) + then + G_DIETPI-NOTIFY 2 "Your Debian version is too low to update to the current branch: $G_DISTRO_NAME ($G_DISTRO)" + G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_DEBIAN_BRANCH" + G_GITBRANCH=$G_OLD_DEBIAN_BRANCH + G_VERSIONDB_SAVE || return 1 + Get_Server_Version || return 1 + + elif (( $G_DIETPI_VERSION_CORE < $G_MIN_VERSION_CORE || ( $G_DIETPI_VERSION_CORE == $G_MIN_VERSION_CORE && $G_DIETPI_VERSION_SUB < $G_MIN_VERSION_SUB ) )) + then + G_DIETPI-NOTIFY 2 "Your DietPi version is too low to update to the current branch: v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB" + G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_VERSION_BRANCH" + G_GITBRANCH=$G_OLD_VERSION_BRANCH + G_VERSIONDB_SAVE || return 1 + Get_Server_Version || return 1 + fi + } + Check_DietPi_Update(){ # If requested, reduce current subversion by 1 to reapply last update @@ -160,14 +189,14 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss local result=1 # Update available - if (( $G_DIETPI_VERSION_CORE < $COREVERSION_SERVER || - ( $G_DIETPI_VERSION_CORE == $COREVERSION_SERVER && ( $G_DIETPI_VERSION_SUB < $SUBVERSION_SERVER || - ( $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER && $G_DIETPI_VERSION_RC < $RCVERSION_SERVER ) ) ) )); then + if (( $G_DIETPI_VERSION_CORE < $G_REMOTE_VERSION_CORE || + ( $G_DIETPI_VERSION_CORE == $G_REMOTE_VERSION_CORE && ( $G_DIETPI_VERSION_SUB < $G_REMOTE_VERSION_SUB || + ( $G_DIETPI_VERSION_SUB == $G_REMOTE_VERSION_SUB && $G_DIETPI_VERSION_RC < $G_REMOTE_VERSION_RC ) ) ) )); then result=0 # Write available update version to flag file - echo "$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" > /run/dietpi/.update_available + echo "$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" > /run/dietpi/.update_available G_DIETPI-NOTIFY 0 'Update available:' @@ -198,7 +227,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss Run_DietPi_Update(){ # RC-only update: Reapply last subversion patches - if (( $G_DIETPI_VERSION_CORE == $COREVERSION_SERVER && $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER )); then + if (( $G_DIETPI_VERSION_CORE == $G_REMOTE_VERSION_CORE && $G_DIETPI_VERSION_SUB == $G_REMOTE_VERSION_SUB )); then ((G_DIETPI_VERSION_SUB--)) G_DIETPI_VERSION_RC=0 @@ -207,11 +236,11 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss fi G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches' - G_EXEC_DESC='Downloading pre-patch file' G_EXEC curl -sSfL "${aURL_MIRROR_PREPATCH[$URL_MIRROR_INDEX]}" -o pre-patch_file - G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file - if ! ./pre-patch_file $G_DIETPI_VERSION_SUB; then + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfL "${aURL_MIRROR_PREPATCH[$URL_MIRROR_INDEX]}" -o pre-patches + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches + if ! ./pre-patches; then - G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + G_DIETPI-NOTIFY 1 "An error occured during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." exit 1 fi @@ -223,17 +252,12 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installing new DietPi code' G_EXEC_DESC='Downloading update archive' G_EXEC curl -sSfL "${aURL_MIRROR_ARCHIVE[$URL_MIRROR_INDEX]}" -o update.tar.gz - G_EXEC_DESC='Unpacking update archive' G_EXEC tar xf update.tar.gz rm update.tar.gz # Remove files from Git archive that are not to be installed on client rm DietPi-"$GITBRANCH_TARGET"/dietpi/{pre-patch_file,server_version*} - # Remove old code before updating, so we dont need to patch for removals - # - https://github.com/MichaIng/DietPi/issues/905#issuecomment-298241622 - #rm -R /boot/dietpi/{func,misc,dietpi-*} - G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /boot/ G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. / G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi @@ -266,12 +290,12 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss exit 1 fi - G_DIETPI_VERSION_CORE=$COREVERSION_SERVER - G_DIETPI_VERSION_SUB=$SUBVERSION_SERVER - G_DIETPI_VERSION_RC=$RCVERSION_SERVER + G_DIETPI_VERSION_CORE=$G_REMOTE_VERSION_CORE + G_DIETPI_VERSION_SUB=$G_REMOTE_VERSION_SUB + G_DIETPI_VERSION_RC=$G_REMOTE_VERSION_RC G_VERSIONDB_SAVE - G_DIETPI-NOTIFY 0 "Incremental patching to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER completed" + G_DIETPI-NOTIFY 0 "Incremental patching to v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC completed" # Remove patch_file rm /boot/dietpi/patch_file @@ -283,13 +307,13 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss #///////////////////////////////////////////////////////////////////////////////////// Get_View_Changelog(){ - local i fp_changelog='CHANGELOG.txt' + local i (( $CHANGELOG_DOWNLOADED )) || for i in "${!aURL_MIRROR_CHANGELOG[@]}" do G_DIETPI-NOTIFY 2 "Checking mirror: ${aURL_MIRROR_CHANGELOG[$i]}" - if curl -sSfL "${aURL_MIRROR_CHANGELOG[$i]}" > $fp_changelog; then + if curl -sSfL "${aURL_MIRROR_CHANGELOG[$i]}" > CHANGELOG.txt; then CHANGELOG_DOWNLOADED=1 break @@ -304,7 +328,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss if (( $CHANGELOG_DOWNLOADED )); then - G_WHIP_VIEWFILE $fp_changelog + G_WHIP_VIEWFILE CHANGELOG.txt else @@ -323,7 +347,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss G_WHIP_MENU_ARRAY=( '' '●─ Update DietPi ' - 'Update' ": Apply update to: v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" + 'Update' ": Apply update to: v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" '' '●─ Additional Options ' 'Changelog' ': View recent changelog and patch notes.' 'Backup' ': Create a system backup before updating.' @@ -342,7 +366,7 @@ Please select 'Update' option to apply the update."; then - A potential downside is: We can't possibly accommodate or predict all modification to Linux configurations files by the end user, outside of DietPi programs, during updates.\n Although we test the updates thoroughly, if you have made any custom changes to Linux configuration files outside of the DietPi programs, an update may trigger a potential issue. >--------------------------------------------------------------------------<\n -Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER?" && return 0 +Do you wish to continue and update DietPi to v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC?" && return 0 elif [[ $G_WHIP_RETURNED_VALUE == 'Changelog' ]]; then @@ -371,7 +395,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Checking for available DietPi update' #---------------------------------------------------------------- # Check for DietPi update and in case store result to /run/dietpi/.update_available for use by DietPi-Banner - if Get_Server_Version && Check_DietPi_Update; then + if Get_Server_Version && Check_Git_Migration && Check_DietPi_Update; then # Exit if check-only input (( $INPUT == 2 )) && exit 0 From df88949c096d057f6cc6968b47bacaf93638a330 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Feb 2021 13:27:17 +0100 Subject: [PATCH 109/218] v6.35 + DietPi-Update | Remove https://dietpi.com/ update server. Access to the GitHub repository is required anyway to download the dietpi.txt and for various software configs, when being patched or reinstalled, so it's even better to exit in the very first place instead of running into failing connections at a later stage. --- dietpi/dietpi-update | 111 ++++++++++--------------------------------- 1 file changed, 26 insertions(+), 85 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 55f3c16e30..ccec989790 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -84,69 +84,38 @@ } - URL_MIRROR_INDEX=0 - aURL_MIRROR_SERVERVERSION=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/version" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/version" - ) - - aURL_MIRROR_PREPATCH=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/pre-patches" - ) - - aURL_MIRROR_ARCHIVE=( - - "https://github.com/$GITOWNER_TARGET/DietPi/archive/$GITBRANCH_TARGET.tar.gz" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/DietPi-$GITBRANCH_TARGET.tar.gz" - ) - - aURL_MIRROR_CHANGELOG=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/CHANGELOG.txt" - ) - Get_Server_Version(){ - local i - for i in "${!aURL_MIRROR_SERVERVERSION[@]}" - do - - G_DIETPI-NOTIFY 2 "Checking mirror: ${aURL_MIRROR_SERVERVERSION[$i]}" - if curl -sSfL "${aURL_MIRROR_SERVERVERSION[$i]}" -o version; then - - # Source file - . version + local url="https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/version" - # Check if server version contains valid intergers - if disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_CORE" && - disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_SUB" && - disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_RC"; then + G_DIETPI-NOTIFY 2 "Getting repository version: $url" + if curl -sSfL "$url" -o version; then - G_DIETPI-NOTIFY 0 "Using update server: ${aURL_MIRROR_SERVERVERSION[$i]}" - URL_MIRROR_INDEX=$i - return 0 + # Source file + . version - else + # Check if remote version consists of valid integers + if disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_CORE" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_SUB" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_RC"; then - G_DIETPI-NOTIFY 2 "Invalid server version string: ${G_REMOTE_VERSION_CORE:-NULL}.${G_REMOTE_VERSION_SUB:-NULL}.${G_REMOTE_VERSION_RC:-NULL}" - - fi + G_DIETPI-NOTIFY 0 'Obtained valid repository version' + return 0 else - G_DIETPI-NOTIFY 2 "No valid response from: ${aURL_MIRROR_SERVERVERSION[$i]} ($( CHANGELOG.txt; then - - CHANGELOG_DOWNLOADED=1 - break - - else - - G_DIETPI-NOTIFY 2 "No response from: ${aURL_MIRROR_CHANGELOG[$i]}" - - fi - - done - - if (( $CHANGELOG_DOWNLOADED )); then - - G_WHIP_VIEWFILE CHANGELOG.txt - - else - - G_WHIP_MSG 'Failed to download the changelog, please try again.' - - fi + [[ -f 'CHANGELOG.txt' ]] || G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" || return 1 + G_WHIP_VIEWFILE CHANGELOG.txt } From b5a9e38833510991548e999e7b9dcb2fc9e6a568 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Feb 2021 17:52:01 +0100 Subject: [PATCH 110/218] v6.35 + DietPi-Update | Remove obsolete CHANGELOG_DOWNLOADED declaration + DietPi-Update | Check desktop session via $DISPLAY variable to detect parent X session, like we do everywhere else. lxsession detects LXDE desktop sessions only. --- dietpi/dietpi-update | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index ccec989790..f4e12a5af4 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -43,8 +43,6 @@ #///////////////////////////////////////////////////////////////////////////////////// readonly FP_LOG='/var/tmp/dietpi/logs/dietpi-update.log' - CHANGELOG_DOWNLOADED=0 # Prevent redownload of changelog if already done in this session - # Git repo to update from GITOWNER_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITOWNER_TARGET=${GITOWNER_TARGET:-MichaIng} @@ -75,12 +73,10 @@ INFO_SERVER_VERSION="Latest version : v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" # Show Git repo, when it changed - if [[ $G_GITBRANCH != "$GITBRANCH_TARGET" || $G_GITOWNER != "$GITOWNER_TARGET" ]]; then - - INFO_CURRENT_VERSION+=" (branch: $G_GITOWNER/$G_GITBRANCH)" - INFO_SERVER_VERSION+=" (branch: $GITOWNER_TARGET/$GITBRANCH_TARGET)" + [[ $G_GITBRANCH != "$GITBRANCH_TARGET" || $G_GITOWNER != "$GITOWNER_TARGET" ]] || return - fi + INFO_CURRENT_VERSION+=" (branch: $G_GITOWNER/$G_GITBRANCH)" + INFO_SERVER_VERSION+=" (branch: $GITOWNER_TARGET/$GITBRANCH_TARGET)" } @@ -386,7 +382,7 @@ Do you wish to continue and update DietPi to v$G_REMOTE_VERSION_CORE.$G_REMOTE_V fi #---------------------------------------------------------------- # Desktop run, exit key prompt - pgrep 'lxsession' > /dev/null && read -rp 'Press any key to exit DietPi-Update...' + [[ $DISPLAY ]] && read -rp 'Press any key to exit DietPi-Update...' # Else, check for and in case apply APT updates based on input mode and dietpi.txt choice else From d6ac615ee10d99549138e308205672d929b899d5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Feb 2021 20:56:46 +0100 Subject: [PATCH 111/218] v6.35 + DietPi-Update | Both, pre-patches and incremental patches for v6 still need to be applied since DietPi-Update restarts are done before incremental patches have been applied and pre-v6.17 system didn't have pre-patches applied either. --- dietpi/dietpi-update | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index f4e12a5af4..52007a8747 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -95,12 +95,12 @@ disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_SUB" && disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_RC"; then - G_DIETPI-NOTIFY 0 'Obtained valid repository version' + G_DIETPI-NOTIFY 0 'Got valid repository version' return 0 else - G_DIETPI-NOTIFY 1 "Got invalid repository version (${G_REMOTE_VERSION_CORE:-NULL}.${G_REMOTE_VERSION_SUB:-NULL}.${G_REMOTE_VERSION_RC:-NULL}). Please check your target Git reposiory and your network connection, then rerun dietpi-update." + G_DIETPI-NOTIFY 1 "Got invalid repository version (${G_REMOTE_VERSION_CORE:-NULL}.${G_REMOTE_VERSION_SUB:-NULL}.${G_REMOTE_VERSION_RC:-NULL}). Please check the target Git reposiory and your network connection, then rerun dietpi-update." fi @@ -199,6 +199,21 @@ fi G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches' + + # DietPi v6 pre-patches, required for DietPi pre-v6.17 systems, which have DietPi-Update restarted before having these pre-patches applied. + if (( $G_DIETPI_VERSION_CORE == 6 )); then + + G_EXEC_DESC='Downloading DietPi v6 pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file + if ! ./pre-patch_file $G_DIETPI_VERSION_SUB; then + + G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + + fi + + fi + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches if ! ./pre-patches; then @@ -247,22 +262,29 @@ G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - if ! /boot/dietpi/patch_file; then + # DietPi v6 incremental patches + if (( $G_DIETPI_VERSION_CORE == 6 )) && ! /boot/dietpi/patch_file; then G_DIETPI-NOTIFY 1 "An error occured during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." exit 1 fi + # - Remove patch_file + rm /boot/dietpi/patch_file + + if ! .update/patches; then + + G_DIETPI-NOTIFY 1 "An error occured during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + + fi + G_DIETPI_VERSION_CORE=$G_REMOTE_VERSION_CORE G_DIETPI_VERSION_SUB=$G_REMOTE_VERSION_SUB G_DIETPI_VERSION_RC=$G_REMOTE_VERSION_RC G_VERSIONDB_SAVE - G_DIETPI-NOTIFY 0 "Incremental patching to v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC completed" - # Remove patch_file - rm /boot/dietpi/patch_file - } #///////////////////////////////////////////////////////////////////////////////////// @@ -270,7 +292,7 @@ #///////////////////////////////////////////////////////////////////////////////////// Get_View_Changelog(){ - [[ -f 'CHANGELOG.txt' ]] || G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" || return 1 + [[ -f 'CHANGELOG.txt' ]] || G_EXEC_NOEXIT=1 G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" || return 1 G_WHIP_VIEWFILE CHANGELOG.txt } From 498c1579b217b6362f25e8f13ad75ab5babf4586 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Feb 2021 21:01:38 +0100 Subject: [PATCH 112/218] v6.35 + DietPi-Update | Create DietPi v7 incremental patch file --- .update/patches | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .update/patches diff --git a/.update/patches b/.update/patches new file mode 100644 index 0000000000..63624b2127 --- /dev/null +++ b/.update/patches @@ -0,0 +1,7 @@ +#!/bin/bash +{ +# DietPi-Update incremental patches to apply system and software migrations and fixes +# Created by MichaIng / micha@dietpi.com / https://dietpi.com/ +# License: GPLv2 / https://github.com/MichaIng/DietPi#license +exit 0 +} From 14c448d4b36b3c6a9e9d40438a059bac8f5fa73c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Feb 2021 22:04:28 +0100 Subject: [PATCH 113/218] v6.35 + DietPi-Patch | This is only called by DietPi v6 systems, so restart whenever it is not the second instance already --- dietpi/patch_file | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 019f4a0bcb..988e65d1ef 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -66,8 +66,7 @@ fi - # Whether to schedule a DietPi-Update restart, with or without system reboot - RESTART= + # Whether to schedue a reboot after DietPi-Update REBOOT= # Pre-v6.29: DietPi-RAMdisk removal needs to be done before loading DietPi-Globals, else /boot/dietpi still contains the old code @@ -88,9 +87,6 @@ # Failsafe sync - # DietPi-Update restart required since old version calls DietPi-RAMdisk forcefully and error-handled - RESTART=1 - 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; chmod 777 /run/dietpi; } @@ -109,7 +105,6 @@ elif [[ ! -f '/boot/dietpi/.version' ]] || ! grep -q '^G_GITOWNER=' /boot/dietpi/.version; then rm /boot/dietpi/.version - RESTART=1 fi @@ -136,7 +131,7 @@ _EOF_ # Import DietPi-Globals -------------------------------------------------------------- /boot/dietpi/func/dietpi-obtain_hw_model # Always update . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Patch' + readonly G_PROGRAM_NAME='DietPi-Patch' G_INIT # Import DietPi-Globals -------------------------------------------------------------- @@ -144,8 +139,8 @@ _EOF_ # - DietPi-Update includes G_VERSIONDB_SAVE after every subversion patch from v6.27 on. (( $1 )) && G_DIETPI_VERSION_SUB=$1 - # Migrate newly supported SBCs from dev to master branch - if (( $G_DIETPI_VERSION_SUB < 29 )) && [[ -f '/etc/.dietpi_hw_model_identifier' ]]; then + # Pre-v6.29: Migrate newly supported SBCs from dev to master branch + if [[ $G_DIETPI_VERSION_SUB -lt 29 && -f '/etc/.dietpi_hw_model_identifier' ]]; then # NanoPi M4v2 (58) # Pine H64 (45) @@ -159,9 +154,6 @@ _EOF_ fi - # Pre-v6.29: Restart DietPi-Update in any case, to apply single-call patch_file change - (( $G_DIETPI_VERSION_SUB > 28 || $(pgrep -c patch_file) > 1 )) || RESTART=1 - # Pre-v6.20: New $G_DIETPI_INSTALL_STAGE system # - As loaded pre-v6.20 dietpi-update will recreate ".update_stage", we need to rerun dietpi-update. if [[ -f '/boot/dietpi/.update_stage' ]]; then @@ -180,12 +172,10 @@ _EOF_ fi - RESTART=1 - fi - # Restart DietPi-Update if scheduled - if [[ $RESTART == 1 ]]; then + # Restart DietPi-Update when not yet done, to migrate to v7 + if (( $(pgrep -c patch_file) < 2 )); then # Save current version to rerun patch on next launch G_VERSIONDB_SAVE @@ -1299,9 +1289,10 @@ Do you still want to keep "p7zip-full"?'; then fi #------------------------------------------------------------------------------- # Fix Pi-hole permissions to allow "pihole -up" - if [[ -d '/var/www/html/pihole' ]]; then + if [[ -d '/var/www/html/pihole' && -d '/var/www/html/admin' ]]; then - cd /var/www/html/admin && git reset --hard HEAD + G_EXEC cd /var/www/html/admin + git reset --hard HEAD G_EXEC cd /tmp/$G_PROGRAM_NAME fi From 3f95ac39d1170a57e3e253904173be9154618518 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 16:17:08 +0100 Subject: [PATCH 114/218] v6.35 (#4106) + DietPi-Software | Fix download GitHub URL/version detection for ruTorrent, Koel and Bitwarden_RS: mawk does not support "[[:blank:]]" syntax, hence the fallback URL was used in those cases. + DietPi-Software | Align automated GitHub download URL/version detection for all installs. Take into account that mawk is not able to handle "[[:blank:]]" syntax and variables, hence if this is required, "grep | cut" pipe needs to be used. Use "curl -sSfL" in all cases so that curl errors and server error responses are shown, for debugging purpose. mawk and grep are then not allowed to exit on first match, since this causes a curl 23 exit code and error message about a broken pipe before the response could have been written completely, when the match was not within the last buffer chunk. To compensate this, assure that a single match exists by being more specific about the expected regex, assure that a fallback is present and effective in every case. **Once Stretch support is dropped, we could use `CURLOPT_BUFFERSIZE=524288` (introduced with curl v7.53 vs Stretch curl v7.52.1) to maximise the curl buffer chunks so that a GitHub API page fully fits inside and parsing can stop at first match. But being explicit about the URL has it's own benefits, in case of multiple matches we might want to review the two options and pick one explicitly.** + DietPi-Software | Whenever a download fallback URL or version string is used, print an error message, inform about the fallback but ask user to do a report as obviously we need to update the URL or regex. + DietPi-Software | "curl -IL" does not suffer from failing GitHub download URL checks, hence the workaround to check the API page only can be removed. Testet on all distros from Stretch to Bullseye. + DietPi-Software | Use G_EXEC more widely throughout the script, where applicable --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 189 ++++++++++++++++------------------------- 2 files changed, 76 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5aaed17049..58dec1480b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -26,6 +26,7 @@ Fixes: - DietPi-Software | PaperMC: Resolved an issue where the install failed due to changed download URLs and stabilised service start and config creation by setting the Java heap size and allowing more time for the startup on smaller SBCs. Many thanks to @omavoss for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191 - DietPi-Software | OpenTyrian: The install option has been disabled on x86_64, since the Debian package comes with a different file structure and it has been disabled on 64-bit RPi systems, since the binary has been compiled for armhf. - DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 +- DietPi-Software | Resolved an issue where for ruTorrent, Koel and Bitwarden_RS the automatic newest version detection failed and instead a possibly older fallback was used. Many thanks to @kelvmod for reporting this issue: https://github.com/MichaIng/DietPi/issues/4105 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/4XXX diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f2c83a332b..0d6e47613e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2985,7 +2985,23 @@ _EOF_ # NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) Download_Install(){ - local url=${1:-$fallback_url} + # Verify input URL + if [[ $1 ]] + then + local url=$1 + + elif [[ $fallback_url ]] + then + G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} download URL detection failed." + G_DIETPI-NOTIFY 1 "\"$fallback_url\" will be used as fallback, but a newer version might be available." + G_DIETPI-NOTIFY 1 'Please report this at: https://github.com/MichaIng/DietPi/issues' + local url=$fallback_url + + else + G_DIETPI-NOTIFY 1 "An empty download URL was passed during ${aSOFTWARE_NAME[$software_id]} install. Please report this at: https://github.com/MichaIng/DietPi/issues" + return 1 + fi + local target=$2 # Target path local file=${url##*/} # Grab file name from URL local type=${file##*.} # Grab file type from file name to special handle deb|zip|tar(.gz|.bz2)|tgz|tbz2|7z @@ -2999,6 +3015,7 @@ _EOF_ fi + # shellcheck disable=SC2154 (( $no_check_url )) || G_CHECK_URL "$url" G_EXEC cd /tmp/$G_PROGRAM_NAME # Failsafe @@ -3514,16 +3531,14 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et # Quick install: https://docs.phpmyadmin.net/en/latest/setup.html#quick-install # - 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 -sf "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"name":' | cut -d \" -f 4) - local fallback_url='https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-english.tar.gz' + local version=$(curl -sSfL 'https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest' | mawk -F\" '/"name": /{print $4}') + [[ $version ]] || { version='5.0.4'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-english.tar.gz" # - Reinstall: Clean install but preserve existing config file [[ -f '/var/www/phpmyadmin/config.inc.php' ]] && G_EXEC mv /var/www/phpmyadmin/config.inc.php phpMyAdmin-*-english/ G_EXEC rm -Rf /var/www/phpmyadmin # Include pre-v6.27 symlink: https://github.com/MichaIng/DietPi/issues/3304 # - Remove GUI setup: https://docs.phpmyadmin.net/en/latest/setup.html#securing-your-phpmyadmin-installation - rm -R phpMyAdmin-*-english/setup + G_EXEC_NOHALT=1 G_EXEC rm -R phpMyAdmin-*-english/setup # - Move new instance in place G_EXEC mv phpMyAdmin-*-english /var/www/phpmyadmin @@ -4396,10 +4411,8 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/airsonic/airsonic/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" local fallback_url='https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war' - no_check_url=1 Download_Install "$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*\.war"/{print $4}')" /mnt/dietpi_userdata/airsonic/airsonic.war + Download_Install "$(curl -sSfL 'https://api.github.com/repos/airsonic/airsonic/releases/latest' | mawk -F\" '/"browser_download_url": .*\/airsonic\.war"/{print $4}')" /mnt/dietpi_userdata/airsonic/airsonic.war fi @@ -4416,8 +4429,6 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/remoteit/installer/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # ARMv6/7 local arch='armhf' @@ -4434,9 +4445,8 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf fi - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) local fallback_url="https://github.com/remoteit/installer/releases/download/v2.5.38/connectd_2.5.38_$arch.deb" - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/remoteit/installer/releases/latest' | grep "\"browser_download_url\": .*/connectd_[^\"/]*_$arch\.deb\"" | cut -d \" -f 4)" fi @@ -4538,18 +4548,11 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/blynkkk/blynk-server/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # 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 -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) + local fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.15/server-0.41.15.jar' java= + (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.15/server-0.41.15-java8.jar' java='-java8' - local fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.14/server-0.41.14.jar' - (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.14/server-0.41.14-java8.jar' - - DEPS_LIST='python' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /mnt/dietpi_userdata/blynk/blynkserver.jar + DEPS_LIST='python' Download_Install "$(curl -sSfL 'https://api.github.com/repos/blynkkk/blynk-server/releases/latest' | grep "\"browser_download_url\": .*/server-[0-9.]*$java\.jar\"" | cut -d \" -f 4)" /mnt/dietpi_userdata/blynk/blynkserver.jar # Install Blynk JS libary npm i -g --unsafe-perm onoff @@ -4584,7 +4587,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Get latest version: No Bullseye packages available yet local distro=$G_DISTRO_NAME (( $G_DISTRO > 5 )) && distro='buster' - local package=$(curl -sSfL "$url/$distro/" | sed -n "/networkaudiod_.*_$arch.deb/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) + local package=$(curl -sSfL "$url/$distro/" | sed -n "/href=\"networkaudiod_[^\"]*_$arch.deb\"/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) # Check final URL before applying debconf settings G_CHECK_URL "$url/$distro/$package" @@ -4852,12 +4855,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - INSTALL_URL_ADDRESS='https://api.github.com/repos/gotson/komga/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - local fallback_url='https://github.com/gotson/komga/releases/download/v0.64.6/komga-0.64.6.jar' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*komga-[0-9.]*\.jar/{print $4;quit}')" /mnt/dietpi_userdata/komga/komga.jar + local fallback_url='https://github.com/gotson/komga/releases/download/v0.69.2/komga-0.69.2.jar' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/"browser_download_url": .*\/komga-[^"\/]*\.jar"/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -5245,14 +5244,11 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/sabre-io/Baikal/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # APT deps: https://github.com/sabre-io/Baikal/wiki/Baïkal-dependencies DEPS_LIST="$PHP_NAME-xml $PHP_NAME-mbstring $PHP_NAME-mysql" - local fallback_url='https://github.com/sabre-io/Baikal/releases/download/0.7.2/baikal-0.7.2.zip' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url":/{print $4;exit}')" + local fallback_url='https://github.com/sabre-io/Baikal/releases/download/0.8.0/baikal-0.8.0.zip' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/sabre-io/Baikal/releases/latest' | mawk -F\" '/"browser_download_url": .*\/baikal-[^"\/]*\.zip"/{print $4}')" # Reinstall: https://sabre.io/baikal/upgrade/ if [[ -d '/var/www/baikal' ]]; then @@ -5279,9 +5275,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv7 local arch='armhf' @@ -5297,10 +5290,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.5.3.0/emby-server-deb_4.5.3.0_$arch.deb" - 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 -v arch + local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.5.4.0/emby-server-deb_4.5.4.0_$arch.deb" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' | grep "\"browser_download_url\": .*/emby-server-deb_[^\"/]*_$arch\.deb\"" | cut -d \" -f 4)" fi @@ -5421,9 +5412,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi local fallback_url="https://github.com/gogs/gogs/releases/download/v0.12.3/gogs_0.12.3_linux_$arch.tar.gz" - G_CHECK_URL 'https://api.github.com/repos/gogs/gogs/releases/latest' - INSTALL_URL_ADDRESS=$(curl -sf 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep -m1 "browser_download_url.*linux_$arch.tar.gz" | cut -d \" -f 4) - local no_check_url=1 # G_CHECK_URL faces 403 + INSTALL_URL_ADDRESS=$(curl -sSfL 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep "\"browser_download_url\": .*/gogs_[^\"/]*_linux_$arch.tar.gz\"" | cut -d \" -f 4) fi @@ -5461,9 +5450,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Install ruTorrent: Web UI for rTorrent # - Grab current version - INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/Novik/ruTorrent/archive/${version:-v3.9}.tar.gz" + local version=$(curl -sSfL 'https://api.github.com/repos/Novik/ruTorrent/releases/latest' | mawk -F\" '/"tag_name": /{print $4}') + [[ $version ]] || { version='v3.10'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall if [[ -d '/var/www/rutorrent' ]]; then @@ -5474,13 +5463,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_BACKUP_FP /var/www/rutorrent/conf/plugins.ini # Merge new install into old to preserve e.g. 3rd party plugins - cp -a ruTorrent-*/. /var/www/rutorrent/ - rm -R ruTorrent-* + G_EXEC cp -a ruTorrent-*/. /var/www/rutorrent/ + G_EXEC rm -R ruTorrent-* # - Fresh install else - mv ruTorrent-* /var/www/rutorrent + G_EXEC mv ruTorrent-* /var/www/rutorrent fi @@ -5547,10 +5536,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else - # Get latest version from GitHub - INSTALL_URL_ADDRESS='https://api.github.com/repos/syncthing/syncthing/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv6/7 local arch='arm' @@ -5566,9 +5551,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-$arch-v1.12.0.tar.gz" - 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 + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.13.1/syncthing-linux-$arch-v1.13.1.tar.gz" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | grep "\"browser_download_url\": .*/syncthing-linux-$arch-[^\"/]*\.tar\.gz\"" | cut -d \" -f 4)" + G_EXEC mv syncthing-* /opt/syncthing fi @@ -5734,9 +5719,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST='pkg-config libssl-dev' # Download - INSTALL_URL_ADDRESS='https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/dani-garcia/bitwarden_rs/archive/${version:=1.17.0}.tar.gz" + local version=$(curl -sSfL 'https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest' | mawk -F\" '/"tag_name": /{print $4}') + [[ $version ]] || { version='1.19.0'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + Download_Install "https://github.com/dani-garcia/bitwarden_rs/archive/$version.tar.gz" # Replace old instance on reinstall [[ -d '/opt/bitwarden_rs' ]] && G_EXEC rm -R /opt/bitwarden_rs @@ -5783,10 +5768,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- HOME='/root' # Install web vault - INSTALL_URL_ADDRESS='https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - local fallback_url='https://github.com/dani-garcia/bw_web_builds/releases/download/v2.17.1/bw_web_v2.17.1.tar.gz' - no_check_url=1 Download_Install "$(curl -sfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*\.tar\.gz\"/{print $4;exit}')" /mnt/dietpi_userdata/bitwarden_rs + local fallback_url='https://github.com/dani-garcia/bw_web_builds/releases/download/v2.18.1b/bw_web_v2.18.1b.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/"browser_download_url": .*\/bw_web_[^"\/]*\.tar\.gz"/{print $4}')" /mnt/dietpi_userdata/bitwarden_rs fi @@ -5794,9 +5777,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz" /mnt/dietpi_userdata + Download_Install 'https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz' /mnt/dietpi_userdata fi @@ -5827,9 +5808,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST="python libpng-dev $PHP_NAME-bcmath $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml" # Grab latest release - INSTALL_URL_ADDRESS='https://api.github.com/repos/koel/koel/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/koel/koel/archive/${version:-v4.4.0}.tar.gz" + local fallback_url='https://github.com/koel/koel/releases/download/v5.0.2/koel-v5.0.2.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/"browser_download_url": .*\/koel-[^"\/]*\.tar\.gz"/{print $4}')" # Reinstall: Clear previous install, but keep existing config file if [[ -d '/mnt/dietpi_userdata/koel' ]]; then @@ -5838,7 +5818,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_EXEC rm -R /mnt/dietpi_userdata/koel fi - mv koel-* /mnt/dietpi_userdata/koel + G_EXEC mv koel-* /mnt/dietpi_userdata/koel # Download external assets manually, not included in download archive: https://github.com/koel/koel/tree/master/resources # - NB: We pull master archive, but this might not match to Koel latest release. Requires testing, else we need to switch to git clone. @@ -5930,35 +5910,32 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- - If you need to reinstall (e.g. broken instance), please manually remove the install dir \"/opt/radarr\" and rerun \"dietpi-software reinstall $software_id\"." else - INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv6 if (( $G_HW_ARCH == 1 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux.tar.gz' # ARMv7 elif (( $G_HW_ARCH == 2 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-arm\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-arm.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-arm\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-arm.tar.gz' # ARMv8 elif (( $G_HW_ARCH == 3 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-arm64\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-arm64.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-arm64\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-arm64.tar.gz' # x86_64 elif (( $G_HW_ARCH == 10 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-x64\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-x64.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-x64\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-x64.tar.gz' fi - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" + Download_Install "$INSTALL_URL_ADDRESS" G_EXEC mv Radarr /opt/radarr fi fi @@ -5977,13 +5954,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else - INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - 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.2.1878/Lidarr.master.0.7.2.1878.linux.tar.gz' - - DEPS_LIST='mediainfo' - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt + DEPS_LIST='mediainfo' Download_Install "$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" '/"browser_download_url": .*linux\.tar\.gz"/{print $4}')" /opt fi @@ -6049,12 +6021,10 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing # Grab latest version download link - INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # - ARMv6: Requires Mono: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below - 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.17.50/Jackett.Binaries.Mono.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL 'https://api.github.com/repos/Jackett/Jackett/releases/latest' | mawk -F\" '/"browser_download_url": .*\/Jackett\.Binaries\.Mono\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.17.513/Jackett.Binaries.Mono.tar.gz' # - ARMv7 if (( $G_HW_ARCH == 2 )); then @@ -6094,18 +6064,17 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi fi - # Download: wget --spider/curl -IL return 403 - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt + Download_Install "$INSTALL_URL_ADDRESS" /opt # Move existing configs to unpacked install dir - [[ -d '/opt/jackett/Jackett' ]] && mv /opt/jackett/Jackett /opt/Jackett/ - [[ -d '/opt/jackett/.mono' ]] && mv /opt/jackett/.mono /opt/Jackett/ + [[ -d '/opt/jackett/Jackett' ]] && G_EXEC mv /opt/jackett/Jackett /opt/Jackett/ + [[ -d '/opt/jackett/.mono' ]] && G_EXEC mv /opt/jackett/.mono /opt/Jackett/ # Remove existing install dir - [[ -d '/opt/jackett' ]] && rm -R /opt/jackett + [[ -d '/opt/jackett' ]] && G_EXEC rm -R /opt/jackett # Move unpacked install dir in place - mv /opt/Jackett /opt/jackett + G_EXEC mv /opt/Jackett /opt/jackett fi @@ -6342,12 +6311,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Grab latest version from GitHub - INSTALL_URL_ADDRESS='https://api.github.com/repos/go-gitea/gitea/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # wget --spider fails on binary URL - # Binary + data dir - mkdir -p /mnt/dietpi_userdata/gitea/gitea-repositories + G_EXEC mkdir -p /mnt/dietpi_userdata/gitea/gitea-repositories # ARMv6 + ARMv7 since as of v1.8 there are issues with ARMv7 binaries on Raspbian which are hence not provided anymore: https://github.com/MichaIng/DietPi/issues/2959 (Troubleshooting) local arch='arm-6' @@ -6364,10 +6329,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi - 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" - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o /mnt/dietpi_userdata/gitea/gitea + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.13.2/gitea-1.13.2-linux-$arch" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | grep "\"browser_download_url\": .*/gitea-[^\"/]*-linux-$arch\"" | cut -d \" -f 4)" /mnt/dietpi_userdata/gitea/gitea fi @@ -6554,8 +6517,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u DEPS_LIST='cmake python3-minimal' # Download - local version=$(curl -sSfL https://api.github.com/repos/ptitSeb/box86/tags | mawk '/"name": /{print $4;exit}') - [[ $version ]] || version='v0.2.0' # Fallback + local version=$(curl -sSfL 'https://api.github.com/repos/ptitSeb/box86/tags' | mawk -F\" '/"name": /{print $4;exit}') + [[ $version ]] || { version='v0.2.0'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/ptitSeb/box86/archive/$version.tar.gz" # Build @@ -10238,10 +10201,8 @@ _EOF_ # Download latest easy-rsa from GitHub G_DIETPI-NOTIFY 2 'Downloading latest easy-rsa for certificate and key generation...' - INSTALL_URL_ADDRESS='https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" local fallback_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8.tgz' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '"browser_download_url.*EasyRSA-.*\.tgz' | cut -d \" -f 4)" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest' | mawk -F\" '/"browser_download_url": .*\/EasyRSA-[^"\/]*\.tgz"/{print $4}')" [[ -d '/etc/openvpn/easy-rsa' ]] && rm -R /etc/openvpn/easy-rsa G_EXEC mv EasyRSA-* /etc/openvpn/easy-rsa From ce87415bb4e30dee003c36919461579ac4594fcc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 16:53:12 +0100 Subject: [PATCH 115/218] v6.35 + CHANGELOG | DietPi-Update: A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 58dec1480b..d832329207 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.35 (2021-02-XX) Changes: +- DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 - DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. From e2d4c6ddd2dcdeebf400ce8e0e07d98a573f33e0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 17:53:27 +0100 Subject: [PATCH 116/218] v6.35 + DietPi-Update | Fix incremental patch file path --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 52007a8747..f08f581def 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -272,7 +272,7 @@ # - Remove patch_file rm /boot/dietpi/patch_file - if ! .update/patches; then + if ! "DietPi-$G_GITBRANCH/.update/patches"; then G_DIETPI-NOTIFY 1 "An error occured during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." exit 1 From 81d401b40a6e553fc909cbf7e99b288c8c972190 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 18:02:03 +0100 Subject: [PATCH 117/218] v6.35 + DietPi-Update | Apply execute permissions to patch file --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index f08f581def..8552ff9ceb 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -238,7 +238,7 @@ G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /boot/ G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. / - G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi + G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi DietPi-"$GITBRANCH_TARGET"/.update/patches # Save version + Git info now for sub scripts to pull from correct branch G_GITOWNER=$GITOWNER_TARGET From e2a928fa96e1c34a5b6d48c223765bc6347d3a5d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 18:07:56 +0100 Subject: [PATCH 118/218] v6.35 + DietPi-Patch | Loop until hardcoded v6.35 since this the last v6 subversion string. --- dietpi/patch_file | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 988e65d1ef..508411fbc7 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2764,8 +2764,6 @@ _EOF_ G_AGA # - Reload systemd systemctl daemon-reload - # - Exit loop - FINISHED=1 #------------------------------------------------------------------------------- fi @@ -2774,10 +2772,9 @@ _EOF_ #------------------------------------------------------------------------------- # Apply subversion patches incrementally - FINISHED=0 # Store RC version "0" during incremental patching. DietPi-Update applies final RC version afterwards. G_DIETPI_VERSION_RC=0 - until (( $FINISHED )) + until (( $G_DIETPI_VERSION_SUB == 35 )) do G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB to $G_DIETPI_VERSION_CORE.$(( $G_DIETPI_VERSION_SUB + 1 ))" Subversion_Patch || exit 1 From 5fc024de0f85b7abc3f5997f6fd507cf3ce24409 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 18:09:09 +0100 Subject: [PATCH 119/218] v6.35 + DietPi-Patch | Failsafe: If for some reason the v6 subversion is >35, exit loop as well --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 508411fbc7..ef2ec749e4 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2774,7 +2774,7 @@ _EOF_ # Apply subversion patches incrementally # Store RC version "0" during incremental patching. DietPi-Update applies final RC version afterwards. G_DIETPI_VERSION_RC=0 - until (( $G_DIETPI_VERSION_SUB == 35 )) + until (( $G_DIETPI_VERSION_SUB > 34 )) do G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB to $G_DIETPI_VERSION_CORE.$(( $G_DIETPI_VERSION_SUB + 1 ))" Subversion_Patch || exit 1 From 90426ab94cc5aeb6a11c5055c71f67c7e6a2ab59 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 18:13:06 +0100 Subject: [PATCH 120/218] v6.35 + DietPi-Survey_report | Add DietPi v7.0 support, matching DietPi v6.35 transition version string --- .meta/dietpi-survey_report | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index a942b82164..8b051fd2b3 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -484,6 +484,13 @@ # shellcheck disable=SC2034 aSOFTWARE_NAME6_35[137]='mjpg-streamer' + # v7.0 (identical to v6.35 transition version) + aSOFTWARE_NAME7_0=() + for i in "${!aSOFTWARE_NAME6_35[@]}" + do + aSOFTWARE_NAME7_0[$i]=${aSOFTWARE_NAME6_35[$i]} + done + Main(){ # Copy files to RAM to speed up sourcing From 660c3e320f392f8edc5ef0077f75ed8ab0e3c23a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Feb 2021 18:18:48 +0100 Subject: [PATCH 121/218] v6.35 + DietPi-Survey_report | Satisfy shellcheck --- .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 8b051fd2b3..26ce4bc024 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -481,13 +481,13 @@ done aSOFTWARE_NAME6_35[62]='Box86' aSOFTWARE_NAME6_35[134]='Docker Compose' - # shellcheck disable=SC2034 aSOFTWARE_NAME6_35[137]='mjpg-streamer' # v7.0 (identical to v6.35 transition version) aSOFTWARE_NAME7_0=() for i in "${!aSOFTWARE_NAME6_35[@]}" do + # shellcheck disable=SC2034 aSOFTWARE_NAME7_0[$i]=${aSOFTWARE_NAME6_35[$i]} done From 5182674f408d0e4715ae937388f340cd1d11301c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 13:30:54 +0100 Subject: [PATCH 122/218] v6.35 + DietPi-Survey_report | Do not trust negative CPU temperatures (for now) and time or bandwidth results of zero (usually an error during benchmark) to reduce benchmark results distortion. + DietPi-Survey_report | Eliminate the need for a hardcoded first min/max benchmark value by using the first individual result instead, being simply correct. --- .meta/dietpi-survey_report | 125 ++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index a942b82164..c83d7a2002 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -321,7 +321,7 @@ aSOFTWARE_NAME[145]='Radarr' aSOFTWARE_NAME[146]='Tautulli' aSOFTWARE_NAME[147]='Jackett' - aSOFTWARE_NAME[148]=148 + #aSOFTWARE_NAME[148]= aSOFTWARE_NAME[149]='NZBGet' aSOFTWARE_NAME[150]='Mono' aSOFTWARE_NAME[151]='Nvidia' @@ -341,7 +341,7 @@ aSOFTWARE_NAME[165]='Gitea' aSOFTWARE_NAME[166]='PI-SPC' aSOFTWARE_NAME[167]='Raspotify' - aSOFTWARE_NAME[168]=168 + #aSOFTWARE_NAME[168]= aSOFTWARE_NAME[169]='Google AIY' # v6.14 (earliest version that can currently upload) + v6.15 @@ -409,8 +409,8 @@ do aSOFTWARE_NAME6_26[$i]=${aSOFTWARE_NAME6_25[$i]} done - aSOFTWARE_NAME6_26[27]=27 # TightVNC: Replaced by TigerVNC on Stretch+ - aSOFTWARE_NAME6_26[140]=140 # SDL2: Merged into Amiberry for targeted minimal install + unset -v aSOFTWARE_NAME6_26[27] # TightVNC: Replaced by TigerVNC on Stretch+ + unset -v aSOFTWARE_NAME6_26[140] # SDL2: Merged into Amiberry for targeted minimal install # v6.27 @@ -464,9 +464,9 @@ do aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} done - aSOFTWARE_NAME6_34[62]=62 # DietPi-CloudShell - aSOFTWARE_NAME6_34[134]=134 # Tonido - aSOFTWARE_NAME6_34[137]=137 # CloudPrint + unset -v aSOFTWARE_NAME6_34[62] # DietPi-CloudShell + unset -v aSOFTWARE_NAME6_34[134] # Tonido + unset -v aSOFTWARE_NAME6_34[137] # CloudPrint aSOFTWARE_NAME6_34[181]='PaperMC' aSOFTWARE_NAME6_34[182]='Unbound' aSOFTWARE_NAME6_34[183]='Bitwarden_RS' @@ -516,7 +516,7 @@ # 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 + if [[ $BENCH_CPU =~ ^[0-9]*[1-9][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 @@ -534,7 +534,7 @@ # - 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 + if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_ROOTFS_READ =~ ^[0-9]*[1-9][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 @@ -547,7 +547,7 @@ # - 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 + if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_RAM_READ =~ ^[0-9]*[1-9][0-9]*$ ]] && (( $BENCH_VERSION > 1 )); 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 @@ -559,7 +559,7 @@ # - 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 + if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]*[1-9][0-9]*$ ]]; 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 @@ -570,7 +570,7 @@ # LAN # - Remove decimal places BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%%.*} - if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then + if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]*[1-9][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]++)) @@ -624,35 +624,34 @@ # Process all results, for later use in HTML printout # - NB: HW_MODEL array based - local default_min_value=100000 # CPU for i in "${!aBENCH_CPU_INDEX[@]}" do - aBENCH_RESULT_CPU_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_MAX[$i]=0 - aBENCH_RESULT_CPU_AVG[$i]=0 - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=0 - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=0 - aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=0 - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=0 + aBENCH_RESULT_CPU_MIN[$i]= + aBENCH_RESULT_CPU_MAX[$i]= + aBENCH_RESULT_CPU_AVG[$i]= + aBENCH_RESULT_CPU_TEMP_START_MIN[$i]= + aBENCH_RESULT_CPU_TEMP_START_MAX[$i]= + aBENCH_RESULT_CPU_TEMP_START_AVG[$i]= + aBENCH_RESULT_CPU_TEMP_END_MIN[$i]= + aBENCH_RESULT_CPU_TEMP_END_MAX[$i]= + aBENCH_RESULT_CPU_TEMP_END_AVG[$i]= for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - (( ${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_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]:=${aBENCH_CPU[$i,$j]}} )) && aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} + (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]:=${aBENCH_CPU[$i,$j]}} )) && aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} (( aBENCH_RESULT_CPU_AVG[$i] += ${aBENCH_CPU[$i,$j]} )) - (( ${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_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]:=${aBENCH_CPU_TEMP_START[$i,$j]}} )) && 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_CPU_TEMP_START[$i,$j]}} )) && 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]} )) - (( ${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_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]:=${aBENCH_CPU_TEMP_END[$i,$j]}} )) && 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_CPU_TEMP_END[$i,$j]}} )) && 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 @@ -672,22 +671,22 @@ for i in "${!aBENCH_ROOTFS_INDEX[@]}" do - aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=0 - aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=0 - aBENCH_RESULT_ROOTFS_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_ROOTFS_READ_MAX[$i]=0 - aBENCH_RESULT_ROOTFS_READ_AVG[$i]=0 + aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]= + aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]= + aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]= + aBENCH_RESULT_ROOTFS_READ_MIN[$i]= + aBENCH_RESULT_ROOTFS_READ_MAX[$i]= + aBENCH_RESULT_ROOTFS_READ_AVG[$i]= for (( j=0; j<${aBENCH_ROOTFS_INDEX[$i]}; j++ )) do - (( ${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_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]:=${aBENCH_ROOTFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]:=${aBENCH_ROOTFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) - (( ${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_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]:=${aBENCH_ROOTFS_READ[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]:=${aBENCH_ROOTFS_READ[$i,$j]}} )) && 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 @@ -703,22 +702,22 @@ for i in "${!aBENCH_RAM_INDEX[@]}" do - aBENCH_RESULT_RAM_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_RAM_WRITE_MAX[$i]=0 - aBENCH_RESULT_RAM_WRITE_AVG[$i]=0 - aBENCH_RESULT_RAM_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_RAM_READ_MAX[$i]=0 - aBENCH_RESULT_RAM_READ_AVG[$i]=0 + aBENCH_RESULT_RAM_WRITE_MIN[$i]= + aBENCH_RESULT_RAM_WRITE_MAX[$i]= + aBENCH_RESULT_RAM_WRITE_AVG[$i]= + aBENCH_RESULT_RAM_READ_MIN[$i]= + aBENCH_RESULT_RAM_READ_MAX[$i]= + aBENCH_RESULT_RAM_READ_AVG[$i]= for (( j=0; j<${aBENCH_RAM_INDEX[$i]}; j++ )) do - (( ${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_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]:=${aBENCH_RAM_WRITE[$i,$j]}} )) && aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} + (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]:=${aBENCH_RAM_WRITE[$i,$j]}} )) && aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - (( ${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_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]:=${aBENCH_RAM_READ[$i,$j]}} )) && aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} + (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]:=${aBENCH_RAM_READ[$i,$j]}} )) && 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 @@ -734,15 +733,15 @@ for i in "${!aBENCH_LAN_INDEX[@]}" do - aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=$default_min_value - aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=0 - aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]=0 + aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]= + aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]= + aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]= for (( j=0; j<${aBENCH_LAN_INDEX[$i]}; j++ )) do - (( ${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_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]:=${aBENCH_NET_LAN_SPEED[$i,$j]}} )) && 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_NET_LAN_SPEED[$i,$j]}} )) && 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 @@ -757,22 +756,22 @@ for i in "${!aBENCH_CUSTOMFS_INDEX[@]}" do - aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 - aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 - aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 - aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 + aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]= + aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]= + aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]= + aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]= + aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]= + aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]= for (( j=0; j<${aBENCH_CUSTOMFS_INDEX[$i]}; j++ )) do - (( ${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_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]:=${aBENCH_CUSTOMFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]:=${aBENCH_CUSTOMFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} (( aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i] += ${aBENCH_CUSTOMFS_WRITE[$i,$j]} )) - (( ${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_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]:=${aBENCH_CUSTOMFS_READ[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]:=${aBENCH_CUSTOMFS_READ[$i,$j]}} )) && 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 From 618a6bc1501ccaa3711ef50498f4dafe20ab3413 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 19:10:16 +0100 Subject: [PATCH 123/218] v6.35 + DietPi-Update | Move APT auto-removal and systemd unit reload after incremental patches from patch file to main script, since we currently handle it as mandatory step anyway. --- dietpi/dietpi-update | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 8552ff9ceb..48554745d4 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -253,8 +253,10 @@ fi - # Failsafe: Sync changes to disk + # Failsafe: Force sync to disk sync + + # Reload systemd units systemctl daemon-reload G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying incremental patches' @@ -279,6 +281,10 @@ fi + # Autoremove possibly obsolete DEB packages and reload systemd units + G_AGA + systemctl daemon-reload + G_DIETPI_VERSION_CORE=$G_REMOTE_VERSION_CORE G_DIETPI_VERSION_SUB=$G_REMOTE_VERSION_SUB G_DIETPI_VERSION_RC=$G_REMOTE_VERSION_RC From 47f62d947199b370e9a4735e1d80a8d40466bfe4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 19:12:28 +0100 Subject: [PATCH 124/218] v6.35 + DietPi-Patch | APT auto-removal and systemd unit reload is now done within dietpi-update parent script. --- dietpi/patch_file | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index ef2ec749e4..c559c53db1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2751,8 +2751,7 @@ _EOF_ # Remove obsolete directory [[ -d '/var/lib/dietpi/dietpi-software/services' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /var/lib/dietpi/dietpi-software/services #------------------------------------------------------------------------------- - # Last subversion patch completed - # - Apply reinstalls + # Last subversion patch completed: Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] then # Coders NB: Assigning to array is not easily possible here since we need to split at newline AND space. @@ -2760,10 +2759,6 @@ _EOF_ (( $G_DIETPI_INSTALL_STAGE == 2 )) && { /boot/dietpi/dietpi-software reinstall $( Date: Sun, 14 Feb 2021 19:35:01 +0100 Subject: [PATCH 125/218] v6.35 + DietPi-Update | After three years, remove the DietPi pre-v6 version file. This means that these DietPi systems won't see a "new image available" message, indicating that a new image needs to be flashed, but the update check will fail instead, which practically the same can be derived from. --- dietpi/server_version | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 dietpi/server_version diff --git a/dietpi/server_version b/dietpi/server_version deleted file mode 100644 index c76772f8fe..0000000000 --- a/dietpi/server_version +++ /dev/null @@ -1,2 +0,0 @@ -160 -6 From 50a7aedf7c9978dfafad0ee88948e207bcbed12c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 19:40:35 +0100 Subject: [PATCH 126/218] v6.35 + DietPi-Update | "DietPi-$GITBRANCH_TARGET/dietpi/server_version" does not exist anymore on v7 branches --- dietpi/dietpi-update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 48554745d4..8e6ae1ef98 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -234,11 +234,11 @@ rm "$GITBRANCH_TARGET.tar.gz" # Remove files from Git archive that are not to be installed on client - rm DietPi-"$GITBRANCH_TARGET"/dietpi/{pre-patch_file,server_version*} + rm "DietPi-$GITBRANCH_TARGET/dietpi/"{pre-patch_file,server_version-6} - G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /boot/ - G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. / - G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi DietPi-"$GITBRANCH_TARGET"/.update/patches + G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/dietpi" /boot/ + G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/rootfs/." / + G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi "DietPi-$GITBRANCH_TARGET/.update/patches" # Save version + Git info now for sub scripts to pull from correct branch G_GITOWNER=$GITOWNER_TARGET From 4b578794940b89459b4f2c699fa1e4f2562abad7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 21:39:48 +0100 Subject: [PATCH 127/218] v6.35 + CHANGELOG | Typo --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d832329207..05cb5bdb9a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -76,7 +76,7 @@ New Software Packages: Removed Software Packages: - DietPi-Software | DietPi-CloudShell: The install option has been removed, but DietPi-CloudShell stays available of course. The install did nothing else than creating the service file and enabling the autostart option, but the script was always available and did work well without having the software option installed. The service is now as well available statically, the script can always be started from console via "dietpi-cloudshell" shortcut alias now and is shown in dietpi-launcher. Also non-root users can run now run it via "dietpi-cloudshell 1" (with intro) or "dietpi-cloudshell 2" (no intro), only changing the settings via menu (no command argument) requires root permissions. - DietPi-Software | CloudPrint: This software option has been removed, since the Google Cloud Print service will be shut down at the end of 2020 and we don't want to offer software options which will work for at most two months. Please migrate to another printing solution in time. Already installed CloudPrint instances will remain installed and the system service remains functional until the end of the year. With the first DietPi release in 2021 we will remove service handling and offer the package removal during the update process. Further information can be found here: https://www.google.com/cloudprint/learn/ -- DietPi-Software | Tonido: This software option has been removed, since it is not developed anymore fore three years, no sources have been found and the latest binaries require ancient library versions which fail to be easily installed on currently supported Debian versions. +- DietPi-Software | Tonido: This software option has been removed, since it is not developed anymore for three years, no sources have been found and the latest binaries require ancient library versions which fail to be easily installed on currently supported Debian versions. Bug Fixes: - DietPi-Config | Resolved an issue on RPi where the onboard 3.5mm jack selection did not work if an HDMI screen was attached. When selecting explicit either HDMI audio or onboard 3.5mm jack, the other one is now disabled on device tree level, which means it cannot be switched without reboot. This is currently the only known way to assure that 3.5mm jack is used for audio output regardless of now or later attached or detached HDMI screens. Many thanks to @corasaniti for reporting this issue: https://github.com/MichaIng/DietPi/issues/3887 From 195f29dbc063e92b12e0fd0e5ac92ac7561f65f7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 22:13:53 +0100 Subject: [PATCH 128/218] v6.35 + DietPi-Cron_daily | Remove MOTD file and re-create it only when the download succeeds --- rootfs/etc/cron.daily/dietpi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index 5ab033ed16..1196b44ce1 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -38,7 +38,8 @@ # Refresh DietPi MOTD if [[ -f '/boot/dietpi/.dietpi-banner' ]] && grep -q '^[[:blank:]]*aENABLED\[12\]=1' /boot/dietpi/.dietpi-banner then - curl -sSfL https://dietpi.com/motd > /run/dietpi/.dietpi_motd + [[ -f '/run/dietpi/.dietpi_motd' ]] && rm /run/dietpi/.dietpi_motd + curl -sSfL https://dietpi.com/motd -o /run/dietpi/.dietpi_motd fi #---------------------------------------------------------------- # DietPi-Sync daily From 9d7080ffdab033048cfb09e61901c9db0cbd63fe Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 22:24:23 +0100 Subject: [PATCH 129/218] v6.35 + DietPi-Banner | Make the menu the default input argument, so it can be made a console alias reasonably. This means that without input argument, the banner won't be printed anymore, but "0" is required explicitly. --- 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 575d4f7fa6..80c3d75255 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -13,13 +13,13 @@ # - Checks /run/dietpi/.update_available, /run/dietpi/.apt_updates, /run/dietpi/.network, /run/dietpi/.dietpi_motd and /boot/dietpi/.prep_info # # Usage: + # - dietpi-banner = banner customisation menu # - dietpi-banner 0 = top section + LAN IP # - dietpi-banner 1 = clear terminal + top section + chosen entries + credits - # - dietpi-banner 2 = banner customisation menu #//////////////////////////////////// # Grab input - [[ $1 == [12] ]] && INPUT=$1 || INPUT=0 + [[ $1 == [01] ]] && INPUT=$1 || INPUT=2 # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals From a4e944b1d1d61cda7bb0a690b0c6604be041af5b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 22:47:02 +0100 Subject: [PATCH 130/218] v6.35 + DietPi-Banner | Allow 3 seconds for network connections + DietPi-Banner | Create MOTD file only in case of download success, so we don't need to assume a failure when it's empty, which simplifies the checks. In turn we can leave it empty intentionally to have the banner line skipped. --- dietpi/func/dietpi-banner | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 80c3d75255..7a125a5b4e 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -205,7 +205,7 @@ $GREEN_LINE" # LAN IP [5] Print_Local_Ip # WAN IP + location info: Move this to /run/dietpi/.network? - (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://ifconfig.co/json 2>&1 | mawk -F\" '/"ip"/{o=$4}/"country"/{c=$4}/"region_name"/{c=$4"-"c}END{if(c){o=o" "c}if(o){print o;exit}{print}}')" + (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 3 https://ifconfig.co/json 2>&1 | mawk -F\" '/"ip"/{o=$4}/"country"/{c=$4}/"region_name"/{c=$4"-"c}END{if(c){o=o" "c}if(o){print o;exit}{print}}')" # DietPi-NordVPN connection status (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/boot/dietpi/misc/dietpi-nordvpn status 2>&1)" # Freespace (RootFS) @@ -213,28 +213,15 @@ $GREEN_LINE" # Freespace (DietPi userdata) (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # Weather - (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://wttr.in/?format=4 2>&1)" + (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 https://wttr.in/?format=4 2>&1)" # Custom [[ ${aENABLED[10]} == 1 && -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" # MOTD if (( ${aENABLED[12]} == 1 )); then local motd fp_motd='/run/dietpi/.dietpi_motd' - # shellcheck disable=SC2015 - [[ -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 - - echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" - - elif [[ -w $fp_motd ]]; then - - rm $fp_motd - - fi - - fi + [[ -f $fp_motd ]] || curl -sSfLm 3 https://dietpi.com/motd -o $fp_motd + [[ -f $fp_motd ]] && . $fp_motd &> /dev/null && [[ $motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" fi echo -e "$GREEN_LINE\n" From ffd9ab1cb0da2ccfd0fb5905ac4fb780ee326336 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 22:49:53 +0100 Subject: [PATCH 131/218] v6.35 + DietPi-Bash | Update dietpi-banner alias: Without an input argument, it opens the menu now, so using "dietpi-banner 0" or "dietpi-banner 1" can now be used to print the banner. --- rootfs/etc/bashrc.d/dietpi.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index b92f243b7f..eb00034ae5 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -41,7 +41,7 @@ alias dietpi-logclear='/boot/dietpi/func/dietpi-logclear' alias dietpi-survey='/boot/dietpi/dietpi-survey' alias dietpi-explorer='/boot/dietpi/dietpi-explorer' - alias dietpi-banner='/boot/dietpi/func/dietpi-banner 2' + alias dietpi-banner='/boot/dietpi/func/dietpi-banner' alias dietpi-justboom='/boot/dietpi/misc/dietpi-justboom' alias dietpi-led_control='/boot/dietpi/dietpi-led_control' alias dietpi-wifidb='/boot/dietpi/func/dietpi-wifidb' From 6a643916bf71194b0336d6445933de3c19a2e620 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 22:55:18 +0100 Subject: [PATCH 132/218] v6.35 + DietPi-Bash | Fix wrong OpenTyrian alias --- rootfs/etc/bashrc.d/dietpi.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index eb00034ae5..0bb2a6e6c1 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -52,7 +52,7 @@ # - Optional DietPi software aliases [[ -d '/mnt/dietpi_userdata/sonarr' || -d '/mnt/dietpi_userdata/radarr' || -d '/mnt/dietpi_userdata/lidarr' ]] && alias dietpi-arr_to_RAM='/boot/dietpi/misc/dietpi-arr_to_RAM' command -v kodi > /dev/null && alias startkodi='/boot/dietpi/misc/start_kodi' - [[ -f '/usr/local/games/opentyrian/run' ]] && alias opentyrian='/usr/local/games/opentyrian/run' + [[ -f '/usr/games/opentyrian/run' ]] && alias opentyrian='/usr/games/opentyrian/run' [[ -f '/mnt/dietpi_userdata/dxx-rebirth/run.sh' ]] && alias dxx-rebirth='/mnt/dietpi_userdata/dxx-rebirth/run.sh' # - 1337 moments ;) alias 1337='echo Indeed, you are =\)' From 4b64abbd2f5487d21b0f778108edb4928cd1d73e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 23:02:05 +0100 Subject: [PATCH 133/218] v6.35 + CHANGELOG | DietPi-Banner: Running the script without input argument will now open the menu instead of printing the banner. The console alias has been adjusted accordingly, so that it is now possible to run "dietpi-banner 0" and "dietpi-banner 1" from console to have full and short banner versions printed. The "dietpi-banner" console command remains opening the menu. --- CHANGELOG.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 05cb5bdb9a..7bd93f53ee 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,9 @@ Changes: - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 +Interface Changes: +- DietPi-Banner | Running the script without input argument will now open the menu instead of printing the banner. The console alias has been adjusted accordingly, so that it is now possible to run "dietpi-banner 0" and "dietpi-banner 1" from console to have full and short banner versions printed. The "dietpi-banner" console command remains opening the menu. + New Software: - DietPi-Software | Docker Compose: A tool to define and run multi-container Docker applications can now be installed through our software selection. Docker will be pulled in as dependency automatically. - DietPi-Software | Box86: An x86 wrapper/emulator for ARMv7 systems is now available for install. Thanks to it's ability to wrap ARMv7 shared system libraries to be used with i386 binaries, often no additional libraries need to be installed. Thanks to binfmt, it will be invoked automatically when an i386 binary is executed. From fbe68c83954598795dd3fb80d722e54f341ee209 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 23:05:01 +0100 Subject: [PATCH 134/218] v7.0 + Use RC version "-1" before releasing the first beta, as before --- .update/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/version b/.update/version index 0981a0672d..e462abba26 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=7 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=0 +G_REMOTE_VERSION_RC=-1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=-1 From 2a52bb85d3fc9f075b13c06b0b51179ea5e50226 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Feb 2021 23:05:40 +0100 Subject: [PATCH 135/218] v7.0 + DietPi-Globals | Default core up --- 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 f081fd5c33..0d0922b596 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -64,8 +64,8 @@ # DietPi version and Git branch [[ -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=35 + [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' From 4171e1d3f66466339a9250e24ccea1ea2d6c0eb4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 12:49:35 +0100 Subject: [PATCH 136/218] v7.0 + DietPi-Drive_Manager | Change comment in fstab to indicate that dietpi-drive_manager is not a must, but an offer, and that it overwrites and re-creates physical drive mount entries on use + DietPi-Drive_Manager | Append df/blkid/lsblk outputs to detection loops directly: It creates a temporary file as well, but assures a unique safe path and auto-removal in a native way, faster as well. + DietPi-Drive_Manager | Add /dev/root workaround right into df output pipe to let mawk handle the possibly left duplicate --- dietpi/dietpi-drive_manager | 47 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index f40903a4ac..971f5af5fb 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -126,7 +126,8 @@ tmpfs /var/log tmpfs size=${var_log_size:-50}M,noatime,lazytime,nodev,nosuid,mod fi - echo "# Please use \"dietpi-drive_manager\" to setup mounts + echo "# You can use \"dietpi-drive_manager\" to setup mounts. +# NB: It overwrites and re-creates physical drive mount entries on use. #---------------------------------------------------------------- # NETWORK #---------------------------------------------------------------- @@ -151,21 +152,16 @@ $swap_mounts # PHYSICAL DRIVES #----------------------------------------------------------------" > $fp_fstab_tmp - # Detect mounted drives G_DIETPI-NOTIFY 2 'Detecting drives, please wait...' + + # Detect mounted drives via df # - Exclude special treated fs types: tmpfs, ecryptfs, vboxsf, glusterfs + # - Workaround for /dev/root on RPi: Replace with actual device path $G_ROOTFS_DEV # - Only detect mounts with "/" in source path, which excludes other special/pseudo fs types - # - Remove duplicates, which excludes bind mounts: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-417413867 - 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 - # shellcheck disable=SC2094 + # - Remove duplicates, e.g. from bind mounts and due to /dev/root conversion: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-417413867 while read -r line do - # Workaround for /dev/root under RPi, force physical location - [[ $line == '/dev/root' ]] && { grep -q "^$G_ROOTFS_DEV$" .df_out_tmp && continue || line=$G_ROOTFS_DEV; } - Init_New_Device aDRIVE_ISMOUNTED[$index]=1 @@ -270,11 +266,9 @@ $swap_mounts fi - done < .df_out_tmp - rm .df_out_tmp + done < <(df -a --output=source --exclude-type=tmpfs --exclude-type=ecryptfs --exclude-type=vboxsf --exclude-type=glusterfs | sed "\|^/dev/root$|c$G_ROOTFS_DEV" | mawk '/\// && !x[$0]++') # Check blkid for unmounted drives, if drive is not mounted, add entry as disabled/commented mount - blkid -o device > .blkid_out_tmp while read -r line do @@ -283,9 +277,7 @@ $swap_mounts # Exclude drives already found for i in "${aDRIVE_MOUNT_SOURCE[@]}" do - - [[ $i == $line* ]] && continue 2 - + [[ $i == "$line"* ]] && continue 2 done # Must have a valid UUID! (this excludes /dev/mmcblk0) @@ -311,12 +303,10 @@ $swap_mounts echo "#UUID=${aDRIVE_UUID[$index]} ${aDRIVE_MOUNT_TARGET[$index]} ${type:-auto} noatime,lazytime,rw,nofail,noauto,x-systemd.automount" >> $fp_fstab_tmp - done < .blkid_out_tmp - rm .blkid_out_tmp + done < <(blkid -o device) # 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 -r line do @@ -325,9 +315,7 @@ $swap_mounts # Exclude drives already found for i in "${aDRIVE_SOURCE_DEVICE[@]}" do - [[ $line == $i* ]] && continue 2 - done G_DIETPI-NOTIFY 2 " - Detected unformated drive: /dev/$line" @@ -338,8 +326,7 @@ $swap_mounts aDRIVE_MOUNT_TARGET[$index]="/tmp/$line" aDRIVE_SOURCE_DEVICE[$index]=$line - done < .lsblk_out_tmp - rm .lsblk_out_tmp + done < <(lsblk -nro NAME | sed '/^mtdblock[0-9]/d') # Set required global flags and deps for all drives found for i in "${!aDRIVE_MOUNT_SOURCE[@]}" @@ -371,7 +358,6 @@ $swap_mounts G_DIETPI-NOTIFY 0 'DEBUG INFO:' for i in "${!aDRIVE_MOUNT_SOURCE[@]}" do - G_DIETPI-NOTIFY 0 "Index=$i aDRIVE_UUID ${aDRIVE_UUID[$i]} aDRIVE_PART_UUID ${aDRIVE_PART_UUID[$i]} @@ -422,15 +408,10 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} local i [[ $MENU_DRIVE_TARGET ]] && for i in "${!aDRIVE_MOUNT_TARGET[@]}" do - - if [[ $MENU_DRIVE_TARGET == "${aDRIVE_MOUNT_TARGET[$i]}" ]]; then - - MENU_DRIVE_INDEX=$i - [[ $G_DEBUG == 1 ]] && echo "[DEBUG$i] EDIT | ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} | ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]} | ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}" - break - - fi - + [[ $MENU_DRIVE_TARGET == "${aDRIVE_MOUNT_TARGET[$i]}" ]] || continue + MENU_DRIVE_INDEX=$i + [[ $G_DEBUG == 1 ]] && echo "[DEBUG$i] EDIT | ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} | ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]} | ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}" + break done } From c0de0453aed82c89f5f8551b28cbb01219ebe482 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 20:00:02 +0100 Subject: [PATCH 137/218] v7.0 + DietPi-Software | Nextcloud v21: Redirect webfinger and nodeinfo requests to Nextcloud endpoint --- .conf/dps_114/apache.nextcloud.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 149fb4abff..3ce8483328 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -5,7 +5,11 @@ Redirect permanent /ocm-provider /nextcloud/ocm-provider Redirect permanent /ocs-provider /nextcloud/ocs-provider - +# Redirect webfinger and nodeinfo requests to Nextcloud endpoint +Redirect permanent /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger +Redirect permanent /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo + + Require all granted AllowOverride All Options FollowSymLinks From 4d784049d9bbbe5dc5ccc7bd4e82a022a2380044 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 20:01:41 +0100 Subject: [PATCH 138/218] v7.0 + DietPi-Software | Nextcloud v21: Redirect webfinger and nodeinfo requests to Nextcloud endpoint to mute admin panel warnings --- .conf/dps_114/lighttpd.nextcloud.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index 4010b05ffc..b91ae51176 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -5,7 +5,9 @@ # Redirect OCM/OCS provider requests to Nextcloud endpoint: url.redirect += ( "^/ocm-provider" => "/nextcloud/ocm-provider", - "^/ocs-provider" => "/nextcloud/ocs-provider" + "^/ocs-provider" => "/nextcloud/ocs-provider", + "^/.well-known/webfinger" => "/nextcloud/index.php/.well-known/webfinger", + "^/.well-known/nodeinfo" => "/nextcloud/index.php/.well-known/nodeinfo" ) $HTTP["url"] =~ "^/nextcloud($|/)" { From cd4b0242c40e74fefa4f754c5b162b46cad44e63 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 20:56:54 +0100 Subject: [PATCH 139/218] v7.0 + DietPi-Software | Nextcloud: Update Nginx config based on enhanced config from Nextcloud docs. Redirect webfinger and nodeinfo requests to Nextcloud endpoint to mute admin panel warnings and remove obsolete OCM/OCS provider redirects --- .conf/dps_114/nginx.nextcloud.conf | 107 +++++++++++++++-------------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index 7c2fd9396b..150c3e859a 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -1,25 +1,12 @@ -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx +# Based on: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/nginx.rst#nextcloud-in-a-subdir-of-the-nginx-webroot -# Redirect OCM/OCS provider requests to Nextcloud endpoint: -location ~ ^\/(?:ocm-provider|ocs-provider).* { - rewrite ^ /nextcloud$request_uri; +# Redirect webfinger and nodeinfo requests to Nextcloud endpoint +location ~ ^/\.well-known/(?:webfinger|nodeinfo) { + return 301 /nextcloud/index.php$request_uri; } location ^~ /nextcloud { - # Add headers to serve security related headers - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; - add_header Referrer-Policy "no-referrer" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Download-Options "noopen" always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Robots-Tag "none" always; - add_header X-XSS-Protection "1; mode=block" always; - - # Remove X-Powered-By, which is an information leak - fastcgi_hide_header X-Powered-By; - # Set max upload size client_max_body_size 1048576M; fastcgi_buffers 64 4K; @@ -32,22 +19,51 @@ location ^~ /nextcloud { gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; - # Uncomment if your server is build with the ngx_pagespeed module - # This module is currently not supported. + # Pagespeed is not supported by Nextcloud, so if your server is built + # with the `ngx_pagespeed` module, uncomment this line to disable it. #pagespeed off; - location /nextcloud { - rewrite ^ /nextcloud/index.php; - } + # HTTP response headers borrowed from Nextcloud `.htaccess` + #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "none" always; + add_header X-XSS-Protection "1; mode=block" always; - location ~ ^\/nextcloud\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { - deny all; - } - location ~ ^\/nextcloud\/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri` + # here as the fallback means that Nginx always exhibits the desired behaviour + # when a client requests a path that corresponds to a directory that exists + # on the server. In particular, if that directory contains an index.php file, + # that file is correctly served; if it doesn't, then the request is passed to + # the front-end controller. This consistent behaviour means that we don't need + # to specify custom rules for certain paths (e.g. images and other assets, + # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus + # `try_files $uri $uri/ /nextcloud/index.php$request_uri` + # always provides the desired behaviour. + index index.php index.html /nextcloud/index.php$request_uri; + + # Rule borrowed from `.htaccess` to handle Microsoft DAV clients + location = /nextcloud { + if ( $http_user_agent ~ ^DavClnt ) { + return 302 /nextcloud/remote.php/webdav/$is_args$args; + } } - location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) { + # Rules borrowed from `.htaccess` to hide certain paths from clients + location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } + location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } + + # Ensure this block, which passes PHP files to the PHP process, is above the blocks + # which handle static assets (as seen below). If this block is not declared first, + # then Nginx will encounter an infinite rewriting loop when it prepends + # `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response. + location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; @@ -60,36 +76,21 @@ location ^~ /nextcloud { fastcgi_pass php; fastcgi_intercept_errors on; fastcgi_request_buffering off; - } - - location ~ ^\/nextcloud\/(?:updater|oc[ms]-provider)(?:$|\/) { - try_files $uri/ =404; - index index.php; } - # Adding the cache control header for js and css files - # Make sure it is BELOW the PHP block - location ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { + location ~ \.(?:css|js|svg|gif)$ { try_files $uri /nextcloud/index.php$request_uri; - add_header Cache-Control "public, max-age=15778463"; - # Add headers to serve security related headers (It is intended - # to have those duplicated to the ones above) - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; - add_header Referrer-Policy "no-referrer" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Download-Options "noopen" always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Robots-Tag "none" always; - add_header X-XSS-Protection "1; mode=block" always; - - # Optional: Don't log access to assets - access_log off; + expires 6M; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location ~ ^\/nextcloud\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg)$ { + location ~ \.woff2?$ { try_files $uri /nextcloud/index.php$request_uri; - # Optional: Don't log access to other assets - access_log off; + expires 7d; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets + } + + location /nextcloud { + try_files $uri $uri/ /nextcloud/index.php$request_uri; } } From 64aa8f8af256d85fa370e05c92297fe6552d72a6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 20:59:02 +0100 Subject: [PATCH 140/218] v7.0 + DietPi-Software | Nextcloud: Remove obsolete OCM/OCS provider redirects --- .conf/dps_114/apache.nextcloud.conf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 3ce8483328..f129493b4a 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -1,9 +1,5 @@ # Location: /etc/apache2/sites-available/dietpi-nextcloud.conf -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration - -# Redirect OCM/OCS provider requests to Nextcloud endpoint -Redirect permanent /ocm-provider /nextcloud/ocm-provider -Redirect permanent /ocs-provider /nextcloud/ocs-provider +# Based on: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/source_installation.rst#apache-web-server-configuration # Redirect webfinger and nodeinfo requests to Nextcloud endpoint Redirect permanent /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger From e8e23514ea711ce3f351365ae09680c3efba8b1f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 21:29:01 +0100 Subject: [PATCH 141/218] v7.0 + DietPi-Software | Nextcloud: Update Lighttpd config based on Nginx config updates. Test applying security headers for whole location and pass the "modHeadersAvailable" to PHP to avoid doubled headers. --- .conf/dps_114/lighttpd.nextcloud.conf | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index b91ae51176..9d0da7ce36 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -1,17 +1,29 @@ # Derived from: # - Apache: https://github.com/nextcloud/server/blob/master/.htaccess -# - Nginx: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# - Nginx: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/nginx.rst#nextcloud-in-a-subdir-of-the-nginx-webroot # Redirect OCM/OCS provider requests to Nextcloud endpoint: url.redirect += ( - "^/ocm-provider" => "/nextcloud/ocm-provider", - "^/ocs-provider" => "/nextcloud/ocs-provider", "^/.well-known/webfinger" => "/nextcloud/index.php/.well-known/webfinger", "^/.well-known/nodeinfo" => "/nextcloud/index.php/.well-known/nodeinfo" ) $HTTP["url"] =~ "^/nextcloud($|/)" { + # Security response headers + setenv.add-response-header += ( + "Referrer-Policy" => "no-referrer", + "X-Content-Type-Options" => "nosniff", + "X-Download-Options" => "noopen", + "X-Frame-Options" => "SAMEORIGIN", + "X-Permitted-Cross-Domain-Policies" => "none", + "X-Robots-Tag" => "none", + "X-XSS-Protection" => "1; mode=block", + ) + setenv.add-environment += ( + "modHeadersAvailable" => "true", + ) + # Hardening # - Directories $HTTP["url"] =~ "^/nextcloud/(build|tests|config|lib|3rdparty|templates|data)($|/)" { url.access-deny = ("") } @@ -19,17 +31,15 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { $HTTP["url"] =~ "^/nextcloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing dir-listing.activate = "disable" - # - Cache control and security headers for static resources - $HTTP["url"] =~ "^/nextcloud/.+[^/]\.(css|js|woff2?|svg|gif|map)$" { + # - Cache control for static resources + $HTTP["url"] =~ "\.(css|js|svg|gif)$" { setenv.add-response-header += ( "Cache-Control" => "public, max-age=15778463", - "Referrer-Policy" => "no-referrer", - "X-Content-Type-Options" => "nosniff", - "X-Download-Options" => "noopen", - "X-Frame-Options" => "SAMEORIGIN", - "X-Permitted-Cross-Domain-Policies" => "none", - "X-Robots-Tag" => "none", - "X-XSS-Protection" => "1; mode=block", + ) + } + $HTTP["url"] =~ "\.woff2?$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=604800", ) } From d75f910054d3925da6d0e307fb0790bde9af4d7f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Feb 2021 23:26:29 +0100 Subject: [PATCH 142/218] v7.0 + DietPi-Software | Nextcloud: Revert Lighttpd config change partly, since multiple matching $HTTP["url"] section do not stack, but the last/best match overrides prior/weaker matches. To avoid massively doubled code, merge all into a single static resource block. Long webfonts cache time should not be an issue, also leave .png and .map files inside. --- .conf/dps_114/lighttpd.nextcloud.conf | 30 ++++++++------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index 9d0da7ce36..44cf82ceb6 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -10,20 +10,6 @@ url.redirect += ( $HTTP["url"] =~ "^/nextcloud($|/)" { - # Security response headers - setenv.add-response-header += ( - "Referrer-Policy" => "no-referrer", - "X-Content-Type-Options" => "nosniff", - "X-Download-Options" => "noopen", - "X-Frame-Options" => "SAMEORIGIN", - "X-Permitted-Cross-Domain-Policies" => "none", - "X-Robots-Tag" => "none", - "X-XSS-Protection" => "1; mode=block", - ) - setenv.add-environment += ( - "modHeadersAvailable" => "true", - ) - # Hardening # - Directories $HTTP["url"] =~ "^/nextcloud/(build|tests|config|lib|3rdparty|templates|data)($|/)" { url.access-deny = ("") } @@ -31,16 +17,18 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { $HTTP["url"] =~ "^/nextcloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing dir-listing.activate = "disable" - # - Cache control for static resources - $HTTP["url"] =~ "\.(css|js|svg|gif)$" { + # - Security and cache control headers for static resources + $HTTP["url"] =~ "\.(css|js|svg|gif|png|woff2?|map)$" { setenv.add-response-header += ( + "Referrer-Policy" => "no-referrer", + "X-Content-Type-Options" => "nosniff", + "X-Download-Options" => "noopen", + "X-Frame-Options" => "SAMEORIGIN", + "X-Permitted-Cross-Domain-Policies" => "none", + "X-Robots-Tag" => "none", + "X-XSS-Protection" => "1; mode=block", "Cache-Control" => "public, max-age=15778463", ) } - $HTTP["url"] =~ "\.woff2?$" { - setenv.add-response-header += ( - "Cache-Control" => "public, max-age=604800", - ) - } } From dffd6427be3643be16293a22875853f035621bd0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Feb 2021 20:32:27 +0100 Subject: [PATCH 143/218] v7.0 + DietPi-Patch | Fix doubled negation on VS Code repo removal --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index c559c53db1..45b45dd4a8 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2744,7 +2744,7 @@ _EOF_ fi #------------------------------------------------------------------------------- # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 - [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { ! G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. + [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. \nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. \nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref; } #------------------------------------------------------------------------------- From c26703513c2135f84fd5efccad3a06de469ac4cb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Feb 2021 01:11:29 +0100 Subject: [PATCH 144/218] v7.0 + DietPi-Software | Python 3 pip: get-pip.py does not support Python 3.5 anymore, but a dedicated backwards-compatible script is luckily available --- dietpi/dietpi-software | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0d6e47613e..7de6220edd 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3535,12 +3535,12 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et [[ $version ]] || { version='5.0.4'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-english.tar.gz" # - Reinstall: Clean install but preserve existing config file - [[ -f '/var/www/phpmyadmin/config.inc.php' ]] && G_EXEC mv /var/www/phpmyadmin/config.inc.php phpMyAdmin-*-english/ + [[ -f '/var/www/phpmyadmin/config.inc.php' ]] && G_EXEC mv /var/www/phpmyadmin/config.inc.php "phpMyAdmin-$version-english/" G_EXEC rm -Rf /var/www/phpmyadmin # Include pre-v6.27 symlink: https://github.com/MichaIng/DietPi/issues/3304 # - Remove GUI setup: https://docs.phpmyadmin.net/en/latest/setup.html#securing-your-phpmyadmin-installation - G_EXEC_NOHALT=1 G_EXEC rm -R phpMyAdmin-*-english/setup + G_EXEC_NOHALT=1 G_EXEC rm -R "phpMyAdmin-$version-english/setup" # - Move new instance in place - G_EXEC mv phpMyAdmin-*-english /var/www/phpmyadmin + G_EXEC mv "phpMyAdmin-$version-english" /var/www/phpmyadmin fi @@ -7217,9 +7217,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas # Perform pip3 installation INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI python3-dev - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o get-pip.py + (( $G_DISTRO > 4 )) || INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/3.5/get-pip.py' # https://pip.pypa.io/en/stable/news/#id1 + DEPS_LIST='python3-dev' Download_Install "$INSTALL_URL_ADDRESS" get-pip.py G_EXEC_OUTPUT=1 G_EXEC python3 ./get-pip.py G_EXEC_NOHALT=1 G_EXEC rm get-pip.py From 0b3661a46535b6ed4b12c026fcf9fbbb885aceff Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Feb 2021 13:12:04 +0100 Subject: [PATCH 145/218] v7.0 + DietPi-Backup | Add support for XFS and ZFS and update error message to show all supported file systems (excluding NFS, which would require more explanation) --- dietpi/dietpi-backup | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index d42a0c5a07..2e1c1f8094 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -54,7 +54,7 @@ # Supported filesystems TARGET_FILESYSTEM_TYPE= - readonly aSUPPORTED_FILESYSTEMS=('ext4' 'ext3' 'ext2' 'nfs' 'nfs4' 'btrfs' 'f2fs') + readonly aSUPPORTED_FILESYSTEMS=('ext4' 'ext3' 'ext2' 'nfs' 'nfs4' 'btrfs' 'f2fs' 'xfs' 'zfs') # rsync options # - Backup: Delete files in target which are not present in source, or excluded @@ -280,9 +280,9 @@ _EOF_ TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR==2 {print $2}') fi - for ((i=0; i<${#aSUPPORTED_FILESYSTEMS[@]}; i++)) + for i in "${aSUPPORTED_FILESYSTEMS[@]}" do - [[ $TARGET_FILESYSTEM_TYPE == "${aSUPPORTED_FILESYSTEMS[$i]}" ]] || continue + [[ $TARGET_FILESYSTEM_TYPE == "$i" ]] || continue return 0 done @@ -459,8 +459,8 @@ _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." + G_DIETPI-NOTIFY 1 "File system type $TARGET_FILESYSTEM_TYPE not supported in $FP_TARGET" + G_WHIP_MSG "File system not supported:\n\n$FP_TARGET Has a file system of: $TARGET_FILESYSTEM_TYPE, which is not supported.\n\nThe file system type must be EXT2/3/4, F2FS, Btrfs, XFS or ZFS for symlink and POSIX permissions compatibilities." } From 17cd7bc36cf4e229efca0996cf0c3e03983dfefd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Feb 2021 13:28:51 +0100 Subject: [PATCH 146/218] v7.0 + CHANGELOG | DietPi-Backup: Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7bd93f53ee..ba462ca37d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,9 @@ -v6.35 +v7.0 (2021-02-XX) Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. +- DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 - DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. From eac6d1f2ef0d56647ef8741d7bd4f89667ee1087 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 00:53:18 +0100 Subject: [PATCH 147/218] v7.0 + DietPi-Backup | Clear the PATH cache after restoring a backup, in case command paths have changed, e.g. due to /usr/bin /bin merge + DietPi-Backup | Syntax --- dietpi/dietpi-backup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 2e1c1f8094..b1b4698245 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -183,7 +183,7 @@ _EOF_ else - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." fi @@ -237,6 +237,7 @@ _EOF_ rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET"/data/ "$FP_SOURCE" EXIT_CODE=$? + hash -d # Clear PATH cache G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" if (( $EXIT_CODE == 0 )); then @@ -245,7 +246,7 @@ _EOF_ else - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." + G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." fi @@ -396,7 +397,7 @@ _EOF_ mapfile -t alist < <(find /mnt -type f -name "$BACKUP_STATS_FILENAME") # Do we have any results? - if (( ${alist[0]} )); then + if [[ ${alist[0]} ]]; then # Create List for Whiptail G_WHIP_MENU_ARRAY=() From cd9b5177b9c2373c65a23d1ad1a23a23f3063c1e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 00:54:42 +0100 Subject: [PATCH 148/218] v7.0 + DietPi-Software | Tiny --- dietpi/dietpi-software | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7de6220edd..3ceebf9ecb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16237,14 +16237,10 @@ _EOF_ # Find all software entries of AUTO_SETUP_INSTALL_SOFTWARE_ID= in dietpi.txt. Then set to state 1 for installation. while read -r software_id do - # Flag for installation - if [[ ${aSOFTWARE_NAME[$software_id]} ]]; then - - aSOFTWARE_INSTALL_STATE[$software_id]=1 - G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_NAME[$software_id]}. Flagged for installation." - - fi + [[ ${aSOFTWARE_NAME[$software_id]} ]] || continue + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_NAME[$software_id]}. Flagged for installation." done <<< "$(grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /boot/dietpi.txt | mawk '{print $1}' | sed 's/[^0-9]*//g')" @@ -17637,10 +17633,8 @@ List of installed software and their online documentation URLs: # Start DietPi Menu until (( $TARGETMENUID < 0 )) do - G_TERM_CLEAR Menu_Main - done fi From 735b0d25804c320223214e7740f33b1318f8a78d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 01:34:44 +0100 Subject: [PATCH 149/218] v7.0 + DietPi-Software | Do not stop (and restart) services on software uninstalls. The uninstalled titles' services are stopped as first step of their individual uninstall block. Since uninstalls don't require much memory or CPU resources, other services can stay active without risk. If dependencies are uninstalled, dependants may crash, but previously their restart would have failed as well. + DietPi-Software | When the "uninstall" input argument is used, do not run the uninstall function when no software title has been actually marked for uninstall, i.e. none of the input IDs is currently installed + DietPi-Software | Handle input arguments in a safer way --- dietpi/dietpi-software | 142 +++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 82 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3ceebf9ecb..9b675ff2d1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16262,124 +16262,114 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// Input_Modes(){ - local input=$* - input=${input#*[[:blank:]]} - # Process software and exit if [[ $1 == 'install' || $1 == 'reinstall' || $1 == 'uninstall' ]]; then G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Automated $1" # Make sure we have at least one entry - if [[ -z $input ]]; then - - G_DIETPI-NOTIFY 1 'Please enter at least one software index ID or choice system INDEX_*_TARGET=-?' - - else - - # Uninstall | Stop services prior - [[ $1 == 'uninstall' && $G_SERVICE_CONTROL != 0 ]] && /boot/dietpi/dietpi-services stop - - # Process inputs - for i in $input - do - - # Check if input software ID exists, install state was defined - if disable_error=1 G_CHECK_VALIDINT "$i" 0 && disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$i]}"; then + [[ $2 ]] || { G_DIETPI-NOTIFY 1 'Please enter at least one software ID to process'; return 1; } - if [[ $1 == 'uninstall' ]]; then + # Process software IDs + local command=$1 + shift + for i in "$@" + do + # Check if input software ID exists, install state was defined + if disable_error=1 G_CHECK_VALIDINT "$i" 0 && disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$i]}"; then - if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then + if [[ $command == 'uninstall' ]]; then - aSOFTWARE_INSTALL_STATE[$i]=-1 - G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then - elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != -1 )); then + aSOFTWARE_INSTALL_STATE[$i]=-1 + UNINSTALL_REQUIRED=1 + G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != -1 )); then - fi + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" - elif [[ $1 == 'reinstall' ]]; then + fi - (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue + elif [[ $command == 'reinstall' ]]; then - if (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" - G_DIETPI-NOTIFY 2 "Use \"dietpi-software install $i\" to install ${aSOFTWARE_NAME[$i]}." - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + if (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" + G_DIETPI-NOTIFY 2 "Use \"dietpi-software install $i\" to install ${aSOFTWARE_NAME[$i]}." + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." + elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then - else + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." - aSOFTWARE_INSTALL_STATE[$i]=1 - GOSTARTINSTALL=1 # Set install start flag - G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + else - fi + aSOFTWARE_INSTALL_STATE[$i]=1 + GOSTARTINSTALL=1 # Set install start flag + G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - elif [[ $1 == 'install' ]]; then + fi - (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue + elif [[ $command == 'install' ]]; then - if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." + if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." + elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then - elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." - aSOFTWARE_INSTALL_STATE[$i]=1 - GOSTARTINSTALL=1 # Set install start flag - G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then - else + aSOFTWARE_INSTALL_STATE[$i]=1 + GOSTARTINSTALL=1 # Set install start flag + G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is already installed" - G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\" to force rerun of installation and configuration steps for ${aSOFTWARE_NAME[$i]}." - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + else - fi + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is already installed" + G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\" to force rerun of installation and configuration steps for ${aSOFTWARE_NAME[$i]}." + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" fi fi - done + fi - # Reinstall, prompt for backup - if [[ $1 == 'reinstall' ]]; then + done - (( $GOSTARTINSTALL )) && G_PROMPT_BACKUP + # Reinstall, prompt for backup + if [[ $1 == 'reinstall' ]]; then - # Uninstall | Finish up and clear non-required packages - elif [[ $1 == 'uninstall' ]]; then + (( $GOSTARTINSTALL )) && G_PROMPT_BACKUP - Uninstall_Software - Write_InstallFileList - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services start + # Uninstall | Finish up and clear non-required packages + elif [[ $1 == 'uninstall' ]]; then - fi + (( $UNINSTALL_REQUIRED )) || return 0 + Uninstall_Software + Write_InstallFileList fi @@ -17474,29 +17464,20 @@ List of installed software and their online documentation URLs: local output_string='The following software will be REMOVED from your system:' for i in $G_WHIP_RETURNED_VALUE do - output_string+="\n - ${aSOFTWARE_NAME[$i]} (ID=$i): ${aSOFTWARE_DESC[$i]}" UNINSTALL_REQUIRED=1 - done (( $UNINSTALL_REQUIRED )) || return 0 - [[ $G_SERVICE_CONTROL == 0 ]] || output_string+='\n\nNB: Software services will be STOPPED by DietPi during this process. Please inform connected users, before continuing. SSH and VNC is not affected.' - G_WHIP_YESNO "$output_string \nNB: Uninstalling usually PURGES any related userdata and configs. If you only need to repair or update software, please use \"dietpi-software reinstall \" instead. \nDo you wish to continue?" || { UNINSTALL_REQUIRED=0; return 0; } - # Stop services - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services stop - # Mark for uninstall for i in $G_WHIP_RETURNED_VALUE do - aSOFTWARE_INSTALL_STATE[$i]=-1 - done # Run uninstall @@ -17505,9 +17486,6 @@ List of installed software and their online documentation URLs: # Save install states Write_InstallFileList - # Start services - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services start - G_WHIP_MSG 'Uninstall completed' fi From 2e39c831df1b062b1362f585f42be3c5a6d444b8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 01:43:16 +0100 Subject: [PATCH 150/218] v7.0 + CHANGELOG | DietPi-Software: Uninstalls do not stop other services anymore --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ba462ca37d..fb356b0db1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes: - DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 - DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. +- DietPi-Software | Uninstalls do not stop other services anymore. E.g. your webserver or media streaming server will stay active while you uninstall that other software that you don't require anymore. Since uninstalls do not require much RAM or CPU resources, this is perfectly fine. Many thanks to @mrgreaper giving the hint: https://github.com/MichaIng/DietPi/issues/4116 - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 From 8f7bed2d918e3c80e164299be53ef462f59a7145 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 17:23:29 +0100 Subject: [PATCH 151/218] v7.0 + DietPi-Software | LXQt: Update configuration, fix visual panel issues, remove obsolete files, cleanup --- .conf/desktop/lxqt/lxqt-buster.7z | Bin 8574 -> 2717 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.conf/desktop/lxqt/lxqt-buster.7z b/.conf/desktop/lxqt/lxqt-buster.7z index 2c55cd37a76ae013c88bc2668e3b178897406030..185acb2b9ead42d6768235a2c49035fcacd5dd8c 100644 GIT binary patch delta 2113 zcmV-H2)_6JLY);QH+sCUCma9-4V(K@S_%LF00000BLDyZ000002?-UM;2dQMKeHPT zcLIO>-Lc|q;|IL4O_8La0#k+7RBfNS-t7@A|D{ubVW?J!=5b{+f^EE6Vktc|HYX4H zrEHEqZ={RU8F#H^+413n4Hs>x8X1?j{dvMl_D6qf^=V3BFoFf05d3E|FYz1!_DuAb z4jr&JeN9^V*XH$F2NPMOi@56ly|K@bx_W>4b$z;`6-#?u0urmG#*QF zbon0)d?aByRJVOq&4I9}V@McMsH~V*AMmLglGnn!_eS<3!@`2{PAJJri%U!{I(eD? zUHoHPPhuE$n7K-rlTKi**;8`V1B65^Qlb^?f;8rANKWRjYe4Sh)yF{QJ$f+;UJHM> zfI=s|R)EP2y?!q{dV*=4SV3sPofUSQf7zsN6CMBFuId~Do^IOS61u_Z2Gx2Vr)7fV zN@elouW9wRSI?4gIK_1J&#Ol)>&ZuyI@wST8f~dA<#u42reE6K3xN2<-A`b_Wq1Zi7vLpkA}NAl3^*v= zd9^y?oXqG|h_EGz3v1d5y;px{WCXoV5y&0b#?sFV*SF*AXWf=B!xQ~)NiQ}D=|0v; zfF6h20lZ;M`9h#3H|LAl+lV&h!6|6qXH=x{H_|Ozb+Bt0l|M_O2e*$8XF*ud_}-h; zy@y&jZtmj(ImxZz+xdUqpxfmHbusK6 z(yX7lMbqoA-CI-c45TfaFhmoZI>%>mMo9r(A}ApOq)%f^$yS^9JLWOY&IoOcvF&tK~tE+7kQX{d>_5Q@=Gg@m1X zJ`VomQPxDsjEyGvri6c@vDhZH%{9JIoQR=Z{&(C4(eIwabIs~LAV+TysA%+6<0$36 z$QDodNX9>_16R`1G+SSbmM5i}AV9=_`WWeC=SWa^YWBnV;^=AdmHsUg=P+|g0r#XK z8oR*-*nws;Fc(&1=Q1IC-Y-&m?Xd`h!j?2gLZiiXeb-_!C}4jEq?BV}-&y__7V5jj z9PNX*ajFd*>mCsMFvm!F4z^(>6_Zp4r^VT}!5c!mTK9I)`UiB3@scdM%ZMZO7$Q{x z@kI${^)J2!I+Z#OMlDSyo}78R*?HBEFLjCW5TqfhCC-0u?rV}8SjH^gt_S&Xd;cIm z9|+J@q9|oxSZ;bf6Cx=6Az1P&KR7^YxhG$se1Po!*nnYvDN(ws&hkPo^p>&ptl}Tl z4PYV>miQvJpj?7mm#Lx$^@A2*%l7E%^A~P4+2-0Z8Lxg`=w2MgTYAQ6Mhu#bB_Qk+W4{yOwmxQ)+&n?Nw%Y4i0LjeOt}aqX2YiF`KoKl6Dl9Jk<@5F_>g~-xPN1;A;RFa_5VCkH|4OqVm+b;M}bO``9w`age%P=;8RK2_2(W^Ns-oYnMH zPqlw?5ukQg@7BZ#Zf;qtkZPA?i(y=^0AAhXDLu}-eC*oznNvX#V#i;#Ao9L`^2?qa zNBpPMpSSsrZl16`3s85|sj->wBqk;;ybe96-m8|SzWX28T>t<80D&_Ht`F6bXqML` z)Bdw?7O_<>bOzosOi_V7;J35ubi50MofLm0S}~?3rs@muyZpQrV%fzCDy>sgYF=gGNw<}4goPP_8rb=RJ8625{yV1X!zlN%><2>v4) ry8r+H7Y2z(0SSQ<00#>J00AQd0Ra&OT>uaO01Sd63IW}M#e4t&V8RKe delta 8015 zcmai(RZ!hgv*izZaMvKgCAdp)clU%G?BMPe{&?`3^rRs8>l{PnkCdSQeW?G>10v#&z~0Qu#5gkq5u?G{ zmUBt;B%_r3F;562&0AW1)ibCVwkoCX!cbm)79&&&SbcCs_hwJ;v=fwn!up#_2O6|- zOISs!Q3CU;jbwE?&*P3=MvkUGS+*^RF7Nup?JK=N0U4cy5c$_TEqa?^dEZc!;snU# zj^^!!9#wo)0L6Wook<(!fap*1=EQnw^V`cW98yUWRX9;(e|O>ub|>9W_uM@EH$Emt zpA5EY|C;87@Y)D|yM0t1t!WNs@75#;Q!TH zL42sB0|cyu78zj9M5rK;TbO<%+y#&*Hi8^^C(XHYyal$3Tu7>uQiW)*>y&g2Y3bUY8#zTM$X7#{E`5oB>M-y~LR zV9ViyB1_B#xe$7|f6#IC#q9j4j#Ck%D`AQ{Z1Bb;X^KwFep(=D_!_^0C1GzW<`JJXI+| zPWc6Sx9$&T+@NavX0D1tUH7oK!xE0i%DW#5sH-eAE?R@ONYx^=hR7B|uo6G3I^L~x z5Ev5$8Ocu6^%ydwzwUCah2BDwPGKNpK!Df?%Cv@k*)nF9{_dfa^p9kWWxc}T{ld8= z?7yrHY)=tZ591l*E|htS*!w2h3~kWnZ5O7k-o{YQd{CO;_^?7?>Y!D(9{kF&)(Pz3 zPqnGJ+>(3G)S(jr?&BN>xv!(cejH2+mn1l2nu39pt(Ppp&gUHBZdzYPZFG74fdKLH zp$~CH)c!rf^@JVZ<*M1e8@Xgye0DAJ-WykNd~C$BCsU;frUi^Ie3GpJ;@NLu+?3Or zkHrTgEjR_-C?2q*Xj|s_hgx)~Z9o&fWyZR`L{4}HEr&meG-pTp&ungcP@&Z@aZ(-__h`7SZ2+4X^a`pj{E z{0&H733|tiKNk9yy!qTz87ROsq}Rxzlq;F?!m!1uS0jjCQx;779t;1N7wMKsOQsyR z(k=hMNtK5s#if>CgPC?@yE!b(OD%+baQ>Y<*%|5=D%qsc-<6c{s-zVxz$fRukv_Ta zeZrLiI0aerou&oDTjND91ic@Q1BH8Zs874kNy8}BagV$|72ghh`v%a7*5`avcs(gQ zhlE%qtF^G3i|_ZXa%nE1;?A|cAb&WbqlfpoQ90orn#Y-**4f4)Bqy;Kl*KJcF;WvK zz=l~)&J|wA8c0Vq4Vo^}rx(Uk2$ifwNoc_R0DsKX3zK~j{{_Pea2LLl{KDY!gP;E~ z{AIwfYYf+`Gr>B`Mu_yLp0kZ8JTHqBmfOk@nS*Hf$QEUa^UV$0ftg@yy$q6J%oL0s ztw3fN|A}s6kQ?vscAFN1pBHzNA9N6hl|;3@BkM)}1-wnyZ#yE<^I#_U4Cpg!F}?N6 zI8>3uW;#bq{lF1!i#<(= z@%F=#U*VX-5PMhAqil9Z^n}P7)_m5&GM{4_ZLG3V5iB+kIJAjlf-R}~HNQu@r)_{-OhRoR*l%UnG`6O`UxMPK=zIYMbgkEJ?1L_8$k5 zWEgnYn%{bWpGF?a^{Eu+pI{y`v)Xrn$*DO9Q@MY{74JyNl_0KijLPuUqZ2occF^#A zXf@^cRsPSnKn|g$7Hza%qKB?nf}n_opN((Xwh^wEjIT>n@%P+LrkR5L*aDb8Kw0>~ zb7le{bXON5yduVQ&uwYQ=8?dqMrZQujZdsi4&DMH)32O8>f5C2MdhSva_a?K)ZSl9 zeqxTflCEb@`qqL6vsKQ{IeKWsoc3|;XZ}tsjo5fkI?{X{{#2&s=sMldYIoOQM^*Wc z@Kd*=4S8ECGgk6;Su;iS^{ZOFAcu|aazW!?)_q?=@LWx1&PRC#DAuf(>2Tp%-D#`w z;iT_@^Nx9zfQ#Uok!cj)hj+cM7AcQ6am&|_pyu)dw@HjSOz8QV$^sqh2~2j$nDptG z-=vmbWtf0GHTsI|V=sIB^o`5$21tJ}r-kQFNh^Uh!+gd*T`2zbw3pZ9!SXYx zqn(>^ozAV4;^wU`M0BJ=NhX0sg_NGpXL^^{-@)%uq$iWD;ScX;S3~(l*w{PC#eklh z&Y*EZGf}^EIwpDKU&vC>l@ufLInnxskg>o3!7?8H#!zJUi=R%VU1o_%bA4ajR)F3Ikz}oLEr@{`*bLT*MyE6U`3(dp0B;E({LdpH1k8|&9R7&M2f?`co z?@X-Gv8|f$Cma!8dYq84NTUsLi>2O{Abpt9`jSrFu*tu=UlqlIE#-j~U>hUQW;Sm@bqhMerrJ;RGj48$q%~tqQ8h4L6Z_3EcjcykiC!5!yFJk@! z+4z(lzi#K!uRhjyb87yz*4izpd@n$uluWA)Qz$f^5!GM}MFshQ%xi(}hHETYR3p@v zY{LSPar7LN^E=O|hPRujOjCS1wy&e#ty7yMt@Mhcg*(QT&h303gy*;v)?4T#o@6gs zzFkS;e2CnMOw?wrJa~U(c_Zx}>Ywl_Sfek++_+~8QqtR_A*mbY;AD3Z7J3nhnRA~v z8k*o=PDVm5eMlxCPLvEd=p;;QS2PI*3O?x5AKO3%r1=~3Q!W)3;CJ6jmian7OIpk{ z?Kwh3>uuAl*EW+D*NRKhUhLEPsv<*wU-oM!_U@;@T7T;~o{oeVY${xX(DdwzMt>#Q zkwm{fsMPPEY%6=Ue=z0ZD}JR%J$`VxMo+l1){a0df}yir-`WBK*g4j$`0YPdhb`$w zEUXItu%iVDWsR*FU)dlfI?fgN9IBf_`oX%i^M0B`WcZ7KC7Uk7y5lV^kXJGn86fHz zUa0Pz4s)_u8*;7lI|w;A>dlgv85Q@{Jag|(yK1Pj4`86dDj){z@DmD6p||+v?s+dw zhTmYt;ycb`UVvqYty$fN!l`;mx6AgP&RdlyL6Pbkg&kB!b7T1->Ne^M+rv4j5V|ji zvWKH~eDuzRXrGUe6gd_YJU^_G$b&pu&8wH}4MwfltElBE6}K}~vOcy;6A@vVK*C#f z*htls`*7pbz2iRbZg+~@Pj-l!5IQz;4h4nP45L(PBLZ@8G8Y$)>jCNnxB-1=FIDKX zk`DG=Kk0K!eeY`zk#fHyj>S9d0B+J5%`}Brv&e{jkL~~ybxPqCl^<4 z@Eq%5H=Z$g1JhLy>eIi+%DWMrrgyw`<)iy)bFKrjHufkoMem z2YCC?ZI=9L=v1dq-OKvWrxpm`k6P! zl&(9fng*^Lp6%gGWt|eSX1{ngw3+8+#H9l>)`MG zWtGd2BN8I>XsNoxhkfGF?Y5@@d+Mkwg~^F#WdGaMEZ(a>Ur#^Y@QVRN!f{1VV59 z{!ZKz5QL#=4zrZ374v{_2L=$m!8GKlS0b%?;>>#I#iXUQd90Z+nV|F+ut4N9XcMgx zwyKWS0~UC@OU5s@#3x;4TL>?wqV@q+T}jD{^aKMmuP38krrdTA%~kc!bidVo%A#!W z7B0Yn9VxuK0fmELK>VL%q4rQ`V_QR%f5f{wJJ`xdh$RjfM!T-{VyI!`5~vNNz|MQA;Cpt@xxw;m z3J3=*G)=0B0?@y4(tWy3P0O0anvpM+H`f6WMaD}@%R+6cwYAyl!N!z-{R+ft;GQX zxm4kctu5`?52l!M(-D!J?~!I~kS zp@OPC&?cj@CbDPCUSk1y{^t%zmP*S~Ns5t|y`8i31$9pLpH~Gw$h(*c zoUdz_i2Qi%i?tS2AL^sxy)eRYqS+k(auVs@xD-t-QN;{Gb4c)Y50@;pe&b-tpgZ*U zS6u(FIT8AF%JYShB%cqGR4x75Vcd!Pl1=&GZj=AT`B^0QkWLP(B5B>g9PI`O%!BLj ztCJMoB=z?fnv3WVi@jN=loo%helL-Jznd|~l7?BVAu1A2RJwuX>b8?)QwF5b{_Wso zKf9oD)lmLsL!bu2h`hpCRd*y92s@^%LPme@l`1hWT|gw^Q)3$23sW!u+YmX1nM-xI z(hyPL?e_eQFfnRO%S16GP(TWBwwwn;SeD+mf8U7Lv~FxNl3lBe>u)aBin*5`zu+9; zoe=lutVol)JoBb-`YF*xrt|CKs^iYdv!ggp>9Q`J(f=QbWdB2=iRrH#s~Gy1}$+=N^VaH+7QgiiYu zZVx{qk`F~OL_@rj_b8NmBeF!1he2ISTf_X<{DP@{KQfuYg$I8!;zalLzNuNw`7qxS znH(_~Z3SLTs&k3xs^ec1J0fXpeLeTY$Qh;$A~+%OF2rC25Q1%l>$R3;e?l->m{r0i zbbWVW58N&X=yb#_odR*m+6l2;`C%ukk;7|2|CEyakJA5CR{wS-&Hqv7f6J`iOxZNy z3SzCFoRgDuwE#3y*3!71oDXTW{atjn;dp*IQFDfX6;K?b=we_*wrWsXVMp&;Nq#D% zX3z9Le6RNdhy1Z_ZYh~>ich7!`0S;f3QtmE(~R#bzgQ*iz_?wOUsrA&kkPX5$*HQD zeME>PU0s}i(8k&jX1OLSd+j^g5IY-(k1A7W^e533bi+bnkgH5s<_z+v!i%enYmgD zbF;Jm0|2oZ_V7O$1N=|k{FgI&A#Ct5vV%tj#c6}0Y>+xl5NyoFXYmDdb_eZ5BfX!T z8{QNB@uXjOFITKf2yVg&8m4&m;HKdQsK@ih_hk6@KKWU08ZfH5|6&b(n(wLelP0%3 z^xG2j75~Lr#T@umg}oCxbeexpnfe*~`OW-z5MXkkpV4ha=Z6_ER9WB}U~F4Rb;}U- zLbX$s_1-Q4qfw<_CMEf6J&nZV_IamY3@zK)7B2p@k2yZPCcZ+!>YXXBxZ5t5CHcO3 z8FIPbpgkSMrRSz<%!!T5`mnL2$KHSLs&ekFv$JeVzv};Ku}7S}_>#&7GdX=c!x`m( z2{@HT6n+V9Pz#oWH`QodCrHJeWt9Bh;M*_DTQ=-4N;R|jW+hNp9rf~La6ndzcdkg2 z!(4#i&W=ES9yR|Khpr;XeiyRPEhOI%&C%BhuV8r;YJ5R{O^Au4j^zjTCnK#%hSeFR zY!vfdiYJwtcwL2UwEK>Fi4*p5pTkpL1&~+_96?@?_L1n&Y{6_$f&b;!Zi9MRrypmT zyMgiTWZk|S?;ga2`lKaR+wA3o>aqNdLHpQ4v(|o_q3OoqJ}7pKWp7sYok@45LN`2o zCGVts!)=h4LrCf!bOq;x#-z0v14Y)N$H^D3PO{+qEB;w?>l722!?~#dv9jjy3IIN$ zIFYibRdgY^zDmlEf;($_DAmbdAku4zz1mfc!4S-PrJ5wXIQUrNL5=9-&|u2%fgPO7 z=0(fSh8opYODNO~6Rvms&J;!{_s}4PN(mJYsm+XTq;G%B#S}zDz4Ba8aKtFMxhQ)( zA8QR#AHvZ#6vn(Fo`swq{J92Dkn_z8MbFz0br;T6aUu?pA$-NR zQl{VV^8^c$c35Y08fO`e)38&wFW+4+lu5EfkDo4{-hqCs4_qr|H>KiGdQ|%O%?dl$ z7wLG-!aHQE{r}?v#vOp6{7+@^-&GMvaIl)+#qfteex-OxeGuApUw_I~u^Gr{BiJp%e-e~Uxoep`U}_6m}1A#3-rYx~QWV~;#h zFEmgNeU)rI+6p?IJQnxp75Cq(MKAkl&Y;2!_Xow7x!YV*`Dgp85Ne+sF%&k-4Z25Gimci+G!H9Z(1RcfA)e43`tK;#ox8YJ z9WmId!|b$3tlo&g>yND~#pcMJS>%+i?_4E2SR-90O^6|C!DSZRJE+f?cpu3t@FOiQ z$Qx2xM%t2|qp0{@6s0t?F%km&RWFFuDE|gCv##kvRy`7&nME&z zjvD}hBTf?o?VJe*U%V^or7e(dtPLh4qHrrAiE8Uf_Y$v;5%+@&&G&EvMD<8>w`twh z>#@EJ2qj_(oa96bp;7XA)f)LhbqC3>kJ%q!xADyhD-*H0+wQJ-TPqF|Z|96&h@95Z zGD5j%@(_JlM#`k0SLtRV7k}ud4yY%PQuIla7?? zW6*FH^1>F&g>MYR*Ogx!E;R@Q{BM6th2!p%=MM}FW34A7Gf+_rX~eU^RG}?w*RJlX z>rx1)Q#4J;kQTO#q7BFa`cP<}RZXiItR+NeqH6O|$?2e;?_5l>L@CUMn2TYn(-9c$ zjahkh3uUmAm8xng3A>+5a|lS<>OnSghTqW039*z z?Ck#2jv01K{ktb5#G@7MDuy92KEl0~_hR}doDrY?<`%Q1Gx1ded<-rFKd5WMXDb|P zSIx0Mn4#c_5Jg5;nx5(D&b;!z?FKkT+h_7H%^@A<^`31BH+n;ig!3gV{B3pbNiPjc z2`ig;nOYyCc&IW)v9N%t*gSq0fw@%?-gh9}6YDEyryv`uYdSF*T`Hc(#v?g2vQZ>X z{Bax5p<(8zjTP8FH$EBowIWT}4e}PhcDj`y7z{T0b0$ zB+fl}r` z-;;d1zYO8aFZ~jcz!80LM9hHAa`{Nw%0B6PY#FV}37uAl#I3q@)_)_ISNLwQUJ^)D zXuBU?#hE$5`*lw!+q(Ws=~WRaOr}9ki4fJw(c`KEc_v89dyzqrAl$rj$@c# zP{)qgjl;c^$4)`G^UeeW118tVpVvVYw9d`~Z%pa9?^t6Qut%nvPCh@ay|9fas=f2` z4SXjv$s=LkDOkmZc~`9vo@H15I|ScDsgIIAyFBVzp*WUm4dF(>lUzQN0qyiG$OD&j zbGs`$v5^)m05#b>^5@PL19!#^u`jo<5RnH*7sT+4d(4_~G( z(!k(IdSJq7M|C?OOs@T?>((pU zFX%TBBp-PnGUvUgQkSKY%WkZV)@vy>tc=I>S5v~1F7 zonXml+QU%%SPUZ&h!8Qy3kEr$4+KVq0l`qi!N4FGg0MhnAhcj_6c}NB1y~U1e*r$= BP9^{V From 1684a773c420a48e1b9652adeb852d46fd11d37e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 17:51:19 +0100 Subject: [PATCH 152/218] v7.0 + DietPi-Software | LXQt comes with xfwm4 window manager as well, with internal composite manager that conflicts with xcompmgr, like Xfce does. So do not install xcompmgr with LXQt and assure that it's disabled otherwise. + DietPi-Software | X server: Do not install xserver-xorg package, which includes all display drivers with are mostly not required or conflict or override the often well working modesetting fallback, at least better than VESA, which would be prioritised. For PCs we have the Intel/Nvidia/AMD selection already, which now makes even sense for AMD GPUs. Outstanding tests is performance on RPi desktops vs fbdev driver or fbturbo, available on RPi repo, and VMware display driver for VMs (as well VirtualBox can emulate the VMware GPU). --- dietpi/dietpi-software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9b675ff2d1..9673da0b35 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3197,7 +3197,7 @@ _EOF_ local editor='leafpad' (( $G_DISTRO > 4 )) && editor='featherpad' - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch xcompmgr + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch fi @@ -6781,8 +6781,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing - # Generic Xserver + Mesa OpenGL libraries and utilities - G_AGI xserver-xorg xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra + # Generic X server + Mesa OpenGL libraries and utilities + G_AGI xserver-xorg-core xserver-xorg-input-libinput xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra # Disable DPMS and screen blanking dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf @@ -6836,7 +6836,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas elif (( $G_HW_MODEL == 40 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' - mv /usr/local/lib/libUMP* /usr/lib/ + G_EXEC mv /usr/local/lib/libUMP* /usr/lib/ Download_Install 'https://dietpi.com/downloads/binaries/all/xf86-video-fbturbo_1-1_arm64.deb' G_BACKUP_FP /etc/X11/xorg.conf dps_index=$software_id Download_Install 'xorg_pine64.conf' /etc/X11/xorg.conf @@ -7451,8 +7451,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Create_Desktop_Shared_Items - # Composition manager: Enable limited server-side composition - dps_index=6 Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop + # Composition manager: LXQt has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 + [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && G_EXEC rm /etc/xdg/autostart/xcompmgr.desktop fi From 134cc50fdb521dfde23067e8362ced20b9314da8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 19:23:47 +0100 Subject: [PATCH 153/218] v7.0 + DietPi-Software | X.Org X server: Install VMware GPU driver for all VMs + DietPi-Software | Home Assistant: Bump Python to v3.8.7. 3.8 is still the target version. 3.9 works mostly but a few related issues are present on GitHub, hence we wait for another release before switching to Python 3.9. --- dietpi/dietpi-software | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9673da0b35..ffd67d57dc 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6633,7 +6633,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u local ha_user='homeassistant' local ha_home="/home/$ha_user" local ha_pyenv_activation=". $ha_home/pyenv-activate.sh" - local ha_python_version='3.8.6' + local ha_python_version='3.8.7' G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user" G_DIETPI-NOTIFY 2 "Home Assistent home: $ha_home" @@ -6782,7 +6782,10 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Generic X server + Mesa OpenGL libraries and utilities - G_AGI xserver-xorg-core xserver-xorg-input-libinput xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra + DEPS_LIST='xserver-xorg-core xserver-xorg-input-libinput xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra' + + # On VM, add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which es even the nowadays recommended default. + (( $G_HW_MODEL == 20 )) && DEPS_LIST+=' xserver-xorg-video-vmware' # Disable DPMS and screen blanking dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf @@ -7035,7 +7038,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Remove Information file - [[ -f '/mnt/samba/readme.txt' ]] && rm /mnt/samba/readme.txt + [[ -f '/mnt/samba/readme.txt' ]] && G_EXEC rm /mnt/samba/readme.txt G_AGI smbclient cifs-utils @@ -7047,7 +7050,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Remove information file - [[ -f '/mnt/nfs_client/readme.txt' ]] && rm /mnt/nfs_client/readme.txt + [[ -f '/mnt/nfs_client/readme.txt' ]] && G_EXEC rm /mnt/nfs_client/readme.txt # "netbase" is needed for mounting NFSv3: https://github.com/MichaIng/DietPi/issues/1898#issuecomment-406247814 G_AGI nfs-common netbase @@ -7063,7 +7066,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas INDEX_SSHSERVER_TARGET=-1 # Stop OpenSSH service to unbind port 22 - systemctl -q is-active ssh && systemctl stop ssh + systemctl -q is-active ssh && G_EXEC systemctl stop ssh # On Stretch + Buster Dropbear packages have been split, install "dropbear-run" only, to have active service, but skip "dropbear-initramfs" # On Bullseye+ "dropbear-run" has become a transitional dummy package for "dropbear" which does not include "dropbear-initramfs" anymore. @@ -7099,7 +7102,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas INDEX_SSHSERVER_TARGET=-2 # Stop Dropbear service to unbind port 22 - systemctl -q is-active dropbear && systemctl stop dropbear + systemctl -q is-active dropbear && G_EXEC systemctl stop dropbear # SSH server package pulls client as dependency. Mark client hence as installed and mark it explicitly so that it is not autoremoved with the server but must be marked for uninstall instead. G_AGI openssh-server openssh-client From 8af52b7262cc5b46b406ac722102a34b541dd945 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 19:25:33 +0100 Subject: [PATCH 154/218] v7.0 + CHANGELOG | XQt: Resolved visual issues with our default configuration of Debian Buster --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb356b0db1..d314c8feb1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -33,6 +33,7 @@ Fixes: - DietPi-Software | OpenTyrian: The install option has been disabled on x86_64, since the Debian package comes with a different file structure and it has been disabled on 64-bit RPi systems, since the binary has been compiled for armhf. - DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 - DietPi-Software | Resolved an issue where for ruTorrent, Koel and Bitwarden_RS the automatic newest version detection failed and instead a possibly older fallback was used. Many thanks to @kelvmod for reporting this issue: https://github.com/MichaIng/DietPi/issues/4105 +- DietPi-Software | LXQt: Resolved visual issues with our default configuration of Debian Buster, drastically simplified and cleaned up the files we ship. 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/4XXX From 9003d696def4a26d60a65ef3e90728de89c616ce Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 22:08:09 +0100 Subject: [PATCH 155/218] v7.0 + DietPi-Software | RPi Cam Control: Fix raspimjpeg on Stretch by installing the dedicated Stretch-compatible binary + DietPi-Software | RPi Cam Control: Use G_EXEC wherever possible --- dietpi/dietpi-software | 55 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ffd67d57dc..2fd6121633 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4208,33 +4208,35 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf DEPS_LIST='gpac motion' Download_Install 'https://github.com/silvanmelchior/RPi_Cam_Web_Interface/archive/master.tar.gz' - G_EXEC cd RPi_Cam* + G_EXEC cd RPi_Cam_Web_Interface-master # Config /etc/motion - mkdir -p /etc/motion - cp etc/motion/motion.conf.1 /etc/motion/motion.conf + G_EXEC mkdir -p /etc/motion + G_EXEC cp etc/motion/motion.conf.1 /etc/motion/motion.conf # Config /etc/raspimjpeg - cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg + G_EXEC cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg # Setup /var/www/rpicam - mkdir -p /var/www/rpicam - cp -dR www/. /var/www/rpicam/ - mknod /var/www/rpicam/FIFO p - mknod /var/www/rpicam/FIFO1 p + G_EXEC mkdir -p /var/www/rpicam + G_EXEC cp -dR www/. /var/www/rpicam/ + G_EXEC mknod /var/www/rpicam/FIFO p + G_EXEC mknod /var/www/rpicam/FIFO1 p # Symlink cam preview and status - ln -sf /run/shm/mjpeg/cam.jpg /var/www/rpicam/cam.jpg - ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/rpicam/status_mjpeg.txt + G_EXEC ln -sf /run/shm/mjpeg/cam.jpg /var/www/rpicam/cam.jpg + G_EXEC ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/rpicam/status_mjpeg.txt # Setup Raspimjpeg binary - cp bin/raspimjpeg /opt/vc/bin/raspimjpeg - chmod +x /opt/vc/bin/raspimjpeg - ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg + # - Use Stretch binary on Stretch + (( $G_DISTRO < 5 )) && G_EXEC mv bin/raspimjpeg{-stretch,} + G_EXEC cp bin/raspimjpeg /opt/vc/bin/raspimjpeg + G_EXEC chmod +x /opt/vc/bin/raspimjpeg + G_EXEC ln -sf /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg # Cleanup / remove extracted source G_EXEC cd /tmp/$G_PROGRAM_NAME - rm -R RPi_Cam* + G_EXEC_NOFAIL=1 G_EXEC rm -R RPi_Cam_Web_Interface-master fi @@ -9287,18 +9289,17 @@ _EOF_ Banner_Configuration # raspimjpeg conf - ln -s /etc/raspimjpeg /var/www/rpicam/raspimjpeg + G_EXEC ln -sf /etc/raspimjpeg /var/www/rpicam/raspimjpeg # Motion conf - chgrp www-data /etc/motion/motion.conf - chown motion:www-data /etc/motion/motion.conf - chmod 664 /etc/motion/motion.conf - usermod -aG video www-data + G_EXEC chown motion:www-data /etc/motion/motion.conf + G_EXEC chmod 664 /etc/motion/motion.conf + G_EXEC usermod -aG video www-data # raspimjpeg/php schedule startup and control script dps_index=$software_id Download_Install 'raspimjpeg.sh' /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh - chmod +x /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh - cat << _EOF_ > /etc/systemd/system/raspimjpeg.service + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh + cat << '_EOF_' > /etc/systemd/system/raspimjpeg.service [Unit] Description=Raspimjpeg (DietPi) @@ -9313,21 +9314,21 @@ _EOF_ # Replace confs with /var/www to /var/www/rpicam, once if ! grep -q '/rpicam' /etc/raspimjpeg; then - sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg - sed -i 's#/var/www#/var/www/rpicam#g' /etc/motion/motion.conf + G_EXEC sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg + G_EXEC sed -i 's#/var/www#/var/www/rpicam#g' /etc/motion/motion.conf fi # Setup Data directory - mkdir -p /mnt/dietpi_userdata/rpicam - rm -Rf /var/www/rpicam/media - ln -s /mnt/dietpi_userdata/rpicam /var/www/rpicam/media + G_EXEC mkdir -p /mnt/dietpi_userdata/rpicam + G_EXEC rm -Rf /var/www/rpicam/media + G_EXEC ln -s /mnt/dietpi_userdata/rpicam /var/www/rpicam/media # Enable RPi camera /boot/dietpi/func/dietpi-set_hardware rpi-camera enable # Permissions - chown -R www-data:www-data /var/www/rpicam /mnt/dietpi_userdata/rpicam + G_EXEC chown -R www-data:www-data /var/www/rpicam /mnt/dietpi_userdata/rpicam fi From ab4b7352a70492af6491864f02d0cc117fd46696 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 22:17:07 +0100 Subject: [PATCH 156/218] v7.0 + CHANGELOG | Remove outstanding issue entry about raspimjpeg streaming on Lighttpd, until someone verifies that it is still present. Generally it works on Lighttpd, as the RPi Cam Web Interface maintained installer contains a Lighttpd block meanwhile. --- CHANGELOG.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d314c8feb1..c63bd65285 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -40,7 +40,6 @@ As always, many smaller code performance and stability improvements, visual and 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 - 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-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 - DietPi-Software | Sonarr/Radarr/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 From e4d18c1680f2ec8d03e4456052bd6d7b4a700460 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Feb 2021 22:21:16 +0100 Subject: [PATCH 157/218] v7.0 + DietPi-Software | Lighttpd: On uninstall, do not attempt to remove /etc/systemd/system/certbot.service.d if it is not present --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2fd6121633..b790cfbe2b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13594,7 +13594,7 @@ _EOF_ # Remove certbot renewal hook [[ -f 'etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf' ]] && rm /etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf # Remove hook directory if empty - rmdir --ignore-fail-on-non-empty /etc/systemd/system/certbot.service.d + [[ -d '/etc/systemd/system/certbot.service.d' ]] && rmdir --ignore-fail-on-non-empty /etc/systemd/system/certbot.service.d fi From 9f48817cb83a4e937bd36e3aaac379e79e226b54 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 00:24:27 +0100 Subject: [PATCH 158/218] v7.0 (#4122) + DietPi-Backup / DietPi-Sync | Link changed from phpBB to dietpi.com/docs --- dietpi/dietpi-backup | 2 +- dietpi/dietpi-sync | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index b1b4698245..f5637f5290 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -353,7 +353,7 @@ _EOF_ 'Help') G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system. \nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup. \nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore. -\nMore information: https://dietpi.com/docs/dietpi_tools/#update-backup";; +\nMore information: https://dietpi.com/docs/dietpi_tools/#dietpi-backup-backuprestore";; 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && rm -R "$FP_TARGET";; diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 26d1de7f28..a9655fb1c9 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -325,7 +325,7 @@ _EOF_ For example: If we want to duplicate (sync) the data on our external USB HDD to another location, we simply select the USB HDD as the source, then, select a target location. The target location can be anything from a networked samba fileserver, or even an FTP server.\n Each sync includes a leading dry run, after which you can check the expected result before deciding if you want to continue with the actual sync.\n -More information:\n - https://dietpi.com/phpbb/viewtopic.php?p=256#p256' +More information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-sync' ;; From bb226bc80cb5770fdf165d4bb66d57d6c977663a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 01:07:43 +0100 Subject: [PATCH 159/218] v7.0 + DietPi-Software | Python 3 pip: Fix get-pip.py download: Download_Install() does not require a target path anymore. When none is given, or the target name matches the downloaded file name, it will simply downloaded to the working directory. --- dietpi/dietpi-software | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b790cfbe2b..18cae4a199 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3053,10 +3053,7 @@ _EOF_ G_EXEC 7zr x -y "$file" ${target:+"-o$target"} - else - - # For all other types a target must be given to move/rename the download - G_EXEC_DESC="Verifying download target: ${target:-missing!}" G_EXEC test "$target" + elif [[ $target != "$file" ]]; then # Pre-create target dir, if given local fp_dir @@ -3068,7 +3065,7 @@ _EOF_ fi - [[ -f $file ]] && G_EXEC rm "$file" + [[ $target != "$file" && -f $file ]] && G_EXEC rm "$file" unset -v fallback_url dps_index no_check_url } @@ -7223,7 +7220,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas # Perform pip3 installation INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' (( $G_DISTRO > 4 )) || INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/3.5/get-pip.py' # https://pip.pypa.io/en/stable/news/#id1 - DEPS_LIST='python3-dev' Download_Install "$INSTALL_URL_ADDRESS" get-pip.py + DEPS_LIST='python3-dev' Download_Install "$INSTALL_URL_ADDRESS" G_EXEC_OUTPUT=1 G_EXEC python3 ./get-pip.py G_EXEC_NOHALT=1 G_EXEC rm get-pip.py From a47f9ce1c782ef57e312dc817ddc9efc23887e0f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 12:31:26 +0100 Subject: [PATCH 160/218] v7.0 + DietPi-Set_hardware | soundcard: Fix a bug on current Debian Buster ALSA packages so that the ALSA daemon only starts when its configuration file exists, rather than when it does not exist, in which case the ALSA restore oneshot service restores control states already. This bug was introduced with Buster and fixed with Bullseye. + DietPi-Set_hardware | soundcard: Remove the obsolete workaround for the other Buster-introduced bug where control states were the ALSA restore oneshot service was not started when control states did not exist, which means that service as well did never store states on shutdown. The faulty condition has been removed, inducing the above other bug in the same turn, but at least the restore service is now active in any case. --- dietpi/func/dietpi-set_hardware | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 3ff136664f..f3331197c3 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -2203,9 +2203,13 @@ ctl.!default { _EOF_ fi - # Store control states once and force restore service, to assure it is active (states preserved) for next reboot + # Store control states once to assure they are not lost on ungraceful shutdown G_EXEC alsactl -g store - G_EXEC systemctl restart alsa-restore + + # Buster: Avoid alsa-state.service start if its config file does not exist: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932209 + (( $G_DISTRO == 5 )) || return + G_EXEC mkdir -p /etc/systemd/system/alsa-state.service.d + echo -e '[Unit]\nConditionPathExists=\nConditionPathExists=/etc/alsa/state-daemon.conf' > /etc/systemd/system/alsa-state.service.d/dietpi.conf } From 301b16b42a0e0128a1a6842c8c0fd8df4fb21eb6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 12:34:05 +0100 Subject: [PATCH 161/218] v7.0 + DietPi-Patch | Remove obsolete ALSA control store step --- dietpi/patch_file | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 45b45dd4a8..e10016286f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1761,13 +1761,7 @@ A backup will be created to "/etc/mympd/mympd.conf.bak_DDMMYYY_N" from where you # RPi: Remove invalid I2C baudrate entries from config.txt. Do no apply any value to preserve current system state (default): https://github.com/MichaIng/DietPi/issues/2966 # RPi: Remove obsolete camera module entry, which is loaded by default since kernel 4.19, instead add a blacklist entry if camera is disabled. # RPi: Further config.txt fixes: https://github.com/MichaIng/DietPi/pull/3000 - if [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]]; then - - alsactl store - systemctl restart alsa-restore - rm /var/lib/dietpi/postboot.d/sparky_unmute.sh - - fi + [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]] && rm /var/lib/dietpi/postboot.d/sparky_unmute.sh [[ -f '/etc/systemd/system/rpi-bcm2835_forced_3.5mm.service' ]] && rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service if (( $G_HW_MODEL < 10 )); then From e3eb44e417964410b52cc372e412a93bf9ec02ec Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 12:37:46 +0100 Subject: [PATCH 162/218] v7.0 + DietPi-Software | ALSA: On uninstall, remove our alsa-state.service fix --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 18cae4a199..05b2daa018 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15834,6 +15834,7 @@ _EOF_ Banner_Uninstalling G_AGP alsa-utils + [[ -d '/etc/systemd/system/alsa-state.service.d' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /etc/systemd/system/alsa-state.service.d fi From 6880316a53db5af26a3eea67e65259baf30950ec Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 12:41:44 +0100 Subject: [PATCH 163/218] v7.0 + DietPi-PREP | Satisfy shellcheck: We remove system directories intentionally here to be freshly restored with the package reinstall and reconfiguration below --- PREP_SYSTEM_FOR_DIETPI.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 0ae98aba76..7d92fdd8e2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1354,6 +1354,7 @@ _EOF_' echo -e "NFS client: $info_use_drive_manager" > /mnt/nfs_client/readme.txt G_DIETPI-NOTIFY 2 'Restoring default base files:' + # shellcheck disable=SC2114 rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail G_AGI -o 'Dpkg::Options::=--force-confmiss,confnew' --reinstall base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home G_EXEC /var/lib/dpkg/info/base-files.postinst configure # Restore /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail From 32c9d475fa5d5497c702f462690ad758ae0a58ab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 12:43:46 +0100 Subject: [PATCH 164/218] v7.0 + DietPi-Survey_report | Assure that unset array entries are not glob expanded --- .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 d3c317617f..fe9774473e 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -409,8 +409,8 @@ do aSOFTWARE_NAME6_26[$i]=${aSOFTWARE_NAME6_25[$i]} done - unset -v aSOFTWARE_NAME6_26[27] # TightVNC: Replaced by TigerVNC on Stretch+ - unset -v aSOFTWARE_NAME6_26[140] # SDL2: Merged into Amiberry for targeted minimal install + unset -v 'aSOFTWARE_NAME6_26[27]' # TightVNC: Replaced by TigerVNC on Stretch+ + unset -v 'aSOFTWARE_NAME6_26[140]' # SDL2: Merged into Amiberry for targeted minimal install # v6.27 @@ -464,9 +464,9 @@ do aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} done - unset -v aSOFTWARE_NAME6_34[62] # DietPi-CloudShell - unset -v aSOFTWARE_NAME6_34[134] # Tonido - unset -v aSOFTWARE_NAME6_34[137] # CloudPrint + unset -v 'aSOFTWARE_NAME6_34[62]' # DietPi-CloudShell + unset -v 'aSOFTWARE_NAME6_34[134]' # Tonido + unset -v 'aSOFTWARE_NAME6_34[137]' # CloudPrint aSOFTWARE_NAME6_34[181]='PaperMC' aSOFTWARE_NAME6_34[182]='Unbound' aSOFTWARE_NAME6_34[183]='Bitwarden_RS' From b092b1b629f100120c9c30c98c903e26b46ca79b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 13:21:37 +0100 Subject: [PATCH 165/218] v7.0 + DietPi-Software | Docker: Install the APT repository manually. It is trivial and the Docker installer does nothing else than obtaining the distribution and package manager. This allows us to enable the install option on Debian Bullseye by keep using the Buster repository, which should work fine, at least for testing purpose. + DietPi-Software | Add further use of G_EXEC where applicable --- dietpi/dietpi-software | 55 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 05b2daa018..518d7a714c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1354,8 +1354,6 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker' - # - Bullseye: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 #------------------ software_id=185 @@ -1364,8 +1362,6 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#portainer' - # - Bullseye - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 #------------------ software_id=134 @@ -1374,8 +1370,6 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' - # - Bullseye: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 # Remote Access #-------------------------------------------------------------------------------- @@ -2282,10 +2276,10 @@ _EOF_ if [[ ${aSOFTWARE_INSTALL_STATE[162]} == 1 && ! -d /lib/modules/$(uname -r) ]] then G_WHIP_MSG '[WARNING] Docker install will be deselected -\nIt seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install. -\nPlease reselect Docker from dietpi-software after next reboot.' +\nIt seems that your kernel has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install. +\nPlease reselect Docker from dietpi-software after next reboot, or run: +# dietpi-software install 162' aSOFTWARE_INSTALL_STATE[162]=0 - (( ${aSOFTWARE_INSTALL_STATE[185]} == 1 )) && aSOFTWARE_INSTALL_STATE[185]=0 fi @@ -6251,13 +6245,19 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Offical installer - INSTALL_URL_ADDRESS='https://get.docker.com' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o DockerInstall.sh - G_EXEC chmod +x DockerInstall.sh - G_EXEC_DESC='Running Docker installer' G_EXEC_OUTPUT=1 G_EXEC ./DockerInstall.sh - G_EXEC_NOFAIL=1 G_EXEC rm DockerInstall.sh + # Detect distro + local distro='debian' + (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )) && distro='raspbian' + + # Install APT repo key + G_EXEC eval "curl -sSfL 'https://download.docker.com/linux/$distro/gpg' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" + + # Install APT repo list + G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ ${G_DISTRO_NAME/bullseye/buster} stable' > /etc/apt/sources.list.d/docker.list" + G_AGUP + + # Install Docker + G_AGI docker-ce fi @@ -12741,17 +12741,17 @@ _EOF_ Banner_Configuration - # Set docker service to 'simple': https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 - mkdir -p /lib/systemd/system/docker.service.d + # Set Docker service to "simple": https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 + G_EXEC mkdir -p /lib/systemd/system/docker.service.d echo -e '[Service]\nType=simple' > /lib/systemd/system/docker.service.d/dietpi-simple.conf # Config: https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file - # - Move docker containers to dietpi_userdata + # - Move Docker containers to dietpi_userdata # - Log to systemd-journald (journalctl) by default with reduced log level: https://github.com/MichaIng/DietPi/issues/2388 # + containerd: https://github.com/docker/docker.github.io/issues/9091 G_CONFIG_INJECT '\[debug\]' '[debug]' /etc/containerd/config.toml GCI_PRESERVE=1 G_CONFIG_INJECT 'level[[:blank:]]*=' ' level = "warn"' /etc/containerd/config.toml '^\[debug\]' - mkdir -p /mnt/dietpi_userdata/docker-data + G_EXEC mkdir -p /mnt/dietpi_userdata/docker-data if [[ -f '/etc/docker/daemon.json' ]]; then GCI_PRESERVE=1 G_CONFIG_INJECT '"data-root":' ' "data-root": "/mnt/dietpi_userdata/docker-data",' /etc/docker/daemon.json '^\{([[:space:]]|$)' @@ -12761,7 +12761,7 @@ _EOF_ else - mkdir -p /etc/docker + G_EXEC mkdir -p /etc/docker echo '{ "data-root": "/mnt/dietpi_userdata/docker-data", "log-driver": "journald", @@ -15459,18 +15459,19 @@ _EOF_ # Remove docker, all its unused dependencies and custom repository G_AGP docker-ce docker-ce-cli docker-engine - [[ -f '/etc/apt/sources.list.d/docker.list' ]] && rm /etc/apt/sources.list.d/docker.list + [[ -f '/etc/apt/sources.list.d/docker.list' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/apt/sources.list.d/docker.list + [[ -f '/etc/apt/trusted.gpg.d/dietpi-docker.gpg' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-docker.gpg # Remove service adjustments - [[ -d '/lib/systemd/system/docker.service.d' ]] && rm -R /lib/systemd/system/docker.service.d + [[ -d '/lib/systemd/system/docker.service.d' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /lib/systemd/system/docker.service.d # Delete data files - dietpi - [[ -d '/mnt/dietpi_userdata/docker-data' ]] && rm -R /mnt/dietpi_userdata/docker-data + [[ -d '/mnt/dietpi_userdata/docker-data' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /mnt/dietpi_userdata/docker-data # Remove default unused folder - [[ -d '/var/lib/docker' ]] && rm -R /var/lib/docker + [[ -d '/var/lib/docker' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /var/lib/docker # Remove configuration file - [[ -d '/etc/docker' ]] && rm -R /etc/docker + [[ -d '/etc/docker' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /etc/docker - # Set portainer as not installed + # Set Portainer as not installed aSOFTWARE_INSTALL_STATE[185]=0 fi From e558f1d546151b0c7037185e65abb38a9076ffb6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 14:06:40 +0100 Subject: [PATCH 166/218] v7.0 + DietPi-Network | Override ifup@.service type to give network(-online).target more meaning and remove obsolete ifquery call: https://github.com/MichaIng/DietPi/issues/4121#issuecomment-782057374 --- rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf diff --git a/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf b/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf new file mode 100644 index 0000000000..f168af15b5 --- /dev/null +++ b/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf @@ -0,0 +1,4 @@ +# Override service type to give network(-online).target more meaning and remove obsolete ifquery call: https://github.com/MichaIng/DietPi/issues/4121#issuecomment-782057374 +[Service] +Type=oneshot +ExecStart=ifup --allow=hotplug %I From 243135f9d116bcb478e71073bc62e3c9cb474484 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 14:13:27 +0100 Subject: [PATCH 167/218] v7.0 + DietPi-Boot | Allow service to start earlier that that it's wait for network and time sync can overlap with ifup@.service / networking.service WiFi connection establishing, DHCP leases etc. network.target + network-online.target are now both delayed until ifup@.service has finished, so that all network-related services would stack up too much. --- rootfs/etc/systemd/system/dietpi-boot.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index e4d6982a83..30138dde98 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -2,7 +2,7 @@ Description=DietPi-Boot # Order 3 Requisite=dietpi-preboot.service -After=dietpi-preboot.service network.target +After=dietpi-preboot.service network-pre.target Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.service [Service] From a7adf5671e87aead6dd97189292f6d958abcfff4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 14:48:32 +0100 Subject: [PATCH 168/218] v7.0 + CHANGELOG | Network: A change has been implemented on the order in which network-related systemd service targets are reached + CHANGELOG | Add a release PR URL --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c63bd65285..dc4fa32c18 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v7.0 Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. +- Network | A change has been implemented on the order in which network-related systemd service targets are reached. "network.target" and "network-online.target" are now reach after all network interfaces have been configured, rather then already after only the loopback interface "lo" has been configured. This affects only systemd services which are not started by DietPi-Services, e.g. SSH/DNS/VPN/VNC servers, with the effect that they are assured to be able to bind to interfaces/IPs, where currently they would fail. The downside is, if one has an Ethernet adapter configured via dietpi-config or /etc/network/interfaces (as allow-hotplug device), but the cable not connected, affected services may be delayed until the interface bring-up timed out. - DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 - DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. @@ -35,7 +36,7 @@ Fixes: - DietPi-Software | Resolved an issue where for ruTorrent, Koel and Bitwarden_RS the automatic newest version detection failed and instead a possibly older fallback was used. Many thanks to @kelvmod for reporting this issue: https://github.com/MichaIng/DietPi/issues/4105 - DietPi-Software | LXQt: Resolved visual issues with our default configuration of Debian Buster, drastically simplified and cleaned up the files we ship. -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/4XXX +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/4126 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 c887f608dcaf025088e46fafc9296d8504b7952b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 16:56:39 +0100 Subject: [PATCH 169/218] v7.0 + DietPi-LED_control | Minor --- dietpi/dietpi-led_control | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control index dae9817fd9..a67967cedf 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' + readonly G_PROGRAM_NAME='DietPi-LED_control' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -144,17 +144,12 @@ #----------------------------------------------------------------------------------- until (( $TARGETMENUID < 0 )) do - - if (( $TARGETMENUID == 1 )); then - + if (( $TARGETMENUID == 1 )) + then Menu_LED - else - Menu_Main - fi - done #----------------------------------------------------------------------------------- exit From 29f03eb3bb2a28de2ab8ba7abc6abddfec5951cb Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:10:11 +0100 Subject: [PATCH 170/218] Link changed from phpBB to dietpi.com/docs #3 - dietpi-cleaner --- dietpi/dietpi-cleaner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 114ac4bb3e..f61df1a455 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -87,7 +87,7 @@ G_WHIP_MSG "$G_PROGRAM_NAME is a program that allows you to remove unwanted junk from your DietPi system, freeing up filesystem space in the process.\n Simply enable the cleaners you require, then select \"Test\" to see what will happen, without modifying your system.\nOnce your satisfied with the Test results, select \"Run\" to clean your system.\n -Further information:\n - https://dietpi.com/phpbb/viewtopic.php?p=623#p623" +Further information:\n - http://localhost:8000/dietpi_tools/#dietpi-cleaner" ;; From afee1fae74309accbe2c2cd8dcbecf04c46c8437 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:14:40 +0100 Subject: [PATCH 171/218] Update dietpi-drive_manager - dietpi-drive_manager --- 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 f40903a4ac..d06ba7d094 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -1001,7 +1001,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return if (( $1 == 0 )); then - G_WHIP_MSG "[FAILED]\n\nYour DietPi userdata is currently located on this drive:\n - $FP_USERDATA_CURRENT\n\nThe requested option for this drive is not currently possible.\n\nPlease move your userdata elsewhere, before trying again:\nhttps://dietpi.com/phpbb/viewtopic.php?t=478" + G_WHIP_MSG "[FAILED]\n\nYour DietPi userdata is currently located on this drive:\n - $FP_USERDATA_CURRENT\n\nThe requested option for this drive is not currently possible.\n\nPlease move your userdata elsewhere, before trying again:\nhttps://dietpi.com/docs/dietpi_tools/#quick-selections" elif (( $1 == 1 )); then @@ -1645,7 +1645,7 @@ NB: If you are planning to dedicate the drive to this system, it is recommended G_WHIP_DEFAULT_ITEM=$FORMAT_FILESYSTEM_TYPE if G_WHIP_MENU 'Please select a filesystem type for this format:\n\nEXT4:\nHighly recommended if you plan to use this drive solely on this system (dedicated drive).\n -NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU usage during transfers.\n\nFull list of different filesystem types:\nhttps://dietpi.com/phpbb/viewtopic.php?p=2898#p2898'; then +NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU usage during transfers.\n\nFull list of different filesystem types:\nhttps://dietpi.com/docs/dietpi_tools/#dietpi-drive-manager'; then # Install FS pre-reqs # - NTFS From 6db54697fdff968038b093bf4363c0f5d6d09f9c Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:25:28 +0100 Subject: [PATCH 172/218] Links in dietpi-software --- dietpi/dietpi-software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfc51297f7..d7ca9420b3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16553,7 +16553,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[68]} == 1 )); then G_WHIP_MSG 'Remot3.it requires you to create an online account, and, link it this device. -\nOnce 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' +\nOnce DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/docs/software/remote_desktop/#remot3it' fi @@ -16561,7 +16561,7 @@ _EOF_ 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?p=1062#p1062' + - 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/docs/software/system_security/#lets-encrypt' fi @@ -16570,7 +16570,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then 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 +\n - More information:\nhttps://dietpi.com/docs/software/advanced_networking/#no-ip'; then # Write installed states to temp Write_InstallFileList temp @@ -16932,7 +16932,7 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Back' if G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc. -\nMore information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087 +\nMore information on user data in DietPi:\n- https://dietpi.com/docs/dietpi_tools/#quick-selections \n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.'; then # DriveMan @@ -17004,7 +17004,7 @@ _EOF_ 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?p=1549#p1549: + if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/docs/software/webserver_stack/#stacks-for-web-development: \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 @@ -17096,7 +17096,7 @@ Welcome to DietPi: Use PageUp/Down or Arrow Up/Down to scroll this help screen. Press ESC, or TAB then enter to exit this help screen.\n Easy to follow, step by step guides for installing DietPi: -https://dietpi.com/phpbb/viewtopic.php?f=8&t=9\n +https://dietpi.com/docs/getting_started/\n For a list of all installation options and their details: https://dietpi.com/software\n ─────────────────────────────────────────────────────────────── From 401e053b734b3412115300d4c154eb5114778d02 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:26:35 +0100 Subject: [PATCH 173/218] Links in dietpi-survey --- dietpi/dietpi-survey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 708ad0ae9b..af3dd16b14 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -15,7 +15,7 @@ # - Runs after every dietpi-update and dietpi-software install, if user opted in # - Summary can be visited at: https://dietpi.com/survey/ # - Allows the DietPi project to focus development based on popularity - # - Further info: https://dietpi.com/phpbb/viewtopic.php?p=34#p34 + # - Further info: https://dietpi.com/docs/dietpi_tools/#dietpi-survey # # Usage: # - /boot/dietpi/dietpi-survey Interactive menu to opt in or out From 5e49cc7a31ba9d23b18aed00a42c92d3ae1e6482 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:27:42 +0100 Subject: [PATCH 174/218] Links in dietpi-sync --- dietpi/dietpi-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 26d1de7f28..a9655fb1c9 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -325,7 +325,7 @@ _EOF_ For example: If we want to duplicate (sync) the data on our external USB HDD to another location, we simply select the USB HDD as the source, then, select a target location. The target location can be anything from a networked samba fileserver, or even an FTP server.\n Each sync includes a leading dry run, after which you can check the expected result before deciding if you want to continue with the actual sync.\n -More information:\n - https://dietpi.com/phpbb/viewtopic.php?p=256#p256' +More information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-sync' ;; From ede38b38d7e5db2934d5703e3a81075b1710293e Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:31:39 +0100 Subject: [PATCH 175/218] Links in dietpi-backup --- dietpi/dietpi-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 38c9876d4e..f1c3384f8f 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -380,7 +380,7 @@ _EOF_ 'Help') - G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system.\n\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup.\n\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255" + G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system.\n\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup.\n\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore.\n\nMore information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-backup-backuprestore" ;; From f020393006e23d01d1aec1df74a3f38f24507905 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 19 Feb 2021 18:34:11 +0100 Subject: [PATCH 176/218] Links in dietpi-globals --- 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 f559dcbb3c..876627ac75 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1701,7 +1701,7 @@ $log_content" || break # Exit error handler menu loop on cancel [[ $G_PROMPT_BACKUP_DISABLED == 1 ]] && return 0 - 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 + 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/docs/dietpi_tools/#dietpi-backup-backuprestore' || return 0 /boot/dietpi/dietpi-backup 1 local exit_code=$? From 75c00f1b382045082b686b9ecc2028b2a5a48409 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Feb 2021 19:02:12 +0100 Subject: [PATCH 177/218] v7.0 + DietPi-Cleaner | Fix docs URL --- dietpi/dietpi-cleaner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index f61df1a455..3b9a0b0b4e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -87,7 +87,7 @@ G_WHIP_MSG "$G_PROGRAM_NAME is a program that allows you to remove unwanted junk from your DietPi system, freeing up filesystem space in the process.\n Simply enable the cleaners you require, then select \"Test\" to see what will happen, without modifying your system.\nOnce your satisfied with the Test results, select \"Run\" to clean your system.\n -Further information:\n - http://localhost:8000/dietpi_tools/#dietpi-cleaner" +Further information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-cleaner" ;; From 07dc022e549c47964909670adc6f20eb07a014e5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Feb 2021 19:12:54 +0100 Subject: [PATCH 178/218] v7.0 + CHANGELOG | Docker: The Docker APT repository is now installed manually instead of using the official Docker installer + CHANGELOG | Audio: Resolved a bug with Debian Buster, where the ALSA state daemon was always running, even when it was not configured --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dc4fa32c18..e026e62f2c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Changes: - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 +- DietPi-Software | Docker: The Docker APT repository is now installed manually instead of using the official Docker installer. This allows us to enable the Docker install option for Debian Bullseye systems, if only to allow widened testing of this upcoming Debian release with DietPi. Interface Changes: - DietPi-Banner | Running the script without input argument will now open the menu instead of printing the banner. The console alias has been adjusted accordingly, so that it is now possible to run "dietpi-banner 0" and "dietpi-banner 1" from console to have full and short banner versions printed. The "dietpi-banner" console command remains opening the menu. @@ -22,6 +23,7 @@ New Software: - DietPi-Software | mjpg-streamer: Lightweight multi-source and multi-output plugin JPEG streamer, now available for install. By default your attached camera capture will be streamed to a custom HTTP port. When installed along with OctoPrint, both will be automatically configured to work together. The Raspberry Pi camera module support is enabled by default, when installed on Raspberry Pi. Fixes: +- Audio | Resolved a bug with Debian Buster, where the ALSA state daemon was always running, even when it was not configured. - DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 - DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. - DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 From 27f3011e09d488092723b1023d0c6c3071fe49f6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Feb 2021 22:02:33 +0100 Subject: [PATCH 179/218] v7.0 + DietPi-Config | Instead of adding regular WiFi settings, then in case of hotspot, removing them and adding hotspot configs, create only Ethernet config first, then add either regular WiFi or hotspot config, based on choice. + DietPi-Config | Do not add loopback interface config, as ifup configures this internally automatically --- dietpi/dietpi-config | 57 ++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 4b0894dab7..8cd602b7df 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2221,15 +2221,15 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Drop Connections G_DIETPI-NOTIFY 0 'Dropping connections, please wait...' - ifdown eth$ETH_DEV_INDEX --force &> /dev/null - ifdown wlan$WIFI_DEV_INDEX --force &> /dev/null + ifdown eth$ETH_DEV_INDEX --force 2> /dev/null + ifdown wlan$WIFI_DEV_INDEX --force 2> /dev/null # Kill dhclient - killall dhclient &> /dev/null + killall dhclient 2> /dev/null - # Flush, not viable to handle this if change of IP, requires a detect of SSH loss/ip change, then exit script. - # - ip addr flush dev eth$ETH_DEV_INDEX &> /dev/null - # - ip addr flush dev wlan$WIFI_DEV_INDEX &> /dev/null + # Flush, not viable to handle this if change of IP, requires a detect of SSH loss/IP change, then exit script. + #ip a flush dev eth$ETH_DEV_INDEX &> /dev/null + #ip a flush dev wlan$WIFI_DEV_INDEX &> /dev/null # Restart Networking G_DIETPI-NOTIFY 2 'Restarting network, please wait...' @@ -2242,7 +2242,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Restart all services (required for hotspot) /boot/dietpi/dietpi-services start - # - Add a little delay to ensure all network device data are updated (eg: SSID current takes a little longer) + # Add a little delay to ensure all network device data are updated (eg: SSID current takes a little longer) G_DIETPI-NOTIFY 2 'Reloading networking data, please wait...' sleep 2 @@ -2251,8 +2251,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR G_DIETPI-NOTIFY 0 'Network restarted' - if [[ $ETH_MODE_TARGET == 0 && $ETH_IP != "$ETH_IP_STATIC" ]] || - [[ $WIFI_MODE_TARGET == 0 && $WIFI_IP != "$WIFI_IP_STATIC" ]]; then + if [[ $ETH_MODE_TARGET == 0 && $ETH_IP != "$ETH_IP_STATIC" ]] || [[ $WIFI_MODE_TARGET == 0 && $WIFI_IP != "$WIFI_IP_STATIC" ]]; then G_WHIP_MSG 'IP STATIC address change detected. A reboot is required to apply the new IP.\n\nPlease reboot the system.' REBOOT_REQUIRED=1 @@ -2314,6 +2313,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR fi + # Create interface config cat << _EOF_ > /etc/network/interfaces # Location: /etc/network/interfaces # Please modify network settings via: dietpi-config @@ -2322,10 +2322,6 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Drop-in configs source interfaces.d/* -# Local -auto lo -iface lo inet loopback - # Ethernet ${eth_enabled_text}allow-hotplug eth$ETH_DEV_INDEX iface eth$ETH_DEV_INDEX inet $eth_dhcp_static_text @@ -2336,46 +2332,45 @@ ${eth_dns_text}dns-nameservers $ETH_DNS # WiFi ${wifi_enabled_text}allow-hotplug wlan$WIFI_DEV_INDEX -iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text -address $WIFI_IP -netmask $WIFI_MASK -gateway $WIFI_GATEWAY -${wifi_dns_text}dns-nameservers $WIFI_DNS -wireless-power off -wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf _EOF_ - - # - Additional settings/changes, required for hotspot mode + # WiFi Hotspot if (( $WIFI_HOTSPOT )); then - # - Remove all entries below wlan, so we can recreate them. - sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces - cat << _EOF_ >> /etc/network/interfaces iface wlan$WIFI_DEV_INDEX inet static address 192.168.42.1 netmask 255.255.255.0 #gateway 192.168.0.1 -wireless-power off #dns-nameservers 9.9.9.9 149.112.112.112 +wireless-power off # IP tables up iptables-restore < /etc/iptables.ipv4.nat _EOF_ - + # WiFi client + else + cat << _EOF_ >> /etc/network/interfaces +iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text +address $WIFI_IP +netmask $WIFI_MASK +gateway $WIFI_GATEWAY +${wifi_dns_text}dns-nameservers $WIFI_DNS +wireless-power off +wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf +_EOF_ fi - # - Remove wireless-power setting, if not supported by adapter/firmware - iwconfig wlan$WIFI_DEV_INDEX power off &> /dev/null || sed -i '/^wireless-power/d' /etc/network/interfaces + # Remove wireless-power setting, if not supported by adapter/firmware + iwconfig wlan$WIFI_DEV_INDEX power off 2> /dev/null || sed -i '/^wireless-power/d' /etc/network/interfaces - # - Update WiFi db/wpa_supplicant + # Update WiFi db/wpa_supplicant /boot/dietpi/func/dietpi-wifidb 1 # Update Current Mode for network restart ETH_MODE=$ETH_MODE_TARGET WIFI_MODE=$WIFI_MODE_TARGET - # Restart net + # Restart network Network_Restart } From eb956a13f0b36d2ef5c112a0ccad4460893e1e88 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Feb 2021 22:13:23 +0100 Subject: [PATCH 180/218] v7.0 + Network | Do not statically add udev rule to disable WiFi adapter power savings. Our interfaces config contains "wireless-power off" which invokes iwconfig on ifup to do exactly that (same command, same arguments), when the interface is brought up. In case of inactive WiFi adapters, power savings do not hurt or might be even save power ;). With Debian Bullseye, wireless-tools (iwconfig) has been deprecated in favour of iw. As long as we do not face many older adapters to not support iw, we might drop wireless-tools, invalidating the "wireless-power" interface setting, so that we need to find an own implementation, either via udev rule or /etc/network/if-pre-up-d/. --- rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules | 1 - 1 file changed, 1 deletion(-) delete mode 100644 rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules diff --git a/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules b/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules deleted file mode 100644 index bb9e43bb49..0000000000 --- a/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="net", KERNEL=="wlan*", ACTION=="add", RUN+="/sbin/iwconfig %k power off" From b4333707788f7f67e8eb731ff32cfd94f9896233 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Feb 2021 22:26:33 +0100 Subject: [PATCH 181/218] v7.0 + DietPi-Patches | Remove obsolete udev rule, as WiFi power saving is disabled via /etc/network/intefaces > "wireless-power off" > /etc/network/if-pre-up.d/wireless-tools (wireless-tools package) when the WiFi interface is configured. --- .update/patches | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.update/patches b/.update/patches index 63624b2127..954a146cba 100644 --- a/.update/patches +++ b/.update/patches @@ -3,5 +3,9 @@ # DietPi-Update incremental patches to apply system and software migrations and fixes # Created by MichaIng / micha@dietpi.com / https://dietpi.com/ # License: GPLv2 / https://github.com/MichaIng/DietPi#license + +# Remove obsolete udev rule, as WiFi power saving is disabled via /etc/network/intefaces > "wireless-power off" > /etc/network/if-pre-up.d/wireless-tools (wireless-tools package) when the WiFi interface is configured. +[[ -f '/etc/udev/rules.d/10-wifi-disable-powermanagement.rules' ]] && rm -v /etc/udev/rules.d/10-wifi-disable-powermanagement.rules + exit 0 } From a1ecafb70f5d6aa207d785caaeeeb06f352d4ca7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Feb 2021 13:53:33 +0100 Subject: [PATCH 182/218] v7.0 + DietPi-Globals | G_OBTAIN_CPU_TEMP: Do not trust negative temperature readouts and add an additional tunable for Roseapple Pi. This may fix as well temperature estimation on OrangePi's. --- dietpi/func/dietpi-globals | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 071a96ff2e..bddabb132f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1469,7 +1469,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 - if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then + if [[ $G_HW_MODEL == 70 || $G_HW_MODEL == 52 ]]; then [[ -f '/sys/class/thermal/thermal_zone1/temp' ]] && temp=$( Date: Sun, 21 Feb 2021 13:58:12 +0100 Subject: [PATCH 183/218] v7.0 + CHANGELOG | G_OBTAIN_CPU_TEMP: Negative temperatures are not trusted anymore, "N/A" will be printed instead --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e026e62f2c..978064c477 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,6 +24,7 @@ New Software: Fixes: - Audio | Resolved a bug with Debian Buster, where the ALSA state daemon was always running, even when it was not configured. +- DietPi-Globals | G_OBTAIN_CPU_TEMP: Negative temperatures are not trusted anymore, "N/A" will be printed instead. This allows a generic approach to fix/allow temperature estimation on further SBC models. Many thanks to @Thanapat for reporting a related issue on Roseapple Pi: https://dietpi.com/phpbb/viewtopic.php?t=8677 - DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 - DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. - DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 From 27496dcf604bd44603bb3772c7354d080f5b321b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Feb 2021 14:18:42 +0100 Subject: [PATCH 184/218] DietPi-Software | Node-RED: Switch to a local service user install (#4124) + DietPi-Software | Node-RED: Switch to a local service user install right into /mnt/dietpi_userdata/node-red/node_modules. This allows Node-RED to control core modules as well. Additionally add a console alias for the admin CLI which invokes the service user instance via sudo. Also do not install Python 2 anymore, everything should now work with Python 3. --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 91 +++++++++++++++++++++++------------------- 2 files changed, 51 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 978064c477..d5679489ef 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Changes: - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 +- DietPi-Software | Node-RED: New installs and reinstalls with setup Node-RED as local module for the "nodered" service user, rather than as global system module/command. This allows upgrading and removing all related Node modules through the web interface, instead of just the ones which were installed via web interface. Additionally a console alias for the "node-red-admin" CLI command has been added so that running this command with any user will call the local Node-RED instance as "nodered" service user. - DietPi-Software | Docker: The Docker APT repository is now installed manually instead of using the official Docker installer. This allows us to enable the Docker install option for Debian Bullseye systems, if only to allow widened testing of this upcoming Debian release with DietPi. Interface Changes: @@ -43,7 +44,6 @@ As always, many smaller code performance and stability improvements, visual and 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 -- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 - 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/Radarr/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 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f4655ab30a..5c9d810f77 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4503,16 +4503,44 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf software_id=122 # Node-RED if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # Pre-configure user and data directory to allow a local service user install + + # Data dir + G_EXEC mkdir -p /mnt/dietpi_userdata/node-red + + # User + Create_User -G gpio,i2c -d /mnt/dietpi_userdata/node-red nodered + # - Allow sudo calls + echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered + + # Permissions + G_EXEC chown -R nodered:nodered /mnt/dietpi_userdata/node-red + + # Service + cat << '_EOF_' > /etc/systemd/system/node-red.service +[Unit] +Description=Node-RED (DietPi) + +[Service] +User=nodered +ExecStart=/mnt/dietpi_userdata/node-red/node_modules/.bin/node-red -u /mnt/dietpi_userdata/node-red +[Install] +WantedBy=multi-user.target +_EOF_ # Pre-reqs - local apackages=('python' 'python3') + local apackages=('python3') # - RPi: GPIO control for Node-RED - (( $G_HW_MODEL > 9 )) || apackages+=('python-rpi.gpio') + (( $G_HW_MODEL > 9 )) || apackages+=('python3-rpi.gpio') G_AGI "${apackages[@]}" - # Serialport fails to build unless below flags are provided - G_EXEC_OUTPUT=1 G_EXEC npm i -g --unsafe-perm node-red + # Install as local instance for "nodered" user + G_EXEC cd /mnt/dietpi_userdata/node-red + G_EXEC_OUTPUT=1 G_EXEC sudo -u nodered npm i node-red + G_EXEC cd /tmp/$G_PROGRAM_NAME + + # CLI alias + echo "alias node-red-admin='sudo -u nodered /mnt/dietpi_userdata/node-red/node_modules/.bin/node-red-admin'" > /etc/bashrc.d/dietpi-node-red.sh fi @@ -8991,36 +9019,6 @@ _EOF_ fi - software_id=122 # Node-RED - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Data dir - mkdir -p /mnt/dietpi_userdata/node-red - - # User - Create_User -G gpio,i2c -d /mnt/dietpi_userdata/node-red nodered - # - Allow sudo calls - echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered - - # Service - cat << _EOF_ > /etc/systemd/system/node-red.service -[Unit] -Description=Node-RED (DietPi) - -[Service] -User=nodered -ExecStart=$(command -v node-red) -u /mnt/dietpi_userdata/node-red - -[Install] -WantedBy=multi-user.target -_EOF_ - # Permissions - chown -R nodered:nodered /mnt/dietpi_userdata/node-red - - fi - software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -13748,6 +13746,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling + + # Service if [[ -f '/etc/systemd/system/node-red.service' ]]; then systemctl disable --now node-red @@ -13755,14 +13755,23 @@ _EOF_ fi [[ -d '/etc/systemd/system/node-red.service.d' ]] && rm -R /etc/systemd/system/node-red.service.d - npm r -g --unsafe-perm node-red + + # User getent passwd nodered > /dev/null && userdel nodered getent group nodered > /dev/null && groupdel nodered - [[ -f '/etc/sudoers.d/nodered' ]] && rm /etc/sudoers.d/nodered - [[ -d '/mnt/dietpi_userdata/node-red' ]] && rm -R /mnt/dietpi_userdata/node-red - [[ -f '/usr/local/bin/node-red' ]] && rm /usr/local/bin/node-red - [[ -f '/usr/local/bin/node-red-pi' ]] && rm /usr/local/bin/node-red-pi - rm -Rf /{root,home/*}/.node-red # Pre-v6.25 + + # Configs + [[ -f '/etc/sudoers.d/nodered' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/sudoers.d/nodered + [[ -f '/etc/bashrc.d/dietpi-node-red.sh' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/bashrc.d/dietpi-node-red.sh + + # Data + [[ -d '/mnt/dietpi_userdata/node-red' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /mnt/dietpi_userdata/node-red + G_EXEC_NOEXIT=1 G_EXEC rm -Rf /{root,home/*}/.node-red # Pre-v6.25 + + # Pre-v7.0 + npm r -g --unsafe-perm node-red + [[ -f '/usr/local/bin/node-red' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /usr/local/bin/node-red + [[ -f '/usr/local/bin/node-red-pi' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /usr/local/bin/node-red-pi fi From 960815ae8fc1a56aa6bde388d89a00e6f8f61280 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Feb 2021 00:46:39 +0100 Subject: [PATCH 185/218] v7.0 + RC up --- .update/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/version b/.update/version index e462abba26..0981a0672d 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=7 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=-1 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=-1 From 2df355ce02d5dbc4da42d1fc83286550fa79b590 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Feb 2021 00:47:07 +0100 Subject: [PATCH 186/218] v7.0 + 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 cbb92e1876..cac48e00cc 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 35 --1 +0 From 45993861593e873d8bec49f35e503bacc686a0c7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Feb 2021 00:47:38 +0100 Subject: [PATCH 187/218] v7.0 + DietPi-Globals | Increment default RC version --- 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 bddabb132f..b7137e62b1 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -66,7 +66,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From f03cc807e235c20e65625f83a9e788c9c1a77623 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Feb 2021 13:07:54 +0100 Subject: [PATCH 188/218] v7.0 + DietPi-Update | Do not apply DietPi v7 pre-patches after DietPi v6 pre-patches. Instead apply the first as part of the second, internally, to assure they run before APT- --- dietpi/dietpi-update | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 8e6ae1ef98..39f9b38341 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -201,27 +201,27 @@ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches' # DietPi v6 pre-patches, required for DietPi pre-v6.17 systems, which have DietPi-Update restarted before having these pre-patches applied. - if (( $G_DIETPI_VERSION_CORE == 6 )); then - - G_EXEC_DESC='Downloading DietPi v6 pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" + if (( $G_DIETPI_VERSION_CORE == 6 )) + then + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file - if ! ./pre-patch_file $G_DIETPI_VERSION_SUB; then - + if ! ./pre-patch_file $G_DIETPI_VERSION_SUB + then G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." exit 1 - fi + # DietPi v6 pre-patches internally apply DietPi v7 pre-patches, hence do not apply then separately. + else + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches + if ! ./pre-patches + then + G_DIETPI-NOTIFY 1 "An error occured during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + fi fi - G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" - G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches - if ! ./pre-patches; then - - G_DIETPI-NOTIFY 1 "An error occured during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." - exit 1 - - fi G_DIETPI-NOTIFY 0 'Successfully applied pre-patches' G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Upgrading APT packages' From 7937961d04248d391194000539dba37bb98fede1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Feb 2021 13:26:33 +0100 Subject: [PATCH 189/218] v7.0 + DietPi-Pre-patches | Run DietPi v7 pre-patches as part of DietPi v6 pre-patches, to assure they run before APT. --- dietpi/pre-patch_file | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 17aceb02fe..8b32f14b11 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -276,6 +276,23 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- curl -sSfL https://apt.radxa.com/buster-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes || exit 24 fi #------------------------------------------------------------------------------- + # Pre-patch 25: Run DietPi v7 pre-patches as part of DietPi v6 pre-patches, to assure they run before APT. + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 25 | Running DietPi v7 pre-patches' + # - Obtain target Git repo + if [[ -f '/DietPi/dietpi.txt' ]] + then + GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + else + GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + fi + [[ $GIT_OWNER ]] || GIT_OWNER='MichaIng' + [[ $GIT_BRANCH ]] || GIT_BRANCH='master' + curl -sSfLO "https://raw.githubusercontent.com/$GIT_OWNER/DietPi/$GIT_BRANCH/.update/pre-patches" || exit 26 + chmod +x pre-patches || exit 26 + ./pre-patches || exit 26 + #------------------------------------------------------------------------------- # Finished exit 0 #------------------------------------------------------------------------------- From 7029f4a5e7352bf27b10a521ef00bd7bd90bf295 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Feb 2021 13:34:28 +0100 Subject: [PATCH 190/218] v7.0 + DietPi-Update | Apply auto-migrated target Git branch permanently (if fetching the version file succeeded) to not cause a mismatch between the dietpi.txt entry and what the updater is downloading from. --- dietpi/dietpi-update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 39f9b38341..5724c59fe8 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -127,6 +127,7 @@ G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_DEBIAN_BRANCH" GITBRANCH_TARGET=$G_OLD_DEBIAN_BRANCH Get_Server_Version || return 1 + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH_TARGET" /boot/dietpi.txt elif (( $G_DIETPI_VERSION_CORE < $G_MIN_VERSION_CORE || ( $G_DIETPI_VERSION_CORE == $G_MIN_VERSION_CORE && $G_DIETPI_VERSION_SUB < $G_MIN_VERSION_SUB ) )) then @@ -134,6 +135,7 @@ G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_VERSION_BRANCH" GITBRANCH_TARGET=$G_OLD_VERSION_BRANCH Get_Server_Version || return 1 + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH_TARGET" /boot/dietpi.txt fi } From 2ec22fb97fe68e2317f3fe4068777f5a6412fbdc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Feb 2021 14:40:36 +0100 Subject: [PATCH 191/218] v7.0 + DietPi-Pre-patches | Update Jellyfin APT repo key, if last modified prior to expiration date: https://dietpi.com/phpbb/viewtopic.php?t=8703 --- .update/pre-patches | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.update/pre-patches b/.update/pre-patches index b8c4b9d3c5..d45596aab8 100644 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -3,5 +3,26 @@ # DietPi-Update pre-patches that need to run before new scripts are downloaded and/or before APT upgrades # Created by MichaIng / micha@dietpi.com / https://dietpi.com/ # License: GPLv2 / https://github.com/MichaIng/DietPi#license + +# Load DietPi-Globals +. /boot/dietpi/func/dietpi-globals +readonly G_PROGRAM_NAME='DietPi-Pre-patches' +G_CHECK_ROOT_USER +G_CHECK_ROOTFS_RW +G_INIT + +# IMPORTANT: This script can be called with DietPi v6.17, hence assure compatibility! +# - Pre-v6.29: Create G_EXEC as G_RUN_CMD wrapper +declare -F G_EXEC || G_EXEC(){ G_RUN_CMD "$@"; } + +# Update Jellyfin APT repo key: https://dietpi.com/phpbb/viewtopic.php?t=8703 +if [[ -f '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg' && $(date -u '+%Y%m%d' -r '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg') -lt 20201216 ]] +then + G_DIETPI-NOTIFY 2 'Updating Jellyfin APT repo key: https://dietpi.com/phpbb/viewtopic.php?t=8703' + G_EXEC curl -sSfLO 'https://repo.jellyfin.org/jellyfin_team.gpg.key' + G_EXEC gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg --yes jellyfin_team.gpg.key + G_EXEC rm jellyfin_team.gpg.key +fi + exit 0 } From c0689f1b0265495e9eb867a2435e50add692d456 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Feb 2021 17:37:57 +0100 Subject: [PATCH 192/218] v7.0 (#4138) + DietPi-Config | Add an option to toggle the SPI state on RPi --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 15 +++++++++++-- dietpi/func/dietpi-set_hardware | 39 ++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d5679489ef..e5210195be 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. - Network | A change has been implemented on the order in which network-related systemd service targets are reached. "network.target" and "network-online.target" are now reach after all network interfaces have been configured, rather then already after only the loopback interface "lo" has been configured. This affects only systemd services which are not started by DietPi-Services, e.g. SSH/DNS/VPN/VNC servers, with the effect that they are assured to be able to bind to interfaces/IPs, where currently they would fail. The downside is, if one has an Ethernet adapter configured via dietpi-config or /etc/network/interfaces (as allow-hotplug device), but the cable not connected, affected services may be delayed until the interface bring-up timed out. - DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. +- DietPi-Config | RPi: An option has been added to toggle the SPI interface. Many thanks to @incanus for resurrecting this old feature request: https://github.com/MichaIng/DietPi/issues/98#issuecomment-783650204 - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 - DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. - DietPi-Software | Uninstalls do not stop other services anymore. E.g. your webserver or media streaming server will stay active while you uninstall that other software that you don't require anymore. Since uninstalls do not require much RAM or CPU resources, this is perfectly fine. Many thanks to @mrgreaper giving the hint: https://github.com/MichaIng/DietPi/issues/4116 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 8cd602b7df..cf5e1bf340 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1263,7 +1263,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before local swap_location=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local swap_size_text="$swap_size MB" (( $swap_size )) || swap_size_text='Off' - G_WHIP_MENU_ARRAY=('Swapfile' ": [$swap_size_text | $swap_location]") + G_WHIP_MENU_ARRAY=('Swap file' ": [$swap_size_text | $swap_location]") # APT cache G_WHIP_MENU_ARRAY+=('APT cache' ': Manage APT cache/info storage') @@ -1346,6 +1346,12 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before rpi_i2c_baudrate=$(( ${rpi_i2c_baudrate:-100000} / 1000 )) G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2c_baudrate kHz]") + # SPI state + local rpi_spi_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=spi=on' /boot/config.txt) + local rpi_spi_text='Off' + (( $rpi_spi_enabled )) && rpi_spi_text='On' + G_WHIP_MENU_ARRAY+=('SPI state' ": [$rpi_spi_text]") + # USB boot option: RPi3 only and not required for RPi3+: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME != *'+'* ]]; then @@ -1362,7 +1368,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before TARGETMENUID=3 # Return to this menu - if [[ $G_WHIP_RETURNED_VALUE == 'Swapfile' ]]; then + if [[ $G_WHIP_RETURNED_VALUE == 'Swap file' ]]; then G_WHIP_YESNO 'Swapfile control has been moved to DietPi-Drive_Manager, would you like to run the application now? \nOnce finished, exit to resume DietPi-Config' && /boot/dietpi/dietpi-drive_manager @@ -1480,6 +1486,11 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr fi + elif [[ $G_WHIP_RETURNED_VALUE == 'SPI state' ]]; then + + /boot/dietpi/func/dietpi-set_hardware spi $(( ! $rpi_spi_enabled )) + REBOOT_REQUIRED=1 + elif [[ $G_WHIP_RETURNED_VALUE == 'Serial/UART' ]]; then TARGETMENUID=18 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index f3331197c3..2dc68055d0 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -21,6 +21,7 @@ $FP_SCRIPT wificountrycode GB/US/DE/... $FP_SCRIPT bluetooth enable/disable $FP_SCRIPT serialconsole enable/disable [tty(S|AMA|SAC)[0-9]] (optional Serial/UART device) $FP_SCRIPT i2c enable/disable/khz +$FP_SCRIPT spi enable/disable $FP_SCRIPT soundcard target_card (non-matching name for reset to default). Add '-eq' to target_card string to enable ALSA equalizer on card. HW:x,x (specify target card and device index eg: HW:9,1) $FP_SCRIPT remoteir odroid_remote/justboom_ir_remote # Odroid/RPi only $FP_SCRIPT lcdpanel target_panel (none to remove all) @@ -830,7 +831,7 @@ _EOF_ G_EXEC sed -i '/^[[:blank:]]*dtoverlay=ads7846,cs=1,penirq=17/d' /boot/config.txt G_EXEC sed -i '/^[[:blank:]]*dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1/d' /boot/config.txt - # - Leave these enabled, just in case the user has other hardware that may use them. + # Leave these enabled, just in case the user has other hardware that may use them. #G_EXEC sed -i '/^[[:blank:]]*dtparam=i2c_arm=/c\dtparam=i2c_arm=on' /boot/config.txt #G_EXEC sed -i '/^[[:blank:]]*dtparam=spi=/c\dtparam=spi=on' /boot/config.txt @@ -1044,6 +1045,38 @@ _EOF_ } + #///////////////////////////////////////////////////////////////////////////////////// + # SPI: https://github.com/raspberrypi/documentation/tree/master/hardware/raspberrypi/spi + #///////////////////////////////////////////////////////////////////////////////////// + SPI_Main(){ + + (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi + + if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then + + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=on' /boot/config.txt + + # Enable in runtime seems to be possible? + #dtparam spi=on + + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=off' /boot/config.txt + G_EXEC sed -i '/^[[:blank:]]*dtoverlay=spi[0-9]-[0-9]cs/d' /boot/config.txt # Alternative SPI interfaces and chip select lines + + # Disable in runtime seems to be possible? + #dtparam spi=off + + else + + Unknown_Input_Mode + + fi + + } + #///////////////////////////////////////////////////////////////////////////////////// # Bluetooth #///////////////////////////////////////////////////////////////////////////////////// @@ -2252,6 +2285,10 @@ _EOF_ I2c_Main + elif [[ $INPUT_DEVICE_NAME == 'spi' ]]; then + + SPI_Main + elif [[ $INPUT_DEVICE_NAME == 'lcdpanel' ]]; then Lcd_Panel_Main From b2c1cbf849bb4ba14fde8cd881a3f6d58948b0c0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Feb 2021 17:16:36 +0100 Subject: [PATCH 193/218] v7.0 + DietPi-Pre-patches | Remove obsolete pre-patch 4, which is overridden by pre-patch 16 --- dietpi/pre-patch_file | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 8b32f14b11..ae3cc600c0 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -76,18 +76,9 @@ fi #------------------------------------------------------------------------------- - # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings if (( $G_DIETPI_VERSION_SUB < 23 )); then - if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages' - echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || exit 4 - - fi - grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=10' >> /DietPi/dietpi.txt || exit 5 grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=2' >> /DietPi/dietpi.txt || exit 5 From bb7f6c6326bf3f2e2a9e5a3bb4e3f9349abaf9e8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Feb 2021 19:04:40 +0100 Subject: [PATCH 194/218] v7.0 + DietPi-Software | Bump a few software's minor versions --- dietpi/dietpi-software | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5c9d810f77..567d12bec3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3575,7 +3575,7 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et else - Download_Install 'https://download.phpbb.com/pub/release/3.3/3.3.2/phpBB-3.3.2.tar.bz2' + Download_Install 'https://download.phpbb.com/pub/release/3.3/3.3.3/phpBB-3.3.3.tar.bz2' G_EXEC mv phpBB3 /var/www/phpbb # Files are shipped with strange UID:GID 1000:1000 while for security reasons it should be root:root. G_EXEC chown -R root:root /var/www/phpbb @@ -4688,18 +4688,15 @@ _EOF_ software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing # http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 + Banner_Installing # https://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 # Grab architecture local arch='arm' (( $G_HW_ARCH == 10 )) && arch='amd64' - # 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 - Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS")" + # Grab latest package URL: Force HTTPS! + local fallback_url="https://downloads.slimdevices.com/LogitechMediaServer_v8.1.1/logitechmediaserver_8.1.1_$arch.deb" + Download_Install "$(curl -sSfL "https://www.mysqueezebox.com/update/?version=8.1&geturl=1&os=deb$arch" | sed 's|^http://|https://|')" fi @@ -4820,7 +4817,7 @@ _EOF_ # ARMv6: Install package manually since repo is not compatible: https://grafana.com/grafana/download?platform=arm if (( $G_HW_ARCH == 1 )); then - Download_Install 'https://dl.grafana.com/oss/release/grafana-rpi_7.3.5_armhf.deb' + Download_Install 'https://dl.grafana.com/oss/release/grafana-rpi_7.4.3_armhf.deb' # Else use official APT repo: https://grafana.com/docs/grafana/latest/installation/debian/#install-from-apt-repository else @@ -6660,7 +6657,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u local ha_user='homeassistant' local ha_home="/home/$ha_user" local ha_pyenv_activation=". $ha_home/pyenv-activate.sh" - local ha_python_version='3.8.7' + local ha_python_version='3.8.8' G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user" G_DIETPI-NOTIFY 2 "Home Assistent home: $ha_home" @@ -6947,7 +6944,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=4 + software_id=4 # Vifm if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6995,7 +6992,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=3 + software_id=3 # MC if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -9688,7 +9685,7 @@ _EOF_ [[ -f '/etc/default/logitechmediaserver' ]] && rm /etc/default/logitechmediaserver # Grant user access to DietPi media files - usermod -aG dietpi squeezeboxserver + G_EXEC usermod -aG dietpi squeezeboxserver # systemd service cat << _EOF_ > /etc/systemd/system/logitechmediaserver.service From edd549d3c7331befd5931067e3a869f98be11826 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Feb 2021 22:39:25 +0100 Subject: [PATCH 195/218] v7.0 + README | Align header with other repos, no need to define tags in markdown --- README.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 5e206174d8..431e7de79f 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ - -

- DietPi Logo -

-

- Lightweight justice for your single-board computer! -

- optimised • simplified • for everyone -

- WebsiteDocumentationView all supported platforms -

-
-

- Ready to run optimised software choices with dietpi-software -
Feature-rich configuration tool for your device with dietpi-config. -

-
- +

DietPi Logo

+

+ Lightweight justice for your single-board computer! +

+ optimised • simplified • for everyone +

+ WebsiteDocumentationView all supported platforms +

+
+

+ Ready to run optimised software choices with dietpi-software +
Feature-rich configuration tool for your device with dietpi-config. +

+
## Introduction From 805938d43fbe9dc58dcbb0855b915c6f46fcf987 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Feb 2021 22:43:14 +0100 Subject: [PATCH 196/218] v7.0 + README | Add forum link to header --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 431e7de79f..aba323a39a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

optimised • simplified • for everyone

- WebsiteDocumentationView all supported platforms + WebsiteDocumentationView all supported platformsForum


@@ -147,7 +147,7 @@ If so, let us know! We are always looking for talented people who believe in the DietPi project, and, wish to contribute in any way you can. - Send me an Email: micha@dietpi.com -- Join our forums: https://dietpi.com/phpbb/ +- Join our forum: https://dietpi.com/phpbb/ - GitHub: https://github.com/MichaIng/DietPi ### FeatHub From 32b386fe0e742856313995b38f8a9877d661b2cf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Feb 2021 14:39:28 +0100 Subject: [PATCH 197/218] v7.0 + CHANGELOG | Add forgotten changelog about piwheels.org being applied on ARMv6 and ARMv7 boards when installing pip --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e5210195be..cc91fbaa86 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Changes: - DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. - DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. - DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 +- DietPi-Software | Python 3 pip: pip and pip-based installs on ARMv6 and ARMv7 boards will have the piwheels.org repository for pre-compiled wheels added automatically, which can reduce build dependencies and compile time dramatically. - DietPi-Software | Node-RED: New installs and reinstalls with setup Node-RED as local module for the "nodered" service user, rather than as global system module/command. This allows upgrading and removing all related Node modules through the web interface, instead of just the ones which were installed via web interface. Additionally a console alias for the "node-red-admin" CLI command has been added so that running this command with any user will call the local Node-RED instance as "nodered" service user. - DietPi-Software | Docker: The Docker APT repository is now installed manually instead of using the official Docker installer. This allows us to enable the Docker install option for Debian Bullseye systems, if only to allow widened testing of this upcoming Debian release with DietPi. From 9e19c2469d0cd1a112f03c685de4996031615a0b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Feb 2021 14:52:24 +0100 Subject: [PATCH 198/218] v7.0 + DietPi-Pre-patches | Mute output of function check --- .update/pre-patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index d45596aab8..5d00232950 100644 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -13,7 +13,7 @@ G_INIT # IMPORTANT: This script can be called with DietPi v6.17, hence assure compatibility! # - Pre-v6.29: Create G_EXEC as G_RUN_CMD wrapper -declare -F G_EXEC || G_EXEC(){ G_RUN_CMD "$@"; } +declare -F G_EXEC > /dev/null || G_EXEC(){ G_RUN_CMD "$@"; } # Update Jellyfin APT repo key: https://dietpi.com/phpbb/viewtopic.php?t=8703 if [[ -f '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg' && $(date -u '+%Y%m%d' -r '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg') -lt 20201216 ]] From 7dcb8ca4d701c0a6b1cef156108d8948c9d4d17e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Feb 2021 16:21:25 +0100 Subject: [PATCH 199/218] v7.0 + DietPi-Drive_Manager | The "_netdev" mount option is not required for CIFS and Samba mounts, since systemd identifies them automatically as remote/network mounts. This option is only required when the remote/network mount cannot be identified by its file system type: http://codingberg.com/linux/systemd_when_to_use_netdev_mount_option + DietPi-Drive_Manager | Minor coding --- dietpi/dietpi-drive_manager | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 39ca513f5c..3e04250f31 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -30,8 +30,8 @@ SERVICES_STOPPED=0 G_EXIT_CUSTOM(){ (( $SERVICES_STOPPED )) && /boot/dietpi/dietpi-services start; } - # Grab input (valid interger) - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab input + [[ $1 == [134] ]] || INPUT=0 EXIT_CODE=0 @@ -65,7 +65,6 @@ aDRIVE_SIZE_TOTAL[$index]= aDRIVE_SIZE_USED[$index]= aDRIVE_SIZE_PERCENTUSED[$index]= - aDRIVE_ISFILESYSTEM[$index]=0 aDRIVE_ISMOUNTED[$index]=0 aDRIVE_ISREADONLY_CURRENTLY[$index]=0 @@ -1725,7 +1724,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u G_AG_CHECK_INSTALL_PREREQ smbclient cifs-utils # Mount now - mkdir -p "$samba_fp_mount_target" + G_EXEC mkdir -p "$samba_fp_mount_target" > $fp_tmp # - Mount attempts from highest CIFS version to lowest, until one succeeds @@ -1740,7 +1739,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Apply to 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 + 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,nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$samba_fp_mount_target Init_Drives_and_Refresh @@ -1795,14 +1794,14 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u G_AG_CHECK_INSTALL_PREREQ nfs-common netbase # Mount now - mkdir -p "$nfs_fp_mount_target" + G_EXEC mkdir -p "$nfs_fp_mount_target" > $fp_tmp 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 - echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs _netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target Init_Drives_and_Refresh @@ -1825,7 +1824,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Apply to 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 + echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target Init_Drives_and_Refresh @@ -1870,24 +1869,18 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Generate menu G_WHIP_MENU_ARRAY=() - df -Ph | tail -n +2 | sed -E '/(^udev|tmpfs)/d' > .df_out_tmp - while read -r line do G_WHIP_MENU_ARRAY+=("$(mawk '{print $6}' <<< "$line")" ": $(mawk '{print $1" | size: "$2"iB | available: "$4"iB"}' <<< "$line")") - done < .df_out_tmp - rm .df_out_tmp + done < <(df -Ph | tail -n +2 | sed -E '/(^udev|tmpfs)/d') - if G_WHIP_MENU 'Please select a mount location to use:'; then + G_WHIP_MENU 'Please select a mount location to use:' || exit 1 - G_DIETPI-NOTIFY 0 "Drive mount selected: $G_WHIP_RETURNED_VALUE" - echo "$G_WHIP_RETURNED_VALUE" > $fp_mount_selection - exit 0 - - fi - exit 1 + G_DIETPI-NOTIFY 0 "Drive mount selected: $G_WHIP_RETURNED_VALUE" + echo "$G_WHIP_RETURNED_VALUE" > $fp_mount_selection + exit 0 } From 710f81a7362f570030ed25564141b37be36b8e61 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Feb 2021 17:44:22 +0100 Subject: [PATCH 200/218] v7.0 + DietPi-Software | Fix Download_Install function when no target is given with a custom file type --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 567d12bec3..8e9a6841f1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3047,7 +3047,7 @@ _EOF_ G_EXEC 7zr x -y "$file" ${target:+"-o$target"} - elif [[ $target != "$file" ]]; then + elif [[ $target && $target != "$file" ]]; then # Pre-create target dir, if given local fp_dir @@ -3059,7 +3059,7 @@ _EOF_ fi - [[ $target != "$file" && -f $file ]] && G_EXEC rm "$file" + [[ $target && $target != "$file" && -f $file ]] && G_EXEC rm "$file" unset -v fallback_url dps_index no_check_url } From 206d169245575c52ce8cd550c21bc14e940682b2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Feb 2021 18:15:00 +0100 Subject: [PATCH 201/218] v7.0 + DietPi-Software | Really fix Download_Install: If no target path is given, but file type is an achieve, it has been extracted/installed and hence needs to be removed. Else, if either no target path has been given or it matches the downloaded file name, return the function so that we don't need to complicated logic afterwards whether the file needs to be removed or not. Luckily the optional environment variables can be unset before starting to unpack/install/move the downloaded file. --- dietpi/dietpi-software | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8e9a6841f1..f6f1878c97 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3011,6 +3011,7 @@ _EOF_ # shellcheck disable=SC2154 (( $no_check_url )) || G_CHECK_URL "$url" + unset -v fallback_url dps_index no_check_url G_EXEC cd /tmp/$G_PROGRAM_NAME # Failsafe @@ -3050,17 +3051,18 @@ _EOF_ elif [[ $target && $target != "$file" ]]; then # Pre-create target dir, if given - local fp_dir - [[ $target == *'/'* ]] && fp_dir=${target%/*} - [[ $fp_dir && ! -d $fp_dir ]] && G_EXEC mkdir -p "$fp_dir" + [[ $target == *'/'* && ! -d ${target%/*} ]] && G_EXEC mkdir -p "${target%/*}" [[ -f $target ]] && G_DIETPI-NOTIFY 2 "Updating file: $target" G_EXEC mv "$file" "$target" + else + + return + fi - [[ $target && $target != "$file" && -f $file ]] && G_EXEC rm "$file" - unset -v fallback_url dps_index no_check_url + [[ -f $file ]] && G_EXEC rm "$file" } From 568d7c26fc003e92c9b05ac5de26d148f6206d7a Mon Sep 17 00:00:00 2001 From: StephanStS Date: Fri, 26 Feb 2021 23:33:45 +0100 Subject: [PATCH 202/218] Choice of automatic login user appears too often The choice of the user for an automatic logic (with its dialog) appeared too often. Now the choice is only done in cases of automatic login (dietpi-autologin options 7 and 2). --- dietpi/dietpi-autostart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 3a44f3840d..fa42d31a31 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -120,8 +120,9 @@ _EOF_ # graphical.target Wants=display-manager.service G_EXEC ln -sf /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service - # - Enable autologin - elif (( $ID_AUTOSTART > 0 )); then + # - Enable autologin + # only for cases 7 (Local terminal - Automatic login) and 2 (Desktops - Automatic login) + elif ((( $ID_AUTOSTART == 7 )) || (( $ID_AUTOSTART == 2 ))); then # Autologin user local user=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOSTART_LOGIN_USER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) From 6a77a0fe266b74ae55e8bd234a5bab2058368df8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 01:16:32 +0100 Subject: [PATCH 203/218] v7.0 + DietPi-Autostart | Assure that if no X server has been installed yet, LightDM selection does not trigger an autologin user selection. Instead prompt a failure and inform user that an X server must be installed first. --- dietpi/dietpi-autostart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index fa42d31a31..80f9ebfee4 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -103,7 +103,7 @@ _EOF_ G_EXEC_NOHALT=1 G_AG_CHECK_INSTALL_PREREQ dbus G_EXEC_NOHALT=1 G_EXEC systemctl unmask systemd-logind - # Apply tweaks + # RPi tweaks if (( $G_HW_MODEL < 10 )); then G_CONFIG_INJECT 'boot_delay=' 'boot_delay=0' /boot/config.txt @@ -114,15 +114,15 @@ _EOF_ fi # - LightDM: Install only if startx (a desktop) is already installed. This is re-applied by dietpi-software after install automatically. - elif (( $ID_AUTOSTART == 16 )) && command -v startx > /dev/null; then + elif (( $ID_AUTOSTART == 16 )); then + command -v X > /dev/null || { G_WHIP_MSG '[FAILED] No X server has been found\n\nLightDM requires an X server. Please install a desktop or other X application first.'; return 1; } G_AG_CHECK_INSTALL_PREREQ lightdm # graphical.target Wants=display-manager.service G_EXEC ln -sf /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service - # - Enable autologin - # only for cases 7 (Local terminal - Automatic login) and 2 (Desktops - Automatic login) - elif ((( $ID_AUTOSTART == 7 )) || (( $ID_AUTOSTART == 2 ))); then + # - Enable autologin + elif (( $ID_AUTOSTART > 0 )); then # Autologin user local user=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOSTART_LOGIN_USER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) @@ -256,7 +256,7 @@ This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you ex elif [[ $ID_AUTOSTART == 14 && ! -f '/var/lib/dietpi/dietpi-autostart/custom.sh' ]]; then G_EXEC mkdir -p /var/lib/dietpi/dietpi-autostart - cat << _EOF_ > /var/lib/dietpi/dietpi-autostart/custom.sh + cat << '_EOF_' > /var/lib/dietpi/dietpi-autostart/custom.sh #!/bin/bash #---Examples--- @@ -267,10 +267,9 @@ This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you ex #startx # Print Hello -#echo "Hello" +#echo 'Hello' #---Put your code below this line--- - _EOF_ G_WHIP_MSG 'A template script has been created:\n - /var/lib/dietpi/dietpi-autostart/custom.sh\n Please edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot.' From 413717ce301f2a6ce0540a4c9a16703fc79e56f9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 02:30:22 +0100 Subject: [PATCH 204/218] v7.0 + DietPi-Software | Do not offer to install and configure No-IP from within the software selection. It will fail as of concurrent dietpi-software execution. Since this was the only reason for writing/reading a temporary install state file, this function can be removed from the code. Instead allow to configure No-IP after it has been installed. + DietPi-Software | Offer to configure DietPi-AutoStart after installs instead of before installs. We'd need to allow failing systemctl calls and others to allow this, and need to keep re-configuring DietPi-AutoStart (automated) after installs. It's better do have the ability to for error handling all required steps and hence relying on software services and binaries being available so that we can check and assure that all worked fine. Since DietPi-Software does not force a reboot after installs, this interactive step after installs have finished is pretty fine and it adds to the anyway possible GPU memory split prompt + No-IP config with above change. --- dietpi/dietpi-software | 92 +++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 60 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfc51297f7..bd5ed9e81b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -35,43 +35,33 @@ Available commands: # Filepath #///////////////////////////////////////////////////////////////////////////////////// readonly FP_INSTALLED_FILE='/boot/dietpi/.installed' - readonly FP_INSTALLED_FILE_TMP='.installed' # Used to set user/personal data directories (e.g.: usbdrive) FP_DIETPI_DEDICATED_USBDRIVE= Write_InstallFileList(){ - local fp_target=$FP_INSTALLED_FILE - local write_software_in_pending_state=0 - if [[ $1 == 'temp' ]]; then - - fp_target=$FP_INSTALLED_FILE_TMP - write_software_in_pending_state=1 - - fi - - > $fp_target + > $FP_INSTALLED_FILE # Save installed states for i in "${!aSOFTWARE_NAME[@]}" do - # Never save pending state for software (=1). Excluding temp saves. - if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 && ! $write_software_in_pending_state )); then + # Never save pending state for software (=1). + if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - echo "aSOFTWARE_INSTALL_STATE[$i]=0" >> $fp_target + echo "aSOFTWARE_INSTALL_STATE[$i]=0" >> $FP_INSTALLED_FILE else - echo "aSOFTWARE_INSTALL_STATE[$i]=${aSOFTWARE_INSTALL_STATE[$i]}" >> $fp_target + echo "aSOFTWARE_INSTALL_STATE[$i]=${aSOFTWARE_INSTALL_STATE[$i]}" >> $FP_INSTALLED_FILE fi done # Misc - cat << _EOF_ >> $fp_target + cat << _EOF_ >> $FP_INSTALLED_FILE # DietPi Choice System: SSH Server INDEX_SSHSERVER_CURRENT=$INDEX_SSHSERVER_CURRENT @@ -97,11 +87,8 @@ _EOF_ # Load Software states G_DIETPI-NOTIFY -2 'Reading database' - local fp_target=$FP_INSTALLED_FILE - [[ $1 == 'temp' ]] && fp_target=$FP_INSTALLED_FILE_TMP - # Load - [[ -f $fp_target ]] && . $fp_target + [[ -f $FP_INSTALLED_FILE ]] && . $FP_INSTALLED_FILE # Always reset choice system during first run to defaults: https://github.com/MichaIng/DietPi/issues/1122 if (( $G_DIETPI_INSTALL_STAGE == 1 )); then @@ -15903,6 +15890,31 @@ _EOF_ # Apply GPU Memory Splits Install_Apply_GPU_Settings + # No-IP configuration + (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )) && G_WHIP_YESNO 'No-IP can be setup and configured by using DietPi-Config. Would you like to complete this now? +\n - Once finished, exit DietPi-Config to finish this install. +\n - More information:\nhttps://dietpi.com/phpbb/viewtopic.php?p=58#p58' && /boot/dietpi/dietpi-config 16 1 + + # DietPi-AutoStart choice + if (( $G_DIETPI_INSTALL_STAGE == 2 )) && (( + ${aSOFTWARE_INSTALL_STATE[23]} == 1 || + ${aSOFTWARE_INSTALL_STATE[24]} == 1 || + ${aSOFTWARE_INSTALL_STATE[25]} == 1 || + ${aSOFTWARE_INSTALL_STATE[26]} == 1 || + ${aSOFTWARE_INSTALL_STATE[31]} == 1 || + ${aSOFTWARE_INSTALL_STATE[51]} == 1 || + ${aSOFTWARE_INSTALL_STATE[108]} == 1 || + ${aSOFTWARE_INSTALL_STATE[112]} == 1 || + ${aSOFTWARE_INSTALL_STATE[119]} == 1 || + ${aSOFTWARE_INSTALL_STATE[155]} == 1 || + ${aSOFTWARE_INSTALL_STATE[173]} == 1 )); then + + G_WHIP_YESNO 'Would you like to configure the DietPi-AutoStart option? +\nThis will allow you to choose which program loads automatically, after the system has booted up, e.g.: + - Console\n - Desktop\n - Kodi' && /boot/dietpi/dietpi-autostart + + fi + # Install finished, set all installed software to state 2 (installed) # - Apply same states to Allo and Allo_update (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )) && { aSOFTWARE_INSTALL_STATE[159]=2; aSOFTWARE_INSTALL_STATE[160]=2; } @@ -16565,26 +16577,6 @@ _EOF_ fi - # dietpi-config can be used to install/configure the following software. Ask user. - # - No-IP - if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then - - 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 - Write_InstallFileList temp - - # Launch DietPi-config - /boot/dietpi/dietpi-config 16 1 - - # Read installed states from temp - Read_InstallFileList temp - - fi - - fi - # Home Assistant: Inform about long install/build time: https://github.com/MichaIng/DietPi/issues/2897 if (( ${aSOFTWARE_INSTALL_STATE[157]} == 1 )); then @@ -16595,26 +16587,6 @@ _EOF_ fi - # Boot Choices - if (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 || - ${aSOFTWARE_INSTALL_STATE[24]} == 1 || - ${aSOFTWARE_INSTALL_STATE[25]} == 1 || - ${aSOFTWARE_INSTALL_STATE[26]} == 1 || - ${aSOFTWARE_INSTALL_STATE[31]} == 1 || - ${aSOFTWARE_INSTALL_STATE[51]} == 1 || - ${aSOFTWARE_INSTALL_STATE[108]} == 1 || - ${aSOFTWARE_INSTALL_STATE[112]} == 1 || - ${aSOFTWARE_INSTALL_STATE[119]} == 1 || - ${aSOFTWARE_INSTALL_STATE[155]} == 1 || - ${aSOFTWARE_INSTALL_STATE[173]} == 1 )); then - - # Set Boot Order - G_WHIP_YESNO 'Would you like to configure the auto boot options for DietPi? -\nThis will allow you to choose which program loads automatically, after the system has booted up, e.g.: - - Console\n - Desktop\n - Kodi' && /boot/dietpi/dietpi-autostart - - fi - fi } From 236ae0b2eef95f74ee2a6c3b8f185aac3451f73a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 02:54:16 +0100 Subject: [PATCH 205/218] v7.0 + DietPi-Config | Detect No-IP install based on binary and service file existence, which allows to do the configuration from within dietpi-software. --- dietpi/dietpi-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index cf5e1bf340..d279b91fdd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4201,7 +4201,7 @@ Additional benchmarks: # No-IP Client local noip_installed=0 local noip_menutext='[Not Installed] Install No-IP now' - if grep -q '^aSOFTWARE_INSTALL_STATE\[67\]=2' /boot/dietpi/.installed; then + if command -v noip2 > /dev/null && [[ -f '/etc/systemd/system/noip2.service' ]]; then noip_installed=1 noip_menutext='[Offline] Enter/Setup No-IP details' @@ -4429,7 +4429,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s G_TERM_CLEAR G_EXEC systemctl stop noip2 # Failsafe: Directory required for "noip2 -C" to create the config file there - mkdir -p /usr/local/etc + G_EXEC mkdir -p /usr/local/etc noip2 -C read -rp 'Press any key to continue...' G_EXEC systemctl restart noip2 From 7d4181cbfced98a59dde84fd1f126f54aa5bc1dd Mon Sep 17 00:00:00 2001 From: ravenclaw900 <50060110+ravenclaw900@users.noreply.github.com> Date: Sat, 27 Feb 2021 08:34:52 -0600 Subject: [PATCH 206/218] v7.0 (#4112) + DietPi-Software | Add way to automatically restore from backup on first boot + DietPi-Software | Only reboot when backup restore succeeded, inform user about it for three seconds + DietPi-Software | Downgrade auto-restore =2 to =1 in every case + DietPi-Backup | Clear PATH cache after backup restore, in case commands are restored to a different locations + DietPi-Backup | Do not stop services before we definitely run the backup or restore. The rsync process check still needs to be done after stopping the services, which include the rsync daemon. But do not kill a running rsync process afterwards, better error out. + DietPi-Backup | Implement function when restoring a backup, to check whether the backup's UUIDs match the current drive's UUIDs, so that we do not restore a system that is not booting, because the bootloader and fstab do not find the configured drives. If the UUIDs seem to not match, check whether we are able to reliably make the system bootable by adjusting known bootloader configurations. Add function to restore UUIDs, in case, but content is on ToDo for now :). + DietPi-Globals | G_WHIP_YESNO: If the default is set to "yes", return "true" as well in case of non-interactive calls + DietPi-Backup | Add whiptail yes/no dialogues when storing a backup to a system with different UUIDs. Default to "yes", if we did find the boot configuration method, else default to "no", which is especially relevant for non-interactive first run setups with AUTO_SETUP_BACKUP_RESTORE=1 set. --- CHANGELOG.txt | 1 + dietpi.txt | 4 + dietpi/dietpi-backup | 287 +++++++++++++++++++++++------------- dietpi/dietpi-drive_manager | 2 +- dietpi/dietpi-software | 84 +++++++++++ dietpi/func/dietpi-globals | 1 + 6 files changed, 272 insertions(+), 107 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cc91fbaa86..24d19b38a7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v7.0 Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. - Network | A change has been implemented on the order in which network-related systemd service targets are reached. "network.target" and "network-online.target" are now reach after all network interfaces have been configured, rather then already after only the loopback interface "lo" has been configured. This affects only systemd services which are not started by DietPi-Services, e.g. SSH/DNS/VPN/VNC servers, with the effect that they are assured to be able to bind to interfaces/IPs, where currently they would fail. The downside is, if one has an Ethernet adapter configured via dietpi-config or /etc/network/interfaces (as allow-hotplug device), but the cable not connected, affected services may be delayed until the interface bring-up timed out. +- DietPi-Backup | A new feature has been added which allows to automatically restore a dietpi-backup on first boot. For this set the new dietpi.txt option AUTO_SETUP_BACKUP_RESTORE=1, to get a list of found backups to select from (this does not work in combination with AUTO_SETUP_AUTOMATED=1). All attached drives are mounted temporarily and seached automatically. Set AUTO_SETUP_BACKUP_RESTORE=2 to have the first found backup restored non-interactively (this works in combination with AUTO_SETUP_AUTOMATED=1). The restore runs after the initial update, hence works with older images as well and can be done via SSH connection. Credits go to @ravenclaw900 for implementing this feature: https://github.com/MichaIng/DietPi/pull/4112 - DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. - DietPi-Config | RPi: An option has been added to toggle the SPI interface. Many thanks to @incanus for resurrecting this old feature request: https://github.com/MichaIng/DietPi/issues/98#issuecomment-783650204 - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 diff --git a/dietpi.txt b/dietpi.txt index e7fabbc82b..62bbdba433 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -67,6 +67,10 @@ AUTO_UNMASK_LOGIND=0 # - Executed script log: /var/tmp/dietpi/logs/dietpi-automation_custom_script.log AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0 +# Restore a DietPi-Backup on first boot: 0 => disable | 1 => interactive restore (show list of found backups) | 2 => non-interactive restore (restore first found backup) +# - Simply attach the drive/disk/stick with contains the backup. All attached drives will be mounted temporarily and searched automatically. +AUTO_SETUP_BACKUP_RESTORE=0 + ##### Software Options ##### # SSH Server Selection: 0=none/custom | -1=Dropbear | -2=OpenSSH AUTO_SETUP_SSH_SERVER_INDEX=-1 diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index f5637f5290..0b713be8a6 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -30,14 +30,12 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - # Grab Input - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab input + [[ $1 =~ ^-?1$ ]] && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Backup System #///////////////////////////////////////////////////////////////////////////////////// - RSYNC_MODE_TEXT=0 - readonly FP_LOG='/var/log/dietpi-backup.log' # Backup Filepaths @@ -64,7 +62,7 @@ readonly aRSYNC_LOGGING_OPTIONS=('-v' "--log-file=$FP_LOG") # Date format for logs - Print_Date(){ date +"%Y-%m-%d_%T"; } + Print_Date(){ date '+%Y-%m-%d_%T'; } Create_Filter_Include_Exclude(){ @@ -97,168 +95,245 @@ _EOF_ } - Services_Stop(){ - - /boot/dietpi/dietpi-services stop - killall -w rsync &> /dev/null # https://github.com/MichaIng/DietPi/issues/1869#issuecomment-400036370 - - } - - Services_Start(){ /boot/dietpi/dietpi-services start; } - Run_Backup(){ - RSYNC_MODE_TEXT='Backup' - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Backup' # Check valid FS Check_Supported_Directory_Location || return 1 - Services_Stop - # Generate target dir - mkdir -p "$FP_TARGET" + G_EXEC_NOHALT=1 G_EXEC mkdir -p "$FP_TARGET/data" # Error: Unable to create target folder. - if [[ ! -d $FP_TARGET ]]; then - - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\nUnable to create $FP_TARGET" + if [[ ! -d $FP_TARGET/data ]]; then - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then - - Error_Rsync_Already_Running + G_WHIP_MSG "Backup failed:\n\nUnable to create $FP_TARGET/data" else - # Start Backup - echo -e "DietPi-Backup Log File. $(Print_Date)\n\n" > $FP_LOG + /boot/dietpi/dietpi-services stop + + # Check if rsync is already running, while the daemon should have been stopped above + pgrep 'rsync' &> /dev/null && { Error_Rsync_Already_Running 'Backup'; return 1; } # Generate Exclude/Include lists Create_Filter_Include_Exclude - while : - do - - # System - G_EXEC mkdir -p "$FP_TARGET"/data - - # Check for sufficient free space - # - NB: working in KiB until end MiB conversion, as, don't like using long long int, and, KiB should offer a good end result. - local old_backup_size=$(du -ks "$FP_TARGET"/data | mawk '{print $1}') # Actual disk space usage - - rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ > /tmp/dietpi-backup_result - local new_backup_size=$(( $(grep -m1 '^Total file size:' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') / 1024 +1 )) # Theoretical, data size only - local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local target_fs_blocksize=$(stat -fc %s "$FP_TARGET"/data) - new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize / 1024 + 1 )) # Add one block size to each file + dir as worst case result - local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024 + 1 )) - rm /tmp/dietpi-backup_result - - if ! G_CHECK_FREESPACE "$FP_TARGET"/data $end_result; then - - G_WHIP_BUTTON_OK_TEXT='Ignore' - G_WHIP_BUTTON_CANCEL_TEXT='Exit' - 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. + # Check for sufficient free space + local old_backup_size=$(du -sB1 "$FP_TARGET/data" | mawk '{print $1}') # Actual disk usage in bytes + # - Dry run to obtain transferred data size + rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET/data/" > .dietpi-backup_result + local new_backup_size=$(grep -m1 '^Total file size:' .dietpi-backup_result | sed 's/[^0-9]*//g') # Apparent data size without block size related overhead + local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' .dietpi-backup_result | sed 's/[^0-9]*//g') + local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' .dietpi-backup_result | sed 's/[^0-9]*//g') + rm .dietpi-backup_result + local target_fs_blocksize=$(stat -fc '%s' "$FP_TARGET/data") + new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize )) # Add one block size for each file + dir as worst case result + local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024**2 + 1 )) # bytes => MiB rounded up + # - Perform check + if ! G_CHECK_FREESPACE "$FP_TARGET/data" $end_result; then + + G_WHIP_BUTTON_OK_TEXT='Ignore' + G_WHIP_BUTTON_CANCEL_TEXT='Exit' + if ! G_WHIP_YESNO 'The backup target location appears to have insufficient free space to successfully finish the backup. +However, 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 cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - break - - fi + echo -e "Backup cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + /boot/dietpi/dietpi-services start + return 1 fi - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT to $FP_TARGET in progress, please wait..." + fi - rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ - EXIT_CODE=$? - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" - if (( $EXIT_CODE == 0 )); then + G_DIETPI-NOTIFY 2 "Backup to $FP_TARGET in progress, please wait..." - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET" + # Init log file + echo -e "Backup log from $(Print_Date)\n" > $FP_LOG - else + rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET/data/" + EXIT_CODE=$? - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." + /boot/dietpi/dietpi-services start - fi + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: Backup" + if (( $EXIT_CODE == 0 )); then - # Done - break + echo -e "Backup completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "Backup completed:\n - $FP_TARGET" - done + else + + G_WHIP_MSG "Backup failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." + + fi log=1 G_WHIP_VIEWFILE $FP_LOG - # Return to main menu - TARGETMENUID=0 + fi + + } + # When restoring a backup, assure that either the UUIDs stored in the backup fstab/boot config matches the current system drive, or that we know all relevant files to adjust afterwards. + Check_UUIDs() + { + UPDATE_UUIDs=0 UPDATE_GRUB=0 UPDATE_RPI=0 UPDATE_ARMBIAN=0 UPDATE_ODROID=0 UPDATE_UBOOT=0 + UUID_ROOT=$(findmnt -no UUID /) + PARTUUID_ROOT=$(findmnt -no PARTUUID /) + + # If the current rootfs' UUID or PARTUUID can be found in the the backups fstab, it can be assumed that it was created from the same drives. + grep -q "^UUID=${UUID_ROOT}[[:blank:]]" "$FP_TARGET/data/etc/fstab" || grep -q "^PARTUUID=${PARTUUID_ROOT}[[:blank:]]" "$FP_TARGET/data/etc/fstab" && return 0 + + UPDATE_UUIDs=1 + + # Else check if we know how to adjust the boot config after the backup has been restored. + # - x86_64 + if (( $G_HW_ARCH == 10 )) && command -v update-grub > /dev/null + then + UPDATE_GRUB=1 + + # - RPi + elif (( $G_HW_MODEL < 10 )) && [[ -f $FP_TARGET/data/boot/cmdline.txt ]] + then + UPDATE_RPI=1 + + # - Armbian + elif [[ -f $FP_TARGET/data/boot/armbianEnv.txt ]] + then + UPDATE_ARMBIAN=1 + + # - Odroids / classic U-Boot + elif [[ -f $FP_TARGET/data/boot/boot.ini ]] + then + UPDATE_ODROID=1 + + # - Modern U-Boot + elif [[ -f $FP_TARGET/data/boot/boot.cmd ]] && command -v mkimage > /dev/null + then + UPDATE_UBOOT=1 + + # - Else we cannot assure that the restored image will boot. + else + # Let user decide, but default to "no" + G_WHIP_YESNO '[WARNING] UUIDs of the backup and the current system differ +\nThe file systems unique identifiers, usually used to mount the drives at boot, seem to differ between the backup and the current system. +\nThis usually indicates that you try to restore an old backup onto a newly flashed DietPi system. +\nMoreover are we not able to find the boot configuration, where those UUIDs would need to be adjusted, to assure that the system will boot. +\nWe hence do not recommend to restore this backup on this system. If you continue, you will need to assure yourself that fstab and boot configurations match the UUIDs, else the system may not boot. +\nDo you want to restore this backup?' && return 0 || return 1 fi - Services_Start + G_WHIP_DEFAULT_ITEM='ok' G_WHIP_YESNO '[WARNING] UUIDs of the backup and the current system differ +\nThe file systems unique identifiers, usually used to mount the drives at boot, seem to differ between the backup and the current system. +\nThis usually indicates that you try to restore an old backup onto a newly flashed DietPi system. +\nBut we were able to find the boot configuration, where those UUIDs would need to be adjusted, to assure that the system will boot. +\nIt should be hence safe to restore this backup, but if the UUIDs were used elsewhere, you might need to adjust it manually. +\nDo you want to restore this backup?' && return 0 || return 1 + } + Update_UUIDs() + { + # fstab + while read -r mountpoint + do + [[ $mountpoint ]] || continue + local uuid=$(findmnt -no UUID "$mountpoint") + [[ $uuid ]] && G_EXEC sed -i "\|[[:blank:]]${mountpoint}[[:blank:]]|s|^[[:blank:]]*UUID=[^[:blank:]]*|UUID=$uuid|" /etc/fstab + local partuuid=$(findmnt -no PARTUUID "$mountpoint") + [[ $partuuid ]] && G_EXEC sed -i "\|[[:blank:]]${mountpoint}[[:blank:]]|s|^[[:blank:]]*PARTUUID=[^[:blank:]]*|PARTUUID=$partuuid|" /etc/fstab + + done < <(lsblk -no MOUNTPOINT "/dev/$(lsblk -no PKNAME "$G_ROOTFS_DEV")") + + # boot configs + # - x86_64 + if (( UPDATE_GRUB == 1 )) + then + G_EXEC update-grub + command -v update-tirfs > /dev/null && G_EXEC update-tirfs && return + command -v update-initramfs > /dev/null && G_EXEC update-initramfs -u + + # - RPi + elif (( UPDATE_RPI == 1 )) + then + G_EXEC sed -Ei "s/(^|[[:blank:]])root=[^[:blank:]]*/\1root=PARTUUID=$PARTUUID_ROOT/" /boot/cmdline.txt + + # - Armbian + elif (( UPDATE_ARMBIAN == 1 )) + then + grep -q '^[[:blank:]]*rootdev=UUID=' /boot/armbianEnv.txt && G_CONFIG_INJECT 'rootdev=UUID=' "rootdev=UUID=$UUID_ROOT" /boot/armbianEnv.txt && return + grep -q '^[[:blank:]]*rootdev=PARTUUID=' /boot/armbianEnv.txt && G_CONFIG_INJECT 'rootdev=PARTUUID=' "rootdev=PARTUUID=$PARTUUID_ROOT" /boot/armbianEnv.txt + + # - Odroids / classic U-Boot + elif (( UPDATE_ODROID == 1 )) + then + G_EXEC sed -Ei "s/(\"|root=)UUID=[^[:blank:]\"]*/\1UUID=$UUID_ROOT/" /boot/boot.ini + G_EXEC sed -Ei "s/(\"|root=)PARTUUID=[^[:blank:]\"]*/\1PARTUUID=$PARTUUID_ROOT/" /boot/boot.ini + + # - Modern U-Boot + elif (( UPDATE_UBOOT == 1 )) + then + G_EXEC sed -Ei "s/(\"|root=)UUID=[^[:blank:]\"]*/\1UUID=$UUID_ROOT/" /boot/boot.cmd + G_EXEC sed -Ei "s/(\"|root=)PARTUUID=[^[:blank:]\"]*/\1PARTUUID=$PARTUUID_ROOT/" /boot/boot.cmd + G_EXEC mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr + fi } Run_Restore(){ - RSYNC_MODE_TEXT='Restore' - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Restore' # Check valid FS Check_Supported_Directory_Location || return 1 - Services_Stop - # Error: Backup not found if [[ ! -f $FP_TARGET/$BACKUP_STATS_FILENAME ]]; then - G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET" - G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed.\n" + G_WHIP_MSG "Restore failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" + # Restore + else - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then + Check_UUIDs || return 1 - Error_Rsync_Already_Running + /boot/dietpi/dietpi-services stop - # Restore - else + # Check if rsync is already running, while the daemon should have been stopped above + pgrep 'rsync' &> /dev/null && { Error_Rsync_Already_Running 'Restore'; return 1; } # Generate Exclude/Include lists Create_Filter_Include_Exclude - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT from $FP_TARGET in progress, please wait..." + G_DIETPI-NOTIFY 2 "Restore from $FP_TARGET in progress, please wait..." + + # Init log file + echo -e "Restore log from $(Print_Date)\n" > $FP_LOG - rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET"/data/ "$FP_SOURCE" + rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET/data/" "$FP_SOURCE" EXIT_CODE=$? + hash -d # Clear PATH cache - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" + (( $UPDATE_UUIDs )) && Update_UUIDs + + /boot/dietpi/dietpi-services start + + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: Restore" if (( $EXIT_CODE == 0 )); then - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." + echo -e "Restore completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "Restore completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." else - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." + G_WHIP_MSG "Restore failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." fi log=1 G_WHIP_VIEWFILE $FP_LOG - # Done - TARGETMENUID=0 - fi - Services_Start - } Check_Supported_Directory_Location(){ @@ -275,10 +350,10 @@ _EOF_ if [[ ! -d $FP_TARGET ]] then G_EXEC mkdir -p "$FP_TARGET" - TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR==2 {print $2}') + TARGET_FILESYSTEM_TYPE=$(df -T "$FP_TARGET" | mawk 'NR==2 {print $2}') G_EXEC rmdir "$FP_TARGET" else - TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR==2 {print $2}') + TARGET_FILESYSTEM_TYPE=$(df -T "$FP_TARGET" | mawk 'NR==2 {print $2}') fi for i in "${aSUPPORTED_FILESYSTEMS[@]}" @@ -355,7 +430,7 @@ _EOF_ \nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore. \nMore information: https://dietpi.com/docs/dietpi_tools/#dietpi-backup-backuprestore";; - 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && rm -R "$FP_TARGET";; + 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && G_EXEC_NOEXIT=1 G_EXEC rm -R "$FP_TARGET";; 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup;; @@ -448,8 +523,7 @@ _EOF_ else - # Return to main menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to main menu fi @@ -479,11 +553,13 @@ _EOF_ } + # $1=Backup/Restore Error_Rsync_Already_Running(){ - G_DIETPI-NOTIFY 1 'Another Rsync process is already running.' - echo -e "$RSYNC_MODE_TEXT failed: $(Print_Date). 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." + G_DIETPI-NOTIFY 1 'Another rsync process is already running.' + echo -e "$1 failed: $(Print_Date). rsync is already running." >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "$1 Error:\n\nA $1 could not be started as rsync is already running." + /boot/dietpi/dietpi-services start } @@ -512,7 +588,6 @@ _EOF_ # NB: To exclude from a custom located dietpi_userdata, you need to add its symlinked path: /mnt/dietpi_userdata/excludeThis #- /path/to/my/file #- /path/to/my/directory/ - _EOF_ #----------------------------------------------------------------------------- diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 3e04250f31..b58b751ec4 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -31,7 +31,7 @@ G_EXIT_CUSTOM(){ (( $SERVICES_STOPPED )) && /boot/dietpi/dietpi-services start; } # Grab input - [[ $1 == [134] ]] || INPUT=0 + [[ $1 == [134] ]] && INPUT=$1 || INPUT=0 EXIT_CODE=0 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d8579ed4bf..b9a4068ff7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16235,6 +16235,7 @@ _EOF_ AUTOINSTALL_WEBSERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_WEB_SERVER_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTOINSTALL_CUSTOMSCRIPTURL=$(sed -n '/^[[:blank:]]*AUTO_SETUP_CUSTOM_SCRIPT_EXEC=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTOINSTALL_TIMESYNCMODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + AUTOINSTALL_RESTORE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_BACKUP_RESTORE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) # Else set defaults [[ $AUTOINSTALL_ENABLED ]] || AUTOINSTALL_ENABLED=0 [[ $AUTOINSTALL_AUTOSTARTTARGET ]] || AUTOINSTALL_AUTOSTARTTARGET=0 @@ -16244,6 +16245,7 @@ _EOF_ [[ $AUTOINSTALL_WEBSERVERINDEX ]] || AUTOINSTALL_WEBSERVERINDEX=0 [[ $AUTOINSTALL_CUSTOMSCRIPTURL ]] || AUTOINSTALL_CUSTOMSCRIPTURL=0 [[ $AUTOINSTALL_TIMESYNCMODE ]] || AUTOINSTALL_TIMESYNCMODE=2 + [[ $AUTOINSTALL_RESTORE ]] || AUTOINSTALL_RESTORE=0 } @@ -17546,6 +17548,88 @@ List of installed software and their online documentation URLs: # Load all automation vars FirstRun_Automation_Init + # Restore DietPi-Backup + if (( $AUTOINSTALL_RESTORE )); then + + # Reboot only when backup restore succeeded + restore_succeeded=0 + + G_DIETPI-NOTIFY 2 'DietPi-Backup restore selected, scanning and mounting attached drives...' + i=0 + while read -r line + do + # Mount drives to temporary mount points + mkdir -p "/mnt/dietpi-backup$i" && mount "$line" "/mnt/dietpi-backup$i" + ((i++)) + + done < <(lsblk -rnpo NAME,UUID,MOUNTPOINT | mawk '$2 && ! $3 {print $1}') + + G_DIETPI-NOTIFY 2 'Searching all drives for DietPi-Backup instances...' + mapfile -t alist < <(find /mnt -type f -name '.dietpi-backup_stats') + + # Interactive restore + if [[ $AUTOINSTALL_RESTORE == 1 ]]; then + + # Do we have any results? + if [[ ${alist[0]} ]]; then + + # Create List for Whiptail + G_WHIP_MENU_ARRAY=() + for i in "${alist[@]}" + do + last_backup_date=$(sed -n '/ompleted/s/^.*: //p' "$i" | tail -1) # Date of last backup for this backup + backup_directory=${i%/.dietpi-backup_stats} # Backup directory (minus the backup file), that we can use for target backup directory. + G_WHIP_MENU_ARRAY+=("$backup_directory" ": $last_backup_date") + done + + export G_DIETPI_SERVICES_DISABLE=1 + G_WHIP_MENU 'Please select a previous backup to restore:' && /boot/dietpi/dietpi-backup -1 "$G_WHIP_RETURNED_VALUE" && restore_succeeded=1 + unset -v G_DIETPI_SERVICES_DISABLE + + else + + G_WHIP_MSG 'No previous backups were found in /mnt/*. Install will continue like normal.' + + fi + + # Non-interactive restore + elif [[ $AUTOINSTALL_RESTORE == 2 ]]; then + + # Do we have any results? + if [[ ${alist[0]} ]]; then + + # Restore first found backup + export G_DIETPI_SERVICES_DISABLE=1 + /boot/dietpi/dietpi-backup -1 "${alist[0]%/.dietpi-backup_stats}" && restore_succeeded=1 + unset -v G_DIETPI_SERVICES_DISABLE + + else + + G_DIETPI-NOTIFY 1 'DietPi-Backup auto-restore was selected but no backup has been found in /mnt/*. Install will continue like normal.' + + fi + + # Downgrade dietpi.txt option + G_CONFIG_INJECT 'AUTO_SETUP_BACKUP_RESTORE=' 'AUTO_SETUP_BACKUP_RESTORE=1' /boot/dietpi.txt + + fi + + # Remove mounted drives and mount points + findmnt /mnt/dietpi-backup[0-9]* > /dev/null && umount /mnt/dietpi-backup[0-9]* + [[ -d '/mnt/dietpi-backup0' ]] && rmdir /mnt/dietpi-backup[0-9]* + + # Reboot on successful restore + if (( $restore_succeeded )); then + + G_DIETPI-NOTIFY 2 'The system will now reboot into the restored system' + sync # Failsafe + sleep 3 + reboot + + fi + + fi + # Global PW # - Automation, apply as per dietpi.txt if (( $AUTOINSTALL_ENABLED )); then diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index b7137e62b1..5840ea5177 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -722,6 +722,7 @@ $grey───────────────────────── G_WHIP_YESNO(){ local result=1 + [[ ${G_WHIP_DEFAULT_ITEM,,} == 'yes' || ${G_WHIP_DEFAULT_ITEM,,} == 'ok' ]] && result=0 if (( $G_INTERACTIVE )); then From 973719842fe5efdaa1fa32a48366251350aa744e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 15:38:51 +0100 Subject: [PATCH 207/218] v7.0 + DietPi-Software | Tiny --- dietpi/dietpi-software | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b9a4068ff7..21f5c51e90 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4980,7 +4980,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # RPi elif (( $G_HW_MODEL < 10 )); then - # Install bootloader package as well to assure we have a corretly booting system with intended kernel + # Install bootloader package as well to assure we have a correctly booting system with intended kernel apackages=('raspberrypi-kernel' 'raspberrypi-kernel-headers' 'raspberrypi-bootloader') # Odroid XU4 @@ -5021,10 +5021,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # - Known as issue currently on Odroid C2/N1/N2, check for new build system if linux-/ holds current headers instead of linux-source-/: https://dietpi.com/meveric/pool/c2/l/ for i in /lib/modules/* do - [[ -d $i/build ]] && continue [[ -d /usr/src/linux-headers-${i##*/} ]] && ln -sfv "/usr/src/linux-headers-${i##*/}" "$i/build" - done # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers From cc092bb954d9e7e7aabecc3b1aa0848f75b4fc49 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 20:46:30 +0100 Subject: [PATCH 208/218] v7.0 + DietPi-Software | SABnzbd: Since v3.2.0 raised the minimum Python dependency to v3.6, on Stretch, v3.1.1 needs to be installed. However, check the actually installed Python version so that a custom Python install allows to install SABnzbd v3.2+ as well. + DietPi-Software | SABnzbd: Use the new Create_Config function to pre-create the config file --- dietpi/dietpi-software | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 21f5c51e90..5efcd6b64c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5668,23 +5668,28 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # APT deps DEPS_LIST='par2 p7zip-full' # - Pre-compiling required on ARM - (( $G_HW_ARCH < 10 )) && DEPS_LIST+=' libffi-dev libssl-dev' + (( $G_HW_ARCH > 9 )) || DEPS_LIST+=' libffi-dev libssl-dev' + + # Stretch: SABnzbd v3.2.0 raised the Python dependency to v3.6: https://github.com/sabnzbd/sabnzbd/tree/3.2.0 + local version='master' + (( $(python3 -V | tr -cd '0-9') < 360 )) && version='3.1.1' - Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.tar.gz' + # Download + Download_Install "https://github.com/sabnzbd/sabnzbd/archive/$version.tar.gz" # Reinstall: Remove old install dir if [[ -d '/etc/sabnzbd' ]]; then # Preserve old config file - [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] && G_EXEC mv /etc/sabnzbd/sabnzbd.ini sabnzbd-master/sabnzbd.ini + [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] && G_EXEC mv /etc/sabnzbd/sabnzbd.ini sabnzbd-$version/sabnzbd.ini G_EXEC rm -R /etc/sabnzbd fi - # Install new files - G_EXEC mv sabnzbd-master /etc/sabnzbd + # Install + G_EXEC mv sabnzbd-$version /etc/sabnzbd - # Required Python modules + # Python deps G_EXEC cd /etc/sabnzbd G_EXEC_OUTPUT=1 G_EXEC pip3 install -Ur requirements.txt G_EXEC cd /tmp/$G_PROGRAM_NAME @@ -11895,25 +11900,14 @@ _EOF_ G_EXEC mkdir -p /var/log/sabnzbd G_EXEC chown -R sabnzbd:root /{etc,var/log}/sabnzbd - # Create config + # Config # - Touch only if it does not yet exist, assume reinstall otherwise and preserve custom changes # - API keys and initial config are only generated during 1st run # - We need to launch program, then apply our config tweaks, else, wizard setup in web interface simply loops without API keys. if [[ ! -f '/etc/sabnzbd/sabnzbd.ini' ]]; then - G_DIETPI-NOTIFY 2 'Generating initial config, please wait...' - G_EXEC systemctl daemon-reload - G_EXEC systemctl start sabnzbd - until [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] - do - - sleep 0.5 - - done - sleep 2 - - G_EXEC_NOHALT=1 G_EXEC systemctl stop sabnzbd - sleep 2 # Additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?p=7082#p7082 + Create_Config /etc/sabnzbd/sabnzbd.ini sabnzbd + sleep 1 # Additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?p=7082#p7082 G_CONFIG_INJECT 'download_dir =' 'download_dir = /mnt/dietpi_userdata/downloads/incomplete' /etc/sabnzbd/sabnzbd.ini G_CONFIG_INJECT 'complete_dir =' 'complete_dir = /mnt/dietpi_userdata/downloads/complete' /etc/sabnzbd/sabnzbd.ini From fecc6e6bae761d9d3ead916a765be33e68cc9bc8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 20:49:50 +0100 Subject: [PATCH 209/218] v7.0 + CHANGELOG | SABnzbd: Resolved an issue on Stretch where the install failed due to raised minimum Python version with SABnzbd v3.2.0 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 24d19b38a7..758cac7a16 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -42,6 +42,7 @@ Fixes: - DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 - DietPi-Software | Resolved an issue where for ruTorrent, Koel and Bitwarden_RS the automatic newest version detection failed and instead a possibly older fallback was used. Many thanks to @kelvmod for reporting this issue: https://github.com/MichaIng/DietPi/issues/4105 - DietPi-Software | LXQt: Resolved visual issues with our default configuration of Debian Buster, drastically simplified and cleaned up the files we ship. +- DietPi-Software | SABnzbd: Resolved an issue on Stretch where the install failed due to raised minimum Python version with SABnzbd v3.2.0. If Python 3.5 is installed, SABnzbd v3.1.1 will be installed now to allow keeping the install option enabled for now. Many thanks to @19eighties for reporting this issue: https://github.com/MichaIng/DietPi/issues/2762#issuecomment-787118995 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/4126 From 9b49a403eb44e8429776d89d164e9006face5e31 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 21:00:43 +0100 Subject: [PATCH 210/218] v7.0 + 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 5840ea5177..a5cb3b1cb6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -66,7 +66,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $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 fd32c8a2772234d6a17f952fa343d65192ff2110 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 21:01:12 +0100 Subject: [PATCH 211/218] v7.0 + RC up --- .update/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/version b/.update/version index 0981a0672d..d62971817e 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=7 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=0 +G_REMOTE_VERSION_RC=1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=-1 From 2e47755130fe51b785b3a9cd33cc567da9f19efa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Feb 2021 21:11:29 +0100 Subject: [PATCH 212/218] v7.0 + CONTRIBUTING | Add a few more cross-references to docs and new contribution web page --- CONTRIBUTING.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 84ce773ccf..0fe26142c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,13 +9,15 @@ Are you able to: - Provide feedback and/or test areas of DietPi, to improve the user experience? - Report bugs? - Improve/add more features to the DietPi [website](https://github.com/MichaIng/DietPi-Website) or [documentation](https://github.com/MichaIng/DietPi-Docs)? -- Compile software for our supported SBCs? +- Compile software for our [supported platforms](https://dietpi.com/docs/hardware/)? - Contribute to DietPi with programming on GitHub? - Suggest new software that we can add to the `dietpi-software` install system? -If so, let us know! +If so, let us know! We are always looking for talented people who believe in the DietPi project, and, wish to contribute in any way you can. -- Send me an Email: micha@dietpi.com -- Join our forums: https://dietpi.com/phpbb/ -- GitHub: https://github.com/MichaIng/DietPi +- Send us an email: +- Join our forum: +- GitHub: + +Read more: From 959b704ba3f85d061b0c00d5eef87533db43402c Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Sat, 27 Feb 2021 23:33:53 +0100 Subject: [PATCH 213/218] v7.0 DietPi-Software | Docker-Compose - adjust wording --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5efcd6b64c..93c9ae7e0d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1353,7 +1353,7 @@ _EOF_ software_id=134 aSOFTWARE_NAME[$software_id]='Docker Compose' - aSOFTWARE_DESC[$software_id]='Tool to defining and run multi-container Docker applications' + aSOFTWARE_DESC[$software_id]='Tool for defining and running multi-container Docker applications' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' From b2959fa29fa56f56793313f1387386216730d060 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Feb 2021 00:30:36 +0100 Subject: [PATCH 214/218] v7.0 + DietPi-Software | Add missing space --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 93c9ae7e0d..b66af94f8f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5603,7 +5603,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Build dependencies DEPS_LIST='make cmake gcc libc6-dev libjpeg-dev' # - On RPi, add RPi Camera support by default - (( $G_HW_MODEL > 9 )) || DEPS_LIST+='libraspberrypi-dev' + (( $G_HW_MODEL > 9 )) || DEPS_LIST+=' libraspberrypi-dev' # Download sources Download_Install 'https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz' From e835400ae9e467ea2c4eed2b07f72f265adc296a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Feb 2021 18:46:54 +0100 Subject: [PATCH 215/218] v7.0 + DietPi-Software | Shorten some software descriptions so that they fit nicely into the optimised software menu --- dietpi/dietpi-software | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b66af94f8f..880b5a9fde 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -511,7 +511,7 @@ _EOF_ software_id=35 aSOFTWARE_NAME[$software_id]='Logitech Media Server' - aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server, SqueezeCenter, SlimServer' + aSOFTWARE_DESC[$software_id]='aka SlimServer, SqueezeCenter, Squeezebox Server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#logitech-media-server' @@ -1276,7 +1276,7 @@ _EOF_ software_id=137 aSOFTWARE_NAME[$software_id]='mjpg-streamer' - aSOFTWARE_DESC[$software_id]='Steam JPEG frames from various sources to various possible outputs' + aSOFTWARE_DESC[$software_id]='Simple camera streaming tool with HTML plugin' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#mjpg-streamer' @@ -1353,7 +1353,7 @@ _EOF_ software_id=134 aSOFTWARE_NAME[$software_id]='Docker Compose' - aSOFTWARE_DESC[$software_id]='Tool for defining and running multi-container Docker applications' + aSOFTWARE_DESC[$software_id]='Manage multi-container Docker applications' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' @@ -16585,7 +16585,7 @@ _EOF_ G_WHIP_SIZE_X_MAX=95 # Assure this is enough to show full software descriptions + scroll bar G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_CHECKLIST "Please use the spacebar to select the software you wish to install.\n - Software and usage details: https://dietpi.com/software + G_WHIP_CHECKLIST "Please use the spacebar to select the software you wish to install.\n - Software and usage details: https://dietpi.com/docs/software/ - NB: Pressing 'ESC' or selecting 'Back' will clear all changed selections" # Reset Choices made flag @@ -16594,15 +16594,10 @@ _EOF_ # Check for matching results (selected items) for i in $G_WHIP_RETURNED_VALUE do - # Enable - if disable_error=1 G_CHECK_VALIDINT "$i" && (( ${aSOFTWARE_INSTALL_STATE[$i]} == 0 )); then - - INSTALL_SOFTWARE_CHOICESMADE=1 - aSOFTWARE_INSTALL_STATE[$i]=1 - - fi - + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 0 )) || continue + INSTALL_SOFTWARE_CHOICESMADE=1 + aSOFTWARE_INSTALL_STATE[$i]=1 done #----------------------------------------------------------------------------- From aaa11b872661f6c5aac3560316577fa1c409caf9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Feb 2021 19:42:33 +0100 Subject: [PATCH 216/218] v7.0 + DietPi-Globals | Raise default RC version --- 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 a5cb3b1cb6..4a16b874f2 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -66,7 +66,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $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 736616c9f80fc338f8cce0e06de65220eabec310 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Feb 2021 19:43:17 +0100 Subject: [PATCH 217/218] v7.0 + RC up --- .update/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/version b/.update/version index d62971817e..26e350ba72 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=7 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_RC=2 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=-1 From 0fe2bf556f42a7ac96d6f3ab4709910733e8f44c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Feb 2021 22:19:02 +0100 Subject: [PATCH 218/218] v7.0 + CHANGELOG | Add release date --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 758cac7a16..16d9e1134e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v7.0 -(2021-02-XX) +(2021-02-28) Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago.