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/ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26d74d2649..854a5d0f4d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,8 +3,11 @@ 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. +- 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. @@ -15,12 +18,14 @@ 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 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/ @@ -33,8 +38,13 @@ 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 +- 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 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ce546547fa..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}')" @@ -994,33 +993,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=( @@ -1029,8 +1028,9 @@ _EOF_ 'firstrun' 'resize2fs' 'log2ram' - 'armbian*' + '*armbian*' 'tinker-bluetooth' + 'rk3399-bluetooth' # Meveric 'cpu_governor' # RPi @@ -1053,7 +1053,7 @@ _EOF_ systemctl mask ${j##*/} else - rm -R $j + rm -vR $j fi @@ -1064,38 +1064,51 @@ _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/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 # 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 +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 # Required for ARMbian root package upgrade +_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 +1124,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 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 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 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fb73f32ea6..536bc942ab 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++)) @@ -732,8 +733,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,18 +745,18 @@ 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 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 @@ -819,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' @@ -1039,7 +1040,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++)) @@ -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 @@ -2212,15 +2212,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 @@ -2240,7 +2240,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 @@ -2250,7 +2250,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 @@ -2264,15 +2264,14 @@ 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[163]=1 # Gmrender + #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi-Daemon (pulled in by O!MPD) + aSOFTWARE_INSTALL_STATE[163]=1 # GMediaRender fi @@ -2281,7 +2280,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 @@ -2456,7 +2455,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 @@ -2671,7 +2670,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=( @@ -2699,19 +2698,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 @@ -2922,7 +2921,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 @@ -3093,7 +3092,7 @@ _EOF_ fi - software_id=83 # Apache Webserver + software_id=83 # Apache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3673,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 @@ -3794,17 +3819,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: 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/ + # 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 - # Move new instance in place - G_RUN_CMD mv amiberry $G_FP_DIETPI_USERDATA/ + # Move/Merge new instance in place + G_RUN_CMD cp -a 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 @@ -5079,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 @@ -5101,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 @@ -5785,8 +5815,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 @@ -8314,7 +8342,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 @@ -8391,10 +8419,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) @@ -9717,37 +9745,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 @@ -10235,9 +10261,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 @@ -10520,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 @@ -10540,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 @@ -10558,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), @@ -10604,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 @@ -11831,9 +11860,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 @@ -11841,12 +11875,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 -R 770 /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) @@ -11902,7 +11940,7 @@ _EOF_ fi - # - Allow for quick updates with 160 reinstall + # Allow for quick updates with 160 reinstall aSOFTWARE_INSTALL_STATE[160]=2 fi @@ -11912,34 +11950,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 + 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 @@ -14061,15 +14097,19 @@ _EOF_ fi - software_id=163 + software_id=163 # GMediaRender if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null - G_AGP gmrender 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 diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 71efa9e38e..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,65 +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 - if G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL $SFTP_ADDR; 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 8 --retry 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 @@ -186,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 @@ -214,5 +178,4 @@ Would you like to join DietPi-Survey?'; then #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- - } 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' && $( 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 #----------------------------------------------------------------------------------- - } 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 diff --git a/dietpi/patch_file b/dietpi/patch_file index 8ed0243b96..2fcd7a770d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2207,31 +2207,63 @@ 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 - # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi + rm -vf /lib/systemd/system/*armbian* 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/share/armbian' ]] && rm -vR /usr/share/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 # 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 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/share/armbian +#path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade +#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 + 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 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 #------------------------------------------------------------------------------- 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