From 87faca8819a2e0b1b36a7c09d869c21316374212 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 8 Feb 2019 20:15:53 +0000 Subject: [PATCH 001/175] v6.22 + VC's --- CHANGELOG.txt | 44 +++++++++++++++++++++-------------------- dietpi/.version | 2 +- dietpi/patch_file | 6 ++++++ dietpi/server_version-6 | 4 ++-- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 64d4cd2730..1c5f3c7a9f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,18 +1,10 @@ -v6.21 (Hotfix) -(07/02/19) +v6.22 +(xx/02/19) Changes / Improvements / Optimisations: -- DietPi-Software | VNC4: Automated VNC password based on $GLOBAL_PW. -- DietPi-Software | GPU memory split: You will now be prompted to increase GPU memory if DietPi detects a higher value is required for installed software: https://github.com/Fourdee/DietPi/issues/2483 Bug Fixes: -- General | G_RUN_CMD: Resolved issue with incorrect exit code return. This also prevented the ability to remove networked drives from dietpi-drive_manager: https://github.com/Fourdee/DietPi/issues/2508 -- General | Resolved an issue when updating to v6.20, where DietPi-RAMdisk failed to sync changes to disk, causing several issues after reboot: https://github.com/Fourdee/DietPi/issues/2471#issuecomment-460104856 -- DietPi-Software | WireGuard: Server installation also sets port as configured during installation to wg0-client.conf. Disabled installation for ARMv6 (no binaries). Many thanks to @WilburWalsh for reporting this issue: https://github.com/Fourdee/DietPi/issues/2474 -- DietPi-Software | VNCserver: Resolved "HOME" variable not set in service. -- DietPi-Software | MariaDB: Resolved an issue with latest MariaDB v10.3 update on Buster due to deprecated/removed settings: https://github.com/Fourdee/DietPi/pull/2490 -- PREP | Resolved issues with failed installation, due to missing pre-req directory: https://github.com/Fourdee/DietPi/issues/2487 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster @@ -30,6 +22,27 @@ For all additional issues that may appear after release, please see the followin ----------------------------------------------------------------------------------------------------------- +v6.21 (Hotfix) +(07/02/19) + +Changes / Improvements / Optimisations: +- DietPi-Software | VNC4: Automated VNC password based on $GLOBAL_PW. +- DietPi-Software | GPU memory split: You will now be prompted to increase GPU memory if DietPi detects a higher value is required for installed software: https://github.com/Fourdee/DietPi/issues/2483 + +Bug Fixes: +- General | G_RUN_CMD: Resolved issue with incorrect exit code return. This also prevented the ability to remove networked drives from dietpi-drive_manager: https://github.com/Fourdee/DietPi/issues/2508 +- General | Resolved an issue when updating to v6.20, where DietPi-RAMdisk failed to sync changes to disk, causing several issues after reboot: https://github.com/Fourdee/DietPi/issues/2471#issuecomment-460104856 +- DietPi-Software | WireGuard: Server installation also sets port as configured during installation to wg0-client.conf. Disabled installation for ARMv6 (no binaries). Many thanks to @WilburWalsh for reporting this issue: https://github.com/Fourdee/DietPi/issues/2474 +- DietPi-Software | VNCserver: Resolved "HOME" variable not set in service. +- DietPi-Software | MariaDB: Resolved an issue with latest MariaDB v10.3 update on Buster due to deprecated/removed settings: https://github.com/Fourdee/DietPi/pull/2490 +- PREP | Resolved issues with failed installation, due to missing pre-req directory: https://github.com/Fourdee/DietPi/issues/2487 + +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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster + +For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones + +----------------------------------------------------------------------------------------------------------- + v6.20 (28/01/19) @@ -139,8 +152,6 @@ Allo GUI: 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: - ----------------------------------------------------------------------------------------------------------- v6.18 @@ -198,8 +209,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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: - ----------------------------------------------------------------------------------------------------------- v6.17 @@ -254,13 +263,6 @@ Allo GUI v11: 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: -- O!MPD and MyMPD fail to update libaries. YMPD is fine: https://github.com/Fourdee/DietPi/issues/2156 -- Kodi shutdown options missing: https://github.com/Fourdee/DietPi/issues/2155 -- DietPi-Config | RPi | OpenGL/VC4 causes soundcard selection to be invalid: https://github.com/Fourdee/DietPi/issues/2173 -- PineA64: No sound over 3.5mm jack: https://github.com/Fourdee/DietPi/issues/2153 -- For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones - ----------------------------------------------------------------------------------------------------------- v6.16 diff --git a/dietpi/.version b/dietpi/.version index 4ac699de82..46b255593b 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1,6 +1,6 @@ #!/bin/bash G_DIETPI_VERSION_CORE=6 -G_DIETPI_VERSION_SUB=21 +G_DIETPI_VERSION_SUB=22 G_DIETPI_VERSION_RC=0 G_GITBRANCH='master' G_GITOWNER='Fourdee' diff --git a/dietpi/patch_file b/dietpi/patch_file index 171c4723e8..850fd128e2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1644,6 +1644,12 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + elif (( $G_DIETPI_VERSION_SUB == 21 )); then + + #------------------------------------------------------------------------------- + echo 0 + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 40a5bc26c6..6537feb98a 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -21 -1 +22 +0 From 96b5b6f8167dcd10d306eedbce8bf0a83ece7e68 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 13:47:20 +0100 Subject: [PATCH 002/175] v6.22 + DietPi-Update | Fix syntax: We are not in a function here --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index bd335d78e2..d996c329fe 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -525,7 +525,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - local do_reboot=0 + do_reboot=0 # - 1st run setup if (( $G_DIETPI_INSTALL_STAGE < 2 )); then From b9926b146242dbd0d234354b2e04a9fe47f796a9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 20:55:38 +0100 Subject: [PATCH 003/175] v6.22 + DietPi-Software | WireGuard: Switch from 10.8.0.0 to 10.9.0.0 IP addresses, to avoid double use with OpenVPN + DietPi-Software | WireGuard: Replace 127.0.0.1/localhost loopback DNS entries in client config by VPN server IP 10.9.0.1 + DietPi-Software | OpenVPN: Use drop-in /etc/sysctl.d/dietpi-openvpn.conf to apply IP forwarding; Add IPv6 forwarding as well; Use sysctl command to apply settings now + DietPi-Software | WiFi Hotspot: Use drop-in /etc/sysctl.d/dietpi-wifihotspot.conf to apply IP forwarding; Add IPv6 forwarding as well; Use sysctl command to apply settings now --- dietpi/dietpi-software | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..f087572cc8 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4915,11 +4915,11 @@ _EOF_ local existing_install=0 dpkg-query -s wireguard-dkms &> /dev/null && existing_install=1 - # iptables required to forward incoming VPN traffic to internet interface + # iptables required to forward incoming VPN traffic to local LAN/internet interface # qrencode required to print client config QR code to console G_AGI wireguard iptables qrencode - # If no fresh install, reconfigure to rebuild WireGuard kernel module against current kernel headers + # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers (( $existing_install )) && G_RUN_CMD dpkg-reconfigure wireguard-dkms unset kernel_packages existing_install @@ -9921,8 +9921,9 @@ _EOF_ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ - #enable ipv4 forwarding - sed -i '/net.ipv4.ip_forward=/c\net.ipv4.ip_forward=1' /etc/sysctl.conf + #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) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(sed -n 3p /DietPi/dietpi/.network)" -j MASQUERADE @@ -10013,7 +10014,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal # - Server config [[ -f wg0.conf ]] || cat << _EOF_ > wg0.conf [Interface] -Address = 10.8.0.1/24 +Address = 10.9.0.1/24 PrivateKey = $( wg0-client.conf [Interface] -# The address must be unique for each client, use "10.8.0.3/24" for the second client and so on. -Address = 10.8.0.2/24 +# The address must be unique for each client, use "10.9.0.3/24" for the second client and so on. +Address = 10.9.0.2/24 PrivateKey = $( /etc/sysctl.d/dietpi-wireguard.conf @@ -10183,9 +10190,9 @@ _EOF_ DAEMON_CONF="/etc/hostapd/hostapd.conf" _EOF_ - # - Enable IPv4 forwarding - sed -i "/net.ipv4.ip_forward=/c\net.ipv4.ip_forward=1" /etc/sysctl.conf - echo 1 > /proc/sys/net/ipv4/ip_forward + # - 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 + sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1 # - Apply iptables iptables -t nat -A POSTROUTING -o eth$eth_index -j MASQUERADE @@ -13638,12 +13645,13 @@ _EOF_ fi - software_id=97 + software_id=97 # OpenVPN server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP openvpn [[ -d /etc/openvpn ]] && rm -R /etc/openvpn + [[ -f /etc/sysctl.d/dietpi-openvpn.conf ]] && rm /etc/sysctl.d/dietpi-openvpn.conf fi @@ -13743,6 +13751,9 @@ _EOF_ rm /usr/sbin/hostapd &> /dev/null rm /usr/sbin/hostapd_cli &> /dev/null + # IP forwarding + [[ -f /etc/sysctl.d/dietpi-wifihotspot.conf ]] && rm /etc/sysctl.d/dietpi-wifihotspot.conf + #Set Wlan back to inactive and ready for use with dietpi-config. local wifi_index=$(sed -n 2p /DietPi/dietpi/.network) From 27bcbbd5769fa24df80eff08c864cf1667d895b6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 21:08:12 +0100 Subject: [PATCH 004/175] v6.22 + CHANGELOG | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs + CHANGELOG | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1c5f3c7a9f..6155c5d471 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,8 +3,10 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: ++ DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 Bug Fixes: ++ DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From 71f68731ed83a0fdc031d8af268482016b38258c Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sat, 9 Feb 2019 17:17:04 -0600 Subject: [PATCH 005/175] dietpi-autostart comment typo interger => integer --- dietpi/dietpi-autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index fb5a45005c..76623d750c 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -23,7 +23,7 @@ G_INIT #Import DietPi-Globals --------------------------------------------------------------- - #Grab Input (valid interger) + #Grab Input (valid integer) INPUT=-1 disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 From 9f2bd1a23ee3f28c7d1945a4fca1a1e4afb33e92 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sat, 9 Feb 2019 17:43:18 -0600 Subject: [PATCH 006/175] PREP_SYSTEM_FOR_DIETPI.sh comment typo fixes sucessfully => successfully histroy => history parition => partition mininum => minimum --- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index bcc235a6e7..8efc28ad2d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -145,7 +145,7 @@ # DietPi-Globals #------------------------------------------------------------------------------------------------ # - Download - # - NB: We'll have to manually handle errors, until DietPi-Globals are sucessfully loaded. + # - NB: We'll have to manually handle errors, until DietPi-Globals are successfully loaded. if ! wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then echo -e '[FAILED] Unable to download dietpi-globals. Aborting...\n' @@ -1466,7 +1466,7 @@ _EOF_ [[ -f ~/.bash_history ]] && rm ~/.bash_history rm -f /home/*/.bash_history - # - Remove Nano histroy file + # - Remove Nano history file [[ -f ~/.nano_history ]] && rm ~/.nano_history rm -f /home/*/.nano_history @@ -1671,7 +1671,7 @@ _EOF_ #Read image - #Resize rootfs parition to mininum size +50MB + #Resize rootfs partition to minimum size +50MB } From 3922a73afbd2543095632aea7dae95027fe2d80a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 10 Feb 2019 14:45:05 +0000 Subject: [PATCH 007/175] v6.22 General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 --- CHANGELOG.txt | 1 + dietpi/patch_file | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1c5f3c7a9f..02e7c9f784 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ v6.22 Changes / Improvements / Optimisations: Bug Fixes: +- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/patch_file b/dietpi/patch_file index 850fd128e2..953e8badf0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1647,7 +1647,9 @@ Also have a look at "Sonarr", another alternative TV show manager, available for elif (( $G_DIETPI_VERSION_SUB == 21 )); then #------------------------------------------------------------------------------- - echo 0 + #Redo our /etc/bash.bashrc entry, user confirmed 4 entries: https://github.com/Fourdee/DietPi/issues/2529 + sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc + G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- fi From 5b815f3c05021603ffecba718848a1491e037f96 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 10 Feb 2019 14:55:03 +0000 Subject: [PATCH 008/175] v6.22 + Credit https://github.com/Fourdee/DietPi/issues/2529 + Consistency --- CHANGELOG.txt | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 02e7c9f784..b768d1ca2b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ v6.22 Changes / Improvements / Optimisations: Bug Fixes: -- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 +- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8efc28ad2d..183b1d11e7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -933,12 +933,12 @@ _EOF_ local aservices=( # - ARMbian - firstrun - resize2fs - log2ram - armbian* + 'firstrun' + 'resize2fs' + 'log2ram' + 'armbian*' # - Meveric - cpu_governor + 'cpu_governor' ) From 718e1a6e09ae28bb3f4780f85ebdc92d24b18198 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Feb 2019 17:55:15 +0100 Subject: [PATCH 009/175] v6.22 + DietPi-Patch | Tiny: Avoid install "/etc/bashrc.d/" entry twice + tiny coding --- dietpi/patch_file | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 953e8badf0..60045b42ed 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -195,7 +195,7 @@ fi #------------------------------------------------------------------------------- #https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10646 - rm /etc/apt/sources.list.d/openmediavault.list &> /dev/null + [[ -f /etc/apt/sources.list.d/openmediavault.list ]] && rm /etc/apt/sources.list.d/openmediavault.list #------------------------------------------------------------------------------- #DietPi-Software removals: https://github.com/Fourdee/DietPi/issues/1491 if [[ -f /DietPi/dietpi/.installed ]]; then @@ -212,8 +212,7 @@ fi #------------------------------------------------------------------------------- #Nodered lacks homedir, create it: https://github.com/Fourdee/DietPi/issues/1446#issuecomment-366370800 - if grep -qi '^nodered:' /etc/passwd && - [[ ! -d /home/nodered ]]; then + if grep -qi '^nodered:' /etc/passwd && [[ ! -d /home/nodered ]]; then mkdir -p /home/nodered chown -R nodered:nodered /home/nodered @@ -262,7 +261,7 @@ StandardOutput=tty WantedBy=multi-user.target _EOF_ - systemctl enable rc-local.service + systemctl enable rc-local systemctl enable dietpi-postboot if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[168\]=2' /DietPi/dietpi/.installed; then @@ -290,7 +289,7 @@ _EOF_ sed -i 's@https://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/meveric* &> /dev/null #------------------------------------------------------------------------------- #Remove any existing apt recommends settings, before applying ours: https://github.com/Fourdee/DietPi/issues/1482#issuecomment-368031044 - rm /etc/apt/apt.conf.d/*recommends* &> /dev/null + rm -f /etc/apt/apt.conf.d/*recommends* G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-norecommends' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND @@ -348,7 +347,7 @@ _EOF_ # Odroids FFmpeg decendency fix: https://github.com/Fourdee/DietPi/issues/1556#issuecomment-369463910 if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 15 )); then - rm /etc/apt/preferences.d/meveric* + rm -f /etc/apt/preferences.d/meveric* cat << _EOF_ > /etc/apt/preferences.d/backports Package: * Pin: release a=jessie-backports @@ -623,7 +622,7 @@ _EOF_ #------------------------------------------------------------------------------- #Move DietPi globals and login scripts into new /etc/bashrc.d location to load on all interactive shells: mkdir -p /etc/bashrc.d - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + # => v6.22 #G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc sed -i '/\/DietPi/d' /root/.bashrc #should already be removed, failsafe start clean for i in /home/*/.bashrc; do sed -i '/\/DietPi/d' $i; done #should already be removed, failsafe start clean rm /etc/profile.d/99-dietpi* &> /dev/null From 8e718cc6ae208b78aa9e8b41e836ec35afe33a8c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 18:19:26 +0000 Subject: [PATCH 010/175] v6.22 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- dietpi/patch_file | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b768d1ca2b..de440544d7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..b4a823c8ef 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8723,7 +8723,7 @@ _EOF_ fi # - Adjust user group and home dir - usermod -a -G dietpi -d $G_FP_DIETPI_USERDATA/mopidy mopidy + usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy # - Adjust systemd unit to match new group and do not pre-create obsolete cache dir mkdir -p /etc/systemd/system/mopidy.service.d diff --git a/dietpi/patch_file b/dietpi/patch_file index 953e8badf0..144ad4a4f1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1651,6 +1651,13 @@ Also have a look at "Sonarr", another alternative TV show manager, available for sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- + #Mopidy fix: https://github.com/Fourdee/DietPi/issues/2536 + if grep -q '^mopidy' /etc/passwd; then + + usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy + + fi + #------------------------------------------------------------------------------- fi From 33abe47dce5333436f42dab25681552f705314c7 Mon Sep 17 00:00:00 2001 From: songz Date: Tue, 12 Feb 2019 02:35:12 +0800 Subject: [PATCH 011/175] add aria2 config option: rpc allow origin all to fix using 3rd party plugin; and comment unknown option; --- dietpi/dietpi-software | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..44b426c8ae 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11107,12 +11107,12 @@ _EOF_ G_BACKUP_FP /var/lib/dietpi/dietpi-software/installed/aria2.conf cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/aria2.conf # host is where aria2c is running on -host=localhost +# host=localhost dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS # cleanup_policy -cleanup-policy=clean_got -cleanup-percent=90% +# cleanup-policy=clean_got +# cleanup-percent=90% # The fallowing options are aria2c options as usual aria2.conf file # https://aria2.github.io/manual/en/html/aria2c.html @@ -11122,6 +11122,7 @@ enable-rpc=true rpc-listen-all=true rpc-listen-port=6800 rpc-secret=$GLOBAL_PW +rpc-allow-origin-all=true pause=false # General Options @@ -11148,18 +11149,18 @@ max-download-limit=0 seed-ratio=0.1 seed-time=0 -metalink-servers=$(Optimize_BitTorrent 2) +# metalink-servers=$(Optimize_BitTorrent 2) allow-overwrite=false always-resume=true auto-file-renaming=false file-allocation=none -[limit-options] +# [limit-options] max-concurrent-downloads=$(Optimize_BitTorrent 1) max-overall-download-limit=1000K max-overall-upload-limit=100K -[unlimit-options] +# [unlimit-options] max-concurrent-downloads=$(Optimize_BitTorrent 1) max-overall-download-limit=0 max-overall-upload-limit=0 From 4798faa17d9038370e4ab26cd1a463f4bf860a15 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 18:51:50 +0000 Subject: [PATCH 012/175] v6.22 + Minor/consistency --- dietpi/dietpi-update | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index d996c329fe..c80fb27f0c 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -45,6 +45,7 @@ UPDATE_AVAILABLE=0 UPDATE_REQUIRESNEWIMAGE=0 RUN_UPDATE=0 + DO_REBOOT=0 GITOWNER_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') GITOWNER_TARGET=${GITOWNER_TARGET:-Fourdee} @@ -525,22 +526,20 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - do_reboot=0 - # - 1st run setup if (( $G_DIETPI_INSTALL_STAGE < 2 )); then Apply_1st_Run_Update_Sucess G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup.\n\nPress Enter to Continue.' - do_reboot=1 + DO_REBOOT=1 # - Reboot prompt, if system is already installed else G_WHIP_YESNO "[ OK ] Update applied\n Current version: $INFO_CURRENT_VERSION\n -A system reboot is required to finalise the update. Would you like to reboot the system now?" && do_reboot=1 +A system reboot is required to finalise the update. Would you like to reboot the system now?" && DO_REBOOT=1 fi @@ -550,7 +549,7 @@ A system reboot is required to finalise the update. Would you like to reboot the G_RUN_CMD systemctl restart dietpi-ramdisk sync - (( $do_reboot )) && reboot + (( $DO_REBOOT )) && reboot /DietPi/dietpi/dietpi-services restart From 1272bf921fcd26ee9ce2f990a0d70e5463e7efa8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 20:30:08 +0000 Subject: [PATCH 013/175] v6.22 + Prevent initial update section running if already running. --- dietpi/login | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/dietpi/login b/dietpi/login index e8d9fcff0e..50d68c115a 100644 --- a/dietpi/login +++ b/dietpi/login @@ -157,21 +157,32 @@ # - 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + if pgrep 'dietpi-update' &> /dev/null; then - # Check NTP synced - /DietPi/dietpi/func/run_ntpd + local additional_text='Please resume setup on the active screen.' + grep -q '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && additional_text='Automated installation update is in progress, the system will reboot automatically when completed.' - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]]; then + G_WHIP_MSG "DietPi is currently running on another screen.\n\n$additional_text" - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + else - fi + # Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + + # Check NTP synced + /DietPi/dietpi/func/run_ntpd + + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]]; then + + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + fi + + /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + + fi # - 1st run dietpi-software installs elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then From 0a90f864793e92341870d78d06736bd2c9f980c3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Feb 2019 22:35:21 +0100 Subject: [PATCH 014/175] v6.22 + DietPi-Software | Aria2: Remove deprecated settings (instead of comment only); Remove doubled settings; Add bandwidth limit info --- dietpi/dietpi-software | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 44b426c8ae..7ce410d614 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11106,17 +11106,12 @@ _EOF_ G_BACKUP_FP /var/lib/dietpi/dietpi-software/installed/aria2.conf cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/aria2.conf -# host is where aria2c is running on -# host=localhost -dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS - -# cleanup_policy -# cleanup-policy=clean_got -# cleanup-percent=90% - # The fallowing options are aria2c options as usual aria2.conf file # https://aria2.github.io/manual/en/html/aria2c.html +# Download directory +dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS + # RPC Options enable-rpc=true rpc-listen-all=true @@ -11134,6 +11129,9 @@ continue=true check-integrity=true max-concurrent-downloads=$(Optimize_BitTorrent 1) max-connection-per-server=$(Optimize_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 max-file-not-found=3 max-tries=5 retry-wait=60 @@ -11149,21 +11147,10 @@ max-download-limit=0 seed-ratio=0.1 seed-time=0 -# metalink-servers=$(Optimize_BitTorrent 2) allow-overwrite=false always-resume=true auto-file-renaming=false file-allocation=none - -# [limit-options] -max-concurrent-downloads=$(Optimize_BitTorrent 1) -max-overall-download-limit=1000K -max-overall-upload-limit=100K - -# [unlimit-options] -max-concurrent-downloads=$(Optimize_BitTorrent 1) -max-overall-download-limit=0 -max-overall-upload-limit=0 _EOF_ cat << _EOF_ > /etc/systemd/system/aria2.service From 03394b9338e438aeea3263a1efb9e71e588d14b7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Feb 2019 22:54:46 +0100 Subject: [PATCH 015/175] v6.22 + CHANGELOG | Aria2: Config tweak/fix --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index de440544d7..ba72f18902 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 From f967a547899d07603937563fba9dcbf57807b797 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 12:39:05 +0100 Subject: [PATCH 016/175] v6.22 + DietPi-Software | Java: Reapply workaround to fix ARM install issue --- dietpi/dietpi-software | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f10da36ada..53b8e12d7c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6726,6 +6726,8 @@ 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 use backports repo: if (( $G_DISTRO == 3 )); then @@ -6735,14 +6737,14 @@ Pin: release a=jessie-backports Pin-Priority: 990 _EOF_ - G_AGI openjdk-8-jre-headless openjdk-8-jdk-headless -t jessie-backports - - else - - G_AGI openjdk-8-jre-headless openjdk-8-jdk-headless + packages+=' -t jessie-backports' fi + # Workaround for ARM install issue: https://github.com/Fourdee/DietPi/issues/2524 + apt-get install -y -qq $packages + G_AGI $package + fi software_id=9 From 92d9dca4ba3733bded2a87064441bcddc642f7e6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 12:42:44 +0100 Subject: [PATCH 017/175] v6.22 + CHANGELOG | Java: Resolved an issue where install failed on ARM --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ba72f18902..c5b970f095 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 +- DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From 7a274847d64ad8838dbd77c9992fa58f3be78a0b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 15:28:15 +0100 Subject: [PATCH 018/175] v6.22 + DietPi-Software | WireGuard: Add multiple clients as own [Peer] entries, so allow concurrent connections --- dietpi/dietpi-software | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e6eecf8a47..77460a90a6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10021,9 +10021,15 @@ ListenPort = $port PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o \$(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o \$(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE +# Client 1 [Peer] PublicKey = $( wg0-client.conf [Interface] -# The address must be unique for each client, use "10.9.0.3/24" for the second client and so on. Address = 10.9.0.2/24 PrivateKey = $( Date: Tue, 12 Feb 2019 17:24:41 +0100 Subject: [PATCH 019/175] v6.22 + DietPi-Software | Java: Fix wrong variable --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 53b8e12d7c..89a0dedb54 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6743,7 +6743,7 @@ _EOF_ # Workaround for ARM install issue: https://github.com/Fourdee/DietPi/issues/2524 apt-get install -y -qq $packages - G_AGI $package + G_AGI $packages fi From 902bc21921bf1167fa00923375e3b907d82ff31c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 12 Feb 2019 19:31:55 +0000 Subject: [PATCH 020/175] v6.22 - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. --- CHANGELOG.txt | 1 + dietpi/misc/dietpi-nordvpn | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2d226e8487..2f02989b87 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index b9ce207832..e03808127d 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -30,6 +30,7 @@ NORDVPN_SERVER='' PROTOCOL='udp' + NET_DEV='tun0' NORDVPN_CONNECTED=0 MAX_WAIT_FOR_CONNECTION=5 @@ -61,7 +62,7 @@ NORDVPN_CONNECTED=0 local status=1 #if systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'; then - if ip r | grep -q 'tun0'; then + if ip r | grep -q $NET_DEV; then status=0 NORDVPN_CONNECTED=1 @@ -161,7 +162,34 @@ _EOF_ local text_status='Status:\n' if Check_Connected; then - text_status+=" - Connected to $NORDVPN_SERVER" + text_status+=" - Connected : $NORDVPN_SERVER\n" + + local net_rx_byte=0 + local net_tx_byte=0 + local net_rx_mb='N/A' + local net_tx_mb='N/A' + + 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 + + net_tx_mb='Unknown' + if disable_error=1 G_CHECK_VALIDINT $net_tx_byte && (( $net_tx_byte > 0 )); then + + net_tx_mb="$(( $net_tx_byte / 1024 / 1024 ))MB" + + fi + + fi + + text_status+=" - Usage : Sent = $net_tx_mb | Recieved = $net_rx_mb" else From 11b1a4b9b9f0722f5210ce55866aa8c6004d720b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 02:39:15 +0100 Subject: [PATCH 021/175] v6.22 + DietPi-Login | Remove "Filesystem prep" install state info, as this does not exist anymore, instead warn user about unknown install state, ask for check and report issue + DietPi-Login | Prompt G_WHIP_MSG, if install state is "-1" to make this more prominent + DietPi-Login | Check for root user before starting first run setup, otherwise ask user to login as root + DietPi-Login | Assure that user accepts license interactively one time: Skip on automated install to have it shown on first normal login instead + DietPi-Login | If on first run setup dietpi-update or dietpi-software is running in other session, show same G_WHIP once and exit script to prevent user from being kept in loop that can never be resolved in this session. + DietPi-Login | Re-read install state after first run update and dietpi-software run, to exit loop if immediate reboot was skipped. Allow update and installs in a single loop, e.g. if already on latest version, so second loop is an error indicator. Inform user in case. Apply install state 0, if not valid before second loop to prevent unlimited repeats. --- dietpi/login | 193 ++++++++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 85 deletions(-) diff --git a/dietpi/login b/dietpi/login index 50d68c115a..85a05624f1 100644 --- a/dietpi/login +++ b/dietpi/login @@ -13,7 +13,7 @@ # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// - #Precaution: Wait for DietPi Ramdisk to finish + # Precaution: Wait for DietPi RAMdisk to finish until [[ -f /DietPi/.ramdisk ]] do @@ -22,35 +22,35 @@ done - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Login' #G_INIT - ##Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' FP_TMP_DIETPI_FIRSTRUNSETUP_LOG='/tmp/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// - #DietPi-Autostart + # DietPi-Autostart #///////////////////////////////////////////////////////////////////////////////////// AUTO_START_INDEX=0 [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && AUTO_START_INDEX=$(= $max_seconds )) && break done - #Kodi + # - Kodi if (( $AUTO_START_INDEX == 1 )); then /DietPi/dietpi/misc/start_kodi - #Desktop (LXDE/MATE etc) + # - Desktop (LXDE/MATE etc) elif (( $AUTO_START_INDEX == 2 )); then clear @@ -84,49 +82,46 @@ fi - #RetroPie/Emulation station + # - RetroPie/Emulation station elif (( $AUTO_START_INDEX == 3 )); then - #emulationstation - can no longer be run as root + # emulationstation - can no longer be run as root /opt/retropie/supplementary/emulationstation/emulationstation.sh - #OpenTyrian + # - OpenTyrian elif (( $AUTO_START_INDEX == 4 )); then /usr/local/games/opentyrian/run - #DietPi-Cloudshell + # - DietPi-Cloudshell elif (( $AUTO_START_INDEX == 5 )); then - #Launch DietPi-Cloudshell setterm --blank 0 --powersave off --cursor off systemctl start dietpi-cloudshell - #Amiberry standard boot + # - Amiberry standard boot elif (( $AUTO_START_INDEX == 8 )); then systemctl start amiberry - #DXX-Rebirth + # - DXX-Rebirth elif (( $AUTO_START_INDEX == 9 )); then $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh - #CAVA + # - CAVA elif (( $AUTO_START_INDEX == 10 )); then - # wait for MPD fifo to start - sleep 4 - + sleep 4 # Wait for MPD fifo to start setterm --blank 0 --powersave off cava - #Chromium + # - Chromium elif (( $AUTO_START_INDEX == 11 )); then /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh - #LightDM + # - LightDM elif (( $AUTO_START_INDEX == 16 )); then /usr/sbin/lightdm @@ -139,89 +134,92 @@ Run_First_Update_Setup(){ - /DietPi/dietpi/func/dietpi-banner 0 local automated_setup=0 - until (( $G_DIETPI_INSTALL_STAGE == 2 )) - do - - # - Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # First run setup running in other session + Other_Session_User_Prompt(){ - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + local additional_text='Please resume setup on the active screen.' + (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' - fi + # Force interactive whiptail + G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" - # - 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + exit - if pgrep 'dietpi-update' &> /dev/null; then + } - local additional_text='Please resume setup on the active screen.' - grep -q '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && additional_text='Automated installation update is in progress, the system will reboot automatically when completed.' + # Automated? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - G_WHIP_MSG "DietPi is currently running on another screen.\n\n$additional_text" + automated_setup=1 + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - else + fi - # Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then - # Check NTP synced - /DietPi/dietpi/func/run_ntpd + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]]; then + fi - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + until (( $G_DIETPI_INSTALL_STAGE == 2 )) + do - fi + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + 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 - # - 1st run dietpi-software installs - elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - # Wait for DietPi-Software if already running, else run it - local run_dietpi_software=1 - while pgrep 'dietpi-software' &> /dev/null - do + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - run_dietpi_software=0 + # - Update install state, to allow DietPi-Software in same loop, if no update was required + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - G_DIETPI-NOTIFY 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + mv $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG $FP_DIETPI_FIRSTRUNSETUP_LOG - fi + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } - fi + G_WHIP_MSG "[FAILED] First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now try to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" fi - # - reset to auto detection - unset G_USER_INPUTS - done } @@ -234,32 +232,57 @@ /DietPi/dietpi/func/obtain_network_details #---------------------------------------------------------------- - #Normal Login + # Normal Login if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + # - Show GPL license on first normal login, if setup was automated + if [[ -f /var/lib/dietpi/license.txt ]]; then + + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt + + fi + /DietPi/dietpi/func/dietpi-banner 1 (( $AUTO_START_INDEX > 0 )) && Run_AutoStart #---------------------------------------------------------------- - #Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE >= 0 )); then + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - Run_First_Update_Setup + /DietPi/dietpi/func/dietpi-banner 0 + + if (( $UID )); then + + G_WHIP_MSG '[WARNING] Root login required\n +To finish DietPi first run setup, root permissions are required.\n +Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' + + else + + Run_First_Update_Setup + + fi #---------------------------------------------------------------- - #DietPi finishing up bootloader. + # DietPi-Boot first run setup not finished elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' >> DietPi System prep is nearly completed: \n Please run /DietPi/dietpi/login after a few seconds.' + G_WHIP_MSG '[WARNING] Boot scripts still running\n +DietPi boot scripts have not yet finished system preparations.\n +Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' #---------------------------------------------------------------- - #DietPi running filesystem prep + # Unknown install state else /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' >> Filesystem prep has not yet completed: \n Please wait for the system to reboot.' + G_WHIP_MSG '[WARNING] Unknown install state\n +DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n + systemctl status dietpi-*\n +In case report this issue to: https://github.com/Fourdee/DietPi/issues' fi From 27db0019546b00ef659ef13d7344554451bb0df6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 03:28:07 +0100 Subject: [PATCH 022/175] v6.22 + DietPi-Banner | Coding --- dietpi/func/dietpi-banner | 81 ++++++++++++++------------------------- 1 file changed, 29 insertions(+), 52 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 823f17b423..8c14362b5d 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -17,28 +17,20 @@ # - dietpi-banner 1 = top section and credits + clear #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Banner' G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- INPUT=0 - if disable_error=1 G_CHECK_VALIDINT $1; then - - INPUT=$1 - - fi + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" - if [[ $G_GITBRANCH != 'master' ]]; then - - DIETPI_VERSION+=" ($G_GITBRANCH)" - - fi + [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) @@ -53,11 +45,11 @@ } UPDATE_AVAILABLE=0 - UPDATE_AVAILABLE_VERSION='' #-1 = image required, other value=latest version + UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version Obtain_Update_Available(){ - #Update Available + # Update Available if [[ -f '/DietPi/dietpi/.update_available' ]]; then UPDATE_AVAILABLE=1 @@ -75,12 +67,8 @@ IPAddress_Print(){ - #Try to re-obtain IP if missing - if [[ -z $IP_ADDRESS ]]; then - - Update_Ip_Address - - fi + # Try to re-obtain IP if missing + [[ $IP_ADDRESS ]] || Update_Ip_Address echo -e " \e[1m$IP_ADAPTER\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" @@ -93,23 +81,23 @@ Banner_TopText_Extras(){ - #Update Available + # Update Available if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then - TEXT_TOP="\e[90m| \e[1;33mImage available\e[0m" + TEXT_TOP='\e[90m| \e[1;33mImage available\e[0m' else - TEXT_TOP="\e[90m| \e[1;33mUpdate available\e[0m" + TEXT_TOP='\e[90m| \e[1;33mUpdate available\e[0m' fi - #Use TEXT_TOP for storing helpful info + # Use TEXT_TOP for storing helpful info else - #Helpful mode + # Helpful mode TEXT_TOP="\e[90m| $(date +"%a %x - %R")\e[0m" fi @@ -117,31 +105,24 @@ Banner_Dietpi(){ - if (( $INPUT == 1 )); then - - printf '\ec' # clear current terminal screen - - fi + (( $INPUT == 1 )) && printf '\ec' # clear current terminal screen echo -e " \e[38;5;154m────────────────────────────────────────────────\e[0m\n \e[1mDietPi\e[0m $TEXT_TOP\n \e[38;5;154m────────────────────────────────────────────────\e[0m" Hardware_Model_Print IPAddress_Print + } Credits_Print(){ - echo -e "\e[90m DietPi Team : Daniel Knight (founder), MichaIng, K-Plan\e[0m" + echo -e '\e[90m DietPi Team : Daniel Knight (founder), MichaIng, K-Plan\e[0m' local fp_prep_info='/DietPi/dietpi/.prep_info' if [[ -f $fp_prep_info ]]; then - local image_creator="$(sed -n 1p $fp_prep_info)" - local preimage_name="$(sed -n 2p $fp_prep_info)" - if [[ $image_creator == '0' ]]; then - - image_creator='DietPi Core Team' - - fi + local image_creator=$(sed -n 1p $fp_prep_info) + local preimage_name=$(sed -n 2p $fp_prep_info) + [[ $image_creator == '0' ]] && image_creator='DietPi Core Team' echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" @@ -153,23 +134,19 @@ Patreon Legends : PINE64 community Donate : https://DietPi.com/#donate' - if [[ $IMAGE_ADDITIONAL_CREDITS ]]; then - - echo -e "\n\ Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS" - - fi + [[ $IMAGE_ADDITIONAL_CREDITS ]] && echo -e "\n\ Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS" - echo -e " DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m" - echo -e "\n\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place." - echo -e "\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device." - echo -e "\e[1m dietpi-software\e[0m = Select optimized software for installation." + echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m\n +\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. +\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. +\e[1m dietpi-software\e[0m = Select optimized software for installation.' - #Update available? + # Update available? if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION = '-1' ]]; then - echo -e "\n\e[1;31m Updated DietPi image is available, please download it:\e[0m\n https://dietpi.com/download\n" + echo -e '\n\e[1;31m Updated DietPi image is available, please download it:\e[0m\n https://dietpi.com/download\n' else @@ -179,8 +156,8 @@ fi - echo -e "\e[1m htop\e[0m = Resource monitor." - echo -e "\e[1m cpu\e[0m = Shows CPU information and stats.\n" + echo -e '\e[1m htop\e[0m = Resource monitor. +\e[1m cpu\e[0m = Shows CPU information and stats.\n' } From 95e29fcc2bbd770d1783985bb4a06a97d6540590 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 13 Feb 2019 17:17:33 +0000 Subject: [PATCH 023/175] v6.22 + Minor code + Log to disk --- dietpi/login | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dietpi/login b/dietpi/login index 85a05624f1..b28642c10f 100644 --- a/dietpi/login +++ b/dietpi/login @@ -32,7 +32,6 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_TMP_DIETPI_FIRSTRUNSETUP_LOG='/tmp/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// # DietPi-Autostart @@ -196,8 +195,7 @@ pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - mv $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG $FP_DIETPI_FIRSTRUNSETUP_LOG + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 # - Update install state, to exit loop, if user skipped immediate reboot export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 17:36:15 +0000 Subject: [PATCH 024/175] v6.22 + Minor optimization --- dietpi/login | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/dietpi/login b/dietpi/login index b28642c10f..d40d79388e 100644 --- a/dietpi/login +++ b/dietpi/login @@ -13,15 +13,6 @@ # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// - # Precaution: Wait for DietPi RAMdisk to finish - until [[ -f /DietPi/.ramdisk ]] - do - - G_DIETPI-NOTIFY 2 'Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM...' - sleep 1 - - done - # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Login' @@ -33,12 +24,6 @@ #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - #///////////////////////////////////////////////////////////////////////////////////// - # DietPi-Autostart - #///////////////////////////////////////////////////////////////////////////////////// - AUTO_START_INDEX=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && AUTO_START_INDEX=$( 0 )) && Run_AutoStart + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart #---------------------------------------------------------------- # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) From f303a3014ec71dcfa393737429dd3a58af956716 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 17:43:07 +0000 Subject: [PATCH 025/175] v6.22 + revert --- dietpi/login | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index d40d79388e..85e65d5f62 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # Check for second loop and in case inform user, since this indicates an error - if (( $G_DIETPI_INSTALL_STAGE != 2 )); then + if ! (( $G_DIETPI_INSTALL_STAGE == 2 )); then # - Force interactive mode to show G_WHIP error prompts export G_USER_INPUTS=1 @@ -273,5 +273,6 @@ In case report this issue to: https://github.com/Fourdee/DietPi/issues' #----------------------------------------------------------------------------------- exit + #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } From ee924aaa1d3b7c6e72d943f9fe7bc0d4ff7cb272 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:49:47 +0100 Subject: [PATCH 026/175] v6.22 + DietPi-Boot | Assure it has finished before OpenSSH and Dropbear to prevent too early login + DietPi-Boot | Add "Before=getty-pre.target" which is reached on Buster before any getty starts. This is actually what we want, does not exist on Stretch yet but does not harm to add. On Buster we should add it to Wants= as well, as it is not pulled in automatically. But on Stretch this would produce an error, as it does not exist. --- rootfs/etc/systemd/system/dietpi-boot.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index a0c8804dc7..e90a1b3bb5 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -3,7 +3,7 @@ Description=DietPi-Boot # Order 3 Requires=dietpi-preboot.service After=dietpi-preboot.service network.target networking.service -Before=getty@tty1.service getty.target +Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.service [Service] Type=oneshot From 1d718e4291ee983c8d13d313b0a27720311c3e7d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 19:43:31 +0100 Subject: [PATCH 027/175] v6.22 + DietPi-Login | Log STDERR to first run setup log as well + DietPi-Login | Add info comment why we use "! (( $G_DIETPI_INSTALL_STAGE == 2 ))", to not forget --- dietpi/login | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..7b094a9b6d 100644 --- a/dietpi/login +++ b/dietpi/login @@ -181,7 +181,7 @@ pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 # - Update install state, to exit loop, if user skipped immediate reboot export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 19:22:34 +0000 Subject: [PATCH 028/175] v6.22 + fix: Does not run on RPi during boot. --- dietpi/login | 207 ++++++++---------- .../systemd/system/dietpi-postboot.service | 2 +- 2 files changed, 98 insertions(+), 111 deletions(-) diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..ac001a85a6 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,9 +14,7 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT + # In main loop # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -34,19 +32,6 @@ # - Boot to specific program if (( $screen_valid )); then - # - Wait for DietPi-PostBoot - local max_seconds=15 - local current_seconds=1 - until systemctl status dietpi-postboot | grep -qi 'exited' - do - - G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" - sleep 1 - ((current_seconds++)) - (( $current_seconds >= $max_seconds )) && break - - done - # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -119,13 +104,11 @@ # First Run Setup Run_First_Update_Setup(){ - local automated_setup=0 - # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -134,145 +117,149 @@ } - # Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + 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 - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - fi + # - Update install state, to allow DietPi-Software in same loop + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Check internet - 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 + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + fi - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + } - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } + G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' + sleep 1 - G_WHIP_MSG "[FAILED] First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now try to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" + done - fi + # - Automated install? + if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - done + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - } + fi - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// + /DietPi/dietpi/func/obtain_network_details - #Update network details for banner IP address. - /DietPi/dietpi/func/obtain_network_details + Show_License - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - # - Show GPL license on first normal login, if setup was automated - if [[ -f /var/lib/dietpi/license.txt ]]; then + /DietPi/dietpi/func/dietpi-banner 1 - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - fi + break - /DietPi/dietpi/func/dietpi-banner 1 - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 0 + if (( $G_CHECK_ROOT_USER_VERIFIED )); then - /DietPi/dietpi/func/dietpi-banner 0 + Run_First_Update_Setup - if (( $UID )); then + else - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - else + break - Run_First_Update_Setup + fi - fi + #---------------------------------------------------------------- + # Unknown install state + else - #---------------------------------------------------------------- - # DietPi-Boot first run setup not finished - elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then + /DietPi/dietpi/func/dietpi-banner 0 - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Boot scripts still running\n -DietPi boot scripts have not yet finished system preparations.\n -Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' + # - Force interactive mode to show G_WHIP error prompts + export G_USER_INPUTS=1 - #---------------------------------------------------------------- - # Unknown install state - else + if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now attempt to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Unknown install state\n -DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n - systemctl status dietpi-*\n -In case report this issue to: https://github.com/Fourdee/DietPi/issues' + # - reset to 0 to force update and fix code + echo 0 > /DietPi/dietpi/.install_stage - fi + else + + break + + fi + + fi + + done + + } + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + Main #----------------------------------------------------------------------------------- exit - #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 30c7672188..204dc67008 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service multi-user.target +After=dietpi-boot.service [Service] Type=idle From ac7975c48f9884fd09369363563eb8ff59500c09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:22:41 +0000 Subject: [PATCH 029/175] Revert "v6.22" This reverts commit 1467813234e7eb0e41cd6038c89f23d7e8bac0bd. --- dietpi/login | 207 ++++++++++-------- .../systemd/system/dietpi-postboot.service | 2 +- 2 files changed, 111 insertions(+), 98 deletions(-) diff --git a/dietpi/login b/dietpi/login index ac001a85a6..85e65d5f62 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,7 +14,9 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - # In main loop + . /DietPi/dietpi/func/dietpi-globals + G_PROGRAM_NAME='DietPi-Login' + #G_INIT # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -32,6 +34,19 @@ # - Boot to specific program if (( $screen_valid )); then + # - Wait for DietPi-PostBoot + local max_seconds=15 + local current_seconds=1 + until systemctl status dietpi-postboot | grep -qi 'exited' + do + + G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" + sleep 1 + ((current_seconds++)) + (( $current_seconds >= $max_seconds )) && break + + done + # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -104,11 +119,13 @@ # First Run Setup Run_First_Update_Setup(){ + local automated_setup=0 + # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -117,149 +134,145 @@ } - # 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + # Automated? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + automated_setup=1 + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - # - Check internet - 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 + fi - # - Check NTP synced - /DietPi/dietpi/func/run_ntpd + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then - # - Start DietPi-Update - /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - # - Update install state, to allow DietPi-Software in same loop - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - } + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - Main(){ + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } - done + G_WHIP_MSG "[FAILED] First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now try to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" - # - Automated install? - if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + fi - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + done - fi + } - /DietPi/dietpi/func/obtain_network_details + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// - Show_License + #Update network details for banner IP address. + /DietPi/dietpi/func/obtain_network_details - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /DietPi/dietpi/func/dietpi-banner 1 + # - Show GPL license on first normal login, if setup was automated + if [[ -f /var/lib/dietpi/license.txt ]]; then - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - break + fi - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 1 + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - /DietPi/dietpi/func/dietpi-banner 0 - if (( $G_CHECK_ROOT_USER_VERIFIED )); then + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - Run_First_Update_Setup + /DietPi/dietpi/func/dietpi-banner 0 - else + if (( $UID )); then - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - break - - fi + else - #---------------------------------------------------------------- - # Unknown install state - else + Run_First_Update_Setup - /DietPi/dietpi/func/dietpi-banner 0 - - # - Force interactive mode to show G_WHIP error prompts - export G_USER_INPUTS=1 - - if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now attempt to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - - # - reset to 0 to force update and fix code - echo 0 > /DietPi/dietpi/.install_stage - - else - - break + fi - fi + #---------------------------------------------------------------- + # DietPi-Boot first run setup not finished + elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then - fi + /DietPi/dietpi/func/dietpi-banner 0 + G_WHIP_MSG '[WARNING] Boot scripts still running\n +DietPi boot scripts have not yet finished system preparations.\n +Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' - done + #---------------------------------------------------------------- + # Unknown install state + else - } + /DietPi/dietpi/func/dietpi-banner 0 + G_WHIP_MSG '[WARNING] Unknown install state\n +DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n + systemctl status dietpi-*\n +In case report this issue to: https://github.com/Fourdee/DietPi/issues' - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - Main + fi #----------------------------------------------------------------------------------- exit + #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 204dc67008..30c7672188 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service +After=dietpi-boot.service multi-user.target [Service] Type=idle From bcb380667f5616f6c6fdf63d264f3f55f49a5baa Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:23:03 +0000 Subject: [PATCH 030/175] v6.22 + Fix: does not run on RPi during boot. --- rootfs/etc/systemd/system/dietpi-postboot.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 30c7672188..204dc67008 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service multi-user.target +After=dietpi-boot.service [Service] Type=idle From 2ec69cf3581ecc8e7af1666716d93d42298bc2ad Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:24:06 +0000 Subject: [PATCH 031/175] v6.22 + Login script rewrite + Minimize system reboots required aftert updates Not finished yet, will test and patch. --- dietpi/dietpi-software | 2 + dietpi/dietpi-update | 21 +---- dietpi/login | 207 +++++++++++++++++++---------------------- 3 files changed, 101 insertions(+), 129 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a371c26c91..c1f826e7b5 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16172,6 +16172,8 @@ NB: You can use dietpi-software at a later date, to install optimized software f #exit menu system TARGETMENUID=-1 + DISABLE_REBOOT=1 + #Enable installation start flag GOSTARTINSTALL=1 diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index c80fb27f0c..be61dfbb83 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -410,7 +410,6 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -527,21 +526,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" # - 1st run setup - if (( $G_DIETPI_INSTALL_STAGE < 2 )); then - - Apply_1st_Run_Update_Sucess - - G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup.\n\nPress Enter to Continue.' - DO_REBOOT=1 - - # - Reboot prompt, if system is already installed - else - - G_WHIP_YESNO "[ OK ] Update applied\n -Current version: $INFO_CURRENT_VERSION\n -A system reboot is required to finalise the update. Would you like to reboot the system now?" && DO_REBOOT=1 - - fi + Apply_1st_Run_Update_Sucess # Failsafe: Restart RAMdisk + sync to disk # - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222 @@ -549,9 +534,7 @@ A system reboot is required to finalise the update. Would you like to reboot the G_RUN_CMD systemctl restart dietpi-ramdisk sync - (( $DO_REBOOT )) && reboot - - /DietPi/dietpi/dietpi-services restart + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-services restart fi diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..ac001a85a6 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,9 +14,7 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT + # In main loop # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -34,19 +32,6 @@ # - Boot to specific program if (( $screen_valid )); then - # - Wait for DietPi-PostBoot - local max_seconds=15 - local current_seconds=1 - until systemctl status dietpi-postboot | grep -qi 'exited' - do - - G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" - sleep 1 - ((current_seconds++)) - (( $current_seconds >= $max_seconds )) && break - - done - # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -119,13 +104,11 @@ # First Run Setup Run_First_Update_Setup(){ - local automated_setup=0 - # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -134,145 +117,149 @@ } - # Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + 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 - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - fi + # - Update install state, to allow DietPi-Software in same loop + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Check internet - 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 + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + fi - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + } - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } + G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' + sleep 1 - G_WHIP_MSG "[FAILED] First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now try to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" + done - fi + # - Automated install? + if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - done + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - } + fi - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// + /DietPi/dietpi/func/obtain_network_details - #Update network details for banner IP address. - /DietPi/dietpi/func/obtain_network_details + Show_License - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - # - Show GPL license on first normal login, if setup was automated - if [[ -f /var/lib/dietpi/license.txt ]]; then + /DietPi/dietpi/func/dietpi-banner 1 - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - fi + break - /DietPi/dietpi/func/dietpi-banner 1 - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 0 + if (( $G_CHECK_ROOT_USER_VERIFIED )); then - /DietPi/dietpi/func/dietpi-banner 0 + Run_First_Update_Setup - if (( $UID )); then + else - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - else + break - Run_First_Update_Setup + fi - fi + #---------------------------------------------------------------- + # Unknown install state + else - #---------------------------------------------------------------- - # DietPi-Boot first run setup not finished - elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then + /DietPi/dietpi/func/dietpi-banner 0 - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Boot scripts still running\n -DietPi boot scripts have not yet finished system preparations.\n -Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' + # - Force interactive mode to show G_WHIP error prompts + export G_USER_INPUTS=1 - #---------------------------------------------------------------- - # Unknown install state - else + if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now attempt to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Unknown install state\n -DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n - systemctl status dietpi-*\n -In case report this issue to: https://github.com/Fourdee/DietPi/issues' + # - reset to 0 to force update and fix code + echo 0 > /DietPi/dietpi/.install_stage - fi + else + + break + + fi + + fi + + done + + } + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + Main #----------------------------------------------------------------------------------- exit - #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } From d7df082b24f220e843b156e0717ce13e681ce6cb Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:40:29 +0000 Subject: [PATCH 032/175] v6.22 + Fix --- dietpi/login | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/login b/dietpi/login index ac001a85a6..bc8fbc3647 100644 --- a/dietpi/login +++ b/dietpi/login @@ -211,6 +211,8 @@ elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/func/dietpi-banner 0 + + G_CHECK_ROOT_USER if (( $G_CHECK_ROOT_USER_VERIFIED )); then Run_First_Update_Setup From 923468ec0677ad7c5677149dfe64a23c045e7869 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:46:33 +0000 Subject: [PATCH 033/175] v6.22 + Minor --- dietpi/dietpi-update | 1 - dietpi/login | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index be61dfbb83..678afcd221 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -45,7 +45,6 @@ UPDATE_AVAILABLE=0 UPDATE_REQUIRESNEWIMAGE=0 RUN_UPDATE=0 - DO_REBOOT=0 GITOWNER_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') GITOWNER_TARGET=${GITOWNER_TARGET:-Fourdee} diff --git a/dietpi/login b/dietpi/login index bc8fbc3647..a8d8835be8 100644 --- a/dietpi/login +++ b/dietpi/login @@ -144,7 +144,7 @@ # - Start DietPi-Software /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Update install state, to exit loop, if user skipped immediate reboot + # - Update install state, to exit loop, if no software changes made/reboot required export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 21:07:14 +0100 Subject: [PATCH 034/175] v6.22 + DietPi-Update | Spelling --- dietpi/dietpi-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 678afcd221..69b08c7e57 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -402,7 +402,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE } - Apply_1st_Run_Update_Sucess(){ + Apply_1st_Run_Update_Success(){ # - 1st run setup (( $G_DIETPI_INSTALL_STAGE < 2 )) && echo 1 > /DietPi/dietpi/.install_stage @@ -489,7 +489,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" G_DIETPI-NOTIFY 0 'No updates required, your DietPi installation is up to date.\n' - Apply_1st_Run_Update_Sucess + Apply_1st_Run_Update_Success fi @@ -525,7 +525,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" # - 1st run setup - Apply_1st_Run_Update_Sucess + Apply_1st_Run_Update_Success # Failsafe: Restart RAMdisk + sync to disk # - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222 From faf3550610de9eb336082848da558939da1d9e2e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 21:21:38 +0100 Subject: [PATCH 035/175] v6.22 + DietPi-Login | Remove "export G_DIETPI_INSTALL_STAGE" since every loop re-reads this via DietPi-Globals + DietPi-Login | Log STDERR to first run setup log as well --- dietpi/login | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dietpi/login b/dietpi/login index a8d8835be8..3aa2fa3ba2 100644 --- a/dietpi/login +++ b/dietpi/login @@ -132,9 +132,6 @@ # - Start DietPi-Update /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - # - Update install state, to allow DietPi-Software in same loop - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - - # - Update install state, to exit loop, if no software changes made/reboot required - export G_DIETPI_INSTALL_STAGE=$(&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 fi From 2c5d01ad46696ad4e32a8ae63972fb737b28400d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 22:19:19 +0100 Subject: [PATCH 036/175] v6.22 + DietPi-Login | Fix changed AUTO_START_INDEX => auto_start_index + DietPi-Login | Check for PostBoot finish only once before loop: Tiny speed-up of following loops + DietPi-Login | Check for AUTO_SETUP_AUTOMATED only once before loop, to have "export G_USER_INPUTS=0" not being overwritten on error --- dietpi/login | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/dietpi/login b/dietpi/login index 3aa2fa3ba2..ef35f2d400 100644 --- a/dietpi/login +++ b/dietpi/login @@ -33,12 +33,12 @@ if (( $screen_valid )); then # - Kodi - if (( $AUTO_START_INDEX == 1 )); then + if (( $auto_start_index == 1 )); then /DietPi/dietpi/misc/start_kodi # - Desktop (LXDE/MATE etc) - elif (( $AUTO_START_INDEX == 2 )); then + elif (( $auto_start_index == 2 )); then clear if (( $G_HW_MODEL == 11 )); then @@ -52,46 +52,46 @@ fi # - RetroPie/Emulation station - elif (( $AUTO_START_INDEX == 3 )); then + elif (( $auto_start_index == 3 )); then # emulationstation - can no longer be run as root /opt/retropie/supplementary/emulationstation/emulationstation.sh # - OpenTyrian - elif (( $AUTO_START_INDEX == 4 )); then + elif (( $auto_start_index == 4 )); then /usr/local/games/opentyrian/run # - DietPi-Cloudshell - elif (( $AUTO_START_INDEX == 5 )); then + elif (( $auto_start_index == 5 )); then setterm --blank 0 --powersave off --cursor off systemctl start dietpi-cloudshell # - Amiberry standard boot - elif (( $AUTO_START_INDEX == 8 )); then + elif (( $auto_start_index == 8 )); then systemctl start amiberry # - DXX-Rebirth - elif (( $AUTO_START_INDEX == 9 )); then + elif (( $auto_start_index == 9 )); then $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh # - CAVA - elif (( $AUTO_START_INDEX == 10 )); then + elif (( $auto_start_index == 10 )); then sleep 4 # Wait for MPD fifo to start setterm --blank 0 --powersave off cava # - Chromium - elif (( $AUTO_START_INDEX == 11 )); then + elif (( $auto_start_index == 11 )); then /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh # - LightDM - elif (( $AUTO_START_INDEX == 16 )); then + elif (( $auto_start_index == 16 )); then /usr/sbin/lightdm @@ -158,31 +158,31 @@ Main(){ - while : + # Wait for full system boot + until systemctl status dietpi-postboot | grep -qi 'exited' do - # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT - # Import DietPi-Globals -------------------------------------------------------------- + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' + sleep 1 - # - Wait for full system boot - until systemctl status dietpi-postboot | grep -qi 'exited' - do + done - G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' - sleep 1 + # Automated first run setup? + if (( $( Date: Wed, 13 Feb 2019 23:20:12 +0100 Subject: [PATCH 037/175] v6.22 + DietPi-Software | WireGuard: Fix Debian Sid repo not being removed correctly on uninstall --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c1f826e7b5..a7fd03b77e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13656,7 +13656,7 @@ _EOF_ Banner_Uninstalling G_AGP wireguard* [[ -d /etc/wireguard ]] && rm -R /etc/wireguard - [[ -f /etc/apt/sources.d/dietpi-wireguard.list ]] && rm /etc/apt/sources.d/dietpi-wireguard.list + [[ -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 From 484f34751ced06bb00eba0aff2393cba9d50fb54 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 23:23:23 +0100 Subject: [PATCH 038/175] v6.22 + CHANGELOG | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2f02989b87..cb4259505a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,7 +4,7 @@ v6.22 Changes / Improvements / Optimisations: - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. -- DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 +- DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 @@ -12,6 +12,7 @@ Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 +- DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From d1dbf3c0a3f56c0b9b1612ab4d29dde5c85c1150 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 00:52:02 +0100 Subject: [PATCH 039/175] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: Fix module source build, add informational comments --- dietpi/func/dietpi-set_hardware | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index fbb0eabd85..ddd76912e8 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1988,7 +1988,9 @@ _EOF_ local old_firmware=$(ls /lib/modules/) local rpi_firmware='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0' G_AGUP - G_AGI $rpi_firmware raspberrypi-kernel-headers make + # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo + # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 + G_AGI $rpi_firmware raspberrypi-kernel-headers make g++-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe if [[ $old_firmware != $(ls /lib/modules/) ]]; then @@ -2000,10 +2002,14 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c fi + # - /lib/modules/$(uname -r)/source expected, but only .../build included in headers package currently + # - A symlink does the job: https://github.com/notro/rpi-source/blob/master/rpi-source#L340-L341 + [[ -e /lib/modules/$(uname -r)/source ]] || ln -s /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source + # - Build dtoverlay mkdir -p i-sabre-k2m_build cd i-sabre-k2m_build - install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' + install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' # https://github.com/SatoruKawase/I-Sabre-K2M G_CHECK_URL "$install_url_address" wget "$install_url_address" -O package.7z 7z x -y package.7z From 1f98515dc8443c5a0a08bd1cb56e575b04960fea Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 01:26:30 +0100 Subject: [PATCH 040/175] v6.22 + DietPi-Set_Software | Remove obsolete workaround for archive.raspberrypi.org repo on Buster --- dietpi/func/dietpi-set_software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index e1919c7ea8..c3c5cecc68 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -132,9 +132,6 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list - # Highest available raspi.list distro is currently Stretch, working good enough for testing purposes with Raspbian Buster: - (( $G_DISTRO > 4 )) && sed -i "s/$G_DISTRO_NAME/stretch/" /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 From e59cc70df2682cb013a693e0d126aeb3b7e7d762 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 01:38:08 +0100 Subject: [PATCH 041/175] v6.22 + DietPi-Patch | Remove obsolete workaround for archive.raspberrypi.org repo on Buster --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index ae7091584c..501c26edda 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1657,6 +1657,9 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 + (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list + #------------------------------------------------------------------------------- fi From 649574f6a792ae7833f6e8b71b32ab5640d8ff84 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 16:16:30 +0100 Subject: [PATCH 042/175] v6.22 (#2552) + DietPi-Software | Remot3.it: Fix install due to changed Git repo. Install latest available version via: api.github.com + DietPi-Software | Remot3.it: Now available for ARMv8 and x86_64 as well + CHANGELOG | Remot3.it: Resolved an issue where install failed due to Git repo changes --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 38 +++++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb4259505a..b60a6da499 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 +- DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a7fd03b77e..f4ee6cb6c9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1527,11 +1527,7 @@ _EOF_ 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]='f=8&t=5&start=20#p188' - - # - Currently ARMv6/7 only - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' #------------------ software_id=138 @@ -4336,12 +4332,30 @@ _EOF_ fi - #WEAVED - software_id=68 + software_id=68 # Remot3.it (previously Weaved) if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - Download_Install 'https://github.com/weaved/installer/raw/master/Raspbian%20deb/1.3-07/weavedconnectd_1.3-07z1_armhf.deb' + INSTALL_URL_ADDRESS='https://api.github.com/repos/remoteit/installer/releases/latest' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + + # ARMv6/7 + local arch='armhf' + + # ARMv8 + if (( $G_HW_ARCH == 3 )); then + + arch='arm64' + + # x86_64 + elif (( $G_HW_ARCH == 10 )); then + + arch='amd64' + + fi + + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) + no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" fi @@ -13489,13 +13503,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # <= v150 (weaved) - rm -R /etc/weaved - rm -R $HOME/weaved_software - rm $HOME/weaved_setup.bin - - # Remot3.it - G_AGP weavedconnectd + G_AGP connectd weavedconnectd # pre-v6.22 fi From 7c9d752885fd245b4723b88b3fff7e85e95edb39 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:21:01 +0000 Subject: [PATCH 043/175] v6.22 #Sudo required for non-root dietpi@DietPi:~$ systemctl status dietpi-postboot Failed to connect to bus: No such file or directory --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index ef35f2d400..9bd69e9b63 100644 --- a/dietpi/login +++ b/dietpi/login @@ -159,7 +159,7 @@ Main(){ # Wait for full system boot - until systemctl status dietpi-postboot | grep -qi 'exited' + until sudo systemctl status dietpi-postboot | grep -qi 'exited' #Sudo required for non-root do echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' From c7312937b3b2c395951bb7e93b5debc3f0bd199d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 16:29:14 +0100 Subject: [PATCH 044/175] v6.22 + CHANGELOG | Resolved an issue where I-Sabre-K2M sound card selection failed --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb4259505a..b9974de2ab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 From 82fe2a7744ea3e6038ab65139710111e2b73ed19 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:44:52 +0000 Subject: [PATCH 045/175] v6.22 + Tweaks --- dietpi/login | 56 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/dietpi/login b/dietpi/login index 9bd69e9b63..5b70f78b63 100644 --- a/dietpi/login +++ b/dietpi/login @@ -104,25 +104,9 @@ # First Run Setup Run_First_Update_Setup(){ - # First run setup running in other session - Other_Session_User_Prompt(){ - - local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' - - # Force interactive whiptail - G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" - - exit - - } - # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - # - Check internet 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 @@ -135,9 +119,6 @@ # 1st run dietpi-software installs elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then - # - Prompt and exit if DietPi-Software runs in other session already - pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt - # - Start DietPi-Software /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 @@ -167,14 +148,6 @@ done - # Automated first run setup? - if (( $( /dev/null; then + + # - First run setup running in other session + local additional_text='Please resume setup on the active screen.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + + G_WHIP_MSG "[WARNING] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + + local restart_loop_delay=5 + G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" + sleep $restart_loop_delay + + elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n @@ -219,6 +209,10 @@ Please login again as user "root" with password "dietpi", respectively the one y break + else + + Run_First_Update_Setup + fi #---------------------------------------------------------------- From a206e5483fbc17204c50d6ed4005451bb09c0a4a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:48:12 +0000 Subject: [PATCH 046/175] v6.22 + Might also need a failsafe int check --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 5b70f78b63..4492b3e5ea 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if pgrep 'login' &> /dev/null; then + if (( $(pgrep 'login' 2> /dev/null | wc -l) >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From a970f39a86a42852057a24e4d5b22cf486bee0d4 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:06:48 +0000 Subject: [PATCH 047/175] v6.22 + Count \o/ --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 4492b3e5ea..a7023e537c 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep 'login' 2> /dev/null | wc -l) >= 2 )); then + if (( $(pgrep -c 'login') >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From ffc3eec4113abd2c6165c12c5426c016cba4ec38 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:08:32 +0000 Subject: [PATCH 048/175] v6.22 + Switch to dietpi-login, to ensure pgrep better match --- dietpi/{login => dietpi-login} | 4 ++-- rootfs/etc/bashrc.d/dietpi-login.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename dietpi/{login => dietpi-login} (98%) diff --git a/dietpi/login b/dietpi/dietpi-login similarity index 98% rename from dietpi/login rename to dietpi/dietpi-login index a7023e537c..a1f9f98262 100644 --- a/dietpi/login +++ b/dietpi/dietpi-login @@ -9,7 +9,7 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/login + # - filename /DietPi/dietpi/dietpi-login # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep -c 'login') >= 2 )); then + if (( $(pgrep -c 'dietpi-login') >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' diff --git a/rootfs/etc/bashrc.d/dietpi-login.sh b/rootfs/etc/bashrc.d/dietpi-login.sh index 3d8fbbcaa4..18e76501c1 100644 --- a/rootfs/etc/bashrc.d/dietpi-login.sh +++ b/rootfs/etc/bashrc.d/dietpi-login.sh @@ -4,4 +4,4 @@ . /DietPi/dietpi/func/dietpi-globals # login scripts and banner -/DietPi/dietpi/login +/DietPi/dietpi/dietpi-login From b6bd3b06b5438312fcca15c159837e564ff8e06d Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:13:58 +0000 Subject: [PATCH 049/175] v6.22 + Syntax --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index a1f9f98262..7d97bd2fba 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -181,7 +181,7 @@ G_CHECK_ROOT_USER # - Automated first run setup? - grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) export G_USER_INPUTS=0 From af53f73625d7ac1ba35bebe70e721d49ed9fc8a8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:40:45 +0000 Subject: [PATCH 050/175] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 7d97bd2fba..bc72dab162 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -195,7 +195,7 @@ local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - G_WHIP_MSG "[WARNING] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" @@ -203,7 +203,7 @@ elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[ERROR] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' From d88030a04cb01f1a810d5545c20b4f9f79d06435 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:25:15 +0000 Subject: [PATCH 051/175] v6.22 + Switch to file for already in use detection. --- dietpi/dietpi-login | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index bc72dab162..3078e30c45 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,6 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ @@ -104,6 +105,8 @@ # First Run Setup Run_First_Update_Setup(){ + echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then @@ -124,6 +127,8 @@ fi + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + } Show_License(){ @@ -189,7 +194,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep -c 'dietpi-login') >= 2 )); then + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From 3ef39bbe92759ff05012e6d0f71ee5d657fa4619 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:26:11 +0000 Subject: [PATCH 052/175] v6.22 + Tweak. --- dietpi/dietpi-login | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 3078e30c45..14c1e433cd 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -125,9 +125,10 @@ # - Start DietPi-Software /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - fi + # - done + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + fi } From d447e3592e11d5b189be64c38e1a7f7bd97c2c09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:34:51 +0000 Subject: [PATCH 053/175] v6.22 + Further tweaks/clean up --- dietpi/dietpi-login | 108 +++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 14c1e433cd..8c223e2962 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/var/tmp/dietpi/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ @@ -105,28 +105,64 @@ # First Run Setup Run_First_Update_Setup(){ - echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + G_CHECK_ROOT_USER - # 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + # - Automated first run setup? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Check internet - 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 + # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - # - Check NTP synced - /DietPi/dietpi/func/run_ntpd + fi + + # - Prompt and wait if this script runs in other session already + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then + + # - First run setup running in other session + local additional_text='Please resume setup on the active screen.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + + local restart_loop_delay=5 + G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" + sleep $restart_loop_delay + + elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then + + G_WHIP_MSG '[ERROR] Root login required\n +To finish DietPi first run setup, root permissions are required.\n +Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - # - Start DietPi-Update - /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + exit - # 1st run dietpi-software installs - elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + else - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + # Prevent re-run from another session. + echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID - # - done - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + + # - Check internet + 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 + + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd + + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + + # 1st run dietpi-software installs + elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + + # - done + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + + fi fi @@ -184,42 +220,8 @@ elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/func/dietpi-banner 0 - G_CHECK_ROOT_USER - - # - Automated first run setup? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 - - fi - - # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then - - # - First run setup running in other session - local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" - - local restart_loop_delay=5 - G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" - sleep $restart_loop_delay - - elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - - G_WHIP_MSG '[ERROR] Root login required\n -To finish DietPi first run setup, root permissions are required.\n -Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - - break - - else - - Run_First_Update_Setup - - fi + Run_First_Update_Setup #---------------------------------------------------------------- # Unknown install state @@ -235,8 +237,10 @@ An error has occured either during first run update or installs.\n First run setup will now attempt to re-apply the last step. If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - # - reset to 0 to force update and fix code + # - Reset and force re-run of first run + killall -w dietpi-software dietpi-update &> /dev/null echo 0 > /DietPi/dietpi/.install_stage + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID else From 4113aa7c8d560886024b5aebbdfe2089290eabde Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:35:43 +0000 Subject: [PATCH 054/175] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 8c223e2962..524f0141f4 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -103,7 +103,7 @@ } # First Run Setup - Run_First_Update_Setup(){ + Run_DietPi_First_Run_Setup(){ G_CHECK_ROOT_USER @@ -221,7 +221,7 @@ Please login again as user "root" with password "dietpi", respectively the one y /DietPi/dietpi/func/dietpi-banner 0 - Run_First_Update_Setup + Run_DietPi_First_Run_Setup #---------------------------------------------------------------- # Unknown install state From 47f165687650c68401b70f12465f968206c8daf0 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:37:44 +0000 Subject: [PATCH 055/175] v6.22 + Use RAM, in case of reboot, to reset file. --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 524f0141f4..30440369b0 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/var/tmp/dietpi/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/dietpi/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ From 0d2fede7affcdf3d49e10f2c00d298e344d0f059 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:39:42 +0000 Subject: [PATCH 056/175] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 30440369b0..a5eb6a7f6a 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/dietpi/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' # Must be on RAM, in case of reboot from dietpi-software etc, to reset file before this script can remove it. # Autoboot Run_AutoStart(){ @@ -134,7 +134,7 @@ To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - exit + exit 1 else From c8c0f49d7cdecc597ea7ad30a20234075f7b293b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:41:50 +0000 Subject: [PATCH 057/175] v6.22 + May as well use the info we have :) --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index a5eb6a7f6a..895ceb3a9f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -122,7 +122,7 @@ local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" From f575476b0950e365649e750f527c1d31748b9d2d Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:45:23 +0000 Subject: [PATCH 058/175] v6.22 + Due to re-ordering. --- dietpi/dietpi-login | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 895ceb3a9f..8cf5077b90 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -136,11 +136,14 @@ Please login again as user "root" with password "dietpi", respectively the one y exit 1 + # Proceed with 1st run setup else # Prevent re-run from another session. echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + Show_License + # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then @@ -201,12 +204,12 @@ Please login again as user "root" with password "dietpi", respectively the one y /DietPi/dietpi/func/obtain_network_details - Show_License - #---------------------------------------------------------------- # Normal Login if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + Show_License + /DietPi/dietpi/func/dietpi-banner 1 local auto_start_index=0 From d5f44d4ca0b25e191141266ea6c236aa3f29025e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 18:05:41 +0000 Subject: [PATCH 059/175] v6.22 + PID check --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 8cf5077b90..d789dac681 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,7 +116,7 @@ fi # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && (( $(cat $FP_DIETPI_FIRSTRUNSETUP_PID) != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From 0fc5e84af0fca0abb1d1c6a29e610037c94786b9 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 18:55:07 +0000 Subject: [PATCH 060/175] v6.22 Automated always reboots system after software. --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index d789dac681..f95b716502 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -120,7 +120,7 @@ # - First run setup running in other session local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted.' G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" From 74edffd389bdc03b0415a5bc72f2e02d430c7975 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:12:36 +0000 Subject: [PATCH 061/175] v6.22 + Minor --- dietpi/dietpi-login | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index f95b716502..bd1f6a027e 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,13 +116,15 @@ fi # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && (( $(cat $FP_DIETPI_FIRSTRUNSETUP_PID) != $$ )); then + local pid_firstrunsetup='-1' + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) + if (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted.' - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$pid_firstrunsetup).\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" From f8d1b374421b0b22132610c517b0f196e75cda09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:13:36 +0000 Subject: [PATCH 062/175] v6.22 + More coffee required... --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index bd1f6a027e..47cdfe135f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,7 +116,7 @@ fi # - Prompt and wait if this script runs in other session already - local pid_firstrunsetup='-1' + local pid_firstrunsetup=-1 [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) if (( $pid_firstrunsetup != $$ )); then From 62a6437db8ce10332dd2446aae5f412bb2f3237a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:18:08 +0000 Subject: [PATCH 063/175] v6.22 + Too much coffee maybe? lol --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 47cdfe135f..4674158b23 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,9 +116,9 @@ fi # - Prompt and wait if this script runs in other session already - local pid_firstrunsetup=-1 + local pid_firstrunsetup='' [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) - if (( $pid_firstrunsetup != $$ )); then + if [[ $pid_firstrunsetup ]] && (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From d07c029b64b6d331efcbfdb0c4f31480c90b43d9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 14:39:47 +0100 Subject: [PATCH 064/175] META | dietpi-cloud-migration: Minor coding and wording --- .meta/dietpi-cloud-migration | 47 +++++++++++++++--------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/.meta/dietpi-cloud-migration b/.meta/dietpi-cloud-migration index 07142326b4..992fe4e9fd 100644 --- a/.meta/dietpi-cloud-migration +++ b/.meta/dietpi-cloud-migration @@ -1,28 +1,24 @@ #!/bin/bash -(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the command with "sudo".\n' && exit 1 +(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the script with "sudo".\n' && exit 1 echo -e '[\e[32m OK \e[0m] Root privileges verified.' -apt-get install -y rsync -(( $? )) && echo -e '[\e[31mFAILED\e[0m] Installation of rsync 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-get install -y rsync"\n' && exit 1 echo -e '[\e[32m OK \e[0m] Successfully installed rsync.' run_backup(){ - 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 - fp_config="/var/www/$1/config/config.php" - echo "[ INFO ] Scanning $fp_config for necessary information..." - [[ ! -f $fp_config ]] && echo -e "[\e[31mFAILED\e[0m] File $fp_config not found, please check your installation.\n" && exit 1 + 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 - local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") + echo "[ INFO ] Scanning $fp_config for necessary information..." + local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | cut -d \' -f 4) + local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | cut -d \' -f 4) + local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | cut -d \' -f 4) + local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | cut -d \' -f 4) + local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | cut -d \' -f 4) echo -e " - data directory: $fp_datadir - database name: $dbname - database hostname: $dbhost @@ -30,50 +26,45 @@ 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 seems to have failed. 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.\n' && 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, 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.\n' && 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 directory, please check spelling and mount status of your desired backup location.\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.\n" && exit 1 - rsync -aHp --delete "$fp_datadir"/ "$2" - (( $? )) && echo -e '[\e[31mFAILED\e[0m] Rsync failed, 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.\n' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully synced data directory to: $2" else - echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there or rerun this script, providing the external backup location as argument.' + echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there, or, rerun this script with the desired external backup path as argument.' fi - echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstallation, DietPi-Software will check this location for backups and in case automatically restore them." + echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstall, DietPi-Software will check this location for backups and in case automatically restore them." } ### MAIN ### -[[ ! -f /DietPi/dietpi/.installed ]] && echo -e '[\e[31mFAILED\e[0m] No proper DietPi installation found or DietPi-RamDisk is not running. Please ensure you are executing this script from a functional DietPi system and "dietpi-ramdisk" is up.\n' && exit 1 - -if grep -q 'aSOFTWARE_INSTALL_STATE\[47\]=2' /DietPi/dietpi/.installed; then +if [[ -f /var/www/owncloud/config/config.php ]]; then echo '[ INFO ] ownCloud installation found, preparing backup...' run_backup owncloud "$1" fi -if grep -q 'aSOFTWARE_INSTALL_STATE\[114\]=2' /DietPi/dietpi/.installed; 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 installation found. Please verify that it was installed via dietpi-software, in case reinstall it, non of your existing data/settings will be overwritten.\n" && exit 1 +[[ ! $fp_config ]] && echo -e '[\e[31mFAILED\e[0m] No ownCloud or Nextcloud instance found at /var/www/owncloud|nextcloud. Aborting...\n' && exit 1 From eb0f4cbc5afd7c98ffacb14ca0ff4f96b1459915 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 14:49:58 +0100 Subject: [PATCH 065/175] META | dietpi-fan_control: Fix G_CHECK_VALIDINT use + minor coding --- .meta/dietpi-fan_control | 52 +++++++++++++--------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/.meta/dietpi-fan_control b/.meta/dietpi-fan_control index 70488023e6..bf99bf2292 100644 --- a/.meta/dietpi-fan_control +++ b/.meta/dietpi-fan_control @@ -62,7 +62,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. INPUT=0 if [[ $@ ]]; then - if G_CHECK_VALIDINT "$@"; then + if disable_error=1 G_CHECK_VALIDINT "$@"; then INPUT=$@ @@ -97,7 +97,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. done # - Remove leading white space - TRIP_TEMPS_CURRENT="${TRIP_TEMPS_CURRENT# }" + TRIP_TEMPS_CURRENT=${TRIP_TEMPS_CURRENT# } # - Read current trip point fan speeds TRIP_SPEEDS_CURRENT='' @@ -109,7 +109,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. done # - Remove leading white space - TRIP_SPEEDS_CURRENT="${TRIP_SPEEDS_CURRENT# }" + TRIP_SPEEDS_CURRENT=${TRIP_SPEEDS_CURRENT# } # - Read current static fan speed # - Convert 0-255 to 0-100% @@ -122,11 +122,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # - $TRIP_TEMPS='XX YY ZZ'; XX°C YY°C ZZ°C # - $TRIP_SPEEDS='AAA BBB CCC DDD'; AAA*100/255 %... # - $STATIC_SPEED=EEE; EEE*100/255 % - Read_Settings(){ - - . $FP_SETTINGS - - } + Read_Settings(){ . $FP_SETTINGS; } # Verify valid settings, before applying Verify_Settings(){ @@ -153,7 +149,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. elif (( ! $TEMP_CONTROLLED )); then # - $STATIC_SPEED is expected to be an integer. - if ! G_CHECK_VALIDINT $STATIC_SPEED; then + if ! disable_error=1 G_CHECK_VALIDINT $STATIC_SPEED; then G_DIETPI-NOTIFY 1 "Invalid setting: \$STATIC_SPEED=$STATIC_SPEED" return 1 @@ -236,7 +232,7 @@ _EOF_ done # - Remove leading white space - trip_speeds_target="${trip_speeds_target# }" + trip_speeds_target=${trip_speeds_target# } echo "$trip_speeds_target" > $FP_TRIP_SPEEDS else @@ -266,49 +262,33 @@ _EOF_ Temps_Menu(){ - G_WHIP_DEFAULT_ITEM="$TRIP_TEMPS" + G_WHIP_DEFAULT_ITEM=$TRIP_TEMPS G_WHIP_INPUTBOX "Please enter $TRIP_POINT_COUNT space-separated temperature points in °C. -EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\"" - if (( ! $? )); then - - TRIP_TEMPS="$G_WHIP_RETURNED_VALUE" - - fi +EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\"" && TRIP_TEMPS=$G_WHIP_RETURNED_VALUE } Speeds_Menu(){ - G_WHIP_DEFAULT_ITEM="$TRIP_SPEEDS" + G_WHIP_DEFAULT_ITEM=$TRIP_SPEEDS G_WHIP_INPUTBOX "Please enter $(( $TRIP_POINT_COUNT + 1 )) space-separated fan speeds in % (percent) of the maximum possible speed. EG: To disable the fan below $(( $(<$FP_TRIP_TEMPS) / 1000 ))°C, run it at 45% above, 70% after reaching $(( $(<${FP_TRIP_TEMPS/0_temp/1_temp}) / 1000 ))°C and 95% above $(( $(<${FP_TRIP_TEMPS/0_temp/2_temp}) / 1000 ))°C, enter - \"0 45 70 95\"" - if (( ! $? )); then - - TRIP_SPEEDS="$G_WHIP_RETURNED_VALUE" - - fi + \"0 45 70 95\"" && TRIP_SPEEDS=$G_WHIP_RETURNED_VALUE } Static_Speed_Menu(){ - G_WHIP_DEFAULT_ITEM="$STATIC_SPEED" + G_WHIP_DEFAULT_ITEM=$STATIC_SPEED G_WHIP_INPUTBOX "Please enter the desired static fan speeds in % (percent) of the maximum possible speed. -EG: To run the fan at 50%, enter\n \"60\"" - if (( ! $? )); then - - STATIC_SPEED="$G_WHIP_RETURNED_VALUE" - - fi +EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_VALUE } Reboot_Menu(){ G_WHIP_BUTTON_CANCEL_TEXT='Later' - G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?' - if (( ! $? )); then + if G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?'; then reboot exit 0 @@ -372,7 +352,7 @@ EG: To run the fan at 50%, enter\n \"60\"" if (( $TEMP_CONTROLLED )); then # - Trip point temperature settings - TRIP_TEMPS="${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT}" + TRIP_TEMPS=${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT} local trip_temps_text='' for i in $TRIP_TEMPS do @@ -383,7 +363,7 @@ EG: To run the fan at 50%, enter\n \"60\"" G_WHIP_MENU_ARRAY+=( 'Temp points' "Selected: $trip_temps_text" ) # - Trip point speed settings - TRIP_SPEEDS="${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT}" + TRIP_SPEEDS=${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT} local trip_speeds_text='' for i in $TRIP_SPEEDS do @@ -482,7 +462,7 @@ EG: To run the fan at 50%, enter\n \"60\"" # Read settings file, to generate menu entries and use current settings as default. [[ -f $FP_SETTINGS ]] && Read_Settings - while true + while : do Main_Menu From 588b77093de4248b6b28003b2afedc415ef2bc66 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 15:06:36 +0100 Subject: [PATCH 066/175] META | dietpi-survey_report: Add v6.21/22 support; Fix version sorting (6.9 => 6.09); Minor wording --- .meta/dietpi-survey_report | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 39a3235e2c..6cf4d6542b 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -200,8 +200,8 @@ aSOFTWARE_NAME[30]='NoMachine' aSOFTWARE_NAME[31]='Kodi' aSOFTWARE_NAME[32]='YMPD' - aSOFTWARE_NAME[33]='AirSonic' - aSOFTWARE_NAME[34]='SubSonic 6' + aSOFTWARE_NAME[33]='Airsonic' + aSOFTWARE_NAME[34]='Subsonic 6' aSOFTWARE_NAME[35]='SqueezeBox' aSOFTWARE_NAME[36]='SqueezeLite' aSOFTWARE_NAME[37]='Shairport Sync' @@ -221,7 +221,7 @@ aSOFTWARE_NAME[51]='OpenTyrian' aSOFTWARE_NAME[52]='Cuberite' aSOFTWARE_NAME[53]='MineOS' - aSOFTWARE_NAME[54]='Forums' + aSOFTWARE_NAME[54]='phpBB' aSOFTWARE_NAME[55]='Wordpress' aSOFTWARE_NAME[56]='Image Gallery' aSOFTWARE_NAME[57]='BaiKal' @@ -263,14 +263,14 @@ aSOFTWARE_NAME[93]='Pi-hole' aSOFTWARE_NAME[94]='ProFTP' aSOFTWARE_NAME[95]='vsFTPD' - aSOFTWARE_NAME[96]='Samba' + aSOFTWARE_NAME[96]='Samba Server' aSOFTWARE_NAME[97]='OpenVPN' aSOFTWARE_NAME[98]='HaProxy' aSOFTWARE_NAME[99]='EmonPi' aSOFTWARE_NAME[100]='PiJuice' aSOFTWARE_NAME[101]='Log Rotate' aSOFTWARE_NAME[102]='Rsyslog' - aSOFTWARE_NAME[103]='DietPi-Ramlog' + aSOFTWARE_NAME[103]='DietPi-RAMlog' aSOFTWARE_NAME[104]='Dropbear' aSOFTWARE_NAME[105]='OpenSSH Server' aSOFTWARE_NAME[106]='NTP' @@ -435,6 +435,15 @@ aSOFTWARE_NAME6_20[171]='DietPi-NordVPN' aSOFTWARE_NAME6_20[172]='WireGuard' + # - v6.21 + v6.22 + for i in ${!aSOFTWARE_NAME6_20[@]} + do + + aSOFTWARE_NAME6_21[$i]=${aSOFTWARE_NAME6_20[$i]} + aSOFTWARE_NAME6_22[$i]=${aSOFTWARE_NAME6_21[$i]} + + done + Main(){ # Copy files to RAM to speed up grep @@ -443,7 +452,7 @@ [[ -e /tmp/dietpi-survey_report ]] && rm -R /tmp/dietpi-survey_report cp -R /home/dietpi-survey/survey /tmp/dietpi-survey_report - cd /tmp/dietpi-survey_report # so we can remove bad files from disk + cd /tmp/dietpi-survey_report for file in *.txt do @@ -894,7 +903,7 @@

DietPi versions:

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

Git branches:

From 511fc0df69d91338685fd96f786d4edde15a3482 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:03:07 +0100 Subject: [PATCH 067/175] v6.22 + DietPi-Login | Tiny --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 4674158b23..4f730bc2f5 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -117,7 +117,7 @@ # - Prompt and wait if this script runs in other session already local pid_firstrunsetup='' - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(<$FP_DIETPI_FIRSTRUNSETUP_PID) if [[ $pid_firstrunsetup ]] && (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session @@ -187,7 +187,7 @@ Please login again as user "root" with password "dietpi", respectively the one y Main(){ # Wait for full system boot - until sudo systemctl status dietpi-postboot | grep -qi 'exited' #Sudo required for non-root + until sudo systemctl status dietpi-postboot | grep -qi 'exited' # "sudo" required for non-root logins do echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' From cbf611e8fd0b782db5ce3e4da1d31e07e8679744 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:27:05 +0100 Subject: [PATCH 068/175] v6.22 + DietPi-Globals | Update defaults to v6.22, minor coding and cleanup --- dietpi/func/dietpi-globals | 78 ++++++++++++++------------------------ 1 file changed, 29 insertions(+), 49 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5711aacc20..69e630483d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -57,23 +57,15 @@ #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 G_DIETPI_INSTALL_STAGE=-2 - if [[ -f '/DietPi/dietpi/.install_stage' ]]; then - - G_DIETPI_INSTALL_STAGE=$(&1 1>&2 2>&3) if [[ $password_0 && $password_0 == "$password_1" ]]; then - result="$password_0" + result=$password_0 return_value=0 break @@ -1107,7 +1099,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Usage: G_RUN_CMD dothis G_ERROR_HANDLER(){ - [[ $l_message ]] || local l_message="$G_ERROR_HANDLER_COMMAND" + [[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND #Ok (( $G_ERROR_HANDLER_NO_FAIL )) && G_ERROR_HANDLER_EXITCODE=0 @@ -1135,9 +1127,9 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then local preimage_name='n/a' if [[ -r '/DietPi/dietpi/.prep_info' ]]; then - image_creator="$(sed -n 1p /DietPi/dietpi/.prep_info)" + image_creator=$(sed -n 1p /DietPi/dietpi/.prep_info) [[ $image_creator == 0 ]] && image_creator='DietPi Core Team' - preimage_name="$(sed -n 2p /DietPi/dietpi/.prep_info)" + preimage_name=$(sed -n 2p /DietPi/dietpi/.prep_info) fi @@ -1164,7 +1156,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then else - whip_msg+="$G_ERROR_HANDLER_COMMAND" + whip_msg+=$G_ERROR_HANDLER_COMMAND fi @@ -1177,7 +1169,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Display optional logfile? if [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]]; then - whip_msg+="$print_logfile_info" + whip_msg+=$print_logfile_info whip_msg+='\n\n' fi @@ -1185,14 +1177,14 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Display "please report to dietpi", if its one of our programs if [[ $G_PROGRAM_NAME && ! $G_ERROR_HANDLER_INFO_ONLY ]]; then - whip_msg+="$print_report_to_dietpi_info" + whip_msg+=$print_report_to_dietpi_info fi if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then whip_msg+='\n\n' - whip_msg+="$print_unable_to_continue" + whip_msg+=$print_unable_to_continue fi @@ -1239,7 +1231,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then elif [[ $choice == 'Send report' ]]; then send_bugreport=1 - bugreport_id="$(sed -n 5p /DietPi/dietpi/.hw_model)" + bugreport_id=$(sed -n 5p /DietPi/dietpi/.hw_model) fi @@ -1361,13 +1353,13 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - G_ERROR_HANDLER_COMMAND="$@" + G_ERROR_HANDLER_COMMAND=$@ G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - [[ $l_message ]] || local l_message="$G_ERROR_HANDLER_COMMAND" + [[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND G_DIETPI-NOTIFY -2 "$l_message" $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND @@ -1390,7 +1382,7 @@ $print_logfile_info # Prompts user to configure network if $G_USER_INPUTS=1 G_CHECK_URL(){ - local string="$@" + local string=$@ local timeout=${timeout:-5} local retry_max=${retry_max:-3} local optional_cmd_inputs=${optional_cmd_inputs:-} @@ -1508,7 +1500,7 @@ $print_logfile_info #Checks if a file/folder exists G_FILE_EXISTS(){ - G_ERROR_HANDLER_COMMAND="$@" + G_ERROR_HANDLER_COMMAND=$@ G_DIETPI-NOTIFY -2 "Checking for existance: $G_ERROR_HANDLER_COMMAND" @@ -1533,7 +1525,7 @@ $print_logfile_info echo -e "$string" > /tmp/G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_ERROR_HANDLER_COMMAND' - G_ERROR_HANDLER_COMMAND="$string" + G_ERROR_HANDLER_COMMAND=$string G_ERROR_HANDLER @@ -1552,7 +1544,7 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - local string="$@" + local string=$@ local force_options='' if (( $G_DISTRO >= 4 )); then @@ -1988,7 +1980,7 @@ $print_logfile_info G_CHECK_FREESPACE(){ local return_value=1 - local input_path="$1" + local input_path=$1 local input_required_space=$2 local available_space=$(df -mP $input_path | sed -n 2p | mawk '{print $4}') local string_output="Free space check: path=$input_path | available=$available_space MB | required=$input_required_space MB" @@ -2093,7 +2085,7 @@ $print_logfile_info if [[ -L $G_FP_DIETPI_USERDATA ]]; then # - Check psyhical location exists and is mounted - fp_actual="$(readlink $G_FP_DIETPI_USERDATA)" + fp_actual=$(readlink -f $G_FP_DIETPI_USERDATA) if ! df -P $fp_actual &> /dev/null; then return_value=1 @@ -2293,17 +2285,6 @@ $print_logfile_info } - #Escape chars to prevent expansion and return value - G_ESCAPE_EXPANSION(){ - - local input="${@//\\/\\\\}"; input="${input//./\\.}"; input="${input//+/\\+}"; input="${input//\*/\\\*}"; input="${input//\?/\\\?}"; input="${input//[/\\[}" - input="${input//\(/\\\(}"; input="${input//\{/\\\{}"; input="${input//^/\\^}"; input="${input//&/\\&}"; input="${input//$/\\$}"; input="${input//|/\\|}" - input="${input//\`/\\\`}" - - echo "$input" - - } - #----------------------------------------------------------------------------------- # DEV tools (Not for public use! All mine! :D) #----------------------------------------------------------------------------------- @@ -2363,13 +2344,12 @@ $print_logfile_info G_CONFIG_INJECT(){ [[ $G_PROGRAM_NAME ]] || local G_PROGRAM_NAME='G_CONFIG_INJECT' - local pattern="${1//\//\\\/}" - # local setting="$(G_ESCAPE_EXPANSION $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}" - local file="$3" - local after="${4//\//\\\/}" + local pattern=${1//\//\\\/} + 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} + local file=$3 + local after=${4//\//\\\/} local error='' syntax_error(){ From d3459e543c24e982db0174898340c3c6ec3b8f4f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:39:57 +0100 Subject: [PATCH 069/175] v6.22 + General | Remove last dot file from GitHub repo, so we don't need to remove it in dietpi-update or take care it matches upstream version --- dietpi/.version | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 dietpi/.version diff --git a/dietpi/.version b/dietpi/.version deleted file mode 100644 index 46b255593b..0000000000 --- a/dietpi/.version +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -G_DIETPI_VERSION_CORE=6 -G_DIETPI_VERSION_SUB=22 -G_DIETPI_VERSION_RC=0 -G_GITBRANCH='master' -G_GITOWNER='Fourdee' From 3dc62bdaec55a717761cf610a35682cb411eda7d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:44:50 +0100 Subject: [PATCH 070/175] v6.22 + DietPi-Update | All dot files have been removed from update archive dietpi/ sub dir --- dietpi/dietpi-update | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 69b08c7e57..c2379ee611 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -334,7 +334,6 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE rm update.zip # Remove files from Git that are not to be updated on client - rm -R DietPi-"$GITBRANCH_TARGET"/dietpi/.??* rm DietPi-"$GITBRANCH_TARGET"/dietpi/server_version* rm DietPi-"$GITBRANCH_TARGET"/dietpi/pre-patch_file From f38f3242d0c0f465939e5620c96b6e799cb7acde Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 17:12:13 +0100 Subject: [PATCH 071/175] v6.22 + DietPi-PREP | Use G_GITBRANCH/G_GITOWNER to match/override dietpi-globals defaults + DietPi-PREP | Read installed version string to G_* variables from "server_version-6", before removing it, instead of downloading ".version" separately. + DietPi-PREP | The above allows to successfully use G_VERSIONDB_SAVE without having ".version" stored in our Git repo --- PREP_SYSTEM_FOR_DIETPI.sh | 60 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 183b1d11e7..d9ef78d48f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -18,7 +18,8 @@ #Core globals G_PROGRAM_NAME='DietPi-PREP' - GITOWNER=${GITOWNER:-Fourdee} + G_GITOWNER=${GITOWNER:-Fourdee} + unset GITOWNER #------------------------------------------------------------------------------------------------ # Critical checks and pre-reqs, with exit, prior to initial run of script @@ -128,7 +129,7 @@ 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 - GITBRANCH=$WHIP_RETURN + G_GITBRANCH=$WHIP_RETURN else @@ -139,14 +140,14 @@ unset aWHIP_BRANCH WHIP_RETURN - echo "[ INFO ] Selected Git branch: $GITOWNER/$GITBRANCH" + echo "[ INFO ] Selected Git branch: $G_GITOWNER/$G_GITBRANCH" #------------------------------------------------------------------------------------------------ # DietPi-Globals #------------------------------------------------------------------------------------------------ # - Download # - NB: We'll have to manually handle errors, until DietPi-Globals are successfully loaded. - if ! wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then + if ! wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then echo -e '[FAILED] Unable to download dietpi-globals. Aborting...\n' exit 1 @@ -508,11 +509,11 @@ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - INTERNET_ADDRESS="https://github.com/$GITOWNER/DietPi/archive/$GITBRANCH.zip" + 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 - [[ -d DietPi-$GITBRANCH ]] && l_message='Cleaning previously extracted files' G_RUN_CMD rm -R "DietPi-$GITBRANCH" + [[ -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 rm package.zip @@ -523,41 +524,46 @@ # - HW specific config.txt, boot.ini uEnv.txt if (( $G_HW_MODEL < 10 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/config.txt" /boot/ + G_RUN_CMD mv "DietPi-$G_GITBRANCH/config.txt" /boot/ elif (( $G_HW_MODEL == 10 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_c1.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_c1.ini" /boot/boot.ini elif (( $G_HW_MODEL == 11 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_xu4.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_xu4.ini" /boot/boot.ini elif (( $G_HW_MODEL == 12 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_c2.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_c2.ini" /boot/boot.ini fi - G_RUN_CMD mv "DietPi-$GITBRANCH/dietpi.txt" /boot/ - G_RUN_CMD mv "DietPi-$GITBRANCH/README.md" /boot/dietpi-README.md - G_RUN_CMD mv "DietPi-$GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt + G_RUN_CMD mv "DietPi-$G_GITBRANCH/dietpi.txt" /boot/ + G_RUN_CMD mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md + G_RUN_CMD mv "DietPi-$G_GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt + + # - Reading version string for later use + G_DIETPI_VERSION_CORE=$(sed -n 1p "DietPi-$G_GITBRANCH/dietpi/server_version-6") + G_DIETPI_VERSION_SUB=$(sed -n 2p "DietPi-$G_GITBRANCH/dietpi/server_version-6") + G_DIETPI_VERSION_RC=$(sed -n 3p "DietPi-$G_GITBRANCH/dietpi/server_version-6") # - Remove server_version* / (pre-)patch_file (downloads fresh from dietpi-update) - rm "DietPi-$GITBRANCH/dietpi/server_version"* - rm "DietPi-$GITBRANCH/dietpi/pre-patch_file" - rm "DietPi-$GITBRANCH/dietpi/patch_file" + rm "DietPi-$G_GITBRANCH/dietpi/server_version"* + rm "DietPi-$G_GITBRANCH/dietpi/pre-patch_file" + rm "DietPi-$G_GITBRANCH/dietpi/patch_file" - l_message='Copy DietPi core files to /boot/dietpi' G_RUN_CMD cp -Rf "DietPi-$GITBRANCH/dietpi" /boot/ - l_message='Copy DietPi rootfs files in place' G_RUN_CMD cp -Rf "DietPi-$GITBRANCH/rootfs"/. / - l_message='Clean download location' G_RUN_CMD rm -R "DietPi-$GITBRANCH" + l_message='Copy DietPi core files to /boot/dietpi' G_RUN_CMD cp -Rf "DietPi-$G_GITBRANCH/dietpi" /boot/ + l_message='Copy DietPi rootfs files in place' G_RUN_CMD cp -Rf "DietPi-$G_GITBRANCH/rootfs"/. / + l_message='Clean download location' G_RUN_CMD rm -R "DietPi-$G_GITBRANCH" l_message='Set execute permissions for DietPi scripts' G_RUN_CMD chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi G_RUN_CMD systemctl daemon-reload G_RUN_CMD systemctl enable dietpi-ramdisk # - Mount tmpfs - mkdir -p /DietPi + G_RUN_CMD mkdir -p /DietPi G_RUN_CMD mount -t tmpfs -o size=10m tmpfs /DietPi l_message='Starting DietPi-RAMdisk' G_RUN_CMD systemctl start dietpi-ramdisk @@ -994,7 +1000,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Boot Logo - [[ -f /boot/boot.bmp ]] && G_RUN_CMD wget https://github.com/$GITOWNER/DietPi/raw/$GITBRANCH/.meta/images/dietpi-logo_boot.bmp -O /boot/boot.bmp + [[ -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 @@ -1582,7 +1588,7 @@ This program is free software: you can redistribute it and/or modify it under th This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along with this program. If not, please see http://www.gnu.org/licenses/' +You should have received a copy of the GNU General Public License along with this program. If not, please see http://www.gnu.org/licenses/ _EOF_ G_DIETPI-NOTIFY 2 'Clearing APT cache' @@ -1609,17 +1615,13 @@ _EOF_ fi - G_DIETPI-NOTIFY 2 'Storing DietPi version ID' + G_DIETPI-NOTIFY 2 'Storing DietPi version info' - G_RUN_CMD wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/.version" -O /DietPi/dietpi/.version + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$G_GITBRANCH" /DietPi/dietpi.txt + G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$G_GITOWNER" /DietPi/dietpi.txt - chmod +x /DietPi/dietpi/.version - . /DietPi/dietpi/.version # Reduce sub_version by 1, allows us to create image, prior to release and patch if needed. ((G_DIETPI_VERSION_SUB--)) - - G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH" /DietPi/dietpi.txt - G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$GITOWNER" /DietPi/dietpi.txt G_VERSIONDB_SAVE G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version From 80bb15d6ab349cf29a6f09ba0959e07bb64281d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:10:41 +0100 Subject: [PATCH 072/175] v6.22 + DietPi-Bugreport | Increase max upload size to 20M, our server can effort it + DietPi-Bugreport | Use "ls" with option "-A" instead of "-a" not not list "." and ".." current and parent dirs + DietPi-Bugreport | No double quotes required when declaring commands/file paths with wildcard/asterisk, since they are expanded later when reading back array entries + DietPi-Bugreport | Add all known boot/kernel config files to upload archive + DietPi-Bugreport | Add whole directories instead of their contained files via "/*". This includes hidden files as well and allows simpler syntax without expansion. + DietPi-Bugreport | Write command errors to command out file as well, to derive e.g. missing commands/packages + DietPi-Bugreport | Use "7zr" lightweight standalone 7z archiver to lower dependency from "p7zip-full" to "p7zip" + DietPi-Bugreport | Minor coding, e.g. include INPUT check into menu loop to auto break --- dietpi/dietpi-bugreport | 129 +++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 67 deletions(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 8d26806ed7..112549f9fa 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -27,13 +27,13 @@ #Import DietPi-Globals --------------------------------------------------------------- INPUT=0 - disable_error=1 G_CHECK_VALIDINT $1 && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) UPLOAD_FILENAME="$UNIQUE_ID.7z" # - byte - UPLOAD_FILESIZE_LIMIT=10000000 + UPLOAD_FILESIZE_LIMIT=20000000 UPLOAD_FILESIZE=0 SFTP_ADDR='ssh.dietpi.com' @@ -43,28 +43,27 @@ # List of commands we want to run and redirect to upload archive aCOMMAND_LIST=( - 'ls -lha /var/log' 'dpkg -l' + 'ip l' 'ip a' 'ip r' - 'ip l' 'lsusb' 'cat /proc/cpuinfo' 'ps aux' 'blkid' 'mount' 'df -h' - "ls /etc/rc*.d/" + 'ls /etc/rc*.d/' 'cut -d: -f1 /etc/passwd' 'locale' - 'ls -lha /mnt' #dietpi userdata location + 'ls -lAh /mnt' # dietpi_userdata location 'dmesg' 'uname -a' 'lsmod' 'aplay -l' 'aplay -L' - "systemctl status *.service -l" - "systemctl status *.mount -l" + 'systemctl status *.service -l' + 'systemctl status *.mount -l' '/DietPi/dietpi/dietpi-services status' ) @@ -72,38 +71,43 @@ # List of files and folders we want to add to upload archive aFILE_LIST=( - # - command output file + # - aCOMMAND_LIST output file 'CMD_OUT.txt' - # - Git Error file + # - Git error file 'G_ERROR_HANDLER_GITREPORT' - # - logs - "/var/log/*" + # - Logs + '/var/log' - # - DietPi scripts / logs - "/DietPi/*" - '/boot/dietpi.txt' + # - Boot/kernel configs '/boot/config.txt' - "/boot/dietpi/*" - "/tmp/.G*" - "/var/tmp/dietpi/logs/*" + '/boot/cmdline.txt' + '/boot/boot.ini' + '/boot/uEnv.ini' + '/boot/armbianEnv.ini' - # - /var/lib/dietpi - "/var/lib/dietpi/*" + # - DietPi files + '/DietPi' + '/boot/dietpi.txt' + '/boot/dietpi' + '/tmp/.G*' + '/var/lib/dietpi' + '/var/tmp/dietpi' - # - confs + # - Login scripts # - bash shell '/etc/bash.bashrc' - "/etc/bashrc.d/*" + '/etc/bashrc.d' '/root/.bashrc' - "/home/*/.bashrc" + '/home/*/.bashrc' # - login shell '/etc/profile' - "/etc/profile.d/*" + '/etc/profile.d' '/root/.profile' - "/home/*/.profile" + '/home/*/.profile' + # - System '/etc/rc.local' '/etc/X11/xorg.conf' '/etc/asound.conf' @@ -111,16 +115,16 @@ '/etc/wpa_supplicant/wpa_supplicant.conf' '/etc/fstab' '/etc/sysctl.conf' - "/etc/sysctl.d/*" + '/etc/sysctl.d' # - Services - "/etc/init.d/*" - "/etc/systemd/system/*" - "/lib/systemd/system/*" + '/etc/init.d' + '/etc/systemd/system' + '/lib/systemd/system' # - APT '/etc/apt/sources.list' - "/etc/apt/sources.list.d/*" + '/etc/apt/sources.list.d' ) @@ -131,34 +135,33 @@ do echo -e "\n----------\n${aCOMMAND_LIST[$i]}:\n----------" >> CMD_OUT.txt - ${aCOMMAND_LIST[$i]} >> CMD_OUT.txt + ${aCOMMAND_LIST[$i]} &>> CMD_OUT.txt done unset aCOMMAND_LIST # - Have the git error in 1st directory. - cp /tmp/.G_ERROR_HANDLER_GITREPORT ./G_ERROR_HANDLER_GITREPORT &> /dev/null + [[ -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...' - 7z a -t7z -spf "$UPLOAD_FILENAME" ${aFILE_LIST[@]} &> /tmp/dietpi-bugreport_compress.log + 7zr a -spf "$UPLOAD_FILENAME" ${aFILE_LIST[@]} &> dietpi-bugreport_compress.log } Upload_Bug_Report(){ # Check upload location is online - G_CHECK_URL "$SFTP_ADDR" - if (( ! $? )); then + if G_CHECK_URL "$SFTP_ADDR"; then if [[ ! -f $UPLOAD_FILENAME ]]; then G_WHIP_MSG "Failed to create compressed upload file: $UPLOAD_FILENAME\n\nOn the next screen you will be prompted to view the log. If problems persist, please contact DietPi for support." - log=1 G_WHIP_VIEWFILE /tmp/dietpi-bugreport_compress.log + log=1 G_WHIP_VIEWFILE dietpi-bugreport_compress.log exit 1 fi - rm /tmp/dietpi-bugreport_compress.log &> /dev/null + [[ -f dietpi-bugreport_compress.log ]] && rm dietpi-bugreport_compress.log # Limit filesize UPLOAD_FILESIZE=$(stat -c%s "$UPLOAD_FILENAME") @@ -167,8 +170,7 @@ if (( $UPLOAD_FILESIZE <= $UPLOAD_FILESIZE_LIMIT )); then G_DIETPI-NOTIFY -2 'Running cURL' - curl --connect-timeout 4 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/bugreport/ - if (( ! $? )); then + if curl --connect-timeout 4 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/bugreport/; then # Bug report removal via empty file upload if (( $UPLOAD_FILESIZE == 0 )); then @@ -208,57 +210,50 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// # Interactive menu - if (( $INPUT == 0 )); then + while (( $INPUT == 0 )) + do - while true - do - - G_WHIP_MENU_ARRAY=( + G_WHIP_MENU_ARRAY=( - '1' ': Send bug report archive to help the developers investigate an issue.' - '2' ': Remove my previous uploaded bug report.' - '3' ': Show me what is included with the upload archive.' + '1' ': Send bug report archive to help the developers investigate an issue.' + '2' ': Remove my previous uploaded bug report.' + '3' ': Show me what is included with the upload archive.' - ) + ) - 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?" - if (( ! $? )); then +Would you like to send a bug report archive or remove an already uploaded one?"; then - if (( $G_WHIP_RETURNED_VALUE == 1 )); then + if (( $G_WHIP_RETURNED_VALUE == 1 )); then - INPUT=1 - break + INPUT=1 - elif (( $G_WHIP_RETURNED_VALUE == 2 )); then + elif (( $G_WHIP_RETURNED_VALUE == 2 )); then - INPUT=-1 - break + INPUT=-1 - elif (( $G_WHIP_RETURNED_VALUE == 3 )); then + elif (( $G_WHIP_RETURNED_VALUE == 3 )); then - G_WHIP_SCROLLBOX "The upload will contain the following command outputs: + G_WHIP_SCROLLBOX "The upload will contain the following command outputs: $(printf "\t- %s\n" "${aCOMMAND_LIST[@]}") -It will contain as well the following file locations: +It will contain as well the following files and directories: $(printf "\t- %s\n" "${aFILE_LIST[@]}")" - fi - - else + fi - break + else - fi + break - done + fi - fi + done if (( $INPUT == 1 || $INPUT == -1 )); then From da4492bee864ce90e474e2d2cd0ae3c29c7a5093 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:23:02 +0100 Subject: [PATCH 073/175] v6.22 + DietPi-Patch | Remove dependency on "p7zip-full", assure "p7zip" install instead --- dietpi/patch_file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 501c26edda..76dbb2324c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1660,6 +1660,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list #------------------------------------------------------------------------------- + #Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/Fourdee/DietPi/pull/2559 + dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full + G_AGI p7zip + #------------------------------------------------------------------------------- fi From 22a85eb2dc70d39573d04a821617a758a4622ebc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:25:20 +0100 Subject: [PATCH 074/175] v6.22 + DietPi-Set_Hardware | Use standalone lightweight "7zr" to handle 7z archives --- dietpi/func/dietpi-set_hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index fbb0eabd85..695b810e87 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -2006,7 +2006,7 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' G_CHECK_URL "$install_url_address" wget "$install_url_address" -O package.7z - 7z x -y package.7z + 7zr x -y package.7z rm package.7z G_RUN_CMD make From d95364f4af2b18e63c2bc5310b21f616d9cbd6e2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:27:40 +0100 Subject: [PATCH 075/175] v6.22 + DietPi-PREP | Reduced "p7zip-full" dependency to "p7zip" --- 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 183b1d11e7..48c6efbdf5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -638,7 +638,7 @@ _EOF_ 'kmod' # "modprobe", "lsmod", used by several DietPi scripts 'locales' # Support locales, necessary for DietPi scripts, as we use en_GB.UTF8 as default language 'nano' # Simple text editor - 'p7zip-full' # .7z wrapper + 'p7zip' # .7z wrapper 'parted' # Drive partitioning, required by DietPi-Boot + DietPi-Drive_Manager 'procps' # "kill", "ps", "pgrep", "sysctl", used by several DietPi scripts 'psmisc' # "killall", used by several DietPi scripts From a1ed33bd6562f5d1b3ee0f0ef962c0b83525d46a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:35:04 +0100 Subject: [PATCH 076/175] v6.22 + DietPi-Software | Use lightweight standalone "7zr" to handle 7z archives --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f4ee6cb6c9..7db701995f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3147,7 +3147,7 @@ _EOF_ elif [[ $type == 7z ]]; then [[ $target ]] && target="-o$target" - l_message='Extracting 7zip archive' G_RUN_CMD 7za x -y $file $target + l_message='Extracting 7zip archive' G_RUN_CMD 7zr x -y $file $target else From 98a223c7dcebced657e531213ab3641340342806 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:42:01 +0100 Subject: [PATCH 077/175] v6.22 + CHANGELOG | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b60a6da499..72e36a82a5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core dependencies from "p7zip-full" to "p7zip". - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 From 0445816193b01edc8ddfd36d33870dcba6129512 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 02:54:40 +0100 Subject: [PATCH 078/175] v6.22 + DietPi-FS_partition_resize | Tiny: Remove obsolete "RemainAfterExit=no" as this is default and would not harm anyway --- rootfs/etc/systemd/system/dietpi-fs_partition_resize.service | 1 - 1 file changed, 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service index 572445179c..74830cb128 100644 --- a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service +++ b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service @@ -8,7 +8,6 @@ Before=var-swap.swap swap.target local-fs-pre.target [Service] Type=oneshot -RemainAfterExit=no 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' From 8d4829fb477b48e98133d95dac6a79b5fcc14b10 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 14:14:10 +0100 Subject: [PATCH 079/175] v6.22 (#2525) + DietPi-Software | Emby Server: Install latest version via "api.github.com", which now offers native ARMv8 packages as well + CHANGELOG | Emby Server: Now installs the latest version automatically + CHANGELOG | Remove doubled "additional issues" entry. Keep this only in most current version, same as "Known/Outstanding Issues". + DietPi-Software | Emby Server: Drop ARM support on Jessie due to libc6 version requirement + CHANGELOG | Emby Server: Add info about disabled install option on Jessie ARM systems --- CHANGELOG.txt | 4 ++-- dietpi/dietpi-software | 42 ++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b60a6da499..16eb96bd8e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,12 +4,14 @@ v6.22 Changes / Improvements / Optimisations: - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. +- DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 @@ -49,8 +51,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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones - ----------------------------------------------------------------------------------------------------------- v6.20 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f4ee6cb6c9..ad5c73be08 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -648,11 +648,14 @@ _EOF_ 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]='f=8&t=5&p=1789#p1789' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' - # - Disable for ARM6: https://github.com/Fourdee/DietPi/issues/534#issuecomment-416405968 + # - Disable for ARMv6: https://github.com/Fourdee/DietPi/issues/534#issuecomment-416405968 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + # - Disable for all ARM on Jessie: https://github.com/Fourdee/DietPi/issues/2521 + (( $G_DISTRO < 4 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 + #------------------ software_id=42 @@ -660,7 +663,7 @@ _EOF_ 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]='f=8&t=5&p=1949#p1949' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' # - Disable for ARMv6: https://github.com/Fourdee/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -672,7 +675,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='mumble voip server' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1691#p1691' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' #------------------ software_id=118 @@ -724,7 +727,7 @@ _EOF_ 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]='f=8&t=5&p=5171#p5171' + 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 @@ -741,7 +744,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=6526#p6526' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -5212,28 +5215,27 @@ _EOF_ Banner_Installing - G_CHECK_URL 'https://github.com/MediaBrowser' + INSTALL_URL_ADDRESS='https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - #X86_64 - if (( $G_HW_ARCH == 10 )); then + # ARMv7 + local arch='armhf' - no_check_url=1 Download_Install 'https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.2.0/emby-server-deb_3.5.2.0_amd64.deb' + # ARMv8 + if (( $G_HW_ARCH == 3 )); then - #ARM - else + arch='arm64' - #ARMv8 - if (( $G_HW_ARCH == 3 )); then + # x86_64 + elif (( $G_HW_ARCH == 10 )); then - dpkg --add-architecture armhf - G_AGUP - G_AGI gcc-6-base:armhf libc6:armhf libgcc1:armhf zlib1g:armhf + arch='amd64' - fi + fi - no_check_url=1 Download_Install 'https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.2.0/emby-server-deb_3.5.2.0_armhf.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)" - fi + unset arch fi From 6768f9ae972d21bb7c0df7e1bf22ece28190c54d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 15:00:59 +0100 Subject: [PATCH 080/175] v6.22 (#2562) + DietPi-Software | Koel/MineOS: Fix install on ARMv8 systems, where "n" command explicitly requires "-a arm64" + CHANGELOG | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 16eb96bd8e..aae500e3d8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 - DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ad5c73be08..314565de17 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5313,11 +5313,11 @@ _EOF_ Banner_Installing - #check folder is online + # Check folder is online INSTALL_URL_ADDRESS='https://github.com/hexparrot/mineos-node.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #prereqs + # Pre-reqs G_AGI python python3 supervisor rdiff-backup screen rsync mkdir -p $G_FP_DIETPI_USERDATA/mineos @@ -5328,9 +5328,12 @@ _EOF_ git config core.filemode false chmod +x service.js mineos_console.js generate-sslcert.sh webui.js - #Install Node 8, as MineOS is currently not compatible with Node 10 + # Install Node 8, as MineOS is currently not compatible with Node 10: https://github.com/Fourdee/DietPi/issues/1880 npm i -g --unsafe-perm n - n 8 + # - On ARMv8 explicitly add arch info, since it is not recognized by "n": https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 + local arch='' + (( $G_HW_ARCH == 3 )) && arch='-a arm64' + n $arch 8 npm i --unsafe-perm @@ -5758,7 +5761,10 @@ _EOF_ # Install pre-req yarn and "n" to downgrade to Node 8, as Node 10 is not (yet) compatible with Koel build. npm i -g --unsafe-perm yarn n - n 8 + # - On ARMv8 explicitly add arch info, since it is not recognized by "n": https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 + local arch='' + (( $G_HW_ARCH == 3 )) && arch='-a arm64' + n $arch 8 # Download and install Composer: php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php From 347644a8f968614d9f39a199b0f02002c9cb0b05 Mon Sep 17 00:00:00 2001 From: lwqcz <39486334+lwqcz@users.noreply.github.com> Date: Sun, 17 Feb 2019 15:33:00 +0100 Subject: [PATCH 081/175] Update to get correct CPU temp Update to get correct CPU temperature reading on Pine64 with sunxi64 based kernel. As it gives temperature multiplied by 1000 and this value is integer instead of float. Just a minor change. --- 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 5711aacc20..02b437c01c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1922,11 +1922,11 @@ $print_logfile_info fi # - Boards that provide 2 digit output - # Pine + # Pine (when using sunxi64 kernel thermal_zone gives 1000*temp_value) # NanoPi M2 # H3 3.x # H2+ 3.x - if (( $G_HW_MODEL == 40 || + if (( ($G_HW_MODEL == 40 && $(uname -r | awk -F '-' '{ print $2 }') != 'sunxi64') || $G_HW_MODEL == 61 || ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then From 059595d833c67e12c44a0da9d5ed1593acac5e36 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 18 Feb 2019 12:02:06 +0100 Subject: [PATCH 082/175] v6.22 + DietPi-Start_kodi | Do not load DietPi-Globals, since G_HW_MODEL is required only --- dietpi/misc/start_kodi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index c157fd6864..e17c8a1252 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -17,8 +17,8 @@ # - /DietPi/dietpi/misc/start_kodi #//////////////////////////////////// #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Start_kodi' + # G_HW_MODEL required only + G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) ##Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -35,7 +35,7 @@ else #From Desktop - if [ "$DISPLAY" ]; then + if [[ $DISPLAY ]]; then #C2 fix for stuttering and laggy audio: https://github.com/Fourdee/DietPi/issues/399#issuecomment-229413994 if (( $G_HW_MODEL == 12 )); then @@ -57,7 +57,6 @@ fi #----------------------------------------------------------------------------------- - #exit exit #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 4e86b9e660610becd867184ea92459c99962ea36 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Feb 2019 20:27:14 +0000 Subject: [PATCH 083/175] v6.22 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 --- .conf/dps_128/mpd.conf | 4 ++-- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 +++- dietpi/patch_file | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.conf/dps_128/mpd.conf b/.conf/dps_128/mpd.conf index 64ae79f22f..7a085d27eb 100644 --- a/.conf/dps_128/mpd.conf +++ b/.conf/dps_128/mpd.conf @@ -6,8 +6,8 @@ pid_file "/var/run/mpd/pid" state_file "/mnt/dietpi_userdata/.mpd_cache/state" sticker_file "/mnt/dietpi_userdata/.mpd_cache/sticker.sql" -user "mpd" -group "dietpi" +#user "mpd" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi" +#group "dietpi" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi" bind_to_address "localhost" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c13b2c5fc8..102ca8f0fc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 - DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 +- DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 42ccfed939..0a3696af95 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8418,7 +8418,9 @@ Documentation=file:///usr/share/doc/mpd/user-manual.html After=network.target sound.target [Service] -#User=mpd # Forks its own process under user set in /etc/mpd.conf (mpd) +User=mpd +#Group=dietpi # Do not change, use system assigned groups, requires both dietpi and audio groups +PermissionsStartOnly=true RuntimeDirectory=/var/run/mpd ExecStartPre=$(command -v mkdir) -p /var/run/mpd ExecStartPre=$(command -v chown) -R mpd:dietpi /var/run/mpd diff --git a/dietpi/patch_file b/dietpi/patch_file index 76dbb2324c..77e501c344 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1664,6 +1664,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full G_AGI p7zip #------------------------------------------------------------------------------- + # - Reinstalls + # MPD: https://github.com/Fourdee/DietPi/issues/2462 + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 + #------------------------------------------------------------------------------- fi From c1cda33b07568ca5a289c4a93b4c0d1e2a44a45d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Feb 2019 03:09:52 +0100 Subject: [PATCH 084/175] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: "gcc-4.9" should be sufficient for build + DietPi-Set_Hardware | I-Sabre-K2M: Add correct gcc binary to make commands --- dietpi/func/dietpi-set_hardware | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ddd76912e8..614e0a6939 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1990,7 +1990,7 @@ _EOF_ G_AGUP # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 - G_AGI $rpi_firmware raspberrypi-kernel-headers make g++-4.9 + G_AGI $rpi_firmware raspberrypi-kernel-headers make gcc-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe if [[ $old_firmware != $(ls /lib/modules/) ]]; then @@ -2015,10 +2015,10 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c 7z x -y package.7z rm package.7z - G_RUN_CMD make - G_RUN_CMD make modules_install - G_RUN_CMD make dtbs - G_RUN_CMD make install_dtbo + G_RUN_CMD make CC=gcc-4.9 + G_RUN_CMD make CC=gcc-4.9 modules_install + G_RUN_CMD make CC=gcc-4.9 dtbs + G_RUN_CMD make CC=gcc-4.9 install_dtbo cd /tmp/$G_PROGRAM_NAME rm -R i-sabre-k2m_build From 9462a008f25f269eda421913f3c559abef0d48f2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Feb 2019 03:15:58 +0100 Subject: [PATCH 085/175] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: Minor comment fix --- dietpi/func/dietpi-set_hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 614e0a6939..0124eab9f7 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1989,7 +1989,7 @@ _EOF_ local rpi_firmware='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0' G_AGUP # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo - # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 + # - This makes the build process currently incompatible with Raspbian Buster: gcc-4.9 => v4.9.4 G_AGI $rpi_firmware raspberrypi-kernel-headers make gcc-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe From 30768a47ec49496d33cd2e853c6889b04c2b82ff Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 20 Feb 2019 18:39:00 +0000 Subject: [PATCH 086/175] v6.22 + Fix CPU temp readout + simplify code. --- dietpi/func/dietpi-globals | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8d14301408..0e1e093021 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1913,23 +1913,8 @@ $print_logfile_info fi - # - Boards that provide 2 digit output - # Pine (when using sunxi64 kernel thermal_zone gives 1000*temp_value) - # NanoPi M2 - # H3 3.x - # H2+ 3.x - if (( ($G_HW_MODEL == 40 && $(uname -r | awk -F '-' '{ print $2 }') != 'sunxi64') || - $G_HW_MODEL == 61 || - ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || - ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then - - echo 'Do nothing' &> /dev/null - - else - - cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") - - fi + # - 2/5 digit output? + (( $cpu_temp_current >= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") # - Native PC + possibily others, due to vast sensors /sys/class/thermal/thermal_zone[0-9], all of which we are unsure is CPU, check for possible invalid entries and set N/A # EG: Z83 = 0, also seen some results as a minus value From 816c8503fcf38c6a243e731824439684d8cf41ce Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 22 Feb 2019 20:19:46 +0100 Subject: [PATCH 087/175] v6.22 (#2570) + DietPi-Set_Software | setpermissions: Add Pi-hole Git based permissions reset to allow "pihole -up" + DietPi-Patch | Fix Pi-hole permissions to allow "pihole -up" + CHANGELOG | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_software | 9 +++++++++ dietpi/patch_file | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b90ec40eb5..58fb024fe1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -20,6 +20,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 - DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 +- DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Thanks to @jonare77 for resporting this issue: https://github.com/Fourdee/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 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/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index c3c5cecc68..f2ad4a23c2 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -467,6 +467,15 @@ _EOF_ # - 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 + + cd /var/www/html/admin && git reset --hard HEAD + cd /tmp/$G_PROGRAM_NAME + + fi + } #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/patch_file b/dietpi/patch_file index 77e501c344..f845457ed2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1668,6 +1668,14 @@ Also have a look at "Sonarr", another alternative TV show manager, available for # MPD: https://github.com/Fourdee/DietPi/issues/2462 (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 #------------------------------------------------------------------------------- + #Fix Pi-hole permissions to allow "pihole -up" + if [[ -d /var/www/html/pihole ]]; then + + cd /var/www/html/admin && git reset --hard HEAD + cd /tmp/$G_PROGRAM_NAME + + fi + #------------------------------------------------------------------------------- fi From 4c6a3bc8fa81ad1bd8038b7f51d196271b5e5fea Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 22 Feb 2019 20:20:58 +0100 Subject: [PATCH 088/175] v6.22 (#2574) + DietPi-Obtain_network_details | Skip loading DietPi-Globals, since we don't use them at all. Add exit path in case of concurrent execution instead. --- dietpi/func/obtain_network_details | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index 6e1d940203..31d31cc586 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -24,11 +24,14 @@ # - IP address #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Obtain_network_details' - G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals + #G_PROGRAM_NAME='DietPi-Obtain_network_details' + #G_INIT + # Import DietPi-Globals -------------------------------------------------------------- + + # Exit, if already running + pgrep 'obtain_network_details' &> /dev/null && exit #///////////////////////////////////////////////////////////////////////////////////// # Global @@ -47,7 +50,7 @@ DEV_MAX=9 Scrape_IP(){ - #ETH + # ETH for (( i=0; i<=$DEV_MAX; i++ )) do @@ -68,7 +71,7 @@ done - #WLAN + # WLAN for (( i=0; i<=$DEV_MAX; i++ )) do @@ -101,7 +104,7 @@ #///////////////////////////////////////////////////////////////////////////////////// Scrape_IP #----------------------------------------------------------------------------------- - #Output to file + # Output to file cat << _EOF_ > $FP_NETFILE $ETH_INDEX $WLAN_INDEX @@ -111,7 +114,7 @@ ETH_IP=$ETH_IP WLAN_IP=$WLAN_IP _EOF_ - #Assure that non-root user can read file: + # Assure that non-root user can read file: (( $UID )) || chmod 666 $FP_NETFILE #----------------------------------------------------------------------------------- From 8b6f46f5c48a453ae416fa23688c7e2fbed16628 Mon Sep 17 00:00:00 2001 From: WilburWalsh <47111045+WilburWalsh@users.noreply.github.com> Date: Sat, 23 Feb 2019 10:36:14 +0100 Subject: [PATCH 089/175] Gmediarender service starts with obtained IP - Gmediarender service waits for Dietpi Boot Service to finish, then uses obtained IP address - Fixed bug with missing write access for log file --- dietpi/dietpi-software | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0a3696af95..5ac669fdd3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12342,13 +12342,15 @@ _EOF_ cat << _EOF_ > /etc/systemd/system/gmrender.service [Unit] Description=GMrender (DietPi) -After=network.target +After=network.target dietpi-boot.service [Service] Type=simple User=gmrender Group=dietpi -ExecStart=$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log +ExecStartPre=+/usr/bin/touch /var/log/gmrender.log +ExecStartPre=+/bin/chown gmrender /var/log/gmrender.log +ExecStart=/bin/bash -c '$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log -I "\$(/bin/sed -n 4p /DietPi/dietpi/.network)"' [Install] WantedBy=multi-user.target From 01c7eede64f41f19d0734fc50752d1a2eac96a98 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 15:50:53 +0100 Subject: [PATCH 090/175] v6.22 + DietPi-Software | GMediaRender: Enhance reinstall by using "usermod", if user already exists + DietPi-Software | GMediaRender: Pre-create log file; Failsafe + DietPi-Software | GMediaRender: Generally use $(command -v cmd) when adding commands to systemd units; Failsafe + DietPi-Software | GMediaRender: Generally do not use bash subshell for systemd unit Exec if not required for redirects + DietPi-Software | OpenSSH Client: Do NOT purge "openssh-client" if server is installed, since due to dependencies OpenSSH Server would be removed as well. + DietPi-Software | Minor coding and ordering --- dietpi/dietpi-software | 65 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5ac669fdd3..81062fba2a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -801,7 +801,7 @@ _EOF_ 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]='f=8&t=5&p=7966#p7966' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -839,12 +839,12 @@ _EOF_ #------------------ software_id=163 - aSOFTWARE_WHIP_NAME[$software_id]='Gmediarender' + 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]='f=8&t=5&p=9012#p9012' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' #------------------ software_id=167 @@ -854,7 +854,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=9368#p9368' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' # Disable for ARMv8 + x86_64: aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -868,7 +868,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=12969#p12969' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' #------------------ software_id=86 @@ -879,7 +879,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=13160#p13160' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' #BitTorrent #-------------------------------------------------------------------------------- @@ -6134,8 +6134,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Allo Web Interface - software_id=159 #160 for quick reinstall + software_id=159 # Allo Web Interface (160 for quick reinstall) if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then @@ -6144,8 +6143,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Gmediarender - software_id=163 + software_id=163 # GMediaRender if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6174,8 +6172,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #AudioPhonics Pi-SPC - software_id=166 + software_id=166 # AudioPhonics Pi-SPC if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6186,8 +6183,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Raspotify - software_id=167 + software_id=167 # Raspotify if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -12331,26 +12327,32 @@ _EOF_ fi - #Gmediarender - software_id=163 + software_id=163 # GMediaRender if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm gmrender -G dietpi,audio -s /usr/sbin/nologin + # Create/Edit user + local usercmd='useradd -rm' + getent passwd gmrender &> /dev/null && usercmd='usermod' + $usercmd gmrender -G dietpi,audio -s /usr/sbin/nologin + + # Pre-create log file + >> /var/log/gmrender.log + chown gmrender:gmrender /var/log/gmrender.log + # Create systemd unit cat << _EOF_ > /etc/systemd/system/gmrender.service [Unit] -Description=GMrender (DietPi) +Description=GMediaRender (DietPi) After=network.target dietpi-boot.service [Service] -Type=simple User=gmrender Group=dietpi -ExecStartPre=+/usr/bin/touch /var/log/gmrender.log -ExecStartPre=+/bin/chown gmrender /var/log/gmrender.log -ExecStart=/bin/bash -c '$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log -I "\$(/bin/sed -n 4p /DietPi/dietpi/.network)"' +ExecStartPre=!$(command -v touch) /var/log/gmrender.log +ExecStartPre=!$(command -v chown) gmrender:gmrender /var/log/gmrender.log +ExecStart=$(command -v gmediarender) -u '$(sed -n 5p /DietPi/dietpi/.hw_model)' -f '$( /dev/null G_AGP gmrender - rm /etc/systemd/system/gmrender.service + [[ -f /etc/systemd/system/gmrender.service ]] && rm /etc/systemd/system/gmrender.service - userdel -rf gmrender + getent passwd gmrender &> /dev/null && userdel -rf gmrender fi @@ -14450,11 +14451,7 @@ _EOF_ Banner_Uninstalling # This also removes OpenSSH server. So lets check OpenSSH server isn't installed before hand. - if dpkg --get-selections | grep -qi 'openssh-server'; then - - G_AGP openssh-client - - fi + dpkg-query -s 'openssh-server' &> /dev/null || G_AGP openssh-client fi From 65b34d8d8984a0298e13bd8b558333afa492444f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 16:03:46 +0100 Subject: [PATCH 091/175] v6.22 + CHANGELOG | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP and a failing service start due to missing log file + CHANGELOG | OpenSSH Client: Resolved an issue where uninstalling the OpenSSH Client will in case also remove the OpenSSH Server --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 58fb024fe1..8b39a45464 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,8 @@ Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 +- DietPi-Software | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP if multiple network devices are present. As well resolved a failing service start on fresh install if/as the log file does not exist yet. Many thanks to @WilburWalsh for reporting these issues and providing a fix: https://github.com/Fourdee/DietPi/issues/2576 +- DietPi-Software | OpenSSH Client: Resolved an issue where uninstalling the OpenSSH Client will in case also remove the OpenSSH Server. - DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 From 221d300752dc810fdaeb5b678b1e9828f9dc319f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 18:12:18 +0100 Subject: [PATCH 092/175] v6.22 + DietPi-Software | GMediaRender: Revert using (dash) subshell for ExecStart to allow "$(sed -n 4p /DietPi/dietpi/.network)" command substitution + DietPi-Software | GMediaRender: Use "dietpi" group for log file for consistency --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 81062fba2a..8b4dcb4f8d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12339,7 +12339,7 @@ _EOF_ # Pre-create log file >> /var/log/gmrender.log - chown gmrender:gmrender /var/log/gmrender.log + chown gmrender:dietpi /var/log/gmrender.log # Create systemd unit cat << _EOF_ > /etc/systemd/system/gmrender.service @@ -12351,8 +12351,8 @@ After=network.target dietpi-boot.service User=gmrender Group=dietpi ExecStartPre=!$(command -v touch) /var/log/gmrender.log -ExecStartPre=!$(command -v chown) gmrender:gmrender /var/log/gmrender.log -ExecStart=$(command -v gmediarender) -u '$(sed -n 5p /DietPi/dietpi/.hw_model)' -f '$( Date: Sat, 23 Feb 2019 19:28:54 +0100 Subject: [PATCH 093/175] v6.22 + DietPi-PostBoot | Print only file name instead of full path when executing postboot.d scripts + DietPi-PostBoot | Print login banner only if no autologin selected --- dietpi/postboot | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dietpi/postboot b/dietpi/postboot index 152f71aff5..e225c6b84f 100644 --- a/dietpi/postboot +++ b/dietpi/postboot @@ -23,25 +23,25 @@ # Regular boot if (( $( /dev/null & fi - # - Start dietpi-services + # - Start DietPi controlled services /DietPi/dietpi/dietpi-services start fi - # Execute users custom boot scripts + # Execute optional boot scripts for f in /var/lib/dietpi/postboot.d/* do if [[ -f $f ]]; then - echo "DietPi-PostBoot | Running user script: $f" + echo "DietPi-PostBoot | Running user script: ${f##*/}" chmod +x $f $f @@ -49,10 +49,14 @@ done - # Print DietPi login banner - echo -e '\n' - /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' + # Print DietPi login banner if no autologin selected + if [[ ! -f /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf ]]; then + + echo -e '\n' + /DietPi/dietpi/func/dietpi-banner 0 + echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' + + } #----------------------------------------------------------------------------------- exit From aef14bbc4adf64b4f5f4385b89f39fc16261b79d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 19:39:23 +0100 Subject: [PATCH 094/175] v6.22 (#2578) + DietPi-Software | UrBackup: Update install links to v2.3.7 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 50 ++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8b39a45464..bae245cb19 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 +- DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8b4dcb4f8d..d0464f7259 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1069,7 +1069,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1064#p1064' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' #------------------ software_id=111 @@ -1078,7 +1078,7 @@ _EOF_ 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]='f=8&t=5&p=65#p65' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' # No deb packages for ARMv6: aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -4125,28 +4125,27 @@ _EOF_ fi - #urbackup server - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - if (( $G_HW_ARCH == 10 )); then - - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server_2.2.11_amd64.deb' + # ARMv7 + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_armhf.deb' - elif (( $G_HW_ARCH == 2 )); then + # x86_64 + if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server_2.2.11_armhf.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_amd64.deb' - #ARMv8 sourcebuild + # ARMv8 source elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server-2.2.11.tar.gz' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server-2.3.7.tar.gz' fi - #ARMv8 source build + # ARMv8 source build if (( $G_HW_ARCH == 3 )); then DEPS_LIST='build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3' @@ -4166,7 +4165,7 @@ _EOF_ cd /tmp/$G_PROGRAM_NAME rm -R urbackup-server-* - #Deb + # Deb else debconf-set-selections <<< "urbackup-server urbackup/backuppath string $G_FP_DIETPI_USERDATA/urbackup" @@ -11255,18 +11254,17 @@ _EOF_ fi - #Urbackup server - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration mkdir -p $G_FP_DIETPI_USERDATA/urbackup/urbackup_tmp_files - #As we have /tmp mounted to RAM, change tmp locations + # As we have /tmp mounted to RAM, change tmp locations sed -i '/DAEMON_TMPDIR=/c\DAEMON_TMPDIR="/var/tmp"' /etc/default/urbackupsrv - #https://github.com/Fourdee/DietPi/issues/545#issuecomment-252419739 + # https://github.com/Fourdee/DietPi/issues/545#issuecomment-252419739 #sqlite3 /usr/local/var/urbackup/backup_server_settings.db "UPDATE settings SET value = '/mnt/dietpi_userdata/urbackup/' WHERE key = 'backupfolder'" fi @@ -14468,20 +14466,20 @@ _EOF_ fi - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP urbackup-server - #+sourcebuild - rm /etc/systemd/system/urbackupsrv.service - rm /etc/default/urbackupsrv - rm /etc/logrotate.d/urbackupsrv - rm /usr/sbin/urbackupsrv - rm /usr/bin/urbackup_snapshot_helper - rm /usr/bin/urbackupsrv - rm -R /usr/share/urbackup + # +sourcebuild + [[ -f /etc/systemd/system/urbackupsrv.service ]] && rm /etc/systemd/system/urbackupsrv.service + [[ -f /etc/default/urbackupsrv ]] && rm /etc/default/urbackupsrv + [[ -f /etc/logrotate.d/urbackupsrv ]] && rm /etc/logrotate.d/urbackupsrv + [[ -f /usr/sbin/urbackupsrv ]] && rm /usr/sbin/urbackupsrv + [[ -f /usr/bin/urbackup_snapshot_helper ]] && rm /usr/bin/urbackup_snapshot_helper + [[ -f /usr/bin/urbackupsrv ]] && rm /usr/bin/urbackupsrv + [[ -d /usr/share/urbackup ]] && rm -R /usr/share/urbackup fi From 7376e4474613ccd034b1611181cf18da158fe964 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 22:07:41 +0100 Subject: [PATCH 095/175] v6.22 (#2582) + DietPi-Software | GMediaRender: Enable Buster support by using the up-to-date APT repo package --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 46 ++++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bae245cb19..d30c868013 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 +- DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 - DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d0464f7259..194ff29e74 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3591,7 +3591,7 @@ 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 libupnp6 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' + 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' else @@ -3611,8 +3611,8 @@ We work around this error by running APT a second time. Please do not worry and #Buster+ else - # libcdio-paranoia1 and libiso9660-8 not available, but ibcdio-paranoia2 and libiso9660-11 instead - # Buster repo version >= 0.20.23, thus stay with APT for now: + # 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: G_AGI mpd fi @@ -6147,27 +6147,39 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gmrender_1_' - if (( $G_HW_ARCH == 10 )); then + # Stretch + Jessie: Use our updated package + if (( $G_DISTRO < 5 )); then - INSTALL_URL_ADDRESS+='amd64.deb' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gmrender_1_' + if (( $G_HW_ARCH == 10 )); then - elif (( $G_HW_ARCH == 3 )); then + INSTALL_URL_ADDRESS+='amd64.deb' - INSTALL_URL_ADDRESS+='arm64.deb' + elif (( $G_HW_ARCH == 3 )); then - elif (( $G_HW_ARCH == 2 )); then + INSTALL_URL_ADDRESS+='arm64.deb' - INSTALL_URL_ADDRESS+='armv7.deb' + elif (( $G_HW_ARCH == 2 )); then - elif (( $G_HW_ARCH == 1 )); then + INSTALL_URL_ADDRESS+='armv7.deb' - INSTALL_URL_ADDRESS+='armv6.deb' + elif (( $G_HW_ARCH == 1 )); then - fi + INSTALL_URL_ADDRESS+='armv6.deb' - DEPS_LIST='libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa' - Download_Install "$INSTALL_URL_ADDRESS" + fi + + DEPS_LIST='libupnp6 gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly' + Download_Install "$INSTALL_URL_ADDRESS" + + # Buster: Use the up-to-date APT repo package + else + + G_AGI gmediarender gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly + # - Disable init.d service, use our systemd unit instead + systemctl disable gmediarender + + fi fi @@ -12912,7 +12924,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libavformat57 libupnp6 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 libupnp6 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 &> /dev/null + #apt-mark auto libavformat57 libupnp6 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 &> /dev/null apt-mark unhold mpd 1> /dev/null G_AGP mpd libmpdclient2 getent passwd mpd &> /dev/null && userdel -rf mpd @@ -14261,7 +14273,7 @@ _EOF_ Banner_Uninstalling #apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null - G_AGP gmrender + G_AGP gmrender gmediarender [[ -f /etc/systemd/system/gmrender.service ]] && rm /etc/systemd/system/gmrender.service getent passwd gmrender &> /dev/null && userdel -rf gmrender From 9f7aaeef4a5b66b44a40ba8588cb9625d979c748 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:09:15 +0100 Subject: [PATCH 096/175] v6.22 (#2571) + DietPi-Software | WireGuard: Disable sid repo by default, only enable WireGuard packages, to prevent any accidental package upgrades + DietPi-Software | WireGuard: On RPi, install Debian repo keyring --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d30c868013..88ed4f4de6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 +- DietPi-Software | WireGuard: Hardened "sid" repo handling on RPi, to prevent accidental non-WireGuard package installs. Thanks to @rucknapucknavitz for reporting this issue: https://github.com/Fourdee/DietPi/issues/2568#issuecomment-465725312 - DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 - DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 194ff29e74..6711123b80 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4918,13 +4918,19 @@ _EOF_ # 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 - # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed via G_AGI. + # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. G_AGI $kernel_packages # apt-get install overrides hold state - # Add Debian "sid" repo, which contains the wireguard packages + # Add Debian "sid" repo, which contains the WireGuard packages echo 'deb https://deb.debian.org/debian/ sid main' > /etc/apt/sources.list.d/dietpi-wireguard.list - # - Set "sid" priority low enough to only install packages that are not available in main repo(s) - echo -e 'Package: *\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard + # - Disable sid repo via priority "-1", to prevent any accidental package upgrades: https://github.com/Fourdee/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 + + # 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' + G_AGUP # Check for existing WireGuard install From 43c7822690b7f6da3de5aad627cd35b62c1a5a26 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:26:22 +0100 Subject: [PATCH 097/175] v6.22 + DietPi-Patch | Inform and allow user to keep "p7zip-full" + DietPi-Patch | WireGuard: Harden "sid" repo handling and on RPi, catch up on installing the Debian keyring + DietPi-Patch | MPD: Fix permissions issue manually, prevent another reinstall for end user --- dietpi/patch_file | 52 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index f845457ed2..4b3bd8710d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1651,22 +1651,25 @@ Also have a look at "Sonarr", another alternative TV show manager, available for G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- #Mopidy fix: https://github.com/Fourdee/DietPi/issues/2536 - if grep -q '^mopidy' /etc/passwd; then - - usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy - - fi + getent passwd mopidy &> /dev/null && usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy #------------------------------------------------------------------------------- #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list #------------------------------------------------------------------------------- #Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/Fourdee/DietPi/pull/2559 - dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full G_AGI p7zip - #------------------------------------------------------------------------------- - # - Reinstalls - # MPD: https://github.com/Fourdee/DietPi/issues/2462 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 + if dpkg-query -s p7zip-full &> /dev/null && + ! G_WHIP_BUTTON_OK_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO '[QUESTION] Do you want to keep "p7zip-full"?\n +DietPi does not require the "p7zip-full" package anymore but just "p7zip" instead. +- "p7zip" provides the lightweight standalone "7zr" command to handle 7zip archives only. +- "p7zip-full" additionally provides the "7z" and "7za" commands which can handle other archive types as well. + However, DietPi internally uses "unzip", "tar" and "unrar" to handle those.\n +Do you still want to keep "p7zip-full"?'; then + + apt-mark auto p7zip-full + G_AGA + + fi #------------------------------------------------------------------------------- #Fix Pi-hole permissions to allow "pihole -up" if [[ -d /var/www/html/pihole ]]; then @@ -1676,6 +1679,35 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + #WireGuard: Harden "sid" repo handling and on RPi, catch up on installing the Debian keyring: https://github.com/Fourdee/DietPi/pull/2571 + if [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then + + if (( $G_HW_MODEL < 10 )); then + + wget https://dietpi.com/downloads/binaries/rpi/debian-archive-keyring.deb + dpkg -i debian-archive-keyring.deb + rm debian-archive-keyring.deb + + fi + + 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 + + fi + #------------------------------------------------------------------------------- + #MPD: Fix permissions issue: https://github.com/Fourdee/DietPi/issues/2462 + if [[ -f /etc/mpd/mpd.conf ]]; then + + sed -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd/mpd.conf + sed -i '/^Group=/d' /lib/systemd/system/mpd.service + G_CONFIG_INJECT 'User=' 'User=mpd' /lib/systemd/system/mpd.service '\[Service\]' + G_CONFIG_INJECT 'PermissionsStartOnly=' 'PermissionsStartOnly=true' /lib/systemd/system/mpd.service '^User=mpd' + usermod -a -G audio,dietpi mpd + systemctl daemon-reload + systemctl restart mpd + + fi + #------------------------------------------------------------------------------- fi From 6fd3d47ffe4890fa12710b1a6047d3b525b24158 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:43:44 +0100 Subject: [PATCH 098/175] v6.22 + DietPi-PostBoot | Syntax --- dietpi/postboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/postboot b/dietpi/postboot index e225c6b84f..43c2e96f47 100644 --- a/dietpi/postboot +++ b/dietpi/postboot @@ -56,7 +56,7 @@ /DietPi/dietpi/func/dietpi-banner 0 echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' - } + fi #----------------------------------------------------------------------------------- exit From 0f3d701adc187ca02c902330bc302adc6c017c9b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:54:06 +0100 Subject: [PATCH 099/175] v6.22 (#2572) + DietPi-Globals | G_AG*: Remove --allow-downgrades/remove-essential/unauthenticated, since these cases are mostly harmful + DietPi-Globals | G_AG*: Use "G_DIETPI-NOTIFY 2 '\e[0m" for initial info print to still force white text in contrast to apt-get output + DietPi-Globals | G_AG*: Do not create input string array, since "for i in $string" has exactly the same result + DietPi-Globals | G_AG*: "-qq" includes "-y" + DietPi-Globals | G_AG*: Reorder apt-get command and options to have consistent "apt-get [] []" + DietPi-Globals | G_AG*: No colour reset required after apt-get output, since G_ERROR_HANDLER implies this + DietPi-Globals | G_AG*: Add "-q(q)" to certain commands to reduce processing output a bid --- dietpi/func/dietpi-globals | 103 ++++++++++++------------------------- 1 file changed, 32 insertions(+), 71 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 0e1e093021..64757b22e6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -156,7 +156,7 @@ Please check if one of the following applies: - You started this script from within another DietPi program, causing a loop.\n Please assure that the concurrent execution has finished, before retrying, otherwise cancel this instance.\n The following info might help: -$(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then +$(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then G_DIETPI-NOTIFY 1 "Canceled $G_PROGRAM_NAME due to concurrent execution" exit 1 @@ -1545,32 +1545,22 @@ $print_logfile_info G_CHECK_ROOT_USER 1 local string=$@ - local force_options='' - - if (( $G_DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - else - - force_options='--force-yes' - - fi + local options='' + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - G_ERROR_HANDLER_COMMAND="G_AGI: $string" + 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 - G_DIETPI-NOTIFY 0 "APT installation for: \e[33m$string\e[0m, please wait..." + G_DIETPI-NOTIFY 2 "\e[0mAPT installation for: \e[33m$string\e[0m, please wait..." echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options install $string 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1586,19 +1576,15 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - local string=( "$@" ) + local string=$@ local options='' - if (( $G_DISTRO >= 4 )); then - - options+=' --allow-change-held-packages' - - fi + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - G_ERROR_HANDLER_COMMAND="G_AGP: ${string[@]}" + G_ERROR_HANDLER_COMMAND="G_AGP $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT # - Remove non-matching packages from string, which are not installed, to prevent failures. @@ -1610,10 +1596,10 @@ $print_logfile_info local packages_to_remove='' dpkg --get-selections > $fp_temp local i=0 - for i in "${string[@]}"; do + for i in $string; do if grep -qi "^$i[[:space:]|:]" $fp_temp || - { echo -e $i | grep -qi '*' && grep -qi "^$i" $fp_temp; }; then #wildcard check + { grep -qi '*' <<< $i && grep -qi "^$i" $fp_temp; }; then #wildcard check packages_to_remove+="$i " G_DIETPI-NOTIFY 2 "Install verified: $i" @@ -1625,17 +1611,15 @@ $print_logfile_info fi done - rm $fp_temp unset string #habbit :) if [[ $packages_to_remove ]]; then - G_DIETPI-NOTIFY 0 "APT removal for: \e[33m$packages_to_remove\e[0m, please wait..." + G_DIETPI-NOTIFY 2 "\e[0mAPT removal for: \e[33m$packages_to_remove\e[0m, please wait..." echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get purge -y $packages_to_remove $options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options purge $packages_to_remove 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' else @@ -1664,12 +1648,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGA' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT autoremove + purge, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT autoremove + purge, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq --purge autoremove 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1692,12 +1675,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGF' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT fix, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT fix, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq -f install 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1720,13 +1702,12 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGUP' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT update, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT update, please wait...' echo -ne '\e[90m' DEBIAN_FRONTEND=noninteractive apt-get clean 2>&1 | tee $G_FP_LOG_APT - DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee -a $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -q update 2>&1 | tee -a $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1749,19 +1730,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGUG' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT upgrade, please wait...' - - local options='' - if (( $G_DISTRO >= 4 )); then - - options='--allow-unauthenticated' - - fi + G_DIETPI-NOTIFY 2 '\e[0mAPT upgrade, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y $options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq upgrade 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1777,6 +1750,9 @@ $print_logfile_info G_CHECK_ROOT_USER 1 + local options='' + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' + G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do @@ -1784,22 +1760,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGDUG' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - if (( $G_DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - else - - force_options='--force-yes' - - fi - - G_DIETPI-NOTIFY 0 'APT dist-upgrade, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT dist-upgrade, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y $force_options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options dist-upgrade 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1818,40 +1783,36 @@ $print_logfile_info local fp_temp='/tmp/.G_AG_CHECK_INSTALL_PREREQ' local exit_code=0 - local string=( "$@" ) + local string=$@ local packages_to_install='' - G_DIETPI-NOTIFY 0 "Checking for pre-req APT packages: \e[33m${string[*]}" + G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: \e[33m$string" dpkg --get-selections > $fp_temp local i=0 - for i in "${string[@]}"; do + for i in $string; do if ! grep -qi "^$i[[:space:]]" $fp_temp; then - G_DIETPI-NOTIFY 2 "Flagged for installation: $i" + G_DIETPI-NOTIFY 2 "Flagged for installation: \e[33m$i" packages_to_install+=" $i" fi done + rm $fp_temp if [[ $packages_to_install ]]; then - G_DIETPI-NOTIFY -2 'Installing pre-req APT packages' G_AGI $packages_to_install exit_code=$? else - G_DIETPI-NOTIFY 2 'Pre-req APT packages are installed' + G_DIETPI-NOTIFY 2 'Pre-req APT packages were already installed' fi - #G_AGI now handles the error - - rm $fp_temp - return $exit_code } From 2cd6ac139156aade8e041b4c5f84e3da23a1f2dd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Feb 2019 16:19:10 +0100 Subject: [PATCH 100/175] v6.22 + DietPi-Globals | Fix G_* function execution via G_SUDO() by explicitly sourcing DietPi-Globals; Workaround required since "sudo -s" does not wait for all bashrc scripts being loaded before executing the provided command + DietPi-Globals | Minor coding --- dietpi/func/dietpi-globals | 51 ++++++++++++++------------------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 64757b22e6..e52a16e6c7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -127,10 +127,11 @@ _EOF_ #INIT functions for originating script # - Stuff we can't init in main globals/funcs due to /etc/bashrc.d/ load into current session. - G_INIT_ALLOW_CONCURRENT=${G_INIT_ALLOW_CONCURRENT:-0} - G_INIT_WAIT_CONCURRENT=${G_INIT_WAIT_CONCURRENT:-5} G_INIT(){ + G_INIT_ALLOW_CONCURRENT=${G_INIT_ALLOW_CONCURRENT:-0} + G_INIT_WAIT_CONCURRENT=${G_INIT_WAIT_CONCURRENT:-5} + # Check for concurrent execution if (( ! $G_INIT_ALLOW_CONCURRENT )); then @@ -149,7 +150,7 @@ _EOF_ else G_WHIP_BUTTON_OK_TEXT='Retry' - if ! G_WHIP_YESNO "WARNING: Concurrent execution of $G_PROGRAM_NAME detected.\n + if ! G_WHIP_YESNO "WARNING: Concurrent execution of $G_PROGRAM_NAME detected\n Please check if one of the following applies: - This script already runs on another terminal/SSH session. - Currently a cron or systemd background job executes the script. @@ -457,7 +458,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - G_CHECK_ROOT_USER_VERIFIED=${G_CHECK_ROOT_USER_VERIFIED:-0} #only check once for each session # $1 = mode # - 0 = Exit all linked scripts (kill all) # - 1 = Kill current script only, excluding the shell. @@ -468,9 +468,9 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $UID )); then local input=0 - disable_error=1 G_CHECK_VALIDINT $1 && input=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && input=$1 - G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "G_SUDO", or, "sudo -i".' + G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "G_SUDO", or, "sudo -s".' if (( $input == 0 )); then @@ -493,7 +493,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - G_CHECK_ROOTFS_RW_VERIFIED=${G_CHECK_ROOTFS_RW_VERIFIED:-0} #only check once for each session G_CHECK_ROOTFS_RW(){ if [[ $G_CHECK_ROOTFS_RW_VERIFIED != 1 ]]; then @@ -519,12 +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 profile.d is reloaded (ensures ENV with our globals) - G_SUDO(){ - - sudo -i $@ - - } + # - 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/Fourdee/DietPi/issues/424 @@ -621,11 +616,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #Update backtitle WHIP_BACKTITLE="$G_PROGRAM_NAME | $G_HW_MODEL_DESCRIPTION" - if [[ -r '/DietPi/dietpi/.network' ]]; then - - WHIP_BACKTITLE+=" | IP: $(sed -n 4p /DietPi/dietpi/.network)" - - fi + [[ -r '/DietPi/dietpi/.network' ]] && WHIP_BACKTITLE+=" | IP: $(sed -n 4p /DietPi/dietpi/.network)" #Automaticaly set size of whiptail box and contents local input_mode=$1 @@ -833,7 +824,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Display a whip message G_WHIP_MSG(){ - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then @@ -854,7 +845,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Display a whip message inside a scrollbox G_WHIP_SCROLLBOX(){ - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then @@ -880,7 +871,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ G_WHIP_INIT 0 local option_default_no='--defaultno' [[ ${G_WHIP_DEFAULT_ITEM,,} == 'yes' || ${G_WHIP_DEFAULT_ITEM,,} == 'ok' ]] && option_default_no='' @@ -904,7 +895,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=("$@") + 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' ' ') @@ -1368,7 +1359,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 done @@ -2133,11 +2124,7 @@ $print_logfile_info #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} - if [[ -z $G_THREAD_COMMAND ]]; then - - G_THREAD_COMMAND=() - - fi + [[ $G_THREAD_COMMAND ]] || G_THREAD_COMMAND=() G_THREAD_START(){ @@ -2172,7 +2159,7 @@ $print_logfile_info # fi - while true + while : do local thread_active=0 From cbfc4e6363d0a11d73c250740b6afcd992cd0e4a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Feb 2019 22:13:34 +0100 Subject: [PATCH 101/175] v6.22 (#2586) + DietPi-Config | Fix wrong shown connection state where in some cases a route is shown but suffixed with "linkdown" + DietPi-Obtain_network_details | Rewrite: Scan more targeted via /sys/class/net entries: Performance! + DietPi-Obtain_network_details | Verify that device with assigned IP is actually connected, via "ip a" =~ "UP" flag --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 4 +- dietpi/func/obtain_network_details | 118 +++++++++++++++-------------- 3 files changed, 65 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 88ed4f4de6..b706208c22 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- General | Resolved an issue where DietPi-Config and banner shows wrong adapter state if it is not connected but has an IP assigned. Thanks to @msongz for reporting this issue: https://github.com/Fourdee/DietPi/issues/2573 - RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 - DietPi-Software | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP if multiple network devices are present. As well resolved a failing service start on fresh install if/as the log file does not exist yet. Many thanks to @WilburWalsh for reporting these issues and providing a fix: https://github.com/Fourdee/DietPi/issues/2576 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index fd6d7fd985..3cd2537510 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2765,7 +2765,7 @@ _EOF_ ETH_MODE_TARGET=$ETH_MODE #Connected and Valid IP? - ETH_CONNECTED=$(ip r | grep -ci -m1 "eth$ETH_DEV_INDEX") + ETH_CONNECTED=$(ip -o r l dev eth$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') #Enabled and Connected if (( $ETH_DISABLED == 0 && $ETH_CONNECTED == 1 )); then @@ -2789,7 +2789,7 @@ _EOF_ WIFI_MODE_TARGET=$WIFI_MODE #Connected and Valid IP? - WIFI_CONNECTED=$(ip r | grep -ci -m1 "wlan$WIFI_DEV_INDEX") + WIFI_CONNECTED=$(ip -o r l dev wlan$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') #Enabled and Connected if (( $WIFI_DISABLED == 0 && $WIFI_CONNECTED == 1 )); then diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index 31d31cc586..27dcce9f4c 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -10,26 +10,19 @@ #//////////////////////////////////// # # Info: + # - Location: /{DietPi,boot}/dietpi/func/obtain_network_details # - Attempts to find the 1st available index numbers for eth[0-9] and wlan[0-9] devices # - Obtains the active network adapter (eth, then wlan). - # - Saves the above data to $FP_NETFILE for use systemwide + # - Saves the above data to $FP_NETFILE for use system-wide # - # $FP_NETFILE line1 - # - eth index - # $FP_NETFILE line2 - # - wlan index - # $FP_NETFILE line3 - # - Active adapter name (eg: eth0) - # $FP_NETFILE line4 - # - IP address + # line1: eth index + # line2: wlan index + # line3: Active adapter name (eg: eth0) + # line4: Active IP address + # line5: ETH_IP= + # line6: WLAN_IP= #//////////////////////////////////// - # Import DietPi-Globals -------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals - #G_PROGRAM_NAME='DietPi-Obtain_network_details' - #G_INIT - # Import DietPi-Globals -------------------------------------------------------------- - # Exit, if already running pgrep 'obtain_network_details' &> /dev/null && exit @@ -39,61 +32,74 @@ FP_NETFILE='/DietPi/dietpi/.network' - ETH_INDEX=0 - WLAN_INDEX=0 - - ACTIVE_DEVICE='NONE' + ETH_INDEX='' + WLAN_INDEX='' + ACTIVE_DEVICE='' + ACTIVE_IP='' ETH_IP='' WLAN_IP='' - IP_ADDRESS='Use dietpi-config to setup a connection' - DEV_MAX=9 - Scrape_IP(){ + Scan(){ # ETH - for (( i=0; i<=$DEV_MAX; i++ )) + local eth_dev='' eth_index='' eth_out='' eth_ip='' + for i in /sys/class/net/eth* do - if ETH_IP=$(ip -o a s eth$i 2>/dev/null); then + # Check if any eth dev exists + [[ -e $i ]] || break - ETH_INDEX=$i - ETH_IP=${ETH_IP#*inet* } - ETH_IP=${ETH_IP%%/*} - if [[ $ETH_IP ]]; then + # Get dev name and index, assign not yet if lower index found + eth_dev=${i#*net/} + eth_index=${eth_dev#eth} + [[ $ETH_INDEX ]] || ETH_INDEX=$eth_index - ACTIVE_DEVICE="eth$ETH_INDEX" - IP_ADDRESS=$ETH_IP - break + # Get and check IP, assign not yet if lower index IP found + eth_out=$(ip a s $eth_dev 2>/dev/null) || continue + eth_ip=${eth_out#*inet* } + eth_ip=${eth_ip%%/*} + [[ $eth_ip ]] || continue + [[ $ETH_IP ]] || { ETH_IP=$eth_ip; ETH_INDEX=$eth_index; } - fi + # Check connection state + [[ $eth_out =~ [[:blank:]]UP[[:blank:]] ]] || continue - fi + # Assign active dev info + ETH_INDEX=$eth_index + ETH_IP=$eth_ip + ACTIVE_DEVICE=$eth_dev + ACTIVE_IP=$ETH_IP + break done # WLAN - for (( i=0; i<=$DEV_MAX; i++ )) + local wlan_dev='' wlan_index='' wlan_out='' wlan_ip='' + for i in /sys/class/net/wlan* do - if WLAN_IP=$(ip -o a s wlan$i 2>/dev/null); then - - WLAN_INDEX=$i - WLAN_IP=${WLAN_IP#*inet* } - WLAN_IP=${WLAN_IP%%/*} - if [[ $WLAN_IP ]]; then - - if [[ ! $ETH_IP ]]; then - - ACTIVE_DEVICE="wlan$WLAN_INDEX" - IP_ADDRESS=$WLAN_IP + [[ -e $i ]] || break - fi + # Get dev name and index, assign not yet if lower index found + wlan_dev=${i#*net/} + wlan_index=${wlan_dev#wlan} + [[ $WLAN_INDEX ]] || WLAN_INDEX=$wlan_index - break + # Get and check IP, assign not yet if lower index IP found + wlan_out=$(ip a s $wlan_dev 2>/dev/null) || continue + wlan_ip=${wlan_out#*inet* } + wlan_ip=${wlan_ip%%/*} + [[ $wlan_ip ]] || continue + [[ $WLAN_IP ]] || { WLAN_IP=$wlan_ip; WLAN_INDEX=$wlan_index; } - fi + # Check connection state + [[ $wlan_out =~ [[:blank:]]UP[[:blank:]] ]] || continue - fi + # Assign active dev info if none (eth) assigned yet + WLAN_INDEX=$wlan_index + WLAN_IP=$wlan_ip + [[ $ACTIVE_DEVICE ]] || { ACTIVE_DEVICE=$wlan_dev; ACTIVE_IP=$WLAN_IP; } + break done @@ -102,19 +108,19 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - Scrape_IP + Scan #----------------------------------------------------------------------------------- - # Output to file + # Write to file cat << _EOF_ > $FP_NETFILE -$ETH_INDEX -$WLAN_INDEX -$ACTIVE_DEVICE -$IP_ADDRESS +${ETH_INDEX:-0} +${WLAN_INDEX:-0} +${ACTIVE_DEVICE:-NONE} +${ACTIVE_IP:-Use dietpi-config to setup a connection} ETH_IP=$ETH_IP WLAN_IP=$WLAN_IP _EOF_ - # Assure that non-root user can read file: + # Assure that non-root user can write file (( $UID )) || chmod 666 $FP_NETFILE #----------------------------------------------------------------------------------- From c323c6baaf8c9903b6d1f07a4fd8ce7e13c428b1 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 25 Feb 2019 02:13:30 +0100 Subject: [PATCH 102/175] META | DietPi-Survey_report: Write to /tmp first, move to /var/www/survey afterwards --- .meta/dietpi-survey_report | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 6cf4d6542b..c748719f1e 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -4,7 +4,7 @@ # Created by Micha / micha@dietpi.com / dietpi.com #----------------------------------------------------------- - #Globals - benchmarks + # Globals - benchmarks #----------------------------------------------------------- # 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) @@ -71,7 +71,6 @@ # - Optional benchmarks declare -A aBENCH_CUSTOMFS_WRITE declare -A aBENCH_CUSTOMFS_READ - declare -A aBENCH_NET_LAN_SPEED #Results @@ -117,7 +116,7 @@ aBENCH_RESULT_NET_LAN_SPEED_AVG=() #----------------------------------------------------------- - #Globals - Survey + # Globals - Survey #----------------------------------------------------------- SURVEY_COUNT_TOTAL=0 SURVEY_COUNT_EMPTY=0 @@ -520,7 +519,6 @@ #Done, clear vars unset BENCH_VERSION unset BENCH_HW_MODEL - unset BENCH_CPU unset BENCH_ROOTFS_WRITE unset BENCH_ROOTFS_READ @@ -528,7 +526,6 @@ unset BENCH_RAM_READ unset BENCH_CPU_TEMP_START unset BENCH_CPU_TEMP_END - unset BENCH_CUSTOMFS_WRITE unset BENCH_CUSTOMFS_READ unset BENCH_NET_LAN_SPEED @@ -606,6 +603,12 @@ done + # Navigate to parent /tmp + cd /tmp + + # Clean up reports dir + rm -R /tmp/dietpi-survey_report + SURVEY_SENTCOUNT_TOTAL=0 for i in ${!aSURVEY_SENTCOUNT[@]} do @@ -852,15 +855,16 @@ done # - Optional benchmarks CUSTOMFS - # 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_WRITE_MIN[$i]=$default_min_value + #aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 + #aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 - # aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value - # aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 - # aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 + #aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value + #aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 + #aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 - cat << _EOF_ > /var/www/survey/index.html + # Create HTML file + cat << _EOF_ > index.html -

DietPi-Survey report page:

- Uploads since: 01.01.2019 00:00:00 UTC
+

DietPi-Survey report page

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

- - - -
Total user count$SURVEY_COUNT_TOTAL
Users opted in$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY ))
Users opted out$SURVEY_COUNT_EMPTY
- -

DietPi-Survey versions:

- - $(for i in ${!aSURVEY_VERSION[@]}; do echo ""; done | sort -nrk 1.24 -t ' ') -
DietPi-Survey v$i ${aSURVEY_VERSION[$i]}
- -

DietPi-Survey opt-in upload counts:

- - - - $(for i in ${!aSURVEY_SENTCOUNT[@]}; do echo ""; done | sort -nrk 1.9 -t ' ') + + +
Overall upload count$SURVEY_SENTCOUNT_TOTAL
Upload countby user count
$i ${aSURVEY_SENTCOUNT[$i]}
Total install count$SURVEY_COUNT_TOTAL
Opted in installs$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY ))
Opted out installs$SURVEY_COUNT_EMPTY

DietPi versions:

diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index f5d4b3c252..d6bafceb69 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -23,23 +23,20 @@ # $(sed -n 5p /DietPi/dietpi/.hw_model).txt #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Survey' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- EXIT_CODE=1 # 1=failed to send survey, 0=survey sent, 2=opted out and sent - #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 - #Force opted in, for automated installations by default - OPTED_IN=1 #1=yes | 0=no and purge data - SURVEY_SENTCOUNT=0 - SURVEY_VERSION=6 + # Force opted in for automated installations by default + OPTED_IN=1 # 1=yes | 0=no and purge data DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB" UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) @@ -50,21 +47,12 @@ SFTP_PASS='upload2dietpi' FP_SETTINGS='/DietPi/dietpi/.dietpi-survey' - Write_Settings(){ - - cat << _EOF_ > $FP_SETTINGS -$OPTED_IN -$SURVEY_SENTCOUNT -_EOF_ - - } - + Write_Settings(){ echo $OPTED_IN > $FP_SETTINGS; } Read_Settings(){ - OPTED_IN=$(sed -n 1p $FP_SETTINGS) - # Force interactive mode, if invalid opt value is found: - (( OPTED_IN < 0 || OPTED_IN > 1 )) && INPUT=0 - SURVEY_SENTCOUNT=$(sed -n 2p $FP_SETTINGS) + OPTED_IN=$(<$FP_SETTINGS) + # Force interactive mode if invalid opt value is found + [[ $OPTED_IN == [01] ]] || INPUT=0 } @@ -84,10 +72,8 @@ _EOF_ cat << _EOF_ > $UPLOAD_FILENAME #!/bin/bash # ------------------------- -((aSURVEY_VERSION[$SURVEY_VERSION]++)) -# ------------------------- -((aSURVEY_SENTCOUNT[$((SURVEY_SENTCOUNT+1))]++)) ((aDIETPI_VERSION[$DIETPI_VERSION]++)) +# ------------------------- ((aGIT_BRANCH[$gitbranch]++)) ((aDEVICE_NAME[$G_HW_MODEL_DESCRIPTION]++)) ((aCPU_ARCH[$G_HW_ARCH_DESCRIPTION]++)) @@ -137,7 +123,7 @@ _EOF_ local info_failure_msg='Failed to connect to SFTP server. Please try again later. If problems persist, please report this issue to the DietPi dev team (forum or GitHub repo).' - #Check if we have a working internet connection beforehand + # Check if we have a working internet connection beforehand G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL "$SFTP_ADDR" if (( $G_ERROR_HANDLER_EXITCODE_RETURN == 0 )); then @@ -152,7 +138,7 @@ _EOF_ fi - #Upload to server + # Upload to server curl --connect-timeout 8 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/survey/ if (( $? )); then @@ -164,8 +150,6 @@ _EOF_ EXIT_CODE=0 G_DIETPI-NOTIFY 0 'Successfully sent survey data' - # Increase sent count - ((SURVEY_SENTCOUNT++)) # Successful upload + opted out + interactive elif (( ! $INPUT )); then @@ -190,19 +174,19 @@ _EOF_ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Read data from .dietpi-survey file + # Read data from .dietpi-survey file if [[ -f $FP_SETTINGS ]]; then Read_Settings - #Force interactive user choice, if no settings file found = no choice made yet + # Force interactive user choice, if no settings file found = no choice made yet elif (( $G_USER_INPUTS )); then INPUT=0 fi - #Input mode: Send survey if opted in or empty file if opted out + # Input mode: Send survey if opted in or empty file if opted out if (( $INPUT == 1 )); then Generate_File @@ -221,7 +205,7 @@ _EOF_ ) - G_WHIP_MENU "DietPi-Survey would like to collect anonymous statistics about your hardware, DietPi software and settings. \ + if G_WHIP_MENU "DietPi-Survey would like to collect anonymous statistics about your hardware, DietPi software and settings. \ This allows us to focus development based on popularity. NO private data will be collected and NO ONE can identify you based on the data. \ The data is sent via secured connection to our SFTP server and is stored there unreadable to the public upload user. \ If you agree, your uploaded data will be automatically updated on every DietPi-Update and DietPi-Software usage. \ @@ -230,8 +214,7 @@ The current survey statistics can be reviewed at: https://dietpi.com/survey Your personal upload file would look like this: $(<$UPLOAD_FILENAME) -Would you like to join DietPi-Survey?" - if (( ! $? )); then +Would you like to join DietPi-Survey?"; then OPTED_IN=$G_WHIP_RETURNED_VALUE Send_File diff --git a/dietpi/patch_file b/dietpi/patch_file index 5956861a03..0e9e8dbe5e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1666,6 +1666,14 @@ _EOF_ fi + fi + #------------------------------------------------------------------------------- + #DietPi-Survey: Remove survey sent count from settings file: https://github.com/MichaIng/DietPi/pull/2626 + 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 + fi #------------------------------------------------------------------------------- #Reinstalls From 634851d6da7eefb8e5f0dfbeb673ac971a959fcf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 16:59:12 +0100 Subject: [PATCH 173/175] v6.22 + DietPi-Software | DietPi-RAMlog: Fix wrong logging mode estimation at end of uninstall when disabling/uninstalling and enabling/installing RAMlog again: Uninstall adds "#/var/log" to fstab, install only removes "[[:blank:]]/var/log[[:blank:]]", so when uninstall finalise is reached again, it will find "#/var/log" and detects logging mode "0". + DietPi-Software | DietPi-RAMlog: Enable and start RAMlog tmpfs directly which allows us to clean the /var/log mountpoint priorly. + DietPi-Software | DietPi-RAMlog: Do never run "systemctl daemon-reload" during boot process (from within dietpi-ramlog_disable.service) which can mess the currently running boot order and is also not required here. + DietPi-Software | DietPi-RAMlog: Minor coding and wording --- dietpi/dietpi-software | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 012efaab06..83e69f3017 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6711,13 +6711,21 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - l_message='Copy /var/log skeletons to temporary storage' G_RUN_CMD /DietPi/dietpi/func/dietpi-ramlog 1 - # Install (add tmpfs mount to fstab) + # Install persistent tmpfs local tmpfs_max_size=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - sed -i '/[[:space:]]\/var\/log[[:space:]]/d' /etc/fstab + tmpfs_max_size=${tmpfs_max_size:=50} + sed -i '/[[:blank:]]\/var\/log[[:blank:]]/d' /etc/fstab echo "tmpfs /var/log tmpfs defaults,size=${tmpfs_max_size}m,noatime,nodev,nosuid,mode=1777 0 0" >> /etc/fstab + + # Enable DietPi-RAMdisk systemctl enable dietpi-ramlog + # To assure a cleaned mountpoint we need to start RAMlog now + l_message='Storing /var/log metadata to disk' G_RUN_CMD /DietPi/dietpi/func/dietpi-ramlog 1 + l_message='Cleaning /var/log mountpoint' G_RUN_CMD rm -Rf /var/log/{,.??,.[^.]}* + l_message='Mounting tmpfs to /var/log' G_RUN_CMD mount /var/log + l_message='Restoring metadata to /var/log tmpfs' G_RUN_CMD systemctl start dietpi-ramlog + fi software_id=101 @@ -14601,31 +14609,28 @@ _EOF_ fi - software_id=103 + software_id=103 # DietPi-RAMlog if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - sed -i '/\/var\/log/c\#\/var\/log DietPi-RAMlog disabled' /etc/fstab + sed -i '/[[:blank:]]\/var\/log[[:blank:]]/d' /etc/fstab - # - Boot service to allow dietpi-ramlog to start and copy skeletons back to /var/log, then finally disable ramlog cat << _EOF_ > /etc/systemd/system/dietpi-ramlog_disable.service [Unit] -Description=DietPi - Boot service to allow dietpi-ramlog to start and copy skeletons back to /var/log, then finally disable ramlog +Description=DietPi-RAMlog_disable | Disables DietPi-RAMlog after it has restored log metadata back to /var/log After=dietpi-ramlog.service dietpi-ramdisk.service Requires=dietpi-ramdisk.service -Before=dietpi-boot.service rsyslog.service syslog.service +Before=dietpi-preboot.service rsyslog.service syslog.service [Service] Type=oneshot -RemainAfterExit=yes StandardOutput=tty ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-ramlog/disable.sh &> /var/tmp/dietpi/logs/dietpi-ramlog_disable_debug.log' [Install] WantedBy=local-fs.target _EOF_ - systemctl daemon-reload systemctl enable dietpi-ramlog_disable @@ -14634,14 +14639,12 @@ _EOF_ { systemctl stop dietpi-ramlog systemctl disable dietpi-ramlog - rm -R /var/tmp/dietpi/logs/dietpi-ramlog_store/* + rm -R /var/tmp/dietpi/logs/dietpi-ramlog_store systemctl disable dietpi-ramlog_disable rm /etc/systemd/system/dietpi-ramlog_disable.service - systemctl daemon-reload rm /var/lib/dietpi/dietpi-ramlog/disable.sh } _EOF_ - chmod +x /var/lib/dietpi/dietpi-ramlog/disable.sh fi @@ -14742,7 +14745,7 @@ _EOF_ fi - if grep -q '#/var/log' /etc/fstab && + if ! grep -q '[[:blank:]]/var/log[[:blank:]]' /etc/fstab && ! grep -q '^rsyslog' $fp_temp && ! grep -q '^logrotate' $fp_temp; then From 81281d3c08f4e35505981a1cb7e10f0bf3c1883b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 17:07:57 +0100 Subject: [PATCH 174/175] v6.22 + CHANGELOG | DietPi-RAMlog --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f768727458..5a80f83f53 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from official docs. Deluge now runs as user "debian-deluged", logs have been moved to "/var/log/deluged/" and the init.d service with its traces are removed, which are all pre-generated by the Debian APT package. The systemd units have been adjusted according to the official Deluge documentation. These changes are applied as well to existing installs during DietPi update, the old user "deluge" and obsolete configurations are removed. Your active configurations and data are preserved, the installer has been as well enhanced to better handle existing installs and never touch existing configs. Note that access to the Deluge console has to be done as user "debian-deluged" (sudo -u debian-deluged deluge-console). A related access issue to the console has been fixed by this as well. Many thanks to @seanmikhaels for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5525 - DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 +- DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 @@ -38,6 +39,7 @@ Bug Fixes: - DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for resporting this issue: https://github.com/MichaIng/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 +- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 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/pulls?q=is%3Aclosed+base%3Amaster From dad12fc612103449469ef9ccddb6290331169a02 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 19:57:33 +0100 Subject: [PATCH 175/175] v6.22 + DietPi-Software | DietPi-RAMlog: Pre-create "/var/lib/dietpi/dietpi-ramlog" before attempting to place "disable.sh" inside. --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 83e69f3017..9576471ba3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14634,6 +14634,7 @@ _EOF_ systemctl daemon-reload systemctl enable dietpi-ramlog_disable + mkdir -p /var/lib/dietpi/dietpi-ramlog cat << _EOF_ > /var/lib/dietpi/dietpi-ramlog/disable.sh #!/bin/bash {