From cf8e3723279a65054bf89ef05bfdb65fe95b1aa9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 11 Dec 2019 17:31:40 +0100 Subject: [PATCH 01/34] META | Image request template: Fix typo --- .github/ISSUE_TEMPLATE/image_request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/image_request.md b/.github/ISSUE_TEMPLATE/image_request.md index f6870141db..18b0501cc0 100644 --- a/.github/ISSUE_TEMPLATE/image_request.md +++ b/.github/ISSUE_TEMPLATE/image_request.md @@ -22,5 +22,5 @@ about: Suggest a new SBC to be added to the offial support and image list of Die - ... -#### Vote for this iamge on FeatHub: https://feathub.com/MichaIng/DietPi/ +#### Vote for this image on FeatHub: https://feathub.com/MichaIng/DietPi/ From 9811e9c403d447ccb678eb69e63b4d9d47f00f19 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 10:37:43 +0100 Subject: [PATCH 02/34] v6.27 + DietPi-Patch | Minor wording, align with DietPi-PREP --- dietpi/patch_file | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 8ed0243b96..0986b34970 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2213,23 +2213,23 @@ Would you like to switch back to the Nginx authentication method now?' && certbo systemctl mask $services done - # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi rm -vf /etc/apt/apt.conf.d/*armbian* rm -vf /etc/cron.*/*armbian* - #rm -vf /etc/default/*armbian* + #rm -vf /etc/default/*armbian* # Required for ARMbian root package upgrade rm -vf /etc/update-motd.d/*armbian* rm -vf /etc/profile.d/*armbian* - #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian + #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for ARMbian root package upgrade [[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian + # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi cat << _EOF_ > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian # Exclude conflicting ARMbian files path-exclude /lib/systemd/system/*armbian* path-exclude /etc/apt/apt.conf.d/*armbian* path-exclude /etc/cron.*/*armbian* -#path-exclude /etc/default/*armbian* # Breaks ARMbian root package upgrade +#path-exclude /etc/default/*armbian* # Required for ARMbian root package upgrade path-exclude /etc/update-motd.d/*armbian* path-exclude /etc/profile.d/*armbian* -#path-exclude /usr/lib/armbian # Breaks ARMbian root package upgrade +#path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade path-exclude /usr/share/armbian _EOF_ #------------------------------------------------------------------------------- From d198143392960f93e174a43c20f601e024ddba53 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 10:45:14 +0100 Subject: [PATCH 03/34] v6.27 + DietPi-PREP | Keep man pages and documentation for installed packages. Removing those can cause APT upgrade issues in rare cases, removing "doc" in particular should be kept for legal reasons, as it contains copyright files/info, and finally we should enable users to simply install man-db to view all installed package man pages. When removing those, each package must be reinstalled to restore its man pages and documentation files: https://github.com/MichaIng/DietPi/issues/3259 + DietPi-PREP | Align ARMbian service and file removal with DietPi-Patch, especially prevent file and new service install via dpkg exclusion config + DietPi-PREP | Be more verbose about files we remove --- PREP_SYSTEM_FOR_DIETPI.sh | 88 ++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 38 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ce546547fa..adfd7ea5a2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -994,33 +994,33 @@ _EOF_ G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' - [[ -d '/home' ]] && rm -R /home - [[ -d '/media' ]] && rm -R /media - [[ -d '/selinux' ]] && rm -R /selinux + [[ -d '/home' ]] && rm -vR /home + [[ -d '/media' ]] && rm -vR /media + [[ -d '/selinux' ]] && rm -vR /selinux # - www - [[ -d '/var/www' ]] && rm -Rf /var/www/{,.??,.[^.]}* + [[ -d '/var/www' ]] && rm -vRf /var/www/{,.??,.[^.]}* # - Sourcecode (linux-headers etc) - [[ -d '/usr/src' ]] && rm -Rf /usr/src/{,.??,.[^.]}* + [[ -d '/usr/src' ]] && rm -vRf /usr/src/{,.??,.[^.]}* # - root - [[ -e '/root/.cache' ]] && rm -R /root/.cache - [[ -e '/root/.local' ]] && rm -R /root/.local - [[ -e '/root/.config' ]] && rm -R /root/.config + [[ -e '/root/.cache' ]] && rm -vR /root/.cache + [[ -e '/root/.local' ]] && rm -vR /root/.local + [[ -e '/root/.config' ]] && rm -vR /root/.config - # - Documentation dirs - [[ -d '/usr/share/man' ]] && rm -R /usr/share/man - [[ -d '/usr/share/doc' ]] && rm -R /usr/share/doc - [[ -d '/usr/share/doc-base' ]] && rm -R /usr/share/doc-base - [[ -d '/usr/share/calendar' ]] && rm -R /usr/share/calendar + # - Documentation dirs: https://github.com/MichaIng/DietPi/issues/3259 + #[[ -d '/usr/share/man' ]] && rm -vR /usr/share/man + #[[ -d '/usr/share/doc' ]] && rm -vR /usr/share/doc + #[[ -d '/usr/share/doc-base' ]] && rm -vR /usr/share/doc-base + [[ -d '/usr/share/calendar' ]] && rm -vR /usr/share/calendar # - Previous debconfs rm -f /var/cache/debconf/*-old # - Fonts - [[ -d '/usr/share/fonts' ]] && rm -R /usr/share/fonts - [[ -d '/usr/share/icons' ]] && rm -R /usr/share/icons + [[ -d '/usr/share/fonts' ]] && rm -vR /usr/share/fonts + [[ -d '/usr/share/icons' ]] && rm -vR /usr/share/icons # - Stop, disable and remove not required 3rd party services local aservices=( @@ -1053,7 +1053,7 @@ _EOF_ systemctl mask ${j##*/} else - rm -R $j + rm -vR $j fi @@ -1064,38 +1064,50 @@ _EOF_ systemctl daemon-reload # - ARMbian specific - [[ -f '/boot/armbian_first_run.txt.template' ]] && rm /boot/armbian_first_run.txt.template - [[ -f '/usr/bin/armbianmonitor' ]] && rm /usr/bin/armbianmonitor - [[ -d '/usr/lib/armbian' ]] && rm -R /usr/lib/armbian - [[ -f '/usr/local/sbin/log2ram' ]] && rm /usr/local/sbin/log2ram - [[ -d '/usr/share/armbian' ]] && rm -R /usr/share/armbian - #rm -f /etc/armbian* armbian-release required for kernel package update (initramfs postinst) - rm -f /etc/apt/apt.conf.d/*armbian* - rm -f /etc/cron.*/armbian* - rm -f /etc/default/armbian* - rm -f /etc/profile.d/armbian* - rm -f /etc/update-motd.d/*armbian* - rm -f /etc/X11/xorg.conf.d/*armbian* + [[ -f '/boot/armbian_first_run.txt.template' ]] && rm -v /boot/armbian_first_run.txt.template + [[ -f '/usr/bin/armbianmonitor' ]] && rm -v /usr/bin/armbianmonitor + [[ -f '/usr/local/sbin/log2ram' ]] && rm -v /usr/local/sbin/log2ram umount /var/log.hdd 2> /dev/null [[ -d '/var/log.hdd' ]] && rm -R /var/log.hdd + rm -vf /etc/X11/xorg.conf.d/*armbian* + #rm -vf /etc/armbian* armbian-release required for kernel package upgrade (initramfs postinst) + rm -vf /etc/apt/apt.conf.d/*armbian* + rm -vf /etc/cron.*/*armbian* + #rm -vf /etc/default/*armbian* # Required for ARMbian root package upgrade + rm -vf /etc/update-motd.d/*armbian* + rm -vf /etc/profile.d/*armbian* + #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for ARMbian root package upgrade + [[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian + # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi + cat << _EOF_ > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian +# Exclude conflicting ARMbian files +path-exclude /lib/systemd/system/*armbian* +path-exclude /etc/apt/apt.conf.d/*armbian* +path-exclude /etc/cron.*/*armbian* +#path-exclude /etc/default/*armbian* # Required for ARMbian root package upgrade +path-exclude /etc/update-motd.d/*armbian* +path-exclude /etc/profile.d/*armbian* +#path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade +path-exclude /usr/share/armbian +_EOF_ # - OMV: https://github.com/MichaIng/DietPi/issues/2994 - [[ -d '/etc/openmediavault' ]] && rm -R /etc/openmediavault - rm -f /etc/cron.*/openmediavault* - rm -f /usr/sbin/omv-* + [[ -d '/etc/openmediavault' ]] && rm -vR /etc/openmediavault + rm -vf /etc/cron.*/openmediavault* + rm -vf /usr/sbin/omv-* # - Meveric specific - [[ -f '/usr/local/sbin/setup-odroid' ]] && rm /usr/local/sbin/setup-odroid + [[ -f '/usr/local/sbin/setup-odroid' ]] && rm -v /usr/local/sbin/setup-odroid # - RPi specific: https://github.com/MichaIng/DietPi/issues/1631#issuecomment-373965406 - [[ -f '/etc/profile.d/wifi-country.sh' ]] && rm /etc/profile.d/wifi-country.sh - [[ -f '/etc/sudoers.d/010_pi-nopasswd' ]] && rm /etc/sudoers.d/010_pi-nopasswd - [[ -d '/etc/systemd/system/dhcpcd.service.d' ]] && rm -R /etc/systemd/system/dhcpcd.service.d # https://github.com/RPi-Distro/pi-gen/blob/master/stage3/01-tweaks/00-run.sh + [[ -f '/etc/profile.d/wifi-country.sh' ]] && rm -v /etc/profile.d/wifi-country.sh + [[ -f '/etc/sudoers.d/010_pi-nopasswd' ]] && rm -v /etc/sudoers.d/010_pi-nopasswd + [[ -d '/etc/systemd/system/dhcpcd.service.d' ]] && rm -vR /etc/systemd/system/dhcpcd.service.d # https://github.com/RPi-Distro/pi-gen/blob/master/stage3/01-tweaks/00-run.sh # Do not ship rc.local anymore. On DietPi /var/lib/dietpi/postboot.d should be used. # WIP: Mask rc-local.service and create symlink postboot.d/rc.local => /etc/rc.local for backwards compatibility? - [[ -f '/etc/rc.local' ]] && rm /etc/rc.local # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/rc.local + [[ -f '/etc/rc.local' ]] && rm -v /etc/rc.local # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/rc.local # Below required if DietPi-PREP is executed from chroot/container, so RPi firstrun scripts are not executed - [[ -f '/etc/init.d/resize2fs_once' ]] && rm /etc/init.d/resize2fs_once # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/resize2fs_once + [[ -f '/etc/init.d/resize2fs_once' ]] && rm -v /etc/init.d/resize2fs_once # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/resize2fs_once [[ -f '/boot/cmdline.txt' ]] && sed -i 's| init=/usr/lib/raspi-config/init_resize\.sh||' /boot/cmdline.txt # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/00-patches/07-resize-init.diff # - make_nas_processes_faster cron job on Rock64 + NanoPi + Pine64(?) images @@ -1111,7 +1123,7 @@ _EOF_ # - Pre v6.9 cleaning: sed -i '/\/DietPi/d' /root/.bashrc sed -i '/\/DietPi/d' /home/dietpi/.bashrc &> /dev/null - rm -f /etc/profile.d/99-dietpi* + rm -vf /etc/profile.d/99-dietpi* # - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts: sed -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc From 3cc522071c62cb96a67a33bffc971abfa4f6cbb6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 10:51:15 +0100 Subject: [PATCH 04/34] v6.27 + CHANGELOG | DietPi-PREP: New images will have all man pages and documentation files for installed packages available --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26d74d2649..e66f63d80b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes / Improvements / Optimisations: - FriendlyARM ZeroPi | Initial hardware identifier (ID: 59) and support for this device has been added to DietPi. Many thanks to @Stephan for creating the related DietPi image: https://github.com/MichaIng/DietPi/issues/3221 - RPi4 | Since RPi4, bootloader and USB firmware is stored on an internal EEPROM, which is not updated/flashed by the firmware APT package installs automatically. The additional "rpi-eeprom" package comes with an EEPROM update script and boot service, which will now be installed on DietPi update and firstrun setup automatically, if RPi4 is detected. Those firmware updates include power consumption (hence heat emission) optimisations and enable additional boot methods, currently network boot and USB boot is planned as well. This was reason enough for us to implement it automatically for all RPi4 systems. Additionally you can actively install/update the EEPROM manually via dietpi-config > Advanced Options > Update RPi4 EEPROM firmware. For additional information, read the official docs: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md Many thanks to @trueaspects for informing us about this important subject: https://github.com/MichaIng/DietPi/issues/3217 - Virtual Machines | Intel/AMD CPU microcode update packages are not installed/purged from virtual machines. The CPU is provided by the host, hypervisors do not allow to update microcode from within the guest, reasonably, and if they did, this would be serious security and stability issue. +- DietPi-PREP | New images will have all man pages and documentation files for installed packages available. Those were removed until now, but prevented users from simply installing man-db to view man pages on the system, without reinstalling packages to restore those first. Many thanks to @smudgered for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3259 - DietPi-Software | The general network check against first sources.list entry has been replaced by a pure connectivity test and separate DNS resolver test via ping. This solves an issue where sources.list parsing failed when [arch=...] was specified and allows better debugging. The sources list entries themselves are checked and error-handled by G_AGUP already. Ping target IP for connection test and domain for DNS resolver test can be set via dietpi.txt, default is Cloudflare DNS IP and domain which should be very reliable and fast all over the world. Many thanks to @lwqcz for reporting the issue and providing a solution: https://github.com/MichaIng/DietPi/pull/3243 - DietPi-Software | TasmoAdmin: The administrative website to manage ESP8266 devices flashed with Tasmota for smart home systems is now available for install. Many thanks to @svh1985 for implementing this software title: https://github.com/MichaIng/DietPi/issues/3103 - DietPi-Software | ownCloud: Enabled install on Buster, Bullseye and ARMv6 RPi models (RPi1+Zero). ownCloud 10.3 has been release with PHP7.3 support, hence it can be used with native distro PHP7.3 and does not require Ondrej's PHP repo which does not support armv6hf. From 79a1f9df0230f94cc3592bfcbd13179e3390b0b6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 12:01:42 +0100 Subject: [PATCH 05/34] v6.27 + DietPi-Software | Tor: Remove deprecated entries from config file + DietPi-Software | Tor: Leave/move logs in/to journal (stdout of systemd unit) + DietPi-Software | Tor: Remove obsolete sysvinit service and config --- dietpi/dietpi-software | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fb73f32ea6..45eae78e2d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1271,16 +1271,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='WiFi Hotspot' aSOFTWARE_DESC[$software_id]='turn your device into a wifi hotspot' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207' #------------------ software_id=61 aSOFTWARE_NAME[$software_id]='Tor Hotspot' aSOFTWARE_DESC[$software_id]='optional: route hotspot traffic through tor' - aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529' # System stats @@ -9717,37 +9717,35 @@ _EOF_ Banner_Configuration - # - Tor config + # Remove obsolete sysvinit service and config + [[ -f '/etc/init.d/tor' ]] && rm /etc/init.d/tor + update-rc.d -f tor remove + [[ -f '/etc/default/tor' ]] && rm /etc/default/tor + + # Tor config cat << _EOF_ > /etc/tor/torrc -Log notice file /var/log/tor/notices.log +Log notice stdout VirtualAddrNetwork 10.192.0.0/10 AutomapHostsSuffixes .onion,.exit AutomapHostsOnResolve 1 -TransPort 9040 -TransListenAddress 192.168.42.1 -DNSPort 53 -DNSListenAddress 192.168.42.1 +TransPort 192.168.42.1:9040 +DNSPort 192.168.42.1:53 _EOF_ - # - Flush IP tables + # Flush IP tables iptables -F iptables -t nat -F - # - Generate tor prerouting tables - local wifi_index=$(sed -n 2p /DietPi/dietpi/.network) + # Generate tor prerouting tables + local wifi_index=$(mawk 'NR==2' /DietPi/dietpi/.network) iptables -t nat -A PREROUTING -i wlan$wifi_index -p tcp --dport 22 -j REDIRECT --to-ports 22 iptables -t nat -A PREROUTING -i wlan$wifi_index -p udp --dport 53 -j REDIRECT --to-ports 53 iptables -t nat -A PREROUTING -i wlan$wifi_index -p tcp --syn -j REDIRECT --to-ports 9040 - # - Save + # Save IP tables iptables-save > /etc/iptables.ipv4.nat - # - Generate Logfile - mkdir -p /var/log/tor - > /var/log/tor/notices.log - chown -R debian-tor:nogroup /var/log/tor/notices.log - - # - User: Test tor is functional. + # User: Test tor is functional #https://check.torproject.org fi @@ -13494,17 +13492,19 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm -R /root/wiringPi* &> /dev/null + rm -Rf /root/wiringPi* fi - software_id=61 + software_id=61 # Tor Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP tor - # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. + [[ -d '/var/log/tor' ]] && rm -R /var/log/tor # pre-v6.27 + + # Uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset aSOFTWARE_INSTALL_STATE[60]=-1 fi From da997040a286d8d0fdf4d9abc0e73b270e8fe1c2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 12:19:55 +0100 Subject: [PATCH 06/34] v6.27 + CHANGELOG | Tor Hotspot: Resolved an issue where, since Buster, Tor fails to start due to deprecated config file entries --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e66f63d80b..2feafa4ac1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -36,6 +36,7 @@ Bug Fixes: - DietPi-Software | Java: Resolved an issue where install on ARMv6 RPis (1/Zero) on Buster system failed, since Java 11 is not ARMv6-compatible. On these system, Java 8 is now installed instead. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3182 - DietPi-Software | ruTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 - DietPi-Software | Amiberry: Resolved an issue where the binary fails to execute on Odroid XU4. Many thanks to @wasu111 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3181 +- DietPi-Software | Tor Hotspot: Resolved an issue where, since Buster, Tor fails to start due to deprecated config file entries. Many thanks to @blizarazu for reporting this issue: https://github.com/MichaIng/DietPi/issues/3261 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX From c107fcef3743914382cb19bc3ebc8f831d2fd0f3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 13:42:53 +0100 Subject: [PATCH 07/34] v6.27 + DietPi-Login | When DietPi-Update or DietPi-Software fails on first run setup, always prompt user to choose retry or exit, to avoid endless loop without interaction, e.g. on insufficient free space and such + DietPi-Login | Apply new network and DNS test method from DietPi-Software --- dietpi/dietpi-login | 72 ++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 7eb6447d3c..72bf7e07f8 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -105,6 +105,34 @@ } + # Force interactive prompt on unexpected state or failure, to allow user choice to retry or exit + Prompt_on_Failure(){ + + /DietPi/dietpi/func/dietpi-banner 0 + + # Force interactive mode to show G_WHIP error prompts + # - NB: We need to write this to dietpi.txt as well to not have it overwritten on next loop. + export G_INTERACTIVE=1 + G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=0' /DietPi/dietpi.txt + + if G_WHIP_DEFAULT_ITEM='yes' 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, forced as interactive run. +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/MichaIng/DietPi/issues\n +Would you like to restart the first run setup and installation?"; then + + # Reset and force re-run of first run + killall -qw dietpi-software dietpi-update + echo 0 > /DietPi/dietpi/.install_stage + + else + + exit 1 + + fi + + } + # First Run Setup Run_DietPi_First_Run_Setup(){ @@ -147,21 +175,34 @@ Please login again as user "root" with password "dietpi", respectively the one y # 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[[:blank:]]' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + # Checking network connectivity + local timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + local ip=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_CONNECTION_IP=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + l_message='Checking network connectivity' G_RUN_CMD ping -c 1 -W ${timeout:-5} ${ip:-1.1.1.1} + + # Checking DNS resolver + # - NB: The timeout is only valid for ping response while DNS resolver timeout is controlled by: https://manpages.debian.org/resolv.conf + local domain=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_DNS_DOMAIN=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + l_message='Checking DNS resolver' G_RUN_CMD ping -c 1 -W ${timeout:-5} ${domain:-one.one.one.one} - # Check NTP synced + # Network time sync /DietPi/dietpi/func/run_ntpd # Start DietPi-Update /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + # Prompt on failure + (( $(&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + # Prompt on failure + (( $( /DietPi/dietpi/.install_stage - - else - - break - - fi + Prompt_on_Failure fi From 404ddf3ae47e12481f1e2125c8299a22956d6e10 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 12 Dec 2019 15:12:31 +0100 Subject: [PATCH 08/34] v6.27 + DietPi-Survey | Do not check ssh.dietpi.com via G_CHECK_URL (wget), since this includes HTTP(S), which is not what SFTP uses. Instead use curl with sftp protocol for test as well, with timeout and attempts from dietpi.txt entries (timeout times 2 for actual file upload, since curl -m includes connection+DNS resolving+transfer all together). --- dietpi/dietpi-survey | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 71efa9e38e..57bc5d8f5d 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -109,7 +109,9 @@ _EOF_ - https://github.com/MichaIng/DietPi/issues or https://dietpi.com/phpbb/viewforum.php?f=11' # Check if we have a working internet connection beforehand - if G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL $SFTP_ADDR; then + local timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + local attempts=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + if G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD curl -I -m ${timeout:-5} --retry $(( ${attempts:-3} - 1 )) sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/; then if (( $OPTED_IN )); then @@ -123,7 +125,7 @@ _EOF_ fi # Upload to server - curl -m 8 --retry 1 --retry-delay 4 -sT $FP_UPLOAD sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/ + curl -m $(( ${timeout:-5} * 2 )) --retry $(( ${attempts:-3} - 1 )) --retry-delay 4 -sT $FP_UPLOAD sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/ if (( $? )); then # Silently fail, in case of non-interactive mode From b24939e16459f9489d8d0db5a9c9197fdb6b2f32 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Dec 2019 14:22:50 +0100 Subject: [PATCH 09/34] v6.27 + DietPi-Obtain_HW_model | Add support for new RPi4 PCB1.2 revision and possible new revision by same manufacturer (Sony) + DietPi-Obtain_HW_model | Minor coding --- dietpi/func/dietpi-obtain_hw_model | 111 ++++++++++++++--------------- 1 file changed, 55 insertions(+), 56 deletions(-) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 90b4a349e9..222ef4fcbe 100644 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -138,19 +138,19 @@ #----------------------------------------------------------------------------------- # Obtain device info by revision code: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md # - Release dates: https://www.elinux.org/RPi_HardwareHistory - # - *' because 10000002 then it indicates that your Raspberry Pi has been over-volted - HW_REVISION_CODE=$(mawk '/^Revision/ {print $3;exit}' /proc/cpuinfo) + HW_REVISION_CODE=$(mawk '/^Revision/{print $3;exit}' /proc/cpuinfo) + HW_REVISION_CODE=${HW_REVISION_CODE#1000} # Remove possible leading over-volted string G_HW_MODEL_DESCRIPTION='RPi ' - if [[ $HW_REVISION_CODE == *'Beta' ]]; then + if [[ $HW_REVISION_CODE == 'Beta' ]]; then HW_RELEASE_DATE='Q1 2012' G_HW_MODEL_DESCRIPTION+='Beta' HW_MEMORY_SIZE=256 G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0002' ]]; then + elif [[ $HW_REVISION_CODE == '0002' ]]; then HW_RELEASE_DATE='Q1 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -159,7 +159,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0003' ]]; then + elif [[ $HW_REVISION_CODE == '0003' ]]; then HW_RELEASE_DATE='Q3 2012' G_HW_MODEL_DESCRIPTION+='B (ECN0001)' @@ -168,7 +168,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0004' ]]; then + elif [[ $HW_REVISION_CODE == '0004' ]]; then HW_RELEASE_DATE='Q3 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -177,7 +177,7 @@ HW_MANUFACTURER_NAME='Sony' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0005' ]]; then + elif [[ $HW_REVISION_CODE == '0005' ]]; then HW_RELEASE_DATE='Q4 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -186,7 +186,7 @@ HW_MANUFACTURER_NAME='Qisda' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0006' ]]; then + elif [[ $HW_REVISION_CODE == '0006' ]]; then HW_RELEASE_DATE='Q4 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -195,7 +195,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0007' ]]; then + elif [[ $HW_REVISION_CODE == '0007' ]]; then HW_RELEASE_DATE='Q1 2013' G_HW_MODEL_DESCRIPTION+='A' @@ -204,7 +204,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0008' ]]; then + elif [[ $HW_REVISION_CODE == '0008' ]]; then HW_RELEASE_DATE='Q1 2013' G_HW_MODEL_DESCRIPTION+='A' @@ -213,7 +213,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0009' ]]; then + elif [[ $HW_REVISION_CODE == '0009' ]]; then HW_RELEASE_DATE='Q1 2013' G_HW_MODEL_DESCRIPTION+='A' @@ -222,7 +222,7 @@ HW_MANUFACTURER_NAME='Qisda' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'000d' ]]; then + elif [[ $HW_REVISION_CODE == '000d' ]]; then HW_RELEASE_DATE='Q4 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -231,7 +231,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'000e' ]]; then + elif [[ $HW_REVISION_CODE == '000e' ]]; then HW_RELEASE_DATE='Q4 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -240,7 +240,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'000f' ]]; then + elif [[ $HW_REVISION_CODE == '000f' ]]; then HW_RELEASE_DATE='Q4 2012' G_HW_MODEL_DESCRIPTION+='B' @@ -249,7 +249,7 @@ HW_MANUFACTURER_NAME='Egoman' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'0010' ]]; then + elif [[ $HW_REVISION_CODE == '0010' ]]; then HW_RELEASE_DATE='Q3 2014' G_HW_MODEL_DESCRIPTION+='B+' @@ -258,7 +258,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'0011' ]]; then + elif [[ $HW_REVISION_CODE == '0011' ]]; then HW_RELEASE_DATE='Q2 2014' G_HW_MODEL_DESCRIPTION+='CM' @@ -267,7 +267,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'0012' ]]; then + elif [[ $HW_REVISION_CODE == '0012' ]]; then HW_RELEASE_DATE='Q4 2014' G_HW_MODEL_DESCRIPTION+='A+' @@ -276,7 +276,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=0 - elif [[ $HW_REVISION_CODE == *'0013' ]]; then + elif [[ $HW_REVISION_CODE == '0013' ]]; then HW_RELEASE_DATE='Q1 2015' G_HW_MODEL_DESCRIPTION+='B+' @@ -285,7 +285,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'0014' ]]; then + elif [[ $HW_REVISION_CODE == '0014' ]]; then HW_RELEASE_DATE='Q2 2014' G_HW_MODEL_DESCRIPTION+='CM' @@ -294,12 +294,12 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'0015' ]]; then + elif [[ $HW_REVISION_CODE == '0015' ]]; then G_HW_MODEL_DESCRIPTION+='A+' HW_PCB_REVISION_CODE='1.1' # 256M and 512M versions exist - if (( $(mawk '/^MemTotal:/ {print $2}' /proc/meminfo) > 300000 )); then + if (( $(mawk '/^MemTotal:/{print $2;exit}' /proc/meminfo) > 300000 )); then HW_MEMORY_SIZE=512 G_HW_MODEL=1 @@ -312,7 +312,7 @@ fi HW_MANUFACTURER_NAME='Embest, China' - elif [[ $HW_REVISION_CODE == *'900021' ]]; then + elif [[ $HW_REVISION_CODE == '900021' ]]; then HW_RELEASE_DATE='Q3 2016' G_HW_MODEL_DESCRIPTION+='A+' @@ -321,7 +321,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'900032' ]]; then + elif [[ $HW_REVISION_CODE == '900032' ]]; then HW_RELEASE_DATE='Q2 2016' G_HW_MODEL_DESCRIPTION+='B+' @@ -330,7 +330,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'900092' ]]; then + elif [[ $HW_REVISION_CODE == '900092' ]]; then HW_RELEASE_DATE='Q4 2015' G_HW_MODEL_DESCRIPTION+='Zero' @@ -339,7 +339,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'900093' ]]; then + elif [[ $HW_REVISION_CODE == '900093' ]]; then HW_RELEASE_DATE='Q2 2016' G_HW_MODEL_DESCRIPTION+='Zero' @@ -348,7 +348,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'9000c1' ]]; then + elif [[ $HW_REVISION_CODE == '9000c1' ]]; then HW_RELEASE_DATE='Q1 2017' G_HW_MODEL_DESCRIPTION+='Zero W' @@ -358,7 +358,7 @@ G_HW_MODEL=1 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'9020e0' ]]; then + elif [[ $HW_REVISION_CODE == '9020e0' ]]; then HW_RELEASE_DATE='Q4 2018' G_HW_MODEL_DESCRIPTION+='3 Model A+' @@ -368,7 +368,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'920092' ]]; then + elif [[ $HW_REVISION_CODE == '920092' ]]; then G_HW_MODEL_DESCRIPTION+='Zero' HW_PCB_REVISION_CODE='1.2' @@ -376,7 +376,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'920093' ]]; then + elif [[ $HW_REVISION_CODE == '920093' ]]; then HW_RELEASE_DATE='Q4 2016' G_HW_MODEL_DESCRIPTION+='Zero' @@ -385,7 +385,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'900061' ]]; then + elif [[ $HW_REVISION_CODE == '900061' ]]; then G_HW_MODEL_DESCRIPTION+='CM' HW_PCB_REVISION_CODE='1.1' @@ -393,7 +393,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=1 - elif [[ $HW_REVISION_CODE == *'a01040' ]]; then + elif [[ $HW_REVISION_CODE == 'a01040' ]]; then G_HW_MODEL_DESCRIPTION+='2 Model B' HW_PCB_REVISION_CODE='1.0' @@ -401,7 +401,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=2 - elif [[ $HW_REVISION_CODE == *'a01041' ]]; then + elif [[ $HW_REVISION_CODE == 'a01041' ]]; then HW_RELEASE_DATE='Q1 2015' G_HW_MODEL_DESCRIPTION+='2 Model B' @@ -410,7 +410,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=2 - elif [[ $HW_REVISION_CODE == *'a02082' ]]; then + elif [[ $HW_REVISION_CODE == 'a02082' ]]; then HW_RELEASE_DATE='Q1 2016' G_HW_MODEL_DESCRIPTION+='3 Model B' @@ -420,7 +420,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a020a0' ]]; then + elif [[ $HW_REVISION_CODE == 'a020a0' ]]; then HW_RELEASE_DATE='Q1 2017' G_HW_MODEL_DESCRIPTION+='CM 3' @@ -429,7 +429,7 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=3 - elif [[ $HW_REVISION_CODE == *'a020d3' ]]; then + elif [[ $HW_REVISION_CODE == 'a020d3' ]]; then HW_RELEASE_DATE='Q1 2018' G_HW_MODEL_DESCRIPTION+='3 Model B+' @@ -439,7 +439,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a21041' ]]; then + elif [[ $HW_REVISION_CODE == 'a21041' ]]; then HW_RELEASE_DATE='Q1 2015' G_HW_MODEL_DESCRIPTION+='2 Model B' @@ -448,7 +448,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=2 - elif [[ $HW_REVISION_CODE == *'a22042' ]]; then + elif [[ $HW_REVISION_CODE == 'a22042' ]]; then HW_RELEASE_DATE='Q1 2016' G_HW_MODEL_DESCRIPTION+='2 Model B' @@ -457,7 +457,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=2 - elif [[ $HW_REVISION_CODE == *'a22082' ]]; then + elif [[ $HW_REVISION_CODE == 'a22082' ]]; then HW_RELEASE_DATE='Q1 2016' G_HW_MODEL_DESCRIPTION+='3 Model B' @@ -467,7 +467,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a220a0' ]]; then + elif [[ $HW_REVISION_CODE == 'a220a0' ]]; then G_HW_MODEL_DESCRIPTION+='CM 3' HW_PCB_REVISION_CODE='1.0' @@ -475,7 +475,7 @@ HW_MANUFACTURER_NAME='Embest, China' G_HW_MODEL=3 - elif [[ $HW_REVISION_CODE == *'a32082' ]]; then + elif [[ $HW_REVISION_CODE == 'a32082' ]]; then HW_RELEASE_DATE='Q4 2016' G_HW_MODEL_DESCRIPTION+='3 Model B' @@ -485,7 +485,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a52082' ]]; then + elif [[ $HW_REVISION_CODE == 'a52082' ]]; then HW_RELEASE_DATE='Q1 2018' G_HW_MODEL_DESCRIPTION+='3 Model B' @@ -495,7 +495,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a22083' ]]; then + elif [[ $HW_REVISION_CODE == 'a22083' ]]; then G_HW_MODEL_DESCRIPTION+='3 Model B' HW_PCB_REVISION_CODE='1.3' @@ -504,7 +504,7 @@ G_HW_MODEL=3 HW_ONBOARD_WIFI=1 - elif [[ $HW_REVISION_CODE == *'a02100' ]]; then + elif [[ $HW_REVISION_CODE == 'a02100' ]]; then G_HW_MODEL_DESCRIPTION+='CM 3+' HW_PCB_REVISION_CODE='1.0' @@ -512,14 +512,14 @@ HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=3 - elif [[ $HW_REVISION_CODE == *[abc]'03111' ]]; then + elif [[ $HW_REVISION_CODE == [abc]'0311'[1-9] ]]; then HW_RELEASE_DATE='Q2 2019' G_HW_MODEL_DESCRIPTION+='4 Model B' - HW_PCB_REVISION_CODE='1.1' - [[ $HW_REVISION_CODE == *'a03111' ]] && HW_MEMORY_SIZE=1024 - [[ $HW_REVISION_CODE == *'b03111' ]] && HW_MEMORY_SIZE=2048 - [[ $HW_REVISION_CODE == *'c03111' ]] && HW_MEMORY_SIZE=4096 + HW_PCB_REVISION_CODE="1.${HW_REVISION_CODE: -1}" + [[ $HW_REVISION_CODE == 'a'* ]] && HW_MEMORY_SIZE=1024 + [[ $HW_REVISION_CODE == 'b'* ]] && HW_MEMORY_SIZE=2048 + [[ $HW_REVISION_CODE == 'c'* ]] && HW_MEMORY_SIZE=4096 HW_MANUFACTURER_NAME='Sony, UK' G_HW_MODEL=4 HW_ONBOARD_WIFI=1 @@ -535,7 +535,7 @@ # Systems that use /etc/.dietpi_hw_model_identifier for G_HW_MODEL if [[ -f $FP_G_HW_MODEL_INDENTIFIER ]]; then - G_HW_MODEL=$(sed -n 1p $FP_G_HW_MODEL_INDENTIFIER) + G_HW_MODEL=$(mawk 'NR==1' $FP_G_HW_MODEL_INDENTIFIER) # ROCK Pi 4 if (( $G_HW_MODEL == 72 )); then @@ -729,12 +729,12 @@ G_HW_MODEL_DESCRIPTION='Generic Device' IMAGE_ADDITIONAL_CREDITS='You!' - # x86_64 native PC + # x86_64 PC elif (( $G_HW_MODEL == 21 )); then G_HW_MODEL_DESCRIPTION='Native PC' - # VM + # x86_64 VM elif (( $G_HW_MODEL == 20 )); then G_HW_MODEL_DESCRIPTION='Virtual Machine' @@ -782,12 +782,12 @@ # RPi elif grep -qi '^ID=raspbian' /etc/os-release; then - # Grab hardware description from rpi_boardinfo + # Grab hardware description from /proc/cpuinfo revision code RPi_BoardInfo fi - # Get distro index + # Get distro ID if grep -qi 'stretch' /etc/os-release; then G_DISTRO=4 @@ -805,11 +805,11 @@ # Generate UUID if it does not exist if [[ -f '/DietPi/dietpi/.hw_model' ]]; then - HW_UUID=$(mawk 'NR==5 {print}' /DietPi/dietpi/.hw_model) + HW_UUID=$(mawk 'NR==5' /DietPi/dietpi/.hw_model) elif [[ -f '/boot/dietpi/.hw_model' ]]; then - HW_UUID=$(mawk 'NR==5 {print}' /boot/dietpi/.hw_model) + HW_UUID=$(mawk 'NR==5' /boot/dietpi/.hw_model) else @@ -871,5 +871,4 @@ HW_MANUFACTURER_NAME=$HW_MANUFACTURER_NAME" >> /DietPi/dietpi/.hw_model #----------------------------------------------------------------------------------- exit 0 #----------------------------------------------------------------------------------- - } From 9634e8a4a47cad3e9604e5b9e70cd99faa358e31 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Dec 2019 21:08:27 +0100 Subject: [PATCH 10/34] v6.27 + DietPi-Software | Amiberry: On Stretch, new build does not require Xserver anymore + DietPi-Software | Amiberry: Preserve custom user files, dirs and settings by installing new amiberry.conf as amiberry.conf_new and merging new dir into existing one --- dietpi/dietpi-software | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 45eae78e2d..f445ecec5e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1039,7 +1039,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' - (( $G_DISTRO < 5 )) && aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -3794,17 +3793,14 @@ _EOF_ # Download Amiberry Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/amiberry_$platform.tar.bz2" - # Reinstall: Backup old instance - [[ -d $G_FP_DIETPI_USERDATA/amiberry ]] && G_RUN_CMD mv $G_FP_DIETPI_USERDATA/amiberry $G_FP_DIETPI_USERDATA/amiberry_bak + # Reinstall: Install new amiberry.conf as amiberry.conf_new, to preserve user settings + [[ -d $G_FP_DIETPI_USERDATA/amiberry/conf ]] && G_RUN_CMD mv amiberry/conf/amiberry.conf $G_FP_DIETPI_USERDATA/amiberry/conf/amiberry.conf_new - # Reinstall: Restore old configs and data - [[ -d $G_FP_DIETPI_USERDATA/amiberry_bak ]] && G_RUN_CMD cp -a $G_FP_DIETPI_USERDATA/amiberry_bak/{conf,kickstarts,savestates,screenshots} amiberry/ + # Move/Merge new instance in place + G_RUN_CMD cp -a amiberry $G_FP_DIETPI_USERDATA/ - # Move new instance in place - G_RUN_CMD mv amiberry $G_FP_DIETPI_USERDATA/ - - # Reinstall: Remove old instance - [[ -d $G_FP_DIETPI_USERDATA/amiberry_bak ]] && rm -R $G_FP_DIETPI_USERDATA/amiberry_bak + # Cleanup + rm -R amiberry fi @@ -8391,10 +8387,10 @@ _EOF_ Banner_Configuration - # Reinstall: Remove obsolete and old config file to allow Amiberry recreating it: https://github.com/midwan/amiberry/releases/tag/v2.25 + # Reinstall: Remove obsolete config file: https://github.com/midwan/amiberry/releases/tag/v2.25 [[ -f $G_FP_DIETPI_USERDATA/amiberry/conf/adfdir.conf ]] && rm $G_FP_DIETPI_USERDATA/amiberry/conf/adfdir.conf - [[ -f $G_FP_DIETPI_USERDATA/amiberry/conf/amiberry.conf ]] && rm $G_FP_DIETPI_USERDATA/amiberry/conf/amiberry.conf + # Service cat << _EOF_ > /etc/systemd/system/amiberry.service [Unit] Description=Amiberry Amiga Emulator (DietPi) From 588684b36f2865d0ab887669563826a5727cf72a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Dec 2019 23:35:29 +0100 Subject: [PATCH 11/34] v6.27 + DietPi-Survey | Skip dedicated URL/ping check, since generating the upload file is much faster then doing a network connection check. Error handle file upload itself + DietPi-Survey | Do not retry upload in case of failure, lets keep the overhead as small as possible --- dietpi/dietpi-survey | 91 +++++++++++++------------------------------- 1 file changed, 26 insertions(+), 65 deletions(-) diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 57bc5d8f5d..2bda4ee70e 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -21,7 +21,7 @@ # - /DietPi/dietpi/dietpi-survey Interactive menu to opt in or out # - /DietPi/dietpi/dietpi-survey 1 Non-interactively send survey data or empty file, based on previous user choice # - # File sent format: $(sed -n 5p /DietPi/dietpi/.hw_model).txt + # File sent format: $(mawk 'NR==5' /DietPi/dietpi/.hw_model).txt #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- @@ -36,12 +36,9 @@ # Grab input [[ $1 == 1 ]] && INPUT=1 || INPUT=0 - # Opted out by default, do not send data without user interactively opted in - OPTED_IN=0 # 1=yes and send data | 0=no and purge data - # Re-estimage .hw_model if not existent [[ -f '/DietPi/dietpi/.hw_model' ]] || /DietPi/dietpi/func/dietpi-obtain_hw_model - FP_UPLOAD="$(sed -n 5p /DietPi/dietpi/.hw_model).txt" + FP_UPLOAD="$(mawk 'NR==5' /DietPi/dietpi/.hw_model).txt" SFTP_ADDR='ssh.dietpi.com' SFTP_USER='dietpi-survey' @@ -59,7 +56,7 @@ # Active network interface local network_interface='NONE' - [[ -f '/DietPi/dietpi/.network' ]] && network_interface=$(sed -n 3p /DietPi/dietpi/.network) + [[ -f '/DietPi/dietpi/.network' ]] && network_interface=$(mawk 'NR==3' /DietPi/dietpi/.network) # Autostart index local autostart_index=0 @@ -74,25 +71,21 @@ ((aCPU_COUNT[$G_HW_CPU_CORES]++)) ((aDISTRO_VERSION[$G_DISTRO_NAME]++)) ((aAUTOSTART_OPTION[\${aAUTOSTART_NAME[$autostart_index]:=$autostart_index}]++)) -((aAUTO_SETUP_AUTOMATED[$(grep -m1 -ci '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt)]++)) +((aAUTO_SETUP_AUTOMATED[$(grep -cim1 '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt)]++)) ((aNETWORK_INTERFACE[$network_interface]++)) _EOF_ # DietPi-Software installs if [[ -f '/DietPi/dietpi/.installed' ]]; then - echo -e '# -------------------------\n# DietPi-Software Installs\n# -------------------------' >> $FP_UPLOAD + echo -e '# -------------------------\n# DietPi-Software installs\n# -------------------------' >> $FP_UPLOAD while read software do software=${software##*[} software=${software%%]*} - if disable_error=1 G_CHECK_VALIDINT "$software"; then - - echo "((aSOFTWARE[\${aSOFTWARE_NAME${G_DIETPI_VERSION_CORE}_${G_DIETPI_VERSION_SUB}[$software]:=$software}]++))" >> $FP_UPLOAD - - fi + disable_error=1 G_CHECK_VALIDINT "$software" && echo "((aSOFTWARE[\${aSOFTWARE_NAME${G_DIETPI_VERSION_CORE}_${G_DIETPI_VERSION_SUB}[$software]:=$software}]++))" >> $FP_UPLOAD done <<< "$(grep ']=2' /DietPi/dietpi/.installed)" @@ -105,67 +98,37 @@ _EOF_ Send_File(){ - local info_failure_msg='Failed to connect to SFTP server. Please try again later. If problems persist, please report this issue to the DietPi team: - - https://github.com/MichaIng/DietPi/issues or https://dietpi.com/phpbb/viewforum.php?f=11' - - # Check if we have a working internet connection beforehand - local timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) - local attempts=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) - if G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD curl -I -m ${timeout:-5} --retry $(( ${attempts:-3} - 1 )) sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/; then - - if (( $OPTED_IN )); then - - [[ -f $FP_UPLOAD ]] || Generate_File - - else - - # Send empty file to overwrite existing data, rm is not possible due to missing file list permissions - > $FP_UPLOAD - - fi - - # Upload to server - curl -m $(( ${timeout:-5} * 2 )) --retry $(( ${attempts:-3} - 1 )) --retry-delay 4 -sT $FP_UPLOAD sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/ - if (( $? )); then + if (( $OPTED_IN )); then - # Silently fail, in case of non-interactive mode - (( $INPUT )) || G_DIETPI-NOTIFY 1 "$info_failure_msg" + [[ -f $FP_UPLOAD ]] || Generate_File - # Successful upload + opted in - elif (( $OPTED_IN )); then + else - EXIT_CODE=0 - G_DIETPI-NOTIFY 0 'Successfully sent survey data' - - # Successful upload + opted out + interactive - elif (( ! $INPUT )); then - - EXIT_CODE=2 - G_DIETPI-NOTIFY 0 'Successfully purged survey data' - - fi - - # Silently fail, in case of non-interactive mode - elif (( ! $INPUT )); then - - G_DIETPI-NOTIFY 1 "$info_failure_msg" + # Send empty file to overwrite existing data, rm is not possible due to missing file list permissions + > $FP_UPLOAD fi + # Upload to server + local timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) l_message='Sending survey data' ok_code=0 + (( $OPTED_IN )) || l_message='Purging survey data' ok_code=1 + # - Timeout times 2 for DNS resolving + connection, upload itself is done in no time + G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD curl -m $(( ${timeout:-5} * 2 )) -sT $FP_UPLOAD sftp://$SFTP_USER:$SFTP_PASS@$SFTP_ADDR/survey/ && EXIT_CODE=$ok_code + } #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # Read opt in/out choice - if grep -q '^[[:blank:]]*SURVEY_OPTED_IN=[01]$' /DietPi/dietpi.txt; then - - OPTED_IN=$(sed -n '/^[[:blank:]]*SURVEY_OPTED_IN=[01]$/{s/^[^=]*=//;p;q}' /DietPi/dietpi.txt) - - # Force interactive menu if no choice was done yet - elif (( $G_INTERACTIVE )); then + # Read opt in/out choice: 1=yes and send data | 0=no and purge data + OPTED_IN=$(sed -n '/^[[:blank:]]*SURVEY_OPTED_IN=[01]$/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + # - No (valid) choice done yet + if [[ $OPTED_IN != [01] ]]; then - INPUT=0 + # Do not send data without user interactively opted in! + OPTED_IN=0 + # Ask for choice, if interactive + (( $G_INTERACTIVE )) && INPUT=0 fi @@ -188,8 +151,7 @@ This allows us to focus development based on popularity. - The data is sent via secured SFTP connection, stored unreadable to the public upload user. - If you agree, your uploaded data will be updated after each DietPi-Update and DietPi-Software install. - Current survey statistics can be reviewed at: https://dietpi.com/survey/ - -Would you like to join DietPi-Survey?'; then +\nWould you like to join DietPi-Survey?'; then if [[ $G_WHIP_RETURNED_VALUE == 'Show' ]]; then @@ -216,5 +178,4 @@ Would you like to join DietPi-Survey?'; then #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- - } From 32c5e492f4f8fa259133c66f9a11092ce164d24c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 16 Dec 2019 00:58:08 +0100 Subject: [PATCH 12/34] v6.27 + DietPi-Software | GMediaRender: Update systemd unit to log to journal instead of file, define ALSA sink explicitly, add bind IP via ExecStartPre job to environment to allow skipping the shell wrapper on ExecStart, which allows slightly lower memory usage. Do not run as group "dietpi", skip adding gmrender user to "dietpi" group and to no create its home dir, since all of this is not required. Correctly remove the obsolete sysvinit service. --- dietpi/dietpi-software | 51 ++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f445ecec5e..032e8f5000 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -751,11 +751,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=163 aSOFTWARE_NAME[$software_id]='GMediaRender' - aSOFTWARE_DESC[$software_id]='DLNA audio render/endpoint' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 + aSOFTWARE_DESC[$software_id]='Resource efficient UPnP/DLNA renderer' aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_REQUIRES_ALSA[$software_id]=1 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' + aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=167 @@ -2271,7 +2271,7 @@ Please reselect Docker from dietpi-software after next reboot.' #aSOFTWARE_INSTALL_STATE[128]=1 # MPD (pulled in by O!MPD) aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) - aSOFTWARE_INSTALL_STATE[163]=1 # Gmrender + aSOFTWARE_INSTALL_STATE[163]=1 # GMediaRender fi @@ -5781,8 +5781,6 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal 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 @@ -11906,34 +11904,29 @@ _EOF_ Banner_Configuration - # Create/Edit user + # Remove obsolete sysvinit service and config + [[ -f '/etc/init.d/gmediarender' ]] && rm /etc/init.d/gmediarender + update-rc.d -f gmediarender remove + [[ -f '/etc/default/gmediarender' ]] && rm /etc/default/gmediarender + + # User local usercmd='useradd -rMU' getent passwd gmrender &> /dev/null && usercmd='usermod -a' - $usercmd -G dietpi,audio -s $(command -v nologin) gmrender + $usercmd -G audio -s $(command -v nologin) gmrender # - Add to new "render" group on Buster - (( $G_DISTRO > 4 )) && usermod -aG render gmrender - - # Home dir (failsafe) - mkdir -p /home/gmrender - - # Log file - >> /var/log/gmrender.log - - # Permissions - chown -R gmrender:dietpi /home/gmrender /var/log/gmrender.log + getent group render &> /dev/null && usermod -aG render gmrender # Service cat << _EOF_ > /etc/systemd/system/gmrender.service [Unit] Description=GMediaRender (DietPi) -After=network.target dietpi-boot.service +Wants=network-online.target +After=network-online.target dietpi-boot.service [Service] User=gmrender -Group=dietpi -ExecStartPre=+$(command -v touch) /var/log/gmrender.log -ExecStartPre=+$(command -v chown) gmrender:dietpi /var/log/gmrender.log -ExecStart=/bin/dash -c 'gmediarender -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$( /dev/null - G_AGP gmrender gmediarender - [[ -f '/etc/systemd/system/gmrender.service' ]] && rm /etc/systemd/system/gmrender.service + if [[ -f '/etc/systemd/system/gmrender.service' ]]; then + + systemctl disable --now gmrender + rm -R /etc/systemd/system/gmrender.service* + fi getent passwd gmrender &> /dev/null && userdel -rf gmrender + #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 gmediarender fi From 4b7e7ec9964cdf8c26ed0d417fed33ab9cae0bb3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 16 Dec 2019 14:46:35 +0100 Subject: [PATCH 13/34] v6.27 + DietPi-Software | Minor: Pull shared desktop items from chosen Git owner, add pull file path to GMediaRender systemd unit + minor coding/wording --- dietpi/dietpi-software | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 032e8f5000..a1af335666 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2211,15 +2211,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Prevent Docker install if kernel has just been upgraded and old one overwritten/purged: https://github.com/MichaIng/DietPi/issues/3126 if [[ ${aSOFTWARE_INSTALL_STATE[162]} == 1 && ! -d /lib/modules/$(uname -r) ]]; then - G_WHIP_MSG '[WARNING] Docker install will be deselected\n -It seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install.\n -Please reselect Docker from dietpi-software after next reboot.' + G_WHIP_MSG '[WARNING] Docker install will be deselected +\nIt seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install. +\nPlease reselect Docker from dietpi-software after next reboot.' aSOFTWARE_INSTALL_STATE[162]=0 fi # Nextcloud extensions - # - Nextcloud Talk + # - Nextcloud Talk (168) software_id=114 if (( ${aSOFTWARE_INSTALL_STATE[168]} == 1 && ${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )); then @@ -2239,7 +2239,7 @@ Please reselect Docker from dietpi-software after next reboot.' fi # Additional software that requires TigerVNC - # - XRDP: https://github.com/MichaIng/DietPi/issues/1727 + # - XRDP (29): https://github.com/MichaIng/DietPi/issues/1727 software_id=28 if (( ${aSOFTWARE_INSTALL_STATE[29]} == 1 )); then @@ -2249,7 +2249,7 @@ Please reselect Docker from dietpi-software after next reboot.' fi # Additional software that requires WiringPi - # - AudioPhonics Pi-SPC + # - AudioPhonics Pi-SPC (166) software_id=70 if (( ${aSOFTWARE_INSTALL_STATE[166]} == 1 )); then @@ -2263,14 +2263,13 @@ Please reselect Docker from dietpi-software after next reboot.' aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - #(( $G_HW_MODEL == 70 )) && aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot aSOFTWARE_INSTALL_STATE[65]=1 # Netdata aSOFTWARE_INSTALL_STATE[96]=1 # Samba aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon #aSOFTWARE_INSTALL_STATE[128]=1 # MPD (pulled in by O!MPD) aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD - #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) + #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi-Daemon (pulled in by O!MPD) aSOFTWARE_INSTALL_STATE[163]=1 # GMediaRender fi @@ -2280,7 +2279,7 @@ Please reselect Docker from dietpi-software after next reboot.' aSOFTWARE_INSTALL_STATE[69]=1 # RPi.GPIO G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[69]} will be installed" - #aSOFTWARE_INSTALL_STATE[130]=1 # python-pip, enabled in #Software that requires Python-Pip + #aSOFTWARE_INSTALL_STATE[130]=1 # python-pip, enabled in "Software that requires Python-Pip" fi @@ -2455,7 +2454,7 @@ Please reselect Docker from dietpi-software after next reboot.' for i in ${!aSOFTWARE_NAME[@]} do - (( ${aSOFTWARE_INSTALL_STATE[$i]} != 1 )) && continue + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) || continue # Webserver - Auto install via choice system # - Check for existing webserver base (Apache2, Nginx, Lighttpd) installation @@ -2670,7 +2669,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers} # Copy DietPi favourite links - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O /root/.gtk-bookmarks + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks" -O /root/.gtk-bookmarks # DietPi apps to download local adesktop_items=( @@ -2698,19 +2697,19 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di for i in ${adesktop_items[@]} do - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i.desktop -O /usr/share/applications/$i.desktop + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i.desktop" -O /usr/share/applications/$i.desktop done # Icons - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/dietpi-icon.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png # Wallpapers - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png + G_THREAD_START wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png" -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png G_THREAD_WAIT @@ -2921,7 +2920,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di #-------------------------------------------------------------- # Install Software - local software_id=-1 + local software_id software_id=23 # Desktop LXDE if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -3092,7 +3091,7 @@ _EOF_ fi - software_id=83 # Apache Webserver + software_id=83 # Apache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -11926,7 +11925,7 @@ After=network-online.target dietpi-boot.service [Service] User=gmrender ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=\$(mawk 'NR==4' /DietPi/dietpi/.network)' -ExecStart=gmediarender -u '$(mawk 'NR==5' /DietPi/dietpi/.hw_model)' -f '$( Date: Tue, 17 Dec 2019 13:24:49 +0100 Subject: [PATCH 14/34] v6.27 + DietPi-Software | Allo web GUI: Resolve access permission issues --- dietpi/dietpi-software | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a1af335666..efc6ae1b64 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -732,8 +732,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='Allo' aSOFTWARE_DESC[$software_id]='web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 #aSOFTWARE_ONLINEDOC_URL[$software_id] aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 @@ -744,8 +744,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='Allo_update' aSOFTWARE_DESC[$software_id]='quick reinstall/update web only' - aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=-1 + aSOFTWARE_CATEGORY_INDEX[$software_id]=2 #aSOFTWARE_ONLINEDOC_URL[$software_id] #------------------ software_id=163 @@ -11822,9 +11822,11 @@ _EOF_ Banner_Configuration # Create allo user for GUI - local usercmd='useradd -mU' + local usercmd='useradd -MU' getent passwd allo &> /dev/null && usercmd='usermod -a' $usercmd -G www-data -p 'allo' -s /bin/bash allo + # - Create home dir separately to avoid skeleton creation + mkdir -p /home/allo # - Grant sudo permissions echo 'allo ALL=NOPASSWD: ALL' > /etc/sudoers.d/allo @@ -11832,12 +11834,12 @@ _EOF_ mysqladmin drop allo_db -f &> /dev/null mysql -e 'drop user allo_db@localhost' &> /dev/null - /DietPi/dietpi/func/create_mysql_db allo_db allo_db "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db allo_db allo_db dietpi mysql allo_db < /var/www/allo_db.sql - [[ -f '/var/www/allo_db.sql' ]] && rm /var/www/allo_db.sql + rm /var/www/allo_db.sql # Redirect to web interface by default: - rm -f /var/www/index.htm* + rm -f /var/www/index\.* cat << _EOF_ > /var/www/index.php _EOF_ + # Permissions + chown -R www-data:www-data /var/www/allo + chmod 770 -R /var/www/allo + # HW specific changes # - SPARKY ONLY - Auto detect eth adapter if (( $G_HW_MODEL == 70 )); then - # - Disable onboard ETH if adapter found + # Disable onboard ETH if adapter found cat << _EOF_ > /etc/systemd/system/sparky_eth_controller.service [Unit] Description=Sparky auto detect and set onboard ETH/USB ETH (DietPi) @@ -11893,7 +11899,7 @@ _EOF_ fi - # - Allow for quick updates with 160 reinstall + # Allow for quick updates with 160 reinstall aSOFTWARE_INSTALL_STATE[160]=2 fi From 1dfa7575b06ea8c5ef07a7143571205a052b89d0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 17 Dec 2019 22:58:22 +0100 Subject: [PATCH 15/34] v6.27 + DietPi-Software | Passwords cannot be added as raw test via usermod/useradd -p, hence chpasswd must be used --- dietpi/dietpi-software | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index efc6ae1b64..717a4c7770 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10226,9 +10226,12 @@ _EOF_ Banner_Configuration + # User local usercmd='useradd -rMU' getent passwd qbittorrent &> /dev/null && usercmd='usermod -a' - $usercmd -G dietpi -p "$GLOBAL_PW" -s $(command -v nologin) qbittorrent + $usercmd -G dietpi -s $(command -v nologin) qbittorrent + # - Change password only on fresh install + [[ $usercmd == 'useradd'* ]] && chpasswd <<< "qbittorrent:$GLOBAL_PW" # Config mkdir -p /home/qbittorrent/.config/qBittorrent @@ -11822,11 +11825,14 @@ _EOF_ Banner_Configuration # Create allo user for GUI - local usercmd='useradd -MU' + local usercmd='useradd -rMU' getent passwd allo &> /dev/null && usercmd='usermod -a' - $usercmd -G www-data -p 'allo' -s /bin/bash allo + $usercmd -G www-data -s /bin/bash allo + # - Set password only on fresh install + [[ $usercmd == 'useradd'* ]] && chpasswd <<< 'allo:allo' # - Create home dir separately to avoid skeleton creation mkdir -p /home/allo + chown -R allo:allo /home/allo # - Grant sudo permissions echo 'allo ALL=NOPASSWD: ALL' > /etc/sudoers.d/allo @@ -11853,7 +11859,7 @@ _EOF_ # Permissions chown -R www-data:www-data /var/www/allo - chmod 770 -R /var/www/allo + chmod -R 770 /var/www/allo # HW specific changes # - SPARKY ONLY - Auto detect eth adapter From 7291c29007a43a8bb0ff6a583ccb83d219ff8daa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 00:51:18 +0100 Subject: [PATCH 16/34] v6.27 + DietPi-Patch | RPi: Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet --- dietpi/patch_file | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 0986b34970..b2d7b703db 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2232,6 +2232,37 @@ path-exclude /etc/profile.d/*armbian* #path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade path-exclude /usr/share/armbian _EOF_ + #------------------------------------------------------------------------------- + # RPi: Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet + if (( $G_HW_MODEL < 10 )); then + + cat << _EOF_ > /etc/kernel/postinst.d/dietpi-USBridgeSig +#!/bin/bash +# Only apply to ARMv7+ kernel +[[ \$1 == *'-v7+' ]] || exit 0 +echo "[ INFO ] Updating asix ax88179 driver for kernel \$1, as provided by allo.com:" +echo '[ INFO ] - https://github.com/allocom/USBridgeSig/tree/master/ethernet' +echo '[ INFO ] Downloading driver...' +wget http://3.230.113.73:9011/Allocom/USBridgeSig/rpi-usbs-\$1/ax88179_178a.ko -O /tmp/ax88179_178a.ko || exit 0 +echo '[ INFO ] Installing driver...' +install -vpm 644 /tmp/ax88179_178a.ko /lib/modules/\$1/kernel/drivers/net/usb || exit 0 +echo '[ INFO ] Running depmod...' +depmod \$1 || exit 0 +echo '[ INFO ] Cleaning up...' +rm -v /tmp/ax88179_178a.ko || exit 0 +_EOF_ + chmod +x /etc/kernel/postinst.d/dietpi-USBridgeSig + # Update for all installed ARMv7+ kernel versions now + for i in /lib/modules/*-v7+ + do + + [[ -d $i ]] || continue + i=${i##*/} + /etc/kernel/postinst.d/dietpi-USBridgeSig $i + + done + + fi #------------------------------------------------------------------------------- # Reinstalls # Syncthing: https://github.com/MichaIng/DietPi/pull/3202 From cfa3573d2928b58f0c0229062899d4956328e56d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 16:29:18 +0100 Subject: [PATCH 17/34] v6.27 + DietPi-Software | Kodi: Add GPU-accelerated support for Odroid N2 --- dietpi/dietpi-software | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 717a4c7770..4fb5d70e09 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -460,7 +460,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 + # Odroid N2 has not GPU support for Xserver, hence it's not required for Kodi + (( $G_HW_MODEL == 15 )) || aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' # Only RPi + Odroid + x86_64 for ((i=22; i<=$MAX_G_HW_MODEL; i++)) @@ -3671,7 +3672,33 @@ _EOF_ # Odroids if [[ $G_HW_MODEL == 1[0-9] ]]; then - package_list+=' kodi-odroid' + # Odroid N2: https://github.com/MichaIng/DietPi/issues/3255 + if (( $G_HW_MODEL == 15 )); then + + package_list+=' aml-libs-odroid malig52-fbdev-opencl-odroid kodi-n2-fbdev-odroid' + echo 'media_clock +firmware +decoder_common +stream_input +amvdec_avs +amvdec_h264 +amvdec_h264_4k2k +amvdec_mh264 +amvdec_h264mvc +amvdec_h265 +amvdec_mjpeg +amvdec_mmjpeg +amvdec_mpeg12 +amvdec_mpeg4 +amvdec_mmpeg4 +amvdec_real +amvdec_vc1 +amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf + + else + package_list+=' kodi-odroid' + + fi # Everything else else @@ -8307,7 +8334,7 @@ _EOF_ # Create .desktop symlink mkdir -p /root/Desktop - G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -O /usr/share/applications/kodi.desktop + G_RUN_CMD wget https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -O /usr/share/applications/kodi.desktop ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop fi @@ -13064,15 +13091,16 @@ _EOF_ fi - software_id=31 + software_id=31 # Kodi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libcec4 libcurl3-gnutls libnfs* - G_AGP kodi kodi-odroid + #apt-mark auto libcec4 libcurl3-gnutls libnfs* # Odroid N2: aml-libs-odroid malig52-fbdev-opencl-odroid + G_AGP kodi kodi-odroid kodi-n2-fbdev-odroid [[ -f '/usr/share/applications/kodi.desktop' ]] && rm /usr/share/applications/kodi.desktop rm -f /{root,home/*}/Desktop/kodi.desktop [[ -f '/etc/udev/rules.d/99-dietpi-kodi.rules' ]] && rm /etc/udev/rules.d/99-dietpi-kodi.rules + [[ -f '/etc/modules-load.d/dietpi-n2-kodi.conf' ]] && rm /etc/modules-load.d/dietpi-n2-kodi.conf fi From b9f0da722f9a80ebe8d0a3d97f83d34158a3cf67 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 16:39:52 +0100 Subject: [PATCH 18/34] v6.27 + DietPi-Start_Kodi | Odroid N2 has no GPU-accelerated Xserver support, hence runs Kodi via fbdev driver in standalone mode like RPi --- dietpi/misc/start_kodi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index 3bf8394a0f..def265b82d 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -17,14 +17,14 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- # G_HW_MODEL required only - G_HW_MODEL=$(mawk 'NR==1 {print}' /DietPi/dietpi/.hw_model) + G_HW_MODEL=$(mawk 'NR==1' /DietPi/dietpi/.hw_model) # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # RPi - if (( $G_HW_MODEL < 10 )); then + # RPi + Odroid N2 + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 15 )); then kodi --standalone From 70445e46b4ce34947b44946a8bfde18a532bd30d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 16:42:05 +0100 Subject: [PATCH 19/34] v6.27 + CHANGELOG | Kodi: Add GPU-accelerated support for Odroid N2 via fbdev driver and special Kodi build, provided by Meveric --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2feafa4ac1..0abf757aca 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -18,6 +18,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Gitea: The latest version will now be pulled from GitHub automatically. - DietPi-Software | Amiberry: Updated to v3.0.4, a large update from v2.25 with many improvements, see: https://github.com/midwan/amiberry/releases - DietPi-Software | Amiberry: Since we ship a tailored SDL2 version, this has now been merged right into the Amiberry download archive and install directory, to not interfere with other system-wide installed SDL2 instances. +- DietPi-Software | Kodi: Add GPU-accelerated support for Odroid N2 via fbdev driver and special Kodi build, provided by Meveric. Many thanks to @ernero93 for doing this request: https://github.com/MichaIng/DietPi/issues/3255 Bug Fixes: - DietPi-PREP | Resolved an issue, where in rare cases a wrong $PATH variable could break command calls. Many thanks to @dtm2001 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3206 From a5b68d17e446cae701ec4b44ea5c9500514ba0ec Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:16:52 +0100 Subject: [PATCH 20/34] v6.27 + CHANGELOG | Resolved permission related issues with Allo web GUI and GMediaRender --- CHANGELOG.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0abf757aca..66e6a42e8b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,9 +16,11 @@ Changes / Improvements / Optimisations: - DietPi-Software | Home Assistant: Vastly reduced Home Assistant dependencies and install complexity. It does not run inside a virtualenv of pyenv anymore, since it has already its unique pyenv Python instance. pyenv is still required due to the large amount of specific module versions, required for HA and its integrations. The alternative would be a venv from a globally installed Python instance, but this requires further thoughts and discussion. The amount of development libraries and tools, installed via APT, has been updated and reduced to a minimum to build Python and Home Assistant inside the pyenv without errors and warnings. There is a slightly increased chance that certain HA components need additional development packages. To cover this, two new settings have been added to dietpi.txt: "SOFTWARE_HOMEASSISTANT_APT_DEPS" and "SOFTWARE_HOMEASSISTANT_PIP_DEPS". Add a space-separated list of APT packages and pip modules respectively, to have those installed automatically with Home Assistant. As well activating the pyenv environment from console is now easier possible via "source /home/homeassistant/pyenv-activate.sh" as user "homeassistant". Additionally "/home/homeassistant/homeassistant-update.sh" has been added, which can be called by any sudo-capable user to update Home Assistant easily. - DietPi-Software | Node-RED: Access permissions to I2C is now enabled by default on RPi and other SBCs which ship a configured "i2c" group by default. Many thanks to @NastySpill for reporting an underlying issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=6862 - DietPi-Software | Gitea: The latest version will now be pulled from GitHub automatically. -- DietPi-Software | Amiberry: Updated to v3.0.4, a large update from v2.25 with many improvements, see: https://github.com/midwan/amiberry/releases +- DietPi-Software | Amiberry: Updated to v3.0.9, a large update from v2.25 with many improvements, see: https://github.com/midwan/amiberry/releases - DietPi-Software | Amiberry: Since we ship a tailored SDL2 version, this has now been merged right into the Amiberry download archive and install directory, to not interfere with other system-wide installed SDL2 instances. - DietPi-Software | Kodi: Add GPU-accelerated support for Odroid N2 via fbdev driver and special Kodi build, provided by Meveric. Many thanks to @ernero93 for doing this request: https://github.com/MichaIng/DietPi/issues/3255 +- DietPi-Software | Allo web GUI: Resolved an issue where web access fails due to wrong permissions. Many thanks to @Heroldgray for reporting this issue: https://github.com/MichaIng/DietPi/issues/3264 +- DietPi-Software | GMediaRender: Resolved an issue where service fails to start due to missing permissions. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3263 Bug Fixes: - DietPi-PREP | Resolved an issue, where in rare cases a wrong $PATH variable could break command calls. Many thanks to @dtm2001 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3206 From 6105fd11849a04a0356683029caea6b10c7211b4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:22:25 +0100 Subject: [PATCH 21/34] v6.27 + CHANGELOG | Move bug reports to where they belong to... --- CHANGELOG.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 66e6a42e8b..f61e4c47fc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,8 +19,6 @@ Changes / Improvements / Optimisations: - DietPi-Software | Amiberry: Updated to v3.0.9, a large update from v2.25 with many improvements, see: https://github.com/midwan/amiberry/releases - DietPi-Software | Amiberry: Since we ship a tailored SDL2 version, this has now been merged right into the Amiberry download archive and install directory, to not interfere with other system-wide installed SDL2 instances. - DietPi-Software | Kodi: Add GPU-accelerated support for Odroid N2 via fbdev driver and special Kodi build, provided by Meveric. Many thanks to @ernero93 for doing this request: https://github.com/MichaIng/DietPi/issues/3255 -- DietPi-Software | Allo web GUI: Resolved an issue where web access fails due to wrong permissions. Many thanks to @Heroldgray for reporting this issue: https://github.com/MichaIng/DietPi/issues/3264 -- DietPi-Software | GMediaRender: Resolved an issue where service fails to start due to missing permissions. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3263 Bug Fixes: - DietPi-PREP | Resolved an issue, where in rare cases a wrong $PATH variable could break command calls. Many thanks to @dtm2001 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3206 @@ -40,6 +38,8 @@ Bug Fixes: - DietPi-Software | ruTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 - DietPi-Software | Amiberry: Resolved an issue where the binary fails to execute on Odroid XU4. Many thanks to @wasu111 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3181 - DietPi-Software | Tor Hotspot: Resolved an issue where, since Buster, Tor fails to start due to deprecated config file entries. Many thanks to @blizarazu for reporting this issue: https://github.com/MichaIng/DietPi/issues/3261 +- DietPi-Software | Allo web GUI: Resolved an issue where web access fails due to wrong permissions. Many thanks to @Heroldgray for reporting this issue: https://github.com/MichaIng/DietPi/issues/3264 +- DietPi-Software | GMediaRender: Resolved an issue where service fails to start due to missing permissions. Many thanks to @fnsnyc for reporting this issue: https://github.com/MichaIng/DietPi/issues/3263 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX From 50384494652685386880ff97e331ac19ccc37480 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:33:49 +0100 Subject: [PATCH 22/34] v6.27 + CHANGELOG | RPi4: Added generic RPi4 revision code detection to include the new revisions [abc]03112 and potential new PCB v1.3 til v1.9 once released --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f61e4c47fc..b14c51641e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.27 Changes / Improvements / Optimisations: - FriendlyARM ZeroPi | Initial hardware identifier (ID: 59) and support for this device has been added to DietPi. Many thanks to @Stephan for creating the related DietPi image: https://github.com/MichaIng/DietPi/issues/3221 +- RPi4 | Added generic RPi4 revision code detection to include the new revisions [abc]03112 and potential new PCB v1.3 til v1.9 once released. Many thanks to @Joulinar for reporting the missing new revision code: https://github.com/MichaIng/DietPi/issues/3257#issuecomment-565370856 - RPi4 | Since RPi4, bootloader and USB firmware is stored on an internal EEPROM, which is not updated/flashed by the firmware APT package installs automatically. The additional "rpi-eeprom" package comes with an EEPROM update script and boot service, which will now be installed on DietPi update and firstrun setup automatically, if RPi4 is detected. Those firmware updates include power consumption (hence heat emission) optimisations and enable additional boot methods, currently network boot and USB boot is planned as well. This was reason enough for us to implement it automatically for all RPi4 systems. Additionally you can actively install/update the EEPROM manually via dietpi-config > Advanced Options > Update RPi4 EEPROM firmware. For additional information, read the official docs: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md Many thanks to @trueaspects for informing us about this important subject: https://github.com/MichaIng/DietPi/issues/3217 - Virtual Machines | Intel/AMD CPU microcode update packages are not installed/purged from virtual machines. The CPU is provided by the host, hypervisors do not allow to update microcode from within the guest, reasonably, and if they did, this would be serious security and stability issue. - DietPi-PREP | New images will have all man pages and documentation files for installed packages available. Those were removed until now, but prevented users from simply installing man-db to view man pages on the system, without reinstalling packages to restore those first. Many thanks to @smudgered for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3259 From f11a71f82cf58e23244eb73666135882573ba73e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:37:15 +0100 Subject: [PATCH 23/34] v6.27 + CHANGELOG | RPi: An updated USBridgeSig Ethernet driver, as provided by allo.com, will be applied via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b14c51641e..4ca1703908 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.27 Changes / Improvements / Optimisations: - FriendlyARM ZeroPi | Initial hardware identifier (ID: 59) and support for this device has been added to DietPi. Many thanks to @Stephan for creating the related DietPi image: https://github.com/MichaIng/DietPi/issues/3221 +- RPi | An updated USBridgeSig Ethernet driver, as provided by allo.com, will be applied via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet - RPi4 | Added generic RPi4 revision code detection to include the new revisions [abc]03112 and potential new PCB v1.3 til v1.9 once released. Many thanks to @Joulinar for reporting the missing new revision code: https://github.com/MichaIng/DietPi/issues/3257#issuecomment-565370856 - RPi4 | Since RPi4, bootloader and USB firmware is stored on an internal EEPROM, which is not updated/flashed by the firmware APT package installs automatically. The additional "rpi-eeprom" package comes with an EEPROM update script and boot service, which will now be installed on DietPi update and firstrun setup automatically, if RPi4 is detected. Those firmware updates include power consumption (hence heat emission) optimisations and enable additional boot methods, currently network boot and USB boot is planned as well. This was reason enough for us to implement it automatically for all RPi4 systems. Additionally you can actively install/update the EEPROM manually via dietpi-config > Advanced Options > Update RPi4 EEPROM firmware. For additional information, read the official docs: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md Many thanks to @trueaspects for informing us about this important subject: https://github.com/MichaIng/DietPi/issues/3217 - Virtual Machines | Intel/AMD CPU microcode update packages are not installed/purged from virtual machines. The CPU is provided by the host, hypervisors do not allow to update microcode from within the guest, reasonably, and if they did, this would be serious security and stability issue. From 824315af3bab0ce2433dd7bc30e32b430b790800 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:45:41 +0100 Subject: [PATCH 24/34] v6.27 + RC up --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 6834eb2924..78b4b37f64 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 27 -0 +1 From ec1cf1f6c7d0510826aa9119a33478ad55459a56 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Dec 2019 17:46:17 +0100 Subject: [PATCH 25/34] v6.27 + DietPi-Globals | Default RC up --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 77d7120757..55a55041dd 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # DietPi version and Git branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-27} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-0} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-1} G_GITBRANCH=${G_GITBRANCH:-master} G_GITOWNER=${G_GITOWNER:-MichaIng} [[ -f '/DietPi/dietpi/.version' && $( Date: Wed, 18 Dec 2019 20:43:21 +0100 Subject: [PATCH 26/34] v6.27 + DietPi-Pre-patch | Applying new hardware ID per pre-patches to ZeroPi boards. DietPi-Patch generates the new /DietPi/dietpi/.hw_model accordingly to have it ready for further patches. --- dietpi/pre-patch_file | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 2efc81862e..cf52fc0eac 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -189,6 +189,7 @@ _EOF_ fi #------------------------------------------------------------------------------- # Pre-patch 16: https://github.com/MichaIng/DietPi/pull/2571 + # Pre-patch 19: https://github.com/MichaIng/DietPi/issues/3221#issuecomment-560462951 if (( $G_DIETPI_VERSION_SUB < 27 )); then if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then @@ -205,6 +206,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- rm /etc/kernel/postinst.d/dietpi-wireguard || exit 18 fi + if [[ -f '/etc/.dietpi_hw_model_identifier' && $( /etc/.dietpi_hw_model_identifier + + fi fi #------------------------------------------------------------------------------- From c7b82ca81c380fdc423d342ed33cf487b8dec7dd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 13:16:00 +0100 Subject: [PATCH 27/34] v6.27 + DietPi-Drive_Manager | Add rw flag to mount options. This should be default but seems to be not in rare cases: https://github.com/MichaIng/DietPi/issues/3268 --- dietpi/dietpi-drive_manager | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index a91ba88342..ee2e38cac2 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -257,10 +257,10 @@ $swap_mounts # Add entry to fstab if [[ ${aDRIVE_UUID[$index]} ]]; then - local options='' - - # R/O? - (( ${aDRIVE_ISREADONLY_CURRENTLY[$index]} )) && options+=',ro' + # R/W or R/O? + # - Add rw flag to mount options. This should be default but seems to be not in rare cases: https://github.com/MichaIng/DietPi/issues/3268 + local options=',rw' + (( ${aDRIVE_ISREADONLY_CURRENTLY[$index]} )) && options=',ro' # Additional FS-specific options # - NFTS: Enable POSIX permissions @@ -336,7 +336,7 @@ $swap_mounts local type=${aDRIVE_FSTYPE[$index]} (( ${aDRIVE_ISNETWORKED[$index]} )) && type='auto' - echo "#UUID=${aDRIVE_UUID[$index]} ${aDRIVE_MOUNT_TARGET[$index]} ${type:-auto} noatime,lazytime,nofail,noauto,x-systemd.automount" >> $fp_fstab_tmp + echo "#UUID=${aDRIVE_UUID[$index]} ${aDRIVE_MOUNT_TARGET[$index]} ${type:-auto} noatime,lazytime,rw,nofail,noauto,x-systemd.automount" >> $fp_fstab_tmp done < .blkid_out_tmp rm .blkid_out_tmp From c8243de0333ed9d1d1d81dec73c3da1c650f56e3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 13:19:44 +0100 Subject: [PATCH 28/34] v6.27 + CHANGELOG | DietPi-Drive_Manager: Resolved an issue where, in rare cases, all drives were mounted as R/O on boot --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4ca1703908..7bd519d029 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - DietPi-PREP | Resolved an issue, where in rare cases a wrong $PATH variable could break command calls. Many thanks to @dtm2001 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3206 - DietPi-Drive_Manager | Resolved an issue where, after transferring the root file system, the script itself could revert the fstab entry, since a reboot was not forced anymore since v6.22. This change has been reverted, hence a reboot cannot be skipped to avoid any fstab revert and inconsistency with cmdline. Many thanks to @DutchFlash for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=6645 +- DietPi-Drive_Manager | Resolved an issue where, in rare cases, all drives were mounted as R/O on boot. Many thanks to @samolego for reporting this issue: https://github.com/MichaIng/DietPi/issues/3268 - DietPi-Autostart | Resolved an issue where non-interactive script calls, e.g. done by dietpi-software installs, reset prior made auto login user choices. Many thanks to @zedrdave for reporting this issue: https://github.com/MichaIng/DietPi/issues/3242 - DietPi-Config | RPi: Resolved an issue where PSU noise reduction state always shows "[Off]". HDMI output will now be toggled immediately, hence no reboot is required for changes to take effect. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3187 - DietPi-Software | ownCloud/Nextcloud: An important security fix has been applied to our ownCloud/Nextcloud Nginx configs. This has been merged into our other GitHub branches as well, hence all fresh installs wont be affected. Read more about it: https://nextcloud.com/blog/urgent-security-issue-in-nginx-php-fpm/ From 86fd99fe0caa96749b92354dd51314c94f21aeed Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 13:44:37 +0100 Subject: [PATCH 29/34] v6.27 + DietPi-PREP | Disable+mask ARMbian ROCK Pi 4/RK3399 Bluetooth service as well for fresh image --- PREP_SYSTEM_FOR_DIETPI.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index adfd7ea5a2..fc1e31a22b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1031,6 +1031,7 @@ _EOF_ 'log2ram' 'armbian*' 'tinker-bluetooth' + 'rk3399-bluetooth' # Meveric 'cpu_governor' # RPi From dcb2e90b94d4a2a6fae0d035699a3163cb163959 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 14:25:15 +0100 Subject: [PATCH 30/34] v6.27 + DietPi-Software | rTorrent: Install ruTorrent DarkBetter theme manually, since it is, as repo link, not included in the download archive: https://github.com/MichaIng/DietPi/issues/3271 --- dietpi/dietpi-software | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4fb5d70e09..fc7500e8ef 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -820,8 +820,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_NAME[$software_id]='rTorrent' aSOFTWARE_DESC[$software_id]='bittorrent server with rutorrent web interface' - aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' @@ -5101,7 +5101,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" local version_string=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) - Download_Install "https://github.com/Novik/ruTorrent/archive/$version_string.tar.gz" # - Reinstall @@ -5123,6 +5122,15 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi + # Install DarkBetter theme manually: https://github.com/MichaIng/DietPi/issues/3271 + if [[ -d '/var/www/rutorrent/plugins/theme/themes/DarkBetter' ]]; then + + Download_Install 'https://github.com/chocolatkey/DarkBetter/archive/master.tar.gz' + rm -R /var/www/rutorrent/plugins/theme/themes/DarkBetter + mv DarkBetter-master /var/www/rutorrent/plugins/theme/themes/DarkBetter + + fi + fi software_id=132 # Aria2 From 73b07d10d8eee2bdc282e1ca14a10516aea4a51b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 18:16:59 +0100 Subject: [PATCH 31/34] v6.27 + DietPi-Software | rTorrent: Update deprecated commands and variables in our default config: https://github.com/MichaIng/DietPi/issues/3273 --- dietpi/dietpi-software | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fc7500e8ef..536bc942ab 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10549,11 +10549,11 @@ session.path.set = $G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS/.session # UMask system.umask.set = 002 -# Close torrents when diskspace is low. -schedule2 = low_diskspace,5,60,close_low_diskspace=1000M +# Close torrents when diskspace is low, check every minute +schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M)) -# Periodically save session data -schedule2 = session_save,240,300,session_save= +# Save session data every 5 minutes +schedule2 = session_save, 240, 300, ((session.save)) # Enable the default ratio group. ratio.enable=yes @@ -10569,7 +10569,7 @@ ratio.upload.set=1M method.set = group.seeding.ratio.command,d.close= # Move files to ./unsorted when download completes -method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/" +method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.base_path=,./unsorted/;d.directory.set=./unsorted/" # Port range to use for listening. network.port_range.set = 33101-33199 @@ -10587,31 +10587,31 @@ network.port_random.set = yes protocol.encryption.set = require # Sort the main view by ratio -view.sort_current = main,greater=d.get_ratio= -view.sort_new = main,less=d.get_ratio= +view.sort_current = main,greater=d.ratio= +view.sort_new = main,less=d.ratio= view.sort = main # Sort the seeding view by the upload rate and only show torrents with peers -view.sort_current = seeding,greater=d.get_up_rate= -view.filter = seeding,"and=d.get_complete=,d.get_peers_connected=" -view.sort_new = seeding,less=d.get_up_rate= +view.sort_current = seeding,greater=d.up.rate= +view.filter = seeding,"and=d.complete=,d.peers_connected=" +view.sort_new = seeding,less=d.up.rate= view.sort = seeding # Sort the leeching view by name -view.sort_current = leeching,greater=d.get_name= -view.sort_new = leeching,greater=d.get_name= +view.sort_current = leeching,greater=d.name= +view.sort_new = leeching,greater=d.name= view.sort = leeching # Filter the active view by connected peers -view.sort_current = active,less=d.get_name= -view.sort_new = leeching,less=d.get_name= -view.filter = active,d.get_peers_connected= +view.sort_current = active,less=d.name= +view.sort_new = leeching,less=d.name= +view.filter = active,d.peers_connected= view.sort = active -schedule2 = sort_main,11,5,view.sort=main -schedule2 = sort_seeding,12,5,view.sort=seeding -schedule2 = sort_leeching,13,5,view.sort=leeching -schedule2 = sort_active,14,5,view.sort=active +schedule2 = sort_main, 11, 5, view.sort=main +schedule2 = sort_seeding, 12, 5, view.sort=seeding +schedule2 = sort_leeching, 13, 5, view.sort=leeching +schedule2 = sort_active, 14, 5, view.sort=active # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), @@ -10633,8 +10633,8 @@ protocol.pex.set = yes # Use a IP socket with scgi_port, or a Unix socket with scgi_local. # schedule can be used to set permissions on the unix socket. # -scgi_port = 127.0.0.1:5000 -#scgi_local = /home/user/rtorrent/rpc.socket +network.scgi.open_port = 127.0.0.1:5000 +#network.scgi.open_local = /home/user/rtorrent/rpc.socket #schedule2 = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket" _EOF_ # On Buster use new daemon mode From 6f2e51d70ea10018f0d13a2ad6d7e2a0760453c5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 18:26:02 +0100 Subject: [PATCH 32/34] v6.27 + CHANGELOG | rTorrent: Updated deprecated commands and variables in config file + installs DarkBetter theme correctly now --- CHANGELOG.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7bd519d029..854a5d0f4d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -38,7 +38,9 @@ Bug Fixes: - DietPi-Software | Jackett: Resolved an issue where the internal updater broke the Jackett instance. Automated updates can be safely enabled again. Many thanks to @ngosang for providing the workaround: https://github.com/MichaIng/DietPi/issues/2593 - DietPi-Software | Pi-hole: Resolved an issue where choosing to block public admin panel access on Nginx failed. Many thanks to @anubis-genix for reporting this issue: https://github.com/MichaIng/DietPi/issues/3024#issuecomment-550342684 - DietPi-Software | Java: Resolved an issue where install on ARMv6 RPis (1/Zero) on Buster system failed, since Java 11 is not ARMv6-compatible. On these system, Java 8 is now installed instead. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3182 -- DietPi-Software | ruTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 +- DietPi-Software | rTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 +- DietPi-Software | rTorrent: Updated deprecated commands and variables in our default config file. Many thanks to @bbsixzz for reporting this issue: https://github.com/MichaIng/DietPi/issues/3273 +- DietPi-Software | rTorrent: Resolved an issue where ruTorrent DarkBetter theme was not installed. Many thanks to @bbsixzz for reporting this issue: https://github.com/MichaIng/DietPi/issues/3271 - DietPi-Software | Amiberry: Resolved an issue where the binary fails to execute on Odroid XU4. Many thanks to @wasu111 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3181 - DietPi-Software | Tor Hotspot: Resolved an issue where, since Buster, Tor fails to start due to deprecated config file entries. Many thanks to @blizarazu for reporting this issue: https://github.com/MichaIng/DietPi/issues/3261 - DietPi-Software | Allo web GUI: Resolved an issue where web access fails due to wrong permissions. Many thanks to @Heroldgray for reporting this issue: https://github.com/MichaIng/DietPi/issues/3264 From a2f7946520f0d93f9ac64aff1e363a0db142feda Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 19:05:30 +0100 Subject: [PATCH 33/34] v6.27 + DietPi-Patch | Allow /usr/share/armbian files on ARMbian-based systems, since otherwise image-*-root-* package fails to upgrade + DietPi-Patch | Mask (failsafe) but additionall remove the original ARMbian service files. When being excluded for DPKG, this would otherwise lead to outdated files over time. Keep mask, since this does not break APT upgrades. --- dietpi/patch_file | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index b2d7b703db..2fcd7a770d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2207,19 +2207,20 @@ Would you like to switch back to the Nginx authentication method now?' && certbo for i in $packages do - services=$(dpkg -L $i | sed -n '\|^/lib/systemd/system/[^/]*\.service$|{s|^.*/||g;p}') + services=$(dpkg -L $i | sed -n 's|^/lib/systemd/system/\([^/]*\)\.service$|\1|p') [[ $services == *'armbian'* ]] || continue # Failsafe - systemctl disable --now $services - systemctl mask $services + systemctl disable --now $services 2> /dev/null + systemctl mask $services 2> /dev/null done + rm -vf /lib/systemd/system/*armbian* rm -vf /etc/apt/apt.conf.d/*armbian* rm -vf /etc/cron.*/*armbian* #rm -vf /etc/default/*armbian* # Required for ARMbian root package upgrade rm -vf /etc/update-motd.d/*armbian* rm -vf /etc/profile.d/*armbian* #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for ARMbian root package upgrade - [[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian + #[[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian # Required for ARMbian root package upgrade # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi cat << _EOF_ > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian # Exclude conflicting ARMbian files @@ -2230,7 +2231,7 @@ path-exclude /etc/cron.*/*armbian* path-exclude /etc/update-motd.d/*armbian* path-exclude /etc/profile.d/*armbian* #path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade -path-exclude /usr/share/armbian +#path-exclude /usr/share/armbian # Required for ARMbian root package upgrade _EOF_ #------------------------------------------------------------------------------- # RPi: Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet From 14e1dd717f8c38fa49823bbeec186b7e8f5f48cb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 20 Dec 2019 19:18:51 +0100 Subject: [PATCH 34/34] v6.27 + DietPi-PREP | Align with DietPi-Patch update according to ARMbian services and /usr/share/armbian files + DietPi-PREP | Do not set ARMbian packages on hold, we want them to be upgraded, especially during DietPi-PREP as well to check for potential APT errors in the first place --- PREP_SYSTEM_FOR_DIETPI.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index fc1e31a22b..6b3447dad7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -812,9 +812,9 @@ _EOF_ fi - # - G_HW_MODEL specific required Kernel packages + # - G_HW_MODEL specific required firmware/kernel/bootloader packages # ARMbian grab currently installed packages - elif dpkg --get-selections | grep -qi 'armbian'; then + elif dpkg --get-selections | grep -q 'armbian'; then systemctl stop armbian-* @@ -835,8 +835,7 @@ _EOF_ do aPACKAGES_REQUIRED_INSTALL+=("$line") - apt-mark hold $line - G_DIETPI-NOTIFY 2 "PKG detected and set on hold: $line" + G_DIETPI-NOTIFY 2 "ARMbian package detected and added: $line" done <<< "$(dpkg --get-selections | mawk -v pat="^$i" '$0~pat {print $1}')" @@ -1029,7 +1028,7 @@ _EOF_ 'firstrun' 'resize2fs' 'log2ram' - 'armbian*' + '*armbian*' 'tinker-bluetooth' 'rk3399-bluetooth' # Meveric @@ -1071,14 +1070,15 @@ _EOF_ umount /var/log.hdd 2> /dev/null [[ -d '/var/log.hdd' ]] && rm -R /var/log.hdd rm -vf /etc/X11/xorg.conf.d/*armbian* - #rm -vf /etc/armbian* armbian-release required for kernel package upgrade (initramfs postinst) + #rm -vf /etc/armbian* armbian-release # Required for kernel/bootloader package upgrade (initramfs postinst) + rm -vf /lib/systemd/system/*armbian* rm -vf /etc/apt/apt.conf.d/*armbian* rm -vf /etc/cron.*/*armbian* #rm -vf /etc/default/*armbian* # Required for ARMbian root package upgrade rm -vf /etc/update-motd.d/*armbian* rm -vf /etc/profile.d/*armbian* #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for ARMbian root package upgrade - [[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian + #[[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian # Required for ARMbian root package upgrade # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi cat << _EOF_ > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian # Exclude conflicting ARMbian files @@ -1089,7 +1089,7 @@ path-exclude /etc/cron.*/*armbian* path-exclude /etc/update-motd.d/*armbian* path-exclude /etc/profile.d/*armbian* #path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade -path-exclude /usr/share/armbian +#path-exclude /usr/share/armbian # Required for ARMbian root package upgrade _EOF_ # - OMV: https://github.com/MichaIng/DietPi/issues/2994