From 0e6273a3397c07f6e30a8de22d9b9d24ab950384 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Mar 2019 15:32:39 +0100 Subject: [PATCH 001/253] v6.22 + DietPi-Services | Syntax: Re-add required and remove non-required double quotes. Service names never have free spaces, but the status line with tab escape code of course needs to be quoted. --- dietpi/dietpi-services | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 0bbc035aa1..d367930162 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -412,7 +412,7 @@ if (( ${aSERVICE_AVAILABLE[$i]} )); then - G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 ${aSERVICE_NAME[$i]} systemctl $target_state ${aSERVICE_NAME[$i]} &> /dev/null @@ -430,7 +430,7 @@ if (( ${aSERVICE_AVAILABLE[$i]} )); then - G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 ${aSERVICE_NAME[$i]} systemctl $target_state ${aSERVICE_NAME[$i]} &> /dev/null @@ -499,7 +499,7 @@ _EOF_ #Apply if (( ${aSERVICE_AVAILABLE[$i]} )); then - G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 ${aSERVICE_NAME[$i]} systemctl $SYSTEMD_CMD ${aSERVICE_NAME[$i]} &> /dev/null @@ -568,7 +568,7 @@ _EOF_ #Apply if (( ${aSERVICE_AVAILABLE[$i]} )); then - STATUS=${aSERVICE_NAME[$i]}\t$(systemctl status ${aSERVICE_NAME[$i]} | grep -m1 'Active' | cut -c12-) + STATUS="${aSERVICE_NAME[$i]}\t$(systemctl status ${aSERVICE_NAME[$i]} | grep -m1 'Active' | cut -c12-)" if [[ $STATUS =~ 'failed' ]]; then From 24e5fc095ebe2b826fcfe180edfc053657a1d8e0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Mar 2019 15:35:29 +0100 Subject: [PATCH 002/253] v6.23 + RC up --- dietpi/server_version-6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 467a39c6e9..3a79d15d01 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -22 -3 +23 +0 From becbacf360422ca5117f531c4690854b0cfb2758 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Mar 2019 15:36:45 +0100 Subject: [PATCH 003/253] v6.23 + DietPi-Globals | Default version 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 5c32b13a1f..d6955c6dc8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -61,8 +61,8 @@ #DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} - G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-22} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-2} + G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-23} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-0} G_GITBRANCH=${G_GITBRANCH:-master} G_GITOWNER=${G_GITOWNER:-MichaIng} [[ -f '/DietPi/dietpi/.version' && $( Date: Sun, 24 Mar 2019 19:44:42 +0100 Subject: [PATCH 004/253] v6.23 + DietPi-PREP | Add "/etc/bashrc.d/*.bash" file ending support --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 505e4890f2..15e1c15444 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1011,7 +1011,8 @@ _EOF_ rm -f /etc/profile.d/99-dietpi* # - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts: - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + sed -i '\#for i in /etc/bashrc\.d#d' /etc/bash.bashrc + G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc # - Enable bash-completion for non-login shells: # - NB: It is called twice on login shells then, but breaks directly if called already once. From 04e23f05adb984a085feba32d4af96d9a47acde6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Mar 2019 22:35:27 +0100 Subject: [PATCH 005/253] META | DietPi-Survey_report | Add v6.23 software title array --- .meta/dietpi-survey_report | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 52a1862581..9f3483a7b0 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -376,12 +376,13 @@ aSOFTWARE_NAME6_20[171]='DietPi-NordVPN' aSOFTWARE_NAME6_20[172]='WireGuard' - # - v6.21 + v6.22 + # - v6.21 + v6.22 + v6.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 From d16145742ed45476f44c5b2692d24f23d4d44eae Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 25 Mar 2019 17:04:12 +0100 Subject: [PATCH 006/253] v6.23 + DietPi-Change_hostname | Minor coding --- dietpi/func/change_hostname | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname index 845113f068..571a168d7b 100644 --- a/dietpi/func/change_hostname +++ b/dietpi/func/change_hostname @@ -18,22 +18,22 @@ #//////////////////////////////////// #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + G_PROGRAM_NAME='DietPi-Change_hostname' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW - G_PROGRAM_NAME='DietPi-Change_hostname' G_INIT #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Change Hostname #///////////////////////////////////////////////////////////////////////////////////// - HOSTNAME_NEW="$1" + HOSTNAME_NEW=$1 #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// G_CONFIG_INJECT '127.0.1.1 ' "127.0.1.1 $HOSTNAME_NEW" /etc/hosts - echo "$HOSTNAME_NEW" > /etc/hostname + echo $HOSTNAME_NEW > /etc/hostname #----------------------------------------------------------------------------------- exit From 4417d8cb065e273a01e0b08c7868d29d6ca5f236 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 25 Mar 2019 23:56:37 +0100 Subject: [PATCH 007/253] v6.23 + DietPi-Login | Replace "sudo systemctl" by "pgrep" to allow non-sudoers login: https://github.com/MichaIng/DietPi/issues/2667 --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 1030319b6f..e5175d8c9b 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -177,7 +177,7 @@ Please login again as user "root" with password "dietpi", respectively the one y # Wait for full system boot local i=0 - until sudo systemctl -ln 0 --no-pager status dietpi-postboot | grep -qi 'exited' # "sudo" required for non-root logins + while pgrep -f '/DietPi/dietpi/postboot' &> /dev/null do echo -ne "\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish... (Press CTRL+C to abort) ($((i++)))\r" From 9fdf8ae4756d4b2c7d5dff5cc8859c91331104ac Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 26 Mar 2019 00:03:02 +0100 Subject: [PATCH 008/253] v6.23 + CHANGELOG | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop. --- CHANGELOG.txt | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6cbaf6444b..d4c062fd4d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,27 @@ +v6.23 +(XX/04/19) + +Changes / Improvements / Optimisations: + +Bug Fixes: +- DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files + +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-Config | RPi: Enabling OpenGL/VC4 causes sound card selection to be invalid: https://github.com/MichaIng/DietPi/issues/2173 +- DietPi-Drive_Manager | encryptfs is currently not supported and will be removed from fstab when executing drive manager: https://github.com/MichaIng/DietPi/issues/2078 +- RPi | LXAppearance (on LXDE desktop) hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791 +- Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955 +- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584 +- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522 +- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 +- DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747 + +For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues + v6.22 (23/03/19) @@ -51,19 +74,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/2653/files -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-Config | RPi: Enabling OpenGL/VC4 causes sound card selection to be invalid: https://github.com/MichaIng/DietPi/issues/2173 -- DietPi-Drive_Manager | encryptfs is currently not supported and will be removed from fstab when executing drive manager: https://github.com/MichaIng/DietPi/issues/2078 -- RPi | LXAppearance (on LXDE desktop) hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791 -- Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955 -- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584 -- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522 -- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 -- DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747 - -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v6.21 (Hotfix) From 8bc4e09ee9ba3b96d798b5ae7c7bebadc7fd587f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Mar 2019 18:01:23 +0100 Subject: [PATCH 009/253] v6.23 + DietPi-Banner | Add whiptail (de)selection info to menu: https://github.com/MichaIng/DietPi/issues/2670 + DietPi-Banner | Add comment about input argument for customisation menu + DietPi-Banner | Syntax and minor wording --- dietpi/func/dietpi-banner | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 7f9d86e6ac..20d7c20cca 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -15,6 +15,7 @@ # Usage: # - dietpi-banner 0 = top section only # - dietpi-banner 1 = top section and credits + clear + # - dietpi-banner 2 = banner customisation menu #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- @@ -178,7 +179,7 @@ $GREEN_LINE" Print_Banner(){ - # - Source DietPi-Globals if CPU temp chosen + # - Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen [[ ${aENABLED[2]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals # - Re-obtain network details if missing and LAN IP chosen @@ -217,12 +218,12 @@ $GREEN_LINE" do local state='off' - (( ${aENABLED[$i]=0} == 1 )) && state='on' + (( ${aENABLED[$i]:=0} == 1 )) && state='on' G_WHIP_CHECKLIST_ARRAY+=($i "${aDESCRIPTION[$i]}" $state) done - if G_WHIP_CHECKLIST "Please select options to enable in $G_PROGRAM_NAME display:"; then + if G_WHIP_CHECKLIST "Please (de)select options via spacebar to be shown in the $G_PROGRAM_NAME:"; then for i in ${!aDESCRIPTION[@]} do From 61fce58f7f6680db4120aa5faa3816d075d6c674 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 29 Mar 2019 02:08:33 +0100 Subject: [PATCH 010/253] v6.23 + DietPi-Set_hardware | Fix for different boot config files (uEnv.txt, uenv.txt, armbianEnv.txt) based on pre-image, e.g. on Pine A64 + DietPi-Set_hardware | Minor syntax, coding and wording --- dietpi/func/dietpi-set_hardware | 670 +++++++++++++++++--------------- 1 file changed, 353 insertions(+), 317 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 0509ad6e8f..9cdbd5ce46 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -12,27 +12,27 @@ # Usage: FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_hardware' AVAIABLE_COMMANDS=" -Available commands -$FP_SCRIPT enableipv6 enable/disable -$FP_SCRIPT preferipv4 enable/disable -$FP_SCRIPT eth-forcespeed 10/100/1000/disable -$FP_SCRIPT wifimodules enable/disable/onboard_enable/onboard_disable -$FP_SCRIPT wificountrycode GB/US/DE -$FP_SCRIPT bluetooth enable/disable -$FP_SCRIPT serialconsole enable/disable -$FP_SCRIPT i2c enable/disable/khz -$FP_SCRIPT soundcard target_card (non-matching name for reset to default) add '-eq' to target_card string, enable alsa eq 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) -$FP_SCRIPT gpumemsplit 64/128/256 # RPi only -$FP_SCRIPT headless enable/disable -$FP_SCRIPT rpi-camera enable/disable -$FP_SCRIPT rpi-opengl vc4-kms-v3d/vc4-fkms-v3d/disable -$FP_SCRIPT rpi3_usb_boot enable +Available commands: +$FP_SCRIPT enableipv6 enable/disable +$FP_SCRIPT preferipv4 enable/disable +$FP_SCRIPT eth-forcespeed 10/100/1000/disable +$FP_SCRIPT wifimodules enable/disable/onboard_enable/onboard_disable +$FP_SCRIPT wificountrycode GB/US/DE/... +$FP_SCRIPT bluetooth enable/disable +$FP_SCRIPT serialconsole enable/disable +$FP_SCRIPT i2c enable/disable/khz +$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) +$FP_SCRIPT headless enable/disable +$FP_SCRIPT gpumemsplit 64/128/256 # RPi only +$FP_SCRIPT rpi-camera enable/disable +$FP_SCRIPT rpi-opengl vc4-kms-v3d/vc4-fkms-v3d/disable +$FP_SCRIPT rpi3_usb_boot enable " #//////////////////////////////////// - #Grab Inputs + # Grab Inputs INPUT_DEVICE_NAME=${1,,} INPUT_DEVICE_VALUE=${2,,} # - Support for 1/0 inputs for enable/disable @@ -46,20 +46,35 @@ $FP_SCRIPT rpi3_usb_boot enable fi - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Set_Hardware' + G_PROGRAM_NAME='DietPi-Set_hardware' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- + # Semi non-RAMdisk support if (( $G_HW_MODEL < 10 )); then FP_RPI_CONFIG='/DietPi/config.txt' - #Semi support non-dietpi Raspbian [[ -f $FP_RPI_CONFIG ]] || FP_RPI_CONFIG='/boot/config.txt' + # ARMbian uses armbianEnv.txt instead which requires different syntax + elif [[ -f /boot/armbianEnv.txt ]]; then + + ARMBIAN=1 + FP_UENV='/boot/armbianEnv.txt' + [[ -f /DietPi/armbianEnv.txt ]] && FP_UENV='/DietPi/armbianEnv.txt' + + # Sparky SBC uEnv.txt has been renamed to uenv.txt which is currently not copied to RAMdisk + else + + ARMBIAN=0 + FP_UENV='/tmp/uEnv.txt' + for i in /{DietPi,boot}/u{e,E}nv.txt; do [[ -f $i ]] && FP_UENV=$i && break; done + unset i + fi EXIT_CODE=0 @@ -68,36 +83,34 @@ $FP_SCRIPT rpi3_usb_boot enable Unknown_Input_Name(){ - EXIT_CODE=1 G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." echo "$AVAIABLE_COMMANDS" + EXIT_CODE=1 } Unknown_Input_Mode(){ - EXIT_CODE=1 G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." echo "$AVAIABLE_COMMANDS" + EXIT_CODE=1 } Unsupported_Input_Name(){ - EXIT_CODE=0 G_DIETPI-NOTIFY 2 "Input name ($INPUT_DEVICE_NAME) is not supported by $G_HW_MODEL_DESCRIPTION. Nothing has been applied." } Unsupported_Input_Mode(){ - EXIT_CODE=0 G_DIETPI-NOTIFY 2 "Input value ($INPUT_DEVICE_VALUE) is not supported by $G_HW_MODEL_DESCRIPTION. Nothing has been applied." } #///////////////////////////////////////////////////////////////////////////////////// - #rpi-camera + # rpi-camera #///////////////////////////////////////////////////////////////////////////////////// RPi_Camera_Main(){ @@ -121,10 +134,8 @@ $FP_SCRIPT rpi3_usb_boot enable Gpu_Memory_Split_Main INPUT_DEVICE_VALUE=$tmp - unset tmp fi - unset gpu_mem elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then @@ -140,7 +151,7 @@ $FP_SCRIPT rpi3_usb_boot enable } #///////////////////////////////////////////////////////////////////////////////////// - #rpi3_usb_boot + # rpi3_usb_boot #///////////////////////////////////////////////////////////////////////////////////// RPi_USB_Boot_Main(){ @@ -152,26 +163,34 @@ $FP_SCRIPT rpi3_usb_boot enable cat << _EOF_ > /etc/systemd/system/dietpi-rm_program_usb_boot_mode.service [Unit] -Description=dietpi-rm_program_usb_boot_mode.service +Description=DietPi-rm_program_usb_boot_mode.service After=dietpi-boot.service [Service] -Type=simple +Type=oneshot RemainAfterExit=yes ExecStartPre=$(command -v sed) -i '/^[[:blank:]]*program_usb_boot_mode=/d' $FP_RPI_CONFIG ExecStartPre=$(command -v systemctl) disable dietpi-rm_program_usb_boot_mode -ExecStart=$(command -v systemctl) daemon-reload +ExecStart=$(command -v rm) /etc/systemd/system/dietpi-rm_program_usb_boot_mode.service [Install] WantedBy=multi-user.target _EOF_ -systemctl daemon-reload -systemctl enable dietpi-rm_program_usb_boot_mode + systemctl daemon-reload + systemctl enable dietpi-rm_program_usb_boot_mode elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then sed -i '/^[[:blank:]]*program_usb_boot_mode=/d' $FP_RPI_CONFIG + if [[ -f /etc/systemd/system/dietpi-rm_program_usb_boot_mode.service ]]; then + + systemctl disable dietpi-rm_program_usb_boot_mode + rm /etc/systemd/system/dietpi-rm_program_usb_boot_mode.service + systemctl daemon-reload + + fi + else Unknown_Input_Mode @@ -181,22 +200,22 @@ systemctl enable dietpi-rm_program_usb_boot_mode } #///////////////////////////////////////////////////////////////////////////////////// - #gpumemsplit + # gpumemsplit #///////////////////////////////////////////////////////////////////////////////////// Gpu_Memory_Split_Main(){ (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi # Remove overridden "gpu_mem" setting - sed -i '/^[[:blank:]]*gpu_mem=' $FP_RPI_CONFIG + sed -i '/^[[:blank:]]*gpu_mem=/d' $FP_RPI_CONFIG if disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 16 944; then G_CONFIG_INJECT 'gpu_mem_1024=' "gpu_mem_1024=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG local gpu_mem_cap=$INPUT_DEVICE_VALUE - (( $INPUT_DEVICE_VALUE >= 512 )) && gpu_mem_cap=448 + (( $INPUT_DEVICE_VALUE > 448 )) && gpu_mem_cap=448 G_CONFIG_INJECT 'gpu_mem_512=' "gpu_mem_512=$gpu_mem_cap" $FP_RPI_CONFIG - (( $INPUT_DEVICE_VALUE >= 256 )) && gpu_mem_cap=192 + (( $INPUT_DEVICE_VALUE > 192 )) && gpu_mem_cap=192 G_CONFIG_INJECT 'gpu_mem_256=' "gpu_mem_256=$gpu_mem_cap" $FP_RPI_CONFIG else @@ -208,12 +227,13 @@ systemctl enable dietpi-rm_program_usb_boot_mode } #///////////////////////////////////////////////////////////////////////////////////// - #headless + # headless #///////////////////////////////////////////////////////////////////////////////////// Headless_Main(){ if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then + # RPi if (( $G_HW_MODEL < 10 )); then # - Framebuffer dimensions should not play a role here, but @@ -223,23 +243,23 @@ systemctl enable dietpi-rm_program_usb_boot_mode G_CONFIG_INJECT 'framebuffer_height=' '#framebuffer_height=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_width=' '#max_framebuffer_width=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_height=' '#max_framebuffer_height=0' /DietPi/config.txt - # - Splash cannot be seen anyway, without video output + # - Splash cannot be seen anyway without video output G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' /DietPi/config.txt # - hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen G_CONFIG_INJECT 'hdmi_blanking=' 'hdmi_blanking=1' /DietPi/config.txt - # - Disable HDMI hotplug, which requires it to be generally responsive/active + # - Disable HDMI hotplug detection, which requires it to be generally responsive/active G_CONFIG_INJECT 'hdmi_ignore_hotplug=' 'hdmi_ignore_hotplug=1' /DietPi/config.txt # - Disable composite hotplug, which then allows to completely disable the video pipeline + framebuffer G_CONFIG_INJECT 'hdmi_ignore_composite=' 'hdmi_ignore_composite=1' /DietPi/config.txt - #odroid C1 + # Odroid C1 elif (( $G_HW_MODEL == 10 )); then G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "0"' /DietPi/boot.ini G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then G_CONFIG_INJECT 'setenv nographics ' 'setenv nographics "1"' /DietPi/boot.ini @@ -252,20 +272,21 @@ systemctl enable dietpi-rm_program_usb_boot_mode elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + # RPi if (( $G_HW_MODEL < 10 )); then G_CONFIG_INJECT 'hdmi_ignore_hotplug=' '#hdmi_ignore_hotplug=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_ignore_composite=' '#hdmi_ignore_composite=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_blanking=' '#hdmi_blanking=0' /DietPi/config.txt - #odroid C1 + # Odroid C1 elif (( $G_HW_MODEL == 10 )); then G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "1"' /DietPi/boot.ini G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "1"' /DietPi/boot.ini G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then G_CONFIG_INJECT 'setenv nographics ' 'setenv nographics "0"' /DietPi/boot.ini @@ -285,32 +306,34 @@ systemctl enable dietpi-rm_program_usb_boot_mode } #///////////////////////////////////////////////////////////////////////////////////// - #remoteir + # remoteir #///////////////////////////////////////////////////////////////////////////////////// RemoteIR_Prereqs(){ G_AG_CHECK_INSTALL_PREREQ lirc; } RemoteIR_Reset_All(){ - # - Disable JustBoom + # Disable JustBoom if (( $G_HW_MODEL < 10 )); then if [[ -f /etc/systemd/system/justboom-ir-mpd.service ]]; then - systemctl stop justboom-ir-mpd.service - systemctl disable justboom-ir-mpd.service + systemctl stop justboom-ir-mpd + systemctl disable justboom-ir-mpd rm /etc/systemd/system/justboom-ir-mpd.service + systemctl daemon-reload fi sed -i '/^[[:blank:]]*dtoverlay=lirc-rpi/d' $FP_RPI_CONFIG sed -i '/^[[:blank:]]*dtparam=gpio_in_pin=25/d' $FP_RPI_CONFIG - # - Disable Odroids + # Disable Odroids elif (( $G_HW_MODEL < 20 )) && [[ -f /etc/systemd/system/odroid-remote.service ]]; then systemctl stop odroid-remote systemctl disable odroid-remote rm /etc/systemd/system/odroid-remote.service + systemctl daemon-reload fi @@ -327,20 +350,16 @@ systemctl enable dietpi-rm_program_usb_boot_mode RemoteIR_Prereqs RemoteIR_Reset_All - # - XU4 Cloudshell + # XU4 Cloudshell if (( $G_HW_MODEL == 11 )); then - # - modules + # - Modules local string='options gpioplug_ir_recv gpio_nr=24 active_low=1' G_CONFIG_INJECT "$string" "$string" /etc/modprobe.d/odroid-cloudshell.conf + G_CONFIG_INJECT 'gpio-ir-recv' 'gpio-ir-recv' /etc/modules + G_CONFIG_INJECT 'gpioplug-ir-recv' 'gpioplug-ir-recv' /etc/modules - string='gpio-ir-recv' - G_CONFIG_INJECT "$string" "$string" /etc/modules - - string='gpioplug-ir-recv' - G_CONFIG_INJECT "$string" "$string" /etc/modules - - # - C1/C2 + # C1/C2 elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then # - Module @@ -348,26 +367,41 @@ systemctl enable dietpi-rm_program_usb_boot_mode fi - # - All - # - Systemd - systemctl disable lirc - [[ -f /etc/init.d/lirc ]] && rm /etc/init.d/lirc - cat << _EOF_ > /etc/systemd/system/odroid-remote.service + # All + # - systemd + if (( $G_DISTRO < 4 )); then + + if [[ -f /etc/init.d/lirc ]]; then + + systemctl disable lirc + rm /etc/init.d/lirc + systemctl daemon-reload + + fi + + cat << _EOF_ > /etc/systemd/system/odroid-remote.service [Unit] Description=Odroid Remote C1/C2/XU4 [Service] Type=forking -ExecStartPre=$(command -v mkdir) -p /var/run/lirc +ExecStartPre=$(command -v mkdir) -p /run/lirc ExecStart=$(command -v lircd) --output=/run/lirc/lircd --driver=default --device=/dev/lirc0 --uinput [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - systemctl enable odroid-remote + systemctl daemon-reload + systemctl enable odroid-remote + + # Since Stretch a systemd service exists + else + + systemctl enable lircd - # Lircd conf for Odroid Remote + fi + + # - Lircd conf for Odroid Remote cat << _EOF_ > /etc/lirc/lircd.conf begin remote @@ -468,7 +502,7 @@ _EOF_ # + MPD control G_AG_CHECK_INSTALL_PREREQ mpc - cat << _EOF_ > ~/.lircrc + cat << _EOF_ > /root/.lircrc begin prog = irexec button = KEY_ENTER @@ -516,16 +550,13 @@ config = mpc repeat off end _EOF_ - # service + # - Service cat << _EOF_ > /etc/systemd/system/justboom-ir-mpd.service [Unit] Description=justboom-ir-mpd (DietPi) -After=sound.target lirc.service +After=sound.target lircd.service lirc.service [Service] -User=$USER -Type=simple - ExecStart=$(command -v irexec) [Install] @@ -548,7 +579,7 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - #Ethernet force link speed + # Ethernet force link speed #///////////////////////////////////////////////////////////////////////////////////// Eth_Force_Speed_Main(){ @@ -574,10 +605,16 @@ _EOF_ systemctl enable ethtool_force_speed systemctl start ethtool_force_speed - elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to 'disabled' + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to 'disable' - [[ -f /etc/systemd/system/ethtool_force_speed.service ]] && rm /etc/systemd/system/ethtool_force_speed.service - systemctl daemon-reload + if [[ -f /etc/systemd/system/ethtool_force_speed.service ]]; then + + systemctl stop ethtool_force_speed + systemctl disable ethtool_force_speed + rm /etc/systemd/system/ethtool_force_speed.service + systemctl daemon-reload + + fi else @@ -588,13 +625,13 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - #RPi openGL + # RPi openGL #///////////////////////////////////////////////////////////////////////////////////// RPi_OpenGL_Main(){ (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi - #Always remove previous vc4 overlay entry + # Always remove previous vc4 overlay entry sed -i '/^[[:blank:]]*dtoverlay=vc4-/d' $FP_RPI_CONFIG if [[ $INPUT_DEVICE_VALUE == 'vc4-'* ]]; then @@ -606,7 +643,7 @@ _EOF_ echo "dtoverlay=$INPUT_DEVICE_VALUE" >> $FP_RPI_CONFIG - # - set 1080p by default + # - Set 1080p by default G_CONFIG_INJECT 'framebuffer_width=' 'framebuffer_width=1920' $FP_RPI_CONFIG G_CONFIG_INJECT 'framebuffer_height=' 'framebuffer_height=1080' $FP_RPI_CONFIG @@ -641,7 +678,7 @@ _EOF_ Lcd_Panel_ESP01215E_Enable - #disable all + # Disable all elif [[ $INPUT_DEVICE_VALUE == 'none' ]]; then Lcd_Panel_Waveshare32_Disable @@ -656,7 +693,7 @@ _EOF_ fi - #Update dietpi.txt entry? + # Update dietpi.txt entry? (( $update_dietpitxt )) && G_CONFIG_INJECT 'CONFIG_LCDPANEL=' "CONFIG_LCDPANEL=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt } @@ -687,36 +724,35 @@ _EOF_ Lcd_Panel_Xorg_All_Enable(){ - #Xinput calibrator, fbset for con2fbmap + # Xinput calibrator, fbset for con2fbmap G_AG_CHECK_INSTALL_PREREQ fbset xinput-calibrator xserver-xorg-input-evdev mkdir -p /etc/X11/xorg.conf.d - # - Create desktop icon for xcalibration - # NB: libinput replaces this in start menu + # Create desktop icon for xcalibration + # - NB: libinput replaces this in start menu } - # - Waveshare32 + # Waveshare32 Lcd_Panel_Waveshare32_Enable_X11(){ cat << _EOF_ > /etc/X11/xorg.conf.d/99-waveshare32_xorg.conf Section "Device" - Identifier "Allwinner A10/A13 FBDEV" - Driver "fbdev" - Option "fbdev" "/dev/fb1" - - Option "SwapbuffersWait" "true" + Identifier "Allwinner A10/A13 FBDEV" + Driver "fbdev" + Option "fbdev" "/dev/fb1" + Option "SwapbuffersWait" "true" EndSection _EOF_ cat << _EOF_ > /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf Section "InputClass" -Identifier "calibration" -MatchProduct "ADS7846 Touchscreen" -Option "Calibration" "219 3835 3984 219" -Option "SwapAxes" "1" -Driver "evdev" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "219 3835 3984 219" + Option "SwapAxes" "1" + Driver "evdev" EndSection _EOF_ @@ -726,10 +762,10 @@ _EOF_ (( $G_HW_MODEL > 19 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-RPi/non-Odroid - #Disable 1st to reset any existing installations: + # Disable 1st to reset any existing installations: Lcd_Panel_Waveshare32_Disable - #RPi + # RPi if (( $G_HW_MODEL < 10 )); then # + X11 @@ -753,30 +789,29 @@ _EOF_ G_CONFIG_INJECT 'dtoverlay=waveshare32b' 'dtoverlay=waveshare32b:rotate=270' $FP_RPI_CONFIG # - Swap input axis - sed -i '/"SwapAxes"/c\ Option "SwapAxes" "1"' /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf + sed -i '/"SwapAxes"/c\ Option "SwapAxes" "1"' /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf # - Move fb0 xorg.conf out the way: https://github.com/MichaIng/DietPi/issues/767 - mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/99-fbturbo.conf + [[ -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]] && mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/99-fbturbo.conf - #Odroids + # Odroids else # + X11 Lcd_Panel_Xorg_All_Enable Lcd_Panel_Waveshare32_Enable_X11 - #con2fbmap, maps console (1) to panel(2). Run during boot. + # - con2fbmap, maps console (1) to panel(2). Run during boot. cat << _EOF_ > /etc/systemd/system/con2fbmap.service [Unit] Description=con2fbmap [Service] Type=oneshot +RemainAfterExit=yes ExecStart=$(command -v con2fbmap) 1 2 ExecStop=$(command -v con2fbmap) 1 0 -RemainAfterExit=yes - [Install] WantedBy=multi-user.target _EOF_ @@ -786,35 +821,30 @@ _EOF_ G_CONFIG_INJECT 'spicc' 'spicc' /etc/modules G_CONFIG_INJECT 'fbtft_device' 'fbtft_device' /etc/modules - cat << _EOF_ > /etc/modprobe.d/waveshare32.conf -options fbtft_device name=odroidc_tft32 rotate=270 gpios=reset:116,dc:115 speed=32000000 cs=0 -_EOF_ + echo 'options fbtft_device name=odroidc_tft32 rotate=270 gpios=reset:116,dc:115 speed=32000000 cs=0' > /etc/modprobe.d/waveshare32.conf - #x11 + # - X11 cat << _EOF_ > /etc/X11/xorg.conf.d/99-waveshare32_xorg.conf Section "Device" - Identifier "FBDEV" - Driver "fbdev" - Option "fbdev" "/dev/fb2" - - #Option "SwapbuffersWait" "true" + Identifier "FBDEV" + Driver "fbdev" + Option "fbdev" "/dev/fb2" + #Option "SwapbuffersWait" "true" EndSection - _EOF_ fi - } Lcd_Panel_Waveshare32_Disable(){ - #all + # All [[ -f /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf ]] && rm /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf [[ -f /etc/X11/xorg.conf.d/99-waveshare32_xorg.conf ]] && rm /etc/X11/xorg.conf.d/99-waveshare32_xorg.conf [[ -f /usr/share/applications/xinput_calibrator.desktop ]] && rm /usr/share/applications/xinput_calibrator.desktop - #RPi + # RPi if (( $G_HW_MODEL < 10 )); then [[ -f /boot/overlays/waveshare32b.dtbo ]] && rm /boot/overlays/waveshare32b.dtbo @@ -825,19 +855,24 @@ _EOF_ sed -i '/^[[:blank:]]*dtoverlay=ads7846,cs=1,penirq=17/d' $FP_RPI_CONFIG sed -i '/^[[:blank:]]*dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1/d' $FP_RPI_CONFIG - # - Leave these enabled, just incase the user has other hardware that may use them. + # - Leave these enabled, just in case the user has other hardware that may use them. #sed -i '/^[[:blank:]]*dtparam=i2c_arm=/c\dtparam=i2c_arm=on' $FP_RPI_CONFIG #sed -i '/^[[:blank:]]*dtparam=spi=/c\dtparam=spi=on' $FP_RPI_CONFIG # - Move fb0 xorg.conf back: https://github.com/MichaIng/DietPi/issues/767 - [[ -f /usr/share/X11/99-fbturbo.conf ]] && mv /usr/share/X11/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.conf + [[ -f /usr/share/X11/99-fbturbo.conf && ! -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]] && mv /usr/share/X11/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.conf + + # Odroids + elif (( $G_HW_MODEL < 20 )); then - #Odroids - elif (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then + if [[ -f /etc/systemd/system/con2fbmap.service ]]; then - [[ -f /etc/systemd/system/con2fbmap.service ]] && rm /etc/systemd/system/con2fbmap.service - systemctl daemon-reload + systemctl stop con2fbmap + systemctl disable con2fbmap + rm /etc/systemd/system/con2fbmap.service + systemctl daemon-reload + fi [[ -f /etc/modprobe.d/waveshare32.conf ]] && rm /etc/modprobe.d/waveshare32.conf sed -i '/^[[:blank:]]*spicc/d' /etc/modules sed -i '/^[[:blank:]]*fbtft_device/d' /etc/modules @@ -846,16 +881,14 @@ _EOF_ } - # - Odroid Cloudshell + # Odroid Cloudshell Lcd_Panel_Odroidcloudshell_Enable(){ - cat << _EOF_ > /etc/modprobe.d/odroid-cloudshell.conf -options fbtft_device name=hktft9340 busnum=1 rotate=270 -_EOF_ + echo 'options fbtft_device name=hktft9340 busnum=1 rotate=270' > /etc/modprobe.d/odroid-cloudshell.conf G_CONFIG_INJECT 'spi_s3c64xx' 'spi_s3c64xx' /etc/modules G_CONFIG_INJECT 'fbtft_device' 'fbtft_device' /etc/modules - echo 'fbtft_device' >> /etc/modules #XU4 4.9 workaround: https://github.com/MichaIng/DietPi/issues/926#issuecomment-299480918 + echo 'fbtft_device' >> /etc/modules # XU4 4.9 workaround: https://github.com/MichaIng/DietPi/issues/926#issuecomment-299480918 } @@ -872,12 +905,12 @@ _EOF_ } - # - Odroid LCD 3.5 + # Odroid LCD 3.5 Lcd_Panel_OdroidLCD35_Enable(){ (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid - #Reset to disabled: + # Reset to disabled: Lcd_Panel_OdroidLCD35_Disable Lcd_Panel_Xorg_All_Enable @@ -913,9 +946,7 @@ _EOF_ done - unset amodules - - #Service + # Service # - XU4 if (( $G_HW_MODEL == 11 )); then @@ -969,25 +1000,25 @@ _EOF_ systemctl daemon-reload systemctl enable odroid-lcd35 - #XORG - [[ -f /etc/X11/xorg.conf.d/exynos.conf ]] && rm /etc/X11/xorg.conf.d/exynos.conf #XU4 + # - X.org + [[ -f /etc/X11/xorg.conf.d/exynos.conf ]] && rm /etc/X11/xorg.conf.d/exynos.conf # XU4 mkdir -p /etc/X11/xorg.conf.d cat << _EOF_ > /etc/X11/xorg.conf.d/99-odroid-lcd35.conf Section "Device" - Identifier "C fbdev" - Driver "fbdev" - Option "fbdev" "/dev/fb2" + Identifier "C fbdev" + Driver "fbdev" + Option "fbdev" "/dev/fb2" EndSection _EOF_ # - default calibration cat << _EOF_ > /etc/X11/xorg.conf.d/99-calibration.conf Section "InputClass" - Identifier "calibration" - MatchProduct "SX865X Touchscreen" - Option "Calibration" "3854 155 3880 262" - Option "SwapAxes" "0" + Identifier "calibration" + MatchProduct "SX865X Touchscreen" + Option "Calibration" "3854 155 3880 262" + Option "SwapAxes" "0" EndSection _EOF_ @@ -997,14 +1028,20 @@ _EOF_ [[ -f /etc/X11/xorg.conf.d/99-calibration.conf ]] && rm /etc/X11/xorg.conf.d/99-calibration.conf [[ -f /etc/modprobe.d/odroid-lcd35.conf ]] && rm /etc/modprobe.d/odroid-lcd35.conf - [[ -f /etc/systemd/system/odroid-lcd35.service ]] && rm /etc/systemd/system/odroid-lcd35.service + if [[ -f /etc/systemd/system/odroid-lcd35.service ]]; then + + systemctl stop odroid-lcd35 + systemctl disable odroid-lcd35 + rm /etc/systemd/system/odroid-lcd35.service + systemctl daemon-reload + + fi [[ -f /etc/X11/xorg.conf.d/99-odroid-lcd35.conf ]] && rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf - systemctl daemon-reload } #///////////////////////////////////////////////////////////////////////////////////// - # i2c + # I2C #///////////////////////////////////////////////////////////////////////////////////// I2c_Main(){ @@ -1012,18 +1049,18 @@ _EOF_ if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - #Check/install pre-reqs + # Check/install pre-reqs G_AG_CHECK_INSTALL_PREREQ python-smbus i2c-tools - #Kernel modules + # Kernel modules G_CONFIG_INJECT 'i2c-bcm2708' 'i2c-bcm2708' /etc/modules G_CONFIG_INJECT 'i2c-dev' 'i2c-dev' /etc/modules - #config.txt + # config.txt G_CONFIG_INJECT 'dtparam=i2c_arm=' 'dtparam=i2c_arm=on' $FP_RPI_CONFIG G_CONFIG_INJECT 'dtparam=i2c1=' 'dtparam=i2c1=on' $FP_RPI_CONFIG - #DietPi-Software, set installed + # DietPi-Software, set installed sed -i '/^aSOFTWARE_INSTALL_STATE\[72\]=/c\aSOFTWARE_INSTALL_STATE\[72\]=2' /DietPi/dietpi/.installed elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then @@ -1034,12 +1071,12 @@ _EOF_ G_CONFIG_INJECT 'dtparam=i2c1=' 'dtparam=i2c1=off' $FP_RPI_CONFIG G_CONFIG_INJECT 'i2c_arm_baudrate=' 'i2c_arm_baudrate=100000' $FP_RPI_CONFIG - #Set baudrate (khz) | valid int + # Set baudrate (khz) | valid int elif disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 2 10000000; then G_CONFIG_INJECT 'i2c_arm_baudrate=' "i2c_arm_baudrate=$(( $INPUT_DEVICE_VALUE * 1000 ))" $FP_RPI_CONFIG - #inform user + # inform user INPUT_DEVICE_VALUE+='Khz' else @@ -1051,22 +1088,21 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # bluetooth + # Bluetooth #///////////////////////////////////////////////////////////////////////////////////// Bluetooth_Main(){ - local aBLUETOOTH_MODULES=() - - aBLUETOOTH_MODULES=('bluetooth') - aBLUETOOTH_MODULES+=('bnep') - - aBLUETOOTH_MODULES+=('btbcm') # rpi3 broadcom onboard + local aBLUETOOTH_MODULES=( - aBLUETOOTH_MODULES+=('rfcomm') # BPi pro/m2+ and others - aBLUETOOTH_MODULES+=('hidp') # BPi pro/m2+ and others + 'bluetooth' + 'bnep' + 'btbcm' # RPi3 Broadcom onboard + 'rfcomm' # BPi Pro/M2+ and others + 'hidp' # BPi Pro/M2+ and others + 'hci_uart' - aBLUETOOTH_MODULES+=('hci_uart') + ) [[ -f /etc/modprobe.d/disable_bt.conf ]] && rm /etc/modprobe.d/disable_bt.conf @@ -1080,7 +1116,7 @@ _EOF_ systemctl disable brcm_patchram_plus 2> /dev/null # + RPi 3 (apply to all, as pi-bluetooth package is default installed on all RPi's now) - # + Asus TB + # + ASUS TB elif (( $G_HW_MODEL < 10 || $G_HW_MODEL == 52 )); then systemctl stop hciuart 2> /dev/null @@ -1088,7 +1124,7 @@ _EOF_ fi - #bluetooth last + # Bluetooth last systemctl stop bluetooth 2> /dev/null systemctl disable bluetooth 2> /dev/null @@ -1100,7 +1136,7 @@ _EOF_ done - #Purge packages + # Purge packages if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then G_AGP bluetooth bluez-firmware pi-bluetooth @@ -1111,23 +1147,24 @@ _EOF_ # - Enable elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - # + RPi - # Serial console must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 + # Pre-Reqs if (( $G_HW_MODEL < 10 )); then + # - Serial console must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 INPUT_DEVICE_VALUE='disable' Serial_Main + G_AG_CHECK_INSTALL_PREREQ pi-bluetooth - fi + else - #Pre-Reqs - G_AG_CHECK_INSTALL_PREREQ bluetooth bluez-firmware - (( $G_HW_MODEL < 10 )) && G_AG_CHECK_INSTALL_PREREQ pi-bluetooth + G_AG_CHECK_INSTALL_PREREQ bluetooth bluez-firmware - #bluetooth first - for ((i=0; i<${#aBLUETOOTH_MODULES[@]}; i++)) + fi + + # Bluetooth first + for i in "${aBLUETOOTH_MODULES[@]}" do - modprobe "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null + modprobe "$i" 2> /dev/null done @@ -1142,7 +1179,7 @@ _EOF_ systemctl enable bluetooth 2> /dev/null G_RUN_CMD systemctl start bluetooth - # + RPi + # + RPi if (( $G_HW_MODEL < 10 )); then systemctl enable hciuart @@ -1156,8 +1193,6 @@ _EOF_ fi - unset aBLUETOOTH_MODULES - } #///////////////////////////////////////////////////////////////////////////////////// @@ -1170,7 +1205,7 @@ _EOF_ G_DIETPI-NOTIFY 1 'IPv6 is not supported or disabled on kernel level. Aborting...' EXIT_CODE=1 - return + return 1 elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then @@ -1203,17 +1238,17 @@ _EOF_ else Unknown_Input_Mode - return + return 1 fi # Failsafe: Comment "disable_ipv6" entries in all other sysctl config files local i='' - for i in /etc/sysctl.conf /etc/sysctl.d/* + for i in /etc/sysctl{,.d/*}.conf do [[ ! -f $i || $i == *'dietpi-disable_ipv6.conf' ]] && continue - sed -i 's/^[[:blank:]]*net.ipv6.conf.[^[:blank:]].disable_ipv6[[:blank:]]*=/#&/' $i + sed -i 's/^[[:blank:]]*net.ipv6.conf.[^[:blank:]]*.disable_ipv6[[:blank:]]*=/#&/' $i done @@ -1242,7 +1277,7 @@ _EOF_ else Unknown_Input_Mode - return + return 1 fi @@ -1260,21 +1295,16 @@ _EOF_ Wifi_Modules_Main(){ - local aWIFI_MODULES=() - # - All - aWIFI_MODULES=('cfg80211') + local aWIFI_MODULES=('cfg80211') - #NB: we need to start doing these device specific via $G_HW_MODEL index. This prevents unnecessary modules getting loaded. - # + RPi 3 - aWIFI_MODULES+=('brcmfmac') #onboard WiFi - aWIFI_MODULES+=('brcmutil') #onboard WiFi + # + RPi with onboard WiFi + if (( $G_HW_MODEL < 10 && $HW_ONBOARD_WIFI )); then - # + BPi Pro - aWIFI_MODULES+=('ap6211') #onboard + aWIFI_MODULES+=('brcmfmac' 'brcmutil') # + OrangePi Zero - if (( $G_HW_MODEL == 32 )); then + elif (( $G_HW_MODEL == 32 )); then aWIFI_MODULES+=('xradio_wlan') @@ -1283,28 +1313,43 @@ _EOF_ aWIFI_MODULES+=('8189es') - # + Pine A64 / PB / Asus tinker board (onboard) - elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 44 || $G_HW_MODEL == 52 )); then + # + Pine A64 / PB / ASUS Tinker Board (onboard) + elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 44 || $G_HW_MODEL == 52 )); then aWIFI_MODULES+=('8723bs') + # + BPi Pro (onboard) + elif (( $G_HW_MODEL == 51 )); then + + aWIFI_MODULES+=('ap6211') + # + NanoPi NEO Air / Zero 2+ elif (( $G_HW_MODEL == 35 || $G_HW_MODEL == 64 )); then - #4.9 uses brcm, only enable dhd for 3.x - [[ ! -d '/boot/dtb' ]] && aWIFI_MODULES+=('dhd') + # 4.9 uses brcm, only enable dhd for 3.x + if [[ -d '/boot/dtb' ]]; then - fi + aWIFI_MODULES+=('brcmfmac' 'brcmutil') + + else + + aWIFI_MODULES+=('dhd') + + fi # + NanoPi T3 - aWIFI_MODULES+=('bcmdhd') + elif (( $G_HW_MODEL == 62 )); then + + aWIFI_MODULES+=('bcmdhd') + + fi # - Disable if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then [[ -f /etc/modprobe.d/disable_wifi.conf ]] && rm /etc/modprobe.d/disable_wifi.conf - #cfg80211 last + # cfg80211 last for ((i=$(( ${#aWIFI_MODULES[@]} - 1 )); i>=0; i--)) do @@ -1326,19 +1371,19 @@ _EOF_ # - Disable known powersaving options for specific chipsets echo 'options 8192cu rtw_power_mgnt=0' > /etc/modprobe.d/8192cu.conf echo 'options 8188eu rtw_power_mgnt=0' > /etc/modprobe.d/8188eu.conf - echo 'options 8189es rtw_power_mgnt=0' > /etc/modprobe.d/8189es.conf #OPi Plus - echo 'options 8723bs rtw_power_mgnt=0' > /etc/modprobe.d/8723bs.conf #PineA64 + echo 'options 8189es rtw_power_mgnt=0' > /etc/modprobe.d/8189es.conf # OPi Plus + echo 'options 8723bs rtw_power_mgnt=0' > /etc/modprobe.d/8723bs.conf # Pine A64 echo 'options wlan_8192eu rtw_power_mgnt=0' > /etc/modprobe.d/wlan_8192eu.conf # Sparky/Allo WiFi - #cfg80211 first - for ((i=0; i<${#aWIFI_MODULES[@]}; i++)) + # cfg80211 first + for i in "${aWIFI_MODULES[@]}" do - modprobe "${aWIFI_MODULES[$i]}" 2> /dev/null + modprobe "$i" 2> /dev/null done - # - Delay. Without this, kernel reports wifi device not found with RPi 3 and Pine A64 addon board, when ran straight after this script. + # - Delay. Without this, kernel reports WiFi device not found with RPi 3 and Pine A64 addon board, when ran straight after this script. G_DIETPI-NOTIFY 2 'Please wait, enabling WiFi Modules...' # - Had to up the delay from 3 seconds to 8 seconds on WPA2-Enterprise, otherwise still get device not found error. sleep 8 @@ -1346,26 +1391,26 @@ _EOF_ # + RPi 3+, unlock scan+wifi https://github.com/MichaIng/DietPi/issues/1627 rfkill unblock wifi &> /dev/null - #Update our networking file (refresh active wlan index) + # Update our networking file (refresh active wlan index) /DietPi/dietpi/func/obtain_network_details elif [[ $INPUT_DEVICE_VALUE == 'onboard_enable' ]]; then - (( $HW_ONBOARD_WIFI )) || + (( $HW_ONBOARD_WIFI )) || { Unsupported_Input_Mode; return 1; } - #NB: Requires reboot - #NB: Do not change filenames, -f check used by DietPi-Config to obtain state + # NB: Requires reboot + # NB: Do not change filenames, -f check used by DietPi-Config to obtain state [[ -f /etc/modprobe.d/disable_wifi_rpi3_onboard.conf ]] && rm /etc/modprobe.d/disable_wifi_rpi3_onboard.conf elif [[ $INPUT_DEVICE_VALUE == 'onboard_disable' ]]; then - (( $HW_ONBOARD_WIFI )) || + (( $HW_ONBOARD_WIFI )) || { Unsupported_Input_Mode; return 1; } - #NB: Requires reboot - #NB: Do not change filenames, -f check used by DietPi-Config to obtain state + # NB: Requires reboot + # NB: Do not change filenames, -f check used by DietPi-Config to obtain state - # - RPi 3/ZeroW + # - RPi 3/Zero W echo 'blacklist brcmfmac' > /etc/modprobe.d/disable_wifi_rpi3_onboard.conf echo 'blacklist brcmutil' >> /etc/modprobe.d/disable_wifi_rpi3_onboard.conf @@ -1375,13 +1420,11 @@ _EOF_ fi - unset aWIFI_MODULES - } Wifi_Countrycode_Main(){ - #Use country code from command input. Implies new setting. + # Use country code from command input. Implies new setting. if [[ $INPUT_DEVICE_VALUE ]]; then # - Apply value to DietPi.txt @@ -1411,12 +1454,9 @@ _EOF_ Serial_Main(){ #------------------------------------------------------------------------------------- - #Enable + # Enable if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - #systemctl enable serial-getty@*.service # Wildcard does not work, we need to specify each possible tty device name - #systemctl enable serial-getty@ttyAMA[0-9].service # Number wildcards do not work, we need to specify each possible tty device number - G_DIETPI-NOTIFY 2 'Enabling known serial-getty services, please wait...' systemctl unmask serial-getty@tty 2> /dev/null systemctl enable serial-getty@tty 2> /dev/null @@ -1442,7 +1482,7 @@ _EOF_ done - #Device Specific: + # Device Specific: # - RPi if (( $G_HW_MODEL < 10 )); then @@ -1467,12 +1507,12 @@ _EOF_ sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini - # - Pine A64 - elif (( $G_HW_MODEL == 40 )); then + # - Pine A64 (on ARMbian ttyS0 boot output is forced) + elif (( $G_HW_MODEL == 40 && ! $ARMBIAN )); then - if ! grep -qi 'console=ttyS0,115200n8 ' /DietPi/uEnv.txt; then + if ! grep -qi 'console=ttyS0,115200n8 ' $FP_UENV; then - sed -i 's/console=tty0 /console=tty0 console=ttyS0,115200n8 /' /DietPi/uEnv.txt + sed -i 's/console=tty0 /console=tty0 console=ttyS0,115200n8 /' $FP_UENV fi @@ -1483,7 +1523,7 @@ _EOF_ #------------------------------------------------------------------------------------- - #Disable + # Disable elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then #Disable services. Although, this seems to have no effect on the cmdline.txt boot.ini etc serial console entries. They run regardless. But lets do it for consistency. @@ -1506,11 +1546,11 @@ _EOF_ done - #Device Specific: + # Device Specific: # - RPi if (( $G_HW_MODEL < 10 )); then - sed -i 's/console=ttyAMA0,115200 //' /boot/cmdline.txt #Replaced by enable_uart= + sed -i 's/console=ttyAMA0,115200 //' /boot/cmdline.txt # Replaced by enable_uart= G_CONFIG_INJECT 'enable_uart=' 'enable_uart=0' /DietPi/config.txt @@ -1524,10 +1564,10 @@ _EOF_ sed -i 's/console=ttySAC2,115200n8 //' /DietPi/boot.ini - # - Pine A64 - elif (( $G_HW_MODEL == 40 )); then + # - Pine A64 (on ARMbian ttyS0 boot output is forced) + elif (( $G_HW_MODEL == 40 && ! $ARMBIAN )); then - sed -i 's/console=ttyS0,115200n8 //' /DietPi/uEnv.txt + sed -i 's/console=ttyS0,115200n8 //' $FP_UENV fi @@ -1545,32 +1585,28 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # soundcard #///////////////////////////////////////////////////////////////////////////////////// - #NB: When adding a new dtoverlay soundcard, we must add the dtoverlay name for deletion in Soundcard_Reset_RPi() + # NB: When adding a new dtoverlay soundcard, we must add the dtoverlay name for deletion in Soundcard_Reset_RPi() SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=0 ALSA_EQ_ENABLED=0 - #Disable all soundcards and revert back to default output if available. + # Disable all soundcards and revert back to default output if available. Soundcard_Reset_All(){ SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=0 ALSA_EQ_ENABLED=0 - #Remove previous asound.conf + # Remove previous asound.conf [[ -f /etc/asound.conf ]] && rm /etc/asound.conf # - Pre-Reqs for any soundcard G_AG_CHECK_INSTALL_PREREQ alsa-utils # Intel sound firmware - if grep -qi 'vendor_id.*intel' /proc/cpuinfo; then - - G_AG_CHECK_INSTALL_PREREQ firmware-intel-sound - - fi + grep -qi 'vendor_id.*intel' /proc/cpuinfo && G_AG_CHECK_INSTALL_PREREQ firmware-intel-sound - #HW specific + # HW specific # - RPi if (( $G_HW_MODEL < 10 )); then @@ -1640,8 +1676,10 @@ _EOF_ # - Disable forced analogue out if [[ -f /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service ]]; then + systemctl stop rpi-bcm2835_forced_3.5mm systemctl disable rpi-bcm2835_forced_3.5mm rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service + systemctl daemon-reload fi @@ -1654,19 +1692,21 @@ _EOF_ [[ -f /var/lib/dietpi/postboot.d/c2_smp.sh ]] && rm /var/lib/dietpi/postboot.d/c2_smp.sh - # - hifi shield plus + # - HiFi shield plus sed -i '/^[[:blank:]]*snd-soc-pcm5102/d' /etc/modules sed -i '/^[[:blank:]]*snd-soc-odroid-dac/d' /etc/modules - # - hifi shield 2 + # - HiFi shield 2 sed -i '/^[[:blank:]]*snd-soc-pcm512x/d' /etc/modules sed -i '/^[[:blank:]]*snd-soc-pcm512x-i2c/d' /etc/modules sed -i '/^[[:blank:]]*snd-soc-odroid-dac2/d' /etc/modules if [[ -f '/etc/systemd/system/odroid-hifishield2.service' ]]; then + systemctl stop odroid-hifishield2 systemctl disable odroid-hifishield2 rm /etc/systemd/system/odroid-hifishield2.service + systemctl daemon-reload fi @@ -1674,23 +1714,22 @@ _EOF_ Soundcard_Reset_H2(){ - #set 3.5mm + # Set 3.5mm amixer set -c 0 'Audio lineout' unmute &> /dev/null } Soundcard_Reset_H3(){ - #set hdmi + # Set HDMI amixer set -c 0 'Audio lineout' mute &> /dev/null - SOUNDCARD_TARGET_CARD=1 } Soundcard_Reset_Asus(){ - #set hdmi + # Set HDMI SOUNDCARD_TARGET_CARD=1 } @@ -1699,21 +1738,21 @@ _EOF_ sed -i '/^[[:blank:]]*snd-soc-allo-piano-dac/d' /etc/modules - # - HDMI + # Set HDMI SOUNDCARD_TARGET_DEVICE=1 amixer -c 0 sset 'audio output mode switch' 'hdmi' # Disable USB 1.1 compat - sed -i 's/aotg.aotg1_speed=1/aotg.aotg1_speed=0/' /DietPi/uEnv.txt + sed -i 's/aotg.aotg1_speed=1/aotg.aotg1_speed=0/' $FP_UENV - # - auto unmute + # Auto unmute [[ -f /var/lib/dietpi/postboot.d/sparky_unmute.sh ]] && rm /var/lib/dietpi/postboot.d/sparky_unmute.sh } Soundcard_Reset_BPi_Pro(){ - #3.5mm: https://github.com/MichaIng/DietPi/issues/732#issuecomment-275915919 + # Set 3.5mm: https://github.com/MichaIng/DietPi/issues/732#issuecomment-275915919 SOUNDCARD_TARGET_CARD=0 amixer sset 'Left Mixer Left DAC' off @@ -1729,10 +1768,10 @@ _EOF_ Soundcard_Main(){ #----------------------------------------------------------------------------- - #Always reset soundcards and revert back to HDMI + # Always reset soundcards and revert back to HDMI Soundcard_Reset_All #----------------------------------------------------------------------------- - #Apply specific asound.confs and additional settings + # Apply specific asound.confs and additional settings # - ALSA EQ enabled? if [[ $INPUT_DEVICE_VALUE == *'-eq' ]]; then @@ -1750,12 +1789,12 @@ _EOF_ # - RPi: Enable DTPARAM audio setting (( $G_HW_MODEL < 10 )) && G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' $FP_RPI_CONFIG - #Cards + # Cards case "$INPUT_DEVICE_VALUE" in - #ALL: ---------------------------------------------------------------------- + # ALL: ---------------------------------------------------------------------- - #Specify card + device indexs + # Specify card + device indexs hw:*) echo "$INPUT_DEVICE_VALUE" @@ -1779,7 +1818,7 @@ _EOF_ # USB 1.1 compat mode (Sparky currently) if [[ $INPUT_DEVICE_VALUE == 'usb-dac-1.1' ]]; then - sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' /DietPi/uEnv.txt + sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' $FP_UENV fi @@ -1788,7 +1827,7 @@ _EOF_ for x in \$(amixer controls | grep layback) do - amixer cset "\$x" 100% &> /dev/null + amixer cset "\$x" 100% &> /dev/null done alsactl store &> /dev/null @@ -1798,7 +1837,7 @@ _EOF_ elif (( $G_HW_MODEL == 12 )); then cat << _EOF_ > /var/lib/dietpi/postboot.d/c2_smp.sh -#!/bin/bash +#!/bin/dash echo 4 > /proc/irq/63/smp_affinity echo 8 > /proc/irq/62/smp_affinity _EOF_ @@ -1820,7 +1859,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # rpi-bcm2835 # rpi-bcm2835-ultrahq # rpi-bcm2835-3.5mm @@ -1837,12 +1876,11 @@ _EOF_ [Unit] Description=Forces sound through 3.5mm analogue Before=sound.target -After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service +After=dietpi-boot.service [Service] Type=simple RemainAfterExit=yes - ExecStart=/usr/bin/amixer -c 0 cset numid=3 1 [Install] @@ -1856,7 +1894,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # hifiberry-dac # hifiberry-dacplus # hifiberry-digi @@ -1869,7 +1907,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # googlevoicehat-soundcard googlevoicehat-soundcard*) @@ -1882,7 +1920,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero # JustBoom-digi: Digi HAT and Digi Zero justboom-*) @@ -1892,7 +1930,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # allo-piano-dac-pcm512x-audio # allo-piano-dac-plus-pcm512x-audio (2.1) allo-piano-dac*) @@ -1913,7 +1951,7 @@ _EOF_ ;; - #Sparky SBC (module) + # Sparky SBC (module) # snd-soc-allo-piano-dac # snd-soc-allo-piano-dac-plus (2.1) snd-soc-allo-piano-dac*) @@ -1936,7 +1974,7 @@ _EOF_ ;; - #Sparky SBC + # Sparky SBC # allo-cheapo-analogue #3.5mm/RCA # allo-cheapo-optical #Optical out allo-cheapo*) @@ -1960,7 +1998,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # allo-boss-dac-pcm512x-audio # allo-digione # allo-katana-dac-audio @@ -1980,7 +2018,7 @@ _EOF_ ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # rpi-dac rpi-dac) @@ -1989,7 +2027,7 @@ _EOF_ ;; - #AudioPhonics I-Sabre-K2M (dtoverlay) + # AudioPhonics I-Sabre-K2M (dtoverlay) # i-sabre-k2m i-sabre-k2m) @@ -2047,7 +2085,7 @@ NB: The module must be rebuilt each time the kernel is upgraded. For this, simpl ;; - #RPi (dtoverlay) + # RPi (dtoverlay) # applepi-dac applepi*) @@ -2063,8 +2101,8 @@ NB: The module must be rebuilt each time the kernel is upgraded. For this, simpl ;; - #dionaudio-loco - #dionaudio-loco-v2 + # dionaudio-loco + # dionaudio-loco-v2 dionaudio-loco*) # - enable dtoverlay @@ -2072,7 +2110,7 @@ NB: The module must be rebuilt each time the kernel is upgraded. For this, simpl ;; - #Odroid ------------------------------------------------------------------------------- + # Odroid ------------------------------------------------------------------------------- odroid-hifishield-plus) G_CONFIG_INJECT 'snd-soc-pcm5102' 'snd-soc-pcm5102' /etc/modules @@ -2099,8 +2137,7 @@ After=local-fs.target [Service] Type=oneshot RemainAfterExit=yes - -ExecStart=/bin/bash -c 'echo pcm5242 0x4c > /sys/class/i2c-adapter/i2c-1/new_device' +ExecStart=/bin/dash -c 'echo pcm5242 0x4c > /sys/class/i2c-adapter/i2c-1/new_device' ExecStart=$(command -v amixer) -c 1 sset Analogue 0 ExecStart=$(command -v amixer) -c 1 sset Digital 201 ExecStart=$(command -v amixer) -c 1 sset Deemphasis on @@ -2113,7 +2150,7 @@ _EOF_ ;; - #H2 ------------------------------------------------------------------------------- + # H2 ------------------------------------------------------------------------------- h2-hdmi) amixer set -c 0 'Audio lineout' mute &> /dev/null @@ -2121,7 +2158,7 @@ _EOF_ ;; - #H3 ------------------------------------------------------------------------------- + # H3 ------------------------------------------------------------------------------- h3-analogue) amixer set -c 0 'Audio lineout' unmute &> /dev/null @@ -2129,7 +2166,7 @@ _EOF_ ;; - #Pine A64 ------------------------------------------------------------------------------- + # Pine A64 ------------------------------------------------------------------------------- pine64-analogue) cat << _EOF_ > /etc/modules-load.d/pine64-audiojack.conf @@ -2142,14 +2179,14 @@ _EOF_ ;; - #NanoPi M2/M3 ------------------------------------------------------------------------------- + # NanoPi M2/M3 ------------------------------------------------------------------------------- s5pxx18-hdmi) SOUNDCARD_TARGET_CARD=1 ;; - #Asus tinker ------------------------------------------------------------------------------- + # Asus tinker ------------------------------------------------------------------------------- asus-tb-analogue) SOUNDCARD_TARGET_CARD=0 @@ -2164,32 +2201,32 @@ _EOF_ cat << _EOF_ > /etc/asound.conf pcm.softvol { - type softvol - slave.pcm dmix - control { - name Master - card 0 - } + type softvol + slave.pcm dmix + control { + name Master + card 0 + } } pcm.micboost { - type route - slave.pcm dsnoop - ttable { - 0.0 30.0 - 1.1 30.0 - } + type route + slave.pcm dsnoop + ttable { + 0.0 30.0 + 1.1 30.0 + } } pcm.!default { - type asym - playback.pcm "plug:softvol" - capture.pcm "plug:micboost" + type asym + playback.pcm "plug:softvol" + capture.pcm "plug:micboost" } ctl.!default { - type hw - card 0 + type hw + card 0 } _EOF_ @@ -2197,25 +2234,25 @@ _EOF_ cat << _EOF_ > /etc/asound.conf ctl.eq { - type equal - controls "$HOME/.alsaequal.bin" + type equal + controls "/root/.alsaequal.bin" } pcm.plugequal { - type equal - slave.pcm "plughw:$SOUNDCARD_TARGET_CARD,$SOUNDCARD_TARGET_DEVICE" - controls "$HOME/.alsaequal.bin" + type equal + slave.pcm "plughw:$SOUNDCARD_TARGET_CARD,$SOUNDCARD_TARGET_DEVICE" + controls "/root/.alsaequal.bin" } pcm.!default { - type plug - slave.pcm plugequal - slave.channels 2 + type plug + slave.pcm plugequal + slave.channels 2 } ctl.!default { - type hw - card $SOUNDCARD_TARGET_CARD + type hw + card $SOUNDCARD_TARGET_CARD } _EOF_ @@ -2225,13 +2262,13 @@ _EOF_ cat << _EOF_ > /etc/asound.conf pcm.!default { - type hw - card $SOUNDCARD_TARGET_CARD - device $SOUNDCARD_TARGET_DEVICE + type hw + card $SOUNDCARD_TARGET_CARD + device $SOUNDCARD_TARGET_DEVICE } ctl.!default { - type hw - card $SOUNDCARD_TARGET_CARD + type hw + card $SOUNDCARD_TARGET_CARD } _EOF_ @@ -2239,13 +2276,11 @@ _EOF_ } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - #info - + # info G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)" #----------------------------------------------------------------------------------- @@ -2316,6 +2351,7 @@ _EOF_ else Unknown_Input_Name + EXIT_CODE=1 fi From 22a4e2640276d70f99f80ebbe2f3e3c746841343 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 29 Mar 2019 02:31:37 +0100 Subject: [PATCH 011/253] META | README.md: Add Sparky SBC GitHub sources to Additional Software list + typo --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b25f6d8abc..17c389d9fd 100644 --- a/README.md +++ b/README.md @@ -190,10 +190,11 @@ along with this program. If not, see https://www.gnu.org/licenses/ Links to additional software used in DietPi and their source and build instructions where applicable: - [Linux kernel](https://github.com/torvalds/linux) -- [GNU operating sytem](https://www.gnu.org/) +- [GNU operating system](https://www.gnu.org/) - [Debian distribution](https://salsa.debian.org/) - [Raspberry](https://github.com/raspberrypi) [Pi](https://github.com/RPi-Distro) - [Odroid](https://github.com/hardkernel?tab=repositories) +- [Sparky](https://github.com/sparkysbc?tab=repositories) [SBC](https://github.com/sparky-sbc/sparky-test) - [FriendlyARM](https://github.com/friendlyarm?tab=repositories) - [X.Org-X-Server](https://www.x.org/archive//individual/) - [LXDE desktop](https://github.com/LXDE) From ff0af2d0cc139b9b8a5449ea41302811e49c8efa Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 29 Mar 2019 13:13:53 +0000 Subject: [PATCH 012/253] v6.23 + remove debug printout --- CHANGELOG.txt | 2 ++ dietpi/dietpi-software | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d4c062fd4d..c97dea85a7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,8 @@ Known/Outstanding Issues: For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues +----------------------------------------------------------------------------------------------------------- + v6.22 (23/03/19) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 68c0204fbf..aa6e6b51c9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15316,8 +15316,6 @@ _EOF_ fi - echo $i - G_WHIP_CHECKLIST_ARRAY+=($i "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" "$selected") display_software_menu=1 From 14c60510de00ea076a135b0f2d30cedbb898c8b2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 30 Mar 2019 03:27:23 +0100 Subject: [PATCH 013/253] META | README.md: Access feathub.com via HTTPS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17c389d9fd..b62e5e7db2 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ We are always looking for talented people who believe in the DietPi project, and Vote for new suggestions, feature-, software- or image requests, or add your own to our new FeatHub page: -[![Feature Requests](http://feathub.com/MichaIng/DietPi?format=svg)](http://feathub.com/MichaIng/DietPi) +[![Feature Requests](https://feathub.com/MichaIng/DietPi?format=svg)](https://feathub.com/MichaIng/DietPi) ## License From febdaefcbebe4c2797b6f1739d88c6e9888d93f0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 30 Mar 2019 04:14:22 +0100 Subject: [PATCH 014/253] v6.23 + DietPi-Software | Change all URLs to HTTPS where possible + DietPi-Software | Minor coding and wording --- dietpi/dietpi-software | 128 +++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 74 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index aa6e6b51c9..ac6d92a46c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3682,7 +3682,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - Download_Install 'http://yacy.net/release/yacy_v1.92_20161226_9000.tar.gz' /etc + Download_Install 'https://yacy.net/release/yacy_v1.92_20161226_9000.tar.gz' /etc fi @@ -3893,68 +3893,59 @@ _EOF_ fi - #Roon Bridge - software_id=121 + software_id=121 # Roon Bridge if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #x86_64 + # x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonBridge_linuxx64.tar.bz2' + INSTALL_URL_ADDRESS='https://download.roonlabs.com/builds/RoonBridge_linuxx64.tar.bz2' - #ARMv8 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonBridge_linuxarmv8.tar.bz2' + INSTALL_URL_ADDRESS='https://download.roonlabs.com/builds/RoonBridge_linuxarmv8.tar.bz2' - #ARMv7 + # ARMv7 else - INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonBridge_linuxarmv7hf.tar.bz2' + INSTALL_URL_ADDRESS='https://download.roonlabs.com/builds/RoonBridge_linuxarmv7hf.tar.bz2' fi Download_Install "$INSTALL_URL_ADDRESS" - # - reinstall, clear dir, prevent mv fail on non-empty dir - rm -R /etc/roonbridge &> /dev/null - - mkdir -p /etc/roonbridge - mv RoonBridge/* /etc/roonbridge - rm -R RoonBridge + # Clear dir on reinstall + [[ -d /etc/roonbridge ]] && rm -R /etc/roonbridge + mv RoonBridge /etc/roonbridge fi - #CAVA - software_id=119 + software_id=119 # CAVA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - armv6 + # armv6 if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.6.1-1_armv6.deb' - # - armv7 + # armv7 elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.6.1-1_armv7.deb' - # - arm64 + # arm64 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.6.1-1_arm64.deb' # Using older binary for Odroid C2 due to: https://github.com/MichaIng/DietPi/issues/1340#issuecomment-393225267 - if (( $G_HW_MODEL == 12 )); then - - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.4.2_arm64.deb' - - fi + (( $G_HW_MODEL == 12 )) && INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.4.2_arm64.deb' - # - x86_64 + # x86_64 elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/cava_0.6.1-1_amd64.deb' @@ -3968,8 +3959,7 @@ _EOF_ fi - #Mopidy - software_id=118 + software_id=118 # Mopidy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4232,8 +4222,7 @@ _EOF_ fi - #WEBMIN - software_id=115 + software_id=115 # Webmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4243,8 +4232,7 @@ _EOF_ fi - #O!MPD - software_id=129 + software_id=129 # O!MPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4284,7 +4272,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://install.pi-hole.net' + INSTALL_URL_ADDRESS='https://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. @@ -4378,7 +4366,7 @@ _EOF_ # - RPi if (( $G_HW_MODEL < 10 )); then - # http://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot + # https://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot Download_Install 'https://dietpi.com/downloads/binaries/all/wiringPi-8d188fa.tar.gz' # - Odroid's @@ -5281,15 +5269,15 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing - #x86_64 + # x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='http://builds.cuberite.org/job/Cuberite%20Linux%20x64%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' + INSTALL_URL_ADDRESS='https://builds.cuberite.org/job/Cuberite%20Linux%20x64%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' - #32bit ARM + # 32bit ARM elif (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS='http://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' + INSTALL_URL_ADDRESS='https://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' fi @@ -5553,7 +5541,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS1='https://dietpi.com/downloads/binaries/all/libjpeg8_8d1-2_amd64.deb' (( $G_DISTRO > 3 )) && INSTALL_URL_ADDRESS2='https://dietpi.com/downloads/binaries/all/libpng12-0_1.2.50-2+deb8u3_amd64.deb' || DEPS_LIST+=' libpng12-0' - INSTALL_URL_ADDRESS3='http://www.tonido.com/download.php?tonido64.tar.gz' + INSTALL_URL_ADDRESS3='https://www.tonido.com/download.php?tonido64.tar.gz' fi @@ -5645,8 +5633,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #CloudPrint - software_id=137 + software_id=137 # CloudPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5655,7 +5642,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='http://davesteele.github.io/cloudprint-service' - #url/redirect fails wget spider test... + # url/redirect fails wget spider test... G_CHECK_URL "$INSTALL_URL_ADDRESS" INSTALL_URL_ADDRESS+='/repo' @@ -5674,25 +5661,24 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #VirtualHere - software_id=138 + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://virtualhere.com/sites/default/files/usbserver/vhusbd' - #armv6+ + # ARMv6/7 if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='arm' - #ARMv8 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64' - #x86_64 + # x86_64 elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='x86_64' @@ -5789,23 +5775,22 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Sonarr - software_id=144 + software_id=144 # Sonarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #ARMv8 binary install: https://github.com/MichaIng/DietPi/issues/1502 + # ARMv8 binary install: https://github.com/MichaIng/DietPi/issues/1502 if (( $G_HW_ARCH == 3 )); then - Download_Install 'http://update.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz' /opt + Download_Install 'https://update.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz' /opt G_AGI mediainfo - #Repo install + # Repo install else apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC - echo 'deb http://apt.sonarr.tv/ develop main' > /etc/apt/sources.list.d/sonarr.list + echo 'deb https://apt.sonarr.tv/ develop main' > /etc/apt/sources.list.d/sonarr.list G_AGUP G_AGI nzbdrone @@ -5813,14 +5798,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Radarr - software_id=145 + software_id=145 # Radarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' - G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( + G_CHECK_URL "$INSTALL_URL_ADDRESS" # full filepath below, returns --spider error :( INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) DEPS_LIST='mediainfo' @@ -5828,8 +5812,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Lidarr - software_id=106 + software_id=106 # Lidarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5843,8 +5826,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #PlexPy - software_id=146 + software_id=146 # PlexPy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5961,8 +5943,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #RoonServer - software_id=154 + software_id=154 # RoonServer if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5972,7 +5953,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior # Skip download and install, if already existent, manual removal or internal updater can be used: if [[ ! -d $G_FP_DIETPI_USERDATA/roonserver ]]; then - Download_Install 'http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' $G_FP_DIETPI_USERDATA + Download_Install 'https://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' $G_FP_DIETPI_USERDATA mv $G_FP_DIETPI_USERDATA/RoonServer $G_FP_DIETPI_USERDATA/roonserver else @@ -5986,8 +5967,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte fi - #Steam - software_id=156 + software_id=156 # Steam if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6071,11 +6051,11 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='http://FuguHub.com/install/FuguHub.linux.install' + INSTALL_URL_ADDRESS='https://FuguHub.com/install/FuguHub.linux.install' else - INSTALL_URL_ADDRESS='http://FuguHub.com/releases/raspberrypi/install.sh' + INSTALL_URL_ADDRESS='https://FuguHub.com/releases/raspberrypi/install.sh' fi @@ -6085,7 +6065,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix chmod +x FHinstall.sh ./FHinstall.sh rm FHinstall.sh - wget http://fuguhub.com/box.zip -O /home/bd/applications/box.zip + wget https://fuguhub.com/box.zip -O /home/bd/applications/box.zip fi @@ -6798,7 +6778,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' + INSTALL_URL_ADDRESS='https://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' G_CHECK_URL "$INSTALL_URL_ADDRESS" wget "$INSTALL_URL_ADDRESS" -O node_install.sh @@ -7350,7 +7330,7 @@ _EOF_ cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf # -*- depends: fastcgi -*- # /usr/share/doc/lighttpd/fastcgi.txt.gz -# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi +# https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi ## Start an FastCGI server using php-fpm fastcgi.server += ( ".php" => @@ -9862,9 +9842,9 @@ _EOF_ wget https://dietpi.com/images/dietpi-logo_256.png -O /var/www/gallery/DietPi/logo_256.png mkdir -p /var/www/gallery/Tr-Zero - wget http://media.indiedb.com/images/games/1/25/24673/SS_0.jpg -O /var/www/gallery/Tr-Zero/SS_0.jpg - wget http://media.indiedb.com/images/games/1/25/24673/SS_44.jpg -O /var/www/gallery/Tr-Zero/SS_1.jpg - wget http://media.indiedb.com/images/games/1/25/24673/3.png -O /var/www/gallery/Tr-Zero/SS_2.jpg + wget https://media.indiedb.com/images/games/1/25/24673/SS_0.jpg -O /var/www/gallery/Tr-Zero/SS_0.jpg + wget https://media.indiedb.com/images/games/1/25/24673/SS_44.jpg -O /var/www/gallery/Tr-Zero/SS_1.jpg + wget https://media.indiedb.com/images/games/1/25/24673/3.png -O /var/www/gallery/Tr-Zero/SS_2.jpg #permissions for cache/thumbnail/database mkdir -p /var/www/gallery/_sfpg_data @@ -15499,7 +15479,7 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n while (( $USER_EMONHUB_APIKEY_COMPLETED == 0 )); do - G_WHIP_INPUTBOX "EmonHUB/EmonPi:\n\nPlease enter the \"Write API KEY\":\n - Visit http://emoncms.org to register an account and login. + G_WHIP_INPUTBOX "EmonHUB/EmonPi:\n\nPlease enter the \"Write API KEY\":\n - Visit https://emoncms.org to register an account and login. - Select \"Setup\" from the top right of screen, then select \"My Account\"\n - Enter the \"Write API Key\" into the box below." if (( $? == 0 )); then From ce890930d8239433f307b0bbe6219a84a718aedd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 30 Mar 2019 15:47:25 +0100 Subject: [PATCH 015/253] v6.23 + DietPi-Software | Download_Install: Allow $fallback_url to be used if given URL does not exist, e.g. scrape from api.github.com fails + DietPi-Software | Emby Server: Use last known stable release as fallback URL, if latest release does not contain a Debian package + DietPi-Software | Download_Install: Failsafe: Allow spaces in target path; Minor coding and wording --- dietpi/dietpi-software | 66 +++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ac6d92a46c..345edb8425 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3066,40 +3066,40 @@ _EOF_ } - #NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) + # Usage: # Download_Install 'https://file.com/file' /etc/install_here # dps_index=$software_id Download_Install 'conf_0' /etc/conf.conf + # Optional input variables: + # fallback_url='http...' = URL to use if e.g. grabbing URL from api.github.com fails: https://dietpi.com/phpbb/viewtopic.php?p=17390#p17390 + # no_check_url=[01] = Optionally disable URL check + # dps_index=$software_id = Download from DietPi GitHub repo based on software ID/index + # DEPS_LIST='pkg1 ...' = Install APT dependency packages + # NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) Download_Install(){ - #no_check_url = Optional disable URL check local url=$1 + [[ ! $url && $fallback_url ]] && url=$fallback_url local target=$2 # Extract target - local type=${url##*.} # grab ext from URL | compatbile with >> deb|zip|tar(.gz|.bz2)|7z - if [[ $type == 'gz' || $type == 'bz2' ]]; then - - type='tar' - - fi + local type=${url##*.} # Grab ext from URL | compatbile with >> deb|zip|tar(.gz|.bz2)|7z + [[ $type == 'gz' || $type == 'bz2' ]] && type='tar' + local file="$software_id.$type" - # - DietPi-Software conf/service mode - local dps_index=${dps_index:--1} - if (( $dps_index >= 0 )); then + # DietPi-Software conf/service mode + if disable_error=1 G_CHECK_VALIDINT "$dps_index" 0; then - type=$url - url="https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/dps_$dps_index/$type" + type='dps_index' + url="https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/dps_$dps_index/$url" fi - local file="$software_id.$type" - (( $no_check_url )) || G_CHECK_URL "$url" - unset no_check_url cd /tmp/$G_PROGRAM_NAME - # Download file (+thread if APT pre-reqs are to be installed) + # Download file if [[ $DEPS_LIST ]]; then + # - Download as background thread if dependencies are to be installed G_THREAD_START wget "$url" -O $file G_AGI $DEPS_LIST DEPS_LIST='' @@ -3112,42 +3112,35 @@ _EOF_ fi # Process downloaded file - if (( $dps_index >= 0 )); then + if [[ $type == dps_index ]]; then - # - Precreate dir + # - Pre-create dir local fp_dir=${target%/*} - if [[ ! -d $fp_dir ]]; then + [[ -d $fp_dir ]] || G_RUN_CMD mkdir -p "$fp_dir" - G_RUN_CMD mkdir -p $fp_dir - - fi - - [[ -f $target ]] && G_WHIP_MSG "[INFO] Configuration/data updated for:\n - $target" - - G_RUN_CMD cp -f $file $target + [[ -f $target ]] && G_WHIP_MSG "[INFO] Updating file: $target" + G_RUN_CMD mv $file "$target" elif [[ $type == deb ]]; then - # Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies + # - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies l_message='Installing deb package' G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg -i $file (( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF - #(( $G_ERROR_HANDLER_EXITCODE_RETURN )) && error? - elif [[ $type == zip ]]; then [[ $target ]] && target="-d $target" - l_message='Unzipping archive' G_RUN_CMD unzip -o $file $target + l_message='Unzipping archive' G_RUN_CMD unzip -o $file "$target" elif [[ $type == tar ]]; then - [[ $target ]] && mkdir -p $target && target="-C $target" - l_message='Unpacking tarball' G_RUN_CMD tar xf $file $target + [[ $target ]] && target="--one-top-level=$target" + l_message='Unpacking tarball' G_RUN_CMD tar xf $file "$target" elif [[ $type == 7z ]]; then [[ $target ]] && target="-o$target" - l_message='Extracting 7zip archive' G_RUN_CMD 7zr x -y $file $target + l_message='Extracting 7zip archive' G_RUN_CMD 7zr x -y $file "$target" else @@ -3156,6 +3149,7 @@ _EOF_ fi [[ -f $file ]] && l_message='Cleaning download directory' G_RUN_CMD rm $file + unset fallback_url dps_index no_check_url } @@ -5204,8 +5198,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #EMBYSERVER - software_id=41 + software_id=41 # Emby Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5228,6 +5221,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi + local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.0.2.0/emby-server-deb_4.0.2.0_$arch.deb" no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*emby-server-deb_.*_$arch\.deb" | cut -d \" -f 4)" unset arch From 27d364fc805e42db65a4f5afc7668bc2ae00460a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 30 Mar 2019 15:50:35 +0100 Subject: [PATCH 016/253] v6.23 + CHANGELOG | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c97dea85a7..a6bf4eea16 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 +- DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From 525a8d77845089abef73a0ac3ee63a52db0672d9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 31 Mar 2019 19:12:40 +0200 Subject: [PATCH 017/253] v6.23 + DietPi-Obtain_HW_model | RPi CM3 does not have onboard WiFi + DietPi-Obtain_HW_model | No not set locale or cd into /tmp since both is not required here + DietPi-Obtain_HW_model | Tiny coding --- dietpi/func/dietpi-obtain_hw_model | 125 ++++++++++++++--------------- 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 22d2e4b5c0..d24cc9221c 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -102,35 +102,30 @@ # HW_MANUFACTURER_NAME #//////////////////////////////////// - #----------------------------------------------------------------------------------- - #Set locale for all scripts, prevents incorrect scraping - export LANG=en_GB.UTF-8 - export LC_ALL=en_GB.UTF-8 - #Ensure we are in /tmp dir: https://github.com/MichaIng/DietPi/issues/2050#issuecomment-419901350 - cd /tmp - #----------------------------------------------------------------------------------- - #Import DietPi-Globals --------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals # Not required + #export LC_ALL=en_GB.UTF-8 # No locale dependant output scrape + #cd /tmp # No tmp file creation + # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Hardware Model index + # Obtain Hardware Model index #///////////////////////////////////////////////////////////////////////////////////// FP_G_HW_MODEL_INDENTIFIER='/etc/.dietpi_hw_model_identifier' - G_HW_MODEL=0 + G_HW_MODEL=-1 G_HW_MODEL_DESCRIPTION='Unknown Device' G_DISTRO=0 - ROOTFS_DEVICE_PATH=$(df | mawk '/\/$/ {print $1;exit}') + ROOTFS_DEVICE_PATH=$(df --output=source,target | mawk '/\/$/ {print $1;exit}') HW_UUID=0 G_HW_ARCH=0 - G_HW_ARCH_DESCRIPTION='unknown' + G_HW_ARCH_DESCRIPTION=$(uname -m) IMAGE_ADDITIONAL_CREDITS='' G_HW_CPUID=0 HW_ONBOARD_WIFI=0 - # RPi Extras + # RPi extras HW_REVISION_CODE=0 HW_RELEASE_DATE='Unknown' HW_PCB_REVISION_CODE='Unknown' @@ -140,7 +135,7 @@ RPi_BoardInfo(){ #----------------------------------------------------------------------------------- - #Obtain device info by revision number + # Obtain device info by revision number # *" because 10000002 then it indicates that your Raspberry Pi has been over-volted HW_REVISION_CODE=$(mawk '/Revision/ {print $3;exit}' /proc/cpuinfo) @@ -307,7 +302,6 @@ HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Sony' G_HW_MODEL=3 - HW_ONBOARD_WIFI=1 elif [[ $HW_REVISION_CODE == *'a21041' ]]; then @@ -423,227 +417,227 @@ # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc) Obtain_HW_Info(){ - #Systems that use /etc/.dietpi_hw_model_identifier for G_HW_MODEL + # Systems that use /etc/.dietpi_hw_model_identifier for G_HW_MODEL if [[ -f $FP_G_HW_MODEL_INDENTIFIER ]]; then G_HW_MODEL=$(sed -n 1p $FP_G_HW_MODEL_INDENTIFIER) - #Beagle Bone Black + # Beagle Bone Black if (( $G_HW_MODEL == 71 )); then G_HW_MODEL_DESCRIPTION='BBB' - #Sparky SBC + # Sparky SBC elif (( $G_HW_MODEL == 70 )); then G_HW_MODEL_DESCRIPTION='Sparky SBC' - #Firefly RK3399 + # Firefly RK3399 elif (( $G_HW_MODEL == 69 )); then G_HW_MODEL_DESCRIPTION='Firefly RK3399' G_HW_CPUID=3 - #NanoPC T4 + # NanoPC T4 elif (( $G_HW_MODEL == 68 )); then G_HW_MODEL_DESCRIPTION='NanoPC T4' G_HW_CPUID=3 - #NanoPi K1 Plus + # NanoPi K1 Plus elif (( $G_HW_MODEL == 67 )); then G_HW_MODEL_DESCRIPTION='NanoPi K1 Plus' G_HW_CPUID=2 - #NanoPi M1 Plus + # NanoPi M1 Plus elif (( $G_HW_MODEL == 66 )); then G_HW_MODEL_DESCRIPTION='NanoPi M1 Plus' G_HW_CPUID=1 - #NanoPi NEO 2 + # NanoPi NEO 2 elif (( $G_HW_MODEL == 65 )); then G_HW_MODEL_DESCRIPTION='NanoPi NEO 2' G_HW_CPUID=2 - #NanoPi NEO Air + # NanoPi NEO Air elif (( $G_HW_MODEL == 64 )); then G_HW_MODEL_DESCRIPTION='NanoPi NEO Air' G_HW_CPUID=1 - #NanoPi M1 + # NanoPi M1 elif (( $G_HW_MODEL == 63 )); then G_HW_MODEL_DESCRIPTION='NanoPi M1/T1' G_HW_CPUID=1 - #NanoPi M3 + # NanoPi M3 elif (( $G_HW_MODEL == 62 )); then G_HW_MODEL_DESCRIPTION='NanoPi M3/T3/F3' - #NanoPi M2 + # NanoPi M2 elif (( $G_HW_MODEL == 61 )); then G_HW_MODEL_DESCRIPTION='NanoPi M2/T2' - #NanoPi Neo + # NanoPi Neo elif (( $G_HW_MODEL == 60 )); then G_HW_MODEL_DESCRIPTION='NanoPi Neo' G_HW_CPUID=1 - #BananaPi (1st Gen) + # BananaPi (1st Gen) elif (( $G_HW_MODEL == 53 )); then G_HW_MODEL_DESCRIPTION='BananaPi' - #Asus Tinker Board + # Asus Tinker Board elif (( $G_HW_MODEL == 52 )); then G_HW_MODEL_DESCRIPTION='Asus Tinker Board' - #BananaPi Pro + # BananaPi Pro elif (( $G_HW_MODEL == 51 )); then G_HW_MODEL_DESCRIPTION='BananaPi Pro' - #BananaPi M2+ + # BananaPi M2+ elif (( $G_HW_MODEL == 50 )); then G_HW_MODEL_DESCRIPTION='BananaPi M2+' G_HW_CPUID=1 - #Pinebook A64 + # Pinebook A64 elif (( $G_HW_MODEL == 44 )); then G_HW_MODEL_DESCRIPTION='Pinebook A64' - #Rock64 + # Rock64 elif (( $G_HW_MODEL == 43 )); then G_HW_MODEL_DESCRIPTION='Rock64' - #RockPro64 + # RockPro64 elif (( $G_HW_MODEL == 42 )); then G_HW_MODEL_DESCRIPTION='RockPro64' G_HW_CPUID=3 - #OrangePi PC Plus + # OrangePi PC Plus elif (( $G_HW_MODEL == 41 )); then G_HW_MODEL_DESCRIPTION='OrangePi PC Plus' G_HW_CPUID=1 - #PineA64 + # PineA64 elif (( $G_HW_MODEL == 40 )); then G_HW_MODEL_DESCRIPTION='Pine A64' - #LeMaker Guitar + # LeMaker Guitar elif (( $G_HW_MODEL == 39 )); then G_HW_MODEL_DESCRIPTION='LeMaker Guitar' - #OrangePi PC 2 + # OrangePi PC 2 elif (( $G_HW_MODEL == 38 )); then G_HW_MODEL_DESCRIPTION='OPi PC2' G_HW_CPUID=2 - #OrangePi Prime + # OrangePi Prime elif (( $G_HW_MODEL == 37 )); then G_HW_MODEL_DESCRIPTION='OPi Prime' G_HW_CPUID=2 - #OrangePi Win + # OrangePi Win elif (( $G_HW_MODEL == 36 )); then G_HW_MODEL_DESCRIPTION='OPi Win' - #OrangePi Zero Plus 2 (h3/h5) + # OrangePi Zero Plus 2 (h3/h5) elif (( $G_HW_MODEL == 35 )); then G_HW_MODEL_DESCRIPTION='OPi Zero 2 Plus' G_HW_CPUID=1 - #OrangePi Plus + # OrangePi Plus elif (( $G_HW_MODEL == 34 )); then G_HW_MODEL_DESCRIPTION='OrangePi Plus' G_HW_CPUID=1 - #OrangePi Lite + # OrangePi Lite elif (( $G_HW_MODEL == 33 )); then G_HW_MODEL_DESCRIPTION='OrangePi Lite' G_HW_CPUID=1 - #OrangePi Zero + # OrangePi Zero elif (( $G_HW_MODEL == 32 )); then G_HW_MODEL_DESCRIPTION='OrangePi Zero' - #G_HW_CPUID=1 #H2+ + #G_HW_CPUID=1 # H2+ - #OrangePi One + # OrangePi One elif (( $G_HW_MODEL == 31 )); then G_HW_MODEL_DESCRIPTION='OrangePi One' G_HW_CPUID=1 - #OrangePi Pc + # OrangePi Pc elif (( $G_HW_MODEL == 30 )); then G_HW_MODEL_DESCRIPTION='OrangePi PC' G_HW_CPUID=1 - #Generic device (eg: unknown to DietPi) + # Generic device (eg: unknown to DietPi) elif (( $G_HW_MODEL == 22 )); then G_HW_MODEL_DESCRIPTION='Generic Device' IMAGE_ADDITIONAL_CREDITS='You!' - #x86_64 native PC + # x86_64 native PC elif (( $G_HW_MODEL == 21 )); then G_HW_MODEL_DESCRIPTION='Native PC' - #VM + # VM elif (( $G_HW_MODEL == 20 )); then G_HW_MODEL_DESCRIPTION='Virtual Machine' - #oDroid N1 + # Odroid N1 elif (( $G_HW_MODEL == 14 )); then G_HW_MODEL_DESCRIPTION='Odroid N1' G_HW_CPUID=3 #IMAGE_ADDITIONAL_CREDITS='Meveric' - #oDroid U3 + # Odroid U3 elif (( $G_HW_MODEL == 13 )); then G_HW_MODEL_DESCRIPTION='Odroid U3' #IMAGE_ADDITIONAL_CREDITS='Meveric' - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then G_HW_MODEL_DESCRIPTION='Odroid C2' IMAGE_ADDITIONAL_CREDITS='Meveric' - #Odroid XU3/XU4/HC1/HC2 + # Odroid XU3/XU4/HC1/HC2 elif (( $G_HW_MODEL == 11 )); then G_HW_MODEL_DESCRIPTION='Odroid XU3/XU4/HC1/HC2' IMAGE_ADDITIONAL_CREDITS='Meveric' - #Odroid C1 + # Odroid C1 elif (( $G_HW_MODEL == 10 )); then G_HW_MODEL_DESCRIPTION='Odroid C1' @@ -651,7 +645,7 @@ fi - #RPi + # RPi elif grep -qi '^ID=raspbian' /etc/os-release; then #Grab hardware description from rpi_boardinfo @@ -659,7 +653,7 @@ fi - #Get Distro Index + # Get distro index if grep -qi 'jessie' /etc/os-release; then G_DISTRO=3 @@ -674,10 +668,10 @@ fi - #Generate UUID if it does not exist + # Generate UUID if it does not exist if [[ -f '/DietPi/dietpi/.hw_model' ]]; then - HW_UUID=$(sed -n 5p /DietPi/dietpi/.hw_model) + HW_UUID=$(mawk 'NR==5 {print}' /DietPi/dietpi/.hw_model) else @@ -685,8 +679,7 @@ fi - #Obtain hardware cpu architecture - G_HW_ARCH_DESCRIPTION=$(uname -m) + # Obtain hardware CPU architecture if [[ $G_HW_ARCH_DESCRIPTION == 'armv6l' ]]; then G_HW_ARCH=1 @@ -713,7 +706,7 @@ # - Add HW arch to HW desc G_HW_MODEL_DESCRIPTION+=" ($G_HW_ARCH_DESCRIPTION)" - #Save data + # Save data echo "$G_HW_MODEL $G_HW_MODEL_DESCRIPTION $G_DISTRO @@ -726,7 +719,7 @@ $G_HW_CPUID $HW_ONBOARD_WIFI HW_MEMORY_SIZE=$HW_MEMORY_SIZE" > /DietPi/dietpi/.hw_model - # - RPi Extras + # - RPi extras (( $G_HW_MODEL < 10 )) && echo "$HW_REVISION_CODE HW_RELEASE_DATE=$HW_RELEASE_DATE HW_PCB_REVISION_CODE=$HW_PCB_REVISION_CODE From e62b4e2dd1d06babe4ae64810360311ca957f989 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 31 Mar 2019 21:43:46 +0200 Subject: [PATCH 018/253] v6.23 + DietPi-Login | Force first run setup PID file removal when script is killed, interrupted etc --- dietpi/dietpi-login | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index e5175d8c9b..4e2301e64d 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -192,6 +192,8 @@ Please login again as user "root" with password "dietpi", respectively the one y . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Login' #G_INIT # To allow concurrent logins + # - Always remove PID file when script is killed + trap '[[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID' EXIT # Import DietPi-Globals -------------------------------------------------------------- /DietPi/dietpi/func/obtain_network_details From 9d354433fa96fc93d7d5a1c0427bbb491a4c66a9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 1 Apr 2019 00:41:58 +0200 Subject: [PATCH 019/253] v6.23 + CHANGELOG | Serial/UART device handling has been reworked --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a6bf4eea16..f651bdd6b0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.23 (XX/04/19) Changes / Improvements / Optimisations: +- DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. Bug Fixes: - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 From fb60a023c48f00772db4a62c5208d0efece503f4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 1 Apr 2019 01:42:58 +0200 Subject: [PATCH 020/253] v6.23 + DietPi-PREP | Tiny --- PREP_SYSTEM_FOR_DIETPI.sh | 67 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 15e1c15444..39813625db 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -16,7 +16,7 @@ # - G_DISTRO_NAME #------------------------------------------------------------------------------------------------ - #Core globals + # Core globals G_PROGRAM_NAME='DietPi-PREP' G_GITOWNER=${GITOWNER:-MichaIng} unset GITOWNER @@ -32,12 +32,12 @@ fi - #Work inside /tmp as usually ramfs to reduce disk I/O and speed up download and unpacking + # Work inside /tmp as usually ramfs to reduce disk I/O and speed up download and unpacking # - Save full script path, beforehand: https://github.com/MichaIng/DietPi/pull/2341#discussion_r241784962 FP_PREP_SCRIPT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" cd /tmp - #Prefer IPv4 by default, to avoid hanging access attempts in some cases + # Prefer IPv4 by default, to avoid hanging access attempts in some cases # - NB: This needs to match the method in: /DietPi/dietpi/func/dietpi-set_hardware preferipv4 enable # - APT echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 @@ -56,7 +56,7 @@ fi - #Check/install minimal APT Pre-Reqs + # Check/install minimal APT Pre-Reqs a_MIN_APT_PREREQS=( 'apt-transport-https' # Allows HTTPS sources for APT @@ -69,7 +69,7 @@ ) - #Removing conflicting /etc/apt/sources.list.d entries + # Removing conflicting /etc/apt/sources.list.d entries # - Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 [[ -f /etc/apt/sources.list.d/deb-multimedia.list ]] && rm /etc/apt/sources.list.d/deb-multimedia.list # - OMV: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10594 @@ -91,7 +91,7 @@ unset a_MIN_APT_PREREQS - #Setup locale + # Setup locale # - Remove existing settings that could break dpkg-reconfigure locales > /etc/environment [[ -f /etc/default/locale ]] && rm /etc/default/locale @@ -118,7 +118,7 @@ export LANG=en_GB.UTF8 export LC_ALL=en_GB.UTF8 - #Select gitbranch + # Select gitbranch aWHIP_BRANCH=( 'master' ': Stable release (recommended)' @@ -215,17 +215,17 @@ fi - #WiFi install flag + # WiFi install flag WIFI_REQUIRED=0 - #Image creator flags + # Image creator flags IMAGE_CREATOR='' PREIMAGE_INFO='' - #Setup step, current (used in info) + # Setup step, current (used in info) SETUP_STEP=0 - #URL connection test var holder + # URL connection test var holder INTERNET_ADDRESS='' Main(){ @@ -277,7 +277,7 @@ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - #Image creator + # Image creator while : do @@ -328,7 +328,7 @@ done - #Pre-image used/name + # Pre-image used/name while : do @@ -343,7 +343,7 @@ done - #Hardware selection + # Hardware selection # NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results, # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc) G_WHIP_DEFAULT_ITEM=22 @@ -436,7 +436,7 @@ fi - #Distro Selection + # Distro Selection DISTRO_LIST_ARRAY=( '4' ': Stretch (current stable release, recommended)' @@ -999,11 +999,11 @@ _EOF_ [[ -f /etc/cron.d/make_nas_processes_faster ]] && rm /etc/cron.d/make_nas_processes_faster #----------------------------------------------------------------------------------- - #Boot Logo + # Boot Logo [[ -f /boot/boot.bmp ]] && G_RUN_CMD wget https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.meta/images/dietpi-logo_boot.bmp -O /boot/boot.bmp #----------------------------------------------------------------------------------- - #Bash Profiles + # Bash Profiles # - Pre v6.9 cleaning: sed -i '/\/DietPi/d' /root/.bashrc @@ -1031,7 +1031,7 @@ _EOF_ chmod 4755 $(which sudo) #----------------------------------------------------------------------------------- - #Dir's + # Dirs G_DIETPI-NOTIFY 2 'Configuring DietPi Directories' @@ -1068,7 +1068,7 @@ _EOF_ mkdir -p /mnt/nfs_client #----------------------------------------------------------------------------------- - #Services + # Services G_DIETPI-NOTIFY 2 'Configuring DietPi Services:' @@ -1079,7 +1079,7 @@ _EOF_ G_RUN_CMD systemctl enable dietpi-kill_ssh #----------------------------------------------------------------------------------- - #Cron Jobs + # Cron Jobs G_DIETPI-NOTIFY 2 'Configuring Cron:' @@ -1100,7 +1100,7 @@ _EOF_ G_ERROR_HANDLER #----------------------------------------------------------------------------------- - #Network + # Network G_DIETPI-NOTIFY 2 'Configuring wlan/eth naming to be preferred for networked devices:' ln -sfv /dev/null /etc/systemd/network/99-default.link @@ -1118,7 +1118,7 @@ _EOF_ systemctl disable wpa_supplicant 2> /dev/null && G_DIETPI-NOTIFY 2 'Disabled non-required wpa_supplicant systemd unit' #----------------------------------------------------------------------------------- - #MISC + # MISC G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock' @@ -1295,9 +1295,9 @@ _EOF_ #G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" - #Runs at start of script + # Runs at start of script - #G_HW_ARCH specific + # G_HW_ARCH specific G_DIETPI-NOTIFY 2 'Applying G_HW_ARCH specific tweaks:' if (( $G_HW_ARCH == 10 )); then @@ -1319,7 +1319,7 @@ _EOF_ fi - #G_HW_MODEL specific + # G_HW_MODEL specific G_DIETPI-NOTIFY 2 'Appling G_HW_MODEL specific tweaks:' if (( $G_HW_MODEL != 20 )); then @@ -1332,7 +1332,7 @@ _EOF_ #DietPi external USB drive. Power management settings. /dev/sda { - #10 mins + # 10 mins spindown_time = 120 # @@ -1424,7 +1424,7 @@ _EOF_ # - Ensure WiFi module pre-exists G_CONFIG_INJECT '8723bs' '8723bs' /etc/modules - #Rock64, remove HW accell config, as its not currently functional: https://github.com/MichaIng/DietPi/issues/2086 + # Rock64, remove HW accell config, as its not currently functional: https://github.com/MichaIng/DietPi/issues/2086 elif (( $G_HW_MODEL == 43 )); then [[ -f /etc/X11/xorg.conf.d/20-armsoc.conf ]] && rm /etc/X11/xorg.conf.d/20-armsoc.conf @@ -1473,11 +1473,11 @@ _EOF_ G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' # - Remove Bash history file - [[ -f ~/.bash_history ]] && rm ~/.bash_history + [[ -f /root/.bash_history ]] && rm /root/.bash_history rm -f /home/*/.bash_history # - Remove Nano history file - [[ -f ~/.nano_history ]] && rm ~/.nano_history + [[ -f /root/.nano_history ]] && rm /root/.nano_history rm -f /home/*/.nano_history G_DIETPI-NOTIFY 2 'Removing swapfile from image' @@ -1646,7 +1646,7 @@ _EOF_ rm -Rf /var/log/{,.??,.[^.]}* mount /var/log # Prevent new log files from being written to disk by background processes - cd ~ + cd /root umount /tmp rm -Rf /tmp/{,.??,.[^.]}* mount /tmp # Prevent new tmp files from being written to disk by background processes @@ -1673,16 +1673,15 @@ _EOF_ 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 + # Power off system - #Read image + # Read image - #Resize rootfs partition to minimum size +50MB + # Resize rootfs partition to minimum size +50MB } #------------------------------------------------------------------------------------------------ - #Run Main #------------------------------------------------------------------------------------------------ From fa99794e14022c7e51d73876818156519d6bd8c8 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 1 Apr 2019 04:57:14 +0200 Subject: [PATCH 021/253] v6.23 + DietPi-PREP | Apply prefer IPv4 with wget after it is installed as minimal pre-req to avoid DPKG prompt for changed config file --- PREP_SYSTEM_FOR_DIETPI.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 39813625db..a9d2853879 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -37,24 +37,9 @@ FP_PREP_SCRIPT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" cd /tmp - # Prefer IPv4 by default, to avoid hanging access attempts in some cases + # APT: Prefer IPv4 by default to avoid hanging access attempts in some cases # - NB: This needs to match the method in: /DietPi/dietpi/func/dietpi-set_hardware preferipv4 enable - # - APT echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 - # - Wget - if grep -q '^[[:blank:]]*prefer-family[[:blank:]]*=' /etc/wgetrc; then - - sed -i '/^[[:blank:]]*prefer-family[[:blank:]]*=/c\prefer-family = IPv4' /etc/wgetrc - - elif grep -q '^[[:blank:]#;]*prefer-family[[:blank:]]*=' /etc/wgetrc; then - - sed -i '/^[[:blank:]#;]*prefer-family[[:blank:]]*=/c\prefer-family = IPv4' /etc/wgetrc - - else - - echo 'prefer-family = IPv4' >> /etc/wgetrc - - fi # Check/install minimal APT Pre-Reqs a_MIN_APT_PREREQS=( @@ -88,9 +73,24 @@ fi done - unset a_MIN_APT_PREREQS + # Wget: Prefer IPv4 by default to avoid hanging access attempts in some cases + # - NB: This needs to match the method in: /DietPi/dietpi/func/dietpi-set_hardware preferipv4 enable + if grep -q '^[[:blank:]]*prefer-family[[:blank:]]*=' /etc/wgetrc; then + + sed -i '/^[[:blank:]]*prefer-family[[:blank:]]*=/c\prefer-family = IPv4' /etc/wgetrc + + elif grep -q '^[[:blank:]#;]*prefer-family[[:blank:]]*=' /etc/wgetrc; then + + sed -i '/^[[:blank:]#;]*prefer-family[[:blank:]]*=/c\prefer-family = IPv4' /etc/wgetrc + + else + + echo 'prefer-family = IPv4' >> /etc/wgetrc + + fi + # Setup locale # - Remove existing settings that could break dpkg-reconfigure locales > /etc/environment From ed1e1a0fe71e0bb644a259d90d5a72a871b1bfeb Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 3 Apr 2019 13:20:52 +0100 Subject: [PATCH 022/253] hardware accelerated video decode/encode for intel GPU's. --- dietpi/dietpi-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7305c4a64c..97b7631712 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -843,11 +843,11 @@ if (( $intel_installed )); then - G_AGP xserver-xorg-video-intel #Must test removal deps... + G_AGP i965-va-driver xserver-xorg-video-intel else - G_AG_CHECK_INSTALL_PREREQ xserver-xorg-video-intel libgl1-mesa-dri + G_AG_CHECK_INSTALL_PREREQ i965-va-driver xserver-xorg-video-intel libgl1-mesa-dri Xorg_Configure fi From bb4a7596903e81fb818830e33ffab4d97e8285a6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 4 Apr 2019 13:29:19 +0200 Subject: [PATCH 023/253] v6.23 + CHANGELOG | Add info about important first run update fix which has been applied to patch_file outside of releases --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f651bdd6b0..296b0e5529 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. Bug Fixes: +- DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 - DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 From 88d62aa15ed0e51ef987debd0f3beeb7a63ce58e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 5 Apr 2019 02:30:17 +0200 Subject: [PATCH 024/253] v6.23 (#2688) + DietPi-LetsEncrypt | Lighttpd: Use webroot authentication method (instead of standalone) to allow CertBot auto-renewal succeed even that webserver is running (thus blocking port 80). + DietPi-LetsEncrypt | Apache/Nginx: Revert to --apache/--nginx module authentication. The reason to use webroot has been fixed with CertBot 0.21.0 and Debian Stretch repo now ships 0.28.0 + DietPi-LetsEncrypt | Pre-answer sharing mail with EFF prompt with "no", to allow non-interactive run while preserving privacy: https://github.com/MichaIng/DietPi/issues/2500 + DietPi-LetsEncrypt | Minor coding and wording --- CHANGELOG.txt | 1 + dietpi/dietpi-letsencrypt | 199 +++++++++++++++++++------------------- 2 files changed, 99 insertions(+), 101 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 296b0e5529..4d6a3e12d1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.23 (XX/04/19) Changes / Improvements / Optimisations: +- DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. Bug Fixes: diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index e8238fd4c7..8c6d741a78 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -17,33 +17,31 @@ # - /DietPi/dietpi/dietpi-letsencrypt 1 = Create/Renew/Apply cert #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-LetsEncrypt' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - #Grab Input - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab Input + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_LOGFILE='/var/log/dietpi-letsencrypt.log' - # On Stretch+ the APT package installs a systemd unit for cert renewal, - # on Jessie-, we install the CertBot from github directly and add a cron job for renewal: + # On Stretch+ the APT package installs a systemd unit for cert renewal. FP_RENEWAL='/etc/systemd/system/certbot.service.d' + # On Jessie- we install the CertBot from GitHub directly and add a cron job for renewal. (( $G_DISTRO < 4 )) && FP_RENEWAL='/etc/cron.weekly/dietpi-letsencrypt' FP_BINARY='/usr/bin/certbot' (( $G_DISTRO < 4 )) && FP_BINARY='/etc/certbot_scripts/certbot-auto' - LETSENCRYPT_INSTALLED=0 - [[ -f $FP_BINARY ]] && LETSENCRYPT_INSTALLED=1 + [[ -f $FP_BINARY ]] && LETSENCRYPT_INSTALLED=1 || LETSENCRYPT_INSTALLED=0 LETSENCRYPT_DOMAIN='mydomain.com' LETSENCRYPT_EMAIL='myemail@email.com' @@ -58,26 +56,24 @@ local fp_cert_dir="/etc/letsencrypt/live/$LETSENCRYPT_DOMAIN" #------------------------------------------------------------------------------------------------------ - #Apache2 + # Apache2 if pgrep '[a]pache' &> /dev/null; then G_DIETPI-NOTIFY 0 'Apache2 webserver detected' local fp_defaultsite='/etc/apache2/sites-available/000-default.conf' - #Add ServerName if it doesnt exist. This is required to prevent CertBot compaining about vhost with no domain. + # - Add ServerName if it doesnt exist. This is required to prevent CertBot complaining about vhost with no domain. G_CONFIG_INJECT 'ServerName[[:blank:]]' "ServerName $LETSENCRYPT_DOMAIN" "$fp_defaultsite" ' 3 )) && options='-a webroot -w /var/www/ -i apache' (( $LETSENCRYPT_REDIRECT )) && options+=' --redirect' || options+=' --no-redirect' (( $LETSENCRYPT_HSTS )) && options+=' --hsts' - #Cert me up Apache2 - # - When cert exists already, attempt renewal. This allows easy configuration update via "dietpi-letsencrypt 1" without using up limited certs per week. + # - Cert me up Apache2 + # If cert exists already, attempt renewal. This allows easy configuration update via "dietpi-letsencrypt 1" without using up limited certs per week. if [[ -f $fp_cert_dir/cert.pem ]]; then $FP_BINARY renew @@ -85,7 +81,7 @@ else - $FP_BINARY $options --agree-tos --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" + $FP_BINARY $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" local exit_code=$? fi @@ -98,13 +94,12 @@ fi #------------------------------------------------------------------------------------------------------ - #Lighttpd + # Lighttpd elif pgrep '[l]ighttpd' &> /dev/null; then G_DIETPI-NOTIFY 0 'Lighttpd webserver detected' # - Cert me up - /DietPi/dietpi/dietpi-services stop if [[ -f $fp_cert_dir/cert.pem ]]; then $FP_BINARY renew @@ -112,7 +107,7 @@ else - $FP_BINARY certonly --standalone --agree-tos --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" + $FP_BINARY certonly --webroot -w /var/www --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" local exit_code=$? fi @@ -134,18 +129,18 @@ fi - # Add Lighttpd renewal to certbot system service: + # - Add Lighttpd renewal to certbot systemd service if (( $G_DISTRO > 3 )); then [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL" cat << _EOF_ > "$FP_RENEWAL"/dietpi-lighttpd.conf [Service] -ExecStartPost=/bin/bash -c '/bin/cat $fp_cert_dir/privkey.pem $fp_cert_dir/cert.pem > $fp_cert_dir/combined.pem' +ExecStartPost=/bin/dash -c 'cat "$fp_cert_dir/privkey.pem" "$fp_cert_dir/cert.pem" > "$fp_cert_dir/combined.pem"' _EOF_ fi - # Allow adding environment variables via: setenv.add-environment + # - Allow adding environment variables via: setenv.add-environment G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' cat << _EOF_ > /etc/lighttpd/conf-enabled/letsencrypt.conf @@ -156,13 +151,13 @@ _EOF_ ssl.disable-client-renegotiation = "enable" # pemfile is cert+privkey, ca-file is the intermediate chain in one file - ssl.pemfile = "$fp_cert_dir/combined.pem" - ssl.ca-file = "$fp_cert_dir/fullchain.pem" + ssl.pemfile = "$fp_cert_dir/combined.pem" + ssl.ca-file = "$fp_cert_dir/fullchain.pem" # for DH/DHE ciphers, dhparam should be >= 2048-bit - #ssl.dh-file = "/path/to/dhparam.pem" + #ssl.dh-file = "/path/to/dhparam.pem" # ECDH/ECDHE ciphers curve strength (see 'openssl ecparam -list_curves') - ssl.ec-curve = "secp384r1" + ssl.ec-curve = "secp384r1" # Compression is by default off at compile-time, but use if needed #ssl.use-compression = "disable" @@ -173,15 +168,15 @@ _EOF_ ssl.use-sslv2 = "disable" ssl.use-sslv3 = "disable" ssl.honor-cipher-order = "enable" - ssl.cipher-list = "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS" + ssl.cipher-list = "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS" } _EOF_ - # Enable new "mod_openssl" on Buster + # - Enable new "mod_openssl" on Buster (( $G_DISTRO > 4 )) && sed -i '1i\server.modules += ( "mod_openssl" )\n' /etc/lighttpd/conf-enabled/letsencrypt.conf - # Redirect - rm /etc/lighttpd/conf-enabled/redirect.conf &> /dev/null + # - Redirect + [[ -f /etc/lighttpd/conf-enabled/redirect.conf ]] && rm /etc/lighttpd/conf-enabled/redirect.conf if (( $LETSENCRYPT_REDIRECT )); then cat << _EOF_ > /etc/lighttpd/conf-enabled/redirect.conf @@ -196,7 +191,7 @@ _EOF_ fi - # HSTS + # - HSTS if (( $LETSENCRYPT_HSTS )); then cat << _EOF_ > /etc/lighttpd/conf-available/99-dietpi-hsts.conf @@ -220,19 +215,17 @@ _EOF_ G_DIETPI-NOTIFY 0 'Nginx webserver detected' local fp_defaultsite='/etc/nginx/sites-available/default' - # Apply domain name + # - Apply domain name G_CONFIG_INJECT 'server_name[[:blank:]]' " server_name $LETSENCRYPT_DOMAIN;" "$fp_defaultsite" 'listen[[:blank:]]' - #Restart Nginx to apply server_name change: + # - Restart Nginx to apply server_name change systemctl restart nginx local options='--nginx' - #Use webroot authentication on Stretch+ for now: https://github.com/MichaIng/DietPi/issues/734#issuecomment-361774084 - (( $G_DISTRO > 3 )) && options='-a webroot -w /var/www/ -i nginx' (( $LETSENCRYPT_REDIRECT )) && options+=' --redirect' || options+=' --no-redirect' (( $LETSENCRYPT_HSTS )) && options+=' --hsts' - #Cert me up Nginx + # - Cert me up Nginx if [[ -f $fp_cert_dir/cert.pem ]]; then $FP_BINARY renew @@ -240,7 +233,7 @@ _EOF_ else - $FP_BINARY $options --agree-tos --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" + $FP_BINARY $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" local exit_code=$? fi @@ -252,7 +245,7 @@ _EOF_ fi - #Apply HSTS header to ownCloud/Nextcloud config + # - Apply HSTS header to ownCloud/Nextcloud config if (( $LETSENCRYPT_HSTS )); then [[ -f /etc/nginx/sites-dietpi/dietpi-owncloud.conf ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' /etc/nginx/sites-dietpi/dietpi-owncloud.conf @@ -261,7 +254,7 @@ _EOF_ fi #------------------------------------------------------------------------------------------------------ - #Minio + # Minio elif pgrep '[m]inio' &> /dev/null; then G_DIETPI-NOTIFY 0 'Minio S3 server detected' @@ -275,7 +268,7 @@ _EOF_ else - $FP_BINARY certonly --standalone --staple-ocsp --agree-tos --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" + $FP_BINARY certonly --standalone --staple-ocsp --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN" local exit_code=$? fi @@ -287,29 +280,29 @@ _EOF_ fi - # Ensure strict permissions while copying: + # - Ensure strict permissions while copying: umask 077 - # Locate them correctly (THIS didn't work as symlinks) - G_RUN_CMD cp "$fp_cert_dir"/fullchain.pem /home/minio-user/.minio/certs/public.crt - G_RUN_CMD cp "$fp_cert_dir"/privkey.pem /home/minio-user/.minio/certs/private.key + # - Locate them correctly (THIS didn't work as symlinks) + G_RUN_CMD cp "$fp_cert_dir/fullchain.pem" /home/minio-user/.minio/certs/public.crt + G_RUN_CMD cp "$fp_cert_dir/privkey.pem" /home/minio-user/.minio/certs/private.key - # Own those certs! + # - Own those certs! G_RUN_CMD chown minio-user:minio-user /home/minio-user/.minio/certs/public.crt /home/minio-user/.minio/certs/private.key G_RUN_CMD chmod 400 /home/minio-user/.minio/certs/public.crt /home/minio-user/.minio/certs/private.key - # Creation permissions back to default: + # - Creation permissions back to default: umask 022 - # Add SSL to config file + # - Add SSL to config file G_CONFIG_INJECT 'MINIO_OPTS="' 'MINIO_OPTS="--address :443"' /etc/default/minio - # Allow SSL binding for non root user - # - Install libcap2-bin, which provides setcap command, not installed by default on DietPi: + # - Allow SSL binding for non root user + # Install libcap2-bin, which provides setcap command, not installed by default on DietPi: G_AGI libcap2-bin G_RUN_CMD setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/minio - # Create renewl script + # - Create renewl script cat << _EOF_ > /home/minio-user/.minio/dietpi-cert-renewl.sh #!/bin/bash # Minio only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned @@ -319,8 +312,8 @@ systemctl stop minio umask 077 # Copy to correct Location -cp $fp_cert_dir/fullchain.pem /home/minio-user/.minio/certs/public.crt -cp $fp_cert_dir/privkey.pem /home/minio-user/.minio/certs/private.key +cp "$fp_cert_dir/fullchain.pem" /home/minio-user/.minio/certs/public.crt +cp "$fp_cert_dir/privkey.pem" /home/minio-user/.minio/certs/private.key # Re-Own those certs! chown minio-user:minio-user /home/minio-user/.minio/certs/public.crt /home/minio-user/.minio/certs/private.key @@ -329,10 +322,10 @@ chmod 400 /home/minio-user/.minio/certs/public.crt /home/minio-user/.minio/certs systemctl start minio _EOF_ - # Change permissions on renewal script + # - Change permissions on renewal script G_RUN_CMD chmod +x /home/minio-user/.minio/dietpi-cert-renewl.sh - # Add Minio renewal to certbot system service: + # Add Minio renewal to certbot system service if (( $G_DISTRO > 3 )); then [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL" @@ -359,9 +352,10 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /D fi + # coTURN if [[ -f /etc/turnserver.conf ]]; then - G_DIETPI-NOTIFY 2 'coturn TURN server detected' + G_DIETPI-NOTIFY 2 'coTURN server detected' # - Get TURN port local turn_port=5349 @@ -387,7 +381,7 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /D fi - #ALL | Create cert renewal cron job on Jessie-: + # ALL | Create cert renewal cron job on Jessie-: if (( $G_DISTRO < 4 )); then cat << _EOF_ > "$FP_RENEWAL" @@ -409,7 +403,7 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /D $FP_BINARY -q renew &>> $FP_LOGFILE [[ -f /home/minio-user/.minio/dietpi-cert-renewl.sh ]] && /home/minio-user/.minio/dietpi-cert-renewl.sh &>> $FP_LOGFILE - [[ -f $fp_cert_dir/combined.pem ]] && cat $fp_cert_dir/privkey.pem $fp_cert_dir/cert.pem > $fp_cert_dir/combined.pem 2>> $FP_LOGFILE + [[ -f $fp_cert_dir/combined.pem ]] && cat "$fp_cert_dir/privkey.pem" "$fp_cert_dir/cert.pem" > "$fp_cert_dir/combined.pem" 2>> $FP_LOGFILE #---------------------------------------------------------------- exit @@ -443,19 +437,17 @@ _EOF_ Read_Settings_File(){ - local sed_index=1 - - LETSENCRYPT_DOMAIN=$(sed -n "$sed_index"p "$FP_SETTINGS");((sed_index++)) - LETSENCRYPT_EMAIL=$(sed -n "$sed_index"p "$FP_SETTINGS");((sed_index++)) - LETSENCRYPT_REDIRECT=$(sed -n "$sed_index"p "$FP_SETTINGS");((sed_index++)) - LETSENCRYPT_HSTS=$(sed -n "$sed_index"p "$FP_SETTINGS");((sed_index++)) - LETSENCRYPT_KEYSIZE=$(sed -n "$sed_index"p "$FP_SETTINGS");((sed_index++)) + LETSENCRYPT_DOMAIN=$(sed -n 1p $FP_SETTINGS) + LETSENCRYPT_EMAIL=$(sed -n 2p $FP_SETTINGS) + LETSENCRYPT_REDIRECT=$(sed -n 3p $FP_SETTINGS) + LETSENCRYPT_HSTS=$(sed -n 4p $FP_SETTINGS) + LETSENCRYPT_KEYSIZE=$(sed -n 5p $FP_SETTINGS) } Write_Settings_File(){ - cat << _EOF_ > "$FP_SETTINGS" + cat << _EOF_ > $FP_SETTINGS $LETSENCRYPT_DOMAIN $LETSENCRYPT_EMAIL $LETSENCRYPT_REDIRECT @@ -476,18 +468,37 @@ _EOF_ G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - #exit + # Exit TARGETMENUID=-1 else - #Return to Main Menu + # Return to Main Menu TARGETMENUID=0 fi } + Input_Box(){ + + local input_value=$1 + local input_desc=$2 + + G_WHIP_DEFAULT_ITEM=$input_value + if G_WHIP_INPUTBOX "Please enter a value for $input_desc"; then + + input_value=$G_WHIP_RETURNED_VALUE + + # Prevent null values + [[ $input_value ]] || input_value='NULL' + + fi + + echo "$input_value" + + } + #TARGETMENUID=0 Menu_Main(){ @@ -521,8 +532,8 @@ _EOF_ while : do - LETSENCRYPT_DOMAIN=$(Input_Box $LETSENCRYPT_DOMAIN Website-Domain) - [[ $LETSENCRYPT_DOMAIN == *?.?* && ! $(sed 's/\.//g' <<< $LETSENCRYPT_DOMAIN) =~ ^[0-9]*$ ]] && break + LETSENCRYPT_DOMAIN=$(Input_Box "$LETSENCRYPT_DOMAIN" Website-Domain) + [[ $LETSENCRYPT_DOMAIN == *?.?* && ! $(sed 's/\.//g' <<< "$LETSENCRYPT_DOMAIN") =~ ^[0-9]*$ ]] && break G_WHIP_MSG "[FAILED] \"$LETSENCRYPT_DOMAIN\" is no valid domain name.\n\nNote that raw IP addresses are not allowed by LetsEncrypt, thus a domain is required.\nYou can install No-IP with DietPi-Software to aquire one.\n\nPlease try again..." @@ -532,13 +543,13 @@ _EOF_ 'Email') - LETSENCRYPT_EMAIL=$(Input_Box $LETSENCRYPT_EMAIL Email-Address) + LETSENCRYPT_EMAIL=$(Input_Box "$LETSENCRYPT_EMAIL" Email-Address) ;; 'Key Size') - (( $LETSENCRYPT_KEYSIZE == 2048 )) && LETSENCRYPT_KEYSIZE=4096 || LETSENCRYPT_KEYSIZE=2048 + (( $LETSENCRYPT_KEYSIZE == 4096 )) && LETSENCRYPT_KEYSIZE=2048 || LETSENCRYPT_KEYSIZE=4096 ;; @@ -578,8 +589,13 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC 'Apply') - G_WHIP_YESNO "LetsEncrypt will now be run. This will:\n- Create your free SSL cert.\n- Automatically apply and enable your SSL cert\n- NB: This process can take a long time, please be patient.\n- NB: HTTPS will automatically be applied to the webserver and applications which use '/var/www/*'. Applications which use their own webserver (these usually have their own :port number), will not be available under HTTPS, and, these will need to be configured manually.\n\nWould you like to continue?" - if (( ! $? )); then + if G_WHIP_YESNO 'LetsEncrypt will now be run. This will: +- Create your free SSL cert. +- Automatically apply and enable your SSL cert +- NB: This process can take a long time, please be patient. +- NB: HTTPS will automatically be applied to the webserver and applications which use "/var/www/*". + Applications which use their own webserver (these usually have their own :port number), will not be available under HTTPS, and, these will need to be configured manually.\n +Would you like to continue?'; then Write_Settings_File Run_Lets_Encrypt @@ -593,36 +609,17 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC else - #Exit + # Exit Menu_Exit fi } - Input_Box(){ - - local input_value=$1 - local input_desc=$2 - - G_WHIP_DEFAULT_ITEM=$input_value - if G_WHIP_INPUTBOX "Please enter a value for $input_desc"; then - - input_value=$G_WHIP_RETURNED_VALUE - - # - Prevent null values - [[ $input_value ]] || input_value='NULL' - - fi - - echo "$input_value" - - } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Load Settings file. Generate if required. + # Load Settings file. Generate if required. if [[ -f $FP_SETTINGS ]]; then Read_Settings_File @@ -634,10 +631,10 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC fi #----------------------------------------------------------------------------------- - #Check installed + # Check installed if (( ! $LETSENCRYPT_INSTALLED )); then - #Menu + # Menu if (( ! $INPUT )); then G_DIETPI-NOTIFY 1 "CertBot binary not found ( $FP_BINARY )" @@ -651,7 +648,7 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC fi #----------------------------------------------------------------------------------- - #Menu + # Menu elif (( ! $INPUT )); then while (( $TARGETMENUID > -1 )); do @@ -663,7 +660,7 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC done #----------------------------------------------------------------------------------- - #Run + # Run elif (( $INPUT == 1 )); then Run_Lets_Encrypt @@ -673,7 +670,7 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC G_DIETPI-NOTIFY 2 'DietPi-LetsEncrypt usage:' G_DIETPI-NOTIFY 2 ' dietpi-letsencrypt => Open whiptail menu' - G_DIETPI-NOTIFY 2 ' dietpi-letsencrypt 1 => Create/Renew/Apply certs without user input' + G_DIETPI-NOTIFY 2 ' dietpi-letsencrypt 1 => Create/Renew/Apply certs non-interactively' fi From 69a5762fc98f10d2ff2dce9cebc4847b56d2c4e1 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 5 Apr 2019 14:18:02 +0100 Subject: [PATCH 025/253] v6.23 --- CHANGELOG.txt | 1 + dietpi/func/dietpi-banner | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4d6a3e12d1..bb7c722164 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.23 (XX/04/19) Changes / Improvements / Optimisations: +- DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 20d7c20cca..25955d10fa 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -135,6 +135,12 @@ $GREEN_LINE" } + Print_Local_Ip(){ + + echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPERATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter) + + } + Print_Credits(){ echo -e " ${aCOLOUR[2]}DietPi Team : MichaIng (lead), Daniel Knight (founder)" @@ -193,7 +199,7 @@ $GREEN_LINE" (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPERATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" #2: CPU temp (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPERATOR $(hostname -f 2>&1)" #3: Hostname (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPERATOR $(hostname -y 2>&1)" #4: Domain name - (( ${aENABLED[5]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPERATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter) + (( ${aENABLED[5]} == 1 )) && Print_Local_Ip (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPERATOR $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)" #6: WAN IP # Move this to /DietPi/dietpi/.network? (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPERATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" #7: Freespace (RootFS) (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPERATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" #8: Freespace (DietPi userdata) @@ -275,6 +281,7 @@ NB: It is executed as bash script, so it needs to be in bash compatible syntax. if (( $INPUT == 0 )); then Print_Header + Print_Local_Ip elif (( $INPUT == 1 )); then From 9b1c0c4639fbd335ccf0c64ee11870dabc7f4657 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Apr 2019 20:47:05 +0200 Subject: [PATCH 026/253] v6.23 (#2699) + General | In DietPi systemd services use faster "dash" as script exec + log forwarding wrapper --- rootfs/etc/systemd/system/dietpi-boot.service | 2 +- rootfs/etc/systemd/system/dietpi-fs_partition_resize.service | 2 +- rootfs/etc/systemd/system/dietpi-preboot.service | 2 +- rootfs/etc/systemd/system/dietpi-ramdisk.service | 4 ++-- rootfs/etc/systemd/system/dietpi-ramlog.service | 4 ++-- rootfs/etc/systemd/system/dietpi-wifi-monitor.service | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index e90a1b3bb5..854fde07de 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -9,7 +9,7 @@ Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.ser Type=oneshot RemainAfterExit=yes StandardOutput=tty -ExecStart=/bin/bash -c '/DietPi/dietpi/boot 2>&1 | tee /tmp/dietpi-boot.log' +ExecStart=/bin/dash -c '/DietPi/dietpi/boot 2>&1 | tee /tmp/dietpi-boot.log' [Install] WantedBy=multi-user.target diff --git a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service index 74830cb128..af4a8dee69 100644 --- a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service +++ b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service @@ -10,7 +10,7 @@ Before=var-swap.swap swap.target local-fs-pre.target Type=oneshot StandardOutput=tty ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs -ExecStart=/bin/bash -c '/var/lib/dietpi/services/fs_partition_resize.sh 2>&1 | tee /var/tmp/dietpi/logs/fs_partition_resize.log' +ExecStart=/bin/dash -c '/var/lib/dietpi/services/fs_partition_resize.sh 2>&1 | tee /var/tmp/dietpi/logs/fs_partition_resize.log' [Install] WantedBy=local-fs.target diff --git a/rootfs/etc/systemd/system/dietpi-preboot.service b/rootfs/etc/systemd/system/dietpi-preboot.service index 7421b66bb6..c909aedf27 100644 --- a/rootfs/etc/systemd/system/dietpi-preboot.service +++ b/rootfs/etc/systemd/system/dietpi-preboot.service @@ -10,7 +10,7 @@ Before=network-pre.target dropbear.service ssh.service Type=oneshot RemainAfterExit=yes StandardOutput=tty -ExecStart=/bin/bash -c '/DietPi/dietpi/preboot 2>&1 | tee /tmp/dietpi-preboot.log' +ExecStart=/bin/dash -c '/DietPi/dietpi/preboot 2>&1 | tee /tmp/dietpi-preboot.log' [Install] WantedBy=local-fs.target diff --git a/rootfs/etc/systemd/system/dietpi-ramdisk.service b/rootfs/etc/systemd/system/dietpi-ramdisk.service index 541c342f30..828638dc95 100644 --- a/rootfs/etc/systemd/system/dietpi-ramdisk.service +++ b/rootfs/etc/systemd/system/dietpi-ramdisk.service @@ -8,8 +8,8 @@ Before=syslog.service rsyslog.service Type=forking RemainAfterExit=yes ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/func/dietpi-ramdisk 0 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/func/dietpi-ramdisk 1 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStart=/bin/dash -c '/boot/dietpi/func/dietpi-ramdisk 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/dash -c '/DietPi/dietpi/func/dietpi-ramdisk 1 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramdisk.log' [Install] WantedBy=local-fs.target diff --git a/rootfs/etc/systemd/system/dietpi-ramlog.service b/rootfs/etc/systemd/system/dietpi-ramlog.service index 3c4dcb4fe1..4979b6e45c 100644 --- a/rootfs/etc/systemd/system/dietpi-ramlog.service +++ b/rootfs/etc/systemd/system/dietpi-ramlog.service @@ -8,8 +8,8 @@ Before=syslog.service rsyslog.service Type=forking RemainAfterExit=yes ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/func/dietpi-ramlog 0 &>> /var/tmp/dietpi/logs/dietpi-ramlog.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/func/dietpi-ramlog 1 &>> /var/tmp/dietpi/logs/dietpi-ramlog.log' +ExecStart=/bin/dash -c '/boot/dietpi/func/dietpi-ramlog 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log' +ExecStop=/bin/dash -c '/DietPi/dietpi/func/dietpi-ramlog 1 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log' [Install] WantedBy=local-fs.target diff --git a/rootfs/etc/systemd/system/dietpi-wifi-monitor.service b/rootfs/etc/systemd/system/dietpi-wifi-monitor.service index 1cba3633d0..af5da29fc4 100644 --- a/rootfs/etc/systemd/system/dietpi-wifi-monitor.service +++ b/rootfs/etc/systemd/system/dietpi-wifi-monitor.service @@ -7,7 +7,7 @@ After=dietpi-boot.service network-online.target network.target [Service] ExecStartPre=/DietPi/dietpi/func/obtain_network_details -ExecStartPre=/bin/bash -c '[[ -e /sys/class/net/wlan$(sed -n 2p /DietPi/dietpi/.network) ]]' +ExecStartPre=/bin/dash -c '[ -e /sys/class/net/wlan$(sed -n 2p /DietPi/dietpi/.network) ]' ExecStart=/var/lib/dietpi/services/dietpi-wifi-monitor.sh [Install] From 9cf6dd333059d7bbc3682374f04e8fce71292d29 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 8 Apr 2019 20:48:12 +0200 Subject: [PATCH 027/253] v6.23 (#2678) + DietPi-Config/Set_hardware | Serial/UART rework: Allow to toggle login console (+boot messages) on single serial devices. Without input (backwards compatibility) toggle for active devices only based on /dev/tty* existence to prevent e.g. boot error logs because systemd attempts to start serial-getty on unavailable serial devices. + DietPi-Set_hardware | Serial/UART rework: On RPi warn when attempting to enable login console on ttyAMA0 while Bluetooth is active and the other way round, since onboard Bluetooth uses ttyAMA0. + DietPi-Config/Set_hardware | Fix adding boot message to serial devices for ARMbian images, since armbianEnv.txt allows to enable a fixed serial console (onboard) only and requires different syntax + DietPi-Config | Adjust Pine A64 options based on ARMbian vs Ayufan/Longsleep image + DietPi-Config | Fix: Reset soundcard defaults and with this install alsa-utils, if missing, when entering Audio Options. Installing alsa-utils was skipped if it was NOT installed. + DietPi-Patch | Cleanup and fix masked/enabled serial-getty instances for non-existent serial devices + DietPi-Config | Serial/UART: Enable VM support since VirtualBox and VMware allow to enable virtual serial ports and attach devices from host. + DietPi-Config/Set_hardware | Serial/UART: Several coding, order and wording enhancements + cleanup --- dietpi/dietpi-config | 785 +++++++++++++++----------------- dietpi/func/dietpi-set_hardware | 224 +++++---- dietpi/patch_file | 26 ++ 3 files changed, 535 insertions(+), 500 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 97b7631712..c0fb64a98a 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -17,15 +17,15 @@ # - iEXITONBACK - 1=Exit DietPi-Config when going back to previous menu (applied to TARGETMENUINDEX 8 only!!) #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Config' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - #Grab Inputs + # Grab Inputs # - target MENU INDEX (valid interger) disable_error=1 G_CHECK_VALIDINT "$1" && TARGETMENUID=$1 @@ -38,29 +38,20 @@ fi #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Hardware Details + # Obtain Hardware Details #///////////////////////////////////////////////////////////////////////////////////// HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model) FP_CPU_SCALING_GOV='/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors' #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Installed software + # Obtain Installed software #///////////////////////////////////////////////////////////////////////////////////// - Load_Installed_Software(){ - - [[ -f /DietPi/dietpi/.installed ]] && . /DietPi/dietpi/.installed - - } + Load_Installed_Software(){ [[ -f /DietPi/dietpi/.installed ]] && . /DietPi/dietpi/.installed; } #///////////////////////////////////////////////////////////////////////////////////// - #Whiltail Info + # Whiltail Info #///////////////////////////////////////////////////////////////////////////////////// - HW_MSG_NOTSUPPORTED='Not Supported' - Info_HW_OptionNotSupported(){ - - G_WHIP_MSG "This option is not available for $G_HW_MODEL_DESCRIPTION" - - } + Info_HW_OptionNotSupported(){ G_WHIP_MSG "This option is not available for $G_HW_MODEL_DESCRIPTION"; } #///////////////////////////////////////////////////////////////////////////////////// # MENUS @@ -73,11 +64,11 @@ REBOOT_REQUIRED=0 - #Interger min/max value holders + # Interger min/max value holders MIN_VALUE=0 MAX_VALUE=0 - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ G_WHIP_MENU_ARRAY=('1' ': Display Options') @@ -159,7 +150,7 @@ Menu_Exit(){ - # TARGETMENUID = -1 , if we are to exit the menu + # TARGETMENUID=-1, if we are to exit DietPi-Config G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then @@ -212,7 +203,7 @@ } - #TARGETMENUID=1 + # TARGETMENUID=1 Menu_DisplayOptions(){ TARGETMENUID=0 @@ -238,7 +229,7 @@ fi - #Display brightness + # Display brightness G_WHIP_MENU_ARRAY+=('16' ': Display Brightness') local xorg_dpi_current=$(grep -m1 '^[[:blank:]]*SOFTWARE_XORG_DPI=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -246,7 +237,7 @@ (( $G_HW_MODEL != 20 )) && G_WHIP_MENU_ARRAY+=('14' ': LED Control') - #RPi only + # RPi only if (( $G_HW_MODEL < 10 )); then # HDMI rotation @@ -262,7 +253,7 @@ local overscan_text='[On]' (( $overscan_disabled )) && overscan_text='[Off]' G_WHIP_MENU_ARRAY+=('6' ": Overscan : $overscan_text") - # - Overscan sizes + # - Overscan sizes if (( ! $overscan_disabled )); then local overscan_options=( @@ -319,7 +310,7 @@ fi - #Odroid Remote + # Odroid Remote if (( $G_HW_MODEL >= 10 && $G_HW_MODEL <= 12 )); then local odroid_remote_text='[Off]' @@ -339,8 +330,7 @@ if G_WHIP_MENU 'Please select an option:'; then - #Return to this menu - TARGETMENUID=1 + TARGETMENUID=1 # Return to this menu WHIP_SELECTION_PREVIOUS=$G_WHIP_RETURNED_VALUE @@ -372,9 +362,7 @@ # RPi and Odroids only if (( $G_HW_MODEL < 20 )); then - G_WHIP_MENU_ARRAY=() - - G_WHIP_MENU_ARRAY+=('none' ': Uninstall all panels') + G_WHIP_MENU_ARRAY=('none' ': Uninstall all panels') G_WHIP_MENU_ARRAY+=('waveshare32' ': 320x240 panel with touch input') if (( $G_HW_MODEL < 10 )); then @@ -406,7 +394,7 @@ if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then - G_WHIP_MSG 'GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup. \n \nThe split value is optimized based on your software installs, however, feel free to tweak them.' + G_WHIP_MSG 'GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup.\n\nThe split value is optimized based on your software installs, however, feel free to tweak them.' TARGETMENUID=6 else @@ -417,7 +405,7 @@ elif (( $G_WHIP_RETURNED_VALUE == 6 )); then - #RPI only + # RPi only if (( $G_HW_MODEL < 10 )); then if (( $overscan_disabled )); then @@ -445,7 +433,7 @@ elif (( $G_WHIP_RETURNED_VALUE == 7 )); then - #RPI only + # RPi only if (( $G_HW_MODEL < 10 )); then G_WHIP_MENU_ARRAY=( @@ -479,7 +467,7 @@ elif (( $G_WHIP_RETURNED_VALUE == 8 )); then - #RPI only + # RPi only if (( $G_HW_MODEL < 10 )); then if (( $rpi_camera_module_enabled )); then @@ -501,17 +489,15 @@ elif (( $G_WHIP_RETURNED_VALUE == 9 )); then - #RPI only + # RPi only if (( $G_HW_MODEL < 10 )); then if (( $rpi_camera_led_disabled )); then - #disable G_CONFIG_INJECT 'disable_camera_led=' 'disable_camera_led=0' /DietPi/config.txt else - #enable G_CONFIG_INJECT 'disable_camera_led=' 'disable_camera_led=1' /DietPi/config.txt fi @@ -525,7 +511,6 @@ elif (( $G_WHIP_RETURNED_VALUE == 10 )); then - # - Enable if (( $odroid_remote_enabled )); then /DietPi/dietpi/func/dietpi-set_hardware remoteir none @@ -540,12 +525,10 @@ fi fi - REBOOT_REQUIRED=1 elif (( $G_WHIP_RETURNED_VALUE == 11 )); then - # - Enable if (( $justboom_ir_remote_enabled )); then /DietPi/dietpi/func/dietpi-set_hardware remoteir none @@ -560,7 +543,6 @@ fi fi - REBOOT_REQUIRED=1 elif (( $G_WHIP_RETURNED_VALUE == 12 )); then @@ -570,7 +552,7 @@ G_CONFIG_INJECT 'decode_WVC1=' "decode_WVC1=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt - #https://github.com/MichaIng/DietPi/issues/1487 + # https://github.com/MichaIng/DietPi/issues/1487 local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem_1024' /DietPi/config.txt | sed 's/^[^=]*=//g') (( $current_gpu_mem < 128 )) && /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit 128 @@ -585,7 +567,7 @@ G_CONFIG_INJECT 'decode_MPG2=' "decode_MPG2=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt - #https://github.com/MichaIng/DietPi/issues/1487 + # https://github.com/MichaIng/DietPi/issues/1487 local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem_1024' /DietPi/config.txt | sed 's/^[^=]*=//g') (( $current_gpu_mem < 128 )) && /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit 128 @@ -612,18 +594,17 @@ G_CONFIG_INJECT 'display_hdmi_rotate=' "display_hdmi_rotate=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt - # rotation 90/270 | invert x/y on FB (Y > X) + # rotation 90/270 | invert x/y on FB (Y > X) if [[ $G_WHIP_RETURNED_VALUE == '1' || $G_WHIP_RETURNED_VALUE == '3' ]]; then Display_Rotation_Calc_XY_Invert 1 - # X > Y + # X > Y else Display_Rotation_Calc_XY_Invert 0 fi - REBOOT_REQUIRED=1 fi @@ -683,14 +664,10 @@ G_WHIP_DEFAULT_ITEM=$current_brightness G_WHIP_INPUTBOX "Please enter a brightness value:\n - Min = $MIN_VALUE | Max = $MAX_VALUE" - if (( $? == 0 )) && [[ $G_WHIP_RETURNED_VALUE ]]; then - - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then - - # - apply - echo $G_WHIP_RETURNED_VALUE > $fp_brightness/brightness + if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then - fi + # - apply + echo $G_WHIP_RETURNED_VALUE > $fp_brightness/brightness fi @@ -700,8 +677,6 @@ fi - unset afp_current_set_brightness - elif (( $G_WHIP_RETURNED_VALUE == 17 )); then G_WHIP_MENU_ARRAY=( @@ -731,8 +706,6 @@ fi - unset overscan_options - } Xorg_Configure(){ @@ -743,19 +716,18 @@ \nWould you like to continue?"; then G_RUN_CMD Xorg -configure - mv $HOME/xorg.conf.new /etc/X11/xorg.conf + mv /root/xorg.conf.new /etc/X11/xorg.conf fi } - #TARGETMENUID=2 + # TARGETMENUID=2 Menu_DisplayOptions_Driver_Resolution(){ - #Return to Display Options Menu - TARGETMENUID=1 + TARGETMENUID=1 # Return to Display Options menu - #VM + # VM if (( $G_HW_MODEL == 20 )); then local current=$(grep -m1 '^[[:blank:]]*GRUB_GFXMODE=' /etc/default/grub | sed 's/^[^=]*=//') @@ -793,7 +765,7 @@ fi - #Native PC + # Native PC elif (( $G_HW_MODEL == 21 )); then local nvidia_installed=0 @@ -836,7 +808,6 @@ /DietPi/dietpi/dietpi-software install 151 fi - REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'Intel' ]]; then @@ -856,7 +827,7 @@ fi - #RPI + # RPi elif (( $G_HW_MODEL < 10 )); then local framebuffer_x=$(grep -m1 '^[[:blank:]]*framebuffer_width=' /DietPi/config.txt || vcgencmd get_config framebuffer_width) @@ -900,8 +871,7 @@ REBOOT_REQUIRED=1 - #Return to This Menu - TARGETMENUID=2 + TARGETMENUID=2 # Return to this menu if [[ $G_WHIP_RETURNED_VALUE == 'Headless' ]]; then @@ -1015,10 +985,10 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Odroid C1 + # Odroid C1 elif (( $G_HW_MODEL == 10 )); then - #Get Current Values + # Get Current Values local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini) G_WHIP_MENU_ARRAY=( @@ -1036,8 +1006,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 REBOOT_REQUIRED=1 - #Return to This Menu - TARGETMENUID=2 + TARGETMENUID=2 # Return to this menu # - Always reset to HDMI sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini @@ -1079,10 +1048,10 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Odroid xu3/4 + # Odroid XU3/4 elif (( $G_HW_MODEL == 11 )); then - #Get Current Values + # Get Current Values local current_resolution=$(grep -m1 'setenv videoconfig \"' /DietPi/boot.ini) if [[ $current_resolution == *'1920x1080'* ]]; then @@ -1112,8 +1081,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 REBOOT_REQUIRED=1 - #Return to This Menu - TARGETMENUID=2 + TARGETMENUID=2 # Return to this menu # - Always reset to hdmi sed -i '/setenv vout /c\setenv vout "hdmi"' /DietPi/boot.ini @@ -1127,10 +1095,10 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then - #Get Current Values + # Get Current Values local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini | sed 's/p/p /') # - NB: also added space after xxxp, so its easier to read, and selects default item. @@ -1158,11 +1126,11 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 [[ $current_resolution != $G_WHIP_RETURNED_VALUE ]] && REBOOT_REQUIRED=1 - # - Always reset vga/dvi options + # Always reset vga/dvi options sed -i '/setenv vout "dvi"/c\# setenv vout "dvi"' /DietPi/boot.ini sed -i '/setenv vout "vga"/c\# setenv vout "vga"' /DietPi/boot.ini - #DVI / VU7+ + # DVI / VU7+ if [[ $G_WHIP_RETURNED_VALUE == '1024x600p 60hz' ]]; then # + DVI mode @@ -1170,20 +1138,19 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Remove the space from option - local temp_string=$(echo "$G_WHIP_RETURNED_VALUE" | tr -d '[:blank:]') + # Remove the space from option + local temp_string=${G_WHIP_RETURNED_VALUE//[[:blank:]]/} sed -i "/setenv m /c\setenv m \"$temp_string\"" /DietPi/boot.ini - #Return to This Menu - TARGETMENUID=2 + TARGETMENUID=2 # Return to this menu fi - #Pine a64 + # Pine A64 elif (( $G_HW_MODEL == 40 )); then - #Get Current Values + # Get Current Values local current_resolution=$(grep -m1 '^[[:blank:]]*hdmi_mode=' /DietPi/uEnv.txt | sed 's/^[^=]*=//') [[ $current_resolution ]] || current_resolution='Not set' @@ -1212,8 +1179,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Return to This Menu - TARGETMENUID=2 + TARGETMENUID=2 # Return to this menu fi @@ -1225,21 +1191,93 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 } - #TARGETMENUID=3 - Menu_AdvancedOptions(){ + # TARGETMENUID=18 + Menu_AdvancedOptions_Serial_UART(){ - TARGETMENUID=0 + TARGETMENUID=18 # Return to this menu + declare -A aSTATE=() G_WHIP_MENU_ARRAY=() - #Swap file + (( $G_HW_MODEL < 10 )) && G_WHIP_MENU_ARRAY+=('' '●─ Toggle console ') + for i in /dev/tty{S,AMA,SAC}[0-9] + do + + [[ -e $i ]] || continue + i=${i#/dev/} + aSTATE[$i]='[Off]' + systemctl -q is-active serial-getty@$i && aSTATE[$i]='[On]' + G_WHIP_MENU_ARRAY+=("$i console" ": ${aSTATE[$i]}") + + done + + # RPi special + local rpi_text='' + if (( $G_HW_MODEL < 10 )); then + + local rpi_text='\n\nOn Raspberry Pi you can additionally enable or disable the primary UART device completely (requires reboot).' + G_WHIP_MENU_ARRAY+=('' '●─ Toggle device ') + + # Onboard WiFi/BT: "enable_uart" toggles ttyS0 (mini UART), disabled by default + if (( $(sed -n 9p /DietPi/dietpi/.hw_model) )); then + + local rpi_uart='ttyS0 (mini UART)' + local rpi_uart_state='[Off]' + grep -q '^[[:blank:]]*enable_uart=1' /DietPi/config.txt && rpi_uart_state='[On]' + + # Nonboard WiFi/BT: "enable_uart" toggles ttyAMA0 (full UART). enabled by default + else + + local rpi_uart='ttyAMA0 (full UART)' + local rpi_uart_state='[On]' + grep -q '^[[:blank:]]*enable_uart=0' /DietPi/config.txt && rpi_uart_state='[Off]' + + fi + G_WHIP_MENU_ARRAY+=("$rpi_uart device" ': $rpi_uart_state') + + fi + + (( ${#G_WHIP_MENU_ARRAY[@]} > 2 )) || { G_WHIP_MSG 'No serial/UART devices have been found on your system.'; TARGETMENUID=3; return; } + + G_WHIP_BUTTON_CANCEL_TEXT='Back' + if G_WHIP_MENU "Select an available serial/UART device to toggle a login console on it.$rpi_text"; then + + if [[ $G_WHIP_RETURNED_VALUE == *'device' ]]; then + + local toggle=1 + [[ $rpi_uart_state == '[On]' ]] && toggle=0 && /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable ${G_WHIP_RETURNED_VALUE%% *} + G_CONFIG_INJECT 'enable_uart=' "enable_uart=$toggle" /DietPi/config.txt + REBOOT_REQUIRED=1 + + elif [[ $G_WHIP_RETURNED_VALUE == *'console' ]]; then + + local toggle='enable' + [[ ${aSTATE[${G_WHIP_RETURNED_VALUE%% *}]} == '[On]' ]] && toggle='disable' + /DietPi/dietpi/func/dietpi-set_hardware serialconsole $toggle ${G_WHIP_RETURNED_VALUE%% *} + + fi + + else + + TARGETMENUID=3 # Return to Advanced Options + + fi + + } + + # TARGETMENUID=3 + Menu_AdvancedOptions(){ + + TARGETMENUID=0 + + # Swap file local swap_size=$(free -m | mawk '/Swap:/ {print $2;exit}') local swap_location=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') local swap_size_text="$swap_size MB" - (( ! $swap_size )) && swap_size_text='[Off]' - G_WHIP_MENU_ARRAY+=('Swapfile' ": [$swap_size_text | $swap_location]") + (( $swap_size )) || swap_size_text='[Off]' + G_WHIP_MENU_ARRAY=('Swapfile' ": [$swap_size_text | $swap_location]") - #Time sync + # Time sync local ntpd_mode_current=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') local ntpd_mode_text='' if (( $ntpd_mode_current == 0 )); then @@ -1265,29 +1303,25 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi G_WHIP_MENU_ARRAY+=('Time sync mode' ": [$ntpd_mode_text]") - local rtc_enabled=0 - local rtc_text='Emulated' - if ! command -v fake-hwclock &> /dev/null; then + # RTC clock + local rtc_enabled=1 + local rtc_text='Hardware' + if command -v fake-hwclock &> /dev/null; then - rtc_enabled=1 - rtc_text='Hardware' + rtc_enabled=0 + rtc_text='Emulated' fi - G_WHIP_MENU_ARRAY+=('RTC mode' ": [$rtc_text]") G_WHIP_MENU_ARRAY+=('Update firmware' '') - #No bluetooth and serial console for VM - if (( $G_HW_MODEL != 20 )); then + # Serial/UART devices + G_WHIP_MENU_ARRAY+=('Serial/UART' ': Manage available devices') - #Serial console - local serialconsole_state=$(grep -m1 '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - local serialconsole_text='[Off]' - (( $serialconsole_state )) && serialconsole_text='[On]' - G_WHIP_MENU_ARRAY+=('Serial console' ": $serialconsole_text") + # Bluetooth: Not for VM + if (( $G_HW_MODEL != 20 )); then - #Bluetooth local bluetooth_state_text='[On]' local bluetooth_state=1 if [[ -f /etc/modprobe.d/disable_bt.conf ]]; then @@ -1300,40 +1334,42 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #RPi Specific + # RPi specific if (( $G_HW_MODEL < 10 )); then + # I2C state local rpi_i2c_enabled=$(grep -ci -m1 '^[[:blank:]]*dtparam=i2c_arm=on' /DietPi/config.txt) local rpi_i2c_text='[Off]' (( $rpi_i2c_enabled )) && rpi_i2c_text='[On]' + G_WHIP_MENU_ARRAY+=('I2C state' ": $rpi_i2c_text") + # I2C baudrate local rpi_i2cbaudrate_hz=$(grep -m1 '^[[:blank:]]*i2c_arm_baudrate=' /DietPi/config.txt | sed 's/^[^=]*=//') - # Allow commented/non-existent entry, using default value: https://github.com/raspberrypi/firmware/blob/d69aadedb7c146ba5d3b0b45a661e5669a9141c4/boot/overlays/README#L115-L116 + # - Allow commented/non-existent entry, using default value: https://github.com/raspberrypi/firmware/blob/d69aadedb7c146ba5d3b0b45a661e5669a9141c4/boot/overlays/README#L115-L116 rpi_i2cbaudrate_hz="$(( ${rpi_i2cbaudrate_hz:-100000} / 1000 )) kHz" + G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2cbaudrate_hz]") + + # USB max current local usb_max_current_enabled=$(grep -ci -m1 '^[[:blank:]]*max_usb_current=1' /DietPi/config.txt) local rpi_usbmaxcurrent_text='[Off]' (( $usb_max_current_enabled )) && rpi_usbmaxcurrent_text='[On]' + G_WHIP_MENU_ARRAY+=('Max USB current' ": $rpi_usbmaxcurrent_text") - if (( $G_HW_MODEL == 3 )); then + # 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_DESCRIPTION == *'3 Model '[AB]'+' ]]; then local rpi3_usb_boot_bit_enabled=$(vcgencmd otp_dump | grep -m1 '17:' | grep -ci -m1 '3020000a') local rpi3_usb_boot_bit_enabled_text='[Off]' (( $rpi3_usb_boot_bit_enabled )) && rpi3_usb_boot_bit_enabled_text='[On]' - G_WHIP_MENU_ARRAY+=('USB boot support' ": $rpi3_usb_boot_bit_enabled_text") fi - G_WHIP_MENU_ARRAY+=('Max USB current' ": $rpi_usbmaxcurrent_text") - G_WHIP_MENU_ARRAY+=('I2c state' ": $rpi_i2c_text") - G_WHIP_MENU_ARRAY+=('I2c frequency' ": [$rpi_i2cbaudrate_hz]") - fi if G_WHIP_MENU 'Please select an option:'; then - #Return to This Menu - TARGETMENUID=3 + TARGETMENUID=3 # Return to this menu if [[ $G_WHIP_RETURNED_VALUE == 'Swapfile' ]]; then @@ -1356,7 +1392,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 systemctl stop fake-hwclock - # - allow times in the past + # - Allow times in the past G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock systemctl restart fake-hwclock @@ -1391,8 +1427,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 local old_firmware=$(ls /lib/modules/) - #PineA64 - if (( $G_HW_MODEL == 40 )); then + # Pine A64: Non-ARMbian only + if (( $G_HW_MODEL == 40 && -f /usr/local/sbin/pine64_update_uboot.sh && -f /usr/local/sbin/pine64_update_kernel.sh )); then if G_WHIP_YESNO "Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION? - This will run longsleep's update scripts to update the U-Boot and kernel."; then @@ -1402,7 +1438,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #G_AGDUG based (not all devices support this) + # G_AGDUG based (not all devices support this) elif G_WHIP_YESNO "Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION? - This will run G_AGDUG, a wrapper for 'apt-get dist-upgrade'\n - Most (but not all) devices allow APT based firmware updates \nNB: If requested to overwrite the current kernel, press TAB and then ENTER (to confirm)."; then @@ -1412,12 +1448,12 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Reboot required only, if firmware got actually updated + # Reboot required only, if firmware got actually updated [[ $old_firmware != $(ls /lib/modules/) ]] && REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'Max USB current' ]]; then - #Enabled + # Enabled if (( $usb_max_current_enabled == 1 )); then if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_text (1.2AMP)\nWould you like to disable this setting? @@ -1428,7 +1464,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Disabled + # Disabled elif (( $usb_max_current_enabled == 0 )); then if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_text (0.6AMP)\nWould you like to enable this setting? @@ -1441,7 +1477,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - elif [[ $G_WHIP_RETURNED_VALUE == 'I2c state' ]]; then + elif [[ $G_WHIP_RETURNED_VALUE == 'I2C state' ]]; then if (( $rpi_i2c_enabled )); then @@ -1454,13 +1490,13 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi REBOOT_REQUIRED=1 - elif [[ $G_WHIP_RETURNED_VALUE == 'I2c frequency' ]]; then + elif [[ $G_WHIP_RETURNED_VALUE == 'I2C frequency' ]]; then - #remove kHz from current - G_WHIP_DEFAULT_ITEM=$(echo -e "$rpi_i2cbaudrate_hz" | tr -d ' kHz') - if G_WHIP_INPUTBOX 'Please enter the required i2c baudrate frequency (kHz).'; then + # Remove kHz from current + G_WHIP_DEFAULT_ITEM=${rpi_i2cbaudrate_hz% kHz} + if G_WHIP_INPUTBOX 'Please enter the required I2C baudrate frequency (kHz).'; then - #check valid int + # Check valid int if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE; then /DietPi/dietpi/func/dietpi-set_hardware i2c "$G_WHIP_RETURNED_VALUE" @@ -1470,18 +1506,9 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - elif [[ $G_WHIP_RETURNED_VALUE == 'Serial console' ]]; then + elif [[ $G_WHIP_RETURNED_VALUE == 'Serial/UART' ]]; then - if (( $serialconsole_state )); then - - /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable - - else - - /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable - - fi - REBOOT_REQUIRED=1 + TARGETMENUID=18 elif [[ $G_WHIP_RETURNED_VALUE == 'Bluetooth' ]]; then @@ -1520,35 +1547,27 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 } - #TARGETMENUID=4 + # TARGETMENUID=4 Menu_PerformanceOptions(){ TARGETMENUID=0 - #All devices + # All devices local current_cpu_governor=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_GOVERNOR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') local frequency_min_cpu_governor=1 local fp_frequency_min_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq' - if [[ -f $fp_frequency_min_cpu_governor ]]; then - - frequency_min_cpu_governor=$(( $(<$fp_frequency_min_cpu_governor) / 1000 )) - - fi + [[ -f $fp_frequency_min_cpu_governor ]] && frequency_min_cpu_governor=$(( $(<$fp_frequency_min_cpu_governor) / 1000 )) local frequency_max_cpu_governor=2 local fp_frequency_max_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' - if [[ -f $fp_frequency_max_cpu_governor ]]; then - - frequency_max_cpu_governor=$(( $(<$fp_frequency_max_cpu_governor) / 1000 )) - - fi + [[ -f $fp_frequency_max_cpu_governor ]] && frequency_max_cpu_governor=$(( $(<$fp_frequency_max_cpu_governor) / 1000 )) local cpu_temp=$(G_OBTAIN_CPU_TEMP) local cpu_temp_f='Unknown' if disable_error=1 G_CHECK_VALIDINT "$cpu_temp"; then - cpu_temp_f="$(( ( $cpu_temp * 9 / 5 ) + 32 ))'f" + cpu_temp_f="$(( $cpu_temp * 9/5 + 32 ))'f" cpu_temp+="'c" fi @@ -1557,17 +1576,17 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 local memory_free=$(( $(mawk '/MemFree:/ {print $2;exit}' /proc/meminfo) / 1000 )) local memory_usage=$(( $memory_total - $memory_free )) - #Create Menu List for Whiptail + # Create Menu List for Whiptail # - this will list the menu options available for each device. G_WHIP_MENU_ARRAY=() - #RPi: Overclocking + # RPi: Overclocking (( $G_HW_MODEL < 10 )) && G_WHIP_MENU_ARRAY+=('Overclocking' ': Set Profile') - #CPU GOV + # CPU GOV G_WHIP_MENU_ARRAY+=('CPU Governor' ": [$current_cpu_governor]") - #Ondemand/Interactive Throttle up menu + # Ondemand/Interactive Throttle up menu if [[ $current_cpu_governor == 'ondemand' || $current_cpu_governor == 'conservative' || $current_cpu_governor == 'interactive' ]]; then @@ -1577,7 +1596,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Ondemand extras + # Ondemand extras if [[ $current_cpu_governor == 'ondemand' ]]; then local current_cpu_sample_rate=$(( $(grep -m1 '^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' /DietPi/dietpi.txt | sed 's/[^=]*=//') / 1000 )) #convert to ms @@ -1589,7 +1608,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Define CPU scaling frequency or percent + # Define CPU scaling frequency or percent local type_cpu_freq_info='MHz' # - Intel [[ -f /sys/devices/system/cpu/intel_pstate/max_perf_pct ]] && type_cpu_freq_info='%' @@ -1606,7 +1625,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_MENU_ARRAY+=('CPU Frequency Limits' ": Max = [$user_frequency_max_text] | Min = [$user_frequency_min_text]") - #RPi extras + # RPi extras if (( $G_HW_MODEL < 10 )); then local current_cpu_temp_limit=$(grep -m1 'temp_limit' /DietPi/config.txt | sed 's/^[^=]*=//') @@ -1622,8 +1641,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCPU Temp: $cpu_temp : $cpu_temp_f\nRAM: $memory_total MB | Used: $memory_usage MB | Free: $memory_free MB" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=4 + TARGETMENUID=4 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -1637,7 +1655,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then - sed -i "/CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=/c\CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' "CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_cpu fi @@ -1648,8 +1666,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 'Ondemand Sample Rate'*) - local index=-1 - local input_fp=( + local file='' + local afile=( '/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate_min' '/sys/devices/system/cpu/cpufreq/ondemand/min_sampling_rate' @@ -1658,46 +1676,38 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 ) - for ((i=0; i<${#input_fp[@]}; i++)) + for i in ${afile[@]} do - if [[ -f ${input_fp[$i]} ]]; then - - index=$i - break - - fi + [[ -f $i ]] && file=$i && break done - # - Unable to find min value, hard set it - if (( $index <= -1 )); then + if [[ $file ]]; then - MIN_VALUE=20 # RPi is min 20ms, however, no way to currently detect min available values... + MIN_VALUE=$(( $(<$file) / 1000 )) + # - Unable to find min value, hard set it else - MIN_VALUE=$(( $(<${input_fp[$index]}) / 1000 )) + MIN_VALUE=20 # RPi is min 20ms, however, no way to currently detect min available values... fi MAX_VALUE=300 G_WHIP_DEFAULT_ITEM=$current_cpu_sample_rate - G_WHIP_INPUTBOX "Please enter a sample rate in miliseconds, for Ondemand to check if it needs to increase CPU clocks.\nA lower value will make the system more responsive.\n - valid range: $MIN_VALUE - $MAX_VALUE" + G_WHIP_INPUTBOX "Please enter a sample rate in milliseconds, for Ondemand to check if it needs to increase CPU clocks.\nA lower value will make the system more responsive.\n - valid range: $MIN_VALUE - $MAX_VALUE" if (( $? == 0 )); then if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then - sed -i "/CONFIG_CPU_ONDEMAND_SAMPLE_RATE=/c\CONFIG_CPU_ONDEMAND_SAMPLE_RATE=$(( $G_WHIP_RETURNED_VALUE * 1000 ))" /DietPi/dietpi.txt - #Apply changes + G_CONFIG_INJECT 'CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' "CONFIG_CPU_ONDEMAND_SAMPLE_RATE=$(( $G_WHIP_RETURNED_VALUE * 1000 ))" /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_cpu fi fi - unset input_fp - ;; 'CPU Frequency Limits'*) @@ -1714,13 +1724,9 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 readarray available_frequency_array < /tmp/dietpi-available_cpu_freqs local division_factor=1000 #display MHz for user menu # - Intel (disable conversion) - if [[ -f /sys/devices/system/cpu/intel_pstate/max_perf_pct ]]; then + [[ -f /sys/devices/system/cpu/intel_pstate/max_perf_pct ]] && division_factor=1 - division_factor=1 - - fi - - local index=0 #0=max | 1=min + local index=0 # 0=max | 1=min while (( $index < 2 )) do @@ -1847,7 +1853,6 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then G_CONFIG_INJECT 'CONFIG_CPU_USAGE_THROTTLE_UP=' "CONFIG_CPU_USAGE_THROTTLE_UP=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt - #Apply changes /DietPi/dietpi/func/dietpi-set_cpu fi @@ -1889,7 +1894,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Change_Hostname(){ - #Get existing Hostname + # Get existing Hostname local hostname_existing=$( /tmp/available_locale + mawk '/UTF-8/ {print $1}' /usr/share/i18n/SUPPORTED | sed 's/#//g' > /tmp/available_locale G_WHIP_MENU_ARRAY=() local index=0 - # convert for whiptail 0-1=1st option 2-3=2nd + # convert for whiptail 0-1=1st option 2-3=2nd while read line do @@ -2154,8 +2150,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 rm /tmp/available_locale G_WHIP_DEFAULT_ITEM=$locale_current - G_WHIP_MENU 'Please select a system locale. DietPi will automatically apply this as the default locale:' - if (( $? == 0 )); then + if G_WHIP_MENU 'Please select a system locale. DietPi will automatically apply this as the default locale:'; then /DietPi/dietpi/func/dietpi-set_software locale "$G_WHIP_RETURNED_VALUE" @@ -2191,7 +2186,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 NET_RX_MB='Unknown' NET_TX_MB='Unknown' - #$1 = device+index + # $1 = device+index Net_Update_UsageStats(){ local input=$1 @@ -2206,14 +2201,14 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 NET_RX_BYTE=$( 0 )); then + if disable_error=1 G_CHECK_VALIDINT $NET_RX_BYTE 1; then NET_RX_MB="$(( $NET_RX_BYTE / 1024 / 1024 ))MB" fi NET_TX_MB='Unknown' - if disable_error=1 G_CHECK_VALIDINT $NET_TX_BYTE && (( $NET_TX_BYTE > 0 )); then + if disable_error=1 G_CHECK_VALIDINT $NET_TX_BYTE 1; then NET_TX_MB="$(( $NET_TX_BYTE / 1024 / 1024 ))MB" @@ -2293,10 +2288,10 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_Restart(){ - #Stop all services (required for hotspot) + # Stop all services (required for hotspot) /DietPi/dietpi/dietpi-services stop - # Enable/Disable wifi modules + # Enable/Disable WiFi modules if (( $WIFI_DISABLED )); then /DietPi/dietpi/func/dietpi-set_hardware wifimodules disable @@ -2307,34 +2302,34 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Drop Connections + # 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 - #Kill dhclient + # Kill dhclient killall dhclient &> /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 addr flush dev eth$ETH_DEV_INDEX &> /dev/null + # - ip addr flush dev wlan$WIFI_DEV_INDEX &> /dev/null - #Restart Networking + # Restart Networking G_DIETPI-NOTIFY 2 'Restarting network, please wait...' systemctl daemon-reload - #Manually bring up adapters + # Manually bring up adapters (( $ETH_DISABLED == 0 )) && ifup eth$ETH_DEV_INDEX --force (( $WIFI_DISABLED == 0 )) && ifup wlan$WIFI_DEV_INDEX --force - #Restart all services (required for hotspot) + # Restart all services (required for hotspot) /DietPi/dietpi/dietpi-services start # - 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 - #Update network data + # Update network data Network_GetData G_DIETPI-NOTIFY 0 'Network restarted' @@ -2351,7 +2346,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_ApplyChanges(){ - #Eth + # Eth local eth_enabled_text='' (( $ETH_DISABLED )) && eth_enabled_text='#' @@ -2368,7 +2363,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Wlan + # WiFi local wifi_enabled_text='' (( $WIFI_DISABLED )) && wifi_enabled_text='#' @@ -2386,8 +2381,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi cat << _EOF_ > /etc/network/interfaces -#/etc/network/interfaces -#Please use DietPi-Config to modify network settings. +# /etc/network/interfaces +# Please use DietPi-Config to modify network settings. # Local auto lo @@ -2401,7 +2396,7 @@ netmask $ETH_MASK gateway $ETH_GATEWAY ${eth_dns_text}dns-nameservers $ETH_DNS -# Wifi +# WiFi ${wifi_enabled_text}allow-hotplug wlan$WIFI_DEV_INDEX iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text address $WIFI_IP @@ -2438,24 +2433,24 @@ _EOF_ # - Update WiFi db/wpa_supplicant /DietPi/dietpi/func/dietpi-wifidb 1 - #Update Current Mode for network restart + # Update Current Mode for network restart ETH_MODE=$ETH_MODE_TARGET WIFI_MODE=$WIFI_MODE_TARGET - #restart net + # Restart net Network_Restart } Change_StaticIp(){ - #Ethernet + # Ethernet if (( $1 == 0 )); then G_WHIP_DEFAULT_ITEM=$ETH_IP_STATIC G_WHIP_INPUTBOX 'Please enter a new static IP address' && ETH_IP_STATIC=$G_WHIP_RETURNED_VALUE - #wifi + # WiFi elif (( $1 == 1 )); then G_WHIP_DEFAULT_ITEM=$WIFI_IP_STATIC @@ -2467,13 +2462,13 @@ _EOF_ Change_StaticGateway(){ - #Ethernet + # Ethernet if (( $1 == 0 )); then G_WHIP_DEFAULT_ITEM=$ETH_GATEWAY_STATIC G_WHIP_INPUTBOX 'Please enter a new static Gateway address' && ETH_GATEWAY_STATIC=$G_WHIP_RETURNED_VALUE - #wifi + # WiFi elif (( $1 == 1 )); then G_WHIP_DEFAULT_ITEM=$WIFI_GATEWAY_STATIC @@ -2485,13 +2480,13 @@ _EOF_ Change_StaticMask(){ - #Ethernet + # Ethernet if (( $1 == 0 )); then G_WHIP_DEFAULT_ITEM=$ETH_MASK_STATIC G_WHIP_INPUTBOX 'Please enter a new static Mask address' && ETH_MASK_STATIC=$G_WHIP_RETURNED_VALUE - #wifi + # WiFi elif (( $1 == 1 )); then G_WHIP_DEFAULT_ITEM=$WIFI_MASK_STATIC @@ -2505,7 +2500,7 @@ _EOF_ #$1 = Adapater type | 0=Eth, 1=WiFi - #Store current into var + # Store current into var local current_value=0 # - Ethernet @@ -2522,7 +2517,7 @@ _EOF_ local return_value=$current_value - #Create Menu List for Whiptail + # Create Menu List for Whiptail G_WHIP_MENU_ARRAY=( 'Custom' 'Manually enter your DNS server' @@ -2560,7 +2555,7 @@ _EOF_ fi - #Apply new value + # Apply new value # - Ethernet if (( $1 == 0 )); then @@ -2615,7 +2610,6 @@ _EOF_ esac - #Apply /DietPi/dietpi/func/dietpi-set_hardware wificountrycode "$wifi_country_code_target" # - Restart networking @@ -2640,23 +2634,16 @@ _EOF_ Wifi_Reconnect(){ G_WHIP_YESNO "WiFi will connect to the strongest configured SSID that is secure, with an open SSID being the last priority.\n\nSave all changes and restart networking?\n\nNB: All WiFi connections will be dropped!" - if (( $? == 0 )); then - - #Apply Changes - Network_ApplyChanges - - fi + (( $? == 0 )) && Network_ApplyChanges } Ethernet_Reconnect(){ - G_WHIP_YESNO 'Do you wish to apply settings and reconnect network now? \n\n(NOTICE) All Ethernet connections will be dropped!' - if (( $? == 0 )); then + if G_WHIP_YESNO 'Do you wish to apply settings and reconnect network now? \n\n(NOTICE) All Ethernet connections will be dropped!'; then - #Apply Changes printf '\ec' # clear current terminal screen - echo -e 'Reconnecting Ethernet , please wait' + echo 'Reconnecting Ethernet , please wait...' Network_ApplyChanges fi @@ -2668,13 +2655,13 @@ _EOF_ Network_GetData(){ - #Update DietPi system network details + # Update DietPi system network details /DietPi/dietpi/func/obtain_network_details - #Copy /etc/network/interfaces to /tmp (tmpfs) and pull data from it. + # Copy /etc/network/interfaces to /tmp (tmpfs) and pull data from it. cp /etc/network/interfaces /tmp/net_interfaces - #Reset + # Reset ETH_IP_STATIC=$(mawk '/address / {print $2;exit}' /tmp/net_interfaces) ETH_GATEWAY_STATIC=$(mawk '/gateway / {print $2;exit}' /tmp/net_interfaces) ETH_MASK_STATIC=$(mawk '/netmask / {print $2;exit}' /tmp/net_interfaces) @@ -2714,7 +2701,7 @@ _EOF_ [[ ! $WIFI_SSID_CURRENT ]] && WIFI_SSID_CURRENT='Disconnected / No SSID' WIFI_CRED_INDEX=0 # Which index of SSID/KEY etc we are editing - #Get extra wifi stats + # Get extra WiFi stats WIFI_BITRATE=0 WIFI_SIGNALSTRENGTH=0 # - Hotspot enabled? @@ -2754,20 +2741,20 @@ _EOF_ } - #eth + # Eth if [[ -d /sys/class/net/eth$ETH_DEV_INDEX ]]; then - #Hardware + # Hardware ETH_HARDWARE=1 - #Static or DHCP? + # Static or DHCP? ETH_MODE=$(grep -ci -m1 "iface eth$ETH_DEV_INDEX inet dhcp" /tmp/net_interfaces) ETH_MODE_TARGET=$ETH_MODE - #Connected and Valid IP? + # Connected and Valid IP? ETH_CONNECTED=$(ip -o r l dev eth$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') - #Enabled and Connected + # Enabled and Connected if (( $ETH_DISABLED == 0 && $ETH_CONNECTED == 1 )); then ETH_IP=$(ip a s eth$ETH_DEV_INDEX | grep -m1 '^[[:blank:]]*inet ' | mawk '{print $2}' | sed 's|/.*$||') @@ -2779,19 +2766,20 @@ _EOF_ fi + # WiFi if [[ -d /sys/class/net/wlan$WIFI_DEV_INDEX ]]; then - #Hardware + # Hardware WIFI_HARDWARE=1 - #Static or DHCP? + # Static or DHCP? WIFI_MODE=$(grep -ci -m1 "iface wlan$WIFI_DEV_INDEX inet dhcp" /tmp/net_interfaces) WIFI_MODE_TARGET=$WIFI_MODE - #Connected and Valid IP? + # Connected and Valid IP? WIFI_CONNECTED=$(ip -o r l dev wlan$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') - #Enabled and Connected + # Enabled and Connected if (( $WIFI_DISABLED == 0 && $WIFI_CONNECTED == 1 )); then WIFI_IP=$(ip a s wlan$WIFI_DEV_INDEX | grep -m1 '^[[:blank:]]*inet ' | mawk '{print $2}' | sed 's|/.*$||') @@ -2799,7 +2787,7 @@ _EOF_ WIFI_MASK=$(cidr2mask $(ip a s wlan$WIFI_DEV_INDEX | grep -m1 '^[[:blank:]]*inet ' | mawk '{print $2}' | sed 's|^.*/||')) WIFI_DNS=$(mawk '/nameserver/ {print $2;exit}' /etc/resolv.conf) - #Get extra wifi stats + # Get extra WiFi stats WIFI_BITRATE=$(iwconfig wlan$WIFI_DEV_INDEX | mawk '/Bit Rate/ {print $2;exit}' | sed 's/Rate[:=]//g') WIFI_SIGNALSTRENGTH=$(iwconfig wlan$WIFI_DEV_INDEX | mawk '/Signal level=/ {print $4;exit}' | sed 's/level=//g' | cut -f1 -d "/") @@ -2818,36 +2806,36 @@ _EOF_ fi - #cleanup tmp + # Cleanup tmp [[ -f /tmp/net_interfaces ]] && rm /tmp/net_interfaces } - #TARGETMENUID=8 + # TARGETMENUID=8 Menu_NetworkAdapters(){ TARGETMENUID=0 - #Check Network + # Check Network Network_GetData G_WHIP_MENU_ARRAY=() - #Obtain enabled/disabled status + # Obtain enabled/disabled status local eth_disabled_text='[On]' (( $ETH_DISABLED )) && eth_disabled_text='[Off]' local wlan_disabled_text='[On]' (( $WIFI_DISABLED )) && wlan_disabled_text='[Off]' - #Obtain Hardware Status + # Obtain Hardware Status local eth_hardware_text='Available' - (( ! $ETH_HARDWARE )) && eth_hardware_text='Not Found' + (( $ETH_HARDWARE )) || eth_hardware_text='Not Found' local wlan_hardware_text='Available' - (( ! $WIFI_HARDWARE )) && wlan_hardware_text='Not Found' + (( $WIFI_HARDWARE )) || wlan_hardware_text='Not Found' - #Obtain Connected/Carrier Status + # Obtain Connected/Carrier Status local eth_connected_text='Disconnected' (( $ETH_CONNECTED )) && eth_connected_text='Connected' @@ -2859,7 +2847,7 @@ _EOF_ fi - #Internet Connection Status + # Internet Connection Status local Internet_connected_text='Please run Internet Test' if (( $INTERNET_TEST_STATE == 2 )); then @@ -2871,7 +2859,7 @@ _EOF_ fi - #Proxy settings (global vars, force an int to obtain current values stored in dietpi.txt) + # Proxy settings (global vars, force an int to obtain current values stored in dietpi.txt) Load_Proxy_Vars local proxy_state_text='[Off]' @@ -2904,7 +2892,7 @@ _EOF_ G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') - #IPv6 + # IPv6 local ipv6_status_text='[WARNING] Not supported or disabled on kernel level!' if [[ -d /proc/sys/net/ipv6 ]]; then @@ -2942,8 +2930,7 @@ _EOF_ G_WHIP_MENU "Ethernet : $eth_hardware_text | $eth_disabled_text | $eth_connected_text \nWifi : $wlan_hardware_text | $wlan_disabled_text | $wlan_connected_text\nIPv6 : $ipv6_status_text$ipv4_status_long\nInternet : $Internet_connected_text\nProxy : $proxy_state_text" if (( $? == 0 )); then - #Return to this Menu - TARGETMENUID=8 + TARGETMENUID=8 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -2959,20 +2946,18 @@ _EOF_ fi - REBOOT_REQUIRED=1 - G_WHIP_MSG 'Onboard WiFi modules setting applied\n\nNB: A reboot is required for the changes to take effect.' ;; 'IPv6') - #Disable + # Disable if (( $ipv6_enabled )); then /DietPi/dietpi/func/dietpi-set_hardware enableipv6 0 - #Enable + # Enable else /DietPi/dietpi/func/dietpi-set_hardware enableipv6 1 @@ -2983,12 +2968,12 @@ _EOF_ 'Prefer IPv4') - #Don't prefer + # Don't prefer if (( $ipv4_preferred )); then /DietPi/dietpi/func/dietpi-set_hardware preferipv4 0 - #Prefer + # Prefer else /DietPi/dietpi/func/dietpi-set_hardware preferipv4 1 @@ -2999,12 +2984,12 @@ _EOF_ 'Ethernet') - #No hardware found + # No hardware found if (( ! $ETH_HARDWARE )); then G_WHIP_MSG 'No Ethernet Hardware was found. You are most likely running a Pi Model A.' - #Disabled + # Disabled elif (( $ETH_DISABLED )); then G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed.\n\nWould you like to enable Ethernet now?\n - (NOTICE) Connections may drop!' @@ -3026,7 +3011,7 @@ _EOF_ 'WiFi') - #Disabled | Offer chance to enable (also enables wifi modules) + # Disabled | Offer chance to enable (also enables wifi modules) if (( $WIFI_DISABLED )); then G_WHIP_YESNO 'WiFi must be enabled before settings can be changed.\n\nWould you like to enable WiFi now? \n - (NOTICE) Connections may drop!' @@ -3037,7 +3022,7 @@ _EOF_ fi - # - No hardware found + # No hardware found elif (( ! $WIFI_HARDWARE )); then G_WHIP_YESNO 'No supported Wifi Hardware was found.\n\nWould you like to disable WiFi? \n - (NOTICE) Connections may drop!' @@ -3059,20 +3044,19 @@ _EOF_ 'Test') G_WHIP_DEFAULT_ITEM=$INTERNET_TEST_URL - G_WHIP_INPUTBOX 'Press enter a URL address to test (eg: http://google.com)' - if (( $? == 0 )); then + if G_WHIP_INPUTBOX 'Press enter a URL address to test (eg: http://google.com)'; then INTERNET_TEST_URL=$G_WHIP_RETURNED_VALUE - INTERNET_TEST_STATE=0 #Not tested + INTERNET_TEST_STATE=0 # Not tested G_ERROR_HANDLER_INFO_ONLY=1 retry_max=2 G_CHECK_URL "$INTERNET_TEST_URL" if (( $G_ERROR_HANDLER_EXITCODE_RETURN == 0 )); then - INTERNET_TEST_STATE=2 #Online + INTERNET_TEST_STATE=2 # Online else - INTERNET_TEST_STATE=1 #Failed + INTERNET_TEST_STATE=1 # Failed fi @@ -3088,14 +3072,13 @@ _EOF_ esac - #Cancel + # Cancel else - #Exit DietPi-Config on back to previous menu? + # Exit DietPi-Config on back to previous menu? if (( $EXITONBACK == 1 )); then - #Return to this menu - TARGETMENUID=8 + TARGETMENUID=8 # Return to this menu Menu_Exit fi @@ -3104,7 +3087,7 @@ _EOF_ } - #TARGETMENUID=9 + # TARGETMENUID=9 Menu_NetworkAdapters_Ethernet(){ TARGETMENUID=8 @@ -3143,8 +3126,7 @@ _EOF_ G_WHIP_MENU "Ethernet Details:\nUsage : Sent = $NET_TX_MB | Recieved = $NET_RX_MB\nAddress : IP = $ETH_IP | Mask = $ETH_MASK | Gateway = $ETH_GATEWAY | DNS = $ETH_DNS" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=9 + TARGETMENUID=9 # Return to this menu WHIP_SELECTION_PREVIOUS=$G_WHIP_RETURNED_VALUE @@ -3230,7 +3212,7 @@ _EOF_ } - #TARGETMENUID=10 + # TARGETMENUID=10 Menu_NetworkAdapters_Wifi(){ TARGETMENUID=8 @@ -3242,7 +3224,7 @@ _EOF_ G_WHIP_MENU_ARRAY=('' '●─ Basic Options ') - #WiFi Hotspot Menu + # WiFi Hotspot Menu if (( $WIFI_HOTSPOT )); then # - Load current details into global vars, once. @@ -3254,7 +3236,7 @@ _EOF_ fi - # N enabled? + # - N enabled? local hotspot_n_enabled=0 local hotspot_n_text='Disabled' if grep -q '^ieee80211n=1' /etc/hostapd/hostapd.conf; then @@ -3264,18 +3246,14 @@ _EOF_ fi - # toggle + # - Toggle local hotspot_active_state=$(systemctl is-active hostapd | grep -ci -m1 '^active' ) - local hotspot_status_text='Status : ' - local hotspot_active_state_text='[Enabled] | Select to turn off hotspot' - if (( ! $hotspot_active_state )); then + local hotspot_status_text='Status : Offline' + local hotspot_active_state_text='[Disabled] | Select to turn on hotspot' + if (( $hotspot_active_state )); then - hotspot_active_state_text='[Disabled] | Select to turn on hotspot' - hotspot_status_text+='Offline' - - else - - hotspot_status_text+='Online' + hotspot_status_text+='Status : Online' + hotspot_active_state_text='[Enabled] | Select to turn off hotspot' fi @@ -3286,16 +3264,16 @@ _EOF_ description_text+=$hotspot_status_text - #WiFi Menu + # WiFi Menu else # - Get current Mode details local mode_current='DHCP' - (( $WIFI_MODE == 0 )) && mode_current='STATIC' + (( $WIFI_MODE )) || mode_current='STATIC' # - Target Details local mode_target='DHCP' - (( $WIFI_MODE_TARGET == 0 )) && mode_target='STATIC' + (( $WIFI_MODE_TARGET )) || mode_target='STATIC' G_WHIP_MENU_ARRAY+=('Scan' ': Scan and configure SSID') @@ -3361,8 +3339,7 @@ _EOF_ G_WHIP_DEFAULT_ITEM=$WHIP_SELECTION_PREVIOUS if G_WHIP_MENU "$description_text"; then - #Return to this menu - TARGETMENUID=10 + TARGETMENUID=10 # Return to this menu WHIP_SELECTION_PREVIOUS=$G_WHIP_RETURNED_VALUE @@ -3545,7 +3522,7 @@ _EOF_ } - #TARGETMENUID=11 + # TARGETMENUID=11 Menu_Tools(){ TARGETMENUID=0 @@ -3579,7 +3556,7 @@ _EOF_ } - #TARGETMENUID=12 + # TARGETMENUID=12 Menu_FilesystemBenchmark(){ TARGETMENUID=11 @@ -3614,8 +3591,7 @@ Additional benchmarks: - Network LAN : Transfer rate = $BENCH_NET_LAN_SPEED MB/s" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=12 + TARGETMENUID=12 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -3702,7 +3678,7 @@ Additional benchmarks: sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=400' /DietPi/config.txt - #Zero , via name id + # Zero , via name id if grep -qi 'rpi zero' /DietPi/dietpi/.hw_model; then sed -i '/arm_freq=/c\#arm_freq=1000' /DietPi/config.txt @@ -3723,32 +3699,27 @@ Additional benchmarks: } - #TARGETMENUID=13 + # TARGETMENUID=13 Menu_Overclock(){ TARGETMENUID=4 - #Get Current Overclocking Settings + # Get Current Overclocking Settings local over_voltage_value=$(grep -m1 'over_voltage=' /DietPi/config.txt | tr -d '#over_voltage=') local arm_freq_value=$(grep -m1 'arm_freq=' /DietPi/config.txt | tr -d '#arm_freq=') local core_freq_value=$(grep -m1 'core_freq=' /DietPi/config.txt | tr -d '#core_freq=') local sdram_freq_value=$(grep -m1 'sdram_freq=' /DietPi/config.txt | tr -d '#sdram_freq=') - #Overclocking Pi1 + # Overclocking RPi1 # - Zero if grep -qi 'rpi zero' /DietPi/dietpi/.hw_model; then - G_WHIP_MENU_ARRAY=( - - 'none' ': 1000 MHz ARM | 400 MHz core | 450 MHz SDRAM | 0 overvolt' - - ) + G_WHIP_MENU_ARRAY=('none' ': 1000 MHz ARM | 400 MHz core | 450 MHz SDRAM | 0 overvolt') G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=13 + TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -3776,8 +3747,7 @@ Additional benchmarks: G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=13 + TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in 'none') @@ -3824,7 +3794,7 @@ Additional benchmarks: fi - #Overclocking Pi2 + # Overclocking Pi2 elif (( $G_HW_MODEL == 2 )); then G_WHIP_MENU_ARRAY=( @@ -3839,8 +3809,7 @@ Additional benchmarks: G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=13 + TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -3892,16 +3861,12 @@ Additional benchmarks: fi - #Overclocking Pi3 + # Overclocking Pi3 elif (( $G_HW_MODEL == 3 )); then if grep -qi 'RPi 3 Model B+' /DietPi/dietpi/.hw_model; then - G_WHIP_MENU_ARRAY=( - - 'none' ': 1400 MHz ARM | 400 MHz core | 500 MHz SDRAM | 0 overvolt' - - ) + G_WHIP_MENU_ARRAY=('none' ': 1400 MHz ARM | 400 MHz core | 500 MHz SDRAM | 0 overvolt') else @@ -3919,8 +3884,7 @@ Additional benchmarks: G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=13 + TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -3977,7 +3941,7 @@ Additional benchmarks: } - #TARGETMENUID=14 + # TARGETMENUID=14 Menu_AudioOptions(){ TARGETMENUID=0 @@ -4017,8 +3981,7 @@ Additional benchmarks: if G_WHIP_MENU 'Please select an option:'; then - #Return to This Menu - TARGETMENUID=14 + TARGETMENUID=14 # Return to this menu if [[ $G_WHIP_RETURNED_VALUE == 'PSU noise reduction' ]]; then @@ -4047,7 +4010,7 @@ Additional benchmarks: G_WHIP_MENU_ARRAY=() # - Global: - # RPI, none disables HDMI aswell. + # RPi, none disables HDMI as well. if (( $G_HW_MODEL < 10 )); then G_WHIP_MENU_ARRAY+=('none' ': Disables HDMI + 3.5mm Analogue') @@ -4065,11 +4028,7 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('default' ': HW:0,0') # Install prereqs to allow for detection - if dpkg-query -s alsa-utils &> /dev/null; then - - /DietPi/dietpi/func/dietpi-set_hardware soundcard default - - fi + dpkg-query -s alsa-utils &> /dev/null || /DietPi/dietpi/func/dietpi-set_hardware soundcard default for i in {0..9} do @@ -4155,9 +4114,9 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('H3-analogue' ': 3.5mm analogue') # - H5 - # elif (( $G_HW_CPUID == 2 )); then + #elif (( $G_HW_CPUID == 2 )); then - # G_WHIP_MENU_ARRAY+=('H5-analogue' '3.5mm analogue') + #G_WHIP_MENU_ARRAY+=('H5-analogue' '3.5mm analogue') # - Sparky elif (( $G_HW_MODEL == 70 )); then @@ -4196,8 +4155,8 @@ Additional benchmarks: } - #TARGETMENUID=15 - STRESS_TEST_MODE=0 #0=CPU only | 1=CPU/RAM 2=CPU/RAM/IO + # TARGETMENUID=15 + STRESS_TEST_MODE=0 # 0=CPU only | 1=CPU/RAM 2=CPU/RAM/IO STRESS_TEST_DURATION=60 STRESS_TEST_RESULTS_TEMP_MIN=0 STRESS_TEST_RESULTS_TEMP_MAX=0 @@ -4227,8 +4186,7 @@ Additional benchmarks: if G_WHIP_MENU 'Please select an option:'; then - #Return to this menu - TARGETMENUID=15 + TARGETMENUID=15 # Return to this menu if [[ $G_WHIP_RETURNED_VALUE == 'Duration' ]]; then @@ -4243,11 +4201,7 @@ Additional benchmarks: ) G_WHIP_DEFAULT_ITEM=$STRESS_TEST_DURATION - if G_WHIP_MENU 'Please select a duration for the test'; then - - STRESS_TEST_DURATION=$G_WHIP_RETURNED_VALUE - - fi + G_WHIP_MENU 'Please select a duration for the test' && STRESS_TEST_DURATION=$G_WHIP_RETURNED_VALUE elif [[ $G_WHIP_RETURNED_VALUE == 'Mode' ]]; then @@ -4260,11 +4214,7 @@ Additional benchmarks: ) G_WHIP_DEFAULT_ITEM=$STRESS_TEST_MODE - if G_WHIP_MENU 'Please select a stress test type'; then - - STRESS_TEST_MODE=$G_WHIP_RETURNED_VALUE - - fi + G_WHIP_MENU 'Please select a stress test type' && STRESS_TEST_MODE=$G_WHIP_RETURNED_VALUE elif [[ $G_WHIP_RETURNED_VALUE == 'Start' ]]; then @@ -4276,7 +4226,7 @@ Additional benchmarks: local start_time=$(date) local start_time_epoch=$(date +%s) local memory_per_thread=$(( $(free -m | mawk '/^Mem:/ {print $2;exit}') / ( $G_HW_CPU_CORES * 2 ) )) - local fp_log="$HOME/dietpi-config_stress.log" + local fp_log='/root/dietpi-config_stress.log' rm $fp_log &> /dev/null if (( $STRESS_TEST_MODE == 0 )); then @@ -4356,15 +4306,15 @@ Additional benchmarks: } - #TARGETMENUID=16 + # TARGETMENUID=16 Menu_Network_Nas_Misc(){ TARGETMENUID=0 - #Update installed software + # Update installed software Load_Installed_Software - #No-IP Client + # No-IP Client local noip_installed=0 local noip_status='Not Installed' local noip_menutext='Install No-IP now' @@ -4374,7 +4324,7 @@ Additional benchmarks: noip_status='Offline - Please enter No-IP details' noip_menutext='Enter/Setup No-IP details' - #Check if No-IP is running (indicates login details are valid) + # Check if No-IP is running (indicates login details are valid) if pgrep '/usr/local/bin/noip2' &> /dev/null; then noip_status='Online / Active' @@ -4384,15 +4334,15 @@ Additional benchmarks: fi - #APT mirror + # APT mirror local apt_mirror_current=$(grep -m1 '^[[:blank:]]*deb[[:blank:]]' /etc/apt/sources.list | mawk '{print $2}') [[ $apt_mirror_current ]] || apt_mirror_current='Unknown, no string from scrape' - #NTP mirror + # NTP mirror local ntp_mirror_current=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') [[ $ntp_mirror_current ]] || ntp_mirror_current='Unknown, no string from scrape' - #Network boot wait + # Network boot wait local boot_wait_for_network=$(grep -m1 '^[[:blank:]]*CONFIG_BOOT_WAIT_FOR_NETWORK=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') local boot_wait_for_network_text='' if (( $boot_wait_for_network == 0 )); then @@ -4423,8 +4373,7 @@ Additional benchmarks: if G_WHIP_MENU ''; then - #Return to this Menu - TARGETMENUID=16 + TARGETMENUID=16 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -4453,12 +4402,8 @@ Additional benchmarks: 'APT Mirror') - #Create Menu List for Whiptail - G_WHIP_MENU_ARRAY=( - - 'Custom' ': Manually enter APT mirror' - - ) + # Create Menu List for Whiptail + G_WHIP_MENU_ARRAY=('Custom' ': Manually enter APT mirror') # - Raspbian if (( $G_HW_MODEL < 10 )); then @@ -4510,7 +4455,7 @@ Additional benchmarks: 'NTP Mirror') - #Create Menu List for Whiptail + # Create Menu List for Whiptail G_WHIP_MENU_ARRAY=( 'Gateway' ': Use local router as NTP server (Recommended)' @@ -4584,7 +4529,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s 'No-IP') - #Installed? + # Installed? if (( ! $noip_installed )); then G_WHIP_YESNO 'No-IP Client is not installed, would you like to install it now?\n @@ -4595,7 +4540,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s printf '\ec' # clear current terminal screen G_RUN_CMD systemctl stop noip2 - #Failsafe: Directory required for "noip2 -C" to create the config file there + # Failsafe: Directory required for "noip2 -C" to create the config file there mkdir -p /usr/local/etc noip2 -C read -p 'Press any key to continue...' @@ -4607,14 +4552,13 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s esac - #Cancel + # Cancel else - #Exit DietPi-Config on back to previous menu? + # Exit DietPi-Config on back to previous menu? if (( $EXITONBACK == 1 )); then - #Return to this menu - TARGETMENUID=16 + TARGETMENUID=16 # Return to this menu Menu_Exit fi @@ -4629,7 +4573,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s PROXY_USERNAME='' PROXY_PASSWORD='' - #So we can call this in other menus (eg: submenu of this) + # So we can call this in other menus (eg: submenu of this) Load_Proxy_Vars(){ PROXY_ENABLED=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ENABLED=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -4640,12 +4584,12 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s } - #TARGETMENUID=17 + # TARGETMENUID=17 Menu_NetworkAdapters_Proxy(){ TARGETMENUID=8 - #Get current details on first menu init (PROXY_ENABLED=-1) + # Get current details on first menu init (PROXY_ENABLED=-1) if (( $PROXY_ENABLED == -1 )); then Load_Proxy_Vars @@ -4672,8 +4616,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s G_WHIP_MENU "Current Details:\n - Status: $proxy_state_text\n - Address: $PROXY_ADDRESS\n - Port: $PROXY_PORT\n - Username: $PROXY_USERNAME\n - Password: $PROXY_PASSWORD" if (( $? == 0 )); then - #Return to this menu - TARGETMENUID=17 + TARGETMENUID=17 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in @@ -4760,7 +4703,7 @@ _EOF_ esac - #Reset init flag to force a reload of setings next time this menu is run. + # Reset init flag to force a reload of setings next time this menu is run. else PROXY_ENABLED=-1 @@ -4774,7 +4717,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then - #Start DietPi-Config + # Start DietPi-Config while (( $TARGETMENUID >= 0 )); do printf '\ec' # clear current terminal screen @@ -4853,6 +4796,10 @@ _EOF_ Menu_NetworkAdapters_Proxy + elif (( $TARGETMENUID == 18 )); then + + Menu_AdvancedOptions_Serial_UART + else G_WHIP_MSG "[FAILED] Unknown menu ID $TARGETMENUID, reverting to DietPi-Config main menu\n @@ -4866,7 +4813,7 @@ Please report it to: https://github.com/MichaIng/DietPi/issues" else - echo -e ' >> Filesystem prep has not yet completed:\n Please wait for the system to reboot' + G_WHIP_MSG '[INFO] First run setup has not reached sufficient state.\n\nPlease reboot before using DietPi-Config. If the issue persists, please report this as bug.' fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 9cdbd5ce46..4579fc003a 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -19,7 +19,7 @@ $FP_SCRIPT eth-forcespeed 10/100/1000/disable $FP_SCRIPT wifimodules enable/disable/onboard_enable/onboard_disable $FP_SCRIPT wificountrycode GB/US/DE/... $FP_SCRIPT bluetooth enable/disable -$FP_SCRIPT serialconsole 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 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 @@ -45,6 +45,7 @@ $FP_SCRIPT rpi3_usb_boot enable INPUT_DEVICE_VALUE='disable' fi + INPUT_ADDITIONAL=$3 # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals @@ -898,7 +899,7 @@ _EOF_ sed -i '/^[[:blank:]]*spi_s3c64xx/d' /etc/modules sed -i '/^[[:blank:]]*fbtft_device/d' /etc/modules - ##Cant run it on the fly, locks up device. + # Cant run it on the fly, locks up device. #root@DietPi-XU4:~# modprobe -rf spi_s3c64xx #root@DietPi-XU4:~# modprobe -rf fbtft_device #Segmentation fault @@ -1150,8 +1151,22 @@ _EOF_ # Pre-Reqs if (( $G_HW_MODEL < 10 )); then - # - Serial console must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 - INPUT_DEVICE_VALUE='disable' Serial_Main + # - Login console on ttyAMA0 must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 + if systemctl -q is-active serial-getty@ttyAMA0; then + + if G_WHIP_YESNO '[WARNING] A serial login console is currently active on ttyAMA0\n +Do you want to continue and disable the serial login console?'; then + + INPUT_DEVICE_VALUE='disable' INPUT_ADDITIONAL='ttyAMA0' Serial_Main + + else + + exit 0 + + fi + + fi + G_AG_CHECK_INSTALL_PREREQ pi-bluetooth else @@ -1449,130 +1464,178 @@ _EOF_ # serialconsole #///////////////////////////////////////////////////////////////////////////////////// - MAX_SERIAL_CONSOLES=2 - Serial_Main(){ #------------------------------------------------------------------------------------- # Enable if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - G_DIETPI-NOTIFY 2 'Enabling known serial-getty services, please wait...' - systemctl unmask serial-getty@tty 2> /dev/null - systemctl enable serial-getty@tty 2> /dev/null - for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) - do + # Enable for specific Serial/UART device + if [[ $INPUT_ADDITIONAL ]]; then - # - unmask v6.3+ - systemctl unmask serial-getty@ttyAMA$i 2> /dev/null - systemctl unmask serial-getty@ttySAC$i 2> /dev/null - systemctl unmask serial-getty@ttyS$i 2> /dev/null - #systemctl unmask serial-getty@ttyFIQ$i 2> /dev/null #:https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + # - RPi: Warn if on RPi ttyAMA0 is about to be enabled while Bluetooth is up + if [[ $G_HW_MODEL == [0-9] && $INPUT_ADDITIONAL == 'ttyAMA0' ]] && systemctl -q is-active hciuart; then + if G_WHIP_YESNO '[WARNING] ttyAMA0 is currently used by Bluetooth\n +Do you want to continue and DISABLE Bluetooth now?'; then - # - Enable v6.2- - systemctl enable serial-getty@ttyAMA$i 2> /dev/null - systemctl enable serial-getty@ttySAC$i 2> /dev/null - systemctl enable serial-getty@ttyS$i 2> /dev/null - #systemctl enable serial-getty@ttyFIQ$i 2> /dev/null #:https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + INPUT_DEVICE_VALUE='disable' Bluetooth_Main - # - Allow root login for known TTY's not in /etc/securetty by default - # NanoPC-T4 - G_CONFIG_INJECT "ttyFIQ$i" "ttyFIQ$i" /etc/securetty + else - done + exit 0 - # Device Specific: - # - RPi - if (( $G_HW_MODEL < 10 )); then + fi - G_CONFIG_INJECT 'enable_uart=' 'enable_uart=1' /DietPi/config.txt + fi - # - Odroid C1 - elif (( $G_HW_MODEL == 10 )); then + G_DIETPI-NOTIFY 2 "Enabling serial-getty on: /dev/$INPUT_ADDITIONAL" + G_RUN_CMD systemctl unmask serial-getty@$INPUT_ADDITIONAL + G_RUN_CMD systemctl enable serial-getty@$INPUT_ADDITIONAL + # - Start now if device (already) exists + [[ -e /dev/$INPUT_ADDITIONAL ]] && G_RUN_CMD systemctl start serial-getty@$INPUT_ADDITIONAL - sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini + # Allow root login on selected TTY if not enabled by default + G_CONFIG_INJECT "$INPUT_ADDITIONAL" "$INPUT_ADDITIONAL" /etc/securetty - # - Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then + # Enable boot messages depending on device + # - RPi + if (( $G_HW_MODEL < 10 )); then - if ! grep -qi 'console=ttySAC2,115200n8 ' /DietPi/boot.ini; then + grep -q "console=$INPUT_ADDITIONAL" /boot/cmdline.txt || sed -i "/root=/s/$/ console=$INPUT_ADDITIONAL,115200/" /boot/cmdline.txt - sed -i 's/console=tty1 /console=tty1 console=ttySAC2,115200n8 /' /DietPi/boot.ini + # - Odroid C1/C2 + elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then - fi + local old='' + [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv condev "' /DietPi/boot.ini) || return + [[ $old =~ console=$INPUT_ADDITIONAL ]] && return + old=$(cut -d \" -f 2 <<< "$old") + G_CONFIG_INJECT 'setenv condev "' "setenv condev \"$old console=$INPUT_ADDITIONAL,115200n8\"" /DietPi/boot.ini - # - Odroid C2 - elif (( $G_HW_MODEL == 12 )); then + # - Odroid XU4 + elif (( $G_HW_MODEL == 11 )); then + + local old='' + [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv bootrootfs "' /DietPi/boot.ini) || return + [[ $old =~ console=$INPUT_ADDITIONAL ]] && return + old=$(cut -d \" -f 2 <<< "$old") + G_CONFIG_INJECT 'setenv bootrootfs "' "setenv bootrootfs \"$old console=$INPUT_ADDITIONAL,115200n8\"" /DietPi/boot.ini + + # - ARMbian: armbianEnv.txt only allows to toggle a fixed serial console depending on device + elif (( $ARMBIAN )); then + + grep -q "console=$INPUT_ADDITIONAL" /boot/boot.cmd || return + if grep -qE 'console=(display|both)' $FP_UENV; then + + G_CONFIG_INJECT 'console=' 'console=both' $FP_UENV + + else + + G_CONFIG_INJECT 'console=' 'console=serial' $FP_UENV + + fi - sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini + # - Pine A64: On ARMbian ttyS0 boot output is forced and custom console is not possible via armbianEnv.txt + elif (( $G_HW_MODEL == 40 )); then - # - Pine A64 (on ARMbian ttyS0 boot output is forced) - elif (( $G_HW_MODEL == 40 && ! $ARMBIAN )); then + [[ ! -f $FP_UENV ]] || grep -q "console=$INPUT_ADDITIONAL" $FP_UENV && return + echo "console=$INPUT_ADDITIONAL,115200n8" >> $FP_UENV - if ! grep -qi 'console=ttyS0,115200n8 ' $FP_UENV; then + #elif (( $G_HW_MODEL == 70 )); then - sed -i 's/console=tty0 /console=tty0 console=ttyS0,115200n8 /' $FP_UENV + # grep -q "console=$INPUT_ADDITIONAL" $FP_UENV || sed -i "/bootargs=/s/$/ console=$INPUT_ADDITIONAL,115200n8/" $FP_UENV fi - fi + # Enable for all detected Serial/UART devices + else + + # ttyFIQ[0-9]: https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + for i in /dev/tty{S,AMA,SAC}[0-9] + do + + [[ -e $i ]] || continue + INPUT_ADDITIONAL=${i/\/dev\/} Serial_Main - # - Update dietpi.txt global var - G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=1' /DietPi/dietpi.txt + done + # On RPi enable primary UART device + (( $G_HW_MODEL < 10 )) && G_CONFIG_INJECT 'enable_uart=' 'enable_uart=1' $FP_RPI_CONFIG + + # Update dietpi.txt global var + G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=1' /DietPi/dietpi.txt + + fi #------------------------------------------------------------------------------------- # Disable elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then - #Disable services. Although, this seems to have no effect on the cmdline.txt boot.ini etc serial console entries. They run regardless. But lets do it for consistency. - G_DIETPI-NOTIFY 2 'Disabling known serial-getty services, please wait...' - systemctl disable serial-getty@tty 2> /dev/null - systemctl mask serial-getty@tty 2> /dev/null - for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) - do + # Disable for specific Serial/UART device + if [[ $INPUT_ADDITIONAL ]]; then - # Disable first, to remove symlink from /etc/systemd/system/getty.target.wants/ - systemctl disable serial-getty@ttyAMA$i 2> /dev/null - systemctl disable serial-getty@ttySAC$i 2> /dev/null - systemctl disable serial-getty@ttyS$i 2> /dev/null - #systemctl disable serial-getty@ttyFIQ$i 2> /dev/null #:https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + G_DIETPI-NOTIFY 2 "Disabling serial-getty on: /dev/$INPUT_ADDITIONAL" + systemctl stop serial-getty@$INPUT_ADDITIONAL + systemctl disable serial-getty@$INPUT_ADDITIONAL + # - Place a mask only if device exists + [[ -e /dev/$INPUT_ADDITIONAL ]] && systemctl mask serial-getty@$INPUT_ADDITIONAL - systemctl mask serial-getty@ttyAMA$i 2> /dev/null - systemctl mask serial-getty@ttySAC$i 2> /dev/null - systemctl mask serial-getty@ttyS$i 2> /dev/null - #systemctl mask serial-getty@ttyFIQ$i 2> /dev/null #:https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + # Disable boot messages depending on device + # - RPi + if (( $G_HW_MODEL < 10 )); then - done + sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" /boot/cmdline.txt - # Device Specific: - # - RPi - if (( $G_HW_MODEL < 10 )); then + # - Odroid C1/C2/XU4 + elif (( $G_HW_MODEL < 12 )); then - sed -i 's/console=ttyAMA0,115200 //' /boot/cmdline.txt # Replaced by enable_uart= + sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" /DietPi/boot.ini - G_CONFIG_INJECT 'enable_uart=' 'enable_uart=0' /DietPi/config.txt + elif (( $ARMBIAN )); then - # - Odroid C1/C2 - elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then + grep -q "console=$INPUT_ADDITIONAL" /boot/boot.cmd || return + if grep -qE 'console=(display|both)' $FP_UENV; then - G_CONFIG_INJECT 'setenv condev' 'setenv condev "console=tty0"' /DietPi/boot.ini + G_CONFIG_INJECT 'console=' 'console=display' $FP_UENV - # - Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then + else - sed -i 's/console=ttySAC2,115200n8 //' /DietPi/boot.ini + G_CONFIG_INJECT 'console=' 'console=none' $FP_UENV - # - Pine A64 (on ARMbian ttyS0 boot output is forced) - elif (( $G_HW_MODEL == 40 && ! $ARMBIAN )); then + fi - sed -i 's/console=ttyS0,115200n8 //' $FP_UENV + # - Pine A64: On ARMbian ttyS0 boot output is forced and custom console is not possible via armbianEnv.txt + elif (( $G_HW_MODEL == 40 )); then - fi + sed -i "/^[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*$/d" $FP_UENV # New style: One variable each line + sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line - # - Update dietpi.txt global var - G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=0' /DietPi/dietpi.txt + #elif (( $G_HW_MODEL == 70 )); then + + # sed -i "s/[[:blank:]]*console=$INPUT_ADDITIONAL[^\"[:blank:]]*//" $FP_UENV + + fi + + # Disable for all detected Serial/UART devices + else + + # ttyFIQ[0-9]: https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 + for i in /dev/tty{S,AMA,SAC}[0-9] + do + + [[ -e $i ]] || continue + INPUT_ADDITIONAL=${i/\/dev\/} Serial_Main + + done + + # On RPi disable primary UART device + (( $G_HW_MODEL < 10 )) && G_CONFIG_INJECT 'enable_uart=' 'enable_uart=0' $FP_RPI_CONFIG + + # Update dietpi.txt global var + G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=0' /DietPi/dietpi.txt + + fi else @@ -2351,7 +2414,6 @@ _EOF_ else Unknown_Input_Name - EXIT_CODE=1 fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 70de9646b2..6a0ca35b43 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1692,6 +1692,32 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" fi #------------------------------------------------------------------------------- + elif (( $G_DIETPI_VERSION_SUB == 22 )); then + + #------------------------------------------------------------------------------- + # Apply Serial/UART rework: https://github.com/MichaIng/DietPi/pull/2678 + # - Cleanup: Remove serial-getty masks for all non-existent serial devices + for i in /etc/systemd/system/serial-getty@tty{S,AMA,SAC}[0-9].service + do + + [[ -L $i && $(readlink $i) == '/dev/null' ]] || continue + local tty=${i##*serial-getty@} + tty=${tty%.service} + [[ -e /dev/$tty ]] || systemctl unmask serial-getty@$tty + + done + # - Fix: Disable serial-getty instances for all non-existent serial devices + for i in /etc/systemd/system/getty.target.wants/serial-getty@tty{S,AMA,SAC}[0-9].service + do + + [[ -L $i ]] || continue + local tty=${i##*serial-getty@} + tty=${tty%.service} + [[ -e /dev/$tty ]] || systemctl disable serial-getty@$tty + + done + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- From 19e20b8679b8ec7a2eb1c00a5f089c27a389df0a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 9 Apr 2019 00:52:37 +0200 Subject: [PATCH 028/253] v6.23 + DietPi-PREP | Fix Meveric APT repo mirror change to include non-HTTPS entries: https://github.com/MichaIng/DietPi/issues/2701 --- 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 a9d2853879..5c754b5863 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -581,7 +581,7 @@ G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME G_HW_MODEL=$G_HW_MODEL G_RUN_CMD /DietPi/dietpi/func/dietpi-set_software apt-mirror 'default' # - Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302 - sed -i 's@https://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/meveric* &> /dev/null + sed -Ei 's@https?://oph\.mdrjr\.net@http://fuzon.co.uk@' /etc/apt/sources.list.d/meveric* &> /dev/null # - (Re)create DietPi logs dir, used by G_AGx G_RUN_CMD mkdir -p /var/tmp/dietpi/logs From 39b5fd1e4d238ed41271959f2fd29d9c733e5777 Mon Sep 17 00:00:00 2001 From: spectrumcomputing <38283339+spectrumcomputing@users.noreply.github.com> Date: Tue, 9 Apr 2019 00:44:45 +0100 Subject: [PATCH 029/253] v6.23 (#2702) + DietPi-Software | Subsonic: Our package does not contain the version string anymore, to allow updating for all DietPi versions without touching the code. Current version on our server: v6.1.5 --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 345edb8425..a10e018d86 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4307,8 +4307,8 @@ _EOF_ Banner_Installing - #G_AGI lame #conflicts with our ffmpeg package: https://github.com/MichaIng/DietPi/issues/946#issuecomment-300738228 - Download_Install 'https://dietpi.com/downloads/binaries/all/subsonic-6.1.3.deb' + #G_AGI lame # Conflicts with our ffmpeg package: https://github.com/MichaIng/DietPi/issues/946#issuecomment-300738228 + Download_Install 'https://dietpi.com/downloads/binaries/all/subsonic.deb' fi From c45d05ffb9b25a72140203f5d8b64ab30e31cc41 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 9 Apr 2019 01:48:01 +0200 Subject: [PATCH 030/253] v6.23 + CHANGELOG | Subsonic: Package has been updated to v6.1.5 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bb7c722164..cbbaf315b8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. +- DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 Bug Fixes: - DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 From 90e4e77d4af52109b87e6629a1f9b182cb7270a3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 9 Apr 2019 20:46:06 +0200 Subject: [PATCH 031/253] v6.23 (#2706) + DietPi-Software | Transmission: Add password with escaped double quotes to prevent service startup failures in case. As well skip adding legacy "max-peers-global" setting which is replaced by "peer-limit-global" for a long time which we add/adjust as well. --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cbbaf315b8..9440a05df7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Bug Fixes: - DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 - DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 +- DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a10e018d86..443a26d287 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8363,7 +8363,6 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_CONFIG_INJECT '"cache-size-mb"' ' "cache-size-mb": '$(Optimize_BitTorrent 0)',' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"download-queue-size"' ' "download-queue-size": '$(Optimize_BitTorrent 1)',' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"peer-limit-global"' ' "peer-limit-global": '$(Optimize_BitTorrent 2)',' /etc/transmission-daemon/settings.json '^\{$' - G_CONFIG_INJECT '"max-peers-global"' ' "max-peers-global": '$(Optimize_BitTorrent 2)',' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"upload-slots-per-torrent"' ' "upload-slots-per-torrent": '$(Optimize_BitTorrent 3)',' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"port-forwarding-enabled"' ' "port-forwarding-enabled": true,' /etc/transmission-daemon/settings.json '^\{$' @@ -8376,7 +8375,9 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_CONFIG_INJECT '"trash-original-torrent-files"' ' "trash-original-torrent-files": true,' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"download-dir"' ' "download-dir": "'$G_FP_DIETPI_USERDATA'/downloads",' /etc/transmission-daemon/settings.json '^\{$' - G_CONFIG_INJECT '"rpc-password"' ' "rpc-password": "'"$GLOBAL_PW"'",' /etc/transmission-daemon/settings.json '^\{$' + # - Double quotes need to be escaped in .json files: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-481374924 + # - ToDo: Hash password directly. Which hash method is used? + G_CONFIG_INJECT '"rpc-password"' ' "rpc-password": "'"${GLOBAL_PW//\"/\\\"}"'",' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"rpc-username"' ' "rpc-username": "root",' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"rpc-whitelist-enabled"' ' "rpc-whitelist-enabled": false,' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"message-level"' ' "message-level": 0,' /etc/transmission-daemon/settings.json '^\{$' From 501e9d10a8aa38b38bb45c966bf3c6ea2cbd1e62 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 9 Apr 2019 20:01:15 +0100 Subject: [PATCH 032/253] Odroid N2 HW codes. --- PREP_SYSTEM_FOR_DIETPI.sh | 6 ++++++ dietpi/func/dietpi-obtain_hw_model | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5c754b5863..43cbe08705 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -382,6 +382,7 @@ '68' ': NanoPC T4' '67' ': NanoPi K1 Plus' '14' ': Odroid N1' + '15' ': Odroid N2' '13' ': Odroid U3' '38' ': OrangePi PC 2' '37' ': OrangePi Prime' @@ -770,6 +771,11 @@ _EOF_ # Buster systemd-udevd doesn't support the current raspi-copies-and-fills: https://github.com/MichaIng/DietPi/issues/1286 (( $DISTRO_TARGET < 5 )) && G_AGI raspi-copies-and-fills + # Odroid N2 + elif (( $G_HW_MODEL == 15 )); then + + G_AGI linux-image-arm64-odroid-n2 + # Odroid N1 elif (( $G_HW_MODEL == 14 )); then diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index d24cc9221c..b1ad7c5a24 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -50,6 +50,7 @@ # G_HW_MODEL 22 Generic device (eg: unknown to DietPi) # G_HW_MODEL 21 x86_64 native (PC) # G_HW_MODEL 20 VM x64 (VMware VirtualBox) + # G_HW_MODEL 15 oDroid N2 # G_HW_MODEL 14 oDroid N1 # G_HW_MODEL 13 oDroid U3 # G_HW_MODEL 12 oDroid C2 @@ -87,6 +88,7 @@ # G_HW_CPUID 1 H3 # G_HW_CPUID 2 H5 # G_HW_CPUID 3 RK3399 + # G_HW_CPUID 4 S922X # - Line 10 - Onboard WiFi/BT Index # HW_ONBOARD_WIFI 0 Not set # HW_ONBOARD_WIFI 1 RPi3/ZeroW (BCM43438) @@ -612,6 +614,13 @@ G_HW_MODEL_DESCRIPTION='Virtual Machine' + # Odroid N2 + elif (( $G_HW_MODEL == 15 )); then + + G_HW_MODEL_DESCRIPTION='Odroid N2' + G_HW_CPUID=4 + #IMAGE_ADDITIONAL_CREDITS='Meveric' + # Odroid N1 elif (( $G_HW_MODEL == 14 )); then From d9ff690c75bf809f94911d8a5e34b5ceb242d26f Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 11 Apr 2019 13:58:34 +0100 Subject: [PATCH 033/253] DietPi-Banner MOTD --- CHANGELOG.txt | 1 + dietpi/func/dietpi-banner | 10 +++++++++- rootfs/etc/cron.daily/dietpi | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9440a05df7..19ee8eefee 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.23 (XX/04/19) Changes / Improvements / Optimisations: +- DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 25955d10fa..b9520877be 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -44,10 +44,11 @@ 'Weather (wttr.in)' 'Custom banner entry' 'Display DietPi useful commands?' + 'MOTD' ) # Set defaults - aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1) + aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1) COLOUR_RESET='\e[0m' aCOLOUR=( @@ -205,6 +206,13 @@ $GREEN_LINE" (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPERATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" #8: Freespace (DietPi userdata) (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPERATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPERATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom + local fp_motd='/tmp/.dietpi_motd' + if (( ${aENABLED[12]} == 1 )); then + + [[ ! -f $fp_motd ]] && curl -sLm 2 https://dietpi.com/motd > $fp_motd + [[ -f $fp_motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPERATOR $(< $fp_motd)" #12: MOTD + + fi echo -e "$GREEN_LINE\n" Print_Credits diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index 532e7745fa..c85f8eb36b 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -45,6 +45,9 @@ fi #---------------------------------------------------------------- + #Clear DietPi motd + [[ -f /tmp/.dietpi_motd ]] && rm /tmp/.dietpi_motd & + #---------------------------------------------------------------- exit #---------------------------------------------------------------- } From 5a0ffe99bab9c0460f06f96017cb26bf4f63292b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 11 Apr 2019 14:39:27 +0100 Subject: [PATCH 034/253] Survey N2 --- .meta/dietpi-survey_report | 1 + 1 file changed, 1 insertion(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 9f3483a7b0..52a33df61b 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -18,6 +18,7 @@ aHW_NAME[12]='Odroid C2' aHW_NAME[13]='Odroid U3' aHW_NAME[14]='Odroid N1' + aHW_NAME[15]='Odroid N2' aHW_NAME[20]='VM x64 (VMware VirtualBox)' aHW_NAME[21]='x86_64 native (PC)' aHW_NAME[22]='Generic device (eg: unknown to DietPi)' From ff638835aebf4185ac3e98ea6344d9417ad2b951 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 11 Apr 2019 15:56:46 +0100 Subject: [PATCH 035/253] Fix for: https://github.com/MichaIng/DietPi/issues/2704 --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 100 +++++++++++++++---------------------------- 2 files changed, 36 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 19ee8eefee..a6280aeb44 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 Bug Fixes: +- DietPi-Config | Resolved an issue where proxy settings would not be correct after a reboot. Many thanks to @stephantual for reporting this!: https://github.com/MichaIng/DietPi/issues/2704 - DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 - DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index c0fb64a98a..e55d9364da 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2862,11 +2862,8 @@ _EOF_ # Proxy settings (global vars, force an int to obtain current values stored in dietpi.txt) Load_Proxy_Vars - local proxy_state_text='[Off]' - (( $PROXY_ENABLED )) && proxy_state_text="[On] | $PROXY_ADDRESS:$PROXY_PORT" - - # - Reset init flag. Ensures Menu_Proxy() reloads current settings. - PROXY_ENABLED=-1 + local proxy_state_text='[Disabled]' + (( $PROXY_ENABLED )) && proxy_state_text="[Enabled] | $PROXY_ADDRESS:$PROXY_PORT" G_WHIP_MENU_ARRAY+=('' '●─ Adapter Options ') G_WHIP_MENU_ARRAY+=('Ethernet' ': Change Wired Network Settings') @@ -4021,7 +4018,8 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('default' ': 3.5mm Analogue') # Native PC/MISC devices | Detect and list available - elif (( $G_HW_MODEL == 21 || + elif (( $G_HW_MODEL == 15 || + $G_HW_MODEL == 21 || $G_HW_MODEL == 40 || $G_HW_MODEL == 42 || $G_HW_MODEL == 43 || $G_HW_MODEL == 44 || $G_HW_MODEL == 67 )); then @@ -4567,7 +4565,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s } - PROXY_ENABLED=-1 + PROXY_ENABLED=0 PROXY_ADDRESS='' PROXY_PORT='' PROXY_USERNAME='' @@ -4576,7 +4574,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s # So we can call this in other menus (eg: submenu of this) Load_Proxy_Vars(){ - PROXY_ENABLED=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ENABLED=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + PROXY_ENABLED=$(grep -ci -m1 'export {http,https,ftp}_proxy' /etc/bash.bashrc) PROXY_ADDRESS=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ADDRESS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') PROXY_PORT=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PORT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') PROXY_USERNAME=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_USERNAME=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -4589,38 +4587,29 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s TARGETMENUID=8 - # Get current details on first menu init (PROXY_ENABLED=-1) - if (( $PROXY_ENABLED == -1 )); then - - Load_Proxy_Vars - - proxy_state_text='[Off]' - (( $PROXY_ENABLED )) && proxy_state_text='[On]' - - fi + Load_Proxy_Vars - proxy_state_text_new='No' - (( $PROXY_ENABLED )) && proxy_state_text_new='Yes' + local proxy_state_text='[Disabled]' + (( $PROXY_ENABLED )) && proxy_state_text='[Enabled]' G_WHIP_MENU_ARRAY=( - 'Toggle' ": Use Proxy?: $proxy_state_text_new" - 'Address' ': Enter Proxy server IP/URL' - 'Port' ': Enter Proxy server port' - 'Username' ': Enter Proxy server username' - 'Password' ': Enter Proxy server password' - 'Apply' ': Save Changes' + 'State' ": $proxy_state_text" + 'Address' ": $PROXY_ADDRESS" + 'Port' ": $PROXY_PORT" + 'Username' ": $PROXY_USERNAME" + 'Password' ": $PROXY_PASSWORD" ) - G_WHIP_MENU "Current Details:\n - Status: $proxy_state_text\n - Address: $PROXY_ADDRESS\n - Port: $PROXY_PORT\n - Username: $PROXY_USERNAME\n - Password: $PROXY_PASSWORD" + G_WHIP_MENU "Please select an option to change:" if (( $? == 0 )); then TARGETMENUID=17 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in - 'Toggle') + 'State') ((PROXY_ENABLED++)) (( $PROXY_ENABLED > 1 )) && PROXY_ENABLED=0 @@ -4659,54 +4648,35 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s ;; - 'Apply') + esac - # - Save settings to dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_ENABLED=' "CONFIG_PROXY_ENABLED=$PROXY_ENABLED" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_ADDRESS=' "CONFIG_PROXY_ADDRESS=$PROXY_ADDRESS" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_PORT=' "CONFIG_PROXY_PORT=$PROXY_PORT" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_USERNAME=' "CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_PASSWORD=' "CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_PROXY_ENABLED=' "CONFIG_PROXY_ENABLED=$PROXY_ENABLED" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_PROXY_ADDRESS=' "CONFIG_PROXY_ADDRESS=$PROXY_ADDRESS" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_PROXY_PORT=' "CONFIG_PROXY_PORT=$PROXY_PORT" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_PROXY_USERNAME=' "CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_PROXY_PASSWORD=' "CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /DietPi/dietpi.txt - # - Delete active export vars - #unset {http,https,ftp}_proxy #Does not apply to system when running from a bash script. + export {http,https,ftp}_proxy='' + sed -i '/export {http,https,ftp}_proxy=/d' /etc/bash.bashrc - # - Delete any existing export settings from /etc/bash.bashrc - sed -i '/^[[:blank:]]*{http,https,ftp}_proxy=/d' /etc/bash.bashrc + # - Add export settings + if (( $PROXY_ENABLED )); then - # - Add export settings - if (( $PROXY_ENABLED )); then + if [[ $PROXY_USERNAME && $PROXY_PASSWORD ]]; then - if [[ $PROXY_USERNAME && $PROXY_PASSWORD ]]; then - cat << _EOF_ >> /etc/bash.bashrc + export {http,https,ftp}_proxy="http://$PROXY_USERNAME:$PROXY_PASSWORD@$PROXY_ADDRESS:$PROXY_PORT" + cat << _EOF_ >> /etc/bash.bashrc export {http,https,ftp}_proxy="http://$PROXY_USERNAME:$PROXY_PASSWORD@$PROXY_ADDRESS:$PROXY_PORT" _EOF_ - else - cat << _EOF_ >> /etc/bash.bashrc + else + + export {http,https,ftp}_proxy="http://$PROXY_ADDRESS:$PROXY_PORT" + cat << _EOF_ >> /etc/bash.bashrc export {http,https,ftp}_proxy="http://$PROXY_ADDRESS:$PROXY_PORT" _EOF_ - fi - - - fi - - # - Ask user for reboot now to activate/disable proxy - REBOOT_REQUIRED=1 - - G_WHIP_YESNO 'The updated proxy settings have been saved.\n\nNB: You must reboot your system, before the new proxy settings will take effect.\n\nReboot system now?' - (( $? == 0 )) && reboot - - # - Reset init flag to force a reload of setings next time this menu is run. - PROXY_ENABLED=-1 - - ;; - - esac - - # Reset init flag to force a reload of setings next time this menu is run. - else + fi - PROXY_ENABLED=-1 + fi fi From be6d0206e341f4070a1c74cadb1be7be7c04a402 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 11 Apr 2019 16:08:35 +0100 Subject: [PATCH 036/253] Reboot required. --- dietpi/dietpi-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index e55d9364da..d7cde13136 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4664,13 +4664,11 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s if [[ $PROXY_USERNAME && $PROXY_PASSWORD ]]; then - export {http,https,ftp}_proxy="http://$PROXY_USERNAME:$PROXY_PASSWORD@$PROXY_ADDRESS:$PROXY_PORT" cat << _EOF_ >> /etc/bash.bashrc export {http,https,ftp}_proxy="http://$PROXY_USERNAME:$PROXY_PASSWORD@$PROXY_ADDRESS:$PROXY_PORT" _EOF_ else - export {http,https,ftp}_proxy="http://$PROXY_ADDRESS:$PROXY_PORT" cat << _EOF_ >> /etc/bash.bashrc export {http,https,ftp}_proxy="http://$PROXY_ADDRESS:$PROXY_PORT" _EOF_ @@ -4678,6 +4676,8 @@ _EOF_ fi + REBOOT_REQUIRED=1 + fi } From 12a09ab605e9709c0c1d77d1b4ecff67f3fd5810 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 11 Apr 2019 16:22:13 +0100 Subject: [PATCH 037/253] Minor --- dietpi/func/dietpi-globals | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d6955c6dc8..d7ea7526a5 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -518,11 +518,8 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # Alias defines #----------------------------------------------------------------------------------- #DietPi scripts, moved from /etc/bash.bashrc - # - Sudo command, that ensures DietPi-Globals with G_* commands are loaded - G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } # - DietPi programs - alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424 alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt' alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart' @@ -544,8 +541,18 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then alias dietpi-banner='/DietPi/dietpi/func/dietpi-banner 2' alias cpu='/DietPi/dietpi/dietpi-cpuinfo' + + # - Misc + # Sudo command, that ensures DietPi-Globals with G_* commands are loaded + G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } + alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424 + + # - 1337 moments ;) alias 1337='echo Indeed, you are =\)' + # - Helpers + #alias dd='dd status=progress ' #needs to be at end... + # - Optional DietPi software aliases/functions [[ -d /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn ]] && alias dietpi-nordvpn='/DietPi/dietpi/misc/dietpi-nordvpn' [[ -f /opt/retropie/supplementary/emulationstation/emulationstation ]] && alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' From 4357c644e0869485454f27978ab1850f94324716 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 13 Apr 2019 14:17:55 +0100 Subject: [PATCH 038/253] DietPi-Benchmark run at nice -19. --- dietpi/func/dietpi-benchmark | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 4a1202fe80..1a8c90dea3 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -388,6 +388,10 @@ Compare these results online with other users, using the link below: #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// + #----------------------------------------------------------------------------------- + #Run at highest priority. + renice -n -19 $$ + #----------------------------------------------------------------------------------- #Init vars for sourcing if (( $INPUT == 0 )); then From 9aba8b91a5166bb79fd3ddef9bbd830fff595859 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 13 Apr 2019 14:48:25 +0100 Subject: [PATCH 039/253] DietPi-Benchmark: increase accuracy of dd results with more time. --- CHANGELOG.txt | 1 + dietpi/func/dietpi-benchmark | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a6280aeb44..c5140c476f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ v6.23 Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 +- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes to 100MB (from 10MB). This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 1a8c90dea3..ea931a0498 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -326,7 +326,7 @@ NB: A lower 'Total time' is faster" CPU_Benchmark #FS/RAM - BENCH_FILESIZE=10 + BENCH_FILESIZE=100 # - RAM FP_BENCHFILE='/tmp' From d232b71b73b8e05de24618e167d334df7fb154d5 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 13 Apr 2019 15:04:40 +0100 Subject: [PATCH 040/253] 1/4 of RAM for benchmark. --- CHANGELOG.txt | 2 +- dietpi/func/dietpi-benchmark | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c5140c476f..ae6d983340 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ v6.23 Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 -- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes to 100MB (from 10MB). This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. +- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index ea931a0498..5cb05476be 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -326,14 +326,15 @@ NB: A lower 'Total time' is faster" CPU_Benchmark #FS/RAM - BENCH_FILESIZE=100 # - RAM FP_BENCHFILE='/tmp' + BENCH_FILESIZE=$(( $(mawk '/MemFree:/ {print $2;exit}' /proc/meminfo) / 1000 / 4 )) #Free mem / 4 Filesystem_Benchmark # - Rootfs FP_BENCHFILE='/' + BENCH_FILESIZE=100 Filesystem_Benchmark SHOW_RESULTS=1 From 16d77f936cb9edc1213d5f1b004ba6a3ae13d78d Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 14 Apr 2019 15:17:34 +0100 Subject: [PATCH 041/253] Remove hard limit to benchmark sizes. Rely on detected max. --- dietpi/func/dietpi-benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 5cb05476be..83e0a8b959 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -194,7 +194,7 @@ NB: A lower 'Total time' is faster" local benchmark_file_name='benchmark.file' local min_benchmark_size=10 local max_benchmark_size=$(( $(G_CHECK_FREESPACE $FP_BENCHFILE) - 100 )) - (( $max_benchmark_size > 1000 )) && max_benchmark_size=1000 + #(( $max_benchmark_size > 10000 )) && max_benchmark_size=10000 [[ $FP_BENCHFILE != *'/' ]] && FP_BENCHFILE+='/' FP_BENCHFILE+=$benchmark_file_name From 2e0d4e7c9b2f2845708cbba2bd223f2184daebde Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 14 Apr 2019 20:21:39 +0200 Subject: [PATCH 042/253] v6.23 (#2698) + DietPi-Arr_to_RAM | Handle files per program + DietPi-Arr_to_RAM | Skip program loop if related disk dir does not exist + DietPi-Arr_to_RAM | Failsafe file/link handling to cover all possible situations + DietPi-Arr_to_RAM | Optimise backup creation to reduce disk writes + DietPi-Arr_to_RAM | Handle program service only if currently active, e.g. allows execution during boot without interfering service starts + DietPi-Arr_to_RAM | Use "--no-block" when starting Sonarr/Radarr/Lidarr services, since they wait for dietpi-arr_to_RAM.service to finish (regardless of being systemd controlled or not), timing it out... + DietPi-Arr_to_RAM | Only start services once after all programs/files have been handled + DietPi-Arr_to_RAM | Allow (non-zero) exit code for boot service. Otherwise the service can be inactive even that databases might already partly been moved to RAM. On shutdown those would then not be stored back to disk, which should always be done. + DietPi-Arr_to_RAM | Add "enable"/"disable" option to toggle boot script + DietPi-Arr_to_RAM | Add command to update the backups which can be used by cron job/systemd timers or Sonarr/Radarr/Lidarr connect custom scripts. Prevents larger database change losses in case of system crash. + DietPi-Arr_to_RAM | Allow database handling for single program. This is especially useful when adding the backup update job as event hook to be executed by Sonarr/Radarr/Lidarr e.g. when finished download. + DietPi-Arr_to_RAM | Sonarr/Radarr/Lidarr run users can now update the database backups, e.g. via custom script triggers that can be configured in web UI + DietPi-Arr_to_RAM | Do not load DietPi-Globals, to allow faster execution on boot + DietPi-Arr_to_RAM | Add intense error handling for now + DietPi-Arr_to_RAM | Print date in shortened format + DietPi-Arr_to_RAM | Further coding and minor wording optimisations + DietPi-Globals | Add "dietpi-arr_to_RAM" alias, if Sonarr, Radarr or Lidarr is installed + DietPi-Globals | Minor coding + DietPi-Patch | Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM --- CHANGELOG.txt | 1 + dietpi/func/dietpi-globals | 59 ++++--- dietpi/misc/dietpi-arr_to_RAM | 304 ++++++++++++++++++++++++++-------- dietpi/patch_file | 14 ++ 4 files changed, 276 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ae6d983340..375bc9cd94 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 +- DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d7ea7526a5..6e684dbf8f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -37,7 +37,7 @@ #----------------------------------------------------------------------------------- #To be exported by the originating script, after loading globals and before calling G_INIT() # - Used in G_ERROR_ and G_WHIP_ - G_PROGRAM_NAME='' + unset G_PROGRAM_NAME #Debug enable G_DEBUG=${G_DEBUG:-0} @@ -74,8 +74,8 @@ G_DIETPI_VERSION_CORE=$G_DIETPI_VERSION_CORE G_DIETPI_VERSION_SUB=$G_DIETPI_VERSION_SUB G_DIETPI_VERSION_RC=$G_DIETPI_VERSION_RC -G_GITBRANCH=$G_GITBRANCH -G_GITOWNER=$G_GITOWNER +G_GITBRANCH='$G_GITBRANCH' +G_GITOWNER='$G_GITOWNER' _EOF_ } @@ -257,7 +257,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #Funcs Clean_Process_Animation(){ - if [[ -t 0 ]] && [[ -w /tmp/dietpi-process.pid ]]; then + if [[ -t 0 && -w /tmp/dietpi-process.pid ]]; then kill -9 $( /dev/null rm /tmp/dietpi-process.pid &> /dev/null @@ -458,27 +458,24 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - # $1 = mode - # - 0 = Exit all linked scripts (kill all) - # - 1 = Kill current script only, excluding the shell. + # $1 = mode + # 1 = Kill current script only, excluding the shell. + # else = Exit all linked scripts (kill all) G_CHECK_ROOT_USER(){ if [[ $G_CHECK_ROOT_USER_VERIFIED != 1 ]]; then if (( $UID )); then - local input=0 - disable_error=1 G_CHECK_VALIDINT "$1" && input=$1 + G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "sudo" or "G_SUDO".' - G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "G_SUDO", or, "sudo -s".' + if [[ $1 == 1 ]]; then - if (( $input == 0 )); then - - exit 1 + kill -INT $$ - elif (( $input == 1 )); then + else - kill -INT $$ + exit 1 fi @@ -506,7 +503,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then else export G_CHECK_ROOTFS_RW_VERIFIED=1 - G_DIETPI-NOTIFY 0 'RootFS R/W access verified.\n' + G_DIETPI-NOTIFY 0 'RootFS R/W access verified.' fi @@ -517,7 +514,11 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #----------------------------------------------------------------------------------- # Alias defines #----------------------------------------------------------------------------------- - #DietPi scripts, moved from /etc/bash.bashrc + # DietPi scripts, moved from /etc/bash.bashrc + # - sudo command that ensures DietPi-Globals with G_* commands are loaded + G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } + # - sudo alias that allows running other aliases with "sudo" + alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424 # - DietPi programs alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' @@ -561,6 +562,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then [[ -f $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh ]] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" [[ -f /usr/share/applications/kodi.desktop ]] && alias startkodi='/DietPi/dietpi/misc/start_kodi' [[ -f /etc/systemd/system/dietpi-cloudshell.service ]] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' + [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM' # - occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: [[ -f /var/www/owncloud/occ ]] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } [[ -f /var/www/nextcloud/occ ]] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } @@ -596,7 +598,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then G_WHIP_DESTROY(){ # - Delete - unset WHIP_MESSAGE unset WHIP_SIZE_X unset WHIP_SIZE_Y unset WHIP_SIZE_Z @@ -832,12 +833,13 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Display a whip message G_WHIP_MSG(){ - WHIP_MESSAGE=$@ + local WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then G_WHIP_INIT 0 whiptail --title "$G_PROGRAM_NAME" --msgbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X + G_WHIP_DESTROY else @@ -845,20 +847,19 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi - G_WHIP_DESTROY - } #G_WHIP_SCROLLBOX "message" # - Display a whip message inside a scrollbox G_WHIP_SCROLLBOX(){ - WHIP_MESSAGE=$@ + local WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then G_WHIP_INIT 0 whiptail --title "$G_PROGRAM_NAME" --scrolltext --msgbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X + G_WHIP_DESTROY else @@ -866,8 +867,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi - G_WHIP_DESTROY - } #G_WHIP_YESNO "message" @@ -879,7 +878,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=$@ + local WHIP_MESSAGE=$@ G_WHIP_INIT 0 local option_default_no='--defaultno' [[ ${G_WHIP_DEFAULT_ITEM,,} == 'yes' || ${G_WHIP_DEFAULT_ITEM,,} == 'ok' ]] && option_default_no='' @@ -903,14 +902,14 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=$@ + local WHIP_MESSAGE=$@ G_WHIP_INIT 0 G_WHIP_RETURNED_VALUE=$(whiptail --title "$G_PROGRAM_NAME" --inputbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" --default-item "$G_WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X "$G_WHIP_DEFAULT_ITEM" 3>&1 1>&2 2>&3; echo $? > /tmp/.G_WHIP_INPUTBOX_RESULT) result=$(&1 1>&2 2>&3; echo $? > /tmp/.WHIP_MENU_RESULT) result=$(&1 1>&2 2>&3; echo $? > /tmp/.WHIP_CHECKLIST_RESULT) G_WHIP_RETURNED_VALUE=$(echo -e "$G_WHIP_RETURNED_VALUE" | tr '\n' ' ') diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index d66fd41070..4216b472c5 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -1,8 +1,7 @@ #!/bin/bash { - #//////////////////////////////////// - # DietPi Move Arr to RAM + # DietPi Link Arr to RAM # #//////////////////////////////////// # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com @@ -10,124 +9,285 @@ #//////////////////////////////////// # # Info: - # - Moves arr program database files to RAM (/tmp) with symlink, and, back to disk + # - Moves Sonarr, Radarr and Lidarr database files to RAM, leaving symlinks on disk + # - Reduces disk I/O and enhances database I/O performance + # - Creates a backup first and automatically restores from backup on next start in case of system crash # - # Usage: - # - dietpi-arr_to_RAM 1 = Move to RAM - # - dietpi-arr_to_RAM 0 = Move to Disk - #//////////////////////////////////// - - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Arr_to_RAM' - G_INIT - G_CHECK_ROOT_USER - #Import DietPi-Globals --------------------------------------------------------------- - + USAGE=' +Usage: /DietPi/dietpi/misc/dietpi-arr_to_RAM [] +Available commands: + 1 [] Link (program) database(s) to RAM + 2 [] Update (program) database backup(s) + 0 [] Store (program) database(s) back to disk + enable Enable Link to RAM on boot + disable Disable Link to RAM on boot +Supported programs: + Apply to all supported and installed programs + sonarr Apply to Sonarr database only + radarr Apply to Radarr database only + lidarr Apply to Lidarr database only +' #//////////////////////////////////// + + # Import DietPi-Globals -------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals # Skip globals for faster execution on early boot stage + PROGRAM_NAME='DietPi-Arr_to_RAM' + # Import DietPi-Globals -------------------------------------------------------------- + + # Grab input INPUT=$1 - if [[ ! $INPUT ]]; then + INPUT_PROG=$2 - exit 1 + EXIT_CODE=0 - fi - - aFP_FILES=( + # Print output + # - In case of error, sets EXIT_CODE as well + unset error + Print(){ - 'nzbdrone.db' - 'nzbdrone.db-shm' - 'nzbdrone.db-wal' + local message=$@ + [[ $error ]] && { message="[ERROR] $message"; EXIT_CODE=$error; } + unset error + echo "$(date '+%Y-%m-%d %T') | $PROGRAM_NAME: $message" - # - Lidarr - 'lidarr.db' - 'lidarr.db-shm' - 'lidarr.db-wal' + } - ) + # Check for required root or program specific permissions permissions + # - Handling systemd service always requires root permissions + # - Database backup updates can be done as program user when defined via $2 + (( $UID )) && [[ $INPUT != 2 || $USER != $INPUT_PROG ]] && { error=1 Print 'This script must run as root user. Please use: "sudo"'; exit 1; } - aFP_PROGRAM=( + # Boot service log file + FP_LOG='/var/tmp/dietpi/logs/dietpi-arr_to_RAM.log' - 'sonarr' - 'radarr' - 'lidarr' + # Program files array + declare -A aFILES=() + # - Sonarr/Radarr: Both use the same file names + [[ ${INPUT_PROG:-sonarr} == 'sonarr' ]] && aFILES[sonarr]='nzbdrone.db nzbdrone.db-shm nzbdrone.db-wal' + [[ ${INPUT_PROG:-radarr} == 'radarr' ]] && aFILES[radarr]='nzbdrone.db nzbdrone.db-shm nzbdrone.db-wal' + # - Lidarr + [[ ${INPUT_PROG:-lidarr} == 'lidarr' ]] && aFILES[lidarr]='lidarr.db lidarr.db-shm lidarr.db-wal' - ) + # Check for valid input program + (( ${#aFILES[@]} )) || { error=1 Print "Invalid input program ($INPUT_PROG). Aborting... +$USAGE"; exit 1; } - FP_SOURCE='' - FP_TARGET='' + FP_DISK='' + FP_RAM='' - Copy_To_Ram(){ + Link_To_Ram(){ - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp $FP_SOURCE ${FP_SOURCE}.bak - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp $FP_SOURCE $FP_TARGET - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm $FP_SOURCE - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD ln -sf $FP_TARGET $FP_SOURCE + Print "Linking $FP_DISK to RAM ($FP_RAM)..." + mv $FP_DISK ${FP_DISK}.bak || { error=$? Print "Creating backup failed for $FP_DISK. Skipping this file..."; return; } + ln -s $FP_RAM $FP_DISK || EXIT_CODE=$? + # chown link in case created by root but program user wants to store back to disk + chown -h $i $FP_DISK || EXIT_CODE=$? + cp -a --no-preserve=timestamps ${FP_DISK}.bak $FP_RAM || EXIT_CODE=$? } - for i in ${!aFP_PROGRAM[@]} - do + Toggle_Link_To_Ram(){ - systemctl stop ${aFP_PROGRAM[$i]} + local start_services='' - for j in ${!aFP_FILES[@]} + for i in ${!aFILES[@]} do - FP_SOURCE="$G_FP_DIETPI_USERDATA/${aFP_PROGRAM[$i]}/${aFP_FILES[$j]}" - FP_TARGET="/tmp/${aFP_PROGRAM[$i]}/${aFP_FILES[$j]}" + FP_DISK="/mnt/dietpi_userdata/$i" + FP_RAM="/tmp/${i}_db_link" - # - Copy to RAM + backup - if (( $INPUT == 1 )); then + # Skip non-installed program + [[ -d $FP_DISK ]] || continue - if [[ ! -d /tmp/${aFP_PROGRAM[$i]} ]]; then + Print "${i^} detected" + + # Update backup + if (( $INPUT == 2 )); then + + if [[ -d $FP_RAM ]]; then + + Print "Updating ${i^} database backups..." + for j in ${aFILES[$i]} + do + + FP_RAM="/tmp/${i}_db_link/$j" + [[ -f $FP_RAM ]] || { Print "$FP_RAM not found. Skipping this file..."; continue; } + cp -a $FP_RAM $FP_DISK/$j.bak || EXIT_CODE=$? + + done + Print "Updated ${i^} database backups." + + else - G_RUN_CMD mkdir -p /tmp/${aFP_PROGRAM[$i]} + Print "${i^} database is not in RAM. Skipping this program..." fi + continue - if [[ -f $FP_TARGET ]]; then + fi - G_DIETPI-NOTIFY 2 "$FP_SOURCE already at location ($FP_TARGET)" + # If active, stop program before handling database and restart afterwards + if pgrep -f $i &> /dev/null; then - elif [[ ! -L $FP_SOURCE && -f $FP_SOURCE ]]; then + Print "Stopping ${i^} service..." + start_services+=" $i" + systemctl stop $i || { error=$? Print "Stopping ${i^} service failed. Skipping this program..."; continue; } - Copy_To_Ram + fi - # - recover + copy to RAM - elif [[ -f ${FP_SOURCE}.bak ]]; then + # Link to RAM + backup + if (( $INPUT == 1 )); then - rm $FP_SOURCE &> /dev/null + Print "Linking ${i^} database to RAM..." + # - Pre-create RAM dir + [[ -d $FP_RAM ]] || mkdir -p $FP_RAM || { error=$? Print "Pre-creating RAM directory for ${i^} failed ($FP_RAM). Skipping this program..."; continue; } + # - chown dir in case created by root but program user wants to store back to disk + chown $i $FP_RAM || EXIT_CODE=$? - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp ${FP_SOURCE}.bak $FP_SOURCE - Copy_To_Ram + for j in ${aFILES[$i]} + do - fi + FP_DISK="/mnt/dietpi_userdata/$i/$j" + FP_RAM="/tmp/${i}_db_link/$j" + local fp_target='' + + # - Source exists and is no symlink, expected situation + if [[ -f $FP_DISK && ! -L $FP_DISK ]]; then + + Link_To_Ram + + # - Link + target exists, should only happen when running the script two times in same session + elif [[ -L $FP_DISK ]] && fp_target=$(readlink -e $FP_DISK); then + + if [[ $fp_target == $FP_RAM ]]; then + + Print "$FP_DISK already linked to RAM ($FP_RAM). Skipping this file..." + + # - Failsafe: Restore file from wrong symlink, should never occur but required for this script to function + else + + Print "$FP_DISK already linked to $fp_target. Restoring original file location before linking to RAM..." + rm $FP_DISK || { error=$? Print "Removing symlink failed ($FP_DISK). Skipping this file..."; continue; } + mv $fp_target $FP_DISK || { error=$? Print "Restoring original file failed ($fp_target). Skipping this file..."; continue; } + Link_To_Ram + + fi + + # - Source does not exist or is orphaned link, should only happen after crash + elif [[ -f ${FP_DISK}.bak ]]; then + + Print "$FP_DISK not found. Recovering from backup first (${FP_DISK}.bak)..." + # - Remove possible orphaned symlink + [[ ! -L $FP_DISK ]] || rm $FP_DISK || { error=$? Print "Removing orphaned symlink failed ($FP_DISK). Skipping this file..."; continue; } + # - Recover from backup + mv ${FP_DISK}.bak $FP_DISK || { error=$? Print "Recovering file from backup failed (${FP_DISK}.bak). Skipping this file..."; continue; } + Link_To_Ram - systemctl start ${aFP_PROGRAM[$i]} + else - # - Save to disk + Print "$FP_DISK not found. Skipping this file..." + + fi + + done + + Print "Linked ${i^} database to RAM." + + # Store back to disk elif (( $INPUT == 0 )); then - if [[ ! -f $FP_TARGET ]]; then + if [[ -d $FP_RAM ]]; then - G_DIETPI-NOTIFY 2 "$FP_TARGET does not exist." + Print "Storing database from RAM ($FP_RAM) back to disk ($FP_DISK)..." + # - "-u" will only copy newer files, thus actually used by program. + # - "--remove-destination" will remove expected existing symlinks. + cp -au --remove-destination $FP_RAM/. $FP_DISK || { error=$? Print "Storing ${i^} database from RAM back to disk failed."; continue; } + rm -R $FP_RAM + Print "Stored ${i^} database from RAM back to disk." else - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm $FP_SOURCE - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp $FP_TARGET $FP_SOURCE - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm $FP_TARGET + Print "${i^} database is not in RAM. Skipping this program..." fi fi - chown -R ${aFP_PROGRAM[$i]}:dietpi $FP_TARGET $FP_SOURCE &> /dev/null - done - done + # Failsafe: When restoring to disk, "sync" now to prevent async issues! + (( $INPUT == 0 )) && sync + + # Start programs we stopped before + # - NB: Due to Before=, *arr.service waits for dietpi-arr_to_RAM.service to finish, timing it out. + # - "--no-block" allows dietpi-arr_to_RAM.service to only enqueue *arr.service starts and finish, to allow them starting afterwards. + if [[ $start_services ]]; then + + Print "Enqueuing$start_services service start(s)..." + systemctl --no-block start $start_services + + fi - unset aFP_FILES - unset aFP_PROGRAM + } + + Enable_On_Boot(){ + + cat << _EOF_ > /etc/systemd/system/dietpi-arr_to_RAM.service +[Unit] +Description=DietPi-Arr_to_RAM +Requisite=dietpi-ramdisk.service tmp.mount +After=dietpi-ramdisk.service tmp.mount +Before=dietpi-preboot.service sonarr.service radarr.service lidarr.service + +[Service] +Type=forking +RemainAfterExit=yes +ExecStart=-/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 1 2>&1 >> $FP_LOG' +ExecStop=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 0 2>&1 > $FP_LOG' + +[Install] +WantedBy=multi-user.target +_EOF_ + systemctl daemon-reload + systemctl enable dietpi-arr_to_RAM || EXIT_CODE=$? + systemctl start dietpi-arr_to_RAM || EXIT_CODE=$? + + } + + Disable_On_Boot(){ + + if [[ -f /etc/systemd/system/dietpi-arr_to_RAM.service ]]; then + + systemctl stop dietpi-arr_to_RAM || EXIT_CODE=$? + systemctl disable dietpi-arr_to_RAM || EXIT_CODE=$? + rm /etc/systemd/system/dietpi-arr_to_RAM.service || EXIT_CODE=$? + + fi + + } + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + # - Toggle Link to RAM + if [[ $INPUT == [012] ]]; then + + Toggle_Link_To_Ram + (( $EXIT_CODE )) && Print '[ERROR] An issue has occurred. Please check the above output for details.' + + # - Enable/Disable Link to RAM on boot + elif [[ $INPUT == 'enable' || $INPUT == 'disable' ]]; then + + ${INPUT^}_On_Boot + (( $EXIT_CODE )) && Print "[ERROR] An issue has occurred. Please check the log for details: $FP_LOG" + + else + + error=1 Print "Invalid input command (${INPUT:-}). Aborting... +$USAGE" + + fi + #----------------------------------------------------------------------------------- + exit $EXIT_CODE + #----------------------------------------------------------------------------------- } diff --git a/dietpi/patch_file b/dietpi/patch_file index 6a0ca35b43..69c0971128 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1717,6 +1717,20 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" done #------------------------------------------------------------------------------- + #Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + + if grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then + + G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n +With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n +This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n +Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' + + fi + + fi + #------------------------------------------------------------------------------- fi From 302b8de16577d8e9ecc57cc8435c3deae438213a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 14 Apr 2019 20:39:34 +0100 Subject: [PATCH 043/253] Up bench version, incase we need to reset current online results. --- dietpi/func/dietpi-benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 83e0a8b959..cba73f2bd5 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -72,7 +72,7 @@ # ------------------------- # DietPi-Benchmark # ------------------------- -BENCH_VERSION=1 +BENCH_VERSION=2 BENCH_HW_MODEL=$G_HW_MODEL BENCH_CPU='$BENCH_CPU' BENCH_ROOTFS_WRITE='$BENCH_ROOTFS_WRITE' From 883611919a2a81d9f6f010dd80d02284628a31fc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 14 Apr 2019 22:16:56 +0200 Subject: [PATCH 044/253] v6.23 (#2700) + DietPi-Software | WireGuard: Move sysctl settings into WireGuard PostUp config, which allows targeted settings toggle for relevant interfaces only + DietPi-Software | WireGuard: Add ip6tables forwarding rules to enable forwarding for IPv6 connections as well + DietPi-Software | WireGuard: Set sysctl IPv6 "accept_ra=2" for www interface, otherwise IPv6 interface auto-configuration is disabled by forwarding=1 which results in non-functional IPv6 requests + DietPi-Software | WireGuard: Raise WireGuard APT package priority to 100 to allow APT auto-upgrades; This is save now since all other Sid packages have priority -1 + DietPi-Software | Coding: A start for software array reordering: Align according to 8-space tab mode, which we use on GitHub and which is default for most Linux editors (nano) as well + DietPi-Pre-patch | Reapply Sid repo pins for WireGuard, this time with priority 100 to allow APT auto-upgrades for the WireGuard packages + DietPi-Patch | Fix IPv6 connections with WireGuard --- CHANGELOG.txt | 2 ++ dietpi/dietpi-software | 63 +++++++++++++++++++----------------------- dietpi/patch_file | 13 ++++++++- dietpi/pre-patch_file | 32 ++++++++++----------- 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 375bc9cd94..512bf7de57 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changes / Improvements / Optimisations: - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 +- DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 Bug Fixes: - DietPi-Config | Resolved an issue where proxy settings would not be correct after a reboot. Many thanks to @stephantual for reporting this!: https://github.com/MichaIng/DietPi/issues/2704 @@ -17,6 +18,7 @@ Bug Fixes: - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 - DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 - DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168 +- DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thats to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 443a26d287..f01a2acb75 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1963,20 +1963,20 @@ _EOF_ #------------------ software_id=171 - aSOFTWARE_WHIP_NAME[$software_id]='DietPi-NordVPN' - aSOFTWARE_WHIP_DESC[$software_id]='vpn client with connection gui' - aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p15975#p15975' + aSOFTWARE_WHIP_NAME[$software_id]='DietPi-NordVPN' + aSOFTWARE_WHIP_DESC[$software_id]='vpn client with connection gui' + aSOFTWARE_CATEGORY_INDEX[$software_id]=16 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p15975#p15975' #------------------ software_id=172 - aSOFTWARE_WHIP_NAME[$software_id]='WireGuard' - aSOFTWARE_WHIP_DESC[$software_id]='an extremely simple yet fast and modern VPN' - aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=16308#p16308' + aSOFTWARE_WHIP_NAME[$software_id]='WireGuard' + aSOFTWARE_WHIP_DESC[$software_id]='an extremely simple yet fast and modern VPN' + aSOFTWARE_CATEGORY_INDEX[$software_id]=16 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=16308#p16308' # Required to ask for public domain/IP and desired VPN server port aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1989,10 +1989,8 @@ _EOF_ done # Disable for ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # Enable RPi/x86_64/Odroids | ARMv6 disabled - if (( $G_HW_MODEL < 10 || - $G_HW_ARCH == 10 || - $G_HW_MODEL == 10 || $G_HW_MODEL == 11 || $G_HW_MODEL == 12 || $G_HW_MODEL == 14 )); then + # Enable RPi/Odroids/x86_64 | ARMv6 disabled + if (( $G_HW_MODEL < 13 || $G_HW_MODEL == 14 || $G_HW_ARCH == 10 )); then aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=1 @@ -2003,12 +2001,12 @@ _EOF_ #-------------------------------------------------------------------------------- software_id=98 - aSOFTWARE_WHIP_NAME[$software_id]='HaProxy' - aSOFTWARE_WHIP_DESC[$software_id]='high performance tcp/http load balancer' - aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' + aSOFTWARE_WHIP_NAME[$software_id]='HaProxy' + aSOFTWARE_WHIP_DESC[$software_id]='high performance tcp/http load balancer' + aSOFTWARE_CATEGORY_INDEX[$software_id]=17 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' #Home automation #-------------------------------------------------------------------------------- @@ -4903,7 +4901,7 @@ _EOF_ # - Disable sid repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568 # - Enable but set sid WireGuard package priorities low enough to install only if not available in main repo(s) echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard +Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard # RPi: Install debian-archive-keyring, currently version 2018.1 from sid branch: https://packages.debian.org/de/sid/debian-archive-keyring (( $G_HW_MODEL < 10 )) && Download_Install 'https://dietpi.com/downloads/binaries/rpi/debian-archive-keyring.deb' @@ -9998,8 +9996,7 @@ _EOF_ fi - #WireGuard - software_id=172 + software_id=172 # WireGuard if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then # Try to enable module, if it fails, a reboot is required @@ -10014,7 +10011,7 @@ _EOF_ G_WHIP_MENU_ARRAY=( 'Server' ': Use this machine as VPN server and allow clients to connect to it.' - 'Client' ': Use this machine as VPN client, e.g. to connect to a VPN service provider.' + 'Client' ': Use this machine as VPN client to connect to another VPN server or service provider.' ) @@ -10086,8 +10083,13 @@ Address = 10.9.0.1/24 PrivateKey = $( /etc/sysctl.d/dietpi-wireguard.conf - # - Start WireGuard interface via systemd unit (( $module_active )) && systemctl start wg-quick@wg0 # persistent @@ -10178,8 +10175,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo fi - #WIFIHOTSPOT - software_id=60 + software_id=60 # WiFi Hostspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -13743,11 +13739,10 @@ _EOF_ [[ -d /etc/wireguard ]] && rm -R /etc/wireguard [[ -f /etc/apt/sources.list.d/dietpi-wireguard.list ]] && rm /etc/apt/sources.list.d/dietpi-wireguard.list [[ -f /etc/apt/preferences.d/dietpi-wireguard ]] && rm /etc/apt/preferences.d/dietpi-wireguard - [[ -f /etc/sysctl.d/dietpi-wireguard.conf ]] && rm /etc/sysctl.d/dietpi-wireguard.conf fi - software_id=171 + software_id=171 # DietPi-NordVPN if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling diff --git a/dietpi/patch_file b/dietpi/patch_file index 69c0971128..22a2b45d86 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1717,9 +1717,9 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" done #------------------------------------------------------------------------------- - #Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 if grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n @@ -1728,6 +1728,17 @@ This script has gone through some rework and polishing with v6.23 and can now be Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' fi + #Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691 + if [[ -f '/etc/wireguard/wg0.conf' ]] && ! grep -q 'sysctl' /etc/wireguard/wg0.conf; then + + [[ -f '/etc/sysctl.d/dietpi-wireguard.conf' ]] && rm /etc/sysctl.d/dietpi-wireguard.conf + sed -i '/^ListenPort/a\PostUp = sysctl net.ipv4.conf.%i.forwarding=1 net.ipv4.conf.$(sed -n 3p /DietPi/dietpi/.network).forwarding=1' /etc/wireguard/wg0.conf + sed -i '/^ListenPort/a\PostUp = sysctl net.ipv6.conf.$(sed -n 3p /DietPi/dietpi/.network).accept_ra=2' /etc/wireguard/wg0.conf + sed -i '/^ListenPort/a\PostUp = sysctl net.ipv6.conf.%i.forwarding=1 net.ipv6.conf.$(sed -n 3p /DietPi/dietpi/.network).forwarding=1' /etc/wireguard/wg0.conf + sed -i '/^ListenPort/a\PostUp = ip6tables -A FORWARD -i %i -j ACCEPT; ip6tables -t nat -A POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf + sed -i '/^ListenPort/a\PostDown = ip6tables -D FORWARD -i %i -j ACCEPT; ip6tables -t nat -D POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf + + fi fi #------------------------------------------------------------------------------- diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 30f092fe95..caf17db103 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -40,14 +40,14 @@ # Main loop #/////////////////////////////////////////////////////////////////////////////// - while (( $EXIT_CODE == 0 )) + until (( $EXIT_CODE )) do #------------------------------------------------------------------------------- # Pre-patch 1: RAMlog 0 free space check due to issues with failing DietPi cron jobs in v6.11 if (( $G_DIETPI_VERSION_SUB < 12 && $(df -B1M --output=avail /var/log | sed -n 2p) < 2 )); then - echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 1 | Clearing /var/log files to free up RAMlog space (<2MB) before update will continue' + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 1 | Clearing /var/log files to free up RAMlog space (<2MB) before update will continue' /DietPi/dietpi/func/dietpi-logclear 1 || { EXIT_CODE=1; break; } fi @@ -56,30 +56,28 @@ if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf ]] && grep -qi 'buster' /etc/os-release; then - echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support' + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support' sed -i '/innodb_large_prefix/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || { EXIT_CODE=2; break; } sed -i '/innodb_file_format/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || { EXIT_CODE=2; break; } fi #------------------------------------------------------------------------------- # Pre-patch 3: https://github.com/MichaIng/DietPi/issues/2213 - # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 - if (( $G_DIETPI_VERSION_SUB < 22 )); then - - if GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc -nosalt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then - - echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security' - grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2='' - 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 || { EXIT_CODE=3; break; } + if (( $G_DIETPI_VERSION_SUB < 22 )) && + GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc -nosalt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then - fi - if [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security' + grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2='' + 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 || { EXIT_CODE=3; break; } - echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades' - echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard || { EXIT_CODE=4; break; } + fi + #------------------------------------------------------------------------------- + # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 + if (( $G_DIETPI_VERSION_SUB < 23 )) && [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then - fi + 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_CODE=4; break; } fi #------------------------------------------------------------------------------- From b7492c7908c9d4a1c0cbfc31320f90dc56769037 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 15 Apr 2019 23:31:00 +0200 Subject: [PATCH 045/253] v6.23 (#2716) + DietPi-Config | Proxy: Fine tuning + DietPi-Config | Proxy: Gracefully handle proxy settings if set up outside of DietPi script: Inform user + DietPi-Config | Proxy: Stop using $CONFIG_PROXY_ENABLED since it has no practical use. Current state is estimated based on /etc/bashrc.d/dietpi-proxy.sh existence only. Keep other dietpi.txt settings to have them preserved when user toggles proxy. + DietPi-Config | Network Adapters: Show current settings states inside menu to reduce doubled info/overhead and for consistency with other menus + DietPi-Config | Minor coding and wording + dietpi.txt | Remove obsolete $CONFIG_PROXY_ENABLED + dietpi.txt | Minor wording + DietPi-Patch | Patch proxy settings changes + CHANGELOG | DietPi-Config Network Adapters and Proxy menu rework --- CHANGELOG.txt | 1 + dietpi.txt | 11 ++- dietpi/dietpi-config | 160 +++++++++++++++++++++++-------------------- dietpi/patch_file | 15 +++- 4 files changed, 105 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 512bf7de57..81fa907525 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. +- DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 diff --git a/dietpi.txt b/dietpi.txt index 9d4d78b3f6..c259e2aa69 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -7,17 +7,17 @@ #------------------------------------------------------------------------------------------------------ # D I E T - P I -# DietPi-Automation settings, applied on the 1st boot of DietPi, ONCE +# DietPi-Automation settings, applied on 1st boot of DietPi only, ONCE! #------------------------------------------------------------------------------------------------------ ##### Networking Options ##### -# If both Ethernet and Wifi are enabled, Wifi will take priority and Ethernet will be disabled. +# If both Ethernet and WiFi are enabled, WiFi will take priority and Ethernet will be disabled. # 1=enabled AUTO_SETUP_NET_ETHERNET_ENABLED=1 AUTO_SETUP_NET_WIFI_ENABLED=0 -# If using WiFi, please edit the following to pre-enter creds /boot/dietpi-wifi.txt +# If using WiFi, please edit dietpi-wifi.txt to pre-enter credentials. # Enter your Static Network details below, if applicable. AUTO_SETUP_NET_USESTATIC=0 @@ -153,9 +153,8 @@ CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 #sampling rate * down factor / 1000 = Milliseconds (40 = 1000ms when sampling rate is 25000) CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 -#Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply. -# NB: Do not modify, you must use dietpi-config to configure/set options -CONFIG_PROXY_ENABLED=0 +#Proxy settings | System-wide proxy settings +# NB: Do not modify, you must use dietpi-config > "Networking Options: Adapters" to apply CONFIG_PROXY_ADDRESS=MyProxyServer.com CONFIG_PROXY_PORT=8080 CONFIG_PROXY_USERNAME= diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index d7cde13136..d3e1dde9c4 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2814,13 +2814,9 @@ _EOF_ # TARGETMENUID=8 Menu_NetworkAdapters(){ - TARGETMENUID=0 - # Check Network Network_GetData - G_WHIP_MENU_ARRAY=() - # Obtain enabled/disabled status local eth_disabled_text='[On]' (( $ETH_DISABLED )) && eth_disabled_text='[Off]' @@ -2842,39 +2838,38 @@ _EOF_ local wlan_connected_text='Disconnected' if (( $WIFI_CONNECTED )); then - wlan_connected_text='Connected' - (( $WIFI_HOTSPOT )) && wlan_connected_text='WiFi Hotspot Mode' + (( $WIFI_HOTSPOT )) && wlan_connected_text='WiFi Hotspot Mode' || wlan_connected_text='Connected' fi # Internet Connection Status - local Internet_connected_text='Please run Internet Test' + local Internet_connected_text='Run internet connection test' if (( $INTERNET_TEST_STATE == 2 )); then - Internet_connected_text='[On]' + Internet_connected_text='[Success] | Online' elif (( $INTERNET_TEST_STATE == 1 )); then - Internet_connected_text='[Fail] | Offline' + Internet_connected_text='[Failure] | Offine' fi - # Proxy settings (global vars, force an int to obtain current values stored in dietpi.txt) + # Proxy settings: Scrapes $http_proxy, otherwise obtains current values stored in dietpi.txt Load_Proxy_Vars - local proxy_state_text='[Disabled]' - (( $PROXY_ENABLED )) && proxy_state_text="[Enabled] | $PROXY_ADDRESS:$PROXY_PORT" + local proxy_state_text='[Off]' + (( $PROXY_ENABLED )) && proxy_state_text="[On] | $PROXY_ADDRESS:$PROXY_PORT" - G_WHIP_MENU_ARRAY+=('' '●─ Adapter Options ') - G_WHIP_MENU_ARRAY+=('Ethernet' ': Change Wired Network Settings') - G_WHIP_MENU_ARRAY+=('WiFi' ': Change Wireless Network Settings') + G_WHIP_MENU_ARRAY=('' '●─ Adapter Options ') + G_WHIP_MENU_ARRAY+=('Ethernet' ": $eth_hardware_text | $eth_disabled_text | $eth_connected_text") + G_WHIP_MENU_ARRAY+=('WiFi' ": $wlan_hardware_text | $wlan_disabled_text | $wlan_connected_text") # - Onboard WiFi - local onboard_wifi_enabled=1 - # RPi 3/ZeroW + # RPi 3/Zero W if (( $HW_ONBOARD_WIFI )); then - if [[ -f /etc/modprobe.d/disable_wifi_rpi3_onboard.conf ]]; then + local onboard_wifi_enabled=1 + if [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]]; then onboard_wifi_enabled=0 G_WHIP_MENU_ARRAY+=('Onboard WiFi' ': [Off]') @@ -2891,7 +2886,7 @@ _EOF_ # IPv6 local ipv6_status_text='[WARNING] Not supported or disabled on kernel level!' - if [[ -d /proc/sys/net/ipv6 ]]; then + if [[ -d '/proc/sys/net/ipv6' ]]; then local ipv6_enabled=0 ipv6_status_text='[Off]' @@ -2907,12 +2902,10 @@ _EOF_ local ipv4_preferred=0 local ipv4_status_text='[Off]' - local ipv4_status_long='\nIPv4 : Not preferred over IPv6 with APT and wget' if [[ -f /etc/apt/apt.conf.d/99-dietpi-force-ipv4 ]]; then ipv4_preferred=1 ipv4_status_text='[On]' - ipv4_status_long='\nIPv4 : Preferred over IPv6 with APT and wget' fi G_WHIP_MENU_ARRAY+=('Prefer IPv4' ": $ipv4_status_text") @@ -2921,13 +2914,10 @@ _EOF_ fi - G_WHIP_MENU_ARRAY+=('Test' ': Run the internet connection test') - G_WHIP_MENU_ARRAY+=('Proxy' ': Configure proxy settings') + G_WHIP_MENU_ARRAY+=('Proxy' ": $proxy_state_text") + G_WHIP_MENU_ARRAY+=('Test' ": $Internet_connected_text") - G_WHIP_MENU "Ethernet : $eth_hardware_text | $eth_disabled_text | $eth_connected_text \nWifi : $wlan_hardware_text | $wlan_disabled_text | $wlan_connected_text\nIPv6 : $ipv6_status_text$ipv4_status_long\nInternet : $Internet_connected_text\nProxy : $proxy_state_text" - if (( $? == 0 )); then - - TARGETMENUID=8 # Return to this menu + if G_WHIP_MENU 'Please select an option to change:'; then case "$G_WHIP_RETURNED_VALUE" in @@ -2949,12 +2939,10 @@ _EOF_ 'IPv6') - # Disable if (( $ipv6_enabled )); then /DietPi/dietpi/func/dietpi-set_hardware enableipv6 0 - # Enable else /DietPi/dietpi/func/dietpi-set_hardware enableipv6 1 @@ -2965,12 +2953,10 @@ _EOF_ 'Prefer IPv4') - # Don't prefer if (( $ipv4_preferred )); then /DietPi/dietpi/func/dietpi-set_hardware preferipv4 0 - # Prefer else /DietPi/dietpi/func/dietpi-set_hardware preferipv4 1 @@ -2984,13 +2970,13 @@ _EOF_ # No hardware found if (( ! $ETH_HARDWARE )); then - G_WHIP_MSG 'No Ethernet Hardware was found. You are most likely running a Pi Model A.' + G_WHIP_MSG 'No Ethernet hardware was detected on your device.' # Disabled elif (( $ETH_DISABLED )); then - G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed.\n\nWould you like to enable Ethernet now?\n - (NOTICE) Connections may drop!' - if (( $? == 0 )); 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 ETH_DISABLED=0 Network_ApplyChanges @@ -3008,11 +2994,11 @@ _EOF_ 'WiFi') - # Disabled | Offer chance to enable (also enables wifi modules) + # Disabled | Offer chance to enable (also enables WiFi modules) if (( $WIFI_DISABLED )); then - G_WHIP_YESNO 'WiFi must be enabled before settings can be changed.\n\nWould you like to enable WiFi now? \n - (NOTICE) Connections may drop!' - if (( $? == 0 )); then + if G_WHIP_YESNO 'WiFi must be enabled before settings can be changed.\n +Would you like to enable WiFi now? \n - (NOTICE) Connections may drop!'; then WIFI_DISABLED=0 Network_ApplyChanges @@ -3022,8 +3008,8 @@ _EOF_ # No hardware found elif (( ! $WIFI_HARDWARE )); then - G_WHIP_YESNO 'No supported Wifi Hardware was found.\n\nWould you like to disable WiFi? \n - (NOTICE) Connections may drop!' - if (( $? == 0 )); then + if G_WHIP_YESNO 'No supported WiFi hardware was found.\n +Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then WIFI_DISABLED=1 Network_ApplyChanges @@ -3041,7 +3027,7 @@ _EOF_ 'Test') G_WHIP_DEFAULT_ITEM=$INTERNET_TEST_URL - if G_WHIP_INPUTBOX 'Press enter a URL address to test (eg: http://google.com)'; then + if G_WHIP_INPUTBOX 'Please enter a URL address to test (eg: https://dietpi.com)'; then INTERNET_TEST_URL=$G_WHIP_RETURNED_VALUE @@ -3072,6 +3058,8 @@ _EOF_ # Cancel else + TARGETMENUID=0 # Return to main menu + # Exit DietPi-Config on back to previous menu? if (( $EXITONBACK == 1 )); then @@ -4574,23 +4562,51 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s # So we can call this in other menus (eg: submenu of this) Load_Proxy_Vars(){ - PROXY_ENABLED=$(grep -ci -m1 'export {http,https,ftp}_proxy' /etc/bash.bashrc) - PROXY_ADDRESS=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ADDRESS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - PROXY_PORT=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PORT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - PROXY_USERNAME=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_USERNAME=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - PROXY_PASSWORD=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + if [[ -f '/etc/bashrc.d/dietpi-proxy.sh' ]]; then + + PROXY_ENABLED=1 + . /etc/bashrc.d/dietpi-proxy.sh + + else + + PROXY_ENABLED=0 + # Inform user if DietPi proxy state does not match variable existence + # - This occurs either because of missing reboot/login after exiting script before, or, proxy was set up outside of DietPi scripts + # - Prompt only when inside/entering proxy settings + [[ $http_proxy && $TARGETMENUID == 17 ]] && G_WHIP_MSG 'Either a proxy was set up outside of DietPi scripts or you need to reload you current login session (logout+login or reboot) for changes to take effect.' + + fi + + if [[ $http_proxy ]]; then + + PROXY_ADDRESS=${http_proxy#*//}; PROXY_ADDRESS=${PROXY_ADDRESS%:*} + PROXY_PORT=${http_proxy##*:} + if [[ $http_proxy == *@* ]]; then + + PROXY_ADDRESS=${PROXY_ADDRESS#*@} + PROXY_USERNAME=${http_proxy#*//}; PROXY_USERNAME=${PROXY_USERNAME%%:*} + PROXY_PASSWORD=${http_proxy%%@*}; PROXY_PASSWORD=${PROXY_PASSWORD##*:} + + fi + + else + + [[ $PROXY_ADDRESS ]] || PROXY_ADDRESS=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ADDRESS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + [[ $PROXY_PORT ]] || PROXY_PORT=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PORT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + [[ $PROXY_USERNAME ]] || PROXY_USERNAME=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_USERNAME=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + [[ $PROXY_PASSWORD ]] || PROXY_PASSWORD=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + + fi } # TARGETMENUID=17 Menu_NetworkAdapters_Proxy(){ - TARGETMENUID=8 - Load_Proxy_Vars - local proxy_state_text='[Disabled]' - (( $PROXY_ENABLED )) && proxy_state_text='[Enabled]' + local proxy_state_text='[Off]' + (( $PROXY_ENABLED )) && proxy_state_text='[On]' G_WHIP_MENU_ARRAY=( @@ -4602,82 +4618,78 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s ) - G_WHIP_MENU "Please select an option to change:" - if (( $? == 0 )); then - - TARGETMENUID=17 # Return to this menu + if G_WHIP_MENU 'Please select an option to change:'; then case "$G_WHIP_RETURNED_VALUE" in 'State') - ((PROXY_ENABLED++)) - (( $PROXY_ENABLED > 1 )) && PROXY_ENABLED=0 + (( $PROXY_ENABLED )) && PROXY_ENABLED=0 || PROXY_ENABLED=1 ;; 'Address') G_WHIP_DEFAULT_ITEM=$PROXY_ADDRESS - G_WHIP_INPUTBOX 'Please enter the proxy URL or IP address\n - eg: MyProxy.com' - (( $? == 0 )) && PROXY_ADDRESS=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter the proxy URL or IP address\n - eg: MyProxy.com' && PROXY_ADDRESS=$G_WHIP_RETURNED_VALUE + G_CONFIG_INJECT 'CONFIG_PROXY_ADDRESS=' "CONFIG_PROXY_ADDRESS=$PROXY_ADDRESS" /DietPi/dietpi.txt ;; 'Port') G_WHIP_DEFAULT_ITEM=$PROXY_PORT - G_WHIP_INPUTBOX 'Please enter the proxy port number\n - eg: 1234' - (( $? == 0 )) && PROXY_PORT=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter the proxy port number\n - eg: 1234' && PROXY_PORT=$G_WHIP_RETURNED_VALUE + G_CONFIG_INJECT 'CONFIG_PROXY_PORT=' "CONFIG_PROXY_PORT=$PROXY_PORT" /DietPi/dietpi.txt ;; 'Username') G_WHIP_DEFAULT_ITEM=$PROXY_USERNAME - G_WHIP_INPUTBOX 'Please enter the proxy username\n - eg: JoeBloggs\n - Leave blank if not required' - (( $? == 0 )) && PROXY_USERNAME=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter the proxy username\n - eg: JoeBloggs\n - Leave blank if not required' && PROXY_USERNAME=$G_WHIP_RETURNED_VALUE + G_CONFIG_INJECT 'CONFIG_PROXY_USERNAME=' "CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /DietPi/dietpi.txt ;; 'Password') G_WHIP_DEFAULT_ITEM=$PROXY_PASSWORD - G_WHIP_INPUTBOX 'Please enter the proxy password\n - eg: LetMeIn\n - Leave blank if not required' - (( $? == 0 )) && PROXY_PASSWORD=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter the proxy password\n - eg: LetMeIn\n - Leave blank if not required' && PROXY_PASSWORD=$G_WHIP_RETURNED_VALUE + G_CONFIG_INJECT 'CONFIG_PROXY_PASSWORD=' "CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /DietPi/dietpi.txt ;; esac - G_CONFIG_INJECT 'CONFIG_PROXY_ENABLED=' "CONFIG_PROXY_ENABLED=$PROXY_ENABLED" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_ADDRESS=' "CONFIG_PROXY_ADDRESS=$PROXY_ADDRESS" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_PORT=' "CONFIG_PROXY_PORT=$PROXY_PORT" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_USERNAME=' "CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /DietPi/dietpi.txt - G_CONFIG_INJECT 'CONFIG_PROXY_PASSWORD=' "CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /DietPi/dietpi.txt - - export {http,https,ftp}_proxy='' - sed -i '/export {http,https,ftp}_proxy=/d' /etc/bash.bashrc - # - Add export settings if (( $PROXY_ENABLED )); then if [[ $PROXY_USERNAME && $PROXY_PASSWORD ]]; then - cat << _EOF_ >> /etc/bash.bashrc + cat << _EOF_ > /etc/bashrc.d/dietpi-proxy.sh export {http,https,ftp}_proxy="http://$PROXY_USERNAME:$PROXY_PASSWORD@$PROXY_ADDRESS:$PROXY_PORT" _EOF_ else - cat << _EOF_ >> /etc/bash.bashrc + cat << _EOF_ > /etc/bashrc.d/dietpi-proxy.sh export {http,https,ftp}_proxy="http://$PROXY_ADDRESS:$PROXY_PORT" _EOF_ fi + else + + [[ -f '/etc/bashrc.d/dietpi-proxy.sh' ]] && rm /etc/bashrc.d/dietpi-proxy.sh + unset {http,https,ftp}_proxy # Has no effect on current login session but for this script, e.g. connection test + fi REBOOT_REQUIRED=1 + else + + TARGETMENUID=8 # Return to Network Adapters menu + fi } diff --git a/dietpi/patch_file b/dietpi/patch_file index 22a2b45d86..9a16f4a92d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1717,9 +1717,19 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" done #------------------------------------------------------------------------------- + # Patch proxy settings changes: https://github.com/MichaIng/DietPi/pull/2716 + sed -i '/^[[:blank:]]*CONFIG_PROXY_ENABLED=/d' /DietPi/dietpi.txt + local proxy='' + if proxy=$(grep '^[[:blank:]]*export {http,https,ftp}_proxy=' /etc/bash.bashrc); then + + [[ -f '/etc/bashrc.d/dietpi-proxy.sh' ]] || echo "$proxy" > /etc/bashrc.d/dietpi-proxy.sh + sed -i '/^[[:blank:]]*export {http,https,ftp}_proxy=/d' /etc/bash.bashrc + + fi + #------------------------------------------------------------------------------- if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - #Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 + # Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 if grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n @@ -1728,7 +1738,8 @@ This script has gone through some rework and polishing with v6.23 and can now be Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' fi - #Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691 + #----------------------------------------------------------------------- + # Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691 if [[ -f '/etc/wireguard/wg0.conf' ]] && ! grep -q 'sysctl' /etc/wireguard/wg0.conf; then [[ -f '/etc/sysctl.d/dietpi-wireguard.conf' ]] && rm /etc/sysctl.d/dietpi-wireguard.conf From f139ad13f70de9d8ee0bf33a626c9d3678890bc8 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 16 Apr 2019 04:57:47 +0200 Subject: [PATCH 046/253] v6.23 (#2705) + DietPi-Software | Subsonic: Failsafe FFmpeg transcoder symlink creation, similar how we did with Airsonic + DietPi-Software | Subsonic: Now runs as limited user "subsonic" + DietPi-Patch | Reinstall Subsonic to apply "subsonic" user and transcoder fix + DietPi-Patch | Prevent initial stops and final start of services during DietPi-Software reinstalls. This new variable needs to implemented into DietPi-Software and in case other scripts, where applicable + DietPi-Software | Skip initial stop and final start of services, if $G_SERVICE_CONTROL == 0 was exported. Currently this is done by patch_file (DietPi-Update) which already has services stopped and starts or reboots after finish. Skip DietPi-Survey call for the same reason. + DietPi-Software | Visual-only syntax fix + DietPi-Software | Minor coding and wording --- CHANGELOG.txt | 2 + dietpi/dietpi-software | 148 +++++++++++++++++++---------------------- dietpi/patch_file | 11 ++- 3 files changed, 81 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 81fa907525..1c72e9feab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 +- DietPi-Software | Subsonic: Runs now as limited user "subsonic". This change is as well applied to existing installs via patch during DietPi-Update: https://github.com/MichaIng/DietPi/pull/2705 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 Bug Fixes: @@ -20,6 +21,7 @@ Bug Fixes: - DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755 - DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168 - DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thats to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691 +- DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f01a2acb75..129aa09244 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -579,14 +579,14 @@ _EOF_ #------------------ software_id=34 - aSOFTWARE_WHIP_NAME[$software_id]='Subsonic' - aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=213#p213' + aSOFTWARE_WHIP_NAME[$software_id]='Subsonic' + aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=213#p213' #------------------ software_id=35 @@ -1154,13 +1154,13 @@ _EOF_ #-------------------------------------------------------------------------------- software_id=108 - aSOFTWARE_WHIP_NAME[$software_id]='AmiBerry' - aSOFTWARE_WHIP_DESC[$software_id]='amiga emulator' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='AmiBerry' + aSOFTWARE_WHIP_DESC[$software_id]='amiga emulator' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -4305,7 +4305,7 @@ _EOF_ Banner_Installing - #G_AGI lame # Conflicts with our ffmpeg package: https://github.com/MichaIng/DietPi/issues/946#issuecomment-300738228 + #DEPS_LIST='lame' # Conflicts with our ffmpeg package: https://github.com/MichaIng/DietPi/issues/946#issuecomment-300738228 Download_Install 'https://dietpi.com/downloads/binaries/all/subsonic.deb' fi @@ -5281,8 +5281,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #MINEOS - software_id=53 + software_id=53 # MineOS if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6722,7 +6721,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - #RPi + OpenMAX HW Encoding: https://github.com/MichaIng/DietPi/issues/869 + # RPi + OpenMAX HW Encoding: https://github.com/MichaIng/DietPi/issues/869 if (( $G_HW_MODEL < 10 )); then Download_Install 'https://dietpi.com/downloads/binaries/rpi/ffmpeg_rpi.7z' ffmpeg_rpi @@ -6730,7 +6729,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix dpkg -i ffmpeg_rpi/*.deb rm -R ffmpeg_rpi - #Everything else + # Everything else else G_AGI ffmpeg @@ -9238,7 +9237,7 @@ Do you want to enable the Pi-hole blocking page?'; then getent passwd airsonic &> /dev/null && usercmd='usermod' $usercmd airsonic -G dietpi,audio -d $G_FP_DIETPI_USERDATA/airsonic -s /usr/sbin/nologin - #Optimize memory limit + # Optimize memory limit local airsonic_memory_max=$(( $RAM_TOTAL / 5 )) (( $airsonic_memory_max < 200 )) && airsonic_memory_max=200 airsonic_memory_max+='m' @@ -9258,10 +9257,10 @@ ExecStart=$(command -v java) -Xmx$airsonic_memory_max -Dairsonic.home=$G_FP_DIET WantedBy=multi-user.target _EOF_ - #Symlink FFmpeg to Airsonic transcoder - ln -sf $(command -v ffmpeg) $G_FP_DIETPI_USERDATA/airsonic/transcode + # Symlink FFmpeg to Airsonic transcoder + command -v ffmpeg &> /dev/null && ln -sf $(command -v ffmpeg) $G_FP_DIETPI_USERDATA/airsonic/transcode - #Grab our test media for user + # Grab our test media for user Download_Test_Media fi @@ -9271,48 +9270,45 @@ _EOF_ Banner_Configuration - #Optimize memory limit - local subsonic_memory_max=$(( $RAM_TOTAL / 5 )) - if (( $subsonic_memory_max < 200 )); then - - subsonic_memory_max=200 + local usercmd='useradd -rM' + getent passwd subsonic &> /dev/null && usercmd='usermod' + $usercmd subsonic -G dietpi,audio -d /var/subsonic -s /usr/sbin/nologin - fi + # Optimize memory limit + local subsonic_memory_max=$(( $RAM_TOTAL / 5 )) + (( $subsonic_memory_max < 200 )) && subsonic_memory_max=200 - cat << _EOF_ > /etc/default/subsonic -SUBSONIC_USER=root -SUBSONIC_ARGS='--quiet --pidfile=/run/subsonic.pid --max-memory=$subsonic_memory_max --default-music-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-podcast-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-playlist-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC' -_EOF_ + 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=$subsonic_memory_max --default-music-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-podcast-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-playlist-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC'" /etc/default/subsonic - #Symlink FFmpeg to Subsonic transcoder - ln -fs $(command -v ffmpeg) /var/subsonic/transcode + # Symlink FFmpeg to Subsonic transcoder + mkdir -p /var/subsonic/transcode + command -v ffmpeg &> /dev/null && ln -sf $(command -v ffmpeg) /var/subsonic/transcode - #Grab our test media for user + # Grab our test media for user Download_Test_Media fi - #WEBIOPI - software_id=71 + software_id=71 # WEBIOPI if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #auto start + # autostart update-rc.d webiopi defaults fi - #DIETPICLOUDSHELL - software_id=62 + software_id=62 # DietPi-CloudShell if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Enable DietPi-Cloudshell autostart + # Enable DietPi-Cloudshell autostart /DietPi/dietpi/dietpi-autostart 5 - #Service + # Service cat << _EOF_ > /etc/systemd/system/dietpi-cloudshell.service [Unit] Description=dietpi-cloudshell on main screen (DietPi) @@ -10725,18 +10721,17 @@ _EOF_ fi - #MINEOS - software_id=53 + software_id=53 # MineOS if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Add underprivilged user for web access | no longer works, could be a nodejs v8 issue? + # Add underprivilged user for web access | no longer works, could be a nodejs v8 issue? useradd mineos echo -e "$GLOBAL_PW\n$GLOBAL_PW\n" | passwd mineos - #Stop mineos from running while we config it. When we didnt do this, the program would constantly overwrite our symlink from (/var/games/minecraft). - /DietPi/dietpi/dietpi-services stop + # Stop mineos from running while we config it. When we didnt do this, the program would constantly overwrite our symlink from (/var/games/minecraft). + #/DietPi/dietpi/dietpi-services stop # Already done after install step now killall -w supervisord &> /dev/null killall -w node &> /dev/null killall -w nodejs &> /dev/null @@ -13556,6 +13551,7 @@ _EOF_ Banner_Uninstalling G_AGP subsonic + getent passwd subsonic &> /dev/null && userdel -rf subsonic [[ -d /var/subsonic ]] && rm -R /var/subsonic fi @@ -14811,7 +14807,7 @@ _EOF_ # Unmask all services: https://github.com/MichaIng/DietPi/issues/1320 DISABLE_SERVICES_START=1 /DietPi/dietpi/dietpi-services unmask all # Stop services - /DietPi/dietpi/dietpi-services stop + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services stop #------------------------------------------------------------ #Generate userdata folders: Create_UserContent_Folders @@ -15062,14 +15058,14 @@ _EOF_ else # - Uninstall | Stop services prior - [[ $1 == 'uninstall' ]] && /DietPi/dietpi/dietpi-services stop + [[ $1 == 'uninstall' && $G_SERVICE_CONTROL != 0 ]] && /DietPi/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 + if disable_error=1 G_CHECK_VALIDINT $i 0 && disable_error=1 G_CHECK_VALIDINT ${aSOFTWARE_INSTALL_STATE[$i]}; then if [[ $1 == 'uninstall' ]]; then @@ -15144,22 +15140,18 @@ _EOF_ # - Reinstall, prompt for backup if [[ $1 == 'reinstall' ]]; then - if (( $GOSTARTINSTALL )); then - - G_PROMPT_BACKUP - - fi + (( $GOSTARTINSTALL )) && G_PROMPT_BACKUP # - Uninstall | Finish up and clear non-required packages elif [[ $1 == 'uninstall' ]]; then Uninstall_Software - #Save + # - Save Write_InstallFileList # - Start services - /DietPi/dietpi/dietpi-services start + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services start fi @@ -16195,12 +16187,11 @@ When you select any software for install that requires a webserver, DietPi will fi done + [[ $G_SERVICE_CONTROL == 0 ]] || string_output+='\nNB: Software services will be temporarily controlled (stopped) by DietPi during this process. Please inform connected users, before continuing. SSH is not affected.' #Confirm Software install if G_WHIP_YESNO "DietPi is now ready to install your software choices: $string_output\n -Software details, usernames, passwords etc:\n - https://dietpi.com/software\n -NB: Software services will be temporarily controlled (stopped) by DietPi during this process. Please inform connected users, before continuing. SSH is not affected.\n -Would you like to begin?"; then +Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nWould you like to begin?"; then #exit menu system TARGETMENUID=-1 @@ -16329,14 +16320,14 @@ NB: You can use dietpi-software at a later date, to install optimized software f UNINSTALL_REQUIRED=1 done + [[ $G_SERVICE_CONTROL == 0 ]] || output_string+='\nNB: Software services will be temporarily controlled (stopped) by DietPi during this process. Please inform connected users, before continuing. SSH is not affected.' if (( $UNINSTALL_REQUIRED )); then - G_WHIP_YESNO "$output_string \n\nNB: Software services will be temporarily controlled (stopped) by DietPi during this process. Please inform connected users, before continuing. SSH is not affected.\n\nDo you wish to continue?" - if (( $? == 0 )); then + if G_WHIP_YESNO "$output_string\n\nDo you wish to continue?"; then - # - stop services - /DietPi/dietpi/dietpi-services stop + # - Stop services + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services stop # - Run uninstall for i in ${G_WHIP_RETURNED_VALUE[@]} @@ -16347,11 +16338,11 @@ NB: You can use dietpi-software at a later date, to install optimized software f done Uninstall_Software - #Save + # - Save Write_InstallFileList - # - start services - /DietPi/dietpi/dietpi-services start + # - Start services + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services start G_WHIP_MSG 'Uninstall completed.' @@ -16437,13 +16428,13 @@ NB: You can use dietpi-software at a later date, to install optimized software f #Init software arrays Software_Arrays_Init #-------------------------------------------------------------------------------------- - #load .installed file, update vars, if it exists + #Load .installed file, update vars, if it exists Read_InstallFileList #-------------------------------------------------------------------------------------- #Update GLOBAL_PW Update_Global_Pw #-------------------------------------------------------------------------------------- - # - CLi input mode + # - CLI input mode if [[ $1 ]]; then # - Run input mode @@ -16474,12 +16465,12 @@ NB: You can use dietpi-software at a later date, to install optimized software f fi # - Disable serial? - # must be enabled for the following: + # Must be enabled for the following: # XU4: https://github.com/MichaIng/DietPi/issues/2038#issuecomment-416089875 # RockPro64: Fails to boot into kernel without serial enabled # NanoPi Neo Air: Required for end users/debugging/setting up WiFi without automation - if (( $(grep -m1 '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=' /DietPi/dietpi.txt | sed 's/^.*=//') == 1 && - $G_HW_MODEL != 11 && $G_HW_MODEL != 42 && $G_HW_MODEL != 64 )); then + if grep -q '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=1' /DietPi/dietpi.txt && + (( $G_HW_MODEL != 11 && $G_HW_MODEL != 42 && $G_HW_MODEL != 64 )); then if G_WHIP_YESNO 'Serial console is currently enabled, would you like to disable it?\n - Disabling serial console will reduce memory consumption slightly\n - If you are unsure on what serial console is, it is safe to disable it'; then @@ -16537,9 +16528,9 @@ NB: You can use dietpi-software at a later date, to install optimized software f # Unmask systemd-logind if set in dietpi.txt / libpam-systemd was installed / Kodi if [[ $(readlink /etc/systemd/system/systemd-logind.service) == '/dev/null' ]] && - ( grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /DietPi/dietpi.txt || + { grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /DietPi/dietpi.txt || dpkg-query -s 'libpam-systemd' &> /dev/null || - (( ${aSOFTWARE_INSTALL_STATE[31]} > 0 )) ); then + (( ${aSOFTWARE_INSTALL_STATE[31]} > 0 )); }; then G_RUN_CMD systemctl unmask systemd-logind # systemd-logind is currently a static unit, but to be failsafe: @@ -16549,14 +16540,15 @@ NB: You can use dietpi-software at a later date, to install optimized software f fi # Upload DietPi-Survey Data, if opted in, prompt user choice, if no settings file exists - /DietPi/dietpi/dietpi-survey 1 + # - Skip, if G_SERVICE_CONTROL == 0, which is exported by patch_file (DietPi-Update) which sends survey already + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-survey 1 G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installation completed' if (( $DISABLE_REBOOT )); then # - Start services (restart to reload webserver configs) - /DietPi/dietpi/dietpi-services restart + [[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services restart else diff --git a/dietpi/patch_file b/dietpi/patch_file index 9a16f4a92d..8238011936 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -29,6 +29,9 @@ # Prevent backup prompts during patching e.g. from DietPi-Software reinstalls export G_PROMPT_BACKUP_DISABLED=1 + # Prevent initial and final service crontrol during DietPi-Software reinstalls + export G_SERVICE_CONTROL=0 + # Export subversion, required for pre-v6.14 export G_DIETPI_VERSION_SUB=$INPUT @@ -547,12 +550,12 @@ _EOF_ #Reinstalls # RPi (apply to all) LXDE missing icons under pcmanfm reinstall: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173 # v6.12 AirSonic - # SubSonic + # v6.23 SubSonic # Cava # CloudPrint # TightVNC/VNC4/RealVNC: https://github.com/MichaIng/DietPi/pull/1798#issuecomment-392594878 # v6.19 Xserver: https://github.com/MichaIng/DietPi/issues/1823 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 23 27 28 34 119 120 137 + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 23 27 28 119 120 137 #------------------------------------------------------------------------------- #Initially allow non-root users to obtain network details as well: https://github.com/MichaIng/DietPi/commit/15c0d495c33d3091e219c87bb2d09a22f8d27e9c chmod -f 666 /{DietPi,boot}/dietpi/.network @@ -1750,6 +1753,10 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' sed -i '/^ListenPort/a\PostDown = ip6tables -D FORWARD -i %i -j ACCEPT; ip6tables -t nat -D POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf fi + #Reinstalls + # Subsonic: https://github.com/MichaIng/DietPi/pull/2705 + [[ -L '/var/subsonic/transcode' ]] && rm /var/subsonic/transcode + /DietPi/dietpi/dietpi-software reinstall 34 fi #------------------------------------------------------------------------------- From 91e394920459adf01537a7d526e55af294544083 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 12:39:43 +0100 Subject: [PATCH 047/253] List available software ID's. --- dietpi/dietpi-software | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 129aa09244..460d240e28 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3068,10 +3068,10 @@ _EOF_ # Download_Install 'https://file.com/file' /etc/install_here # dps_index=$software_id Download_Install 'conf_0' /etc/conf.conf # Optional input variables: - # fallback_url='http...' = URL to use if e.g. grabbing URL from api.github.com fails: https://dietpi.com/phpbb/viewtopic.php?p=17390#p17390 + # fallback_url='http...' = URL to use if e.g. grabbing URL from api.github.com fails: https://dietpi.com/phpbb/viewtopic.php?p=17390#p17390 # no_check_url=[01] = Optionally disable URL check # dps_index=$software_id = Download from DietPi GitHub repo based on software ID/index - # DEPS_LIST='pkg1 ...' = Install APT dependency packages + # DEPS_LIST='pkg1 ...' = Install APT dependency packages # NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) Download_Install(){ @@ -15160,7 +15160,7 @@ _EOF_ #List unique software names and ID's elif [[ $1 == 'list' ]]; then - for i in ${!aSOFTWARE_INSTALL_STATE[@]} + for (( i=0; i<${#aSOFTWARE_INSTALL_STATE[@]}; i++)) do local string='' @@ -15169,6 +15169,10 @@ _EOF_ string="\e[32mID $i | " + elif [[ ! ${aSOFTWARE_WHIP_NAME[$i]} ]]; then + + string="\e[91mID $i | DEV USE: AVAILABLE SOFTWARE ID $i" + else string="\e[0mID $i | " From 697e33217bc5850841373f6f59eafc1abbd42bf7 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 12:51:57 +0100 Subject: [PATCH 048/253] LXQt + GIMP --- dietpi/dietpi-software | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 460d240e28..5f521dcb78 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -387,6 +387,17 @@ _EOF_ aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + #------------------ + software_id=173 + + aSOFTWARE_WHIP_NAME[$software_id]='LXQt' + aSOFTWARE_WHIP_DESC[$software_id]='Lightweight desktop' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxxxxxx' + #------------------ software_id=24 @@ -434,6 +445,16 @@ _EOF_ # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + #------------------ + software_id=174 + + aSOFTWARE_WHIP_NAME[$software_id]='GIMP' + aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + #Remote Desktops #-------------------------------------------------------------------------------- software_id=27 @@ -3228,6 +3249,20 @@ _EOF_ fi + #Desktop LXQt + software_id=173 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + # - For desktop entries/icons hosted on dietpi.com + #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + #G_CHECK_URL "$INSTALL_URL_ADDRESS" + + G_AGI lxqt qterminal + + fi + #Desktop MATE software_id=24 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -3270,6 +3305,16 @@ _EOF_ fi + #GIMP + software_id=174 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + G_AGI gimp + + fi + #XRDP software_id=29 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -7190,6 +7235,15 @@ _EOF_ fi + #Desktop LXQt + software_id=173 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Configuration + Create_Desktop_Shared_Items + + fi + #Desktop GNUStep software_id=26 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12692,6 +12746,24 @@ _EOF_ fi + software_id=173 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + + Banner_Uninstalling + G_AGP lxqt qterminal + + fi + + software_id=174 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + + Banner_Uninstalling + G_AGP gimp + + fi + software_id=24 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then From 58e1b719934f8c6807d18aae60c69454ce154777 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 13:46:09 +0100 Subject: [PATCH 049/253] LXQT WIP --- dietpi/dietpi-software | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5f521dcb78..0abd11af56 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3259,7 +3259,7 @@ _EOF_ #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' #G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lxqt qterminal + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower fi @@ -7240,6 +7240,13 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration + + # - PCmanFM configs + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O /root/.config/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O /root/.config/pcmanfm/LXDE/desktop-items-0.conf + # - Disable Trash + G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf + Create_Desktop_Shared_Items fi @@ -9732,6 +9739,11 @@ _EOF_ cmd_launch_desktop='/usr/bin/xfce4-session &' + #DESKTOP_LXQT + elif (( ${aSOFTWARE_INSTALL_STATE[173]} >= 1 )); then + + cmd_launch_desktop='/usr/bin/lxqt-session &' + fi mkdir -p /root/.vnc @@ -12751,7 +12763,7 @@ _EOF_ Banner_Uninstalling - G_AGP lxqt qterminal + G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower fi From 2d88a81047434b0324035f8bcc92df55449e8984 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 13:57:17 +0100 Subject: [PATCH 050/253] VNC detect LXQT install. --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0abd11af56..c204ea3045 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2765,7 +2765,8 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[23]} < 1 && ${aSOFTWARE_INSTALL_STATE[24]} < 1 && ${aSOFTWARE_INSTALL_STATE[25]} < 1 && - ${aSOFTWARE_INSTALL_STATE[26]} < 1)); then + ${aSOFTWARE_INSTALL_STATE[26]} < 1 && + ${aSOFTWARE_INSTALL_STATE[173]} < 1 )); then # - If no desktop is selected or installed (0), default to LXDE aSOFTWARE_INSTALL_STATE[23]=1 From 5615dad75e29ec04295f1a3dcd2fd2b2d961e2da Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 14:22:09 +0100 Subject: [PATCH 051/253] Required. --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c204ea3045..bb8ddbab98 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3260,7 +3260,7 @@ _EOF_ #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' #G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver fi @@ -12764,7 +12764,7 @@ _EOF_ Banner_Uninstalling - G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower + G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver fi From 8ddd3122276512bbed7f395c1630d48d95255b7c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:03:17 +0100 Subject: [PATCH 052/253] + XFCE4 power mgr. For LXDE/LXQt offers brightness hotkey support. --- dietpi/dietpi-software | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bb8ddbab98..fc7d28e8a9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -455,6 +455,16 @@ _EOF_ aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + #------------------ + software_id=175 + + aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power' + aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + #Remote Desktops #-------------------------------------------------------------------------------- software_id=27 @@ -3316,6 +3326,16 @@ _EOF_ fi + #XFCE4 Power + software_id=175 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + G_AGI xfce4-power-manager + + fi + #XRDP software_id=29 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12777,6 +12797,15 @@ _EOF_ fi + software_id=175 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + + Banner_Uninstalling + G_AGP xfce4-power-manager + + fi + software_id=24 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then From f41b771385ee4773065020b56ed3d5a33d4c14ea Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:17:10 +0100 Subject: [PATCH 053/253] LXQt profiles, WIP. --- .conf/desktop/lxqt.7z | Bin 0 -> 4208 bytes dietpi/dietpi-software | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .conf/desktop/lxqt.7z diff --git a/.conf/desktop/lxqt.7z b/.conf/desktop/lxqt.7z new file mode 100644 index 0000000000000000000000000000000000000000..a83ff813d240633e49c0597fb40935d7dda6367e GIT binary patch literal 4208 zcmai&Ra_I`yMQ-hqeDVqAS0zEq)QY8Mo#IF94R2927)k3S{N`wN_38L`{XAd1Asf_Od7B+Ta;J-oQj`wx-;3veHo(StM$Q6x8WG$Y zAez!obyO87Pwg|JDU<}7Y5__J0x0@&*zs)E{te%o8s!fh2&bTk} z!B^bN_(G{Ne*He)XG~IHk-n;+dGGpGyjsC+_M+N_*?@%UVq6YehWLPc5;YAPF8VHm z9o!>+j04Da8o4LS_V6RQxNu3PI)Yh(P%?$CinCnIhr|H`?-NGO&PD&-x19&>-m-nj zuU;$aB>v3;`pO{gu6g;CZP(++nal2oPtBNf)sB2vxr?>l_t9y$rQ6=gL(!gAot(@9 zgQqQLl%8;5ggW&yJsdlKs-io{ez4l_zbAz{RMM8ONDC@;8*AolbsGR-hN~VZjTn@Q zekpkTM+Y!0uTQ?UbpuNDUWGvXZAi(r*m0qwca`Ab8d{50x~He3Qg#y(gHc!g@LM<_ z!SMP+xyY^G+v!_3b{jab8M;ev%WHR7i@wD!!V?wmVj=614h_KF*nU1!F^x`4cxQlV z_>RZO3(k_^ydi{fnDvyJeG00f<1Mmquf@x=YR?XFnZZWTL3LnewT3dqwaUYcP+d> z@V&Om73r<)mOT?@;X97?!9)fpT!00z7%=PqTrByja47woKjpHQ{`tS@P<80oP#4VR zLNLCgp>XVHm%S>r->#!w7^nex^d?W1dP*NgIXJ4ri!#UxL5$Rk4uR-tA1!%L#q-OK z1LLCh^w&J)C*E1P3rkdgYjgaqy$t1P>m!U zB`he9Gasd~4&NE-oby019N3v7K$_1M{0%nncZ&E+Iagonn*`Tb;wkDp6sW*e_~aB$ ziYDfGc?0U@;k@zEt7L7t%VwKg{f4i_8Mc9*9!TUKPk!F7E10YeThj22khy)39Anc= zl`~$bCIJ&j6MG}^&a*>F7SrE8xY4iNN!^Hi2$SjhR~Mt{8-TtDP;rWd@wjPpYQ3_t zSAmOhbor5y<&{VO8K3+J8b?N%OrS}ZIm?mvxa0;Mgh68_-1UE$t73^YW+E{&nJfuI zh)>m-C_81ZH~;_$;IPz0cp{K?Ppv6@T!RqG_a6U^0&?Q=P`SI(f)s!Spg*AX-$%Ie zSW?Yi@|IowR)~geS;gy)7_eS7SDyDFzBi3hRj}}9A zQ8fAed=boBkf3)of~1k|$~8vcG<$7mMMd;uhE0Q4h}Qh}yZBAiT)e{>IGS$K`^piG zRFKD3{f86sznnHUem)4Klj~E2jg7J|(hu>M67U^R|8L5Qg^UGzsR*%}kqNB_zRr&_ z=CY(Nkn4QLVLm2H#L|7!Ed9KG~!EH{nDDQ@Mda1J9PjWORiAl;3i)p2?n_m@uXUvz(A{SinTM}&i`Bf>{n zLY%_qnVo~Hr?avQMS!cLuZ!|saq+(nz&ykh|8`KFnM>6Z_fg7yl!1W!dHm;<2HwXq zO0!TfL>?fy%yCdfq;$g-D`pC(W3seicAUtAEiV1jNJsR3H}~ekkd( zsCGK2tXs0o%S_fFWw=NCXE!L-E0F(j@8k;A$fdZ}#?xC`vxDiSwT{^{m!G;|zdbT~ zwKc40RYvHe#$JDh#(i}(M{?gQQHbk3cu{9`tJnv%N$&r>w7m=V zOyoZfO}%a#FARXj?GIlt=}j7ZxPX)m+{>EnOE~OapnN`M7Jp=+-yU}Qw%P4EDgdiC zYWW#OPG6d1SjeFh_@ZTB-mT>s!@7f-CF1ImBw|TxcQZ#FiE*cA_~F9HISPzZBTc?o zW@g4{{IuWaIGuAo0UL}scl25cD=qe$CSAiF+{v`iYK|HgCjb~(Ch}S#NP!J^K(r+P z^8kSsr&y|a$)L$bY(}R?*%&^SP&kJW_bqsW@5jc2Fx0>TDOwLVNcH_Njt;*H9-W+| zhZ`MdBAO7pRY9#c>>G*RqSNnp033IR$V^;3y1A`*ueG^zreMOq#!ibPQRt%i8tiYI zEWFx9duA>3W=N}Kxz8IHT!V9Eu9Z9K6hmNlpF@e8bnzzRkkvV+vCxEhJcC?UL%A}> z;{X3OfcikPf4-P-=C#?vR)Jq~nD0ej;oXQ&GlUU~Niy0N9Vbg)(cpJmYYPWvVIy`J zDp=%`hel0@8V>xgNRK2|4xXj4P8ZE7Cv#TK+c%T5%0m5p!}_HdEk2^6jFFimindY& zdI(ajzVhYm1nb_%`xZhguvaT4@)>mPUcsp((ea8r5-YEQ+-uItvTi|6cS7?x^NS8t>XQE}}O+gCVPct@XhxZV`l9+!@{2i7!G zh!(3}Z|Ey;=`rt8bxnq3^yE4qCSe^9(PdN=bvsMnGoEZHh(;PO02YXvfD-@o@i*N& zbLrdY#D7wD5=Ol5or2X?PB4a+3-&dw1k#mynV^5{mF|G~3|y2#Q}){DcqMXX;4HAa zSe2mNb;c)+q|}}H!3SoMPQQL`pf%dWcgksv%1gz-#$((EV8fWD32jEop-)h{w`MjV zCD0cCdf2i~^{$UEena3X9Jt(YfA+TuiTTjHZgRfXj&pv={PF?T%Z=8h&Ts# z>IEOO58BX%$&t-W<Y9Ci&UGL8lgjc330m z)sF^avoE(A3PujSH%mRapkGnveEvt~GikylQds}$-VCZ}GoL?+D zw_=PApwE9dQ&}H49+~{n=Dnc$o_%AqmDBZ(xFPJNzn+ol8lAA6yE84gbUoHv_@VQY zf)$A&MQMsEd8sGO1R3jTWrkoh7Y7SFxKT&vN;FYpF98Hx=y8t0i}CnvuY~m7yrUiY z>s7iUa$s8sgI6vcwKgkdy>iQo@7ahC*qFp$axgg(BAscIbz?rd#f)yR1&)upY=63m zImtNeR~Wd?mcY&WR04}n&f$u(jp90)yHVB)72&*sV8yXK%MWh#{>s0 zjX?3c8!;3y#CtJ-W3x~;!Ua(pNdykB!)IUwE2x-59T~yBwl3{hqg6Z;T7+(YWBx{D zURbh5b3iZVPz+%@y!|83>(u>_x6-Rc4HGce9cs|-eQp6`E+&Ah-x<6%i@xBY>c%mJ z@4OC(c#y~zhpQexX6f?lW{@ml$Bvgvbkh`U&w=}8O`J8W;48=HfIkJf6LwJOyFYMr#}D<6IDi(2uwGOUfT0;79Csr zB>@_Nt%BdI`o4?jeeZNyIt3k1PY_HULA00}E~S8`G>>CmL<#?Nea>ji)pC23(X1r! zT(iT;cL5nb)F42CbQs@pd4Xq3Vox&%{;_&9uh3VQJU<`-ZN&U-SViJ(2&KaWWd83~XuT)XlIvl+p3ULrmQ9i2to zISVAP=zDdpLKsIch3;WrN;nV3y~sD@GhbBMaWM224_7&#&*i*2M8H`N4B`P*YV@IM(JU7s!(K&m?RW@AT2}E0+V{ v+E#V4hy6b@gPWkFQXn}x5&)(I0)RZkKp?3#;O|g@D&iXj@KHJ(2LSvRZ|B(Q literal 0 HcmV?d00001 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fc7d28e8a9..2ec68e52c8 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7262,9 +7262,8 @@ _EOF_ Banner_Configuration - # - PCmanFM configs - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O /root/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O /root/.config/pcmanfm/LXDE/desktop-items-0.conf + # - Configs + Download_Install 'https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxqt.7z' /root/.config # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf @@ -12776,6 +12775,7 @@ _EOF_ Banner_Uninstalling G_AGP lxde $(dpkg --get-selections lxde-* | mawk '{print $1}') upower policykit-1 firefox-esr + G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm -R $HOME/.config/{lxpanel,lxsession,lxterminal} fi @@ -12785,6 +12785,7 @@ _EOF_ Banner_Uninstalling G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver + G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm -R $HOME/.config/lxqt fi From 7a1ade4359e1f7fc8c0c176c2226352cb41cdcd2 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:38:13 +0100 Subject: [PATCH 054/253] Correction. --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2ec68e52c8..273be8fbaf 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7263,7 +7263,7 @@ _EOF_ Banner_Configuration # - Configs - Download_Install 'https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxqt.7z' /root/.config + Download_Install 'https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt.7z' /root/.config # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf From 3c5d094f7c9cab2a69ac4a35708a50abee8a6a04 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:47:39 +0100 Subject: [PATCH 055/253] DietPi-NordVPN: Autostart/connect during boot option. --- CHANGELOG.txt | 2 ++ dietpi/misc/dietpi-nordvpn | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1c72e9feab..769b2b498a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,9 +10,11 @@ Changes / Improvements / Optimisations: - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. +- DietPi-NordVPN | Added ability to toggle auto start/connect during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 - DietPi-Software | Subsonic: Runs now as limited user "subsonic". This change is as well applied to existing installs via patch during DietPi-Update: https://github.com/MichaIng/DietPi/pull/2705 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 +- DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. Bug Fixes: - DietPi-Config | Resolved an issue where proxy settings would not be correct after a reboot. Many thanks to @stephantual for reporting this!: https://github.com/MichaIng/DietPi/issues/2704 diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index e03808127d..97240a5dd8 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -198,11 +198,16 @@ _EOF_ fi + local autostart_enabled=$(systemctl is-enabled dietpi-nordvpn 2> /dev/null | grep -q '^enabled$') + local autostart_text='On' + (( ! $autostart_enabled )) && autostart_text='Off' + G_WHIP_MENU_ARRAY=('' '●─ Global Options ') G_WHIP_MENU_ARRAY+=('Username' ": [$NORDVPN_USERNAME]") G_WHIP_MENU_ARRAY+=('Password' ": [$NORDVPN_PASSWORD]") G_WHIP_MENU_ARRAY+=('Server' ": [$NORDVPN_SERVER]") G_WHIP_MENU_ARRAY+=('Refresh' ': Update VPN connection status') + G_WHIP_MENU_ARRAY+=('Auto start' ": [$autostart_text]") (( $NORDVPN_CONNECTED )) && G_WHIP_MENU_ARRAY+=('Disconnect' '') G_WHIP_MENU_ARRAY+=('' '●─ Save Settings ') G_WHIP_MENU_ARRAY+=('Apply' ': Save settings and restart VPN connection') @@ -217,6 +222,18 @@ _EOF_ Save_Settings + elif [[ $G_WHIP_RETURNED_VALUE == 'Auto start' ]]; then + + if (( $autostart_enabled )); then + + G_RUN_CMD systemctl disable dietpi-nordvpn + + else + + G_RUN_CMD systemctl enable dietpi-nordvpn + + fi + elif [[ $G_WHIP_RETURNED_VALUE == 'Username' ]]; then G_WHIP_DEFAULT_ITEM=$NORDVPN_USERNAME From 7fb84d63d3684722cce56d30b0f42077482a32ec Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:54:00 +0100 Subject: [PATCH 056/253] Tweak --- dietpi/misc/dietpi-nordvpn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index 97240a5dd8..e794d34e6d 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -198,9 +198,10 @@ _EOF_ fi - local autostart_enabled=$(systemctl is-enabled dietpi-nordvpn 2> /dev/null | grep -q '^enabled$') - local autostart_text='On' - (( ! $autostart_enabled )) && autostart_text='Off' + local autostart_enabled=$(( $(systemctl is-enabled dietpi-nordvpn &> /dev/null; echo $?) + 1 )) + (( $autostart_enabled > 1 )) && autostart_enabled=0 + local autostart_text='Off' + (( $autostart_enabled )) && autostart_text='On' G_WHIP_MENU_ARRAY=('' '●─ Global Options ') G_WHIP_MENU_ARRAY+=('Username' ": [$NORDVPN_USERNAME]") From 249e72682b5f5f54b7f4c933b7b1157e308e2999 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 16 Apr 2019 15:58:10 +0100 Subject: [PATCH 057/253] Minor --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 273be8fbaf..cfdf92f036 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15724,7 +15724,8 @@ Once DietPi has completed your software installations, and rebooted, please foll ${aSOFTWARE_INSTALL_STATE[108]} == 1 || ${aSOFTWARE_INSTALL_STATE[112]} == 1 || ${aSOFTWARE_INSTALL_STATE[119]} == 1 || - ${aSOFTWARE_INSTALL_STATE[155]} == 1 )); then + ${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?\n From eff72f9c2fa19f8c9367fafd87b060a61fc576cc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 16 Apr 2019 21:38:31 +0200 Subject: [PATCH 058/253] v6.23 + DietPi-NordVPN | Check if service was already created and do connection check + show menu items based on result + DietPi-NordVPN | When enabling auto start, apply settings as well to include connection check and assure that enabled service matches the currently chosen/shown settings from the menu + DietPi-NordVPN | Coding --- dietpi/misc/dietpi-nordvpn | 118 +++++++++++++------------------------ 1 file changed, 41 insertions(+), 77 deletions(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index e794d34e6d..10af2db569 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -15,13 +15,13 @@ # - /DietPi/dietpi/misc/dietpi-nordvpn #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-NordVPN' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- FP_SETTINGS_DIETPI='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf' FP_SETTINGS_OVPN='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_ovpn.conf' @@ -31,12 +31,13 @@ PROTOCOL='udp' NET_DEV='tun0' + NORDVPN_SERVICE=0 NORDVPN_CONNECTED=0 MAX_WAIT_FOR_CONNECTION=5 Init(){ - #Check installed + # Check installed until grep -q 'aSOFTWARE_INSTALL_STATE\[171\]=2' /DietPi/dietpi/.installed do @@ -53,6 +54,9 @@ done + # Check service exists + [[ -f '/lib/systemd/system/dietpi-nordvpn.service' ]] && NORDVPN_SERVICE=1 + Read_Settings } @@ -60,16 +64,10 @@ Check_Connected(){ NORDVPN_CONNECTED=0 - local status=1 #if systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'; then - if ip r | grep -q $NET_DEV; then - - status=0 - NORDVPN_CONNECTED=1 + [[ $(ip r s dev $NET_DEV) ]] && NORDVPN_CONNECTED=1 - fi - - return $status + return $(( ! $NORDVPN_CONNECTED )) } @@ -77,7 +75,7 @@ Save_Settings(){ - systemctl stop dietpi-nordvpn + (( $NORDVPN_SERVICE )) && systemctl stop dietpi-nordvpn cat << _EOF_ > $FP_SETTINGS_OVPN ${NORDVPN_USERNAME//\'/\'\\\'\'} @@ -101,15 +99,13 @@ Description=NordVPN (DietPi) After=network.target dietpi-boot.service [Service] -User=root -Type=simple ExecStart=$(which openvpn) /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload + NORDVPN_SERVICE=1 G_RUN_CMD systemctl enable dietpi-nordvpn G_RUN_CMD systemctl restart dietpi-nordvpn @@ -137,30 +133,20 @@ _EOF_ # Whip #///////////////////////////////////////////////////////////////////////////////////// TARGETMENUID=0 - LAST_SELECTED_NAME=0 + LAST_SELECTED_NAME='Username' Menu_Exit(){ G_WHIP_SIZE_X_MAX=50 - if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - - #exit - TARGETMENUID=-1 - - else - - #Return to Main Menu - TARGETMENUID=0 - - fi + G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 # Exit } - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ local text_status='Status:\n' - if Check_Connected; then + if (( $NORDVPN_SERVICE )) && Check_Connected; then text_status+=" - Connected : $NORDVPN_SERVER\n" @@ -172,20 +158,12 @@ _EOF_ if [[ -f /sys/class/net/$NET_DEV/statistics/rx_bytes && -f /sys/class/net/$NET_DEV/statistics/tx_bytes ]]; then net_rx_byte=$( 0 )); then - - net_rx_mb="$(( $net_rx_byte / 1024 / 1024 ))MB" - - fi + disable_error=1 G_CHECK_VALIDINT "$net_rx_byte" 1 && net_rx_mb="$(( $net_rx_byte / 1024 / 1024 ))MB" + net_tx_byte=$( 0 )); then - - net_tx_mb="$(( $net_tx_byte / 1024 / 1024 ))MB" - - fi + disable_error=1 G_CHECK_VALIDINT "$net_tx_byte" 1 && net_tx_mb="$(( $net_tx_byte / 1024 / 1024 ))MB" fi @@ -193,23 +171,25 @@ _EOF_ else - text_status+=' - Disconnected\n' - text_status+=' - NordVPN subscription: https://go.nordvpn.net/aff_c?offer_id=15&aff_id=5305&url_id=902' + (( $NORDVPN_SERVICE )) && text_status+=' - Disconnected' || text_status+=' - Not configured' + text_status+='\n - NordVPN subscription: https://go.nordvpn.net/aff_c?offer_id=15&aff_id=5305&url_id=902' fi - local autostart_enabled=$(( $(systemctl is-enabled dietpi-nordvpn &> /dev/null; echo $?) + 1 )) - (( $autostart_enabled > 1 )) && autostart_enabled=0 - local autostart_text='Off' - (( $autostart_enabled )) && autostart_text='On' - G_WHIP_MENU_ARRAY=('' '●─ Global Options ') G_WHIP_MENU_ARRAY+=('Username' ": [$NORDVPN_USERNAME]") G_WHIP_MENU_ARRAY+=('Password' ": [$NORDVPN_PASSWORD]") G_WHIP_MENU_ARRAY+=('Server' ": [$NORDVPN_SERVER]") - G_WHIP_MENU_ARRAY+=('Refresh' ': Update VPN connection status') - G_WHIP_MENU_ARRAY+=('Auto start' ": [$autostart_text]") - (( $NORDVPN_CONNECTED )) && G_WHIP_MENU_ARRAY+=('Disconnect' '') + if (( $NORDVPN_SERVICE )); then + + local autostart_enabled=0 autostart_text='Off' + systemctl -q is-enabled dietpi-nordvpn && { autostart_enabled=1 autostart_text='On'; } + G_WHIP_MENU_ARRAY+=('Auto start' ": [$autostart_text]") + + G_WHIP_MENU_ARRAY+=('Refresh' ': Update VPN connection status') + (( $NORDVPN_CONNECTED )) && G_WHIP_MENU_ARRAY+=('Disconnect' '') + + fi G_WHIP_MENU_ARRAY+=('' '●─ Save Settings ') G_WHIP_MENU_ARRAY+=('Apply' ': Save settings and restart VPN connection') @@ -217,7 +197,7 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Exit' if G_WHIP_MENU "$text_status"; then - LAST_SELECTED_NAME="$G_WHIP_RETURNED_VALUE" + LAST_SELECTED_NAME=$G_WHIP_RETURNED_VALUE if [[ $G_WHIP_RETURNED_VALUE == 'Apply' ]]; then @@ -231,35 +211,28 @@ _EOF_ else - G_RUN_CMD systemctl enable dietpi-nordvpn + Save_Settings fi elif [[ $G_WHIP_RETURNED_VALUE == 'Username' ]]; then G_WHIP_DEFAULT_ITEM=$NORDVPN_USERNAME - if G_WHIP_INPUTBOX 'Please enter your NordVPN username:'; then - - NORDVPN_USERNAME=$G_WHIP_RETURNED_VALUE - - fi + G_WHIP_INPUTBOX 'Please enter your NordVPN username:' && NORDVPN_USERNAME=$G_WHIP_RETURNED_VALUE elif [[ $G_WHIP_RETURNED_VALUE == 'Password' ]]; then - if G_WHIP_PASSWORD 'Please enter your NordVPN password:'; then - - NORDVPN_PASSWORD=$result - unset result - - fi + G_WHIP_PASSWORD 'Please enter your NordVPN password:' && NORDVPN_PASSWORD=$result + unset result elif [[ $G_WHIP_RETURNED_VALUE == 'Disconnect' ]]; then G_RUN_CMD systemctl stop dietpi-nordvpn + LAST_SELECTED_NAME='Refresh' elif [[ $G_WHIP_RETURNED_VALUE == 'Server' ]]; then - # Select protocol + # - Select protocol G_WHIP_MENU_ARRAY=( 'UDP' ': Recommended' @@ -268,31 +241,22 @@ _EOF_ ) G_WHIP_DEFAULT_ITEM=$PROTOCOL - if G_WHIP_MENU 'Please select the connection protocol type:'; then + G_WHIP_MENU 'Please select the connection protocol type:' && PROTOCOL=${G_WHIP_RETURNED_VALUE,,} - PROTOCOL=${G_WHIP_RETURNED_VALUE,,} - - fi - - # Select server - G_WHIP_MENU_ARRAY=() + # - Select server G_DIETPI-NOTIFY 2 'Populating NordVPN server list, please wait...' cd /etc/openvpn/ovpn_$PROTOCOL + G_WHIP_MENU_ARRAY=() for i in * do G_WHIP_MENU_ARRAY+=("$i" '') done - cd /tmp/$G_PROGRAM_NAME G_WHIP_DEFAULT_ITEM=$NORDVPN_SERVER - if G_WHIP_MENU 'Please select a NordVPN server to use'; then - - NORDVPN_SERVER=$G_WHIP_RETURNED_VALUE - - fi + G_WHIP_MENU 'Please select a NordVPN server to use' && NORDVPN_SERVER=$G_WHIP_RETURNED_VALUE fi From d793545eea7f3130d4b8e51d0997be3ff4061ab5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 02:34:09 +0200 Subject: [PATCH 059/253] v6.23 + DietPi-Software | Estimate free/unused software IDs via new command argument: "dietpi-software free" --- dietpi/dietpi-software | 572 ++++++++++++++++++----------------------- 1 file changed, 250 insertions(+), 322 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfdf92f036..257b264d0b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -21,24 +21,24 @@ # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software. #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Software' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// - #Filepath + # Filepath #///////////////////////////////////////////////////////////////////////////////////// FP_INSTALLED_FILE='/DietPi/dietpi/.installed' FP_INSTALLED_FILE_TEMP='.installed' - #Used to set user/personal data directories (eg: usbdrive) + # Used to set user/personal data directories (eg: usbdrive) FP_DIETPI_DEDICATED_USBDRIVE='' - #Default user content folders used in DietPi. + # Default user content folders used in DietPi. FOLDER_MUSIC='Music' FOLDER_PICTURES='Pictures' FOLDER_VIDEO='Video' @@ -58,7 +58,7 @@ > $fp_target - #Save installed states + # Save installed states for i in ${!aSOFTWARE_INSTALL_STATE[@]} do @@ -75,22 +75,22 @@ done - #Misc + # Misc cat << _EOF_ >> $fp_target -#DietPi Choice System: SSH Server +# DietPi Choice System: SSH Server INDEX_SSHSERVER_CURRENT=$INDEX_SSHSERVER_CURRENT INDEX_SSHSERVER_TARGET=$INDEX_SSHSERVER_TARGET -#DietPi Choice System: File Server +# DietPi Choice System: File Server INDEX_FILESERVER_CURRENT=$INDEX_FILESERVER_CURRENT INDEX_FILESERVER_TARGET=$INDEX_FILESERVER_TARGET -#DietPi Choice System: Logging +# DietPi Choice System: Logging INDEX_LOGGING_CURRENT=$INDEX_LOGGING_CURRENT INDEX_LOGGING_TARGET=$INDEX_LOGGING_TARGET -#DietPi Preference System: Webserver base +# DietPi Preference System: Webserver base INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_CURRENT INDEX_WEBSERVER_TARGET=$INDEX_WEBSERVER_TARGET _EOF_ @@ -99,16 +99,16 @@ _EOF_ Read_InstallFileList(){ - #Load Software states + # Load Software states G_DIETPI-NOTIFY -2 'Reading database' local fp_target=$FP_INSTALLED_FILE [[ $1 == 'temp' ]] && fp_target=$FP_INSTALLED_FILE_TEMP - #Load + # Load [[ -f $fp_target ]] && . $fp_target - #Always reset choice system during first run to defaults: https://github.com/MichaIng/DietPi/issues/1122 + # Always reset choice system during first run to defaults: https://github.com/MichaIng/DietPi/issues/1122 if (( $G_DIETPI_INSTALL_STAGE == 1 )); then INDEX_SSHSERVER_CURRENT=-1 @@ -142,19 +142,19 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Installation System #///////////////////////////////////////////////////////////////////////////////////// - #Reboot after installation has finished. + # Reboot after installation has finished DISABLE_REBOOT=0 - #uninstall flag, used in software installations + removals, runs Uninstall_Software() + # Uninstall flag, used in software installations + removals, runs Uninstall_Software() UNINSTALL_REQUIRED=0 - #Global Password for software installs + # Global password for software installs GLOBAL_PW='' Update_Global_Pw(){ GLOBAL_PW='' # - Encrypted - if [[ -r '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then + if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' @@ -162,7 +162,7 @@ _EOF_ 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) # - 1st run automated setup only - else + elif (( $G_INSTALL_STATE < 2 )); then GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -172,16 +172,16 @@ _EOF_ if [[ ! $GLOBAL_PW ]]; then GLOBAL_PW='dietpi' - G_DIETPI-NOTIFY 1 "Unable to obtain GLOBAL_PW from dietpi.txt (1st run automation only), and, /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin\n\nThe following fallback GLOBAL_PW will be used:\n - $GLOBAL_PW" + G_WHIP_MSG "[ERROR] 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 levels, eg: opcache/apcu max sizes) + # Total system RAM: Used to calculate percentage based value for software cache levels, eg: OPcache/APCu max sizes RAM_TOTAL=$(free -m | mawk '/Mem:/ {print $2;exit}') - #Run Installation Flag (1 = run installs) + # Run Installation Flag (1 = run installs) GOSTARTINSTALL=0 # Install variables @@ -189,14 +189,14 @@ _EOF_ UNINSTALL_URL_ADDRESS='' DEPS_LIST='' - #Special installation Vars + # Special installation Vars USER_EMONHUB_APIKEY_COMPLETED=0 USER_EMONHUB_APIKEY_CURRENT=0 WIFIHOTSPOT_RTL8188C_DEVICE=0 USER_LINUX_AUTOINSTALL_PROMPT_DISPLAYED=0 - #PHP5/7 specific directories, apt package-, module- and command names - # - and Distro specific MariaDB service name + # PHP5/7 specific directories, apt package-, module- and command names + # - and distro specific MariaDB service name FP_PHP_BASE_DIR='/etc/php/7.0' PHP_APT_PACKAGE_NAME='php7.0' PHP_BINARY='php' @@ -217,39 +217,39 @@ _EOF_ USBDRIVE=0 - #Choices Made? + # Choices Made? INSTALL_SOFTWARE_CHOICESMADE=0 - #DietPi Choice System: SSH Server - #NB: Update Read_InstallFileList with defaults + # DietPi Choice System: SSH Server + # NB: Update Read_InstallFileList with defaults INSTALL_SSHSERVER_CHOICESMADE=0 INDEX_SSHSERVER_CURRENT=-1 INDEX_SSHSERVER_TARGET=-1 - #DietPi Choice System: Fileserver - #NB: Update Read_InstallFileList with defaults + # DietPi Choice System: Fileserver + # NB: Update Read_InstallFileList with defaults INSTALL_FILESERVER_CHOICESMADE=0 INDEX_FILESERVER_CURRENT=0 INDEX_FILESERVER_TARGET=0 - #DietPi Choice System: Logging - #NB: Update Read_InstallFileList with defaults + # DietPi Choice System: Logging + # NB: Update Read_InstallFileList with defaults INSTALL_LOGGING_CHOICESMADE=0 INDEX_LOGGING_CURRENT=-1 INDEX_LOGGING_TARGET=-1 - #DietPi Preference System: Webserver base - #NB: Update Read_InstallFileList with defaults + # DietPi Preference System: Webserver base + # NB: Update Read_InstallFileList with defaults INDEX_WEBSERVER_CURRENT=-2 INDEX_WEBSERVER_TARGET=-2 FP_ONLINEDOC_URL='https://dietpi.com/phpbb/viewtopic.php?' - # - Available for - MAX_G_HW_MODEL=71 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model - MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model - MAX_G_DISTRO=5 #This needs to match highest G_DISTRO value in dietpi-obtain_hw_model - # 2D array (well, bash style) + # Available for + MAX_G_HW_MODEL=71 # This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model + MAX_G_HW_ARCH=10 # This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model + MAX_G_DISTRO=5 # This needs to match highest G_DISTRO value in dietpi-obtain_hw_model + # - 2D array (well, bash style) declare -A aSOFTWARE_AVAIL_G_HW_MODEL declare -A aSOFTWARE_AVAIL_G_HW_ARCH declare -A aSOFTWARE_AVAIL_G_DISTRO @@ -286,7 +286,8 @@ _EOF_ # aSOFTWARE_CATEGORIES_LINUX then it is 1. In the example it is 0. # # - aSOFTWARE_ONLINEDOC_URL[$software_id]: - # This is appended to FP_ONLINEDOC_URL to make a URL for help on this software. + # This is appended to "https://dietpi.com/phpbb/viewtopic.php?" to make a URL for help on this software. + # This needs to be filled after creating the related online docs entry: https://dietpi.com/phpbb/viewtopic.php?p=5#p5 # # Specifying other software as dependencies: # If your software needs other software to be available, look under the 'Requires software @@ -308,13 +309,13 @@ _EOF_ # Example: # #------------------ Desktops: LXDE ------------------ # software_id=23 - # aSOFTWARE_WHIP_NAME[$software_id]='LXDE' - # aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' - # aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - # aSOFTWARE_TYPE[$software_id]=0 - # aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - # aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p42' + # aSOFTWARE_WHIP_NAME[$software_id]='LXDE' + # aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' + # aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + # aSOFTWARE_TYPE[$software_id]=0 + # aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + # aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + # aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' # #///////////////////////////////////////////////////////////////////////////////////// Software_Arrays_Init(){ @@ -322,10 +323,10 @@ _EOF_ G_DIETPI-NOTIFY -2 'Initializing database' #-------------------------------------------------------------------------------- - #Categories - #NB: Unique IDs, do not re-arrange or re-order. + # Categories + # NB: Unique IDs, do not re-arrange or re-order. #-------------------------------------------------------------------------------- - #DietPi software + # DietPi software aSOFTWARE_CATEGORIES_DIETPI=( '●─ Desktops ' #0 @@ -352,7 +353,7 @@ _EOF_ ) - #Linux software + # Linux software aSOFTWARE_CATEGORIES_LINUX=( '●─ SSH Clients ' #0 @@ -368,14 +369,14 @@ _EOF_ ) #-------------------------------------------------------------------------------- - #DietPi software items + # DietPi software items #-------------------------------------------------------------------------------- - #Before adding, please check 'dietpi-software list | grep null' to list NULL (available) IDs for use. + # Before adding, please check 'dietpi-software list | grep null' to list NULL (available) IDs for use. - #Assign UNIQUE ID to each item + # Assign unique ID to each item local software_id=-1 - #Desktops + # Desktops #-------------------------------------------------------------------------------- software_id=23 @@ -412,35 +413,35 @@ _EOF_ #------------------ software_id=25 - aSOFTWARE_WHIP_NAME[$software_id]='XFCE' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop environment' + aSOFTWARE_WHIP_NAME[$software_id]='XFCE' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop environment' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' #------------------ software_id=26 - aSOFTWARE_WHIP_NAME[$software_id]='GNUStep' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight based on OpenStep' + aSOFTWARE_WHIP_NAME[$software_id]='GNUStep' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight based on OpenStep' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' #------------------ software_id=113 - aSOFTWARE_WHIP_NAME[$software_id]='Chromium' - aSOFTWARE_WHIP_DESC[$software_id]='web browser for desktop or autostart' + aSOFTWARE_WHIP_NAME[$software_id]='Chromium' + aSOFTWARE_WHIP_DESC[$software_id]='web browser for desktop or autostart' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -448,24 +449,24 @@ _EOF_ #------------------ software_id=174 - aSOFTWARE_WHIP_NAME[$software_id]='GIMP' - aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids' + aSOFTWARE_WHIP_NAME[$software_id]='GIMP' + aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' - #------------------ + #------------------ software_id=175 - aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power' - aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' + aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power' + aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' - #Remote Desktops + # Remote Desktops #-------------------------------------------------------------------------------- software_id=27 @@ -562,7 +563,7 @@ _EOF_ aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 # + NanoPC T4 - # aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,68]=1 + #aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,68]=1 #------------------ software_id=32 @@ -2463,16 +2464,16 @@ _EOF_ } - #Work out which additional software we need to install + # Work out which additional software we need to install # - We do reinstall =2 marked software as well, just to be sure. Install_Flag_Prereq_Software(){ - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Checking for prerequisite software" + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Checking for prerequisite software' local software_id=-1 #------------------------------------------------------------------------- - #Pre-req software, for items that do not have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + # Pre-req software, for items that do NOT have their own array aSOFTWARE_REQUIRES_SOFTWARENAME #Nextcloud extensions # Nextcloud Talk @@ -2510,16 +2511,9 @@ _EOF_ aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - - # if (( $G_HW_MODEL == 70 )); then - - # aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot - - # fi - + #(( $G_HW_MODEL == 70 )) && aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot aSOFTWARE_INSTALL_STATE[65]=1 # Netdata aSOFTWARE_INSTALL_STATE[96]=1 # Samba - aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon #aSOFTWARE_INSTALL_STATE[128]=1 # MPD (pulled in by O!MPD) @@ -2547,8 +2541,6 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[163]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 - - #aSOFTWARE_WHIP_NAME G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" fi @@ -2561,8 +2553,6 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[134]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 - - #aSOFTWARE_WHIP_NAME G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" fi @@ -2646,9 +2636,9 @@ _EOF_ fi #------------------------------------------------------------------------- - #WEBSERVER - Manual stack install + # WEBSERVER - Manual stack install # - Define extra DietPi install flags for WEBSERVER_STACKS - #LLMP + # LLMP if (( ${aSOFTWARE_INSTALL_STATE[82]} == 1 )); then aSOFTWARE_INSTALL_STATE[84]=1 @@ -2657,7 +2647,7 @@ _EOF_ fi - #LLSP + # LLSP if (( ${aSOFTWARE_INSTALL_STATE[81]} == 1 )); then aSOFTWARE_INSTALL_STATE[84]=1 @@ -2666,7 +2656,7 @@ _EOF_ fi - #LEMP + # LEMP if (( ${aSOFTWARE_INSTALL_STATE[79]} == 1 )); then aSOFTWARE_INSTALL_STATE[85]=1 @@ -2675,7 +2665,7 @@ _EOF_ fi - #LESP + # LESP if (( ${aSOFTWARE_INSTALL_STATE[78]} == 1 )); then aSOFTWARE_INSTALL_STATE[85]=1 @@ -2684,7 +2674,7 @@ _EOF_ fi - #LAMP + # LAMP if (( ${aSOFTWARE_INSTALL_STATE[76]} == 1 )); then aSOFTWARE_INSTALL_STATE[83]=1 @@ -2693,7 +2683,7 @@ _EOF_ fi - #LASP + # LASP if (( ${aSOFTWARE_INSTALL_STATE[75]} == 1 )); then aSOFTWARE_INSTALL_STATE[83]=1 @@ -2703,15 +2693,15 @@ _EOF_ fi #------------------------------------------------------------------------- - #Pre-req software, for items that do DO have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + # Pre-req software, for items that DO have their own array aSOFTWARE_REQUIRES_SOFTWARENAME for i in ${!aSOFTWARE_INSTALL_STATE[@]} do (( ${aSOFTWARE_INSTALL_STATE[$i]} != 1 )) && continue - #WEBSERVER - Auto install via choice system - # - Check for existing webserver base (Apache2,Nginx,Lighttpd) installation + # WEBSERVER - Auto install via choice system + # - Check for existing webserver base (Apache2, Nginx, Lighttpd) installation if (( ${aSOFTWARE_REQUIRES_WEBSERVER[$i]:=0} && ${aSOFTWARE_INSTALL_STATE[83]} < 1 && ${aSOFTWARE_INSTALL_STATE[84]} < 1 && @@ -2720,19 +2710,19 @@ _EOF_ # - None found, select one for install, based on user preference if (( $INDEX_WEBSERVER_TARGET == 0 )); then - #WEBSERVER_APACHE + # WEBSERVER_APACHE aSOFTWARE_INSTALL_STATE[83]=1 G_DIETPI-NOTIFY 2 'Apache2 will be installed' elif (( $INDEX_WEBSERVER_TARGET == -1 )); then - #WEBSERVER_NGINX + # WEBSERVER_NGINX aSOFTWARE_INSTALL_STATE[85]=1 G_DIETPI-NOTIFY 2 'Nginx will be installed' else - #WEBSERVER_LIGHTTPD + # WEBSERVER_LIGHTTPD aSOFTWARE_INSTALL_STATE[84]=1 G_DIETPI-NOTIFY 2 'Lighttpd will be installed' @@ -2743,7 +2733,7 @@ _EOF_ fi - #WEBSERVER_PHP + # WEBSERVER_PHP software_id=89 if (( ${aSOFTWARE_REQUIRES_PHP[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2752,7 +2742,7 @@ _EOF_ fi - #WEBSERVER_MARIADB + # WEBSERVER_MARIADB software_id=88 if (( ${aSOFTWARE_REQUIRES_MYSQL[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2761,16 +2751,16 @@ _EOF_ fi - #WEBSERVER_SQLITE + # WEBSERVER_SQLITE software_id=87 if (( ${aSOFTWARE_REQUIRES_SQLITE[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 - G_DIETPI-NOTIFY 2 'SQlite will be installed' + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" fi - #DESKTOP + # DESKTOP if (( ${aSOFTWARE_REQUIRES_DESKTOP[$i]:=0} && ${aSOFTWARE_INSTALL_STATE[23]} < 1 && ${aSOFTWARE_INSTALL_STATE[24]} < 1 && @@ -2787,7 +2777,7 @@ _EOF_ fi - #GIT + # GIT software_id=17 if (( ${aSOFTWARE_REQUIRES_GIT[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2795,7 +2785,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" fi - #BUILDESSENTIAL + # BUILDESSENTIAL software_id=16 if (( ${aSOFTWARE_REQUIRES_BUILDESSENTIAL[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2804,7 +2794,7 @@ _EOF_ fi - #RSYSLOG + # RSYSLOG software_id=102 if (( ${aSOFTWARE_REQUIRES_RSYSLOG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2812,7 +2802,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" fi - #FFMPEG + # FFMPEG software_id=7 if (( ${aSOFTWARE_REQUIRES_FFMPEG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2821,7 +2811,7 @@ _EOF_ fi - #ORACLEJAVA + # JAVA software_id=8 if (( ${aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2830,7 +2820,7 @@ _EOF_ fi - #NODEJS + # NODEJS software_id=9 if (( ${aSOFTWARE_REQUIRES_NODEJS[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2839,7 +2829,7 @@ _EOF_ fi - #ALSA + # ALSA software_id=5 if (( ${aSOFTWARE_REQUIRES_ALSA[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2848,7 +2838,7 @@ _EOF_ fi - #XSERVERXORG + # XSERVERXORG software_id=6 if (( ${aSOFTWARE_REQUIRES_XSERVERXORG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then @@ -2859,65 +2849,34 @@ _EOF_ done - #WEBSERVER - Check for stacks and flag as installing - #WEBSERVER_APACHE + # WEBSERVER - Check for stacks and flag as installing + # WEBSERVER_APACHE if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - #SQLite - if (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )); then - - #WEBSERVER_LASP - aSOFTWARE_INSTALL_STATE[75]=1 + # SQLite: LASP + (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && aSOFTWARE_INSTALL_STATE[75]=1 - fi - - #MariaDB - if (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )); then + # MariaDB: LAMP + (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && aSOFTWARE_INSTALL_STATE[76]=1 - #WEBSERVER_LAMP - aSOFTWARE_INSTALL_STATE[76]=1 - fi - - - #WEBSERVER_NGINX + # WEBSERVER_NGINX elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then - #SQLite - if (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )); then - - #WEBSERVER_LESP - aSOFTWARE_INSTALL_STATE[78]=1 - - fi - - #MariaDB - if (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )); then - - #WEBSERVER_LEMP - aSOFTWARE_INSTALL_STATE[79]=1 + # SQLite: LESP + (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && aSOFTWARE_INSTALL_STATE[78]=1 - fi + # MariaDB: LEMP + (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && aSOFTWARE_INSTALL_STATE[79]=1 - #WEBSERVER_LIGHTTPD + # WEBSERVER_LIGHTTPD elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then - #SQLite - if (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )); then - - #WEBSERVER_LLSP - aSOFTWARE_INSTALL_STATE[81]=1 - - fi - - #MariaDB - if (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )); then - - #WEBSERVER_LLMP - aSOFTWARE_INSTALL_STATE[82]=1 - - fi + # SQLite: LLSP + (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && aSOFTWARE_INSTALL_STATE[81]=1 + # MariaDB: LLMP + (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && aSOFTWARE_INSTALL_STATE[82]=1 fi @@ -2957,16 +2916,16 @@ _EOF_ ) - for (( i=0; i<${#adesktop_items[@]}; i++)) + for i in ${adesktop_items[@]} do - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/${adesktop_items[$i]} -O /usr/share/applications/${adesktop_items[$i]} + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i -O /usr/share/applications/$i done unset adesktop_items - # - icons + # - Icons G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png @@ -3001,7 +2960,6 @@ _EOF_ if [[ ! -f $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg ]]; then - #Grab My test music wget https://dietpi.com/downloads/audio/fourdee_tech.ogg -O $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_tech.ogg #wget https://dietpi.com/downloads/audio/fourdee_space.mp3 -O $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC/fourdee_space.mp3 @@ -3009,7 +2967,7 @@ _EOF_ } - #Return optimization values for BitTorrent servers based on device and hardware capabilities. + # Return optimisation values for BitTorrent servers based on device and hardware capabilities. Optimize_BitTorrent(){ local output=0 @@ -3022,12 +2980,12 @@ _EOF_ fi - #Cache size (MB) 1/10th of total mem + # Cache size (MB) 1/10th of total mem if (( $1 == 0 )); then output=$(( $RAM_TOTAL / 10 )) - #Max active downloads + # Max active downloads elif (( $1 == 1 )); then output=2 @@ -3035,7 +2993,7 @@ _EOF_ # - Bump up for x86 (( $G_HW_ARCH == 10 )) && output=3 - #Max global connections + # Max global connections elif (( $1 == 2 )); then output=20 @@ -3045,45 +3003,45 @@ _EOF_ output=40 - # - 1Gbit SBC's + # - Gbit devices elif (( $gigabit_device )); then output=30 - # - Reduce for RPi's. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. - # - RPi v3 + # - Reduce for RPi. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. + # - RPi3 elif (( $G_HW_MODEL == 3 )); then output=15 - # - RPi v2 + # - RPi2 elif (( $G_HW_MODEL == 2 )); then output=13 - # - RPi v1 256/512 + # - RPi1 256/512 elif (( $G_HW_MODEL <= 1 )); then output=7 fi - #Max upload slots + # Max upload slots elif (( $1 == 3 )); then output=3 # - Bump up for x86 - if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then + if (( $G_HW_ARCH == 10 )); then output=5 - # - 1Gbit devices + # - Gbit devices elif (( $gigabit_device )); then output=4 - # - Reduce for RPi's. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. + # - Reduce for RPi. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. elif (( $G_HW_MODEL <= 3 )); then output=2 @@ -3216,13 +3174,13 @@ _EOF_ # # G_CHECK_URL "$INSTALL_URL_ADDRESS" # - # #Install Python and PIP + # # Install Python and PIP # G_AGI python python-pip python-imaging # # cd /root # git clone --depth=1 "$INSTALL_URL_ADDRESS" # - # # - Move HTPC Manager to a 'better' location + # # Move HTPC Manager to a 'better' location # mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager # mv /root/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ # rm -R /root/HTPC-Manager @@ -3233,12 +3191,11 @@ _EOF_ Install_Dietpi_Software(){ #-------------------------------------------------------------- - #Install Software + # Install Software local software_id=-1 - #Desktop LXDE - software_id=23 + software_id=23 # Desktop LXDE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3250,7 +3207,7 @@ _EOF_ G_AGI lxde upower policykit-1 firefox-esr #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ... - #RPi, revert to Debian pcmanfm install package: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173 + # - RPi, revert to Debian pcmanfm install package: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173 if (( $G_HW_MODEL < 10 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/pcmanfm_1.2.5-3_armhf.deb' @@ -3260,8 +3217,7 @@ _EOF_ fi - #Desktop LXQt - software_id=173 + software_id=173 # Desktop LXQt if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3274,8 +3230,7 @@ _EOF_ fi - #Desktop MATE - software_id=24 + software_id=24 # Desktop MATE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3288,8 +3243,7 @@ _EOF_ fi - #Desktop GNUStep - software_id=26 + software_id=26 # Desktop GNUStep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3302,8 +3256,7 @@ _EOF_ fi - #DESKTOP_XFCE - software_id=25 + software_id=25 # DESKTOP_XFCE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3316,8 +3269,7 @@ _EOF_ fi - #GIMP - software_id=174 + software_id=174 # GIMP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3326,8 +3278,7 @@ _EOF_ fi - #XFCE4 Power - software_id=175 + software_id=175 # XFCE4 Power if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3336,8 +3287,7 @@ _EOF_ fi - #XRDP - software_id=29 + software_id=29 # XRDP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3345,8 +3295,7 @@ _EOF_ fi - #NOMACHINE - software_id=30 + software_id=30 # NoMachine if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3354,8 +3303,7 @@ _EOF_ fi - #BitTorrent Transmission - software_id=44 + software_id=44 # BitTorrent Transmission if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3363,8 +3311,7 @@ _EOF_ fi - #ProFTPd - software_id=94 + software_id=94 # ProFTPd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3374,8 +3321,7 @@ _EOF_ fi - #Samba Server - software_id=96 + software_id=96 # Samba Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -15272,54 +15218,29 @@ _EOF_ fi - #List unique software names and ID's + # List software IDs, names and additional info elif [[ $1 == 'list' ]]; then - for (( i=0; i<${#aSOFTWARE_INSTALL_STATE[@]}; i++)) + for i in ${!aSOFTWARE_INSTALL_STATE[@]} do - local string='' - - if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then - - string="\e[32mID $i | " - - elif [[ ! ${aSOFTWARE_WHIP_NAME[$i]} ]]; then - - string="\e[91mID $i | DEV USE: AVAILABLE SOFTWARE ID $i" - - else - - string="\e[0mID $i | " - - fi + local string="\e[0mID $i | " + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )) && string="\e[32mID $i | " string+="=${aSOFTWARE_INSTALL_STATE[$i]} | ${aSOFTWARE_WHIP_NAME[$i]}:\e[0m \e[90m${aSOFTWARE_WHIP_DESC[$i]}\e[0m |" (( ${aSOFTWARE_REQUIRES_ALSA[$i]:=0} == 1 )) && string+=' +ALSA' - (( ${aSOFTWARE_REQUIRES_XSERVERXORG[$i]:=0} == 1 )) && string+=' +XSERVER' - (( ${aSOFTWARE_REQUIRES_DESKTOP[$i]:=0} == 1 )) && string+=' +DESKTOP' - (( ${aSOFTWARE_REQUIRES_RSYSLOG[$i]:=0} == 1 )) && string+=' +RSYSLOG' - (( ${aSOFTWARE_REQUIRES_FFMPEG[$i]:=0} == 1 )) && string+=' +FFMPEG' - - (( ${aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$i]:=0} == 1 )) && string+=' +ORACLEJAVA' - + (( ${aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$i]:=0} == 1 )) && string+=' +JAVA' (( ${aSOFTWARE_REQUIRES_NODEJS[$i]:=0} == 1 )) && string+=' +NODEJS' - (( ${aSOFTWARE_REQUIRES_BUILDESSENTIAL[$i]:=0} == 1 )) && string+=' +BUILDESSENTIAL' - (( ${aSOFTWARE_REQUIRES_GIT[$i]:=0} == 1 )) && string+=' +GIT' - (( ${aSOFTWARE_REQUIRES_WEBSERVER[$i]:=0} == 1 )) && string+=' +WEBSERVER' - (( ${aSOFTWARE_REQUIRES_PHP[$i]:=0} == 1 )) && string+=' +PHP' - (( ${aSOFTWARE_REQUIRES_MYSQL[$i]:=0} == 1 )) && string+=' +MARIADB' - (( ${aSOFTWARE_REQUIRES_SQLITE[$i]:=0} == 1 )) && string+=' +SQLITE' # - Available for G_HW_ARCH? @@ -15342,11 +15263,23 @@ _EOF_ # - Online docs [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] && string+=" | \e[90m$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\e[0m" - #Convert string to lowercase + # - Convert string to lowercase echo -e "${string,,}" done + elif [[ $1 == 'free' ]]; then + + # Get highest software array index + local max=0 + for max in ${!aSOFTWARE_INSTALL_STATE[@]}; do :; done + + # Check for unused indices + local free='' + for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_INSTALL_STATE[$i]} ]] || free+=' $i'; done + + echo "Free software ID(s): ${free:-None, so use $(($max+1))}!" + else G_DIETPI-NOTIFY 2 "Unknown command $1" @@ -15363,11 +15296,11 @@ _EOF_ Menu_CreateSoftwareList(){ - #software type for this menu + # Software type for this menu local input_mode=$1 #-1=search all mode #0=dietpi 1=linux local display_software_menu=1 #only used to disable display of CHECKLIST when search finds no results - #Search Mode + # Search Mode if (( $input_mode == -1 )); then local search_string='' #show all @@ -15408,7 +15341,7 @@ _EOF_ fi - #Generate Whiptail menu list, of all items in specific software type, based on category + # Generate Whiptail menu list, of all items in specific software type, based on category else # - Prewarnings - Linux @@ -15432,14 +15365,14 @@ _EOF_ for ((i=0; i<$max_categories; i++)) do - #Only add the category if we have software for it. + # Only add the category if we have software for it. local category_enabled=0 - #Now run through all available software + # Now run through all available software for j in ${!aSOFTWARE_CATEGORY_INDEX[@]} do - #Check if this software matches the current category and software type for this menu. + # Check if this software matches the current category and software type for this menu. if (( ${aSOFTWARE_CATEGORY_INDEX[$j]} == $i && ${aSOFTWARE_TYPE[$j]} == $input_mode )); then # + is available for hardware? @@ -15482,7 +15415,7 @@ _EOF_ fi - #Add this option to whiptail list + # Add this option to whiptail list G_WHIP_CHECKLIST_ARRAY+=($j "${aSOFTWARE_WHIP_NAME[$j]}: ${aSOFTWARE_WHIP_DESC[$j]}" $selected) fi @@ -15502,10 +15435,10 @@ _EOF_ G_WHIP_CHECKLIST "Please use the spacebar to select the software you wish to install.\n - Software and usage details: https://dietpi.com/software - NB: Pressing 'ESC' or selecting 'Back' will clear all changed selections" - #Reset Choices made flag + # Reset Choices made flag INSTALL_SOFTWARE_CHOICESMADE=0 - #Check for matching results (selected items) + # Check for matching results (selected items) for i in ${G_WHIP_RETURNED_VALUE[@]} do @@ -15520,9 +15453,9 @@ _EOF_ done #----------------------------------------------------------------------------- - #Install Info/Warnings + # Install Info/Warnings - #DietPi-Drive_Manager can be used to setup Samba/NFS shares with ease! + # DietPi-Drive_Manager can be used to setup Samba/NFS shares with ease! if (( ${aSOFTWARE_INSTALL_STATE[1]} == 1 || ${aSOFTWARE_INSTALL_STATE[110]} == 1 )); then G_WHIP_MSG "NFS/Samba client info:\n\nDietPi-Drive_Manager is a powerful tool which vastly simplifies the mounting of NFS and Samba shares.\n @@ -15530,7 +15463,7 @@ Once $G_PROGRAM_NAME has finished installation, simply run 'dietpi-drive_manager fi - #Gogs: Requires OpenSSH for ssh-keygen binary: https://github.com/MichaIng/DietPi/issues/442 + # 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 if G_WHIP_YESNO "Gogs requires OpenSSH server to function.\n\nIf you continue, OpenSSH will be selected for install on your system. OpenSSH will also replace Dropbear (if currently installed).\n @@ -15547,7 +15480,7 @@ Would you like to continue with the Gogs installation?"; then fi - #Webserver stacks + # Webserver stacks for i in 75 76 78 79 81 82 do @@ -15563,7 +15496,7 @@ TLDR: You do NOT need to select a webserver stack for installation with DietPi. done - #RPiCamInterface - warn user of locking out camera: https://github.com/MichaIng/DietPi/issues/249 + # RPiCamInterface - warn user of locking out camera: https://github.com/MichaIng/DietPi/issues/249 if (( ${aSOFTWARE_INSTALL_STATE[59]} == 1 )); then G_WHIP_MSG 'RPi Cam Control Interface will automatically start and activate the camera during boot. This will prevent other programs (eg: raspistill) from using the camera.\n @@ -15571,7 +15504,7 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n fi - #EmonHUB/EmonPi + # EmonHUB/EmonPi if (( ${aSOFTWARE_INSTALL_STATE[99]} == 1 )); then # - Enter API KEY @@ -15602,7 +15535,7 @@ You can free up the camera by selecting "Stop Camera" from the web interface:\n fi - #Pi-hole. + # Pi-hole if (( ${aSOFTWARE_INSTALL_STATE[93]} == 1 )); then # - prompt for static ip. @@ -15619,10 +15552,10 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s fi - #Wifi Hotspot Criteria + # WiFi Hotspot Criteria if (( ${aSOFTWARE_INSTALL_STATE[60]} == 1 || ${aSOFTWARE_INSTALL_STATE[61]} == 1 )); then - #Enable wifi modules + # Enable WiFi modules /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable while :; do @@ -15652,14 +15585,14 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s fi - #Passed + # Passed if (( $criteria_passed )); then output_string+='\n\nPASSED: Criteria met. Good to go.' G_WHIP_MSG "$output_string" break - #Failed, retry? + # Failed, retry? else output_string+='\n\nFAILED: Criteria not met. Would you like to check again?' @@ -15678,7 +15611,7 @@ Once completed, select "Apply Save Changes", then exit DietPi-Config to resume s fi - #Weaved + # Weaved/Remot3.it if (( ${aSOFTWARE_INSTALL_STATE[68]} == 1 )); then G_WHIP_MSG 'Remot3.it requires you to create an online account, and, link it this device.\n @@ -15686,7 +15619,7 @@ Once DietPi has completed your software installations, and rebooted, please foll fi - #LetsEncrypt + # Let's Encrypt if (( ${aSOFTWARE_INSTALL_STATE[92]} == 1 )); then G_WHIP_MSG 'The DietPi installation of CertBot supports all offered web servers.\n\nOnce the installation has finished, you can setup your free SSL cert with: @@ -15694,7 +15627,7 @@ Once DietPi has completed your software installations, and rebooted, please foll fi - #dietpi-config can be used to install/configure the following software. Ask user. + # dietpi-config can be used to install/configure the following software. Ask user. # NoIp if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then @@ -15714,7 +15647,7 @@ Once DietPi has completed your software installations, and rebooted, please foll fi - #Boot Choices + # Boot Choices if (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 || ${aSOFTWARE_INSTALL_STATE[24]} == 1 || ${aSOFTWARE_INSTALL_STATE[25]} == 1 || @@ -15740,7 +15673,7 @@ This will allow you to choose which program loads automatically, after the syste Menu_Main(){ - #Data for storing SSH server index info + # Data for storing SSH server index info local index_sshserver_text='None' if (( $INDEX_SSHSERVER_TARGET == -1 )); then @@ -15752,7 +15685,7 @@ This will allow you to choose which program loads automatically, after the syste fi - #Data for storing Fileserver index info + # Data for storing Fileserver index info local index_fileserver_text='None' if (( $INDEX_FILESERVER_TARGET == -1 )); then @@ -15764,7 +15697,7 @@ This will allow you to choose which program loads automatically, after the syste fi - #Data for storing Logging index info + # Data for storing Logging index info local index_logging_text='None' if (( $INDEX_LOGGING_TARGET == -1 )); then @@ -15780,13 +15713,13 @@ This will allow you to choose which program loads automatically, after the syste fi - #Hold our string that tells the user what software will be removed when using Index based choice systems + # Hold our string that tells the user what software will be removed when using Index based choice systems local toberemoved_text='' - #Check status of USB drive + # Check status of USB drive Check_USB_Drive_Installed - #Where is userdata stored? + # Where is userdata stored? local user_data_location_current=$(readlink -f $G_FP_DIETPI_USERDATA) local user_data_location_description='' @@ -15911,7 +15844,7 @@ This will allow you to choose which program loads automatically, after the syste fi - #Check for changes + # Check for changes INSTALL_SSHSERVER_CHOICESMADE=0 if (( $INDEX_SSHSERVER_TARGET != $INDEX_SSHSERVER_CURRENT )); then @@ -15966,7 +15899,7 @@ This will allow you to choose which program loads automatically, after the syste fi - #Check for changes + # Check for changes INSTALL_FILESERVER_CHOICESMADE=0 if (( $INDEX_FILESERVER_TARGET != $INDEX_FILESERVER_CURRENT )); then @@ -16028,7 +15961,7 @@ This will allow you to choose which program loads automatically, after the syste fi - #Check for changes + # Check for changes INSTALL_LOGGING_CHOICESMADE=0 if (( $INDEX_LOGGING_TARGET != $INDEX_LOGGING_CURRENT )); then @@ -16146,14 +16079,14 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p INDEX_WEBSERVER_TARGET=-2 - #Reset to current + # Reset to current else INDEX_WEBSERVER_TARGET=$INDEX_WEBSERVER_CURRENT fi - #Check for changes + # Check for changes if (( $INDEX_WEBSERVER_TARGET != $INDEX_WEBSERVER_CURRENT )); then # - Check for existing and compatible installed stacks before allowing the change @@ -16259,7 +16192,7 @@ When you select any software for install that requires a webserver, DietPi will esac - #Exit/Abort Setup + # Exit/Abort Setup else Menu_Exit @@ -16270,21 +16203,20 @@ When you select any software for install that requires a webserver, DietPi will Menu_Exit(){ - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to Main Menu - #1st run install + # 1st run install if (( $G_DIETPI_INSTALL_STAGE == 1 )); then G_WHIP_MSG 'DietPi has not fully been installed.\nThis must be completed prior to using DietPi by selecting:\n - Go Start Install.' - #Standard exit + # Standard exit elif (( $G_DIETPI_INSTALL_STAGE == 2 )); then if G_WHIP_YESNO 'Do you wish to exit DietPi-Software?\n\nAll changes to software selections will be cleared.'; then Banner_Aborted - #Exit script NOW + # Exit script NOW exit fi @@ -16295,7 +16227,7 @@ When you select any software for install that requires a webserver, DietPi will Menu_ConfirmInstall(){ - #Obtain list of pending software installation: + # Obtain list of pending software installation: local string_output='' for i in ${!aSOFTWARE_INSTALL_STATE[@]} do @@ -16309,20 +16241,19 @@ When you select any software for install that requires a webserver, DietPi will done [[ $G_SERVICE_CONTROL == 0 ]] || string_output+='\nNB: Software services will be temporarily controlled (stopped) by DietPi during this process. Please inform connected users, before continuing. SSH is not affected.' - #Confirm Software install + # Confirm Software install if G_WHIP_YESNO "DietPi is now ready to install your software choices: $string_output\n Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nWould you like to begin?"; then - #exit menu system + # Exit menu system TARGETMENUID=-1 - #Enable installation start flag + # Enable installation start flag GOSTARTINSTALL=1 else - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to Main Menu fi @@ -16330,7 +16261,7 @@ Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nW Menu_StartInstall(){ - #Check if the user has made changes to their software selections. + # Check if the user has made changes to their software selections. if (( $INSTALL_SOFTWARE_CHOICESMADE || $INSTALL_SSHSERVER_CHOICESMADE || $INSTALL_FILESERVER_CHOICESMADE || @@ -16341,7 +16272,7 @@ Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nW else - #1st run install + # 1st run install if (( $G_DIETPI_INSTALL_STAGE == 1 )); then G_WHIP_YESNO 'DietPi was unable to detect any additional software selections for install.\n @@ -16363,7 +16294,7 @@ NB: You can use dietpi-software at a later date, to install optimized software f fi - #Not 1st run + # Not 1st run elif (( $G_DIETPI_INSTALL_STAGE == 2 )); then G_WHIP_MSG 'No changes have been detected. Unable to start installation.' @@ -16374,38 +16305,35 @@ NB: You can use dietpi-software at a later date, to install optimized software f } - #TARGETMENUID=1 + # TARGETMENUID=1 Menu_Dietpi_Software(){ - #Generate Whiptail menu and store results into our software arrays + # Generate Whiptail menu and store results into our software arrays Menu_CreateSoftwareList 0 - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to Main Menu } - #TARGETMENUID=2 + # TARGETMENUID=2 Menu_Linux_Software(){ - #Generate Whiptail menu and store results into our software arrays + # Generate Whiptail menu and store results into our software arrays Menu_CreateSoftwareList 1 - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to Main Menu } - #TARGETMENUID=3 + # TARGETMENUID=3 Menu_Uninstall_Software(){ - #Return to main menu - TARGETMENUID=0 + TARGETMENUID=0 # Return to Main Menu - #Array which will hold all software IDs to be removed. + # Array which will hold all software IDs to be removed. G_WHIP_CHECKLIST_ARRAY=() - #Obtain list of installed software + # Obtain list of installed software local software_available_for_uninstall=0 for i in ${!aSOFTWARE_INSTALL_STATE[@]} do @@ -16420,12 +16348,12 @@ NB: You can use dietpi-software at a later date, to install optimized software f done - #No software installed + # No software installed if (( ! $software_available_for_uninstall )); then G_WHIP_MSG 'No software is currently installed, or, available for removal.' - #Run menu + # Run menu else G_WHIP_BUTTON_CANCEL_TEXT='Back' @@ -16526,13 +16454,13 @@ NB: You can use dietpi-software at a later date, to install optimized software f Banner_Aborted(){ - #1st run abort + # 1st run abort if (( $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/func/dietpi-banner 0 G_DIETPI-NOTIFY 1 '\n Installation aborted by user.\n Installation must be completed prior to using DietPi.\n Please run dietpi-software to restart the installation.\n' - #Standard abort + # Standard abort else /DietPi/dietpi/func/dietpi-banner 1 @@ -16545,13 +16473,13 @@ NB: You can use dietpi-software at a later date, to install optimized software f # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #-------------------------------------------------------------------------------------- - #Init software arrays + # Init software arrays Software_Arrays_Init #-------------------------------------------------------------------------------------- - #Load .installed file, update vars, if it exists + # Load .installed file, update vars, if it exists Read_InstallFileList #-------------------------------------------------------------------------------------- - #Update GLOBAL_PW + # Update GLOBAL_PW Update_Global_Pw #-------------------------------------------------------------------------------------- # - CLI input mode @@ -16561,10 +16489,10 @@ NB: You can use dietpi-software at a later date, to install optimized software f Input_Modes "$@" #-------------------------------------------------------------------------------------- - #Standard launch + # Standard launch else - #1st run dietpi-software + # 1st run dietpi-software if (( $G_DIETPI_INSTALL_STAGE == 1 )); then # - Load all automation vars From 6414af05d937ea62ad992a12cda482c0d1b50e9e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 02:48:27 +0200 Subject: [PATCH 060/253] v6.23 + DietPi-Software | Whoopsie --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 257b264d0b..65269fbb51 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -162,7 +162,7 @@ _EOF_ 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) # - 1st run automated setup only - elif (( $G_INSTALL_STATE < 2 )); then + elif (( $G_DIETPI_INSTALL_STAGE < 2 )); then GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') From 56e7e51838f8b1b866c5d7b266e33d1309d49a67 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 03:37:21 +0200 Subject: [PATCH 061/253] v6.23 + DietPi-Software | In case user cancelled password prompts on first boot, global password will not be encrypted. DietPi-Software now assures this. --- dietpi/dietpi-software | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 65269fbb51..485fc2a998 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -153,18 +153,24 @@ _EOF_ Update_Global_Pw(){ 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='' + (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' + # - Encrypted if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 - local pbkdf2='' - (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' 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) - # - 1st run automated setup only - elif (( $G_DIETPI_INSTALL_STAGE < 2 )); then + # - 1st run automated setup or user cancelled manual password choice + elif GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/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 + chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin + G_WHIP_MSG '[INFO] For security reasons your global software password has been removed from dietpi.txt and instead saved and ecrypted within: /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' fi From ffbb919966d905ed3b905ad763e6718a311381e4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 03:38:48 +0200 Subject: [PATCH 062/253] v6.23 + DietPi-Software | Syntax --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 485fc2a998..9de9a900c1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -164,7 +164,7 @@ _EOF_ 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) # - 1st run automated setup or user cancelled manual password choice - elif GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + elif GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//'); then G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/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 From ef6d3e8f83caf9ab544c3dba86fae423eedc2288 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 03:40:48 +0200 Subject: [PATCH 063/253] v6.23 + DietPi-Software | Minor --- dietpi/dietpi-software | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9de9a900c1..32d32d4836 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -169,8 +169,10 @@ _EOF_ G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/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 chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - G_WHIP_MSG '[INFO] For security reasons your global software password has been removed from dietpi.txt and instead saved and ecrypted within: /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' + G_WHIP_MSG '[INFO] For security reasons your global software password has been removed from dietpi.txt and instead saved and ecrypted within: + - /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' fi From eae4a9e80c60304555efb5139d4202ba061d6f31 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 03:46:31 +0200 Subject: [PATCH 064/253] v6.23 + DietPi-Software | Syntax --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 32d32d4836..c10f96a3c4 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15284,7 +15284,7 @@ _EOF_ # Check for unused indices local free='' - for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_INSTALL_STATE[$i]} ]] || free+=' $i'; done + for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_INSTALL_STATE[$i]} ]] || free+=" $i"; done echo "Free software ID(s): ${free:-None, so use $(($max+1))}!" From 0ae1f9e2478e14ed910c3d43c480d20057a090cf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 03:48:34 +0200 Subject: [PATCH 065/253] v6.23 + DietPi-Software | Minor --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c10f96a3c4..7903f920e3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15286,7 +15286,7 @@ _EOF_ local free='' for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_INSTALL_STATE[$i]} ]] || free+=" $i"; done - echo "Free software ID(s): ${free:-None, so use $(($max+1))}!" + echo "Free software ID(s):${free:- None, so use $(($max+1))!}" else From f29e065e080d267fcf8abf3a059548528706be95 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 13:42:39 +0100 Subject: [PATCH 066/253] Required for autostart toggle. Disabled by default now on fresh installs. --- dietpi/misc/dietpi-nordvpn | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index e794d34e6d..dc69643697 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -110,7 +110,6 @@ WantedBy=multi-user.target _EOF_ systemctl daemon-reload - G_RUN_CMD systemctl enable dietpi-nordvpn G_RUN_CMD systemctl restart dietpi-nordvpn for (( i=1; i<=$MAX_WAIT_FOR_CONNECTION; i++ )) From bf928db556c558e497dfb1a2072217538dd20fd0 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 13:47:59 +0100 Subject: [PATCH 067/253] Not required, checks during init. --- dietpi/misc/dietpi-nordvpn | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index ab6e1e4630..bfaf09cc3a 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -105,7 +105,6 @@ ExecStart=$(which openvpn) /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER WantedBy=multi-user.target _EOF_ systemctl daemon-reload - NORDVPN_SERVICE=1 G_RUN_CMD systemctl restart dietpi-nordvpn for (( i=1; i<=$MAX_WAIT_FOR_CONNECTION; i++ )) From 61681472de8cae21e24e09e19f624ad342c19e7c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 13:52:11 +0100 Subject: [PATCH 068/253] Whoopsie, got confused ;) --- dietpi/misc/dietpi-nordvpn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index bfaf09cc3a..a49360be47 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -47,7 +47,7 @@ else - TARGETMENUID=-1 + TARGETMENUID=-1 #Exit path without save. break fi @@ -105,6 +105,7 @@ ExecStart=$(which openvpn) /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER WantedBy=multi-user.target _EOF_ systemctl daemon-reload + NORDVPN_SERVICE=1 G_RUN_CMD systemctl restart dietpi-nordvpn for (( i=1; i<=$MAX_WAIT_FOR_CONNECTION; i++ )) From bfbb266a59bd88d91db5e31d50a66eac8cd6d3a7 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 14:12:49 +0100 Subject: [PATCH 069/253] Whoopsie! --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7903f920e3..d130e9f589 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7217,7 +7217,7 @@ _EOF_ Banner_Configuration # - Configs - Download_Install 'https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt.7z' /root/.config + Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt.7z" /root/.config # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf From 97279ddfc7599afdbec1e8c891beedd23b490ea4 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 17:09:15 +0100 Subject: [PATCH 070/253] Minor --- dietpi/misc/dietpi-nordvpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index a49360be47..eca7b8dfd0 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -210,7 +210,7 @@ _EOF_ else - Save_Settings + G_RUN_CMD systemctl enable dietpi-nordvpn fi From dc7b98b02737cacb1515c78f0bef5900631ffe90 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 17 Apr 2019 17:21:31 +0100 Subject: [PATCH 071/253] WAN IP + tweaks --- dietpi/misc/dietpi-nordvpn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index eca7b8dfd0..6b3e2053e7 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -34,6 +34,13 @@ NORDVPN_SERVICE=0 NORDVPN_CONNECTED=0 MAX_WAIT_FOR_CONNECTION=5 + WAN_IP='' + + Update_Wan_Ip(){ + + WAN_IP=$(curl -sLm 2 https://dietpi.com/myip.php 2>&1) + + } Init(){ @@ -65,7 +72,7 @@ NORDVPN_CONNECTED=0 #if systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'; then - [[ $(ip r s dev $NET_DEV) ]] && NORDVPN_CONNECTED=1 + ip r s dev $NET_DEV &>/dev/null && NORDVPN_CONNECTED=1 return $(( ! $NORDVPN_CONNECTED )) @@ -144,7 +151,9 @@ _EOF_ # TARGETMENUID=0 Menu_Main(){ - local text_status='Status:\n' + Update_Wan_Ip + + local text_status="Status:\n - WAN IP: $WAN_IP\n" if (( $NORDVPN_SERVICE )) && Check_Connected; then text_status+=" - Connected : $NORDVPN_SERVER\n" From b1b40efcdee602c8fcbb90ae39b8f76dde9de87c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 17 Apr 2019 23:10:04 +0200 Subject: [PATCH 072/253] v6.23 (#2718) + DietPi-Autostart | Enable systemd-logind with AmiBerry fastboot mode to have a login console ready when exiting AmiBerry + DietPi-Autostart | Minor coding and custom boot script simplification --- CHANGELOG.txt | 1 + dietpi/dietpi-autostart | 78 +++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 769b2b498a..7288daf5ae 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,6 +24,7 @@ Bug Fixes: - DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168 - DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thats to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691 - DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697 +- DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index fa97aa9b36..58c02ca4c8 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -16,16 +16,15 @@ # - dietpi-autostart int (set value only) #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Autostart' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - #Grab Input (valid integer) - INPUT=-1 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab Input (valid integer) + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=-1 #///////////////////////////////////////////////////////////////////////////////////// # MENUS @@ -36,12 +35,12 @@ Apply_Boot_Index(){ - # - Always disable LightDM + # Disable all autostart options first + # - LightDM systemctl disable lightdm &> /dev/null - # - Amiberry | always disable services, service launched by DietPi/login if non fastboot mode + # - Amiberry systemctl disable amiberry &> /dev/null - if (( $G_HW_MODEL < 10 )); then sed -i '/^[[:blank:]]*boot_delay=0/d' /DietPi/config.txt @@ -51,49 +50,54 @@ fi - # - Disable custom launch service + # - Custom script + systemctl disable dietpi-autostart_custom &> /dev/null [[ -f /etc/systemd/system/dietpi-autostart_custom.service ]] && rm /etc/systemd/system/dietpi-autostart_custom.service - # - Disable auto login + # - Auto login local fp_svc='/etc/systemd/system/getty@tty1.service.d' if [[ -d $fp_svc ]]; then [[ -f $fp_svc/dietpi-autologin.conf ]] && rm $fp_svc/dietpi-autologin.conf - [[ $(ls -A $fp_svc) ]] || rmdir $fp_svc + rmdir --ignore-fail-on-non-empty $fp_svc fi #---------------------------------------------------------------------- - #Enable autoboot options - # Custom script, service without auto login: https://github.com/MichaIng/DietPi/issues/1024 + # Enable selected autostart option + # - Custom script, service without auto login: https://github.com/MichaIng/DietPi/issues/1024 if (( $AUTO_START_INDEX == 14 )); then cat << _EOF_ > /etc/systemd/system/dietpi-autostart_custom.service [Unit] Description=DietPi-Autostart (Custom /var/lib/dietpi/dietpi-autostart/custom.sh) -After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service dietpi-postboot.service rc-local.service -Requires=dietpi-boot.service dietpi-ramdisk.service +Requisite=dietpi-boot.service +After=dietpi-boot.service dietpi-postboot.service rc-local.service +ConditionPathExists=/var/lib/dietpi/dietpi-autostart/custom.sh [Service] Type=idle -ExecStartPre=$(command -v echo) 'Starting DietPi-Autostart (Custom) script' +RemainAfterExit=yes +StandardOutput=tty ExecStartPre=$(command -v chmod) +x /var/lib/dietpi/dietpi-autostart/custom.sh +ExecStartPre=$(which echo) 'Starting DietPi-Autostart (Custom) script...' ExecStart=/var/lib/dietpi/dietpi-autostart/custom.sh -StandardOutput=tty -RemainAfterExit=yes [Install] WantedBy=multi-user.target _EOF_ - systemctl enable dietpi-autostart_custom - # Uae4arm special | fast boot via enabled service + # - Uae4arm special | fast boot via enabled service elif (( $AUTO_START_INDEX == 6 )); then systemctl enable amiberry - # - apply tweaks + # - Enable systemd-logind to have a login console ready after exiting AmiBerry from fastboot + systemctl unmask systemd-logind + systemctl enable systemd-logind &> /dev/null + + # - Apply tweaks if (( $G_HW_MODEL < 10 )); then G_CONFIG_INJECT 'boot_delay=' 'boot_delay=0' /DietPi/config.txt @@ -103,7 +107,7 @@ _EOF_ fi - # Enable auto login + # - Enable auto login elif (( $AUTO_START_INDEX > 0 )); then mkdir -p /etc/systemd/system/getty@tty1.service.d @@ -120,17 +124,17 @@ _EOF_ fi - #Save boot index, if not default 0 + # Save boot index, if not default 0 (( $AUTO_START_INDEX )) && echo $AUTO_START_INDEX > /DietPi/dietpi/.dietpi-autostart_index systemctl daemon-reload } - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ - #existing boot flag + # Existing boot flag [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && AUTO_START_INDEX=$( -1 )); do @@ -240,7 +242,7 @@ _EOF_ done - #Apply boot index + # Apply boot index elif (( $INPUT >= 0 )); then AUTO_START_INDEX=$INPUT From 0ba9eb288de9b7168905886201925cc30c5ac7fb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 18 Apr 2019 03:42:44 +0200 Subject: [PATCH 073/253] v6.23 (#2720) + DietPi-Set_swapfile | Check for unsupported file systems (BTRFS) before applying swapfile + DietPi-Set_swapfile | Rename script to represent unaffiliation from "dphys-swapfile" APT package + DietPi-Set_swapfile | Coding and wording --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/boot | 2 +- dietpi/dietpi-drive_manager | 13 +-- ...set_dphys-swapfile => dietpi-set_swapfile} | 110 ++++++++---------- dietpi/patch_file | 5 +- dietpi/preboot | 2 +- 7 files changed, 64 insertions(+), 71 deletions(-) rename dietpi/func/{dietpi-set_dphys-swapfile => dietpi-set_swapfile} (52%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7288daf5ae..39c3466208 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. Bug Fixes: +- DietPi-Set_swapfile | Resolved an issue where on first boot (and when calling the script manually) the swapfile creation is attempted on target file systems that do not support it (BTRFS). Many thanks to @mzramna for reporting this issue: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484205696 - DietPi-Config | Resolved an issue where proxy settings would not be correct after a reboot. Many thanks to @stephantual for reporting this!: https://github.com/MichaIng/DietPi/issues/2704 - DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 - DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 43cbe08705..3eaf44825b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1488,7 +1488,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Removing swapfile from image' - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap + /DietPi/dietpi/func/dietpi-set_swapfile 0 /var/swap [[ -e /var/swap ]] && rm /var/swap # still exists on some images... # - re-enable for next run diff --git a/dietpi/boot b/dietpi/boot index d2ddd649dc..09a1dd27ff 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -109,7 +109,7 @@ if (( $G_DIETPI_INSTALL_STAGE == 10 )); then # - Set swap - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" + /DietPi/dietpi/func/dietpi-set_swapfile $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" # - Run survey [[ -f /DietPi/dietpi/.dietpi-survey ]] && rm /DietPi/dietpi/.dietpi-survey diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 50a7ee7a5c..95d77e1e44 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -17,16 +17,15 @@ # #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Drive_Manager' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- #Grab Input (valid interger) - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 EXIT_CODE=0 @@ -782,7 +781,7 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} sed -i "\@[[:space:]]/[[:space:]][[:space:]]*auto@c $dev_entry / auto defaults,noatime,rw 0 1" /etc/fstab # - Disable Swap - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 + /DietPi/dietpi/func/dietpi-set_swapfile 0 rsync -aHv --delete --exclude '/boot/*' --exclude '/lost+found/' --exclude '/mnt/*' --exclude ${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}/ --exclude '/sys/*' --exclude '/proc/*' / "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}"/ if (( $? )); then @@ -796,7 +795,7 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} fi # - Recreate swap - # /DietPi/dietpi/func/dietpi-set_dphys-swapfile 1 ${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}/var/swap/.swap + # /DietPi/dietpi/func/dietpi-set_swapfile 1 ${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}/var/swap/.swap # Manually update location # sed -i "/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/c\AUTO_SETUP_SWAPFILE_LOCATION=/var/swap" /DietPi/dietpi.txt @@ -1318,7 +1317,7 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} local fp_target_swapfile="${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}/.swapfile" [[ ${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]} == '/' ]] && fp_target_swapfile='/var/swap' - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $G_WHIP_RETURNED_VALUE "$fp_target_swapfile" + /DietPi/dietpi/func/dietpi-set_swapfile $G_WHIP_RETURNED_VALUE "$fp_target_swapfile" fi diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_swapfile similarity index 52% rename from dietpi/func/dietpi-set_dphys-swapfile rename to dietpi/func/dietpi-set_swapfile index 778f3a8463..f6747eb501 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_swapfile @@ -14,38 +14,24 @@ # Usage: # - $1 = 0=disable, 1=enable+autosize, >=2=enable+size # - $2 = optional location - # - /DietPi/dietpi/func/dietpi-set_dphys-swapfile = Print current swap size and location + # - /DietPi/dietpi/func/dietpi-set_swapfile = Print current swap size and location #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Swapfile' + G_PROGRAM_NAME='DietPi-Set_swapfile' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- SWAP_SIZE=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - SWAP_LOCATION="$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" + SWAP_LOCATION=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - SWAP_SIZE_TARGET=$SWAP_SIZE - disable_error=1 G_CHECK_VALIDINT "$1" && SWAP_SIZE_TARGET=$1 - - SWAP_LOCATION_TARGET="$SWAP_LOCATION" - [[ $2 ]] && SWAP_LOCATION_TARGET=$2 - - Delete_Swapfile(){ - - G_RUN_CMD swapoff -a - G_DIETPI-NOTIFY 2 "Deleting existing swapfile ($SWAP_LOCATION)" - [[ -f $SWAP_LOCATION ]] && rm "$SWAP_LOCATION" - sed -i '/[[:blank:]]swap[[:blank:]]/d' /etc/fstab - systemctl daemon-reload - - } + disable_error=1 G_CHECK_VALIDINT "$1" && SWAP_SIZE_TARGET=$1 || SWAP_SIZE_TARGET=$SWAP_SIZE + [[ $2 ]] && SWAP_LOCATION_TARGET=$2 || SWAP_LOCATION_TARGET=$SWAP_LOCATION Update_DietPi_Conf(){ - # DietPi.txt G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_SIZE=' "AUTO_SETUP_SWAPFILE_SIZE=$SWAP_SIZE" /DietPi/dietpi.txt G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_LOCATION=' "AUTO_SETUP_SWAPFILE_LOCATION=$SWAP_LOCATION" /DietPi/dietpi.txt @@ -53,17 +39,17 @@ Update_Tmp(){ - #Set /tmp to 50% of RAM+SWAP: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369373082 + # Set /tmp to 50% of RAM+SWAP: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369373082 local mem_total=$(free -m | mawk '/Mem:/ {print $2;exit}') local swap_size=$(free -m | mawk '/Swap:/ {print $2;exit}') local tmp_target_size="$(( ( $mem_total + $swap_size ) / 2 ))M" G_DIETPI-NOTIFY 2 "Setting /tmp tmpfs size: $tmp_target_size" - sed -i -e "/[[:blank:]]\/tmp[[:blank:]]/ctmpfs \/tmp tmpfs defaults,size=$tmp_target_size,noatime,nodev,nosuid,mode=1777 0 0" /etc/fstab + sed -i "/[[:blank:]]\/tmp[[:blank:]]/ctmpfs \/tmp tmpfs defaults,size=$tmp_target_size,noatime,nodev,nosuid,mode=1777 0 0" /etc/fstab systemctl daemon-reload - mount -a - G_RUN_CMD mount -o remount,size=$tmp_target_size tmpfs /tmp + mount -a # Required if /tmp was somehow not mounted before. Will be skipped if already mounted + G_RUN_CMD mount -o remount /tmp # Required to apply new settings/size. "remount" required to preserve current content, or, doubled mount } @@ -71,66 +57,67 @@ G_DIETPI-NOTIFY 0 'Disable swapfile' - Delete_Swapfile + G_RUN_CMD swapoff -a + if [[ -f $SWAP_LOCATION ]]; then + + G_DIETPI-NOTIFY 2 "Deleting existing swapfile: $SWAP_LOCATION" + rm "$SWAP_LOCATION" + + fi + sed -i '/[[:blank:]]swap[[:blank:]]/d' /etc/fstab SWAP_SIZE=0 SWAP_LOCATION='/var/swap' - Update_DietPi_Conf - Update_Tmp - } Swap_Enable(){ - # - Create temp file for freespace check, and, fs_type scrape - > "$SWAP_LOCATION_TARGET" + local swap_dir="${SWAP_LOCATION_TARGET%/*}/" + local fs_type=$(findmnt -n -o FSTYPE -T "$swap_dir") - #Free spacey, checkey weckey - if ! G_CHECK_FREESPACE "$SWAP_LOCATION_TARGET" $SWAP_SIZE_TARGET; then + # Exclude devices + # - BBB + if (( $G_HW_MODEL == 71 )); then - G_DIETPI-NOTIFY 1 'Unable to generate swapfile due to insufficient disk space. Swap has be disabled.' + G_DIETPI-NOTIFY 1 "Disabled swapfile generation for: $G_HW_MODEL_DESCRIPTION" - #Exclude devices - # - BBB - elif (( $G_HW_MODEL == 71 )); then + # Exclude file systems + elif [[ $fs_type == 'btrfs' ]]; then + + G_DIETPI-NOTIFY 1 "Swapfile not supported on file system: $fs_type" + + # Free spacey, checkey weckey + elif ! G_CHECK_FREESPACE "$swap_dir" $SWAP_SIZE_TARGET; then - G_DIETPI-NOTIFY 2 "Disabled swapfile generation for $G_HW_MODEL_DESCRIPTION" + G_DIETPI-NOTIFY 1 'Unable to generate swapfile due to insufficient disk space. Swap has been disabled.' - #Create new swappey whappey + # Create new swappey whappey else SWAP_SIZE=$SWAP_SIZE_TARGET - SWAP_LOCATION="$SWAP_LOCATION_TARGET" + SWAP_LOCATION=$SWAP_LOCATION_TARGET G_DIETPI-NOTIFY 0 'Generating new swapfile' G_DIETPI-NOTIFY 2 "Size = $SWAP_SIZE MB" G_DIETPI-NOTIFY 2 "Location = $SWAP_LOCATION" - local fs_type="$(findmnt -n -o FSTYPE -T $SWAP_LOCATION)" - - #Pre-allocate for filesystems which do no support quick-allocate with fallocate + # - Pre-allocate for filesystems which do no support quick-allocate with fallocate if [[ $fs_type == 'f2fs' || $fs_type == 'xfs' || $fs_type == 'vfat' ]]; then - G_RUN_CMD dd if=/dev/zero of=$SWAP_LOCATION bs=4K count=$(( $SWAP_SIZE * 1024 / 4 )) + G_RUN_CMD dd if=/dev/zero of="$SWAP_LOCATION" bs=4K count=$(( $SWAP_SIZE * 1024 / 4 )) else - G_RUN_CMD fallocate -l $SWAP_SIZE'M' $SWAP_LOCATION + G_RUN_CMD fallocate -l $SWAP_SIZE'M' "$SWAP_LOCATION" fi - G_RUN_CMD mkswap $SWAP_LOCATION + G_RUN_CMD mkswap "$SWAP_LOCATION" chmod 600 "$SWAP_LOCATION" + G_RUN_CMD swapon "$SWAP_LOCATION" - G_RUN_CMD swapon $SWAP_LOCATION - - cat << _EOF_ >> /etc/fstab -$SWAP_LOCATION none swap sw 0 0 -_EOF_ - - Update_DietPi_Conf - Update_Tmp + echo "$SWAP_LOCATION none swap sw 0 0" >> /etc/fstab fi @@ -139,25 +126,28 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Info mode - Print Size / Location + # Info mode - Print Size / Location if [[ ! $1 ]]; then - echo -e "$SWAP_SIZE $SWAP_LOCATION" + echo "$SWAP_SIZE $SWAP_LOCATION" - #Remove/Create swap + # Remove/Create swap else G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Apply' - #Always reset/remove existing swap + # - Always reset/remove existing swap Swap_Disable - #Auto size? + # - Auto size? (( $SWAP_SIZE_TARGET == 1 )) && SWAP_SIZE_TARGET=$(( 2048 - $(free -m | mawk '/Mem:/ {print $2;exit}') )) - #Configure new swapfile? + # - Configure new swapfile? (( $SWAP_SIZE_TARGET > 0 )) && Swap_Enable + Update_DietPi_Conf + Update_Tmp + fi #----------------------------------------------------------------------------------- exit 0 diff --git a/dietpi/patch_file b/dietpi/patch_file index 8238011936..4a9909f3ca 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -370,7 +370,7 @@ _EOF_ #Re-Apply swap to set /tmp tmpfs size: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369435049 # + Force auto swapfile size https://github.com/MichaIng/DietPi/issues/1593#issuecomment-371516418 - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 1 + /DietPi/dietpi/func/dietpi-set_swapfile 1 G_AGP dphys-swapfile #------------------------------------------------------------------------------- @@ -1730,6 +1730,9 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" fi #------------------------------------------------------------------------------- + # dietpi-set_dphys-swapfile renamed to: "dietpi-set_swapfile": https://github.com/MichaIng/DietPi/pull/2720 + rm -f /{DietPi,boot}/dietpi/func/dietpi-set_dphys-swapfile + #------------------------------------------------------------------------------- if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 diff --git a/dietpi/preboot b/dietpi/preboot index 718a35db10..4c401ff52e 100644 --- a/dietpi/preboot +++ b/dietpi/preboot @@ -83,7 +83,7 @@ # Automation #---------------------------------------------------------------- # - Generate Swapfile - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" + /DietPi/dietpi/func/dietpi-set_swapfile $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" # - Apply Timezone local autoinstall_timezone=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_TIMEZONE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') From 78224a61698906b72d27d180ca5eebf8502a8c31 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 18 Apr 2019 14:12:05 +0100 Subject: [PATCH 074/253] Fix LXQT under VNC. Remove /usr/bin, default entry in $PATH already. --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d130e9f589..51c262b288 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9696,12 +9696,12 @@ _EOF_ #DESKTOP_LXDE if (( ${aSOFTWARE_INSTALL_STATE[23]} >= 1 )); then - cmd_launch_desktop='/usr/bin/lxsession -s LXDE &' + cmd_launch_desktop='lxsession -s LXDE &' #DESKTOP_MATE elif (( ${aSOFTWARE_INSTALL_STATE[24]} >= 1 )); then - cmd_launch_desktop='/usr/bin/mate-session &' + cmd_launch_desktop='mate-session &' #DESKTOP_GNUSTEP elif (( ${aSOFTWARE_INSTALL_STATE[26]} >= 1 )); then @@ -9711,12 +9711,12 @@ _EOF_ #DESKTOP_XFCE elif (( ${aSOFTWARE_INSTALL_STATE[25]} >= 1 )); then - cmd_launch_desktop='/usr/bin/xfce4-session &' + cmd_launch_desktop='xfce4-session &' #DESKTOP_LXQT elif (( ${aSOFTWARE_INSTALL_STATE[173]} >= 1 )); then - cmd_launch_desktop='/usr/bin/lxqt-session &' + cmd_launch_desktop='startlxqt &' fi From 2325c39fb201b58983481f3f035faefa99140ac8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 18 Apr 2019 14:16:18 +0100 Subject: [PATCH 075/253] LXQt: Install a basic notepad GUI (leafpad) by default. --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 51c262b288..319afc2b27 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3234,7 +3234,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' #G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad fi @@ -12738,7 +12738,7 @@ _EOF_ Banner_Uninstalling - G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver + G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm -R $HOME/.config/lxqt fi From 46e11eeefbd7dad1f6ec623055f95c6325e4ea79 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 18 Apr 2019 14:18:06 +0100 Subject: [PATCH 076/253] Minor, LXQt, fit DietPi wallpaper to screen res. --- .conf/desktop/lxqt.7z | Bin 4208 -> 4208 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.conf/desktop/lxqt.7z b/.conf/desktop/lxqt.7z index a83ff813d240633e49c0597fb40935d7dda6367e..119d1045a9d44aeb0c34bc516d333059125b4780 100644 GIT binary patch delta 888 zcmV-;1Bd+ZAn+g{H+sCUCma9-eLFoKEf4?z00000BLDyZ00000Gc@)ou^@vB13UvE zv!)AJ0e_XYtU;AX4Mg}9bmG*rgVolYIG2AtUm?XY{U7{WL6!`sL18m}_?P6)cG4YB zh-6^PKch-C5Fcxb1eb3h+CRknv(@Y!0Tu$kPx(&yY=1vFff$Tlz)+9<8O}|+RTr&| z^8G&p?lx0dhzA)p#K;%v#7(H*DNlzfG{Jp4+JC5_lcCdZ}P_-PqQI;)AO zWN6IoA;urTXhBqqvCQQvl~f59hlj}h0cEEmZ&nZzDnDVt#G%bYKngwb2wfut&hJJA zNx&j_6Jl7f8I{_1FcSCQH3FrtX;nfp zp`rVLI?(PYpx$DGuoy_mypU2kSxHv+>`ti=n1{jU_MUDuV{}vt7F^cNz5`9jG=xjBV{*c>t5d2Ev1wCOA?zEbkBLG7x$Sh)uD)g;MRL@BGK#s zlgJJp171q=lj#l~fAZeFi3q*)aJb@;Ts&KG>@CnXH3B@dWInP& zwzB3?*&fC}%WP#YH3IK4Wa`Z-=Gxx3wvBk?g&}l*a@1V5)3ut+mfFTcRbF`Ngj5js z%CQd0^2P6{;#C}LHJ)dI?wcd0<=GJM-He@1MJ$am_uL0We_<~$_U4{z3pAGNPcLx9 zc%b&VGZraE<0>odUB&;3E&~}8)Fe)UKck-e)7w<~B0{nS6K{BoWF~rciY(dOgC9C9 z!p2wut`$gBYU6>S_~@pA#1DF9Q=N*{vEdT|!N{kaG7gXpMiZIrjg~ned3p4`#ln4Z z&^PU~h(`kHYPhlG-GwS3aaAcs)B!Q1NI7I`(r_6(^P|MUeutazJ+MqI$s&LnnmROG zep`BDv~+j0zl&WucQKpZoFLC8&~`K@0H6Q>7Y2^10SSSF00#>J00AQd0RaVF01yBG O41?MV0r6DM3;+PR^q5}& delta 888 zcmV-;1Bd+ZAn+g{H+sCUCma9-FT@B7Ef4?z00000BLDyZ00000>H3$Pu^@vB13v>G zv!)AJ0e^(;kCi)e%IqqVtv#vGU0A6Z{%W3!#_5Z9>D8_L9TjA{gl7+sOo+K^h|uik zdDGBn?7$b2_m}g@I?Df=F{RvduK}m``cXSKxG+nY?}c69u7V^f2RqW9TeNDnc3@<` z(+pB_DE3wxMR_nZ>4*x51Mr9d_E>)!y88l@1b>62txF|OR7#+(-FWm=QE%(~VHt)# zZj8MuC)yU;0$HM{=MM4_E@P(~74s+Go^SYT^CYity+M+9-Nk=T!EyRpN*1TO2eG72 zn^=bXBMil*6@u=YcY{NX8j7W{)Aks|b;T1hs2rBlt1-n6pzPfSCVltPFL(re8yrky z3V-vM$ITykC6XY0=(^s5;P{iPAzd;D<946|K^jt4O-YwN`Tm@qbk_^1S>A8Z8O4F9 zlKD0yd}qtYLXZ2;rP@$FA_LNZpom}y4pVzr*d%UW`9@_{e6rV=0pY*E{QyN)KNNT@ zN=$$eHE#3Vfr+!xj39%Suu&JV+wZL;tW9S4sn#IVm5eEq&t<(=P~wpW)<^b;euXRL zX?qk^A-yNi6j-Qv`bWZMbl`G=%(o~Ca%0o(Xnw64jvSO(0sUN|-a5#&klxBMAh?o~ z$qpU^M;l|4>JA=%^!bA?`FXk+PH)5J8x+v|DnOQpF=xw)exFb!S>ZnJV^DE0fKZxTWR^pYARi|~LLNcsT<(^=H{ zL|LwvVclIrfB4}v4g$KSdfR~K2;I=AESwXizJE0V0!h_>E&#&#R2>xLHD!3>XugB3 z%lk*8`Pt@#i;yZZ!q%7z+zPr324otFdrGDQfU_MnXlc!ah?t!TgjN$^)Bfe&+^K%o zNSoxtFlYC*k@QFIS2~ly==)AAN&a%(JUkmg4@J6?3m>`xVvvC6|4cwi^05Pz1*UWCh3XO?X=hRM@4$-+M)=^Rbg>X;f4ViYyVIPhtF>T^j6X zN}1h%L_#CgO6IL*xn$WPV*vkPKh?$@000007Y2^00SSSG00#>J00AQd0RaVF01yBG O41?MV0aBGwr2qhS)}apo From 4cf97648c2e793a8f62cccc8878724ae69eef0ee Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 18 Apr 2019 17:59:23 +0200 Subject: [PATCH 077/253] v6.23 + DietPi-Software | WiFi Hotspot: Use new "INTERFACESv4" variable for isc-dhcp-server environment. "INTERFACES" is deprecated, currently migrated automatically but this will be skipped in future updates. + DietPi-Software | WiFi Hotspot: Minor coding --- dietpi/dietpi-software | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 319afc2b27..e0854c5d1f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10238,14 +10238,12 @@ subnet 192.168.42.0 netmask 255.255.255.0 { _EOF_ # - Assign wlan as interface for dhcp server. - cat << _EOF_ > /etc/default/isc-dhcp-server -INTERFACES="wlan$wifi_index" -_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 - # - enable up wlan + # - Enable up wlan sed -i "/allow-hotplug wlan/c\allow-hotplug wlan$wifi_index" /etc/network/interfaces # - Add wifi settings to network interfaces config @@ -10262,38 +10260,31 @@ up iptables-restore < /etc/iptables.ipv4.nat _EOF_ # - Assign static IP for wlan now - #ifconfig wlan$wifi_index 192.168.42.1 - ip addr add 192.168.42.1 dev wlan$wifi_index + ip a add 192.168.42.1 dev wlan$wifi_index # - Create access point config G_BACKUP_FP /etc/hostapd/hostapd.conf cat << _EOF_ > /etc/hostapd/hostapd.conf interface=wlan$wifi_index driver=nl80211 -ssid=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=' /DietPi/dietpi.txt | sed 's/^.*=//') +ssid=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') hw_mode=g -channel=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=' /DietPi/dietpi.txt | sed 's/^.*=//') +channel=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 -wpa_passphrase=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=' /DietPi/dietpi.txt | sed 's/^.*=//') +wpa_passphrase=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') 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 - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - - sed -i "/^driver=/c\driver=rtl871xdrv" /etc/hostapd/hostapd.conf - - fi + (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf # - Enable access point config - cat << _EOF_ > /etc/default/hostapd -DAEMON_CONF="/etc/hostapd/hostapd.conf" -_EOF_ + echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"" > /etc/default/hostapd # - Enable IP forwarding echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-wifihotspot.conf @@ -10307,18 +10298,12 @@ _EOF_ # - Save IP tables, applied during ifup in /etc/network/interfaces. iptables-save > /etc/iptables.ipv4.nat - # - RPi 3 - onboard wifi, enable N - if (( $G_HW_MODEL == 3 && ! $WIFIHOTSPOT_RTL8188C_DEVICE )); then - - # - Add Wireless N support - G_CONFIG_INJECT 'ieee80211n=' 'ieee80211n=1' /etc/hostapd/hostapd.conf - - fi + # - RPi 3 Onboard WiFi: Enable N support + (( $G_HW_MODEL == 3 && ! $WIFIHOTSPOT_RTL8188C_DEVICE )) && G_CONFIG_INJECT 'ieee80211n=' 'ieee80211n=1' /etc/hostapd/hostapd.conf fi - #TORHOTSPOT - software_id=61 + software_id=61 # Tor Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration From 14686f6bc382f28cc18f10107110a6a8dcccbc10 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 18 Apr 2019 18:43:32 +0200 Subject: [PATCH 078/253] v6.23 + DietPi-Config | WiFi country code: Wait for 0.1 seconds to apply, before checking success. As well abort, if either user cancelled manual input box or entered an invalid country code. + DietPi-Config | WiFi country code: Minor coding --- dietpi/dietpi-config | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index d3e1dde9c4..e7811b56a1 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2585,30 +2585,16 @@ _EOF_ ) G_WHIP_DEFAULT_ITEM=$WIFI_COUNTRYCODE - G_WHIP_MENU 'Please select a country, to enable WiFi channels and power ratings allowed in your country.' - if (( $? == 0 )); then - - case "$G_WHIP_RETURNED_VALUE" in - - 'Manual') - - G_WHIP_DEFAULT_ITEM=$WIFI_COUNTRYCODE - G_WHIP_INPUTBOX "Please enter a 2 character country code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2" - if (( $? == 0 )); then - - wifi_country_code_target=$G_WHIP_RETURNED_VALUE - - fi - - ;; - - *) + if G_WHIP_MENU 'Please select a country, to enable WiFi channels and power ratings allowed in your country.'; then - wifi_country_code_target=$G_WHIP_RETURNED_VALUE + if [[ $G_WHIP_RETURNED_VALUE == 'Manual' ]]; then - ;; + G_WHIP_DEFAULT_ITEM=$WIFI_COUNTRYCODE + G_WHIP_INPUTBOX 'Please enter a 2 character country code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2' || return + [[ $G_WHIP_RETURNED_VALUE == [A-Z][A-Z] ]] || { G_WHIP_MSG '[ERROR] Invalid country code. Aborting...'; return; } - esac + fi + wifi_country_code_target=$G_WHIP_RETURNED_VALUE /DietPi/dietpi/func/dietpi-set_hardware wificountrycode "$wifi_country_code_target" @@ -2620,6 +2606,8 @@ _EOF_ iw reg set $wifi_country_code_target # - Check if country code was successfully applied + # Wait a bid until setting got applied + sleep 0.1 WIFI_COUNTRYCODE=$(iw reg get | mawk '/country/ {print $2;exit}' | tr -d ':') if [[ $WIFI_COUNTRYCODE != $wifi_country_code_target ]]; then @@ -2633,7 +2621,7 @@ _EOF_ Wifi_Reconnect(){ - G_WHIP_YESNO "WiFi will connect to the strongest configured SSID that is secure, with an open SSID being the last priority.\n\nSave all changes and restart networking?\n\nNB: All WiFi connections will be dropped!" + G_WHIP_YESNO 'WiFi will connect to the strongest configured SSID that is secure, with an open SSID being the last priority.\n\nSave all changes and restart networking?\n\nNB: All WiFi connections will be dropped!' (( $? == 0 )) && Network_ApplyChanges } From ccb4f5098edccbee75d07fc0135e5a7862f60715 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 18 Apr 2019 18:56:31 +0200 Subject: [PATCH 079/253] v6.23 + DietPi-Config | WiFi country code: "[A-Z]" matches non-capital letters as well. Use "[[:upper:]]" instead. Show entered invalid country code in case. --- dietpi/dietpi-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index e7811b56a1..a61dc9314a 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2591,7 +2591,7 @@ _EOF_ G_WHIP_DEFAULT_ITEM=$WIFI_COUNTRYCODE G_WHIP_INPUTBOX 'Please enter a 2 character country code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2' || return - [[ $G_WHIP_RETURNED_VALUE == [A-Z][A-Z] ]] || { G_WHIP_MSG '[ERROR] Invalid country code. Aborting...'; return; } + [[ $G_WHIP_RETURNED_VALUE == [[:upper:]][[:upper:]] ]] || { G_WHIP_MSG "[ERROR] Invalid country code ($G_WHIP_RETURNED_VALUE). Aborting..."; return; } fi wifi_country_code_target=$G_WHIP_RETURNED_VALUE From e05a496178b5e5d3337eb30393effce907ec4c0e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 18 Apr 2019 22:31:53 +0200 Subject: [PATCH 080/253] v6.23 (#2722) + DietPi-Software | Plex Media Server: Install via new official APT repo + DietPi-Software | Plex Media Server: Consistent method to apply APT keys, via "curl" (+silent+errors+redirects) which is slightly faster then "wget" + DietPi-Patch | Migrate Plex systemd (from dev2day) to new official APT repo --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 81 ++++++++++++++++++------------------------ dietpi/patch_file | 9 +++-- 3 files changed, 43 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 39c3466208..e545c03ecb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Subsonic: Runs now as limited user "subsonic". This change is as well applied to existing installs via patch during DietPi-Update: https://github.com/MichaIng/DietPi/pull/2705 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. +- DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 Bug Fixes: - DietPi-Set_swapfile | Resolved an issue where on first boot (and when calling the script manually) the swapfile creation is attempted on target file systems that do not support it (BTRFS). Many thanks to @mzramna for reporting this issue: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484205696 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e0854c5d1f..09e6272dc2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -699,11 +699,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=42 - aSOFTWARE_WHIP_NAME[$software_id]='Plex Media Server' - aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' + aSOFTWARE_WHIP_NAME[$software_id]='Plex Media Server' + aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' # - Disable for ARMv6: https://github.com/MichaIng/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -3983,7 +3983,7 @@ _EOF_ # - This needs to be done prior to APT install, since this would otherwise install a default config file as well. [[ -f /etc/mopidy/mopidy.conf ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf - wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - # No Buster list available yet, use stretch.list for testing: if (( $G_DISTRO > 3 )); then @@ -4717,8 +4717,7 @@ _EOF_ fi - #InfluxDB - software_id=74 + software_id=74 # InfluxDB if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4726,7 +4725,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://repos.influxdata.com/influxdb.key' G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - echo "deb https://repos.influxdata.com/debian $G_DISTRO_NAME stable" > /etc/apt/sources.list.d/influxdb.list G_AGUP @@ -4734,8 +4733,7 @@ _EOF_ fi - #Grafana - software_id=77 + software_id=77 # Grafana if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4751,7 +4749,7 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - curl -sL "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - # APT repo source & update echo "$deb_address" > /etc/apt/sources.list.d/grafana.list @@ -5251,27 +5249,19 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing - # Derive latest version from: https://plex.tv/pms/downloads/5 - INSTALL_URL_ADDRESS='https://plex.tv/pms/downloads/5' + # Apply APT key + INSTALL_URL_ADDRESS='https://downloads.plex.tv/plex-keys/PlexSign.key' G_CHECK_URL "$INSTALL_URL_ADDRESS" + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - - # ARMv7 - local arch='armhf' - - # ARMv8 - if (( $G_HW_ARCH == 3 )); then - - arch='arm64' - - # x86_64 - elif (( $G_HW_ARCH == 10 )); then + # Apply APT repo + echo 'deb https://downloads.plex.tv/repo/deb public main' > /etc/apt/sources.list.d/plexmediaserver.list - arch='amd64' - - fi + # Update APT lists + G_AGUP - # Derive URL from arch - no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "distro=\"debian\".*$arch\.deb" | cut -d \" -f 8)" + # Install PMS + G_AGI plexmediaserver fi @@ -5649,19 +5639,20 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing - if (( $G_DISTRO == 3 )); then #https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002 + if (( $G_DISTRO == 3 )); then # https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002 - INSTALL_URL_ADDRESS='http://davesteele.github.io/cloudprint-service' - - # url/redirect fails wget spider test... + # Apply APT key + INSTALL_URL_ADDRESS='https://davesteele.github.io/key-366150CE.pub.txt' G_CHECK_URL "$INSTALL_URL_ADDRESS" + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - - INSTALL_URL_ADDRESS+='/repo' + # Apply APT repo + echo 'deb https://davesteele.github.io/cloudprint-service/repo cloudprint-jessie main' > /etc/apt/sources.list.d/cloudprint.list - echo -e "deb $INSTALL_URL_ADDRESS cloudprint-jessie main" > /etc/apt/sources.list.d/cloudprint.list - wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - + # Update APT lists G_AGUP + # Install CloudPrint G_AGI cloudprint-service else @@ -6202,7 +6193,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' G_CHECK_URL "$INSTALL_URL_ADDRESS" - wget -O - "$INSTALL_URL_ADDRESS" | apt-key add - + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - echo 'deb https://dtcooper.github.io/raspotify jessie main' > /etc/apt/sources.list.d/raspotify.list G_AGUP @@ -14039,14 +14030,13 @@ _EOF_ fi - software_id=58 + software_id=58 # OpenBazaar if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - - rm /etc/systemd/system/openbazaar.service - rm -R $G_FP_DIETPI_USERDATA/go/src/github.com/OpenBazaar - rm -R /etc/openbazaar-server &> /dev/null # Pre v6.15 OB1.0 + [[ -f '/etc/systemd/system/openbazaar.service' ]] && rm /etc/systemd/system/openbazaar.service + [[ -d $G_FP_DIETPI_USERDATA/go/src/github.com/OpenBazaar ]] && rm -R $G_FP_DIETPI_USERDATA/go/src/github.com/OpenBazaar + [[ -d '/etc/openbazaar-server' ]] && rm -R /etc/openbazaar-server # Pre v6.15 OB1.0 fi @@ -14054,10 +14044,9 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP $(dpkg --get-selections plexmediaserver* | mawk '{print $1}') - [[ -d /etc/systemd/system/plexmediaserver.service.d ]] && rm -R /etc/systemd/system/plexmediaserver.service.d # post v6.17 - [[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver # pre v6.22 Plex v1.15 - [[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP # pre v6.22 + G_AGP plexmediaserver + [[ -d '/var/lib/plexmediaserver' ]] && rm -R /var/lib/plexmediaserver # Left over from purging package, still... + [[ -d '/etc/systemd/system/plexmediaserver.service.d' ]] && rm -R /etc/systemd/system/plexmediaserver.service.d fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 4a9909f3ca..f2782b2728 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1756,10 +1756,15 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' sed -i '/^ListenPort/a\PostDown = ip6tables -D FORWARD -i %i -j ACCEPT; ip6tables -t nat -D POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf fi - #Reinstalls + #----------------------------------------------------------------------- + # Reinstalls # Subsonic: https://github.com/MichaIng/DietPi/pull/2705 [[ -L '/var/subsonic/transcode' ]] && rm /var/subsonic/transcode - /DietPi/dietpi/dietpi-software reinstall 34 + # Plex Media Server: https://github.com/MichaIng/DietPi/pull/2722 + dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer + [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list + + /DietPi/dietpi/dietpi-software reinstall 34 42 fi #------------------------------------------------------------------------------- From ca62698b521c62cf8ef1042f52b1c9f043e70d0c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 02:26:58 +0200 Subject: [PATCH 081/253] v6.23 + DietPi-Software | Never error handle file removal on uninstall. Do existence check first, in case of multiple files via curly braces match use "-f" to ignore missing files. Even with relatively long LXDE usage, /root/.config/lxsession (I believe) did not exist. + DietPi-Software | Replace all /root aliases ($Home/~) with /root, since we do not allow to run this script with any other user anyway. + DietPi-Software | dietpi-set_dphys-swapfile has been renamed to dietpi-set_swapfile --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 09e6272dc2..a263321e08 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4292,7 +4292,7 @@ _EOF_ $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') < 512 )); then G_DIETPI-NOTIFY 2 'Increasing swapfile size to 512MB before running gravity.sh, please wait...\n' - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512 + /DietPi/dietpi/func/dietpi-set_swapfile 512 fi @@ -12705,7 +12705,7 @@ _EOF_ Banner_Uninstalling G_AGP lxde $(dpkg --get-selections lxde-* | mawk '{print $1}') upower policykit-1 firefox-esr - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm -R $HOME/.config/{lxpanel,lxsession,lxterminal} + rm -Rf /root/.config/{lxpanel,lxsession,lxterminal} fi @@ -12715,7 +12715,7 @@ _EOF_ Banner_Uninstalling G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD rm -R $HOME/.config/lxqt + [[ -d '/root/.config/lxqt' ]] && rm -R /root/.config/lxqt fi From eccef6700381c3f044ec4d435beb167736db0bb4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 16:44:36 +0200 Subject: [PATCH 082/253] v6.23 + DietPi-Software | Logitech Media Server: Install current nightly as suggested in docs/wiki, since there are no "public releases" done anymore + DietPi-Software | Logitech Media Server: Rename in software list away from outdated "Squeezebox Server", do this for our systemd service as well + DietPi-Software | Logitech Media Server: Skip installed libraries since the new package comes with dependencies, installed automatically via G_AGF. In case additional libraries are still required for certain modules, we will (re)add them on demand. + DietPi-Software | Logitech Media Server: Run now as pre-installed "squeezeboxserver" user, grant access to audio devices and media files as usual and according to the docs/wiki + DietPi-Software | Logitech Media Server: Update systemd unit according to shipped SysVinit service, implement restart on failure with 5 seconds sleep, as done by the "squeezeboxserver_safe" binary wrapper that is used by the SysVinit service --- dietpi/dietpi-software | 100 ++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 56 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a263321e08..fff1399427 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -631,21 +631,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=35 - aSOFTWARE_WHIP_NAME[$software_id]='SqueezeBox' - aSOFTWARE_WHIP_DESC[$software_id]='logitech media server (lms)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' + aSOFTWARE_WHIP_NAME[$software_id]='Logitech Media Server' + aSOFTWARE_WHIP_DESC[$software_id]='aka LMS, Squeezebox Server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' #------------------ software_id=36 - aSOFTWARE_WHIP_NAME[$software_id]='SqueezeLite' - aSOFTWARE_WHIP_DESC[$software_id]='audio player for lms & squeezebox' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' + aSOFTWARE_WHIP_NAME[$software_id]='SqueezeLite' + aSOFTWARE_WHIP_DESC[$software_id]='audio player for lms & squeezebox' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' #------------------ software_id=37 @@ -4606,39 +4606,22 @@ _EOF_ fi - #SQUEEZEBOXSERVER - software_id=35 + software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - ARMv8 under ARMv6/7 - if (( $G_HW_ARCH == 3 )); then - - dpkg --add-architecture armhf - G_AGUP - - fi - - Download_Install 'https://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.1_all.deb' - - # - ARMv8, CPAN - if (( $G_HW_ARCH == 3 )); then - - if (( $G_DISTRO == 3 )); then - - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip' - - else + # Instructions: http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 + # - Grab architecture + local arch='arm' + (( $G_HW_ARCH == 10 )) && arch='amd64' - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.1_CPAN-armv8-stretch.zip' - - fi - - DEPS_LIST='libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev' # shared libs needed for Image::Scale@0.08 - Download_Install "$INSTALL_URL_ADDRESS" /usr/share/squeezeboxserver + # - Grab URL for the latest package (nightly) + INSTALL_URL_ADDRESS="https://www.mysqueezebox.com/update/?version=7.9.2&revision=1&geturl=1&os=deb$arch" + G_CHECK_URL "$INSTALL_URL_ADDRESS" - fi + # - Install, failsafe checking this URL again + Download_Install "$(curl -s "$INSTALL_URL_ADDRESS")" fi @@ -9446,33 +9429,38 @@ _EOF_ fi - #SQUEEZEBOXSERVER - software_id=35 + software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Remove bundled service + # Remove bundled SysVinit service systemctl stop logitechmediaserver &> /dev/null - killall -w squeezeboxserver &> /dev/null #provided service may not wait for exit, kill: https://github.com/MichaIng/DietPi/issues/1613#issuecomment-372787574 - + systemctl disable logitechmediaserver &> /dev/null + killall -qwr squeezeboxserver* # Provided service may not wait for exit, kill: https://github.com/MichaIng/DietPi/issues/1613#issuecomment-372787574 update-rc.d logitechmediaserver remove &> /dev/null - rm /etc/init.d/logitechmediaserver &> /dev/null + [[ -f '/etc/init.d/logitechmediaserver' ]] && rm /etc/init.d/logitechmediaserver + [[ -f '/etc/default/logitechmediaserver' ]] && rm /etc/default/logitechmediaserver - #Service - cat << _EOF_ > /etc/systemd/system/squeezeboxserver.service + # Grant user access to audio devices and DietPi media files + usermod -aG audio,dietpi squeezeboxserver + + # systemd service + cat << _EOF_ > /etc/systemd/system/logitechmediaserver.service [Unit] -Description=Squeezebox Server/LMS (DietPi) +Description=Logitech Media Server (DietPi) [Service] -Type=simple -ExecStart=$(command -v squeezeboxserver) --prefsdir /var/lib/squeezeboxserver/prefs --logfile /var/log/squeezeboxserver/error.log --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --user root +User=squeezeboxserver +ExecStart=$(command -v squeezeboxserver) --prefsdir /var/lib/squeezeboxserver/prefs --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --charset=utf8 --logfile /var/log/squeezeboxserver/error.log +Restart=on-failure +RestartSec=5 [Install] WantedBy=multi-user.target _EOF_ - #Grab our test media for user + # Grab our test media for user Download_Test_Media fi @@ -13651,15 +13639,15 @@ _EOF_ fi - software_id=35 + software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev &> /dev/null G_AGP logitechmediaserver - rm /etc/systemd/system/squeezeboxserver.service - rm -R /var/lib/squeezeboxserver - rm -R /usr/share/squeezeboxserver + getent passwd squeezeboxserver &> /dev/null && userdel -rf squeezeboxserver + [[ -f '/etc/systemd/system/logitechmediaserver.service' ]] && rm /etc/systemd/system/logitechmediaserver.service + [[ -d '/var/lib/squeezeboxserver' ]] && rm -R /var/lib/squeezeboxserver + [[ -d '/usr/share/squeezeboxserver' ]] && rm -R /usr/share/squeezeboxserver fi @@ -13936,7 +13924,7 @@ _EOF_ Banner_Uninstalling G_AGP squeezelite - rm -R /usr/bin/squeezelite* + rm -Rf /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service fi From e9f981947220cac8af719eacad1c50e0f47aea2d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 16:51:25 +0200 Subject: [PATCH 083/253] v6.23 + DietPi-Patch | Reinstall Logitech Media Server to update to v7.9.2 and apply "squeezeboxserver" run user + service updates --- dietpi/patch_file | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index f2782b2728..b000722eec 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -376,7 +376,7 @@ _EOF_ #------------------------------------------------------------------------------- #Reinstalls # v6.20 Shairport-sync: https://github.com/MichaIng/DietPi/issues/1620#issuecomment-373086888 - # Squeezebox server: + # v6.23 Squeezebox server: # v6.20 AmiBerry 2.18: https://github.com/MichaIng/DietPi/issues/1410#issuecomment-374060452 # Mopidy: https://github.com/MichaIng/DietPi/issues/1625 # v6.17 MPD: https://github.com/MichaIng/DietPi/issues/1614 @@ -385,7 +385,7 @@ _EOF_ killall -qw squeezeboxserver [[ -f /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service ]] && rm /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service - /DietPi/dietpi/dietpi-software reinstall 35 118 + /DietPi/dietpi/dietpi-software reinstall 118 fi #------------------------------------------------------------------------------- @@ -1763,8 +1763,14 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' # Plex Media Server: https://github.com/MichaIng/DietPi/pull/2722 dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list + # Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4 + if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then - /DietPi/dietpi/dietpi-software reinstall 34 42 + systemctl disable squeezeboxserver + mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service + + fi + /DietPi/dietpi/dietpi-software reinstall 34 35 42 fi #------------------------------------------------------------------------------- From e3422e64b5653811eb109c4dc91af7ebfd9a0b30 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 16:58:00 +0200 Subject: [PATCH 084/253] v6.23 + CHANGELOG | Logitech Media Server: Install current nightly, service updates and missing "libio-socket-ssl-perl" fix --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e545c03ecb..2c07bd8310 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 +- DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. Bug Fixes: - DietPi-Set_swapfile | Resolved an issue where on first boot (and when calling the script manually) the swapfile creation is attempted on target file systems that do not support it (BTRFS). Many thanks to @mzramna for reporting this issue: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484205696 @@ -27,6 +28,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thats to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691 - DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697 - DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 +- DietPi-Software | Logitech Media Server: Resolved an issue where certain plugins failed due to missing "libio-socket-ssl-perl". Many thanks to @noobian and @Edward for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5824 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From c6fca3b62547326d406bfd313a0606a75b0c2e16 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 17:06:14 +0200 Subject: [PATCH 085/253] v6.23 + DietPi-Services | "squeezeboxserver" has been renamed to "logitechmediaserver" + DietPi-Services | Add all possible PHP-FPM versions, especially 7.3 for current Buster support + DietPi-Services | Add new "dietpi-arr_to_RAM" service --- dietpi/dietpi-services | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index d367930162..bb37abe636 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -65,7 +65,9 @@ # - PHP 'php5-fpm' 'php7.0-fpm' + 'php7.1-fpm' 'php7.2-fpm' + 'php7.3-fpm' # - Webservers 'apache2' @@ -102,7 +104,7 @@ # - Media 'ympd' 'mympd' - 'squeezeboxserver' + 'logitechmediaserver' 'subsonic' 'airsonic' 'mopidy' @@ -199,7 +201,7 @@ # - SSH aSERVICE_NAME+=('dropbear') - aSERVICE_NAME+=('ssh') #: OpenSSH-server + aSERVICE_NAME+=('ssh') #: OpenSSH Server # - Misc #aSERVICE_NAME+=('systemd-timesyncd') #: Timesync. DietPi stops this by default after success, may confuse user/prompt questions. @@ -208,7 +210,7 @@ aSERVICE_NAME+=('openvpn') #: https://github.com/MichaIng/DietPi/issues/1501 aSERVICE_NAME+=('vncserver') #: DietPi vnc server service/script aSERVICE_NAME+=('nxserver') #: Nomachine - aSERVICE_NAME+=('xrdp') #: XRDP server + aSERVICE_NAME+=('xrdp') #: XRDP Server aSERVICE_NAME+=('amiberry') #: DietPi AmiBerry run service # - DietPi @@ -219,6 +221,7 @@ aSERVICE_NAME+=('dietpi-postboot') aSERVICE_NAME+=('dietpi-wifi-monitor') #: https://github.com/MichaIng/DietPi/issues/1288#issuecomment-350653480 aSERVICE_NAME+=('dietpi-nordvpn') #: NordVPN install + client + aSERVICE_NAME+=('dietpi-arr_to_RAM') #: Sonarr/Radarr/Lidarr database to RAM link service #aSERVICE_NAME+=('wg-quick@wg0') #: WireGuard fi From 451ace192e3ef321fb4f9d471ecaeed747129c1a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 17:10:12 +0200 Subject: [PATCH 086/253] v6.23 + DietPi-Process_tool | Squeezebox Server has been renamed to "Logitech Media Server", however the process name (binary) is still the same, so chosen settings still apply as well --- dietpi/dietpi-process_tool | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index d49012ad0a..27cff3f857 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -277,7 +277,7 @@ aNAME[$index]='Sonarr';aPROCESS_NAME[$index]='NzbDrone.exe';((index++)) aNAME[$index]='Spotify Connect Web';aPROCESS_NAME[$index]='spotify-connect-web';((index++)) aNAME[$index]='Supervisor';aPROCESS_NAME[$index]='supervisor';((index++)) - aNAME[$index]='Squeezebox Server (LMS)';aPROCESS_NAME[$index]='squeezeboxserver';((index++)) + aNAME[$index]='Logitech Media Server';aPROCESS_NAME[$index]='squeezeboxserver';((index++)) aNAME[$index]='Squeezelite';aPROCESS_NAME[$index]='squeezelite';((index++)) aNAME[$index]='Syncthing';aPROCESS_NAME[$index]='syncthing';((index++)) aNAME[$index]='Syncthing-inotify';aPROCESS_NAME[$index]='syncthing-inotify';((index++)) @@ -437,7 +437,7 @@ Write_Settings_File(){ - rm $FP_SETTINGS &> /dev/null + [[ -f $FP_SETTINGS ]] && rm $FP_SETTINGS local save_index=0 for i in ${!aNAME[@]} From 7261f07eaacd68aa3bc4766b97c4f94ad7524800 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 19 Apr 2019 18:07:37 +0200 Subject: [PATCH 087/253] v6.23 (#2723) + DietPi-Software | Tor Hotspot: Mark WiFi Hotspot during regular pre-req check, otherwise WiFi Hotspot pre-reqs will not be marked: libssl1.0.0 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 44 ++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2c07bd8310..0a58de7f9e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. +- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 Bug Fixes: - DietPi-Set_swapfile | Resolved an issue where on first boot (and when calling the script manually) the swapfile creation is attempted on target file systems that do not support it (BTRFS). Many thanks to @mzramna for reporting this issue: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484205696 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fff1399427..da6ee79da1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1452,11 +1452,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=60 - aSOFTWARE_WHIP_NAME[$software_id]='WiFi Hotspot' - aSOFTWARE_WHIP_DESC[$software_id]='turn your device into a wifi hotspot' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207' + aSOFTWARE_WHIP_NAME[$software_id]='WiFi Hotspot' + aSOFTWARE_WHIP_DESC[$software_id]='turn your device into a wifi hotspot' + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207' # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -1464,11 +1464,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=61 - aSOFTWARE_WHIP_NAME[$software_id]='Tor Hotspot' - aSOFTWARE_WHIP_DESC[$software_id]='optional: route hotspot traffic through tor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529' + aSOFTWARE_WHIP_NAME[$software_id]='Tor Hotspot' + aSOFTWARE_WHIP_DESC[$software_id]='optional: route hotspot traffic through tor' + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529' # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -2494,6 +2494,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + #Tor Hotspot requires WiFi Hotspot + software_id=60 + if (( ${aSOFTWARE_INSTALL_STATE[61]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" + + fi + #Additional software that requires VNC4server # XRDP: https://github.com/MichaIng/DietPi/issues/1727 software_id=28 @@ -4976,11 +4985,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #TORHOTSPOT requires WIFIHOTSPOT: - (( ${aSOFTWARE_INSTALL_STATE[61]} == 1 )) && aSOFTWARE_INSTALL_STATE[60]=1 - - #WIFIHOTSPOT - software_id=60 + software_id=60 # WiFi Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4995,7 +5000,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Which binary to install + # Which binary to install local filename_hostapd='' local filename_hostapd_cli='' @@ -5030,19 +5035,16 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior rm hostapd-* - #Enable wifi modules + # Enable wifi modules /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable fi - #TORHOTSPOT - software_id=61 + software_id=61 # Tor Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - # - Prereqs G_AGI tor fi From 458d8a0bfb01c9ed4e5a6da823d566d20c079b2a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 20 Apr 2019 03:46:08 +0200 Subject: [PATCH 088/253] META | DietPi-Survey_report | Benchmark rework and RAM reset (#2715) --- .meta/dietpi-survey_report | 376 +++++++++++++++++++++---------------- 1 file changed, 209 insertions(+), 167 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 52a33df61b..b218616f0f 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -54,13 +54,15 @@ aHW_NAME[70]='Sparky SBC' aHW_NAME[71]='Beagle Bone Black' - aBENCH_COMMON_INDEX=() - + # - Core Benchmarks + aBENCH_CPU_INDEX=() + aBENCH_RAM_INDEX=() + aBENCH_ROOTFS_INDEX=() # - Optional benchmarks aBENCH_LAN_INDEX=() aBENCH_CUSTOMFS_INDEX=() - #[$HW_MODEL,${aBENCH_COMMON_INDEX[$HW_MODEL]}] + #[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}] declare -A aBENCH_CPU declare -A aBENCH_ROOTFS_WRITE declare -A aBENCH_ROOTFS_READ @@ -75,7 +77,7 @@ declare -A aBENCH_NET_LAN_SPEED #Results - BENCH_RESULTS_CPU_SCALE=2 + BENCH_RESULTS_CPU_SCALE=1 aBENCH_RESULT_CPU_MIN=() aBENCH_RESULT_CPU_MAX=() aBENCH_RESULT_CPU_AVG=() @@ -378,6 +380,9 @@ aSOFTWARE_NAME6_20[172]='WireGuard' # - v6.21 + v6.22 + v6.23 + aSOFTWARE_NAME6_21=() + aSOFTWARE_NAME6_22=() + aSOFTWARE_NAME6_23=() for i in ${!aSOFTWARE_NAME6_20[@]} do @@ -386,6 +391,9 @@ aSOFTWARE_NAME6_23[$i]=${aSOFTWARE_NAME6_22[$i]} done + aSOFTWARE_NAME6_23[173]='LXQt' + aSOFTWARE_NAME6_23[174]='GIMP' + aSOFTWARE_NAME6_23[175]='XFCE Power Manager' Main(){ @@ -418,27 +426,45 @@ if [[ $G_DEBUG == 1 ]]; then - echo "DEBUG Benchmark: $file" - echo "BENCH_VERSION=$BENCH_VERSION | BENCH_HW_MODEL=$BENCH_HW_MODEL BENCH_CPU=$BENCH_CPU | BENCH_ROOTFS_WRITE=$BENCH_ROOTFS_WRITE | BENCH_ROOTFS_READ=$BENCH_ROOTFS_READ | BENCH_RAM_WRITE=$BENCH_RAM_WRITE | BENCH_RAM_READ=$BENCH_RAM_READ | BENCH_CPU_TEMP_START=$BENCH_CPU_TEMP_START | BENCH_CPU_TEMP_END=$BENCH_CPU_TEMP_END | BENCH_CUSTOMFS_WRITE=$BENCH_CUSTOMFS_WRITE | BENCH_CUSTOMFS_READ=$BENCH_CUSTOMFS_READ | BENCH_NET_LAN_SPEED=$BENCH_NET_LAN_SPEED" + echo "DEBUG $file: BENCH_VERSION=$BENCH_VERSION | BENCH_HW_MODEL=$BENCH_HW_MODEL BENCH_CPU=$BENCH_CPU | BENCH_ROOTFS_WRITE=$BENCH_ROOTFS_WRITE | BENCH_ROOTFS_READ=$BENCH_ROOTFS_READ | BENCH_RAM_WRITE=$BENCH_RAM_WRITE | BENCH_RAM_READ=$BENCH_RAM_READ | BENCH_CPU_TEMP_START=$BENCH_CPU_TEMP_START | BENCH_CPU_TEMP_END=$BENCH_CPU_TEMP_END | BENCH_CUSTOMFS_WRITE=$BENCH_CUSTOMFS_WRITE | BENCH_CUSTOMFS_READ=$BENCH_CUSTOMFS_READ | BENCH_NET_LAN_SPEED=$BENCH_NET_LAN_SPEED" fi - #Common benchmarks - # - Check for all expected values based on how we handle them, only add entry if valid for all. + #CPU if [[ ${BENCH_CPU//.*} =~ ^-?[0-9]+$ && - ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ && - ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ && - $BENCH_CPU_TEMP_START && $BENCH_CPU_TEMP_END ]]; then + $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then + + aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU + + # - Patch for 5 digit CPU temp's: https://github.com/MichaIng/DietPi/issues/2715 + (( ${BENCH_CPU_TEMP_START//.*} > 130 )) && (( BENCH_CPU_TEMP_START /= 1000 )) + (( ${BENCH_CPU_TEMP_END//.*} > 130 )) && (( BENCH_CPU_TEMP_END /= 1000 )) + # ------------------------------------------------------------------------------ + + aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_START//.*} + aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_END//.*} + + ((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++)) - aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU - aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_WRITE//.*} - aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_READ//.*} - aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_WRITE//.*} - aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_READ//.*} - aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_START//.*} - aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_END//.*} + fi + + if [[ ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ ]]; then + + aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_ROOTFS_WRITE//.*} + aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_READ//.*} - ((aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]++)) + ((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++)) + + fi + + # - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing. + if (( $BENCH_VERSION >= 2 )) && + [[ ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ ]]; then + + aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_RAM_WRITE//.*} + aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_READ//.*} + + ((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++)) fi @@ -447,7 +473,8 @@ if [[ ${BENCH_CUSTOMFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_CUSTOMFS_READ//.*} =~ ^-?[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//.*} + aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_CUSTOMFS_READ//.*} + ((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++)) fi @@ -456,6 +483,7 @@ if [[ ${BENCH_NET_LAN_SPEED//.*} =~ ^-?[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]++)) fi @@ -488,32 +516,14 @@ #Bench Results, HW_MODEL array: local default_min_value=100000 - for i in ${!aBENCH_COMMON_INDEX[@]} + #CPU + for i in ${!aBENCH_CPU_INDEX[@]} do - local hw_model_supports_cpu_temps=1 - - #init results aBENCH_RESULT_CPU_MIN[$i]=$default_min_value aBENCH_RESULT_CPU_MAX[$i]=0 aBENCH_RESULT_CPU_AVG[$i]=0 - 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_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_CPU_TEMP_START_MIN[$i]=$default_min_value aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=0 aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=0 @@ -522,10 +532,9 @@ aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=0 aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=0 - for (( j=0; j<${aBENCH_COMMON_INDEX[$i]}; j++ )) + for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - #CPU # echo "aBENCH_CPU[$i,$j] ${aBENCH_CPU[$i,$j]}" if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]}") )); then @@ -539,145 +548,158 @@ fi aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_CPU[$i,$j]} + ${aBENCH_RESULT_CPU_AVG[$i]}") - #RootFS - # echo "aBENCH_ROOTFS_WRITE[$i,$j] ${aBENCH_ROOTFS_WRITE[$i,$j]}" - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )); then + if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then - aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} fi - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )); then + if (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )); then - aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} fi - (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) + (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) - # echo "aBENCH_ROOTFS_READ[$i,$j] ${aBENCH_ROOTFS_READ[$i,$j]}" - if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then + # echo "aBENCH_CPU_TEMP_END[$i,$j] ${aBENCH_CPU_TEMP_END[$i,$j]}" + if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then - aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} fi - if (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )); then + if (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )); then - aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} fi - (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) + (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) - #RAM - # echo "aBENCH_RAM_WRITE[$i,$j] ${aBENCH_RAM_WRITE[$i,$j]}" - if (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )); then + #Last item in current array. Work out averages + if (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )); then - aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} + aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]}") + aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) + aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) - fi - if (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )); then + if [[ $G_DEBUG == 1 ]]; then - aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} + echo "aBENCH_RESULT_CPU_AVG $i = ${aBENCH_RESULT_CPU_AVG[$i]}" + echo "aBENCH_RESULT_CPU_TEMP_START_AVG $i = ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}" + echo "aBENCH_RESULT_CPU_TEMP_END_AVG $i = ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}" + + fi fi - (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - # echo "aBENCH_RAM_READ[$i,$j] ${aBENCH_RAM_READ[$i,$j]}" - if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then + done - aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} + done + + 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 + + for (( j=0; j<${aBENCH_ROOTFS_INDEX[$i]}; j++ )) + do + + if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )); then + + aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} fi - if (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )); then + if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )); then - aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} + aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} fi - (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) + (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) - #CPU temp - # echo "aBENCH_CPU_TEMP_START[$i,$j] ${aBENCH_CPU_TEMP_START[$i,$j]}" - if (( $hw_model_supports_cpu_temps )); then + # echo "aBENCH_ROOTFS_READ[$i,$j] ${aBENCH_ROOTFS_READ[$i,$j]}" + if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then - if [[ ${aBENCH_CPU_TEMP_START[$i,$j]} =~ ^-?[0-9]+$ ]]; then + aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then + fi + if (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )); then - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - fi - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )); then + fi + (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + #Last item in current array. Work out averages + if (( $j == ${aBENCH_ROOTFS_INDEX[$i]} - 1 )); then - fi - (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) + aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) + aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) - # echo "aBENCH_CPU_TEMP_END[$i,$j] ${aBENCH_CPU_TEMP_END[$i,$j]}" - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then + if [[ $G_DEBUG == 1 ]]; then - aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + echo "aBENCH_RESULT_ROOTFS_WRITE_AVG $i = ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}" + echo "aBENCH_RESULT_ROOTFS_READ_AVG $i = ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}" - fi - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )); then + fi - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + fi - fi - (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) + done - else + done - hw_model_supports_cpu_temps=0 #Set unavailable for current HW model, do not check again for HW model - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]='N/A' + for i in ${!aBENCH_RAM_INDEX[@]} + do - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]='N/A' + 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_CPU_TEMP_END_MIN[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]='N/A' + aBENCH_RESULT_RAM_READ_MIN[$i]=$default_min_value + aBENCH_RESULT_RAM_READ_MAX[$i]=0 + aBENCH_RESULT_RAM_READ_AVG[$i]=0 - fi + for (( j=0; j<${aBENCH_RAM_INDEX[$i]}; j++ )) + do - fi + if (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )); then - if [[ $G_DEBUG == 1 ]]; then + aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} - echo "DEBUG Bench Entry: $i $j" - echo ${aBENCH_ROOTFS_WRITE[$i,$j]} - echo ${aBENCH_ROOTFS_READ[$i,$j]} - echo ${aBENCH_RAM_WRITE[$i,$j]} - echo ${aBENCH_RAM_READ[$i,$j]} - echo ${aBENCH_CPU_TEMP_START[$i,$j]} - echo ${aBENCH_CPU_TEMP_END[$i,$j]} + fi + if (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )); then + + aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} fi + (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - #Last item in current array. Work out averages - if (( $j == ${aBENCH_COMMON_INDEX[$i]} - 1 )); then + # echo "aBENCH_RAM_READ[$i,$j] ${aBENCH_RAM_READ[$i,$j]}" + if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then + + aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} - aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]}") - aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) + fi + if (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )); then - if (( $hw_model_supports_cpu_temps )); then + aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) + fi + (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) - fi + #Last item in current array. Work out averages + if (( $j == ${aBENCH_RAM_INDEX[$i]} - 1 )); then + + aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) + aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) if [[ $G_DEBUG == 1 ]]; then - echo "DEBUG Bench avg: $i" - echo "aBENCH_RESULT_CPU_AVG $i = ${aBENCH_RESULT_CPU_AVG[$i]}" - echo "aBENCH_RESULT_ROOTFS_WRITE_AVG $i = ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}" - echo "aBENCH_RESULT_ROOTFS_READ_AVG $i = ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}" echo "aBENCH_RESULT_RAM_WRITE_AVG $i = ${aBENCH_RESULT_RAM_WRITE_AVG[$i]}" echo "aBENCH_RESULT_RAM_READ_AVG $i = ${aBENCH_RESULT_RAM_READ_AVG[$i]}" - echo "aBENCH_RESULT_CPU_TEMP_START_AVG $i = ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}" - echo "aBENCH_RESULT_CPU_TEMP_END_AVG $i = ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}" fi @@ -754,7 +776,7 @@

DietPi-Survey report page

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

@@ -763,52 +785,52 @@
Opted out installs$SURVEY_COUNT_EMPTY
-

DietPi versions:

+

DietPi versions:

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

Git branches:

+

Git branches:

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

Devices:

+

Devices:

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

CPU architectures:

+

CPU architectures:

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

CPU core counts:

+

CPU core counts:

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

Distro versions:

+

Distro versions:

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

Autostart options:

+

Autostart options:

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

DietPi-Automation:

+

DietPi-Automation:

Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) installs
-

Network interfaces:

+

Network interfaces:

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

Installed software titles:

+

Installed software titles:

$(for i in "${!aSOFTWARE[@]}"; do echo ""; done | sort -nrk 2 -t ' ')
$i ${aSOFTWARE[$i]}
@@ -823,49 +845,61 @@ Device: - Total benchmarks: - Average: - Fastest: - Slowest: - Average: - Lowest: - Highest: - Average: - Lowest: - Highest: + Count: + Average: + Fastest: + Slowest: + Average: + Lowest: + Highest: + Average: + Lowest: + Highest: - $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') -

DietPi-Benchmarks | IO (Filesystem & RAM):

+

DietPi-Benchmarks | IO (RootFS):

+ + + + + + + + + + + + $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo ""; done ) +
RootFS write (MB/s): RootFS read (MB/s):
Device:Count:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]}
+ +

DietPi-Benchmarks | IO (RAM):

+ + + - - - - - - - - - - - - - + + + + + + + - $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo ""; done )
RAM write (MB/s): RAM read (MB/s):
Device:Total benchmarks:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Count:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]} ${aBENCH_RESULT_RAM_READ_MIN[$i]}
${aHW_NAME[$i]:=$i} ${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}
-

DietPi-Benchmarks | Network LAN throughput:

+

DietPi-Benchmarks | IO (Network LAN):

- - - - + + + + - $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done )
@@ -873,19 +907,27 @@
Device:Total benchmarks:Average:Fastest:Slowest:Count:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]}${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
_EOF_ # Move HTML page in place - mv index.html /var/www/survey/index.html + if [[ $G_DEBUG == 1 ]]; then + + mv index.html /var/www/survey/debug.html + + else + + mv index.html /var/www/survey/index.html + + fi } From b6044942e0bb6e800f776292ac230434fda5c68e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 20 Apr 2019 11:57:33 +0100 Subject: [PATCH 089/253] https://github.com/MichaIng/DietPi/issues/2715 https://github.com/MichaIng/DietPi/issues/1918 --- .conf/desktop/lxqt/lxqt-buster.7z | Bin 0 -> 8574 bytes .../desktop/{lxqt.7z => lxqt/lxqt-stretch.7z} | Bin .meta/dietpi-survey_report | 352 ++++++++++-------- dietpi/dietpi-software | 20 +- 4 files changed, 208 insertions(+), 164 deletions(-) create mode 100644 .conf/desktop/lxqt/lxqt-buster.7z rename .conf/desktop/{lxqt.7z => lxqt/lxqt-stretch.7z} (100%) diff --git a/.conf/desktop/lxqt/lxqt-buster.7z b/.conf/desktop/lxqt/lxqt-buster.7z new file mode 100644 index 0000000000000000000000000000000000000000..2c55cd37a76ae013c88bc2668e3b178897406030 GIT binary patch literal 8574 zcmai(RZty3m#q)(&cPwLySuv_T!X{G-7Po-5AN>n65I*y5ZoPt1=mU4`!F?CQ~&fs z_w%=U?Nxhs^Z0bt(GUTk@A3?k1jqpYZ&CdJ1AxaHg|SnRje2PSz(}zvV=8x6FrgnYSpnUvUcE`aHRMSmexuNllyqops@{=^9x5TO){FabMWO_!F4>|Wvf3f*A?`V4!{)wVi(0X`@ z9@=~q2!_PcOaOQ9mDVCd<&IdV1?HCVJJgCsq*M6usilD+Lje0k- zPb{mp$b;bM<2c}`(faowzH>iby(CLMis-s0^quw@NCqQ=b@M5{Q3qKG9THszow^Js z3>TXdE?;?uzA*$?2cYM6<{eQoO>?{MREfZwHBsXJU0TRtu53{nAs1@1a~4C%P7b9l z3?9B0=3WlO`lxGxGUlf30j$~go~39$hKYkVz%KaSqj)@G}PNyrQl4jTTjCk!ih z?&O2y8+ymY99J-qNab&7V+W~Ifb7k1=Zw_ZK1Z40}jmZb64_o)@K(C)^oI?)(Qkh-MFMIMzA35ja zJj-*G{WdY?&&D8sLx?%4&L2$He!~>%a>XX*u3pMXaZ*eBG8+Xc5) zvv7DXn+geJ)gbA=cY{lek6QC$s5V8jgz$q-vD1US{4Io)c2Or#dOY5SS;UFx2|0nh zYf*TjL5Ro^$8OtC{cKh|&pL3Y z0yio_3m7lF2<&I~n5VA?1xVmkaUoC|JPG=((yG`G!1)eXVEz0Xl(`;4zzv)X|4iL^ zYpD+AV;IqCW>U1kR!fCG9;HtDgRwfmZ(fr#q`zXaC|`a$AD0E5N1)%Qny*r*zQ!x zJ5E3SS+G!_7R5#H6;TA4D%P1{$Sn>(|3-Yxtt+7+^#359GZ zV*w-HXX92xt*~FTk09AiWvUpL*&ZYYR}5y|cJ73O30!Gt>beT3fZC2qR2&?G!y804 z)LZk=c`xVBCu4r)52N|>9e%kL!!QRPOA`d6#>K+oK+|8yD|;Hs^l}&}GzM_#BjWtRalgc8QuUz&?xSTH*3a zzvK>WwCBd^Iv66RhBK}E-MdL7<(69OzPs)$5_LRKHcbxgv4A(ddKVWaM}{Pm;my< zxbvnYleoX?w?p8=ZH}wHfHacs6j^>1KaxcmZJs_lz<6XVosbq>D2i-Gr6thRhVUYP z$gETmmOx%EM+1f9X;oBNx1mHyD9HE7zd#b^yKDY&Bus^XcB}iXXv)F?3N!(DGoGt`{K+=sTnf16kbdAV}n=!As`ReN`op^C)rb5 zG>KnW&EM9qV$T@MTiVYxru0XCH^Y2UVSEw9pMZ+UQ;JUYWx_8t0B5t+C$^|ZHhO!8yJ{+bMqap|Zp+z`n=_Mi%9tylY~9xD zgg9>ZR`Q#S+6;UHKy$R1yPOsjA=)tCWI{!1^k!@%MiPCw>RMt7x(=-ypF{L}Cg^vw zOnbRcSi5@xv{n|m&!8@%fv+|}%hb&05V>WOQWul{GaCNY5qxqKDC;sW{j7;|_pWE# z0NvrdHm*Nq?Kn2HOIb(M;lR5&Z||AowV~W%6!R^t?f%=K$Mw@#m4^hrFr{kBW+jf- z{*UFaNyKBc$t+l~IE*deHja~0awg8|@Pa2oEJ#DOw9uI zJ|M+(x~eJ9>+-fxAm!JxqqqG@Ntx__$!Andadi|my3e-ZA>W@-Avt?y{ZAOg8wv@^R3#mP!R<0{S9Y zUj8PV(&K=tov&n#oKh9^ls&DyAhFynefF)Q)2ri;OSuteJII+^3b$xAM{xh-yA)Fw z+Sz=u`3{dO#~i;{T#c5Vm4R*E2dix~e56DgniL2FoWO0>j-TZvoJ{}8sR!luf$oXr zqQm7%E8+QV^1-RCcpE|bVA$MIs;=ce9QzoDhQ)Vhaa*eqNZJeyL)#n!0Wl*59$2MI zGihqI21=?uzG!_aA+$ETUuT`~+=ai31`g!{$+|`#7Bg=J8hhE*|JrCAlvRJ>BUMbL z(u61$oXU!6G65q2d;u2qy-j!MGDyZq@3{s=!c!=Dh*ytZF-@QMG1+E7YL;&kKWx%l zB&>BxV}-h=6tC?4o`n`UGsB6UK{Cx(~msFgIQS=GWH%>S%Q zb7pHaB*oiYn0BME41Mrfw#L)tRn}&%?!Xo%(rA}qv$>P9vRPV|@$QhxQxhHj`({ux zx&J8h!{&S6*<7@d-j4ho09nVrWMVYMo-p>~8PvFsxToaZNpHr%Q~E)JboT6ehmv$_ zqZtKT0zqxJwYwX{%C>3E>mX1Yv8o-lyuts|o(dqCGr4JUYYU(3v{>YOqH1O|2&YZ8 zU-x9O>3gXoux=3LO@8!=oB7480I{ zx{{6Sz3sY9rTHOcK8a3WV8?dE%$ z5EYF3W|C-MB2i)JrPrhVP}|>GKIDB5db4K9&}G*fHKdZ~BgJjgeYfz0Gx|gV9p48&HG0d8gF@Y!u8WAh?@px7`avnF6oY zD;^PTyTi&5(oPOXD=x<;{>aY#EA&N#9i&l3t`oqO0@cTMc`iP|+Q!qu9G_Z62WRlj+oJ(r`ZYdpO;d5L)ISuX%(Q1?qaxyQeH z;UhMCqu93}mS3AT-_gVjZA*FWd2kP)*scarQY+70cvK9a%&wvkFn_Vc=VQCbs!;m0 z_Wt{jTC;0JE7Vzs7Bbb1{;Ob-Aya!oIRma?Y@v@moq1N+hV}Z*!iMO);_HTmOQ%VA zV35fy5b~L&S+)yl^Kif6v@ckAc?o?hS2I8jtn6N5hWPZ}E%FUW>Z%hTT>HQi42yw7 z9w+jSX~LkoLm3{z$#&wl1@~jHqI%8fln~D%R@aXg$1WlO}{^0+2`UwXo0$F{Gscf^93xG8=1nUDwNs@jm+^!?WsB=|H zR8CdEoE?`9$b5(6i+%&_AXh`y7yy_O#*pvoy=m)MIOw|%goJl4@#A-^>+oAuwLCNg zsS6lAS}&;BAEZY|lSMR%$F;tt`;L4C38C~0dp*8Be)cMnj`$pxYYsgmO=sbGA0Vx8 zdpX6SM<~Q0g@1m1bP0jF*`3&@vsV%~ejW*(b|0)8f0>pE|Jo>XaY7KH)99B-EDdc+ zF=m77>enkG941%Gs|8@~*URZb%|R%8@f0;V(;1%2JDvlPZm0DcGf7 zYPX19w*A6>@VUfHg^@Tow*b{sa$Gy}o!r5^uiV?EoZl{RP_8lh|I{ ztUbMr<%=$=tE%KU%wKJU25+#Po*~j;=`F<}DInoP(PKRjR@x~*&+p=m^|xYyC4V9o z*NE4E`wddj=LU={-f(&Y=w*a{_+bYMhoLl)=0xM#HX;1zEF|3XP zpr*I5NKO2xLQa$rSWkeCESdmjBe8_nF!~bq=VL0c)Cx$n!Ll4#NlxJ#u;E5TQli5j zq<%LO^FHgo4{M>Ud#U}s;cE_AlaEjlCggbW<2@h}00H3rDg$-^yO`J+ApVP2Hy1}c z84U#uE3iFS%E83c4s0%DVPfYBMl>>VcLlpxSlfY(jD*}=+`))|9c&Fq(f{FizWQKN zjDq(no;Q!YdvvdspvVBL#Iqg0nt`^$`NJVo5ft|;bCW>WHkZ4CTppBVkUY}FtOBK% za>h6COe@nQEC!m|p7U}vHO~S>RM<7>*nw}cSl^a`tzoU-wx_!+8^bMy%eREd>#k3) z67Fd0GjVZrGl4IkJaVPItrO$f3{7?}Dw_QZJh!c5lhHs>du~gq*fcS4Fh=p@8ySw_ zN=sVFxJJ3w@RKzVaoX`vKCNLXrLOpL zlm*iAYy4V+*kaF*3|C(hpYR2-6DOKa8D)PuccJ1VUXJ&z%P0rbwpx~E?CoIh;&M%q zm;2{Kp2vtFZW{C3<_#<_cIQgHWet5}OrkexBxWp&(_eNx?R(df*;VqmVQ?NHQ2S)n zO5-;sx-^R8;9%9=Pup|BuNPc~bcBUGMk%#YA6+KhSns)H&mOjghAwZy`6tw}=v66O zdKSp{!39uV{tXgBJ4Atjf{RgIqVe}zWKv?EwO_ry`x?1~y zg+$f=?X7*z<)IiXK6DjiIytx%)Jn#?aFG$uw+ z#I&~G0pzj!%@DPgn3Z!d7I7yoh8r*BOf5oWJ>VZF;eT`fZ}s%=?XC4cQ`YXJ?U-_e zFgMOD%1XFds-k`OK?v{GA+|$KJhl`5l26Z_ zAAJ7N=noh6$ELNdY^fzNo#I;GTQeP+u*|j<=q9&PBj!lAS5eqdX%m#ycI3sbte$&{ z3olh$T6o;S+!SGTIBv#^!F8WXjwCO= z2iV2P9BgK74t5n{V?}gzGBLAuuoU7(bayaua|1h=gUyvpyg=^uLad0M*5+M^=-a`~ zx=k6*eI!oPEY~5_9MllSRKe7tH1FY8f2$omI%SVh=Fr!rz6O6O5~~ycU4B2YQRW)P z;BO$-Zt%!O;S*W9KE~Up#n~`}Bh9>aI|?tvkO63!V~DO}Io&-=#2d+8S;l9t3=Ww* z^Cl%FP~&wxE`Pu$^Lk{>-mZA%mqXmy$sPVJB6|OPY1QLir3~SZjhnEWqbAL{7!DnG zWfOJ`EavC!RUOvBD>u-UkJkR09nD7I*Ofjo*3uhtTeQ^7sVo=7V}=VUSfTguCY4ZG zXfw6uEu3_$1v-fzO@4zi+!bSv6Xf$dpVoX0wK4CnddI}|*jEaad5lFc9;`4VS20VU z2`C_b*2l2rUO~C0Shj&~XnCvCaFc72J6tq)Rdj#2Kw_f0R7kA}vSv}g)kGr6>5mP_ zX8RvVH<%FuM{HhlAn}#pafD?lU-2&WHnb)X^r(BMEz(VcZh}?*HtP5DEr(w0CjbM| ztA=QOtG6$b=h}B#%`;E+dWSvQmV3vikoZZa!vz@v)81_PUTElQ?isnJhY)Yau=Gdp zI_5d0X?rOuqKsvqvmbVYMA6kZ;ALz3ECaFQl^GwtlKR*>+$rg~q-DK=E6&|*N?{Dt zWyf>5R^c+9PFwu#fpQ!wf6fQ_4DR)@K$#~6tg~a28LuZsXg-TK6)Ou;Oh-MgU@JtV z&KZFjgkb)OUK+U~5;lB?IraF!(WI*x0FPq*t*Gdfj(=xG=3yz`2B12Esc9gDc8kAY zbj1j2Oho4_z<5L8B<0Q50|Q*{-%0yEf2z8&Z;0Ws36B63KFb+?LoeYhOW31dQmb8N zHP1oLKD_^MyH+C14L^ImekB0>+#0%5$Zbi-B=fBH^T4= z>_65+FwXHtVGr#e-o*9NRn=i|&r{B8N55o(v#NH}s(vqAxwP`Bik(j?- z{B^=;+Vxz{I&**SPsPSPK3b>5yhB$r#+F&qGK={x$KK z;3eI#GZ3%?*$Kh+ABFnYpIDNCj1;2#ge(}q)xVbIo9Y&^1FGmoI}g0kD;%|gwy!HL z;i#0Y1OpPT`!^}svR72`V#VSIXn%L>SevGLer?KV20D2 zC%=VLiP&3|!$z9yBSkOLF@hC@J*Pei+*fG0a&@aYrL|Lq*l!cxxEF@jo!nB4&y&5h z%q!p8zfEGOxN*b>xHk*^pqfnq%|?;XL^lN}IY zQN_DSDdfAa+Bet@bXfGRls_W%U{#|n+~>60?VCop$3 zp}u%OS$lbzaBZ{cnb>l%0v0Zbk@4*kG5l}S8BG1C5!W5jy)R2*>asfG0zRH!oowL^ zg6B!di&7B5W{*{M&3(ZM5Uh*2AB|(-@M4_9_iozQgR9Ni2_(jZL}vu8Qs2QF$}ydC z6n}mgt2a3uz!hsDl@o~R6h_;`L8~4e$n}m%5}(+Hi<*#?ZGPuiA&Nta?&oPP+~K{r zMm$(o(1iljSqyllmu)mqppD0sAik{`{GQ=C7&U;dyzx(lhl?73!eg{us~pc*KO*{q zA+1q8t<~BZ%c?Evi17fyp`td zAj@_|{Q7K~FN^OopPxpk?X9Z_n=jwEqf9qRS$Ckq#6v3dQu5$a`Waxh=+2h~8`j^h z^{Y@p?AKrSDZiNn{}iHy7eH5XFDOJ*6|3aJUxX`Fni-Z?ycZ^mgE^FmBb^BU_XQus z0aq7F+=4>0gn%1;%*fst2L(S>%@xUeJXaKC(>#w1cG9nmQG1S$Y!a1aHKXhP-trAI z@k*xsh|zKR4^I2Avo;ZVn!9EK?b5O;M$|z9){PuS8qA|lHh<8}Cdu0tfRxI`h3}Ig z6N`X3o)%+#w&h&^b@QENTtS7v-!GUzdWK8fp_{*k1?{m`J~GF?@^=`}Q*nTdCbu%? zPQEmrd=uuL&x=GZn-=-vGQ<;$XlJh{OlyFj22Q;1)lpZsRG!wgLcW%`b)2`s?`lmJ z(V{dIv$hJ&fC@uhLh}Rt8{_s}{L{!!=yH*87W6-}_JMtg7J~H%u21oXqk&Aye;R+} zhK3FDszD%a?^g!cF`3a9@bv4MY++T7)z&m|G+3aaJ2(5}K~)XRXph_LbkOTKmv$V` zMd~Z{Og(Asnx2w|-N|?lj@_iM&_FjDhwLORNarjHW<8V%5Sk5zxPD`ys~K2F?qy1N z#ioY!M1#_d>2-ve+5Fkit5b4RG-%3CIG{PV{hT#WeTGZ4XoM`_m`d= @c5e?v)I z)zdeaV@FkAQUMR`_XcD}E>WyjsKgu9NjNYb)ffQ4h0XJZKnNNDz#%~ZASj?9AYcpt S=l}q6s1G89kghx=0PtTedt(6r literal 0 HcmV?d00001 diff --git a/.conf/desktop/lxqt.7z b/.conf/desktop/lxqt/lxqt-stretch.7z similarity index 100% rename from .conf/desktop/lxqt.7z rename to .conf/desktop/lxqt/lxqt-stretch.7z diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 52a33df61b..e0f35b6b2c 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -54,13 +54,15 @@ aHW_NAME[70]='Sparky SBC' aHW_NAME[71]='Beagle Bone Black' - aBENCH_COMMON_INDEX=() - + # - Core Benchmarks + aBENCH_CPU_INDEX=() + aBENCH_RAM_INDEX=() + aBENCH_ROOTFS_INDEX=() # - Optional benchmarks aBENCH_LAN_INDEX=() aBENCH_CUSTOMFS_INDEX=() - #[$HW_MODEL,${aBENCH_COMMON_INDEX[$HW_MODEL]}] + #[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}] declare -A aBENCH_CPU declare -A aBENCH_ROOTFS_WRITE declare -A aBENCH_ROOTFS_READ @@ -75,7 +77,7 @@ declare -A aBENCH_NET_LAN_SPEED #Results - BENCH_RESULTS_CPU_SCALE=2 + BENCH_RESULTS_CPU_SCALE=1 aBENCH_RESULT_CPU_MIN=() aBENCH_RESULT_CPU_MAX=() aBENCH_RESULT_CPU_AVG=() @@ -378,6 +380,7 @@ aSOFTWARE_NAME6_20[172]='WireGuard' # - v6.21 + v6.22 + v6.23 + aSOFTWARE_NAME6_23=() for i in ${!aSOFTWARE_NAME6_20[@]} do @@ -386,6 +389,9 @@ aSOFTWARE_NAME6_23[$i]=${aSOFTWARE_NAME6_22[$i]} done + aSOFTWARE_NAME6_23[173]='LXQt' + aSOFTWARE_NAME6_23[174]='GIMP' + aSOFTWARE_NAME6_23[175]='XFCE Power Manager' Main(){ @@ -418,27 +424,45 @@ if [[ $G_DEBUG == 1 ]]; then - echo "DEBUG Benchmark: $file" - echo "BENCH_VERSION=$BENCH_VERSION | BENCH_HW_MODEL=$BENCH_HW_MODEL BENCH_CPU=$BENCH_CPU | BENCH_ROOTFS_WRITE=$BENCH_ROOTFS_WRITE | BENCH_ROOTFS_READ=$BENCH_ROOTFS_READ | BENCH_RAM_WRITE=$BENCH_RAM_WRITE | BENCH_RAM_READ=$BENCH_RAM_READ | BENCH_CPU_TEMP_START=$BENCH_CPU_TEMP_START | BENCH_CPU_TEMP_END=$BENCH_CPU_TEMP_END | BENCH_CUSTOMFS_WRITE=$BENCH_CUSTOMFS_WRITE | BENCH_CUSTOMFS_READ=$BENCH_CUSTOMFS_READ | BENCH_NET_LAN_SPEED=$BENCH_NET_LAN_SPEED" + echo "DEBUG $file: BENCH_VERSION=$BENCH_VERSION | BENCH_HW_MODEL=$BENCH_HW_MODEL BENCH_CPU=$BENCH_CPU | BENCH_ROOTFS_WRITE=$BENCH_ROOTFS_WRITE | BENCH_ROOTFS_READ=$BENCH_ROOTFS_READ | BENCH_RAM_WRITE=$BENCH_RAM_WRITE | BENCH_RAM_READ=$BENCH_RAM_READ | BENCH_CPU_TEMP_START=$BENCH_CPU_TEMP_START | BENCH_CPU_TEMP_END=$BENCH_CPU_TEMP_END | BENCH_CUSTOMFS_WRITE=$BENCH_CUSTOMFS_WRITE | BENCH_CUSTOMFS_READ=$BENCH_CUSTOMFS_READ | BENCH_NET_LAN_SPEED=$BENCH_NET_LAN_SPEED" fi - #Common benchmarks - # - Check for all expected values based on how we handle them, only add entry if valid for all. + #CPU if [[ ${BENCH_CPU//.*} =~ ^-?[0-9]+$ && - ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ && - ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ && - $BENCH_CPU_TEMP_START && $BENCH_CPU_TEMP_END ]]; then + $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then + + aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU + + # - Patch for 5 digit CPU temp's: https://github.com/MichaIng/DietPi/issues/2715 + (( ${BENCH_CPU_TEMP_START//.*} > 130 )) && (( BENCH_CPU_TEMP_START /= 1000 )) + (( ${BENCH_CPU_TEMP_END//.*} > 130 )) && (( BENCH_CPU_TEMP_END /= 1000 )) + # ------------------------------------------------------------------------------ + + aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_START//.*} + aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_END//.*} + + ((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++)) - aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU - aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_WRITE//.*} - aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_READ//.*} - aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_WRITE//.*} - aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_READ//.*} - aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_START//.*} - aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_END//.*} + fi + + if [[ ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ ]]; then + + aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_ROOTFS_WRITE//.*} + aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_READ//.*} - ((aBENCH_COMMON_INDEX[$BENCH_HW_MODEL]++)) + ((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++)) + + fi + + # - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing. + if (( $BENCH_VERSION >= 2 )) && + [[ ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ ]]; then + + aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_RAM_WRITE//.*} + aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_READ//.*} + + ((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++)) fi @@ -447,7 +471,8 @@ if [[ ${BENCH_CUSTOMFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_CUSTOMFS_READ//.*} =~ ^-?[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//.*} + aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_CUSTOMFS_READ//.*} + ((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++)) fi @@ -456,6 +481,7 @@ if [[ ${BENCH_NET_LAN_SPEED//.*} =~ ^-?[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]++)) fi @@ -488,32 +514,14 @@ #Bench Results, HW_MODEL array: local default_min_value=100000 - for i in ${!aBENCH_COMMON_INDEX[@]} + #CPU + for i in ${!aBENCH_CPU_INDEX[@]} do - local hw_model_supports_cpu_temps=1 - - #init results aBENCH_RESULT_CPU_MIN[$i]=$default_min_value aBENCH_RESULT_CPU_MAX[$i]=0 aBENCH_RESULT_CPU_AVG[$i]=0 - 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_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_CPU_TEMP_START_MIN[$i]=$default_min_value aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=0 aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=0 @@ -522,10 +530,9 @@ aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=0 aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=0 - for (( j=0; j<${aBENCH_COMMON_INDEX[$i]}; j++ )) + for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - #CPU # echo "aBENCH_CPU[$i,$j] ${aBENCH_CPU[$i,$j]}" if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]}") )); then @@ -539,145 +546,158 @@ fi aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_CPU[$i,$j]} + ${aBENCH_RESULT_CPU_AVG[$i]}") - #RootFS - # echo "aBENCH_ROOTFS_WRITE[$i,$j] ${aBENCH_ROOTFS_WRITE[$i,$j]}" - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )); then + if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then - aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} fi - if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )); then + if (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )); then - aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} fi - (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) + (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) - # echo "aBENCH_ROOTFS_READ[$i,$j] ${aBENCH_ROOTFS_READ[$i,$j]}" - if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then + # echo "aBENCH_CPU_TEMP_END[$i,$j] ${aBENCH_CPU_TEMP_END[$i,$j]}" + if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then - aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} fi - if (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )); then + if (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )); then - aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} fi - (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) + (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) - #RAM - # echo "aBENCH_RAM_WRITE[$i,$j] ${aBENCH_RAM_WRITE[$i,$j]}" - if (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )); then + #Last item in current array. Work out averages + if (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )); then - aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} + aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]}") + aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) + aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} )) - fi - if (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )); then + if [[ $G_DEBUG == 1 ]]; then - aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} + echo "aBENCH_RESULT_CPU_AVG $i = ${aBENCH_RESULT_CPU_AVG[$i]}" + echo "aBENCH_RESULT_CPU_TEMP_START_AVG $i = ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}" + echo "aBENCH_RESULT_CPU_TEMP_END_AVG $i = ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}" + + fi fi - (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - # echo "aBENCH_RAM_READ[$i,$j] ${aBENCH_RAM_READ[$i,$j]}" - if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then + done - aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} + done + + 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 + + for (( j=0; j<${aBENCH_ROOTFS_INDEX[$i]}; j++ )) + do + + if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )); then + + aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} fi - if (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )); then + if (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )); then - aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} + aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} fi - (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) + (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) - #CPU temp - # echo "aBENCH_CPU_TEMP_START[$i,$j] ${aBENCH_CPU_TEMP_START[$i,$j]}" - if (( $hw_model_supports_cpu_temps )); then + # echo "aBENCH_ROOTFS_READ[$i,$j] ${aBENCH_ROOTFS_READ[$i,$j]}" + if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then - if [[ ${aBENCH_CPU_TEMP_START[$i,$j]} =~ ^-?[0-9]+$ ]]; then + aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then + fi + if (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )); then - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - fi - if (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )); then + fi + (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + #Last item in current array. Work out averages + if (( $j == ${aBENCH_ROOTFS_INDEX[$i]} - 1 )); then - fi - (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) + aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) + aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} )) - # echo "aBENCH_CPU_TEMP_END[$i,$j] ${aBENCH_CPU_TEMP_END[$i,$j]}" - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then + if [[ $G_DEBUG == 1 ]]; then - aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + echo "aBENCH_RESULT_ROOTFS_WRITE_AVG $i = ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}" + echo "aBENCH_RESULT_ROOTFS_READ_AVG $i = ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}" - fi - if (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )); then + fi - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + fi - fi - (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) + done - else + done - hw_model_supports_cpu_temps=0 #Set unavailable for current HW model, do not check again for HW model - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]='N/A' + for i in ${!aBENCH_RAM_INDEX[@]} + do - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]='N/A' + 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_CPU_TEMP_END_MIN[$i]='N/A' - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]='N/A' + aBENCH_RESULT_RAM_READ_MIN[$i]=$default_min_value + aBENCH_RESULT_RAM_READ_MAX[$i]=0 + aBENCH_RESULT_RAM_READ_AVG[$i]=0 - fi + for (( j=0; j<${aBENCH_RAM_INDEX[$i]}; j++ )) + do - fi + if (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )); then - if [[ $G_DEBUG == 1 ]]; then + aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} - echo "DEBUG Bench Entry: $i $j" - echo ${aBENCH_ROOTFS_WRITE[$i,$j]} - echo ${aBENCH_ROOTFS_READ[$i,$j]} - echo ${aBENCH_RAM_WRITE[$i,$j]} - echo ${aBENCH_RAM_READ[$i,$j]} - echo ${aBENCH_CPU_TEMP_START[$i,$j]} - echo ${aBENCH_CPU_TEMP_END[$i,$j]} + fi + if (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )); then + + aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} fi + (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - #Last item in current array. Work out averages - if (( $j == ${aBENCH_COMMON_INDEX[$i]} - 1 )); then + # echo "aBENCH_RAM_READ[$i,$j] ${aBENCH_RAM_READ[$i,$j]}" + if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then + + aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} - aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]}") - aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) + fi + if (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )); then - if (( $hw_model_supports_cpu_temps )); then + aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_COMMON_INDEX[$i]} )) + fi + (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) - fi + #Last item in current array. Work out averages + if (( $j == ${aBENCH_RAM_INDEX[$i]} - 1 )); then + + aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) + aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} )) if [[ $G_DEBUG == 1 ]]; then - echo "DEBUG Bench avg: $i" - echo "aBENCH_RESULT_CPU_AVG $i = ${aBENCH_RESULT_CPU_AVG[$i]}" - echo "aBENCH_RESULT_ROOTFS_WRITE_AVG $i = ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}" - echo "aBENCH_RESULT_ROOTFS_READ_AVG $i = ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}" echo "aBENCH_RESULT_RAM_WRITE_AVG $i = ${aBENCH_RESULT_RAM_WRITE_AVG[$i]}" echo "aBENCH_RESULT_RAM_READ_AVG $i = ${aBENCH_RESULT_RAM_READ_AVG[$i]}" - echo "aBENCH_RESULT_CPU_TEMP_START_AVG $i = ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}" - echo "aBENCH_RESULT_CPU_TEMP_END_AVG $i = ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}" fi @@ -823,49 +843,61 @@ Device: - Total benchmarks: - Average: - Fastest: - Slowest: - Average: - Lowest: - Highest: - Average: - Lowest: - Highest: + Count: + Average: + Fastest: + Slowest: + Average: + Lowest: + Highest: + Average: + Lowest: + Highest: - $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') -

DietPi-Benchmarks | IO (Filesystem & RAM):

+

DietPi-Benchmarks | IO (RootFS):

+ + + + + + + + + + + + $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo ""; done ) +
RootFS write (MB/s): RootFS read (MB/s):
Device:Count:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]}
+ +

DietPi-Benchmarks | IO (RAM):

+ + + - - - - - - - - - - - - - + + + + + + + - $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo ""; done )
RAM write (MB/s): RAM read (MB/s):
Device:Total benchmarks:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Count:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]} ${aBENCH_RESULT_RAM_READ_MIN[$i]}
${aHW_NAME[$i]:=$i} ${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}
-

DietPi-Benchmarks | Network LAN throughput:

+

DietPi-Benchmarks | IO (Network LAN):

- - - - + + + + - $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ') + $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done )
@@ -873,19 +905,27 @@
Device:Total benchmarks:Average:Fastest:Slowest:Count:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]}${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
_EOF_ # Move HTML page in place - mv index.html /var/www/survey/index.html + if (( $G_DEBUG == 1 )); then + + mv index.html /var/www/survey/debug.html + + else + + mv index.html /var/www/survey/index.html + + fi } diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a263321e08..d28ef36f5e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3234,7 +3234,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' #G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad speedcrunch fi @@ -7208,7 +7208,7 @@ _EOF_ Banner_Configuration # - Configs - Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt.7z" /root/.config + Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf @@ -12704,7 +12704,8 @@ _EOF_ apt-mark unhold pcmanfm #RPi Banner_Uninstalling - G_AGP lxde $(dpkg --get-selections lxde-* | mawk '{print $1}') upower policykit-1 firefox-esr + apt-mark auto upower policykit-1 firefox-esr + G_AGP lxde $(dpkg --get-selections lxde-* | mawk '{print $1}') rm -Rf /root/.config/{lxpanel,lxsession,lxterminal} fi @@ -12712,9 +12713,9 @@ _EOF_ software_id=173 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - Banner_Uninstalling - G_AGP lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad + apt-mark auto qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad speedcrunch + G_AGP lxqt [[ -d '/root/.config/lxqt' ]] && rm -R /root/.config/lxqt fi @@ -12741,7 +12742,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP mate-desktop-environment-extras upower policykit-1 firefox-esr + apt-mark auto upower policykit-1 firefox-esr + G_AGP mate-desktop-environment-extras fi @@ -12749,7 +12751,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 firefox-esr + apt-mark auto upower policykit-1 firefox-esr + G_AGP x-window-system-core wmaker gnustep gnustep-devel gnustep-games fi @@ -12757,7 +12760,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP xfce4 gnome-icon-theme tango-icon-theme firefox-esr + apt-mark auto gnome-icon-theme tango-icon-theme firefox-esr + G_AGP xfce4 fi From aee4e8fb6b0e026b91f8ecd07101bbc3732c59b8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 20 Apr 2019 12:10:43 +0100 Subject: [PATCH 090/253] Minor desc/info. --- .meta/dietpi-survey_report | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index b218616f0f..9fb6156067 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -430,7 +430,7 @@ fi - #CPU + # - CPU if [[ ${BENCH_CPU//.*} =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then @@ -448,6 +448,7 @@ fi + # - RootFS if [[ ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ ]]; then aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_ROOTFS_WRITE//.*} @@ -457,6 +458,7 @@ fi + # - RAM # - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing. if (( $BENCH_VERSION >= 2 )) && [[ ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ ]]; then @@ -468,7 +470,6 @@ fi - #Optional benchmarks, handle them in a seperate index array # - Custom FS if [[ ${BENCH_CUSTOMFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_CUSTOMFS_READ//.*} =~ ^-?[0-9]+$ ]]; then @@ -514,9 +515,11 @@ # Clean up reports dir rm -R /tmp/dietpi-survey_report - #Bench Results, HW_MODEL array: + #Process all results, for later use in HTML printout + # - NB: HW_MODEL array based local default_min_value=100000 - #CPU + + # - CPU for i in ${!aBENCH_CPU_INDEX[@]} do @@ -594,6 +597,7 @@ done + # - RootFS for i in ${!aBENCH_ROOTFS_INDEX[@]} do @@ -651,6 +655,7 @@ done + # - RAM for i in ${!aBENCH_RAM_INDEX[@]} do @@ -709,7 +714,7 @@ done - # - Optional benchmarks LAN + # - LAN for i in ${!aBENCH_LAN_INDEX[@]} do @@ -745,7 +750,8 @@ done - # - Optional benchmarks CUSTOMFS + # - CustomFS + #Still needs to be done (will take a look when I can) #aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value #aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 #aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 From 1b5f97fc3046b2f909c58ee725c81bf7d23a44d9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 20 Apr 2019 22:19:23 +0200 Subject: [PATCH 091/253] v6.23 + CHANGELOG | Fail2Ban: Resolved an issue where the service silently failed --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0a58de7f9e..385ee1b1f6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -30,6 +30,7 @@ Bug Fixes: - DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697 - DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 - DietPi-Software | Logitech Media Server: Resolved an issue where certain plugins failed due to missing "libio-socket-ssl-perl". Many thanks to @noobian and @Edward for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5824 +- DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From fdd016f373683840520a1962e0274c44fce42294 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 21 Apr 2019 02:19:03 +0200 Subject: [PATCH 092/253] v6.23 (#2727) + DietPi-Software | Fail2Ban: Fix changed loglevel options on Stretch + DietPi-Software | Fail2Ban: Skip overwriting fail2ban.conf since our values match the APT defaults + DietPi-Software | Fail2Ban: Create jail.conf (with backend = systemd) before installing fail2ban APT package, so we can skip the /var/log/auth.log creation which is only required for log file based banning. This is never required on DietPi systems since systemd/journald is present as default syslog daemon and used Dropbear and OpenSSH. The whole configuration step can be skipped then. + DietPi-Software | Fail2Ban: On Jessie, the systemd backend is not yet supported, so we install the Stretch package manually + DietPi-Software | Fail2Ban: Create [DEFAULT]s for all required variables (all ports, filter based on jail name) and define SSH port (22) in separate jails only. + DietPi-Software | Fail2Ban: Never overwrite existing config files. They are usually (should be) customized based on own needs. + DietPi-Software | Download_Install: Apply our default APT noninteractive options to "dpkg -i", especially confdef+confold since user won't even see the prompt which is redirected to log file by G_RUN_CMD. + DietPi-Software | Download_Install: Why not being a bid more transparent and show user which command we run in details. --- dietpi/dietpi-software | 115 ++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 66 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d14d3a4cba..f1f40fc5d9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1765,11 +1765,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=73 - aSOFTWARE_WHIP_NAME[$software_id]='Fail2Ban' - aSOFTWARE_WHIP_DESC[$software_id]='prevents brute-force attacks with ip ban' - aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' + aSOFTWARE_WHIP_NAME[$software_id]='Fail2Ban' + aSOFTWARE_WHIP_DESC[$software_id]='prevents brute-force attacks with ip ban' + aSOFTWARE_CATEGORY_INDEX[$software_id]=12 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' #------------------ #Webserver stacks @@ -3129,23 +3129,23 @@ DietPi-Software will decrypt and use it for software installs. You can change it elif [[ $type == deb ]]; then # - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies - l_message='Installing deb package' G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg -i $file + G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file (( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF elif [[ $type == zip ]]; then [[ $target ]] && target="-d $target" - l_message='Unzipping archive' G_RUN_CMD unzip -o $file "$target" + G_RUN_CMD unzip -o $file "$target" elif [[ $type == tar ]]; then [[ $target ]] && target="--one-top-level=$target" - l_message='Unpacking tarball' G_RUN_CMD tar xf $file "$target" + G_RUN_CMD tar xf $file "$target" elif [[ $type == 7z ]]; then [[ $target ]] && target="-o$target" - l_message='Extracting 7zip archive' G_RUN_CMD 7zr x -y $file "$target" + G_RUN_CMD 7zr x -y $file "$target" else @@ -3153,7 +3153,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi - [[ -f $file ]] && l_message='Cleaning download directory' G_RUN_CMD rm $file + [[ -f $file ]] && G_RUN_CMD rm $file unset fallback_url dps_index no_check_url } @@ -4697,15 +4697,46 @@ _EOF_ fi - #FAIL2BAN - software_id=73 + software_id=73 # Fail2Ban if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - >> /var/log/auth.log #: https://github.com/MichaIng/DietPi/issues/475#issuecomment-310873879 + # Create jail.conf (backend = systemd) first, to prevent APT failure due to missing /var/log/auth.log: https://github.com/MichaIng/DietPi/issues/475#issuecomment-310873879 + mkdir -p /etc/fail2ban + [[ -f '/etc/fail2ban/jail.conf' ]] || cat << _EOF_ > /etc/fail2ban/jail.conf +[DEFAULT] +ignoreip = 127.0.0.1/8 +ignorecommand = +bantime = 600 +findtime = 600 +maxretry = 3 +backend = systemd +enabled = true +filter = %(__name__)s +port = 0:65535 +banaction = route +action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s"] +action = %(action_)s + +[sshd] +port = ssh + +[dropbear] +port = ssh +_EOF_ + + if (( $G_DISTRO > 3 )); then + + G_AGI python3-systemd fail2ban + + # On Jessie, the systemd backend is not yet supported, so we install the Stretch package manually + else + + DEPS_LIST='python3-systemd' + Download_Install 'https://dietpi.com/downloads/binaries/all/fail2ban.deb' - G_AGI python3-systemd fail2ban + fi fi @@ -9716,57 +9747,7 @@ _EOF_ fi - #FAIL2BAN - software_id=73 - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - G_BACKUP_FP /etc/fail2ban/fail2ban.conf /etc/fail2ban/jail.conf - cat << _EOF_ > /etc/fail2ban/fail2ban.conf -[Definition] -# loglevel #1=error #2=warn #3=info -loglevel = 3 -logtarget = /var/log/fail2ban.log -socket = /var/run/fail2ban/fail2ban.sock -pidfile = /var/run/fail2ban/fail2ban.pid -_EOF_ - - cat << _EOF_ > /etc/fail2ban/jail.conf -[DEFAULT] - -enabled = true -ignoreip = 127.0.0.1/8 -ignorecommand = -backend = systemd -bantime = 600 -findtime = 600 -maxretry = 3 -banaction = route -action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s"] -action = %(action_)s - -[sshd] - -enabled = true -port = ssh -filter = sshd -logpath = /var/log/auth.log -maxretry = 3 - -[dropbear] - -enabled = true -port = ssh -filter = dropbear -logpath = /var/log/auth.log -maxretry = 3 -_EOF_ - - fi - - #InfluxDB - software_id=74 + software_id=74 # InfluxDB if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -13708,11 +13689,13 @@ _EOF_ fi - software_id=73 + software_id=73 # Fail2Ban if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP fail2ban + apt-mark auto python3-systemd + [[ -d '/etc/fail2ban' ]] && rm -R /etc/fail2ban fi From 847a016638c6929153dc16e7ce054d3dce5e4c60 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 21 Apr 2019 16:35:56 +0200 Subject: [PATCH 093/253] v6.23 + DietPi-NordVPN | By default "auth-user-pass" is present without blank. A second valid entry did not break things, but lets prevent it. --- dietpi/misc/dietpi-nordvpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index 6b3e2053e7..b61398da37 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -95,7 +95,7 @@ NORDVPN_PASSWORD='${NORDVPN_PASSWORD//\'/\'\\\'\'}' NORDVPN_SERVER='$NORDVPN_SERVER' PROTOCOL='$PROTOCOL' _EOF_ - G_CONFIG_INJECT 'auth-user-pass[[:blank:]]' "auth-user-pass $FP_SETTINGS_OVPN" /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER + G_CONFIG_INJECT 'auth-user-pass' "auth-user-pass $FP_SETTINGS_OVPN" /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER chmod 600 $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER chown root:root $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER From fddbd422bdd680ff84c122e38a9bae42cfb78e54 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 21 Apr 2019 16:49:28 +0200 Subject: [PATCH 094/253] v6.23 + DietPi-Patch | Fix doubled "auth-user-pass" entry in NordVPN/OpenVPN config file --- dietpi/patch_file | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index b000722eec..55276497ac 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1755,6 +1755,19 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' sed -i '/^ListenPort/a\PostUp = ip6tables -A FORWARD -i %i -j ACCEPT; ip6tables -t nat -A POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf sed -i '/^ListenPort/a\PostDown = ip6tables -D FORWARD -i %i -j ACCEPT; ip6tables -t nat -D POSTROUTING -o $(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE' /etc/wireguard/wg0.conf + fi + #----------------------------------------------------------------------- + # NordVPN: Tiny fix for doubled auth-user-pass entry: https://github.com/MichaIng/DietPi/commit/847a016638c6929153dc16e7ce054d3dce5e4c60 + if [[ -f '/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf' ]]; then + + . /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf + if [[ -f /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER && $(grep -c '^auth-user-pass' /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER) == 2 ]]; then + + sed -i '/^auth-user-pass$/d' /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER + + fi + unset NORDVPN_USERNAME NORDVPN_PASSWORD NORDVPN_SERVER PROTOCOL + fi #----------------------------------------------------------------------- # Reinstalls From 3a13392d116ebf735eb900a944c4db9e63072caf Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 22 Apr 2019 12:43:15 +0100 Subject: [PATCH 095/253] https://github.com/MichaIng/DietPi/issues/2717 --- 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 6e684dbf8f..eaef4221eb 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1381,8 +1381,8 @@ $print_logfile_info G_CHECK_URL(){ local string=$@ - local timeout=${timeout:-5} - local retry_max=${retry_max:-3} + local timeout=${timeout:-10} + local retry_max=${retry_max:-2} local optional_cmd_inputs=${optional_cmd_inputs:-} while : From da67c2c69fc52edc2fa80c51d98494ee270d8389 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 22 Apr 2019 13:18:39 +0100 Subject: [PATCH 096/253] https://github.com/MichaIng/DietPi/issues/2717 --- CHANGELOG.txt | 1 + dietpi.txt | 5 +++++ dietpi/dietpi-config | 35 ++++++++++++++++++++++++++++++++++- dietpi/func/dietpi-globals | 4 ++-- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 385ee1b1f6..6b6e367802 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 +- DietPi-Config | G_CHECK_URL: Added ability to change the timeout and retry count, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-NordVPN | Added ability to toggle auto start/connect during boot. diff --git a/dietpi.txt b/dietpi.txt index c259e2aa69..44684b8726 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -163,6 +163,11 @@ CONFIG_PROXY_PASSWORD= #Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait CONFIG_BOOT_WAIT_FOR_NETWORK=1 +#Change the default timeout, before DietPi G_CHECK_URL assumes the URL is dead. Increase if you have a "flaky" connection or slow DNS resolver. +CONFIG_G_CHECK_URL_TIMEOUT=10 +# Retry count: How many tries to check the URL before assuming URL is dead. +CONFIG_G_CHECK_URL_RETRY=2 + #DietPi checks for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.) CONFIG_CHECK_DIETPI_UPDATES=1 # Optional: Automatically update DietPi when updates are available. | requires CONFIG_CHECK_DIETPI_UPDATES=1 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index a61dc9314a..da2e04014d 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4333,13 +4333,19 @@ Additional benchmarks: fi + local check_url_timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + local check_url_retry=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_RETRY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + G_WHIP_MENU_ARRAY=( '' '●─ Mirror Options ' 'APT Mirror' ": [$apt_mirror_current]" 'NTP Mirror' ": [$ntp_mirror_current]" - '' '●─ Additional Options ' + '' '●─ Connection Test Options ' 'Boot Net Wait' ": [$boot_wait_for_network_text]" + 'G_CHECK_URL Timeout' ": [$check_url_timeout]" + 'G_CHECK_URL Retry' ": [$check_url_retry]" + '' '●─ Additional Options ' 'Network Drives' ': Mount/control networked storage' 'No-IP' ": [$noip_menutext]" @@ -4351,6 +4357,33 @@ Additional benchmarks: case "$G_WHIP_RETURNED_VALUE" in + 'G_CHECK_URL Timeout') + + local min=5 + local max=60 + G_WHIP_DEFAULT_ITEM=$check_url_timeout + G_WHIP_INPUTBOX "This setting tells DietPi how long to wait, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." + if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $min $max; then + + G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_TIMEOUT=' "CONFIG_G_CHECK_URL_TIMEOUT=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt + + fi + + ;; + + 'G_CHECK_URL Retry') + + local min=2 + local max=10 + G_WHIP_INPUTBOX "This setting tells DietPi how many tries to check a URL, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." + if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $min $max; then + + G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_RETRY=' "CONFIG_G_CHECK_URL_RETRY=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt + + fi + + ;; + 'Network Drives') G_WHIP_YESNO 'The ability to mount and control networked drives has moved to:\n - DietPi-Drive_manager\n\nWould you like to launch the program now?' diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index eaef4221eb..14f6c5c8dc 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1381,8 +1381,8 @@ $print_logfile_info G_CHECK_URL(){ local string=$@ - local timeout=${timeout:-10} - local retry_max=${retry_max:-2} + local timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + local retry_max=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_RETRY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') local optional_cmd_inputs=${optional_cmd_inputs:-} while : From 27808a0927bba686fa1767502527ae08a0e0d3f9 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 22 Apr 2019 13:20:50 +0100 Subject: [PATCH 097/253] Minor --- dietpi/dietpi-config | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index da2e04014d..93c5062684 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4375,6 +4375,7 @@ Additional benchmarks: local min=2 local max=10 + G_WHIP_DEFAULT_ITEM=$check_url_retry G_WHIP_INPUTBOX "This setting tells DietPi how many tries to check a URL, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $min $max; then From b1b18df5b50a1600a24c0ce109c59d09a1ac77db Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 22 Apr 2019 13:30:38 +0100 Subject: [PATCH 098/253] Revert 5 seconds and 3: https://github.com/MichaIng/DietPi/issues/2717 --- dietpi.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 44684b8726..e43d39dc32 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -164,9 +164,9 @@ CONFIG_PROXY_PASSWORD= CONFIG_BOOT_WAIT_FOR_NETWORK=1 #Change the default timeout, before DietPi G_CHECK_URL assumes the URL is dead. Increase if you have a "flaky" connection or slow DNS resolver. -CONFIG_G_CHECK_URL_TIMEOUT=10 +CONFIG_G_CHECK_URL_TIMEOUT=5 # Retry count: How many tries to check the URL before assuming URL is dead. -CONFIG_G_CHECK_URL_RETRY=2 +CONFIG_G_CHECK_URL_RETRY=3 #DietPi checks for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.) CONFIG_CHECK_DIETPI_UPDATES=1 From 89d1d9dca54e5c991790b8b4bb85413503680574 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 22 Apr 2019 13:35:12 +0100 Subject: [PATCH 099/253] Minor info. --- dietpi/dietpi-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 93c5062684..7d72dee29d 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4343,8 +4343,8 @@ Additional benchmarks: 'NTP Mirror' ": [$ntp_mirror_current]" '' '●─ Connection Test Options ' 'Boot Net Wait' ": [$boot_wait_for_network_text]" - 'G_CHECK_URL Timeout' ": [$check_url_timeout]" - 'G_CHECK_URL Retry' ": [$check_url_retry]" + 'G_CHECK_URL Timeout' ": [$check_url_timeout Seconds]" + 'G_CHECK_URL Retry' ": [$check_url_retry Tries]" '' '●─ Additional Options ' 'Network Drives' ': Mount/control networked storage' 'No-IP' ": [$noip_menutext]" From 908c64a3ee587002f030bb9d9e33108e345f55ac Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 22 Apr 2019 17:14:00 +0200 Subject: [PATCH 100/253] v6.23 + DietPi-Globals | G_CHECK_URL: Minor coding and wording --- dietpi/func/dietpi-globals | 39 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 14f6c5c8dc..d7ec237636 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1376,52 +1376,43 @@ $print_logfile_info #URL Connection test # - $@ = URL - # Optional inputs = timeout | retry_max | optional_cmd_inputs (eg: --no-check-certificate) - # Prompts user to configure network if $G_USER_INPUTS=1 + # Optional variables: $optional_cmd_inputs (eg: --no-check-certificate) + # In case of failure and $G_USER_INPUTS=1: Prompts user to configure network G_CHECK_URL(){ local string=$@ local timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - local retry_max=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_RETRY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - local optional_cmd_inputs=${optional_cmd_inputs:-} + local attempts=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + #local optional_cmd_inputs while : do G_ERROR_HANDLER_COMMAND="Connection test: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_CHECK_URL' - G_ERROR_HANDLER_RETRY=1 + G_DIETPI-NOTIFY -2 "Testing connection to $string, please wait..." + local i=0 - for ((i=1; i<=$retry_max; i++)) + for ((i=1; i<=$attempts; i++)) do - G_DIETPI-NOTIFY -2 "($i/$retry_max) Testing connection to $string, please wait..." - - wget --spider $optional_cmd_inputs --timeout=$timeout --tries=1 "$string" &> $G_ERROR_HANDLER_ONERROR_FPLOGFILE + # Since --tries/-t is not applied on "fatal" errors (resolving failed, connection refused, 404), we need to loop ourself to exclude any temporary issue + wget --spider -t 1 -T $timeout $optional_cmd_inputs "$string" &> $G_ERROR_HANDLER_ONERROR_FPLOGFILE G_ERROR_HANDLER_EXITCODE=$? - # Valid - if (( ! $G_ERROR_HANDLER_EXITCODE )); then - - break - - # Retry - else - sleep 2 - G_DIETPI-NOTIFY -2 "Failed connection attempt ($i/$retry_max), retrying..." + # Valid + (( $G_ERROR_HANDLER_EXITCODE )) || break - fi + # Retry + G_DIETPI-NOTIFY -2 "Failed connection attempt to $string ($i/$attempts), retrying..." + sleep 1 done G_ERROR_HANDLER - if (( ! $G_ERROR_HANDLER_EXITCODE )); then - - break - - fi + (( $G_ERROR_HANDLER_EXITCODE )) || break done From 645c9d36638d08692a9301173380d234524ee88d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 22 Apr 2019 17:30:12 +0200 Subject: [PATCH 101/253] v6.23 + dietpi.txt | "CONFIG_G_CHECK_URL_RETRY" => "CONFIG_G_CHECK_URL_ATTEMPTS" renaming since it is not the amount of "retries" meaning "1" = 2 attempts overall, but actually the amount of tries/attempts. + dietpi.txt | G_CHECK_URL: Add info about effect of zero values, which are never recommended + minor wording --- dietpi.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index e43d39dc32..77d9e7a2e8 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -163,14 +163,16 @@ CONFIG_PROXY_PASSWORD= #Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait CONFIG_BOOT_WAIT_FOR_NETWORK=1 -#Change the default timeout, before DietPi G_CHECK_URL assumes the URL is dead. Increase if you have a "flaky" connection or slow DNS resolver. +#Connection timeout, before DietPi G_CHECK_URL assumes the URL is dead. Increase if you have a "flaky" connection or slow DNS resolver. +# NB: Set this to "0" to allow unlimited time, however this is not recommended to avoid unlimited hanging background scripts, e.g. daily DietPi update check. CONFIG_G_CHECK_URL_TIMEOUT=5 -# Retry count: How many tries to check the URL before assuming URL is dead. -CONFIG_G_CHECK_URL_RETRY=3 +#Connection attempts with above timeout each, before DietPi G_CHECK_URL is giving up and prompts an error. +# NB: Set this to "0" to disable URL checking completely, however this is not recommended to avoid harder to debug follow-up errors during APT and download attempts. +CONFIG_G_CHECK_URL_ATTEMPTS=3 #DietPi checks for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.) CONFIG_CHECK_DIETPI_UPDATES=1 -# Optional: Automatically update DietPi when updates are available. | requires CONFIG_CHECK_DIETPI_UPDATES=1 +# Optional: Automatically update DietPi when updates are available. | requires CONFIG_CHECK_DIETPI_UPDATES=1 CONFIG_AUTO_DIETPI_UPDATES=0 #NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift From d299e3d9ba6cd680ad935d185be9c19b807519fb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 22 Apr 2019 17:50:15 +0200 Subject: [PATCH 102/253] v6.23 + DietPi-Pre-patch | Apply new G_CHECK_URL settings to dietpi.txt. Required in pre-patches since those values are used throughout patch_file already. --- dietpi/pre-patch_file | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index caf17db103..1e2c096df0 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -73,12 +73,20 @@ fi #------------------------------------------------------------------------------- # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 - if (( $G_DIETPI_VERSION_SUB < 23 )) && [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then + # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings + if (( $G_DIETPI_VERSION_SUB < 23 )); 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 + 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_CODE=4; break; } + fi + + grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } + grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } + fi #------------------------------------------------------------------------------- # Finished From ac9b16041872e91cd7725a1a7a5d7b652640bfb4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 22 Apr 2019 17:58:09 +0200 Subject: [PATCH 103/253] v6.23 + DietPi-Pre-patches | Remove the "critical" wording as most patches are not too critical but just need to be applied before APT or new DietPi code can be loaded without errors. So this became a regular method to apply patches in a reasonable order. --- dietpi/pre-patch_file | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 1e2c096df0..e3147ef440 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -9,10 +9,10 @@ #//////////////////////////////////// # # Info: - # - Online pre-patching for client system for changes made to update system and critical bug fixes + # - Patches changes made to update system, critical bug fixes and changes that need to be applied before APT and patch_file to run without error # - Runs from dietpi-update as very first update step # - In case of failure, returns related pre-patch ID as exit code - # - NB: Keep this script as simple as possible, do not load/call dietpi-globals, to allow fixing most kinds of DietPi code issues! + # - NB: Keep this script as simple as possible, do not load/call dietpi-globals, to allow adjusting/fixing most kinds of DietPi code first! # # Usage: # - ./pre-patch_file $G_DIETPI_VERSION_SUB @@ -22,7 +22,7 @@ echo -e '\n \e[38;5;154mDietPi-Pre-patch\e[0m \e[90m───────────────────────────────────────────────────── - Mode: \e[0mApplying critical pre-patches\n' + Mode: \e[0mApplying pre-patches\n' # Grab input, being failsafe when applying to $G_DIETPI_VERSION_SUB if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -53,7 +53,7 @@ fi #------------------------------------------------------------------------------- # Pre-patch 2: https://github.com/MichaIng/DietPi/pull/2490 - if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf ]] && + if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f '/etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf' ]] && grep -qi 'buster' /etc/os-release; then echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support' @@ -76,7 +76,7 @@ # 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 + 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 @@ -90,7 +90,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi #------------------------------------------------------------------------------- # Finished - echo -e '\e[90m[\e[0m \e[32mOK\e[0m \e[90m]\e[0m Successfully applied critical pre-patches\n' + echo -e '\e[90m[\e[0m \e[32mOK\e[0m \e[90m]\e[0m Successfully applied pre-patches\n' break #------------------------------------------------------------------------------- From 36ecc7814e873929c0cdca714f0946dcf86526ae Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 22 Apr 2019 19:37:58 +0200 Subject: [PATCH 104/253] v6.23 (#2728) + DietPi-Set_software | APT mirror: Debian dropped jessie-updates and jessie-backports branch and debian-security Jessie branch is about to reach validity timeout. Finally only the main branch remains. + DietPi-Set_software | APT mirror: Debian Jessie ARMv8 branch has been removed completely from repo. It is only available from archive: http://archive.debian.org/debian/ + DietPi-Config | Break attempts to change APT mirror on Jessie ARMv8 + DietPi-Pre-patches | Apply required Debian Jessie APT changes + DietPi-PREP | Fix Jessie APT sources due to Debian support drop; Although we don't support to create Jessie images, we do support to dist-upgrade a Jessie image to Stretch, so this fix needs to stay for now. --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 15 +++++++++++++++ dietpi/dietpi-config | 11 +++++++++++ dietpi/func/dietpi-set_software | 19 ++++++++++--------- dietpi/pre-patch_file | 16 ++++++++++++++++ 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6b6e367802..379a8570b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 Bug Fixes: +- System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 - DietPi-Set_swapfile | Resolved an issue where on first boot (and when calling the script manually) the swapfile creation is attempted on target file systems that do not support it (BTRFS). Many thanks to @mzramna for reporting this issue: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484205696 - DietPi-Config | Resolved an issue where proxy settings would not be correct after a reboot. Many thanks to @stephantual for reporting this!: https://github.com/MichaIng/DietPi/issues/2704 - DietPi-Update | Resolved an issue where on older images first run update didn't finalise as intended, leading to several first run setup issues, depending on the image age. The fix has been applied outside of the releases since only the online part of the updater is affected: https://github.com/MichaIng/DietPi/pull/2684 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3eaf44825b..cc99350f0f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -60,6 +60,21 @@ # - OMV: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10594 [[ -f /etc/apt/sources.list.d/openmediavault.list ]] && rm /etc/apt/sources.list.d/openmediavault.list + # Fixing sources.list due to Debian dropped Jessie support: https://github.com/MichaIng/DietPi/issues/2665 + if grep -qi 'jessie' /etc/os-release && ! grep -qi 'raspbian' /etc/os-release; then + + if [[ $(uname -m) == 'aarch64' ]]; then + + echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list + + else + + sed -Ei '/jessie(\/updates|-backports|-updates)/d' /etc/apt/sources.list + + fi + + fi + apt-get clean apt-get update for i in "${a_MIN_APT_PREREQS[@]}" diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7d72dee29d..80badea093 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4410,6 +4410,17 @@ Additional benchmarks: 'APT Mirror') + # Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 + if (( $G_HW_ARCH == 3 && $G_DISTRO < 4 )); then + + G_WHIP_MSG '[INFO] Debian has dropped the Jessie ARMv8 branch from the official APT repository.\n +Related packages are now available only from the archive: http://archive.debian.org/debian/\n +This has been applied to your APT sources.list during DietPi update to v6.23 and it cannot be changed.\n +Aborting...' + return + + fi + # Create Menu List for Whiptail G_WHIP_MENU_ARRAY=('Custom' ': Manually enter APT mirror') diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index b409c056a7..edca9157ee 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -106,8 +106,13 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe if [[ $INPUT_MODE_VALUE ]]; then + # - Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 + if (( $G_HW_ARCH == 3 && $G_DISTRO < 4 )); then + + INPUT_MODE_VALUE='http://archive.debian.org/debian/' + # - Set defaults? - if [[ $INPUT_MODE_VALUE == 'default' ]]; then + elif [[ $INPUT_MODE_VALUE == 'default' ]]; then if (( $G_HW_MODEL < 10 )); then @@ -121,17 +126,16 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe fi - # - Set raspbian + # - Set Raspbian if (( $G_HW_MODEL < 10 )); then echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free rpi" > /etc/apt/sources.list - echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list # Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt - # - Set debian + # - Set Debian else cat << _EOF_ > /etc/apt/sources.list @@ -141,13 +145,10 @@ deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ - # Jessie, switch deb.debian.org to http: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 + # Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 if (( $G_DISTRO < 4 )); then - sed -i 's/https:/http:/g' /etc/apt/sources.list - - # - ARM64 packages no longer available: https://github.com/MichaIng/DietPi/issues/1915 - (( $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list + echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free" > /etc/apt/sources.list # Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 elif (( $G_DISTRO > 4 )); then diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index e3147ef440..3713371d3b 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -74,6 +74,7 @@ #------------------------------------------------------------------------------- # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings + # Pre-patch 6: https://github.com/MichaIng/DietPi/pull/2728 if (( $G_DIETPI_VERSION_SUB < 23 )); then if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then @@ -87,6 +88,21 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } + if (( $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )) && grep -qi 'jessie' /etc/os-release; then + + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 6 | Applying changes to APT sources.list since Debian dropped support for Jessie systems' + if [[ $(uname -m) == 'aarch64' ]]; then + + echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=6; break; } + + else + + sed -Ei '/(debian-security|jessie-backports|jessie-updates)/d' /etc/apt/sources.list || { EXIT_CODE=6; break; } + + fi + + fi + fi #------------------------------------------------------------------------------- # Finished From 184fc765cdd05df3df96ab082d663e196dfed8d5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 23 Apr 2019 01:54:32 +0200 Subject: [PATCH 105/253] v6.23 (#2729) + DietPi-Drive_Manager | Preserve encryptfs and vboxsf (VirtualBox shared folder) fstab entries --- CHANGELOG.txt | 1 + dietpi/dietpi-drive_manager | 38 ++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 379a8570b4..78401c3522 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 +- DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 - DietPi-Config | G_CHECK_URL: Added ability to change the timeout and retry count, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 95d77e1e44..9b92684137 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -126,7 +126,7 @@ # Mounts local swap_mount='' local tmpfs_mounts='' - local bind_mounts='' + local misc_mounts='' local net_mounts='' # Mode 4: Force reset/clean fstab (PREP) @@ -142,35 +142,35 @@ tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0" swap_mount=$(grep -m1 '[[:blank:]]swap[[:blank:]]' $FP_TEMP_FSTAB) tmpfs_mounts=$(grep '^tmpfs[[:blank:]]' $FP_TEMP_FSTAB) - bind_mounts=$(grep '[[:blank:],]bind[[:blank:],]' $FP_TEMP_FSTAB) + misc_mounts=$(grep -E '([[:blank:],]bind[[:blank:],]|[[:blank:]](encryptfs|vboxsf)[[:blank:]])' $FP_TEMP_FSTAB) # CurlFtpFS, CIFS/SMB/Samba, NFS - net_mounts=$(grep -E '(^curlftpfs|[[:blank:]]cifs[[:blank:]]|[[:blank:]]nfs[4]?[[:blank:]])' $FP_TEMP_FSTAB) + net_mounts=$(grep -E '(^curlftpfs|[[:blank:]](cifs|nfs[4]?)[[:blank:]])' $FP_TEMP_FSTAB) fi - echo "#----------------------------------------------------------- -#NETWORK + echo "# Please use \"dietpi-drive_manager\" to setup mounts +#----------------------------------------------------------- +# NETWORK #----------------------------------------------------------- -#Please use DietPi-Drive_Manager to setup network mounts $net_mounts #----------------------------------------------------------- -#TMPFS +# TMPFS #----------------------------------------------------------- $tmpfs_mounts #----------------------------------------------------------- -#MISC (bind) +# MISC: bind, encryptfs, vboxsf (VirtualBox shared folder) #----------------------------------------------------------- -$bind_mounts +$misc_mounts #----------------------------------------------------------- -#SWAPFILE +# SWAPFILE #----------------------------------------------------------- $swap_mount #----------------------------------------------------------- -#PHYSICAL DRIVES +# PHYSICAL DRIVES #-----------------------------------------------------------" > $FP_TEMP_FSTAB # Detect mounted drives and add them to fstab @@ -178,20 +178,20 @@ $swap_mount df -Pha | tail -n +2 > .dietpi-drive_manager_df_tmp # - Remove items from list - # Bind: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374 + # Misc: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374 while read line do [[ $line ]] || continue - # - Bind - local input_bind_mount_source=$(mawk '{print $1}' <<< $line) - local input_bind_mount_target=$(mawk '{print $2}' <<< $line) - sed -i "\#[[:blank:]]$input_bind_mount_target#d" .dietpi-drive_manager_df_tmp - sed -i "\#[[:blank:]]$input_bind_mount_source#d" .dietpi-drive_manager_df_tmp - [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 0 " - Detected bind mount and removed from df scrape: $input_bind_mount_source > $input_bind_mount_target" + # - Misc + local input_mount_source=$(mawk '{print $1}' <<< $line) + local input_mount_target=$(mawk '{print $2}' <<< $line) + sed -i "\#^$input_mount_source[[:blank:]]#d" .dietpi-drive_manager_df_tmp + sed -i "\#[[:blank:]]$input_mount_target$#d" .dietpi-drive_manager_df_tmp + [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 0 " - Detected misc mount and removed from df scrape: $input_mount_source > $input_mount_target" - done <<< "$bind_mounts" + done <<< "$misc_mounts" # - Process final DF result while read line From fa1f0469b1fc0cfaf9834024575a935162902f40 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 23 Apr 2019 14:26:09 +0200 Subject: [PATCH 106/253] v6.23 + DietPi-Config | Apply "CONFIG_G_CHECK_URL_RETRY" => "CONFIG_G_CHECK_URL_ATTEMPTS" to here as well. + DietPi-Config | G_CHECK_URL does not handle $retry_max as input variable anymore + DietPi-Config | Coding: Always wrap first argument of G_CHECK_VALIDINT into double quotes to assure it is not split in case of invalid user input --- dietpi/dietpi-config | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 80badea093..37fa150bca 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3020,7 +3020,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then INTERNET_TEST_URL=$G_WHIP_RETURNED_VALUE INTERNET_TEST_STATE=0 # Not tested - G_ERROR_HANDLER_INFO_ONLY=1 retry_max=2 G_CHECK_URL "$INTERNET_TEST_URL" + G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL "$INTERNET_TEST_URL" if (( $G_ERROR_HANDLER_EXITCODE_RETURN == 0 )); then INTERNET_TEST_STATE=2 # Online @@ -4334,7 +4334,7 @@ Additional benchmarks: fi local check_url_timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - local check_url_retry=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_RETRY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + local check_url_attempts=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') G_WHIP_MENU_ARRAY=( @@ -4344,7 +4344,7 @@ Additional benchmarks: '' '●─ Connection Test Options ' 'Boot Net Wait' ": [$boot_wait_for_network_text]" 'G_CHECK_URL Timeout' ": [$check_url_timeout Seconds]" - 'G_CHECK_URL Retry' ": [$check_url_retry Tries]" + 'G_CHECK_URL Attempts' ": [$check_url_attempts Tries]" '' '●─ Additional Options ' 'Network Drives' ': Mount/control networked storage' 'No-IP' ": [$noip_menutext]" @@ -4359,11 +4359,10 @@ Additional benchmarks: 'G_CHECK_URL Timeout') - local min=5 - local max=60 + local min=5 max=60 G_WHIP_DEFAULT_ITEM=$check_url_timeout - G_WHIP_INPUTBOX "This setting tells DietPi how long to wait, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." - if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $min $max; then + G_WHIP_INPUTBOX "This setting tells DietPi how long to wait, before G_CHECK_URL assumes a dead connection attempt (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." + if (( $? == 0 )) && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $min $max; then G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_TIMEOUT=' "CONFIG_G_CHECK_URL_TIMEOUT=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt @@ -4371,15 +4370,14 @@ Additional benchmarks: ;; - 'G_CHECK_URL Retry') + 'G_CHECK_URL Attempts') - local min=2 - local max=10 - G_WHIP_DEFAULT_ITEM=$check_url_retry - G_WHIP_INPUTBOX "This setting tells DietPi how many tries to check a URL, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." - if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $min $max; then + local min=2 max=10 + G_WHIP_DEFAULT_ITEM=$check_url_attempts + G_WHIP_INPUTBOX "This setting tells DietPi how many times to check a URL, before G_CHECK_URL assumes a dead URL link (and failure).\nIncrease this value if you have a 'flaky' connection.\n\nPlease enter a value between $min and $max." + if (( $? == 0 )) && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $min $max; then - G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_RETRY=' "CONFIG_G_CHECK_URL_RETRY=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt + G_CONFIG_INJECT 'CONFIG_G_CHECK_URL_ATTEMPTS=' "CONFIG_G_CHECK_URL_ATTEMPTS=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt fi From 330d7316af56fdad78276aeb855b98927e0ac6b4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 23 Apr 2019 14:30:50 +0200 Subject: [PATCH 107/253] v6.23 +CHANGELOG | Minor wording --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 78401c3522..d5941eea20 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,7 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 -- DietPi-Config | G_CHECK_URL: Added ability to change the timeout and retry count, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 +- DietPi-Config | G_CHECK_URL: Added ability to change the connection attempts and timeout, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-NordVPN | Added ability to toggle auto start/connect during boot. From 54faaaac606dbc6d0c25af2e962cf3f5d93676d6 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 23 Apr 2019 18:03:50 +0100 Subject: [PATCH 108/253] Fix not starting services on boot. Always control services. --- dietpi/misc/dietpi-arr_to_RAM | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index 4216b472c5..e3f0de6caf 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -99,6 +99,7 @@ $USAGE"; exit 1; } [[ -d $FP_DISK ]] || continue Print "${i^} detected" + start_services+=" $i" # Update backup if (( $INPUT == 2 )); then @@ -125,14 +126,8 @@ $USAGE"; exit 1; } fi - # If active, stop program before handling database and restart afterwards - if pgrep -f $i &> /dev/null; then - - Print "Stopping ${i^} service..." - start_services+=" $i" - systemctl stop $i || { error=$? Print "Stopping ${i^} service failed. Skipping this program..."; continue; } - - fi + Print "Stopping ${i^} service..." + systemctl stop $i || { error=$? Print "Stopping ${i^} service failed. Skipping this program..."; continue; } # Link to RAM + backup if (( $INPUT == 1 )); then @@ -241,7 +236,7 @@ Before=dietpi-preboot.service sonarr.service radarr.service lidarr.service [Service] Type=forking RemainAfterExit=yes -ExecStart=-/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 1 2>&1 >> $FP_LOG' +ExecStart=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 1 2>&1 >> $FP_LOG' ExecStop=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 0 2>&1 > $FP_LOG' [Install] From cd4de24b7bcda3cd4d44d51b33c75935069449a7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 24 Apr 2019 13:20:18 +0200 Subject: [PATCH 109/253] v6.23 + DietPi-Patch | Set default GRUB_TIMEOUT on x86 systems to 0 to disable the initial grub prompt. This speeds up boots and users can still adjust BIOS or hit shift key to boot into other OS. This as well matches our "v6.-1" patch. --- PREP_SYSTEM_FOR_DIETPI.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index cc99350f0f..bd53cf788b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1549,8 +1549,7 @@ _EOF_ l_message='Detecting additional OS installed on system' G_RUN_CMD os-prober # - Native PC/EFI (assume x86_64 only possible) - if dpkg-query -s 'grub-efi-amd64' &> /dev/null && - [[ -d '/boot/efi' ]]; then + if dpkg-query -s 'grub-efi-amd64' &> /dev/null && [[ -d '/boot/efi' ]]; then l_message='Recreating GRUB-EFI' G_RUN_CMD grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck @@ -1561,8 +1560,8 @@ _EOF_ G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX_DEFAULT=' 'GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0 quiet"' /etc/default/grub G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX=' 'GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub - G_CONFIG_INJECT 'GRUB_TIMEOUT=' 'GRUB_TIMEOUT=3' /etc/default/grub - l_message='Finalizing GRUB' G_RUN_CMD update-grub + G_CONFIG_INJECT 'GRUB_TIMEOUT=' 'GRUB_TIMEOUT=0' /etc/default/grub + l_message='Finalising GRUB' G_RUN_CMD update-grub fi @@ -1636,7 +1635,7 @@ _EOF_ else - l_message='Enabling dietpi-fs_partition_resize for first boot' G_RUN_CMD systemctl enable dietpi-fs_partition_resize + l_message='Enabling automated partition and file system resize for first boot' G_RUN_CMD systemctl enable dietpi-fs_partition_resize fi From b5441ed54c8cf186768f6e7f0afdedc210adf805 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 24 Apr 2019 12:47:02 +0100 Subject: [PATCH 110/253] + CustomFS benchmark scores. --- .meta/dietpi-survey_report | 95 ++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 9fb6156067..09c78a026f 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -541,12 +541,12 @@ # echo "aBENCH_CPU[$i,$j] ${aBENCH_CPU[$i,$j]}" if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]}") )); then - aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} * 1") + aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} / 1") fi if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]}") )); then - aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} * 1") + aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} / 1") fi aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_CPU[$i,$j]} + ${aBENCH_RESULT_CPU_AVG[$i]}") @@ -751,14 +751,63 @@ done # - CustomFS - #Still needs to be done (will take a look when I can) - #aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value - #aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 - #aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 + # - RootFS + 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 + + for (( j=0; j<${aBENCH_CUSTOMFS_INDEX[$i]}; j++ )) + do + + if (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} )); then + + aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + + fi + if (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} )); then + + aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + + fi + (( aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i] += ${aBENCH_CUSTOMFS_WRITE[$i,$j]} )) + + # echo "aBENCH_CUSTOMFS_READ[$i,$j] ${aBENCH_CUSTOMFS_READ[$i,$j]}" + if (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} )); then + + aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + + fi + if (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]} )); then + + aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + + fi + (( aBENCH_RESULT_CUSTOMFS_READ_AVG[$i] += ${aBENCH_CUSTOMFS_READ[$i,$j]} )) + + #Last item in current array. Work out averages + if (( $j == ${aBENCH_CUSTOMFS_INDEX[$i]} - 1 )); then + + aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) + aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} )) + + if [[ $G_DEBUG == 1 ]]; then + + echo "aBENCH_RESULT_CUSTOMFS_WRITE_AVG $i = ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]}" + echo "aBENCH_RESULT_CUSTOMFS_READ_AVG $i = ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]}" + + fi + + fi + + done - #aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value - #aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 - #aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 + done # Create HTML file cat << _EOF_ > index.html @@ -865,6 +914,26 @@ $(for i in "${!aBENCH_CPU_INDEX[@]}"; do echo "${aHW_NAME[$i]:=$i} ${aBENCH_CPU_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]}${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} "; done | sort -nk 1 -t ' ') +

DietPi-Benchmarks | IO (RAM):

+ + + + + + + + + + + + + + + + $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo ""; done ) +
+ RAM write (MB/s):RAM read (MB/s):
Device:Count:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}
+

DietPi-Benchmarks | IO (RootFS):

@@ -885,12 +954,12 @@ $(for i in "${!aBENCH_ROOTFS_INDEX[@]}"; do echo ""; done )
${aHW_NAME[$i]:=$i} ${aBENCH_ROOTFS_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]}${aBENCH_RESULT_ROOTFS_READ_MIN[$i]}
-

DietPi-Benchmarks | IO (RAM):

+

DietPi-Benchmarks | IO (Custom FS):

- + + @@ -902,7 +971,7 @@ - $(for i in "${!aBENCH_RAM_INDEX[@]}"; do echo ""; done ) + $(for i in "${!aBENCH_CUSTOMFS_INDEX[@]}"; do echo ""; done )
- RAM write (MB/s):RAM read (MB/s):Custom FS write (MB/s):Custom FS read (MB/s):
Device:Fastest: Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_RAM_INDEX[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]}${aBENCH_RESULT_RAM_READ_MIN[$i]}
${aHW_NAME[$i]:=$i} ${aBENCH_CUSTOMFS_INDEX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]}${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]}

DietPi-Benchmarks | IO (Network LAN):

From 5f203a0c1cb79a8de9d3e12138b78ce6ab0c8763 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 24 Apr 2019 12:49:46 +0100 Subject: [PATCH 111/253] Minor --- .meta/dietpi-survey_report | 1 - 1 file changed, 1 deletion(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 09c78a026f..68a81f61cb 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -751,7 +751,6 @@ done # - CustomFS - # - RootFS for i in ${!aBENCH_CUSTOMFS_INDEX[@]} do From ab838023d585ee81b9e1f41aedeedf046417db8c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 24 Apr 2019 13:37:44 +0100 Subject: [PATCH 112/253] + info URL links. --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f1f40fc5d9..9144d5f041 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -405,7 +405,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxxxxxx' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712' #------------------ software_id=24 @@ -462,7 +462,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713' #------------------ software_id=175 @@ -472,7 +472,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='xxxxxxxx' + aSOFTWARE_ONLINEDOC_URL[$software_id]='' # Remote Desktops #-------------------------------------------------------------------------------- From d745b62ccf0ad1b52907f59c482a6a0156622a1c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 24 Apr 2019 14:26:06 +0100 Subject: [PATCH 113/253] DietPi-Config: Intel CPU boost option. --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d5941eea20..8a15eb5437 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 +- DietPi-Config | Added support to toggle Intel CPU turbo/boost mode. Requires Intel CPU that supports the feature. - DietPi-Config | G_CHECK_URL: Added ability to change the connection attempts and timeout, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 37fa150bca..11335083de 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1608,6 +1608,17 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi + #Intel boost option (eg: i5-6200U, disables 2.9GHz mode, limits to 2.3GHz) + local intel_boost_disabled=0 + local intel_boost_text='Enabled' + if grep -qi 'genuineintel' /proc/cpuinfo; then + + intel_boost_disabled=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_DISABLE_TURBO=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + (( $intel_boost_disabled )) && intel_boost_text='Disabled' + G_WHIP_MENU_ARRAY+=('Intel Turbo/Boost' ": [$intel_boost_text]") + + fi + # Define CPU scaling frequency or percent local type_cpu_freq_info='MHz' # - Intel @@ -1645,6 +1656,15 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 case "$G_WHIP_RETURNED_VALUE" in + 'Intel Turbo/Boost'*) + + (( intel_boost_disabled++ )) + (( $intel_boost_disabled > 1 )) && intel_boost_disabled=0 + G_CONFIG_INJECT 'CONFIG_CPU_DISABLE_TURBO=' "CONFIG_CPU_DISABLE_TURBO=$intel_boost_disabled" /DietPi/dietpi.txt + /DietPi/dietpi/func/dietpi-set_cpu + + ;; + 'Ondemand Down Factor'*) MIN_VALUE=1 From 43e0653607144e583424249c1d36c38add2ff3ac Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 24 Apr 2019 21:57:40 +0200 Subject: [PATCH 114/253] v6.23 + DietPi-Software | OpenTyrian: Tiny coding: Use dash for tiny RAM usage and performance enhancement --- .conf/dps_51/run | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.conf/dps_51/run b/.conf/dps_51/run index 9f439918ae..2a2442b529 100644 --- a/.conf/dps_51/run +++ b/.conf/dps_51/run @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/dash #//////////////////////////////////// # DietPi OpenTyrian Run Script # @@ -13,12 +13,12 @@ # run #//////////////////////////////////// -#Xserver already running -if (($(pidof X) >= 0)); then +# Xserver already running +if pidof X > /dev/null; then /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data -#No X (init X server) +# No X (init X server) else xinit /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data From ec9048dfe46a7706fee50a971facd3caf85578ca Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 24 Apr 2019 22:00:28 +0200 Subject: [PATCH 115/253] v6.23 + DietPi-Software | SqueezeLite: Tiny service change --- .conf/dps_36/squeezelite.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.conf/dps_36/squeezelite.service b/.conf/dps_36/squeezelite.service index e4fc683d62..9971e7a702 100644 --- a/.conf/dps_36/squeezelite.service +++ b/.conf/dps_36/squeezelite.service @@ -1,8 +1,7 @@ [Unit] -Description=squeezelite +Description=SqueezeLite (DietPi) [Service] -Type=simple ExecStart=/usr/bin/squeezelite -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log [Install] From 91d4a513ee469a424704a737b73036b306d52edb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 24 Apr 2019 22:01:49 +0200 Subject: [PATCH 116/253] v6.23 + DietPi-Software | Roon Bridge: Tiny service change --- .conf/dps_121/roonbridge.service | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.conf/dps_121/roonbridge.service b/.conf/dps_121/roonbridge.service index 531b1091a9..111937a921 100644 --- a/.conf/dps_121/roonbridge.service +++ b/.conf/dps_121/roonbridge.service @@ -1,10 +1,8 @@ [Unit] -Description=Roon Bridge +Description=Roon Bridge (DietPi) After=network.target sound.target [Service] -Type=simple -User=root Group=dietpi Environment=ROON_DATAROOT=/mnt/dietpi_userdata/roon Environment=ROON_ID_DIR=/mnt/dietpi_userdata/roon From b2bbd24dd3c0c2bc984608538ebda4ae76ce758f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 24 Apr 2019 22:32:12 +0200 Subject: [PATCH 117/253] v6.23 + DietPi-Software | Revert tar extraction to "-C $target" (which requires pre-creation) since "--one-top-level" does not yet exist on Jessie --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9144d5f041..1b240beeaf 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3139,7 +3139,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it elif [[ $type == tar ]]; then - [[ $target ]] && target="--one-top-level=$target" + #[[ $target ]] && target="--one-top-level=$target" # Option exist not on Jessie + [[ $target ]] && G_RUN_CMD mkdir -p "$target" && target="-C $target" G_RUN_CMD tar xf $file "$target" elif [[ $type == 7z ]]; then From b4312c0f575cb511e9020965ffeb252676fdbcc4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 25 Apr 2019 00:05:04 +0200 Subject: [PATCH 118/253] v6.23 + DietPi-Pre-patch | On non-ARMv8 Jessie systems the security repo still works and is required in case some packages were pulled from there already and others, depending from them are about to be installed afterwards (perl-base => perl). Let's hope this does not break again soon. --- dietpi/pre-patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 3713371d3b..7d356bc728 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -97,7 +97,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior else - sed -Ei '/(debian-security|jessie-backports|jessie-updates)/d' /etc/apt/sources.list || { EXIT_CODE=6; break; } + sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=6; break; } fi From cd6836d8c4a05d7bf777784c5118b8515246608c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 25 Apr 2019 13:23:17 +0100 Subject: [PATCH 119/253] pidof X never worked for me, switch to pgrep Xorg which does. --- .conf/dps_51/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_51/run b/.conf/dps_51/run index 2a2442b529..6eff8a8de0 100644 --- a/.conf/dps_51/run +++ b/.conf/dps_51/run @@ -14,7 +14,7 @@ #//////////////////////////////////// # Xserver already running -if pidof X > /dev/null; then +if pgrep Xorg &> /dev/null; then /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data From 7985c0aff6df02daefb01a1cf9c898ff9bab1f15 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 25 Apr 2019 13:42:03 +0100 Subject: [PATCH 120/253] Move to /usr/games (same as APT). Support x86_64. Various tweaks. --- .conf/desktop/apps/opentyrian.desktop | 4 +-- .conf/dps_51/run | 5 ++-- dietpi/dietpi-software | 37 ++++++++++++++++++++++----- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/.conf/desktop/apps/opentyrian.desktop b/.conf/desktop/apps/opentyrian.desktop index c09b7d95fc..4d2d0efa7a 100644 --- a/.conf/desktop/apps/opentyrian.desktop +++ b/.conf/desktop/apps/opentyrian.desktop @@ -2,7 +2,7 @@ Type=Application Name=OpenTyrian Comment=An arcade-style shoot 'em up -Icon=/usr/local/games/opentyrian/linux/icons/tyrian-48.png +Icon=/usr/games/opentyrian/linux/icons/tyrian-48.png Categories=Game;ArcadeGame; -Exec=/usr/local/games/opentyrian/run +Exec=/usr/games/opentyrian/run Terminal=false diff --git a/.conf/dps_51/run b/.conf/dps_51/run index 6eff8a8de0..3a6f1533f1 100644 --- a/.conf/dps_51/run +++ b/.conf/dps_51/run @@ -12,15 +12,16 @@ # Usage: # run #//////////////////////////////////// +FP_DIR='/usr/games/opentyrian' # Xserver already running if pgrep Xorg &> /dev/null; then - /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data + $FP_DIR/opentyrian -t $FP_DIR/data # No X (init X server) else - xinit /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data + xinit $FP_DIR/opentyrian -t $FP_DIR/data fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1b240beeaf..a669367604 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1233,6 +1233,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it done + # - enable x86_64 + aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + + #------------------ software_id=112 @@ -4190,9 +4194,19 @@ _EOF_ Banner_Installing - DEPS_LIST='ibsdl1.2debian libsdl-net1.2' - Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - chmod +x /usr/local/games/opentyrian/opentyrian + if (( $G_HW_MODEL >= 10 )); then + + G_AGI opentyrian + + else + + DEPS_LIST='ibsdl1.2debian libsdl-net1.2' + Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / + cp -R /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 fi @@ -9058,8 +9072,8 @@ _EOF_ Banner_Configuration #Copy the DietPi run file for OpenTyrian - dps_index=$software_id Download_Install 'run' /usr/local/games/opentyrian/run - chmod +x /usr/local/games/opentyrian/run + dps_index=$software_id Download_Install 'run' /usr/games/opentyrian/run + chmod +x /usr/games/opentyrian/run #Create .Desktop SymLinks mkdir -p /root/Desktop @@ -13443,10 +13457,19 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP ibsdl1.2debian libsdl-net1.2 - rm -R /usr/local/games/opentyrian + if (( $G_HW_MODEL >= 10 )); then + + G_AGP opentyrian + + else + + G_AGP ibsdl1.2debian libsdl-net1.2 + + fi + rm /usr/share/applications/opentyrian.desktop rm /root/Desktop/opentyrian.desktop + rm -R /usr/games/opentyrian fi From 45b8d74314287673f874dae2bfa6cd70178afe88 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 25 Apr 2019 13:55:51 +0100 Subject: [PATCH 121/253] Revert, x86_64 needs alot more work. --- .conf/desktop/apps/opentyrian.desktop | 4 +-- .conf/dps_51/run | 5 ++-- dietpi/dietpi-software | 37 ++++++++++++++++++++++----- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/.conf/desktop/apps/opentyrian.desktop b/.conf/desktop/apps/opentyrian.desktop index c09b7d95fc..4d2d0efa7a 100644 --- a/.conf/desktop/apps/opentyrian.desktop +++ b/.conf/desktop/apps/opentyrian.desktop @@ -2,7 +2,7 @@ Type=Application Name=OpenTyrian Comment=An arcade-style shoot 'em up -Icon=/usr/local/games/opentyrian/linux/icons/tyrian-48.png +Icon=/usr/games/opentyrian/linux/icons/tyrian-48.png Categories=Game;ArcadeGame; -Exec=/usr/local/games/opentyrian/run +Exec=/usr/games/opentyrian/run Terminal=false diff --git a/.conf/dps_51/run b/.conf/dps_51/run index 6eff8a8de0..3a6f1533f1 100644 --- a/.conf/dps_51/run +++ b/.conf/dps_51/run @@ -12,15 +12,16 @@ # Usage: # run #//////////////////////////////////// +FP_DIR='/usr/games/opentyrian' # Xserver already running if pgrep Xorg &> /dev/null; then - /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data + $FP_DIR/opentyrian -t $FP_DIR/data # No X (init X server) else - xinit /usr/local/games/opentyrian/opentyrian -t /usr/local/games/opentyrian/data + xinit $FP_DIR/opentyrian -t $FP_DIR/data fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1b240beeaf..a669367604 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1233,6 +1233,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it done + # - enable x86_64 + aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + + #------------------ software_id=112 @@ -4190,9 +4194,19 @@ _EOF_ Banner_Installing - DEPS_LIST='ibsdl1.2debian libsdl-net1.2' - Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - chmod +x /usr/local/games/opentyrian/opentyrian + if (( $G_HW_MODEL >= 10 )); then + + G_AGI opentyrian + + else + + DEPS_LIST='ibsdl1.2debian libsdl-net1.2' + Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / + cp -R /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 fi @@ -9058,8 +9072,8 @@ _EOF_ Banner_Configuration #Copy the DietPi run file for OpenTyrian - dps_index=$software_id Download_Install 'run' /usr/local/games/opentyrian/run - chmod +x /usr/local/games/opentyrian/run + dps_index=$software_id Download_Install 'run' /usr/games/opentyrian/run + chmod +x /usr/games/opentyrian/run #Create .Desktop SymLinks mkdir -p /root/Desktop @@ -13443,10 +13457,19 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP ibsdl1.2debian libsdl-net1.2 - rm -R /usr/local/games/opentyrian + if (( $G_HW_MODEL >= 10 )); then + + G_AGP opentyrian + + else + + G_AGP ibsdl1.2debian libsdl-net1.2 + + fi + rm /usr/share/applications/opentyrian.desktop rm /root/Desktop/opentyrian.desktop + rm -R /usr/games/opentyrian fi From ce1f36665fa9532ae9040937c9d360dabdec6e74 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 17:24:23 +0200 Subject: [PATCH 122/253] v6.23 + DietPi-PREP | Remove Jessie options from code, since we don't support it anyway + DietPi-PREP | Jessie pre-images: Leave security repo inside since this is still supported an when missing can lead to rare APT errors (another package from security repo already installed, then repo removed, then package being installed which depends on a lower version from main repo, e.g. perl > perl-base) + DietPi-PREP | XU4: Force most current kernel v4.14 which is preinstalled on Meverics images anyway. --- PREP_SYSTEM_FOR_DIETPI.sh | 41 +++++++++------------------------------ 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index bd53cf788b..c01dc64d54 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -69,7 +69,7 @@ else - sed -Ei '/jessie(\/updates|-backports|-updates)/d' /etc/apt/sources.list + sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list fi @@ -651,6 +651,7 @@ _EOF_ 'curl' # Web address testing, downloading, uploading etc. 'debconf' # APT package pre-configuration, e.g. "debconf-set-selections" for non-interactive install 'dirmngr' # GNU key management required for some APT installs via additional repos + 'dropbear-run' # DietPi default SSH-Client, excluding initramfs integration 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'gnupg' # apt-key add @@ -677,7 +678,7 @@ _EOF_ ) # - G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273 - if (( $G_HW_MODEL >= 10 )); then + if (( $G_HW_MODEL > 9 )); then G_AGI debian-archive-keyring aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools') # RAM file system initialization, required for generic boot loader, but not required/used by RPi bootloader @@ -699,17 +700,6 @@ _EOF_ fi - # - G_DISTRO specific required packages: - if (( $G_DISTRO < 4 )); then - - aPACKAGES_REQUIRED_INSTALL+=('dropbear') # DietPi default SSH-Client - - else - - aPACKAGES_REQUIRED_INSTALL+=('dropbear-run') # DietPi default SSH-Client (excluding initramfs integration, available since Stretch) - - fi - # - G_HW_MODEL specific required packages: if (( $G_HW_MODEL != 20 )); then @@ -795,7 +785,7 @@ _EOF_ elif (( $G_HW_MODEL == 14 )); then G_AGI linux-image-arm64-odroid-n1 - #G_AGI libdrm-rockchip1 #Not currently on meveric's repo + #G_AGI libdrm-rockchip1 # Not currently on meveric's repo # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -805,9 +795,7 @@ _EOF_ # Odroid XU3/4/HC1/HC2 elif (( $G_HW_MODEL == 11 )); then - #G_AGI linux-image-4.9-armhf-odroid-xu3 - G_AGI $(dpkg --get-selections | mawk '/^linux-image/ {print $1}') - dpkg --get-selections | grep -q '^linux-image' || G_AGI linux-image-4.14-armhf-odroid-xu4 + G_AGI linux-image-4.14-armhf-odroid-xu4 # Odroid C1 elif (( $G_HW_MODEL == 10 )); then @@ -817,12 +805,12 @@ _EOF_ # BBB elif (( $G_HW_MODEL == 71 )); then - G_AGI device-tree-compiler #Kern + G_AGI device-tree-compiler # dtoverlay compiler # - Auto detect kernel package incl. ARMbian/others DTB else - AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | grep -E '^linux-(image|dtb)' | awk '{print $1}') + AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | grep -E '^linux-(image|dtb)' | mawk '{print $1}') if [[ $AUTO_DETECT_KERN_PKG ]]; then G_AGI $AUTO_DETECT_KERN_PKG @@ -846,7 +834,7 @@ _EOF_ if (( $G_HW_MODEL != 20 )); then aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # Eth/WiFi/BT dongle firmware - aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') # Various drivers for generic devices fi @@ -855,18 +843,7 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('firmware-atheros') # WiFi dongle firmware aPACKAGES_REQUIRED_INSTALL+=('firmware-brcm80211') # WiFi dongle firmware aPACKAGES_REQUIRED_INSTALL+=('firmware-iwlwifi') # Intel WiFi dongle/PCI-e firwmare - - # Intel/Nvidia/WiFi (ralink) dongle firmware: https://github.com/MichaIng/DietPi/issues/1675#issuecomment-377806609 - # On Jessie, firmware-misc-nonfree is not available, firmware-ralink instead as dedicated package. - if (( $G_DISTRO < 4 )); then - - aPACKAGES_REQUIRED_INSTALL+=('firmware-ralink') - - else - - aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') - - fi + aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') # Intel/Nvidia/WiFi (Ralink) dongle firmware fi From cf708ded4c82c6cd16d13ad31ea13668ab3110f7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 20:38:35 +0200 Subject: [PATCH 123/253] v6.23 + DIetPi-Set_software | Jessie repo fixes --- dietpi/func/dietpi-set_software | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index edca9157ee..64da1412c7 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -148,7 +148,12 @@ _EOF_ # Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 if (( $G_DISTRO < 4 )); then - echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free" > /etc/apt/sources.list + # - Jessie APT reports warning on httpS://deb.debian.org + sed -i 's|https://deb.debian.org|http://deb.debian.org|g' /etc/apt/sources.list + # - backports and updates have been dropped + sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list + # - ARMv8 has been dropped from security repo + (( $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list # Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 elif (( $G_DISTRO > 4 )); then From 54de30bb5261842bf35a5e0191b720c49514efc1 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 20:46:08 +0200 Subject: [PATCH 124/253] v6.23 (#2735) + DietPi-Software | PHP: Install PHP7.3 on all distro version, on Jessie and Stretch via Ondrejs repo: sury.org + DietPi-Software | PHP: For ownCloud, force PHP7.2 since it does not yet support PHP7.3 + DietPi-Software | Align all aSOFTWARE array items to match "tab = tab with 8 char size" which is default for nano and our scripts on GitHub + DietPi-Patch | Migrate all systems to PHP7.3, ownCloud users to PHP7.2 + DietPi-Software | Redis: Fix wrong permissions shipped by Debian Jessie package + DietPi-Software | Nextcloud: On Jessie current version can and must now be installed since NC14 does not yet support PHP7.3 + DietPi-Patch | Upgrade all Nextcloud <14 installs incrementally to NC14. This is expected for Jessie systems + DietPi-Software | PHP: On Jessie libssl1.1 needs to be installed for PHP7.3 but the version from sury.org breaks Lighttpd, thus we need to install our own package like we do for some other installs + DietPi-Software | PHP: Save all PHP settings in our own module, not touching any default settings files anymore. Save software specific settings into separate dietpi-.ini modules. + DietPi-Cloud_migration | Start MariaDB service, required to access the database + DietPi-Software | Nextcloud: Add opcache.memory_consumption=128 to PHP config directly instead of per-dir via webserver config. It does not make any difference since once Nextcloud web UI was entered once, the new value overrides the existing global value server-wide. This solves an issue on Lighttpd as well which does not allow multiple setenv.add-environment entries in different config files/conditional statements. --- .conf/dps_114/apache.nextcloud.conf | 3 - .conf/dps_114/lighttpd.nextcloud.conf | 3 - .conf/dps_114/nginx.nextcloud.conf | 2 - .conf/dps_85/nginx.conf | 4 +- .meta/dietpi-cloud-migration | 25 +- CHANGELOG.txt | 3 + dietpi/dietpi-software | 2906 ++++++++++++------------- dietpi/patch_file | 231 +- 8 files changed, 1591 insertions(+), 1586 deletions(-) diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 6d6e8e33fe..2f6d842044 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -15,7 +15,4 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud - # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. - php_admin_value opcache.memory_consumption 128 - diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index 489d1862a5..e3b242844e 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -30,7 +30,4 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { ) } - # Solve OPcache settings warning on Nextcloud admin panel - setenv.add-environment += ( "PHP_ADMIN_VALUE" => "opcache.memory_consumption=128" ) - } diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index 057e9f4742..b9081fac72 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -60,8 +60,6 @@ location ^~ /nextcloud { fastcgi_intercept_errors on; # Disable on Jessie, because Jessie Nginx does not support this directive #fastcgi_request_buffering off; - # Hard coding 128M OPCache size to suppress warning on Nextcloud admin panel. - fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; } location ~ ^\/nextcloud\/(?:updater|ocs-provider|ocm-provider)(?:$|\/) { diff --git a/.conf/dps_85/nginx.conf b/.conf/dps_85/nginx.conf index 863d8e8b48..b6cabc61f7 100644 --- a/.conf/dps_85/nginx.conf +++ b/.conf/dps_85/nginx.conf @@ -30,7 +30,7 @@ http { # Upstream to abstract back-end connection(s) for PHP upstream php { - server unix:/run/php/php7.0-fpm.sock; + server unix:/run/php/php7.3-fpm.sock; } # Set the mime-types via the mime.types external file @@ -42,7 +42,7 @@ http { # Click tracking! access_log off; - # Hide nginx version + # Hide Nginx version server_tokens off; # ~2 seconds is often enough for HTML/CSS, but connections in diff --git a/.meta/dietpi-cloud-migration b/.meta/dietpi-cloud-migration index 992fe4e9fd..cb07eddffd 100644 --- a/.meta/dietpi-cloud-migration +++ b/.meta/dietpi-cloud-migration @@ -1,17 +1,20 @@ #!/bin/bash -(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the script with "sudo".\n' && exit 1 +(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the script with "sudo".' && exit 1 echo -e '[\e[32m OK \e[0m] Root privileges verified.' -! apt-get install -y rsync && echo -e '[\e[31mFAILED\e[0m] "rsync" install failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt-get install -y rsync"\n' && exit 1 +! apt-get install -y rsync && echo -e '[\e[31mFAILED\e[0m] "rsync" install failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt install rsync"' && exit 1 echo -e '[\e[32m OK \e[0m] Successfully installed rsync.' +systemctl start mariadb &> /dev/null || systemctl start mysql &> /dev/null || { echo -e '[\e[31mFAILED\e[0m] Could not start MariaDB server. Aborting...'; exit 1; } +echo -e '[\e[32m OK \e[0m] Successfully started MariaDB.' + run_backup(){ fp_config="/var/www/$1/config/config.php" echo '[ INFO ] Enabling maintenance mode...' - ! sudo -u www-data php /var/www/$1/occ maintenance:mode --on && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.\n' && exit 1 + ! sudo -u www-data php /var/www/$1/occ maintenance:mode --on && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.' && exit 1 echo "[ INFO ] Scanning $fp_config for necessary information..." local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | cut -d \' -f 4) @@ -26,19 +29,19 @@ run_backup(){ - database password: $dbpass" echo '[ INFO ] Backup database to data directory...' - ! mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql && echo -e '[\e[31mFAILED\e[0m] Database backup failed, please check state of your database server, check logs and in case repair table corruptions.\n' && exit 1 + ! mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql && echo -e '[\e[31mFAILED\e[0m] Database backup failed, please check state of your database server, check logs and in case repair table corruptions.' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully finished database backup to: $fp_datadir/dietpi-$1-database-backup.sql" echo '[ INFO ] Backup installation folder to data directory...' - ! rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1 + ! rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully finished installation backup to: $fp_datadir/dietpi-$1-installation-backup/" if [[ $2 ]]; then echo '[ INFO ] You provided an additional backup location. Moving data directory...' - [[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no existing directory, please check spelling and mount status of your desired backup drive.\n" && exit 1 + [[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no existing directory, please check spelling and mount status of your desired backup drive." && exit 1 - ! rsync -aHp --delete "$fp_datadir"/ "$2" && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1 + ! rsync -aHp --delete "$fp_datadir"/ "$2" && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully synced data directory to: $2" else @@ -53,18 +56,20 @@ run_backup(){ ### MAIN ### -if [[ -f /var/www/owncloud/config/config.php ]]; then +if [[ -f '/var/www/owncloud/config/config.php' ]]; then echo '[ INFO ] ownCloud installation found, preparing backup...' run_backup owncloud "$1" fi -if [[ -f /var/www/nextcloud/config/config.php ]]; then +if [[ -f '/var/www/nextcloud/config/config.php' ]]; then echo '[ INFO ] Nextcloud installation found, preparing backup...' run_backup nextcloud "$1" fi -[[ ! $fp_config ]] && echo -e '[\e[31mFAILED\e[0m] No ownCloud or Nextcloud instance found at /var/www/owncloud|nextcloud. Aborting...\n' && exit 1 +[[ ! $fp_config ]] && echo -e '[\e[31mFAILED\e[0m] No ownCloud or Nextcloud instance found at /var/www/owncloud|nextcloud. Aborting...' && exit 1 + +exit 0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8a15eb5437..a1758dd6b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-NordVPN | Added ability to toggle auto start/connect during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 +- DietPi-Software | PHP: All systems will be upgraded to PHP7.3 for security, performance, compatibility and consistency across distro versions. Ondrejs (official Debian PHP maintainer) PHP repository (sury.org) is used for this on Jessie and Stretch, so general functionality and trustworthiness is assured. ownCloud users will stay on PHP7.2 for now since ownCloud does not yet support PHP7.3. Your PHP configurations will be backed up and webserver configurations adjusted to match the new version. Nextcloud 13 and earlier, especially Jessie systems, will be upgraded to Nextcloud 14 to allow PHP7.3. A full Nextcloud backup will be done, your data, settings and custom apps will be preserved. We strongly advice to further upgrade to the current Nextcloud major version via its web UI updater. - DietPi-Software | Subsonic: Runs now as limited user "subsonic". This change is as well applied to existing installs via patch during DietPi-Update: https://github.com/MichaIng/DietPi/pull/2705 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. @@ -35,6 +36,8 @@ Bug Fixes: - DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440 - DietPi-Software | Logitech Media Server: Resolved an issue where certain plugins failed due to missing "libio-socket-ssl-perl". Many thanks to @noobian and @Edward for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5824 - DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 +- DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 +- DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a669367604..d48b4c89e6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -203,25 +203,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it WIFIHOTSPOT_RTL8188C_DEVICE=0 USER_LINUX_AUTOINSTALL_PROMPT_DISPLAYED=0 - # PHP5/7 specific directories, apt package-, module- and command names + # PHP version specific directories, APT package-, module- and command names # - and distro specific MariaDB service name - FP_PHP_BASE_DIR='/etc/php/7.0' - PHP_APT_PACKAGE_NAME='php7.0' - PHP_BINARY='php' + FP_PHP_BASE_DIR='/etc/php/7.3' + PHP_NAME='php7.3' + # MariaDB: On Jessie it is still shipped with /etc/init.d/mysql only MARIADB_SERVICE='mariadb' - if (( $G_DISTRO < 4 )); then - - FP_PHP_BASE_DIR='/etc/php5' - PHP_APT_PACKAGE_NAME='php5' - PHP_BINARY='php5' - MARIADB_SERVICE='mysql' - - elif (( $G_DISTRO > 4 )); then - - FP_PHP_BASE_DIR='/etc/php/7.3' - PHP_APT_PACKAGE_NAME='php7.3' - - fi + (( $G_DISTRO < 4 )) && MARIADB_SERVICE='mysql' USBDRIVE=0 @@ -308,31 +296,32 @@ DietPi-Software will decrypt and use it for software installs. You can change it # to add something like below. Look for other examples in the existing software # installations. Full list of models can be found in 'dietpi-obtain_hw_model'. # - # # - Disable for All non-RPi - # for ((i=10; i<=$MAX_G_HW_MODEL; i++)) - # do - # aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 - # done + # # - Disable for all non-RPi + # for ((i=10; i<=$MAX_G_HW_MODEL; i++)) + # do + # aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 + # done # # Example: - # #------------------ Desktops: LXDE ------------------ - # software_id=23 - # aSOFTWARE_WHIP_NAME[$software_id]='LXDE' - # aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' - # aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - # aSOFTWARE_TYPE[$software_id]=0 - # aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - # aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + # #------------------ Desktops: LXDE ------------------ + # software_id=23 + # + # aSOFTWARE_WHIP_NAME[$software_id]='LXDE' + # aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' + # aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + # aSOFTWARE_TYPE[$software_id]=0 + # aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + # aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + # aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' # #///////////////////////////////////////////////////////////////////////////////////// Software_Arrays_Init(){ - G_DIETPI-NOTIFY -2 'Initializing database' + G_DIETPI-NOTIFY -2 'Initialising database' #-------------------------------------------------------------------------------- # Categories - # NB: Unique IDs, do not re-arrange or re-order. + # NB: Unique IDs, do not re-arrange or re-order! #-------------------------------------------------------------------------------- # DietPi software aSOFTWARE_CATEGORIES_DIETPI=( @@ -379,7 +368,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- # DietPi software items #-------------------------------------------------------------------------------- - # Before adding, please check 'dietpi-software list | grep null' to list NULL (available) IDs for use. + # Before adding, please check 'dietpi-software free' to list free IDs for use. # Assign unique ID to each item local software_id=-1 @@ -388,68 +377,68 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=23 - aSOFTWARE_WHIP_NAME[$software_id]='LXDE' - aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + aSOFTWARE_WHIP_NAME[$software_id]='LXDE' + aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' #------------------ software_id=173 - aSOFTWARE_WHIP_NAME[$software_id]='LXQt' - aSOFTWARE_WHIP_DESC[$software_id]='Lightweight desktop' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712' + aSOFTWARE_WHIP_NAME[$software_id]='LXQt' + aSOFTWARE_WHIP_DESC[$software_id]='Lightweight desktop' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712' #------------------ software_id=24 - aSOFTWARE_WHIP_NAME[$software_id]='MATE' - aSOFTWARE_WHIP_DESC[$software_id]='desktop enviroment' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' + aSOFTWARE_WHIP_NAME[$software_id]='MATE' + aSOFTWARE_WHIP_DESC[$software_id]='desktop enviroment' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' #------------------ software_id=25 - aSOFTWARE_WHIP_NAME[$software_id]='XFCE' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop environment' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' + aSOFTWARE_WHIP_NAME[$software_id]='XFCE' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop environment' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' #------------------ software_id=26 - aSOFTWARE_WHIP_NAME[$software_id]='GNUStep' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight based on OpenStep' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' + aSOFTWARE_WHIP_NAME[$software_id]='GNUStep' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight based on OpenStep' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' #------------------ software_id=113 - aSOFTWARE_WHIP_NAME[$software_id]='Chromium' - aSOFTWARE_WHIP_DESC[$software_id]='web browser for desktop or autostart' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' + aSOFTWARE_WHIP_NAME[$software_id]='Chromium' + aSOFTWARE_WHIP_DESC[$software_id]='web browser for desktop or autostart' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -457,38 +446,38 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=174 - aSOFTWARE_WHIP_NAME[$software_id]='GIMP' - aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713' + aSOFTWARE_WHIP_NAME[$software_id]='GIMP' + aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713' #------------------ software_id=175 - aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power' - aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='' + aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power' + aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='' # Remote Desktops #-------------------------------------------------------------------------------- software_id=27 - aSOFTWARE_WHIP_NAME[$software_id]='TightVNC Server' - aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' + aSOFTWARE_WHIP_NAME[$software_id]='TightVNC Server' + aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 - # - Stretch+: replaced by tigervnc (vnc4) + # - Stretch+: Replaced by TigerVNC (VNC4) for ((i=4; i<=$MAX_G_DISTRO; i++)) do @@ -499,42 +488,42 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=28 - aSOFTWARE_WHIP_NAME[$software_id]='VNC4 Server' - aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' + aSOFTWARE_WHIP_NAME[$software_id]='VNC4 Server' + aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' #------------------ software_id=29 - aSOFTWARE_WHIP_NAME[$software_id]='XRDP' - aSOFTWARE_WHIP_DESC[$software_id]='remote desktop protocol (rdp) server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' + aSOFTWARE_WHIP_NAME[$software_id]='XRDP' + aSOFTWARE_WHIP_DESC[$software_id]='remote desktop protocol (rdp) server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' #------------------ software_id=30 - aSOFTWARE_WHIP_NAME[$software_id]='NoMachine' - aSOFTWARE_WHIP_DESC[$software_id]='multi-platform server and client access' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2071#p2071' + aSOFTWARE_WHIP_NAME[$software_id]='NoMachine' + aSOFTWARE_WHIP_DESC[$software_id]='multi-platform server and client access' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2071#p2071' #------------------ software_id=120 - aSOFTWARE_WHIP_NAME[$software_id]='RealVNC Server' - aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' + aSOFTWARE_WHIP_NAME[$software_id]='RealVNC Server' + aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' # - License RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -548,25 +537,22 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=31 - aSOFTWARE_WHIP_NAME[$software_id]='Kodi' - aSOFTWARE_WHIP_DESC[$software_id]='the media centre for linux' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' + aSOFTWARE_WHIP_NAME[$software_id]='Kodi' + aSOFTWARE_WHIP_DESC[$software_id]='the media centre for linux' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' - # - Only RPi + Odroid - for ((i=20; i<=$MAX_G_HW_MODEL; i++)) + # - Only RPi + Odroid + x86_64 + for ((i=22; i<=$MAX_G_HW_MODEL; i++)) do aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 done - # - Re-enable Native PC - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 - # + ASUS TB aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 @@ -576,45 +562,45 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=32 - aSOFTWARE_WHIP_NAME[$software_id]='YMPD' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight web interface music player for mpd' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' + aSOFTWARE_WHIP_NAME[$software_id]='YMPD' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight web interface music player for mpd' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' #------------------ software_id=148 - aSOFTWARE_WHIP_NAME[$software_id]='myMPD' - aSOFTWARE_WHIP_DESC[$software_id]='fork of ympd with improved features' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978' + aSOFTWARE_WHIP_NAME[$software_id]='myMPD' + aSOFTWARE_WHIP_DESC[$software_id]='fork of ympd with improved features' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978' #------------------ software_id=119 - aSOFTWARE_WHIP_NAME[$software_id]='CAVA' - aSOFTWARE_WHIP_DESC[$software_id]='optional: console audio vis for mpd' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3928#p3928' + aSOFTWARE_WHIP_NAME[$software_id]='CAVA' + aSOFTWARE_WHIP_DESC[$software_id]='optional: console audio vis for mpd' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3928#p3928' #------------------ software_id=33 - aSOFTWARE_WHIP_NAME[$software_id]='Airsonic' - aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280' + aSOFTWARE_WHIP_NAME[$software_id]='Airsonic' + aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280' #------------------ software_id=34 @@ -650,50 +636,50 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=37 - aSOFTWARE_WHIP_NAME[$software_id]='Shairport Sync' - aSOFTWARE_WHIP_DESC[$software_id]='airplay audio player with multiroom sync' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1221#p1221' + aSOFTWARE_WHIP_NAME[$software_id]='Shairport Sync' + aSOFTWARE_WHIP_DESC[$software_id]='airplay audio player with multiroom sync' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1221#p1221' #------------------ software_id=39 - aSOFTWARE_WHIP_NAME[$software_id]='ReadyMedia' - aSOFTWARE_WHIP_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' + aSOFTWARE_WHIP_NAME[$software_id]='ReadyMedia' + aSOFTWARE_WHIP_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' #------------------ software_id=40 - aSOFTWARE_WHIP_NAME[$software_id]='Ampache' - aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Ampache' + aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' #------------------ software_id=41 - aSOFTWARE_WHIP_NAME[$software_id]='Emby Server' - aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' + aSOFTWARE_WHIP_NAME[$software_id]='Emby Server' + aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' - # - Disable for ARMv6: https://github.com/MichaIng/DietPi/issues/534#issuecomment-416405968 + # - ARMv6: https://github.com/MichaIng/DietPi/issues/534#issuecomment-416405968 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - Disable for all ARM on Jessie: https://github.com/MichaIng/DietPi/issues/2521 + # - ARM on Jessie: https://github.com/MichaIng/DietPi/issues/2521 (( $G_DISTRO < 4 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ @@ -705,86 +691,83 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' - # - Disable for ARMv6: https://github.com/MichaIng/DietPi/issues/648 + # - ARMv6: https://github.com/MichaIng/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ software_id=43 - aSOFTWARE_WHIP_NAME[$software_id]='Murmur' - aSOFTWARE_WHIP_DESC[$software_id]='mumble voip server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' + aSOFTWARE_WHIP_NAME[$software_id]='Murmur' + aSOFTWARE_WHIP_DESC[$software_id]='mumble voip server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' #------------------ software_id=118 - aSOFTWARE_WHIP_NAME[$software_id]='Mopidy' - aSOFTWARE_WHIP_DESC[$software_id]='web interface music & radio player' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3611#p3611' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Mopidy' + aSOFTWARE_WHIP_DESC[$software_id]='web interface music & radio player' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3611#p3611' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=121 - aSOFTWARE_WHIP_NAME[$software_id]='Roon Bridge' - aSOFTWARE_WHIP_DESC[$software_id]='Turns device into Roon capable audio player' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Roon Bridge' + aSOFTWARE_WHIP_DESC[$software_id]='Turns device into Roon capable audio player' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - # - Disable for ARMv6 + # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ software_id=124 - aSOFTWARE_WHIP_NAME[$software_id]='NAA daemon' - aSOFTWARE_WHIP_DESC[$software_id]='signalyst network audio adaptor (naa)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='NAA daemon' + aSOFTWARE_WHIP_DESC[$software_id]='signalyst network audio adaptor (naa)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=128 - aSOFTWARE_WHIP_NAME[$software_id]='MPD' - aSOFTWARE_WHIP_DESC[$software_id]='music player daemon' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='' + aSOFTWARE_WHIP_NAME[$software_id]='MPD' + aSOFTWARE_WHIP_DESC[$software_id]='music player daemon' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='' #------------------ software_id=129 - aSOFTWARE_WHIP_NAME[$software_id]='O!MPD' - aSOFTWARE_WHIP_DESC[$software_id]='feature-rich, web interface audio player for mpd' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='O!MPD' + aSOFTWARE_WHIP_DESC[$software_id]='feature-rich, web interface audio player for mpd' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - - # - VM - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ software_id=135 - aSOFTWARE_WHIP_NAME[$software_id]='IceCast' - aSOFTWARE_WHIP_DESC[$software_id]='Shoutcast streaming server (+DarkIce)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' + aSOFTWARE_WHIP_NAME[$software_id]='IceCast' + aSOFTWARE_WHIP_DESC[$software_id]='Shoutcast streaming server (+DarkIce)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -792,12 +775,12 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=141 - aSOFTWARE_WHIP_NAME[$software_id]='Spotify Connect Web' - aSOFTWARE_WHIP_DESC[$software_id]='web interface for spotify premium' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7013#p7013' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Spotify Connect Web' + aSOFTWARE_WHIP_DESC[$software_id]='web interface for spotify premium' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7013#p7013' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - Currently ARMv7+ only, so disable all archs, then re-enable armv7+ for ((i=1; i<=$MAX_G_HW_ARCH; i++)) @@ -811,39 +794,39 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=143 - aSOFTWARE_WHIP_NAME[$software_id]='Koel' - aSOFTWARE_WHIP_DESC[$software_id]='web interface audio streamer' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' + aSOFTWARE_WHIP_NAME[$software_id]='Koel' + aSOFTWARE_WHIP_DESC[$software_id]='web interface audio streamer' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 # Currently user prompt asks for admin user credentials: aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 #------------------ software_id=146 - aSOFTWARE_WHIP_NAME[$software_id]='Tautulli' - aSOFTWARE_WHIP_DESC[$software_id]='monitoring and tracking tool for Plex' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7463#p7463' - aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Tautulli' + aSOFTWARE_WHIP_DESC[$software_id]='monitoring and tracking tool for Plex' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7463#p7463' + aSOFTWARE_REQUIRES_GIT[$software_id]=1 #------------------ software_id=154 - aSOFTWARE_WHIP_NAME[$software_id]='Roon Server' - aSOFTWARE_WHIP_DESC[$software_id]='Roon capable audio player and core' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Roon Server' + aSOFTWARE_WHIP_DESC[$software_id]='Roon capable audio player and core' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 # - x86_64 only for ((i=1; i<=$MAX_G_HW_ARCH; i++)) @@ -857,282 +840,284 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=159 - aSOFTWARE_WHIP_NAME[$software_id]='Allo' - aSOFTWARE_WHIP_DESC[$software_id]='web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='' - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Allo' + aSOFTWARE_WHIP_DESC[$software_id]='web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ software_id=160 - aSOFTWARE_WHIP_NAME[$software_id]='Allo_update' - aSOFTWARE_WHIP_DESC[$software_id]='quick reinstall/update web only' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='' + aSOFTWARE_WHIP_NAME[$software_id]='Allo_update' + aSOFTWARE_WHIP_DESC[$software_id]='quick reinstall/update web only' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='' #------------------ software_id=163 - aSOFTWARE_WHIP_NAME[$software_id]='GMediaRender' - aSOFTWARE_WHIP_DESC[$software_id]='DLNA audio render/endpoint' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' + aSOFTWARE_WHIP_NAME[$software_id]='GMediaRender' + aSOFTWARE_WHIP_DESC[$software_id]='DLNA audio render/endpoint' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' #------------------ software_id=167 - aSOFTWARE_WHIP_NAME[$software_id]='Raspotify' - aSOFTWARE_WHIP_DESC[$software_id]='spotify connect client' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' + aSOFTWARE_WHIP_NAME[$software_id]='Raspotify' + aSOFTWARE_WHIP_DESC[$software_id]='spotify connect client' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' - # Disable for ARMv8 + x86_64: + # - ARMv8 - x86_64 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 #------------------ software_id=80 - aSOFTWARE_WHIP_NAME[$software_id]='Ubooquity' - aSOFTWARE_WHIP_DESC[$software_id]='a free home server for your comics and ebooks library' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' + aSOFTWARE_WHIP_NAME[$software_id]='Ubooquity' + aSOFTWARE_WHIP_DESC[$software_id]='a free home server for your comics and ebooks library' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' #------------------ software_id=86 - aSOFTWARE_WHIP_NAME[$software_id]='Roon Extension Manager' - aSOFTWARE_WHIP_DESC[$software_id]='Manage extensions from within Roon' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' + aSOFTWARE_WHIP_NAME[$software_id]='Roon Extension Manager' + aSOFTWARE_WHIP_DESC[$software_id]='Manage extensions from within Roon' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' #BitTorrent #-------------------------------------------------------------------------------- software_id=44 - aSOFTWARE_WHIP_NAME[$software_id]='Transmission' - aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=46#p46' + aSOFTWARE_WHIP_NAME[$software_id]='Transmission' + aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=46#p46' #------------------ software_id=45 - aSOFTWARE_WHIP_NAME[$software_id]='Deluge' - aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (python)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61' + aSOFTWARE_WHIP_NAME[$software_id]='Deluge' + aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (python)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61' #------------------ software_id=46 - aSOFTWARE_WHIP_NAME[$software_id]='qBitTorrent' - aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c++)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2272#p2272' + aSOFTWARE_WHIP_NAME[$software_id]='qBitTorrent' + aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c++)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2272#p2272' #------------------ software_id=107 - aSOFTWARE_WHIP_NAME[$software_id]='rTorrent' - aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with rutorrent web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='rTorrent' + aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with rutorrent web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' #------------------ software_id=116 - aSOFTWARE_WHIP_NAME[$software_id]='Medusa' - aSOFTWARE_WHIP_DESC[$software_id]='Automatic Video Library Manager for TV Shows' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327' + aSOFTWARE_WHIP_NAME[$software_id]='Medusa' + aSOFTWARE_WHIP_DESC[$software_id]='Automatic Video Library Manager for TV Shows' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327' #------------------ software_id=132 - aSOFTWARE_WHIP_NAME[$software_id]='Aria2' - aSOFTWARE_WHIP_DESC[$software_id]='download manager with web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6177#p6177' + aSOFTWARE_WHIP_NAME[$software_id]='Aria2' + aSOFTWARE_WHIP_DESC[$software_id]='download manager with web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6177#p6177' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=139 - aSOFTWARE_WHIP_NAME[$software_id]='SABnzbd' - aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='SABnzbd' + aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=142 - aSOFTWARE_WHIP_NAME[$software_id]='CouchPotato' - aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='CouchPotato' + aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 #------------------ software_id=144 - aSOFTWARE_WHIP_NAME[$software_id]='Sonarr' - aSOFTWARE_WHIP_DESC[$software_id]='automatically download TV shows' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7455#p7455' - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Sonarr' + aSOFTWARE_WHIP_DESC[$software_id]='automatically download TV shows' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7455#p7455' + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=145 - aSOFTWARE_WHIP_NAME[$software_id]='Radarr' - aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7457#p7457' - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Radarr' + aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7457#p7457' + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=106 - aSOFTWARE_WHIP_NAME[$software_id]='Lidarr' - aSOFTWARE_WHIP_DESC[$software_id]='automatically download music' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Lidarr' + aSOFTWARE_WHIP_DESC[$software_id]='automatically download music' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=147 - aSOFTWARE_WHIP_NAME[$software_id]='Jackett' - aSOFTWARE_WHIP_DESC[$software_id]='API support for your torrent trackers' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7503#p7503' + aSOFTWARE_WHIP_NAME[$software_id]='Jackett' + aSOFTWARE_WHIP_DESC[$software_id]='API support for your torrent trackers' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7503#p7503' #------------------ software_id=149 - aSOFTWARE_WHIP_NAME[$software_id]='NZBget' - aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7575#p7575' + aSOFTWARE_WHIP_NAME[$software_id]='NZBget' + aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7575#p7575' #------------------ BitTorrent: HTPC Manager ------------------ software_id=155 - aSOFTWARE_WHIP_NAME[$software_id]='HTPC Manager' - aSOFTWARE_WHIP_DESC[$software_id]='manage your HTPC from anywhere' - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8043#p8043' + aSOFTWARE_WHIP_NAME[$software_id]='HTPC Manager' + aSOFTWARE_WHIP_DESC[$software_id]='manage your HTPC from anywhere' + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8043#p8043' #Cloud / Backups #-------------------------------------------------------------------------------- software_id=47 - aSOFTWARE_WHIP_NAME[$software_id]='ownCloud' - aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='ownCloud' + aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=47#p47' - # Current ownCloud 10.0.10 does not support PHP7.3 (Buster): https://doc.owncloud.org/server/administration_manual/installation/system_requirements.html - aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=47#p47' + # ownCloud up to 10.2 does not support PHP7.3 (Buster): https://doc.owncloud.org/server/administration_manual/installation/system_requirements.html + aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 + # Disable if PHP7.3 is already installed + command -v php7.3 &> /dev/null && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=114 - aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud' - aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud' + aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3026#p3026' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3026#p3026' #------------------ software_id=168 - aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud Talk' - aSOFTWARE_WHIP_DESC[$software_id]='Video calls with configured TURN server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - #Currently requires manual domain and TURN server port input. + aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud Talk' + aSOFTWARE_WHIP_DESC[$software_id]='Video calls with configured coTURN server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + # 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 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=15227#p15227' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=15227#p15227' #------------------ software_id=48 - aSOFTWARE_WHIP_NAME[$software_id]='Pydio' - aSOFTWARE_WHIP_DESC[$software_id]='feature-rich backup and sync server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='Pydio' + aSOFTWARE_WHIP_DESC[$software_id]='feature-rich backup and sync server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' #------------------ software_id=111 - aSOFTWARE_WHIP_NAME[$software_id]='UrBackup server' - aSOFTWARE_WHIP_DESC[$software_id]='full system backup server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' + aSOFTWARE_WHIP_NAME[$software_id]='UrBackup server' + aSOFTWARE_WHIP_DESC[$software_id]='full system backup server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' - # No deb packages for ARMv6: + # - ARMv6: aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ software_id=49 - aSOFTWARE_WHIP_NAME[$software_id]='Gogs' - aSOFTWARE_WHIP_DESC[$software_id]='personal github server with web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' + aSOFTWARE_WHIP_NAME[$software_id]='Gogs' + aSOFTWARE_WHIP_DESC[$software_id]='personal github server with web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1140,20 +1125,20 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=50 - aSOFTWARE_WHIP_NAME[$software_id]='Syncthing' - aSOFTWARE_WHIP_DESC[$software_id]='backup and sync server with web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' + aSOFTWARE_WHIP_NAME[$software_id]='Syncthing' + aSOFTWARE_WHIP_DESC[$software_id]='backup and sync server with web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' #------------------ software_id=134 - aSOFTWARE_WHIP_NAME[$software_id]='Tonido' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight cloud based backup system' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6476#p6476' + aSOFTWARE_WHIP_NAME[$software_id]='Tonido' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight cloud based backup system' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6476#p6476' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -1163,17 +1148,19 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=158 - aSOFTWARE_WHIP_NAME[$software_id]='Minio' - aSOFTWARE_WHIP_DESC[$software_id]='S3 compatible distributed object server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 + + aSOFTWARE_WHIP_NAME[$software_id]='Minio' + aSOFTWARE_WHIP_DESC[$software_id]='S3 compatible distributed object server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 #------------------ software_id=161 - aSOFTWARE_WHIP_NAME[$software_id]='FuguHub' - aSOFTWARE_WHIP_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 + + aSOFTWARE_WHIP_NAME[$software_id]='FuguHub' + aSOFTWARE_WHIP_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1181,14 +1168,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=165 - aSOFTWARE_WHIP_NAME[$software_id]='Gitea' - aSOFTWARE_WHIP_DESC[$software_id]='Git with a cup of tea' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9863#p9863' - + aSOFTWARE_WHIP_NAME[$software_id]='Gitea' + aSOFTWARE_WHIP_DESC[$software_id]='Git with a cup of tea' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9863#p9863' #Emulation / Gaming #-------------------------------------------------------------------------------- @@ -1202,7 +1188,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1217,15 +1203,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=51 - aSOFTWARE_WHIP_NAME[$software_id]='OpenTyrian' - aSOFTWARE_WHIP_DESC[$software_id]='a classic retro game, addictive' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' + aSOFTWARE_WHIP_NAME[$software_id]='OpenTyrian' + aSOFTWARE_WHIP_DESC[$software_id]='a classic retro game, addictive' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1240,14 +1226,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=112 - aSOFTWARE_WHIP_NAME[$software_id]='DXX-Rebirth' - aSOFTWARE_WHIP_DESC[$software_id]='Descent 1/2' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2963#p2963' + aSOFTWARE_WHIP_NAME[$software_id]='DXX-Rebirth' + aSOFTWARE_WHIP_DESC[$software_id]='Descent 1/2' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2963#p2963' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1258,11 +1244,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=52 - aSOFTWARE_WHIP_NAME[$software_id]='Cuberite' - aSOFTWARE_WHIP_DESC[$software_id]='minecraft server with web interface (c++)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' + aSOFTWARE_WHIP_NAME[$software_id]='Cuberite' + aSOFTWARE_WHIP_DESC[$software_id]='minecraft server with web interface (c++)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1270,29 +1256,29 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=53 - aSOFTWARE_WHIP_NAME[$software_id]='MineOS' - aSOFTWARE_WHIP_DESC[$software_id]='minecraft servers with web interface (java)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' + aSOFTWARE_WHIP_NAME[$software_id]='MineOS' + aSOFTWARE_WHIP_DESC[$software_id]='minecraft servers with web interface (java)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' #------------------ software_id=156 - aSOFTWARE_WHIP_NAME[$software_id]='Steam' - aSOFTWARE_WHIP_DESC[$software_id]='client' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - 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 + aSOFTWARE_WHIP_NAME[$software_id]='Steam' + aSOFTWARE_WHIP_DESC[$software_id]='client' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + 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 + # Native PC only for ((i=0; i<=$MAX_G_HW_MODEL; i++)) do @@ -1303,94 +1289,95 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=164 - aSOFTWARE_WHIP_NAME[$software_id]='Nukkit' - aSOFTWARE_WHIP_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10675#p10675' + + aSOFTWARE_WHIP_NAME[$software_id]='Nukkit' + aSOFTWARE_WHIP_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10675#p10675' #Social Media #-------------------------------------------------------------------------------- software_id=54 - aSOFTWARE_WHIP_NAME[$software_id]='Forums' - aSOFTWARE_WHIP_DESC[$software_id]='phpbb forums' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='phpBB' + aSOFTWARE_WHIP_DESC[$software_id]='bulletin board forum software' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' #------------------ software_id=55 - aSOFTWARE_WHIP_NAME[$software_id]='Wordpress' - aSOFTWARE_WHIP_DESC[$software_id]='website blog and publishing platform' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='Wordpress' + aSOFTWARE_WHIP_DESC[$software_id]='website blog and publishing platform' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' #------------------ software_id=38 - aSOFTWARE_WHIP_NAME[$software_id]='FreshRSS' - aSOFTWARE_WHIP_DESC[$software_id]='self-hosted RSS feed aggregator' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='FreshRSS' + aSOFTWARE_WHIP_DESC[$software_id]='self-hosted RSS feed aggregator' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' #------------------ software_id=56 - aSOFTWARE_WHIP_NAME[$software_id]='Image Gallery' - aSOFTWARE_WHIP_DESC[$software_id]='website to host / browse your images' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='Image Gallery' + aSOFTWARE_WHIP_DESC[$software_id]='website to host / browse your images' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' #------------------ software_id=57 - aSOFTWARE_WHIP_NAME[$software_id]='BaiKal' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight caldav + carddav server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='BaiKal' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight caldav + carddav server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' #------------------ software_id=58 - aSOFTWARE_WHIP_NAME[$software_id]='OpenBazaar' - aSOFTWARE_WHIP_DESC[$software_id]='decentralized peer to peer bitcoin market' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1796#p1796' + aSOFTWARE_WHIP_NAME[$software_id]='OpenBazaar' + aSOFTWARE_WHIP_DESC[$software_id]='decentralized peer to peer bitcoin market' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1796#p1796' #------------------ software_id=133 - aSOFTWARE_WHIP_NAME[$software_id]='YaCy' - aSOFTWARE_WHIP_DESC[$software_id]='decentralized open source search engine' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6202#p6202' + aSOFTWARE_WHIP_NAME[$software_id]='YaCy' + aSOFTWARE_WHIP_DESC[$software_id]='decentralized open source search engine' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6202#p6202' #------------------ software_id=2 @@ -1400,6 +1387,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=20 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13704#p13704' + # - x86_64 only for ((i=1; i<$MAX_G_HW_ARCH; i++)) do @@ -1407,7 +1395,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,$i]=0 done - # - Not supported on Jessie: https://github.com/MichaIng/DietPi/pull/1992#issuecomment-410772255 + + # - Jessie: https://github.com/MichaIng/DietPi/pull/1992#issuecomment-410772255 aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0 #------------------ @@ -1416,15 +1405,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=59 - aSOFTWARE_WHIP_NAME[$software_id]='RPi Cam Control' - aSOFTWARE_WHIP_DESC[$software_id]='web interface & controls for your rpi camera' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='RPi Cam Control' + aSOFTWARE_WHIP_DESC[$software_id]='web interface & controls for your rpi camera' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1435,20 +1424,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=136 - aSOFTWARE_WHIP_NAME[$software_id]='MotionEye' - aSOFTWARE_WHIP_DESC[$software_id]='web interface & surveillance for your camera' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6610#p6610' - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - - # - Disable for Jessie - if (( $G_DISTRO == 3 )); then - - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0 + aSOFTWARE_WHIP_NAME[$software_id]='MotionEye' + aSOFTWARE_WHIP_DESC[$software_id]='web interface & surveillance for your camera' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6610#p6610' + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - fi + # - Jessie + aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0 #------------------ @@ -1483,55 +1468,55 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=62 - aSOFTWARE_WHIP_NAME[$software_id]='DietPi-Cloudshell' - aSOFTWARE_WHIP_DESC[$software_id]='system stats displayed on lcd/panel' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=204#p204' + aSOFTWARE_WHIP_NAME[$software_id]='DietPi-Cloudshell' + aSOFTWARE_WHIP_DESC[$software_id]='system stats displayed on lcd/panel' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=204#p204' #------------------ software_id=63 - aSOFTWARE_WHIP_NAME[$software_id]='LinuxDash' - aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='LinuxDash' + aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' #------------------ software_id=64 - aSOFTWARE_WHIP_NAME[$software_id]='PhpSysInfo' - aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='PhpSysInfo' + aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=451#p451' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=451#p451' #------------------ software_id=65 - aSOFTWARE_WHIP_NAME[$software_id]='NetData' - aSOFTWARE_WHIP_DESC[$software_id]='real-time performance monitoring' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='NetData' + aSOFTWARE_WHIP_DESC[$software_id]='real-time performance monitoring' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 # Node.js only required for our custom package (( $G_DISTRO < 4 || ( $G_HW_MODEL < 10 && $G_DISTRO < 5 ) )) && aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1611#p1611' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1611#p1611' #------------------ software_id=66 - aSOFTWARE_WHIP_NAME[$software_id]='RPi-Monitor' - aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1503#p1503' + aSOFTWARE_WHIP_NAME[$software_id]='RPi-Monitor' + aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1503#p1503' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1542,49 +1527,48 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=115 - aSOFTWARE_WHIP_NAME[$software_id]='Webmin' - aSOFTWARE_WHIP_DESC[$software_id]='web interface system management' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' - aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Webmin' + aSOFTWARE_WHIP_DESC[$software_id]='web interface system management' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' + aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 #------------------ software_id=162 - aSOFTWARE_WHIP_NAME[$software_id]='Docker' - aSOFTWARE_WHIP_DESC[$software_id]='Build, ship, and run distributed applications' - aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_TYPE[$software_id]=0 - + aSOFTWARE_WHIP_NAME[$software_id]='Docker' + aSOFTWARE_WHIP_DESC[$software_id]='Build, ship, and run distributed applications' + aSOFTWARE_CATEGORY_INDEX[$software_id]=9 + aSOFTWARE_TYPE[$software_id]=0 #Remote Access #-------------------------------------------------------------------------------- software_id=67 - aSOFTWARE_WHIP_NAME[$software_id]='NoIp' - aSOFTWARE_WHIP_DESC[$software_id]='url website address for your device' - aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' + aSOFTWARE_WHIP_NAME[$software_id]='NoIp' + aSOFTWARE_WHIP_DESC[$software_id]='url website address for your device' + aSOFTWARE_CATEGORY_INDEX[$software_id]=10 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' #------------------ software_id=68 - aSOFTWARE_WHIP_NAME[$software_id]='Remot3.it' - aSOFTWARE_WHIP_DESC[$software_id]='(Weaved) access your device over the internet' - aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' + aSOFTWARE_WHIP_NAME[$software_id]='Remot3.it' + aSOFTWARE_WHIP_DESC[$software_id]='(Weaved) access your device over the internet' + aSOFTWARE_CATEGORY_INDEX[$software_id]=10 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' #------------------ software_id=138 - aSOFTWARE_WHIP_NAME[$software_id]='VirtualHere' - aSOFTWARE_WHIP_DESC[$software_id]='server: share USB devices over the network' - aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6709#p6709' + aSOFTWARE_WHIP_NAME[$software_id]='VirtualHere' + aSOFTWARE_WHIP_DESC[$software_id]='server: share USB devices over the network' + aSOFTWARE_CATEGORY_INDEX[$software_id]=10 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6709#p6709' #------------------ @@ -1592,13 +1576,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=69 - aSOFTWARE_WHIP_NAME[$software_id]='RPi.GPIO' - aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library for rpi (python)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' + aSOFTWARE_WHIP_NAME[$software_id]='RPi.GPIO' + aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library for rpi (python)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1609,14 +1593,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=70 - aSOFTWARE_WHIP_NAME[$software_id]='WiringPi' - aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library (c)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1066#p1066' + aSOFTWARE_WHIP_NAME[$software_id]='WiringPi' + aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library (c)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1066#p1066' - # - RPi / Odroids + # - RPi + Odroids only for ((i=20; i<=$MAX_G_HW_MODEL; i++)) do @@ -1624,20 +1608,20 @@ DietPi-Software will decrypt and use it for software installs. You can change it done - #+ BPi Pro + # + BPi Pro aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,51]=1 #------------------ software_id=71 - aSOFTWARE_WHIP_NAME[$software_id]='WebIOPi' - aSOFTWARE_WHIP_DESC[$software_id]='web interface to control rpi.gpio' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' + aSOFTWARE_WHIP_NAME[$software_id]='WebIOPi' + aSOFTWARE_WHIP_DESC[$software_id]='web interface to control rpi.gpio' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' - # - Disable for All non-RPi and RPi3 + # - RPi1/2/Zero only for ((i=3; i<=$MAX_G_HW_MODEL; i++)) do @@ -1648,12 +1632,12 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=72 - aSOFTWARE_WHIP_NAME[$software_id]='I2c' - aSOFTWARE_WHIP_DESC[$software_id]='enables support for i2c based hardware' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='I2C' + aSOFTWARE_WHIP_DESC[$software_id]='enables support for i2c based hardware' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1664,13 +1648,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=100 - aSOFTWARE_WHIP_NAME[$software_id]='PiJuice' - aSOFTWARE_WHIP_DESC[$software_id]='pisupply ups' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10740#p10740' + aSOFTWARE_WHIP_NAME[$software_id]='PiJuice' + aSOFTWARE_WHIP_DESC[$software_id]='pisupply ups' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10740#p10740' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1681,45 +1665,45 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=122 - aSOFTWARE_WHIP_NAME[$software_id]='Node-Red' - aSOFTWARE_WHIP_DESC[$software_id]='tool for wiring devices, APIs and online services' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' + aSOFTWARE_WHIP_NAME[$software_id]='Node-Red' + aSOFTWARE_WHIP_DESC[$software_id]='tool for wiring devices, APIs and online services' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' #------------------ software_id=123 - aSOFTWARE_WHIP_NAME[$software_id]='Mosquitto ' - aSOFTWARE_WHIP_DESC[$software_id]='MQTT messaging broker' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' + aSOFTWARE_WHIP_NAME[$software_id]='Mosquitto ' + aSOFTWARE_WHIP_DESC[$software_id]='MQTT messaging broker' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' #------------------ software_id=131 - aSOFTWARE_WHIP_NAME[$software_id]='Blynk Server' - aSOFTWARE_WHIP_DESC[$software_id]='msg controller for blynk mobile app and sbcs' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5901#p5901' - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Blynk Server' + aSOFTWARE_WHIP_DESC[$software_id]='msg controller for blynk mobile app and sbcs' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5901#p5901' + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=166 - aSOFTWARE_WHIP_NAME[$software_id]='PI-SPC' - aSOFTWARE_WHIP_DESC[$software_id]='audiophonics pi-spc power control module' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9359#p9359' + aSOFTWARE_WHIP_NAME[$software_id]='PI-SPC' + aSOFTWARE_WHIP_DESC[$software_id]='audiophonics pi-spc power control module' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9359#p9359' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1730,15 +1714,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=169 - aSOFTWARE_WHIP_NAME[$software_id]='Google AIY' - aSOFTWARE_WHIP_DESC[$software_id]='voice kit' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9486#p9486' + aSOFTWARE_WHIP_NAME[$software_id]='Google AIY' + aSOFTWARE_WHIP_DESC[$software_id]='voice kit' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9486#p9486' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1749,21 +1733,20 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=74 - aSOFTWARE_WHIP_NAME[$software_id]='InfluxDB' - aSOFTWARE_WHIP_DESC[$software_id]='time-series database' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' + aSOFTWARE_WHIP_NAME[$software_id]='InfluxDB' + aSOFTWARE_WHIP_DESC[$software_id]='time-series database' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' #------------------ software_id=77 - aSOFTWARE_WHIP_NAME[$software_id]='Grafana' - aSOFTWARE_WHIP_DESC[$software_id]='platform for analytics and monitoring' - aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12524#p12524' - + aSOFTWARE_WHIP_NAME[$software_id]='Grafana' + aSOFTWARE_WHIP_DESC[$software_id]='platform for analytics and monitoring' + aSOFTWARE_CATEGORY_INDEX[$software_id]=11 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12524#p12524' #System security #-------------------------------------------------------------------------------- @@ -1780,204 +1763,204 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=75 - aSOFTWARE_WHIP_NAME[$software_id]='LASP' - aSOFTWARE_WHIP_DESC[$software_id]='apache2 | sqlite | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_WHIP_NAME[$software_id]='LASP' + aSOFTWARE_WHIP_DESC[$software_id]='apache2 | sqlite | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=76 - aSOFTWARE_WHIP_NAME[$software_id]='LAMP' - aSOFTWARE_WHIP_DESC[$software_id]='apache2 | mariadb | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_WHIP_NAME[$software_id]='LAMP' + aSOFTWARE_WHIP_DESC[$software_id]='apache2 | mariadb | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=78 - aSOFTWARE_WHIP_NAME[$software_id]='LESP' - aSOFTWARE_WHIP_DESC[$software_id]='nginx | sqlite | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_WHIP_NAME[$software_id]='LESP' + aSOFTWARE_WHIP_DESC[$software_id]='nginx | sqlite | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=79 - aSOFTWARE_WHIP_NAME[$software_id]='LEMP' - aSOFTWARE_WHIP_DESC[$software_id]='nginx | mariadb | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_WHIP_NAME[$software_id]='LEMP' + aSOFTWARE_WHIP_DESC[$software_id]='nginx | mariadb | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=81 - aSOFTWARE_WHIP_NAME[$software_id]='LLSP' - aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | sqlite | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='LLSP' + aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | sqlite | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=82 - aSOFTWARE_WHIP_NAME[$software_id]='LLMP' - aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | mariadb | php' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='LLMP' + aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | mariadb | php' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=83 - aSOFTWARE_WHIP_NAME[$software_id]='Apache2' - aSOFTWARE_WHIP_DESC[$software_id]='webserver' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_WHIP_NAME[$software_id]='Apache2' + aSOFTWARE_WHIP_DESC[$software_id]='webserver' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=84 - aSOFTWARE_WHIP_NAME[$software_id]='Lighttpd' - aSOFTWARE_WHIP_DESC[$software_id]='webserver' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='Lighttpd' + aSOFTWARE_WHIP_DESC[$software_id]='webserver' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=85 - aSOFTWARE_WHIP_NAME[$software_id]='Nginx' - aSOFTWARE_WHIP_DESC[$software_id]='webserver' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_WHIP_NAME[$software_id]='Nginx' + aSOFTWARE_WHIP_DESC[$software_id]='webserver' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=87 - aSOFTWARE_WHIP_NAME[$software_id]='SQlite' - aSOFTWARE_WHIP_DESC[$software_id]='database' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='SQLite' + aSOFTWARE_WHIP_DESC[$software_id]='database' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=88 - aSOFTWARE_WHIP_NAME[$software_id]='MariaDB' - aSOFTWARE_WHIP_DESC[$software_id]='database' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='MariaDB' + aSOFTWARE_WHIP_DESC[$software_id]='database' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=89 - aSOFTWARE_WHIP_NAME[$software_id]='PHP' - aSOFTWARE_WHIP_DESC[$software_id]='webserver' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_WHIP_NAME[$software_id]='PHP' + aSOFTWARE_WHIP_DESC[$software_id]='Hypertext Preprocessor for dynamic web content' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=90 - aSOFTWARE_WHIP_NAME[$software_id]='phpMyAdmin' - aSOFTWARE_WHIP_DESC[$software_id]='optional mysql admin tools' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='phpMyAdmin' + aSOFTWARE_WHIP_DESC[$software_id]='optional mysql admin tools' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' + aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' #------------------ software_id=91 - aSOFTWARE_WHIP_NAME[$software_id]='Redis' - aSOFTWARE_WHIP_DESC[$software_id]='optional non-sql database store' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_WHIP_NAME[$software_id]='Redis' + aSOFTWARE_WHIP_DESC[$software_id]='optional non-sql database store' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 #------------------ software_id=92 - aSOFTWARE_WHIP_NAME[$software_id]='CertBot' - aSOFTWARE_WHIP_DESC[$software_id]='free, ssl cert install allowing https://' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1061#p1062' + aSOFTWARE_WHIP_NAME[$software_id]='CertBot' + aSOFTWARE_WHIP_DESC[$software_id]='free, ssl cert install allowing https://' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1061#p1062' #------------------ software_id=125 - aSOFTWARE_WHIP_NAME[$software_id]='Tomcat8' - aSOFTWARE_WHIP_DESC[$software_id]='apache tomcat server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' - aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Tomcat8' + aSOFTWARE_WHIP_DESC[$software_id]='apache tomcat server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=13 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' + aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #PiHole #-------------------------------------------------------------------------------- software_id=93 - aSOFTWARE_WHIP_NAME[$software_id]='Pi-hole' - aSOFTWARE_WHIP_DESC[$software_id]='block adverts for any device on your network' - aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Pi-hole' + aSOFTWARE_WHIP_DESC[$software_id]='block adverts for any device on your network' + aSOFTWARE_CATEGORY_INDEX[$software_id]=14 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 - aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' + aSOFTWARE_REQUIRES_PHP[$software_id]=1 + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 #File servers #-------------------------------------------------------------------------------- software_id=94 - aSOFTWARE_WHIP_NAME[$software_id]='ProFTP' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight ftp server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' + aSOFTWARE_WHIP_NAME[$software_id]='ProFTP' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight ftp server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=15 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' #------------------ software_id=95 - aSOFTWARE_WHIP_NAME[$software_id]='vsFTPD' - aSOFTWARE_WHIP_DESC[$software_id]='alternative ftp server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2820#p2820' + aSOFTWARE_WHIP_NAME[$software_id]='vsFTPD' + aSOFTWARE_WHIP_DESC[$software_id]='alternative ftp server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=15 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2820#p2820' #------------------ software_id=96 - aSOFTWARE_WHIP_NAME[$software_id]='Samba' - aSOFTWARE_WHIP_DESC[$software_id]='feature-rich file server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' + aSOFTWARE_WHIP_NAME[$software_id]='Samba' + aSOFTWARE_WHIP_DESC[$software_id]='feature-rich file server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=15 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' #------------------ software_id=109 - aSOFTWARE_WHIP_NAME[$software_id]='NFS' - aSOFTWARE_WHIP_DESC[$software_id]='network file system server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' + aSOFTWARE_WHIP_NAME[$software_id]='NFS' + aSOFTWARE_WHIP_DESC[$software_id]='network file system server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=15 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' #------------------ @@ -1985,23 +1968,23 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=97 - aSOFTWARE_WHIP_NAME[$software_id]='OpenVPN' - aSOFTWARE_WHIP_DESC[$software_id]='vpn server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=613#p613' + aSOFTWARE_WHIP_NAME[$software_id]='OpenVPN' + aSOFTWARE_WHIP_DESC[$software_id]='vpn server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=16 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=613#p613' #------------------ software_id=117 - aSOFTWARE_WHIP_NAME[$software_id]='PiVPN' - aSOFTWARE_WHIP_DESC[$software_id]='openvpn server install & management tool' - aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3469#p3469' + aSOFTWARE_WHIP_NAME[$software_id]='PiVPN' + aSOFTWARE_WHIP_DESC[$software_id]='openvpn server install & management tool' + aSOFTWARE_CATEGORY_INDEX[$software_id]=16 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3469#p3469' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 #------------------ @@ -2031,8 +2014,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 done - # Disable for ARMv6 + + # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + # Enable RPi/Odroids/x86_64 | ARMv6 disabled if (( $G_HW_MODEL < 13 || $G_HW_MODEL == 14 || $G_HW_ARCH == 10 )); then @@ -2040,7 +2025,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi - #Advanced Networking #-------------------------------------------------------------------------------- software_id=98 @@ -2056,13 +2040,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=99 - aSOFTWARE_WHIP_NAME[$software_id]='EmonPi' - aSOFTWARE_WHIP_DESC[$software_id]='energy usage addon board with web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=18 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' + aSOFTWARE_WHIP_NAME[$software_id]='EmonPi' + aSOFTWARE_WHIP_DESC[$software_id]='energy usage addon board with web interface' + aSOFTWARE_CATEGORY_INDEX[$software_id]=18 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' - # - Disable for All non-RPi + # - RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -2073,15 +2057,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=157 - aSOFTWARE_WHIP_NAME[$software_id]='Home Assistant' - aSOFTWARE_WHIP_DESC[$software_id]='open-source home automation platform' - aSOFTWARE_CATEGORY_INDEX[$software_id]=18 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 - aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' + aSOFTWARE_WHIP_NAME[$software_id]='Home Assistant' + aSOFTWARE_WHIP_DESC[$software_id]='open-source home automation platform' + aSOFTWARE_CATEGORY_INDEX[$software_id]=18 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 + aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' #------------------ @@ -2089,26 +2073,26 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=137 - aSOFTWARE_WHIP_NAME[$software_id]='CloudPrint' - aSOFTWARE_WHIP_DESC[$software_id]='print server for google cloud print' - aSOFTWARE_CATEGORY_INDEX[$software_id]=19 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=6630#p6630' - aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 #Not required, but comes in as package dep + aSOFTWARE_WHIP_NAME[$software_id]='CloudPrint' + aSOFTWARE_WHIP_DESC[$software_id]='print server for google cloud print' + aSOFTWARE_CATEGORY_INDEX[$software_id]=19 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6630#p6630' + aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 # Not required, but comes in as package dep - #Disabled for ARMv8 on Jessie only: https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002 + # - ARMv8 on Jessie: https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002 (( $G_DISTRO == 3 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=153 - aSOFTWARE_WHIP_NAME[$software_id]='OctoPrint' - aSOFTWARE_WHIP_DESC[$software_id]='web interface for controlling 3d printers' - aSOFTWARE_CATEGORY_INDEX[$software_id]=19 - aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7958#p7958' - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_REQUIRES_GIT[$software_id]=1 # Required for updates + aSOFTWARE_WHIP_NAME[$software_id]='OctoPrint' + aSOFTWARE_WHIP_DESC[$software_id]='web interface for controlling 3d printers' + aSOFTWARE_CATEGORY_INDEX[$software_id]=19 + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7958#p7958' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 # Required for updates #-------------------------------------------------------------------------------- #Additional linux software items @@ -2118,74 +2102,74 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=0 - aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Client' - aSOFTWARE_WHIP_DESC[$software_id]='' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Client' + aSOFTWARE_WHIP_DESC[$software_id]='' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=1 #------------------ #File server clients #-------------------------------------------------------------------------------- software_id=1 - aSOFTWARE_WHIP_NAME[$software_id]='Samba Client' - aSOFTWARE_WHIP_DESC[$software_id]='access network shares' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc' + aSOFTWARE_WHIP_NAME[$software_id]='Samba Client' + aSOFTWARE_WHIP_DESC[$software_id]='access network shares' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc' #------------------ software_id=110 - aSOFTWARE_WHIP_NAME[$software_id]='NFS Client' - aSOFTWARE_WHIP_DESC[$software_id]='network file system client' - aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_TYPE[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc' + aSOFTWARE_WHIP_NAME[$software_id]='NFS Client' + aSOFTWARE_WHIP_DESC[$software_id]='network file system client' + aSOFTWARE_CATEGORY_INDEX[$software_id]=1 + aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc' #------------------ #File managers #-------------------------------------------------------------------------------- software_id=3 - aSOFTWARE_WHIP_NAME[$software_id]='MC' - aSOFTWARE_WHIP_DESC[$software_id]='midnight commander, powerful file manager' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='MC' + aSOFTWARE_WHIP_DESC[$software_id]='midnight commander, powerful file manager' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=4 - aSOFTWARE_WHIP_NAME[$software_id]='ViFM' - aSOFTWARE_WHIP_DESC[$software_id]='file manager with vi bindings' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='ViFM' + aSOFTWARE_WHIP_DESC[$software_id]='file manager with vi bindings' + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_TYPE[$software_id]=1 #------------------ #System #-------------------------------------------------------------------------------- software_id=5 - aSOFTWARE_WHIP_NAME[$software_id]='ALSA' - aSOFTWARE_WHIP_DESC[$software_id]='linux sound system' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='ALSA' + aSOFTWARE_WHIP_DESC[$software_id]='linux sound system' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=6 - aSOFTWARE_WHIP_NAME[$software_id]='Xserver' - aSOFTWARE_WHIP_DESC[$software_id]='linux display system' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Xserver' + aSOFTWARE_WHIP_DESC[$software_id]='linux display system' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=151 - aSOFTWARE_WHIP_NAME[$software_id]='Nvidia' - aSOFTWARE_WHIP_DESC[$software_id]='display driver' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_TYPE[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Nvidia' + aSOFTWARE_WHIP_DESC[$software_id]='display driver' + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 + aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # NativePC only + # Native PC only for ((i=0; i<=$MAX_G_HW_MODEL; i++)) do @@ -2198,194 +2182,182 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=7 - aSOFTWARE_WHIP_NAME[$software_id]='FFmpeg' - aSOFTWARE_WHIP_DESC[$software_id]='audio & visual libary' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='FFmpeg' + aSOFTWARE_WHIP_DESC[$software_id]='audio & visual libary' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=8 - aSOFTWARE_WHIP_NAME[$software_id]='Java' - aSOFTWARE_WHIP_DESC[$software_id]='OpenJDK 8 + JRE libary' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Java' + aSOFTWARE_WHIP_DESC[$software_id]='OpenJDK 8 + JRE libary' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=9 - aSOFTWARE_WHIP_NAME[$software_id]='Node.js' - aSOFTWARE_WHIP_DESC[$software_id]='javascript runtime' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Node.js' + aSOFTWARE_WHIP_DESC[$software_id]='javascript runtime' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=130 - aSOFTWARE_WHIP_NAME[$software_id]='Python Pip' - aSOFTWARE_WHIP_DESC[$software_id]='python pip package installer' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Python Pip' + aSOFTWARE_WHIP_DESC[$software_id]='python pip package installer' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=140 - aSOFTWARE_WHIP_NAME[$software_id]='SDL2' - aSOFTWARE_WHIP_DESC[$software_id]='simple direct layer 2' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 - SOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='SDL2' + aSOFTWARE_WHIP_DESC[$software_id]='simple direct layer 2' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 + SOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # Disable for ARMv8 + # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 - #------------------ software_id=150 - aSOFTWARE_WHIP_NAME[$software_id]='Mono' - aSOFTWARE_WHIP_DESC[$software_id]='runtime libraries and repo' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 - - + aSOFTWARE_WHIP_NAME[$software_id]='Mono' + aSOFTWARE_WHIP_DESC[$software_id]='runtime libraries and repo' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=126 - aSOFTWARE_WHIP_NAME[$software_id]='LibSSL1.0.0' - aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='LibSSL1.0.0' + aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_TYPE[$software_id]=1 #Networking #-------------------------------------------------------------------------------- software_id=10 - aSOFTWARE_WHIP_NAME[$software_id]='iftop' - aSOFTWARE_WHIP_DESC[$software_id]='displays bandwidth usage information' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='iftop' + aSOFTWARE_WHIP_DESC[$software_id]='displays bandwidth usage information' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=11 - aSOFTWARE_WHIP_NAME[$software_id]='IPTraf' - aSOFTWARE_WHIP_DESC[$software_id]='interactive colorful ip lan monitor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='IPTraf' + aSOFTWARE_WHIP_DESC[$software_id]='interactive colorful ip lan monitor' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=12 - aSOFTWARE_WHIP_NAME[$software_id]='Iperf' - aSOFTWARE_WHIP_DESC[$software_id]='internet protocol bandwidth measuring tool' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Iperf' + aSOFTWARE_WHIP_DESC[$software_id]='internet protocol bandwidth measuring tool' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=13 - aSOFTWARE_WHIP_NAME[$software_id]='MTR-Tiny' - aSOFTWARE_WHIP_DESC[$software_id]='full screen ncurses traceroute tool' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='MTR-Tiny' + aSOFTWARE_WHIP_DESC[$software_id]='full screen ncurses traceroute tool' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=14 - aSOFTWARE_WHIP_NAME[$software_id]='nLoad' - aSOFTWARE_WHIP_DESC[$software_id]='realtime console network usage monitor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='nLoad' + aSOFTWARE_WHIP_DESC[$software_id]='realtime console network usage monitor' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=15 - aSOFTWARE_WHIP_NAME[$software_id]='tcpdump' - aSOFTWARE_WHIP_DESC[$software_id]='command-line network traffic analyzer' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='tcpdump' + aSOFTWARE_WHIP_DESC[$software_id]='command-line network traffic analyzer' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=152 - aSOFTWARE_WHIP_NAME[$software_id]='Avahi-Daemon' - aSOFTWARE_WHIP_DESC[$software_id]='hostname broadcast (mac, pc bonjour)' - aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_TYPE[$software_id]=1 - + aSOFTWARE_WHIP_NAME[$software_id]='Avahi-Daemon' + aSOFTWARE_WHIP_DESC[$software_id]='hostname broadcast (mac, pc bonjour)' + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_TYPE[$software_id]=1 #Development / Programming #-------------------------------------------------------------------------------- software_id=16 - aSOFTWARE_WHIP_NAME[$software_id]='Build-Essentials' - aSOFTWARE_WHIP_DESC[$software_id]='common packages for compile' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Build-Essentials' + aSOFTWARE_WHIP_DESC[$software_id]='common packages for compile' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=17 - aSOFTWARE_WHIP_NAME[$software_id]='Git Client' - aSOFTWARE_WHIP_DESC[$software_id]='git clone etc' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Git Client' + aSOFTWARE_WHIP_DESC[$software_id]='git clone etc' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=170 - aSOFTWARE_WHIP_NAME[$software_id]='Unrar' - aSOFTWARE_WHIP_DESC[$software_id]='unarchiver for .rar files' - aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Unrar' + aSOFTWARE_WHIP_DESC[$software_id]='unarchiver for .rar files' + aSOFTWARE_CATEGORY_INDEX[$software_id]=6 + aSOFTWARE_TYPE[$software_id]=1 #------------------ #Text Editors #-------------------------------------------------------------------------------- software_id=18 - aSOFTWARE_WHIP_NAME[$software_id]='Emacs' - aSOFTWARE_WHIP_DESC[$software_id]='gnu emacs editor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Emacs' + aSOFTWARE_WHIP_DESC[$software_id]='gnu emacs editor' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=19 - aSOFTWARE_WHIP_NAME[$software_id]='Jed' - aSOFTWARE_WHIP_DESC[$software_id]='editor for programmers' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Jed' + aSOFTWARE_WHIP_DESC[$software_id]='editor for programmers' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=20 - aSOFTWARE_WHIP_NAME[$software_id]='Vim' - aSOFTWARE_WHIP_DESC[$software_id]='vi enhanced text editor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Vim' + aSOFTWARE_WHIP_DESC[$software_id]='vi enhanced text editor' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=21 - aSOFTWARE_WHIP_NAME[$software_id]='Vim-Tiny' - aSOFTWARE_WHIP_DESC[$software_id]='compact release of vim' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_WHIP_NAME[$software_id]='Vim-Tiny' + aSOFTWARE_WHIP_DESC[$software_id]='compact release of vim' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=1 #------------------ software_id=127 - aSOFTWARE_WHIP_NAME[$software_id]='NeoVim' - aSOFTWARE_WHIP_DESC[$software_id]='heavily refactored vim fork' - aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_TYPE[$software_id]=1 - - # - Stretch only - for ((i=3; i<=$MAX_G_DISTRO; i++)) - do - - aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 - - done - aSOFTWARE_AVAIL_G_DISTRO[$software_id,4]=1 + aSOFTWARE_WHIP_NAME[$software_id]='NeoVim' + aSOFTWARE_WHIP_DESC[$software_id]='heavily refactored vim fork' + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_TYPE[$software_id]=1 + # - Jessie + aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0 #------------------ #Desktop Utilities #-------------------------------------------------------------------------------- software_id=22 - aSOFTWARE_WHIP_NAME[$software_id]='QuiteRSS' - aSOFTWARE_WHIP_DESC[$software_id]='cross-platform, free rss reader' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_TYPE[$software_id]=1 - aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - + aSOFTWARE_WHIP_NAME[$software_id]='QuiteRSS' + aSOFTWARE_WHIP_DESC[$software_id]='cross-platform, free rss reader' + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_TYPE[$software_id]=1 + aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ #-------------------------------------------------------------------------------- @@ -2393,27 +2365,27 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=101 - aSOFTWARE_WHIP_NAME[$software_id]='Log Rotate' - aSOFTWARE_WHIP_DESC[$software_id]='rotates log files' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_WHIP_NAME[$software_id]='Log Rotate' + aSOFTWARE_WHIP_DESC[$software_id]='rotates log files' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=102 - aSOFTWARE_WHIP_NAME[$software_id]='Rsyslog' - aSOFTWARE_WHIP_DESC[$software_id]='system logging' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_WHIP_NAME[$software_id]='Rsyslog' + aSOFTWARE_WHIP_DESC[$software_id]='system logging' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=103 - aSOFTWARE_WHIP_NAME[$software_id]='DietPi-RAMlog' - aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimized logging' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_WHIP_NAME[$software_id]='DietPi-RAMlog' + aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimized logging' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ #-------------------------------------------------------------------------------- @@ -2421,19 +2393,19 @@ DietPi-Software will decrypt and use it for software installs. You can change it #-------------------------------------------------------------------------------- software_id=104 - aSOFTWARE_WHIP_NAME[$software_id]='Dropbear' - aSOFTWARE_WHIP_DESC[$software_id]='lightweight ssh server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' + aSOFTWARE_WHIP_NAME[$software_id]='Dropbear' + aSOFTWARE_WHIP_DESC[$software_id]='lightweight ssh server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' #------------------ software_id=105 - aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Server' - aSOFTWARE_WHIP_DESC[$software_id]='feature rich ssh server' - aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' + aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Server' + aSOFTWARE_WHIP_DESC[$software_id]='feature rich ssh server' + aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' #------------------ #-------------------------------------------------------------------------------- @@ -2880,7 +2852,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it # MariaDB: LAMP (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && aSOFTWARE_INSTALL_STATE[76]=1 - # WEBSERVER_NGINX elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then @@ -2901,6 +2872,22 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + # Update PHP variables after all software titles have been marked. + if (( ${aSOFTWARE_INSTALL_STATE[89]} > 0 )); then + + # ownCloud (up to v10.2) does not yet support PHP7.3, so install PHP7.2 for now + if (( ${aSOFTWARE_INSTALL_STATE[47]} > 0 )) || [[ -f '/var/www/owncloud/version.php' ]]; then + + FP_PHP_BASE_DIR='/etc/php/7.2' + PHP_NAME='php7.2' + # - Prevent accidental PHP7.3 installs + echo -e '# ownCloud does not yet support PHP7.3 +Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-owncloud + + fi + + fi + } Create_Desktop_Shared_Items(){ @@ -3295,7 +3282,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI gimp fi @@ -3304,7 +3290,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI xfce4-power-manager fi @@ -3350,7 +3335,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Link disk cache to RAM: https://github.com/MichaIng/DietPi/issues/2396 # - Remove previous disk cache dir or symlink - [[ -e /var/cache/samba ]] && rm -R /var/cache/samba + [[ -d '/var/cache/samba' || -L '/var/cache/samba' ]] && rm -R /var/cache/samba # - Pre-create RAM cache dir mkdir -p /var/run/samba-cache # - Link disk cache to RAM @@ -3456,23 +3441,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it local package_list='mariadb-server' # Install php-mysql module, if PHP was already installed - if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - - if (( $G_DISTRO < 4 )); then - # For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - package_list+=' php5-mysqlnd' - - else - # For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - package_list+=" $PHP_APT_PACKAGE_NAME-mysql" - - fi - - fi + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-mysql" G_AGI "$package_list" # - Remove mysql.service as we use mariadb.service, both cannot exist: https://github.com/MichaIng/DietPi/issues/1913#issuecomment-441343798 - if [[ -f /etc/init.d/mysql ]] && (( $G_DISTRO >= 4 )); then + if [[ -f '/etc/init.d/mysql' ]] && (( $G_DISTRO > 3 )); then G_DIETPI-NOTIFY 2 'Switching from /etc/init.d/mysql to mariadb.service' systemctl stop mysql @@ -3490,7 +3463,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing local package_list='sqlite3' # Install php-sqlite module, if PHP was already installed - (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_APT_PACKAGE_NAME-sqlite*" + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-sqlite3" G_AGI "$package_list" fi @@ -3502,9 +3475,22 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing local package_list='redis-server' # Install php-redis module, if PHP was already installed - (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_BINARY-redis" + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-redis" G_AGI $package_list + # Fix wrong permissions from Jessie package: https://github.com/MichaIng/DietPi/issues/2736 + # - /var/run/redis is created but on boot as well with wrong root:root permissions, so we need to fix that via ExecStartPre + if (( $G_DISTRO < 4 )); then + + mkdir -p /etc/systemd/system/redis-server.service.d + echo "[Service] +PermissionsStartOnly=true +ExecStartPre=$(command -v mkdir) -p /var/run/redis /var/lib/redis +ExecStartPre=$(command -v chown) -R redis:redis /var/run/redis /var/lib/redis" > /etc/systemd/system/redis-server.service.d/dietpi-fix_permissions.conf + systemctl daemon-reload + + fi + fi #WEBSERVER_PHP @@ -3513,53 +3499,79 @@ DietPi-Software will decrypt and use it for software installs. You can change it Banner_Installing - # Install base PHP packages/modules - # - Apache - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + # Jessie + Stretch: Add Ondrejs PHP repository for latest PHP version (currently PHP7.3) + if (( $G_DISTRO < 5 )); then - local package_list="libapache2-mod-$PHP_APT_PACKAGE_NAME" + # Jessie: https://github.com/MichaIng/DietPi/issues/1620#issuecomment-373086888 + if (( $G_DISTRO < 4 )); then - # - Lighttpd or Nginx - elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 || ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/libssl1.1_1.1.0f-3+deb9u1_' - local package_list="$PHP_APT_PACKAGE_NAME-fpm" + # - ARMv7 + if (( $G_HW_ARCH < 3 )); then - # - No webserver, /usr/bin/php cmd usage - else + INSTALL_URL_ADDRESS+='armhf.deb' - local package_list="$PHP_APT_PACKAGE_NAME-cli" + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - fi + INSTALL_URL_ADDRESS+='arm64.deb' - # php-common modules, used by most web software - package_list+=" $PHP_APT_PACKAGE_NAME-curl $PHP_APT_PACKAGE_NAME-gd $PHP_BINARY-apcu" + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - # + Stretch extras - (( $G_DISTRO > 3 )) && package_list+=" $PHP_APT_PACKAGE_NAME-mbstring $PHP_APT_PACKAGE_NAME-opcache $PHP_APT_PACKAGE_NAME-zip $PHP_APT_PACKAGE_NAME-xml" + INSTALL_URL_ADDRESS+='amd64.deb' - # PHP7.2/Buster dropped support for mcrypt: https://liorkaplan.wordpress.com/2017/09/10/php-7-2-is-coming-mcrypt-extension-isnt/ - (( $G_DISTRO < 5 )) && package_list+=" $PHP_APT_PACKAGE_NAME-mcrypt" + fi - # MySQL/MariaDB php module - if (( ${aSOFTWARE_INSTALL_STATE[88]} >= 1 )); then + Download_Install "$INSTALL_URL_ADDRESS" - if (( $G_DISTRO < 4 )); then - # For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - package_list+=' php5-mysqlnd' + fi - else - # For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - package_list+=" $PHP_APT_PACKAGE_NAME-mysql" + # - Check URL + INSTALL_URL_ADDRESS='https://packages.sury.org/php/apt.gpg' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + # - APT key + curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - + # - APT source + echo "deb https://packages.sury.org/php/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-php.list + # - Pin down libssl1.1 version from this repo on Jessie and Stretch: https://github.com/MichaIng/DietPi/issues/2734 + echo -e '# libssl1.1 from sury.org breaks Lighttpd install +Package: openssl libssl1.1\nPin: origin packages.sury.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-openssl + # - APT list update + G_AGUP - fi + fi + + # Base PHP modules + # - Apache + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then + + local package_list="libapache2-mod-$PHP_NAME" + + # - Lighttpd or Nginx + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then + + local package_list="$PHP_NAME-fpm" + + # - No webserver, /usr/bin/php cmd usage + else + + local package_list="$PHP_NAME-cli" fi - # SQLite php module - (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )) && package_list+=" $PHP_APT_PACKAGE_NAME-sqlite*" # Wildcard for version (eg:3) + # Additional PHP modules, commonly used by most web applications + package_list+=" $PHP_NAME-apcu $PHP_NAME-curl $PHP_NAME-gd $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-zip" + + # MySQL/MariaDB PHP module + (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && package_list+=" $PHP_NAME-mysql" - # Redis php module - (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )) && package_list+=" $PHP_BINARY-redis" + # SQLite PHP module + (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && package_list+=" $PHP_NAME-sqlite3" + + # Redis PHP module + (( ${aSOFTWARE_INSTALL_STATE[91]} > 0 )) && package_list+=" $PHP_NAME-redis" G_AGI $package_list @@ -3601,13 +3613,12 @@ We work around this error by running APT a second time. Please do not worry and fi - #MPD - software_id=128 + software_id=128 # MPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Jessie- + # Jessie- if (( $G_DISTRO < 4 )); then # MPD not available in Jessie repo for ARMv8 @@ -3623,7 +3634,7 @@ We work around this error by running APT a second time. Please do not worry and fi - #Stretch + # Stretch elif (( $G_DISTRO == 4 )); then DEPS_LIST='libnfs8 libsmbclient libsqlite3-0 libupnp6 libwrap0 libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0' @@ -3631,11 +3642,11 @@ We work around this error by running APT a second time. Please do not worry and # Prevent APT repo updates from overwriting apt-mark hold mpd - #Buster+ + # Buster+ else # libcdio-paranoia1, libiso9660-8 and libupnp6 not available, but ibcdio-paranoia2, libiso9660-11 and libupnp13 instead - # Buster repo version >= 0.21.4, thus stay with APT for now: + # Buster repo version >= 0.21.5, thus stay with APT for now: G_AGI mpd fi @@ -3662,27 +3673,25 @@ We work around this error by running APT a second time. Please do not worry and fi - #OPENBAZAAR - software_id=58 + software_id=58 # OpenBazaar if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Install go - # x86_64 + # - x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-amd64.tar.gz' - # ARMv8 + # - ARMv8 elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.2.linux-arm64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-arm64.tar.gz' - # ARMv6/7 + # - ARMv6/7 else - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.2.linux-armv6l.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-armv6l.tar.gz' fi @@ -3739,12 +3748,11 @@ _EOF_ fi - #ownCloud - software_id=47 + software_id=47 # ownCloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST="$PHP_APT_PACKAGE_NAME-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions + DEPS_LIST="$PHP_NAME-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions if [[ -f /var/www/owncloud/occ ]]; then @@ -3775,12 +3783,11 @@ _EOF_ fi - #Nextcloud - software_id=114 + software_id=114 # Nextcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST="$PHP_APT_PACKAGE_NAME-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + DEPS_LIST="$PHP_NAME-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation if [[ -f /var/www/nextcloud/occ ]]; then @@ -3797,11 +3804,6 @@ _EOF_ # Correct config.php data directory entry, in case it changed due to server migration: G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/nextcloud/config/config.php "'dbtype'" - elif (( $G_DISTRO < 4 )); then - - G_DIETPI-NOTIFY 2 'PHP5 support was dropped with NC14, latest NC13 will be installed instead' - Download_Install 'https://download.nextcloud.com/server/releases/latest-13.tar.bz2' /var/www - else Download_Install 'https://download.nextcloud.com/server/releases/latest.tar.bz2' /var/www @@ -3816,13 +3818,12 @@ _EOF_ fi - #Nextcloud Talk - software_id=168 + software_id=168 # Nextcloud Talk if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # Install "coturn" TURN server only, install Nextcloud Talk app after Nextcloud has been fully configured + # Install coTURN server only, install Nextcloud Talk app after Nextcloud has been fully configured G_AGI coturn fi @@ -3944,7 +3945,7 @@ _EOF_ Download_Install "$INSTALL_URL_ADDRESS" # Clear dir on reinstall - [[ -d /etc/roonbridge ]] && rm -R /etc/roonbridge + [[ -d '/etc/roonbridge' ]] && rm -R /etc/roonbridge mv RoonBridge /etc/roonbridge fi @@ -4011,39 +4012,34 @@ _EOF_ G_AGUP G_AGI mopidy gstreamer1.0-alsa - #ARMv8 - #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. - #Mopidy web client extensions not loading in webpage... - # if (( $G_HW_ARCH == 3 )); then + # ARMv8 + # NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. + # Mopidy web client extensions not loading in webpage... + #if (( $G_HW_ARCH == 3 )); then - # G_AGI build-essential python-dev - # pip install mopidy #no effect, claims already upto date. + #G_AGI build-essential python-dev + #pip install mopidy #no effect, claims already upto date. - # fi + #fi pip install Mopidy-MusicBox-Webclient Mopidy-Local-Images fi - #Kodi - software_id=31 + software_id=31 # Kodi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Odroids - if (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then + # Odroids + if (( $G_HW_MODEL > 9 )) && (( $G_HW_MODEL < 20 )); then local package_list='kodi-odroid' - #XU4 - requires pulse audio (fixes corrupt sound) - if (( $G_HW_MODEL == 11 )); then - - package_list+=' pulseaudio' - - fi + # XU4 - requires pulse audio (fixes corrupt sound) + (( $G_HW_MODEL == 11 )) && package_list+=' pulseaudio' - #Everything else + # Everything else else local package_list='kodi' @@ -4081,30 +4077,28 @@ _EOF_ fi - #NoIp - software_id=67 + software_id=67 # No-IP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #x86_x64 + # x86_x64 if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/noip_x32_x64.zip' - #ARMv8 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/noip_arm64.zip' - #ARMv6/7 + # ARMv6/7 else INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/noip_armhf.zip' fi - #NoIp binary install Download_Install "$INSTALL_URL_ADDRESS" mkdir -p /usr/local/bin @@ -4113,13 +4107,12 @@ _EOF_ fi - #amiberry - software_id=108 + software_id=108 # Amiberry if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Backup existing autostart.uae for user + # Backup existing autostart.uae for user G_BACKUP_FP $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae DEPS_LIST='libmpg123-0 libxml2 mpeg2dec libmpeg2-4 libsndio6.1' @@ -4188,8 +4181,7 @@ _EOF_ fi - #OpenTyrian - software_id=51 + software_id=51 # OpenTyrian if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4221,30 +4213,30 @@ _EOF_ cd RPi_Cam* - #Config /etc/motion + # Config /etc/motion mkdir -p /etc/motion cp etc/motion/motion.conf.1 /etc/motion/motion.conf - #Config /etc/raspimjpeg + # Config /etc/raspimjpeg cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg - #Setup /var/www/rpicam + # Setup /var/www/rpicam mkdir -p /var/www/rpicam/media cp -R www/* /var/www/rpicam/ #chmod +x /var/www/rpicam/raspizip.sh mknod /var/www/rpicam/FIFO p mknod /var/www/rpicam/FIFO1 p - #symlink cam preview and status + # 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 - #Setup Raspimjpeg binary + # 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 - #Cleanup / remove extracted source + # Cleanup / remove extracted source cd /tmp/$G_PROGRAM_NAME rm -R RPi_Cam* @@ -4273,7 +4265,7 @@ _EOF_ Banner_Installing - # Download_Install 'https://github.com/ArturSierzant/OMPD/archive/master.zip' /var/www + #Download_Install 'https://github.com/ArturSierzant/OMPD/archive/master.zip' /var/www Download_Install 'https://github.com/ArturSierzant/OMPD/archive/2a2909be2d7abc8cce7dff741f529c7d876d4094.zip' /var/www rm -R /var/www/ompd &> /dev/null #Replace/upgrade existing installs @@ -4281,8 +4273,7 @@ _EOF_ fi - #IceCast + DarkIce - software_id=135 + software_id=135 # IceCast + DarkIce if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4290,8 +4281,7 @@ _EOF_ fi - #LINUXDASH - software_id=63 + software_id=63 # LinuxDash if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4311,7 +4301,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. + # Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | mawk '/Mem:/ {print $4;exit}') < 512 && $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') < 512 )); then @@ -4320,12 +4310,12 @@ _EOF_ fi - # - Install + # Install wget "$INSTALL_URL_ADDRESS" -O install.sh chmod +x install.sh - # Skip Lighttpd install, since user properly has chosen a different one, which was installed as pre-req. + # - Skip Lighttpd install, since user properly has chosen a different one, which was installed as pre-req. ./install.sh --disable-install-webserver - # We can't do reasonable exit code check, since installer always returns 5! + # - We can't do reasonable exit code check, since installer always returns 5! rm install.sh fi @@ -4463,8 +4453,7 @@ _EOF_ fi - #Blynk Server - software_id=131 + software_id=131 # Blynk Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4476,7 +4465,7 @@ _EOF_ mkdir -p $G_FP_DIETPI_USERDATA/blynk/data G_THREAD_START wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar - # - Install Blynk JS Libary + # Install Blynk JS libary G_AGI python npm i -g --unsafe-perm onoff npm i -g --unsafe-perm blynk-library @@ -4494,10 +4483,10 @@ _EOF_ # - Skip license for NAA daemon: debconf-set-selections <<< 'networkaudiod networkaudiod/license note false' - #Packages + # Packages local apackages=() - # Jessie - requires stretch packages + # - Jessie - requires stretch packages if (( $G_DISTRO == 3 )); then apackages+=('https://dietpi.com/downloads/binaries/all/gcc-6-base_6.3.0-6_armhf.deb') @@ -4522,7 +4511,7 @@ _EOF_ fi - # - check online + # - Check online for ((i=0; i<${#apackages[@]}; i++)) do @@ -4533,12 +4522,8 @@ _EOF_ # - Prereqs DEPS_LIST='libasound2' - # - Stretch, install additional packages - if (( $G_DISTRO >= 4 )); then - - DEPS_LIST+=' gcc-6-base libstdc++6' - - fi + # - Stretch+ additional packages + (( $G_DISTRO > 3 )) && DEPS_LIST+=' gcc-6-base libstdc++6' for ((i=0; i<${#apackages[@]}; i++)) do @@ -4549,8 +4534,8 @@ _EOF_ unset apackages - #Enable logging for NAA Daemon - #echo -e "NETWORKAUDIOD_LOGFILE='/var/log/naadaemon.log'" > /etc/default/networkaudiod + # Enable logging for NAA Daemon + #echo "NETWORKAUDIOD_LOGFILE='/var/log/naadaemon.log'" > /etc/default/networkaudiod fi @@ -4574,16 +4559,15 @@ _EOF_ cd WebIOPi* - #Automate Weaved prompt + # Automate Weaved prompt sed -i '/read response/c\response="n"' setup.sh - #Run setup script + # Run setup script ./setup.sh - printf '\ec' # clear current terminal screen cd /tmp/$G_PROGRAM_NAME - #Cleanup + # Cleanup rm -R WebIOPi* fi @@ -4611,19 +4595,19 @@ _EOF_ cd haproxy-* - #Compile and install + # Compile and install make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install mkdir /etc/haproxy - #Exit directory + # Exit directory cd /tmp/$G_PROGRAM_NAME - #Clean up + # Clean up rm -R haproxy-* - #Install init script as service + # Install init script as service dps_index=$software_id Download_Install 'haproxy.service' /etc/init.d/haproxy chmod +x /etc/init.d/haproxy update-rc.d haproxy defaults @@ -4665,8 +4649,8 @@ _EOF_ Banner_Installing # Install required PHP modules: https://github.com/FreshRSS/FreshRSS#example-of-full-installation-on-linux-debianubuntu - DEPS_LIST="$PHP_APT_PACKAGE_NAME-curl $PHP_APT_PACKAGE_NAME-gmp $PHP_APT_PACKAGE_NAME-intl $PHP_APT_PACKAGE_NAME-json" - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_APT_PACKAGE_NAME-mbstring $PHP_APT_PACKAGE_NAME-xml $PHP_APT_PACKAGE_NAME-zip" + DEPS_LIST="$PHP_NAME-curl $PHP_NAME-gmp $PHP_NAME-intl $PHP_NAME-json" + (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-zip" Download_Install 'https://github.com/FreshRSS/FreshRSS/archive/master.zip' /opt mv /opt/FreshRSS-master /opt/FreshRSS @@ -4947,7 +4931,7 @@ _EOF_ fi # Odroids need to purge before we install, else, does not update to latest version... - (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages + (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. G_AGI $kernel_packages # apt-get install overrides hold state @@ -5086,7 +5070,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - software_id=61 # Tor Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -5117,10 +5100,10 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # Install required PHP modules - DEPS_LIST="$PHP_BINARY-apcu $PHP_APT_PACKAGE_NAME-gd $PHP_APT_PACKAGE_NAME-intl" + DEPS_LIST="$PHP_NAME-apcu $PHP_NAME-gd $PHP_NAME-intl" # - Stretch extras - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_APT_PACKAGE_NAME-mbstring $PHP_APT_PACKAGE_NAME-opcache $PHP_APT_PACKAGE_NAME-xml" + (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-opcache $PHP_NAME-xml" # Skip install, if already present if [[ -d /var/www/pydio ]]; then @@ -5622,7 +5605,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then + if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )); then DEPS_LIST='libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7' @@ -5782,8 +5765,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # Needed PHP modules, (re)install to be failsafe: https://koel.phanan.net/docs/#/?id=server, https://laravel.com/docs/5.6/installation#server-requirements - DEPS_LIST="python $PHP_APT_PACKAGE_NAME-json" - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_APT_PACKAGE_NAME-mbstring $PHP_APT_PACKAGE_NAME-xml" + DEPS_LIST="python $PHP_NAME-json" + (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-xml" Download_Install 'https://github.com/phanan/koel/archive/v3.7.2.zip' mv koel-* $G_FP_DIETPI_USERDATA/koel @@ -7271,7 +7254,7 @@ _EOF_ Banner_Configuration - #Apache2 confs + # Apache2 confs G_BACKUP_FP /etc/apache2/apache2.conf dps_index=$software_id Download_Install 'apache2.conf' /etc/apache2/apache2.conf cat << _EOF_ > /etc/apache2/sites-available/000-default.conf @@ -7318,7 +7301,7 @@ _EOF_ _EOF_ - #Use /var/www as default webfolder + # Use /var/www as default webfolder mv /var/www/html/index.html /var/www/index.html &> /dev/null [[ $(ls -A /var/www/html 2>&1) ]] || rm -R /var/www/html @@ -7339,15 +7322,7 @@ _EOF_ G_BACKUP_FP /etc/nginx/nginx.conf dps_index=$software_id Download_Install 'nginx.conf' /etc/nginx/nginx.conf # Adjust socket name to PHP version - if (( $G_DISTRO < 4 )); then - - sed -i 's#/run/php/php7.0-fpm.sock#/run/php5-fpm.sock#g' /etc/nginx/nginx.conf - - elif (( $G_DISTRO > 4 )); then - - sed -i 's#php7.0-fpm.sock#php7.3-fpm.sock#g' /etc/nginx/nginx.conf - - fi + sed -i "s#/run/php/php.*-fpm.sock#/run/php/$PHP_NAME-fpm.sock#g" /etc/nginx/nginx.conf # - CPU core count sed -i "/worker_processes/c\worker_processes $G_HW_CPU_CORES;" /etc/nginx/nginx.conf @@ -7372,9 +7347,6 @@ _EOF_ sed -i '/^server.document-root/c\server.document-root = "/var/www"' /etc/lighttpd/lighttpd.conf #Configure fastcgi for PHP-FPM - local fp_php_fpm_sock="/var/run/php/$PHP_APT_PACKAGE_NAME-fpm.sock" - (( $G_DISTRO < 4 )) && fp_php_fpm_sock='/var/run/php5-fpm.sock' - cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf # -*- depends: fastcgi -*- # /usr/share/doc/lighttpd/fastcgi.txt.gz @@ -7383,7 +7355,7 @@ _EOF_ ## Start an FastCGI server using php-fpm fastcgi.server += ( ".php" => (( - "socket" => "$fp_php_fpm_sock", + "socket" => "/run/php/$PHP_NAME-fpm.sock", "broken-scriptfilename" => "enable" )) ) @@ -7406,15 +7378,15 @@ _EOF_ Banner_Configuration # - Apache2 has its own PHP module - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then # https://github.com/MichaIng/DietPi/issues/1144 local php_service='/lib/systemd/system/apache2.service' # - Nginx and Lighttpd use PHP-FPM - elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 || ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then - local php_service='/lib/systemd/system/php*-fpm.service' + local php_service="/lib/systemd/system/${PHP_NAME}-fpm.service" # - PHP-FPM confs sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=1' "$FP_PHP_BASE_DIR"/fpm/php.ini @@ -7436,70 +7408,59 @@ _EOF_ fi - # PHP cache settings - local target_php_cachesize=$(( $RAM_TOTAL / 30 )) - (( $target_php_cachesize < 10 )) && target_php_cachesize=10 - - # - OPcache - local target_php_ini="$FP_PHP_BASE_DIR/mods-available/opcache.ini" - - G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini - G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]]*=' "opcache.memory_consumption=$target_php_cachesize" $target_php_ini - G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]]*=' 'opcache.revalidate_freq=60' $target_php_ini - - # - APCu - target_php_ini="$FP_PHP_BASE_DIR/mods-available/apcu.ini" - # - apc.shm_size= requires M at end to prevent warning: https://github.com/MichaIng/DietPi/issues/218 - target_php_cachesize+='M' - # - 3days TTL - local target_apc_ttl='259200' - - G_CONFIG_INJECT 'apc.shm_size[[:blank:]]*=' "apc.shm_size=$target_php_cachesize" $target_php_ini - G_CONFIG_INJECT 'apc.ttl[[:blank:]]*=' "apc.ttl=$target_apc_ttl" $target_php_ini - # We create our own PHP mod to add DietPi specific configs. target_php_ini="$FP_PHP_BASE_DIR/mods-available/dietpi.ini" - echo -e '; DietPi PHP settngs\n; priority=99' > $target_php_ini + echo -e '; DietPi PHP settngs\n; priority=98' > $target_php_ini - # - Set tmp_upload_dir to sd. Can't be /tmp as its ramdisk and limited size. Also used by ownCloud/Nextcloud uploads + # - Set upload_tmp_dir to disk. Can't be /tmp as its ramdisk and limited size. Also used by ownCloud/Nextcloud uploads # - If PHP uses PrivateTmp, we must not use own subfolder: https://github.com/MichaIng/DietPi/issues/1144 if [[ -f $php_service ]] && grep -q '^[[:blank:]]*PrivateTmp=true' $php_service; then - local tmp_upload_dir='/var/tmp' + local upload_tmp_dir='/var/tmp' else - local tmp_upload_dir='/var/tmp/php_upload_tmp' - mkdir -p $tmp_upload_dir - chown -R www-data:www-data $tmp_upload_dir + local upload_tmp_dir='/var/tmp/php_upload_tmp' + mkdir -p $upload_tmp_dir + chown -R www-data:www-data $upload_tmp_dir fi - G_CONFIG_INJECT 'upload_tmp_dir[[:blank:]]*=' "upload_tmp_dir=$tmp_upload_dir" $target_php_ini + G_CONFIG_INJECT 'upload_tmp_dir[[:blank:]]*=' "upload_tmp_dir=$upload_tmp_dir" $target_php_ini - # - max upload size + # - Max upload size local php_max_upload_size="$(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M" # - upload_max_filesize G_CONFIG_INJECT 'upload_max_filesize[[:blank:]]*=' "upload_max_filesize=$php_max_upload_size" $target_php_ini # - post_max_size G_CONFIG_INJECT 'post_max_size[[:blank:]]*=' "post_max_size=$php_max_upload_size" $target_php_ini - # - Nginx - Set client_max_body_size to avoid 2MB upload error: https://github.com/MichaIng/DietPi/issues/546 - if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + # - Nginx: Set client_max_body_size to avoid 2MB upload error: https://github.com/MichaIng/DietPi/issues/546 + if (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then - sed -i "/client_max_body_size/c\ client_max_body_size $php_max_upload_size;" /etc/nginx/nginx.conf + sed -i "/client_max_body_size/c\ client_max_body_size $php_max_upload_size;" /etc/nginx/nginx.conf fi # - Set UTF-8 G_CONFIG_INJECT 'default_charset[[:blank:]]*=' 'default_charset="UTF-8"' $target_php_ini - # Enable all installed and available PHP modules. - local modules_to_enable=$(ls "$FP_PHP_BASE_DIR"/mods-available | grep '.ini' | sed 's/.ini//') - ${PHP_BINARY}enmod "$modules_to_enable" + # - PHP cache settings + local target_php_cachesize=$(( $RAM_TOTAL / 30 )) + (( $target_php_cachesize < 10 )) && target_php_cachesize=10 + # - OPcache + G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini + G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]]*=' "opcache.memory_consumption=$target_php_cachesize" $target_php_ini + G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]]*=' 'opcache.revalidate_freq=60' $target_php_ini + # - APCu + G_CONFIG_INJECT 'apc.shm_size[[:blank:]]*=' "apc.shm_size=${target_php_cachesize}M" $target_php_ini + G_CONFIG_INJECT 'apc.ttl[[:blank:]]*=' 'apc.ttl=259200' $target_php_ini # 3 days TTL + + # Enable all available PHP modules + phpenmod $(ls $FP_PHP_BASE_DIR/mods-available | sed -n '/\.ini$/{s/\.ini$//;p}') # Create PHP info pages within webroot, if webserver is installed. - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 || - ${aSOFTWARE_INSTALL_STATE[84]} >= 1 || - ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 || + ${aSOFTWARE_INSTALL_STATE[84]} > 0 || + ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then # PHP info page echo '' > /var/www/phpinfo.php @@ -7534,7 +7495,7 @@ _EOF_ ### Also for MariaDB? # Optimize for reduced memory use: https://github.com/MichaIng/DietPi/issues/605#issue-188930987 - #cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf + #cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi.cnf #[mysqld] #key_buffer_size=8M #max_connections=30 @@ -7574,20 +7535,19 @@ _EOF_ Banner_Configuration # Enable redis php module, if installed: - ${PHP_BINARY}enmod redis 2> /dev/null + phpenmod redis 2> /dev/null fi - #OPENBAZAAR - software_id=58 + software_id=58 # OpenBazaar if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Data dir + # Data dir mkdir -p $G_FP_DIETPI_USERDATA/openbazaar - # - Init OB to have config file available, if not yet the case, and edit to allow remote client access + # Init OB to have config file available, if not yet the case, and edit to allow remote client access if [[ ! -f $G_FP_DIETPI_USERDATA/openbazaar/config ]]; then openbazaar-go init -d $G_FP_DIETPI_USERDATA/openbazaar @@ -7627,13 +7587,12 @@ This is required, since the ${aSOFTWARE_WHIP_NAME[$software_id]} server node by fi - # - service + # Service cat << _EOF_ > /etc/systemd/system/openbazaar.service [Unit] Description=OpenBazaar (DietPi) [Service] -Type=simple Environment=GOPATH=$G_FP_DIETPI_USERDATA/go WorkingDirectory=$G_FP_DIETPI_USERDATA/go ExecStart=$(command -v openbazaar-go) start -d $G_FP_DIETPI_USERDATA/openbazaar @@ -7644,8 +7603,7 @@ _EOF_ fi - #YaCy - software_id=133 + software_id=133 # YaCy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7657,23 +7615,20 @@ _EOF_ Description=YaCy (DietPi) [Service] -Type=simple RemainAfterExit=yes -ExecStart=/bin/bash -c '/etc/yacy/startYACY.sh' -ExecStop=/bin/bash -c '/etc/yacy/stopYACY.sh' +ExecStart=/etc/yacy/startYACY.sh +ExecStop=/etc/yacy/stopYACY.sh [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - # Create admin login account: + # Create admin login account: /etc/yacy/bin/passwd.sh "$GLOBAL_PW" fi - #Folding@Home - software_id=2 + software_id=2 # Folding@Home if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7693,7 +7648,6 @@ _EOF_ Description=Folding@Home (DietPi) [Service] -Type=simple User=fahclient Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/fahclient @@ -7701,24 +7655,23 @@ ExecStart=$(command -v FAHClient) --allow='0/0' --web-allow='0/0' --daemon=false [Install] WantedBy=multi-user.target - _EOF_ fi - #ownCloud - software_id=47 + software_id=47 # ownCloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration G_DIETPI-NOTIFY 2 'Enabling needed PHP modules.' # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions - ${PHP_BINARY}enmod curl gd intl json pdo_mysql opcache apcu redis + phpenmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: (( $G_DISTRO > 3 )) && phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif G_DIETPI-NOTIFY 2 'Enabling APCu memory cache for PHP command line usage (CLI) as well, including ownCloud occ command and cron jobs.' - G_CONFIG_INJECT 'apc.enable_cli[[:blank:]=]' 'apc.enable_cli=1' "$FP_PHP_BASE_DIR/mods-available/apcu.ini" + echo -e '; ownCloud PHP settngs\n; priority=99\napc.enable_cli=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-owncloud.ini + phpenmod dietpi-owncloud if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then @@ -7927,7 +7880,7 @@ _EOF_ sed -i "s|'http://localhost'|'http://localhost/owncloud'|g" $config_php # Set pretty URLs (without /index.php/) on Apache: - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then GCI_PRESERVE=1 G_CONFIG_INJECT "'htaccess.RewriteBase'" "'htaccess.RewriteBase' => '/owncloud'," $config_php "'overwrite.cli.url'" occ maintenance:update:htaccess @@ -7971,27 +7924,21 @@ _EOF_ fi - #Nextcloud - software_id=114 + software_id=114 #N extcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - G_DIETPI-NOTIFY 2 'Enabling needed PHP modules.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - ${PHP_BINARY}enmod curl gd intl json pdo_mysql opcache apcu redis + G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + phpenmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: (( $G_DISTRO > 3 )) && phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif - G_DIETPI-NOTIFY 2 'Enabling APCu memory cache for PHP command line usage (CLI) as well, including Nextcloud ncc command and cron jobs.' - G_CONFIG_INJECT 'apc.enable_cli[[:blank:]=]' 'apc.enable_cli=1' "$FP_PHP_BASE_DIR/mods-available/apcu.ini" - - G_DIETPI-NOTIFY 2 'Enabling and configuring OPcache for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - G_CONFIG_INJECT 'opcache.enable[[:blank:]=]' 'opcache.enable=1' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" - G_CONFIG_INJECT 'opcache.enable_cli[[:blank:]=]' 'opcache.enable_cli=1' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" - G_CONFIG_INJECT 'opcache.interned_strings_buffer[[:blank:]=]' 'opcache.interned_strings_buffer=8' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" - G_CONFIG_INJECT 'opcache.max_accelerated_files[[:blank:]=]' 'opcache.max_accelerated_files=10000' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" - G_CONFIG_INJECT 'opcache.save_comments[[:blank:]=]' 'opcache.save_comments=1' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" - G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]=]' 'opcache.revalidate_freq=1' "$FP_PHP_BASE_DIR/mods-available/opcache.ini" + G_DIETPI-NOTIFY 2 'Optimising APCu and OPcache modules for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache + echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1 +opcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000 +opcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-nextcloud.ini + phpenmod dietpi-nextcloud if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then @@ -8228,7 +8175,7 @@ The install script will now exit. After applying one of the the above, rerun die sed -i "s|'http://localhost'|'http://localhost/nextcloud'|g" $config_php # Set pretty URLs (without /index.php/) on Apache: - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then GCI_PRESERVE=1 G_CONFIG_INJECT "'htaccess.RewriteBase'" "'htaccess.RewriteBase' => '/nextcloud'," $config_php "'overwrite.cli.url'" ncc maintenance:update:htaccess @@ -8638,14 +8585,13 @@ _EOF_ getent passwd ympd &> /dev/null && usercmd='usermod' $usercmd ympd -G dietpi -s /usr/sbin/nologin - #YMPD service + # YMPD service cat << _EOF_ > /etc/systemd/system/ympd.service [Unit] Description=YMPD (DietPi) After=mpd.service [Service] -Type=simple #User=ympd # Changes to ympd during run Group=dietpi ExecStart=/usr/bin/ympd --user ympd --webport 1337 @@ -8672,7 +8618,6 @@ Description=myMPD (DietPi) After=mpd.service [Service] -Type=simple #User=mympd # Changes at runlevel Group=dietpi ExecStart=$(command -v mympd) /etc/mympd/mympd.conf @@ -8725,23 +8670,21 @@ _EOF_ fi - #NodeRed - software_id=122 + software_id=122 # Node-RED if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration mkdir -p $G_FP_DIETPI_USERDATA/node-red - adduser nodered --system --group --shell=/bin/nologin + adduser nodered --system --group --shell=/usr/bin/nologin usermod -a -G gpio nodered cat << _EOF_ > /etc/systemd/system/node-red.service [Unit] -Description=Node-Red (DietPi) +Description=Node-RED (DietPi) [Service] -Type=simple User=nodered ExecStart=/usr/local/bin/node-red -u $G_FP_DIETPI_USERDATA/node-red @@ -8817,7 +8760,6 @@ _EOF_ # - Non-hidden files/folders are data mv $G_FP_DIETPI_USERDATA/mopidy/* $G_FP_DIETPI_USERDATA/mopidy/data - else mkdir -p $G_FP_DIETPI_USERDATA/mopidy/data @@ -8891,7 +8833,6 @@ Description=MiniDLNA (DietPi) After=network.target [Service] -Type=simple User=minidlna Group=dietpi RuntimeDirectory=minidlna @@ -8899,23 +8840,20 @@ ExecStart=$(command -v minidlnad) -SR -f /etc/minidlna.conf [Install] WantedBy=multi-user.target - _EOF_ - #Copy Config + # Copy Config G_BACKUP_FP /etc/minidlna.conf dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf - #Setup data directories + # Setup data directories mkdir -p $G_FP_DIETPI_USERDATA/.MiniDLNA_Cache Download_Test_Media fi - - #NoIp - software_id=67 + software_id=67 # No-IP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8933,7 +8871,6 @@ ConditionPathExists=/usr/local/etc/no-ip2.conf [Service] Type=forking RemainAfterExit=yes - ExecStart=/usr/local/bin/noip2 ExecStop=/usr/bin/killall -w noip2 @@ -8943,13 +8880,12 @@ _EOF_ fi - #amiberry - software_id=108 + software_id=108 # Amiberry if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Allow binary execution + # Allow binary execution chmod -R +x $G_FP_DIETPI_USERDATA/amiberry local amiberry_filename=0 @@ -8993,7 +8929,7 @@ _EOF_ mkdir -p $G_FP_DIETPI_USERDATA/amiberry/hdf mkdir -p $G_FP_DIETPI_USERDATA/amiberry/cd - #Uae4arm does not support browsing symlinks (https://github.com/MichaIng/DietPi/issues/474#issuecomment-242973839) + # Uae4arm does not support browsing symlinks (https://github.com/MichaIng/DietPi/issues/474#issuecomment-242973839) # So we need to change config file default paths to actual userdata location: local fp_userdata_actual=$(readlink $G_FP_DIETPI_USERDATA) # Only returns a value if symlink exists (eg: off SDcard) if [[ -n $fp_userdata_actual ]]; then @@ -9016,7 +8952,6 @@ _EOF_ Description=AmiBerry Amiga Emulator (DietPi) [Service] -Type=simple #StandardOutput=tty #StandardInput=tty #TTYPath=/dev/tty1 @@ -9030,7 +8965,7 @@ WantedBy=local-fs.target _EOF_ cat << _EOF_ > $G_FP_DIETPI_USERDATA/amiberry/run.sh -#!/bin/bash +#!/bin/dash cd $G_FP_DIETPI_USERDATA/amiberry ./$amiberry_filename -f conf/autostart.uae _EOF_ @@ -9045,7 +8980,7 @@ _EOF_ Banner_Configuration - #Symlink savegames to root + # Symlink savegames to root # - Remove existing syslinks rm -R /root/.d1x-rebirth &> /dev/null rm -R /root/.d2x-rebirth &> /dev/null @@ -9053,10 +8988,10 @@ _EOF_ ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth - #+exe + # +exe chmod +x -R $G_FP_DIETPI_USERDATA/dxx-rebirth/* - #Create .Desktop SymLinks + # Create .Desktop SymLinks mkdir -p /root/Desktop mkdir -p /usr/share/applications @@ -9065,17 +9000,16 @@ _EOF_ fi - #OpenTyrian - software_id=51 + software_id=51 # OpenTyrian if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Copy the DietPi run file for OpenTyrian + # Copy the DietPi run file for OpenTyrian dps_index=$software_id Download_Install 'run' /usr/games/opentyrian/run chmod +x /usr/games/opentyrian/run - #Create .Desktop SymLinks + # Create .Desktop SymLinks mkdir -p /root/Desktop rm /usr/share/applications/opentyrian.desktop &> /dev/null G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop -O /usr/share/applications/opentyrian.desktop @@ -9106,10 +9040,9 @@ _EOF_ Description=Raspimjpeg (DietPi) [Service] -Type=simple RemainAfterExit=yes -ExecStart=$(command -v bash) -c '/var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh start' -ExecStop=$(command -v bash) -c '/var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh stop' +ExecStart=/var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh start +ExecStop=/var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh stop [Install] WantedBy=multi-user.target @@ -9229,8 +9162,8 @@ Description=Webmin (DietPi) [Service] Type=forking -ExecStart=$(command -v bash) -c '/etc/webmin/start' -ExecStop=$(command -v bash) -c '/etc/webmin/stop' +ExecStart=/etc/webmin/start +ExecStop=/etc/webmin/stop [Install] WantedBy=multi-user.target @@ -9371,12 +9304,11 @@ _EOF_ Description=dietpi-cloudshell on main screen (DietPi) [Service] -Type=simple StandardOutput=tty TTYPath=/dev/tty1 ExecStartPre=$(command -v setterm) --term linux --blank 0 --powersave off --cursor off -ExecStart=/bin/bash -c '/DietPi/dietpi/dietpi-cloudshell 1' +ExecStart=/DietPi/dietpi/dietpi-cloudshell 1 ExecStop=$(command -v setterm) --reset ExecStop=$(command -v echo) 'DietPi-Cloudshell terminated, have a nice day!' @@ -9531,7 +9463,7 @@ _EOF_ Banner_Configuration # Enable required PHP modules: https://github.com/FreshRSS/FreshRSS#requirements - ${PHP_BINARY}enmod curl gmp intl json pdo_mysql + phpenmod curl gmp intl json pdo_mysql (( $G_DISTRO > 3 )) && phpenmod ctype dom mbstring xml zip # Apache configuration @@ -9593,75 +9525,73 @@ Before=xrdp.service xrdp-sesman.service After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service [Service] -Type=simple -User=root RemainAfterExit=yes PAMName=login Environment=HOME=/root -ExecStart=/bin/bash /usr/local/bin/vncserver start -ExecStop=/bin/bash /usr/local/bin/vncserver stop +ExecStart=/usr/local/bin/vncserver start +ExecStop=/usr/local/bin/vncserver stop [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - systemctl enable vncserver.service + systemctl enable vncserver cat << _EOF_ > /usr/local/bin/vncserver #!/bin/bash -#Globals +# Globals VNC_INSTALLED=0 BINARY_FP=0 SHARED_MODE=0 -WIDTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=' /DietPi/dietpi.txt | sed 's/^.*=//') -HEIGHT=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=' /DietPi/dietpi.txt | sed 's/^.*=//') -DEPTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=' /DietPi/dietpi.txt | sed 's/^.*=//') -DISPLAY=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=' /DietPi/dietpi.txt | sed 's/^.*=//') -SHARED_MODE=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=' /DietPi/dietpi.txt | sed 's/^.*=//') +WIDTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') +HEIGHT=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') +DEPTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') +DISPLAY=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') +SHARED_MODE=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') -#RealVNC | Slightly different launch method to VNC4server +# RealVNC | Slightly different launch method to VNC4server REALVNC=0 -if (( \$(dpkg --get-selections | grep -ci -m1 '^realvnc-vnc-server') )); then +if dpkg-query -s realvnc-vnc-server &> /dev/null; then REALVNC=1 #Set shared desktop mode if autostart is enabled for desktops. This prevents another VNC server being launched on :1. - if (( \$( /dev/null - killall -w x11vnc &> /dev/null - killall -w Xtigervnc &> /dev/null - ;; + stop) + \$BINARY_FP -kill :\$DISPLAY &> /dev/null + killall -qw x11vnc + killall -qw Xtigervnc + ;; esac @@ -9698,15 +9628,15 @@ _EOF_ # + RealVNC | enable services if (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then - systemctl enable vncserver-x11-serviced.service - systemctl enable vncserver-virtuald.service + systemctl enable vncserver-x11-serviced + systemctl enable vncserver-virtuald fi # - Stretch + TigerVNC: Disable Localhost only by default - if (( $G_DISTRO >= 4 )); then + if (( $G_DISTRO > 3 )); then - echo -e '$localhost = "no";' >> /etc/vnc.conf + echo '$localhost = "no";' >> /etc/vnc.conf fi @@ -9714,34 +9644,34 @@ _EOF_ #VNC4SERVER / RealVNC software_id=28 - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} >= 1 || - ${aSOFTWARE_INSTALL_STATE[120]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} > 0 || + ${aSOFTWARE_INSTALL_STATE[120]} > 0 )); then Banner_Configuration local cmd_launch_desktop='' - #DESKTOP_LXDE - if (( ${aSOFTWARE_INSTALL_STATE[23]} >= 1 )); then + # DESKTOP_LXDE + if (( ${aSOFTWARE_INSTALL_STATE[23]} > 0 )); then cmd_launch_desktop='lxsession -s LXDE &' - #DESKTOP_MATE - elif (( ${aSOFTWARE_INSTALL_STATE[24]} >= 1 )); then + # DESKTOP_MATE + elif (( ${aSOFTWARE_INSTALL_STATE[24]} > 0 )); then cmd_launch_desktop='mate-session &' - #DESKTOP_GNUSTEP - elif (( ${aSOFTWARE_INSTALL_STATE[26]} >= 1 )); then + # DESKTOP_GNUSTEP + elif (( ${aSOFTWARE_INSTALL_STATE[26]} > 0 )); then cmd_launch_desktop='x-window-manager &' - #DESKTOP_XFCE - elif (( ${aSOFTWARE_INSTALL_STATE[25]} >= 1 )); then + # DESKTOP_XFCE + elif (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )); then cmd_launch_desktop='xfce4-session &' - #DESKTOP_LXQT - elif (( ${aSOFTWARE_INSTALL_STATE[173]} >= 1 )); then + # DESKTOP_LXQT + elif (( ${aSOFTWARE_INSTALL_STATE[173]} > 0 )); then cmd_launch_desktop='startlxqt &' @@ -9757,7 +9687,6 @@ xsetroot -solid grey vncconfig -iconic & $cmd_launch_desktop _EOF_ - chmod +x /root/.vnc/xstartup fi @@ -9773,8 +9702,7 @@ _EOF_ fi - #Grafana - software_id=77 + software_id=77 # Grafana if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9815,7 +9743,6 @@ Description=Ubooquity (DietPi) After=dietpi-boot.service network.target [Service] -Type=simple User=ubooquity WorkingDirectory=$G_FP_DIETPI_USERDATA/ubooquity ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --libraryport 2039 @@ -9843,7 +9770,7 @@ _EOF_ Banner_Configuration - #Get test images + # Get test images mkdir -p /var/www/gallery/DietPi wget https://dietpi.com/images/dietpi-logo_256.png -O /var/www/gallery/DietPi/logo_256.png @@ -9852,10 +9779,10 @@ _EOF_ wget https://media.indiedb.com/images/games/1/25/24673/SS_44.jpg -O /var/www/gallery/Tr-Zero/SS_1.jpg wget https://media.indiedb.com/images/games/1/25/24673/3.png -O /var/www/gallery/Tr-Zero/SS_2.jpg - #permissions for cache/thumbnail/database + # Permissions for cache/thumbnail/database mkdir -p /var/www/gallery/_sfpg_data - #enable (Some type of security trigger) + # Enable (Some type of security trigger) sed -i "/define('SECURITY_PHRASE'/c\define('SECURITY_PHRASE', 'true');" /var/www/gallery/index.php fi @@ -9868,14 +9795,14 @@ _EOF_ Download_Test_Media - #create/insert our pre-made ampache sql db + # Create/insert our pre-made ampache sql db Download_Install 'https://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip' /DietPi/dietpi/func/create_mysql_db ampache ampache "$GLOBAL_PW" mysql ampache < ampache.sql rm ampache.sql - #Grab config + # Grab config G_RUN_CMD wget https://dietpi.com/downloads/conf/ampache.cfg.php_3.8.2-v6.0 -O /var/www/ampache/config/ampache.cfg.php fi @@ -10346,7 +10273,6 @@ metadata = socket_msglength = 65000; }; - alsa = { // mixer_control_name = "PCM"; @@ -10369,7 +10295,7 @@ _EOF_ Banner_Configuration # PHP configuration - ${PHP_BINARY}enmod apcu gd intl pdo_mysql + phpenmod apcu gd intl pdo_mysql (( $G_DISTRO > 3 )) && phpenmod dom mbstring xml # Webserver config @@ -10436,7 +10362,6 @@ _EOF_ fi - #SQUEEZELITE software_id=36 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -10795,12 +10720,11 @@ DefaultDependencies=no After=mysqld.service mysql.service mariadb.service [Service] -Type=simple User=gogs Group=gogs WorkingDirectory=/etc/gogs Environment=USER=gogs HOME=/etc/gogs -ExecStart=/etc/gogs/gogs web &> /var/log/gogs/gogs_daemon.log +ExecStart=/bin/dash -c '/etc/gogs/gogs web 2>&1 > /var/log/gogs/gogs_daemon.log' StandardOutput=tty [Install] @@ -10908,7 +10832,6 @@ Description=qBittorrent (DietPi) After=network.target [Service] -Type=simple User=qbittorrent Group=dietpi RemainAfterExit=yes @@ -11054,7 +10977,6 @@ _EOF_ G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v rtorrent)" /etc/systemd/system/rtorrent.service fi - systemctl daemon-reload # - Default conf, do not overwrite if existent # Example: https://github.com/rakshasa/rtorrent/blob/master/doc/rtorrent.rc @@ -11253,7 +11175,6 @@ _EOF_ Description=Aria2 (DietPi) [Service] -Type=simple ExecStart=$(command -v aria2c) --conf-path=/var/lib/dietpi/dietpi-software/installed/aria2.conf [Install] @@ -11296,16 +11217,15 @@ _EOF_ # - Enable filesystem watcher (previously inotify) sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' $G_FP_DIETPI_USERDATA/syncthing/config.xml - #services + # Services cat << _EOF_ > /etc/systemd/system/syncthing.service [Unit] Description=Syncthing (DietPi) After=network.target [Service] -Type=simple -ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$G_FP_DIETPI_USERDATA/syncthing User=dietpi +ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$G_FP_DIETPI_USERDATA/syncthing [Install] WantedBy=multi-user.target @@ -11360,7 +11280,6 @@ _EOF_ Description=Tonido (DietPi) [Service] -Type=simple User=tonido Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/tonido @@ -11391,8 +11310,7 @@ _EOF_ fi - #Chromium - software_id=113 + software_id=113 # Chromium if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11562,11 +11480,10 @@ _EOF_ cat << _EOF_ > /etc/systemd/system/darkice.service [Unit] Description=DarkIce (DietPi) -After=icecast2.service Requires=icecast2.service +After=icecast2.service [Service] -Type=simple ExecStart=$(command -v darkice) [Install] @@ -11588,7 +11505,6 @@ Description=Mosquitto (DietPi) After=network.target [Service] -Type=simple ExecStart=$(command -v mosquitto) -c /etc/mosquitto/mosquitto.conf [Install] @@ -11597,13 +11513,12 @@ _EOF_ fi - #Blynk - software_id=131 + software_id=131 # Blynk if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Preserve existing config + # Preserve existing config if [[ ! -f $G_FP_DIETPI_USERDATA/blynk/server.properties ]]; then local config_file_url_address='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' @@ -11612,17 +11527,16 @@ _EOF_ fi - # - User + # User useradd -rM blynk -G dietpi -s /usr/sbin/nologin - # - Service + # Service cat << _EOF_ > /etc/systemd/system/blynkserver.service [Unit] Description=Blynk Server (DietPi) After=network.target [Service] -Type=simple User=blynk Group=dietpi ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar -serverConfig $G_FP_DIETPI_USERDATA/blynk/server.properties @@ -11639,7 +11553,7 @@ _EOF_ Banner_Configuration - #Enable RPi cam + # Enable RPi cam if (( $G_HW_MODEL < 10 )); then /DietPi/dietpi/func/dietpi-set_hardware rpi-camera enable @@ -11653,7 +11567,7 @@ _EOF_ mkdir -p $G_FP_DIETPI_USERDATA/motioneye sed -i "/^media_path/c\media_path $G_FP_DIETPI_USERDATA/motioneye" /etc/motioneye/motioneye.conf - # service + # Service cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service fi @@ -11664,7 +11578,7 @@ _EOF_ Banner_Configuration - # - Enable web admin + # Enable web admin G_RUN_CMD systemctl start cups cupsctl --remote-admin usermod -a -G lpadmin root @@ -11672,8 +11586,7 @@ _EOF_ fi - #VirtualHere - software_id=138 + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11684,21 +11597,17 @@ Description=VirtualHere (DietPi) After=local-fs.target [Service] -Type=simple - ExecStart=/etc/vhusbd/vhusbd -r /var/log/virtualhere.log [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - echo -e "ServerName='DietPi'" > /etc/vhusbd/config.ini + echo "ServerName='DietPi'" > /etc/vhusbd/config.ini fi - #SABnzbd - software_id=139 + software_id=139 # SABnzbd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11711,7 +11620,6 @@ Description=sabnzbd (DietPi) [Service] User=sabnzbd Group=dietpi -Type=simple ExecStart=$(command -v python) /etc/sabnzbd/SABnzbd.py -f /etc/sabnzbd/sabnzbd.ini [Install] @@ -11723,7 +11631,7 @@ _EOF_ chown -R sabnzbd:dietpi /etc/sabnzbd chown -R sabnzbd:dietpi /var/log/sabnzbd - #Create config: + # Create config: # API keys and intial config are only generated during 1st run of sabnzbd # We need to launch program, then apply our config tweaks, else, wizard setup in web interface simply loops without API keys. rm /etc/sabnzbd/sabnzbd.ini &> /dev/null @@ -11773,7 +11681,6 @@ Description=spotify-connect-web (DietPi) After=sound.target [Service] -Type=simple WorkingDirectory=$G_FP_DIETPI_USERDATA/spotify-connect-web ExecStart=$G_FP_DIETPI_USERDATA/spotify-connect-web/spotify-connect-web @@ -11836,7 +11743,6 @@ _EOF_ Description=Koel (DietPi) [Service] -Type=simple User=koel Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/koel @@ -11866,7 +11772,6 @@ After=network.target [Service] User=sonarr Group=dietpi -Type=simple ExecStart=/usr/bin/mono -O=-aot /opt/NzbDrone/NzbDrone.exe -nobrowser -data=$G_FP_DIETPI_USERDATA/sonarr [Install] @@ -11901,7 +11806,6 @@ After=network.target [Service] User=radarr Group=dietpi -Type=simple ExecStart=/usr/bin/mono -O=-aot /opt/Radarr/Radarr.exe -nobrowser -data=$G_FP_DIETPI_USERDATA/radarr [Install] @@ -11936,7 +11840,6 @@ After=network.target [Service] User=lidarr Group=dietpi -Type=simple ExecStart=/usr/bin/mono -O=-aot /opt/Lidarr/Lidarr.exe -nobrowser -data=$G_FP_DIETPI_USERDATA/lidarr [Install] @@ -12000,7 +11903,6 @@ WorkingDirectory=/opt/jackett Environment=USER=jackett HOME=/opt/jackett Restart=always RestartSec=5 -Type=simple ExecStart=/usr/bin/mono -O=-aot /opt/jackett/JackettConsole.exe TimeoutStopSec=20 @@ -12061,8 +11963,7 @@ _EOF_ fi - #HTPC Manager - software_id=155 + software_id=155 # HTPC Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12073,7 +11974,6 @@ Description=HTPC Manager (DietPi) After=network.target [Service] -Type=simple ExecStart=/usr/bin/python $G_FP_DIETPI_USERDATA/htpc-manager/Htpc.py [Install] @@ -12093,7 +11993,6 @@ _EOF_ Description=OctoPrint (DietPi) [Service] -Type=simple ExecStart=$(command -v octoprint) serve --iknowwhatimdoing [Install] @@ -12114,7 +12013,6 @@ Description=Roon Server (DietPi) After=network.target [Service] -Type=simple Environment=ROON_DATAROOT=$G_FP_DIETPI_USERDATA/roonserver ExecStart=$G_FP_DIETPI_USERDATA/roonserver/start.sh @@ -12150,7 +12048,6 @@ Description=Home Assistant (DietPi) After=network.target [Service] -Type=simple User=homeassistant ExecStart=/srv/homeassistant/homeassistant-start.sh @@ -12197,7 +12094,7 @@ _EOF_ Banner_Configuration - #Set docker service to 'simple': https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 + # Set docker service to 'simple': https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 mkdir -p /lib/systemd/system/docker.service.d echo -e '[Service]\nType=simple' > /lib/systemd/system/docker.service.d/dietpi-simple.conf @@ -12298,7 +12195,6 @@ _EOF_ fi - #Allo Config software_id=159 # 160 for quick reinstall/update if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || @@ -12308,19 +12204,19 @@ _EOF_ #Create allo user for GUI useradd -m allo -s /bin/bash -G www-data - chpasswd <<< "allo:allo" - echo -e "allo ALL=NOPASSWD: ALL" > /etc/sudoers.d/allo + chpasswd <<< 'allo:allo' + echo 'allo ALL=NOPASSWD: ALL' > /etc/sudoers.d/allo #Always Drop DB, and, recreate it, due to error issue with reinstall over the top. mysqladmin drop allo_db -f &> /dev/null - mysql -e "drop user allo_db@localhost" &> /dev/null + mysql -e 'drop user allo_db@localhost' &> /dev/null /DietPi/dietpi/func/create_mysql_db allo_db allo_db "$GLOBAL_PW" mysql allo_db < /var/www/allo_db.sql - rm /var/www/allo_db.sql + [[ -f /var/www/allo_db.sql ]] && rm /var/www/allo_db.sql # - Redirect to web interface by default: - rm /var/www/index.htm* + rm -f /var/www/index.htm* cat << _EOF_ > /var/www/index.php _EOF_ - #HW specific changes + # HW specific changes # - SPARKY ONLY - Auto detect eth adapter if (( $G_HW_MODEL == 70 )); then @@ -12343,15 +12239,14 @@ Description=Sparky auto detect and set onboard ETH/USB ETH (DietPi) After=network.target networking.service [Service] -Type=simple RemainAfterExit=yes -ExecStart=/bin/bash -c '/usr/local/bin/sparky_eth_controller.sh' +ExecStart=/usr/local/bin/sparky_eth_controller.sh [Install] WantedBy=multi-user.target _EOF_ systemctl daemon-reload - systemctl enable sparky_eth_controller.service + systemctl enable sparky_eth_controller cat << _EOF_ > /usr/local/bin/sparky_eth_controller.sh #!/bin/bash @@ -12360,22 +12255,19 @@ sleep 20 # - Set USB ETH if found if ip a | grep -qi 'eth1'; then - echo -e "blacklist ethernet" > /etc/modprobe.d/disable_sparkysbc_ethernet.conf - rm /etc/udev/rules.d/70-persistent-net.rules &> /dev/null - rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null + echo 'blacklist ethernet' > /etc/modprobe.d/disable_sparkysbc_ethernet.conf + rm -f /etc/udev/rules.d/70-persist{a,e}nt-net.rules reboot # - Enable onboard ETH if no adapter found elif ! ip a | grep -qi 'eth0'; then - rm /etc/modprobe.d/disable_sparkysbc_ethernet.conf &> /dev/null - rm /etc/udev/rules.d/70-persistent-net.rules &> /dev/null - rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null + [[ -f '/etc/modprobe.d/disable_sparkysbc_ethernet.conf' ]] && rm /etc/modprobe.d/disable_sparkysbc_ethernet.conf + rm -f /etc/udev/rules.d/70-persist{a,e}nt-net.rules reboot fi _EOF_ - chmod +x /usr/local/bin/sparky_eth_controller.sh fi @@ -12432,11 +12324,11 @@ PATH+=':$HOME/wiringPi/gpio' TICKRATE=0.25 -echo -e "Audiophonics Shutdown script starting..." -echo -e "Asserting pins : " -echo -e "ShutDown : GPIO17=in, Low" -echo -e "BootOK : GPIO22=out, High" -echo -e "SoftSD : GPIO04=out, Low" +echo 'Audiophonics Shutdown script starting... +Asserting pins : +ShutDown : GPIO17=in, Low +BootOK : GPIO22=out, High +SoftSD : GPIO04=out, Low' gpio -g mode 04 out gpio -g write 04 0 @@ -12450,7 +12342,7 @@ do if (( \$(gpio -g read 17) == 1 )); then - G_DIETPI-NOTIFY 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." + G_DIETPI-NOTIFY 0 'AudioPhonics Pi-SPC: Power off requested. Shutting down system.' sudo poweroff #sudo shutdown -h -P now break @@ -12463,7 +12355,6 @@ done exit 0 _EOF_ - chmod +x /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh cat << _EOF_ > /etc/systemd/system/pi-spc.service @@ -12471,17 +12362,15 @@ _EOF_ Description=AudioPhonics Pi-SPC (DietPi) [Service] -Type=simple StandardOutput=tty - -ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh' +ExecStart=/var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh [Install] WantedBy=multi-user.target _EOF_ - # G_CONFIG_INJECT 'dtoverlay=gpio-shutdown' 'dtoverlay=gpio-shutdown,gpio_pin=22,active_low=0' /DietPi/config.txt - # G_CONFIG_INJECT 'dtoverlay=gpio-poweroff' 'dtoverlay=gpio-poweroff,gpio_pin=17' /DietPi/config.txt + #G_CONFIG_INJECT 'dtoverlay=gpio-shutdown' 'dtoverlay=gpio-shutdown,gpio_pin=22,active_low=0' /DietPi/config.txt + #G_CONFIG_INJECT 'dtoverlay=gpio-poweroff' 'dtoverlay=gpio-poweroff,gpio_pin=17' /DietPi/config.txt fi @@ -12497,7 +12386,7 @@ _EOF_ # - Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer - #Setup soundcard + # Setup soundcard /DietPi/dietpi/func/dietpi-set_hardware soundcard googlevoicehat-soundcard fi @@ -12584,14 +12473,6 @@ _EOF_ fi - #Roon Extension Manager - software_id=86 - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - fi - #------------------------------------------------------------------ } @@ -12601,7 +12482,7 @@ _EOF_ local gpu_enabled=0 local gpu_memory=0 - #Define Memory Split Modes with installed software + # Define Memory Split Modes with installed software local hw_memory_size=$(cat /DietPi/dietpi/.hw_model | grep -m1 'HW_MEMORY_SIZE=' | sed 's/^[^=]*=//') # - Kodi @@ -12642,7 +12523,7 @@ _EOF_ fi - #Apply + # Apply if (( $gpu_memory > 0 && $G_HW_MODEL < 10 )); then # - Never override a higher existing value @@ -12657,7 +12538,7 @@ _EOF_ fi - #Disable headless/enable GPU's + # Disable headless/enable GPU's (( $gpu_enabled )) && /DietPi/dietpi/func/dietpi-set_hardware headless 0 } @@ -12668,7 +12549,7 @@ _EOF_ FP_DIETPI_DEDICATED_USBDRIVE=$(df -P | mawk '/^\/dev\/sda1/ {print $6;exit}') - #Only enable if mounted + # Only enable if mounted if [[ $FP_DIETPI_DEDICATED_USBDRIVE ]] && df -P | grep -qi "$FP_DIETPI_DEDICATED_USBDRIVE"; then @@ -12680,7 +12561,7 @@ _EOF_ Uninstall_Software(){ - #NB: systemctl daemon-reload is executed at the end of this function + # NB: systemctl daemon-reload is executed at the end of this function local software_id=-1 @@ -12709,7 +12590,6 @@ _EOF_ software_id=174 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - Banner_Uninstalling G_AGP gimp @@ -12718,7 +12598,6 @@ _EOF_ software_id=175 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - Banner_Uninstalling G_AGP xfce4-power-manager @@ -12791,6 +12670,9 @@ _EOF_ Banner_Uninstalling # Remove background cron job crontab -u www-data -l | grep -v '/var/www/owncloud/cron.php' | crontab -u www-data - + # Disable and remove PHP modules + phpdismod dietpi-owncloud &> /dev/null + rm -f /etc/php/*/mods-available/dietpi-owncloud.ini # Disable and remove webserver configs a2dissite dietpi-owncloud 2> /dev/null rm /etc/apache2/sites-available/dietpi-owncloud.conf 2> /dev/null @@ -12829,13 +12711,13 @@ _EOF_ fi - software_id=168 # Nextcloud Talk + TURN server "coturn" + software_id=168 # Nextcloud Talk + coTURN server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP coturn - [[ -f /etc/turnserver.conf ]] && rm /etc/turnserver.conf - [[ -d /etc/systemd/system/coturn.service.d ]] && rm -R /etc/systemd/system/coturn.service.d + [[ -f '/etc/turnserver.conf' ]] && rm /etc/turnserver.conf + [[ -d '/etc/systemd/system/coturn.service.d' ]] && rm -R /etc/systemd/system/coturn.service.d systemctl start $MARIADB_SERVICE systemctl start redis-server ncc maintenance:mode --off @@ -12849,6 +12731,9 @@ _EOF_ Banner_Uninstalling crontab -u www-data -l | grep -v '/var/www/nextcloud/cron.php' | crontab -u www-data - + # Disable and remove PHP modules + phpdismod dietpi-nextcloud &> /dev/null + rm -f /etc/php/*/mods-available/dietpi-nextcloud.ini # Disable and remove webserver configs a2dissite dietpi-nextcloud 2> /dev/null rm /etc/apache2/sites-available/dietpi-nextcloud.conf 2> /dev/null @@ -12922,7 +12807,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP sqlite3 + G_AGP sqlite3 php*-sqlite3 fi @@ -12930,22 +12815,22 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP "$PHP_BINARY"-redis redis-server redis-tools + G_AGP redis-server redis-tools php*-redis + [[ -d '/etc/systemd/system/redis-server.service.d' ]] && rm -R /etc/systemd/system/redis-server.service.d # Jessie permissions fix fi - software_id=89 + software_id=89 # PHP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm $FP_PHP_BASE_DIR/fpm/pool.d/www.conf 2> /dev/null - rm $FP_PHP_BASE_DIR/mods-available/dietpi.ini 2> /dev/null - G_AGP $(dpkg --get-selections | grep -E '(php[0-9]?\.?[0-9]?-*|libapache2-mod-php*)' | mawk '{print $1}') - rm /var/www/phpinfo.php - rm /var/www/apc.php - rm /var/www/opcache.php + G_AGP $(dpkg --get-selections | grep -E '^(php[0-9.]*-|libapache2-mod-php)' | mawk '{print $1}') + [[ -d '/etc/php' ]] && rm -R /etc/php + [[ -f '/var/www/phpinfo.php' ]] && rm /var/www/phpinfo.php + [[ -f '/var/www/apc.php' ]] && rm /var/www/apc.php + [[ -f '/var/www/opcache.php' ]] && rm /var/www/opcache.php # temp php uploads, if it was created - rm -R /var/tmp/php_upload_tmp 2> /dev/null + [[ -d '/var/tmp/php_upload_tmp' ]] && rm -R /var/tmp/php_upload_tmp fi @@ -12967,7 +12852,7 @@ _EOF_ systemctl start $MARIADB_SERVICE mysqladmin drop phpbb3 -f mysql -e "drop user 'phpbb3'@'localhost'" - rm -R /var/www/phpBB3 + [[ -d '/var/www/phpBB3' ]] && rm -R /var/www/phpBB3 fi @@ -13374,7 +13259,6 @@ _EOF_ fi - software_id=121 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -13828,7 +13712,6 @@ _EOF_ Banner_Uninstalling G_AGP i2c-tools - #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable fi @@ -13903,10 +13786,10 @@ _EOF_ Banner_Uninstalling #apt-mark auto libssl1.0.0 openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 &> /dev/null - # No package is installed anymore, files are directly extracted into places, need to remove them manually? + # No package is installed any more, files are directly extracted into places, need to remove them manually? # https://github.com/MichaIng/DietPi/blob/testing/dietpi/dietpi-software#L5968 #G_AGP shairport-sync - rm /lib/systemd/system/shairport-sync.service /usr/local/bin/shairport-sync /usr/local/etc/shairport-sync.conf* /usr/local/share/man/man7/shairport-sync.7.gz &> /dev/null + rm -f /lib/systemd/system/shairport-sync.service /usr/local/bin/shairport-sync /usr/local/etc/shairport-sync.conf* /usr/local/share/man/man7/shairport-sync.7.gz userdel -rf shairport-sync fi @@ -14391,7 +14274,7 @@ _EOF_ # On Jessie, purging MariaDB server with unix_socket authentication fails, thus revert to password: (( $G_DISTRO < 4 )) && mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by '$GLOBAL_PW' with grant option;flush privileges" systemctl stop $MARIADB_SERVICE - G_AGP mariadb-server + G_AGP mariadb-server php*-mysql # - config folder rm -R /etc/mysql 2> /dev/null @@ -14409,7 +14292,7 @@ _EOF_ Banner_Uninstalling G_AGP influxdb - rm /etc/apt/sources.list.d/influxdb.list && G_AGUP + rm /etc/apt/sources.list.d/influxdb.list rm -R /var/lib/influxdb rm -R $G_FP_DIETPI_USERDATA/influxdb @@ -14458,7 +14341,6 @@ _EOF_ fi - #---------------------------------------------------------------------- #LINUX SOFTWARE @@ -14558,9 +14440,9 @@ _EOF_ Banner_Uninstalling umount -f /mnt/samba G_AGP smbclient - #Disable in fstab + # Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-drive_manager to setup this mount' /etc/fstab - #Add info file for installation method. + # Add info file for installation method. echo -e 'Samba client can be installed and setup by DietPi-Drive_Manager.\nSimply run: dietpi-drive_manager and select the "Add network drive" option.' > /mnt/samba/readme.txt fi @@ -14596,10 +14478,10 @@ _EOF_ fi - #Disable in fstab + # Disable in fstab sed -i '/\/mnt\/nfs_client/c\#\/mnt\/nfs_client . Please use DietPi-Drive_Manager to setup this mount' /etc/fstab - #Add info file for installation method. + # Add info file for installation method. echo -e 'NFS client can be installed and setup by DietPi-Drive_Manager.\nSimply run: dietpi-drive_manager and select the "Add network drive" option.' > /mnt/nfs_client/readme.txt fi @@ -14696,7 +14578,7 @@ Before=dietpi-preboot.service rsyslog.service syslog.service [Service] Type=oneshot StandardOutput=tty -ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-ramlog/disable.sh &> /var/tmp/dietpi/logs/dietpi-ramlog_disable_debug.log' +ExecStart=/bin/dash -c '/var/lib/dietpi/dietpi-ramlog/disable.sh 2>&1 > /var/tmp/dietpi/logs/dietpi-ramlog_disable_debug.log' [Install] WantedBy=local-fs.target @@ -14744,12 +14626,7 @@ _EOF_ G_AGP nodejs # - old install via repo - if [[ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]]; then - - rm /etc/apt/sources.list.d/nodesource_nodejs.list - G_AGUP - - fi + [[ -f '/etc/apt/sources.list.d/nodesource_nodejs.list' ]] && rm /etc/apt/sources.list.d/nodesource_nodejs.list [[ -f /usr/local/bin/node ]] && rm /usr/local/bin/node [[ -d /usr/local/n ]] && rm -R /usr/local/n @@ -15020,7 +14897,7 @@ _EOF_ FirstRun_Automation_Init(){ - #Get settings + # Get settings AUTOINSTALL_ENABLED=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_AUTOMATED=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') AUTOINSTALL_AUTOSTARTTARGET=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_AUTOSTART_TARGET_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//' ) AUTOINSTALL_SSHINDEX=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SSH_SERVER_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -15038,13 +14915,13 @@ _EOF_ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Running automated installation' - #Skip dietpi-software menu + # Skip dietpi-software menu TARGETMENUID=-1 - #Set start install + # Set start install GOSTARTINSTALL=1 - #Find all software entries of AUTO_SETUP_INSTALL_SOFTWARE_ID= in dietpi.txt. Then set to state 1 for installation. + # 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 @@ -15061,13 +14938,13 @@ _EOF_ fi - #Further Automated options. (Applied regardless of AUTOINSTALL_ENABLED) + # Further Automated options. (Applied regardless of AUTOINSTALL_ENABLED) INDEX_SSHSERVER_TARGET=$AUTOINSTALL_SSHINDEX INDEX_FILESERVER_TARGET=$AUTOINSTALL_FILESERVERINDEX INDEX_LOGGING_TARGET=$AUTOINSTALL_LOGGINGINDEX INDEX_WEBSERVER_TARGET=$AUTOINSTALL_WEBSERVERINDEX - #Re-flag RAMlog for install, if enabled, ensures AUTO_SETUP_RAMLOG_MAXSIZE gets applied + # Re-flag RAMlog for install, if enabled, ensures AUTO_SETUP_RAMLOG_MAXSIZE gets applied if (( $INDEX_LOGGING_TARGET == -1 || $INDEX_LOGGING_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[103]=1 @@ -15089,7 +14966,7 @@ _EOF_ local input=$@ input=${input#*[[:blank:]]} - #Install software and exit. + # Install software and exit. if [[ $1 == 'install' || $1 == 'reinstall' || $1 == 'uninstall' ]]; then G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Automated $1" @@ -16105,7 +15982,6 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p G_WHIP_MSG "Error: Incompatible Webserver Preference:\n\nUnable to change your webserver preference to $G_WHIP_RETURNED_VALUE.\n This is due to an existing and incompatible webserver installation on your system ($info_currently_installed_webserver). Please remove all webserver based software (using dietpi-software > uninstall), before trying again." - # - Apply preference selection else diff --git a/dietpi/patch_file b/dietpi/patch_file index 55276497ac..b78be9b3f1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -105,7 +105,7 @@ #------------------------------------------------------------------------------- #Asus TB G_HW_MODEL change - if [[ -f /etc/.dietpi_hw_model_identifier && $(sed -n 1p /etc/.dietpi_hw_model_identifier) == 100 ]]; then + if [[ -f '/etc/.dietpi_hw_model_identifier' && $(sed -n 1p /etc/.dietpi_hw_model_identifier) == 100 ]]; then G_HW_MODEL=52 echo $G_HW_MODEL > /etc/.dietpi_hw_model_identifier @@ -119,12 +119,12 @@ sed -i '/#DietPi Additions/Q' /etc/bash.bashrc #------------------------------------------------------------------------------- #Fix doubled and renamed config files: https://github.com/MichaIng/DietPi/commit/68148cec6b49afc787deca638456e1c4689e1cab#diff-8370b86e635383d521462994afe04a2d - [[ -f /etc/apt/apt.conf.d/99force-ipv ]] && rm /etc/apt/apt.conf.d/99force-ipv - [[ -f /etc/sysctl.d/97-dietpi.conf ]] && rm /etc/sysctl.d/97-dietpi.conf + [[ -f '/etc/apt/apt.conf.d/99force-ipv' ]] && rm /etc/apt/apt.conf.d/99force-ipv + [[ -f '/etc/sysctl.d/97-dietpi.conf' ]] && rm /etc/sysctl.d/97-dietpi.conf #------------------------------------------------------------------------------- #Core_ENV update: https://github.com/MichaIng/DietPi/pull/1419 # - consoleblank disable x86_64 - if [[ -f /etc/default/grub ]]; then + if [[ -f '/etc/default/grub' ]]; then G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX_DEFAULT=' 'GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0 quiet"' /etc/default/grub G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX=' 'GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub @@ -151,7 +151,7 @@ #------------------------------------------------------------------------------- #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' ]] && mv /etc/environment /mnt/dietpi_userdata/environment.bak > /etc/environment /DietPi/dietpi/func/dietpi-set_software locale en_GB.UTF-8 @@ -163,7 +163,7 @@ systemctl enable openvpn &> /dev/null; systemctl start openvpn &> /dev/null #------------------------------------------------------------------------------- #https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10646 - [[ -f /etc/apt/sources.list.d/openmediavault.list ]] && rm /etc/apt/sources.list.d/openmediavault.list + [[ -f '/etc/apt/sources.list.d/openmediavault.list' ]] && rm /etc/apt/sources.list.d/openmediavault.list #------------------------------------------------------------------------------- #DietPi-Software removals: https://github.com/MichaIng/DietPi/issues/1491 if [[ -f /DietPi/dietpi/.installed ]]; then @@ -180,7 +180,7 @@ fi #------------------------------------------------------------------------------- #Nodered lacks homedir, create it: https://github.com/MichaIng/DietPi/issues/1446#issuecomment-366370800 - if getent passwd nodered &> /dev/null && [[ ! -d /home/nodered ]]; then + if getent passwd nodered &> /dev/null && [[ ! -d '/home/nodered' ]]; then mkdir -p /home/nodered chown -R nodered:nodered /home/nodered @@ -196,7 +196,7 @@ #------------------------------------------------------------------------------- #Switch from rc.local to own postboot script: https://github.com/MichaIng/DietPi/issues/1376 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.' - [[ -f /etc/rc.local ]] && mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak + [[ -f '/etc/rc.local' ]] && mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak cat << _EOF_ > /etc/rc.local #!/bin/sh -e # @@ -219,7 +219,7 @@ _EOF_ if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[168\]=2' /DietPi/dietpi/.installed; then - [[ -d /var/lib/dietpi/postboot.d ]] || mkdir /var/lib/dietpi/postboot.d + [[ -d '/var/lib/dietpi/postboot.d' ]] || mkdir /var/lib/dietpi/postboot.d cat << _EOF_ > /var/lib/dietpi/postboot.d/moode #!/bin/bash #moOde additions @@ -271,7 +271,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Add certificate combining for Lighttpd to CertBot auto renewal: https://github.com/MichaIng/DietPi/pull/1553 - if [[ -f /DietPi/dietpi/.dietpi-letsencrypt ]]; then + if [[ -f '/DietPi/dietpi/.dietpi-letsencrypt' ]]; then # - Switch Minio to new certbot.service.d/ hook: if (( $G_DISTRO > 3 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[158\]=2' /DietPi/dietpi/.installed; then @@ -358,7 +358,7 @@ _EOF_ sed -i '/[[:space:]]dphys-swapfile[[:space:]]/d' /etc/fstab local swap_size=0 local swap_location='/var/swap' - if [[ -f /etc/dphys-swapfile ]]; then + if [[ -f '/etc/dphys-swapfile' ]]; then swap_size=$(grep -m1 '^[[:blank:]]*CONF_SWAPSIZE=' /etc/dphys-swapfile | sed 's/^[^=]*=//') swap_location=$(grep -m1 '^[[:blank:]]*CONF_SWAPFILE=' /etc/dphys-swapfile | sed 's/^[^=]*=//') @@ -402,10 +402,10 @@ _EOF_ sed -i '/dietpi/d' /etc/sudoers #Our config must not start with '99-' to assure priority higher than '99-sysctl.conf' # - New config is installed automatically via v6.9 update system. - [[ -f /etc/sysctl.d/99-dietpi.conf ]] && rm /etc/sysctl.d/99-dietpi.conf + [[ -f '/etc/sysctl.d/99-dietpi.conf' ]] && rm /etc/sysctl.d/99-dietpi.conf #------------------------------------------------------------------------------- # - RPi resolve gettext error: https://github.com/MichaIng/DietPi/issues/1631#issuecomment-373965406 - [[ -f /etc/profile.d/wifi-country.sh ]] && rm /etc/profile.d/wifi-country.sh + [[ -f '/etc/profile.d/wifi-country.sh' ]] && rm /etc/profile.d/wifi-country.sh #------------------------------------------------------------------------------- elif (( $G_DIETPI_VERSION_SUB == 5 )); then @@ -426,8 +426,8 @@ _EOF_ #Add Dropbear ecdsa and dss host keys, if missing: https://github.com/MichaIng/DietPi/issues/1670 if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[104\]=2' /DietPi/dietpi/.installed; then - [[ -f /etc/dropbear/dropbear_ecdsa_host_key ]] || dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key &> /dev/null - [[ -f /etc/dropbear/dropbear_dss_host_key ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key &> /dev/null + [[ -f '/etc/dropbear/dropbear_ecdsa_host_key' ]] || dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key &> /dev/null + [[ -f '/etc/dropbear/dropbear_dss_host_key' ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key &> /dev/null fi #------------------------------------------------------------------------------- @@ -460,7 +460,7 @@ _EOF_ #Deluge systemd service update: https://github.com/MichaIng/DietPi/issues/1658 # + Service fix for in v6.6 https://github.com/MichaIng/DietPi/issues/1689#issuecomment-379024795 # => Fixed with reinstall on v6.21 => v6.22 - [[ -f /var/lib/dietpi/dietpi-software/services/deluge.service ]] && rm /var/lib/dietpi/dietpi-software/services/deluge.service + [[ -f '/var/lib/dietpi/dietpi-software/services/deluge.service' ]] && rm /var/lib/dietpi/dietpi-software/services/deluge.service #------------------------------------------------------------------------------- elif (( $G_DIETPI_VERSION_SUB == 7 )); then @@ -528,7 +528,7 @@ _EOF_ rm -f /etc/profile.d/99-dietpi* # - Enable bash-completion for non-login shells: # - NB: It is called twice on login shells then, but breaks directly if called already once. - [[ -f /etc/profile.d/bash_completion.sh ]] && ln -sf /etc/profile.d/bash_completion.sh /etc/bashrc.d/dietpi-bash_completion.sh + [[ -f '/etc/profile.d/bash_completion.sh' ]] && ln -sf /etc/profile.d/bash_completion.sh /etc/bashrc.d/dietpi-bash_completion.sh #------------------------------------------------------------------------------- #Sparky unmute fix (re: @sudeep) # v2: https://github.com/MichaIng/DietPi/pull/1779 @@ -598,7 +598,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Fix Apache2 logging to "/error.log" instead of "/var/log/apache2/error.log": https://github.com/MichaIng/DietPi/commit/c991bd7dc579dbdc7c239e4c887b0962fa204006 - if [[ -d /etc/apache2/sites-available ]]; then + if [[ -d '/etc/apache2/sites-available' ]]; then for vhost in /etc/apache2/sites-available/*.conf do @@ -610,7 +610,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Disable "initial_turbo" option for RPi within config.txt, as it currently prevents CPU throttle down: https://github.com/MichaIng/DietPi/issues/1836 - if [[ -f /DietPi/config.txt ]] && grep -q '^[[:blank:]]*initial_turbo' /DietPi/config.txt; then + if [[ -f '/DietPi/config.txt' ]] && grep -q '^[[:blank:]]*initial_turbo' /DietPi/config.txt; then sed -i '/^[[:blank:]]*initial_turbo/d' /DietPi/config.txt echo -e '\n# Initial turbo currently leads to CPU not being throttled down by CPU governor: https://github.com/MichaIng/DietPi/issues/1836\n#initial_turbo=20' >> /DietPi/config.txt @@ -930,7 +930,7 @@ _EOF_ (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 146 #------------------------------------------------------------------------------- #Update DietPi-Sync save file to new format - if [[ -f /DietPi/dietpi/.dietpi-sync_settings ]] && ! grep -q '^FP_SOURCE=' /DietPi/dietpi/.dietpi-sync_settings; then + if [[ -f '/DietPi/dietpi/.dietpi-sync_settings' ]] && ! grep -q '^FP_SOURCE=' /DietPi/dietpi/.dietpi-sync_settings; then cp /DietPi/dietpi/.dietpi-sync_settings /DietPi/dietpi/.dietpi-sync_settings_bk cat << _EOF_ > /DietPi/dietpi/.dietpi-sync_settings @@ -950,7 +950,7 @@ _EOF_ #------------------------------------------------------------------------------- #Move to new WiFi cred array system and db store: https://github.com/MichaIng/DietPi/issues/368 - if [[ ! -f /var/lib/dietpi/dietpi-wifi.db ]]; then + if [[ ! -f '/var/lib/dietpi/dietpi-wifi.db' ]]; then cat << _EOF_ > /var/lib/dietpi/dietpi-wifi.db aWIFI_SSID[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_SSID=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')' @@ -1154,7 +1154,7 @@ _EOF_ #------------------------------------------------------------------------------- # - Remove mysql.service as we use mariadb.service, both cannot exist: https://github.com/MichaIng/DietPi/issues/1913#issuecomment-441343798 - if [[ -f /etc/init.d/mysql ]] && (( $G_DISTRO >= 4 )); then + if [[ -f '/etc/init.d/mysql' ]] && (( $G_DISTRO >= 4 )); then G_DIETPI-NOTIFY 2 'Switching from /etc/init.d/mysql to mariadb.service' @@ -1215,19 +1215,19 @@ You will not face any practical differences, since both services start the same #------------------------------------------------------------------------------- #conf renaming: https://github.com/MichaIng/DietPi/pull/2312/files # - Apache - if [[ -f /etc/apache2/sites-available/owncloud.conf ]]; then + if [[ -f '/etc/apache2/sites-available/owncloud.conf' ]]; then a2dissite owncloud mv /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-available/dietpi-owncloud.conf fi - if [[ -f /etc/apache2/sites-available/nextcloud.conf ]]; then + if [[ -f '/etc/apache2/sites-available/nextcloud.conf' ]]; then a2dissite nextcloud mv /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-available/dietpi-nextcloud.conf fi - if [[ -f /etc/apache2/sites-available/rutorrent.conf ]]; then + if [[ -f '/etc/apache2/sites-available/rutorrent.conf' ]]; then a2dissite rutorrent mv /etc/apache2/sites-available/rutorrent.conf /etc/apache2/sites-available/dietpi-rutorrent.conf @@ -1235,9 +1235,9 @@ You will not face any practical differences, since both services start the same fi # - Nginx - [[ -f /etc/nginx/sites-dietpi/owncloud.config ]] && mv /etc/nginx/sites-dietpi/owncloud.config /etc/nginx/sites-dietpi/dietpi-owncloud.conf - [[ -f /etc/nginx/sites-dietpi/nextcloud.config ]] && mv /etc/nginx/sites-dietpi/nextcloud.config /etc/nginx/sites-dietpi/dietpi-nextcloud.conf - [[ -f /etc/nginx/sites-dietpi/rutorrent.config ]] && mv /etc/nginx/sites-dietpi/rutorrent.config /etc/nginx/sites-dietpi/dietpi-rutorrent.conf + [[ -f '/etc/nginx/sites-dietpi/owncloud.config' ]] && mv /etc/nginx/sites-dietpi/owncloud.config /etc/nginx/sites-dietpi/dietpi-owncloud.conf + [[ -f '/etc/nginx/sites-dietpi/nextcloud.config' ]] && mv /etc/nginx/sites-dietpi/nextcloud.config /etc/nginx/sites-dietpi/dietpi-nextcloud.conf + [[ -f '/etc/nginx/sites-dietpi/rutorrent.config' ]] && mv /etc/nginx/sites-dietpi/rutorrent.config /etc/nginx/sites-dietpi/dietpi-rutorrent.conf # - Failsafe and custom entries for i in /etc/nginx/sites-dietpi/*.config do @@ -1277,7 +1277,7 @@ You will not face any practical differences, since both services start the same #------------------------------------------------------------------------------- #PB, fix kernel upgrades, switch from dev to stable and enable auto upgrades. - if (( $G_HW_MODEL == 44 )) && [[ ! -f /etc/armbian-release ]]; then + if (( $G_HW_MODEL == 44 )) && [[ ! -f '/etc/armbian-release' ]]; then cat << _EOF_ > /etc/armbian-release # PLEASE DO NOT EDIT THIS FILE @@ -1377,24 +1377,24 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix #------------------------------------------------------------------------------- #DietPi file renaming/removal: # - autologin.conf: https://github.com/MichaIng/DietPi/pull/2343 - [[ -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ]] && mv /etc/systemd/system/getty@tty1.service.d/autologin.conf /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf + [[ -f '/etc/systemd/system/getty@tty1.service.d/autologin.conf' ]] && mv /etc/systemd/system/getty@tty1.service.d/autologin.conf /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf # - README.md: https://github.com/MichaIng/DietPi/pull/2341 - [[ -f /boot/README.md ]] && mv /boot/README.md /boot/dietpi-README.md + [[ -f '/boot/README.md' ]] && mv /boot/README.md /boot/dietpi-README.md # - kill-ssh-user-sessions-before-network: https://github.com/MichaIng/DietPi/pull/2357/commits/c8eb15c169cfaba69fec0b3e631e2241e0bdb7d5 systemctl disable kill-ssh-user-sessions-before-network 2> /dev/null - [[ -f /etc/systemd/system/kill-ssh-user-sessions-before-network.service ]] && rm /etc/systemd/system/kill-ssh-user-sessions-before-network.service - [[ -f /var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh ]] && rm /var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh + [[ -f '/etc/systemd/system/kill-ssh-user-sessions-before-network.service' ]] && rm /etc/systemd/system/kill-ssh-user-sessions-before-network.service + [[ -f '/var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh' ]] && rm /var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh systemctl daemon-reload systemctl enable dietpi-kill_ssh # - dietpi-unsupported_terminal.sh: https://github.com/MichaIng/DietPi/issues/2347 - [[ -f /etc/profile.d/dietpi-unsupported_terminal.sh ]] && rm /etc/profile.d/dietpi-unsupported_terminal.sh + [[ -f '/etc/profile.d/dietpi-unsupported_terminal.sh' ]] && rm /etc/profile.d/dietpi-unsupported_terminal.sh # - Possible leftover from PREP: rm -f /{DietPi,boot}/dietpi/pre-patch_file # - dietpi/conf removal from RAMdisk: https://github.com/MichaIng/DietPi/pull/2393 rm -Rf /{DietPi,boot}/dietpi/conf #------------------------------------------------------------------------------- #.dietpi-autostart_index removal, if zero: https://github.com/MichaIng/DietPi/pull/2343 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && (( $( /etc/apt/preferences.d/dietpi-docker_fix systemctl daemon-reload #------------------------------------------------------------------------------- #Re-enable owncloud/Nextcloud Apache configs, to fix faulty v6.19 installs: https://github.com/MichaIng/DietPi/pull/2361/commits/e33ca150cf29a4f278f5df2defc495053700a91e - [[ -f /etc/apache2/sites-available/dietpi-owncloud.conf ]] && a2ensite dietpi-owncloud - [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && a2ensite dietpi-nextcloud + [[ -f '/etc/apache2/sites-available/dietpi-owncloud.conf' ]] && a2ensite dietpi-owncloud + [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] && a2ensite dietpi-nextcloud #------------------------------------------------------------------------------- #Clear install state for Medusa (( $G_DIETPI_INSTALL_STAGE == 2 )) && [[ ! -d $G_FP_DIETPI_USERDATA/medusa ]] && G_CONFIG_INJECT 'aSOFTWARE_INSTALL_STATE\[116\]=' 'aSOFTWARE_INSTALL_STATE[116]=0' /DietPi/dietpi/.installed @@ -1431,9 +1431,9 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- #Remove obsolete flags: https://github.com/MichaIng/DietPi/pull/2398#issuecomment-452398770 - [[ -f /var/lib/dietpi/.G_RPI_UPDATE ]] && rm /var/lib/dietpi/.G_RPI_UPDATE + [[ -f '/var/lib/dietpi/.G_RPI_UPDATE' ]] && rm /var/lib/dietpi/.G_RPI_UPDATE #https://github.com/MichaIng/DietPi/pull/2407/commits/5b7ad8bddc9dd5ffe89a2614615eb936333c8d41 - [[ -f /var/lib/dietpi/.compiled_i-sabre-k2m ]] && rm /var/lib/dietpi/.compiled_i-sabre-k2m + [[ -f '/var/lib/dietpi/.compiled_i-sabre-k2m' ]] && rm /var/lib/dietpi/.compiled_i-sabre-k2m #------------------------------------------------------------------------------- #RPi changes: https://github.com/MichaIng/DietPi/pull/2402 if (( $G_HW_MODEL < 10 )); then @@ -1472,7 +1472,7 @@ Also have a look at "Sonarr", another alternative TV show manager, available for iwconfig wlan$(sed -n 2p /DietPi/dietpi/.network) power off &> /dev/null || sed -i '/^wireless-power/d' /etc/network/interfaces #------------------------------------------------------------------------------- #Grafana port change - [[ -f /etc/grafana/grafana.ini ]] && G_WHIP_MSG '[INFO]:\nGrafana port has changed to 3001 (previously 3000).' + [[ -f '/etc/grafana/grafana.ini' ]] && G_WHIP_MSG '[INFO]:\nGrafana port has changed to 3001 (previously 3000).' #------------------------------------------------------------------------------- #Remove armbian banner/profiles left on ASUS TB image rm -f /etc/profile.d/armbian-* @@ -1483,7 +1483,7 @@ Also have a look at "Sonarr", another alternative TV show manager, available for #------------------------------------------------------------------------------- #Image updates if (( $G_HW_MODEL == 40 || $G_HW_MODEL == 42 || $G_HW_MODEL == 43 )) && #$G_HW_MODEL == 42 || #Kernel panic... - [[ ! -f /etc/armbian-release ]]; then + [[ ! -f '/etc/armbian-release' ]]; then G_WHIP_MSG "[INFO]:\nThe base image for $G_HW_MODEL_DESCRIPTION has been updated.\nPlease reinstall your system with the latest image from https://dietpi.com/download.\n\nYou can continue to use this existing installation, however, some kernel features may not be available." @@ -1521,7 +1521,7 @@ 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' ]]; then cd /var/www/html/admin && git reset --hard HEAD cd /tmp/$G_PROGRAM_NAME @@ -1529,7 +1529,7 @@ Do you still want to keep "p7zip-full"?'; then fi #------------------------------------------------------------------------------- #WireGuard: Harden "sid" repo handling and on RPi, catch up on installing the Debian keyring: https://github.com/MichaIng/DietPi/pull/2571 - if [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then + if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then if (( $G_HW_MODEL < 10 )); then @@ -1545,7 +1545,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi #------------------------------------------------------------------------------- #MPD: Fix permissions issue: https://github.com/MichaIng/DietPi/issues/2462 - if [[ -f /etc/mpd.conf ]]; then + if [[ -f '/etc/mpd.conf' ]]; then sed -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd.conf sed -i '/^Group=/d' /lib/systemd/system/mpd.service @@ -1589,10 +1589,10 @@ _EOF_ systemctl daemon-reload #------------------------------------------------------------------------------- #Remove obsolete DietPi-Sync log: https://github.com/MichaIng/DietPi/pull/2606 - [[ -f /var/log/dietpi-sync.log ]] && rm /var/log/dietpi-sync.log + [[ -f '/var/log/dietpi-sync.log' ]] && rm /var/log/dietpi-sync.log #------------------------------------------------------------------------------- #XU4, use Meveric's xorg.conf which detects 3.x and 4.x kernel configuration requirments: - if (( $G_HW_MODEL == 11 )) && [[ -f /etc/X11/xorg.conf ]]; then + if (( $G_HW_MODEL == 11 )) && [[ -f '/etc/X11/xorg.conf' ]]; then rm /etc/X11/xorg.conf G_AGI --reinstall firmware-samsung xf86-video-armsoc-odroid malit628-odroid @@ -1600,7 +1600,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #DietPi-Survey: Remove survey sent count from settings file: https://github.com/MichaIng/DietPi/pull/2626 - if [[ -f /DietPi/dietpi/.dietpi-survey ]]; then + if [[ -f '/DietPi/dietpi/.dietpi-survey' ]]; then local survey_opted_in=$(sed -n 1p /DietPi/dietpi/.dietpi-survey) echo $survey_opted_in > /DietPi/dietpi/.dietpi-survey @@ -1620,14 +1620,14 @@ _EOF_ fi #------------------------------------------------------------------------------- #Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 - if [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && + if [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] && ! grep -q 'oc[ms]-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf fi - if [[ -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ]] && + if [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' ]] && ! grep -q 'oc[ms]-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then echo 'url.redirect += ( @@ -1636,7 +1636,7 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites- )' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf fi - if [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && + if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] && ! grep -q 'oc[ms]-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { @@ -1768,6 +1768,95 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' fi unset NORDVPN_USERNAME NORDVPN_PASSWORD NORDVPN_SERVER PROTOCOL + fi + #----------------------------------------------------------------------- + # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 + local reinstall_ids='' + local upgrade_php=0 + if grep -q '^aSOFTWARE_INSTALL_STATE\[89\]=2' /DietPi/dietpi/.installed; then + + # ownCloud (up to v10.2) does not yet support PHP7.3, so install PHP7.2 for now + local PHP_NAME='php7.3' + [[ -f '/var/www/owncloud/occ' ]] && PHP_NAME='php7.2' + + if ! command -v $PHP_NAME &> /dev/null; then + + reinstall_ids+=' 89' + 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 16, ownCloud 10.2 and others.\n +We will update webserver configurations and backup the whole /etc/php(5) directory to /mnt/dietpi_userdata/php(5)_bak, so you can recover custom settings.\n +NB: You must update all manually (outside of DietPi-Software) installed PHP-dependent web applications which do not use the dedicated webserver, to use the new ${PHP_NAME^^} socket/instance. +NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" + upgrade_php=1 + + # We need to upgrade Jessie Nextcloud users since NC13 does not support PHP7.3 yet. Check for NC < 14 in general and do incremental upgrading in case. + local upgrade_nextcloud=0 + while [[ -f '/var/www/nextcloud/version.php' ]] + do + + # - Estimate Nextcloud version, skip if higher than 13 or invalid + local nextcloud_version=$(grep '$OC_VersionString' /var/www/nextcloud/version.php | sed "s/^.*= '//" | sed 's/\..*$//g') + disable_error=1 G_CHECK_VALIDINT "$nextcloud_version" 9 13 || break + + # - Inform user + G_WHIP_MSG '[ INFO ] Nextcloud will be upgraded\n +Your Nextcloud version does not yet support PHP7.3. On Jessie systems this is expected where Nextcloud 14+ was not supported.\n +We will upgrade your Nextcloud version to Nextcloud 14 now to allow the PHP upgrade, which on the other hand enables you to further upgrade Nextcloud to its current major version.\n +We will create a full backup of your Nextcloud install directory and database to: /mnt/dietpi_userdata/nextcloud_data/ +Your Nextcloud data are not touched.' + upgrade_nextcloud=1 + + # - Backup database and install dir: Use our cloud migration script + # In case of failure, exit to not create any damage + local GITOWNER=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//'); GITOWNER=${GITOWNER:-MichaIng} + local GITBRANCH=$(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//'); GITBRANCH=${GITBRANCH:-master} + local url="https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/.meta/dietpi-cloud-migration" + G_CHECK_URL "$url" + curl -sSL "$url" | bash + G_ERROR_HANDLER_EXITCODE=$? + G_ERROR_HANDLER_COMMAND='Nextcloud backup' + G_ERROR_HANDLER_RETRY=0 + G_ERROR_HANDLER + + # - Incremental upgrade since skipping major versions is not supported. There should be no installs < NC13 but let's be failsafe. + until (( $nextcloud_version > 13 )) + do + + ((nextcloud_version++)) + G_CHECK_URL https://download.nextcloud.com/server/releases/latest-$nextcloud_version.tar.bz2 + G_RUN_CMD wget https://download.nextcloud.com/server/releases/latest-$nextcloud_version.tar.bz2 + G_RUN_CMD rm -R /var/www/nextcloud + G_RUN_CMD tar xf latest-$nextcloud_version.tar.bz2 -C /var/www + G_RUN_CMD cp -a /mnt/dietpi_userdata/nextcloud_data/dietpi-nextcloud-installation-backup/config/config.php /var/www/nextcloud/config/config.php + # - Restore custom apps but prevent overwriting upgraded ones or adding obsolete files + for i in /mnt/dietpi_userdata/nextcloud_data/dietpi-nextcloud-installation-backup/apps/* + do + + [[ -d /var/www/nextcloud/apps/${i##*/} ]] || G_RUN_CMD cp -a $i /var/www/nextcloud/apps/ + + done + # - Permissions + G_RUN_CMD chown -R www-data:www-data /var/www/nextcloud + G_RUN_CMD find /var/www/nextcloud/ -type d -exec chmod 750 {} \; + G_RUN_CMD find /var/www/nextcloud/ -type f -exec chmod 640 {} \; + # - Upgrade until NC13, then upgrade after PHP7.3 has been installed, since NC13 does not support PHP5.6 anymore + (( $nextcloud_version < 14 )) && { ncc upgrade || exit 1; } + + done + break + + done + + [[ -d '/etc/php' ]] && G_RUN_CMD cp -a /etc/php /mnt/dietpi_userdata/php_bak + [[ -d '/etc/php5' ]] && G_RUN_CMD cp -a /etc/php5 /mnt/dietpi_userdata/php5_bak + + # - Lighttpd + [[ -f '/etc/lighttpd/conf-available/15-fastcgi-php.conf' ]] && sed -i "s@\"socket\".*\$@\"socket\" => \"/run/php/$PHP_NAME-fpm.sock\",@" /etc/lighttpd/conf-available/15-fastcgi-php.conf + # - Nginx + [[ -f '/etc/nginx/nginx.conf' ]] && sed -i "s#/run/php.*-fpm.sock#/run/php/$PHP_NAME-fpm.sock#g" /etc/nginx/nginx.conf + + fi + fi #----------------------------------------------------------------------- # Reinstalls @@ -1783,7 +1872,47 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service fi - /DietPi/dietpi/dietpi-software reinstall 34 35 42 + /DietPi/dietpi/dietpi-software reinstall 34 35 42 $reinstall_ids + #----------------------------------------------------------------------- + # Remove old PHP version + if (( $upgrade_php )); then + + G_AGP php{5,7.0,7.1}-* libapache2-mod-php{5,7.0,7.1} + [[ $PHP_NAME = 'php7.3' ]] && G_AGP php7.2-* libapache2-mod-php7.2 + # New mod-php must be enabled manually since this is skipped by APT as long as prior version is active + command -v a2enmod &> /dev/null && a2enmod $PHP_NAME + + # Recover ownCloud, Nextcloud and Pydio PHP modules + if grep -q '^aSOFTWARE_INSTALL_STATE\[47\]=2' /DietPi/dietpi/.installed; then + + G_AGI $PHP_NAME-intl + echo -e '; ownCloud PHP settngs\n; priority=99\napc.enable_cli=1' > /etc/php/${PHP_NAME#php}/mods-available/dietpi-owncloud.ini + phpenmod dietpi-owncloud + + fi + if grep -q '^aSOFTWARE_INSTALL_STATE\[114\]=2' /DietPi/dietpi/.installed; then + + G_AGI $PHP_NAME-intl + echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1 +opcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000 +opcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > /etc/php/${PHP_NAME#php}/mods-available/dietpi-nextcloud.ini + phpenmod dietpi-nextcloud + + fi + grep -q '^aSOFTWARE_INSTALL_STATE\[48\]=2' /DietPi/dietpi/.installed && G_AGI $PHP_NAME-intl + + # Upgrade Nextcloud + if (( $upgrade_nextcloud )); then + + local mariadb='mariadb'; (( $G_DISTRO < 4 )) && mariadb='mysql' + G_RUN_CMD systemctl start $mariadb redis-server + ncc upgrade + ncc db:add-missing-indices + ncc db:convert-filecache-bigint + + fi + + fi fi #------------------------------------------------------------------------------- From 50d2a1c5205f44d8bd20ea9a9d644768c7f01611 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 21:54:10 +0200 Subject: [PATCH 125/253] v6.23 + DietPi-FS_partition_resize | Minor wording and adding some info via comments + DietPi-FS_partition_resize | Wrap script into command group { ... } to fully read before execute, as we do for other scripts as well --- .../dietpi/services/fs_partition_resize.sh | 74 ++++++++++--------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index b0b1749c9f..9c97873159 100644 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -1,54 +1,60 @@ #!/bin/bash +{ + # Disable this service + systemctl disable dietpi-fs_partition_resize -systemctl disable dietpi-fs_partition_resize + # Grab root device + # Naming scheme: https://askubuntu.com/questions/56929/what-is-the-linux-drive-naming-scheme + # - SCSI/SATA: /dev/sd[a-z][0-9] + # - IDE: /dev/hd[a-z][0-9] + # - eMMC: /dev/mmcblk[0-9]p[0-9] + # - NVMe: /dev/nvme[0-9]n[0-9]p[0-9] + TARGET_DEV=$(findmnt / -o source -n) + if [[ $TARGET_DEV == '/dev/mmcblk'* || $TARGET_DEV == '/dev/nvme'* ]]; then -sync + TARGET_PARTITION=${TARGET_DEV##*p} # /dev/mmcblk0p1 => 1 + TARGET_DRIVE=${TARGET_DEV%p[0-9]} # /dev/mmcblk0p1 => /dev/mmcblk0 -# Naming scheme: https://askubuntu.com/questions/56929/what-is-the-linux-drive-naming-scheme -# - SCSI/SATA: /dev/sd[a-z][0-9] -# - IDE: /dev/hd[a-z][0-9] -# - eMMC: /dev/mmcblk[0-9]p[0-9] -# - NVMe: /dev/nvme[0-9]n[0-9]p[0-9] -TARGET_DEV=$(findmnt / -o source -n) -if [[ $TARGET_DEV =~ /mmcblk || $TARGET_DEV =~ /nvme ]]; then + elif [[ $TARGET_DEV == /dev/[sh]d[a-z]* ]]; then - TARGET_PARTITION=${TARGET_DEV##*p} # /dev/mmcblk0p1 => 1 - TARGET_DRIVE=${TARGET_DEV%p[0-9]} # /dev/mmcblk0p1 => /dev/mmcblk0 + TARGET_PARTITION=${TARGET_DEV##*[a-z]} # /dev/sda1 => 1 + TARGET_DRIVE=${TARGET_DEV%[0-9]} # /dev/sda1 => /dev/sda -elif [[ $TARGET_DEV =~ /[sh]d[a-z] ]]; then + else - TARGET_PARTITION=${TARGET_DEV##*[a-z]} # /dev/sda1 => 1 - TARGET_DRIVE=${TARGET_DEV%[0-9]} # /dev/sda1 => /dev/sda + echo "[FAILED] Unsupported block device naming scheme ($TARGET_DEV). Aborting..." + exit 1 -else - - echo "[FAILED] Unsupported drive naming scheme: $TARGET_DEV. Aborting..." - exit 1 + fi -fi + # Resize partition, only if drive actually contains a partition table + if [[ $TARGET_PARTITION == [0-9] ]]; then -# Only redo partitions, if drive actually contains a partition table. -if [[ $TARGET_PARTITION == [0-9] ]]; then + # - Failsafe: Sync changes to disk before touching partitions + sync - # - GPT detection | modified version of ayufan-rock64 resize script. - if sfdisk $TARGET_DRIVE -l | grep -qi 'disklabel type: gpt'; then + # - GPT detection | Modified version of ayufan-rock64 resize script + if sfdisk $TARGET_DRIVE -l | grep -qi 'disklabel type: gpt'; then - # move GPT alternate header to end of disk - sgdisk -e $TARGET_DRIVE + # Move GPT alternate header to end of disk + sgdisk -e $TARGET_DRIVE - fi + fi - # - Maximize partition size - sfdisk $TARGET_DRIVE -fN$TARGET_PARTITION --no-reread <<< ',+,,,' + # - Maximize partition size + sfdisk $TARGET_DRIVE -fN$TARGET_PARTITION --no-reread <<< ',+,,,' - partprobe $TARGET_DRIVE + # - Reread partition table + partprobe $TARGET_DRIVE -else + else - echo "[ INFO ] No valid root partition found: $TARGET_PARTITION. Skipping partition resize..." + echo "[ INFO ] No (valid) root partition found ($TARGET_PARTITION). Most likely the drive does not contain a partition table. Skipping partition resize..." -fi + fi -resize2fs $TARGET_DEV + # Resize file system + resize2fs $TARGET_DEV -exit 0 + exit 0 +} From f4f9936d607d75ae9376a797d9f4c16a6de9f106 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 22:13:38 +0200 Subject: [PATCH 126/253] v6.23 + DietPi-WiFi-Monitor | Do not load globals to reduce RAM usage and loading time a bid + DietPi-WiFi-Monitor | RootFS R/W access is not required by this script + DietPi-WiFi-Monitor | Allow to pass $TICKRATE to this script, e.g. for testing purpose currently. Possibly pass this via environment variable/file from systemd service in the future, to allow customisation based on end user requirements. --- .../dietpi/services/dietpi-wifi-monitor.sh | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh index c950605f1a..bdf0f54b0b 100644 --- a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh +++ b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh @@ -1,23 +1,21 @@ #!/bin/bash { - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-WiFi-Monitor' - G_CHECK_ROOT_USER - G_CHECK_ROOTFS_RW - G_INIT - #Import DietPi-Globals --------------------------------------------------------------- - - #Update network info + # Check for root permissions + (( $UID )) && { echo 'ERROR: Root permissions required. Please run this script with "sudo". Exiting...'; exit 1; } + + # Check for concurrent execution + pgrep -f 'dietpi-wifi-monitor.sh' &> /dev/null && { echo 'ERROR: Concurrent execution detected. Please exit the running instance of DietPi-WiFi-Monitor first. Exiting...'; exit 1; } + + # Update network info /DietPi/dietpi/func/obtain_network_details URL_PING='' ADAPTER="wlan$(sed -n 2p /DietPi/dietpi/.network)" - TICKRATE=10 + TICKRATE={TICKRATE:-10} #------------------------------------------------------------------------------------- - #Main + # Main #------------------------------------------------------------------------------------- # Check for valid WiFi adapter [[ -e /sys/class/net/$ADAPTER ]] || { echo "ERROR: No valid WiFi adapter found on interface: $ADAPTER. Exiting..."; exit 1; } From 77e45e3bcd10eab6fc65c6a164e800265439e320 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 23:44:22 +0200 Subject: [PATCH 127/253] v6.23 (#2740) + DietPi-Software | Nextcloud Talk: Do not apply TLS settings to coTURN, which has no security benefit and complicates key handling on Buster, where coTURN runs as limited user: https://github.com/MichaIng/DietPi/issues/2592, https://github.com/MichaIng/DietPi/issues/2440 + DietPi-Software | Nextcloud Talk: Fix wrong/outdated coTURN settings handling due to some changes with newer versions (Buster) --- CHANGELOG.txt | 2 ++ dietpi/dietpi-letsencrypt | 29 ----------------------- dietpi/dietpi-software | 49 ++++++++++++++++++++------------------- 3 files changed, 27 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a1758dd6b4..84fb08f901 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. - DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 +- DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 Bug Fixes: - System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 @@ -38,6 +39,7 @@ Bug Fixes: - DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 - DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 - DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 +- DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 8c6d741a78..52d7f6dbf9 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -352,35 +352,6 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /D fi - # coTURN - if [[ -f /etc/turnserver.conf ]]; then - - G_DIETPI-NOTIFY 2 'coTURN server detected' - - # - Get TURN port - local turn_port=5349 - if grep -q '^[[:blank:]]*tls-listening-port=' /etc/turnserver.conf; then - - turn_port=$(grep -m1 '^[[:blank:]]*tls-listening-port=' /etc/turnserver.conf) - turn_port=${turn_port#*tls-listening-port=} - - elif grep -q '^[[:blank:]]*listening-port=' /etc/turnserver.conf; then - - turn_port=$(grep -m1 '^[[:blank:]]*listening-port=' /etc/turnserver.conf) - turn_port=${turn_port#*listening-port=} - # - Comment non-TLS port setting to avoid doubled port use - G_CONFIG_INJECT 'listening-port=' "#listening-port=$turn_port" /etc/turnserver.conf - - fi - - # - Set TURN TLS settings - G_CONFIG_INJECT 'tls-listening-port=' "tls-listening-port=$turn_port" /etc/turnserver.conf - G_CONFIG_INJECT 'cert=' "cert=$fp_cert_dir/cert.pem" /etc/turnserver.conf - G_CONFIG_INJECT 'pkey=' "pkey=$fp_cert_dir/privkey.pem" /etc/turnserver.conf - G_CONFIG_INJECT 'cipher-list=' 'cipher-list="ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5"' /etc/turnserver.conf - - fi - # ALL | Create cert renewal cron job on Jessie-: if (( $G_DISTRO < 4 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d48b4c89e6..7247e5d6ce 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1195,7 +1195,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 done - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 # ASUS TB + aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 # + ASUS TB # - XU4 test #aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,11]=1 #Requires Stretch due to libc requirements @@ -8229,7 +8229,7 @@ The install script will now exit. After applying one of the the above, rerun die G_DIETPI-NOTIFY 2 'Configuring TURN server:' # Buster (systemd unit) - if (( $G_DISTRO > 4 )); then + if [[ -f '/lib/systemd/system/coturn.service' ]]; then # - Remove init.d service traces [[ -f /etc/init.d/coturn ]] && rm /etc/init.d/coturn @@ -8270,13 +8270,13 @@ The install script will now exit. After applying one of the the above, rerun die done invalid_text='' - local port=5349 + local port=3478 while : do G_WHIP_DEFAULT_ITEM=$port G_WHIP_INPUTBOX "${invalid_text}Please enter the network port, that should be used for your TURN server:\n -NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 5349" +NB: This port needs to be forwarded by your router and/or opened in your firewall settings. Default value is: 3478" if (( $? == 0 )) && disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then port=$G_WHIP_RETURNED_VALUE @@ -8290,40 +8290,41 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal done - # Adjust coturn settings + # Adjust coTURN settings # - On Buster by default /etc/turnserver.conf is not created. Use example or create empty file: - if [[ ! -f /etc/turnserver.conf ]]; then + if [[ ! -f '/etc/turnserver.conf' ]]; then > /etc/turnserver.conf - [[ -f /usr/share/doc/coturn/examples/etc/turnserver.conf.gz ]] && gzip -cd /usr/share/doc/coturn/examples/etc/turnserver.conf.gz > /etc/turnserver.conf + [[ -f '/usr/share/doc/coturn/examples/etc/turnserver.conf.gz' ]] && gzip -cd /usr/share/doc/coturn/examples/etc/turnserver.conf.gz > /etc/turnserver.conf fi + # - Estimate coTURN version to handle outdated settings correctly + local version=$(dpkg-query -Wf '${Version}' coturn); version=${version:0:7}; version=${version//./} + # https://help.nextcloud.com/t/howto-setup-nextcloud-talk-with-turn-server/30794 + G_CONFIG_INJECT 'listening-port=' "listening-port=$port" /etc/turnserver.conf G_CONFIG_INJECT 'fingerprint' 'fingerprint' /etc/turnserver.conf G_CONFIG_INJECT 'use-auth-secret' 'use-auth-secret' /etc/turnserver.conf + if (( $version < 4508 )); then + + G_CONFIG_INJECT 'lt-cred-mech' 'lt-cred-mech' /etc/turnserver.conf + + else + + sed -i '/^[[:blank:]]*lt-cred-mech/#lt-cred-mech/' /etc/turnserver.conf + + fi G_CONFIG_INJECT 'realm=' "realm=$domain" /etc/turnserver.conf GCI_PRESERVE=1 G_CONFIG_INJECT 'total-quota=' 'total-quota=100' /etc/turnserver.conf GCI_PRESERVE=1 G_CONFIG_INJECT 'bps-capacity=' 'bps-capacity=0' /etc/turnserver.conf G_CONFIG_INJECT 'stale-nonce' 'stale-nonce' /etc/turnserver.conf G_CONFIG_INJECT 'no-loopback-peers' 'no-loopback-peers' /etc/turnserver.conf - G_CONFIG_INJECT 'no-multicast-peers' 'no-multicast-peers' /etc/turnserver.conf - - # Add TLS settings, if LetsEncrypt certificates are available: - if [[ -f /DietPi/dietpi/.dietpi-letsencrypt && - -f /etc/letsencrypt/live/$(sed -n 1p /DietPi/dietpi/.dietpi-letsencrypt)/cert.pem ]]; then - - G_DIETPI-NOTIFY 2 'LetsEncrypt certificate found, will configure coturn TURN server to accept TLS connections' - # - Disable non-TLS listening port, enable TLS listening port: - G_CONFIG_INJECT 'listening-port=' "#listening-port=$port" /etc/turnserver.conf - G_CONFIG_INJECT 'tls-listening-port=' "tls-listening-port=$port" /etc/turnserver.conf - local fp_cert_dir="/etc/letsencrypt/live/$(sed -n 1p /DietPi/dietpi/.dietpi-letsencrypt)" - G_CONFIG_INJECT 'cert=' "cert=$fp_cert_dir/cert.pem" /etc/turnserver.conf - G_CONFIG_INJECT 'pkey=' "pkey=$fp_cert_dir/privkey.pem" /etc/turnserver.conf - # - Proven working default cipher, but thus should be properly reworked, e.g. to match webserver settings? - G_CONFIG_INJECT 'cipher-list=' 'cipher-list="ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5"' /etc/turnserver.conf + if (( $version < 4510 )); then + + G_CONFIG_INJECT 'no-multicast-peers' 'no-multicast-peers' /etc/turnserver.conf else - G_CONFIG_INJECT 'listening-port=' "listening-port=$port" /etc/turnserver.conf + sed -i '/^[[:blank:]]*no-multicast-peers/d' /etc/turnserver.conf fi @@ -8343,7 +8344,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal secret=$(grep -m1 '^[[:blank:]]*static-auth-secret=' /etc/turnserver.conf) secret=${secret#*static-auth-secret=} ncc config:app:set spreed turn_servers --value="[{\"server\":\"$domain:$port\",\"secret\":\"$secret\",\"protocols\":\"udp,tcp\"}]" - unset secret domain port invalid_text + unset secret domain port invalid_text version fi From a2a8e604816abc990495fb9b52fd6df0bc1f3ed3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 26 Apr 2019 23:59:05 +0200 Subject: [PATCH 128/253] v6.23 + DietPi-Banner | Load settings before green line/bullet/separator declaration, otherwise chosen green colour is not applied + DietPi-Banner | Tiny spelling --- dietpi/func/dietpi-banner | 54 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index b9520877be..e80bbc1c4a 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -60,9 +60,12 @@ ) + # Load settings here, to have chosen ${aCOLOUR[0]} applied to below strings + [[ -f $FP_SAVEFILE ]] && . $FP_SAVEFILE + GREEN_LINE=" ${aCOLOUR[0]}─────────────────────────────────────────────────────$COLOUR_RESET" GREEN_BULLET=" ${aCOLOUR[0]}-$COLOUR_RESET" - GREEN_SEPERATOR="${aCOLOUR[0]}:$COLOUR_RESET" + GREEN_SEPARATOR="${aCOLOUR[0]}:$COLOUR_RESET" . /DietPi/dietpi/.version DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" @@ -82,8 +85,6 @@ } - Load(){ [[ -f $FP_SAVEFILE ]] && . $FP_SAVEFILE; } - Save(){ > $FP_SAVEFILE @@ -131,14 +132,14 @@ fi echo -e "$GREEN_LINE - ${aCOLOUR[1]}DietPi v$DIETPI_VERSION$COLOUR_RESET $GREEN_SEPERATOR $text_update_available_date$COLOUR_RESET + ${aCOLOUR[1]}DietPi v$DIETPI_VERSION$COLOUR_RESET $GREEN_SEPARATOR $text_update_available_date$COLOUR_RESET $GREEN_LINE" } Print_Local_Ip(){ - echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPERATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter) + echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPARATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter) } @@ -160,13 +161,13 @@ $GREEN_LINE" # Update available? if (( $UPDATE_AVAILABLE )); then - if [[ $UPDATE_AVAILABLE_VERSION = '-1' ]]; then + if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then echo -e " ${aCOLOUR[3]}Updated DietPi image is available, please download it:$COLOUR_RESET\n https://dietpi.com/#download\n" else - echo -e " ${aCOLOUR[1]}dietpi-update$COLOUR_RESET $GREEN_SEPERATOR ${aCOLOUR[3]}Run now to update DietPi from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION.$COLOUR_RESET\n" + echo -e " ${aCOLOUR[1]}dietpi-update$COLOUR_RESET $GREEN_SEPARATOR ${aCOLOUR[3]}Run now to update DietPi from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION.$COLOUR_RESET\n" fi @@ -176,11 +177,11 @@ $GREEN_LINE" Print_Useful_Commands(){ - echo -e "${aCOLOUR[1]} dietpi-launcher$COLOUR_RESET $GREEN_SEPERATOR All the DietPi programs in one place. - ${aCOLOUR[1]}dietpi-config$COLOUR_RESET $GREEN_SEPERATOR Feature rich configuration tool for your device. - ${aCOLOUR[1]}dietpi-software$COLOUR_RESET $GREEN_SEPERATOR Select optimized software for installation. - ${aCOLOUR[1]}htop$COLOUR_RESET $GREEN_SEPERATOR Resource monitor. - ${aCOLOUR[1]}cpu$COLOUR_RESET $GREEN_SEPERATOR Shows CPU information and stats.\n" + echo -e "${aCOLOUR[1]} dietpi-launcher$COLOUR_RESET $GREEN_SEPARATOR All the DietPi programs in one place. + ${aCOLOUR[1]}dietpi-config$COLOUR_RESET $GREEN_SEPARATOR Feature rich configuration tool for your device. + ${aCOLOUR[1]}dietpi-software$COLOUR_RESET $GREEN_SEPARATOR Select optimized software for installation. + ${aCOLOUR[1]}htop$COLOUR_RESET $GREEN_SEPARATOR Resource monitor. + ${aCOLOUR[1]}cpu$COLOUR_RESET $GREEN_SEPARATOR Shows CPU information and stats.\n" } @@ -190,27 +191,27 @@ $GREEN_LINE" [[ ${aENABLED[2]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals # - Re-obtain network details if missing and LAN IP chosen - [[ ${aENABLED[5]} != 1 || -f /DietPi/dietpi/.network ]] || /DietPi/dietpi/func/obtain_network_details + [[ ${aENABLED[5]} != 1 || -f '/DietPi/dietpi/.network' ]] || /DietPi/dietpi/func/obtain_network_details printf '\ec' # clear current terminal screen Print_Header - (( ${aENABLED[0]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[0]} $GREEN_SEPERATOR $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)" #0: Device model - (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPERATOR $(uptime -p 2>&1)" #1: Uptime - (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPERATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" #2: CPU temp - (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPERATOR $(hostname -f 2>&1)" #3: Hostname - (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPERATOR $(hostname -y 2>&1)" #4: Domain name + (( ${aENABLED[0]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[0]} $GREEN_SEPARATOR $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)" #0: Device model + (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPARATOR $(uptime -p 2>&1)" #1: Uptime + (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPARATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" #2: CPU temp + (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPARATOR $(hostname -f 2>&1)" #3: Hostname + (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPARATOR $(hostname -y 2>&1)" #4: Domain name (( ${aENABLED[5]} == 1 )) && Print_Local_Ip - (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPERATOR $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)" #6: WAN IP # Move this to /DietPi/dietpi/.network? - (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPERATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" #7: Freespace (RootFS) - (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPERATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" #8: Freespace (DietPi userdata) - (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPERATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather - (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPERATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom + (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)" #6: WAN IP # Move this to /DietPi/dietpi/.network? + (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" #7: Freespace (RootFS) + (( ${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)" #8: Freespace (DietPi userdata) + (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather + (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom local fp_motd='/tmp/.dietpi_motd' if (( ${aENABLED[12]} == 1 )); then - [[ ! -f $fp_motd ]] && curl -sLm 2 https://dietpi.com/motd > $fp_motd - [[ -f $fp_motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPERATOR $(< $fp_motd)" #12: MOTD + [[ -f $fp_motd ]] || curl -sLm 2 https://dietpi.com/motd > $fp_motd + [[ -f $fp_motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $(<$fp_motd)" #12: MOTD fi echo -e "$GREEN_LINE\n" @@ -283,9 +284,6 @@ NB: It is executed as bash script, so it needs to be in bash compatible syntax. #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #----------------------------------------------------------------------------------- - Load - #----------------------------------------------------------------------------------- if (( $INPUT == 0 )); then Print_Header From b11e023dd1cf85a7c2f5eea17bfb217ae9a46958 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 27 Apr 2019 15:42:07 +0200 Subject: [PATCH 129/253] v6.23 + DietPi-Arr_to_RAM | Reverting https://github.com/MichaIng/DietPi/commit/54faaaac606dbc6d0c25af2e962cf3f5d93676d6 for now. Investigate on DietPi-Postboot level why Sonarr/Radarr/Lidarr fail to start. + DietPi-Arr_to_RAM | Use systemd unit Type=oneshot which fits better here and matches the intentions of how these are used, since there is simply no process running after ExecStart has finished: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples --- dietpi/misc/dietpi-arr_to_RAM | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index e3f0de6caf..5505d233ab 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -99,7 +99,6 @@ $USAGE"; exit 1; } [[ -d $FP_DISK ]] || continue Print "${i^} detected" - start_services+=" $i" # Update backup if (( $INPUT == 2 )); then @@ -126,8 +125,14 @@ $USAGE"; exit 1; } fi - Print "Stopping ${i^} service..." - systemctl stop $i || { error=$? Print "Stopping ${i^} service failed. Skipping this program..."; continue; } + # If active, stop program before handling database and restart afterwards + if pgrep -f $i &> /dev/null; then + + Print "Stopping ${i^} service..." + start_services+=" $i" + systemctl stop $i || { error=$? Print "Stopping ${i^} service failed. Skipping this program..."; continue; } + + fi # Link to RAM + backup if (( $INPUT == 1 )); then @@ -234,9 +239,9 @@ After=dietpi-ramdisk.service tmp.mount Before=dietpi-preboot.service sonarr.service radarr.service lidarr.service [Service] -Type=forking +Type=oneshot RemainAfterExit=yes -ExecStart=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 1 2>&1 >> $FP_LOG' +ExecStart=-/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 1 2>&1 >> $FP_LOG' ExecStop=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 0 2>&1 > $FP_LOG' [Install] From fb1688bb4199e997ed4bdbb6f1dcbc69489bddd4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 27 Apr 2019 17:22:42 +0200 Subject: [PATCH 130/253] v6.23 (#2741) + System | Make DietPi systemd units requisites of each others instead of requirements only + System | Start all DietPi systemd units only when multi-user.target is pulled, as we don't want/need them on emergency/maintenance boot mode + System | Make DietPi systemd units Type=oneshot which fits better to the intentions and since there are simply no background processes active: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples + DietPi-Login | Skip all DietPi login scripts if DietPi-Globals failed to load (e.g. RAMdisk failed), print one clear error instead. This allows using DietPi systems without any DietPi scripts use without running into certain messy follow up errors on login/terminal starts --- rootfs/etc/bashrc.d/dietpi.bash | 5 ++--- rootfs/etc/systemd/system/dietpi-boot.service | 4 ++-- rootfs/etc/systemd/system/dietpi-postboot.service | 2 +- rootfs/etc/systemd/system/dietpi-preboot.service | 6 +++--- rootfs/etc/systemd/system/dietpi-ramdisk.service | 4 ++-- rootfs/etc/systemd/system/dietpi-ramlog.service | 4 ++-- rootfs/etc/systemd/system/dietpi-wifi-monitor.service | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index bfdcb905bb..b71dd589f1 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -15,7 +15,7 @@ #//////////////////////////////////// # - DietPi-Globals: dietpi-* aliases, G_* functions and variables - . /DietPi/dietpi/func/dietpi-globals + . /DietPi/dietpi/func/dietpi-globals || { echo -e '[\e[31mFAILED\e[0m] DietPi-Login | DietPi boot scripts failed. Skipping DietPi login scripts...'; exit 1; } # - "G_DIETPI-NOFITY -2 message" starts a process animation. # If scripts fail to kill the animation, e.g. cancelled by user, terminal bash prompt has to do it as last resort: @@ -53,8 +53,7 @@ As a workaround we fooled the server by setting: TERM=$TERM. This is not the cleanest solution, since commands might expect colours or formats, that are not supported by the actual terminal.\n Please change your SSH clients terminal, respectively the passed \$TERM string$ncurses_term." && (( $G_WHIP_RETURNED_VALUE )) && G_AGI ncurses-term - unset TERM_old - unset ncurses_term + unset TERM_old ncurses_term fi diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index 854fde07de..652928c9fa 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -1,8 +1,8 @@ [Unit] Description=DietPi-Boot # Order 3 -Requires=dietpi-preboot.service -After=dietpi-preboot.service network.target networking.service +Requisite=dietpi-preboot.service +After=dietpi-preboot.service network.target Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.service [Service] diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 204dc67008..9cade037fb 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -1,7 +1,7 @@ [Unit] Description=DietPi-PostBoot # Order 4 -Requires=dietpi-boot.service +Requisite=dietpi-boot.service After=dietpi-boot.service [Service] diff --git a/rootfs/etc/systemd/system/dietpi-preboot.service b/rootfs/etc/systemd/system/dietpi-preboot.service index c909aedf27..a31023035c 100644 --- a/rootfs/etc/systemd/system/dietpi-preboot.service +++ b/rootfs/etc/systemd/system/dietpi-preboot.service @@ -1,10 +1,10 @@ [Unit] Description=DietPi-PreBoot # Order 2 -Requires=dietpi-ramdisk.service +Requisite=dietpi-ramdisk.service Wants=network-pre.target After=dietpi-ramdisk.service dietpi-ramlog.service -Before=network-pre.target dropbear.service ssh.service +Before=network-pre.target [Service] Type=oneshot @@ -13,4 +13,4 @@ StandardOutput=tty ExecStart=/bin/dash -c '/DietPi/dietpi/preboot 2>&1 | tee /tmp/dietpi-preboot.log' [Install] -WantedBy=local-fs.target +WantedBy=multi-user.target diff --git a/rootfs/etc/systemd/system/dietpi-ramdisk.service b/rootfs/etc/systemd/system/dietpi-ramdisk.service index 828638dc95..88769bc211 100644 --- a/rootfs/etc/systemd/system/dietpi-ramdisk.service +++ b/rootfs/etc/systemd/system/dietpi-ramdisk.service @@ -5,11 +5,11 @@ After=local-fs.target DietPi.mount boot.mount -.mount Before=syslog.service rsyslog.service [Service] -Type=forking +Type=oneshot RemainAfterExit=yes ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs ExecStart=/bin/dash -c '/boot/dietpi/func/dietpi-ramdisk 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramdisk.log' ExecStop=/bin/dash -c '/DietPi/dietpi/func/dietpi-ramdisk 1 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramdisk.log' [Install] -WantedBy=local-fs.target +WantedBy=multi-user.target diff --git a/rootfs/etc/systemd/system/dietpi-ramlog.service b/rootfs/etc/systemd/system/dietpi-ramlog.service index 4979b6e45c..bdeaff9669 100644 --- a/rootfs/etc/systemd/system/dietpi-ramlog.service +++ b/rootfs/etc/systemd/system/dietpi-ramlog.service @@ -5,11 +5,11 @@ After=local-fs.target DietPi.mount var-log.mount -.mount Before=syslog.service rsyslog.service [Service] -Type=forking +Type=oneshot RemainAfterExit=yes ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs ExecStart=/bin/dash -c '/boot/dietpi/func/dietpi-ramlog 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log' ExecStop=/bin/dash -c '/DietPi/dietpi/func/dietpi-ramlog 1 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log' [Install] -WantedBy=local-fs.target +WantedBy=multi-user.target diff --git a/rootfs/etc/systemd/system/dietpi-wifi-monitor.service b/rootfs/etc/systemd/system/dietpi-wifi-monitor.service index af5da29fc4..9525341f79 100644 --- a/rootfs/etc/systemd/system/dietpi-wifi-monitor.service +++ b/rootfs/etc/systemd/system/dietpi-wifi-monitor.service @@ -1,7 +1,7 @@ # Monitors loss of WiFi connection and automatically reconnects [Unit] Description=DietPi-WiFi-Monitor -Requires=dietpi-ramdisk.service +Requisite=dietpi-ramdisk.service Wants=network-online.target After=dietpi-boot.service network-online.target network.target From 81ef1ac9b7df9cc381019c20c89c34166fc1fbd4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 27 Apr 2019 23:16:41 +0200 Subject: [PATCH 131/253] v6.23 + DietPi-Pre-patch | Move Jessie systems to "jessie-support" branch --- dietpi/pre-patch_file | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 7d356bc728..28eaa8b0e2 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -103,6 +103,31 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi + fi + # Pre-patch 7: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 + if grep -qi 'jessie' /etc/os-release && [[ $(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') != 'jessie-support' ]]; then + + if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then + + sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt + + else + + echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt + + fi + + # Remove DietPi-Update working directory to allow concurrent execution. + cd /tmp + [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update + + # Apply update forcefully, since user has already chosen to do so. + dietpi-update 1 + + # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish. + kill $PPID + exit + fi #------------------------------------------------------------------------------- # Finished From 458255a037a20bf8ac61a58c104e13d160ae1a75 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 27 Apr 2019 23:25:19 +0200 Subject: [PATCH 132/253] v6.23 + DietPi-Patch | Move Jessie systems to "jessie-support" branch --- dietpi/patch_file | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index b78be9b3f1..1ba4310215 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -74,6 +74,24 @@ } + # Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 + # - We check/apply this already via pre-patches but do as well here since older DietPi version do not yet run pre-patches. + if (( $G_DISTRO < 4 )) && [[ $(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') != 'jessie-support' ]]; then + + if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then + + sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt + + else + + echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt + + fi + + Restart_DietPi_Update + + fi + # Pre-v6.17: New ".version" system # - As loaded pre-v6.17 dietpi-update will overwrite ".version" to previous 2 line system, we need to rerun dietpi-update. # Pre-v6.20: New $G_DIETPI_INSTALL_STAGE system From 5abf309b25098bb4c34bca6d95ad2d3e8b799ef2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 27 Apr 2019 23:46:33 +0200 Subject: [PATCH 133/253] v6.23 + CHANGELOG | Jessie support fading info --- CHANGELOG.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84fb08f901..f18d25d5b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,12 @@ v6.23 (XX/04/19) +Jessie support: +- The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 +- As a result we move Jessie systems to a dedicated "jessie-support" branch. Next DietPi v6.24 will still be merged into this branch as well, but for following updates it depends on how much additional related issues we face. +- We highly recommend to migrate to Stretch as fast as possible. +- For Ordoid C1 there is no Stretch image available since its kernel and firmware are not maintained to match minimum requirements. There are reports about successful "apt-get dist-upgrade" migrations and an ARMbian Stretch image is available that can be used as a basis for DietPi-PREP. But these systems face major limitations, especially no GPU (Xserver, Kodi, desktops) support is available. Read more about it or contribute to solutions for Odroid C1 users here: https://github.com/MichaIng/DietPi/issues/2561 + Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 From 24a47dcbb231abf6d54c8771c4d697d9bb11073f Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 28 Apr 2019 13:01:29 +0100 Subject: [PATCH 134/253] Start of hidden passwords. @micha GCI_PASSWORD was idea, but, no idea where to start lol --- dietpi/dietpi-software | 15 +++++++-------- dietpi/func/dietpi-globals | 1 + dietpi/misc/dietpi-nordvpn | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7247e5d6ce..0644f7e1a7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7450,7 +7450,7 @@ _EOF_ G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]]*=' "opcache.memory_consumption=$target_php_cachesize" $target_php_ini G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]]*=' 'opcache.revalidate_freq=60' $target_php_ini - # - APCu + # - APCu G_CONFIG_INJECT 'apc.shm_size[[:blank:]]*=' "apc.shm_size=${target_php_cachesize}M" $target_php_ini G_CONFIG_INJECT 'apc.ttl[[:blank:]]*=' 'apc.ttl=259200' $target_php_ini # 3 days TTL @@ -8379,7 +8379,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_CONFIG_INJECT '"download-dir"' ' "download-dir": "'$G_FP_DIETPI_USERDATA'/downloads",' /etc/transmission-daemon/settings.json '^\{$' # - Double quotes need to be escaped in .json files: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-481374924 # - ToDo: Hash password directly. Which hash method is used? - G_CONFIG_INJECT '"rpc-password"' ' "rpc-password": "'"${GLOBAL_PW//\"/\\\"}"'",' /etc/transmission-daemon/settings.json '^\{$' + GCI_PASSWORD=1 G_CONFIG_INJECT '"rpc-password"' ' "rpc-password": "'"${GLOBAL_PW//\"/\\\"}"'",' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"rpc-username"' ' "rpc-username": "root",' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"rpc-whitelist-enabled"' ' "rpc-whitelist-enabled": false,' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"message-level"' ' "message-level": 0,' /etc/transmission-daemon/settings.json '^\{$' @@ -9214,8 +9214,7 @@ Do you want to enable the Pi-hole blocking page?'; then pihole -g # - Generate web interface PW: https://github.com/MichaIng/DietPi/issues/662 - pihole -a -p "$GLOBAL_PW" - G_WHIP_MSG "DietPi has changed the Pi-hole web interface password to:\n - $GLOBAL_PW\n\nPlease use this password when logging into the web interface:\n - http://$(sed -n 4p /DietPi/dietpi/.network)/admin\n\nThis password can be changed, please see pihole binary for info:\n - pihole --help" + pihole -a -p "$GLOBAL_PW" &> /dev/null #do not print. fi @@ -9517,7 +9516,7 @@ _EOF_ #Banner_Configuration - echo -e "$GLOBAL_PW=\n$GLOBAL_PW=\nn" | vncpasswd + echo -e "$GLOBAL_PW=\n$GLOBAL_PW=\nn\n" | vncpasswd cat << _EOF_ > /etc/systemd/system/vncserver.service [Unit] @@ -9722,7 +9721,7 @@ _EOF_ ln -sf $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana # - Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password - GCI_PRESERVE=1 G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini + GCI_PASSWORD=1 GCI_PRESERVE=1 G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini G_CONFIG_INJECT 'http_port = ' 'http_port = 3001' /etc/grafana/grafana.ini fi @@ -11727,11 +11726,11 @@ _EOF_ G_CONFIG_INJECT 'DB_HOST=' 'DB_HOST=127.0.0.1' .env G_CONFIG_INJECT 'DB_DATABASE=' 'DB_DATABASE=koel' .env G_CONFIG_INJECT 'DB_USERNAME=' 'DB_USERNAME=koel' .env - G_CONFIG_INJECT 'DB_PASSWORD=' "DB_PASSWORD=$GLOBAL_PW" .env + GCI_PASSWORD=1 G_CONFIG_INJECT 'DB_PASSWORD=' "DB_PASSWORD=$GLOBAL_PW" .env # ADMIN env vars are not used any more, user prompt will ask for info. #G_CONFIG_INJECT 'ADMIN_EMAIL=' 'ADMIN_EMAIL=dietpi@dietpi.com' .env #G_CONFIG_INJECT 'ADMIN_NAME=' 'ADMIN_NAME=admin' .env - #G_CONFIG_INJECT 'ADMIN_PASSWORD=' "ADMIN_PASSWORD=$GLOBAL_PW" .env + #GCI_PASSWORD=1 G_CONFIG_INJECT 'ADMIN_PASSWORD=' "ADMIN_PASSWORD=$GLOBAL_PW" .env G_CONFIG_INJECT 'FFMPEG_PATH=' "FFMPEG_PATH=$(command -v ffmpeg)" .env php artisan koel:init diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d7ec237636..42961236ce 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -2292,6 +2292,7 @@ $print_logfile_info # - $2 Target setting + value, to inject into config file: After bash string expansion (e.g. variables), everything else will be taken literally, thus no further escaping is required. # - $3 Path to config file # - Optional: $4 Line pattern after which the setting will be added instead of end of file with grep extended regular expression support + # - GCI_PASSWORD=1 G_CONFIG_INJECT, password entry, do not print raw output to screen. # - GCI_PRESERVE=1 G_CONFIG_INJECT preserves current setting, if present. # - GCI_BACKUP=1 G_CONFIG_INJECT creates a backup before editing the file, if backup does not yet exist, to: $3.bak # - GCI_NEWLINE=1 G_CONFIG_INJECT explicitly expands newlines \n within $2, which by default are taken literally diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index b61398da37..0963e2ba22 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -186,7 +186,7 @@ _EOF_ G_WHIP_MENU_ARRAY=('' '●─ Global Options ') G_WHIP_MENU_ARRAY+=('Username' ": [$NORDVPN_USERNAME]") - G_WHIP_MENU_ARRAY+=('Password' ": [$NORDVPN_PASSWORD]") + G_WHIP_MENU_ARRAY+=('Password' ": [${NORDVPN_PASSWORD//?/*}]") G_WHIP_MENU_ARRAY+=('Server' ": [$NORDVPN_SERVER]") if (( $NORDVPN_SERVICE )); then From 52d5106aa88b27b5e47f4a47bf3911ae24aed975 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:26:32 +0200 Subject: [PATCH 135/253] v6.23 + DietPi-Patch | Coding --- dietpi/patch_file | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 1ba4310215..18f567c859 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -76,18 +76,9 @@ # Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 # - We check/apply this already via pre-patches but do as well here since older DietPi version do not yet run pre-patches. - if (( $G_DISTRO < 4 )) && [[ $(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') != 'jessie-support' ]]; then - - if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then - - sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt - - else - - echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt - - fi + if (( $G_DISTRO < 4 )) && ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' DietPi/dietpi.txt; then + G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt Restart_DietPi_Update fi From 98b0f39456c117342f6d815a616a72a2aec43972 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:40:24 +0200 Subject: [PATCH 136/253] v6.23 + DietPi-Pre-patch | Coding and add print info about "jessie-support" migration --- dietpi/pre-patch_file | 52 ++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 28eaa8b0e2..214818ba16 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -74,7 +74,6 @@ #------------------------------------------------------------------------------- # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings - # Pre-patch 6: https://github.com/MichaIng/DietPi/pull/2728 if (( $G_DIETPI_VERSION_SUB < 23 )); then if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then @@ -88,45 +87,52 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } - if (( $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )) && grep -qi 'jessie' /etc/os-release; then + fi + #------------------------------------------------------------------------------- + # Pre-patch 6: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 + # Pre-patch 7: https://github.com/MichaIng/DietPi/pull/2728 + if grep -qi 'jessie' /etc/os-release; then - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 6 | Applying changes to APT sources.list since Debian dropped support for Jessie systems' - if [[ $(uname -m) == 'aarch64' ]]; then + if ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt; then + + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Migrating Jessie systems to "jessie-support" update branch' + if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then - echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=6; break; } + sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt else - sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=6; break; } + echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt fi - fi + # Remove DietPi-Update working directory to allow concurrent execution. + cd /tmp + [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update - fi - # Pre-patch 7: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 - if grep -qi 'jessie' /etc/os-release && [[ $(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') != 'jessie-support' ]]; then + # Apply update forcefully, since user has already chosen to do so. + dietpi-update 1 - if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then + # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish. + kill $PPID + exit - sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt + fi - else + if (( $G_DIETPI_VERSION_SUB < 23 && $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )); then - echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Applying changes to APT sources.list since Debian dropped support for Jessie systems' + if [[ $(uname -m) == 'aarch64' ]]; then - fi + echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=7; break; } + + else - # Remove DietPi-Update working directory to allow concurrent execution. - cd /tmp - [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update + sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=7; break; } - # Apply update forcefully, since user has already chosen to do so. - dietpi-update 1 + fi - # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish. - kill $PPID - exit + fi fi #------------------------------------------------------------------------------- From 25adccfabfb154374eb4ebc30ccab69b07826961 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:47:32 +0200 Subject: [PATCH 137/253] General | Move Jessie systems to "jessie-support" branch (#2742) - DietPi-Update | Migrate Jessie systems to the "jessie-support" branch via pre-patch and regular patch. Older systems do not yet run pre-patches, so we need to apply with `patch_file` as well to catch all of 'em. Newer systems will be migrated via pre-patch which is preferred to prevent download and execution of possibly incompatible code with `patch_file`. --- CHANGELOG.txt | 6 ++++++ dietpi/patch_file | 9 +++++++++ dietpi/pre-patch_file | 41 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84fb08f901..f18d25d5b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,12 @@ v6.23 (XX/04/19) +Jessie support: +- The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 +- As a result we move Jessie systems to a dedicated "jessie-support" branch. Next DietPi v6.24 will still be merged into this branch as well, but for following updates it depends on how much additional related issues we face. +- We highly recommend to migrate to Stretch as fast as possible. +- For Ordoid C1 there is no Stretch image available since its kernel and firmware are not maintained to match minimum requirements. There are reports about successful "apt-get dist-upgrade" migrations and an ARMbian Stretch image is available that can be used as a basis for DietPi-PREP. But these systems face major limitations, especially no GPU (Xserver, Kodi, desktops) support is available. Read more about it or contribute to solutions for Odroid C1 users here: https://github.com/MichaIng/DietPi/issues/2561 + Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 diff --git a/dietpi/patch_file b/dietpi/patch_file index b78be9b3f1..18f567c859 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -74,6 +74,15 @@ } + # Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 + # - We check/apply this already via pre-patches but do as well here since older DietPi version do not yet run pre-patches. + if (( $G_DISTRO < 4 )) && ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' DietPi/dietpi.txt; then + + G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt + Restart_DietPi_Update + + fi + # Pre-v6.17: New ".version" system # - As loaded pre-v6.17 dietpi-update will overwrite ".version" to previous 2 line system, we need to rerun dietpi-update. # Pre-v6.20: New $G_DIETPI_INSTALL_STAGE system diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 7d356bc728..214818ba16 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -74,7 +74,6 @@ #------------------------------------------------------------------------------- # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings - # Pre-patch 6: https://github.com/MichaIng/DietPi/pull/2728 if (( $G_DIETPI_VERSION_SUB < 23 )); then if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then @@ -88,16 +87,48 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; } - if (( $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )) && grep -qi 'jessie' /etc/os-release; then + fi + #------------------------------------------------------------------------------- + # Pre-patch 6: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 + # Pre-patch 7: https://github.com/MichaIng/DietPi/pull/2728 + if grep -qi 'jessie' /etc/os-release; then + + if ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt; then + + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Migrating Jessie systems to "jessie-support" update branch' + if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then + + sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt + + else + + echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt + + fi + + # Remove DietPi-Update working directory to allow concurrent execution. + cd /tmp + [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update + + # Apply update forcefully, since user has already chosen to do so. + dietpi-update 1 + + # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish. + kill $PPID + exit + + fi + + if (( $G_DIETPI_VERSION_SUB < 23 && $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )); then - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 6 | Applying changes to APT sources.list since Debian dropped support for Jessie systems' + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Applying changes to APT sources.list since Debian dropped support for Jessie systems' if [[ $(uname -m) == 'aarch64' ]]; then - echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=6; break; } + echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=7; break; } else - sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=6; break; } + sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=7; break; } fi From c44b3451215c15934fcb40b09fa5d64302b0f3a7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:50:52 +0200 Subject: [PATCH 138/253] v6.23 + DietPi-Patch | Inform about DietPi-Arr_to_RAM only on Stretch and above, since Jessie does not support it: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 --- dietpi/patch_file | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 18f567c859..3689e4eda2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1745,7 +1745,8 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 - if grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then + # - Skip on Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 + if (( $G_DISTRO > 3 )) && grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n From 1d4fccc4d7a71532822bf04cb16374e0de90d0e6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:52:07 +0200 Subject: [PATCH 139/253] v6.23 + CHANGELOG | DietPi-Arr_to_RAM is not supported by Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f18d25d5b4..d7096665c0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,7 +13,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 -- DietPi-Arr_to_RAM | With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 +- DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 - DietPi-Config | Added support to toggle Intel CPU turbo/boost mode. Requires Intel CPU that supports the feature. - DietPi-Config | G_CHECK_URL: Added ability to change the connection attempts and timeout, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 From d0d388ea837809423dc91ed36c9a5e7065e8cb14 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 21:55:18 +0200 Subject: [PATCH 140/253] v6.23 + DietPi-Globals | Don't load DietPi-Arr_to_RAM alias on Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 --- 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 42961236ce..c68b20e0b4 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -562,7 +562,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then [[ -f $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh ]] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" [[ -f /usr/share/applications/kodi.desktop ]] && alias startkodi='/DietPi/dietpi/misc/start_kodi' [[ -f /etc/systemd/system/dietpi-cloudshell.service ]] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' - [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM' + (( $G_DISTRO > 3 )) && [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM' # - occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: [[ -f /var/www/owncloud/occ ]] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } [[ -f /var/www/nextcloud/occ ]] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } From ef179ff2c0749c6395f0d5a6edfdb011d7de7cb9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 28 Apr 2019 23:09:03 +0200 Subject: [PATCH 141/253] v6.23 + DietPi-Arr_to_RAM | Add info that this is not supported on Jessie --- dietpi/misc/dietpi-arr_to_RAM | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index 5505d233ab..7bb7d2c504 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -12,6 +12,7 @@ # - Moves Sonarr, Radarr and Lidarr database files to RAM, leaving symlinks on disk # - Reduces disk I/O and enhances database I/O performance # - Creates a backup first and automatically restores from backup on next start in case of system crash + # NB: Not supported on Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 # USAGE=' Usage: /DietPi/dietpi/misc/dietpi-arr_to_RAM [] From 781f9cbe20cc3c39373cda096e3049fc69cdc484 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 01:25:56 +0200 Subject: [PATCH 142/253] v6.23 + DietPi-Pre-patch | Whoopsie --- dietpi/pre-patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 214818ba16..f0ed8ac6c4 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -111,7 +111,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update # Apply update forcefully, since user has already chosen to do so. - dietpi-update 1 + /DietPi/dietpi/dietpi-update 1 # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish. kill $PPID From a62550a8215304da287d76435070f8cc93fdf542 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 02:14:12 +0200 Subject: [PATCH 143/253] v6.23 + DietPi-Globals | G_CONFIG_INJECT: Coding: Catch and print raw (un-escaped) settings string directly instead of pushing the escaped one through sed to resolve magic characters again. + DietPi-Globals | G_CONFIG_INJECT: Replace password string by asterisks (*) if GCI_PASSWORD=1 is set --- dietpi/func/dietpi-globals | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index c68b20e0b4..1f7a68a6d3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -2308,6 +2308,7 @@ $print_logfile_info [[ $G_PROGRAM_NAME ]] || local G_PROGRAM_NAME='G_CONFIG_INJECT' local pattern=${1//\//\\\/} + local setting_raw=$2 local setting=${2//\\/\\\\}; setting=${setting//./\\.}; setting=${setting//+/\\+}; setting=${setting//\*/\\\*}; setting=${setting//\?/\\\?}; setting=${setting//[/\\[} setting=${setting//\(/\\\(}; setting=${setting//\{/\\\{}; setting=${setting//^/\\^}; setting=${setting//&/\\&}; setting=${setting//$/\\$}; setting=${setting//|/\\|}; setting=${setting//\//\\\/} [[ $GCI_NEWLINE == 1 ]] && setting=${setting//\\\\n/\\n} @@ -2315,6 +2316,14 @@ $print_logfile_info local after=${4//\//\\\/} local error='' + # Replace password string by asterisks in output string + if [[ $GCI_PASSWORD == 1 ]]; then + + setting_raw=$(sed -E "s/^.*$pattern[[:blank:]]*//" <<< "$setting_raw") + setting_raw="$(sed -E "s/(^.*$pattern[[:blank:]]*).*$/\1/" <<< "$setting_raw")${setting_raw//?/*}" + + fi + syntax_error(){ [[ $after ]] && after="after line \$4\n $after (raw escaped input)\n" @@ -2323,7 +2332,7 @@ $print_logfile_info G_WHIP_MSG "[FAILED] Syntax error $error Couldn't add setting \$2 - $setting (raw escaped input) + $setting (escaped input) into file \$3 $file $after @@ -2346,18 +2355,18 @@ NB: Please verify the existence of the file \$3 $file\n Retry with proper permissions or apply the setting manually: - $(sed -E "c\\$setting" <<< '')" + $setting_raw" elif error=$(grep -Eq "^[[:blank:]]*$pattern" $file 2>&1); then # As an error within the condition leads to result "false", it can be caught only in next "elif"/"else" statement. if [[ $GCI_PRESERVE == 1 ]]; then - G_DIETPI-NOTIFY 0 "Current setting in \e[33m$file\e[0m will be preserved: \e[33m$(grep -Em1 "^[[:blank:]]*$pattern" $file | sed 's|\\|\\\\|g')\e[0m" + G_DIETPI-NOTIFY 0 "Current setting in \e[33m$file\e[0m will be preserved: \e[33m$([[ $GCI_PASSWORD == 1 ]] && echo "${setting_raw//\\/\\\\}" || grep -Em1 "^[[:blank:]]*$pattern" $file | sed 's|\\|\\\\|g')\e[0m" elif error=$(grep -Eq "^[[:blank:]]*$setting([[:space:]]|$)" $file 2>&1); then - G_DIETPI-NOTIFY 0 "Desired setting in \e[33m$file\e[0m was already set: \e[33m$(grep -Em1 "^[[:blank:]]*$pattern" $file | sed 's|\\|\\\\|g')\e[0m" + G_DIETPI-NOTIFY 0 "Desired setting in \e[33m$file\e[0m was already set: \e[33m$([[ $GCI_PASSWORD == 1 ]] && echo "${setting_raw//\\/\\\\}" || grep -Em1 "^[[:blank:]]*$pattern" $file | sed 's|\\|\\\\|g')\e[0m" elif error=$( (( $(grep -Ec "^[[:blank:]]*$pattern" $file 2>&1) > 1 )) 2>&1); then [[ $error ]] && { syntax_error; return 1; } @@ -2372,14 +2381,14 @@ $(grep -En "^[[:blank:]]*$pattern" $file) ____________\n Either the pattern \$1 needs to be more specific or the desired setting can appear multiple times by design and it cannot be predicted which instance to edit. Please retry with more specific parameter \$1 or apply the setting manually: - $(sed -E "c\\$setting" <<< '')" + $setting_raw" else [[ $error ]] && { syntax_error; return 1; } [[ $GCI_BACKUP == 1 && ! -f $file.bak ]] && cp -a $file $file.bak && G_DIETPI-NOTIFY 2 "Config file backup created: \e[33m$file.bak\e[0m" error=$(sed -Ei "0,/^[[:blank:]]*$pattern.*$/s//$setting/" $file 2>&1) || { syntax_error; return 1; } - G_DIETPI-NOTIFY 0 "Setting in \e[33m$file\e[0m adjusted: \e[33m$(sed -E "c\\$setting" <<< '' | sed 's|\\|\\\\|g')\e[0m" + G_DIETPI-NOTIFY 0 "Setting in \e[33m$file\e[0m adjusted: \e[33m${setting_raw//\\/\\\\}\e[0m" fi @@ -2388,7 +2397,7 @@ Please retry with more specific parameter \$1 or apply the setting manually: [[ $GCI_BACKUP == 1 && ! -f $file.bak ]] && cp -a $file $file.bak && G_DIETPI-NOTIFY 2 "Config file backup created: \e[33m$file.bak\e[0m" error=$(sed -Ei "0,/^[[:blank:]#;]*$pattern.*$/s//$setting/" $file 2>&1) || { syntax_error; return 1; } - G_DIETPI-NOTIFY 0 "Comment in \e[33m$file\e[0m converted to setting: \e[33m$(sed -E "c\\$setting" <<< '' | sed 's|\\|\\\\|g')\e[0m" + G_DIETPI-NOTIFY 0 "Comment in \e[33m$file\e[0m converted to setting: \e[33m${setting_raw//\\/\\\\}\e[0m" else [[ $error ]] && { syntax_error; return 1; } @@ -2399,7 +2408,7 @@ Please retry with more specific parameter \$1 or apply the setting manually: [[ $GCI_BACKUP == 1 && ! -f $file.bak ]] && cp -a $file $file.bak && G_DIETPI-NOTIFY 2 "Config file backup created: \e[33m$file.bak\e[0m" error=$(sed -Ei "0,/^[[:blank:]]*$after.*$/s//&\n$setting/" $file 2>&1) || { syntax_error; return 1; } - G_DIETPI-NOTIFY 0 "Added setting \e[33m$(sed -E "c\\$setting" <<< '' | sed 's|\\|\\\\|g')\e[0m to \e[33m$file\e[0m after line \e[33m$(grep -Em1 "^[[:blank:]]*$after" $file | sed 's|\\|\\\\|g')\e[0m" + G_DIETPI-NOTIFY 0 "Added setting \e[33m${setting_raw//\\/\\\\}\e[0m to \e[33m$file\e[0m after line \e[33m$(grep -Em1 "^[[:blank:]]*$after" $file | sed 's|\\|\\\\|g')\e[0m" else [[ $error ]] && { syntax_error; return 1; } @@ -2410,7 +2419,7 @@ The pattern \$4 could not be found in file \$3 $file\n Please retry with valid parameter \$4 or apply the setting manually: - $(sed -E "c\\$setting" <<< '')" + $setting_raw" fi @@ -2420,7 +2429,7 @@ Please retry with valid parameter \$4 or apply the setting manually: # The following sed does not work on empty files: [[ ! -s $file ]] && echo '# Added by DietPi:' >> $file error=$(sed -Ei "\$a\\$setting" $file 2>&1) || { syntax_error; return 1; } - G_DIETPI-NOTIFY 0 "Added setting \e[33m$(sed -E "c\\$setting" <<< '' | sed 's|\\|\\\\|g')\e[0m to end of file \e[33m$file\e[0m" + G_DIETPI-NOTIFY 0 "Added setting \e[33m${setting_raw//\\/\\\\}\e[0m to end of file \e[33m$file\e[0m" fi @@ -2429,9 +2438,9 @@ Please retry with valid parameter \$4 or apply the setting manually: } #----------------------------------------------------------------------------------- - (( $G_DEBUG == 1 )) && G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' + [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 2 'DietPi-Globals loaded' #----------------------------------------------------------------------------------- - #return exit code 0, by triggering null as last command to output + # Return exit code 0, by triggering null as last command to output : #----------------------------------------------------------------------------------- From f4d7ac6baca3b1bb8d6164aacf1814dd952b0ae2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 02:19:48 +0200 Subject: [PATCH 144/253] v6.23 + DietPi-Patch | Whoopsie --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 3689e4eda2..c0e4620b0b 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -76,7 +76,7 @@ # Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 # - We check/apply this already via pre-patches but do as well here since older DietPi version do not yet run pre-patches. - if (( $G_DISTRO < 4 )) && ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' DietPi/dietpi.txt; then + if (( $G_DISTRO < 4 )) && ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt; then G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt Restart_DietPi_Update From d527caec9e9ce706d901d00c40c0bd29e6fd7f1e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 03:15:00 +0200 Subject: [PATCH 145/253] v6.23 + DietPi-Drive_Manager | Revert to correct bind mount removal from df output via target AND source string match against $6 --- dietpi/dietpi-drive_manager | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9b92684137..4924ff1e4b 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -142,53 +142,54 @@ tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0" swap_mount=$(grep -m1 '[[:blank:]]swap[[:blank:]]' $FP_TEMP_FSTAB) tmpfs_mounts=$(grep '^tmpfs[[:blank:]]' $FP_TEMP_FSTAB) + # encryptfs, vboxsf, bind mounts misc_mounts=$(grep -E '([[:blank:],]bind[[:blank:],]|[[:blank:]](encryptfs|vboxsf)[[:blank:]])' $FP_TEMP_FSTAB) # CurlFtpFS, CIFS/SMB/Samba, NFS - net_mounts=$(grep -E '(^curlftpfs|[[:blank:]](cifs|nfs[4]?)[[:blank:]])' $FP_TEMP_FSTAB) + net_mounts=$(grep -E '(^curlftpfs|[[:blank:]](cifs|nfs4?)[[:blank:]])' $FP_TEMP_FSTAB) fi echo "# Please use \"dietpi-drive_manager\" to setup mounts -#----------------------------------------------------------- +#---------------------------------------------------------------- # NETWORK -#----------------------------------------------------------- +#---------------------------------------------------------------- $net_mounts -#----------------------------------------------------------- +#---------------------------------------------------------------- # TMPFS -#----------------------------------------------------------- +#---------------------------------------------------------------- $tmpfs_mounts -#----------------------------------------------------------- -# MISC: bind, encryptfs, vboxsf (VirtualBox shared folder) -#----------------------------------------------------------- +#---------------------------------------------------------------- +# MISC: encryptfs, vboxsf (VirtualBox shared folder), bind mounts +#---------------------------------------------------------------- $misc_mounts -#----------------------------------------------------------- +#---------------------------------------------------------------- # SWAPFILE -#----------------------------------------------------------- +#---------------------------------------------------------------- $swap_mount -#----------------------------------------------------------- +#---------------------------------------------------------------- # PHYSICAL DRIVES -#-----------------------------------------------------------" > $FP_TEMP_FSTAB +#----------------------------------------------------------------" > $FP_TEMP_FSTAB # Detect mounted drives and add them to fstab G_DIETPI-NOTIFY 2 'Detecting drives, please wait...' df -Pha | tail -n +2 > .dietpi-drive_manager_df_tmp - # - Remove items from list - # Misc: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374 + # - Remove misc items from list + # bind: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374 while read line do [[ $line ]] || continue - # - Misc - local input_mount_source=$(mawk '{print $1}' <<< $line) local input_mount_target=$(mawk '{print $2}' <<< $line) - sed -i "\#^$input_mount_source[[:blank:]]#d" .dietpi-drive_manager_df_tmp sed -i "\#[[:blank:]]$input_mount_target$#d" .dietpi-drive_manager_df_tmp + # - target + source removal via $6 required for bind mounts: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-417413867 + local input_mount_source=$(mawk '{print $1}' <<< $line) + sed -i "\#[[:blank:]]$input_mount_source$#d" .dietpi-drive_manager_df_tmp [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 0 " - Detected misc mount and removed from df scrape: $input_mount_source > $input_mount_target" done <<< "$misc_mounts" From 5a49812631a38b74637dc84487f032d49ac8fa10 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 03:19:40 +0200 Subject: [PATCH 146/253] v6.23 + CHANGELOG | Remove resolved outstanding issue + CHANGELOG | Update release month, as we will not pass beta until end of April --- CHANGELOG.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d7096665c0..f825a7f2e1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,6 @@ v6.23 -(XX/04/19) +(XX/05/19) Jessie support: - The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 @@ -52,7 +52,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-Config | RPi: Enabling OpenGL/VC4 causes sound card selection to be invalid: https://github.com/MichaIng/DietPi/issues/2173 -- DietPi-Drive_Manager | encryptfs is currently not supported and will be removed from fstab when executing drive manager: https://github.com/MichaIng/DietPi/issues/2078 - RPi | LXAppearance (on LXDE desktop) hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791 - Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955 - Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584 From 4e62739a0e995e5e98c650e0877bd32669073fbe Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 03:22:15 +0200 Subject: [PATCH 147/253] v6.23 + dietpi.txt | Tiny --- dietpi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 77d9e7a2e8..444e381da5 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -154,7 +154,7 @@ CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 #Proxy settings | System-wide proxy settings -# NB: Do not modify, you must use dietpi-config > "Networking Options: Adapters" to apply +# NB: Do not modify, you must use dietpi-config > "Network Options: Adapters" to apply CONFIG_PROXY_ADDRESS=MyProxyServer.com CONFIG_PROXY_PORT=8080 CONFIG_PROXY_USERNAME= From 84caa06ec54b4cc5c03763a0e41d8e6d064ed4b3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 17:46:01 +0200 Subject: [PATCH 148/253] v6.23 + DietPi-Config | Wrap all G_CHECK_VALIDINT $1 arguments into double quotes to prevent possible argument splitting --- dietpi/dietpi-config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 11335083de..939d709d3b 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -664,7 +664,7 @@ G_WHIP_DEFAULT_ITEM=$current_brightness G_WHIP_INPUTBOX "Please enter a brightness value:\n - Min = $MIN_VALUE | Max = $MAX_VALUE" - if (( $? == 0 )) && G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then + if (( $? == 0 )) && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then # - apply echo $G_WHIP_RETURNED_VALUE > $fp_brightness/brightness @@ -1497,7 +1497,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 if G_WHIP_INPUTBOX 'Please enter the required I2C baudrate frequency (kHz).'; then # Check valid int - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE; then + if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE"; then /DietPi/dietpi/func/dietpi-set_hardware i2c "$G_WHIP_RETURNED_VALUE" REBOOT_REQUIRED=1 @@ -1673,7 +1673,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_INPUTBOX "After Ondemand throttles up, how long before the next sample to check if CPU clocks can be reduced.\n\n - This value * 'Ondemand Sample Rate' = total miliseconds\n - Lower values may help reduce power consumption, however, a 500-1000ms value is recommended to prevent excessive sampling.\n - Valid range: $MIN_VALUE - $MAX_VALUE\n\nIf unsure, set any value, 'Ondemand Down Factor' option on the next screen will list the calculated miliseconds." if (( $? == 0 )); then - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then + if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then G_CONFIG_INJECT 'CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' "CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_cpu @@ -1719,7 +1719,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_INPUTBOX "Please enter a sample rate in milliseconds, for Ondemand to check if it needs to increase CPU clocks.\nA lower value will make the system more responsive.\n - valid range: $MIN_VALUE - $MAX_VALUE" if (( $? == 0 )); then - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then + if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then G_CONFIG_INJECT 'CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' "CONFIG_CPU_ONDEMAND_SAMPLE_RATE=$(( $G_WHIP_RETURNED_VALUE * 1000 ))" /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_cpu @@ -1870,7 +1870,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_INPUTBOX "When the CPU usage (%) is greater than this value, the CPU frequency will increase from $frequency_min_cpu_governor MHz to $frequency_max_cpu_governor MHz.\n - Valid range $MIN_VALUE - $MAX_VALUE\n - Recommended settings: Desktop = 50%, Server = 85%" if (( $? == 0 )); then - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then + if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then G_CONFIG_INJECT 'CONFIG_CPU_USAGE_THROTTLE_UP=' "CONFIG_CPU_USAGE_THROTTLE_UP=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_cpu @@ -1889,7 +1889,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 G_WHIP_INPUTBOX "When the ARM temperature ('c) reaches this value, the ARM will underclock to reduce heat. \n - Recommended value is 65 \n - Valid range $MIN_VALUE - $MAX_VALUE" if (( $? == 0 )); then - if G_CHECK_VALIDINT $G_WHIP_RETURNED_VALUE $MIN_VALUE $MAX_VALUE; then + if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then if (( $G_WHIP_RETURNED_VALUE > 65 )); then @@ -2221,14 +2221,14 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 NET_RX_BYTE=$( Date: Mon, 29 Apr 2019 21:05:49 +0200 Subject: [PATCH 149/253] v6.23 + DietPi-Patch | Re-create /etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf symlink if not existent: https://github.com/MichaIng/DietPi/issues/2505 --- dietpi/patch_file | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index c0e4620b0b..7bf48f504b 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1867,6 +1867,14 @@ Your Nextcloud data are not touched.' fi + fi + #----------------------------------------------------------------------- + # Re-create /etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf symlink if not existent: https://github.com/MichaIng/DietPi/issues/2505 + if [[ ! -L '/etc/sysctl.d/99-sysctl.conf' ]]; then + + [[ -e '/etc/sysctl.d/99-sysctl.conf' ]] && mv /etc/sysctl.d/99-sysctl.conf /etc/sysctl.conf + ln -sf ../sysctl.conf /etc/sysctl.d/99-sysctl.conf + fi #----------------------------------------------------------------------- # Reinstalls From 08d2511963b3e42ba93ad50d3bec33fcbe3d62fc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 29 Apr 2019 21:35:16 +0200 Subject: [PATCH 150/253] v6.23 + DietPi-PREP | RPi: Allow APT PDiffs + DietPi-PREP | DietPi system detected: Disable and remove all found DietPi services + DietPi-PREP | Coding: Simplify existing DietPi data removal and catch more of 'em --- PREP_SYSTEM_FOR_DIETPI.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c01dc64d54..15505d1176 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -41,6 +41,9 @@ # - NB: This needs to match the method in: /DietPi/dietpi/func/dietpi-set_hardware preferipv4 enable echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 + # Allow PDiffs on RPi since the "slow implementation" argument is outdated and PDiffs allow lower download size and less disk I/O + [[ -f '/etc/apt/apt.conf.d/50raspi' ]] rm /etc/apt/apt.conf.d/50raspi + # Check/install minimal APT Pre-Reqs a_MIN_APT_PREREQS=( @@ -56,9 +59,9 @@ # Removing conflicting /etc/apt/sources.list.d entries # - Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 - [[ -f /etc/apt/sources.list.d/deb-multimedia.list ]] && rm /etc/apt/sources.list.d/deb-multimedia.list + [[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm /etc/apt/sources.list.d/deb-multimedia.list # - OMV: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10594 - [[ -f /etc/apt/sources.list.d/openmediavault.list ]] && rm /etc/apt/sources.list.d/openmediavault.list + [[ -f '/etc/apt/sources.list.d/openmediavault.list' ]] && rm /etc/apt/sources.list.d/openmediavault.list # Fixing sources.list due to Debian dropped Jessie support: https://github.com/MichaIng/DietPi/issues/2665 if grep -qi 'jessie' /etc/os-release && ! grep -qi 'raspbian' /etc/os-release; then @@ -256,24 +259,27 @@ G_DIETPI-NOTIFY 2 'DietPi system found, running pre-prep' - # - Stop services + # - Stop services: RAMdisk includes (Pre|Post)Boot due to dependencies [[ -f /DietPi/dietpi/dietpi-services ]] && /DietPi/dietpi/dietpi-services stop - [[ -f /etc/systemd/system/dietpi-ramdisk.service ]] && systemctl stop dietpi-ramdisk [[ -f /etc/systemd/system/dietpi-ramlog.service ]] && systemctl stop dietpi-ramlog + [[ -f /etc/systemd/system/dietpi-ramdisk.service ]] && systemctl stop dietpi-ramdisk + + # - Disable services + for i in /etc/systemd/system/dietpi-* + do + + [[ -f $i ]] || continue + systemctl disable ${i##*/} + rm $i + + fi # - Delete any previous existing data # Failsafe umount /DietPi [[ -d /DietPi ]] && rm -R /DietPi - [[ -d /boot/dietpi ]] && rm -R /boot/dietpi - - [[ -d /mnt/dietpi-backup ]] && rm -R /mnt/dietpi-backup - [[ -d /mnt/dietpi-sync ]] && rm -R /mnt/dietpi-sync - [[ -d /mnt/dietpi_userdata ]] && rm -R /mnt/dietpi_userdata - - [[ -d /etc/dietpi ]] && rm -R /etc/dietpi # Pre v160 - [[ -d /var/lib/dietpi ]] && rm -R /var/lib/dietpi - [[ -d /var/tmp/dietpi ]] && rm -R /var/tmp/dietpi + rm -Rf /{boot,mnt,etc,var/lib,var/tmp}/dietpi* + rm -f /etc/{bashrc,profile,sysctl}.d/dietpi* [[ -f /root/DietPi-Automation.log ]] && rm /root/DietPi-Automation.log [[ -f /boot/Automation_Format_My_Usb_Drive ]] && rm /boot/Automation_Format_My_Usb_Drive From cd6ccd386822322693cfa93c88f55ab2f3eec952 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 30 Apr 2019 12:56:13 +0100 Subject: [PATCH 151/253] Allow Jessie PREP For jessie-support EOL only. And, so I can make a final C1 image :smile: --- PREP_SYSTEM_FOR_DIETPI.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c01dc64d54..aea4b2eba8 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -454,7 +454,8 @@ # Distro Selection DISTRO_LIST_ARRAY=( - + + '3' ': Jessie-support' '4' ': Stretch (current stable release, recommended)' '5' ': Buster (testing only, not officially supported)' @@ -500,7 +501,11 @@ fi DISTRO_TARGET=$G_WHIP_RETURNED_VALUE - if (( $DISTRO_TARGET == 4 )); then + if (( $DISTRO_TARGET == 3 )); then + + DISTRO_TARGET_NAME='jessie' + + elif (( $DISTRO_TARGET == 4 )); then DISTRO_TARGET_NAME='stretch' @@ -651,7 +656,6 @@ _EOF_ 'curl' # Web address testing, downloading, uploading etc. 'debconf' # APT package pre-configuration, e.g. "debconf-set-selections" for non-interactive install 'dirmngr' # GNU key management required for some APT installs via additional repos - 'dropbear-run' # DietPi default SSH-Client, excluding initramfs integration 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'gnupg' # apt-key add @@ -676,6 +680,16 @@ _EOF_ 'whiptail' # DietPi dialogs ) + + if (( $DISTRO_TARGET == 3 )); then + + aPACKAGES_REQUIRED_INSTALL+=('dropbear') # DietPi default SSH-Client + + else + + aPACKAGES_REQUIRED_INSTALL+=('dropbear-run') # DietPi default SSH-Client, excluding initramfs integration + + fi # - G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273 if (( $G_HW_MODEL > 9 )); then From 8fff7aba4479fdd38f10a8db9c13ad75fdd451b2 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 30 Apr 2019 13:42:18 +0100 Subject: [PATCH 152/253] Apply process tool if services starting. --- dietpi/misc/dietpi-arr_to_RAM | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index 7bb7d2c504..e9bb0ab209 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -225,6 +225,7 @@ $USAGE"; exit 1; } Print "Enqueuing$start_services service start(s)..." systemctl --no-block start $start_services + systemctl -q is-active dietpi-postboot && /DietPi/dietpi/dietpi-process_tool 1 fi From 6bdb85bd44230e9bf2d9609bc5e605417677771e Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 30 Apr 2019 14:03:51 +0100 Subject: [PATCH 153/253] + branch selection --- PREP_SYSTEM_FOR_DIETPI.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index aea4b2eba8..cdfb88bec2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -136,13 +136,11 @@ # Select gitbranch aWHIP_BRANCH=( - 'master' ': Stable release (recommended)' - 'beta' ': Public beta testing branch' - 'dev' ': Unstable dev branch' + 'jessie-support' ': Stable EOL release (recommended)' ) - if WHIP_RETURN=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then + if WHIP_RETURN=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'jessie-support' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then G_GITBRANCH=$WHIP_RETURN From ae5cbf3f858f977b42b7bc087d2915b5d130c44c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 30 Apr 2019 17:00:53 +0100 Subject: [PATCH 154/253] syntax --- 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 15505d1176..18b8ed64f4 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -42,7 +42,7 @@ echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 # Allow PDiffs on RPi since the "slow implementation" argument is outdated and PDiffs allow lower download size and less disk I/O - [[ -f '/etc/apt/apt.conf.d/50raspi' ]] rm /etc/apt/apt.conf.d/50raspi + [[ -f '/etc/apt/apt.conf.d/50raspi' ]] && rm /etc/apt/apt.conf.d/50raspi # Check/install minimal APT Pre-Reqs a_MIN_APT_PREREQS=( @@ -272,7 +272,7 @@ systemctl disable ${i##*/} rm $i - fi + done # - Delete any previous existing data # Failsafe From 8bc33bdb58d0554d2498506ac46b4b1033db6284 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 20:07:28 +0200 Subject: [PATCH 155/253] v6.23 + DietPi-Software | LXQt: Since on Buster no leafpad is available, install mousepad instead, which is also the automatically installed alternative with LXDE + DietPi-Software | LXQt: Check dietpi.com desktop entries/icons URL as we for other desktops --- dietpi/dietpi-software | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0644f7e1a7..69c36ab160 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3232,10 +3232,14 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di Banner_Installing # - For desktop entries/icons hosted on dietpi.com - #INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' - #G_CHECK_URL "$INSTALL_URL_ADDRESS" + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + + # - Buster: No leafpad available, use mousepad instead: https://packages.debian.org/search?keywords=leafpad + local editor='leafpad' + (( $G_DISTRO > 4 )) && editor='mousepad' - G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad speedcrunch + G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch fi @@ -3265,7 +3269,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - software_id=25 # DESKTOP_XFCE + software_id=25 # Desktop Xfce if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing From 74b82f3ebbde10996aa3ce535a8d472f000c54ca Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 20:43:56 +0200 Subject: [PATCH 156/253] v6.23 + DietPi-Software | Kodi: On RPi (Kodi 18) fbset is required to start Kodi with custom resolution: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 --- dietpi/dietpi-software | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 69c36ab160..aca43e8c2b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4040,7 +4040,7 @@ _EOF_ local package_list='kodi-odroid' - # XU4 - requires pulse audio (fixes corrupt sound) + # - XU4: Requires pulse audio (fixes corrupt sound) (( $G_HW_MODEL == 11 )) && package_list+=' pulseaudio' # Everything else @@ -4048,6 +4048,9 @@ _EOF_ local package_list='kodi' + # - RPi: Kodi 18 requires fbset to start with custom screen resolution: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 + (( $G_HW_MODEL < 10 )) && package_list+=' fbset' + fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/MichaIng/DietPi/issues/446 From f99e1bebc6ee0e1c87ada3911d4c05ad6b2ad74a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 20:45:57 +0200 Subject: [PATCH 157/253] v6.23 + CHANGELOG | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f825a7f2e1..369b61e44d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -46,6 +46,7 @@ Bug Fixes: - DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 - DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. +- DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From a6a4b62984aa0a152c7af00e8b856fe9c787d768 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 21:39:37 +0200 Subject: [PATCH 158/253] v6.23 + DietPi-Software | LXQt: Skip disabling trash on Buster via libfm.conf, since the related APT package is no dependency there (thus not installed) so trash seems to be implemented differently --- dietpi/dietpi-software | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index aca43e8c2b..764f64e747 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7159,8 +7159,7 @@ _EOF_ local software_id=-1 - #DESKTOP_LXDE - software_id=23 + software_id=23 # Desktop LXDE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7202,8 +7201,7 @@ _EOF_ fi - #Desktop MATE - software_id=24 + software_id=24 # Desktop MATE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7222,23 +7220,22 @@ _EOF_ fi - #Desktop LXQt - software_id=173 + software_id=173 # Desktop LXQt if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration # - Configs Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config - # - Disable Trash - G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf + # - 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 fi - #Desktop GNUStep - software_id=26 + software_id=26 # Desktop GNUStep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7246,8 +7243,7 @@ _EOF_ fi - #DESKTOP_XFCE - software_id=25 + software_id=25 # Desktop Xfce if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration From 5245a6c39d5b001ac9f70cc172a26db33a04a32f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 22:09:37 +0200 Subject: [PATCH 159/253] v6.23 + DietPi-Banner | Make $fp_motd a source-able to allow system/setup/software targeted messages. The script creates the $motd variable to print. --- dietpi/func/dietpi-banner | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index e80bbc1c4a..c2ed6c7e4a 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -207,11 +207,16 @@ $GREEN_LINE" (( ${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)" #8: Freespace (DietPi userdata) (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom - local fp_motd='/tmp/.dietpi_motd' if (( ${aENABLED[12]} == 1 )); then + local fp_motd='/tmp/.dietpi_motd' [[ -f $fp_motd ]] || curl -sLm 2 https://dietpi.com/motd > $fp_motd - [[ -f $fp_motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $(<$fp_motd)" #12: MOTD + if [[ -f $fp_motd ]]; then + + . $fp_motd # Creates $motd variable + echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" #12: MOTD + + fi fi echo -e "$GREEN_LINE\n" From 26cffb70639309df6c9681ff10cf16c4c2fbb2dd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 22:25:52 +0200 Subject: [PATCH 160/253] v6.23 + DietPi Cron.Daily | Download new MOTD via cron job, if enabled, to allow faster execution of next banner print --- rootfs/etc/cron.daily/dietpi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index c85f8eb36b..85aa1213dc 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -13,20 +13,20 @@ #---------------------------------------------------------------- # Main Loop #---------------------------------------------------------------- - #Time sync update, if mode 2 (daily) is detected + # Time sync update, if mode 2 (daily) is detected if grep -qi '^[[:blank:]]*CONFIG_NTP_MODE=2' /DietPi/dietpi.txt; then /DietPi/dietpi/func/run_ntpd 1 &> /dev/null & fi #---------------------------------------------------------------- - #Check/Update DietPi + # Check/Update DietPi if grep -qi '^[[:blank:]]*CONFIG_CHECK_DIETPI_UPDATES=1' /DietPi/dietpi.txt; then # - Check and update if grep -qi '^[[:blank:]]*CONFIG_AUTO_DIETPI_UPDATES=1' /DietPi/dietpi.txt; then - /DietPi/dietpi/dietpi-update 1 + /DietPi/dietpi/dietpi-update 1 &> /dev/null # - Check only else @@ -37,16 +37,19 @@ fi #---------------------------------------------------------------- - #DietPi-Sync daily - if [[ -f /DietPi/dietpi/.dietpi-sync_settings ]] && - grep -qi 'SYNC_CRONDAILY=1' /DietPi/dietpi/.dietpi-sync_settings; then + # DietPi-Sync daily + if [[ -f '/DietPi/dietpi/.dietpi-sync_settings' ]] && grep -q 'SYNC_CRONDAILY=1' /DietPi/dietpi/.dietpi-sync_settings; then /DietPi/dietpi/dietpi-sync 1 &> /dev/null & fi #---------------------------------------------------------------- - #Clear DietPi motd - [[ -f /tmp/.dietpi_motd ]] && rm /tmp/.dietpi_motd & + # Refresh DietPi MOTD + if [[ -f '/DietPi/dietpi/.dietpi-banner' ]] && grep -q 'aENABLED[12]=1' /DietPi/dietpi/.dietpi-banner; then + + curl -sL https://dietpi.com/motd > /tmp/.dietpi_motd & + + fi #---------------------------------------------------------------- exit #---------------------------------------------------------------- From 57c629b0c137e6737579db715be7e5edfcc54a41 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 22:35:03 +0200 Subject: [PATCH 161/253] v6.23 + DietPi-Banner | MOTD requires DietPi-Globals --- dietpi/func/dietpi-banner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index c2ed6c7e4a..9d75fac5b2 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -188,7 +188,7 @@ $GREEN_LINE" Print_Banner(){ # - Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen - [[ ${aENABLED[2]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals + [[ ${aENABLED[2]} != 1 && ${aENABLED[12]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals # - Re-obtain network details if missing and LAN IP chosen [[ ${aENABLED[5]} != 1 || -f '/DietPi/dietpi/.network' ]] || /DietPi/dietpi/func/obtain_network_details From 5e9e68a203b9ea4b05d0f230be8c8a2433f63960 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 30 Apr 2019 23:07:02 +0200 Subject: [PATCH 162/253] v6.23 + DietPi-Globals | G_CONFIG_INJECT: Fix password string --- dietpi/func/dietpi-globals | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 1f7a68a6d3..0a97b4e716 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -2319,8 +2319,10 @@ $print_logfile_info # Replace password string by asterisks in output string if [[ $GCI_PASSWORD == 1 ]]; then - setting_raw=$(sed -E "s/^.*$pattern[[:blank:]]*//" <<< "$setting_raw") - setting_raw="$(sed -E "s/(^.*$pattern[[:blank:]]*).*$/\1/" <<< "$setting_raw")${setting_raw//?/*}" + local password='' + password=$(sed -E "s/^.*$pattern[[:blank:]]*//" <<< "$setting_raw") + setting_raw="$(sed -E "s/(^.*$pattern[[:blank:]]*).*$/\1/" <<< "$setting_raw")${password//?/*}" + unset password fi From f589b4f362b63eacbd51153188a5dcc7cf201b34 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 1 May 2019 15:28:53 +0200 Subject: [PATCH 163/253] v6.23 + DietPi-Drive_Manager | Fix scraping comment lines as swap and misc mounts --- 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 4924ff1e4b..bcc15f2dd6 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -140,10 +140,10 @@ tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0" # Else: Grab current mounts else - swap_mount=$(grep -m1 '[[:blank:]]swap[[:blank:]]' $FP_TEMP_FSTAB) + swap_mount=$(grep -m1 '^[[:blank:]]*[^#].*[[:blank:]]swap[[:blank:]]' $FP_TEMP_FSTAB) tmpfs_mounts=$(grep '^tmpfs[[:blank:]]' $FP_TEMP_FSTAB) # encryptfs, vboxsf, bind mounts - misc_mounts=$(grep -E '([[:blank:],]bind[[:blank:],]|[[:blank:]](encryptfs|vboxsf)[[:blank:]])' $FP_TEMP_FSTAB) + misc_mounts=$(grep -E '^[[:blank:]]*[^#].*([[:blank:],]bind[[:blank:],]|[[:blank:]](encryptfs|vboxsf)[[:blank:]])' $FP_TEMP_FSTAB) # CurlFtpFS, CIFS/SMB/Samba, NFS net_mounts=$(grep -E '(^curlftpfs|[[:blank:]](cifs|nfs4?)[[:blank:]])' $FP_TEMP_FSTAB) From e0311954491051461efead31a5df12a7bd177703 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 1 May 2019 14:41:32 +0100 Subject: [PATCH 164/253] Workaround for C1 Jessie serial kernel dump --- dietpi/func/dietpi-set_hardware | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4579fc003a..3a8659599d 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1467,8 +1467,13 @@ Do you want to continue and disable the serial login console?'; then Serial_Main(){ #------------------------------------------------------------------------------------- + #C1 on 3.x with Jessie, causes kernel hang. + if (( $G_HW_MODEL == 10 )); then + + echo 'Not supported' + # Enable - if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then + elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then # Enable for specific Serial/UART device if [[ $INPUT_ADDITIONAL ]]; then From 946cb11e4fc1d519543578181b5fcba03dadcb5e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 1 May 2019 17:35:46 +0200 Subject: [PATCH 165/253] v6.23 (#2753) + DietPi-Software | Java: On Jessie, download our self-hosted packages, since jessie-backports branch has been removed from Debian repo which was the source for OpenJDK 8 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 52 +++++++++++++++++------------------------- dietpi/patch_file | 3 +++ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 369b61e44d..2d3eac078c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -47,6 +47,7 @@ Bug Fixes: - DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 +- DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 764f64e747..b76e5b6690 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6775,28 +6775,28 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - local packages='ca-certificates-java openjdk-8-jre-headless openjdk-8-jdk-headless' + # On Jessie we need to our self-hosted packages: + if (( $G_DISTRO < 4 )); then - # On Jessie use backports repo: - if (( $G_DISTRO == 3 )); then + Download_Install "https://dietpi.com/downloads/binaries/jessie/openjdk-8-jre_$G_HW_ARCH_DESCRIPTION.7z" + Download_Install "https://dietpi.com/downloads/binaries/jessie/openjdk-8-jdk_$G_HW_ARCH_DESCRIPTION.7z" + dpkg --force-hold,confdef,confold -i ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb + G_AGF + rm ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb + - cat << _EOF_ > /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk -Package: ca-certificates-java java-common openjdk-8-* -Pin: release a=jessie-backports -Pin-Priority: 990 -_EOF_ + else - packages+=' -t jessie-backports' + local packages='ca-certificates-java openjdk-8-jre-headless openjdk-8-jdk-headless' + # Workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524 + apt-get install -y -qq $packages + G_AGI $packages fi - # Workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524 - apt-get install -y -qq $packages - G_AGI $packages - fi - software_id=9 + software_id=9 # Node.js if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6812,7 +6812,7 @@ _EOF_ fi - software_id=130 + software_id=130 # Python pip if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6831,48 +6831,40 @@ _EOF_ fi - #SDL2 - software_id=140 + software_id=140 # SDL2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #X86_64 + # X86_64 if (( $G_HW_ARCH == 10 )); then # G_AGI libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 libsdl2-net-2.0-0 libsdl2-mixer-2.0-0 INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-x86_64_stretch.7z' - #ARMv6 + # ARMv6 elif (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv6_stretch.7z' - #ARMv7 FKMS: + # ARMv7 FKMS: # ./configure --disable-video-rpi --enable-video-kmsdrm elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv7_stretch.7z' # - RPi 2/3 Enable fkms OpenGL - if (( $G_HW_MODEL < 10 )); then - - /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d - - fi + (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d fi Download_Install "$INSTALL_URL_ADDRESS" sdl2 - dpkg -i sdl2/*.deb - rm -R sdl2 fi - #Mono repo - software_id=150 + software_id=150 # Mono runtime if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -14536,9 +14528,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - apt-mark auto $(dpkg --get-selections default-jre* default-jdk* openjdk-* | mawk '{print $1}') ca-certificates-java - [[ -f /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk ]] && rm /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 7bf48f504b..c2722ee5ae 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1742,6 +1742,9 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" # dietpi-set_dphys-swapfile renamed to: "dietpi-set_swapfile": https://github.com/MichaIng/DietPi/pull/2720 rm -f /{DietPi,boot}/dietpi/func/dietpi-set_dphys-swapfile #------------------------------------------------------------------------------- + # Remove obsolete OpenJDK APT preferences on Jessie: https://github.com/MichaIng/DietPi/pull/2753 + [[ -f '/etc/apt/preferences.d/99-dietpi-openjdk-8-jdk' ]] && rm /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk + #------------------------------------------------------------------------------- if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 From 173b2d403d2908d7feee0e56395f2794f48a3ec5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 1 May 2019 23:12:07 +0200 Subject: [PATCH 166/253] v6.23 + DietPi-Software | New Wiki page allows to remove detailed comments from the script about how to implement a new software title: https://github.com/MichaIng/DietPi/wiki/How-to-implement-a-new-software-title + DietPi-Software | Britishise wording "ize" => "ise" :) + DietPi-Software | Emonhub: Revert GitHub download URL to Fourdee + DietPi-Software | PHP: Install PHP7+ specific module packages on all distro versions now since all DietPi systems are migrated to PHP7.3 --- dietpi/dietpi-software | 295 ++++++++++------------------------------- 1 file changed, 69 insertions(+), 226 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b76e5b6690..afc4b3a621 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9,16 +9,17 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/dietpi-software - # - Installs "ready to run" software with optimizations unique to the device. + # - Location: /DietPi/dietpi/dietpi-software + # - Installs "ready to run" software with optimisations unique to the device. # - Generates and uses /DietPi/dietpi/.installed (software list) # -1=selected for uninstall, 0=not installed, 1=selected for install, 2=installed # # Usage: - # - dietpi-software - # - /DietPi/dietpi/dietpi-software install iUNIQUEID (OR) sINDEX_{SSHSERVER,FILESERVER,LOGGING,WEBSERVER}_TARGET=-int - # - /DietPi/dietpi/dietpi-software reinstall #Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: xserver removes kodi), simply flags to be installed (=1). - # - /DietPi/dietpi/dietpi-software uninstall iUNIQUEID - # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software. + # - dietpi-software # Menu to select software for (un)install + # - dietpi-software install $software_id (OR) $INDEX_{SSHSERVER,FILESERVER,LOGGING,WEBSERVER}_TARGET=-int + # - dietpi-software reinstall # Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: Xserver removes Kodi), simply flags to be installed (=1). + # - dietpi-software uninstall $software_id + # - dietpi-software list # Lists all available software titles with ID and info + # - dietpi-software free # List currently unused software IDs to be used for new software implementations #//////////////////////////////////// # Import DietPi-Globals --------------------------------------------------------------- @@ -135,6 +136,7 @@ _EOF_ # - Use /etc/apt/sources.list for connection test optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + # Time sync /DietPi/dietpi/func/run_ntpd } @@ -250,71 +252,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it declare -A aSOFTWARE_AVAIL_G_HW_ARCH declare -A aSOFTWARE_AVAIL_G_DISTRO - #///////////////////////////////////////////////////////////////////////////////////// - # This function generates the array for all the software available for installation. - # - # Reference: - # - Adding new software to DietPi-Software: - # https://github.com/MichaIng/DietPi/issues/490#issuecomment-244416570 - # - # Adding software to the install list: - # ------------------------------------ - # - software_id: - # This is the next number in the sequence. Each software install has a unique number, - # so it can be referenced in all arrays. This has to be the same for install, uninstall - # and setting up the service. Run "dietpi-software list | grep ''" to - # get the next number in the sequence. Ensure that you are running a testing build, as - # release may be behind the testing branch and available software packages. - # - # - aSOFTWARE_WHIP_NAME[$software_id]: - # This is the name to display in the UI. - # - # - aSOFTWARE_WHIP_DESC[$software_id]: - # This is the description to place next to the name in the UI. - # - # - aSOFTWARE_CATEGORY_INDEX[$software_id]: - # If you are adding a new piece of software, first choose the category it belongs to - # (see aSOFTWARE_CATEGORIES_DIETPI and aSOFTWARE_CATEGORIES_LINUX below), which will - # give you the aSOFTWARE_CATEGORY_INDEX to set. In the example below this is 0. - # - # - aSOFTWARE_TYPE[$software_id]: - # If this is aSOFTWARE_CATEGORIES_DIETPI then aSOFTWARE_TYPE=0, if it is - # aSOFTWARE_CATEGORIES_LINUX then it is 1. In the example it is 0. - # - # - aSOFTWARE_ONLINEDOC_URL[$software_id]: - # This is appended to "https://dietpi.com/phpbb/viewtopic.php?" to make a URL for help on this software. - # This needs to be filled after creating the related online docs entry: https://dietpi.com/phpbb/viewtopic.php?p=5#p5 - # - # Specifying other software as dependencies: - # If your software needs other software to be available, look under the 'Requires software - # to be installed' heading and then add that to the section you create. In the example - # below ALSA and XSERVERXORG are needed. The system will check their presence - # and install as needed. - # - # Dealing with Hardware types: - # If you have hardware requirements, like must not/only be installed on a Pi, then you need - # to add something like below. Look for other examples in the existing software - # installations. Full list of models can be found in 'dietpi-obtain_hw_model'. - # - # # - Disable for all non-RPi - # for ((i=10; i<=$MAX_G_HW_MODEL; i++)) - # do - # aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 - # done - # - # Example: - # #------------------ Desktops: LXDE ------------------ - # software_id=23 - # - # aSOFTWARE_WHIP_NAME[$software_id]='LXDE' - # aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop' - # aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - # aSOFTWARE_TYPE[$software_id]=0 - # aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - # aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - # aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' - # - #///////////////////////////////////////////////////////////////////////////////////// + # Generate arrays for all available software titles Software_Arrays_Init(){ G_DIETPI-NOTIFY -2 'Initialising database' @@ -323,7 +261,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Categories # NB: Unique IDs, do not re-arrange or re-order! #-------------------------------------------------------------------------------- - # DietPi software + # DietPi optimised software aSOFTWARE_CATEGORIES_DIETPI=( '●─ Desktops ' #0 @@ -350,7 +288,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it ) - # Linux software + # Linux additional software aSOFTWARE_CATEGORIES_LINUX=( '●─ SSH Clients ' #0 @@ -1361,7 +1299,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=58 aSOFTWARE_WHIP_NAME[$software_id]='OpenBazaar' - aSOFTWARE_WHIP_DESC[$software_id]='decentralized peer to peer bitcoin market' + aSOFTWARE_WHIP_DESC[$software_id]='decentralised peer to peer bitcoin market' aSOFTWARE_CATEGORY_INDEX[$software_id]=6 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 @@ -1373,7 +1311,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=133 aSOFTWARE_WHIP_NAME[$software_id]='YaCy' - aSOFTWARE_WHIP_DESC[$software_id]='decentralized open source search engine' + aSOFTWARE_WHIP_DESC[$software_id]='decentralised open source search engine' aSOFTWARE_CATEGORY_INDEX[$software_id]=6 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 @@ -2382,7 +2320,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=103 aSOFTWARE_WHIP_NAME[$software_id]='DietPi-RAMlog' - aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimized logging' + aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimised logging' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' @@ -2421,7 +2359,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_INSTALL_STATE[104]=2 # Dropbear #-------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 0 'Initialized database' + G_DIETPI-NOTIFY 0 'Initialised database' } @@ -2976,7 +2914,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di } # Return optimisation values for BitTorrent servers based on device and hardware capabilities. - Optimize_BitTorrent(){ + Optimise_BitTorrent(){ local output=0 @@ -3150,53 +3088,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di } - #///////////////////////////////////////////////////////////////////////////////////// - # This function handles the installation of the selected software. - # - # Reference: - # - Adding new software to DietPi-Software - # https://github.com/MichaIng/DietPi/issues/490#issuecomment-244416570 - # - # Installing the software: - # ------------------------------------ - # - software_id: - # This has to be the same number as software_id for the software list above. - # - # - INSTALL_URL_ADDRESS: - # This can be used to check conectivity to items you need to download later. - # A good example would also be a git repo. - # - # - Use Download_Install() (see code above) to check URL, download and install/extract - # deb|zip|tar(.gz|.bz2)|7z sources automatically and consistent, e.g. - # Download_Install 'https://www.phpbb.com/files/release/phpBB-3.2.2.zip' /var/www - # will check the URL, download phpBB archive, extract it to /var/www(/phpBB3) - # and remove the archieve afterwards. - # - # Example: - # #------------------ Bittorrent: HTPC Manager ------------------ - # software_id=155 - # if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - # - # Banner_Installing - # - # INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' - # - # G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - # # Install Python and PIP - # G_AGI python python-pip python-imaging - # - # cd /root - # git clone --depth=1 "$INSTALL_URL_ADDRESS" - # - # # Move HTPC Manager to a 'better' location - # mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager - # mv /root/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ - # rm -R /root/HTPC-Manager - # - # fi - # - #///////////////////////////////////////////////////////////////////////////////////// + # Run marked software installs Install_Dietpi_Software(){ #-------------------------------------------------------------- @@ -3906,8 +3798,7 @@ _EOF_ fi - #myMPD - software_id=148 + software_id=148 # myMPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4649,15 +4540,13 @@ _EOF_ fi - #FRESHRSS - software_id=38 + software_id=38 # FreshRSS if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing # Install required PHP modules: https://github.com/FreshRSS/FreshRSS#example-of-full-installation-on-linux-debianubuntu - DEPS_LIST="$PHP_NAME-curl $PHP_NAME-gmp $PHP_NAME-intl $PHP_NAME-json" - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-zip" + DEPS_LIST="$PHP_NAME-curl $PHP_NAME-gmp $PHP_NAME-intl $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-zip" Download_Install 'https://github.com/FreshRSS/FreshRSS/archive/master.zip' /opt mv /opt/FreshRSS-master /opt/FreshRSS @@ -5107,10 +4996,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # Install required PHP modules - DEPS_LIST="$PHP_NAME-apcu $PHP_NAME-gd $PHP_NAME-intl" - - # - Stretch extras - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-opcache $PHP_NAME-xml" + DEPS_LIST="$PHP_NAME-apcu $PHP_NAME-gd $PHP_NAME-intl $PHP_NAME-mbstring $PHP_NAME-opcache $PHP_NAME-xml" # Skip install, if already present if [[ -d /var/www/pydio ]]; then @@ -5176,7 +5062,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing DEPS_LIST='minicom python-serial python-configobj' - Download_Install 'https://github.com/MichaIng/emonhub/archive/emon-pi.zip' + Download_Install 'https://github.com/Fourdee/emonhub/archive/emon-pi.zip' pip install paho-mqtt pydispatcher @@ -5286,8 +5172,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #CUBERITE - software_id=52 + software_id=52 # Cuberite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5772,8 +5657,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # Needed PHP modules, (re)install to be failsafe: https://koel.phanan.net/docs/#/?id=server, https://laravel.com/docs/5.6/installation#server-requirements - DEPS_LIST="python $PHP_NAME-json" - (( $G_DISTRO > 3 )) && DEPS_LIST+=" $PHP_NAME-mbstring $PHP_NAME-xml" + DEPS_LIST="python $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml" Download_Install 'https://github.com/phanan/koel/archive/v3.7.2.zip' mv koel-* $G_FP_DIETPI_USERDATA/koel @@ -7100,50 +6984,14 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix if (( $INDEX_WEBSERVER_TARGET != $INDEX_WEBSERVER_CURRENT )); then - #Update Current to Target + # Update Current to Target INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET fi } - #///////////////////////////////////////////////////////////////////////////////////// - # Configuration post installation goes here. - # - # Reference: - # - Adding new software to DietPi-Software - # https://github.com/MichaIng/DietPi/issues/490#issuecomment-244416570 - # - # Adding post installation steps. - # ------------------------------------ - # - software_id: - # This has to be the same number as software_id for the software list above. - # - # Here you can add any configuration changes or addtions to systemd. After this - # has run it will reload the systemd environment and start any services installed - # and referenced in 'dietpi-services' - # - # Example: - # #------------------ Desktop: MATE ------------------ - # software_id=24 - # if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - # - # # - file manager desktop icon - # ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop - # - # Create_Desktop_Shared_Items - # - # #Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 - # if (( $G_HW_MODEL == 12 )) && - # ! grep -qi '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa; then - # - # echo 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' >> /etc/pulse/default.pa - # - # fi - # - # fi - # - #///////////////////////////////////////////////////////////////////////////////////// + # Configure marked software titles Install_Apply_Configs(){ # Copy/Set optimised Software settings. @@ -7156,7 +7004,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Configuration - #Pre-create dirs + # Pre-create dirs mkdir -p /root/.config/openbox mkdir -p /root/.config/lxpanel/LXDE/panels mkdir -p /root/.config/pcmanfm/LXDE @@ -7350,7 +7198,7 @@ _EOF_ ## Start an FastCGI server using php-fpm fastcgi.server += ( ".php" => (( - "socket" => "/run/php/$PHP_NAME-fpm.sock", + "socket" => "/run/php/${PHP_NAME}-fpm.sock", "broken-scriptfilename" => "enable" )) ) @@ -7489,7 +7337,7 @@ _EOF_ fi ### Also for MariaDB? - # Optimize for reduced memory use: https://github.com/MichaIng/DietPi/issues/605#issue-188930987 + # Optimise for reduced memory use: https://github.com/MichaIng/DietPi/issues/605#issue-188930987 #cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi.cnf #[mysqld] #key_buffer_size=8M @@ -8356,11 +8204,11 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal mkdir -p /etc/systemd/system/transmission-daemon.service.d echo -e '[Service]\nGroup=dietpi' > /etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf - # Apply optimized settings - G_CONFIG_INJECT '"cache-size-mb"' ' "cache-size-mb": '$(Optimize_BitTorrent 0)',' /etc/transmission-daemon/settings.json '^\{$' - G_CONFIG_INJECT '"download-queue-size"' ' "download-queue-size": '$(Optimize_BitTorrent 1)',' /etc/transmission-daemon/settings.json '^\{$' - G_CONFIG_INJECT '"peer-limit-global"' ' "peer-limit-global": '$(Optimize_BitTorrent 2)',' /etc/transmission-daemon/settings.json '^\{$' - G_CONFIG_INJECT '"upload-slots-per-torrent"' ' "upload-slots-per-torrent": '$(Optimize_BitTorrent 3)',' /etc/transmission-daemon/settings.json '^\{$' + # Apply optimised settings + G_CONFIG_INJECT '"cache-size-mb"' ' "cache-size-mb": '$(Optimise_BitTorrent 0)',' /etc/transmission-daemon/settings.json '^\{$' + G_CONFIG_INJECT '"download-queue-size"' ' "download-queue-size": '$(Optimise_BitTorrent 1)',' /etc/transmission-daemon/settings.json '^\{$' + G_CONFIG_INJECT '"peer-limit-global"' ' "peer-limit-global": '$(Optimise_BitTorrent 2)',' /etc/transmission-daemon/settings.json '^\{$' + G_CONFIG_INJECT '"upload-slots-per-torrent"' ' "upload-slots-per-torrent": '$(Optimise_BitTorrent 3)',' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"port-forwarding-enabled"' ' "port-forwarding-enabled": true,' /etc/transmission-daemon/settings.json '^\{$' G_CONFIG_INJECT '"encryption"' ' "encryption": 2,' /etc/transmission-daemon/settings.json '^\{$' @@ -8786,8 +8634,7 @@ _EOF_ fi - #Kodi - software_id=31 + software_id=31 # Kodi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9130,11 +8977,11 @@ _EOF_ # Apply optimised settings # - Cache size is in steps of 16 KiB. (Cachesize * 16 = total KiB) - sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimize_BitTorrent 0) * 1024 / 16 ))',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_active_limit": /c\ "max_active_limit": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_active_downloading": /c\ "max_active_downloading": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_connections_global": /c\ "max_connections_global": '$(Optimize_BitTorrent 2)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '$(Optimize_BitTorrent 3)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimise_BitTorrent 0) * 1024 / 16 ))',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_limit": /c\ "max_active_limit": '$(Optimise_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_downloading": /c\ "max_active_downloading": '$(Optimise_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_connections_global": /c\ "max_connections_global": '$(Optimise_BitTorrent 2)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '$(Optimise_BitTorrent 3)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf fi @@ -9222,7 +9069,7 @@ Do you want to enable the Pi-hole blocking page?'; then getent passwd airsonic &> /dev/null && usercmd='usermod' $usercmd airsonic -G dietpi,audio -d $G_FP_DIETPI_USERDATA/airsonic -s /usr/sbin/nologin - # Optimize memory limit + # Optimise memory limit local airsonic_memory_max=$(( $RAM_TOTAL / 5 )) (( $airsonic_memory_max < 200 )) && airsonic_memory_max=200 airsonic_memory_max+='m' @@ -9259,7 +9106,7 @@ _EOF_ getent passwd subsonic &> /dev/null && usercmd='usermod' $usercmd subsonic -G dietpi,audio -d /var/subsonic -s /usr/sbin/nologin - # Optimize memory limit + # Optimise memory limit local subsonic_memory_max=$(( $RAM_TOTAL / 5 )) (( $subsonic_memory_max < 200 )) && subsonic_memory_max=200 @@ -9440,8 +9287,7 @@ _EOF_ fi - #WORDPRESS - software_id=55 + software_id=55 # Wordpress if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9451,8 +9297,7 @@ _EOF_ fi - #FRESHRSS - software_id=38 + software_id=38 # FreshRSS if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9721,8 +9566,7 @@ _EOF_ fi - #Ubooquity - software_id=80 + software_id=80 # Ubooquity if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10744,16 +10588,16 @@ _EOF_ ported_to_new_savepath_system=true [Preferences] -Downloads\DiskWriteCacheSize=$(Optimize_BitTorrent 0) +Downloads\DiskWriteCacheSize=$(Optimise_BitTorrent 0) Downloads\DiskWriteCacheTTL=60 -Queueing\MaxActiveDownloads=$(Optimize_BitTorrent 1) -Queueing\MaxActiveTorrents=$(Optimize_BitTorrent 1) +Queueing\MaxActiveDownloads=$(Optimise_BitTorrent 1) +Queueing\MaxActiveTorrents=$(Optimise_BitTorrent 1) Queueing\MaxActiveUploads=1 Queueing\IgnoreSlowTorrents=false -Bittorrent\MaxConnecs=$(Optimize_BitTorrent 2) -Bittorrent\MaxConnecsPerTorrent=$(Optimize_BitTorrent 2) -Bittorrent\MaxUploads=$(Optimize_BitTorrent 3) -Bittorrent\MaxUploadsPerTorrent=$(Optimize_BitTorrent 3) +Bittorrent\MaxConnecs=$(Optimise_BitTorrent 2) +Bittorrent\MaxConnecsPerTorrent=$(Optimise_BitTorrent 2) +Bittorrent\MaxUploads=$(Optimise_BitTorrent 3) +Bittorrent\MaxUploadsPerTorrent=$(Optimise_BitTorrent 3) WebUI\Port=1340 WebUI\Enabled=true General\Locale=en @@ -10987,20 +10831,20 @@ network.max_open_files.set = 50 scheduler.max_active.set = 3 # byte value -pieces.memory.max.set = $(( $(Optimize_BitTorrent 0) * 1024 * 1024 )) +pieces.memory.max.set = $(( $(Optimise_BitTorrent 0) * 1024 * 1024 )) # Maximum and minimum number of peers to connect to per torrent. throttle.min_peers.normal.set = 1 -throttle.max_peers.normal.set = $(( $(Optimize_BitTorrent 2) / 2 + 1 )) +throttle.max_peers.normal.set = $(( $(Optimise_BitTorrent 2) / 2 + 1 )) # Same as above but for seeding completed torrents (-1 = same as downloading) throttle.min_peers.seed.set = -1 throttle.max_peers.seed.set = -1 # Maximum number of simultaneous downloads -throttle.max_downloads.set = $(Optimize_BitTorrent 2) +throttle.max_downloads.set = $(Optimise_BitTorrent 2) # Maximum number of simultaneous uploads -throttle.max_uploads.set = $(Optimize_BitTorrent 3) +throttle.max_uploads.set = $(Optimise_BitTorrent 3) # Global upload and download rate in KiB. "0" for unlimited. throttle.global_down.max_rate.set_kb = 0 @@ -11136,11 +10980,11 @@ pause=false log=/var/log/aria2.log log-level=warn -split=$(Optimize_BitTorrent 1) +split=$(Optimise_BitTorrent 1) continue=true check-integrity=true -max-concurrent-downloads=$(Optimize_BitTorrent 1) -max-connection-per-server=$(Optimize_BitTorrent 1) +max-concurrent-downloads=$(Optimise_BitTorrent 1) +max-connection-per-server=$(Optimise_BitTorrent 1) # Bandwidth limits: https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-max-overall-upload-limit max-overall-download-limit=0 max-overall-upload-limit=0 @@ -11148,7 +10992,7 @@ max-file-not-found=3 max-tries=5 retry-wait=60 ftp-pasv=true -bt-max-peers=$(Optimize_BitTorrent 2) +bt-max-peers=$(Optimise_BitTorrent 2) listen-port=6881-6999 check-certificate=false @@ -11937,9 +11781,9 @@ _EOF_ sed -i "/CrashTrace=/c\CrashTrace=no" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf sed -i "/DetailTarget=/c\DetailTarget=none" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf - sed -i "/ParBuffer=/c\ParBuffer=$(Optimize_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf - sed -i "/ArticleCache=/c\ArticleCache=$(Optimize_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf - sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimize_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf + sed -i "/ParBuffer=/c\ParBuffer=$(Optimise_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf + sed -i "/ArticleCache=/c\ArticleCache=$(Optimise_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf + sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimise_BitTorrent 0)" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf cat << _EOF_ > /etc/systemd/system/nzbget.service [Unit] @@ -13223,7 +13067,6 @@ _EOF_ Banner_Uninstalling apt-mark auto mono-complete mono-devel mono-runtime libmono-cil-dev 2>/dev/null rm /etc/apt/sources.list.d/mono-xamarin.list - G_AGUP fi @@ -14773,7 +14616,7 @@ _EOF_ /DietPi/dietpi/dietpi-services stop Install_Linux_Software - # Install DietPi Optimized Software + # Install DietPi Optimised Software /DietPi/dietpi/dietpi-services stop Install_Dietpi_Software @@ -15608,7 +15451,7 @@ This will allow you to choose which program loads automatically, after the syste 'DietPi-Config' ': Feature-rich configuration tool for your device' '' '●─ Select Software ' 'Search' ': Find a software title for installation' - 'Software Optimized' ': Select DietPi optimized software for installation' + 'Software Optimised' ': Select DietPi optimised software for installation' 'Software Additional' ': Select additional Linux software for installation' 'SSH Server' ": [$index_sshserver_text]" 'File Server' ": [$index_fileserver_text]" @@ -15643,7 +15486,7 @@ This will allow you to choose which program loads automatically, after the syste ;; - 'Software Optimized') + 'Software Optimised') TARGETMENUID=1 @@ -16128,7 +15971,7 @@ Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nW if (( $G_DIETPI_INSTALL_STAGE == 1 )); then G_WHIP_YESNO 'DietPi was unable to detect any additional software selections for install.\n -NB: You can use dietpi-software at a later date, to install optimized software from our catalogue as required.\n\nDo you wish to continue with DietPi as a pure minimal image?' +NB: You can use dietpi-software at a later date, to install optimised software from our catalogue as required.\n\nDo you wish to continue with DietPi as a pure minimal image?' if (( $? == 0 )); then #exit menu system @@ -16299,7 +16142,7 @@ NB: You can use dietpi-software at a later date, to install optimized software f Banner_Configs(){ - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Optimize and configure software' + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Optimise and configure software' G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION, please wait...\n" } From de44648232c4127942dbb94ec6e1a034d5cc1e1b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 2 May 2019 11:36:17 +0100 Subject: [PATCH 167/253] WIP: C1 Stretch Move image to ARMbian EOS. --- PREP_SYSTEM_FOR_DIETPI.sh | 9 --- boot_c1.ini | 68 ---------------- dietpi/dietpi-config | 125 +---------------------------- dietpi/dietpi-drive_manager | 4 +- dietpi/dietpi-software | 17 +--- dietpi/func/dietpi-obtain_hw_model | 2 +- dietpi/func/dietpi-set_hardware | 22 +---- 7 files changed, 13 insertions(+), 234 deletions(-) delete mode 100644 boot_c1.ini diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 18b8ed64f4..732b84831d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -548,10 +548,6 @@ G_RUN_CMD mv "DietPi-$G_GITBRANCH/config.txt" /boot/ - elif (( $G_HW_MODEL == 10 )); then - - G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_c1.ini" /boot/boot.ini - elif (( $G_HW_MODEL == 11 )); then G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_xu4.ini" /boot/boot.ini @@ -803,11 +799,6 @@ _EOF_ G_AGI linux-image-4.14-armhf-odroid-xu4 - # Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - G_AGI linux-image-armhf-odroid-c1 - # BBB elif (( $G_HW_MODEL == 71 )); then diff --git a/boot_c1.ini b/boot_c1.ini deleted file mode 100644 index e36cda9466..0000000000 --- a/boot_c1.ini +++ /dev/null @@ -1,68 +0,0 @@ -# IMPORTANT: -# - Modifications to /boot/boot.ini will not be preserved on reboot. -# - Please ensure you edit from the DietPi-RAMdisk location: /DietPi/boot.ini - -ODROIDC-UBOOT-CONFIG - -setenv m "720p" - -# HDMI DVI Mode Configuration -setenv vout_mode "hdmi" -# setenv vout_mode "dvi" -# setenv vout_mode "vga" - -# HDMI BPP Mode -setenv m_bpp "16" - -# HDMI Hotplug Force (HPD) -# 1 = Enables HOTPlug Detection -# 0 = Disables HOTPlug Detection and force the connected status -setenv hpd "0" - -# CEC Enable/Disable (Requires Hardware Modification) -# 1 = Enables HDMI CEC -# 0 = Disables HDMI CEC -setenv cec "0" - -# PCM5102 I2S Audio DAC -# PCM5102 is an I2S Audio Dac Addon board for ODROID-C1+ -# Uncomment the line below to __ENABLE__ support for this Addon board. -# setenv enabledac "enabledac" - -# UHS Card Configuration -# Uncomment the line below to __DISABLE__ UHS-1 MicroSD support -# This might break boot for some brand models of cards. -setenv disableuhs "disableuhs" - -# Disable VPU (Video decoding engine, Saves RAM!!!) -# 0 = disabled -# 1 = enabled -setenv vpu "0" - -# Disable HDMI Output (Again, saves ram!) -# 0 = disabled -# 1 = enabled -setenv hdmioutput "1" - -# Default Console Device Setting -setenv condev "console=tty0 console=ttyS0,115200n8" - -########################################### - -if test "${hpd}" = "0"; then setenv hdmi_hpd "disablehpd=true"; fi -if test "${cec}" = "1"; then setenv hdmi_cec "hdmitx=cecf"; fi - -# Boot Arguments -setenv bootargs "root=/dev/mmcblk0p2 rootwait ro ${condev} no_console_suspend vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac}" - -# Booting -fatload mmc 0:1 0x21000000 uImage -fatload mmc 0:1 0x22000000 uInitrd -fatload mmc 0:1 0x21800000 meson8b_odroidc.dtb -fdt addr 21800000 - -if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi - -if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi - -bootm 0x21000000 0x22000000 0x21800000" diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 939d709d3b..8fe1c6d955 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -392,7 +392,7 @@ elif (( $G_WHIP_RETURNED_VALUE == 2 )); then - if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 )); then G_WHIP_MSG 'GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup.\n\nThe split value is optimized based on your software installs, however, feel free to tweak them.' TARGETMENUID=6 @@ -985,69 +985,6 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - # Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - # Get Current Values - local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini) - - G_WHIP_MENU_ARRAY=( - - '1080p' ': 1920 x 1080' - '720p' ': 1280 x 720' - '480p' ': 720 x 480' - 'VU7+' ': 1024 x 600' - 'PC1' ': 1024 x 768' - - ) - - G_WHIP_DEFAULT_ITEM=$current_resolution - if G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $current_resolution"; then - - REBOOT_REQUIRED=1 - - TARGETMENUID=2 # Return to this menu - - # - Always reset to HDMI - sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini - - case "$G_WHIP_RETURNED_VALUE" in - - '1080p') - - sed -i '/setenv m /c\setenv m "1080p"' /DietPi/boot.ini - - ;; - - '720p') - - sed -i '/setenv m /c\setenv m "720p"' /DietPi/boot.ini - - ;; - - '480p') - - sed -i '/setenv m /c\setenv m "480p"' /DietPi/boot.ini - - ;; - - 'PC1') - - sed -i '/setenv m /c\setenv m "1024x768"' /DietPi/boot.ini - - ;; - - 'VU7+') - - sed -i '/setenv m /c\setenv m "1024x600"' /DietPi/boot.ini - sed -i '/setenv vout_mode /c\setenv vout_mode "dvi"' /DietPi/boot.ini - - ;; - - esac - - fi - # Odroid XU3/4 elif (( $G_HW_MODEL == 11 )); then @@ -1979,10 +1916,6 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 gpu_mem_current=$(grep -m1 '^[[:blank:]]*gpu_mem_1024=' /DietPi/config.txt | sed 's/^[^=]*=//') ram_mem_current=$((ram_mem_total-gpu_mem_current)) - elif (( $G_HW_MODEL == 10 )); then - - gpu_mem_current=$((1024-ram_mem_current)) - elif (( $G_HW_MODEL == 12 )); then gpu_mem_current=$((2048-ram_mem_current)) @@ -2026,58 +1959,6 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - # Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - # Odroid HDMI/headless extra data - local display_output_enabled=$(grep -ci -m1 '^setenv hdmioutput "1"' /DietPi/boot.ini) - local display_vpu_enabled=$(grep -ci -m1 '^setenv vpu "1"' /DietPi/boot.ini) - local display_output_text='[On]' - local display_vpu_text='[On]' - - (( $display_output_enabled )) || display_output_text='[Off]' - (( $display_vpu_enabled )) || display_vpu_text='[Off]' - - G_WHIP_MENU_ARRAY=( - - 'Headless' 'HDMI: Disabled | VPU: Disabled' - 'Server' 'HDMI: Enabled | VPU: Disabled' - 'Desktop' 'HDMI: Enabled | VPU: Enabled' - - ) - - G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCurrent : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." - if (( $? == 0 )); then - - REBOOT_REQUIRED=1 - - TARGETMENUID=6 # Return to this menu - - case "$G_WHIP_RETURNED_VALUE" in - - 'Headless') - - /DietPi/dietpi/func/dietpi-set_hardware headless 1 - - ;; - - 'Server') - - /DietPi/dietpi/func/dietpi-set_hardware headless 0 - G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini - - ;; - - 'Desktop') - - /DietPi/dietpi/func/dietpi-set_hardware headless 0 - - ;; - - esac - - fi - # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -4086,8 +3967,8 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('justboom-digi' ': JustBoom: Digi HAT and Digi Zero') G_WHIP_MENU_ARRAY+=('rpi-dac' ': Soekris DAM1021 (pcm1794a)') - # - C1/C2 - elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then + # - C2 + elif (( $G_HW_MODEL == 12 )); then G_WHIP_MENU_ARRAY+=('odroid-hifishield-plus' ': Odroid HiFi Shield 1/Plus') G_WHIP_MENU_ARRAY+=('odroid-hifishield-2' ': Odroid HiFi Shield 2') diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index bcc15f2dd6..d5c175864a 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -814,8 +814,8 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} local rootfstype_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 'rootfstype=') sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$INDEX_DRIVE_BEING_EDITED]}#g" /boot/cmdline.txt - #C1/C2/XU4 | /DietPi/boot.ini - elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then + #C2/XU4 | /DietPi/boot.ini + elif (( $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then # find current root= to replace local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /DietPi/boot.ini | grep -m1 'root=' | sed 's/\"//') diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index afc4b3a621..15fe57a72c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -494,8 +494,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it # + ASUS TB aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 - # + NanoPC T4 - #aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,68]=1 + # - C1 + aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,10]=0 #------------------ software_id=32 @@ -4799,11 +4799,6 @@ _EOF_ kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers' - # - Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - kernel_packages='linux-image-armhf-odroid-c1 linux-headers-armhf-odroid-c1' - # - Odroid XU4 elif (( $G_HW_MODEL == 11 )); then @@ -6269,12 +6264,6 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid #dps_index=$software_id Download_Install 'xorg_xu4.conf' /etc/X11/xorg.conf - #Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - DEPS_LIST='aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid' - dps_index=$software_id Download_Install 'xorg_c1.conf' /etc/X11/xorg.conf - #Pine64 elif (( $G_HW_MODEL == 40 )); then @@ -6667,7 +6656,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix dpkg --force-hold,confdef,confold -i ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb G_AGF rm ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb - + else diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index b1ad7c5a24..eede515538 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -650,7 +650,7 @@ elif (( $G_HW_MODEL == 10 )); then G_HW_MODEL_DESCRIPTION='Odroid C1' - IMAGE_ADDITIONAL_CREDITS='Meveric' + #IMAGE_ADDITIONAL_CREDITS='Meveric' fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4579fc003a..f8c9c5c6f6 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -253,13 +253,6 @@ _EOF_ # - Disable composite hotplug, which then allows to completely disable the video pipeline + framebuffer G_CONFIG_INJECT 'hdmi_ignore_composite=' 'hdmi_ignore_composite=1' /DietPi/config.txt - # Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "0"' /DietPi/boot.ini - G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini - G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini - # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -280,13 +273,6 @@ _EOF_ G_CONFIG_INJECT 'hdmi_ignore_composite=' '#hdmi_ignore_composite=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_blanking=' '#hdmi_blanking=0' /DietPi/config.txt - # Odroid C1 - elif (( $G_HW_MODEL == 10 )); then - - G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "1"' /DietPi/boot.ini - G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "1"' /DietPi/boot.ini - G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini - # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -360,8 +346,8 @@ _EOF_ G_CONFIG_INJECT 'gpio-ir-recv' 'gpio-ir-recv' /etc/modules G_CONFIG_INJECT 'gpioplug-ir-recv' 'gpioplug-ir-recv' /etc/modules - # C1/C2 - elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then + # C2 + elif (( $G_HW_MODEL == 12 )); then # - Module G_CONFIG_INJECT 'meson_ir' 'meson_ir' /etc/modules @@ -1504,8 +1490,8 @@ Do you want to continue and DISABLE Bluetooth now?'; then grep -q "console=$INPUT_ADDITIONAL" /boot/cmdline.txt || sed -i "/root=/s/$/ console=$INPUT_ADDITIONAL,115200/" /boot/cmdline.txt - # - Odroid C1/C2 - elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then + # - Odroid C2 + elif (( $G_HW_MODEL == 12 )); then local old='' [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv condev "' /DietPi/boot.ini) || return From a48ac8096dfc4990d6823fc0b77df45a423349c8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 2 May 2019 14:42:27 +0100 Subject: [PATCH 168/253] No need to show this info if unchanged by user. --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 15fe57a72c..e15349e146 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -171,7 +171,7 @@ _EOF_ G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/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 chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - G_WHIP_MSG '[INFO] For security reasons your global software password has been removed from dietpi.txt and instead saved and ecrypted within: + [[ $GLOBAL_PW != 'dietpi' ]] && G_WHIP_MSG '[INFO] For security reasons your global software password has been removed from dietpi.txt and instead saved and ecrypted within: - /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' From 952274545188a138c244a8e5208678a684513b3e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Thu, 2 May 2019 15:12:03 +0100 Subject: [PATCH 169/253] C1: https://github.com/MichaIng/DietPi/issues/2561 --- CHANGELOG.txt | 2 +- dietpi/patch_file | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2d3eac078c..3b71673e55 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,7 @@ Jessie support: - The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 - As a result we move Jessie systems to a dedicated "jessie-support" branch. Next DietPi v6.24 will still be merged into this branch as well, but for following updates it depends on how much additional related issues we face. - We highly recommend to migrate to Stretch as fast as possible. -- For Ordoid C1 there is no Stretch image available since its kernel and firmware are not maintained to match minimum requirements. There are reports about successful "apt-get dist-upgrade" migrations and an ARMbian Stretch image is available that can be used as a basis for DietPi-PREP. But these systems face major limitations, especially no GPU (Xserver, Kodi, desktops) support is available. Read more about it or contribute to solutions for Odroid C1 users here: https://github.com/MichaIng/DietPi/issues/2561 +- Odroid C1: We have updated the image to Stretch based on ARMbian 4.18 kernel. Existing Jessie installations will be moved to the jessie-support branch: https://github.com/MichaIng/DietPi/issues/2561 Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. diff --git a/dietpi/patch_file b/dietpi/patch_file index c2722ee5ae..89b8d6b854 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1756,6 +1756,11 @@ With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lida This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' + #Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs. + elif (( $G_HW_MODEL == 10 )); then + + G_WHIP_MSG '[INFO] Odroid C1 image has been updated to Stretch. Please upgrade to continue limited support for this device:\nhttps://github.com/MichaIng/DietPi/issues/2561#issuecomment-488685121' + fi #----------------------------------------------------------------------- # Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691 @@ -1777,7 +1782,7 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' if [[ -f /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER && $(grep -c '^auth-user-pass' /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER) == 2 ]]; then sed -i '/^auth-user-pass$/d' /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER - + fi unset NORDVPN_USERNAME NORDVPN_PASSWORD NORDVPN_SERVER PROTOCOL From dc09158a26fa602ab9313908e16f69e3065a7a2a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 2 May 2019 23:12:26 +0200 Subject: [PATCH 170/253] v6.23 + DietPi-Software | Node.js: Fix broken install on ARMv6 since Node 12 does not support it any more: https://github.com/MichaIng/DietPi/issues/2755 --- dietpi/dietpi-software | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e15349e146..f58244e457 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6677,9 +6677,12 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix INSTALL_URL_ADDRESS='https://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' G_CHECK_URL "$INSTALL_URL_ADDRESS" - wget "$INSTALL_URL_ADDRESS" -O node_install.sh - chmod +x node_install.sh + wget "$INSTALL_URL_ADDRESS" + # ARMv6 workaround: https://github.com/MichaIng/DietPi/issues/2755 + (( $G_HW_ARCH == 1 )) && sed -i 's|nodejs.org/dist/latest/|nodejs.org/dist/latest-v11.x/|g' node_install.sh + mkdir -p /usr/local # failsafe + chmod +x node_install.sh ./node_install.sh rm node_install.sh From dca651c7c225dd7c46155fe6a2d4475b756dcdeb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 2 May 2019 23:20:49 +0200 Subject: [PATCH 171/253] v6.23 + CHANGELOG | Node-RED: Resolved an issue where install failed on ARMv6 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3b71673e55..306bb0bdf7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -48,6 +48,7 @@ Bug Fixes: - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 +- DietPi-Software | Node-RED: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From 07ee4c49c679d78476851f899304d103c6e7545b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 2 May 2019 23:23:51 +0200 Subject: [PATCH 172/253] v6.23 + CHANGELOG | Whoopsie, it was Node.js itself --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 306bb0bdf7..4b2432e34b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -48,7 +48,7 @@ Bug Fixes: - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 -- DietPi-Software | Node-RED: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 +- DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From 7480345f28d90c697d41ca8783d573e24f4ba83c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 3 May 2019 00:32:42 +0200 Subject: [PATCH 173/253] v6.23 + DietPi-Software | Node.js: Script name fix --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f58244e457..5f4f621146 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6679,12 +6679,12 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix wget "$INSTALL_URL_ADDRESS" # ARMv6 workaround: https://github.com/MichaIng/DietPi/issues/2755 - (( $G_HW_ARCH == 1 )) && sed -i 's|nodejs.org/dist/latest/|nodejs.org/dist/latest-v11.x/|g' node_install.sh + (( $G_HW_ARCH == 1 )) && sed -i 's|nodejs.org/dist/latest/|nodejs.org/dist/latest-v11.x/|g' node-install.sh mkdir -p /usr/local # failsafe - chmod +x node_install.sh - ./node_install.sh - rm node_install.sh + chmod +x node-install.sh + ./node-install.sh + rm node-install.sh fi From a61bc21ce9629940bd91cd69fb94909242834403 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 12:59:19 +0200 Subject: [PATCH 174/253] META | Slight change of bug report entry to avoid users trying to execute the whole line --- .github/ISSUE_TEMPLATE/bug_report.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ddec9ccc0b..e7af2f218e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -18,7 +18,8 @@ about: Create a report to help us improve - Software title | (EG: Nextcloud) - Was the software title installed freshly or updated/migrated? - Can this issue be replicated on a fresh installation of DietPi? -- `dietpi-bugreport` ID | `sed -n 5p /DietPi/dietpi/.hw_model` + +- Bug report ID | `sed -n 5p /DietPi/dietpi/.hw_model` #### Steps to reproduce From b17e4a22290e8933bf5da102099a947b6ed652b3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 13:16:26 +0200 Subject: [PATCH 175/253] v6.23 + DietPi-Set_hardware | Replace obsolete "bluetooth" meta package with bluez --- dietpi/func/dietpi-set_hardware | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index f8c9c5c6f6..0b5865bd0b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1126,7 +1126,7 @@ _EOF_ # Purge packages if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then - G_AGP bluetooth bluez-firmware pi-bluetooth + G_AGP bluez bluez-firmware pi-bluetooth G_AGA fi @@ -1157,7 +1157,8 @@ Do you want to continue and disable the serial login console?'; then else - G_AG_CHECK_INSTALL_PREREQ bluetooth bluez-firmware + # bluez-firmware: BCM203x dongles: https://packages.debian.org/stretch/bluez-firmware + G_AG_CHECK_INSTALL_PREREQ bluez bluez-firmware fi From 620b91137f856a2f0335a6d46779386401d1435e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 13:29:51 +0200 Subject: [PATCH 176/253] v6.23 + DietPi-Patch | Remove obsolete "bluetooth" meta package and mark bluez instead --- dietpi/patch_file | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 89b8d6b854..869bc69fe7 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1786,6 +1786,15 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' fi unset NORDVPN_USERNAME NORDVPN_PASSWORD NORDVPN_SERVER PROTOCOL + fi + #----------------------------------------------------------------------- + # Remove obsolete "bluetooth" meta package and mark bluez instead + if dpkg-query -s bluetooth &> /dev/null; then + + apt-mark manual bluez + apt-mark auto bluetooth + G_AGA + fi #----------------------------------------------------------------------- # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 From 3a65f6d1a5522d2ddd433bda6b9ada3ca224866b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sat, 4 May 2019 12:50:09 +0100 Subject: [PATCH 177/253] https://github.com/MichaIng/DietPi/issues/1918#issuecomment-489319719 --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5f4f621146..8c4bd46a35 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3127,9 +3127,9 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di INSTALL_URL_ADDRESS='https://dietpi.com/downloads/conf/desktop' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - Buster: No leafpad available, use mousepad instead: https://packages.debian.org/search?keywords=leafpad + # - Buster: No leafpad available, use featherpad instead: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-489319719 local editor='leafpad' - (( $G_DISTRO > 4 )) && editor='mousepad' + (( $G_DISTRO > 4 )) && editor='featherpad' G_AGI lxqt qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver $editor speedcrunch @@ -12412,7 +12412,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - apt-mark auto qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad speedcrunch + apt-mark auto qterminal firefox-esr xarchiver lxde-icon-theme upower xscreensaver leafpad featherpad speedcrunch G_AGP lxqt [[ -d '/root/.config/lxqt' ]] && rm -R /root/.config/lxqt From aa4a36fd890a0774d68fb9e7118e72af042ac8d4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:04:03 +0200 Subject: [PATCH 178/253] v6.23 + DietPi-Config | Allow network drop-in configs via /etc/network/interfaces.d, which e.g. allows to add VLANs, multiple network adapters and such without DietPi-Config destroying it. Future idea is to use this ourself to allow easier adding/removal/adjusting of single interface settings instead of scraping and rewriting the whole interfaces file. --- dietpi/dietpi-config | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 8fe1c6d955..8a82463a8b 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2282,8 +2282,12 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi cat << _EOF_ > /etc/network/interfaces -# /etc/network/interfaces -# Please use DietPi-Config to modify network settings. +# Location: /etc/network/interfaces +# Please modify network settings via: dietpi-config +# Or create your own drop-ins in: /etc/network/interfaces.d/ + +# Drop-in configs +source interfaces.d/* # Local auto lo From 1ef463b93bf265cedfae52cad08fa9807907a21d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:09:54 +0200 Subject: [PATCH 179/253] v6.23 + DietPi-PREP | Drop-in config support has been added to /etc/network/intefaces --- PREP_SYSTEM_FOR_DIETPI.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 732b84831d..83b17ca9bd 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1150,12 +1150,16 @@ _EOF_ G_DIETPI-NOTIFY 2 'Configuring network interfaces:' - [[ -f /etc/network/interfaces ]] && rm -R /etc/network/interfaces # ARMbian symlink for bulky network-manager + [[ -f '/etc/network/interfaces' ]] && rm -R /etc/network/interfaces # ARMbian symlink for bulky network-manager G_ERROR_HANDLER_COMMAND='/etc/network/interfaces' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND -#/etc/network/interfaces -#Please use DietPi-Config to modify network settings. +# Location: /etc/network/interfaces +# Please modify network settings via: dietpi-config +# Or create your own drop-ins in: /etc/network/interfaces.d/ + +# Drop-in configs +source interfaces.d/* # Local auto lo @@ -1169,7 +1173,7 @@ netmask 255.255.255.0 gateway 192.168.0.1 #dns-nameservers 8.8.8.8 8.8.4.4 -# Wifi +# WiFi #allow-hotplug wlan0 iface wlan0 inet dhcp address 192.168.0.100 @@ -1198,7 +1202,7 @@ _EOF_ fi # Fix rare WiFi interface start issue: https://github.com/MichaIng/DietPi/issues/2074 - [[ -f /etc/network/if-pre-up.d/wireless-tools ]] && sed -i '\|^[[:blank:]]ifconfig "$IFACE" up$|c\\t/sbin/ip link set dev "$IFACE" up' /etc/network/if-pre-up.d/wireless-tools + [[ -f '/etc/network/if-pre-up.d/wireless-tools' ]] && sed -i '\|^[[:blank:]]ifconfig "$IFACE" up$|c\\t/sbin/ip link set dev "$IFACE" up' /etc/network/if-pre-up.d/wireless-tools G_DIETPI-NOTIFY 2 'Tweaking DHCP timeout:' @@ -1279,8 +1283,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Configuring regional settings (TZdata):' - [[ -f /etc/timezone ]] && rm /etc/timezone - [[ -f /etc/localtime ]] && rm /etc/localtime + [[ -f '/etc/timezone' ]] && rm /etc/timezone + [[ -f '/etc/localtime' ]] && rm /etc/localtime ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime G_RUN_CMD dpkg-reconfigure -f noninteractive tzdata @@ -1468,17 +1472,17 @@ _EOF_ G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' # - Remove Bash history file - [[ -f /root/.bash_history ]] && rm /root/.bash_history + [[ -f '/root/.bash_history' ]] && rm /root/.bash_history rm -f /home/*/.bash_history # - Remove Nano history file - [[ -f /root/.nano_history ]] && rm /root/.nano_history + [[ -f '/root/.nano_history' ]] && rm /root/.nano_history rm -f /home/*/.nano_history G_DIETPI-NOTIFY 2 'Removing swapfile from image' /DietPi/dietpi/func/dietpi-set_swapfile 0 /var/swap - [[ -e /var/swap ]] && rm /var/swap # still exists on some images... + [[ -e '/var/swap' ]] && rm /var/swap # still exists on some images... # - re-enable for next run G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_SIZE=' 'AUTO_SETUP_SWAPFILE_SIZE=1' /DietPi/dietpi.txt @@ -1489,7 +1493,7 @@ _EOF_ (( $G_HW_MODEL == 40 )) && [[ -f /boot/uEnv.txt ]] && sed -i '/^ethaddr/ d' /boot/uEnv.txt # - Set Pi cmdline.txt back to normal - [[ -f /boot/cmdline.txt ]] && sed -i 's/ rootdelay=10//g' /boot/cmdline.txt + [[ -f '/boot/cmdline.txt' ]] && sed -i 's/ rootdelay=10//g' /boot/cmdline.txt G_DIETPI-NOTIFY 2 'Generating default wpa_supplicant.conf' From 3a10e44be81b6bdfa91d8fbeec811082cb5d06b3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:47:07 +0200 Subject: [PATCH 180/253] v6.23 + DietPi-Bugreport | Add usage info when wrong input argument has been added + DietPi-Bugreport | Use exit code when handled error occurs + DietPi-Bugreport | Add "uenv.txt" (Sparky SBC) and newly possible drop-in network interfaces configs + DietPi-Bugreport | Minor coding and wording --- dietpi/dietpi-bugreport | 84 +++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 9843a95405..bbbb5beb57 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -9,25 +9,26 @@ #//////////////////////////////////// # # Info: + # - Location: /DietPi/dietpi/dietpi-bugreport # - Called from G_ERROR_HANDLER - # - filename /DietPi/dietpi/dietpi-bugreport # - Generates $UNIQUE_ID.7z and uploads to dietpi.com - # Usage: - # - /DietPi/dietpi/dietpi-bugreport Interactively let user send or remove already uploaded bug report - # - /DietPi/dietpi/dietpi-bugreport 1 Automated send of bug report - # - /DietPi/dietpi/dietpi-bugreport -1 Automated remove of already uploaded bug report - #//////////////////////////////////// - - #Import DietPi-Globals --------------------------------------------------------------- + USAGE=' +Usage: /DietPi/dietpi/dietpi-bugreport +Available commands: + 0, Interactive menu to send or remove bug reports and review upload content + 1 Non-interactively send a bug report + -1 Non-interactively remove an already uploaded bug report +' #//////////////////////////////////// + + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Bugreport' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) UPLOAD_FILENAME="$UNIQUE_ID.7z" @@ -85,6 +86,7 @@ '/boot/config.txt' '/boot/cmdline.txt' '/boot/boot.ini' + '/boot/uenv.ini' '/boot/uEnv.ini' '/boot/armbianEnv.ini' @@ -113,6 +115,7 @@ '/etc/X11/xorg.conf' '/etc/asound.conf' '/etc/network/interfaces' + '/etc/network/interfaces.d' '/etc/wpa_supplicant/wpa_supplicant.conf' '/etc/fstab' '/etc/sysctl.conf' @@ -132,17 +135,17 @@ Generate_Upload_File(){ # Generate command output file - for ((i=0; i<${#aCOMMAND_LIST[@]}; i++)) + for i in "${aCOMMAND_LIST[@]}" do - echo -e "\n----------\n${aCOMMAND_LIST[$i]}:\n----------" >> CMD_OUT.txt - ${aCOMMAND_LIST[$i]} &>> CMD_OUT.txt + echo -e "\n----------\n$i\n----------" >> CMD_OUT.txt + $i &>> CMD_OUT.txt done unset aCOMMAND_LIST - # - Have the git error in 1st directory. - [[ -f /tmp/.G_ERROR_HANDLER_GITREPORT ]] && cp /tmp/.G_ERROR_HANDLER_GITREPORT ./G_ERROR_HANDLER_GITREPORT + # Have the Git error in 1st directory + [[ -f '/tmp/.G_ERROR_HANDLER_GITREPORT' ]] && cp /tmp/.G_ERROR_HANDLER_GITREPORT ./G_ERROR_HANDLER_GITREPORT G_DIETPI-NOTIFY 2 'Packing upload archive, please wait...' 7zr a -spf "$UPLOAD_FILENAME" ${aFILE_LIST[@]} &> dietpi-bugreport_compress.log @@ -162,12 +165,12 @@ fi - [[ -f dietpi-bugreport_compress.log ]] && rm dietpi-bugreport_compress.log + [[ -f 'dietpi-bugreport_compress.log' ]] && rm dietpi-bugreport_compress.log # Limit filesize UPLOAD_FILESIZE=$(stat -c%s "$UPLOAD_FILENAME") - # - Upload + # Upload if (( $UPLOAD_FILESIZE <= $UPLOAD_FILESIZE_LIMIT )); then G_DIETPI-NOTIFY -2 'Running cURL' @@ -187,6 +190,7 @@ else G_DIETPI-NOTIFY 1 'Failed to connect to SFTP server. Please try again later or report this to DietPi forum or GitHub repo in the first place.' + exit 1 fi @@ -194,12 +198,14 @@ G_DIETPI-NOTIFY 1 'The bug report upload archive appears to be unexpected large. Please inspect and in case clean up the locations to be uploaded, as their size should never be that large:' printf "%s\n" "${aFILE_LIST[@]}" + exit 1 fi else G_DIETPI-NOTIFY 1 'Failed to connect to "dietpi.com". Please try again later or report this to DietPi forum or GitHub repo in the first place.' + exit 1 fi @@ -222,11 +228,10 @@ ) - if G_WHIP_MENU "By sending a bug report file, you can help the developers to investigate your issue, in relation to your report on GitHub or the DietPi forum. + if G_WHIP_MENU 'By sending a bug report file, you can help the developers to investigate your issue, in relation to your report on GitHub or the DietPi forum. The file is sent via secured connection to our SFTP server and is stored there unreadable to the public upload user. -The file will be removed after your issue is solved and you can remove it by yourself as well by running \"dietpi-bugreport -1\" or via this menu. - -Would you like to send a bug report archive or remove an already uploaded one?"; then +The file will be removed after your issue is solved and you can remove it by yourself as well by running "dietpi-bugreport -1" or via this menu.\n +Would you like to send a bug report archive or remove an already uploaded one?'; then if (( $G_WHIP_RETURNED_VALUE == 1 )); then @@ -238,43 +243,42 @@ Would you like to send a bug report archive or remove an already uploaded one?"; elif (( $G_WHIP_RETURNED_VALUE == 3 )); then - G_WHIP_SCROLLBOX "The upload will contain the following command outputs: - -$(printf "\t- %s\n" "${aCOMMAND_LIST[@]}") - -It will contain as well the following files and directories: - + G_WHIP_SCROLLBOX "The upload will contain the following command outputs:\n +$(printf "\t- %s\n" "${aCOMMAND_LIST[@]}")\n +It will contain as well the following files and directories:\n $(printf "\t- %s\n" "${aFILE_LIST[@]}")" fi else - break + exit 0 fi done - if (( $INPUT == 1 || $INPUT == -1 )); then + if (( $INPUT == 1 )); then - if (( $INPUT == 1 )); then + # Generate 7z bug report file + Generate_Upload_File - # Generate 7z bug report file - Generate_Upload_File + elif (( $INPUT == -1 )); then - else + # Send empty file to clear already uploaded bug report + > "$UPLOAD_FILENAME" - # Send empty file to clear already uploaded bug report - > "$UPLOAD_FILENAME" + else - fi - - # Upload bug report file - Upload_Bug_Report + error=1 Print "Invalid input command ($INPUT). Aborting... +$USAGE" + exit 1 fi + # Upload bug report file + Upload_Bug_Report + #----------------------------------------------------------------------------------- exit 0 #----------------------------------------------------------------------------------- From 757f8ef24d664c8c6318e2e2d8f96ec44c1fccbb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:50:21 +0200 Subject: [PATCH 181/253] v6.23 + DietPi-Patch | Add /etc/network/interfaces.d/ drop-in config support --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 869bc69fe7..84738ce30d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1797,6 +1797,9 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' fi #----------------------------------------------------------------------- + # Add /etc/network/interfaces.d/ drop-in config support + grep -q 'interfaces\.d' /etc/network/interfaces || sed -i '1i\source interfaces.d/*' /etc/network/interfaces + #----------------------------------------------------------------------- # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 local reinstall_ids='' local upgrade_php=0 From a94efc5aef1c214a1db814db2ca9d58154a9b8db Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:53:17 +0200 Subject: [PATCH 182/253] v6.23 + DietPi-Bugreport | Syntax --- dietpi/dietpi-bugreport | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index bbbb5beb57..2775f14b78 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -270,7 +270,7 @@ $(printf "\t- %s\n" "${aFILE_LIST[@]}")" else - error=1 Print "Invalid input command ($INPUT). Aborting... + G_DIETPI-NOTIFY 1 "Invalid input command ($INPUT). Aborting... $USAGE" exit 1 From b436807770576391ff04a76ac69b6169e88da5f9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:54:45 +0200 Subject: [PATCH 183/253] v6.23 + DietPi-Bugreport | Minor: We have an alias for this --- dietpi/dietpi-bugreport | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 2775f14b78..45453a0e10 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -13,7 +13,7 @@ # - Called from G_ERROR_HANDLER # - Generates $UNIQUE_ID.7z and uploads to dietpi.com USAGE=' -Usage: /DietPi/dietpi/dietpi-bugreport +Usage: dietpi-bugreport Available commands: 0, Interactive menu to send or remove bug reports and review upload content 1 Non-interactively send a bug report From bc6336f15bd1166c8bca96485d8fd22e912dfa62 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 15:56:14 +0200 Subject: [PATCH 184/253] v6.23 + DietPi-Arr_to_RAM | Minor: We have an alias for this --- dietpi/misc/dietpi-arr_to_RAM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM index e9bb0ab209..88b9aa146b 100644 --- a/dietpi/misc/dietpi-arr_to_RAM +++ b/dietpi/misc/dietpi-arr_to_RAM @@ -15,7 +15,7 @@ # NB: Not supported on Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241 # USAGE=' -Usage: /DietPi/dietpi/misc/dietpi-arr_to_RAM [] +Usage: dietpi-arr_to_RAM [] Available commands: 1 [] Link (program) database(s) to RAM 2 [] Update (program) database backup(s) From 9f6526882610533813cb52e00b7fe08a0ad06dc3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 18:02:07 +0200 Subject: [PATCH 185/253] v6.23 + DietPi-Globals | Tiny: Change G_HW_MODEL default to "-1" since "0" is used in DietPi-PREP for all RPi models --- 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 0a97b4e716..471324324d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -89,7 +89,7 @@ _EOF_ #Device details # - Declare - G_HW_MODEL=${G_HW_MODEL:-0} + G_HW_MODEL=${G_HW_MODEL:--1} G_HW_MODEL_DESCRIPTION=${G_HW_MODEL_DESCRIPTION:-NULL} G_HW_ARCH=${G_HW_ARCH:-0} G_HW_ARCH_DESCRIPTION=$(uname -m) @@ -101,7 +101,7 @@ _EOF_ # - Update # NB: dietpi-boot service launches dietpi-obtain_hw_model to create the following file - if [[ -f /DietPi/dietpi/.hw_model ]]; then + if [[ -f '/DietPi/dietpi/.hw_model' ]]; then G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) G_HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) From 2a8e1dc8803d4c1440e4401642b6f98f34c4b568 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 18:44:49 +0200 Subject: [PATCH 186/253] v6.23 + DietPi-Globals | G_CHECK_URL: Add support to override default timeout + attempts via passed variables + DietPi-Globals | G_CHECK_URL: Add valid value checks for passed variables and dietpi.txt entries, in case revert to defaults --- dietpi/func/dietpi-globals | 42 ++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 471324324d..4cd99ba53c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1376,37 +1376,61 @@ $print_logfile_info #URL Connection test # - $@ = URL - # Optional variables: $optional_cmd_inputs (eg: --no-check-certificate) + # Optional variables: + # - $optional_cmd_inputs (eg: --no-check-certificate) + # - G_CHECK_URL_TIMEOUT to override default and dietpi.txt set timeout + # - G_CHECK_URL_ATTEMPTS to override default and dietpi.txt set attempts # In case of failure and $G_USER_INPUTS=1: Prompts user to configure network G_CHECK_URL(){ - local string=$@ - local timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - local attempts=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - #local optional_cmd_inputs + local url=$@ + local timeout=5 + if disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_TIMEOUT" 0; then + + timeout=$G_CHECK_URL_TIMEOUT + unset G_CHECK_URL_TIMEOUT + + elif [[ -f '/DietPi/dietpi.txt' ]]; then + + timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + disable_error=1 G_CHECK_VALIDINT "$timeout" 0 || timeout=5 + + fi + local attempts=3 + if disable_error=1 G_CHECK_VALIDINT "$G_CHECK_URL_ATTEMPTS" 0; then + + attempts=$G_CHECK_URL_ATTEMPTS + unset G_CHECK_URL_ATTEMPTS + + elif [[ -f '/DietPi/dietpi.txt' ]]; then + + attempts=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + disable_error=1 G_CHECK_VALIDINT "$attempts" 0 || attempts=3 + + fi while : do - G_ERROR_HANDLER_COMMAND="Connection test: $string" + G_ERROR_HANDLER_COMMAND="Connection test: $url" G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_CHECK_URL' G_ERROR_HANDLER_RETRY=1 - G_DIETPI-NOTIFY -2 "Testing connection to $string, please wait..." + G_DIETPI-NOTIFY -2 "Testing connection to $url, please wait..." local i=0 for ((i=1; i<=$attempts; i++)) do # Since --tries/-t is not applied on "fatal" errors (resolving failed, connection refused, 404), we need to loop ourself to exclude any temporary issue - wget --spider -t 1 -T $timeout $optional_cmd_inputs "$string" &> $G_ERROR_HANDLER_ONERROR_FPLOGFILE + wget --spider -t 1 -T $timeout $optional_cmd_inputs "$url" &> $G_ERROR_HANDLER_ONERROR_FPLOGFILE G_ERROR_HANDLER_EXITCODE=$? # Valid (( $G_ERROR_HANDLER_EXITCODE )) || break # Retry - G_DIETPI-NOTIFY -2 "Failed connection attempt to $string ($i/$attempts), retrying..." + G_DIETPI-NOTIFY -2 "Failed connection attempt to $url ($i/$attempts), retrying..." sleep 1 done From f2dddb8b91be001f9fa5390ce940b407dc390f63 Mon Sep 17 00:00:00 2001 From: Frederic Guilbault <37122999+FredericGuilbault@users.noreply.github.com> Date: Sat, 4 May 2019 12:52:42 -0400 Subject: [PATCH 187/253] v6.23 (#2756) + DietPi-PREP | Allow environment variables to automate script execution + DietPi-PREP | Add valid value checks for environment variables, otherwise revert to interactive prompt --- PREP_SYSTEM_FOR_DIETPI.sh | 213 +++++++++++++++++++++++++------------- 1 file changed, 141 insertions(+), 72 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 83b17ca9bd..4ade5df87e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -14,12 +14,19 @@ # - G_HW_ARCH # - G_DISTRO # - G_DISTRO_NAME + # + # The following environment variables can be set to automate the this script (adjust example values to your needs): + # - GITOWNER='MichaIng' (optional, defaults to 'MichaIng') + # - GITBRANCH='master' (must be one of 'master', 'beta' or 'dev') + # - IMAGE_CREATOR='Mr. Tux' + # - PREIMAGE_INFO='Some GNU/Linux' + # - HW_MODEL=0 (must match one of the supported IDs below) + # - WIFI_REQUIRED=0 [01] + # - DISTRO_TARGET=4 [45] (Stretch: 4, Buster: 5) #------------------------------------------------------------------------------------------------ # Core globals G_PROGRAM_NAME='DietPi-PREP' - G_GITOWNER=${GITOWNER:-MichaIng} - unset GITOWNER #------------------------------------------------------------------------------------------------ # Critical checks and pre-reqs, with exit, prior to initial run of script @@ -136,27 +143,35 @@ export LANG=en_GB.UTF8 export LC_ALL=en_GB.UTF8 - # Select gitbranch - aWHIP_BRANCH=( + # Set Git owner + G_GITOWNER=${GITOWNER:-MichaIng} + unset GITOWNER - 'master' ': Stable release (recommended)' - 'beta' ': Public beta testing branch' - 'dev' ': Unstable dev branch' + # Select Git branch + if ! [[ $GITBRANCH =~ ^(master|beta|dev)$ ]]; then - ) + aWHIP_BRANCH=( - if WHIP_RETURN=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then + 'master' ': Stable release (recommended)' + 'beta' ': Public beta testing branch' + 'dev' ': Unstable dev branch' - G_GITBRANCH=$WHIP_RETURN + ) - else + if GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then - echo -e '[ INFO ] No choice detected. Aborting...\n' - exit 0 + unset aWHIP_BRANCH - fi + else + + echo -e '[ INFO ] No choice detected. Aborting...\n' + exit 0 - unset aWHIP_BRANCH WHIP_RETURN + fi + + fi + G_GITBRANCH=$GITBRANCH + unset GITBRANCH echo "[ INFO ] Selected Git branch: $G_GITOWNER/$G_GITBRANCH" @@ -185,8 +200,6 @@ G_PROGRAM_NAME='DietPi-PREP' G_INIT - DISTRO_TARGET=0 - DISTRO_TARGET_NAME='' if grep -q 'jessie' /etc/os-release; then G_DISTRO=3 @@ -233,21 +246,11 @@ fi - # WiFi install flag - WIFI_REQUIRED=0 - - # Image creator flags - IMAGE_CREATOR='' - PREIMAGE_INFO='' - - # Setup step, current (used in info) - SETUP_STEP=0 - - # URL connection test var holder - INTERNET_ADDRESS='' - Main(){ + # Setup step, current (used in info) + SETUP_STEP=0 + #------------------------------------------------------------------------------------------------ echo '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -301,11 +304,21 @@ # Image creator while : do + if [[ $IMAGE_CREATOR ]]; then + + G_WHIP_RETURNED_VALUE=$IMAGE_CREATOR + # unset to force interactive input if disallowed name is detected + unset IMAGE_CREATOR + + else - G_WHIP_INPUTBOX 'Please enter your name. This will be used to identify the image creator within credits banner.\n\nYou can add your contact information as well for end users.\n\nNB: An entry is required.' - if (( ! $? )) && [[ $G_WHIP_RETURNED_VALUE ]]; then + G_WHIP_INPUTBOX 'Please enter your name. This will be used to identify the image creator within credits banner.\n\nYou can add your contact information as well for end users.\n\nNB: An entry is required.' - #Disallowed: + fi + + if [[ $G_WHIP_RETURNED_VALUE ]]; then + + # Disallowed: DISALLOWED_NAME=0 aDISALLOWED_NAMES=( @@ -340,7 +353,6 @@ else IMAGE_CREATOR=$G_WHIP_RETURNED_VALUE - G_DIETPI-NOTIFY 2 "Entered image creator: $IMAGE_CREATOR" break fi @@ -349,20 +361,27 @@ done + G_DIETPI-NOTIFY 2 "Entered image creator: $IMAGE_CREATOR" + # Pre-image used/name - while : - do + if [[ ! $PREIMAGE_INFO ]]; then - G_WHIP_INPUTBOX 'Please enter the name or URL of the pre-image you installed on this system, prior to running this script. This will be used to identify the pre-image credits.\n\nEG: Debian, Raspbian Lite, Meveric, FriendlyARM, or "forum.odroid.com/viewtopic.php?f=ABC&t=XYZ" etc.\n\nNB: An entry is required.' - if (( ! $? )) && [[ $G_WHIP_RETURNED_VALUE ]]; then + while : + do - PREIMAGE_INFO=$G_WHIP_RETURNED_VALUE - G_DIETPI-NOTIFY 2 "Entered pre-image info: $PREIMAGE_INFO" - break + G_WHIP_INPUTBOX 'Please enter the name or URL of the pre-image you installed on this system, prior to running this script. This will be used to identify the pre-image credits.\n\nEG: Debian, Raspbian Lite, Meveric, FriendlyARM, or "forum.odroid.com/viewtopic.php?f=ABC&t=XYZ" etc.\n\nNB: An entry is required.' + if [[ $G_WHIP_RETURNED_VALUE ]]; then - fi + PREIMAGE_INFO=$G_WHIP_RETURNED_VALUE + break - done + fi + + done + + fi + + G_DIETPI-NOTIFY 2 "Entered pre-image info: $PREIMAGE_INFO" # Hardware selection # NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results, @@ -422,42 +441,72 @@ ) - G_WHIP_MENU 'Please select the current device this is being installed on:\n - NB: Select "Generic device" if not listed.\n - "Core devices": Are fully supported by DietPi, offering full GPU + Kodi support.\n - "Limited support devices": No GPU support, supported limited to DietPi specific issues only (eg: excludes Kernel/GPU/VPU related items).' - if (( $? )) || [[ -z $G_WHIP_RETURNED_VALUE ]]; then + while : + do - G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n' - exit 0 + # Check for valid entry, e.g. when set via environment variabe + if disable_error=1 G_CHECK_VALIDINT "$HW_MODEL" 0; then - fi + for i in "${G_WHIP_MENU_ARRAY[@]}" + do + + [[ $HW_MODEL == $i ]] && break 2 + + done + + fi + + G_WHIP_MENU 'Please select the current device this is being installed on:\n - NB: Select "Generic device" if not listed.\n - "Core devices": Are fully supported by DietPi, offering full GPU + Kodi support.\n - "Limited support devices": No GPU support, supported limited to DietPi specific issues only (eg: excludes Kernel/GPU/VPU related items).' + if (( $? )); then + + G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n' + exit 0 + + elif [[ $G_WHIP_RETURNED_VALUE ]]; then + + HW_MODEL=$G_WHIP_RETURNED_VALUE + break + + fi + + done + G_HW_MODEL=$HW_MODEL + unset HW_MODEL # + Set for future scripts - G_HW_MODEL=$G_WHIP_RETURNED_VALUE echo $G_HW_MODEL > /etc/.dietpi_hw_model_identifier G_DIETPI-NOTIFY 2 "Selected hardware model ID: $G_HW_MODEL" G_DIETPI-NOTIFY 2 "Detected CPU architecture: $G_HW_ARCH_DESCRIPTION (ID: $G_HW_ARCH)" - G_WHIP_MENU_ARRAY=( + # WiFi selection + if [[ $WIFI_REQUIRED != [01] ]]; then - '0' ': I do not require WiFi functionality, skip related package install.' - '1' ': I require WiFi functionality, install related packages.' + G_WHIP_MENU_ARRAY=( - ) + '0' ': I do not require WiFi functionality, skip related package install.' + '1' ': I require WiFi functionality, install related packages.' - G_WHIP_DEFAULT_ITEM=1 - (( $G_HW_MODEL == 20 )) && G_WHIP_DEFAULT_ITEM=0 + ) - if G_WHIP_MENU 'Please select an option:' && (( $G_WHIP_RETURNED_VALUE )); then + G_WHIP_DEFAULT_ITEM=1 + (( $G_HW_MODEL == 20 )) && G_WHIP_DEFAULT_ITEM=0 + if G_WHIP_MENU 'Please select an option:'; then - G_DIETPI-NOTIFY 2 'Marking WiFi as required' - WIFI_REQUIRED=1 - else + WIFI_REQUIRED=$G_WHIP_RETURNED_VALUE + + else - G_DIETPI-NOTIFY 2 'Marking WiFi as NOT required' + G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n' + exit 0 + + fi fi + (( $WIFI_REQUIRED )) && G_DIETPI-NOTIFY 2 'Marking WiFi as required' || G_DIETPI-NOTIFY 2 'Marking WiFi as NOT required' + # Distro Selection DISTRO_LIST_ARRAY=( @@ -488,24 +537,44 @@ unset DISTRO_LIST_ARRAY - if [[ -z ${G_WHIP_MENU_ARRAY+x} ]]; then + if (( ! ${#G_WHIP_MENU_ARRAY[@]} )); then G_DIETPI-NOTIFY 1 'No available distro versions for this system. Aborting...\n' exit 1 fi - G_WHIP_DEFAULT_ITEM=${G_WHIP_MENU_ARRAY[0]} # Downgrades disabled, so first item matches current/lowest supported distro version - G_WHIP_BUTTON_CANCEL_TEXT='Exit' - G_WHIP_MENU "Please select a distro version to install on this system. Selecting a distro that is older than the current installed on system, is not supported.\n\nCurrently installed:\n - $G_DISTRO $G_DISTRO_NAME" - if (( $? )) || [[ -z $G_WHIP_RETURNED_VALUE ]]; then + while : + do - G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n' - exit 0 + if disable_error=1 G_CHECK_VALIDINT "$DISTRO_TARGET" 0; then - fi + for i in "${G_WHIP_MENU_ARRAY[@]}" + do + + [[ $DISTRO_TARGET == $i ]] && break 2 + + done + + fi + + G_WHIP_DEFAULT_ITEM=${G_WHIP_MENU_ARRAY[0]} # Downgrades disabled, so first item matches current/lowest supported distro version + G_WHIP_BUTTON_CANCEL_TEXT='Exit' + G_WHIP_MENU "Please select a distro version to install on this system. Selecting a distro that is older than the current installed on system, is not supported.\n\nCurrently installed:\n - $G_DISTRO $G_DISTRO_NAME" + if (( $? )); then + + G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n' + exit 0 + + else + + DISTRO_TARGET=$G_WHIP_RETURNED_VALUE + break + + fi + + done - DISTRO_TARGET=$G_WHIP_RETURNED_VALUE if (( $DISTRO_TARGET == 4 )); then DISTRO_TARGET_NAME='stretch' @@ -531,9 +600,9 @@ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - INTERNET_ADDRESS="https://github.com/$G_GITOWNER/DietPi/archive/$G_GITBRANCH.zip" - G_CHECK_URL "$INTERNET_ADDRESS" - G_RUN_CMD wget "$INTERNET_ADDRESS" -O package.zip + local url="https://github.com/$G_GITOWNER/DietPi/archive/$G_GITBRANCH.zip" + G_CHECK_URL "$url" + G_RUN_CMD wget "$url" -O package.zip [[ -d DietPi-$G_GITBRANCH ]] && l_message='Cleaning previously extracted files' G_RUN_CMD rm -R "DietPi-$G_GITBRANCH" l_message='Extracting DietPi sourcecode' G_RUN_CMD unzip package.zip From 02e15dce6f20e369f3a812ff4ac3bb6c678e823d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 4 May 2019 18:55:17 +0200 Subject: [PATCH 188/253] v6.23 + CHANGELOG | DietPi-PREP automation via environment variables --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4b2432e34b..b3a8452d99 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changes / Improvements / Optimisations: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 +- DietPi-PREP | The script execution can now be fully automated via environment variables. Many thanks to @FredericGuilbault for adding this feature: https://github.com/MichaIng/DietPi/pull/2756 - DietPi-Config | Added support to toggle Intel CPU turbo/boost mode. Requires Intel CPU that supports the feature. - DietPi-Config | G_CHECK_URL: Added ability to change the connection attempts and timeout, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717 - DietPi-Config | Serial/UART device handling has been reworked. Serial login consoles can now be toggled for every found serial device individually. On RPi the primary UART can be completely disabled and warnings are prompted if Bluetooth and login console are to be enabled both on ttyAMA0. On update existing systems will be patched so that serial-getty masks and enabled instances are removed if the related serial device does not exist. This solves some error messages during boot. From c23700e14a8870cc06db5cce3edd6706b204a5a3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 5 May 2019 01:01:01 +0200 Subject: [PATCH 189/253] v6.23 + DietPi-CPU_info | Minor coding --- dietpi/dietpi-cpuinfo | 63 +++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 5d297bdcf9..3766500de7 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -12,23 +12,19 @@ # - Prints CPU information # # Usage: - # - /DietPi/dietpi/dietpi-cpuinfo Obtain stats and print + # - /DietPi/dietpi/dietpi-cpuinfo Obtain stats and print # - /DietPi/dietpi/dietpi-cpuinfo 2 Generates file of available, ordered scaling freq's $FP_CPU_SCALINGAVAILABLE_FREQ #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-CPU_info' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - #DietPi-Globals exit trap addition - G_EXIT_CUSTOM(){ unset aCPU_CURRENT_FREQ aCPU_MIN_FREQ aCPU_MAX_FREQ aCPU_SCALINGAVAILABLE_FREQ; } - - #Grab Input - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab input + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 aCPU_CURRENT_FREQ=() aCPU_MIN_FREQ=() @@ -38,19 +34,19 @@ for ((i=0; i<$(nproc --all); i++)) do - if [[ -f /sys/devices/system/cpu/cpu$i/cpufreq/scaling_cur_freq ]]; then + if [[ -f '/sys/devices/system/cpu/cpu$i/cpufreq/scaling_cur_freq' ]]; then aCPU_CURRENT_FREQ[$i]=$( $FP_CPU_SCALINGAVAILABLE_FREQ if (( $CPU_SCALINGSUPPORTED )); then @@ -176,16 +167,16 @@ for i in ${aCPU_SCALINGAVAILABLE_FREQ[@]} do - echo -e "$i" >> $FP_CPU_SCALINGAVAILABLE_FREQ + echo $i >> $FP_CPU_SCALINGAVAILABLE_FREQ done - # Order, remove dupes + # - Order, remove dupes sort -u -n $FP_CPU_SCALINGAVAILABLE_FREQ -o $FP_CPU_SCALINGAVAILABLE_FREQ fi - #Print all stats + # Print all stats else Obtain_Cpu_Freq From 81810d3e2b9be2c2664d4335ad78cca29b5578b9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 5 May 2019 01:02:50 +0200 Subject: [PATCH 190/253] v6.23 + DietPi-CPU_info | Syntax --- dietpi/dietpi-cpuinfo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 3766500de7..c49969c1b2 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -34,19 +34,19 @@ for ((i=0; i<$(nproc --all); i++)) do - if [[ -f '/sys/devices/system/cpu/cpu$i/cpufreq/scaling_cur_freq' ]]; then + if [[ -f /sys/devices/system/cpu/cpu$i/cpufreq/scaling_cur_freq ]]; then aCPU_CURRENT_FREQ[$i]=$( Date: Sun, 5 May 2019 01:53:40 +0200 Subject: [PATCH 191/253] v6.23 + DietPi-Cleaner | Minor coding --- dietpi/dietpi-cleaner | 151 ++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 85 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 07ed115228..3d9cbf7391 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -8,6 +8,7 @@ #//////////////////////////////////// # # Info: + # - Location: /DietPi/dietpi/dietpi-cleaner # - Cleans "crap" on users system :) # # - Usage @@ -16,17 +17,16 @@ # /DietPi/dietpi/dietpi-cleaner 2 = Run All cleaners (no menu). #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Cleaner' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - #Grab Input (valid interger) - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab Input (valid interger) + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -48,7 +48,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Menu #///////////////////////////////////////////////////////////////////////////////////// - #Whippy Whoopy Whiptail! + # Whippy Whoopy Whiptail! TARGETMENUID=0 Menu_Exit(){ @@ -56,22 +56,20 @@ G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - #exit - TARGETMENUID=-1 + TARGETMENUID=-1 # Exit else - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Main menu fi } - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ - #Get current RootFS usage + # Get current RootFS usage Update_Space_Used TARGETMENUID=0 @@ -114,10 +112,10 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6 Test) - #Enable test + # Enable test DRY_RUN=1 - #check for at least 1 enabled. + # Check for at least 1 enabled. local at_least_one_cleaner_is_enabled=0 for ((i=0; i<$MAX_CLEANERS; i++)) do @@ -133,8 +131,8 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6 if (( $at_least_one_cleaner_is_enabled )); then - G_WHIP_YESNO "$G_PROGRAM_NAME will now simulate your enabled cleaners.\n\n(Notice): No data will be modified.\n\nContinue with test run?" - (( $? == 0 )) && Run_Cleaners + G_WHIP_YESNO "$G_PROGRAM_NAME will now simulate your enabled cleaners.\n +(Notice): No data will be modified.\n\nContinue with test run?" && Run_Cleaners else @@ -146,10 +144,10 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6 Run) - #Disable test + # Disable test DRY_RUN=0 - #check for at least 1 enabled. + # Check for at least 1 enabled. local at_least_one_cleaner_is_enabled=0 for ((i=0; i<$MAX_CLEANERS; i++)) do @@ -187,23 +185,21 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners } - #TARGETMENUID=1 + # TARGETMENUID=1 Menu_Cleaners(){ - #Return to main menu - TARGETMENUID=0 + TARGETMENUID=0 # Main menu - #Get on/off whilptail status + # Get on/off whilptail status G_WHIP_CHECKLIST_ARRAY=() local OnOff_Status='on' for ((i=0; i<$MAX_CLEANERS; i++)) do - #On/Off status - OnOff_Status='on' - (( ${aEnabledCleaners[$i]} )) || OnOff_Status='off' + # On/Off status + (( ${aEnabledCleaners[$i]} )) && OnOff_Status='on' || OnOff_Status='off' - #Define options + # Define options if (( $i == 0 )); then G_WHIP_CHECKLIST_ARRAY+=("$i " ': Dev - Uninstalls all dev packages (eg: git, lib123-dev).' "$OnOff_Status") @@ -222,7 +218,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners elif (( $i == 4 )); then - G_WHIP_CHECKLIST_ARRAY+=("$i " ': Apt - Clears the apt cache and runs a fresh update.' "$OnOff_Status") + G_WHIP_CHECKLIST_ARRAY+=("$i " ': APT - Clears the APT cache and runs a fresh update.' "$OnOff_Status") else @@ -252,11 +248,10 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners } - #TARGETMENUID=2 + # TARGETMENUID=2 Menu_Options_Files(){ - #Return to main menu - TARGETMENUID=0 + TARGETMENUID=0 # Main menu local option_1_text='Include mount directory (/mnt/*) during file scan' local include_mnt_status='Disabled' @@ -277,24 +272,15 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners "$option_1_text") - if (( $INCLUDE_MNT )); then - - INCLUDE_MNT=0 - - else - - INCLUDE_MNT=1 - - fi - - TARGETMENUID=2 + (( $INCLUDE_MNT )) && INCLUDE_MNT=0 || INCLUDE_MNT=1 + TARGETMENUID=2 # Files menu ;; "$option_2_text") nano $FILEPATH_CUSTOMFILES - TARGETMENUID=2 + TARGETMENUID=2 # Files menu ;; @@ -339,13 +325,13 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners Run_Cleaners(){ - #stop services + # Stop services /DietPi/dietpi/dietpi-services stop Update_Space_Used ROOT_SPACE_USED_BEFORE=$ROOT_SPACE_USED_CURRENT - #Run enabled cleaners + # Run enabled cleaners for ((i=0; i<$MAX_CLEANERS; i++)) do @@ -356,7 +342,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners Update_Space_Used ROOT_SPACE_USED_AFTER=$ROOT_SPACE_USED_CURRENT - #start services + # Start services /DietPi/dietpi/dietpi-services start #inform user of space cleared. @@ -384,18 +370,18 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners while read line do - #Convert lined list into a 1 line string. + # Convert lined list into a 1 line string. string_package_names+="$line " done <<< "$(dpkg --get-selections | mawk '/-dev/ {print $1}')" - #add other dev packages + # Add other dev packages string_package_names+='build-essential git' - #Purge + # Purge if (( $DRY_RUN )); then - apt-get remove -ys $string_package_names + apt-get -s purge $string_package_names else @@ -414,18 +400,16 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners INFO_CLEAN_NAME='Man pages and docs' Banner_Cleaning - local Yes_or_Simulate='-y' - (( $DRY_RUN )) && Yes_or_Simulate='-s' + # Purge + if (( $DRY_RUN )); then - G_AGP man manpages $Yes_or_Simulate - G_AGA $Yes_or_Simulate + apt-get -s purge man manpages - #Remove files - if (( ! $DRY_RUN )); then + else - rm -R /usr/share/man - rm -R /usr/share/doc - rm -R /usr/share/doc-base + G_AGP man manpages + G_AGA + rm -Rf /usr/share/{man,doc,doc-base} fi @@ -437,25 +421,25 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners INFO_CLEAN_NAME='Files' Banner_Cleaning - #Generate list of files to include. Remove lines with (#) or (space) or (empty) from list + # Generate list of files to include. Remove lines with (#) or (space) or (empty) from list sed -E '/([#[:blank:]]|^$)/d' $FILEPATH_CUSTOMFILES > $FP_TEMP - #Check include file has at least one value/line to process. + # Check include file has at least one value/line to process. local line_count=$(wc -l < $FP_TEMP) - if (( $line_count == 0 )); then + if (( ! $line_count )); then - echo -e "\nNo files to find. Have you setup the Files options and added filename entries to match?\n" + echo -e '\nNo files to find. Have you setup the Files options and added filename entries to match?\n' else - #Create array to hold user includes + # Create array to hold user includes local aCustomFiles=() readarray aCustomFiles < $FP_TEMP - #Generate the find string + # Generate the find string local find_string='' echo -e '\nSearching for filenames matching:' - for ((i=0; i<${#aCustomFiles[@]}; i++)) + for i in ${!aCustomFiles[@]} do echo -e "- ${aCustomFiles[$i]}" @@ -474,10 +458,10 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners echo 'Please wait...' - #Find all matching filenames. + # Find all matching filenames. find / -type f $find_string > $FP_TEMP - #Remove /mnt from find list + # Remove /mnt from find list (( $INCLUDE_MNT )) || sed -i '/\/mnt/d' $FP_TEMP line_count=$(wc -l < $FP_TEMP) @@ -491,7 +475,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners fi - #Remove files + # Remove files while read line do @@ -505,9 +489,6 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners done < $FP_TEMP - #delete[] - unset aCustomFiles - fi rm $FP_TEMP @@ -529,7 +510,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners } - # Apt caches + # APT caches Run_Cleaner_4(){ INFO_CLEAN_NAME='APT cache and update' @@ -548,7 +529,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners #///////////////////////////////////////////////////////////////////////////////////// # Settings File #///////////////////////////////////////////////////////////////////////////////////// - #Define Location + # Define Location FILEPATH_SETTINGS='/DietPi/dietpi/.dietpi-cleaner' FILEPATH_CUSTOMFILES='/DietPi/dietpi/.dietpi-cleaner_custom_files' @@ -556,10 +537,10 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners if [[ -f $FILEPATH_SETTINGS ]]; then - #Get line count - local line_count=$(cat $FILEPATH_SETTINGS | wc -l) + # Get line count + local line_count=$(wc -l < $FILEPATH_SETTINGS) - #Load settings + # Load settings for ((i=0; i<$line_count; i++)) do @@ -569,7 +550,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners fi - #Custom filescan options + # Custom filescan options if [[ ! -f $FILEPATH_CUSTOMFILES ]]; then cat << _EOF_ > $FILEPATH_CUSTOMFILES @@ -600,26 +581,26 @@ _EOF_ Write_Settings_File(){ - #Enabled/Disabled Cleaner Settings - rm $FILEPATH_SETTINGS &> /dev/null + # Enabled/Disabled Cleaner Settings + [[ -f $FILEPATH_SETTINGS ]] && rm $FILEPATH_SETTINGS for ((i=0; i<$MAX_CLEANERS; i++)) do - echo -e "${aEnabledCleaners[$i]}" >> $FILEPATH_SETTINGS + echo "${aEnabledCleaners[$i]}" >> $FILEPATH_SETTINGS done } #///////////////////////////////////////////////////////////////////////////////////// - #Main + # Main #///////////////////////////////////////////////////////////////////////////////////// Read_Settings_File #----------------------------------------------------------------------------------- - #Run Menu + # Run Menu if (( $INPUT == 0 )); then - #Start DietPi Menu + # Start DietPi Menu while (( $TARGETMENUID > -1 )); do if (( $TARGETMENUID == 0 )); then @@ -641,13 +622,13 @@ _EOF_ Write_Settings_File #----------------------------------------------------------------------------------- - #Run Enabled cleaners (no menu) + # Run Enabled cleaners (no menu) elif (( $INPUT == 1 )); then Run_Cleaners #----------------------------------------------------------------------------------- - #Run ALL cleaners (no menu) + # Run ALL cleaners (no menu) elif (( $INPUT == 2 )); then for ((i=0; i<$MAX_CLEANERS; i++)) From f51948bf1771944b9c1e6c197eb916f134a06ddd Mon Sep 17 00:00:00 2001 From: Frederic Guilbault Date: Sun, 5 May 2019 08:13:16 -0400 Subject: [PATCH 192/253] Trivial text edit for better clarity --- PREP_SYSTEM_FOR_DIETPI.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 4ade5df87e..dbd1be3c08 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -158,7 +158,7 @@ ) - if GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then + if GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select the Git branch the installer should use:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then unset aWHIP_BRANCH @@ -200,6 +200,7 @@ G_PROGRAM_NAME='DietPi-PREP' G_INIT + # - Detect the the Debian version of this operating system. if grep -q 'jessie' /etc/os-release; then G_DISTRO=3 @@ -222,6 +223,7 @@ fi + # - Detect the the hardware architecture of this operating system. G_HW_ARCH_DESCRIPTION=$(uname -m) if [[ $G_HW_ARCH_DESCRIPTION == 'armv6l' ]]; then @@ -260,7 +262,7 @@ #------------------------------------------------------------------------------------------------ if [[ -d /DietPi/dietpi || -d /boot/dietpi ]]; then - G_DIETPI-NOTIFY 2 'DietPi system found, running pre-prep' + G_DIETPI-NOTIFY 2 'DietPi system found, removing the old files and stopping services. (pre-prep)' # - Stop services: RAMdisk includes (Pre|Post)Boot due to dependencies [[ -f /DietPi/dietpi/dietpi-services ]] && /DietPi/dietpi/dietpi-services stop @@ -296,7 +298,7 @@ #------------------------------------------------------------------------------------------------ echo '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - G_DIETPI-NOTIFY 0 "Step $SETUP_STEP (inputs): Image info / Hardware / WiFi / Distro:" + G_DIETPI-NOTIFY 0 "Step $SETUP_STEP Ask user about: Image info / Hardware / WiFi / Distro:" ((SETUP_STEP++)) G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ @@ -783,6 +785,7 @@ _EOF_ # - G_HW_ARCH specific required Kernel packages # As these are kernel, or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: # https://github.com/MichaIng/DietPi/issues/1285#issuecomment-354602594 + # x86_64 if (( $G_HW_ARCH == 10 )); then From 66b8ecc77f1229b2d331d3a8b833b80003d77cf8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 5 May 2019 13:20:35 +0100 Subject: [PATCH 193/253] Resolve Java on buster. --- dietpi/dietpi-software | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8c4bd46a35..c2ccd14f18 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6660,7 +6660,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix else - local packages='ca-certificates-java openjdk-8-jre-headless openjdk-8-jdk-headless' + local version=8 + (( $G_DISTRO == 5 )) && version=11 + + local packages="ca-certificates-java openjdk-$version-jre-headless openjdk-$version-jdk-headless" # Workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524 apt-get install -y -qq $packages G_AGI $packages From 489571834081480a01d13c746d0b3791648e21c2 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 5 May 2019 13:22:08 +0100 Subject: [PATCH 194/253] Minor --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c2ccd14f18..007943edd9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2128,7 +2128,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=8 aSOFTWARE_WHIP_NAME[$software_id]='Java' - aSOFTWARE_WHIP_DESC[$software_id]='OpenJDK 8 + JRE libary' + aSOFTWARE_WHIP_DESC[$software_id]='OpenJDK + JRE libary' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=1 #------------------ From 158d0e44e615c34a14b4d6f8ba3e4a87e5ddd909 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 5 May 2019 21:33:25 +0200 Subject: [PATCH 195/253] v6.23 (#2768) + DietPi-Software | SABnzbd: Install latest master version + DietPi-Software | SABnzbd: Clear install dir before reinstalling, preserving config file + DietPi-Software | SABnzbd: Do not touch existing config files on reinstall + DietPi-Software | SABnzbd: p7zip-full binaries are expected + DietPi-Software | SABnzbd: Skip install non-required -dev packages + DietPi-Software | SABnzbd: Build-essentials are not required. Par2 multicore compiling requires it, but info about that has been added to online docs. + DietPi-Software | SABnzbd: Slight systemd unit updates based on docs and shebang + DietPi-Software | SABnzbd: Start with Python 2.7 binary explicitly to avoid possible conflicts with Python 3 + DietPi-Set_software | setpermissions: Add SABnzbd download sub dirs + DietPi-Patch | Reinstall SABnzbd to update to current version and apply 7zip-full and systemd unit --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 119 ++++++++++++++++++++------------ dietpi/func/dietpi-set_software | 13 ++-- dietpi/patch_file | 5 +- 4 files changed, 84 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b3a8452d99..cb673b4676 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -30,6 +30,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. - DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 +- DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 Bug Fixes: - System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 007943edd9..44a2c0054f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -910,7 +910,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=142 @@ -5596,22 +5595,29 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #sabnzbd - software_id=139 + software_id=139 # SABnzbd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # https://sabnzbd.org/wiki/installation/install-off-modules + + # Pre-reqs + DEPS_LIST='par2 p7zip-full' + + Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.zip' - local version='2.3.5' + # Clear old install dir (in case of reinstall) + if [[ -d '/etc/sabnzbd' ]]; then - #prereqs - DEPS_LIST='par2 python-dev libffi-dev libssl-dev' + # - Preserve old config file + [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] && mv /etc/sabnzbd/sabnzbd.ini sabnzbd-master/ + rm -R /etc/sabnzbd - Download_Install "https://github.com/sabnzbd/sabnzbd/archive/$version.zip" /etc/sabnzbd + fi - mv /etc/sabnzbd/sabnzbd-"$version"/* /etc/sabnzbd/ - rm -R /etc/sabnzbd/sabnzbd-"$version" + # Install new files + mv sabnzbd-master /etc/sabnzbd + # Required Python modules pip install cheetah cryptography sabyenc fi @@ -11446,60 +11452,76 @@ _EOF_ Banner_Configuration - useradd -rM sabnzbd -G dietpi -s /usr/sbin/nologin + # User + local usercmd='useradd -rM' + getent passwd sabnzbd &> /dev/null && usercmd='usermod' + $usercmd sabnzbd -G dietpi -d /etc/sabnzbd -s $(command -v nologin) + + # Service: https://github.com/sabnzbd/sabnzbd/blob/master/linux/sabnzbd%40.service + # - Options: https://sabnzbd.org/wiki/advanced/command-line-parameters + # "-OO": Optimise code and remove doc lines (default shebang of SABnzbd.py, but we run python2.7 explicitly to avoid version conflicts) + # "-d": Run in daemon mode without terminal and browser start (requires "-f ") + # NB: In systemd unit leads to unreliable long taking webserver start. A new process is forked which allows web access, but sometimes after very long time, sometimes never: https://github.com/sabnzbd/sabnzbd/issues/1283 + # "-b 0": Do no start browser with daemon cat << _EOF_ > /etc/systemd/system/sabnzbd.service [Unit] -Description=sabnzbd (DietPi) +Description=SABnzbd (DietPi) +Documentation=https://sabnzbd.org/wiki/ +Wants=network-online.target +After=network-online.target [Service] User=sabnzbd Group=dietpi -ExecStart=$(command -v python) /etc/sabnzbd/SABnzbd.py -f /etc/sabnzbd/sabnzbd.ini +ExecStart=$(command -v python2.7) -OO /etc/sabnzbd/SABnzbd.py -b 0 -f /etc/sabnzbd/sabnzbd.ini +Restart=on-failure [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload + # Log dir and permissions mkdir -p /var/log/sabnzbd - chown -R sabnzbd:dietpi /etc/sabnzbd - chown -R sabnzbd:dietpi /var/log/sabnzbd + chown -R sabnzbd:sabnzbd /etc/sabnzbd /var/log/sabnzbd - # Create config: - # API keys and intial config are only generated during 1st run of sabnzbd - # We need to launch program, then apply our config tweaks, else, wizard setup in web interface simply loops without API keys. - rm /etc/sabnzbd/sabnzbd.ini &> /dev/null + # Create 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 - systemctl start sabnzbd - G_DIETPI-NOTIFY 2 "Generating initial config, please wait..." - while [[ ! -f '/etc/sabnzbd/sabnzbd.ini' ]] - do - - sleep 1 + systemctl daemon-reload + systemctl start sabnzbd - done + G_DIETPI-NOTIFY 2 'Generating initial config, please wait...' + while [[ ! -f '/etc/sabnzbd/sabnzbd.ini' ]] + do - sleep 2 + sleep 0.5 - systemctl stop sabnzbd + done + sleep 2 - sleep 2 #additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?f=11&t=1848&p=7085#p7082 + systemctl stop sabnzbd + sleep 2 # Additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?p=7082#p7082 - sed -i "/^download_dir =/c\download_dir = $G_FP_DIETPI_USERDATA/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^complete_dir =/c\complete_dir = $G_FP_DIETPI_USERDATA/downloads/complete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^nzb_backup_dir =/c\nzb_backup_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini - sed -i "/^admin_dir =/c\admin_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini - sed -i "/^log_dir =/c\log_dir = /var/log/sabnzbd" /etc/sabnzbd/sabnzbd.ini - sed -i "/^log_level =/c\log_level = 0" /etc/sabnzbd/sabnzbd.ini #err only - sed -i "/^refresh_rate =/c\refresh_rate = 2" /etc/sabnzbd/sabnzbd.ini - sed -i "/^host =/c\host = 0.0.0.0" /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'download_dir =' "download_dir = $G_FP_DIETPI_USERDATA/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'complete_dir =' "complete_dir = $G_FP_DIETPI_USERDATA/downloads/complete" /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'nzb_backup_dir =' "nzb_backup_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'admin_dir =' "admin_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'log_dir =' 'log_dir = /var/log/sabnzbd' /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'log_level =' 'log_level = 0' /etc/sabnzbd/sabnzbd.ini # Warning errors only + G_CONFIG_INJECT 'refresh_rate =' 'refresh_rate = 2' /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'host =' 'host = 0.0.0.0' /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'permissions =' 'permissions = 0775' /etc/sabnzbd/sabnzbd.ini + G_CONFIG_INJECT 'auto_browser =' 'auto_browser = 0' /etc/sabnzbd/sabnzbd.ini - G_CONFIG_INJECT 'permissions =' 'permissions = "0775"' /etc/sabnzbd/sabnzbd.ini + fi - # - Install language packs: https://github.com/MichaIng/DietPi/issues/1917#issue-340631943 + # Install language packs: https://github.com/MichaIng/DietPi/issues/1917#issue-340631943 cd /etc/sabnzbd - G_RUN_CMD python tools/make_mo.py - cd /root + G_RUN_CMD python2.7 tools/make_mo.py + cd /tmp/$G_PROGRAM_NAME fi @@ -12908,13 +12930,18 @@ _EOF_ fi - software_id=139 + software_id=139 # SABnzbd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - userdel -rf sabnzbd - rm -R /etc/sabnzbd - rm /etc/systemd/system/sabnzbd.service + getent passwd sabnzbd &> /dev/null && userdel -rf sabnzbd + [[ -d '/etc/sabnzbd' ]] && rm -R /etc/sabnzbd + if [[ -f '/etc/systemd/system/sabnzbd.service' ]]; then + + systemctl disable sabnzbd + rm /etc/systemd/system/sabnzbd.service + + fi fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 64da1412c7..84f720e41c 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -328,9 +328,9 @@ _EOF_ chmod +x /root/Desktop/* # - O!MPD, requires write permissions - chmod -R 777 /var/www/ompd/tmp #(required for database update) - chmod -R 777 /var/www/ompd/stream #(required for streaming files) - chmod -R 777 /var/www/ompd/cache #(required for downloading files) + chmod -R 777 /var/www/ompd/tmp # Required for database update + chmod -R 777 /var/www/ompd/stream # Required for streaming files + chmod -R 777 /var/www/ompd/cache # Required for downloading files # - MPD chmod 0664 /var/log/mpd/mpd.log /etc/mpd.conf @@ -401,7 +401,7 @@ _EOF_ # - sickrage # pre-v6.20 compatibility [[ -d $G_FP_DIETPI_USERDATA/sickrage ]] && chown -R sickrage:dietpi $G_FP_DIETPI_USERDATA/sickrage - [[ -f /var/log/sickrage.log ]] && chown sickrage:dietpi /var/log/sickrage.log + [[ -f '/var/log/sickrage.log' ]] && chown sickrage:dietpi /var/log/sickrage.log # - Medusa chown -R medusa:dietpi $G_FP_DIETPI_USERDATA/medusa @@ -454,14 +454,15 @@ _EOF_ chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log # - Sabnzbd - chown -R sabnzbd:dietpi /etc/sabnzbd /var/log/sabnzbd + chown -R sabnzbd:sabnzbd /etc/sabnzbd /var/log/sabnzbd $G_FP_DIETPI_USERDATA/downloads/sabnzbd* + chown -R sabnzbd:dietpi $G_FP_DIETPI_USERDATA/downloads/{,in}complete # - Blynk chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk # - Pi-hole # - NB: Git requies special permissions to allow "pihole -up". - if [[ -d /var/www/html/pihole ]]; then + if [[ -d '/var/www/html/pihole' ]]; then cd /var/www/html/admin && git reset --hard HEAD cd /tmp/$G_PROGRAM_NAME diff --git a/dietpi/patch_file b/dietpi/patch_file index 84738ce30d..9489fa8178 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -901,7 +901,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Reinstalls: - # # => v6.20 NAA: https://dietpi.com/phpbb/viewtopic.php?f=11&t=4420&p=13914#p13914 + # # => v6.20 NAA: https://dietpi.com/phpbb/viewtopic.php?p=13914#p13914 #------------------------------------------------------------------------------- elif (( $G_DIETPI_VERSION_SUB == 14 )); then @@ -1904,13 +1904,14 @@ Your Nextcloud data are not touched.' dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list # Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4 + # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then systemctl disable squeezeboxserver mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service fi - /DietPi/dietpi/dietpi-software reinstall 34 35 42 $reinstall_ids + /DietPi/dietpi/dietpi-software reinstall 34 35 42 139 $reinstall_ids #----------------------------------------------------------------------- # Remove old PHP version if (( $upgrade_php )); then From 259073f79ea34a02202def42c6d8f885b294ff05 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 5 May 2019 22:15:41 +0200 Subject: [PATCH 196/253] v6.23 + 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 3a79d15d01..2a01bb1a3e 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 23 -0 +1 From f50b9482e98ebfbabfbbb696b4d6ef805997a030 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 5 May 2019 22:16:16 +0200 Subject: [PATCH 197/253] v6.23 - 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 4cd99ba53c..33ce1c95b7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -62,7 +62,7 @@ #DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-23} - 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} [[ -f '/DietPi/dietpi/.version' && $( Date: Sun, 5 May 2019 22:46:23 +0200 Subject: [PATCH 198/253] v6.23 + CHANGELOG | Java: Resolved an issue where install fails on Buster systems --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb673b4676..e0cd6008ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -50,6 +50,7 @@ Bug Fixes: - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 +- DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From 45f79c60c78c8d0fe921da7367f5a2f8272a6086 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 6 May 2019 02:20:55 +0200 Subject: [PATCH 199/253] v6.23 + DietPi-Globals | Minor coding, cleanup, wording and alignment --- dietpi/func/dietpi-globals | 366 +++++++++++++++++-------------------- 1 file changed, 166 insertions(+), 200 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 33ce1c95b7..9fe8836d74 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -9,17 +9,10 @@ #//////////////////////////////////// # # Info: - # - Provides/Exports shared/global DietPi variables/functions for current bash session and other scripts + # - Provides shared/global DietPi variables and functions for current bash session and DietPi scripts # - CRITICAL, use local index variables in for/while loops, or unset them afterwards, else havoc: https://github.com/MichaIng/DietPi/issues/1454 - # - Sourced/Loaded in interactive bash sessions: /etc/bashrc.d/dietpi-login.sh - # - Sourced/Loaded as start of all DietPi script, except those listed below - # - # Excluded scripts, which do NOT load these globals: - # - dietpi-ramlog - # - dietpi-ramdisk - # - dietpi-obtain_hw_model - # - dietpi.txt and all other .txt, .ini or config files - # + # - Sourced/Loaded in interactive bash sessions: /etc/bashrc.d/dietpi.bash + # - Sourced/Loaded as start of most DietPi script #//////////////////////////////////// #----------------------------------------------------------------------------------- @@ -33,33 +26,33 @@ #----------------------------------------------------------------------------------- #----------------------------------------------------------------------------------- - # Core varianles, functions and environment, used at start of all scripts + # Core variables, functions and environment, used at start of all scripts #----------------------------------------------------------------------------------- - #To be exported by the originating script, after loading globals and before calling G_INIT() - # - Used in G_ERROR_ and G_WHIP_ + # To be exported by the originating script, after loading globals and before calling G_INIT() + # - Used in G_ERROR_HANDLER, G_WHIP_* and G_DIETPI-NOTIFY functions unset G_PROGRAM_NAME - #Debug enable - G_DEBUG=${G_DEBUG:-0} + # Debug mode + # - Do no pre-generate to reduce bash session variables: Needs to be checked via: [[ $G_DEBUG == 1 ]] + #G_DEBUG=${G_DEBUG:-0} - #Flag, if we are in interactive shell, by checking STDIN availability + # Flag, if we are in interactive shell, by checking STDIN availability # OK | systemd = non-STDIN # OK | Cron = non-STDIN # NB | ~/.bashrc = STDIN # - Affects whether G_ERROR_ and G_WHIP_ prompts are displayed or not # NB: You can export G_USER_INPUTS=0 to force non-interactive/automated scipt calls. Run 'unset G_USER_INPUTS' afterwards to return to auto detection. - if [[ -z $G_USER_INPUTS ]]; then + if [[ $G_USER_INPUTS != [01] ]]; then - G_USER_INPUTS=0 - [[ -t 0 ]] && G_USER_INPUTS=1 + [[ -t 0 ]] && G_USER_INPUTS=1 || G_USER_INPUTS=0 fi - #DietPi First-Run Stage | -2 = PREP_SYSTEM/Unknown | -1 = first boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot + # DietPi First-Run Stage | -2 = PREP_SYSTEM/Unknown | -1 = 1st boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot G_DIETPI_INSTALL_STAGE=-2 [[ -f '/DietPi/dietpi/.install_stage' ]] && G_DIETPI_INSTALL_STAGE=$( 0 )); then - # >=10 should never occur, however, if it is, lets make it line up regardless - if (( $HIERARCHY < 10 )); then - - local status_subfunction="$HIERARCHY " - - else - - local status_subfunction=$HIERARCHY + local status_subfunction="$HIERARCHY " + # > 9 should never occur, however, if it is, lets make it line up regardless + (( $HIERARCHY > 9 )) && status_subfunction=$HIERARCHY - fi output_string+="$bracket_l\e[33m SUB$status_subfunction$bracket_r $2 > " ainput_string+=('\n') - Print_Output_String 2 else - output_string+="\n \e[38;5;154m$2\e[0m" - output_string+='\n\e[90m─────────────────────────────────────────────────────' - output_string+='\n Mode: \e[0m' + output_string+=" + \e[38;5;154m$2\e[0m +\e[90m───────────────────────────────────────────────────── + Mode: \e[0m" ainput_string+=('\n\n') - Print_Output_String 2 fi + Print_Output_String 2 + fi #----------------------------------------------------------------------------------- - # Unset internal functions, otherwise they are accessible from terminal: - unset Clean_Process_Animation - unset Status_Ok - unset Status_Failed - unset Print_Output_String + # Unset internal functions, otherwise they are accessible from terminal + unset Clean_Process_Animation Status_Ok Status_Failed Print_Output_String #----------------------------------------------------------------------------------- } @@ -516,7 +502,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #----------------------------------------------------------------------------------- # DietPi scripts, moved from /etc/bash.bashrc # - sudo command that ensures DietPi-Globals with G_* commands are loaded - G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } + G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && "$@"; } # - sudo alias that allows running other aliases with "sudo" alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424 @@ -540,61 +526,56 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then alias dietpi-survey='/DietPi/dietpi/dietpi-survey' alias dietpi-explorer='/DietPi/dietpi/dietpi-explorer' alias dietpi-banner='/DietPi/dietpi/func/dietpi-banner 2' + alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom' alias cpu='/DietPi/dietpi/dietpi-cpuinfo' - # - Misc - # Sudo command, that ensures DietPi-Globals with G_* commands are loaded - G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } - alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424 - # - 1337 moments ;) alias 1337='echo Indeed, you are =\)' # - Helpers - #alias dd='dd status=progress ' #needs to be at end... + #alias dd='dd status=progress ' # needs to be at end... # - Optional DietPi software aliases/functions - [[ -d /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn ]] && alias dietpi-nordvpn='/DietPi/dietpi/misc/dietpi-nordvpn' - [[ -f /opt/retropie/supplementary/emulationstation/emulationstation ]] && alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' - [[ -f /usr/local/games/opentyrian/run ]] && alias opentyrian='/usr/local/games/opentyrian/run' - [[ -f /DietPi/dietpi/misc/dietpi-justboom ]] && alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom' + [[ -d '/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn' ]] && alias dietpi-nordvpn='/DietPi/dietpi/misc/dietpi-nordvpn' + [[ -f '/opt/retropie/supplementary/emulationstation/emulationstation' ]] && alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' + [[ -f '/usr/local/games/opentyrian/run' ]] && alias opentyrian='/usr/local/games/opentyrian/run' [[ -f $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh ]] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" - [[ -f /usr/share/applications/kodi.desktop ]] && alias startkodi='/DietPi/dietpi/misc/start_kodi' - [[ -f /etc/systemd/system/dietpi-cloudshell.service ]] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' + [[ -f '/usr/share/applications/kodi.desktop' ]] && alias startkodi='/DietPi/dietpi/misc/start_kodi' + [[ -f '/etc/systemd/system/dietpi-cloudshell.service' ]] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' (( $G_DISTRO > 3 )) && [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM' # - occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: - [[ -f /var/www/owncloud/occ ]] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } - [[ -f /var/www/nextcloud/occ ]] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } + [[ -f '/var/www/owncloud/occ' ]] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } + [[ -f '/var/www/nextcloud/occ' ]] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } #----------------------------------------------------------------------------------- # Whiptail (Whippy-da-whip-whip-whip tail!) # - Automatically detects/processes for G_USER_INPUTS #----------------------------------------------------------------------------------- - #G_WHIP_DEFAULT_ITEM | to be set by scripts to set the default selected item. + # G_WHIP_DEFAULT_ITEM | to be set by scripts to set the default selected item. G_WHIP_DEFAULT_ITEM='' - #Scaling options: + # Scaling options: # Optional, limits X to value, if below available screen X limits G_WHIP_SIZE_X_MAX=0 # Whip size overrides | optional, will override auto detection, must be exported and unset after use. #G_WHIP_SIZE_X_OVERRIDE #G_WHIP_SIZE_Y_OVERRIDE - #G_WHIP_BUTTON_X_TEXT | Change as needed, else, defaults to Ok/Cancel + # G_WHIP_BUTTON_X_TEXT | Change as needed, else, defaults to Ok/Cancel G_WHIP_BUTTON_OK_TEXT='' G_WHIP_BUTTON_CANCEL_TEXT='' - #G_WHIP_MENU_ARRAY | to be set by scripts to set available menu/checkbox options + # G_WHIP_MENU_ARRAY | to be set by scripts to set available menu/checkbox options G_WHIP_MENU_ARRAY=('NULL' 'NULL') - #G_WHIP_CHECKLIST_ARRAY | to be set by scripts to set available checklist options + # G_WHIP_CHECKLIST_ARRAY | to be set by scripts to set available checklist options G_WHIP_CHECKLIST_ARRAY=('NULL' 'NULL' 'off') - #G_WHIP_RETURNED_VALUE | Returned value from inputbox/menu/checklist based whiptail items + # G_WHIP_RETURNED_VALUE | Returned value from inputbox/menu/checklist based whiptail items G_WHIP_RETURNED_VALUE='' - #G_WHIP_DESTROY | Clear vars after run of whiptail + # G_WHIP_DESTROY | Clear vars after run of whiptail G_WHIP_DESTROY(){ # - Delete @@ -613,21 +594,21 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_INIT + # G_WHIP_INIT # - update target whiptail size, based on current screen dimensions. # - Used by G_WHIP_ automatically, doesn't need to be a global function, however, bash does not support local functions. # - $1 = input mode 0=no-Z 1=yes-Z (G_WHIP_MENU_ARRAY) 2=yes-Z (G_WHIP_CHECKLIST_ARRAY) 3=Force full size of Y G_WHIP_INIT(){ - #Set default button text, if not defined + # Set default button text, if not defined G_WHIP_BUTTON_OK_TEXT=${G_WHIP_BUTTON_OK_TEXT:-Ok} G_WHIP_BUTTON_CANCEL_TEXT=${G_WHIP_BUTTON_CANCEL_TEXT:-Cancel} - #Update backtitle + # Update backtitle WHIP_BACKTITLE="$G_PROGRAM_NAME | $G_HW_MODEL_DESCRIPTION" [[ -r '/DietPi/dietpi/.network' ]] && WHIP_BACKTITLE+=" | IP: $(sed -n 4p /DietPi/dietpi/.network)" - #Automaticaly set size of whiptail box and contents + # Automaticaly set size of whiptail box and contents local input_mode=$1 # - Whip margins @@ -638,7 +619,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then local lines_required_whip_y=0 local lines_required_whip_z=0 - #Set current screen dimensions ( - outside margin) + # Set current screen dimensions ( - outside margin) # - G_WHIP_SIZE_X_OVERRIDE allows to estimate and export terminal sizes outside of script/function # This is required in case both, STOUT and STERR are redirected ( e.g. 2>&1 | tee file.log ) # Until ncurses-bin v6.0 (current on Stretch repo), tput can not estimate terminal dimensions then. @@ -659,12 +640,12 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then WHIP_SIZE_Z=2 - #Force full size of Y? + # Force full size of Y? if (( $input_mode == 3 )); then lines_required_whip_y=$WHIP_SIZE_Y - #Calulate lines required for WHIP_MESSAGE, as displayed inside the whiptail box + # Calulate lines required for WHIP_MESSAGE, as displayed inside the whiptail box # - This can then be used to increase/decrease size of WHIP_SIZE_Z automatically. else @@ -682,7 +663,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi - #Calculate Z + # Calculate Z # - G_WHIP_MENU_ARRAY if (( $input_mode == 1 )); then @@ -692,7 +673,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Requires additional line on Y ((lines_required_whip_y++)) - #Auto length for ─ + # Auto length for ─ # Get max length of all the lines in odd number array 1st | '' 'this one' local i=0 local character_count_max=0 @@ -704,17 +685,17 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then character_count_max=${#G_WHIP_MENU_ARRAY[$i]} # - cap to X | need to calculate all length of array 1st... - # if (( $character_count_max >= $WHIP_SIZE_X )); then + #if (( $character_count_max >= $WHIP_SIZE_X )); then - # character_count_max=$WHIP_SIZE_X - # break + #character_count_max=$WHIP_SIZE_X + #break - # fi + #fi fi done - ((character_count_max--)) #-1 for additional ● + ((character_count_max--)) # -1 for additional ● # Now add the additional required lines for (( i=0; i<${#G_WHIP_MENU_ARRAY[@]}; i++ )) @@ -741,7 +722,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - ( ${#array} + 2 ) to round up single+double array entries lines_required_whip_z=$(( ( ${#G_WHIP_CHECKLIST_ARRAY[@]} + 2 ) / 3 )) - #Auto length for ─ + # Auto length for ─ # Get max length of all the lines in array index 1 1st | '' 'this one' '' local i=0 local character_count_max=0 @@ -753,17 +734,17 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then character_count_max=${#G_WHIP_CHECKLIST_ARRAY[$i]} # - cap to X | need to calculate all length of array 1st... - # if (( $character_count_max >= $WHIP_SIZE_X )); then + #if (( $character_count_max >= $WHIP_SIZE_X )); then - # character_count_max=$WHIP_SIZE_X - # break + #character_count_max=$WHIP_SIZE_X + #break - # fi + #fi fi done - ((character_count_max--)) #-1 for additional ● + ((character_count_max--)) # -1 for additional ● # Now add the additional required lines for (( i=0; i<${#G_WHIP_CHECKLIST_ARRAY[@]}; i++ )) @@ -774,7 +755,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then while (( ${#G_WHIP_CHECKLIST_ARRAY[$i]} < $character_count_max )) do - # echo -e "${#G_WHIP_CHECKLIST_ARRAY[$i]} > $WHIP_LENGTH_AUTOLINEFILL | index=$i" + #echo -e "${#G_WHIP_CHECKLIST_ARRAY[$i]} > $WHIP_LENGTH_AUTOLINEFILL | index=$i" G_WHIP_CHECKLIST_ARRAY[$i]+='─' done @@ -787,7 +768,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi - #Calculate end result + # Calculate end result # - Message will not fit! if (( $lines_required_whip_y > $WHIP_SIZE_Y )); then @@ -829,7 +810,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_MSG "message" + # G_WHIP_MSG "message" # - Display a whip message G_WHIP_MSG(){ @@ -849,7 +830,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_SCROLLBOX "message" + # G_WHIP_SCROLLBOX "message" # - Display a whip message inside a scrollbox G_WHIP_SCROLLBOX(){ @@ -869,7 +850,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_YESNO "message" + # G_WHIP_YESNO "message" # - Prompt user for a Yes/No, return result # - returns result 0=Ok, everything else considered a user canceled result G_WHIP_YESNO(){ @@ -893,7 +874,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_INPUTBOX "message" + # G_WHIP_INPUTBOX "message" # - Prompt user to input text and save it to G_WHIP_RETURNED_VALUE # - returns result 0=Ok, everything else considered a user canceled result G_WHIP_INPUTBOX(){ @@ -922,7 +903,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_PASSWORD "message" + # G_WHIP_PASSWORD "message" # - Prompt user to input password and safe it in variable "result". Do not export for security reasons! G_WHIP_PASSWORD(){ @@ -961,7 +942,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_MENU "message" + # G_WHIP_MENU "message" # - Prompt user to select option from G_WHIP_MENU_ARRAY and sets G_WHIP_RETURNED_VALUE # - returns result 0=Ok, everything else considered a user canceled result G_WHIP_MENU(){ @@ -984,7 +965,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_CHECKLIST "message" + # G_WHIP_CHECKLIST "message" # - Prompt user to select multiple option from G_WHIP_CHECKLIST_ARRAY and sets G_WHIP_RETURNED_VALUE # - returns result 0=Ok, everything else considered a user canceled result G_WHIP_CHECKLIST(){ @@ -1008,7 +989,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #G_WHIP_VIEWFILE /var/log/file.log + # G_WHIP_VIEWFILE /var/log/file.log # - Prompt user to view logfile, then display it as needed. G_WHIP_VIEWFILE(){ @@ -1016,7 +997,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - local log=${log:-0} #Optional yes/no prompt for viewing logs + local log=${log:-0} # Optional yes/no prompt for viewing logs local fp_file=$1 if [[ -f $fp_file ]]; then @@ -1054,25 +1035,25 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # DietPi Error Handler # https://github.com/MichaIng/DietPi/issues/1311#issuecomment-353716344 #----------------------------------------------------------------------------------- - G_ERROR_HANDLER_EXITCODE=0 #input value to use with G_ERROR_HANDLER - G_ERROR_HANDLER_EXITCODE_RETURN=0 #Same as above, but not destroyed during G_ERROR_HANDLER_RESET, allowing us to return it in funcs - G_ERROR_HANDLER_COMMAND='' #eg: G_AGI: moooooooo + G_ERROR_HANDLER_EXITCODE=0 # input value to use with G_ERROR_HANDLER + G_ERROR_HANDLER_EXITCODE_RETURN=0 # Same as above, but not destroyed during G_ERROR_HANDLER_RESET, allowing us to return it in funcs + G_ERROR_HANDLER_COMMAND='' # eg: G_AGI: moooooooo # For export: On error, following entries will be used - G_ERROR_HANDLER_NO_FAIL=0 #Always report a success, regardless of the exit code | G_USER_INPUTS=0 is not required for this - G_ERROR_HANDLER_INFO_ONLY=0 #Only print info and retry options, no exit or bug report, sets G_ERROR_HANDLER_ONERROR_EXIT=0 automatically - G_ERROR_HANDLER_ONERROR_EXIT=1 #Do we exit the program when the error occurs? 0=no 1=yes - G_ERROR_HANDLER_ONERROR_FPLOGFILE='' #FP to logfile, if available - G_ERROR_HANDLER_RETRY=0 #Used in func with while loop to re-run func as needed + G_ERROR_HANDLER_NO_FAIL=0 # Always report a success, regardless of the exit code | G_USER_INPUTS=0 is not required for this + G_ERROR_HANDLER_INFO_ONLY=0 # Only print info and retry options, no exit or bug report, sets G_ERROR_HANDLER_ONERROR_EXIT=0 automatically + G_ERROR_HANDLER_ONERROR_EXIT=1 # Do we exit the program when the error occurs? 0=no 1=yes + G_ERROR_HANDLER_ONERROR_FPLOGFILE='' # FP to logfile, if available + G_ERROR_HANDLER_RETRY=0 # Used in func with while loop to re-run func as needed - #Runs automatically after G_ERROR_HANDLER to reset vars to default + # Runs automatically after G_ERROR_HANDLER to reset vars to default G_ERROR_HANDLER_RESET(){ G_ERROR_HANDLER_EXITCODE_RETURN=$G_ERROR_HANDLER_EXITCODE - #Delete if used: + # Delete if used: [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE && -f $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]] && rm $G_ERROR_HANDLER_ONERROR_FPLOGFILE - #unset originating program + # unset originating program unset G_ERROR_HANDLER_EXITCODE unset G_ERROR_HANDLER_COMMAND @@ -1093,20 +1074,20 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - #Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings + # Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings # Usage: G_RUN_CMD dothis G_ERROR_HANDLER(){ [[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND - #Ok + # Ok (( $G_ERROR_HANDLER_NO_FAIL )) && G_ERROR_HANDLER_EXITCODE=0 if (( ! $G_ERROR_HANDLER_EXITCODE )); then G_DIETPI-NOTIFY 0 "$l_message" G_ERROR_HANDLER_RESET - #Error + # Error else local send_bugreport=0 @@ -1196,7 +1177,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if ! ps aux | grep -qi '[d]ietpi-config' && (( ! $G_ERROR_HANDLER_INFO_ONLY )); then - aretry_menu_options+=('DietPi-Config' ': Edit network, APT/NTP mirror settings etc'); ((retry_menu_options_count++)) fi @@ -1208,11 +1188,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi local no_button_text='Ignore' - if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then - - no_button_text='Exit' - - fi + (( $G_ERROR_HANDLER_ONERROR_EXIT )) && no_button_text='Exit' local choice=$(whiptail --title 'DietPi Error Handler:' --menu "$whip_msg" --cancel-button "$no_button_text" --scrolltext 24 90 $retry_menu_options_count "${aretry_menu_options[@]}" 3>&1 1>&2 2>&3) if (( $? == 0 )); then @@ -1250,7 +1226,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then fi - #Github printout + # GitHub printout if (( ! $G_ERROR_HANDLER_INFO_ONLY )); then echo -e " @@ -1342,7 +1318,7 @@ $print_logfile_info } - #Run a command and send the output through the error handler. Allows for command used info, and log output/view when an error occurs + # Run a command and send the output through the error handler. Allows for command used info, and log output/view when an error occurs # NB: This command does not support inputs with redirects. For file creation, use G_FILE_EXISTS afterwards to check it exists: https://github.com/MichaIng/DietPi/issues/1311#issuecomment-354541417 # NB: automatically error handled (G_ERROR_HANDLER) # $@ = input command @@ -1366,7 +1342,7 @@ $print_logfile_info G_ERROR_HANDLER - [[ -f /tmp/G_ERROR_HANDLER_COMMAND ]] && rm /tmp/G_ERROR_HANDLER_COMMAND + [[ -f '/tmp/G_ERROR_HANDLER_COMMAND' ]] && rm /tmp/G_ERROR_HANDLER_COMMAND done @@ -1374,7 +1350,7 @@ $print_logfile_info } - #URL Connection test + # URL Connection test # - $@ = URL # Optional variables: # - $optional_cmd_inputs (eg: --no-check-certificate) @@ -1444,8 +1420,8 @@ $print_logfile_info } - #$1 = directory to test permissions support - #Returns 0=ok >=1=failed + # $1 = directory to test permissions support + # Returns 0=ok >=1=failed G_CHECK_FS_PERMISSION_SUPPORT(){ local input=$1 @@ -1454,8 +1430,7 @@ $print_logfile_info while : do - mkdir -p $input - if (( $? != 0 )); then + if ! mkdir -p $input; then G_WHIP_MSG "Error creating directory $input, unable to check filesystem permissions" break @@ -1463,8 +1438,7 @@ $print_logfile_info fi local fp_target="$input/.test" - > $fp_target - if (( $? != 0 )); then + if ! > $fp_target; then G_WHIP_MSG "Error creating test file $fp_target, unable to check filesystem permissions" break @@ -1482,11 +1456,7 @@ $print_logfile_info else chmod 644 $fp_target - if [[ $(stat -c "%a" $fp_target) != '644' ]]; then - - permissions_failed=1 - - fi + [[ $(stat -c "%a" $fp_target) != '644' ]] && permissions_failed=1 fi @@ -1502,15 +1472,14 @@ $print_logfile_info break - done - rm $fp_target &> /dev/null + [[ -f $fp_target ]] && rm $fp_target return $result } - #Checks if a file/folder exists + # Checks if a file/folder exists G_FILE_EXISTS(){ G_ERROR_HANDLER_COMMAND=$@ @@ -1542,7 +1511,7 @@ $print_logfile_info G_ERROR_HANDLER - rm /tmp/G_ERROR_HANDLER_COMMAND &> /dev/null + [[ -f '/tmp/G_ERROR_HANDLER_COMMAND' ]] && rm /tmp/G_ERROR_HANDLER_COMMAND } @@ -1551,7 +1520,7 @@ $print_logfile_info #----------------------------------------------------------------------------------- G_FP_LOG_APT='/var/tmp/dietpi/logs/dietpi-software_apt.log' - #apt-get install + # apt-get install # NB: automatically error handled (G_ERROR_HANDLER) G_AGI(){ @@ -1568,7 +1537,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGI $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - #-qq can add a slight period of appearing nothing is happening, lets inform user + # -qq can add a slight period of appearing nothing is happening, lets inform user G_DIETPI-NOTIFY 2 "\e[0mAPT installation for: \e[33m$string\e[0m, please wait..." echo -ne '\e[90m' @@ -1583,7 +1552,7 @@ $print_logfile_info } - #apt-get purge + # apt-get purge # NB: automatically error handled (G_ERROR_HANDLER) G_AGP(){ @@ -1648,7 +1617,7 @@ $print_logfile_info } - #apt-get autoremove + # apt-get autoremove # NB: automatically error handled (G_ERROR_HANDLER) G_AGA(){ @@ -1675,7 +1644,7 @@ $print_logfile_info } - #apt-get install -f + # apt-get -f install # NB: automatically error handled (G_ERROR_HANDLER) G_AGF(){ @@ -1702,7 +1671,7 @@ $print_logfile_info } - #apt-get clean + update + # apt-get clean + update # NB: automatically error handled (G_ERROR_HANDLER) G_AGUP(){ @@ -1730,7 +1699,7 @@ $print_logfile_info } - #apt-get upgrade + # apt-get upgrade # NB: automatically error handled (G_ERROR_HANDLER) G_AGUG(){ @@ -1757,7 +1726,7 @@ $print_logfile_info } - #apt-get dist-upgrade + # apt-get dist-upgrade # NB: automatically error handled (G_ERROR_HANDLER) G_AGDUG(){ @@ -1787,7 +1756,7 @@ $print_logfile_info } - #Checks for required APT packages, installs if needed. + # Checks for required APT packages, installs if needed. # $@ = list of required packages # NB: automatically error handled (G_ERROR_HANDLER) G_AG_CHECK_INSTALL_PREREQ(){ @@ -1833,7 +1802,7 @@ $print_logfile_info #----------------------------------------------------------------------------------- # MISC: Commands #----------------------------------------------------------------------------------- - #Treesize + # Treesize # - $1 = Optional input directory (eg: G_TREESIZE /etc/apt) G_TREESIZE(){ @@ -1856,7 +1825,7 @@ $print_logfile_info ' } - #Returns current CPU temp 'C + # Returns current CPU temp 'C # print_full_info=1# optional input to print full colour text output and temp warnings. G_OBTAIN_CPU_TEMP(){ @@ -1938,7 +1907,7 @@ $print_logfile_info } - #Returns current CPU usage % + # Returns current CPU usage % G_OBTAIN_CPU_USAGE(){ # - PS (inaccurate, but fast??) @@ -1958,7 +1927,7 @@ $print_logfile_info } - #Check available free space on path, against input value (MiB) + # Check available free space on path, against input value (MiB) # - Returns 0=Ok, 1=insufficient space available # If $2 is not used, returns available space in MiB | info_autoscale=1 # Scales MiB to GiB if required and prints unit # - $1 = path @@ -1998,7 +1967,7 @@ $print_logfile_info } - #G_CHECK_VALIDINT | Simple test to verify if a variable is a valid integer. + # G_CHECK_VALIDINT | Simple test to verify if a variable is a valid integer. # $1=input # $2=Optional Min value range # $3=Optional Max value range @@ -2061,7 +2030,7 @@ $print_logfile_info } - #Verifies the integrity of the DietPi userdata folder/symlink, based on where it should be psyhically. Basically, checks if user removed the USB drive with userdata on it. + # Verifies the integrity of the DietPi userdata folder/symlink, based on where it should be psyhically. Basically, checks if user removed the USB drive with userdata on it. # NB: As this is considered a critical (if failed), current scripts will be exited automatically # 1=fail # 0=ok @@ -2096,7 +2065,7 @@ $print_logfile_info } - #Prompt user to create a backup before system changes. Exit existing scripts if failed. + # Prompt user to create a backup before system changes. Exit existing scripts if failed. G_PROMPT_BACKUP_DISABLED=${G_PROMPT_BACKUP_DISABLED:-0} G_PROMPT_BACKUP(){ @@ -2123,7 +2092,7 @@ $print_logfile_info } - #If file/folder exists, backup to *.bak_DDMMYYY + # If file/folder exists, backup to *.bak_DDMMYYY G_BACKUP_FP(){ local ainput_string=("$@") @@ -2174,7 +2143,7 @@ $print_logfile_info #----------------------------------------------------------------------------------- # Multithreading handler #----------------------------------------------------------------------------------- - #Not yet compatible with dietpi global commands. single bash commands only with no error handling. + # Not yet compatible with dietpi global commands. single bash commands only with no error handling. G_THREADING_ENABLED=${G_THREADING_ENABLED:-1} G_THREAD_COUNT=${G_THREAD_COUNT:--1} [[ $G_THREAD_COMMAND ]] || G_THREAD_COMMAND=() @@ -2205,64 +2174,61 @@ $print_logfile_info G_THREAD_WAIT(){ - # local wait_for_specific_thread_pid=0 - # if [[ -n $1 ]]; then + #local wait_for_specific_thread_pid=0 + #if [[ -n $1 ]]; then - # wait_for_specific_thread_pid=$1 + #wait_for_specific_thread_pid=$1 - # fi + #fi while : do local thread_active=0 - for (( i=0; i<${#G_THREAD_COMMAND[@]}; i++ )) + for i in ${!G_THREAD_COMMAND[@]} do - if [[ -f /tmp/.G_THREAD_EXITCODE_$i ]] && (( $( /dev/null + rm -f /tmp/.G_THREAD* - sync #Failsafe: Sync changes to disk + sync # Failsafe: Sync changes to disk G_DIETPI-NOTIFY 0 'G_THREAD: All threads finished' @@ -2305,7 +2271,7 @@ $print_logfile_info # Automatically opt in to DietPi-Survey and run + send benchmark + data G_DEV_BENCH(){ - sed -i '1s/.*/1/' /DietPi/dietpi/.dietpi-survey + echo 1 > /DietPi/dietpi/.dietpi-survey G_USER_INPUTS=0 /DietPi/dietpi/func/dietpi-benchmark 2 } From 3de84026c27a55f998659ffbaf4cf285537b9350 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 6 May 2019 13:30:26 +0100 Subject: [PATCH 200/253] C1: Revert Jessie removal until v6.24 released. Add distro check also. --- dietpi/dietpi-config | 127 +++++++++++++++++++++++++++++++- dietpi/dietpi-drive_manager | 3 +- dietpi/dietpi-software | 14 +++- dietpi/func/dietpi-set_hardware | 22 +++++- 4 files changed, 160 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 8a82463a8b..51438fcd0f 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -392,7 +392,8 @@ elif (( $G_WHIP_RETURNED_VALUE == 2 )); then - if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 || + ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24 G_WHIP_MSG 'GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup.\n\nThe split value is optimized based on your software installs, however, feel free to tweak them.' TARGETMENUID=6 @@ -1084,6 +1085,70 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi + # Odroid C1 + #REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + # Get Current Values + local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini) + + G_WHIP_MENU_ARRAY=( + + '1080p' ': 1920 x 1080' + '720p' ': 1280 x 720' + '480p' ': 720 x 480' + 'VU7+' ': 1024 x 600' + 'PC1' ': 1024 x 768' + + ) + + G_WHIP_DEFAULT_ITEM=$current_resolution + if G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $current_resolution"; then + + REBOOT_REQUIRED=1 + + TARGETMENUID=2 # Return to this menu + + # - Always reset to HDMI + sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini + + case "$G_WHIP_RETURNED_VALUE" in + + '1080p') + + sed -i '/setenv m /c\setenv m "1080p"' /DietPi/boot.ini + + ;; + + '720p') + + sed -i '/setenv m /c\setenv m "720p"' /DietPi/boot.ini + + ;; + + '480p') + + sed -i '/setenv m /c\setenv m "480p"' /DietPi/boot.ini + + ;; + + 'PC1') + + sed -i '/setenv m /c\setenv m "1024x768"' /DietPi/boot.ini + + ;; + + 'VU7+') + + sed -i '/setenv m /c\setenv m "1024x600"' /DietPi/boot.ini + sed -i '/setenv vout_mode /c\setenv vout_mode "dvi"' /DietPi/boot.ini + + ;; + + esac + + fi + # Pine A64 elif (( $G_HW_MODEL == 40 )); then @@ -1916,6 +1981,10 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 gpu_mem_current=$(grep -m1 '^[[:blank:]]*gpu_mem_1024=' /DietPi/config.txt | sed 's/^[^=]*=//') ram_mem_current=$((ram_mem_total-gpu_mem_current)) + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then #REMOVE v6.24 + + gpu_mem_current=$((1024-ram_mem_current)) + elif (( $G_HW_MODEL == 12 )); then gpu_mem_current=$((2048-ram_mem_current)) @@ -1959,6 +2028,59 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi + # Odroid C1 + #REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + # Odroid HDMI/headless extra data + local display_output_enabled=$(grep -ci -m1 '^setenv hdmioutput "1"' /DietPi/boot.ini) + local display_vpu_enabled=$(grep -ci -m1 '^setenv vpu "1"' /DietPi/boot.ini) + local display_output_text='[On]' + local display_vpu_text='[On]' + + (( $display_output_enabled )) || display_output_text='[Off]' + (( $display_vpu_enabled )) || display_vpu_text='[Off]' + + G_WHIP_MENU_ARRAY=( + + 'Headless' 'HDMI: Disabled | VPU: Disabled' + 'Server' 'HDMI: Enabled | VPU: Disabled' + 'Desktop' 'HDMI: Enabled | VPU: Enabled' + + ) + + G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCurrent : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." + if (( $? == 0 )); then + + REBOOT_REQUIRED=1 + + TARGETMENUID=6 # Return to this menu + + case "$G_WHIP_RETURNED_VALUE" in + + 'Headless') + + /DietPi/dietpi/func/dietpi-set_hardware headless 1 + + ;; + + 'Server') + + /DietPi/dietpi/func/dietpi-set_hardware headless 0 + G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini + + ;; + + 'Desktop') + + /DietPi/dietpi/func/dietpi-set_hardware headless 0 + + ;; + + esac + + fi + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -3972,7 +4094,8 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('rpi-dac' ': Soekris DAM1021 (pcm1794a)') # - C2 - elif (( $G_HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 || + ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24 G_WHIP_MENU_ARRAY+=('odroid-hifishield-plus' ': Odroid HiFi Shield 1/Plus') G_WHIP_MENU_ARRAY+=('odroid-hifishield-2' ': Odroid HiFi Shield 2') diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index d5c175864a..6c8898c045 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -815,7 +815,8 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$INDEX_DRIVE_BEING_EDITED]}#g" /boot/cmdline.txt #C2/XU4 | /DietPi/boot.ini - elif (( $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 11 || $G_HW_MODEL == 12 || + ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24 # find current root= to replace local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /DietPi/boot.ini | grep -m1 'root=' | sed 's/\"//') diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 007943edd9..cb7101449f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -495,7 +495,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 # - C1 - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,10]=0 + (( $G_DISTRO > 3 )) & aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,10]=0 #------------------ software_id=32 @@ -4799,6 +4799,11 @@ _EOF_ kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers' + #Odroid C1 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then #REMOVE v6.24 + + kernel_packages='linux-image-armhf-odroid-c1 linux-headers-armhf-odroid-c1' + # - Odroid XU4 elif (( $G_HW_MODEL == 11 )); then @@ -6264,6 +6269,13 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid #dps_index=$software_id Download_Install 'xorg_xu4.conf' /etc/X11/xorg.conf + #Odroid C1 + #REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + DEPS_LIST='aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid' + dps_index=$software_id Download_Install 'xorg_c1.conf' /etc/X11/xorg.conf + #Pine64 elif (( $G_HW_MODEL == 40 )); then diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 0b5865bd0b..8e10682208 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -253,6 +253,14 @@ _EOF_ # - Disable composite hotplug, which then allows to completely disable the video pipeline + framebuffer G_CONFIG_INJECT 'hdmi_ignore_composite=' 'hdmi_ignore_composite=1' /DietPi/config.txt + # Odroid C1 + #REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "0"' /DietPi/boot.ini + G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini + G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -273,6 +281,14 @@ _EOF_ G_CONFIG_INJECT 'hdmi_ignore_composite=' '#hdmi_ignore_composite=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_blanking=' '#hdmi_blanking=0' /DietPi/config.txt + # Odroid C1 + #REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "1"' /DietPi/boot.ini + G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "1"' /DietPi/boot.ini + G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then @@ -347,7 +363,8 @@ _EOF_ G_CONFIG_INJECT 'gpioplug-ir-recv' 'gpioplug-ir-recv' /etc/modules # C2 - elif (( $G_HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 || + ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24 # - Module G_CONFIG_INJECT 'meson_ir' 'meson_ir' /etc/modules @@ -1492,7 +1509,8 @@ Do you want to continue and DISABLE Bluetooth now?'; then grep -q "console=$INPUT_ADDITIONAL" /boot/cmdline.txt || sed -i "/root=/s/$/ console=$INPUT_ADDITIONAL,115200/" /boot/cmdline.txt # - Odroid C2 - elif (( $G_HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 || + ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24 local old='' [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv condev "' /DietPi/boot.ini) || return From ba10c1663e1efd461176954b82bc8c516eda062a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 6 May 2019 13:59:24 +0100 Subject: [PATCH 201/253] https://github.com/MichaIng/DietPi/pull/2771#issuecomment-489606736 --- PREP_SYSTEM_FOR_DIETPI.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index dbd1be3c08..cbc8cac4c5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -158,6 +158,8 @@ ) + grep -qi 'jessie' /etc/os-release && aWHIP_BRANCH+=( 'jessie-support' 'EOS') #REMOVE v6.24 + if GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select the Git branch the installer should use:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then unset aWHIP_BRANCH @@ -512,6 +514,7 @@ # Distro Selection DISTRO_LIST_ARRAY=( + '3' ': jessie-support' #REMOVE v6.24 '4' ': Stretch (current stable release, recommended)' '5' ': Buster (testing only, not officially supported)' @@ -577,7 +580,11 @@ done - if (( $DISTRO_TARGET == 4 )); then + if (( $DISTRO_TARGET == 3 )); then #REMOVE v6.24 + + DISTRO_TARGET_NAME='jessie' + + elif (( $DISTRO_TARGET == 4 )); then DISTRO_TARGET_NAME='stretch' From 79979311dfb286475057314ba7fc01c43c3af5c1 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 6 May 2019 14:18:36 +0100 Subject: [PATCH 202/253] https://github.com/MichaIng/DietPi/issues/2751 --- dietpi/dietpi-cleaner | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 3d9cbf7391..e18f97b340 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -407,9 +407,13 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners else - G_AGP man manpages - G_AGA - rm -Rf /usr/share/{man,doc,doc-base} + if G_WHIP_YESNO '[WARNING] Removing man pages and docs from the system, may break some APT packages (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then + + G_AGP man manpages + G_AGA + rm -Rf /usr/share/{man,doc,doc-base} + + fi fi From 33f6bca525e8d68dc8dfbf8bf101a84a381d79cd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 6 May 2019 21:31:53 +0200 Subject: [PATCH 203/253] v6.23 + DietPi-Config | Reorder and alignment --- dietpi/dietpi-config | 127 +++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 51438fcd0f..d5d70d9f08 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -986,6 +986,69 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi + # Odroid C1: REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + + # Get Current Values + local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini) + + G_WHIP_MENU_ARRAY=( + + '1080p' ': 1920 x 1080' + '720p' ': 1280 x 720' + '480p' ': 720 x 480' + 'VU7+' ': 1024 x 600' + 'PC1' ': 1024 x 768' + + ) + + G_WHIP_DEFAULT_ITEM=$current_resolution + if G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $current_resolution"; then + + REBOOT_REQUIRED=1 + + TARGETMENUID=2 # Return to this menu + + # - Always reset to HDMI + sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini + + case "$G_WHIP_RETURNED_VALUE" in + + '1080p') + + sed -i '/setenv m /c\setenv m "1080p"' /DietPi/boot.ini + + ;; + + '720p') + + sed -i '/setenv m /c\setenv m "720p"' /DietPi/boot.ini + + ;; + + '480p') + + sed -i '/setenv m /c\setenv m "480p"' /DietPi/boot.ini + + ;; + + 'PC1') + + sed -i '/setenv m /c\setenv m "1024x768"' /DietPi/boot.ini + + ;; + + 'VU7+') + + sed -i '/setenv m /c\setenv m "1024x600"' /DietPi/boot.ini + sed -i '/setenv vout_mode /c\setenv vout_mode "dvi"' /DietPi/boot.ini + + ;; + + esac + + fi + # Odroid XU3/4 elif (( $G_HW_MODEL == 11 )); then @@ -1085,70 +1148,6 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - # Odroid C1 - #REMOVE v6.24 - elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then - - # Get Current Values - local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini) - - G_WHIP_MENU_ARRAY=( - - '1080p' ': 1920 x 1080' - '720p' ': 1280 x 720' - '480p' ': 720 x 480' - 'VU7+' ': 1024 x 600' - 'PC1' ': 1024 x 768' - - ) - - G_WHIP_DEFAULT_ITEM=$current_resolution - if G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $current_resolution"; then - - REBOOT_REQUIRED=1 - - TARGETMENUID=2 # Return to this menu - - # - Always reset to HDMI - sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini - - case "$G_WHIP_RETURNED_VALUE" in - - '1080p') - - sed -i '/setenv m /c\setenv m "1080p"' /DietPi/boot.ini - - ;; - - '720p') - - sed -i '/setenv m /c\setenv m "720p"' /DietPi/boot.ini - - ;; - - '480p') - - sed -i '/setenv m /c\setenv m "480p"' /DietPi/boot.ini - - ;; - - 'PC1') - - sed -i '/setenv m /c\setenv m "1024x768"' /DietPi/boot.ini - - ;; - - 'VU7+') - - sed -i '/setenv m /c\setenv m "1024x600"' /DietPi/boot.ini - sed -i '/setenv vout_mode /c\setenv vout_mode "dvi"' /DietPi/boot.ini - - ;; - - esac - - fi - # Pine A64 elif (( $G_HW_MODEL == 40 )); then From 528b1bb15ba8e146ae90df5b2c1b9286dca332fe Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 6 May 2019 21:35:36 +0200 Subject: [PATCH 204/253] v6.23 + DietPi-Config | Alignment --- dietpi/dietpi-config | 65 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index d5d70d9f08..2a9860be18 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1982,7 +1982,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then #REMOVE v6.24 - gpu_mem_current=$((1024-ram_mem_current)) + gpu_mem_current=$((1024-ram_mem_current)) elif (( $G_HW_MODEL == 12 )); then @@ -2027,58 +2027,57 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - # Odroid C1 - #REMOVE v6.24 - elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then + # Odroid C1: REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then - # Odroid HDMI/headless extra data - local display_output_enabled=$(grep -ci -m1 '^setenv hdmioutput "1"' /DietPi/boot.ini) - local display_vpu_enabled=$(grep -ci -m1 '^setenv vpu "1"' /DietPi/boot.ini) - local display_output_text='[On]' - local display_vpu_text='[On]' + # Odroid HDMI/headless extra data + local display_output_enabled=$(grep -ci -m1 '^setenv hdmioutput "1"' /DietPi/boot.ini) + local display_vpu_enabled=$(grep -ci -m1 '^setenv vpu "1"' /DietPi/boot.ini) + local display_output_text='[On]' + local display_vpu_text='[On]' - (( $display_output_enabled )) || display_output_text='[Off]' - (( $display_vpu_enabled )) || display_vpu_text='[Off]' + (( $display_output_enabled )) || display_output_text='[Off]' + (( $display_vpu_enabled )) || display_vpu_text='[Off]' - G_WHIP_MENU_ARRAY=( + G_WHIP_MENU_ARRAY=( - 'Headless' 'HDMI: Disabled | VPU: Disabled' - 'Server' 'HDMI: Enabled | VPU: Disabled' - 'Desktop' 'HDMI: Enabled | VPU: Enabled' + 'Headless' 'HDMI: Disabled | VPU: Disabled' + 'Server' 'HDMI: Enabled | VPU: Disabled' + 'Desktop' 'HDMI: Enabled | VPU: Enabled' - ) + ) - G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCurrent : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." - if (( $? == 0 )); then + G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION \nCurrent : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." + if (( $? == 0 )); then - REBOOT_REQUIRED=1 + REBOOT_REQUIRED=1 - TARGETMENUID=6 # Return to this menu + TARGETMENUID=6 # Return to this menu - case "$G_WHIP_RETURNED_VALUE" in + case "$G_WHIP_RETURNED_VALUE" in - 'Headless') + 'Headless') - /DietPi/dietpi/func/dietpi-set_hardware headless 1 + /DietPi/dietpi/func/dietpi-set_hardware headless 1 - ;; + ;; - 'Server') + 'Server') - /DietPi/dietpi/func/dietpi-set_hardware headless 0 - G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini + /DietPi/dietpi/func/dietpi-set_hardware headless 0 + G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini - ;; + ;; - 'Desktop') + 'Desktop') - /DietPi/dietpi/func/dietpi-set_hardware headless 0 + /DietPi/dietpi/func/dietpi-set_hardware headless 0 - ;; + ;; - esac + esac - fi + fi # Odroid C2 elif (( $G_HW_MODEL == 12 )); then From be020062802517d356e930c510912377fdebdc58 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 6 May 2019 23:25:22 +0200 Subject: [PATCH 205/253] v6.23 + CHANGELOG | Move entry from "Changes" to "Bug Fixes" where it belongs to --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e0cd6008ff..c17fe97024 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -28,7 +28,6 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. -- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 @@ -52,6 +51,7 @@ Bug Fixes: - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 - DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 +- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From d7d02d95a2ff4248766d69e153586aa5a885948a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 7 May 2019 12:02:12 +0100 Subject: [PATCH 206/253] Info --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c17fe97024..4be6afe4e3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. +- DietPi-Cleaner | Added a confirmation prompt, before removal of manpages and docs, as this may cause APT issues in some circumstances: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 @@ -28,6 +29,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. +- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 @@ -51,7 +53,6 @@ Bug Fixes: - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 - DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 -- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From b530fe5e4d749775b682ccb5de6cd881f994b89b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 7 May 2019 12:18:50 +0100 Subject: [PATCH 207/253] pre-reqs required for ARMv8 (compile) install, and possibily others. --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d0d75f1ce6..ca4260e256 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -910,6 +910,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=142 @@ -5606,7 +5607,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # https://sabnzbd.org/wiki/installation/install-off-modules # Pre-reqs - DEPS_LIST='par2 p7zip-full' + DEPS_LIST='par2 p7zip-full libffi-dev libssl-dev' Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.zip' From 85381274c8dcda810664af506c8903cc395394f1 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 7 May 2019 17:51:16 +0200 Subject: [PATCH 208/253] v6.23 + CHANGELOG | Tor/WiFi Hotspot issue was still a bug --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4be6afe4e3..a3737c4cc8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -29,7 +29,6 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. -- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 @@ -53,6 +52,7 @@ Bug Fixes: - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 - DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 +- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files From d5bcb822a954a379abb97567fa5ed68fdad78d8c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 7 May 2019 18:14:20 +0200 Subject: [PATCH 209/253] v6.23 + DietPi-Software | SABnzbd: Install build tools on ARM only + DietPi-Software | HTPC Manager: Install Python pip via pre-req system + DietPi-Software | OctoPrint: Python pip/dev is installed via pre-req system already + DietPi-Software | Minor coding and alignment: "# Comment with space" / "#commented command without space" --- dietpi/dietpi-software | 230 +++++++++++++++++++---------------------- 1 file changed, 105 insertions(+), 125 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ca4260e256..8a53170740 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -910,7 +910,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' - aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + # Pre-compiling required on ARM + (( $G_HW_ARCH < 10 )) && aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=142 @@ -2510,6 +2511,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi #Software that requires Python-Pip: https://github.com/MichaIng/DietPi/issues/784 + # OctoPrint (153) + # HTPC Manager (155) software_id=130 if (( ${aSOFTWARE_INSTALL_STATE[99]} == 1 || ${aSOFTWARE_INSTALL_STATE[118]} == 1 || @@ -2517,6 +2520,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it ${aSOFTWARE_INSTALL_STATE[139]} == 1 || ${aSOFTWARE_INSTALL_STATE[142]} == 1 || ${aSOFTWARE_INSTALL_STATE[153]} == 1 || + ${aSOFTWARE_INSTALL_STATE[155]} == 1 || ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 @@ -5607,7 +5611,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Banner_Installing # https://sabnzbd.org/wiki/installation/install-off-modules # Pre-reqs - DEPS_LIST='par2 p7zip-full libffi-dev libssl-dev' + DEPS_LIST='par2 p7zip-full' + # - Pre-compiling required on ARM + (( $G_HW_ARCH < 10 )) && DEPS_LIST+=' libffi-dev libssl-dev' Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.zip' @@ -5628,21 +5634,19 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #spotifyconnectweb - software_id=141 + software_id=141 # Spotify Connect Web 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' # Full path fails wget spider test... 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" $G_FP_DIETPI_USERDATA fi - #couchpotato - software_id=142 + software_id=142 # CouchPotato if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5657,8 +5661,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Koel - software_id=143 + software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5765,14 +5768,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Jackett - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( + G_CHECK_URL "$INSTALL_URL_ADDRESS" # Full filepath below, returns --spider error :( INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -5789,14 +5791,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #NZBget - software_id=149 + software_id=149 # NZBget if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://nzbget.net' - G_CHECK_URL "$INSTALL_URL_ADDRESS" INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' @@ -5808,33 +5808,30 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #------------------ Bittorrent: HTPC Manager ------------------ - software_id=155 + software_id=155 # HTPC Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install Python and PIP - G_AGI python python-pip python-imaging python-dev + # Pre-reqs + G_AGI python-imaging git clone --depth=1 "$INSTALL_URL_ADDRESS" - # - Move HTPC Manager to a 'better' location + # Move HTPC Manager to a 'better' location mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager cp -R HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ rm -R HTPC-Manager - # - psutil for system stats + # psutil for system stats pip install psutil fi - #OctoPrint - software_id=153 + software_id=153 # OctoPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5844,7 +5841,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior G_THREAD_START git clone "$INSTALL_URL_ADDRESS" - G_AGI python python-dev libjpeg-dev + G_AGI libjpeg-dev G_THREAD_WAIT mv OctoPrint* $G_FP_DIETPI_USERDATA/octoprint @@ -5892,8 +5889,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte fi - #Minio - software_id=158 + software_id=158 # Minio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5910,32 +5906,29 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte INSTALL_URL_ADDRESS='https://dl.minio.io/server/minio/release/linux-arm/minio' fi - G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Download executable - [ -d /usr/local/bin ] || mkdir /usr/local/bin - wget -O /usr/local/bin/minio $INSTALL_URL_ADDRESS + # Download executable + [[ -d '/usr/local/bin' ]] || mkdir -p /usr/local/bin + wget -O /usr/local/bin/minio "$INSTALL_URL_ADDRESS" chmod +x /usr/local/bin/minio # Check, Download, Install startup script INSTALL_URL_ADDRESS='https://github.com/minio/minio-service/raw/master/linux-systemd/minio.service' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # Download the systemd service script - wget -O /etc/systemd/system/minio.service $INSTALL_URL_ADDRESS + wget -O /etc/systemd/system/minio.service "$INSTALL_URL_ADDRESS" # Create no login, with home directory, with group of same name, user to run Minio in adduser --system --group minio-user # Create default data directory & grant minio-user proper access - mkdir $G_FP_DIETPI_USERDATA/minio-data + mkdir -p $G_FP_DIETPI_USERDATA/minio-data fi - #Docker - software_id=162 + software_id=162 # Docker if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5957,8 +5950,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #FuguHub - software_id=161 + software_id=161 # FuguHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6004,22 +5996,22 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.7/gitea-1.7-' - #armv6 + # armv6 if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='linux-arm-6' - #armv7 + # armv7 elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='linux-arm-7' - #armv8 + # armv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='linux-arm64' - #x86_64 + # x86_64 elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='linux-amd64' @@ -6028,7 +6020,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - Data storage / user data + # Data storage / user data mkdir -p $G_FP_DIETPI_USERDATA/gitea/gitea-repositories wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/gitea/gitea @@ -6113,8 +6105,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Google AIY - software_id=169 + software_id=169 # Google AIY if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6130,11 +6121,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix env/bin/pip install -r requirements.txt #??? ARMv7 only - if (( $G_HW_ARCH == 2 )); then - - env/bin/pip install google-assistant-library==0.0.3 - - fi + (( $G_HW_ARCH == 2 )) && env/bin/pip install google-assistant-library==0.0.3 # - Services sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service @@ -6153,8 +6140,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Roon Extension Manager - software_id=86 + software_id=86 # Roon Extension Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6180,7 +6166,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix local software_id=-1 - software_id=5 + software_id=5 # ALSA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6203,14 +6189,13 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #LibSSL1.0.0 - software_id=126 + software_id=126 # LibSSL1.0.0 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Stretch, libssl1.0.0 no longer available: https://github.com/MichaIng/DietPi/issues/1299 - if (( $G_DISTRO >= 4 )); then + # - Stretch+, libssl1.0.0 no longer available: https://github.com/MichaIng/DietPi/issues/1299 + if (( $G_DISTRO > 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/' @@ -6237,12 +6222,12 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=6 + software_id=6 # Xserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Xserver Prereqs (ALL) + # Xserver Prereqs (ALL) G_AGI xserver-xorg xinit xcompmgr xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra G_BACKUP_FP /etc/X11/xorg.conf @@ -6253,37 +6238,36 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix # - Disable DPMS and all screen blanking dps_index=$software_id Download_Install '99-dietpi-dpms_off.conf' /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf - #RPI + # RPI if (( $G_HW_MODEL < 10 )); then : - #Odroid N1 + # Odroid N1 elif (( $G_HW_MODEL == 14 )); then DEPS_LIST='libmali-rk-midgard-t86x-r14p0 xserver-xorg-video-armsoc-rk3399-odroid' dps_index=$software_id Download_Install 'xorg_n1.conf' /etc/X11/xorg.conf - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then DEPS_LIST='aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid xf86-video-fbturbo-odroid' dps_index=$software_id Download_Install 'xorg_c2.conf' /etc/X11/xorg.conf - #Odroid XU4 + # Odroid XU4 elif (( $G_HW_MODEL == 11 )); then G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid #dps_index=$software_id Download_Install 'xorg_xu4.conf' /etc/X11/xorg.conf - #Odroid C1 - #REMOVE v6.24 + # Odroid C1: REMOVE v6.24 elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then DEPS_LIST='aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid' dps_index=$software_id Download_Install 'xorg_c1.conf' /etc/X11/xorg.conf - #Pine64 + # Pine64 elif (( $G_HW_MODEL == 40 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' @@ -6292,32 +6276,32 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix dps_index=$software_id Download_Install 'xorg_pine64.conf' /etc/X11/xorg.conf - #RK3399 + # RK3399 # elif (( $G_HW_MODEL == 42 || $G_HW_MODEL == 68 )); then - #/usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/libglamoregl.so: undefined symbol: gbm_create_device - #Retry with kernel/uboot from Ubuntu image??? - - # dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf - # dps_index=$software_id Download_Install '50-dietpi-rk3399.rules' /etc/udev/rules.d/50-rk3399.rules - - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-x11-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-gbm.so -O /usr/lib/aarch64-linux-gnu/libMali.so #works but no GLES - # wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0.so -O /usr/lib/aarch64-linux-gnu/libMali.so - # rm $(ls /usr/lib/aarch64-linux-gnu/libGLESv2.*) - # rm $(ls /usr/lib/aarch64-linux-gnu/libEGL.*) - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libmali.so - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMaliOpenCL.so - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libOpenCL.so - - #ASUS TB + # /usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/libglamoregl.so: undefined symbol: gbm_create_device + # Retry with kernel/uboot from Ubuntu image??? + + #dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf + #dps_index=$software_id Download_Install '50-dietpi-rk3399.rules' /etc/udev/rules.d/50-rk3399.rules + + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-x11-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-gbm.so -O /usr/lib/aarch64-linux-gnu/libMali.so #works but no GLES + #wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0.so -O /usr/lib/aarch64-linux-gnu/libMali.so + #rm $(ls /usr/lib/aarch64-linux-gnu/libGLESv2.*) + #rm $(ls /usr/lib/aarch64-linux-gnu/libEGL.*) + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libmali.so + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMaliOpenCL.so + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libOpenCL.so + + # ASUS TB elif (( $G_HW_MODEL == 52 )); then Download_Install 'https://dietpi.com/downloads/binaries/asus/ASUSTB_GPU.7z' gpu_driver @@ -6351,8 +6335,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Nvidia driver - software_id=151 + software_id=151 # Nvidia driver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6361,8 +6344,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Avahi-Daemon - software_id=152 + software_id=152 # Avahi-Daemon if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6370,7 +6352,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=16 + software_id=16 # Build essentials if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6386,7 +6368,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=17 + software_id=17 # Git client if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6511,7 +6493,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - #Remove Information file + # Remove Information file rm /mnt/samba/readme.txt &> /dev/null G_AGI smbclient cifs-utils @@ -6633,7 +6615,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix 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 + # 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 G_AGI rsyslog systemctl start rsyslog &> /dev/null @@ -6769,7 +6751,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - #RPi's + ARMv6 only available in raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 + # RPi's + ARMv6 only available in raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 if (( $G_HW_MODEL < 10 || $G_HW_ARCH == 1 )); then echo "deb https://download.mono-project.com/repo/debian raspbian$G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list @@ -6789,8 +6771,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #------------------ Home Automation: Home Assistant ------------------ - software_id=157 + software_id=157 # Home Assistant if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6854,16 +6835,15 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Unrar - software_id=170 + software_id=170 # Unrar if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Raspbian "unrar-free" only available in repos + # Raspbian "unrar-free" only available in repos if (( $G_HW_MODEL < 10 )); then - #G_AGI unrar-free #Does not support all rar formats, better use "unrar-nonfree" from Debian repo + #G_AGI unrar-free # Does not support all rar formats, better use "unrar-nonfree" from Debian repo Download_Install "https://dietpi.com/downloads/binaries/rpi/unrar-armhf-$G_DISTRO_NAME.deb" else @@ -6883,8 +6863,8 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_SSHServer_Choices(){ - #Work out which SSH server needs installing from IDs (if any) - #Work out which SSH server needs removing (if any) + # Work out which SSH server needs installing from IDs (if any) + # Work out which SSH server needs removing (if any) if (( $INDEX_SSHSERVER_TARGET != $INDEX_SSHSERVER_CURRENT )); then # - No SSH server @@ -6914,8 +6894,8 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_FileServer_Choices(){ - #Work out which File Server needs installing from IDs (if any) - #Work out which File server needs removing (if any) + # Work out which File Server needs installing from IDs (if any) + # Work out which File server needs removing (if any) if (( $INDEX_FILESERVER_TARGET != $INDEX_FILESERVER_CURRENT )); then # Run uninstall of old file servers, after install loop @@ -6950,35 +6930,35 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_Logging_Choices(){ - #Work out which Logging system needs installing from IDs (if any) - #Work out which Logging system needs removing (if any) + # Work out which Logging system needs installing from IDs (if any) + # Work out which Logging system needs removing (if any) if (( $INDEX_LOGGING_TARGET != $INDEX_LOGGING_CURRENT )); then # Run uninstall of old logging systems, after install loop UNINSTALL_REQUIRED=1 - #None + # None if (( $INDEX_LOGGING_TARGET == 0 )); then (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 (( ${aSOFTWARE_INSTALL_STATE[103]} == 2 )) && aSOFTWARE_INSTALL_STATE[103]=-1 - #Ramlog - clear every hour + # Ramlog - clear every hour elif (( $INDEX_LOGGING_TARGET == -1 )); then aSOFTWARE_INSTALL_STATE[103]=1 (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - #Ramlog - backup every 1H to /root/logfile_storage, then clear. + # Ramlog - backup every 1H to /root/logfile_storage, then clear. elif (( $INDEX_LOGGING_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[103]=1 (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - #Logrotate + rsyslog - logs to disk + # Logrotate + rsyslog - logs to disk elif (( $INDEX_LOGGING_TARGET == -3 )); then aSOFTWARE_INSTALL_STATE[101]=1 @@ -6987,7 +6967,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Update Current Logging index + # Update Current Logging index INDEX_LOGGING_CURRENT=$INDEX_LOGGING_TARGET fi @@ -7041,10 +7021,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix # - Firefox optimizations # ??? These keep adding new entries, ignore existing entry??? - # G_CONFIG_INJECT 'extensions.update.enabled' 'pref("extensions.update.enabled", false);' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'datareporting.healthreport.uploadEnabled' 'pref("datareporting.healthreport.uploadEnabled", false);' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'browser.cache.disk.parent_directory' 'pref("browser.cache.disk.parent_directory", "/tmp/firefox_cache");' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'general.smoothScroll' 'pref("general.smoothScroll", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'extensions.update.enabled' 'pref("extensions.update.enabled", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'datareporting.healthreport.uploadEnabled' 'pref("datareporting.healthreport.uploadEnabled", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'browser.cache.disk.parent_directory' 'pref("browser.cache.disk.parent_directory", "/tmp/firefox_cache");' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'general.smoothScroll' 'pref("general.smoothScroll", false);' /etc/firefox-esr/firefox-esr.js G_THREAD_WAIT @@ -7062,10 +7042,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Create_Desktop_Shared_Items - # - file manager desktop icon + # 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 + # Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 if (( $G_HW_MODEL == 12 )); then G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa @@ -7079,10 +7059,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Configuration - # - Configs + # Configs Download_Install "https://github.com/MichaIng/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 + # 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 From df2177a0dbf9675544349f255b83d7276a3a4d50 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 7 May 2019 20:00:17 +0200 Subject: [PATCH 210/253] v6.23 + DietPi-Software | Jackett: Add "--NoRestart" option to solve failing service restart after update + DietPi-Software | Jackett: Service sandboxing according to official docs + DietPi-Software | Enhance run user creation: Use "usermod" in case of reinstall and set run users home dir to software install dir which makes "WorkingDirectory" and "Environment=USER=... HOME=..." in systemd units obsolete. + DietPi-Software | Minor coding and alignment --- dietpi/dietpi-software | 119 ++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 62 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8a53170740..e0578742ef 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5234,8 +5234,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #GOGS - software_id=49 + software_id=49 # Gogs if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5773,18 +5772,21 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior 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" # Full filepath below, returns --spider error :( + G_CHECK_URL "$INSTALL_URL_ADDRESS" INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) + # Download: wget --spider/curl -LI return 403 + fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.11.295/Jackett.Binaries.Mono.tar.gz' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt # Move existing configs to unpacked install dir - [[ -d /opt/jackett/.mono ]] && mv /opt/jackett/.mono /opt/Jackett/ - [[ -d /opt/jackett/.config ]] && mv /opt/jackett/.config /opt/Jackett/ + [[ -d '/opt/jackett/.mono' ]] && mv /opt/jackett/.mono /opt/Jackett/ + [[ -d '/opt/jackett/.config' ]] && mv /opt/jackett/.config /opt/Jackett/ # Remove existing install dir - [[ -d /opt/jackett ]] && rm -R /opt/jackett + [[ -d '/opt/jackett' ]] && rm -R /opt/jackett # Move unpacked install dir in place mv /opt/Jackett /opt/jackett @@ -10529,23 +10531,25 @@ _EOF_ fi - #GOGS - software_id=49 + software_id=49 # Gogs if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - adduser gogs --system --no-create-home --group --shell=/bin/nologin + # User + usercmd='useradd -rM' + getent passwd gogs &> /dev/null && usercmd='usermod' + $usercmd gogs -d /etc/gogs -s $(command -v nologin) - # - Data storage / user data - mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo - mkdir -p /var/log/gogs + # Directories + mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs > /var/log/gogs/gogs_daemon.log - chown -R gogs:gogs /var/log/gogs + chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs - # - sqldb + # Database /DietPi/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW" + # Service cat << _EOF_ > /etc/systemd/system/gogs.service [Unit] Description=Gogs (DietPi) @@ -10554,11 +10558,7 @@ After=mysqld.service mysql.service mariadb.service [Service] User=gogs -Group=gogs -WorkingDirectory=/etc/gogs -Environment=USER=gogs HOME=/etc/gogs ExecStart=/bin/dash -c '/etc/gogs/gogs web 2>&1 > /var/log/gogs/gogs_daemon.log' -StandardOutput=tty [Install] WantedBy=multi-user.target @@ -10566,13 +10566,12 @@ _EOF_ fi - #QBITTORRENT - software_id=46 + software_id=46 # qBitTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm qbittorrent -p "$GLOBAL_PW" -G dietpi -s /usr/sbin/nologin + useradd -rm qbittorrent -p "$GLOBAL_PW" -G dietpi -s $(command -v nologin) # - conf. mkdir -p /home/qbittorrent/.config/qBittorrent @@ -11705,16 +11704,21 @@ _EOF_ fi - #PlexPy - software_id=146 + software_id=146 # PlexPy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - mkdir -p $G_FP_DIETPI_USERDATA/plexpy + # User + usercmd='useradd -rM' + getent passwd plexpy &> /dev/null && usercmd='usermod' + $usercmd plexpy -G dietpi -d /opt/plexpy -s $(command -v nologin) - useradd -rM plexpy -G dietpi -s /usr/sbin/nologin + # Directory + mkdir -p $G_FP_DIETPI_USERDATA/plexpy + chown plexpy:dietpi /opt/plexpy $G_FP_DIETPI_USERDATA/plexpy + # Service cat << _EOF_ > /etc/systemd/system/plexpy.service [Unit] Description=Tautulli - Stats for Plex Media Server usage (DietPi) @@ -11732,14 +11736,17 @@ _EOF_ fi - #Jackett - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - adduser jackett --system --no-create-home --group --shell=/usr/sbin/nologin + # User + usercmd='useradd -rM' + getent passwd jackett &> /dev/null && usercmd='usermod' + $usercmd jackett -d /opt/jackett -s $(command -v nologin) + # Service: https://github.com/Jackett/Jackett/wiki/systemd-service cat << _EOF_ > /etc/systemd/system/jackett.service [Unit] Description=Jackett Daemon (DietPi) @@ -11747,22 +11754,24 @@ After=network.target [Service] User=jackett -Group=jackett -WorkingDirectory=/opt/jackett -Environment=USER=jackett HOME=/opt/jackett +ExecStart=$(command -v mono) -O=-aot /opt/jackett/JackettConsole.exe --NoRestart Restart=always RestartSec=5 -ExecStart=/usr/bin/mono -O=-aot /opt/jackett/JackettConsole.exe TimeoutStopSec=20 +# These lines optionally isolate (sandbox) Jackett from the rest of the system. +ReadWritePaths=/opt/jackett +ProtectSystem=strict +PrivateDevices=true +ProtectHome=true + [Install] WantedBy=multi-user.target _EOF_ fi - #NZBget - software_id=149 + software_id=149 # NZBget if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11831,8 +11840,7 @@ _EOF_ fi - #OctoPrint - software_id=153 + software_id=153 # OctoPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11850,8 +11858,7 @@ _EOF_ fi - #RoonServer - software_id=154 + software_id=154 # RoonServer if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11871,8 +11878,7 @@ _EOF_ fi - #Steam - software_id=156 + software_id=156 # Steam if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11885,8 +11891,7 @@ _EOF_ fi - #------------------ Home Automation: Home Assistant ------------------ - software_id=157 + software_id=157 # Home Assistant if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11912,10 +11917,8 @@ _EOF_ ln -sf $G_FP_DIETPI_USERDATA/homeassistant /home/homeassistant/.homeassistant fi - #------------------------------------------------------------------- - #Minio Config - software_id=158 + software_id=158 # Minio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11937,8 +11940,7 @@ _EOF_ fi - #Docker Config - software_id=162 + software_id=162 # Docker if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11962,9 +11964,7 @@ _EOF_ fi - #------------------------------------------------------------------- - #FuguHub Config - software_id=161 + software_id=161 # FuguHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11990,9 +11990,7 @@ _EOF_ fi - #------------------------------------------------------------------- - #Nukkit Config - software_id=164 + software_id=164 # Nukkit if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12044,8 +12042,7 @@ _EOF_ fi - #Allo Config - software_id=159 # 160 for quick reinstall/update + software_id=159 # Allo: 160 for quick reinstall/update if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then @@ -12223,16 +12220,15 @@ _EOF_ fi - #Google AIY - software_id=169 + software_id=169 # Google AIY if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Symlink userdata location for assistant.json + # Symlink userdata location for assistant.json ln -sf $G_FP_DIETPI_USERDATA/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json - # - Generate cache dir + # Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer # Setup soundcard @@ -12240,13 +12236,12 @@ _EOF_ fi - #PiJuice - software_id=100 + software_id=100 # PiJuice if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #RPi enable i2c required for GUI + # RPi enable i2c required for GUI (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware i2c enable mkdir -p /var/lib/dietpi/dietpi-software/installed/pijuice From 8c4949c2683b0f1dcace175b94146fee6e0cc914 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 00:37:23 +0200 Subject: [PATCH 211/253] v6.23 (#2773) + DietPi-Software | Jackett: Use new (v0.11+) standalone version on non-ARMv6 devices. "PrivateTmp=true" required to allow access to (then isolated) /tmp in combination with "ProtectSystem=strict". + DietPi-Software | Jackett: On Jessie systemd "ProtectSystem=strict" and "ReadWritePaths" is not supported, use "ProtectSystem=full" instead which allows /opt/jackett access already. + DietPi-Patch | Reinstall Jackett to apply service fix (for using internal updater) and install new standalone binary on non-ARMv6 devices + DietPi-Software | LibSSL1.0.0: Skip whole install loop in Jessie to avoid misleading output and install mark + DietPi-Software | LibSSL1.0.0: Requires "multiarch-support" which is usually pre-installed, but was not on my Buster VM --- CHANGELOG.txt | 2 + dietpi/dietpi-software | 107 ++++++++++++++++++++++++++++++++++------- dietpi/patch_file | 11 ++++- 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a3737c4cc8..710304afc6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -31,6 +31,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 +- DietPi-Software | Jackett: On non-ARMv6 devices the new (v0.11+) standalone (non-mono) binary is installed now. This is applied on DietPi-Update as well, preserving your settings: https://github.com/MichaIng/DietPi/pull/2773 Bug Fixes: - System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 @@ -53,6 +54,7 @@ Bug Fixes: - DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 - DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 +- DietPi-Software | Jackett: Resolved an issue where service start fails after using the internal updater. Many thanks to @DeathIsUnknown for reporting this issue and providing a solution: https://github.com/MichaIng/DietPi/issues/2593#issuecomment-490096681 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e0578742ef..38930b6690 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2168,7 +2168,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=126 aSOFTWARE_WHIP_NAME[$software_id]='LibSSL1.0.0' - aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch)' + aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch+)' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=1 @@ -2477,24 +2477,31 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi - #Software that requires LibSSL1.0.0 - software_id=126 - if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 || - ${aSOFTWARE_INSTALL_STATE[60]} == 1 || - ${aSOFTWARE_INSTALL_STATE[97]} == 1 || - ${aSOFTWARE_INSTALL_STATE[134]} == 1 )); then + #Software that requires LibSSL1.0.0, Stretch+ only + if (( $G_DISTRO > 3 )); then - aSOFTWARE_INSTALL_STATE[$software_id]=1 - G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" + # Jackett (147) + software_id=126 + if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 || + ${aSOFTWARE_INSTALL_STATE[60]} == 1 || + ${aSOFTWARE_INSTALL_STATE[97]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 || + ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" + + fi fi #Software that requires Mono + # Jackett (147) on ARMv6: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below software_id=150 if (( ${aSOFTWARE_INSTALL_STATE[106]} == 1 || ${aSOFTWARE_INSTALL_STATE[144]} == 1 || ${aSOFTWARE_INSTALL_STATE[145]} == 1 || - ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + ( ${aSOFTWARE_INSTALL_STATE[147]} == 1 && $G_HW_ARCH == 1 ) )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" @@ -5775,15 +5782,57 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior # 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 -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) + fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.11.295/Jackett.Binaries.Mono.tar.gz' + + # - ARMv7 + if (( $G_HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxARM32} + fallback_url=${fallback_url/Mono/LinuxARM32} + + # - ARMv8 + elif (( $G_HW_ARCH == 3 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxARM64} + fallback_url=${fallback_url/Mono/LinuxARM64} + + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxAMDx64} + fallback_url=${fallback_url/Mono/LinuxAMDx64} + + fi + + # Standalone version dependencies: https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore30#linux-distribution-dependencies + if (( $G_HW_ARCH != 1 )); then + + DEPS_LIST='liblttng-ust0' + if (( $G_DISTRO < 4 )); then + + DEPS_LIST+=' libicu52' + + elif (( $G_DISTRO == 4 )); then + + DEPS_LIST+=' libicu57' + + elif (( $G_DISTRO > 4 )); then + + DEPS_LIST+=' libicu63' + + fi + + fi # Download: wget --spider/curl -LI return 403 - fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.11.295/Jackett.Binaries.Mono.tar.gz' no_check_url=1 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/.config' ]] && mv /opt/jackett/.config /opt/Jackett/ # Remove existing install dir [[ -d '/opt/jackett' ]] && rm -R /opt/jackett @@ -6218,6 +6267,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi + DEPS_LIST='multiarch-support' Download_Install "$INSTALL_URL_ADDRESS" fi @@ -11746,6 +11796,9 @@ _EOF_ getent passwd jackett &> /dev/null && usercmd='usermod' $usercmd jackett -d /opt/jackett -s $(command -v nologin) + # Permissions + chown -R jackett:jackett /opt/jackett + # Service: https://github.com/Jackett/Jackett/wiki/systemd-service cat << _EOF_ > /etc/systemd/system/jackett.service [Unit] @@ -11754,21 +11807,34 @@ After=network.target [Service] User=jackett +Environment=XDG_CONFIG_HOME=/opt/jackett ExecStart=$(command -v mono) -O=-aot /opt/jackett/JackettConsole.exe --NoRestart Restart=always RestartSec=5 TimeoutStopSec=20 # These lines optionally isolate (sandbox) Jackett from the rest of the system. -ReadWritePaths=/opt/jackett ProtectSystem=strict -PrivateDevices=true ProtectHome=true +PrivateDevices=true +PrivateTmp=true +ReadWritePaths=/opt/jackett [Install] WantedBy=multi-user.target _EOF_ + # - Non-ARMv6 devices run the standalone version: https://github.com/Jackett/Jackett#install-on-linux-amdx64 + (( $G_HW_ARCH != 1 )) && G_CONFIG_INJECT 'ExecStart=' 'ExecStart=/opt/jackett/jackett --NoRestart' /etc/systemd/system/jackett.service + + # - Jessie: ProtectSystem=strict and ReadWritePaths not supported, use ProtectSystem=full instead: https://manpages.debian.org/jessie/systemd/systemd.exec.5.en.html + if (( $G_DISTRO < 4 )); then + + G_CONFIG_INJECT 'ProtectSystem=' 'ProtectSystem=full' /etc/systemd/system/jackett.service + sed -i '/^ReadWritePaths=/d' /etc/systemd/system/jackett.service + + fi + fi software_id=149 # NZBget @@ -13041,13 +13107,18 @@ _EOF_ fi - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - userdel -rf jackett - rm -R /opt/jackett - rm /etc/systemd/system/jackett.service + getent passwd jackett &> /dev/null && userdel -rf jackett + [[ -d '/opt/jackett' ]] && rm -R /opt/jackett + if [[ -f '/etc/systemd/system/jackett.service' ]]; then + + systemctl disable jackett + rm /etc/systemd/system/jackett.service + + fi fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 9489fa8178..4c4a939ac6 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1904,14 +1904,21 @@ Your Nextcloud data are not touched.' dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list # Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4 - # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then systemctl disable squeezeboxserver mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service fi - /DietPi/dietpi/dietpi-software reinstall 34 35 42 139 $reinstall_ids + # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 + # Jackett: https://github.com/MichaIng/DietPi/pull/2773 + if [[ -d '/opt/jackett/.config' ]]; then + + cp -a /opt/jackett/.config/. /opt/jackett/ + rm -R /opt/jackett/.config + + fi + /DietPi/dietpi/dietpi-software reinstall 34 35 42 139 147 $reinstall_ids #----------------------------------------------------------------------- # Remove old PHP version if (( $upgrade_php )); then From 2e49bc517ed86e07c784f4cfa849322419ef03b7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 00:38:02 +0200 Subject: [PATCH 212/253] v6.23 + 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 2a01bb1a3e..382867f696 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 23 -1 +2 From a7a34d2d6cdf1494655156dd52aa727632ab6083 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 00:38:39 +0200 Subject: [PATCH 213/253] v6.23 + 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 9fe8836d74..418e0a96d0 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-23} - 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} [[ -f '/DietPi/dietpi/.version' && $( Date: Wed, 8 May 2019 16:46:26 +0200 Subject: [PATCH 214/253] v6.23 + DietPi-Software | Nextcloud: Lighttpd config directive fix --- .conf/dps_114/lighttpd.nextcloud.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index e3b242844e..d7337c9267 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -16,7 +16,7 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { # - Files $HTTP["url"] =~ "^/nextcloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing - dir-listing.active = "disable" + dir-listing.activate = "disable" # - Cache control and security headers for static resources $HTTP["url"] =~ "^/nextcloud/.*\.(css|js|woff2?|svg|gif)$" { setenv.add-response-header += ( From 3cac9da9d89c84184206bfa91facfb1204d9bfca Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 16:47:01 +0200 Subject: [PATCH 215/253] v6.23 + DietPi-Software | ownCloud: Lighttpd directive fix --- .conf/dps_47/lighttpd.owncloud.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conf/dps_47/lighttpd.owncloud.conf b/.conf/dps_47/lighttpd.owncloud.conf index 0f6211d132..d225c7ff3b 100644 --- a/.conf/dps_47/lighttpd.owncloud.conf +++ b/.conf/dps_47/lighttpd.owncloud.conf @@ -10,7 +10,7 @@ $HTTP["url"] =~ "^/owncloud($|/)" { # - Files $HTTP["url"] =~ "^/owncloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing - dir-listing.active = "disable" + dir-listing.activate = "disable" # - Cache control and security headers for static resources $HTTP["url"] =~ "^/owncloud/.+\.(css|js)" { setenv.add-response-header += ( From 066a6b502d8d11cc0b252f9f0bd1b34a17f37aec Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 16:49:54 +0200 Subject: [PATCH 216/253] v6.23 + CHANGELOG | Nextcloud/ownCloud: Lighttpd config directive fix --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 710304afc6..fb1c3f3296 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -48,6 +48,7 @@ Bug Fixes: - DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 - DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 - DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 +- DietPi-Software | Nextcloud/ownCloud: Fixed a wrong directive in our Lighttpd configs. Many thanks to @WilburWalsh for reporting this issue: https://github.com/MichaIng/DietPi/issues/2775 - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 From 986791bc4f988c3f398710245fe4dc174d439f3c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 8 May 2019 23:02:49 +0200 Subject: [PATCH 217/253] v6.23 + DietPi-Explorer | Try to preserve permissions etc when copying items + DietPi-Explorer | Minor coding --- dietpi/dietpi-explorer | 52 +++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/dietpi/dietpi-explorer b/dietpi/dietpi-explorer index 25c7bdb730..a119e3e656 100644 --- a/dietpi/dietpi-explorer +++ b/dietpi/dietpi-explorer @@ -9,28 +9,27 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/dietpi-explorer + # - Location: /DietPi/dietpi/dietpi-explorer # # Usage: # - dietpi-explorer (menu system) - # - dietpi-explorer 1 | Select a folder mode, return result for other applications to /tmp/.dietpi-explorer_selected_location + # - dietpi-explorer 1 Select a folder mode, return result for other applications to /tmp/.dietpi-explorer_selected_location #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Explorer' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 CURRENT_DIRECTORY='' TARGET_FP='/home' - [[ $2 ]] && TARGET_FP="$2" + [[ $2 ]] && TARGET_FP=$2 - CP_MODE=0 #0=CP 1=MV + CP_MODE=0 # 0=CP 1=MV CP_SOURCE='' CP_TARGET='' @@ -40,7 +39,7 @@ if (( $CP_MODE == 0 )); then - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp -R "$CP_SOURCE" "$CP_TARGET"/ + G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp -a "$CP_SOURCE" "$CP_TARGET"/ elif (( $CP_MODE == 1 )); then @@ -51,9 +50,9 @@ fi # - Reset for next run + CP_MODE=0 CP_SOURCE='' CP_TARGET='' - CP_MODE=0 } @@ -153,7 +152,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Select' ]]; then - echo -e "$CURRENT_DIRECTORY/$TARGET_FP" > /tmp/.dietpi-explorer_selected_location + echo "$CURRENT_DIRECTORY/$TARGET_FP" > /tmp/.dietpi-explorer_selected_location exit 0 elif [[ $G_WHIP_RETURNED_VALUE == 'Copy' ]]; then @@ -173,7 +172,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Rename' ]]; then - G_WHIP_DEFAULT_ITEM="$TARGET_FP" + G_WHIP_DEFAULT_ITEM=$TARGET_FP if G_WHIP_INPUTBOX "Please enter a new name for '$TARGET_FP'"; then G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD mv "$TARGET_FP" "$G_WHIP_RETURNED_VALUE" @@ -199,10 +198,10 @@ done <<< "$(getent passwd | cut -d: -f1 | sort)" - G_WHIP_DEFAULT_ITEM="$permission_current_user" + G_WHIP_DEFAULT_ITEM=$permission_current_user if G_WHIP_MENU 'Chown permissions:\n - Please select a User'; then - local chown_user="$G_WHIP_RETURNED_VALUE" + local chown_user=$G_WHIP_RETURNED_VALUE G_WHIP_MENU_ARRAY=() @@ -213,10 +212,10 @@ done <<< "$(getent group | cut -d: -f1 | sort)" - G_WHIP_DEFAULT_ITEM="$permission_current_group" + G_WHIP_DEFAULT_ITEM=$permission_current_group if G_WHIP_MENU 'Chown permissions:\n - Please select a Group'; then - local chown_group="$G_WHIP_RETURNED_VALUE" + local chown_group=$G_WHIP_RETURNED_VALUE G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD chown -R $chown_user:$chown_group "$CURRENT_DIRECTORY/$TARGET_FP" fi @@ -225,7 +224,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Chmod' ]]; then - G_WHIP_DEFAULT_ITEM="$chmod_current" + G_WHIP_DEFAULT_ITEM=$chmod_current if G_WHIP_INPUTBOX 'Chmod permissions:\n - Please enter a value'; then G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD chmod -R $G_WHIP_RETURNED_VALUE "$CURRENT_DIRECTORY/$TARGET_FP" @@ -245,10 +244,10 @@ #///////////////////////////////////////////////////////////////////////////////////// TARGETMENUID=0 - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ - CURRENT_DIRECTORY="$PWD" + CURRENT_DIRECTORY=$PWD G_WHIP_MENU_ARRAY=() if [[ $CURRENT_DIRECTORY == '/' ]]; then @@ -282,10 +281,10 @@ done G_WHIP_BUTTON_CANCEL_TEXT='Exit' - G_WHIP_DEFAULT_ITEM="$TARGET_FP" + G_WHIP_DEFAULT_ITEM=$TARGET_FP if G_WHIP_MENU "$CURRENT_DIRECTORY"; then - TARGET_FP="$G_WHIP_RETURNED_VALUE" + TARGET_FP=$G_WHIP_RETURNED_VALUE Select_Menu @@ -302,13 +301,11 @@ G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - #exit - TARGETMENUID=-1 + TARGETMENUID=-1 # Exit else - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Main menu fi @@ -317,11 +314,10 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - - #Default to users home dir + # Default to users home dir cd "$TARGET_FP" - #Start Menu + # Start Menu while (( $TARGETMENUID > -1 )) do From f3f801ed83ab553766f3569c56a1abbeed93db66 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 9 May 2019 00:21:10 +0200 Subject: [PATCH 218/253] v6.23 + DietPi-Morsecode | Fix console output mode: "printf '\ec'" does not fill the console with the defined background colour. "clear" does this on some terminals, but e.g. not through PuTTY. The echo/printf codes "\e[H" "\eJ" navigate to start and end of screen, filling everything with the defined background colour reliably. + DietPi-Morsecode | Minor coding and alignment --- dietpi/dietpi-morsecode | 97 +++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 80574db918..2062971f28 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -12,63 +12,63 @@ # - Converts and renders a text file into morse code # # Usage: - # - dietpi-morsecode 0/noinput = Output to Term - # - dietpi-morsecode 1 = Output to both RPi status LED's + # - dietpi-morsecode 0/noinput = Output to console/screen + # - dietpi-morsecode 1 = Output to both RPi status LEDs # - dietpi-morsecode 2 = Output to ALSA (sound) #//////////////////////////////////// - #At the end of the day, if your using this, your probably in a life threating situation. - #I doubt your Transmission downloads, or webserver is going to be more important. - #So, Lets change the nice to -10 (High priority) ;) + # At the end of the day, if your using this, your probably in a life threating situation. + # I doubt your Transmission downloads, or webserver is going to be more important. + # So, Lets change the nice to -10 (High priority) ;) renice -n -10 $$ &> /dev/null - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Morsecode' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- G_EXIT_CUSTOM(){ [[ -f $FP_TEXTFILE_LOWERCASE ]] && rm $FP_TEXTFILE_LOWERCASE; } - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Output Data #///////////////////////////////////////////////////////////////////////////////////// OUTPUT_MODE=$INPUT - #OUTPUT_MODE_0 (TERM/SCREEN) + # OUTPUT_MODE_0 (TERM/SCREEN) TERM_X=$(tput cols) TERM_Y=$(tput lines) - TERM_TOTAL_CHARS=$(( $TERM_X * $TERM_Y - 1)) #How many printed chars are required to fill screen? + TERM_TOTAL_CHARS=$(( $TERM_X * $TERM_Y - 1)) # How many printed chars are required to fill screen? TERM_COLOUR='\e[48;5;15m' - #OUTPUT_MODE_1 (RPI status LEDs) + # OUTPUT_MODE_1 (RPI status LEDs) - #OUTPUT_MODE_2 (Sound) + # OUTPUT_MODE_2 (Sound) + SOUND_PID=-1 Output_On(){ - #TERM/SCREEN Output + # TERM/SCREEN Output if (( $OUTPUT_MODE == 0 )); then - #Set color - echo -e "$TERM_COLOUR" - printf '\ec' # clear current terminal screen + # Fill terminal with colour + echo -ne "\e[H$TERM_COLOUR\eJ" - #RPi status LEDs + # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then echo 1 > /sys/class/leds/led0/brightness echo 1 > /sys/class/leds/led1/brightness + # Sound elif (( $OUTPUT_MODE == 2 )); then - #Isnt quick enough in bash. cant get buffer/latency low enough to make it usable. + # Isnt quick enough in bash. cant get buffer/latency low enough to make it usable. speaker-test -b 40000 -t sine -f 800 -l 1 -p 1 &> /dev/null & - pid=$! + SOUND_PID=$! fi @@ -76,22 +76,22 @@ Output_Off(){ - #TERM/SCREEN Output + # TERM/SCREEN Output if (( $OUTPUT_MODE == 0 )); then - #reset colour - echo -e '\e[0m' - printf '\ec' # clear current terminal screen + # Reset colour + echo -ne '\e[H\e[0m\eJ' - #RPi status LEDs + # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then echo 0 > /sys/class/leds/led0/brightness echo 0 > /sys/class/leds/led1/brightness + # Sound elif (( $OUTPUT_MODE == 2 )); then - kill -9 $pid + kill -9 $SOUND_PID #killall speaker-test &> /dev/null fi @@ -103,22 +103,22 @@ #///////////////////////////////////////////////////////////////////////////////////// CHAR_CURRENT=0 - #Filepaths - FP_TEXTFILE_INPUT="$HOME/dietpi-morsecode" - FP_TEXTFILE_LOWERCASE='/tmp/.dietpi-morsecode_lowercase' + # Filepaths + FP_TEXTFILE_INPUT='/root/dietpi-morsecode' + FP_TEXTFILE_LOWERCASE='.dietpi-morsecode_lowercase' - #Define single unit duration (essentially the speed at which the morse code is outputted) + # Define single unit duration (essentially the speed at which the morse code is outputted) MC_DURATION_UNIT=0.15 - #Dash and next char duration ( MC_DURATION_UNIT * 3 ) - MC_DURATION_DASH=$(echo - | mawk "{print $MC_DURATION_UNIT * 3}") - #New word duration ( MC_DURATION_UNIT * 7 ) - MC_DURATION_WORD=$(echo - | mawk "{print $MC_DURATION_UNIT * 7}") + # Dash and next char duration ( MC_DURATION_UNIT * 3 ) + MC_DURATION_DASH=$(mawk "{print $MC_DURATION_UNIT * 3}" <<< '') + # New word duration ( MC_DURATION_UNIT * 7 ) + MC_DURATION_WORD=$(mawk "{print $MC_DURATION_UNIT * 7}" <<< '') Mc_Convert_Input_Textfile_Lowercase(){ - echo -e 'DietPi-Morsecode\n\nConverting input file to lowercase......\n' + G_DIETPI-NOTIFY 1 'DietPi-Morsecode\n\nConverting input file to lowercase......\n' dd if="$FP_TEXTFILE_INPUT" of="$FP_TEXTFILE_LOWERCASE" conv=lcase &> /dev/null - echo -e "Completed\nRendering to Output_Mode $OUTPUT_MODE" + G_DIETPI-NOTIFY 1 "Completed\nRendering to Output_Mode $OUTPUT_MODE" } @@ -152,7 +152,7 @@ } - #AR + # AR Mc_End_of_Message(){ Mc_Next_Word @@ -441,26 +441,29 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Check for input file + # Check for input file if [[ ! -f $FP_TEXTFILE_INPUT ]]; then - printf '\ec' # clear current terminal screen - echo -e "\nNo textfile was found. Please create a file at:\n$FP_TEXTFILE_INPUT\nThis file will then be converted to Morse Code." - exit + + G_DIETPI-NOTIFY 1 "No textfile was found. Please create a file at:\n$FP_TEXTFILE_INPUT\nThis file will then be converted to Morse Code." + exit 1 + fi #----------------------------------------------------------------------------------- - #Convert input textfile file to lowercase + # Convert input textfile file to lowercase Mc_Convert_Input_Textfile_Lowercase #----------------------------------------------------------------------------------- - #Process file (read char one at a time, convert to morse code and render) + # Process file (read char one at a time, convert to morse code and render) + # - Clear screen in case of console output mode + (( $OUTPUT_MODE == 0 )) && printf '\ec' while read -r -n1 CHAR_CURRENT do - #Space (new word) - if [[ $CHAR_CURRENT = ' ' ]]; then + # Space (new word) + if [[ $CHAR_CURRENT == [[:space:]] ]]; then Mc_Next_Word - #Next char + # Next char else Mc_Next_Char @@ -470,7 +473,7 @@ done < $FP_TEXTFILE_LOWERCASE - #Send end of message (AR) + # Send end of message (AR) Mc_End_of_Message #----------------------------------------------------------------------------------- exit From e93bd5b5ab0bbdfb4e66b0378eff4e8a13cba60b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 9 May 2019 00:23:45 +0200 Subject: [PATCH 219/253] v6.23 + DietPi-Morsecode | Typo --- dietpi/dietpi-morsecode | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 2062971f28..6f8618a034 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -55,7 +55,7 @@ if (( $OUTPUT_MODE == 0 )); then # Fill terminal with colour - echo -ne "\e[H$TERM_COLOUR\eJ" + echo -ne "\e[H$TERM_COLOUR\e[J" # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then @@ -80,7 +80,7 @@ if (( $OUTPUT_MODE == 0 )); then # Reset colour - echo -ne '\e[H\e[0m\eJ' + echo -ne '\e[H\e[0m\e[J' # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then From 1998c4556b75488cc1352ae5d5a1ce171de0f7db Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 9 May 2019 00:48:33 +0200 Subject: [PATCH 220/253] v6.23 + DietPi-Morsecode | Use 8bit colour for console/screen output to be most compatible with all terminal types + DietPi-Morsecode | Code cleanup: Screen size is not required, lowercase file removed automatically since it is created in scripts working dir now --- dietpi/dietpi-morsecode | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 6f8618a034..eed1fd491d 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -9,6 +9,7 @@ #//////////////////////////////////// # # Info: + # - Location: /DietPi/dietpi/dietpi-morsecode # - Converts and renders a text file into morse code # # Usage: @@ -29,33 +30,23 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - G_EXIT_CUSTOM(){ [[ -f $FP_TEXTFILE_LOWERCASE ]] && rm $FP_TEXTFILE_LOWERCASE; } - + # Grab input disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Output Data #///////////////////////////////////////////////////////////////////////////////////// OUTPUT_MODE=$INPUT - - # OUTPUT_MODE_0 (TERM/SCREEN) - TERM_X=$(tput cols) - TERM_Y=$(tput lines) - TERM_TOTAL_CHARS=$(( $TERM_X * $TERM_Y - 1)) # How many printed chars are required to fill screen? - TERM_COLOUR='\e[48;5;15m' - - # OUTPUT_MODE_1 (RPI status LEDs) - - # OUTPUT_MODE_2 (Sound) SOUND_PID=-1 Output_On(){ - # TERM/SCREEN Output + # console/screen if (( $OUTPUT_MODE == 0 )); then # Fill terminal with colour - echo -ne "\e[H$TERM_COLOUR\e[J" + # - 8bit colour code (light gray) for max terminal support + echo -ne '\e[H\e[47m\e[J' # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then @@ -63,7 +54,7 @@ echo 1 > /sys/class/leds/led0/brightness echo 1 > /sys/class/leds/led1/brightness - # Sound + # ALSA (sound) elif (( $OUTPUT_MODE == 2 )); then # Isnt quick enough in bash. cant get buffer/latency low enough to make it usable. @@ -76,7 +67,7 @@ Output_Off(){ - # TERM/SCREEN Output + # console/screen if (( $OUTPUT_MODE == 0 )); then # Reset colour @@ -88,7 +79,7 @@ echo 0 > /sys/class/leds/led0/brightness echo 0 > /sys/class/leds/led1/brightness - # Sound + # ALSA (sound) elif (( $OUTPUT_MODE == 2 )); then kill -9 $SOUND_PID @@ -454,7 +445,7 @@ Mc_Convert_Input_Textfile_Lowercase #----------------------------------------------------------------------------------- # Process file (read char one at a time, convert to morse code and render) - # - Clear screen in case of console output mode + # - Clear screen in case of console/screen output mode (( $OUTPUT_MODE == 0 )) && printf '\ec' while read -r -n1 CHAR_CURRENT do From 3d3c06e2421d2a79d214ab8c0b5a36d21e313865 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 10 May 2019 23:26:11 +0200 Subject: [PATCH 221/253] v6.23 (#2779) + DietPi-Software | Blynk Server: Resolve an issue where logging does not work as the service tries to create logging directory in root + DietPi-Software | Blynk Server: Enable Buster support by installing the Java 11 binary. Otherwise select the Java 8 binary explicitly, which was done already since the Java 8 binary is the first match from the GitHub API page. + DietPi-Software | Blynk Server: Log to /var/log/blynk by default + DietPi-Software | OpenBazaar: Install latest Golang Go v11 + DietPi-Software | Reinstalls: Adjust last run user creations to use "usermod" if user already exists + DietPi-Software | Coding: Finish "software_id= # " line reduction, comments+alignment consistency and some minor tweaks --- CHANGELOG.txt | 3 + dietpi/dietpi-software | 722 ++++++++++++++------------------ dietpi/func/dietpi-set_software | 79 ++-- dietpi/patch_file | 30 +- 4 files changed, 383 insertions(+), 451 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb1c3f3296..5a15f02c72 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,6 +32,8 @@ Changes / Improvements / Optimisations: - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 - DietPi-Software | Jackett: On non-ARMv6 devices the new (v0.11+) standalone (non-mono) binary is installed now. This is applied on DietPi-Update as well, preserving your settings: https://github.com/MichaIng/DietPi/pull/2773 +- DietPi-Software | Blynk: Enabled support for Debian Buster by using the new Java 11 binary. +- DietPi-Software | UrBackup: New version 2.3.8 is installed now. Many thanks to @DeathIsUnknown for informing us about the update: https://github.com/MichaIng/DietPi/issues/2783 Bug Fixes: - System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 @@ -56,6 +58,7 @@ Bug Fixes: - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 - DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Jackett: Resolved an issue where service start fails after using the internal updater. Many thanks to @DeathIsUnknown for reporting this issue and providing a solution: https://github.com/MichaIng/DietPi/issues/2593#issuecomment-490096681 +- DietPi-Software | Blynk: Resolved an issue where logging failed and changed the default log dir to /var/log/blynk. Many thanks to @Phil1988 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2777 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 38930b6690..e205c55628 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3066,24 +3066,24 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di [[ -f $target ]] && G_WHIP_MSG "[INFO] Updating file: $target" G_RUN_CMD mv $file "$target" - elif [[ $type == deb ]]; then + elif [[ $type == 'deb' ]]; then # - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file (( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF - elif [[ $type == zip ]]; then + elif [[ $type == 'zip' ]]; then [[ $target ]] && target="-d $target" G_RUN_CMD unzip -o $file "$target" - elif [[ $type == tar ]]; then + elif [[ $type == 'tar' ]]; then #[[ $target ]] && target="--one-top-level=$target" # Option exist not on Jessie [[ $target ]] && G_RUN_CMD mkdir -p "$target" && target="-C $target" G_RUN_CMD tar xf $file "$target" - elif [[ $type == 7z ]]; then + elif [[ $type == '7z' ]]; then [[ $target ]] && target="-o$target" G_RUN_CMD 7zr x -y $file "$target" @@ -3254,8 +3254,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #vsFTPD - software_id=95 + software_id=95 # vsFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3263,8 +3262,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #NFS_SERVER - software_id=109 + software_id=109 # NFS Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3278,8 +3276,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_APACHE - software_id=83 + software_id=83 # Apache Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3290,8 +3287,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_NGINX - software_id=85 + software_id=85 # Nginx Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3302,8 +3298,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_LIGHTTPD - software_id=84 + software_id=84 # Lighttpd Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3312,8 +3307,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_MARIADB - software_id=88 + software_id=88 # MariaDB Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3328,7 +3322,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di # - Remove possible dead symlinks/files: rm $G_FP_DIETPI_USERDATA/mysql &> /dev/null mkdir -p $G_FP_DIETPI_USERDATA/mysql - if [[ -d /var/lib/mysql ]]; then + if [[ -d '/var/lib/mysql' ]]; then G_DIETPI-NOTIFY 2 '/var/lib/mysql exists, will migrate containing databases' G_RUN_CMD cp -a /var/lib/mysql/. $G_FP_DIETPI_USERDATA/mysql @@ -3338,7 +3332,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi G_DIETPI-NOTIFY 2 'Removing /var/lib/mysql, if existent' - [[ -L /var/lib/mysql && ! $(readlink /var/lib/mysql) =~ $G_FP_DIETPI_USERDATA/mysql ]] && + [[ -L '/var/lib/mysql' && ! $(readlink /var/lib/mysql) =~ $G_FP_DIETPI_USERDATA/mysql ]] && rm -R "$(readlink /var/lib/mysql)" &> /dev/null rm -R /var/lib/mysql &> /dev/null @@ -3363,8 +3357,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_SQLITE - software_id=87 + software_id=87 # SQLite Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3375,8 +3368,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_REDIS - software_id=91 + software_id=91 # Redis Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3400,8 +3392,7 @@ ExecStartPre=$(command -v chown) -R redis:redis /var/run/redis /var/lib/redis" > fi - #WEBSERVER_PHP - software_id=89 + software_id=89 # PHP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3484,13 +3475,12 @@ Package: openssl libssl1.1\nPin: origin packages.sury.org\nPin-Priority: -1' > / fi - #WEBSERVER_MYADMINPHP - software_id=90 + software_id=90 # phpMyAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #MySQL must be running during install to allow debconf setup. + # MariaDB must be running during install to allow debconf setup. G_RUN_CMD systemctl start $MARIADB_SERVICE # Set password parameters before installing @@ -3560,13 +3550,13 @@ We work around this error by running APT a second time. Please do not worry and fi - software_id=54 # Forums phpBB + software_id=54 # phpBB Forum if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing # Skip install, if already present - if [[ -d /var/www/phpBB3 ]]; then + if [[ -d '/var/www/phpBB3' ]]; then G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/var/www/phpBB3\" already exists. Download and install steps will be skipped. - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please follow the instructions from WebUI ACP. @@ -3585,42 +3575,42 @@ We work around this error by running APT a second time. Please do not worry and Banner_Installing + # Install Golang Go: https://golang.org/dl/ # - x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-amd64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-amd64.tar.gz' # - ARMv8 elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-arm64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-arm64.tar.gz' # - ARMv6/7 else - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-armv6l.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-armv6l.tar.gz' fi Download_Install "$INSTALL_URL_ADDRESS" /usr/local/ + # Export Go path variables mkdir -p $G_FP_DIETPI_USERDATA/go cat << _EOF_ > /etc/bashrc.d/go.sh #!/bin/bash export GOPATH=$G_FP_DIETPI_USERDATA/go export PATH=\$PATH:/usr/local/go/bin:$G_FP_DIETPI_USERDATA/go/bin _EOF_ - . /etc/bashrc.d/go.sh - # - Install OB + # Install OpenBazaar G_DIETPI-NOTIFY 2 "Installing ${aSOFTWARE_WHIP_NAME[$software_id]}, please wait, this will take some time (1-5 minutes)" G_RUN_CMD go get github.com/OpenBazaar/openbazaar-go fi - #YACY - software_id=133 + software_id=133 # YaCy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3628,13 +3618,12 @@ _EOF_ fi - #Folding@Home - software_id=2 + software_id=2 # Folding@Home if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - We must uninstall previous package for reinstall, else it will fail: https://github.com/MichaIng/DietPi/issue_comments#issuecomment-411688073 + # We must uninstall previous package for reinstall, else it will fail: https://github.com/MichaIng/DietPi/issue_comments#issuecomment-411688073 if dpkg-query -s 'fahclient' &> /dev/null; then G_DIETPI-NOTIFY 2 'Removing previous package before installing the latest version' @@ -3651,7 +3640,7 @@ _EOF_ Download_Install 'https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.5/latest.deb' - killall -w FAHClient #due to https://github.com/FoldingAtHome/fah-issues/issues/1193 + killall -w FAHClient # Due to https://github.com/FoldingAtHome/fah-issues/issues/1193 fi @@ -3661,7 +3650,7 @@ _EOF_ Banner_Installing DEPS_LIST="$PHP_NAME-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions - if [[ -f /var/www/owncloud/occ ]]; then + if [[ -f '/var/www/owncloud/occ' ]]; then G_DIETPI-NOTIFY 2 'Existing ownCloud installation found, will NOT overwrite...' @@ -3696,7 +3685,7 @@ _EOF_ Banner_Installing DEPS_LIST="$PHP_NAME-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - if [[ -f /var/www/nextcloud/occ ]]; then + if [[ -f '/var/www/nextcloud/occ' ]]; then G_DIETPI-NOTIFY 2 'Existing Nextcloud installation found, will NOT overwrite...' @@ -3735,8 +3724,7 @@ _EOF_ fi - #YMPD - software_id=32 + software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3814,7 +3802,7 @@ _EOF_ Banner_Installing - #Sourcebuild pre-reqs + # Sourcebuild pre-reqs DEPS_LIST='cppcheck pkg-config libssl-dev libmpdclient-dev libmpdclient2 cmake' #Download_Install 'https://github.com/jcorporation/myMPD/archive/master.zip' @@ -3823,6 +3811,7 @@ _EOF_ cd myMPD* G_RUN_CMD ./mkrelease.sh cd /tmp/$G_PROGRAM_NAME + rm -R myMPD* fi @@ -3902,7 +3891,7 @@ _EOF_ # Install our config file only, if not yet existent, to preserve manual user config. # - This needs to be done prior to APT install, since this would otherwise install a default config file as well. - [[ -f /etc/mopidy/mopidy.conf ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf + [[ -f '/etc/mopidy/mopidy.conf' ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - # No Buster list available yet, use stretch.list for testing: @@ -3977,8 +3966,7 @@ _EOF_ fi - #MINIDLNA - software_id=39 + software_id=39 # MiniDLNA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4029,8 +4017,7 @@ _EOF_ fi - #dxx-rebirth - software_id=112 + software_id=112 # DDX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4046,17 +4033,17 @@ _EOF_ Banner_Installing # ARMv7 - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_armhf.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server_2.3.8_armhf.deb' # x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_amd64.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server_2.3.8_amd64.deb' # ARMv8 source elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server-2.3.7.tar.gz' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server-2.3.8.tar.gz' fi @@ -4072,7 +4059,7 @@ _EOF_ G_RUN_CMD make -j $G_HW_CPU_CORES G_RUN_CMD make install - sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service + sed -i '/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime' urbackup-server.service cp urbackup-server.service /etc/systemd/system/urbackupsrv.service cp defaults_server /etc/default/urbackupsrv cp logrotate_urbackupsrv /etc/logrotate.d/urbackupsrv @@ -4095,7 +4082,7 @@ _EOF_ Banner_Installing - if (( $G_HW_MODEL >= 10 )); then + if (( $G_HW_MODEL > 9 )); then G_AGI opentyrian @@ -4103,7 +4090,7 @@ _EOF_ DEPS_LIST='ibsdl1.2debian libsdl-net1.2' Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - cp -R /usr/local/games/opentyrian /usr/games/ #cp 'just does it', mv will fail if already exists. + cp -R /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 @@ -4111,8 +4098,7 @@ _EOF_ fi - #RPi Cam Control - software_id=59 + software_id=59 # RPi Cam Control if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4177,7 +4163,7 @@ _EOF_ #Download_Install 'https://github.com/ArturSierzant/OMPD/archive/master.zip' /var/www Download_Install 'https://github.com/ArturSierzant/OMPD/archive/2a2909be2d7abc8cce7dff741f529c7d876d4094.zip' /var/www - rm -R /var/www/ompd &> /dev/null #Replace/upgrade existing installs + rm -R /var/www/ompd &> /dev/null # Replace/upgrade existing installs mv /var/www/OMPD* /var/www/ompd fi @@ -4280,11 +4266,10 @@ _EOF_ fi - #WEBIOPI requires RPIGPIO + # WebIOPi requires RPi GPIO (( ${aSOFTWARE_INSTALL_STATE[71]} == 1 )) && aSOFTWARE_INSTALL_STATE[69]=1 - #RPIGPIO - software_id=69 + software_id=69 # RPi GPIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4292,24 +4277,23 @@ _EOF_ fi - #WIRINGPI - software_id=70 + software_id=70 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - RPi + # RPi if (( $G_HW_MODEL < 10 )); then - # https://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot + # https://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot Download_Install 'https://dietpi.com/downloads/binaries/all/wiringPi-8d188fa.tar.gz' - # - Odroid's + # Odroids elif (( $G_HW_MODEL < 20 )); then Download_Install 'https://github.com/hardkernel/wiringPi/archive/master.zip' - # - BPiPro + # BPi Pro elif (( $G_HW_MODEL == 51 )); then Download_Install 'https://github.com/LeMaker/WiringBP/archive/bananapro.zip' @@ -4328,8 +4312,7 @@ _EOF_ fi - #RPII2C - software_id=72 + software_id=72 # RPi I2C if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4337,8 +4320,7 @@ _EOF_ fi - #nodered - software_id=122 + software_id=122 # Node-RED if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4353,8 +4335,7 @@ _EOF_ fi - #mosquitto - software_id=123 + software_id=123 # Mosquitto if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4370,7 +4351,19 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/blynkkk/blynk-server/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url' | cut -d \" -f 4) + # On Buster use non-Java8 binary, else Java 8 + local java='java8' + (( $G_DISTRO > 4 )) && java='[^a].' # Exclude "a" von jav[a]8 but allow "8" as this can be from version string + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) + + # Fallback URL + if [[ ! $INSTALL_URL_ADDRESS ]]; then + + INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.41.5/server-0.41.5-java8.jar' + (( $G_DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.41.5/server-0.41.5-java8.jar' + + fi + mkdir -p $G_FP_DIETPI_USERDATA/blynk/data G_THREAD_START wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar @@ -4383,20 +4376,19 @@ _EOF_ fi - #NAA Daemon - software_id=124 + software_id=124 # NAA Daemon if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Skip license for NAA daemon: + # Skip license for NAA daemon debconf-set-selections <<< 'networkaudiod networkaudiod/license note false' # Packages local apackages=() - # - Jessie - requires stretch packages - if (( $G_DISTRO == 3 )); then + # - Jessie: Requires Stretch packages + if (( $G_DISTRO < 4 )); then apackages+=('https://dietpi.com/downloads/binaries/all/gcc-6-base_6.3.0-6_armhf.deb') apackages+=('https://dietpi.com/downloads/binaries/all/libstdc++6_6.3.0-6_armhf.deb') @@ -4404,7 +4396,7 @@ _EOF_ fi # - ARMv6/7 - if (( $G_HW_ARCH <= 2 )); then + if (( $G_HW_ARCH < 3 )); then apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.5-39_armhf.deb') @@ -4420,24 +4412,24 @@ _EOF_ fi - # - Check online - for ((i=0; i<${#apackages[@]}; i++)) + # Check online + for i in "${apackages[@]}" do - G_CHECK_URL "${apackages[$i]}" + G_CHECK_URL "$i" done - # - Prereqs + # Pre-reqs DEPS_LIST='libasound2' # - Stretch+ additional packages (( $G_DISTRO > 3 )) && DEPS_LIST+=' gcc-6-base libstdc++6' - for ((i=0; i<${#apackages[@]}; i++)) + for i in "${apackages[@]}" do - no_check_url=1 Download_Install "${apackages[$i]}" + no_check_url=1 Download_Install "$i" done @@ -4448,8 +4440,7 @@ _EOF_ fi - #Tomcat8 - software_id=125 + software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4457,8 +4448,7 @@ _EOF_ fi - #WEBIOPI - software_id=71 + software_id=71 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4481,20 +4471,18 @@ _EOF_ fi - #DIETPICLOUDSHELL - software_id=62 + software_id=62 # DietPi-CloudShell if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #LCD panels can be enabled in Dietpi-config > display options - # XU4 enable cloudshell + # LCD panels can be enabled in Dietpi-config > display options + # - XU4 enable cloudshell (( $G_HW_MODEL == 11 )) && /DietPi/dietpi/func/dietpi-set_hardware lcdpanel odroid-cloudshell fi - #HAPROXY - software_id=98 + software_id=98 # HAProxy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4542,8 +4530,7 @@ _EOF_ fi - #WORDPRESS - software_id=55 + software_id=55 # Wordpress if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4564,8 +4551,7 @@ _EOF_ fi - #TIGHTVNCSERVER - software_id=27 + software_id=27 # TightVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4573,32 +4559,26 @@ _EOF_ fi - #VNC4SERVER - software_id=28 + software_id=28 # VNC4 Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing local package_list='vnc4server x11vnc' - # - Stretch+ - if (( $G_DISTRO >= 4 )); then - - package_list+=' tigervnc-common' - - fi + # Stretch+ + (( $G_DISTRO > 3 )) && package_list+=' tigervnc-common' G_AGI $package_list fi - #REALVNCSERVER - software_id=120 + software_id=120 # RealVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Available in Raspbian apt + # Available in Raspbian APT repo G_AGI realvnc-vnc-server fi @@ -4689,8 +4669,7 @@ _EOF_ fi - #PHPSYSINFO - software_id=64 + software_id=64 # phpSysInfo if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4700,8 +4679,7 @@ _EOF_ fi - #Ubooquity - software_id=80 + software_id=80 # Ubooquity if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4714,8 +4692,7 @@ _EOF_ fi - #PHPIMAGEGALLERY - software_id=56 + software_id=56 # PHP Image Gallery if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4723,8 +4700,7 @@ _EOF_ fi - #AMPACHE - software_id=40 + software_id=40 # Ampache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4747,8 +4723,7 @@ _EOF_ fi - #OPENVPNSERVER - software_id=97 + software_id=97 # OpenVPN Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4756,8 +4731,7 @@ _EOF_ fi - #PiVPN - software_id=117 + software_id=117 # PiVPN if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4767,14 +4741,14 @@ _EOF_ G_AGI lsb-release iptables-persistent dnsutils expect net-tools openvpn - # - Requires underpriv user: https://github.com/MichaIng/DietPi/issues/570#issuecomment-255588307 + # Requires underpriv user: https://github.com/MichaIng/DietPi/issues/570#issuecomment-255588307 useradd pivpn mkdir -p /home/pivpn wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh chmod +x pivpn_install.sh - # - Disable reboot + # Disable reboot sed -i '/shutdown[[:space:]]/d' pivpn_install.sh until ./pivpn_install.sh @@ -4810,8 +4784,8 @@ _EOF_ kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers' - #Odroid C1 - elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then #REMOVE v6.24 + # - Odroid C1: REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then kernel_packages='linux-image-armhf-odroid-c1 linux-headers-armhf-odroid-c1' @@ -4908,7 +4882,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior else # - Remove/Update existing certbot installer scripts - [[ -d /etc/certbot_scripts ]] && rm -R /etc/certbot_scripts + [[ -d '/etc/certbot_scripts' ]] && rm -R /etc/certbot_scripts Download_Install 'https://github.com/certbot/certbot/archive/master.zip' /etc mv /etc/certbot* /etc/certbot_scripts @@ -4985,8 +4959,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SHAIRPORTSYNC - software_id=37 + software_id=37 # Shairport-Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5000,8 +4973,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #PYDIO - software_id=48 + software_id=48 # Pydio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5027,8 +4999,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SQUEEZELITE - software_id=36 + software_id=36 # SqueezeLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5066,8 +5037,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #EMONHUB - software_id=99 + software_id=99 # EmonHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5077,14 +5047,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior pip install paho-mqtt pydispatcher - # - move everything to /etc/emonhub + # Move everything to /etc/emonhub rm -R /etc/emonhub mv emonhub-* /etc/emonhub fi - #RPIMONITOR - software_id=66 + software_id=66 # RPi Monitor if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5112,8 +5081,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #BAIKAL - software_id=57 + software_id=57 # BaiKal if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5123,8 +5091,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #MUMBLESERVER - software_id=43 + software_id=43 # Mumble Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5269,8 +5236,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #QBITTORRENT - software_id=46 + software_id=46 # qBitTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5363,7 +5329,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Web interface + # Web interface Download_Install 'https://github.com/ziahamza/webui-aria2/archive/master.zip' cp -R webui-aria2* /var/www/aria2 @@ -5371,8 +5337,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Medusa - software_id=116 + software_id=116 # Medusa if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5395,13 +5360,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SYNCTHING - software_id=50 + software_id=50 # Syncthing if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - if [[ -d /etc/syncthing ]]; then + if [[ -d '/etc/syncthing' ]]; then G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/etc/syncthing\" already exists. Download and install steps will be skipped. - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use the internal updater from WebUI. @@ -5436,8 +5400,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #TONIDO - software_id=134 + software_id=134 # Tonido if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5470,17 +5433,16 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #CHROMIUM - software_id=113 + software_id=113 # Chromium if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Pre-Req's + # Pre-reqs G_AG_CHECK_INSTALL_PREREQ lsb-release - #Stretch via apt - if (( $G_DISTRO >= 4 )); then + # Stretch+ via APT + if (( $G_DISTRO > 3 )); then if (( $G_HW_MODEL < 10 )); then @@ -5494,19 +5456,19 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior else - #armv6+ + # ARMv6/7 if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_armhf.deb' - #ARMv8 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_arm64.deb' fi - # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... + # Odroids, 'apt-get -f install' removes chromium package, rather than install required deps... if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )); then DEPS_LIST='libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7' @@ -5517,27 +5479,26 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Download_Install 'https://dietpi.com/downloads/binaries/all/chromium-l10n_52.0.2743.116-1-deb8u1.1_all.deb' - # armv6+ + # ARMv6/7 if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb' - # arm64 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb' fi - # - Prevent Debian repo from replacing our chromium packages: https://github.com/MichaIng/DietPi/issues/658 + # Prevent Debian repo from replacing our chromium packages: https://github.com/MichaIng/DietPi/issues/658 apt-mark hold chromium chromedriver fi fi - #MotionEye - software_id=136 + software_id=136 # MotionEye if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6953,19 +6914,19 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix # Run uninstall of old file servers, after install loop UNINSTALL_REQUIRED=1 - #No File server + # No File server if (( $INDEX_FILESERVER_TARGET == 0 )); then (( ${aSOFTWARE_INSTALL_STATE[94]} == 2 )) && aSOFTWARE_INSTALL_STATE[94]=-1 (( ${aSOFTWARE_INSTALL_STATE[96]} == 2 )) && aSOFTWARE_INSTALL_STATE[96]=-1 - #ProFTP + # ProFTP elif (( $INDEX_FILESERVER_TARGET == -1 )); then aSOFTWARE_INSTALL_STATE[94]=1 (( ${aSOFTWARE_INSTALL_STATE[96]} == 2 )) && aSOFTWARE_INSTALL_STATE[96]=-1 - #Samba + # Samba elif (( $INDEX_FILESERVER_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[96]=1 @@ -6973,7 +6934,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Update Current SSHSERVER index + # Update Current SSHSERVER index INDEX_FILESERVER_CURRENT=$INDEX_FILESERVER_TARGET fi @@ -7066,7 +7027,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O /root/.config/openbox/lxde-rc.xml # - Remove Lxrandr Menu item (monitor configuration tool as we set res in dietpi-config) - [[ -f /usr/share/applications/lxrandr.desktop ]] && rm /usr/share/applications/lxrandr.desktop + [[ -f '/usr/share/applications/lxrandr.desktop' ]] && rm /usr/share/applications/lxrandr.desktop # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf @@ -7137,8 +7098,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #WEBSERVER_APACHE - software_id=83 + software_id=83 # Apache Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7199,8 +7159,7 @@ _EOF_ fi - #WEBSERVER_NGINX - software_id=85 + software_id=85 # Nginx Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7225,17 +7184,16 @@ _EOF_ fi - #WEBSERVER_LIGHTTPD - software_id=84 + software_id=84 # Lighttpd Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #www path + # www path G_BACKUP_FP /etc/lighttpd/lighttpd.conf sed -i '/^server.document-root/c\server.document-root = "/var/www"' /etc/lighttpd/lighttpd.conf - #Configure fastcgi for PHP-FPM + # Configure fastcgi for PHP-FPM cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf # -*- depends: fastcgi -*- # /usr/share/doc/lighttpd/fastcgi.txt.gz @@ -7250,29 +7208,28 @@ fastcgi.server += ( ".php" => ) _EOF_ - #enable cgi/php + # Enable cgi/php lighttpd-enable-mod fastcgi lighttpd-enable-mod fastcgi-php - #Move default page + # Move default page mv /var/www/html/index.lighttpd.html /var/www/ [[ $(ls -A /var/www/html 2>&1) ]] || rm -R /var/www/html fi - #WEBSERVER_PHP - software_id=89 + software_id=89 # PHP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Apache2 has its own PHP module + # Apache2 has its own PHP module if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then # https://github.com/MichaIng/DietPi/issues/1144 local php_service='/lib/systemd/system/apache2.service' - # - Nginx and Lighttpd use PHP-FPM + # Nginx and Lighttpd use PHP-FPM elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then local php_service="/lib/systemd/system/${PHP_NAME}-fpm.service" @@ -7365,8 +7322,7 @@ _EOF_ fi - #WEBSERVER_MARIADB - software_id=88 + software_id=88 # MariaDB Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7395,8 +7351,7 @@ _EOF_ fi - #WEBSERVER_MYADMINPHP - software_id=90 + software_id=90 # phpMyAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7417,8 +7372,7 @@ _EOF_ fi - #WEBSERVER_REDIS - software_id=91 + software_id=91 # Redis Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7657,7 +7611,7 @@ url.redirect += ( fi # Cal/CardDAV redirects to ownCloud DAV endpoint - if [[ ! -f /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf ]]; then + if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: location = /.well-known/carddav { @@ -7813,7 +7767,7 @@ _EOF_ fi - software_id=114 #N extcloud + software_id=114 # Nextcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7923,7 +7877,7 @@ url.redirect += ( fi # Cal/CardDAV redirects to Nextcloud DAV endpoint - if [[ ! -f /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf ]]; then + if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: location = /.well-known/carddav { @@ -8121,8 +8075,8 @@ The install script will now exit. After applying one of the the above, rerun die if [[ -f '/lib/systemd/system/coturn.service' ]]; then # - Remove init.d service traces - [[ -f /etc/init.d/coturn ]] && rm /etc/init.d/coturn - [[ -f /etc/default/coturn ]] && rm /etc/default/coturn + [[ -f '/etc/init.d/coturn' ]] && rm /etc/init.d/coturn + [[ -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 @@ -8221,7 +8175,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_RUN_CMD systemctl start $MARIADB_SERVICE G_RUN_CMD systemctl start redis-server G_RUN_CMD ncc maintenance:mode --off - [[ -d /var/www/nextcloud/apps/spreed ]] || G_RUN_CMD ncc app:install spreed + [[ -d '/var/www/nextcloud/apps/spreed' ]] || G_RUN_CMD ncc app:install spreed ncc app:enable spreed # Adjust Nextcloud Talk settings to use coturn @@ -8242,9 +8196,9 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal Banner_Configuration - # Remove obsolete init.d service and it's environment file - [[ -f /etc/init.d/transmission-daemon ]] && rm /etc/init.d/transmission-daemon - [[ -f /etc/default/transmission-daemon ]] && rm /etc/default/transmission-daemon + # Remove obsolete init.d service and its environment file + [[ -f '/etc/init.d/transmission-daemon' ]] && rm /etc/init.d/transmission-daemon + [[ -f '/etc/default/transmission-daemon' ]] && rm /etc/default/transmission-daemon # Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518 mkdir -p /etc/systemd/system/transmission-daemon.service.d @@ -8278,8 +8232,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi - #PHPBB - software_id=54 + software_id=54 # phpBB Forum if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8307,12 +8260,12 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal >> $G_FP_DIETPI_USERDATA/.mpd_cache/state >> $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql # - Symlink from MPD defaults that applications may still expect/use. - [[ ! -e /var/lib/mpd/music || -L /var/lib/mpd/music ]] || mv -n /var/lib/mpd/music/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null - [[ ! -e /var/lib/mpd/playlists || -L /var/lib/mpd/playlists ]] || mv -n /var/lib/mpd/playlists/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null - [[ ! -e /var/lib/mpd/mpd.db || -L /var/lib/mpd/mpd.db ]] || mv -n /var/lib/mpd/mpd.db $G_FP_DIETPI_USERDATA/.mpd_cache/db_file - [[ ! -e /var/lib/mpd/state || -L /var/lib/mpd/state ]] || mv -n /var/lib/mpd/state $G_FP_DIETPI_USERDATA/.mpd_cache/state - [[ ! -e /var/lib/mpd/sticker.sql || -L /var/lib/mpd/sticker.sql ]] || mv -n /var/lib/mpd/sticker.sql $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql - [[ -d /var/lib/mpd ]] && rm -R /var/lib/mpd + [[ ! -e '/var/lib/mpd/music' || -L '/var/lib/mpd/music' ]] || mv -n /var/lib/mpd/music/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null + [[ ! -e '/var/lib/mpd/playlists' || -L '/var/lib/mpd/playlists' ]] || mv -n /var/lib/mpd/playlists/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null + [[ ! -e '/var/lib/mpd/mpd.db' || -L '/var/lib/mpd/mpd.db' ]] || mv -n /var/lib/mpd/mpd.db $G_FP_DIETPI_USERDATA/.mpd_cache/db_file + [[ ! -e '/var/lib/mpd/state' || -L '/var/lib/mpd/state' ]] || mv -n /var/lib/mpd/state $G_FP_DIETPI_USERDATA/.mpd_cache/state + [[ ! -e '/var/lib/mpd/sticker.sql' || -L '/var/lib/mpd/sticker.sql' ]] || mv -n /var/lib/mpd/sticker.sql $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql + [[ -d '/var/lib/mpd' ]] && rm -R /var/lib/mpd mkdir -p /var/lib/mpd ln -sf $G_FP_DIETPI_USERDATA/Music /var/lib/mpd/music ln -sf $G_FP_DIETPI_USERDATA/Music /var/lib/mpd/playlists @@ -8332,7 +8285,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi # MPD service/confs - [[ -f /etc/default/mpd ]] && rm /etc/default/mpd + [[ -f '/etc/default/mpd' ]] && rm /etc/default/mpd # - Upsteam systemd unit: https://github.com/MusicPlayerDaemon/MPD/blob/master/systemd/system/mpd.service.in # - Debian package systemd unit: https://deb.debian.org/debian/pool/main/m/mpd/ @@ -8408,8 +8361,7 @@ _EOF_ fi - # Proftpd - software_id=94 + software_id=94 # ProFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8421,8 +8373,7 @@ _EOF_ fi - #Samba Server - software_id=96 + software_id=96 # Samba Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8437,8 +8388,7 @@ _EOF_ fi - #vsFTPD - software_id=95 + software_id=95 # vsFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8453,8 +8403,7 @@ _EOF_ fi - #NFS_SERVER - software_id=109 + software_id=109 # NFS Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8465,8 +8414,7 @@ _EOF_ fi - #YMPD - software_id=32 + software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8492,8 +8440,7 @@ _EOF_ fi - #myMPD - software_id=148 + software_id=148 # myMPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8523,18 +8470,17 @@ _EOF_ mkdir -p /var/lib/mympd/smartpls /var/lib/mympd/tmp - #symlink music/libary folders used by mympd + # Symlink music/libary folders used by mympd if [[ $(readlink /usr/share/mympd/htdocs/library) != $G_FP_DIETPI_USERDATA/Music ]]; then - [[ -d /usr/share/mympd/htdocs/library ]] && rm -R /usr/share/mympd/htdocs/library + [[ -d '/usr/share/mympd/htdocs/library' ]] && rm -R /usr/share/mympd/htdocs/library ln -sf $G_FP_DIETPI_USERDATA/Music /usr/share/mympd/htdocs/library fi fi - #Roon Bridge - software_id=121 + software_id=121 # Roon Bridge if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8587,8 +8533,7 @@ _EOF_ fi - #Tomcat8 - software_id=125 + software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8596,8 +8541,7 @@ _EOF_ fi - #CAVA - software_id=119 + software_id=119 # CAVA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8632,8 +8576,7 @@ _EOF_ fi - #Mopidy - software_id=118 + software_id=118 # Mopidy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8643,7 +8586,7 @@ _EOF_ G_CONFIG_INJECT 'cache_dir[[:blank:]]*=' 'cache_dir = /mnt/dietpi_userdata/mopidy/cache' /etc/mopidy/mopidy.conf '\[core\]' # - Move existing home+data to dietpi_userdata, if not yet existent - if [[ -d /var/lib/mopidy && ! -d $G_FP_DIETPI_USERDATA/mopidy ]]; then + if [[ -d '/var/lib/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy ]]; then mv /var/lib/mopidy $G_FP_DIETPI_USERDATA/mopidy mkdir -p $G_FP_DIETPI_USERDATA/mopidy/data @@ -8658,7 +8601,7 @@ _EOF_ fi # - Move existing cache to dietpi_userdata, if not yet existent - if [[ -d /var/cache/mopidy && ! -d $G_FP_DIETPI_USERDATA/mopidy/cache ]]; then + if [[ -d '/var/cache/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy/cache ]]; then mv /var/cache/mopidy $G_FP_DIETPI_USERDATA/mopidy/cache @@ -8689,7 +8632,7 @@ _EOF_ userdel -r kodi &> /dev/null #Run Kodi as root - [[ -f /etc/default/kodi ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi + [[ -f '/etc/default/kodi' ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi #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 @@ -8697,14 +8640,13 @@ _EOF_ #Create .desktop SymLinks mkdir -p /root/Desktop - [[ -f /usr/share/applications/kodi.desktop ]] && rm /usr/share/applications/kodi.desktop + [[ -f '/usr/share/applications/kodi.desktop' ]] && rm /usr/share/applications/kodi.desktop G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/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 fi - #MINIDLNA - software_id=39 + software_id=39 # MiniDLNA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8747,10 +8689,10 @@ _EOF_ Banner_Configuration - #Failsafe: Directory required for "noip2 -C" to create the config file + # Failsafe: Directory required for "noip2 -C" to create the config file mkdir -p /usr/local/etc - #noip2 service file + # noip2 service file cat << _EOF_ > /etc/systemd/system/noip2.service [Unit] Description=noip2 (DietPi) @@ -8863,8 +8805,7 @@ _EOF_ fi - #dxx-rebirth - software_id=112 + software_id=112 # DDX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8906,8 +8847,7 @@ _EOF_ fi - #DIETPICAM - software_id=59 + software_id=59 # RPi Cam Control if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8938,7 +8878,7 @@ WantedBy=multi-user.target _EOF_ # - Replace confs with /var/www to /var/www/rpicam, once - if (( ! $(grep -ci -m1 '/rpicam' /etc/raspimjpeg) )); then + 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 @@ -9004,7 +8944,7 @@ WantedBy=multi-user.target _EOF_ # Add web.log to logrotate config - if [[ -f /etc/logrotate.d/deluged ]] && ! grep -q 'web.log' /etc/logrotate.d/deluged; then + if [[ -f '/etc/logrotate.d/deluged' ]] && ! grep -q 'web.log' /etc/logrotate.d/deluged; then echo -e "\n$(> /etc/logrotate.d/deluged sed -i '1,1s/daemon.log/web.log/' /etc/logrotate.d/deluged @@ -9032,9 +8972,9 @@ _EOF_ fi # Remove init.d service leftovers, installed by Debian APT package - [[ -f /etc/init.d/deluged ]] && rm /etc/init.d/deluged - [[ -f /etc/default/deluged ]] && rm /etc/default/deluged - [[ -d /var/lib/deluged ]] && rm -R /var/lib/deluged + [[ -f '/etc/init.d/deluged' ]] && rm /etc/init.d/deluged + [[ -f '/etc/default/deluged' ]] && rm /etc/default/deluged + [[ -d '/var/lib/deluged' ]] && rm -R /var/lib/deluged fi @@ -9060,8 +9000,7 @@ _EOF_ fi - #PIHOLE - software_id=93 + software_id=93 # Pi-hole if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9168,12 +9107,12 @@ _EOF_ fi - software_id=71 # WEBIOPI + software_id=71 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # autostart + # Autostart update-rc.d webiopi defaults fi @@ -9206,23 +9145,22 @@ _EOF_ fi - #HAPROXY - software_id=98 + software_id=98 # HAProxy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Create jail directory + # Create jail directory mkdir -p /var/lib/haproxy cat << _EOF_ > /etc/haproxy/haproxy.cfg global - #rsyslog is required for logging + # rsyslog is required for logging #log /var/log local0 #log /var/log local1 notice maxconn 64 - #Jail directory + # Jail directory chroot /var/lib/haproxy stats socket /run/haproxy.sock mode 660 level admin stats timeout 30s @@ -9273,7 +9211,7 @@ backend nodes server web02 127.0.0.1:9001 check server web03 127.0.0.1:9002 check -#Admin web page +# Admin web page listen stats bind *:1338 @@ -9283,7 +9221,7 @@ backend nodes stats auth admin:dietpi _EOF_ - #Add html error pages + # Add html error pages mkdir -p /etc/haproxy/errors local errorcode=0 @@ -9338,7 +9276,7 @@ _EOF_ Banner_Configuration - #Create mysql DB + # Create MariaDB database /DietPi/dietpi/func/create_mysql_db wordpress wordpress "$GLOBAL_PW" fi @@ -9394,8 +9332,7 @@ _EOF_ fi - #TIGHTVNCSERVER / VNC4SERVER / RealVNC - Shared setup - #software_id=27/28/120 + #software_id=27/28/120 # TightVNC/VNC4/RealVNC Server - Shared setup if (( ${aSOFTWARE_INSTALL_STATE[27]} == 1 || ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then @@ -9528,8 +9465,7 @@ _EOF_ fi - #VNC4SERVER / RealVNC - software_id=28 + software_id=28 # VNC4/RealVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} > 0 || ${aSOFTWARE_INSTALL_STATE[120]} > 0 )); then @@ -9582,7 +9518,7 @@ _EOF_ Banner_Configuration - # - Move DB/datadir to userdata location + # Move DB/datadir to userdata location mv /var/lib/influxdb $G_FP_DIETPI_USERDATA/ ln -sf $G_FP_DIETPI_USERDATA/influxdb /var/lib/influxdb @@ -9593,11 +9529,11 @@ _EOF_ Banner_Configuration - # - Move DB/plugins to userdata location, if not already existent + # Move DB/plugins to userdata location, if not already existent if [[ -d $G_FP_DIETPI_USERDATA/grafana ]]; then G_DIETPI-NOTIFY 2 "Existing database/plugin directory $G_FP_DIETPI_USERDATA/grafana found. Will not overwrite..." - [[ -e /var/lib/grafana ]] && rm -R /var/lib/grafana + [[ -e '/var/lib/grafana' ]] && rm -R /var/lib/grafana else @@ -9606,7 +9542,7 @@ _EOF_ fi ln -sf $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana - # - Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password + # Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password GCI_PASSWORD=1 GCI_PRESERVE=1 G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini G_CONFIG_INJECT 'http_port = ' 'http_port = 3001' /etc/grafana/grafana.ini @@ -9638,8 +9574,7 @@ _EOF_ fi - #PHPSYSINFO - software_id=64 + software_id=64 # phpSysInfo if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9649,8 +9584,7 @@ _EOF_ fi - #PHPIMAGEGALLERY - software_id=56 + software_id=56 # PHP Image Gallery if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9672,8 +9606,7 @@ _EOF_ fi - #AMPACHE - software_id=40 + software_id=40 # Ampache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9692,15 +9625,14 @@ _EOF_ fi - #OPENVPNSERVER - software_id=97 + software_id=97 # OpenVPN Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration local key_size=2048 - #Start Cert/Key generation. + # Start Cert/Key generation. cp -a /usr/share/easy-rsa/ /etc/openvpn mkdir -p /etc/openvpn/easy-rsa/keys cat << _EOF_ >> /etc/openvpn/easy-rsa/vars @@ -9714,11 +9646,11 @@ export KEY_OU='DietPi' export KEY_NAME='DietPi_OpenVPN_Server' _EOF_ - #Create Server Cert Auth + # Create Server Cert Auth G_DIETPI-NOTIFY 2 'Generating unique OpenVPN certificates and keys. Please wait...\n' openssl dhparam -out /etc/openvpn/dh${key_size}.pem $key_size - #Build Server certs/keys + # Build Server certs/keys chmod -R +x /etc/openvpn/easy-rsa cd /etc/openvpn/easy-rsa # - https://github.com/MichaIng/DietPi/issues/1450#issuecomment-362608574 @@ -9729,16 +9661,16 @@ _EOF_ ./build-ca --batch DietPi_OpenVPN_Server ./build-key-server --batch DietPi_OpenVPN_Server - #Copy Server cert/keys + # Copy Server cert/keys cp -a /etc/openvpn/easy-rsa/keys/{DietPi_OpenVPN_Server.crt,DietPi_OpenVPN_Server.key,ca.crt} /etc/openvpn/ - #Build client cert/keys + # Build client cert/keys ./build-key --batch DietPi_OpenVPN_Client cd /tmp/$G_PROGRAM_NAME - #End Cert/Key generation. + # End Cert/Key generation. - #Server config + # Server config cat << _EOF_ > /etc/openvpn/server.conf port 1194 proto udp @@ -9763,19 +9695,19 @@ persist-key persist-tun verb 3 -#Web Forwarding (uncomment to enable) +# Web Forwarding (uncomment to enable) #push "redirect-gateway" #push "dhcp-option DNS 10.8.0.1" _EOF_ - #Client config + # Client config cat << _EOF_ > /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn client proto udp dev tun -#Ip/Domain name of DietPi system, running OpenVPN server. +# Ip/Domain name of DietPi system, running OpenVPN server. remote mywebsite.com 1194 resolv-retry infinite @@ -9793,7 +9725,7 @@ verb 3 _EOF_ - #Unified client file. Add DietPi generated certs/keys. + # Unified client file. Add DietPi generated certs/keys. # - Add Server Cert auth echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn cat /etc/openvpn/ca.crt >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn @@ -9807,16 +9739,16 @@ _EOF_ cat /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.key >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn - #Copy client file to userdata location + # Copy client file to userdata location cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn $G_FP_DIETPI_USERDATA/ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ - #Enable IP forwarding + # Enable IP forwarding echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-openvpn.conf sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1 - #Web Fowarding (Setup IPtables, must also be run during boot) + # Web Fowarding (Setup IPtables, must also be run during boot) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(sed -n 3p /DietPi/dietpi/.network)" -j MASQUERADE fi @@ -10132,13 +10064,12 @@ _EOF_ fi - #SHAIRPORTSYNC - software_id=37 + software_id=37 # Shairport-Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Enable SOXR by default: + # Enable SOXR by default: G_BACKUP_FP /usr/local/etc/shairport-sync.conf cat << _EOF_ > /usr/local/etc/shairport-sync.conf general = @@ -10166,15 +10097,14 @@ alsa = }; _EOF_ - #Create shairport user + # Create shairport user useradd -rM shairport-sync -G audio -s /usr/sbin/nologin chmod +x /usr/local/bin/shairport-sync fi - #PYDIO - software_id=48 + software_id=48 # Pydio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10247,8 +10177,7 @@ _EOF_ fi - #SQUEEZELITE - software_id=36 + software_id=36 # SqueezeLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10262,8 +10191,7 @@ _EOF_ fi - #EMONHUB - software_id=99 + software_id=99 # EmonHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10278,7 +10206,7 @@ _EOF_ chmod +x -R /etc/emonhub - #RPI 3 - Must disable BCM BT to recover UART 0 + # RPI 3 - Must disable BCM BT to recover UART 0 if (( $G_HW_MODEL == 3 )); then # - Add DToverlay to disable bluetooth @@ -10308,8 +10236,7 @@ _EOF_ fi - #RPIMONITOR - software_id=66 + software_id=66 # RPi Monitor if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10400,8 +10327,7 @@ _EOF_ fi - #BAIKAL - software_id=57 + software_id=57 # BaiKal if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10456,29 +10382,27 @@ location = /.well-known/caldav { fi - #MUMBLESERVER - software_id=43 + software_id=43 # Mumble Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Cap total connections + # Cap total connections local max_users=$(( $G_HW_CPU_CORES * 8 )) sed -i "/users=/c\users=$max_users" /etc/mumble-server.ini - #Name the root channel + # Name the root channel sed -i '/registerName=/c\registerName=DietPi Mumble Server' /etc/mumble-server.ini - #Disable DB logging + # Disable DB logging sed -i '/logdays=/c\logdays=-1' /etc/mumble-server.ini - #Set Superuser passwd: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2024#p8084 + # Set Superuser passwd: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2024#p8084 murmurd -ini /etc/mumble-server.ini -supw "$GLOBAL_PW" fi - #EMBYSERVER - software_id=41 + software_id=41 # Emby Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10498,13 +10422,14 @@ location = /.well-known/caldav { fi - #CUBERITE - software_id=52 + software_id=52 # Cuberite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM cuberite -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd cuberite &> /dev/null && usercmd='usermod' + $usercmd cuberite -G dietpi -d $G_FP_DIETPI_USERDATA/cubrite -s $(command -v nologin) cat << _EOF_ > /etc/systemd/system/cuberite.service [Unit] @@ -10521,7 +10446,7 @@ ExecStart=$G_FP_DIETPI_USERDATA/cubrite/Cuberite --service WantedBy=multi-user.target _EOF_ - #WebUI settings + # WebUI settings cat << _EOF_ > $G_FP_DIETPI_USERDATA/cubrite/webadmin.ini [User:admin] Password=$GLOBAL_PW @@ -10623,7 +10548,7 @@ _EOF_ useradd -rm qbittorrent -p "$GLOBAL_PW" -G dietpi -s $(command -v nologin) - # - conf. + # Config mkdir -p /home/qbittorrent/.config/qBittorrent G_BACKUP_FP /home/qbittorrent/.config/qBittorrent/qBittorrent.conf cat << _EOF_ > /home/qbittorrent/.config/qBittorrent/qBittorrent.conf @@ -10704,10 +10629,10 @@ enabled=false program= _EOF_ - #Jessie WebUI\Password_ha1 breaks login with m5dsum generated pw, revert to default 'adminadmin': https://github.com/MichaIng/DietPi/issues/1499#issuecomment-364769146 + # - Jessie WebUI\Password_ha1 breaks login with m5dsum generated pw, revert to default 'adminadmin': https://github.com/MichaIng/DietPi/issues/1499#issuecomment-364769146 (( $G_DISTRO == 3 )) && sed -i '/Password_ha1=/d' /root/.config/qBittorrent/qBittorrent.conf - # - service + # Service cat << _EOF_ > /etc/systemd/system/qbittorrent.service [Unit] Description=qBittorrent (DietPi) @@ -11065,38 +10990,37 @@ _EOF_ fi - #SYNCTHING - software_id=50 + software_id=50 # Syncthing if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Generate dir's + # Generate dirs mkdir -p $G_FP_DIETPI_USERDATA/syncthing mkdir -p $G_FP_DIETPI_USERDATA/syncthing_data - # Logs/Binary + # - Logs/Binary mkdir -p /var/log/syncthing >> /var/log/syncthing/syncthing.log chown -R dietpi:dietpi /var/log/syncthing chown -R dietpi:dietpi /etc/syncthing - # - Run Syncthing to create cert/config and exit + # Run Syncthing to create cert/config and exit /etc/syncthing/syncthing -generate=$G_FP_DIETPI_USERDATA/syncthing - # - Disable automatic upgrades + # Disable automatic upgrades sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Allow external access (LAN). + # Allow external access (LAN). sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Set default folder + # Set default folder sed -i '/label=\"Default Folder/c\ ' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Disable browser starting + # Disable browser starting sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Enable filesystem watcher (previously inotify) + # Enable filesystem watcher (previously inotify) sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' $G_FP_DIETPI_USERDATA/syncthing/config.xml # Services @@ -11133,8 +11057,7 @@ _EOF_ fi - #Medusa - software_id=116 + software_id=116 # Medusa if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11148,15 +11071,16 @@ _EOF_ fi - #TONIDO - software_id=134 + software_id=134 # Tonido if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm tonido -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rm' + getent passwd tonido &> /dev/null && usercmd='usermod' + $usercmd tonido -G dietpi -s $(command -v nologin) - #service + # Service cat << _EOF_ > /etc/systemd/system/tonido.service [Unit] Description=Tonido (DietPi) @@ -11165,24 +11089,24 @@ Description=Tonido (DietPi) User=tonido Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/tonido -ExecStart=/bin/bash -c 'export LD_LIBRARY_PATH=$G_FP_DIETPI_USERDATA/tonido; export TONIDODIR=$G_FP_DIETPI_USERDATA/tonido; ./tonidoconsole' +ExecStart=/bin/dash -c 'export LD_LIBRARY_PATH=$G_FP_DIETPI_USERDATA/tonido; export TONIDODIR=$G_FP_DIETPI_USERDATA/tonido; ./tonidoconsole' [Install] WantedBy=multi-user.target _EOF_ - # - userdirs + # User dirs mkdir -p $G_FP_DIETPI_USERDATA/tonido/sync mkdir -p $G_FP_DIETPI_USERDATA/tonido/syncdata - # symlink + # - Symlink cp -R /home/tonido/tonido $G_FP_DIETPI_USERDATA/ &> /dev/null rm -R /home/tonido/tonido &> /dev/null ln -sf $G_FP_DIETPI_USERDATA/tonido /home/tonido/tonido ln -sf $G_FP_DIETPI_USERDATA/tonido/sync /home/tonido/TonidoSync ln -sf $G_FP_DIETPI_USERDATA/tonido/syncdata /home/tonido/TonidoSyncData - # - armv7 switch + # ARMv7 switch if (( $G_HW_ARCH == 2 )); then sed -i 's/armv6l/armv7l/' $G_FP_DIETPI_USERDATA/tonido/manifest.xml @@ -11197,7 +11121,7 @@ _EOF_ Banner_Configuration - #Allow root, start maximized and disable sandbox under root (blank screen without) + # Allow root, start maximized and disable sandbox under root (blank screen without) local export_options="export CHROMIUM_FLAGS=\"\$CHROMIUM_FLAGS \ --test-type \ --no-sandbox \ @@ -11210,10 +11134,10 @@ _EOF_ --profiler-timing=0 \ --disable-composited-antialiasing " - #RPi + # RPi if (( $G_HW_MODEL < 10 )); then - # OpenGL + # - OpenGL #if (( $G_HW_MODEL >= 2 )); then # Hangs xinit: https://github.com/MichaIng/DietPi/issues/834 @@ -11222,12 +11146,12 @@ _EOF_ #fi : - #OpenGL + # OpenGL elif (( $G_HW_MODEL == 21 )); then : - #GLES + # GLES else export_options+='--use-gl=egl' @@ -11237,28 +11161,25 @@ _EOF_ export_options+="\"" mkdir -p /etc/chromium.d - cat << _EOF_ > /etc/chromium.d/custom_flags -$export_options -_EOF_ + echo "$export_options" > /etc/chromium.d/custom_flags - # Chromium 60+ + # Chromium 60+ cp /etc/chromium.d/custom_flags /root/.chromium-browser.init - #Symlink to desktop - # * for RPi Stretch due to chromium-browser.desktop + # Symlink to desktop + # - * for RPi Stretch due to chromium-browser.desktop ln -sf /usr/share/applications/chromium*.desktop /root/Desktop/chromium.desktop &> /dev/null - # - Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 - + # 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 #!/bin/bash -#Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 +# 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 # Command line switches https://peter.sh/experiments/chromium-command-line-switches/ -# --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN -# --pull-to-refresh=1 -# --ash-host-window-bounds="400,300" +# --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN +# --pull-to-refresh=1 +# --ash-host-window-bounds="400,300" # - Resolution to use for kiosk mode, should ideally match current system resolution RES_X=\$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -11272,7 +11193,7 @@ CHROMIUM_OPTS="--kiosk --test-type --window-size=\$RES_X,\$RES_Y --start-fullscr URL=\$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') CHROMIUM_OPTS+=" --homepage \$URL" -#Find absolute filepath location of Chromium binary. +# Find absolute filepath location of Chromium binary. FP_CHROMIUM=\$(command -v chromium) if [[ ! \$FP_CHROMIUM ]]; then @@ -11287,8 +11208,7 @@ _EOF_ fi - #O!MPD - software_id=129 + software_id=129 # O!MPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11310,23 +11230,22 @@ _EOF_ fi - #IceCast + DarkIce - software_id=135 + software_id=135 # IceCast + DarkIce if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #icecast set passwords: + # IceCast set passwords sed -i '/\/c\\'"$GLOBAL_PW"'\<\/source-password\>' /etc/icecast2/icecast.xml sed -i '/\/c\\'"$GLOBAL_PW"'\<\/relay-password\>' /etc/icecast2/icecast.xml - # Create random password + # - Create random password local admin_password=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1) sed -i "/\/c\\$admin_password\<\/admin-password\>" /etc/icecast2/icecast.xml sed -i '/ENABLE=/c\ENABLE=true' /etc/default/icecast2 - #Darkice + # DarkIce local input_device_index=$(arecord -l | mawk '/card/ {print $2;exit}' | sed 's/://') cat << _EOF_ > /etc/darkice.cfg @@ -11357,7 +11276,7 @@ public = no #localDumpFile = $G_FP_DIETPI_USERDATA/darkice_recording.ogg _EOF_ - #Systemd service for Darkice + # Systemd service for DarkIce rm /etc/init.d/darkice cat << _EOF_ > /etc/systemd/system/darkice.service [Unit] @@ -11374,8 +11293,7 @@ _EOF_ fi - #mosquitto - software_id=123 + software_id=123 # Mosquitto if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11395,7 +11313,7 @@ _EOF_ fi - software_id=131 # Blynk + software_id=131 # Blynk Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11406,11 +11324,16 @@ _EOF_ local config_file_url_address='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' G_RUN_CMD wget "$config_file_url_address" -O $G_FP_DIETPI_USERDATA/blynk/server.properties G_CONFIG_INJECT 'data.folder=' "data.folder=$G_FP_DIETPI_USERDATA/blynk/data" $G_FP_DIETPI_USERDATA/blynk/server.properties + # - Log to RAMlog + mkdir -p /var/log/blynk + G_CONFIG_INJECT 'logs.folder=' 'logs.folder=/var/log/blynk' $G_FP_DIETPI_USERDATA/blynk/server.properties fi # User - useradd -rM blynk -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd blynk &> /dev/null && usercmd='usermod' + $usercmd blynk -G dietpi -d $G_FP_DIETPI_USERDATA/blynk -s /usr/sbin/nologin # Service cat << _EOF_ > /etc/systemd/system/blynkserver.service @@ -11421,7 +11344,8 @@ After=network.target [Service] User=blynk Group=dietpi -ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar -serverConfig $G_FP_DIETPI_USERDATA/blynk/server.properties +WorkingDirectory=$G_FP_DIETPI_USERDATA/blynk +ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar [Install] WantedBy=multi-user.target @@ -11429,8 +11353,7 @@ _EOF_ fi - #MotionEye - software_id=136 + software_id=136 # MotionEye if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11454,8 +11377,7 @@ _EOF_ fi - #CloudPrint - software_id=137 + software_id=137 # CloudPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11567,15 +11489,14 @@ _EOF_ fi - #spotifyconnectweb - software_id=141 + software_id=141 # Spotify Connect Web if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration cat << _EOF_ > /etc/systemd/system/spotify-connect-web.service [Unit] -Description=spotify-connect-web (DietPi) +Description=Spotify Connect Web (DietPi) After=sound.target [Service] @@ -11588,8 +11509,7 @@ _EOF_ fi - #couchpotato - software_id=142 + software_id=142 # CouchPotato if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11606,8 +11526,7 @@ _EOF_ fi - #Koel - software_id=143 + software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11652,13 +11571,14 @@ _EOF_ fi - #Sonarr - software_id=144 + software_id=144 # Sonarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM sonarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd sonarr &> /dev/null && usercmd='usermod' + $usercmd sonarr -G dietpi -d $G_FP_DIETPI_USERDATA/sonarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/sonarr @@ -11686,13 +11606,14 @@ _EOF_ fi - #Radarr - software_id=145 + software_id=145 # Radarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM radarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd radarr &> /dev/null && usercmd='usermod' + $usercmd radarr -G dietpi -d $G_FP_DIETPI_USERDATA/radarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/radarr @@ -11720,13 +11641,14 @@ _EOF_ fi - #Lidarr - software_id=106 + software_id=106 # Lidarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM lidarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd lidarr &> /dev/null && usercmd='usermod' + $usercmd lidarr -G dietpi -d $G_FP_DIETPI_USERDATA/lidarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/lidarr @@ -11744,7 +11666,7 @@ ExecStart=/usr/bin/mono -O=-aot /opt/Lidarr/Lidarr.exe -nobrowser -data=$G_FP_DI WantedBy=multi-user.target _EOF_ - # - logs to RAM + # Logs to RAM rm -R $G_FP_DIETPI_USERDATA/lidarr/logs* &> /dev/null mkdir -p /var/log/lidarr ln -sf /var/log/lidarr $G_FP_DIETPI_USERDATA/lidarr/logs @@ -11924,7 +11846,7 @@ _EOF_ fi - software_id=154 # RoonServer + software_id=154 # Roon Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12880,15 +12802,19 @@ _EOF_ fi - software_id=131 + software_id=131 # Blynk Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - [[ -f /etc/systemd/system/blynkserver.service ]] && rm /etc/systemd/system/blynkserver.service - [[ -d $G_FP_DIETPI_USERDATA/blynk ]] && rm -R $G_FP_DIETPI_USERDATA/blynk - [[ -d /etc/blynkserver ]] && rm -R /etc/blynkserver #pre v6.19 + if [[ -f '/etc/systemd/system/blynkserver.service' ]]; then + + systemctl disable blynkserver + rm /etc/systemd/system/blynkserver.service + fi userdel -rf blynk + [[ -d $G_FP_DIETPI_USERDATA/blynk ]] && rm -R $G_FP_DIETPI_USERDATA/blynk + [[ -d '/etc/blynkserver' ]] && rm -R /etc/blynkserver # Pre-v6.19 fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 84f720e41c..36754e3c8e 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -10,7 +10,6 @@ #//////////////////////////////////// # # Usage: - # FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_software' AVAIABLE_COMMANDS=" Available commands: @@ -23,10 +22,9 @@ $FP_SCRIPT ntpd-mode [0-4] configures time sync mode (eg: daily/hourly/daemon) $FP_SCRIPT verify_dietpi.txt Verifies dietpi.txt entries, adds missing entries if required $FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=optional set X as global password for future dietpi-software installations and \"root\" + \"dietpi\" login passwords. $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi specific content, and, DietPi userdata directory for software installs -" - #//////////////////////////////////// +" #//////////////////////////////////// - #Grab inputs + # Grab inputs INPUT_MODE_NAME=$1 INPUT_MODE_VALUE=$2 @@ -35,13 +33,13 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe INPUT_ADDITIONAL_3=$5 INPUT_ADDITIONAL_4=$6 - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Set_software' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- EXIT_CODE=0 @@ -100,18 +98,18 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe } #///////////////////////////////////////////////////////////////////////////////////// - # Set Apt Mirror + # Set APT Mirror #///////////////////////////////////////////////////////////////////////////////////// AptMirror_Main(){ if [[ $INPUT_MODE_VALUE ]]; then - # - Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 + # Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 if (( $G_HW_ARCH == 3 && $G_DISTRO < 4 )); then INPUT_MODE_VALUE='http://archive.debian.org/debian/' - # - Set defaults? + # Set defaults? elif [[ $INPUT_MODE_VALUE == 'default' ]]; then if (( $G_HW_MODEL < 10 )); then @@ -126,16 +124,16 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe fi - # - Set Raspbian + # Set Raspbian if (( $G_HW_MODEL < 10 )); then echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free rpi" > /etc/apt/sources.list echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list - # Update dietpi.txt entry + # - Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt - # - Set Debian + # Set Debian else cat << _EOF_ > /etc/apt/sources.list @@ -145,7 +143,7 @@ deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ - # Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 + # - Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 if (( $G_DISTRO < 4 )); then # - Jessie APT reports warning on httpS://deb.debian.org @@ -155,14 +153,14 @@ _EOF_ # - ARMv8 has been dropped from security repo (( $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list - # Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 + # - Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 elif (( $G_DISTRO > 4 )); then sed -i '/backports/d' /etc/apt/sources.list fi - # Update dietpi.txt entry + # - Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_DEBIAN_MIRROR=' "CONFIG_APT_DEBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt fi @@ -193,12 +191,12 @@ _EOF_ local ntp_mirror_entry='Servers='$ntp_mirror # - Default, lets timesyncd use DHCP server (Stretch+ only) or fallback to debian.pool.ntp.org. - if [[ ${ntp_mirror,,} == default ]]; then + if [[ ${ntp_mirror,,} == 'default' ]]; then ntp_mirror_entry='#Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org' # - Gateway, auto detect local gateway(s) (router) to use as NTP server. - elif [[ ${ntp_mirror,,} == gateway ]]; then + elif [[ ${ntp_mirror,,} == 'gateway' ]]; then # NB: Turn output output into single line string via echo local gateway=$(echo $(ip r | mawk '/^default/ {print $3}')) @@ -270,7 +268,7 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # allo + # Allo #///////////////////////////////////////////////////////////////////////////////////// Allo_Main(){ @@ -458,7 +456,7 @@ _EOF_ chown -R sabnzbd:dietpi $G_FP_DIETPI_USERDATA/downloads/{,in}complete # - Blynk - chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk + chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk /var/log/blynk # - Pi-hole # - NB: Git requies special permissions to allow "pihole -up". @@ -481,22 +479,20 @@ _EOF_ mkdir -p /home useradd -m -s /bin/bash "$INPUT_MODE_VALUE" -p "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - # Copy existing profile/bashrc + # Copy existing profile/bashrc cp /root/.profile /home/"$INPUT_MODE_VALUE"/ cp /root/.bashrc /home/"$INPUT_MODE_VALUE"/ chown -R "$INPUT_MODE_VALUE":"$INPUT_MODE_VALUE" /home/"$INPUT_MODE_VALUE" - # Allow sudo without pw + # Allow sudo without pw if ! grep -q "^$INPUT_MODE_VALUE[[:space:]]" /etc/sudoers.d/dietpi; then - cat << _EOF_ >> /etc/sudoers.d/dietpi -$INPUT_MODE_VALUE ALL=NOPASSWD: ALL -_EOF_ + echo "$INPUT_MODE_VALUE ALL=NOPASSWD: ALL" >> /etc/sudoers.d/dietpi fi - # Same groups as user pi + # Same groups as user pi local group_array=() group_array+=('input') group_array+=('netdev') @@ -514,13 +510,13 @@ _EOF_ group_array+=('dialout') group_array+=('adm') - # + allow access to www-data + # Allow access to www-data group_array+=('www-data') - for ((i=0; i<${#group_array[@]}; i++)) + for i in ${group_array[@]} do - usermod -a -G "${group_array[$i]}" "$INPUT_MODE_VALUE" + usermod -a -G $i "$INPUT_MODE_VALUE" done @@ -538,12 +534,11 @@ _EOF_ if [[ $INPUT_MODE_VALUE ]]; then - # - Delete $INPUT_MODE_VALUE - userdel -f "$INPUT_MODE_VALUE" - rm -R "/home/$INPUT_MODE_VALUE" + # Delete $INPUT_MODE_VALUE + userdel -rf "$INPUT_MODE_VALUE" - # - Remove from sudoers - sed -i "/^$INPUT_MODE_VALUE[[:space:]]/d" /etc/sudoers.d/dietpi + # Remove from sudoers + sed -i "/^$INPUT_MODE_VALUE[[:blank:]]/d" /etc/sudoers.d/dietpi else @@ -560,8 +555,7 @@ _EOF_ [[ $gitbranch ]] || gitbranch='master' INSTALL_URL="https://raw.githubusercontent.com/MichaIng/DietPi/$gitbranch/dietpi.txt" - G_CHECK_URL "$INSTALL_URL" - if (( ! $? )); then + if G_CHECK_URL "$INSTALL_URL"; then G_DIETPI-NOTIFY 0 'Patching dietpi.txt' l_message='Downloading current dietpi.txt' G_RUN_CMD wget "$INSTALL_URL" -O /tmp/dietpi.txt_patch @@ -610,16 +604,16 @@ _EOF_ local pw_dietpi_software='' local pw_root_dietpi_users='' - #Automation/input mode, set and then apply input password to both dietpi-software and root/dietpi user passwords. + # Automation/input mode, set and then apply input password to both dietpi-software and root/dietpi user passwords. if [[ $INPUT_MODE_VALUE ]]; then pw_dietpi_software=$INPUT_MODE_VALUE pw_root_dietpi_users=$INPUT_MODE_VALUE - #Prompt to change + # Prompt to change else - #DietPi-Software PW + # DietPi-Software PW G_WHIP_YESNO 'Do you want to adjust the default global password for DietPi-Software installations and new unix users? We especially recommend to change the default password "dietpi". This does not affect any existing unix user login.\n NB: This password will be saved and encrypted within /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin to be useable by DietPi scripts for e.g. web application and database logins. We highly recommend to adjust all passwords for web services and new unix users independently afterwards.' if (( ! $? )); then @@ -630,7 +624,7 @@ NB: This password will be saved and encrypted within /var/lib/dietpi/dietpi-soft fi - #Root/DietPi user PW + # Root/DietPi user PW G_WHIP_YESNO 'Change unix user passwords?\n\nDietPi has two accounts by default "root" and "dietpi". On first boot, both share the global password "dietpi", respectively the one set in dietpi.txt.\n It is highly recommended to change this password, ideally, it should be different than the global DietPi-Software password.\n\nWould you like to change the login passwords for "root" and "dietpi"?' if (( ! $? )); then @@ -643,7 +637,7 @@ It is highly recommended to change this password, ideally, it should be differen fi - #Apply | dietpi-software PW + # Apply | dietpi-software PW if [[ $pw_dietpi_software ]]; then # - Nullify automated PW @@ -662,7 +656,7 @@ It is highly recommended to change this password, ideally, it should be differen fi - #Apply | Root/DietPi users PW + # Apply | Root/DietPi users PW if [[ $pw_root_dietpi_users ]]; then chpasswd <<< "root:$pw_root_dietpi_users" @@ -677,8 +671,7 @@ It is highly recommended to change this password, ideally, it should be differen # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - #info - + # Info G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" #----------------------------------------------------------------------------------- diff --git a/dietpi/patch_file b/dietpi/patch_file index 4c4a939ac6..a970af6f6b 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -271,9 +271,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 '/var/www/dietpicam' ]] && mv /var/www/dietpicam /var/www/rpicam [[ -d $G_FP_DIETPI_USERDATA/dietpicam ]] && mv $G_FP_DIETPI_USERDATA/dietpicam $G_FP_DIETPI_USERDATA/rpicam - [[ -e /var/www/rpicam/media ]] && rm /var/www/rpicam/media + [[ -e '/var/www/rpicam/media' ]] && rm /var/www/rpicam/media /DietPi/dietpi/dietpi-software reinstall 59 132 @@ -430,7 +430,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Remove minutely running "make_nas_processes_faster" cron job, present on images with preinstalled OMV: https://github.com/MichaIng/DietPi/issues/1654 - [[ -f /etc/cron.d/make_nas_processes_faster ]] && rm /etc/cron.d/make_nas_processes_faster + [[ -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 (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[104\]=2' /DietPi/dietpi/.installed; then @@ -492,12 +492,12 @@ _EOF_ if { (( $G_HW_MODEL < 10 )) && ! grep -q 'allo-piano-dac' /DietPi/config.txt; } || { (( $G_HW_MODEL == 70 )) && ! grep -q 'allo-piano-dac' /etc/modules; }; then - [[ -d /lib/firmware/allo ]] && rm -R /lib/firmware/allo + [[ -d '/lib/firmware/allo' ]] && rm -R /lib/firmware/allo fi #------------------------------------------------------------------------------- #RPi UART: https://github.com/MichaIng/DietPi/issues/1759 - if [[ -f /DietPi/config.txt ]]; then + if [[ -f '/DietPi/config.txt' ]]; then local serial_state=$(grep -m1 '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') G_CONFIG_INJECT 'enable_uart=' "enable_uart=$serial_state" /DietPi/config.txt @@ -1010,7 +1010,7 @@ _EOF_ #------------------------------------------------------------------------------- #Update IPv6 handling: https://github.com/MichaIng/DietPi/issues/2027 # - Advice user to re-enable IPv6 on kernel level - if [[ ! -d /proc/sys/net/ipv6 ]]; then + if [[ ! -d '/proc/sys/net/ipv6' ]]; then G_WHIP_MENU_ARRAY=( @@ -1357,7 +1357,7 @@ _EOF_ # - Samba: Link disk cache to RAM: https://github.com/MichaIng/DietPi/issues/2396 if grep -q '^aSOFTWARE_INSTALL_STATE\[96\]=2' /DietPi/dietpi/.installed; then - [[ -e /var/cache/samba ]] && rm -R /var/cache/samba + [[ -e '/var/cache/samba' ]] && rm -R /var/cache/samba mkdir -p /var/run/samba-cache ln -s /var/run/samba-cache /var/cache/samba echo 'd /var/run/samba-cache - - - - -' > /etc/tmpfiles.d/dietpi-samba_cache.conf @@ -1429,7 +1429,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix #Clear install state for Medusa (( $G_DIETPI_INSTALL_STAGE == 2 )) && [[ ! -d $G_FP_DIETPI_USERDATA/medusa ]] && G_CONFIG_INJECT 'aSOFTWARE_INSTALL_STATE\[116\]=' 'aSOFTWARE_INSTALL_STATE[116]=0' /DietPi/dietpi/.installed # - Inform user about SickRage being replaced by Medusa - if [[ -d /etc/sickrage || -d $G_FP_DIETPI_USERDATA/sickrage ]]; then + if [[ -d '/etc/sickrage' || -d $G_FP_DIETPI_USERDATA/sickrage ]]; then G_WHIP_MSG '[WARNING] We found an existing SickRage install on your system\n We already dropped SickRage from DietPi-Software install options with v6.18, now it has been fully replaced with "Medusa", an older stabilized fork. @@ -1755,8 +1755,8 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' - - #Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs. + #----------------------------------------------------------------------- + # Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs. elif (( $G_HW_MODEL == 10 )); then G_WHIP_MSG '[INFO] Odroid C1 image has been updated to Stretch. Please upgrade to continue limited support for this device:\nhttps://github.com/MichaIng/DietPi/issues/2561#issuecomment-488685121' @@ -1800,6 +1800,16 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' # Add /etc/network/interfaces.d/ drop-in config support grep -q 'interfaces\.d' /etc/network/interfaces || sed -i '1i\source interfaces.d/*' /etc/network/interfaces #----------------------------------------------------------------------- + # Blynk: Fix logging and move to RAMlog: https://github.com/MichaIng/DietPi/pull/2779 + if [[ -f '/etc/systemd/system/blynkserver.service' && -f $G_FP_DIETPI_USERDATA/blynk/server.properties ]]; then + + G_CONFIG_INJECT 'WorkingDirectory=' "WorkingDirectory=$G_FP_DIETPI_USERDATA/blynk" /etc/systemd/system/blynkserver.service '\[Service\]' + mkdir -p /var/log/blynk + chown -R blynk:dietpi /var/log/blynk + G_CONFIG_INJECT 'logs.folder=' 'logs.folder=/var/log/blynk' $G_FP_DIETPI_USERDATA/blynk/server.properties + + fi + #----------------------------------------------------------------------- # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 local reinstall_ids='' local upgrade_php=0 From 239b6e8d7035ab1e969ea6ee88dcbd69f78a18a6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 10 May 2019 23:44:51 +0200 Subject: [PATCH 222/253] v6.23 + DietPi-Config | RPi: Hide firmware update, which is done automatically with simple apt upgrade since raspberrypi-kernel it is no meta-package. + DietPi-Config | Minor syntax fix + DietPi-Config | Minor coding and alignment --- dietpi/dietpi-config | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 2a9860be18..90d98a20d6 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -46,7 +46,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Obtain Installed software #///////////////////////////////////////////////////////////////////////////////////// - Load_Installed_Software(){ [[ -f /DietPi/dietpi/.installed ]] && . /DietPi/dietpi/.installed; } + Load_Installed_Software(){ [[ -f '/DietPi/dietpi/.installed' ]] && . /DietPi/dietpi/.installed; } #///////////////////////////////////////////////////////////////////////////////////// # Whiltail Info @@ -311,7 +311,7 @@ fi # Odroid Remote - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL <= 12 )); then + if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 13 )); then local odroid_remote_text='[Off]' local odroid_remote_enabled=0 @@ -1315,7 +1315,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi G_WHIP_MENU_ARRAY+=('RTC mode' ": [$rtc_text]") - G_WHIP_MENU_ARRAY+=('Update firmware' '') + # Hide firmware update on RPi. This is done automatically with simple apt upgrade since raspberrypi-kernel it is no meta-package. + (( $G_HW_MODEL > 9 )) && G_WHIP_MENU_ARRAY+=('Update firmware' '') # Serial/UART devices G_WHIP_MENU_ARRAY+=('Serial/UART' ': Manage available devices') @@ -1429,7 +1430,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 local old_firmware=$(ls /lib/modules/) # Pine A64: Non-ARMbian only - if (( $G_HW_MODEL == 40 && -f /usr/local/sbin/pine64_update_uboot.sh && -f /usr/local/sbin/pine64_update_kernel.sh )); then + if [[ $G_HW_MODEL == 40 && -f '/usr/local/sbin/pine64_update_uboot.sh' && -f '/usr/local/sbin/pine64_update_kernel.sh' ]]; then if G_WHIP_YESNO "Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION? - This will run longsleep's update scripts to update the U-Boot and kernel."; then @@ -1609,7 +1610,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Intel boost option (eg: i5-6200U, disables 2.9GHz mode, limits to 2.3GHz) + # Intel boost option (eg: i5-6200U, disables 2.9GHz mode, limits to 2.3GHz) local intel_boost_disabled=0 local intel_boost_text='Enabled' if grep -qi 'genuineintel' /proc/cpuinfo; then @@ -2281,7 +2282,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_ETH_CopyCurrentToStatic(){ - #Apply, Only if we have a connection + # Apply, Only if we have a connection if (( $ETH_CONNECTED == 1 )); then ETH_IP_STATIC=$ETH_IP @@ -2295,7 +2296,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_WIFI_CopyCurrentToStatic(){ - #Apply, Only if we have a connection + # Apply, Only if we have a connection if (( $WIFI_CONNECTED == 1 )); then WIFI_IP_STATIC=$WIFI_IP @@ -2523,7 +2524,7 @@ _EOF_ Change_StaticDns(){ - #$1 = Adapater type | 0=Eth, 1=WiFi + # $1 = Adapater type | 0=Eth, 1=WiFi # Store current into var local current_value=0 @@ -3308,7 +3309,6 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then fi - G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') # - Unset country code? if [[ $WIFI_COUNTRYCODE == '00' ]]; then @@ -3560,7 +3560,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then TARGETMENUID=11 # - Init/load previous bench results - [[ -f /var/lib/dietpi/dietpi-benchmark/results ]] || /DietPi/dietpi/func/dietpi-benchmark 0 + [[ -f '/var/lib/dietpi/dietpi-benchmark/results' ]] || /DietPi/dietpi/func/dietpi-benchmark 0 . /var/lib/dietpi/dietpi-benchmark/results # - Sanity for beta testing. As this value won't exist until re-save of /var/lib/dietpi/dietpi-benchmark/results @@ -3577,7 +3577,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then ) G_WHIP_DEFAULT_ITEM='DietPi-Benchmark' - G_WHIP_MENU "\ + if G_WHIP_MENU "\ DietPi-Benchmark | https://dietpi.com/survey#benchmark : - CPU Performance : Duration = $BENCH_CPU seconds (lower is faster) - CPU Temp : Idle = ${BENCH_CPU_TEMP_START}'c | Full load = ${BENCH_CPU_TEMP_END}'c @@ -3586,8 +3586,7 @@ DietPi-Benchmark | https://dietpi.com/survey#benchmark : Additional benchmarks: - Custom Filesystem : Write = $BENCH_CUSTOMFS_WRITE MB/s | Read = $BENCH_CUSTOMFS_READ MB/s - - Network LAN : Transfer rate = $BENCH_NET_LAN_SPEED MB/s" - if (( $? == 0 )); then + - Network LAN : Transfer rate = $BENCH_NET_LAN_SPEED MB/s"; then TARGETMENUID=12 # Return to this menu @@ -3670,7 +3669,7 @@ Additional benchmarks: sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - elif (( $G_HW_MODEL <= 1 )); then + elif (( $G_HW_MODEL < 2 )); then sed -i '/arm_freq=/c\#arm_freq=700' /DietPi/config.txt sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt @@ -3748,6 +3747,7 @@ Additional benchmarks: TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in + 'none') Reset_Overclocking From bf59ab07448fda4e9374df52e0041feb2000dbb5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 01:33:50 +0200 Subject: [PATCH 223/253] v6.23 + DietPi-Cleaner | "man" APT package does not exist, handle "man-db" instead + DietPi-Cleaner | Ask user for clearing man page directories only, purge APT packages regardless which is safe --- dietpi/dietpi-cleaner | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index e18f97b340..78bb0741eb 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -403,14 +403,14 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners # Purge if (( $DRY_RUN )); then - apt-get -s purge man manpages + apt-get -s purge man-db manpages else - if G_WHIP_YESNO '[WARNING] Removing man pages and docs from the system, may break some APT packages (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then + G_AGP man-db manpages + G_AGA + if G_WHIP_YESNO '[WARNING] Removing installed man pages and docs causes errors during "apt-get upgrade" in rare cases (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then - G_AGP man manpages - G_AGA rm -Rf /usr/share/{man,doc,doc-base} fi From b6c85ebce9a5ef278ee0e5d2a9720abb3888b869 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 01:41:24 +0200 Subject: [PATCH 224/253] v6.23 + CHANGELOG | Set release date and PR link --- CHANGELOG.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a15f02c72..32fcc597b9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,6 @@ v6.23 -(XX/05/19) +(12/05/19) Jessie support: - The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 @@ -60,7 +60,7 @@ Bug Fixes: - DietPi-Software | Jackett: Resolved an issue where service start fails after using the internal updater. Many thanks to @DeathIsUnknown for reporting this issue and providing a solution: https://github.com/MichaIng/DietPi/issues/2593#issuecomment-490096681 - DietPi-Software | Blynk: Resolved an issue where logging failed and changed the default log dir to /var/log/blynk. Many thanks to @Phil1988 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2777 -As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX/files +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/2784 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 25415ca285892bf58de6059ba0256151dcb1810a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 01:54:31 +0200 Subject: [PATCH 225/253] v6.23 + DietPi-Patch | Remove doubled Jackett reinstall --- dietpi/patch_file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index a970af6f6b..356273298c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1188,11 +1188,11 @@ _EOF_ # OMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 # MyMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 # RoonBridge: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/10?u=dan_knight - # Radarr/lidarr/sonarr/jacket: https://github.com/MichaIng/DietPi/issues/2219 + # Radarr/Lidarr/Sonarr: https://github.com/MichaIng/DietPi/issues/2219 # Mosquitto: https://github.com/MichaIng/DietPi/issues/2243#issuecomment-439492463 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /DietPi/dietpi/dietpi-software reinstall 106 121 123 129 144 145 147 148 + /DietPi/dietpi/dietpi-software reinstall 106 121 123 129 144 145 148 # - Switch to "mariadb" systemd service on Stretch+: https://github.com/MichaIng/DietPi/pull/2196 if (( $G_DISTRO > 3 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[88\]=2' /DietPi/dietpi/.installed; then From e20d784972b2556db502bf2da4a9bc3f7fa9f70a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 02:13:21 +0200 Subject: [PATCH 226/253] v6.23 + DietPi-Software | Gogs: Revert "WorkingDirectory" removal as this is NOT users home by default. Skip log file pre-creation which is not required. --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e205c55628..2784519337 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10518,7 +10518,6 @@ _EOF_ # Directories mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs - > /var/log/gogs/gogs_daemon.log chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs # Database @@ -10533,6 +10532,7 @@ After=mysqld.service mysql.service mariadb.service [Service] User=gogs +WorkingDirectory=/etc/gogs ExecStart=/bin/dash -c '/etc/gogs/gogs web 2>&1 > /var/log/gogs/gogs_daemon.log' [Install] From a24a269655be549ff076105489b8c17ff66c596a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 17:01:23 +0200 Subject: [PATCH 227/253] v6.23 + DietPi-Software | Nextcloud: Do not set "opcache.enable_cli=1" any more, which is not recommended since Nextcloud v16.0.1: https://github.com/nextcloud/documentation/issues/1439 --- dietpi/dietpi-software | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2784519337..d9632c9166 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7778,9 +7778,8 @@ _EOF_ (( $G_DISTRO > 3 )) && phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif G_DIETPI-NOTIFY 2 'Optimising APCu and OPcache modules for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1 -opcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000 -opcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-nextcloud.ini + echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1\nopcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-nextcloud.ini phpenmod dietpi-nextcloud if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then From 7b1b0ac10406d5420409f27bfc69d6bdbe7f107c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 17:07:08 +0200 Subject: [PATCH 228/253] v6.23 + DietPi-Patch | Nextcloud: Do not set "opcache.enable_cli=1" any more, which is not recommended since Nextcloud v16.0.1: nextcloud/documentation#1439 --- dietpi/patch_file | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 356273298c..dedb4fc9f1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1949,9 +1949,8 @@ Your Nextcloud data are not touched.' if grep -q '^aSOFTWARE_INSTALL_STATE\[114\]=2' /DietPi/dietpi/.installed; then G_AGI $PHP_NAME-intl - echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1 -opcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000 -opcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > /etc/php/${PHP_NAME#php}/mods-available/dietpi-nextcloud.ini + echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1\nopcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > /etc/php/${PHP_NAME#php}/mods-available/dietpi-nextcloud.ini phpenmod dietpi-nextcloud fi From 9f9bc2b835a9b1f9e5b1b324804324c37f1c27fa Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 20:31:06 +0200 Subject: [PATCH 229/253] v6.23 + DietPi-Software | Raise max size for software list to cover new XFCE4 power manager --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d9632c9166..3cb447399a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15132,7 +15132,7 @@ _EOF_ if (( $display_software_menu )); then - G_WHIP_SIZE_X_MAX=83 + G_WHIP_SIZE_X_MAX=90 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 - NB: Pressing 'ESC' or selecting 'Back' will clear all changed selections" From f6df69843b9dcf11edf37ac94b49fe932b82fbec Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 11 May 2019 20:42:42 +0200 Subject: [PATCH 230/253] v6.23 + DietPi-Software | Tiny wording --- dietpi/dietpi-software | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3cb447399a..1bea0696d2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15682,15 +15682,15 @@ This will allow you to choose which program loads automatically, after the syste G_WHIP_MENU_ARRAY=( - 'List' ': Select from a list of available drive mounts, to move user data.' - 'Custom' ': Input a manual location to move user data.' - 'Drive' ': Launches DietPi Drive Manager.' + 'List' ': Select from a list of available drives to move user data.' + 'Custom' ': Manually enter a location location to move user data.' + 'Drive' ': Launch DietPi-Drive_Manager.' ) G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_MENU 'Choose where to store your user data. User data includes software such as Owncloud data store, BitTorrent downloads etc.\n -More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?f=8&t=478&p=2087\n\n- DietPi-Drive Manager: Launch DietPi-Drive Manager to setup external drives, and, move user data to different locations.' + G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc.\n +More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087\n\n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.' if (( $? == 0 )); then # - DriveMan @@ -15738,7 +15738,7 @@ More information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.p else - G_WHIP_MSG "User data transfer: Failed\n\n$(cat /var/log/dietpi-move_userdata.log)\n\nNo changes have been applied." + G_WHIP_MSG "User data transfer: Failed\n\n$( Date: Sun, 12 May 2019 00:42:58 +0200 Subject: [PATCH 231/253] v6.23 + DietPi-Software | phpMyAdmin: APT package not available on Debian Buster (but on Raspbian Buster) --- dietpi/dietpi-software | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1bea0696d2..b9b5993f37 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1822,6 +1822,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' + # APT package not available on Debian Buster (but on Raspbian Buster): https://packages.debian.org/phpmyadmin + (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 + #------------------ software_id=91 From ae701d89437128fff70f710c0cd03777dad0118c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 02:21:01 +0200 Subject: [PATCH 232/253] v6.23 + DietPi-Software | Tomcat8: Disable for non-RPi Buster + DietPi-Software | NAA Daemon: libasound2 is installed with ALSA; On Stretch+ rely on G_AGF to resolve dependencies which fixes install on Buster where gcc-6-base is not available (the required libstdc++6 depends on gcc-8-base instead). --- dietpi/dietpi-software | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b9b5993f37..cf153d5bbd 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1822,7 +1822,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' - # APT package not available on Debian Buster (but on Raspbian Buster): https://packages.debian.org/phpmyadmin + # - non-RPi Buster: https://packages.debian.org/phpmyadmin (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 #------------------ @@ -1852,6 +1852,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 + # - non-RPi Buster: https://packages.debian.org/tomcat8 + (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 + #PiHole #-------------------------------------------------------------------------------- software_id=93 @@ -4384,7 +4387,7 @@ _EOF_ Banner_Installing - # Skip license for NAA daemon + # Skip license debconf-set-selections <<< 'networkaudiod networkaudiod/license note false' # Packages @@ -4423,12 +4426,7 @@ _EOF_ done - # Pre-reqs - DEPS_LIST='libasound2' - - # - Stretch+ additional packages - (( $G_DISTRO > 3 )) && DEPS_LIST+=' gcc-6-base libstdc++6' - + # Install for i in "${apackages[@]}" do @@ -12760,7 +12758,7 @@ _EOF_ fi - software_id=124 + software_id=124 # NAA Daemon if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -12769,7 +12767,7 @@ _EOF_ fi - software_id=125 + software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling From 672e53924494e5c2f70f8f4361a143165edc8512 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 03:13:56 +0200 Subject: [PATCH 233/253] v6.23 + DietPi-Software | NAA Daemon: Fix install on non-ARM Jessie systems by providing all arch binaries on our server + DietPi-Software | NAA Daemon: Fix install on Buster by setting JAVA_HOME to Java 11 + DietPi-Software | NAA Daemon: Update to current version 3.5.6-41 + DietPi-Software | MPD: libasound2 > libasound2-data are installed by ALSA; Use current 0.20.23 URL directly which was already symlinked before --- dietpi/dietpi-software | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cf153d5bbd..503df1cea0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3528,8 +3528,8 @@ We work around this error by running APT a second time. Please do not worry and if (( $G_HW_ARCH == 3 )); then # libupnp6 for net discov with upnp/avahi - DEPS_LIST='libupnp6 libwrap0 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file' - Download_Install 'https://dietpi.com/downloads/binaries/all/mpd_0.20.18-1_armv8.deb' + DEPS_LIST='libupnp6 libwrap0 libmpdclient2 libao-common libao4 libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file' + Download_Install 'https://dietpi.com/downloads/binaries/all/mpd_0.20.23-1_aarch64.deb' else @@ -4396,25 +4396,25 @@ _EOF_ # - Jessie: Requires Stretch packages if (( $G_DISTRO < 4 )); then - apackages+=('https://dietpi.com/downloads/binaries/all/gcc-6-base_6.3.0-6_armhf.deb') - apackages+=('https://dietpi.com/downloads/binaries/all/libstdc++6_6.3.0-6_armhf.deb') + apackages+=("https://dietpi.com/downloads/binaries/jessie/gcc-6-base_$G_HW_ARCH_DESCRIPTION.deb") + apackages+=("https://dietpi.com/downloads/binaries/jessie/libstdc++6_$G_HW_ARCH_DESCRIPTION.deb") fi # - ARMv6/7 if (( $G_HW_ARCH < 3 )); then - apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.5-39_armhf.deb') + apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.6-41_armhf.deb') # - ARMv8 elif (( $G_HW_ARCH == 3 )); then - apackages+=('https://www.signalyst.eu/bins/naa/linux/xenial/networkaudiod_3.5.5-39_arm64.deb') + apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.6-41_arm64.deb') # - x86_64 else - apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.5-39_amd64.deb') + apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.6-41_amd64.deb') fi @@ -8537,7 +8537,10 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - sed -i "/JAVA_HOME=/c\JAVA_HOME=$(find \/usr\/lib\/jvm\/ -name java-8-openjdk*)" /etc/default/tomcat8 + + local java=8 + (( $G_DISTRO > 4 )) && java=11 + G_CONFIG_INJECT 'JAVA_HOME=' "JAVA_HOME=$(find /usr/lib/jvm/ -name java-$java-openjdk*)" /etc/default/tomcat8 fi From 472c46af4de818f76a912ee946afb9e578cca240 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 04:55:32 +0200 Subject: [PATCH 234/253] v6.23 + DietPi-Software | HTPC Manager: Fix install on Buster by replacing the obsolete "python-imaging" meta/transitional package with "python-pil" + DietPi-Software | Roon Server: Fix install on Buster by removing the obsolete "libav-tools" meta/transitional package which was only required as old alternative to FFmpeg (which it pulls in) + DietPi-Software | FuguHub: https://fuguhub.com SSL issuer is not known/trusted on different DietPi/Debian systems. Strange since on Windows and all ssllabs.com OS checks it is trusted. We skip certificate check for now, however this should be checked/fixed in Debian ca-certificates package. --- dietpi/dietpi-software | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 503df1cea0..71f7e77ed7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5829,19 +5829,21 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" + G_THREAD_START git clone --depth=1 "$INSTALL_URL_ADDRESS" + # Pre-reqs - G_AGI python-imaging + # - psutil for system stats + # - Python Image library: https://htpc.io/installation.html#linux + pip install psutil + G_AGI python-pil # pip install PIL fails at least on Debian Buster x86_64 - git clone --depth=1 "$INSTALL_URL_ADDRESS" + G_THREAD_WAIT # Move HTPC Manager to a 'better' location mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager cp -R HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ rm -R HTPC-Manager - # psutil for system stats - pip install psutil - fi software_id=153 # OctoPrint @@ -5867,12 +5869,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - software_id=154 # RoonServer + software_id=154 # Roon Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # http://kb.roonlabs.com/LinuxInstall - DEPS_LIST='libav-tools cifs-utils' + DEPS_LIST='cifs-utils' # Skip download and install, if already existent, manual removal or internal updater can be used: if [[ ! -d $G_FP_DIETPI_USERDATA/roonserver ]]; then @@ -5956,7 +5958,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_CHECK_URL "$INSTALL_URL_ADDRESS" # Offical Docker recommended install command - wget -O DockerInstall.sh "$INSTALL_URL_ADDRESS" + wget "$INSTALL_URL_ADDRESS" -O DockerInstall.sh chmod +x DockerInstall.sh ./DockerInstall.sh #rm DockerInstall.sh @@ -5978,13 +5980,13 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - G_CHECK_URL "$INSTALL_URL_ADDRESS" + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$INSTALL_URL_ADDRESS" - wget -O FHinstall.sh "$INSTALL_URL_ADDRESS" + wget --no-check-certificate "$INSTALL_URL_ADDRESS" -O FHinstall.sh chmod +x FHinstall.sh ./FHinstall.sh rm FHinstall.sh - wget https://fuguhub.com/box.zip -O /home/bd/applications/box.zip + wget --no-check-certificate https://fuguhub.com/box.zip -O /home/bd/applications/box.zip fi @@ -5997,8 +5999,8 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_CHECK_URL "$INSTALL_URL_ADDRESS" - mkdir /usr/local/bin/nukkit - wget -O /usr/local/bin/nukkit/nukkit.jar "$INSTALL_URL_ADDRESS" + mkdir -p /usr/local/bin/nukkit + wget "$INSTALL_URL_ADDRESS" -O /usr/local/bin/nukkit/nukkit.jar fi @@ -6636,7 +6638,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=7 + software_id=7 # FFmpeg if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing From cb9206ecaaaed2eff2cc84bbcfc9c534f61d4a12 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 05:04:28 +0200 Subject: [PATCH 235/253] v6.23 + DietPi-Software | Syntax/Typo --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 71f7e77ed7..b434e42ccb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14484,9 +14484,9 @@ _EOF_ [[ -d /usr/local/share/doc/node ]] && rm -R /usr/local/share/doc/node [[ -f /usr/local/man/man1/node.1 ]] && rm /usr/local/man/man1/node.1 [[ -f /usr/local/share/man/man1/node.1 ]] && rm /usr/local/share/man/man1/node.1 - [[ -f /usr/local/README.md ]] && /usr/local/README.md - [[ -f /usr/local/CHANGELOG.md ]] && /usr/local/CHANGELOG.md - [[ -f /usr/local/LICENSE ]] && /usr/local/LICENSE + [[ -f /usr/local/README.md ]] && rm /usr/local/README.md + [[ -f /usr/local/CHANGELOG.md ]] && rm /usr/local/CHANGELOG.md + [[ -f /usr/local/LICENSE ]] && rm /usr/local/LICENSE [[ -f /usr/local/share/systemtap/tapset/node.stp ]] && rm /usr/local/share/systemtap/tapset/node.stp [[ -d /root/.npm ]] && rm -R /root/.npm [[ -f /root/.config/configstore/update-notifier-npm.json ]] && rm /root/.config/configstore/update-notifier-npm.json From d2846fe292b18753e74a456e05df93283522735a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 05:47:18 +0200 Subject: [PATCH 236/253] v6.23 + 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 382867f696..506a7b65b9 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 23 -2 +3 From a99d3ecb381e92d8b32316fc0090029a6cbfb4a7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 05:47:56 +0200 Subject: [PATCH 237/253] v6.23 + 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 418e0a96d0..41cc37b1a5 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-23} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-2} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-3} G_GITBRANCH=${G_GITBRANCH:-master} G_GITOWNER=${G_GITOWNER:-MichaIng} [[ -f '/DietPi/dietpi/.version' && $( Date: Sun, 12 May 2019 06:04:04 +0200 Subject: [PATCH 238/253] v6.23 + CHANGELOG | Inform about current Buster support state --- CHANGELOG.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 32fcc597b9..4c556d37ea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,10 @@ Jessie support: - We highly recommend to migrate to Stretch as fast as possible. - Odroid C1: We have updated the image to Stretch based on ARMbian 4.18 kernel. Existing Jessie installations will be moved to the jessie-support branch: https://github.com/MichaIng/DietPi/issues/2561 +Buster support: +- DietPi-Software | Resolved the last failing installs on Debian Buster systems by either fixing or disabling them: phpMyAdmin and Tomcat8 are currently not available on non-RPi Buster systems. +- DietPi on Debian Buster x86_64 systems can be considered as compatible and stable now. On ARM devices some last software install tests are outstanding, especially on Raspberry Pi with Raspbian particularities. We will ship experimental images for testing purpose soon. + Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 From e366792e14f88c164068f5bd82e153c4d5a84cc4 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 14:20:10 +0200 Subject: [PATCH 239/253] v6.23 + DietPi-Cleaner | Never purge APT packages, instead mark them for autoremoval only. E.g. "man-db" would purge some of our offered software titles as well. Adjust the dry run info accordingly. --- dietpi/dietpi-cleaner | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 78bb0741eb..95c9b148a8 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -366,26 +366,24 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners INFO_CLEAN_NAME='Dev packages' Banner_Cleaning + # Find packages and convert into 1 line string local string_package_names='' while read line do - # Convert lined list into a 1 line string. string_package_names+="$line " - done <<< "$(dpkg --get-selections | mawk '/-dev/ {print $1}')" + done <<< "$(dpkg --get-selections *-dev build-essential git make automake autoconf 2> /dev/null | mawk '{print $1}')" - # Add other dev packages - string_package_names+='build-essential git' - - # Purge + # Mark for autoremoval if (( $DRY_RUN )); then - apt-get -s purge $string_package_names + G_DIETPI-NOTIFY 0 "The following dev packages have been found: ${string_package_names:}" + G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." else - G_AGP $string_package_names + apt-mark auto $string_package_names G_AGA sed -i '/^aSOFTWARE_INSTALL_STATE\[16\]=/c\aSOFTWARE_INSTALL_STATE\[16\]=0' /DietPi/dietpi/.installed &> /dev/null sed -i '/^aSOFTWARE_INSTALL_STATE\[17\]=/c\aSOFTWARE_INSTALL_STATE\[17\]=0' /DietPi/dietpi/.installed &> /dev/null @@ -400,14 +398,24 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners INFO_CLEAN_NAME='Man pages and docs' Banner_Cleaning - # Purge + # Find packages and convert into 1 line string + local string_package_names='' + while read line + do + + string_package_names+="$line " + + done <<< "$(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}')" + + # Mark for autoremoval if (( $DRY_RUN )); then - apt-get -s purge man-db manpages + G_DIETPI-NOTIFY 0 "The following man page/docs packages have been found: ${string_package_names:}" + G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." else - G_AGP man-db manpages + apt-mark auto $string_package_names G_AGA if G_WHIP_YESNO '[WARNING] Removing installed man pages and docs causes errors during "apt-get upgrade" in rare cases (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then From feaab2ec5467e51bb11fcc6a8f78fe749a536ed7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 14:40:57 +0200 Subject: [PATCH 240/253] v6.23 + DietPi-Cleaner | Add info about man/doc disk usage when doing dry run --- dietpi/dietpi-cleaner | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 95c9b148a8..213013da7e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -412,6 +412,8 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners G_DIETPI-NOTIFY 0 "The following man page/docs packages have been found: ${string_package_names:}" G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." + G_DIETPI-NOTIFY 1 'Installed man/doc disk usage:' + du -sh /usr/share/{man,doc,doc-base} 2> /dev/null else From 7105e0ca6533e7016b5cd353a246f3bd6118a626 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 14:54:43 +0200 Subject: [PATCH 241/253] v6.23 + DietPi-Cleaner | Minor fixes + wait for user input after dry run, so results can be reviewed before returning to whiptail menu --- dietpi/dietpi-cleaner | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 213013da7e..02452a4675 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -132,7 +132,7 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6 if (( $at_least_one_cleaner_is_enabled )); then G_WHIP_YESNO "$G_PROGRAM_NAME will now simulate your enabled cleaners.\n -(Notice): No data will be modified.\n\nContinue with test run?" && Run_Cleaners +(Notice): No data will be modified.\n\nContinue with test run?" && { Run_Cleaners; read -p 'Simulation finished: Press any key to return to DietPi-Cleaner...'; } else @@ -371,15 +371,15 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners while read line do - string_package_names+="$line " + [[ $line ]] && string_package_names+="$line " done <<< "$(dpkg --get-selections *-dev build-essential git make automake autoconf 2> /dev/null | mawk '{print $1}')" # Mark for autoremoval if (( $DRY_RUN )); then - G_DIETPI-NOTIFY 0 "The following dev packages have been found: ${string_package_names:}" - G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." + G_DIETPI-NOTIFY 0 "The following dev packages have been found: ${string_package_names:-}" + G_DIETPI-NOTIFY 2 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." else @@ -403,16 +403,16 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners while read line do - string_package_names+="$line " + [[ $line ]] && string_package_names+="$line " done <<< "$(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}')" # Mark for autoremoval if (( $DRY_RUN )); then - G_DIETPI-NOTIFY 0 "The following man page/docs packages have been found: ${string_package_names:}" - G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." - G_DIETPI-NOTIFY 1 'Installed man/doc disk usage:' + G_DIETPI-NOTIFY 0 "The following man page/docs packages have been found: ${string_package_names:-}" + G_DIETPI-NOTIFY 2 "$G_PROGRAM_NAME only purges the ones that are not required for any other installed APT package." + G_DIETPI-NOTIFY 2 'Installed man/doc disk usage:' du -sh /usr/share/{man,doc,doc-base} 2> /dev/null else From f08d80edccda24836ee61c09cc53c77b1227e032 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 14:59:32 +0200 Subject: [PATCH 242/253] v6.23 + DietPi-Cleaner | Fine tuning --- dietpi/dietpi-cleaner | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 02452a4675..712e1a478e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -132,7 +132,7 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6 if (( $at_least_one_cleaner_is_enabled )); then G_WHIP_YESNO "$G_PROGRAM_NAME will now simulate your enabled cleaners.\n -(Notice): No data will be modified.\n\nContinue with test run?" && { Run_Cleaners; read -p 'Simulation finished: Press any key to return to DietPi-Cleaner...'; } +(Notice): No data will be modified.\n\nContinue with test run?" && Run_Cleaners else @@ -350,7 +350,8 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners if (( $INPUT == 0 )); then - G_WHIP_MSG "$G_PROGRAM_NAME completed." + read -p " +$G_PROGRAM_NAME simulation has finished: Press any key to continue..." elif (( $INPUT == 1 )); then From a025fe0518e4d4dcbf6898420c6bdf159d92e677 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 15:13:44 +0200 Subject: [PATCH 243/253] v6.23 + DietPi-Cleaner | Always show freed space after running cleaners if not dry-run was selected. Wait for user input only if dry-run was selected to allow reviewing results. Show more info in future releases. + DietPi-Cleaner | Do not handle services when doing dry-run only --- dietpi/dietpi-cleaner | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 712e1a478e..df6f629529 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -326,7 +326,7 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners Run_Cleaners(){ # Stop services - /DietPi/dietpi/dietpi-services stop + (( $DRY_RUN )) || /DietPi/dietpi/dietpi-services stop Update_Space_Used ROOT_SPACE_USED_BEFORE=$ROOT_SPACE_USED_CURRENT @@ -343,17 +343,17 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners ROOT_SPACE_USED_AFTER=$ROOT_SPACE_USED_CURRENT # Start services - /DietPi/dietpi/dietpi-services start + (( $DRY_RUN )) || /DietPi/dietpi/dietpi-services start #inform user of space cleared. ROOT_SPACE_FREE_DELTA=$(( $ROOT_SPACE_USED_BEFORE - $ROOT_SPACE_USED_AFTER )) - if (( $INPUT == 0 )); then + if (( $DRY_RUN )); then read -p " $G_PROGRAM_NAME simulation has finished: Press any key to continue..." - elif (( $INPUT == 1 )); then + else G_WHIP_MSG "$G_PROGRAM_NAME has finished cleaning RootFS:\n - $ROOT_SPACE_FREE_DELTA MB of space has been cleared." From 974346e29250992697093ece5e8d1fe3f37e60cd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 15:37:28 +0200 Subject: [PATCH 244/253] v6.23 + DietPi-Patch | PHP migration wording to avoid confusion --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index dedb4fc9f1..bd17b88226 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1825,7 +1825,7 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&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 16, ownCloud 10.2 and others.\n We will update webserver configurations and backup the whole /etc/php(5) directory to /mnt/dietpi_userdata/php(5)_bak, so you can recover custom settings.\n -NB: You must update all manually (outside of DietPi-Software) installed PHP-dependent web applications which do not use the dedicated webserver, to use the new ${PHP_NAME^^} socket/instance. +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-" upgrade_php=1 From d5d08e1e08fc6d91da335fea79f6e3bd0029d583 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 12 May 2019 16:25:39 +0100 Subject: [PATCH 245/253] Run DietPi-Benchmark at highest IO priority. --- dietpi/func/dietpi-benchmark | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index cba73f2bd5..c959164558 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -390,8 +390,9 @@ Compare these results online with other users, using the link below: # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - #Run at highest priority. + #Run at highest CPI priority and IO renice -n -19 $$ + ionice -p $$ -c 1 -n 0 #----------------------------------------------------------------------------------- #Init vars for sourcing if (( $INPUT == 0 )); then From e3197c9c1271e5b307eb8e1c0383a92d7717d995 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 12 May 2019 16:27:11 +0100 Subject: [PATCH 246/253] Minor --- dietpi/func/dietpi-benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index c959164558..188bd02675 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -390,7 +390,7 @@ Compare these results online with other users, using the link below: # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - #Run at highest CPI priority and IO + #Run at highest CPU priority and IO renice -n -19 $$ ionice -p $$ -c 1 -n 0 #----------------------------------------------------------------------------------- From f06e2b16fa4d5fc76e820de53d47e8f67abc0635 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 12 May 2019 16:31:02 +0100 Subject: [PATCH 247/253] Info --- CHANGELOG.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4c556d37ea..9796b05f3b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,8 +15,8 @@ Buster support: Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 -- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. -- DietPi-Cleaner | Added a confirmation prompt, before removal of manpages and docs, as this may cause APT issues in some circumstances: +- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime IO with priority 0 (highest). +- DietPi-Cleaner | Added a confirmation prompt, before removal of manpages and docs, as this may cause APT issues in some circumstances: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 From 461673bd212690ed9138479bc60e8a8543582d9c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 20:29:26 +0200 Subject: [PATCH 248/253] v6.23 + DietPi-Patch | phpBB v3.2.X as well does not yet support PHP7.3. Fresh install works fine but any update will prompt an error. Support expected with v3.3.X --- dietpi/patch_file | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index bd17b88226..55fac42155 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1816,8 +1816,9 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' if grep -q '^aSOFTWARE_INSTALL_STATE\[89\]=2' /DietPi/dietpi/.installed; then # ownCloud (up to v10.2) does not yet support PHP7.3, so install PHP7.2 for now + # phpBB 3.2.X: https://github.com/phpbb/phpbb/blob/3.2.x/phpBB/install/app.php#L23 local PHP_NAME='php7.3' - [[ -f '/var/www/owncloud/occ' ]] && PHP_NAME='php7.2' + [[ -f '/var/www/owncloud/occ' || -f '/var/www/phpBB3/config.php' ]] && PHP_NAME='php7.2' if ! command -v $PHP_NAME &> /dev/null; then From 879824374dae7a17012d455a9e8cb9c33e2199ec Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 20:42:14 +0200 Subject: [PATCH 249/253] v6.23 + DietPi-Software | phpBB/PHP: phpBB up to v3.2 does not yet support PHP7.3 as well. Fresh install works but any update will be denied. --- dietpi/dietpi-software | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b434e42ccb..a07e257d13 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2839,6 +2839,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it echo -e '# ownCloud does not yet support PHP7.3 Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-owncloud + # phpBB3 (up to v3.2) as well: https://github.com/phpbb/phpbb/blob/3.2.x/phpBB/install/app.php#L23 + elif (( ${aSOFTWARE_INSTALL_STATE[54]} > 0 )) || [[ -f '/var/www/phpBB3/config.php' ]]; then + + FP_PHP_BASE_DIR='/etc/php/7.2' + PHP_NAME='php7.2' + # - Prevent accidental PHP7.3 installs + echo -e '# phpBB does not yet support PHP7.3 +Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-owncloud + fi fi From 39b0bb25abd21db150e95dce29d800a73f372fb9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 20:49:30 +0200 Subject: [PATCH 250/253] v6.23 + CHANGELOG | PHP: phpBB does as well not yet support PHP7.3 --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9796b05f3b..13398ef9de 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -27,7 +27,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | Network Adapter menu has been cleaned up. Proxy variables are now sourced from "/etc/bashrc.d/dietpi-proxy.sh" and proxy setup outside of DietPi scripts is detected. - DietPi-NordVPN | Added ability to toggle auto start/connect during boot. - DietPi-Software | Subsonic: Package has been updated to v6.1.5. Many thanks to @spectrumcomputing: https://github.com/MichaIng/DietPi/pull/2702 -- DietPi-Software | PHP: All systems will be upgraded to PHP7.3 for security, performance, compatibility and consistency across distro versions. Ondrejs (official Debian PHP maintainer) PHP repository (sury.org) is used for this on Jessie and Stretch, so general functionality and trustworthiness is assured. ownCloud users will stay on PHP7.2 for now since ownCloud does not yet support PHP7.3. Your PHP configurations will be backed up and webserver configurations adjusted to match the new version. Nextcloud 13 and earlier, especially Jessie systems, will be upgraded to Nextcloud 14 to allow PHP7.3. A full Nextcloud backup will be done, your data, settings and custom apps will be preserved. We strongly advice to further upgrade to the current Nextcloud major version via its web UI updater. +- DietPi-Software | PHP: All systems will be upgraded to PHP7.3 for security, performance, compatibility and consistency across distro versions. Ondrejs (official Debian PHP maintainer) PHP repository (sury.org) is used for this on Jessie and Stretch, so general functionality and trustworthiness is assured. ownCloud and phpBB users will stay on PHP7.2 for where PHP7.3 is not yet supported. Your PHP configurations will be backed up and webserver configurations adjusted to match the new version. Nextcloud 13 and earlier, especially Jessie systems, will be upgraded to Nextcloud 14 to allow PHP7.3. A full Nextcloud backup will be done, your data, settings and custom apps will be preserved. We strongly advice to further upgrade to the current Nextcloud major version via its web UI updater. - DietPi-Software | Subsonic: Runs now as limited user "subsonic". This change is as well applied to existing installs via patch during DietPi-Update: https://github.com/MichaIng/DietPi/pull/2705 - DietPi-Software | WireGuard APT packages are now upgraded when running "apt-get upgrade". Many thanks to @swrobel for reporting this issue: https://github.com/MichaIng/DietPi/issues/2671 - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. From eaf0c3969bc6a8c180872bc0910ac0ea1fa59303 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 20:51:44 +0200 Subject: [PATCH 251/253] v6.23 + DietPi-Software | phpBB: Install new v3.2.7 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a07e257d13..78a5a795ca 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3579,7 +3579,7 @@ We work around this error by running APT a second time. Please do not worry and else - Download_Install 'https://www.phpbb.com/files/release/phpBB-3.2.5.tar.bz2' /var/www + Download_Install 'https://www.phpbb.com/files/release/phpBB-3.2.7.tar.bz2' /var/www fi From 95eb4ba320d9ce6278ba94dbf822ee0e71117f5c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 21:07:54 +0200 Subject: [PATCH 252/253] v6.23 + CHANGELOG | Add missing link and user credits for report --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 13398ef9de..9a28174f2c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,7 +16,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime IO with priority 0 (highest). -- DietPi-Cleaner | Added a confirmation prompt, before removal of manpages and docs, as this may cause APT issues in some circumstances: +- DietPi-Cleaner | Added a confirmation prompt, before removal of offline docs and man pages, as this may cause APT issues in some circumstances. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2751 - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 From c4bfe35a1e92fef8652284d34105031e88ac4d32 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 12 May 2019 21:13:25 +0200 Subject: [PATCH 253/253] v6.23 + DietPi-Software | phpBB/ownCloud: Allow both PHP7.3 preferences concurrently and remove them on software uninstall. This assures PHP7.3 is blocked as long as any of both is installed and automatically release when uninstalled. --- dietpi/dietpi-software | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 78a5a795ca..fdf2957459 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2839,14 +2839,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it echo -e '# ownCloud does not yet support PHP7.3 Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-owncloud + fi + # phpBB3 (up to v3.2) as well: https://github.com/phpbb/phpbb/blob/3.2.x/phpBB/install/app.php#L23 - elif (( ${aSOFTWARE_INSTALL_STATE[54]} > 0 )) || [[ -f '/var/www/phpBB3/config.php' ]]; then + if (( ${aSOFTWARE_INSTALL_STATE[54]} > 0 )) || [[ -f '/var/www/phpBB3/config.php' ]]; then FP_PHP_BASE_DIR='/etc/php/7.2' PHP_NAME='php7.2' # - Prevent accidental PHP7.3 installs echo -e '# phpBB does not yet support PHP7.3 -Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-owncloud +Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-phpbb fi @@ -12554,6 +12556,8 @@ _EOF_ fi grep -q 'owncloud' /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf &> /dev/null && rm /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf + # PHP7.3 block removal + [[ -f '/etc/apt/preferences.d/dietpi-owncloud' ]] && rm /etc/apt/preferences.d/dietpi-owncloud fi @@ -12691,7 +12695,7 @@ _EOF_ fi - software_id=54 + software_id=54 # phpBB Forum if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -12699,6 +12703,7 @@ _EOF_ mysqladmin drop phpbb3 -f mysql -e "drop user 'phpbb3'@'localhost'" [[ -d '/var/www/phpBB3' ]] && rm -R /var/www/phpBB3 + [[ -f '/etc/apt/preferences.d/dietpi-phpbb' ]] && rm /etc/apt/preferences.d/dietpi-phpbb fi