From f3c814428087f8894f0cdca658c51e86193960db Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 9 Jan 2022 16:30:46 +0100 Subject: [PATCH 01/67] v8.1 - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. --- CHANGELOG.txt | 19 ++++++++++++------- dietpi/dietpi-software | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9e827c4ab6..f3ac8c2ee4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,15 @@ +v8.1 +(2022-02-05) + +Fixes: +- DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. + +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 + +For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues + +----------------------------------------------------------------------------------------------------------- + v8.0 (2022-01-08) @@ -36,11 +48,6 @@ Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/5146 -Known/Outstanding Issues: -- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 - -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v7.9 @@ -82,8 +89,6 @@ Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/5053 -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v7.8 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 75c741d00d..e010110fa3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14907,7 +14907,7 @@ _EOF_ Banner_Uninstalling # Service - if [[ -f '/etc/systemd/system/minio.service' ]] + if [[ -f '/etc/systemd/system/bdd.service' ]] then G_EXEC systemctl disable --now bdd G_EXEC rm /etc/systemd/system/bdd.service From 481744bd4a01e3e33c89214f29d8fb2dc74f65d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 9 Jan 2022 19:12:02 +0100 Subject: [PATCH 02/67] Init v8.1 --- .meta/dietpi-survey_report | 6 ++++-- .update/version | 4 ++-- CHANGELOG.txt | 2 ++ dietpi/func/dietpi-globals | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 133fd743a6..b7efaba9fb 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -579,17 +579,19 @@ shopt -s extglob unset -v 'aSOFTWARE_NAME7_8[99]' # emonHub aSOFTWARE_NAME7_8[200]='DietPi-Dashboard' - # v7.9 + v8.0 + # v7.9 + v8.0 + v8.1 aSOFTWARE_NAME7_9=() aSOFTWARE_NAME8_0=() + aSOFTWARE_NAME8_1=() for i in "${!aSOFTWARE_NAME7_8[@]}" do aSOFTWARE_NAME7_9[$i]=${aSOFTWARE_NAME7_8[$i]} aSOFTWARE_NAME8_0[$i]=${aSOFTWARE_NAME7_9[$i]} + aSOFTWARE_NAME8_1[$i]=${aSOFTWARE_NAME8_0[$i]} done # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME8_0[@]}" + for i in "${aSOFTWARE_NAME8_1[@]}" do aSOFTWARE["$i"]=0 done diff --git a/.update/version b/.update/version index 992f3e79c9..a39a5e5b12 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=8 -G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=2 +G_REMOTE_VERSION_SUB=1 +G_REMOTE_VERSION_RC=-1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f3ac8c2ee4..973582a61f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ v8.1 (2022-02-05) +Changes: + Fixes: - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index c39b765817..d839746fc8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -56,8 +56,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=1 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From 7f4ba1c735e4b4cbd5159e0a718e550ecdd494c8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jan 2022 01:02:44 +0100 Subject: [PATCH 03/67] v8.1 + DietPi-PREP | Remove non-existing module (on Stretch, Buster, Bullseye, Bookworm) from nouveau blacklist --- PREP_SYSTEM_FOR_DIETPI.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index aba267a9f8..0d62fc95d1 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1549,26 +1549,21 @@ _EOF_' G_EXEC_DESC='Removing foreign i386 DPKG architecture' G_EXEC dpkg --remove-architecture i386 # Disable nouveau: https://github.com/MichaIng/DietPi/issues/1244 // https://dietpi.com/phpbb/viewtopic.php?p=9688#p9688 - rm -f /etc/modprobe.d/*nouveau* + G_EXEC rm -f /etc/modprobe.d/*nouveau* cat << '_EOF_' > /etc/modprobe.d/dietpi-disable_nouveau.conf blacklist nouveau -blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off -alias lbm-nouveau off _EOF_ # Fix grub install device: https://github.com/MichaIng/DietPi/issues/3700 dpkg-query -s grub-pc &> /dev/null && G_EXEC eval "debconf-set-selections <<< 'grub-pc grub-pc/install_devices multiselect /dev/sda'" # Update initramfs with above changes - if command -v update-tirfs > /dev/null; then - + if command -v update-tirfs > /dev/null + then G_EXEC_OUTPUT=1 G_EXEC update-tirfs - else - G_EXEC_OUTPUT=1 G_EXEC update-initramfs -u - fi elif (( $G_HW_ARCH == 3 )); then From 5918e5f59768467d31357e683f2f8b152142e346 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jan 2022 14:06:33 +0100 Subject: [PATCH 04/67] v8.0 - DietPi-Software | WiFi Hotspot: Remove old hostapd service unmask/workaround. All installed services controlled by dietpi-software are unamasked before installs start. If the mask was placed without the service installed, the prior service stop which was added with v8.0 would currently fail anyway. We want to get reports now to trace back the faulty reason for the mask. --- dietpi/dietpi-software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e010110fa3..7606bfba71 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8596,9 +8596,6 @@ If no WireGuard (auto)start is included, but you require it, please do the follo # Enable WiFi modules /boot/dietpi/func/dietpi-set_hardware wifimodules enable - # Unmask hostapd service: https://github.com/MichaIng/DietPi/issues/2962 - G_EXEC systemctl unmask hostapd - local eth_iface=$(G_GET_NET -t eth iface) local wifi_iface=$(G_GET_NET -t wlan iface) From 93b6a274b08a4dd59a4d561c2fa7efe86cc15113 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jan 2022 01:29:37 +0100 Subject: [PATCH 05/67] v8.1 + DietPi-PREP | Odroids: Do not install our boot.ini if the boot partition is not FAT partition --- PREP_SYSTEM_FOR_DIETPI.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 0d62fc95d1..6bc6430e00 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -523,7 +523,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 'Moving kernel and boot configuration to /boot' - # HW specific config.txt, boot.ini uEnv.txt + # HW specific config.txt, boot.ini if (( $G_HW_MODEL < 10 )); then echo "root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /) rootfstype=ext4 rootwait fsck.repair=yes net.ifnames=0 logo.nologo quiet console=serial0,115200 console=tty1" > /boot/cmdline.txt @@ -531,16 +531,16 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then # Boot in 64-bit mode if this is a 64-bit image [[ $G_HW_ARCH == 3 ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt - elif (( $G_HW_MODEL == 11 )); then + elif [[ $G_HW_MODEL == 11 && -f '/boot/boot.ini' && $(findmnt -t vfat -M /boot) ]]; then G_EXEC mv "DietPi-$G_GITBRANCH/boot_xu4.ini" /boot/boot.ini G_EXEC sed -i "s/root=UUID=[^[:blank:]]*/root=UUID=$(findmnt -Ufnro UUID -M /)/" /boot/boot.ini - elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then + elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' && $(findmnt -t vfat -M /boot) ]]; then G_EXEC mv "DietPi-$G_GITBRANCH/boot_c2.ini" /boot/boot.ini - elif [[ $G_HW_MODEL == 15 && -f '/boot/boot.ini' ]]; then + elif [[ $G_HW_MODEL == 15 && -f '/boot/boot.ini' && $(findmnt -t vfat -M /boot) ]]; then G_EXEC mv "DietPi-$G_GITBRANCH/boot_n2.ini" /boot/boot.ini G_EXEC sed -i "s/root=UUID=[^[:blank:]]*/root=UUID=$(findmnt -Ufnro UUID -M /)/" /boot/boot.ini From deaeb1e3dc940c3a7015a96ff05caa554e2c905a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jan 2022 17:35:43 +0100 Subject: [PATCH 06/67] v8.1 - DietPi-Build | Remove obsolete workaround for raspberrypi-archive-keyring, provided now by the RPi Bullseye repo --- .meta/dietpi-build | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.meta/dietpi-build b/.meta/dietpi-build index 745c63fb18..6076fc4313 100644 --- a/.meta/dietpi-build +++ b/.meta/dietpi-build @@ -198,25 +198,14 @@ _EOF_ fi # Create rc.local to automate DietPi-PREP -cat << '_EOF_' > rootfs/etc/rc.local +cat << _EOF_ > rootfs/etc/rc.local #!/bin/dash { -_EOF_ -G_EXEC chmod +x rootfs/etc/rc.local - -# - RPi: https://github.com/RPi-Distro/repo/issues/253 -[[ $HW_MODEL == 0 ]] && cat << '_EOF_' >> rootfs/etc/rc.local -echo '[ INFO ] Installing Raspberry Pi repository keyring...' -curl -sSfLO 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2016.10.31_all.deb' || exit 1 -dpkg -i raspberrypi-archive-keyring_2016.10.31_all.deb || exit 1 -rm raspberrypi-archive-keyring_2016.10.31_all.deb || exit 1 -_EOF_ - -cat << _EOF_ >> rootfs/etc/rc.local echo '[ INFO ] Running DietPi-PREP...' export GITBRANCH='master' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO='from scratch' WIFI_REQUIRED=$WIFI_REQUIRED DISTRO_TARGET=$DISTRO bash -c "\$(curl -sSfL 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/PREP_SYSTEM_FOR_DIETPI.sh')" _EOF_ +G_EXEC chmod +x rootfs/etc/rc.local # - VM: Generate tiny-initramfs with explicit kernel modules, as auto-detection doesn't work correctly within container and loop devices [[ $HW_MODEL == 20 ]] && cat << _EOF_ >> rootfs/etc/rc.local From 41e1572cc21f68d6b6cf468f5e5e22cd6857f8b7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jan 2022 19:31:49 +0100 Subject: [PATCH 07/67] v8.1 - DietPi-PREP | Set setbit bit for the known sudo executable path explicitly, i.e. do not trust e.g. /usr/local/bin/sudo (which should not exist, of course) --- PREP_SYSTEM_FOR_DIETPI.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6bc6430e00..2c5566b8ec 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1322,9 +1322,8 @@ _EOF_ ln -sfv /etc/profile.d/bash_completion.sh /etc/bashrc.d/dietpi-bash_completion.sh #----------------------------------------------------------------------------------- - # UID bit for sudo: https://github.com/MichaIng/DietPi/issues/794 - G_DIETPI-NOTIFY 2 'Setting sudo UID bit' - chmod 4755 "$(command -v sudo)" + # setuid bit for sudo: https://github.com/MichaIng/DietPi/issues/794 + G_EXEC_DESC='Setting setuid bit for "sudo" executable' G_EXEC chmod 4755 /usr/bin/sudo #----------------------------------------------------------------------------------- # Dirs From 7551570735d5934a7d31049ad9ccbad7dac0c5d3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jan 2022 21:34:25 +0100 Subject: [PATCH 08/67] v8.1 - DietPi-Software | OctoPrint: Suppress warnings about executables being intentionally installed to /mnt/dietpi_userdata/octoprint/.local/bin, which is not in PATH --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7606bfba71..9364fbdff3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11145,7 +11145,7 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache # Install OctoPrint - G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint pip3 install --no-cache-dir -U --user octoprint + G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint pip3 install --no-cache-dir -U --user --no-warn-script-location octoprint # Service: https://github.com/OctoPrint/OctoPrint/blob/master/scripts/octoprint.service cat << '_EOF_' > /etc/systemd/system/octoprint.service From ef6219c2a3879787a6a6611e815002ace5f7b37f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jan 2022 16:13:41 +0100 Subject: [PATCH 09/67] v8.1 - DietPi-Software | Minor --- dietpi/dietpi-software | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9364fbdff3..cd5aa66dde 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8754,8 +8754,8 @@ _EOF_ # Install required PHP modules DEPS_LIST="$PHP_NAME-apcu $PHP_NAME-gd $PHP_NAME-intl $PHP_NAME-mbstring $PHP_NAME-opcache $PHP_NAME-xml" - # Skip install, if already present - if [[ -d /var/www/pydio ]] + # Skip install if already present + if [[ -d '/var/www/pydio' ]] then G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"/var/www/pydio\" already exists. Download and install steps will be skipped. - Please manually backup your config files+data, remove the install dir and rerun \"dietpi-software (re)install $software_id\" if you need to reinstall. @@ -8765,8 +8765,8 @@ _EOF_ G_AGI $DEPS_LIST DEPS_LIST= else - Download_Install 'https://download.pydio.com/pub/core/ci/pydio-latest.tar.gz' /var/www - G_EXEC mv /var/www/pydio-latest /var/www/pydio + Download_Install 'https://download.pydio.com/pub/core/ci/pydio-latest.tar.gz' + G_EXEC mv pydio-latest /var/www/pydio fi # PHP configuration @@ -8774,8 +8774,8 @@ _EOF_ # Webserver config # - Apache - if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )) + then # Enable Apache rewrite engine a2enmod rewrite @@ -8784,8 +8784,8 @@ _EOF_ a2ensite dietpi-pydio # - Lighttpd - elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then - + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) + then # Enable Lighttpd setenv, access and rewrite modules G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",' G_CONFIG_INJECT '"mod_setenv",' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' @@ -8796,33 +8796,28 @@ _EOF_ G_EXEC lighty-enable-mod rewrite dietpi-pydio # - Nginx - elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then - + elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) + then # Move Pydio Nginx config in place dps_index=$software_id Download_Install 'nginx.pydio.conf' /etc/nginx/sites-dietpi/dietpi-pydio.conf - fi - # Create MySQL DB + # Database /boot/dietpi/func/create_mysql_db pydio pydio "$GLOBAL_PW" - # Setup Data directory - # - Skip if already existent + # Setup data directory local target_data_dir=/mnt/dietpi_userdata/pydio_data - if [[ -d $target_data_dir ]]; then - + # - Skip if already existent + if [[ -d $target_data_dir ]] + then G_DIETPI-NOTIFY 2 "Existing $target_data_dir found, will migrate..." [[ -e '/var/www/pydio/data' ]] && G_EXEC rm -R /var/www/pydio/data - else - # Move data structure [[ -e $target_data_dir ]] && G_EXEC rm -R $target_data_dir G_EXEC mv /var/www/pydio/data $target_data_dir - fi - - # Create symlink + # - Create symlink G_EXEC ln -sf $target_data_dir /var/www/pydio/data G_EXEC chown -R www-data:www-data $target_data_dir From 355a5c3c1d217bf8e32e01afd8c6eb15ff39332a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jan 2022 16:44:21 +0100 Subject: [PATCH 10/67] v8.1 - DietPi-Software | Pydio: Fix permissions for using internal updater etc --- dietpi/dietpi-software | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cd5aa66dde..5e210763a7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8819,7 +8819,9 @@ _EOF_ fi # - Create symlink G_EXEC ln -sf $target_data_dir /var/www/pydio/data - G_EXEC chown -R www-data:www-data $target_data_dir + + # Permissions + G_EXEC chown -R www-data:www-data /var/www/pydio fi From a98adda4a440943745e352a31a5ef7ba25bc82aa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jan 2022 16:49:04 +0100 Subject: [PATCH 11/67] v8.1 - DietPi-Software | Pydio: Fix some files being 444 mode, breaking internal updater --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5e210763a7..15d7628968 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8820,8 +8820,9 @@ _EOF_ # - Create symlink G_EXEC ln -sf $target_data_dir /var/www/pydio/data - # Permissions + # Permissions: Fix some files being 444 mode, breaking internal updater G_EXEC chown -R www-data:www-data /var/www/pydio + G_EXEC chmod -R u+w /var/www/pydio fi From a96877ac0ee2b4c12cbca7673383c16cf9aec44c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jan 2022 18:33:49 +0100 Subject: [PATCH 12/67] v8.1 - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 - DietPi-Software | Further cleanup on Lighttpd and PHP uninstalls --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 973582a61f..59cd04d74c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes: Fixes: - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. +- DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 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/dietpi/dietpi-software b/dietpi/dietpi-software index 15d7628968..cffe95728b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3985,6 +3985,8 @@ _EOF_ G_CONFIG_INJECT 'pm.start_servers[[:blank:]=]' "pm.start_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" G_CONFIG_INJECT 'pm.min_spare_servers[[:blank:]=]' "pm.min_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" G_CONFIG_INJECT 'pm.max_spare_servers[[:blank:]=]' "pm.max_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" + # Set static PATH, not passed by Lighttpd and Nginx by default but required by some web applications: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 + G_CONFIG_INJECT 'env\[PATH\][[:blank:]=]' 'env[PATH] = /usr/local/bin:/usr/bin:/bin' "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" fi # We create our own PHP mod to add DietPi specific configs. @@ -12954,6 +12956,7 @@ _EOF_ # Config [[ -d '/etc/lighttpd' ]] && G_EXEC rm -R /etc/lighttpd + [[ -d '/var/www/index.lighttpd.html' ]] && G_EXEC rm /var/www/index.lighttpd.html # Pre-v8.0: Certbot renewal hook [[ -f 'etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf' ]] && G_EXEC rm /etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf @@ -12985,7 +12988,7 @@ _EOF_ Banner_Uninstalling G_AGP 'php*-*' 'libapache2-mod-php*' - G_EXEC rm -Rf /{etc,var/lib}/php + G_EXEC rm -Rf /{etc,var/lib}/php /var/log/php*-fpm.log [[ -f '/etc/tmpfiles.d/dietpi-php_sessions.conf' ]] && G_EXEC rm /etc/tmpfiles.d/dietpi-php_sessions.conf [[ -f '/var/www/phpinfo.php' ]] && G_EXEC rm /var/www/phpinfo.php [[ -f '/var/www/apc.php' ]] && G_EXEC rm /var/www/apc.php From b67d6b28819543077dc118d9be42fb43c6742b04 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 17 Jan 2022 18:18:48 +0100 Subject: [PATCH 13/67] v8.1 - DietPi-Software | Cuberite: Apply strict permissions to webadmin.ini before writing global software password to it --- dietpi/dietpi-software | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cffe95728b..823c0e1378 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9081,7 +9081,9 @@ ExecStart=/mnt/dietpi_userdata/cuberite/Cuberite -d WantedBy=multi-user.target _EOF_ # Web UI settings: Do not overwrite existing! - [[ -f '/mnt/dietpi_userdata/cuberite/webadmin.ini' ]] || cat << _EOF_ > /mnt/dietpi_userdata/cuberite/webadmin.ini + [[ -f '/mnt/dietpi_userdata/cuberite/webadmin.ini' ]] || > /mnt/dietpi_userdata/cuberite/webadmin.ini + G_EXEC chmod 0600 /mnt/dietpi_userdata/cuberite/webadmin.ini + [[ -s '/mnt/dietpi_userdata/cuberite/webadmin.ini' ]] || cat << _EOF_ > /mnt/dietpi_userdata/cuberite/webadmin.ini [User:admin] Password=$GLOBAL_PW @@ -9090,7 +9092,6 @@ Ports=1339 Enabled=1 _EOF_ # Permissions - G_EXEC chmod 0600 /mnt/dietpi_userdata/cuberite/webadmin.ini G_EXEC chown -R cuberite:cuberite /mnt/dietpi_userdata/cuberite G_EXEC chmod +x /mnt/dietpi_userdata/cuberite/Cuberite From 39a9d6f4371347bf47dea1aef1b114674dbcbe90 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 17 Jan 2022 18:55:44 +0100 Subject: [PATCH 14/67] v8.1 - DietPi-AutoStart | When using an unprivileged user for Kodi autostart, add it to tty, input and audio group as well, required for keyboard/mouse input, audio playback and on RPi to switch the VT to avoid DRI conflicts when starting from within a desktop session --- dietpi/dietpi-autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 16c7456dd3..80e151d530 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -136,7 +136,7 @@ _EOF_ # - Kodi elif (( $ID_AUTOSTART == 1 )) then - G_EXEC usermod -aG video $user + G_EXEC usermod -aG tty,input,video,audio $user getent group render > /dev/null && G_EXEC usermod -aG render $user # - Desktop autologin: As non-root user, it's LightDM-based From 36d35e900185a306fc2ffc0e878b72424fd762d6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 18 Jan 2022 01:29:41 +0100 Subject: [PATCH 15/67] v8.1 - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 --- .update/patches | 7 +++++++ CHANGELOG.txt | 1 + dietpi/dietpi-services | 10 +++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.update/patches b/.update/patches index eb1de28d1a..12546ba2ed 100644 --- a/.update/patches +++ b/.update/patches @@ -619,6 +619,13 @@ Patch_8_0() [[ -f '/etc/systemd/system/blynkserver.service' ]] && ! grep -q '\-Dlog4j2.formatMsgNoLookups=true' /etc/systemd/system/blynkserver.service && G_EXEC sed -i 's/java -jar/java -Dlog4j2.formatMsgNoLookups=true -jar/' /etc/systemd/system/blynkserver.service } +Patch_8_0() +{ + # DietPi-Services cleanup: https://dietpi.com/phpbb/viewtopic.php?p=42027#p42027 + [[ -f '/dietpi-process_tool.conf' ]] && G_EXEC rm /dietpi-process_tool.conf + [[ -f '/dietpi-services_edit.conf' ]] && G_EXEC rm /dietpi-services_edit.conf +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 59cd04d74c..8f350990a5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v8.1 Changes: Fixes: +- DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 98ebbad448..caf3bf4e02 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -485,7 +485,9 @@ _EOF_ readonly FP_PROCESS_TOOL_CONF='dietpi-process_tool.conf' Apply_Process_Tool(){ - local index=$1 setting=$2 value=${3,,} dp="/etc/systemd/system/${aSERVICE_NAME[$index]}.service.d" fp="$dp/$FP_PROCESS_TOOL_CONF" i + local index=$1 setting=$2 value=${3,,} i + local dp="/etc/systemd/system/${aSERVICE_NAME[$index]}.service.d" + local fp="$dp/$FP_PROCESS_TOOL_CONF" # Arrays to translate $2 integer to settings names local asetting=('CPUAffinity' 'CPUSchedulingPolicy' 'Nice' 'CPUSchedulingPriority' 'IOSchedulingClass' 'IOSchedulingPriority') @@ -534,7 +536,8 @@ _EOF_ # $1 = service index Load_Process_Tool(){ - local index=$1 fp="/etc/systemd/system/${aSERVICE_NAME[$index]}.service.d/$FP_PROCESS_TOOL_CONF" + local index=$1 + local fp="/etc/systemd/system/${aSERVICE_NAME[$index]}.service.d/$FP_PROCESS_TOOL_CONF" [[ -f $fp ]] || return # Source values from config file @@ -887,7 +890,8 @@ This affects starts/stops/restarts during DietPi-Software installs, DietPi-Updat 'Edit') - local dp="/etc/systemd/system/${aSERVICE_NAME[$MENU_SERVICE_INDEX]}.service.d" fp="$dp/dietpi-services_edit.conf" + local dp="/etc/systemd/system/${aSERVICE_NAME[$MENU_SERVICE_INDEX]}.service.d" + local fp="$dp/dietpi-services_edit.conf" if [[ ! -f $fp ]]; then From f2c11c9385c02240d63588b1462f0957c47e6123 Mon Sep 17 00:00:00 2001 From: laddde <43511397+laddde@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:35:38 +0100 Subject: [PATCH 16/67] v8.1 (#5176) - DietPi-Drive_Manager: Btrfs subvolume mounts are not preserved in /etc/fstab. Many thanks to @laddde for implementing this feature: https://github.com/MichaIng/DietPi/pull/5176 --- CHANGELOG.txt | 1 + dietpi/dietpi-drive_manager | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8f350990a5..79bde11c5d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v8.1 (2022-02-05) Changes: +- DietPi-Drive_Manager | Btrfs subvolume mounts are now preserved in /etc/fstab. Many thanks to @laddde for implementing this feature: https://github.com/MichaIng/DietPi/pull/5176 Fixes: - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 05239c4e58..9c55a004c2 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -122,8 +122,8 @@ tmpfs /var/log tmpfs size=${var_log_size:-50}M,noatime,lazytime,nodev,nosuid,mod swap_mounts=$(grep '^[[:blank:]]*[^#].*[[:blank:]]swap[[:blank:]]' $fp_fstab_tmp) tmpfs_mounts=$(grep '^[[:blank:]]*tmpfs[[:blank:]]' $fp_fstab_tmp) - # ecryptfs, vboxsf, glusterfs, bind mounts - misc_mounts=$(grep -E '^[[:blank:]]*[^#].*([[:blank:]](ecryptfs|vboxsf|glusterfs)[[:blank:]]|[[:blank:],]bind[[:blank:],])' $fp_fstab_tmp) + # ecryptfs, vboxsf, glusterfs, bind, Btrfs subvolume mounts + misc_mounts=$(grep -E '^[[:blank:]]*[^#].*([[:blank:]](ecryptfs|vboxsf|glusterfs)[[:blank:]]|[[:blank:],]bind[[:blank:],]|[[:blank:]]btrfs[[:blank:]]+(.+,)?subvol=)' $fp_fstab_tmp) # CurlFtpFS, CIFS/SMB/Samba, NFS, SSHFS net_mounts=$(grep -E '^[[:blank:]]*(curlftpfs|sshfs#|[^#].*[[:blank:]](cifs|nfs4?|fuse.sshfs)[[:blank:]])' $fp_fstab_tmp) @@ -142,7 +142,7 @@ $net_mounts $tmpfs_mounts #---------------------------------------------------------------- -# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts +# MISC: ecryptfs, vboxsf, glusterfs, bind, Btrfs subvolume mounts #---------------------------------------------------------------- $misc_mounts From 7bac70cd420427ac385f592385b4093cc4acba9d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 18 Jan 2022 17:56:17 +0100 Subject: [PATCH 17/67] v8.1 - DietPi-Patches | Fix v8.1 patch function name --- .update/patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 12546ba2ed..8ae1486af4 100644 --- a/.update/patches +++ b/.update/patches @@ -619,7 +619,7 @@ Patch_8_0() [[ -f '/etc/systemd/system/blynkserver.service' ]] && ! grep -q '\-Dlog4j2.formatMsgNoLookups=true' /etc/systemd/system/blynkserver.service && G_EXEC sed -i 's/java -jar/java -Dlog4j2.formatMsgNoLookups=true -jar/' /etc/systemd/system/blynkserver.service } -Patch_8_0() +Patch_8_1() { # DietPi-Services cleanup: https://dietpi.com/phpbb/viewtopic.php?p=42027#p42027 [[ -f '/dietpi-process_tool.conf' ]] && G_EXEC rm /dietpi-process_tool.conf From 209648f1da263436d7ea09b857111b0128e58046 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 19 Jan 2022 19:21:47 +0100 Subject: [PATCH 18/67] v8.1 - DietPi-Software | Chromium: Fix kiosk autostart script for non-RPi systems and use default fallback values when Chromium dietpi.txt settings are not present --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 79bde11c5d..dec7151cd1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Fixes: - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 +- DietPi-Software/DietPi-AutoStart | Chromium: Resolved an issue where the Chromium kiosk autostart option failed on all non-RPi systems. 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/dietpi/dietpi-software b/dietpi/dietpi-software index 823c0e1378..80954f5622 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9887,10 +9887,10 @@ _EOF_ cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh #!/bin/dash # Autostart run script for kiosk mode, based on @AYapejian: https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 -# - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional EGL/GL init options +# - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional falgs. # Command line switches: https://peter.sh/experiments/chromium-command-line-switches/ -# --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN +# --test-type gets rid of some of the Chromium warnings that you may or may not care about in kiosk on a LAN # --pull-to-refresh=1 # --ash-host-window-bounds="400,300" @@ -9898,7 +9898,7 @@ _EOF_ RES_X=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) RES_Y=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -CHROMIUM_OPTS="--kiosk --test-type --window-size=$RES_X,$RES_Y --start-fullscreen --start-maximized --window-position=0,0" +CHROMIUM_OPTS="--kiosk --test-type --window-size=${RES_X:-1280},${RES_Y:-720} --start-fullscreen --start-maximized --window-position=0,0" # If you want tablet mode, uncomment the next line. #CHROMIUM_OPTS+=' --force-tablet-mode --tablet-ui' @@ -9908,9 +9908,9 @@ URL=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}' / # RPi or Debian Chromium package FP_CHROMIUM=$(command -v chromium-browser) -[ $FP_CHROMIUM ] || FP_CHROMIUM=$(command -v chromium-browser) +[ "$FP_CHROMIUM" ] || FP_CHROMIUM=$(command -v chromium) -exec xinit "$FP_CHROMIUM" $CHROMIUM_OPTS --homepage "$URL" +exec xinit "$FP_CHROMIUM" $CHROMIUM_OPTS --homepage "${URL:-https://dietpi.com/}" _EOF_ G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh From 058a1f9e680f1da529af333a22c9db454aac2a4f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 19 Jan 2022 19:53:29 +0100 Subject: [PATCH 19/67] v8.1 - DietPi-Software | Kodi/Chromium: Further cleanup on uninstall --- dietpi/dietpi-software | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 80954f5622..b6024985c7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13807,6 +13807,7 @@ _EOF_ [[ -f '/etc/modules-load.d/dietpi-n2-kodi.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-n2-kodi.conf [[ -f '/etc/modules-load.d/dietpi-c4-kodi.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-c4-kodi.conf [[ -f '/etc/apt/preferences.d/dietpi-kodi' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-kodi + [[ -f '/var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png' ]] && G_EXEC rm /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png fi @@ -14696,7 +14697,9 @@ _EOF_ G_AGP 'chromium*' # Files [[ -d '/etc/chromium.d' ]] && G_EXEC rm -R /etc/chromium.d - G_EXEC rm -f /{root,home/*}/.chromium-browser.init + [[ -d '/usr/lib/chromium' ]] && G_EXEC rm -R /usr/lib/chromium + [[ -d '/usr/lib/chromium-browser' ]] && G_EXEC rm -R /usr/lib/chromium-browser + G_EXEC rm -Rf /{root,home/*}/{.chromium-browser.init,.{cache,config}/chromium,Desktop/chromium{,-browser}.desktop} [[ -f '/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh' ]] && G_EXEC rm /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh # Autostart index: If currently Chromium, revert to console login [[ -f '/boot/dietpi/.dietpi-autostart_index' && $( Date: Wed, 19 Jan 2022 20:21:04 +0100 Subject: [PATCH 20/67] v8.1 - DietPi-Software | Docker: Uninstall Docker after Portainer and Docker Compose and assure that the service is stopped and cleanly removed --- dietpi/dietpi-software | 54 +++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b6024985c7..ebb0a4319a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14936,30 +14936,6 @@ _EOF_ fi - software_id=162 # Docker - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - - Banner_Uninstalling - - # Packages, repo and key - G_AGP docker-ce docker-ce-cli docker-engine - [[ -f '/etc/apt/sources.list.d/docker.list' ]] && G_EXEC rm /etc/apt/sources.list.d/docker.list - [[ -f '/etc/apt/trusted.gpg.d/dietpi-docker.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-docker.gpg - - # Service adjustments - [[ -d '/etc/systemd/system/docker.service.d' ]] && G_EXEC rm -R /etc/systemd/system/docker.service.d - # DietPi data dir - [[ -d '/mnt/dietpi_userdata/docker-data' ]] && G_EXEC rm -R /mnt/dietpi_userdata/docker-data - # Default data dir - [[ -d '/var/lib/docker' ]] && G_EXEC rm -R /var/lib/docker - # Config dir - [[ -d '/etc/docker' ]] && G_EXEC rm -R /etc/docker - - # Set Portainer as not installed - aSOFTWARE_INSTALL_STATE[185]=0 - - fi - software_id=189 # VSCodium if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -15002,6 +14978,35 @@ _EOF_ fi + software_id=162 # Docker + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + Banner_Uninstalling + if [[ -f '/lib/systemd/system/docker.service' ]] + then + G_EXEC systemctl unmask docker + G_EXEC systemctl disable --now docker + G_EXEC rm /lib/systemd/system/docker.service + fi + [[ -d '/etc/systemd/system/docker.service.d' ]] && G_EXEC rm -R /etc/systemd/system/docker.service.d + + # Packages, repo and key + G_AGP docker-ce docker-ce-cli docker-engine + [[ -f '/etc/apt/sources.list.d/docker.list' ]] && G_EXEC rm /etc/apt/sources.list.d/docker.list + [[ -f '/etc/apt/trusted.gpg.d/dietpi-docker.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-docker.gpg + + # DietPi data dir + [[ -d '/mnt/dietpi_userdata/docker-data' ]] && G_EXEC rm -R /mnt/dietpi_userdata/docker-data + # Default data dir + [[ -d '/var/lib/docker' ]] && G_EXEC rm -R /var/lib/docker + # Config dir + [[ -d '/etc/docker' ]] && G_EXEC rm -R /etc/docker + + # Set Portainer as not installed + aSOFTWARE_INSTALL_STATE[185]=0 + + fi + software_id=164 # Nukkit if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -15080,7 +15085,6 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if [[ -f '/lib/systemd/system/influxdb.service' ]] then G_EXEC systemctl unmask influxdb From bffc9956580773212b83ca66ce38923be75199f7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 20 Jan 2022 16:05:04 +0100 Subject: [PATCH 21/67] v8.1 - DietPi-PREP | Remove quiet kernel command line flag for RPi and x86_64 systems to give users more insights for info and debugging the boot process, also aligning with other SBC images --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2c5566b8ec..22cbc09164 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -526,7 +526,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then # HW specific config.txt, boot.ini if (( $G_HW_MODEL < 10 )); then - echo "root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /) rootfstype=ext4 rootwait fsck.repair=yes net.ifnames=0 logo.nologo quiet console=serial0,115200 console=tty1" > /boot/cmdline.txt + echo "root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /) rootfstype=ext4 rootwait fsck.repair=yes net.ifnames=0 logo.nologo console=serial0,115200 console=tty1" > /boot/cmdline.txt G_EXEC mv "DietPi-$G_GITBRANCH/config.txt" /boot/ # Boot in 64-bit mode if this is a 64-bit image [[ $G_HW_ARCH == 3 ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt @@ -1884,7 +1884,7 @@ _EOF_ fi # Update config - G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX_DEFAULT=' 'GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0 quiet"' /etc/default/grub + G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX_DEFAULT=' 'GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0"' /etc/default/grub G_CONFIG_INJECT 'GRUB_CMDLINE_LINUX=' 'GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub G_CONFIG_INJECT 'GRUB_TIMEOUT=' 'GRUB_TIMEOUT=0' /etc/default/grub G_EXEC_DESC='Regenerating GRUB config' G_EXEC_OUTPUT=1 G_EXEC grub-mkconfig -o /boot/grub/grub.cfg From 05f3895acae0e7e93145a7853a94b37c3b879805 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 20 Jan 2022 16:27:04 +0100 Subject: [PATCH 22/67] v8.1 - RPi: Remove obsolete VCSM overlay since the device node has been removed with latest kernel --- .update/patches | 7 +++++++ dietpi/func/dietpi-set_hardware | 25 +++++-------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.update/patches b/.update/patches index 8ae1486af4..515abed9eb 100644 --- a/.update/patches +++ b/.update/patches @@ -624,6 +624,13 @@ Patch_8_1() # DietPi-Services cleanup: https://dietpi.com/phpbb/viewtopic.php?p=42027#p42027 [[ -f '/dietpi-process_tool.conf' ]] && G_EXEC rm /dietpi-process_tool.conf [[ -f '/dietpi-services_edit.conf' ]] && G_EXEC rm /dietpi-services_edit.conf + + # RPi: Remove obsolete VCSM overlay since the device node has been removed + if (( $G_HW_MODEL < 10 )) + then + grep -q 'dtoverlay=dietpi-disable_vcsm' /boot/config.txt && G_EXEC sed -i '/dtoverlay=dietpi-disable_vcsm/d' /boot/config.txt + [[ -f '/boot/overlays/dietpi-disable_vcsm.dtbo' ]] && G_EXEC rm /boot/overlays/dietpi-disable_vcsm.dtbo + fi } # v6.35 => v7 migration diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 2f8908c562..e17f50bb06 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -257,29 +257,14 @@ _EOF_ (( $gpu_mem > 192 )) && gpu_mem=192 G_CONFIG_INJECT 'gpu_mem_256=' "gpu_mem_256=$gpu_mem" /boot/config.txt - # Disable VCSM if less than 32M are applied, since it is doomed to fail with cut-down firmware loaded. + # Disable VideoCore CMA Shared Memory Driver if less than 32 MiB are applied, as it is doomed to fail with cut-down firmware loaded. if (( $gpu_mem < 32 )) then - # Blacklist kernel module G_EXEC eval 'echo '\''blacklist vc_sm_cma'\'' > /etc/modprobe.d/dietpi-disable_vcsm.conf' - # Disable device via dtoverlay - G_EXEC_DESC='Compiling device tree overlay: /boot/overlays/dietpi-disable_vcsm.dtbo' - G_EXEC eval 'dtc -I dts -O dtb -o /boot/overlays/dietpi-disable_vcsm.dtbo <<< '\''/dts-v1/; -/plugin/; -/ { - compatible = "brcm,bcm2835"; - fragment@0 { - target-path = "/soc/vcsm"; - __overlay__ { - status = "disabled"; - }; - }; -};'\''' - G_CONFIG_INJECT 'dtoverlay=dietpi-disable_vcsm' 'dtoverlay=dietpi-disable_vcsm' /boot/config.txt - else - grep -q 'dtoverlay=dietpi-disable_vcsm' /boot/config.txt && G_EXEC sed -i '/dtoverlay=dietpi-disable_vcsm/d' /boot/config.txt - [[ -f '/boot/overlays/dietpi-disable_vcsm.dtbo' ]] && G_EXEC rm /boot/overlays/dietpi-disable_vcsm.dtbo - [[ -f '/etc/modprobe.d/dietpi-disable_vcsm.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_vcsm.conf + + elif [[ -f '/etc/modprobe.d/dietpi-disable_vcsm.conf' ]] + then + G_EXEC rm /etc/modprobe.d/dietpi-disable_vcsm.conf fi else Unknown_Input_Mode From be3f6856b8f839be8b9977b95d9f53cb7e1e2cbe Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 20 Jan 2022 20:09:22 +0100 Subject: [PATCH 23/67] v8.1 - DietPi-Cloud_migration --- .meta/dietpi-cloud-migration | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.meta/dietpi-cloud-migration b/.meta/dietpi-cloud-migration index e25ef23520..0f148f01e6 100644 --- a/.meta/dietpi-cloud-migration +++ b/.meta/dietpi-cloud-migration @@ -44,6 +44,10 @@ run_backup(){ ! rsync -aHp --delete "$fp_datadir/" "$2" && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully synced data directory to: $2" + # Remove old backups when sync was successful @StephanStS + echo "[ INFO ] Removing backups from $fp_datadir/ after successful sync to $2..." + rm -R "$fp_datadir/dietpi-$1-database-backup.sql" "$fp_datadir/dietpi-$1-installation-backup" + else echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there, or, rerun this script with the desired external backup path as argument.' From 1bb1eb050cbefe2e6ead305322e87e6e6de3a982 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 21 Jan 2022 19:05:20 +0100 Subject: [PATCH 24/67] v8.1 - DietPi-Software | Java JRE: Remove obsolete workaround for ARM --- dietpi/dietpi-software | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ebb0a4319a..3fda5026a9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3120,8 +3120,7 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" (( $G_HW_MODEL > 9 )) || (( $G_RASPBIAN == 0 )) || version=11 fi - # Allow two attempts as workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524 - G_EXEC_RETRIES=1 G_AGI ca-certificates-java openjdk-$version-jre-headless + G_AGI openjdk-$version-jre-headless fi From f53a9bf39ea9ffbdd641e4fa60e0eb70309c5b18 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 21 Jan 2022 22:44:30 +0100 Subject: [PATCH 25/67] v8.1 (#5193) - DietPi-Software | Do not use the obsolete --unsafe-perm flag for npm calls anymore - DietPi-Software | MineOS: Install Python 3 on Buster as dependency, required for the Node.js posix module but not pulled by rdiff-backup on Buster - DietPi-Software | MineOS: As a workaround required with latest Node.js 17, install the posix module alone first, before installing the whole project: https://github.com/MichaIng/DietPi/issues/5181 --- CHANGELOG.txt | 3 ++- dietpi/dietpi-software | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dec7151cd1..4a368fa8f7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,9 +6,10 @@ Changes: Fixes: - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 +- DietPi-Software/DietPi-AutoStart | Chromium: Resolved an issue where the Chromium kiosk autostart option failed on all non-RPi systems. - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 -- DietPi-Software/DietPi-AutoStart | Chromium: Resolved an issue where the Chromium kiosk autostart option failed on all non-RPi systems. +- DietPi-Software | MineOS: Resolved an issue where the install failed on Bullseye: https://github.com/MichaIng/DietPi/issues/5181 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/dietpi/dietpi-software b/dietpi/dietpi-software index 3fda5026a9..46226e2f88 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7263,10 +7263,10 @@ _EOF_ fi # RPi: Install "onoff" for GPIO access - (( $G_HW_MODEL > 9 )) || G_EXEC_OUTPUT=1 G_EXEC npm i -g --unsafe-perm --no-audit onoff + (( $G_HW_MODEL > 9 )) || G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit onoff # Install Blynk JS library - G_EXEC_OUTPUT=1 G_EXEC npm i -g --unsafe-perm --no-audit blynk-library + G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit blynk-library # Preserve existing config if [[ ! -f '/mnt/dietpi_userdata/blynk/server.properties' ]] @@ -9104,8 +9104,12 @@ _EOF_ local url='https://github.com/hexparrot/mineos-node.git' G_CHECK_URL "$url" + # Python 3 is not pulled by rdiff-backup on Buster, but required to compile Node.js posix. + local python= + (( $G_DISTRO > 5 )) || python='python3' + # APT deps - G_AGI rdiff-backup rsync screen + G_AGI rdiff-backup rsync screen $python # Download/Update MineOS [[ -d '/mnt/dietpi_userdata/mineos' ]] || G_EXEC mkdir /mnt/dietpi_userdata/mineos @@ -9130,12 +9134,11 @@ _EOF_ G_EXEC git config core.filemode false G_EXEC chmod +x mineos_console.js webui.js update_webui.sh reset_webui.sh generate-sslcert.sh - # Install Node 11, as MineOS is currently not compatible with newer Node versions: https://github.com/hexparrot/mineos-node/issues/374 - G_EXEC_OUTPUT=1 G_EXEC npm i -g --unsafe-perm --no-audit n - G_EXEC_OUTPUT=1 G_EXEC n 11 + # Workaround: Node.js posix needs to be installed alone first: https://github.com/MichaIng/DietPi/issues/5181 + G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit --no-package-lock posix # Install MineOS - G_EXEC_OUTPUT=1 G_EXEC npm i --unsafe-perm --no-audit + G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit G_EXEC cd "$G_WORKING_DIR" # Config: Preserve existing @@ -13141,7 +13144,7 @@ _EOF_ G_EXEC rm -Rf /{root,home/*}/.node-red # Pre-v6.25 # Pre-v7.0 - command -v npm > /dev/null && npm r -g --unsafe-perm node-red + command -v npm > /dev/null && npm r -g node-red [[ -f '/usr/local/bin/node-red' ]] && G_EXEC rm /usr/local/bin/node-red [[ -f '/usr/local/bin/node-red-pi' ]] && G_EXEC rm /usr/local/bin/node-red-pi @@ -13209,7 +13212,7 @@ _EOF_ [[ -d '/var/log/blynk' ]] && G_EXEC rm -R /var/log/blynk getent passwd blynk > /dev/null && G_EXEC userdel blynk getent group blynk > /dev/null && G_EXEC groupdel blynk - command -v npm > /dev/null && npm r -g --unsafe-perm blynk-library + command -v npm > /dev/null && npm r -g blynk-library [[ -f '/usr/local/bin/blynk-ctrl' ]] && G_EXEC rm /usr/local/bin/blynk-ctrl [[ -f '/usr/local/bin/blynk-client' ]] && G_EXEC rm /usr/local/bin/blynk-client [[ -d '/etc/blynkserver' ]] && G_EXEC rm -R /etc/blynkserver # Pre-v6.19 @@ -15528,7 +15531,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - command -v npm > /dev/null && npm r -g --unsafe-perm n yarn npm + command -v npm > /dev/null && npm r -g n yarn npm # Old install via repo G_AGP nodejs From ae056a0ef00c7a573d303bb5a412d47e75dd89f3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 22 Jan 2022 02:18:54 +0100 Subject: [PATCH 26/67] v8.1 - DietPi-Software | Cuberite: Resolved an issue where the server failed to start on ARMv8 systems: https://github.com/MichaIng/DietPi/issues/5180 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4a368fa8f7..16ee0f6300 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Fixes: - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 - DietPi-Software | MineOS: Resolved an issue where the install failed on Bullseye: https://github.com/MichaIng/DietPi/issues/5181 +- DietPi-Software | Cuberite: Resolved an issue where the server failed to start on ARMv8 systems: https://github.com/MichaIng/DietPi/issues/5180 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/dietpi/dietpi-software b/dietpi/dietpi-software index 46226e2f88..a8791c982f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9052,13 +9052,21 @@ location = /.well-known/caldav { return 301 /baikal/html/dav.php; }' > /etc/ngi software_id=52 # Cuberite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # https://github.com/cuberite/cuberite/blob/master/easyinstall.sh - # ARMv6/7/8: https://github.com/cuberite/cuberite/issues/5221 + # ARMv6/7 local url='https://download.cuberite.org/linux-armhf-raspbian/Cuberite.tar.gz' + # ARMv8 + if (( $G_HW_ARCH == 3 )) + then + url='https://download.cuberite.org/linux-aarch64/Cuberite.tar.gz' + # x86_64 - (( $G_HW_ARCH == 10 )) && url='https://download.cuberite.org/linux-x86_64/Cuberite.tar.gz' + elif (( $G_HW_ARCH == 10 )) + then + url='https://download.cuberite.org/linux-x86_64/Cuberite.tar.gz' + fi Download_Install "$url" /mnt/dietpi_userdata/cuberite @@ -9068,7 +9076,7 @@ location = /.well-known/caldav { return 301 /baikal/html/dav.php; }' > /etc/ngi # Service: Needs to be Type=forking, else it shuts down automatically after startup has finished :/ ... cat << '_EOF_' > /etc/systemd/system/cuberite.service [Unit] -Description=Cuberite Server (DietPi) +Description=Cuberite (DietPi) [Service] Type=forking From ce79957b30a0687fd46c58e3d7814695480b1b32 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 22 Jan 2022 14:50:24 +0100 Subject: [PATCH 27/67] v8.1 - DietPi-Software | PHP: Install PHP8.1 on Bookworm now that APCu and Redis modules are updated - DietPi-Software | PHP: Remove support for preserving PHP7.2 --- dietpi/dietpi-software | 149 ++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 78 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a8791c982f..cb1cc5ad54 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -192,13 +192,15 @@ INDEX_BROWSER=$INDEX_BROWSER" # Is the WireGuard kernel module natively shipped by the kernel package? WIREGUARD_BUILTIN=0 - # PHP version specific directories, APT package-, module- and command names - PHP_NAME='php7.3' - FP_PHP_BASE_DIR='/etc/php/7.3' - if (( $G_DISTRO > 5 )) + # PHP version + PHP_VERSION='7.4' + if (( $G_DISTRO < 6 )) then - PHP_NAME='php7.4' - FP_PHP_BASE_DIR='/etc/php/7.4' + PHP_VERSION='7.3' + + elif (( $G_DISTRO > 6 )) + then + PHP_VERSION='8.1' fi # Available for (need to match highest value in dietpi-obtain_hw_model) @@ -2225,32 +2227,6 @@ INDEX_BROWSER=$INDEX_BROWSER" Resolve_Dependencies "$i" done - # Update PHP variables after all software titles have been marked - # - Never install PHP7.2 if PHP7.3 or PHP7.4 is already present - if (( ${aSOFTWARE_INSTALL_STATE[89]} > 0 )) && ! command -v php7.3 > /dev/null && ! command -v php7.4 > /dev/null; then - - # Do not upgrade PHP7.2, since we can support it for a long time - if command -v php7.2 > /dev/null; then - - PHP_NAME='php7.2' - FP_PHP_BASE_DIR='/etc/php/7.2' - - # ownCloud up to v10.2 - elif [[ -f '/var/www/owncloud/version.php' ]]; then - - local oc_version_major=$(sed -n '/OC_VersionString/{s/^[^0-9]*//;s/\..*$//p;q}' /var/www/owncloud/version.php) - local oc_version_minor=$(sed -n '/OC_VersionString/{s/^[^.]*\.//;s/\..*$//p;q}' /var/www/owncloud/version.php) - if (( $oc_version_major < 10 || ( $oc_version_major == 10 && $oc_version_minor < 3 ) )); then - - PHP_NAME='php7.2' - FP_PHP_BASE_DIR='/etc/php/7.2' - - fi - - fi - - fi - } Create_Desktop_Shared_Items(){ @@ -3775,7 +3751,7 @@ _EOF_ G_BACKUP_FP /etc/nginx/nginx.conf dps_index=$software_id Download_Install 'nginx.conf' /etc/nginx/nginx.conf # Adjust socket name to PHP version - G_EXEC sed -i "s#/run/php/php.*-fpm.sock#/run/php/$PHP_NAME-fpm.sock#g" /etc/nginx/nginx.conf + G_EXEC sed -i "s#/run/php/php.*-fpm.sock#/run/php/php$PHP_VERSION-fpm.sock#g" /etc/nginx/nginx.conf # CPU core count G_EXEC sed -i "/worker_processes/c\worker_processes $G_HW_CPU_CORES;" /etc/nginx/nginx.conf @@ -3855,7 +3831,7 @@ _EOF_ ## Use PHP-FPM as PHP handler fastcgi.server += ( ".php" => (( - "socket" => "/run/php/$PHP_NAME-fpm.sock", + "socket" => "/run/php/php$PHP_VERSION-fpm.sock", "broken-scriptfilename" => "enable" )) ) @@ -3897,7 +3873,7 @@ _EOF_ local apackages=('mariadb-server') # Install PHP module if PHP was already installed - (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("$PHP_NAME-mysql") + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("php$PHP_VERSION-mysql") G_AGI "${apackages[@]}" G_EXEC systemctl stop mariadb @@ -3914,7 +3890,7 @@ _EOF_ Banner_Installing local apackages=('sqlite3') # Install PHP module if PHP was already installed - (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("$PHP_NAME-sqlite3") + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("php$PHP_VERSION-sqlite3") G_AGI "${apackages[@]}" fi @@ -3926,7 +3902,7 @@ _EOF_ local apackages=('redis-server') # Install PHP module if PHP was already installed - (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("$PHP_NAME-redis") + (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && apackages+=("php$PHP_VERSION-redis") G_AGI "${apackages[@]}" G_EXEC systemctl stop redis-server @@ -3950,27 +3926,27 @@ _EOF_ # - Webserver: PHP-FPM if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 || ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) then - local apackages=("$PHP_NAME-fpm") + local apackages=("php$PHP_VERSION-fpm") # - No webserver: CLI usage only (php binary) else - local apackages=("$PHP_NAME-cli") + local apackages=("php$PHP_VERSION-cli") fi # Additional PHP modules, commonly used by most web applications - apackages+=("$PHP_NAME-apcu" "$PHP_NAME-curl" "$PHP_NAME-gd" "$PHP_NAME-mbstring" "$PHP_NAME-xml" "$PHP_NAME-zip") + apackages+=("php$PHP_VERSION-apcu" "php$PHP_VERSION-curl" "php$PHP_VERSION-gd" "php$PHP_VERSION-mbstring" "php$PHP_VERSION-xml" "php$PHP_VERSION-zip") # MySQL/MariaDB PHP module - (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && apackages+=("$PHP_NAME-mysql") + (( ${aSOFTWARE_INSTALL_STATE[88]} > 0 )) && apackages+=("php$PHP_VERSION-mysql") # SQLite PHP module - (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && apackages+=("$PHP_NAME-sqlite3") + (( ${aSOFTWARE_INSTALL_STATE[87]} > 0 )) && apackages+=("php$PHP_VERSION-sqlite3") # Redis PHP module - (( ${aSOFTWARE_INSTALL_STATE[91]} > 0 )) && apackages+=("$PHP_NAME-redis") + (( ${aSOFTWARE_INSTALL_STATE[91]} > 0 )) && apackages+=("php$PHP_VERSION-redis") G_AGI "${apackages[@]}" - systemctl -q is-active "$PHP_NAME-fpm" && G_EXEC systemctl stop "$PHP_NAME-fpm" + systemctl -q is-active "php$PHP_VERSION-fpm" && G_EXEC systemctl stop "php$PHP_VERSION-fpm" # Assure that mod_php is purged in favour of PHP-FPM G_AGP 'libapache2-mod-php*' @@ -3980,16 +3956,16 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 || ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) then # Optimisations based on total cores - G_CONFIG_INJECT 'pm.max_children[[:blank:]=]' "pm.max_children = $(( $G_HW_CPU_CORES * 3 ))" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" - G_CONFIG_INJECT 'pm.start_servers[[:blank:]=]' "pm.start_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" - G_CONFIG_INJECT 'pm.min_spare_servers[[:blank:]=]' "pm.min_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" - G_CONFIG_INJECT 'pm.max_spare_servers[[:blank:]=]' "pm.max_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" + G_CONFIG_INJECT 'pm.max_children[[:blank:]=]' "pm.max_children = $(( $G_HW_CPU_CORES * 3 ))" "/etc/php/$PHP_VERSION/fpm/pool.d/www.conf" + G_CONFIG_INJECT 'pm.start_servers[[:blank:]=]' "pm.start_servers = $G_HW_CPU_CORES" "/etc/php/$PHP_VERSION/fpm/pool.d/www.conf" + G_CONFIG_INJECT 'pm.min_spare_servers[[:blank:]=]' "pm.min_spare_servers = $G_HW_CPU_CORES" "/etc/php/$PHP_VERSION/fpm/pool.d/www.conf" + G_CONFIG_INJECT 'pm.max_spare_servers[[:blank:]=]' "pm.max_spare_servers = $G_HW_CPU_CORES" "/etc/php/$PHP_VERSION/fpm/pool.d/www.conf" # Set static PATH, not passed by Lighttpd and Nginx by default but required by some web applications: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 - G_CONFIG_INJECT 'env\[PATH\][[:blank:]=]' 'env[PATH] = /usr/local/bin:/usr/bin:/bin' "$FP_PHP_BASE_DIR/fpm/pool.d/www.conf" + G_CONFIG_INJECT 'env\[PATH\][[:blank:]=]' 'env[PATH] = /usr/local/bin:/usr/bin:/bin' "/etc/php/$PHP_VERSION/fpm/pool.d/www.conf" fi # We create our own PHP mod to add DietPi specific configs. - target_php_ini="$FP_PHP_BASE_DIR/mods-available/dietpi.ini" + target_php_ini="/etc/php/$PHP_VERSION/mods-available/dietpi.ini" echo -e '; DietPi PHP settings\n; priority=97' > $target_php_ini # Session files need to be outside of /tmp and /var/tmp due to PrivateTmp=true, else phpsessionclean.service cannot clean sessions @@ -4016,7 +3992,7 @@ _EOF_ # - OPcache G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]=]' "opcache.memory_consumption=$cache_size" $target_php_ini # Assure that interned_strings_buffer is never larger than half of memory_consumption: https://github.com/MichaIng/DietPi/issues/2293 - (( $($PHP_NAME -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') > $cache_size / 2 )) && G_CONFIG_INJECT 'opcache.interned_strings_buffer[[:blank:]=]' "opcache.interned_strings_buffer=$(( $cache_size / 2 ))" $target_php_ini + (( $(php$PHP_VERSION -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') > $cache_size / 2 )) && G_CONFIG_INJECT 'opcache.interned_strings_buffer[[:blank:]=]' "opcache.interned_strings_buffer=$(( $cache_size / 2 ))" $target_php_ini G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]=]' 'opcache.revalidate_freq=60' $target_php_ini # 1 minute # - APCu G_CONFIG_INJECT 'apc.shm_size[[:blank:]=]' "apc.shm_size=${cache_size}M" $target_php_ini @@ -4024,7 +4000,7 @@ _EOF_ # Enable all available PHP modules local amodules=() - mapfile -t amodules < <(find "$FP_PHP_BASE_DIR/mods-available" -type f -name '*.ini' -printf '%f\n') + mapfile -t amodules < <(find "/etc/php/$PHP_VERSION/mods-available" -type f -name '*.ini' -printf '%f\n') G_EXEC phpenmod "${amodules[@]%.ini}" unset -v amodules @@ -4042,7 +4018,7 @@ _EOF_ fi # Apache: Enable PHP-FPM - command -v a2enconf > /dev/null && { G_EXEC a2enmod proxy_fcgi setenvif; G_EXEC a2enconf "$PHP_NAME-fpm"; } + command -v a2enconf > /dev/null && { G_EXEC a2enmod proxy_fcgi setenvif; G_EXEC a2enconf "php$PHP_VERSION-fpm"; } fi software_id=90 # phpMyAdmin @@ -4051,7 +4027,10 @@ _EOF_ Banner_Installing # Install required PHP modules: https://docs.phpmyadmin.net/en/latest/require.html#php - G_AGI $PHP_NAME-{curl,gd,json,mbstring,xml,zip} + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || json="php$PHP_VERSION-json" + G_AGI php$PHP_VERSION-{curl,gd,mbstring,xml,zip} $json # Quick install: https://docs.phpmyadmin.net/en/latest/setup.html#quick-install # - Get latest version name @@ -4067,7 +4046,7 @@ _EOF_ G_EXEC mv "phpMyAdmin-$version-english" /var/www/phpmyadmin # Enable required PHP modules: https://docs.phpmyadmin.net/en/latest/require.html#php - G_EXEC phpenmod ctype curl gd json mbstring xml zip + G_EXEC phpenmod ctype curl gd mbstring xml zip ${json##*-} # Install and enable webserver config # - Apache @@ -4613,7 +4592,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST="$PHP_NAME-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions + DEPS_LIST="php$PHP_VERSION-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions if [[ -f '/var/www/owncloud/occ' ]]; then @@ -4641,10 +4620,12 @@ _EOF_ [[ $DEPS_LIST ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI $DEPS_LIST; DEPS_LIST=''; } G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions - G_EXEC phpenmod ctype curl dom gd iconv intl json mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif - + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || json='json' + G_EXEC phpenmod ctype curl dom gd iconv intl mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif $json G_DIETPI-NOTIFY 2 'Enabling APCu memory cache for PHP command line usage (CLI) as well, including ownCloud occ command and cron jobs.' - echo -e '; ownCloud PHP settings\n; priority=98\napc.enable_cli=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-owncloud.ini + echo -e '; ownCloud PHP settings\n; priority=98\napc.enable_cli=1' > /etc/php/$PHP_VERSION/mods-available/dietpi-owncloud.ini G_EXEC phpenmod dietpi-owncloud # Get version string @@ -4875,7 +4856,7 @@ The install script will now exit. After applying one of the the above, rerun die if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST="$PHP_NAME-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + DEPS_LIST="php$PHP_VERSION-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation if [[ -f '/var/www/nextcloud/occ' ]]; then @@ -4906,13 +4887,16 @@ The install script will now exit. After applying one of the the above, rerun die [[ $DEPS_LIST ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI $DEPS_LIST; DEPS_LIST=''; } G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - G_EXEC phpenmod ctype curl dom gd iconv intl json mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || json='json' + G_EXEC phpenmod ctype curl dom gd iconv intl mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif $json G_DIETPI-NOTIFY 2 'Apply PHP override settings for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache local interned_strings_buffer='' memory_consumption='' - (( $($PHP_NAME -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') < 8 )) && interned_strings_buffer='\nopcache.interned_strings_buffer=8' - (( $($PHP_NAME -i | mawk '/^opcache.memory_consumption/{print $5;exit}') < 128 )) && memory_consumption='\nopcache.memory_consumption=128' - echo -e "; Nextcloud PHP settings\n; priority=98\nmemory_limit=512M$memory_consumption$interned_strings_buffer\nopcache.revalidate_freq=5\napc.enable_cli=1" > $FP_PHP_BASE_DIR/mods-available/dietpi-nextcloud.ini + (( $(php$PHP_VERSION -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') < 8 )) && interned_strings_buffer='\nopcache.interned_strings_buffer=8' + (( $(php$PHP_VERSION -i | mawk '/^opcache.memory_consumption/{print $5;exit}') < 128 )) && memory_consumption='\nopcache.memory_consumption=128' + echo -e "; Nextcloud PHP settings\n; priority=98\nmemory_limit=512M$memory_consumption$interned_strings_buffer\nopcache.revalidate_freq=5\napc.enable_cli=1" > /etc/php/$PHP_VERSION/mods-available/dietpi-nextcloud.ini G_EXEC phpenmod dietpi-nextcloud if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then @@ -6549,7 +6533,7 @@ _EOF_ fi # Dependencies: https://github.com/pi-hole/pi-hole/blob/development/automated%20install/basic-install.sh#L250 - G_AGI $PHP_NAME-xml $PHP_NAME-sqlite3 $PHP_NAME-intl + G_AGI php$PHP_VERSION-{xml,sqlite3,intl} # Unbound: Switch port to 5335 if it was installed before, else it got just configured within its install step above if (( ${aSOFTWARE_INSTALL_STATE[182]} == 2 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf @@ -7569,7 +7553,10 @@ _EOF_ Banner_Installing # Install required PHP modules: https://github.com/FreshRSS/FreshRSS#example-of-full-installation-on-linux-debianubuntu - DEPS_LIST="$PHP_NAME-curl $PHP_NAME-gmp $PHP_NAME-intl $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-zip" + DEPS_LIST="php$PHP_VERSION-curl php$PHP_VERSION-gmp php$PHP_VERSION-intl php$PHP_VERSION-mbstring php$PHP_VERSION-xml php$PHP_VERSION-zip" + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || DEPS_LIST+=" php$PHP_VERSION-json" json='json' if [[ -d '/opt/FreshRSS' ]] then @@ -7586,7 +7573,7 @@ _EOF_ fi # Enable required PHP modules: https://github.com/FreshRSS/FreshRSS#requirements - G_EXEC phpenmod curl gmp intl json pdo_mysql ctype dom mbstring xml zip + G_EXEC phpenmod curl gmp intl pdo_mysql ctype dom mbstring xml zip $json # Apache configuration if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then @@ -8046,7 +8033,7 @@ _EOF_ Banner_Installing # Install required PHP modules: https://sye.dk/sfpg/ - DEPS_LIST="$PHP_NAME-gd" + DEPS_LIST="php$PHP_VERSION-gd" Download_Install 'https://sye.dk/sfpg/Single_File_PHP_Gallery_4.8.1.zip' /var/www/gallery # Enable required PHP modules @@ -8079,7 +8066,10 @@ _EOF_ Banner_Installing # https://github.com/ampache/ampache/wiki/Installation # Required PHP modules: https://github.com/ampache/ampache/wiki/Installation#prerequisites - DEPS_LIST="$PHP_NAME-curl $PHP_NAME-intl $PHP_NAME-json $PHP_NAME-xml" + DEPS_LIST="php$PHP_VERSION-curl php$PHP_VERSION-intl php$PHP_VERSION-xml" + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || DEPS_LIST+=" php$PHP_VERSION-json" json='json' # Bullseye+ if (( $G_DISTRO > 5 )) @@ -8106,7 +8096,7 @@ _EOF_ Download_Test_Media # Enable required PHP modules: https://github.com/ampache/ampache/wiki/Installation#prerequisites - G_EXEC phpenmod curl intl json xml + G_EXEC phpenmod curl intl xml $json # Import our pre-made Ampache database, if not existent already if [[ ! -d '/mnt/dietpi_userdata/mysql/ampache' ]]; then @@ -8753,7 +8743,7 @@ _EOF_ Banner_Installing # Install required PHP modules - DEPS_LIST="$PHP_NAME-apcu $PHP_NAME-gd $PHP_NAME-intl $PHP_NAME-mbstring $PHP_NAME-opcache $PHP_NAME-xml" + DEPS_LIST="php$PHP_VERSION-apcu php$PHP_VERSION-gd php$PHP_VERSION-intl php$PHP_VERSION-mbstring php$PHP_VERSION-opcache php$PHP_VERSION-xml" # Skip install if already present if [[ -d '/var/www/pydio' ]] @@ -8903,7 +8893,7 @@ _EOF_ Banner_Installing # APT deps: https://github.com/sabre-io/Baikal/wiki/Baïkal-dependencies - DEPS_LIST="$PHP_NAME-xml $PHP_NAME-mbstring $PHP_NAME-mysql" + DEPS_LIST="php$PHP_VERSION-xml php$PHP_VERSION-mbstring php$PHP_VERSION-mysql" local fallback_url='https://github.com/sabre-io/Baikal/releases/download/0.9.1/baikal-0.9.1.zip' Download_Install "$(curl -sSfL 'https://api.github.com/repos/sabre-io/Baikal/releases/latest' | mawk -F\" '/"browser_download_url": .*\/baikal-[^"\/]*\.zip"/{print $4}')" @@ -10423,7 +10413,10 @@ _EOF_ # APT dependencies: https://docs.koel.dev/#server > https://laravel.com/docs/master/deployment#server-requirements # - PHP composer install fails if no PHP SQLite and cURL modules are installed and enabled, even when MariaDB is used later. - DEPS_LIST="$PHP_NAME-bcmath $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml $PHP_NAME-curl $PHP_NAME-sqlite3" + DEPS_LIST="php$PHP_VERSION-bcmath php$PHP_VERSION-mbstring php$PHP_VERSION-xml php$PHP_VERSION-curl php$PHP_VERSION-sqlite3" + # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 + local json= + [[ $PHP_VERSION == 8* ]] || DEPS_LIST+=" php$PHP_VERSION-json" json='json' # Grab latest release local fallback_url='https://github.com/koel/koel/releases/download/v5.1.12/koel-v5.1.12.tar.gz' @@ -10443,7 +10436,7 @@ _EOF_ G_EXEC chmod +x /usr/local/bin/composer # Enable required PHP modules - G_EXEC phpenmod bcmath ctype fileinfo json mbstring tokenizer xml pdo_sqlite curl sqlite3 + G_EXEC phpenmod bcmath ctype fileinfo mbstring tokenizer xml pdo_sqlite curl sqlite3 $json # Install Koel G_EXEC cd /mnt/dietpi_userdata/koel @@ -10488,8 +10481,8 @@ _EOF_ Download_Test_Media # Init - G_EXEC_OUTPUT=1 G_EXEC sudo -u koel $PHP_NAME artisan koel:init -n --no-assets - G_EXEC_OUTPUT=1 G_EXEC sudo -u koel $PHP_NAME artisan koel:sync + G_EXEC_OUTPUT=1 G_EXEC sudo -u koel php$PHP_VERSION artisan koel:init -n --no-assets + G_EXEC_OUTPUT=1 G_EXEC sudo -u koel php$PHP_VERSION artisan koel:sync G_EXEC cd "$G_WORKING_DIR" # Service: Run on port 8003 by default to avoid conflict with IceCast @@ -10504,7 +10497,7 @@ After=network-online.target SyslogIdentifier=Koel User=koel WorkingDirectory=/mnt/dietpi_userdata/koel -ExecStart=$(command -v $PHP_NAME) /mnt/dietpi_userdata/koel/artisan serve --host 0.0.0.0 --port 8003 +ExecStart=$(command -v php$PHP_VERSION) /mnt/dietpi_userdata/koel/artisan serve --host 0.0.0.0 --port 8003 [Install] WantedBy=multi-user.target @@ -12016,7 +12009,7 @@ _EOF_ Banner_Installing # Install required PHP modules - DEPS_LIST="$PHP_NAME-curl $PHP_NAME-zip" # https://github.com/reloxx13/TasmoAdmin#linux + DEPS_LIST="php$PHP_VERSION-curl php$PHP_VERSION-zip" # https://github.com/reloxx13/TasmoAdmin#linux # Skip install, if already present if [[ -d '/var/www/tasmoadmin' ]] From 0845e16824776699cc7071cb03ffbe205e6d2eee Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 22 Jan 2022 18:27:47 +0100 Subject: [PATCH 28/67] v8.1 - DietPi-Services | Control only PHP versions which dietpi-software explicitly installs --- dietpi/dietpi-services | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index caf3bf4e02..aac72051b5 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -75,10 +75,9 @@ Available services: 'postgresql' # - PHP - 'php7.2-fpm' - 'php7.3-fpm' - 'php7.4-fpm' - 'php8.0-fpm' + 'php7.3-fpm' # Buster + 'php7.4-fpm' # Bullseye + 'php8.1-fpm' # Bookworm # - Webservers 'apache2' From 936e364e5aa5ef0d12708e284bda6bb7eddb5aa7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 23 Jan 2022 20:43:00 +0100 Subject: [PATCH 29/67] v8.1 - DietPi-Software | X.Org X Server: Install Odroid Mali/DDX packages only on Buster and below or when DRM is not available. On Bullseye with DRM, the default modesetting DDX and Mesa EGL/GLESv2 should work pretty well, i.e. mainline kernel images where Odroid packages are not available anyway. In case Odroid DDX packages are not available, install fbdev for the (with Hardkernel kernel) expected case the DRM is not available for the default modesetting driver to work. - DietPi-Software | X.Org X Server: Install Mesa EGL/GLESv2 libraries on all non-x86_64 and non-RPi systems, in case not covered by Odroid packages. On x86_64 regular OpenGL may be preferred, on RPi those are installed when KMS is enabled. In all other cases, those may be used by GUI applications. --- dietpi/dietpi-software | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cb1cc5ad54..95b51881b6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2662,60 +2662,59 @@ _EOF_ # Generic X server + Mesa OpenGL libraries and utilities DEPS_LIST='xserver-xorg-core xserver-xorg-input-libinput xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra' - # On RPi, add fbdev display driver, as modesetting requires the full- or fake KMS driver overlay being enabled, so that /dev/dri/card0 exists. + # RPi: Add fbdev display driver for legacy framebuffer graphics support, as modesetting requires KMS driver overlay for /dev/dri/card0 to exists. (( $G_HW_MODEL > 9 )) || DEPS_LIST+=' xserver-xorg-video-fbdev' - # On VM, add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which is even the nowadays recommended default. + # VM: Add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which is even the nowadays recommended default. (( $G_HW_MODEL == 20 )) && DEPS_LIST+=' xserver-xorg-video-vmware' # Disable DPMS and screen blanking dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf - # Rockchip RK3399 + Allwinner A64 + ASUS Tinker Board: Mesa GLESv2 - if [[ $G_HW_CPUID == [38] || $G_HW_MODEL == 52 ]]; then - - G_AGI libegl1 libgles2 - # Odroid C1: https://dietpi.com/meveric/pool/main/s/setup-odroid/ - elif (( $G_HW_MODEL == 10 )); then - + if (( $G_HW_MODEL == 10 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + then local apackages=() apt-cache dumpavail | grep -q '^Package: mali400-odroid$' && apackages+=('mali400-odroid') || apackages+=('libegl1' 'libgles2') - apt-cache dumpavail | grep -q '^Package: xf86-video-mali-odroid$' && apackages+=('libump-odroid' 'xf86-video-mali-odroid') + apt-cache dumpavail | grep -q '^Package: xf86-video-mali-odroid$' && apackages+=('libump-odroid' 'xf86-video-mali-odroid') || apackages+=('xserver-xorg-video-fbdev') G_AGI "${apackages[@]}" # Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then - + elif (( $G_HW_MODEL == 11 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + then local apackages=() apt-cache dumpavail | grep -q '^Package: malit628-odroid$' && apackages+=('malit628-odroid') || apackages+=('libegl1' 'libgles2') - apt-cache dumpavail | grep -q '^Package: xf86-video-armsoc-odroid$' && apackages+=('xf86-video-armsoc-odroid') + apt-cache dumpavail | grep -q '^Package: xf86-video-armsoc-odroid$' && apackages+=('xf86-video-armsoc-odroid') || apackages+=('xserver-xorg-video-fbdev') G_AGI "${apackages[@]}" # xf86-video-armsoc-odroid creates an xorg.conf # Odroid C2 - elif (( $G_HW_MODEL == 12 )); then - + elif (( $G_HW_MODEL == 12 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + then DEPS_LIST= apt-cache dumpavail | grep -q '^Package: mali450-odroid$' && DEPS_LIST='mali450-odroid' || DEPS_LIST='libegl1 libgles2' - apt-cache dumpavail | grep -q '^Package: xf86-video-fbturbo-odroid$' && DEPS_LIST+=' libump-odroid xf86-video-fbturbo-odroid' + apt-cache dumpavail | grep -q '^Package: xf86-video-fbturbo-odroid$' && DEPS_LIST+=' libump-odroid xf86-video-fbturbo-odroid' || DEPS_LIST+=' xserver-xorg-video-fbdev' G_BACKUP_FP /etc/X11/xorg.conf dps_index=$software_id Download_Install 'xorg_c2.conf' /etc/X11/xorg.conf # Odroid N2: https://dietpi.com/phpbb/viewtopic.php?t=9206 - elif (( $G_HW_MODEL == 15 )); then - + elif (( $G_HW_MODEL == 15 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + then local apackages=('xserver-xorg-video-fbdev') apt-cache dumpavail | grep -q '^Package: malig52-fbdev-opencl-odroid$' && apackages+=('malig52-fbdev-opencl-odroid') || apackages+=('libegl1' 'libgles2') G_AGI "${apackages[@]}" # Odroid C4 - elif (( $G_HW_MODEL == 16 )); then - + elif (( $G_HW_MODEL == 16 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + then local apackages=('xserver-xorg-video-fbdev') apt-cache dumpavail | grep -q '^Packagerovides: malig31-fbdev-opencl-odroid$' && apackages+=('malig31-fbdev-opencl-odroid') || apackages+=('libegl1' 'libgles2') G_AGI "${apackages[@]}" + # non-x86_64 and non-RPi: Mesa GLESv2 + elif (( $G_HW_ARCH < 10 && $G_HW_MODEL < 10 )) + then + G_AGI libegl1 libgles2 fi fi From 65126657c65e96deca4a184b03b19034bbc10f32 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 24 Jan 2022 14:56:49 +0100 Subject: [PATCH 30/67] v8.1 - DietPi-Software | Kodi: Install X server on Odroid C4 and N2 from Bullseye on, when no DRM is available. Skip Odroid GPU/Kodi packages on Bullseye with DRM, which covers mainline kernel images, where Debian's Kodi with GBM works just fine. This aligns it with X server installs. - DietPi-Software | RPi: Do not raise GPU memory above default on Bullseye for any software title. It is generally not used anymore since CMA uses the shared system memory. Legacy RPi camera, enabled with RPi Cam Control, sets 96 MiB automatically, which may still be required. Modern KMS based camera module support is still outstanding. Additionally disabling headless mode + default GPU memory is now applied on LXQt insalls as well. --- dietpi/dietpi-software | 31 ++++++++++++++++++------------- dietpi/misc/start_kodi | 9 +++++++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 95b51881b6..86a4f5da44 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -357,7 +357,9 @@ INDEX_BROWSER=$INDEX_BROWSER" aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#kodi' aSOFTWARE_DEPS[$software_id]='5 152' # Bullseye + RPi 32-bit + Odroid N2 + Odroid C4: Kodi starts without X server - [[ $G_HW_MODEL -le 9 && $(dpkg --print-architecture) == 'armhf' || $G_DISTRO -ge 6 || $G_HW_MODEL == 1[56] ]] || aSOFTWARE_DEPS[$software_id]+=' 6' + [[ $G_DISTRO -ge 6 || ( $G_HW_MODEL -le 9 && $(dpkg --print-architecture) == 'armhf' ) || $G_HW_MODEL == 1[56] ]] || aSOFTWARE_DEPS[$software_id]+=' 6' + # Odroids from Bullseye on (no Amlogic fbdev Kodi build available) require an X server when no DRM is available. + [[ $G_HW_MODEL == 1[56] && $G_DISTRO -ge 6 && ! -e '/dev/dri' ]] && aSOFTWARE_DEPS[$software_id]+=' 6' #------------------ software_id=32 @@ -2672,7 +2674,7 @@ _EOF_ dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf # Odroid C1: https://dietpi.com/meveric/pool/main/s/setup-odroid/ - if (( $G_HW_MODEL == 10 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + if (( $G_HW_MODEL == 10 )) && [[ $G_DISTRO -le 5 || ! -e '/dev/dri' ]] then local apackages=() apt-cache dumpavail | grep -q '^Package: mali400-odroid$' && apackages+=('mali400-odroid') || apackages+=('libegl1' 'libgles2') @@ -2680,7 +2682,7 @@ _EOF_ G_AGI "${apackages[@]}" # Odroid XU4 - elif (( $G_HW_MODEL == 11 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + elif (( $G_HW_MODEL == 11 )) && [[ $G_DISTRO -le 5 || ! -e '/dev/dri' ]] then local apackages=() apt-cache dumpavail | grep -q '^Package: malit628-odroid$' && apackages+=('malit628-odroid') || apackages+=('libegl1' 'libgles2') @@ -2689,7 +2691,7 @@ _EOF_ # xf86-video-armsoc-odroid creates an xorg.conf # Odroid C2 - elif (( $G_HW_MODEL == 12 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + elif (( $G_HW_MODEL == 12 )) && [[ $G_DISTRO -le 5 || ! -e '/dev/dri' ]] then DEPS_LIST= apt-cache dumpavail | grep -q '^Package: mali450-odroid$' && DEPS_LIST='mali450-odroid' || DEPS_LIST='libegl1 libgles2' @@ -2698,14 +2700,14 @@ _EOF_ dps_index=$software_id Download_Install 'xorg_c2.conf' /etc/X11/xorg.conf # Odroid N2: https://dietpi.com/phpbb/viewtopic.php?t=9206 - elif (( $G_HW_MODEL == 15 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + elif (( $G_HW_MODEL == 15 )) && [[ $G_DISTRO -le 5 || ! -e '/dev/dri' ]] then local apackages=('xserver-xorg-video-fbdev') apt-cache dumpavail | grep -q '^Package: malig52-fbdev-opencl-odroid$' && apackages+=('malig52-fbdev-opencl-odroid') || apackages+=('libegl1' 'libgles2') G_AGI "${apackages[@]}" # Odroid C4 - elif (( $G_HW_MODEL == 16 )) && [[ $G_DISTRO -lt 6 || ! -e '/dev/dri' ]] + elif (( $G_HW_MODEL == 16 )) && [[ $G_DISTRO -le 5 || ! -e '/dev/dri' ]] then local apackages=('xserver-xorg-video-fbdev') apt-cache dumpavail | grep -q '^Packagerovides: malig31-fbdev-opencl-odroid$' && apackages+=('malig31-fbdev-opencl-odroid') || apackages+=('libegl1' 'libgles2') @@ -5585,8 +5587,8 @@ _EOF_ apackages+=('kodi') - # Odroids - elif [[ $G_HW_MODEL == 1[0-9] ]] + # Odroids on Buster or without DRM + elif [[ $G_HW_MODEL == 1[0-9] && ( $G_DISTRO -le 5 || ! -e '/dev/dri' ) ]] then local package_list=$(apt-cache dumpavail | mawk '/^Package: /{print $2}') @@ -12613,8 +12615,8 @@ _EOF_ # RPi: Define minimal memory split based on installed software local gpu_memory=0 - # Kodi prior to Bullseye, Jellyfin - if (( ( ${aSOFTWARE_INSTALL_STATE[31]} == 1 && $G_DISTRO < 6 ) || ${aSOFTWARE_INSTALL_STATE[178]} == 1 )); then + # Kodi, Jellyfin + if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || ${aSOFTWARE_INSTALL_STATE[178]} == 1 )); then gpu_memory=256 (( ${G_HW_MEMORY_SIZE:-0} > 256 )) || gpu_memory=128 @@ -12631,18 +12633,21 @@ _EOF_ gpu_memory=96 - # Desktops, OpenTyrian, Kodi since Bullseye + # Desktops, OpenTyrian elif (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 || ${aSOFTWARE_INSTALL_STATE[24]} == 1 || ${aSOFTWARE_INSTALL_STATE[25]} == 1 || ${aSOFTWARE_INSTALL_STATE[26]} == 1 || - ${aSOFTWARE_INSTALL_STATE[31]} == 1 || - ${aSOFTWARE_INSTALL_STATE[51]} == 1 )); then + ${aSOFTWARE_INSTALL_STATE[51]} == 1 || + ${aSOFTWARE_INSTALL_STATE[173]} == 1 )); then gpu_memory=1 # default fi + # RPi Bullseye: No need to raise GPU memory above default with CMA + (( $G_DISTRO > 5 && $gpu_memory > 1 )) && gpu_memory=1 + # Disable headless/enable GPU when graphics software was installed (( $gpu_memory )) || return 0 diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index d7ce72ad3c..2f9dae4689 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -16,14 +16,19 @@ # - /boot/dietpi/misc/start_kodi #//////////////////////////////////// - # Load $G_HW_MODEL + # Load $G_HW_MODEL and $G_DISTRO . /boot/dietpi/.hw_model #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// + standalone=0 # Bullseye + RPi 32-bit + Odroid N2 + Odroid C4: Kodi starts without X server - if [ "$G_HW_MODEL" -lt 10 ] && [ "$(dpkg --print-architecture)" = 'armhf' ] || [ "$G_DISTRO" -ge 6 ] || [ "$G_HW_MODEL" = 15 ] || [ "$G_HW_MODEL" = 16 ] + [ "$G_DISTRO" -ge 6 ] || { [ "$G_HW_MODEL" -le 9 ] && [ "$(dpkg --print-architecture)" = 'armhf' ]; } || [ "$G_HW_MODEL" = 15 ] || [ "$G_HW_MODEL" = 16 ] && standalone=1 + # Odroids from Bullseye on (no Amlogic fbdev Kodi build available) require an X server when no DRM is available. + { [ "$G_HW_MODEL" = 15 ] || [ "$G_HW_MODEL" = 16 ]; } && [ "$G_DISTRO" -ge 6 ] && [ ! -e '/dev/dri' ] && standalone=0 + + if [ "$standalone" = 1 ] then exec kodi --standalone "$@" From a09789589836403bf511c843b9dc2e1ceb51aa0e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 02:25:33 +0100 Subject: [PATCH 31/67] v8.1 - dietpi.txt | Fix and update comments for automated first run setup: https://github.com/MichaIng/DietPi/issues/5206 --- dietpi.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 96b6450730..107ef9fbda 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -113,21 +113,23 @@ AUTO_SETUP_AUTOSTART_LOGIN_USER=root ##### Non-interactive Firstrun Setup ##### # On first login, run update, initial setup and software installs without any user input -# - Setting this to "1" is required for below settings to take effect -# - It is HIGHLY recommended to also set CONFIG_BOOT_WAIT_FOR_NETWORK=2, to force infinite wait for network connection during boot and prevent connection timeout errors. -# - Setting this to "1" indicates that you accept the DietPi GPLv2 license, available at /boot/dietpi-LICENSE.txt, superseding any setting of AUTO_SETUP_ACCEPT_LICENSE. +# - Setting this to "1" is required for AUTO_SETUP_GLOBAL_PASSWORD and AUTO_SETUP_INSTALL_SOFTWARE_ID. +# - It is then recommended to leave AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=1 to wait for network connectivity during boot and prevent connection timeout errors. +# - Setting this to "1" indicates that you accept the DietPi GPLv2 license, available at /boot/dietpi-LICENSE.txt, superseding AUTO_SETUP_ACCEPT_LICENSE. AUTO_SETUP_AUTOMATED=0 # Global Password to be applied for the system +# - Requires AUTO_SETUP_AUTOMATED=1 # - Affects "root" and "dietpi" users login passwords and is used by dietpi-software as default for software installs which require a password. # - On first dietpi-software execution, the password is removed from this file and instead encrypted and saved to rootfs. # - WARN: We cannot guarantee that all software options can handle special characters like \"$. AUTO_SETUP_GLOBAL_PASSWORD=dietpi # Software to automatically install +# - Requires AUTO_SETUP_AUTOMATED=1 # - List of available software IDs: https://github.com/MichaIng/DietPi/wiki/DietPi-Software-list # - Add as many entries as you wish, one each line. -# - DietPi will automatically install all pre-reqs (e.g. ALSA/X11 for desktops etc) +# - DietPi will automatically install all dependencies, like ALSA/X11 for desktops etc. # - E.g. the following (without the leading "#") will install the LXDE desktop automatically on first boot: #AUTO_SETUP_INSTALL_SOFTWARE_ID=23 From 747a37be7eb9d0bc458f834b2cfd50278a1a5f77 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 13:14:59 +0100 Subject: [PATCH 32/67] v8.1 - dietpi.txt | Remove mention of AUTO_SETUP_BOOT_WAIT_FOR_NETWORK for AUTO_SETUP_AUTOMATED, since the first has no effect on the second anymore: https://github.com/MichaIng/DietPi/issues/5143#issuecomment-1008080428 --- dietpi.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 107ef9fbda..3e17ade13c 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -114,7 +114,6 @@ AUTO_SETUP_AUTOSTART_LOGIN_USER=root ##### Non-interactive Firstrun Setup ##### # On first login, run update, initial setup and software installs without any user input # - Setting this to "1" is required for AUTO_SETUP_GLOBAL_PASSWORD and AUTO_SETUP_INSTALL_SOFTWARE_ID. -# - It is then recommended to leave AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=1 to wait for network connectivity during boot and prevent connection timeout errors. # - Setting this to "1" indicates that you accept the DietPi GPLv2 license, available at /boot/dietpi-LICENSE.txt, superseding AUTO_SETUP_ACCEPT_LICENSE. AUTO_SETUP_AUTOMATED=0 From bb127ba70a17ef2a713cc5b1d35fdcc04783030d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 16:47:58 +0100 Subject: [PATCH 33/67] v8.1 - DietPi-Set_hardware | When enabling/disabling serial consoles, also loop through ttyAML[0-9] devices, used by mainline Odroid N2/C4 kernel. Be more robust by detecting legacy kernel/bootloader on Odroid XU4 and PINE A64 before trying to apply settings --- dietpi/func/dietpi-set_hardware | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index e17f50bb06..3bfe34786c 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1520,20 +1520,20 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 grep -q "console=$INPUT_ADDITIONAL" /boot/cmdline.txt || sed -i "/root=/s/[[:blank:]]*$/ console=$INPUT_ADDITIONAL,115200/" /boot/cmdline.txt - # - Odroid C2 + # - Odroid C2 legacy elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then local old= - [[ -f '/boot/boot.ini' ]] && old=$(grep -Em1 '^[[:blank:]]*setenv[[:blank:]]+condev[[:blank:]]' /boot/boot.ini) || return 0 + old=$(grep -Em1 '^[[:blank:]]*setenv[[:blank:]]+condev[[:blank:]]' /boot/boot.ini) || return 0 [[ $old == *"console=$INPUT_ADDITIONAL"* ]] && return 0 old=$(cut -d \" -f 2 <<< "$old") G_CONFIG_INJECT 'setenv[[:blank:]]+condev[[:blank:]]' "setenv condev \"$old console=$INPUT_ADDITIONAL,115200n8\"" /boot/boot.ini 'ODROIDC2-UBOOT-CONFIG' - # - Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then + # - Odroid XU4 legacy + elif [[ $G_HW_MODEL == 11 && -f '/boot/boot.ini' ]]; then local old= - [[ -f '/boot/boot.ini' ]] && old=$(grep -Em1 '^[[:blank:]]*setenv[[:blank:]]+bootrootfs[[:blank:]]' /boot/boot.ini) || return 0 + old=$(grep -Em1 '^[[:blank:]]*setenv[[:blank:]]+bootrootfs[[:blank:]]' /boot/boot.ini) || return 0 [[ $old == *"console=$INPUT_ADDITIONAL"* ]] && return 0 old=$(cut -d \" -f 2 <<< "$old") G_CONFIG_INJECT 'setenv[[:blank:]]+bootrootfs[[:blank:]]' "setenv bootrootfs \"$old console=$INPUT_ADDITIONAL,115200n8\"" /boot/boot.ini 'ODROIDXU-UBOOT-CONFIG' @@ -1552,11 +1552,10 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 fi - # - PINE A64: On Armbian ttyS0 boot output is forced and custom console is not possible via armbianEnv.txt - elif (( $G_HW_MODEL == 40 )); then + # - PINE A64 legacy + elif [[ $G_HW_MODEL == 40 && -f $FP_UENV ]]; then - [[ ! -f $FP_UENV ]] || grep -q "console=$INPUT_ADDITIONAL" $FP_UENV && return 0 - echo "console=$INPUT_ADDITIONAL,115200n8" >> $FP_UENV + grep -q "console=$INPUT_ADDITIONAL" $FP_UENV || echo "console=$INPUT_ADDITIONAL,115200n8" >> $FP_UENV fi @@ -1564,7 +1563,7 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 else # ttyFIQ[0-9]: https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 - for i in /dev/tty{S,AMA,SAC}[0-9] + for i in /dev/tty{S,AMA,SAC,AML}[0-9] do [[ -e $i ]] || continue INPUT_ADDITIONAL=${i/\/dev\/} Serial_Main @@ -1602,11 +1601,12 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 sed -Ei "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" /boot/cmdline.txt - # - Odroid C1/C2/XU4 + # - Odroid C1/C2/XU4 legacy elif [[ $G_HW_MODEL -le 12 && -f '/boot/boot.ini' ]]; then sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" /boot/boot.ini + # - Armbian: armbianEnv.txt only allows to toggle a fixed serial console depending on device elif (( $ARMBIAN )); then grep -q "console=$INPUT_ADDITIONAL" /boot/boot.cmd || return 0 @@ -1620,8 +1620,8 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 fi - # - PINE A64: On Armbian ttyS0 boot output is forced and custom console is not possible via armbianEnv.txt - elif (( $G_HW_MODEL == 40 )); then + # - PINE A64 legacy + elif [[ $G_HW_MODEL == 40 && -f $FP_UENV ]]; then sed -i "/^[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*[[:blank:]]*$/d" $FP_UENV # New style: One variable each line sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line @@ -1632,7 +1632,7 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 else # ttyFIQ[0-9]: https://github.com/MichaIng/DietPi/issues/1829#issuecomment-398302497 - for i in /dev/tty{S,AMA,SAC}[0-9] + for i in /dev/tty{S,AMA,SAC,AML}[0-9] do [[ -e $i ]] || continue INPUT_ADDITIONAL=${i/\/dev\/} Serial_Main From 540e8e0cb078d9e4b5ccc2578e0516dfba6e398c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 17:00:39 +0100 Subject: [PATCH 34/67] v8.1 - DietPi-PREP | Cleanup of serial console configuration: Disable first all of them, re-enable only the intended default/debug serial console, where known, and all on non-VM where the default/debug serial console is currently not known or not added, yet. --- PREP_SYSTEM_FOR_DIETPI.sh | 55 +++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 22cbc09164..a59384f7ab 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1489,36 +1489,41 @@ left_meter_modes=1 1 right_meters=Memory Swap Tasks LoadAverage Uptime right_meter_modes=1 1 2 2 2 _EOF_' - G_DIETPI-NOTIFY 2 'Configuring serial login consoles:' - # On virtual machines, serial consoles are not required - if (( $G_HW_MODEL == 20 )); then - - /boot/dietpi/func/dietpi-set_hardware serialconsole disable + G_DIETPI-NOTIFY 2 'Configuring serial login consoles' + # Disable all serial consoles first, also to remove invalid ones + /boot/dietpi/func/dietpi-set_hardware serialconsole disable + # On RPi the primary serial console depends on model, use "serial0" which links to the primary console, converts to correct device on first boot + if (( $G_HW_MODEL < 10 )) + then + G_CONFIG_INJECT 'enable_uart=' 'enable_uart=0' /boot/config.txt + /boot/dietpi/func/dietpi-set_hardware serialconsole enable serial0 + # Disable and mask the others explicitly to be independent of currently available serial devices + /boot/dietpi/func/dietpi-set_hardware serialconsole disable ttyAMA0 + G_EXEC systemctl mask serial-getty@ttyAMA0 + /boot/dietpi/func/dietpi-set_hardware serialconsole disable ttyS0 + G_EXEC systemctl mask serial-getty@ttyS0 + + # Odroid N2: Enable on serial debug console only + elif (( $G_HW_MODEL == 15 )) + then + local tty='ttyAML0' + [[ -e '/dev/ttyAML0' ]] || tty='ttyS0' + /boot/dietpi/func/dietpi-set_hardware serialconsole enable "$tty" - else + # ROCK Pi S: Enable on ttyS0 only + elif (( $G_HW_MODEL == 73 )) + then + /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS0 + # Else on non-VM: Enable on all present serial consoles + elif (( $G_HW_MODEL != 20 )) + then /boot/dietpi/func/dietpi-set_hardware serialconsole enable - # On RPi the primary serial console depends on model, use "serial0" which links to the primary console, converts to correct device on first boot - if (( $G_HW_MODEL < 10 )); then - - /boot/dietpi/func/dietpi-set_hardware serialconsole disable ttyAMA0 - # The actual serial console services need to be masked explicitly to ensure they are not autostarted when the image is created within a container or without both serial devices present, since masks are only placed by dietpi-set_hardware for existing devices: : https://github.com/MichaIng/DietPi/issues/5014 - G_EXEC systemctl mask serial-getty@ttyAMA0 - /boot/dietpi/func/dietpi-set_hardware serialconsole disable ttyS0 - G_EXEC systemctl mask serial-getty@ttyS0 - /boot/dietpi/func/dietpi-set_hardware serialconsole enable serial0 - - # ROCK Pi S: Enable on ttyS0 only - elif (( $G_HW_MODEL == 73 )); then - - /boot/dietpi/func/dietpi-set_hardware serialconsole disable - /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS0 - G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=1' /boot/dietpi.txt - - fi - fi + # Re-set dietpi.txt setting on non-VMs to indicated enabled serial console + (( $G_HW_MODEL == 20 )) || G_CONFIG_INJECT 'CONFIG_SERIAL_CONSOLE_ENABLE=' 'CONFIG_SERIAL_CONSOLE_ENABLE=1' /boot/dietpi.txt + G_DIETPI-NOTIFY 2 'Disabling static and automatic login prompts on consoles tty2 to tty6:' G_EXEC systemctl mask --now getty-static # - logind features are usually not needed and (aside of automatic getty spawn) require the libpam-systemd package. From 5d37711db0a1bc2165b277910b2df61ab0dc297f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 17:56:29 +0100 Subject: [PATCH 35/67] v8.1 - DietPi-Set_swapfile | Skip changing /tmp tmpfs size when it is not defined as dedicated mount --- dietpi/func/dietpi-set_swapfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/func/dietpi-set_swapfile b/dietpi/func/dietpi-set_swapfile index 5566d5365a..01ce84f394 100644 --- a/dietpi/func/dietpi-set_swapfile +++ b/dietpi/func/dietpi-set_swapfile @@ -62,6 +62,9 @@ Update_Tmp(){ + # Skip if /tmp is not dedicated mount + grep -q '[[:blank:]]/tmp[[:blank:]]' /etc/fstab || return 0 + # Set /tmp to 50% of RAM+SWAP: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369373082 local tmp_size=$(( $(free -tm | mawk '/^Total:/{print $2;exit}') / 2 )) From 2455c527acc5fd20a41025d10d38ff78cd77c1e3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 19:36:24 +0100 Subject: [PATCH 36/67] v8.1 - DietPi-Benchmark | Apply performance CPU governor when running RAM I/O benchmark to avoid low frequency affecting RAM I/O results: https://github.com/MichaIng/DietPi/issues/5039#issuecomment-1021459310 - DietPi-Benchmark | A bunch of wording and coding enhancements, not affecting benchmark results --- dietpi/func/dietpi-benchmark | 183 +++++++++++++++-------------------- 1 file changed, 79 insertions(+), 104 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 9f18517342..af8e403843 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -27,13 +27,8 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- + [[ $1 ]] || { G_DIETPI-NOTIFY 1 'Invalid command, please see source code'; exit 1; } INPUT=$1 - if [[ ! $INPUT ]]; then - - G_DIETPI-NOTIFY 1 'Invalid command, please see sourcecode' - exit 1 - - fi #///////////////////////////////////////////////////////////////////////////////////// # Global @@ -42,7 +37,7 @@ SHOW_RESULTS=${SHOW_RESULTS:-1} # Optional input: Show results for individual tests? CPUBENCH_INT_MAX=${CPUBENCH_INT_MAX:-1000000} # Optional input BENCH_FILESIZE=${BENCH_FILESIZE:-0} # Optional input for automated - [[ ${FP_BENCHFILE:=/} == '/'* ]] || { G_DIETPI-NOTIFY 1 'FP_BENCHFILE must be an absolute file path, aborting...'; exit 1; } # Optional input + [[ ${FP_BENCHFILE:=/} == '/'* ]] || { G_DIETPI-NOTIFY 1 'FP_BENCHFILE must be an absolute directory path, aborting...'; exit 1; } # Optional input BENCH_ROOTFS_WRITE='Not tested' BENCH_ROOTFS_READ='Not tested' @@ -78,21 +73,20 @@ _EOF_ Upload_Survey(){ - if grep -q '^[[:blank:]]*SURVEY_OPTED_IN=1$' /boot/dietpi.txt; then - + if grep -q '^[[:blank:]]*SURVEY_OPTED_IN=1$' /boot/dietpi.txt + then /boot/dietpi/dietpi-survey 1 - elif G_WHIP_YESNO 'To upload and compare your results against other users, you must be opted in to the DietPi-Survey.\n\nWould you like to run DietPi-Survey now, allowing you to opt in?'; then - + elif G_WHIP_YESNO 'To upload and compare your results against other users, you must be opted in to the DietPi-Survey.\n\nWould you like to run DietPi-Survey now, allowing you to opt in?' + then /boot/dietpi/dietpi-survey - fi } CPU_Benchmark(){ - G_DIETPI-NOTIFY 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $G_HW_CPU_CORES cores, please wait..." + G_DIETPI-NOTIFY 2 "Running CPU benchmark with max value of 1000000 over $G_HW_CPU_CORES cores, please wait..." cat << _EOF_ > bench #!/bin/bash @@ -105,20 +99,16 @@ aEnd_Int=() # Split the max int target based on total cores for ((i=0; i<\$cores; i++)) do - aEnd_Int[\$i]=\$(( (\$i + 1) * \$int_split )) aStart_Int[\$i]=\$(( \${aEnd_Int[\$i]} - \$int_split )) echo \${aStart_Int[\$i]} \${aEnd_Int[\$i]} - done Run_Bench(){ while (( \${aStart_Int[\$1]} < \${aEnd_Int[\$1]} )) do - ((aStart_Int[\$1]++)) - done } @@ -126,18 +116,14 @@ Run_Bench(){ # Launch benchmark threads for ((i=0; i<\$cores; i++)) do - Run_Bench \$i & - done # Wait for jobs to finish -for job in \`jobs -p\` +for job in \$(jobs -p) do - echo \$job wait \$job - done _EOF_ G_EXEC chmod +x bench @@ -152,12 +138,12 @@ _EOF_ BENCH_CPU_TEMP_END=$(G_OBTAIN_CPU_TEMP) BENCH_CPU=$(mawk '/real/{print $2;exit}' bench_result) - if (( $SHOW_RESULTS )); then - - G_WHIP_MSG "CPU Benchmark Results:\n - - Total time = $BENCH_CPU Seconds + if (( $SHOW_RESULTS )) + then + G_WHIP_MSG "CPU benchmark results:\n + - Total time = $BENCH_CPU seconds - Value to reach = $CPUBENCH_INT_MAX - - CPU temps = Start: ${BENCH_CPU_TEMP_START}'c | End: ${BENCH_CPU_TEMP_END}'c + - CPU temps = Start: ${BENCH_CPU_TEMP_START} °C | End: ${BENCH_CPU_TEMP_END} °C \n\nNB: A lower 'Total time' is faster" fi @@ -166,19 +152,15 @@ _EOF_ Filesystem_Benchmark(){ - G_EXEC mkdir -p "$FP_BENCHFILE" # Failsafe + [[ -d $FP_BENCHFILE ]] || G_EXEC mkdir "$FP_BENCHFILE" # Failsafe + local benchmark_file_name='dietpi-benchmark_testfile' + FP_BENCHFILE="${FP_BENCHFILE%/}/$benchmark_file_name" local min_benchmark_size=10 local max_benchmark_size=$(( $(G_CHECK_FREESPACE "$FP_BENCHFILE") - 50 )) # Assure 50 MiB stays free - #(( $max_benchmark_size > 10000 )) && max_benchmark_size=10000 - - local benchmark_file_name='benchmark.file' - FP_BENCHFILE="${FP_BENCHFILE%/}/$benchmark_file_name" - - G_TERM_CLEAR # Obtain user benchmark size - if (( $BENCH_FILESIZE == 0 )); then - + if (( $BENCH_FILESIZE == 0 )) + then G_WHIP_DEFAULT_ITEM=$min_benchmark_size G_WHIP_INPUTBOX "Please enter a filesize test value (MiB). A value of 100 is recommended. - Minimum value: $min_benchmark_size @@ -191,94 +173,95 @@ _EOF_ (( $BENCH_FILESIZE > $max_benchmark_size )) && BENCH_FILESIZE=$max_benchmark_size # Run benchmark - G_DIETPI-NOTIFY 2 "Performing Read/Write benchmark on $FP_BENCHFILE, please wait..." + G_DIETPI-NOTIFY 2 "Running read/write benchmark on $FP_BENCHFILE ($BENCH_FILESIZE MiB)" - G_DIETPI-NOTIFY 2 "Testing Seq Write Speed ($BENCH_FILESIZE MiB)" + G_DIETPI-NOTIFY 2 'Testing seq write speed, please wait...' sleep 1 - local bench_write_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 256 )) if=/dev/zero of="$FP_BENCHFILE" conv=fdatasync 2>&1 | grep -m1 'copied') - bench_write_result=$(mawk '{printf "%.0f",$1/$8/1024^2}' <<< "$bench_write_result") + local bench_write_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 256 )) if=/dev/zero of="$FP_BENCHFILE" conv=fdatasync 2>&1 | mawk '/copied/{printf "%.0f",$1/$8/1024^2;exit}') + G_DIETPI-NOTIFY 0 "Result: $bench_write_result MiB/s" - # - Clear cache + G_DIETPI-NOTIFY 2 'Clearing filesystem cache...' sync echo 3 > /proc/sys/vm/drop_caches - G_DIETPI-NOTIFY 2 "Testing Seq Read Speed ($BENCH_FILESIZE MiB)" + G_DIETPI-NOTIFY 2 'Testing seq read speed, please wait...' sleep 1 - local bench_read_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 256 )) if="$FP_BENCHFILE" of=/dev/null 2>&1 | grep -m1 'copied') - bench_read_result=$(mawk '{printf "%.0f",$1/$8/1024^2}' <<< "$bench_read_result") + local bench_read_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 256 )) if="$FP_BENCHFILE" of=/dev/null 2>&1 | mawk '/copied/{printf "%.0f",$1/$8/1024^2;exit}') + G_DIETPI-NOTIFY 0 "Result: $bench_read_result MiB/s" # - RootFS - if [[ $FP_BENCHFILE == '/'$benchmark_file_name ]]; then - + if [[ $FP_BENCHFILE == "/$benchmark_file_name" ]] + then BENCH_ROOTFS_WRITE=$bench_write_result BENCH_ROOTFS_READ=$bench_read_result # - RAM - elif [[ $FP_BENCHFILE == '/tmp/'$benchmark_file_name ]]; then - + elif [[ $FP_BENCHFILE == "/tmp/$benchmark_file_name" ]] + then BENCH_RAM_WRITE=$bench_write_result BENCH_RAM_READ=$bench_read_result # - Custom else - BENCH_CUSTOMFS_WRITE=$bench_write_result BENCH_CUSTOMFS_READ=$bench_read_result - fi - if (( $SHOW_RESULTS )); then - - G_WHIP_MSG "Filesystem Benchmark Results:\n - - Filepath = $FP_BENCHFILE + if (( $SHOW_RESULTS )) + then + G_WHIP_MSG "Filesystem benchmark results:\n + - File path = $FP_BENCHFILE - Test size = $BENCH_FILESIZE MiB - WRITE = $bench_write_result MiB/s - READ = $bench_read_result MiB/s" fi - [[ -f $FP_BENCHFILE ]] && rm -v "$FP_BENCHFILE" + [[ -f $FP_BENCHFILE ]] && G_EXEC rm "$FP_BENCHFILE" } Benchmark_Survey(){ SHOW_RESULTS=0 - G_EXEC mkdir -p /var/lib/dietpi/dietpi-benchmark - - if (( $G_INTERACTIVE )); then + [[ -d '/var/lib/dietpi/dietpi-benchmark' ]] || G_EXEC mkdir /var/lib/dietpi/dietpi-benchmark + if (( $G_INTERACTIVE )) + then if G_WHIP_YESNO "$G_PROGRAM_NAME will now run the following benchmarks:\n - CPU performance\n - RootFS read/write performance\n - RAM read/write performance. The test duration will depend on hardware specs, however, most devices will not exceed 40 seconds.\n\nIf you are opted in to the DietPi-Survey, your scores will uploaded automatically. -You can compare results against other users and hardware using the following link:\n - https://dietpi.com/survey#benchmark\n\nPlease select 'Ok' to begin the benchmark tests."; then - +You can compare results against other users and hardware using the following link:\n - https://dietpi.com/survey#benchmark\n\nPlease select 'Ok' to begin the benchmark tests." + then # Additional checks (( $G_HW_CPU_CORES > 2 )) || G_WHIP_YESNO "We have detected a low CPU core count ($G_HW_CPU_CORES). The tests may take up to 5 minutes to complete.\n\nDo you wish to continue?" || exit 0 - else - - G_DIETPI-NOTIFY 0 'Benchmark aborted' + G_DIETPI-NOTIFY 2 'Benchmark aborted' exit 0 - fi - fi - G_DIETPI-NOTIFY 0 'Running benchmark suite tests, please wait...' + G_DIETPI-NOTIFY 2 'Running benchmark suite tests, please wait...' CPU_Benchmark # FS/RAM # - RAM - if df -t tmpfs /tmp &> /dev/null; then + if df -t tmpfs /tmp &> /dev/null + then + # Apply performance CPU governor to avoid low frequency affecting RAM I/O results: https://github.com/MichaIng/DietPi/issues/5039#issuecomment-1021459310 + G_DIETPI-NOTIFY 2 'Temporarily applying performance CPU governor for RAM I/O benchmark...' + for i in /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_governor + do + echo 'performance' > "$i" + done FP_BENCHFILE='/tmp' BENCH_FILESIZE=$(mawk '/^MemFree:/{printf "%.0f",$2/2048;exit}' /proc/meminfo) # Assure 50% of physical mem stays free, so swapping can be ruled out: KiB => MiB / 2 Filesystem_Benchmark + G_DIETPI-NOTIFY 2 'Restoring original CPU governor...' + /boot/dietpi/func/dietpi-set_cpu else - - G_DIETPI-NOTIFY 1 '/tmp does not seem to be mounted as tmpfs (RAMdisk). Skipping RAM benchmark...' - + G_DIETPI-NOTIFY 1 '/tmp does not seem to be mounted as tmpfs (RAMdisk). Skipping RAM I/O benchmark...' fi # - RootFS @@ -289,10 +272,10 @@ You can compare results against other users and hardware using the following lin SHOW_RESULTS=1 G_WHIP_MSG "Benchmarks completed: - - CPU Performance : Duration = $BENCH_CPU seconds (lower is faster) - - CPU Temp : Idle = ${BENCH_CPU_TEMP_START}'c | Full load = ${BENCH_CPU_TEMP_END}'c - - RootFS : Write = $BENCH_ROOTFS_WRITE MiB/s | Read = $BENCH_ROOTFS_READ MiB/s - - RAM : Write = $BENCH_RAM_WRITE MiB/s | Read = $BENCH_RAM_READ MiB/s + - CPU performance : Duration = $BENCH_CPU seconds (lower is faster) + - CPU temps : Idle = ${BENCH_CPU_TEMP_START} °C | Full load = ${BENCH_CPU_TEMP_END} °C + - RootFS I/O : Write = $BENCH_ROOTFS_WRITE MiB/s | Read = $BENCH_ROOTFS_READ MiB/s + - RAM I/O : Write = $BENCH_RAM_WRITE MiB/s | Read = $BENCH_RAM_READ MiB/s Compare these results online with other users, using the link below: - https://dietpi.com/survey#benchmark" @@ -312,25 +295,20 @@ Compare these results online with other users, using the link below: Benchmark_Lan_Client(){ - G_AG_CHECK_INSTALL_PREREQ iperf - if G_WHIP_INPUTBOX 'Please enter the IP address of the system running the network benchmark server:\n - eg: 192.168.0.100'; then - - IPERF_SERVER_IP=$G_WHIP_RETURNED_VALUE - - G_DIETPI-NOTIFY 2 "Benchmarking network performance to $IPERF_SERVER_IP. Please wait..." - BENCH_NET_LAN_SPEED=$(iperf -c "$IPERF_SERVER_IP" -p 5001 -t 5 -y C | sed 's/.*,//g') - if disable_error=1 G_CHECK_VALIDINT "$BENCH_NET_LAN_SPEED"; then - - BENCH_NET_LAN_SPEED=$(( $BENCH_NET_LAN_SPEED / 8 / 1024**2 )) - G_WHIP_MSG "Network LAN benchmark completed:\n - Transfer rate = $BENCH_NET_LAN_SPEED MiB/s" - - else - - G_WHIP_MSG 'Network LAN benchmark failed, please verify:\n - Server is running on the other system\n - Server IP address is correct' - BENCH_NET_LAN_SPEED='Not tested' + G_WHIP_INPUTBOX 'Please enter the IP address of the system running the network benchmark server:\n - E.g.: 192.168.0.100' || return 0 + IPERF_SERVER_IP=$G_WHIP_RETURNED_VALUE - fi + G_AG_CHECK_INSTALL_PREREQ iperf + G_DIETPI-NOTIFY 2 "Benchmarking network performance to $IPERF_SERVER_IP, please wait..." + BENCH_NET_LAN_SPEED=$(iperf -c "$IPERF_SERVER_IP" -p 5001 -t 5 -y C | sed 's/.*,//g') + if disable_error=1 G_CHECK_VALIDINT "$BENCH_NET_LAN_SPEED" + then + BENCH_NET_LAN_SPEED=$(( $BENCH_NET_LAN_SPEED / 8 / 1024**2 )) + G_WHIP_MSG "Network LAN benchmark completed:\n - Transfer rate = $BENCH_NET_LAN_SPEED MiB/s" + else + G_WHIP_MSG 'Network LAN benchmark failed, please verify:\n - Server is running on the other system\n - Server IP address is correct' + BENCH_NET_LAN_SPEED='Not tested' fi } @@ -344,36 +322,34 @@ Compare these results online with other users, using the link below: ionice -p $$ -c 1 -n 0 #----------------------------------------------------------------------------------- # Init vars for sourcing - if (( $INPUT == 0 )); then - + if (( $INPUT == 0 )) + then Save_Results # LAN bench server - elif (( $INPUT == 3 )); then - + elif (( $INPUT == 3 )) + then Benchmark_Lan_Server # Run benchmarks else - #----------------------------------------------------------------------------------- /boot/dietpi/dietpi-services stop #----------------------------------------------------------------------------------- # Reuse existing results if done Load_Results #----------------------------------------------------------------------------------- - if (( $INPUT == 1 )); then - + if (( $INPUT == 1 )) + then Filesystem_Benchmark - elif (( $INPUT == 2 )); then - + elif (( $INPUT == 2 )) + then Benchmark_Survey - elif (( $INPUT == 4 )); then - + elif (( $INPUT == 4 )) + then Benchmark_Lan_Client - fi #----------------------------------------------------------------------------------- # Export results data for other scripts: @@ -384,7 +360,6 @@ Compare these results online with other users, using the link below: #----------------------------------------------------------------------------------- /boot/dietpi/dietpi-services start #----------------------------------------------------------------------------------- - fi #----------------------------------------------------------------------------------- exit 0 From f70b2f5743584336b8bfa82c1f95ed605f38232e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 19:44:52 +0100 Subject: [PATCH 37/67] v8.1 - DietPi-Benchmark | Fix free space check --- dietpi/func/dietpi-benchmark | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index af8e403843..c6a5b8d7ba 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -153,10 +153,10 @@ _EOF_ Filesystem_Benchmark(){ [[ -d $FP_BENCHFILE ]] || G_EXEC mkdir "$FP_BENCHFILE" # Failsafe - local benchmark_file_name='dietpi-benchmark_testfile' - FP_BENCHFILE="${FP_BENCHFILE%/}/$benchmark_file_name" local min_benchmark_size=10 local max_benchmark_size=$(( $(G_CHECK_FREESPACE "$FP_BENCHFILE") - 50 )) # Assure 50 MiB stays free + local benchmark_file_name='dietpi-benchmark_testfile' + FP_BENCHFILE="${FP_BENCHFILE%/}/$benchmark_file_name" # Obtain user benchmark size if (( $BENCH_FILESIZE == 0 )) @@ -228,8 +228,8 @@ _EOF_ if (( $G_INTERACTIVE )) then - if G_WHIP_YESNO "$G_PROGRAM_NAME will now run the following benchmarks:\n - CPU performance\n - RootFS read/write performance\n - RAM read/write performance. -The test duration will depend on hardware specs, however, most devices will not exceed 40 seconds.\n\nIf you are opted in to the DietPi-Survey, your scores will uploaded automatically. + if G_WHIP_YESNO "$G_PROGRAM_NAME will now run the following benchmarks:\n - CPU performance\n - RootFS read/write performance\n - RAM read/write performance +\nThe test duration will depend on hardware specs, however, most devices will not exceed 40 seconds.\n\nIf you are opted in to the DietPi-Survey, your scores will uploaded automatically. You can compare results against other users and hardware using the following link:\n - https://dietpi.com/survey#benchmark\n\nPlease select 'Ok' to begin the benchmark tests." then # Additional checks From cd3bd5ffdb811d5a047ad2c3198f1e5cebb9b11a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jan 2022 22:54:54 +0100 Subject: [PATCH 38/67] v8.1 - DietPi-Backup | Print notification when rsync dry-run to obtain required disk space is starting, since this can take a while: https://github.com/MichaIng/DietPi/issues/5209 --- dietpi/dietpi-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 4c8a17cd5c..65e9af3199 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -176,7 +176,7 @@ _EOF_ # Generate Exclude/Include lists Create_Filter_Include_Exclude - # Check for sufficient free space + G_DIETPI-NOTIFY 2 'Checking for sufficient disk space via rsync dry-run, please wait...' local old_backup_size=$(du -sB1 "$FP_TARGET/data" | mawk '{print $1}') # Actual disk usage in bytes # - Dry run to obtain transferred data size rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET/data/" > .dietpi-backup_result From 5d07ab07c449f7bb08c3bb574708818e4393c93d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 26 Jan 2022 20:27:59 +0100 Subject: [PATCH 39/67] v8.1 - DietPi-Build | Move script to new .build directory in repo - DietPi-Build | Add support for Odroid N2 - DietPi-PREP | Bootstrap RPi archive keyring and add support for Odroid N2 with modern single partition image --- .build/images/U-Boot/99-dietpi-uboot | 5 ++ .build/images/U-Boot/boot.cmd | 79 +++++++++++++++++++ .build/images/U-Boot/dietpi-initramfs_cleanup | 24 ++++++ .build/images/U-Boot/dietpiEnv.txt | 12 +++ {.meta => .build/images}/dietpi-build | 9 ++- PREP_SYSTEM_FOR_DIETPI.sh | 75 +++++++++++++++--- 6 files changed, 189 insertions(+), 15 deletions(-) create mode 100644 .build/images/U-Boot/99-dietpi-uboot create mode 100644 .build/images/U-Boot/boot.cmd create mode 100644 .build/images/U-Boot/dietpi-initramfs_cleanup create mode 100644 .build/images/U-Boot/dietpiEnv.txt rename {.meta => .build/images}/dietpi-build (98%) diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot new file mode 100644 index 0000000000..d25e568e59 --- /dev/null +++ b/.build/images/U-Boot/99-dietpi-uboot @@ -0,0 +1,5 @@ +#!/bin/dash +echo 'update-initramfs: Converting to U-Boot format' >&2 +mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d $2 /boot/uInitrd-$1 > /dev/null +ln -sf uInitrd-$1 /boot/uInitrd > /dev/null 2>&1 +exit 0 diff --git a/.build/images/U-Boot/boot.cmd b/.build/images/U-Boot/boot.cmd new file mode 100644 index 0000000000..d394dfc374 --- /dev/null +++ b/.build/images/U-Boot/boot.cmd @@ -0,0 +1,79 @@ +# DO NOT EDIT THIS FILE +# +# Please edit /boot/dietpiEnv.txt to set supported parameters +# +# If you must edit this file, recompile with: +# mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr + +# Default values +setenv rootdev "/dev/mmcblk0p1" +setenv rootfstype "ext4" +setenv consoleargs "console=tty1" +setenv verbosity "4" +setenv docker_optimizations "off" +setenv overlay_path "amlogic" +setenv overlay_prefix "meson" + +# Load addresses +setenv load_addr "0x32000000" +setenv kernel_addr_r "0x34000000" +setenv fdt_addr_r "0x4080000" +setenv overlay_error "false" + +# Load dietpiEnv.txt +if test -e ${devtype} ${devnum} ${prefix}dietpiEnv.txt; then + load ${devtype} ${devnum} ${load_addr} ${prefix}dietpiEnv.txt + env import -t ${load_addr} ${filesize} +fi + +# Get PARTUUID of first partition on SD/eMMC it was loaded from +# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from +if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi + +# Define kernel command-line arguments +setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} loglevel=${verbosity} consoleblank=0 coherent_pool=2M ubootpart=${partuuid} libata.force=noncq usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}" + +# Add bootargs for Docker +if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi + +# Load kernel, initramfs and device tree +load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image +load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd +load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} +fdt addr ${fdt_addr_r} + +# Apply DT overlays +if test -n "${overlays}" || test -n "${user_overlays}"; then + fdt resize 65536 + for overlay_file in ${overlays}; do + if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-${overlay_file}.dtbo; then + echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" + fdt apply ${load_addr} || setenv overlay_error "true" + fi + done + + for overlay_file in ${user_overlays}; do + if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then + echo "Applying user provided DT overlay ${overlay_file}.dtbo" + fdt apply ${load_addr} || setenv overlay_error "true" + fi + done + + if test "${overlay_error}" = "true"; then + echo "Error applying DT overlays, restoring original DT" + load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} + else + if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-fixup.scr; then + echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" + source ${load_addr} + fi + if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then + load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr + echo "Applying user provided fixup script (fixup.scr)" + source ${load_addr} + fi + fi +fi + +# Boot +booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} diff --git a/.build/images/U-Boot/dietpi-initramfs_cleanup b/.build/images/U-Boot/dietpi-initramfs_cleanup new file mode 100644 index 0000000000..dd88850459 --- /dev/null +++ b/.build/images/U-Boot/dietpi-initramfs_cleanup @@ -0,0 +1,24 @@ +#!/bin/dash + +# Skip if initramfs-tools is not installed +[ -x '/usr/sbin/update-initramfs' ] || exit 0 + +# Passing the kernel version is required +version="$1" +if [ -z "$version" ] +then + echo "W: initramfs-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number" >&2 + exit 0 +fi + +# Avoid running multiple times +if [ "$DEB_MAINT_PARAMS" ] +then + eval set -- "$DEB_MAINT_PARAMS" + [ "$1" == 'upgrade' ] || exit 0 +fi + +# Delete unused initrd images +find /boot -name 'initrd.img-*' -o -name 'uInitrd-*' ! -name "*-$version" -printf 'Removing obsolete file %f\n' -delete + +exit 0 diff --git a/.build/images/U-Boot/dietpiEnv.txt b/.build/images/U-Boot/dietpiEnv.txt new file mode 100644 index 0000000000..5c4702d680 --- /dev/null +++ b/.build/images/U-Boot/dietpiEnv.txt @@ -0,0 +1,12 @@ +rootdev=UUID=3ccf3790-5e80-44b9-83be-17e3b21083d9 +rootfstype=ext4 +# The init system logs to the console defined last. +consoleargs=console=ttyAML0,115200 console=tty1 +verbosity=4 +usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u +extraargs=net.ifnames=0 +docker_optimizations=off +overlay_path=amlogic +overlay_prefix=meson +overlays= +user_overlays= diff --git a/.meta/dietpi-build b/.build/images/dietpi-build similarity index 98% rename from .meta/dietpi-build rename to .build/images/dietpi-build index 6076fc4313..641c23b342 100644 --- a/.meta/dietpi-build +++ b/.build/images/dietpi-build @@ -19,11 +19,12 @@ G_EXIT_CUSTOM(){ # Inputs HW_MODEL= HW_ARCH= -DISTRO=6 # 6=Bulleye, 7=Bookworm +DISTRO=6 # 6=Bullseye, 7=Bookworm PTTYPE='msdos' FSTYPE='ext4' ITYPE= VMTYPE= +GITBRANCH='master' while (( $# )) do case $1 in @@ -34,6 +35,7 @@ do '-f') shift; FSTYPE=$1;; '-i') ITYPE='Installer';; '-v') shift; VMTYPE=$1;; + '-b') shift; GITBRANCH=$1;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -48,6 +50,7 @@ root_size=1023 CLONING_TOOL='dd' case $HW_MODEL in 0) iname='RPi' partition_start=4 boot_size=128 root_size=892;; + 15) iname='OdroidN2' partition_start=4 root_size=768;; 20) iname='VM' WIFI_REQUIRED=0 VMTYPE=${VMTYPE:-raw};; 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1215;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; @@ -91,6 +94,8 @@ case $FSTYPE in *) G_DIETPI-NOTIFY 1 "Invalid filesystem type \"$FSTYPE\" passed, aborting..."; exit 1;; esac +G_CHECK_URL "https://github.com/MichaIng/DietPi/tree/$GITBRANCH" || { G_DIETPI-NOTIFY 1 "Failed to access Git branch \"$GITBRANCH\", aborting..."; exit 1; } + # Image name OUTPUT_IMG_NAME="DietPi_$iname-$iarch-${distro^}" [[ $ITYPE ]] && OUTPUT_IMG_NAME+="_$ITYPE" @@ -202,7 +207,7 @@ cat << _EOF_ > rootfs/etc/rc.local #!/bin/dash { echo '[ INFO ] Running DietPi-PREP...' -export GITBRANCH='master' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO='from scratch' WIFI_REQUIRED=$WIFI_REQUIRED DISTRO_TARGET=$DISTRO +export GITBRANCH='$GITBRANCH' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO='from scratch' WIFI_REQUIRED=$WIFI_REQUIRED DISTRO_TARGET=$DISTRO bash -c "\$(curl -sSfL 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/PREP_SYSTEM_FOR_DIETPI.sh')" _EOF_ G_EXEC chmod +x rootfs/etc/rc.local diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a59384f7ab..824a3bd01a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -608,6 +608,14 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then # (Re)create DietPi runtime and logs dir, used by G_AGx G_EXEC mkdir -p /run/dietpi /var/tmp/dietpi/logs + # RPi: Bootstrap repo when key is missing + if [[ $G_HW_MODEL -le 9 && ! $(apt-key list 'CF8A1AF502A2AA2D763BAE7E82B129927FA3303E' 2> /dev/null) ]] + then + G_EXEC curl -sSfLO 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' + G_AGI dpkg -i raspberrypi-archive-keyring_2016.10.31_all.deb + G_EXEC rm raspberrypi-archive-keyring_2016.10.31_all.deb + fi + G_AGUP # @MichaIng https://github.com/MichaIng/DietPi/pull/1266/files @@ -797,6 +805,36 @@ _EOF_ [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' # - G_HW_MODEL specific required firmware/kernel/bootloader packages + # Odroid N2: Modern single partition image + elif [[ $G_HW_MODEL == 15 && $(findmnt -Ufnro TARGET -T /boot) == '/' ]] + then + # Bootstrap Armbian repository + G_EXEC eval "curl -sSfL 'https://apt.armbian.com/armbian.key' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes" + # Remove obsolete combined keyring + [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg + [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + # Exclude doubled device tree files, shipped with the kernel package + G_EXEC eval "echo 'path-exclude /usr/lib/linux-image-current-*' > /etc/dpkg/dpkg.cfg.d/01-dietpi-exclude_doubled_devicetrees" + # Remove obsolete lists and doubled device tree files, shipped with the kernel package + G_EXEC rm -Rf /etc/apt/sources.list.d/* /usr/lib/linux-image-current-* + # Add Armbian repository + G_EXEC eval "echo 'deb http://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/dietpi-armbian.list" + # Update APT lists + G_AGUP + # Install kernel, device tree, U-Boot and firmware packages + G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware + # Flash U-Boot + . /usr/lib/u-boot/platform_install.sh + write_uboot_platform "$DIR" "$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -M /)")" + # Install kernel, initramfs and boot config files + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/boot.cmd" -o /boot/boot.cmd + G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/dietpiEnv.txt" -o /boot/dietpiEnv.txt + G_EXEC mkdir -p /etc/kernel/preinst.d /etc/initramfs/post-update.d + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/dietpi-initramfs_cleanup" -o /etc/kernel/preinst.d/dietpi-initramfs_cleanup + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" -o /etc/initramfs/post-update.d/99-dietpi-uboot + G_EXEC chmod +x /etc/kernel/preinst.d/dietpi-initramfs_cleanup /etc/initramfs/post-update.d/99-dietpi-uboot + # Armbian grab currently installed packages elif [[ $(dpkg-query -Wf '${Package} ') == *'armbian'* ]]; then @@ -887,6 +925,13 @@ _EOF_ fi G_EXEC chmod +x /etc/kernel/preinst.d/dietpi-initramfs_cleanup + # Add Armbian repo key as dedicated file + G_EXEC eval "curl -sSfL 'https://apt.armbian.com/armbian.key' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes" + + # Remove obsolete combined keyring + [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg + [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + # Remove obsolete components from Armbian list and connect via HTTPS G_EXEC eval "echo 'deb http://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/armbian.list" @@ -1008,7 +1053,7 @@ _EOF_ G_EXEC apt-get clean # Remove downloaded archives # - Firmware - if dpkg-query -Wf '${Package}\n' | grep -q '^armbian-firmware'; then + if dpkg-query -s 'armbian-firmware' &> /dev/null; then aPACKAGES_REQUIRED_INSTALL+=('armbian-firmware') @@ -1577,8 +1622,8 @@ _EOF_ fi G_DIETPI-NOTIFY 2 'Applying board-specific tweaks:' - if (( $G_HW_MODEL != 20 )); then - + if (( $G_HW_MODEL != 20 )) + then G_EXEC_DESC='Configuring hdparm' # Since Debian Bullseye, spindown_time is not applied if APM is not supported by the drive. force_spindown_time is required to override that. local spindown='spindown_time' @@ -1588,21 +1633,26 @@ apm = 127 $spindown = 120 _EOF_" unset -v spindown - fi - # - Sparky SBC - if (( $G_HW_MODEL == 70 )); then + # - Odroid N2: Modern single partition image + if [[ $G_HW_MODEL == 15 && -f '/boot/dietpiEnv.txt' ]] + then + G_CONFIG_INJECT 'rootdev=' 'rootdev=UUID=$(findmnt -Ufnro UUID -M /)' /boot/dietpiEnv.txt + G_CONFIG_INJECT 'rootfstype=' 'rootfstype=$(findmnt -Ufnro FSTYPE -M /)' /boot/dietpiEnv.txt + # - Sparky SBC + if (( $G_HW_MODEL == 70 )) + then # Install latest kernel/drivers - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -o /boot/uImage - G_EXEC curl -sSfLO https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 + G_EXEC curl -sSfL 'https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage' -o /boot/uImage + G_EXEC curl -sSfLO 'https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2' G_EXEC tar -xf 3.10.38.bz2 -C /lib/modules/ G_EXEC rm 3.10.38.bz2 # - USB audio update - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dsd-marantz/snd-usb-audio.ko -o /lib/modules/3.10.38/kernel/sound/usb/snd-usb-audio.ko + G_EXEC curl -sSfL 'https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dsd-marantz/snd-usb-audio.ko' -o /lib/modules/3.10.38/kernel/sound/usb/snd-usb-audio.ko # - Ethernet update - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/sparky-eth/ethernet.ko -o /lib/modules/3.10.38/kernel/drivers/net/ethernet/acts/ethernet.ko + G_EXEC curl -sSfL 'https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/sparky-eth/ethernet.ko' -o /lib/modules/3.10.38/kernel/drivers/net/ethernet/acts/ethernet.ko # Boot args cat << '_EOF_' > /boot/uenv.txt @@ -1778,8 +1828,8 @@ _EOF_ fi # - Armbian special - if [[ -f '/boot/armbianEnv.txt' ]]; then - + if [[ -f '/boot/armbianEnv.txt' ]] + then # Disable bootsplash logo, as we removed the file above: https://github.com/MichaIng/DietPi/issues/3932#issuecomment-852376681 G_CONFIG_INJECT 'bootlogo=' 'bootlogo=false' /boot/armbianEnv.txt @@ -1788,7 +1838,6 @@ _EOF_ # Disable Docker optimisations, since this has some performance drawbacks, enable on Docker install instead G_CONFIG_INJECT 'docker_optimizations=' 'docker_optimizations=off' /boot/armbianEnv.txt - fi # Apply cgroups-v2 workaround on Bullseye if the kernel does not support it: https://github.com/MichaIng/DietPi/issues/4705 From bc9164a6cc3db33667458b9afa643f37b9f0e09d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 26 Jan 2022 20:31:10 +0100 Subject: [PATCH 40/67] v8.1 - Satisfy shellcheck --- .build/images/U-Boot/99-dietpi-uboot | 4 ++-- .build/images/U-Boot/dietpi-initramfs_cleanup | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot index d25e568e59..d1b487926e 100644 --- a/.build/images/U-Boot/99-dietpi-uboot +++ b/.build/images/U-Boot/99-dietpi-uboot @@ -1,5 +1,5 @@ #!/bin/dash echo 'update-initramfs: Converting to U-Boot format' >&2 -mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d $2 /boot/uInitrd-$1 > /dev/null -ln -sf uInitrd-$1 /boot/uInitrd > /dev/null 2>&1 +mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d "$2" "/boot/uInitrd-$1" > /dev/null +ln -sf "uInitrd-$1" /boot/uInitrd > /dev/null 2>&1 exit 0 diff --git a/.build/images/U-Boot/dietpi-initramfs_cleanup b/.build/images/U-Boot/dietpi-initramfs_cleanup index dd88850459..a4b37c5307 100644 --- a/.build/images/U-Boot/dietpi-initramfs_cleanup +++ b/.build/images/U-Boot/dietpi-initramfs_cleanup @@ -15,7 +15,7 @@ fi if [ "$DEB_MAINT_PARAMS" ] then eval set -- "$DEB_MAINT_PARAMS" - [ "$1" == 'upgrade' ] || exit 0 + [ "$1" = 'upgrade' ] || exit 0 fi # Delete unused initrd images diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 824a3bd01a..f64a2e2005 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -869,8 +869,8 @@ _EOF_ cat << _EOF_ > /etc/initramfs/post-update.d/99-dietpi-uboot #!/bin/dash echo 'update-initramfs: Converting to U-Boot format' >&2 -mkimage -A $arch -O linux -T ramdisk -C gzip -n uInitrd -d \$2 /boot/uInitrd-\$1 > /dev/null -ln -sf uInitrd-\$1 /boot/uInitrd > /dev/null 2>&1 || mv /boot/uInitrd-\$1 /boot/uInitrd +mkimage -A $arch -O linux -T ramdisk -C gzip -n uInitrd -d "\$2" "/boot/uInitrd-\$1" > /dev/null +ln -sf "uInitrd-\$1" /boot/uInitrd > /dev/null 2>&1 || mv "/boot/uInitrd-\$1" /boot/uInitrd exit 0 _EOF_ G_EXEC chmod +x /etc/initramfs/post-update.d/99-dietpi-uboot From 0b32ce791bdce9e693900c8c91f7c4ee3a40dda8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 26 Jan 2022 23:17:05 +0100 Subject: [PATCH 41/67] v8.1 - General | Add execute bit to all scripts and files which are aimed to be executed, which makes assigning it on dietpi-update obsolete --- .build/images/U-Boot/99-dietpi-uboot | 0 .build/images/U-Boot/dietpi-initramfs_cleanup | 0 .build/images/dietpi-build | 0 .conf/desktop/apps/dietpi-backup.desktop | 0 .conf/desktop/apps/dietpi-bugreport.desktop | 0 .conf/desktop/apps/dietpi-cleaner.desktop | 0 .conf/desktop/apps/dietpi-config.desktop | 0 .conf/desktop/apps/dietpi-cron.desktop | 0 .conf/desktop/apps/dietpi-drive_manager.desktop | 0 .conf/desktop/apps/dietpi-justboom.desktop | 0 .conf/desktop/apps/dietpi-launcher.desktop | 0 .conf/desktop/apps/dietpi-services.desktop | 0 .conf/desktop/apps/dietpi-software.desktop | 0 .conf/desktop/apps/dietpi-sync.desktop | 0 .conf/desktop/apps/dietpi-update.desktop | 0 .conf/desktop/apps/es2_gears.desktop | 0 .conf/desktop/apps/es2_info.desktop | 0 .conf/desktop/apps/glx_gears.desktop | 0 .conf/desktop/apps/glx_info.desktop | 0 .conf/desktop/apps/kodi.desktop | 0 .conf/desktop/apps/opentyrian.desktop | 0 .meta/dietpi-cloud-migration | 0 .meta/dietpi-fan_control | 0 .meta/dietpi-survey_report | 0 .update/patches | 0 .update/pre-patches | 0 PREP_SYSTEM_FOR_DIETPI.sh | 0 dietpi/dietpi-autostart | 0 dietpi/dietpi-backup | 0 dietpi/dietpi-bugreport | 0 dietpi/dietpi-cleaner | 0 dietpi/dietpi-cloudshell | 0 dietpi/dietpi-config | 0 dietpi/dietpi-cpuinfo | 0 dietpi/dietpi-cron | 0 dietpi/dietpi-ddns | 0 dietpi/dietpi-drive_manager | 0 dietpi/dietpi-explorer | 0 dietpi/dietpi-launcher | 0 dietpi/dietpi-led_control | 0 dietpi/dietpi-letsencrypt | 0 dietpi/dietpi-login | 0 dietpi/dietpi-morsecode | 0 dietpi/dietpi-services | 0 dietpi/dietpi-software | 0 dietpi/dietpi-survey | 0 dietpi/dietpi-sync | 0 dietpi/dietpi-update | 1 - dietpi/dietpi-vpn | 0 dietpi/func/change_hostname | 0 dietpi/func/create_mysql_db | 0 dietpi/func/dietpi-banner | 0 dietpi/func/dietpi-benchmark | 0 dietpi/func/dietpi-globals | 0 dietpi/func/dietpi-logclear | 0 dietpi/func/dietpi-obtain_hw_model | 0 dietpi/func/dietpi-optimal_mtu | 0 dietpi/func/dietpi-print_large | 0 dietpi/func/dietpi-ramlog | 0 dietpi/func/dietpi-set_cpu | 0 dietpi/func/dietpi-set_hardware | 0 dietpi/func/dietpi-set_software | 0 dietpi/func/dietpi-set_swapfile | 0 dietpi/func/dietpi-set_userdata | 0 dietpi/func/dietpi-wifidb | 0 dietpi/func/run_ntpd | 0 dietpi/misc/dietpi-arr_to_RAM | 0 dietpi/misc/dietpi-justboom | 0 dietpi/misc/start_kodi | 0 dietpi/patch_file | 0 dietpi/postboot | 0 dietpi/pre-patch_file | 0 dietpi/preboot | 0 rootfs/etc/cron.daily/dietpi | 0 rootfs/etc/cron.hourly/dietpi | 0 rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh | 0 rootfs/var/lib/dietpi/services/fs_partition_resize.sh | 0 77 files changed, 1 deletion(-) mode change 100644 => 100755 .build/images/U-Boot/99-dietpi-uboot mode change 100644 => 100755 .build/images/U-Boot/dietpi-initramfs_cleanup mode change 100644 => 100755 .build/images/dietpi-build mode change 100644 => 100755 .conf/desktop/apps/dietpi-backup.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-bugreport.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-cleaner.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-config.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-cron.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-drive_manager.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-justboom.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-launcher.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-services.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-software.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-sync.desktop mode change 100644 => 100755 .conf/desktop/apps/dietpi-update.desktop mode change 100644 => 100755 .conf/desktop/apps/es2_gears.desktop mode change 100644 => 100755 .conf/desktop/apps/es2_info.desktop mode change 100644 => 100755 .conf/desktop/apps/glx_gears.desktop mode change 100644 => 100755 .conf/desktop/apps/glx_info.desktop mode change 100644 => 100755 .conf/desktop/apps/kodi.desktop mode change 100644 => 100755 .conf/desktop/apps/opentyrian.desktop mode change 100644 => 100755 .meta/dietpi-cloud-migration mode change 100644 => 100755 .meta/dietpi-fan_control mode change 100644 => 100755 .meta/dietpi-survey_report mode change 100644 => 100755 .update/patches mode change 100644 => 100755 .update/pre-patches mode change 100644 => 100755 PREP_SYSTEM_FOR_DIETPI.sh mode change 100644 => 100755 dietpi/dietpi-autostart mode change 100644 => 100755 dietpi/dietpi-backup mode change 100644 => 100755 dietpi/dietpi-bugreport mode change 100644 => 100755 dietpi/dietpi-cleaner mode change 100644 => 100755 dietpi/dietpi-cloudshell mode change 100644 => 100755 dietpi/dietpi-config mode change 100644 => 100755 dietpi/dietpi-cpuinfo mode change 100644 => 100755 dietpi/dietpi-cron mode change 100644 => 100755 dietpi/dietpi-ddns mode change 100644 => 100755 dietpi/dietpi-drive_manager mode change 100644 => 100755 dietpi/dietpi-explorer mode change 100644 => 100755 dietpi/dietpi-launcher mode change 100644 => 100755 dietpi/dietpi-led_control mode change 100644 => 100755 dietpi/dietpi-letsencrypt mode change 100644 => 100755 dietpi/dietpi-login mode change 100644 => 100755 dietpi/dietpi-morsecode mode change 100644 => 100755 dietpi/dietpi-services mode change 100644 => 100755 dietpi/dietpi-software mode change 100644 => 100755 dietpi/dietpi-survey mode change 100644 => 100755 dietpi/dietpi-sync mode change 100644 => 100755 dietpi/dietpi-update mode change 100644 => 100755 dietpi/dietpi-vpn mode change 100644 => 100755 dietpi/func/change_hostname mode change 100644 => 100755 dietpi/func/create_mysql_db mode change 100644 => 100755 dietpi/func/dietpi-banner mode change 100644 => 100755 dietpi/func/dietpi-benchmark mode change 100644 => 100755 dietpi/func/dietpi-globals mode change 100644 => 100755 dietpi/func/dietpi-logclear mode change 100644 => 100755 dietpi/func/dietpi-obtain_hw_model mode change 100644 => 100755 dietpi/func/dietpi-optimal_mtu mode change 100644 => 100755 dietpi/func/dietpi-print_large mode change 100644 => 100755 dietpi/func/dietpi-ramlog mode change 100644 => 100755 dietpi/func/dietpi-set_cpu mode change 100644 => 100755 dietpi/func/dietpi-set_hardware mode change 100644 => 100755 dietpi/func/dietpi-set_software mode change 100644 => 100755 dietpi/func/dietpi-set_swapfile mode change 100644 => 100755 dietpi/func/dietpi-set_userdata mode change 100644 => 100755 dietpi/func/dietpi-wifidb mode change 100644 => 100755 dietpi/func/run_ntpd mode change 100644 => 100755 dietpi/misc/dietpi-arr_to_RAM mode change 100644 => 100755 dietpi/misc/dietpi-justboom mode change 100644 => 100755 dietpi/misc/start_kodi mode change 100644 => 100755 dietpi/patch_file mode change 100644 => 100755 dietpi/postboot mode change 100644 => 100755 dietpi/pre-patch_file mode change 100644 => 100755 dietpi/preboot mode change 100644 => 100755 rootfs/etc/cron.daily/dietpi mode change 100644 => 100755 rootfs/etc/cron.hourly/dietpi mode change 100644 => 100755 rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh mode change 100644 => 100755 rootfs/var/lib/dietpi/services/fs_partition_resize.sh diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot old mode 100644 new mode 100755 diff --git a/.build/images/U-Boot/dietpi-initramfs_cleanup b/.build/images/U-Boot/dietpi-initramfs_cleanup old mode 100644 new mode 100755 diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-backup.desktop b/.conf/desktop/apps/dietpi-backup.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-bugreport.desktop b/.conf/desktop/apps/dietpi-bugreport.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-cleaner.desktop b/.conf/desktop/apps/dietpi-cleaner.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-config.desktop b/.conf/desktop/apps/dietpi-config.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-cron.desktop b/.conf/desktop/apps/dietpi-cron.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-drive_manager.desktop b/.conf/desktop/apps/dietpi-drive_manager.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-justboom.desktop b/.conf/desktop/apps/dietpi-justboom.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-launcher.desktop b/.conf/desktop/apps/dietpi-launcher.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-services.desktop b/.conf/desktop/apps/dietpi-services.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-software.desktop b/.conf/desktop/apps/dietpi-software.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-sync.desktop b/.conf/desktop/apps/dietpi-sync.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/dietpi-update.desktop b/.conf/desktop/apps/dietpi-update.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/es2_gears.desktop b/.conf/desktop/apps/es2_gears.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/es2_info.desktop b/.conf/desktop/apps/es2_info.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/glx_gears.desktop b/.conf/desktop/apps/glx_gears.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/glx_info.desktop b/.conf/desktop/apps/glx_info.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/kodi.desktop b/.conf/desktop/apps/kodi.desktop old mode 100644 new mode 100755 diff --git a/.conf/desktop/apps/opentyrian.desktop b/.conf/desktop/apps/opentyrian.desktop old mode 100644 new mode 100755 diff --git a/.meta/dietpi-cloud-migration b/.meta/dietpi-cloud-migration old mode 100644 new mode 100755 diff --git a/.meta/dietpi-fan_control b/.meta/dietpi-fan_control old mode 100644 new mode 100755 diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report old mode 100644 new mode 100755 diff --git a/.update/patches b/.update/patches old mode 100644 new mode 100755 diff --git a/.update/pre-patches b/.update/pre-patches old mode 100644 new mode 100755 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-cron b/dietpi/dietpi-cron old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-ddns b/dietpi/dietpi-ddns old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-explorer b/dietpi/dietpi-explorer old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-launcher b/dietpi/dietpi-launcher old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync old mode 100644 new mode 100755 diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update old mode 100644 new mode 100755 index 4579075853..120650cf78 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -312,7 +312,6 @@ G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/dietpi" /boot/ G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/rootfs/." / - G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi "DietPi-$GITBRANCH_TARGET/.update/patches" # Save version + Git info now for sub scripts to pull from correct branch G_GITOWNER=$GITOWNER_TARGET diff --git a/dietpi/dietpi-vpn b/dietpi/dietpi-vpn old mode 100644 new mode 100755 diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname old mode 100644 new mode 100755 diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-logclear b/dietpi/func/dietpi-logclear old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-optimal_mtu b/dietpi/func/dietpi-optimal_mtu old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-print_large b/dietpi/func/dietpi-print_large old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-ramlog b/dietpi/func/dietpi-ramlog old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-set_cpu b/dietpi/func/dietpi-set_cpu old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-set_swapfile b/dietpi/func/dietpi-set_swapfile old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata old mode 100644 new mode 100755 diff --git a/dietpi/func/dietpi-wifidb b/dietpi/func/dietpi-wifidb old mode 100644 new mode 100755 diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd old mode 100644 new mode 100755 diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM old mode 100644 new mode 100755 diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom old mode 100644 new mode 100755 diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi old mode 100644 new mode 100755 diff --git a/dietpi/patch_file b/dietpi/patch_file old mode 100644 new mode 100755 diff --git a/dietpi/postboot b/dietpi/postboot old mode 100644 new mode 100755 diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file old mode 100644 new mode 100755 diff --git a/dietpi/preboot b/dietpi/preboot old mode 100644 new mode 100755 diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi old mode 100644 new mode 100755 diff --git a/rootfs/etc/cron.hourly/dietpi b/rootfs/etc/cron.hourly/dietpi old mode 100644 new mode 100755 diff --git a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh old mode 100644 new mode 100755 diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh old mode 100644 new mode 100755 From 41b37641b79a0e4d2271178f7dfbdab1bb9346e2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 27 Jan 2022 00:33:37 +0100 Subject: [PATCH 42/67] v8.1 - DietPi-Update | Preserve modes when installing files, now that the tarball contains required execute bits and we do not set it anymore --- dietpi/dietpi-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 120650cf78..e6be64dca9 100755 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -310,8 +310,8 @@ # Remove files from Git archive that are not to be installed on client rm "DietPi-$GITBRANCH_TARGET/dietpi/"{pre-patch_file,server_version-6} - G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/dietpi" /boot/ - G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/rootfs/." / + G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -a "DietPi-$GITBRANCH_TARGET/dietpi" /boot/ + G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -a "DietPi-$GITBRANCH_TARGET/rootfs/." / # Save version + Git info now for sub scripts to pull from correct branch G_GITOWNER=$GITOWNER_TARGET From 51d3fed21639e15e70870beadf00594dbd6a1465 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 27 Jan 2022 01:24:32 +0100 Subject: [PATCH 43/67] v8.1 - DietPi-Software | Desktops: Do not apply execute permissions to *.desktop entries anymore, which is not required, tested on MATE Buster, Bullseye and Bookworm - DietPi-Software | Remove only uses of no_check_url=1, which recently only applies when DEPS_LIST has dependencies assigned and download hence starts in background. In this case a download failure wouldn't terminate the script, hence it makes sense to keep checking the URL first. In the two cases where no_check_url=1 was used, DEPS_LIST however is empty. Finally we need to handle G_THREAD errors like G_EXEC errors, show an error prompt and in case exit. --- dietpi/dietpi-software | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 86a4f5da44..4b3e68629a 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2298,7 +2298,7 @@ fi [ -d ~/.config/autostart ] || mkdir -p ~/.config/autostart echo '[Desktop Entry]\nHidden=true' > ~/.config/autostart/dietpi-desktop_setup.desktop _EOF_ - + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh cat << '_EOF_' > /etc/xdg/autostart/dietpi-desktop_setup.desktop [Desktop Entry] Version=1.0 @@ -2309,10 +2309,6 @@ NoDisplay=true Exec=/var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png _EOF_ - - # Add execute permissions to prevent "untrusted" prompt in MATE and possibly other desktops - G_EXEC chmod +x /usr/share/applications/*.desktop /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh - G_THREAD_WAIT } @@ -2440,7 +2436,6 @@ _EOF_ # dps_index=$software_id Download_Install 'conf_0' /etc/conf.conf # Optional input variables: # fallback_url='http...' = URL to use if e.g. grabbing URL from api.github.com fails: https://dietpi.com/phpbb/viewtopic.php?p=17390#p17390 - # no_check_url=[01] = Optionally disable URL check # dps_index=$software_id = Download from DietPi GitHub repo based on software ID/index # DEPS_LIST='pkg1 ...' = Install APT dependency packages # NB: This does not support installs that require user input (e.g.: a whiptail prompt for deb installs) @@ -2476,8 +2471,9 @@ _EOF_ # Download file if [[ $DEPS_LIST ]] then + # Check URL before starting background download, as a failure does not terminate the install # shellcheck disable=SC2154 - (( $no_check_url )) || G_CHECK_URL "$url" + G_CHECK_URL "$url" # Download as background thread if dependencies are to be installed G_THREAD_START curl -sSfL "$url" -o "$file" @@ -2489,7 +2485,7 @@ _EOF_ G_EXEC curl -sSfL "$url" -o "$file" fi - unset -v fallback_url dps_index no_check_url + unset -v fallback_url dps_index # Process downloaded file if [[ $type == 'deb' ]]; then @@ -3486,7 +3482,7 @@ _EOF_ elif [[ $version == 'Nightly' ]] then - no_check_url=1 Download_Install "https://nightly.link/ravenclaw900/DietPi-Dashboard/workflows/push-build/main/dietpi-dashboard-$G_HW_ARCH_NAME$backend.zip" /opt/dietpi-dashboard + Download_Install "https://nightly.link/ravenclaw900/DietPi-Dashboard/workflows/push-build/main/dietpi-dashboard-$G_HW_ARCH_NAME$backend.zip" /opt/dietpi-dashboard url='https://raw.githubusercontent.com/ravenclaw900/DietPi-Dashboard/main/config.toml' fi G_EXEC chmod +x /opt/dietpi-dashboard/dietpi-dashboard @@ -7333,7 +7329,7 @@ _EOF_ debconf-set-selections <<< 'networkaudiod networkaudiod/license note false' # Install - no_check_url=1 Download_Install "$url$package" + Download_Install "$url$package" G_EXEC systemctl stop networkaudiod unset -v url arch package From bca964e31743590f33f81fa7826dfb074df0e925 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 27 Jan 2022 22:31:39 +0100 Subject: [PATCH 44/67] v8.1 - DietPi-LetsEncrypt | Add ServerName directory to 000-default.conf since Certbot fails to add rewrites when there is no actual directive in this vhost, which is the default now with DietPi-Software's Apache installation. Also this way the local IP address as ServerName in conf-available/dietpi.conf is overwritten by the actual domain. --- dietpi/dietpi-letsencrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 969263bc3d..150c73674e 100755 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -55,7 +55,7 @@ G_DIETPI-NOTIFY 0 'Apache webserver detected' # Add ServerName if it doesn't exist. This is required to prevent Certbot complaining about vhost with no domain and mutes a warning on Apache start about a missing global server name. - G_CONFIG_INJECT 'ServerName[[:blank:]]' "ServerName $primary_domain" /etc/apache2/apache2.conf '^[[:blank:]]*[^#]' + G_CONFIG_INJECT 'ServerName[[:blank:]]' " ServerName $primary_domain" /etc/apache2/sites-available/000-default.conf '^[[:blank:]]*<' # Restart Apache to apply ServerName change G_EXEC systemctl restart apache2 From 8f606c496a37473ce147b37195a4776180c0eff3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 27 Jan 2022 22:43:43 +0100 Subject: [PATCH 45/67] v8.1 - CHANGELOG | DietPi-LetsEncrypt: Resolved an issue where Certbot failed on fresh Apache installs since the 000-default.conf vhost by default does not contain any directive anymore. Certbot then fails to add the HTTPS redirects. The ServerName directive with the entered domain name is now added to 000-default.conf instead of apache2.conf, where it also overrides the global ServerName directive in dietpi.conf, which sets local IP address. --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 16ee0f6300..797bb5154b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes: Fixes: - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 +- DietPi-LetsEncrypt | Resolved an issue where Certbot failed on fresh Apache installs since the 000-default.conf vhost by default does not contain any directive anymore. The ServerName directive with the entered domain name is now added to 000-default.conf instead of apache2.conf, with the benefit that it overrides the global ServerName directive in dietpi.conf, which uses the local IP address only. - DietPi-Software/DietPi-AutoStart | Chromium: Resolved an issue where the Chromium kiosk autostart option failed on all non-RPi systems. - DietPi-Software | FuguHub: Resolved an issue where the uninstall failed as the service was not stopped and removed as expected, before attempting to remove the service user. - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 From c4ffb6759d3f039bfda0b41bae9e1b8384b0dac7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 27 Jan 2022 23:53:15 +0100 Subject: [PATCH 46/67] v8.1 - DietPi-Software | Apache2: Add ServerName directive to default vhost as well. It is applied there by dietpi-letsencrypt as well with the domain name, hence we are consistent then with HTTP and HTTPS. Also Certbot copies the previous comment into the HTTPS port 443 vhost, where it is misleading. --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4b3e68629a..716a124b26 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3656,7 +3656,7 @@ _EOF_ cat << '_EOF_' > /etc/apache2/sites-available/000-default.conf # /etc/apache2/sites-available/000-default.conf - # Define directives here which shall apply for port 80 requests only + ServerName $(G_GET_NET ip) _EOF_ # Otherwise assure that the webroot is changed, as all our install options depend on it. From ff9e6bdbce93fd59c6117e23403bfe2fa6b379b5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 00:35:40 +0100 Subject: [PATCH 47/67] v8.1 - DietPi-Globals | Remove execute bit from script, which is not meant to be executed but meant to be sourced only - DietPi-PREP | Align DietPi code install with DietPi-Update --- PREP_SYSTEM_FOR_DIETPI.sh | 5 ++--- dietpi/func/dietpi-globals | 0 2 files changed, 2 insertions(+), 3 deletions(-) mode change 100755 => 100644 dietpi/func/dietpi-globals diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index f64a2e2005..ad1819f6b1 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -562,10 +562,9 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then rm "DietPi-$G_GITBRANCH/dietpi/pre-patch_file" rm "DietPi-$G_GITBRANCH/dietpi/patch_file" - G_EXEC_DESC='Copy DietPi scripts to /boot/dietpi' G_EXEC cp -Rf "DietPi-$G_GITBRANCH/dietpi" /boot/ - G_EXEC_DESC='Copy DietPi system files in place' G_EXEC cp -Rf "DietPi-$G_GITBRANCH/rootfs"/. / + G_EXEC_DESC='Copy DietPi scripts to /boot/dietpi' G_EXEC cp -a "DietPi-$G_GITBRANCH/dietpi" /boot/ + G_EXEC_DESC='Copy DietPi system files in place' G_EXEC cp -a "DietPi-$G_GITBRANCH/rootfs/." / G_EXEC_DESC='Clean download location' G_EXEC rm -R "DietPi-$G_GITBRANCH" - G_EXEC_DESC='Set execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi G_DIETPI-NOTIFY 2 'Storing DietPi version info:' G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$G_GITBRANCH" /boot/dietpi.txt diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals old mode 100755 new mode 100644 From 8305ad5e53cb3538c0049e923171f4d5edfd0362 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 14:24:30 +0100 Subject: [PATCH 48/67] v8.1 - DietPi-Software | PHP: Apply minimum 16 MiB OPcache size, which makes lowering interned stings buffer obsolete. Apply only half of OPcache size as APCu size, which is usually much less used. - DietPi-Software | ownCloud/Nextcloud: Update and cleanup: Remove ancient version support and obsolete setup steps --- .conf/dps_47/nginx.owncloud.conf | 3 +- dietpi/dietpi-software | 70 +++++++------------------------- 2 files changed, 16 insertions(+), 57 deletions(-) diff --git a/.conf/dps_47/nginx.owncloud.conf b/.conf/dps_47/nginx.owncloud.conf index ed13b5ce24..4e631f93d5 100644 --- a/.conf/dps_47/nginx.owncloud.conf +++ b/.conf/dps_47/nginx.owncloud.conf @@ -1,4 +1,4 @@ -# Based on: https://github.com/owncloud/docs/blob/deda107004c35ccfc4927e4aab32a337bc2bb380/modules/admin_manual/examples/installation/nginx/subdirectory-configuration.conf +# Based on: https://github.com/owncloud/docs/blob/deda107/modules/admin_manual/examples/installation/nginx/subdirectory-configuration.conf location ^~ /owncloud { @@ -73,7 +73,6 @@ location ^~ /owncloud { try_files $uri /owncloud/index.php$uri$is_args$args; add_header Cache-Control "max-age=15778463" always; # Add headers to serve security related headers (It is intended to have those duplicated to the ones above) - #add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; add_header X-Content-Type-Options nosniff always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-XSS-Protection "1; mode=block" always; diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 716a124b26..e860f9ebf9 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3985,14 +3985,12 @@ _EOF_ # Cache settings local cache_size=$(( $RAM_PHYS / 30 )) - (( $cache_size < 10 )) && cache_size=10 + (( $cache_size < 16 )) && cache_size=16 # - OPcache G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]=]' "opcache.memory_consumption=$cache_size" $target_php_ini - # Assure that interned_strings_buffer is never larger than half of memory_consumption: https://github.com/MichaIng/DietPi/issues/2293 - (( $(php$PHP_VERSION -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') > $cache_size / 2 )) && G_CONFIG_INJECT 'opcache.interned_strings_buffer[[:blank:]=]' "opcache.interned_strings_buffer=$(( $cache_size / 2 ))" $target_php_ini G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]=]' 'opcache.revalidate_freq=60' $target_php_ini # 1 minute # - APCu - G_CONFIG_INJECT 'apc.shm_size[[:blank:]=]' "apc.shm_size=${cache_size}M" $target_php_ini + G_CONFIG_INJECT 'apc.shm_size[[:blank:]=]' "apc.shm_size=$(( $cache_size / 2 ))M" $target_php_ini G_CONFIG_INJECT 'apc.ttl[[:blank:]=]' 'apc.ttl=259200' $target_php_ini # 3 days # Enable all available PHP modules @@ -4589,7 +4587,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST="php$PHP_VERSION-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions + DEPS_LIST="php$PHP_VERSION-intl" # https://doc.owncloud.com/server/next/admin_manual/installation/manual_installation/manual_installation_prerequisites.html#php-extensions if [[ -f '/var/www/owncloud/occ' ]]; then @@ -4602,7 +4600,7 @@ _EOF_ if [[ -f $datadir/dietpi-owncloud-installation-backup/occ ]]; then G_DIETPI-NOTIFY 2 'ownCloud installation backup found, starting recovery...' - G_EXEC cp -a "$datadir"/dietpi-owncloud-installation-backup/. /var/www/owncloud/ + G_EXEC cp -a "$datadir/dietpi-owncloud-installation-backup/." /var/www/owncloud/ # Correct config.php data directory entry, in case it changed due to server migration: G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/owncloud/config/config.php "'dbtype'" @@ -4616,7 +4614,7 @@ _EOF_ [[ $DEPS_LIST ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI $DEPS_LIST; DEPS_LIST=''; } - G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions + G_DIETPI-NOTIFY 2 'Enabling required PHP modules' # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 local json= [[ $PHP_VERSION == 8* ]] || json='json' @@ -4625,15 +4623,9 @@ _EOF_ echo -e '; ownCloud PHP settings\n; priority=98\napc.enable_cli=1' > /etc/php/$PHP_VERSION/mods-available/dietpi-owncloud.ini G_EXEC phpenmod dietpi-owncloud - # Get version string - local oc_version_major=$(sed -n '/OC_VersionString/{s/^[^0-9]*//;s/\..*$//p;q}' /var/www/owncloud/version.php) - [[ $oc_version_major ]] || oc_version_major=10 - local oc_version_minor=$(sed -n '/OC_VersionString/{s/^[^.]*\.//;s/\..*$//p;q}' /var/www/owncloud/version.php) - [[ $oc_version_minor ]] || oc_version_minor=8 - if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - G_DIETPI-NOTIFY 2 'Apache webserver found, enabling ownCloud specific configuration.' # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#configure-apache-web-server + G_DIETPI-NOTIFY 2 'Apache webserver found, enabling ownCloud specific configuration.' # https://doc.owncloud.com/server/next/admin_manual/installation/manual_installation/manual_installation_apache.html a2enmod rewrite headers env dir mime 1> /dev/null local owncloud_conf='/etc/apache2/sites-available/dietpi-owncloud.conf' if [[ -f $owncloud_conf ]]; then @@ -4689,7 +4681,7 @@ url.redirect += ( elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then - G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling ownCloud specific configuration.' # https://doc.owncloud.org/server/administration_manual/installation/nginx_configuration.html + G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling ownCloud specific configuration.' # https://github.com/owncloud/docs/blob/deda107/modules/admin_manual/examples/installation/nginx/subdirectory-configuration.conf local owncloud_conf='/etc/nginx/sites-dietpi/dietpi-owncloud.conf' if [[ -f $owncloud_conf ]]; then @@ -4699,21 +4691,9 @@ url.redirect += ( fi dps_index=$software_id Download_Install 'nginx.owncloud.conf' $owncloud_conf - # Uncomment HSTS header, if chosen via dietpi-letsencrypt and HTTPS connection test succeeds (incl. self-singed cert => exit code 5) - if [[ -f '/boot/dietpi/.dietpi-letsencrypt' && $(mawk 'NR==4' /boot/dietpi/.dietpi-letsencrypt) == 1 ]]; then - - wget -q --spider --timeout=10 --tries=2 https://localhost &> /dev/null - [[ $? == [05] ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' $owncloud_conf - - fi - - # Disable pretty URLs (front controller) for ownCloud versions lower than 10: - (( $oc_version_major < 10 )) && sed -i 's/^[[:blank:]]*fastcgi_param front_controller_active true;/\t\t#fastcgi_param front_controller_active true;/g' $owncloud_conf - # Cal/CardDAV redirects to ownCloud DAV endpoint if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then - # shellcheck disable=SC2016 echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: location = /.well-known/carddav { return 301 /owncloud/remote.php/dav/; } location = /.well-known/caldav { return 301 /owncloud/remote.php/dav/; }' > /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf @@ -4838,10 +4818,7 @@ The install script will now exit. After applying one of the the above, rerun die GCI_PRESERVE=1 GCI_NEWLINE=1 G_CONFIG_INJECT "'memcache.locking'" "'memcache.locking' => '\\\\OC\\\\Memcache\\\\Redis',\n'redis' => array ('host' => '$redis_sock', 'port' => 0,)," $config_php "'filelocking.enabled'" # Enable ownCloud background cron job: - # - v10.3 comes with new occ system:cron command: https://doc.owncloud.org/server/10.3/admin_manual/release_notes.html#changes-to-background-job-execution - local occ_command='occ system:cron' - (( $oc_version_major < 10 || ( $oc_version_major == 10 && $oc_version_minor < 3 ) )) && occ_command='cron.php' - crontab -u www-data -l 2> /dev/null | grep -q '/var/www/owncloud/.*cron' || ( crontab -u www-data -l 2> /dev/null ; echo "*/15 * * * * php /var/www/owncloud/$occ_command" ) | crontab -u www-data - + crontab -u www-data -l 2> /dev/null | grep -q '/var/www/owncloud/.*cron' || ( crontab -u www-data -l 2> /dev/null ; echo '*/15 * * * * php /var/www/owncloud/occ system:cron' ) | crontab -u www-data - occ background:cron # On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293 @@ -4866,7 +4843,7 @@ The install script will now exit. After applying one of the the above, rerun die if [[ -f $datadir/dietpi-nextcloud-installation-backup/occ ]]; then G_DIETPI-NOTIFY 2 'Nextcloud installation backup found, starting recovery...' - G_EXEC cp -a "$datadir"/dietpi-nextcloud-installation-backup/. /var/www/nextcloud/ + G_EXEC cp -a "$datadir/dietpi-nextcloud-installation-backup/." /var/www/nextcloud/ # Correct config.php data directory entry, in case it changed due to server migration: G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/nextcloud/config/config.php "'dbtype'" @@ -4883,17 +4860,16 @@ The install script will now exit. After applying one of the the above, rerun die [[ $DEPS_LIST ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI $DEPS_LIST; DEPS_LIST=''; } - G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + G_DIETPI-NOTIFY 2 'Enabling required PHP modules' # - Add JSON module for PHP7, as it does not exist (embedded in core package) on PHP8 local json= [[ $PHP_VERSION == 8* ]] || json='json' - G_EXEC phpenmod ctype curl dom gd iconv intl mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif $json + G_EXEC phpenmod ctype curl dom gd intl mbstring pdo_mysql posix simplexml xmlreader xmlwriter zip fileinfo opcache apcu redis exif $json - G_DIETPI-NOTIFY 2 'Apply PHP override settings for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - local interned_strings_buffer='' memory_consumption='' - (( $(php$PHP_VERSION -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') < 8 )) && interned_strings_buffer='\nopcache.interned_strings_buffer=8' - (( $(php$PHP_VERSION -i | mawk '/^opcache.memory_consumption/{print $5;exit}') < 128 )) && memory_consumption='\nopcache.memory_consumption=128' - echo -e "; Nextcloud PHP settings\n; priority=98\nmemory_limit=512M$memory_consumption$interned_strings_buffer\nopcache.revalidate_freq=5\napc.enable_cli=1" > /etc/php/$PHP_VERSION/mods-available/dietpi-nextcloud.ini + G_DIETPI-NOTIFY 2 'Apply PHP override settings for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/server_tuning.html#enable-php-opcache + local memory_consumption=$(sed -n '/^[[:blank:]]*opcache.memory_consumption=/{s/^[^=]*=//p;q}' /etc/php/$PHP_VERSION/mods-available/dietpi.ini) + (( $memory_consumption < 64 )) && memory_consumption='\nopcache.memory_consumption=64' + echo -e "; Nextcloud PHP settings\n; priority=98\nmemory_limit=512M$memory_consumption\nopcache.revalidate_freq=5\napc.enable_cli=1" > /etc/php/$PHP_VERSION/mods-available/dietpi-nextcloud.ini G_EXEC phpenmod dietpi-nextcloud if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then @@ -4964,25 +4940,9 @@ url.redirect += ( fi dps_index=$software_id Download_Install 'nginx.nextcloud.conf' $nextcloud_conf - # Uncomment HSTS header, if chosen via dietpi-letsencrypt and HTTPS connection test succeeds (incl. self-singed cert => exit code 5) - if [[ -f '/boot/dietpi/.dietpi-letsencrypt' && $(mawk 'NR==4' /boot/dietpi/.dietpi-letsencrypt) == 1 ]]; then - - wget -q --spider --timeout=10 --tries=2 https://localhost &> /dev/null - [[ $? == [05] ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' $nextcloud_conf - - fi - - # Disable pretty URLs (front controller), if Nextcloud version is lower than 13 - if (( $(sed -n '/OC_VersionString/{s/^[^0-9]*//;s/\..*$//p;q}' /var/www/nextcloud/version.php) < 13 )); then - - sed -i 's/^[[:blank:]]*fastcgi_param front_controller_active true;/\t\t#fastcgi_param front_controller_active true;/g' $nextcloud_conf - - fi - # Cal/CardDAV redirects to Nextcloud DAV endpoint if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then - # shellcheck disable=SC2016 echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; } location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }' > /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf From c2295bcf3b1c57d1c331008b5130d9b009c8dff6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 15:28:47 +0100 Subject: [PATCH 49/67] v8.1 (#5194) - DietPi-Drive_Manager | Align network drive input prompts, allow to enter a path as SMB/CIFS server shared folder, remove leading slash when given --- dietpi/dietpi-drive_manager | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9c55a004c2..203535bcdb 100755 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -1723,23 +1723,25 @@ NB: If you are planning to dedicate the drive to this system, it is recommended # User inputs G_WHIP_DEFAULT_ITEM=$samba_clientname - G_WHIP_INPUTBOX 'Please enter the fileservers IP address\n - eg: 192.168.0.2' || return + G_WHIP_INPUTBOX 'Please enter the fileservers IP address or hostname.\n - E.g.: 192.168.0.2 or myNAS.local' || return samba_clientname=$G_WHIP_RETURNED_VALUE G_WHIP_DEFAULT_ITEM=$samba_clientshare - G_WHIP_INPUTBOX 'Please enter the fileservers shared folder name\n - eg: MySharedFolder' || return - samba_clientshare=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter the fileservers shared folder name or path.\n - E.g.: mySharedFolder or path/to/folder' || return + # - Remove leading slash + samba_clientshare=${G_WHIP_RETURNED_VALUE#/} G_WHIP_DEFAULT_ITEM=$samba_clientuser - G_WHIP_INPUTBOX 'Please enter the fileservers username\n - eg: JoeBloggs' || return + G_WHIP_INPUTBOX 'Please enter the fileservers username.\n - E.g.: JoeBloggs' || return samba_clientuser=$G_WHIP_RETURNED_VALUE - G_WHIP_PASSWORD 'Please enter the fileservers password\n - eg: LetMeIn' || return + G_WHIP_PASSWORD 'Please enter the fileservers password.\n - E.g.: LetMeIn' || return samba_clientpassword=$result unset -v result G_WHIP_DEFAULT_ITEM=$samba_fp_mount_target - G_WHIP_INPUTBOX 'Please enter a unique folder name for the mount location (eg: samba). This will be placed in /mnt/' || return + G_WHIP_INPUTBOX 'Please enter a unique folder name for the mount location.\n - E.g.: samba\nThis will be placed in /mnt/. +\nNB: Please avoid white spaces or special characters for compatibility reasons.' || return # - Remove leading "/mnt/" and "/" in case entered by user samba_fp_mount_target=${G_WHIP_RETURNED_VALUE#/mnt/}; samba_fp_mount_target=${samba_fp_mount_target#/} # - Remove trailing slash and (re-)add "/mnt/" for full mount target path @@ -1814,11 +1816,11 @@ _EOF_ # User inputs G_WHIP_DEFAULT_ITEM=$nfs_server_ip - G_WHIP_INPUTBOX 'Please enter the NFS servers IP address (eg: 192.168.0.2).' || return + G_WHIP_INPUTBOX 'Please enter the NFS servers IP address or hostname.\n - E.g.: 192.168.0.2 or myNAS.local' || return nfs_server_ip=$G_WHIP_RETURNED_VALUE G_WHIP_DEFAULT_ITEM=$nfs_fp_mount_target - G_WHIP_INPUTBOX 'Please enter a unique folder name for the mount location (eg: nfs_client). This will be placed in /mnt/ + G_WHIP_INPUTBOX 'Please enter a unique folder name for the mount location.\n - E.g.: nfs_client\nThis will be placed in /mnt/. \nNB: Please avoid white spaces or special characters for compatibility reasons.' || return # - Remove leading "/mnt/" and "/" in case entered by user nfs_fp_mount_target=${G_WHIP_RETURNED_VALUE#/mnt/}; nfs_fp_mount_target=${nfs_fp_mount_target#/} From fa1c70c36785cffbf2dc3068b89dcc68a8e3437f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 16:39:45 +0100 Subject: [PATCH 50/67] v8.1 - DietPi-Software | MATE: Resolved an issue where the install failed when LXDE is installed already. Many thanks to @n0valis for reporting this issue: https://github.com/MichaIng/DietPi/issues/5214 --- .update/patches | 7 +++++++ CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 515abed9eb..2c3d6115ec 100755 --- a/.update/patches +++ b/.update/patches @@ -631,6 +631,13 @@ Patch_8_1() grep -q 'dtoverlay=dietpi-disable_vcsm' /boot/config.txt && G_EXEC sed -i '/dtoverlay=dietpi-disable_vcsm/d' /boot/config.txt [[ -f '/boot/overlays/dietpi-disable_vcsm.dtbo' ]] && G_EXEC rm /boot/overlays/dietpi-disable_vcsm.dtbo fi + + # RPi: Fix MATE install: https://github.com/MichaIng/DietPi/issues/5214 + [[ $G_HW_MODEL -le 9 && -f '/etc/apt/preferences.d/dietpi-lxde' ]] && cat << '_EOF_' > /etc/apt/preferences.d/dietpi-lxde +Package: openbox* obconf* libob* pcmanfm* libfm* gtk-* libgtk* libgail* gir1.2-gtk-3.0 lx* +Pin: origin archive.raspberrypi.org +Pin-Priority: -1 +_EOF_ } # v6.35 => v7 migration diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 797bb5154b..86c6d165a3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Fixes: - DietPi-Software | PHP: Resolved an issue where the PATH variable was not available for PHP applications with Lighttpd and Nginx webservers. It is now set to the static value "/usr/local/bin:/usr/bin:/bin", the default PATH excluding super user executables "sbin". Many thanks to @shanew1694 for reporting a related issue with rTorrent: https://github.com/MichaIng/DietPi/issues/5161#issuecomment-1013381362 - DietPi-Software | MineOS: Resolved an issue where the install failed on Bullseye: https://github.com/MichaIng/DietPi/issues/5181 - DietPi-Software | Cuberite: Resolved an issue where the server failed to start on ARMv8 systems: https://github.com/MichaIng/DietPi/issues/5180 +- DietPi-Software | MATE: Resolved an issue where the install failed when LXDE is installed already. Many thanks to @n0valis for reporting this issue: https://github.com/MichaIng/DietPi/issues/5214 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/dietpi/dietpi-software b/dietpi/dietpi-software index e860f9ebf9..da58a62a1f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3253,7 +3253,7 @@ _EOF_ # - https://github.com/MichaIng/DietPi/issues/1558#issuecomment-691206284 # - https://github.com/MichaIng/DietPi/issues/4687 (( $G_HW_MODEL > 9 )) || cat << '_EOF_' > /etc/apt/preferences.d/dietpi-lxde -Package: openbox* obconf* libob* pcmanfm* libfm* libgtk* lx* +Package: openbox* obconf* libob* pcmanfm* libfm* gtk-* libgtk* libgail* gir1.2-gtk-3.0 lx* Pin: origin archive.raspberrypi.org Pin-Priority: -1 _EOF_ From b575b52ec1ef744960d1dd002da59d04b9cbe9f0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 19:52:41 +0100 Subject: [PATCH 51/67] v8.1 - DietPi-Config | Add HDMI/3.5mm audio output selection for Odroid N2 mainline kernel images - DietPi-Config | Add ttyAML[0-9] (Amlogic serial device) )detection to UART console menu --- CHANGELOG.txt | 4 ++ dietpi/dietpi-config | 8 ++- dietpi/dietpi-software | 11 ++-- dietpi/func/dietpi-set_hardware | 94 ++++++++++++++++++++++----------- 4 files changed, 78 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 86c6d165a3..7dbe85c61d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,7 +1,11 @@ v8.1 (2022-02-05) +SBC support: +- Odroid N2 | Support for Odroid N2 with modern mainline Linux images has been added, including proper boot configuration, serial console selection, HDMI and 3.5mm audio selection and more. + Changes: +- DietPi-Benchmark | During RAM I/O benchmarks, the CPU governor is now changed to "performance" so that the result is not affected by possible CPU frequency scaling but the raw/max RAM I/O performance is measured. A significant effect of this has been recognised on Odroid N2 images with modern mainline kernel. Since the CPU benchmark is done first, this has no effect on its score and CPU temperature results. - DietPi-Drive_Manager | Btrfs subvolume mounts are now preserved in /etc/fstab. Many thanks to @laddde for implementing this feature: https://github.com/MichaIng/DietPi/pull/5176 Fixes: diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index fb6b2ded38..08d28fea2e 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1053,7 +1053,7 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY=() (( $G_HW_MODEL < 10 )) && G_WHIP_MENU_ARRAY+=('' '●─ Toggle console ') - for i in /dev/tty{S,AMA,SAC}[0-9] + for i in /dev/tty{S,AMA,SAC,AML}[0-9] do [[ -e $i ]] || continue i=${i#/dev/} @@ -3752,6 +3752,12 @@ Additional benchmarks: G_WHIP_MENU_ARRAY+=('default' ': HDMI') G_WHIP_MENU_ARRAY+=('asus-tb-analogue' ': 3.5mm Analogue') + # Odroid N2: Modern image + elif [[ $G_HW_MODEL == 15 && -f '/boot/dietpiEnv.txt' ]]; then + + G_WHIP_MENU_ARRAY+=('OdroidN2_HDMI' ': Onboard digital HDMI audio (default)') + G_WHIP_MENU_ARRAY+=('OdroidN2_3.5mm' ': Onboard analogue 3.5mm audio') + fi # Intel SST DSP diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index da58a62a1f..fd36a8a7c8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2637,15 +2637,10 @@ _EOF_ # Get chosen sound card local soundcard=$(sed -n '/^[[:blank:]]*CONFIG_SOUNDCARD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - soundcard=${soundcard:-none} + soundcard=${soundcard:-default} - # Enable defaults if set to "none" - if [[ $soundcard == 'none' ]]; then - - # RPi: Onboard auto, Others: default - (( $G_HW_MODEL < 10 )) && soundcard='rpi-bcm2835-auto' || soundcard='default' - - fi + # Enable default if set to "none" + [[ $soundcard == 'none' ]] && soundcard='default' # Apply: Installs "alsa-utils" /boot/dietpi/func/dietpi-set_hardware soundcard "$soundcard" diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 3bfe34786c..ab983e69f7 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1691,6 +1691,11 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 Soundcard_Reset_RPi + # - Odroid N2: Modern image + elif [[ $G_HW_MODEL == 15 && -f '/boot/dietpiEnv.txt' ]]; then + + Soundcard_Reset_OdroidN2 + # - Odroid elif (( $G_HW_MODEL < 20 )); then @@ -1746,6 +1751,9 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 local kms=$(grep -Em1 '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?(,|$)' /boot/config.txt) [[ $kms && ! $kms =~ ',noaudio'(,|$) ]] && G_EXEC sed -Ei '/^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?(,|$)/s/$/,noaudio/' /boot/config.txt + # Use "auto" as default + [[ $INPUT_DEVICE_VALUE == 'default' ]] && INPUT_DEVICE_VALUE='rpi-bcm2835-auto' + } Soundcard_Reset_Odroid(){ @@ -1760,16 +1768,22 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 sed -i '/^[[:blank:]]*snd-soc-pcm512x/d' /etc/modules sed -i '/^[[:blank:]]*snd-soc-pcm512x-i2c/d' /etc/modules sed -i '/^[[:blank:]]*snd-soc-odroid-dac2/d' /etc/modules - if [[ -f '/etc/systemd/system/odroid-hifishield2.service' ]]; then - + if [[ -f '/etc/systemd/system/odroid-hifishield2.service' ]] + then G_EXEC systemctl disable --now odroid-hifishield2 G_EXEC rm /etc/systemd/system/odroid-hifishield2.service - fi [[ -d '/etc/systemd/system/odroid-hifishield2.service.d' ]] && G_EXEC rm -R /etc/systemd/system/odroid-hifishield2.service.d } + Soundcard_Reset_OdroidN2(){ + + # Use HDMI as default + [[ $INPUT_DEVICE_VALUE == 'default' ]] && INPUT_DEVICE_VALUE='OdroidN2_HDMI' + + } + Soundcard_Reset_H3(){ # Set HDMI @@ -1813,7 +1827,7 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # Save selection to dietpi.txt G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' "CONFIG_SOUNDCARD=$INPUT_DEVICE_VALUE" /boot/dietpi.txt # Return now if no sound card has been selected - [[ $INPUT_DEVICE_VALUE == 'none' ]] && return + [[ $INPUT_DEVICE_VALUE == 'none' ]] && return 0 #----------------------------------------------------------------------------- # Apply specific asound.conf and additional settings # - ALSA equalizer enabled? @@ -1841,7 +1855,6 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 SOUNDCARD_TARGET_CARD=$(mawk -F, '{print $1}' <<< "${INPUT_DEVICE_VALUE#hw:}") SOUNDCARD_TARGET_DEVICE=$(mawk -F, '{print $2}' <<< "${INPUT_DEVICE_VALUE#hw:}") - ;; # Auto detect USB DAC @@ -1880,7 +1893,6 @@ _EOF_ return fi - ;; # Intel SST DSP @@ -1906,7 +1918,6 @@ _EOF_ SOUNDCARD_TARGET_CARD=1 SOUNDCARD_TARGET_DEVICE=0 G_EXEC amixer -c 0 set 'audio output mode switch' i2s - ;; # Allo Cheapo @@ -1930,7 +1941,6 @@ _EOF_ SOUNDCARD_TARGET_DEVICE=2 fi - ;; # --------------- RPi ------------------- @@ -1988,7 +1998,6 @@ _EOF_ local kms=$(grep -Em1 '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,(noaudio|.+,noaudio)(,|$)' /boot/config.txt) [[ $kms ]] && G_EXEC sed -Ei '/^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,/s/,noaudio(,|$)/\1/' /boot/config.txt fi - ;; # Allo Piano DAC (DSP firmware + dtoverlay) @@ -2009,7 +2018,6 @@ _EOF_ fi G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - ;; # dtoverlay @@ -2028,7 +2036,6 @@ _EOF_ # Enable dtoverlay G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - ;; # dtoverlay + I2S @@ -2038,7 +2045,6 @@ _EOF_ # Enable dtoverlay + I2S G_CONFIG_INJECT 'dtparam=i2s=' 'dtparam=i2s=on' /boot/config.txt G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - ;; # --------------- Odroid ---------------- @@ -2049,7 +2055,6 @@ _EOF_ G_EXEC modprobe snd-soc-pcm5102 snd-soc-odroid-dac SOUNDCARD_TARGET_CARD=1 - ;; odroid-hifishield-2) @@ -2079,30 +2084,59 @@ WantedBy=sound.target _EOF_ G_EXEC systemctl daemon-reload G_EXEC systemctl enable --now odroid-hifishield2 - ;; - # --------------- H3 -------------------- - h3-analogue) - - SOUNDCARD_TARGET_CARD=0 - + OdroidN2_HDMI) + + # Enable HDMI output + G_EXEC amixer -c 0 set 'TOHDMITX' 'on' + # Use I2S B as source for HDMI output, I2C A is somehow not usable + G_EXEC amixer -c 0 set 'TOHDMITX I2S SRC' 'I2S B' + # Use ALSA device 0 as input for I2S B + G_EXEC amixer -c 0 set 'TDMOUT_B SRC SEL' 'IN 0' + # Enable I2S B (SRC 2) on device 0 (_A) + G_EXEC amixer -c 0 set 'FRDDR_A SRC 2 EN' 'on' + # Set output channels for device 0 (_A) + G_EXEC amixer -c 0 set 'FRDDR_A SINK 1 SEL' 'OUT 0' + G_EXEC amixer -c 0 set 'FRDDR_A SINK 2 SEL' 'OUT 1' + G_EXEC amixer -c 0 set 'FRDDR_A SINK 3 SEL' 'OUT 2' + # Set master volume to 85% + G_EXEC amixer -c 0 set 'ACODEC' '85%' + ;; - # --------------- NanoPi M2/M3 ---------- - s5pxx18-hdmi) + OdroidN2_3.5mm) + + # Enable 3.5mm output + G_EXEC amixer -c 0 set 'TOACODEC OUT EN' 'on' + # Use I2S B as source for 3.5mm output, I2C A is somehow not usable + G_EXEC amixer -c 0 set 'TOACODEC SRC' 'I2S B' + # Use ALSA device 0 as input for I2S B + G_EXEC amixer -c 0 set 'TDMOUT_B SRC SEL' 'IN 0' + # Enable I2S B (SRC 2) on device 0 (_A) + G_EXEC amixer -c 0 set 'FRDDR_A SRC 2 EN' 'on' + # Set output channels for device 0 (_A) + G_EXEC amixer -c 0 set 'FRDDR_A SINK 1 SEL' 'OUT 0' + G_EXEC amixer -c 0 set 'FRDDR_A SINK 2 SEL' 'OUT 1' + G_EXEC amixer -c 0 set 'FRDDR_A SINK 3 SEL' 'OUT 2' + # Set master volume to 85% + G_EXEC amixer -c 0 set 'ACODEC' '85%' + + ;; - SOUNDCARD_TARGET_CARD=1 + OdroidN2_3.5mm) + : ;; - # --------------- ASUS TB --------------- - asus-tb-analogue) + # --------------- H3 -------------------- + h3-analogue) SOUNDCARD_TARGET_CARD=0;; - SOUNDCARD_TARGET_CARD=0 - SOUNDCARD_TARGET_DEVICE=2 + # --------------- NanoPi M2/M3 ---------- + s5pxx18-hdmi) SOUNDCARD_TARGET_CARD=1;; - ;; + # --------------- ASUS TB --------------- + asus-tb-analogue) SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=2;; esac @@ -2143,7 +2177,7 @@ _EOF_ G_AG_CHECK_INSTALL_PREREQ libasound2-plugin-equal # Pre-create config dir - G_EXEC mkdir -p /var/lib/dietpi/dietpi-config + [[ -d '/var/lib/dietpi/dietpi-config' ]] || G_EXEC mkdir -p /var/lib/dietpi/dietpi-config G_EXEC chmod 0775 /var/lib/dietpi/dietpi-config G_EXEC chown dietpi:dietpi /var/lib/dietpi/dietpi-config cat << _EOF_ > /etc/asound.conf @@ -2212,8 +2246,8 @@ _EOF_ G_EXEC alsactl -g store # Buster: Avoid alsa-state.service start if its config file does not exist: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932209 - (( $G_DISTRO == 5 )) || return - G_EXEC mkdir -p /etc/systemd/system/alsa-state.service.d + (( $G_DISTRO == 5 )) || return 0 + [[ -d '/etc/systemd/system/alsa-state.service.d' ]] || G_EXEC mkdir /etc/systemd/system/alsa-state.service.d echo -e '[Unit]\nConditionPathExists=\nConditionPathExists=/etc/alsa/state-daemon.conf' > /etc/systemd/system/alsa-state.service.d/dietpi.conf } From 53dd3981502f42e5e4b517b6a98d9660f6452b58 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 28 Jan 2022 19:56:08 +0100 Subject: [PATCH 52/67] v8.1 (#5216) - META | Backwards merge master > dev From fce5ee791c7944f43278babad429390dc21108c3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 16:52:18 +0100 Subject: [PATCH 53/67] v8.1 - DietPi-Build | Since dbus (and its socket) may not be automatically started on install, do this in any case, but mask them only on exit when the socket was masked before. --- .build/images/dietpi-build | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 641c23b342..c5833c4572 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -236,12 +236,9 @@ G_EXEC rm -Rf rootfs/var/{cache/apt,lib/apt/lists}/* # Start container # - dbus required for container spawn mask_dbus=0 -if [[ $(readlink /etc/systemd/system/dbus.socket) == '/dev/null' ]] -then - mask_dbus=1 - G_EXEC systemctl unmask dbus.socket dbus - G_EXEC systemctl start dbus.socket dbus -fi +[[ $(readlink /etc/systemd/system/dbus.socket) == '/dev/null' ]] && mask_dbus=1 +G_EXEC systemctl unmask dbus.socket dbus +G_EXEC systemctl start dbus.socket dbus # - Bind mounts required to allow container reading its own drive info, /dev/disk for GRUB and probably other tools to detect UUIDs abind=() [[ -b '/dev/loop0p2' ]] && abind=('--bind=/dev/loop0p2') From 21b45e5f62a909d0fa1ff9ad3aeecf5d6bef7bcf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 17:21:13 +0100 Subject: [PATCH 54/67] v8.1 - DietPi-PREP | Syntax --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ad1819f6b1..1ebca3ad1a 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -406,7 +406,7 @@ _EOF_ while : do - # Check for valid environment variabe + # Check for valid environment variable [[ $HW_MODEL =~ ^[0-9]+$ ]] && for i in "${G_WHIP_MENU_ARRAY[@]}" do [[ $HW_MODEL == "$i" ]] && break 2 @@ -1641,7 +1641,7 @@ _EOF_" G_CONFIG_INJECT 'rootfstype=' 'rootfstype=$(findmnt -Ufnro FSTYPE -M /)' /boot/dietpiEnv.txt # - Sparky SBC - if (( $G_HW_MODEL == 70 )) + elif (( $G_HW_MODEL == 70 )) then # Install latest kernel/drivers G_EXEC curl -sSfL 'https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage' -o /boot/uImage From 2f0c3f08964bffccf515ac8b34f4bf3262dfe0ea Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 17:48:02 +0100 Subject: [PATCH 55/67] v8.1 - DietPi-Set_hardware| Remove obsolete case pattern and harden all of them by wrapping literal parts into single quotes --- dietpi/func/dietpi-set_hardware | 37 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ab983e69f7..018b372034 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1851,14 +1851,14 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # --------------- Generic --------------- # Specific card + device, e.g. from auto-detection - hw:*) + 'hw:'*) SOUNDCARD_TARGET_CARD=$(mawk -F, '{print $1}' <<< "${INPUT_DEVICE_VALUE#hw:}") SOUNDCARD_TARGET_DEVICE=$(mawk -F, '{print $2}' <<< "${INPUT_DEVICE_VALUE#hw:}") ;; # Auto detect USB DAC - usb-dac*) + 'usb-dac'*) local usb_detection_card_index=$([[ -f '/proc/asound/cards' ]] && mawk '/USB/ && $1 == /[0-9]/ {print $1;exit}' /proc/asound/cards) if [[ $usb_detection_card_index ]]; then @@ -1896,13 +1896,13 @@ _EOF_ ;; # Intel SST DSP - intel-sst-dsp) G_AG_CHECK_INSTALL_PREREQ 'firmware-intel-sound';; + 'intel-sst-dsp') G_AG_CHECK_INSTALL_PREREQ 'firmware-intel-sound';; # --------------- Sparky SBC ------------ # Allo Piano DAC (firmware + module) # snd-soc-allo-piano-dac # snd-soc-allo-piano-dac-plus (2.1) - snd-soc-allo-piano-dac*) + 'snd-soc-allo-piano-dac'*) if [[ ! -d '/lib/firmware/allo' ]] then @@ -1923,7 +1923,7 @@ _EOF_ # Allo Cheapo # allo-cheapo-analogue # 3.5mm/RCA # allo-cheapo-optical # Optical out - allo-cheapo*) + 'allo-cheapo-'*) SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=0 @@ -1948,7 +1948,7 @@ _EOF_ # rpi-bcm2835-auto # rpi-bcm2835-3.5mm # rpi-bcm2835-hdmi - rpi-bcm2835-*) + 'rpi-bcm2835-'*) # Enable onboard audio G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' /boot/config.txt @@ -2003,7 +2003,7 @@ _EOF_ # Allo Piano DAC (DSP firmware + dtoverlay) # allo-piano-dac-pcm512x-audio # allo-piano-dac-plus-pcm512x-audio (2.1) - allo-piano-dac*) + 'allo-piano-dac'*) if [[ ! -d '/lib/firmware/allo' ]] then @@ -2032,7 +2032,7 @@ _EOF_ # applepi-dac # iqaudio-* # dionaudio-loco(-v2) - hifiberry-*|justboom-*|allo-*|rpi-dac|i-sabre-q2m|applepi*|iqaudio-*|dionaudio-loco*) + 'hifiberry-'*|'justboom-'*|'allo-'*|'rpi-dac'|'i-sabre-q2m'|'applepi'*|'iqaudio-'*|'dionaudio-loco'*) # Enable dtoverlay G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt @@ -2040,7 +2040,7 @@ _EOF_ # dtoverlay + I2S # googlevoicehat-soundcard - googlevoicehat-soundcard*) + 'googlevoicehat-soundcard'*) # Enable dtoverlay + I2S G_CONFIG_INJECT 'dtparam=i2s=' 'dtparam=i2s=on' /boot/config.txt @@ -2048,7 +2048,7 @@ _EOF_ ;; # --------------- Odroid ---------------- - odroid-hifishield-plus) + 'odroid-hifishield-plus') G_CONFIG_INJECT 'snd-soc-pcm5102' 'snd-soc-pcm5102' /etc/modules G_CONFIG_INJECT 'snd-soc-odroid-dac' 'snd-soc-odroid-dac' /etc/modules @@ -2057,7 +2057,7 @@ _EOF_ SOUNDCARD_TARGET_CARD=1 ;; - odroid-hifishield-2) + 'odroid-hifishield-2') G_CONFIG_INJECT 'aml_i2c' 'aml_i2c' /etc/modules G_CONFIG_INJECT 'snd-soc-pcm512x' 'snd-soc-pcm512x' /etc/modules @@ -2086,7 +2086,7 @@ _EOF_ G_EXEC systemctl enable --now odroid-hifishield2 ;; - OdroidN2_HDMI) + 'OdroidN2_HDMI') # Enable HDMI output G_EXEC amixer -c 0 set 'TOHDMITX' 'on' @@ -2105,7 +2105,7 @@ _EOF_ ;; - OdroidN2_3.5mm) + 'OdroidN2_3.5mm') # Enable 3.5mm output G_EXEC amixer -c 0 set 'TOACODEC OUT EN' 'on' @@ -2124,19 +2124,14 @@ _EOF_ ;; - OdroidN2_3.5mm) - - : - ;; - # --------------- H3 -------------------- - h3-analogue) SOUNDCARD_TARGET_CARD=0;; + 'h3-analogue') SOUNDCARD_TARGET_CARD=0;; # --------------- NanoPi M2/M3 ---------- - s5pxx18-hdmi) SOUNDCARD_TARGET_CARD=1;; + 's5pxx18-hdmi') SOUNDCARD_TARGET_CARD=1;; # --------------- ASUS TB --------------- - asus-tb-analogue) SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=2;; + 'asus-tb-analogue') SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=2;; esac From dd209ef4d105ba5f53cf1780ff716edb2fab6c30 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 19:00:06 +0100 Subject: [PATCH 56/67] v8.1 - DietPi-PREP | Fixes and alignments --- .build/images/U-Boot/99-dietpi-uboot | 6 +-- PREP_SYSTEM_FOR_DIETPI.sh | 63 +++++++++++++++------------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot index d1b487926e..78dc0c3406 100755 --- a/.build/images/U-Boot/99-dietpi-uboot +++ b/.build/images/U-Boot/99-dietpi-uboot @@ -1,5 +1,5 @@ #!/bin/dash -echo 'update-initramfs: Converting to U-Boot format' >&2 -mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d "$2" "/boot/uInitrd-$1" > /dev/null -ln -sf "uInitrd-$1" /boot/uInitrd > /dev/null 2>&1 +echo 'update-initramfs: Converting to U-Boot format' +mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d "$2" "/boot/uInitrd-$1" +ln -sf "uInitrd-$1" /boot/uInitrd exit 0 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1ebca3ad1a..76c2c26c53 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -540,6 +540,14 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC mv "DietPi-$G_GITBRANCH/boot_c2.ini" /boot/boot.ini + elif [[ $G_HW_MODEL == 15 && $(findmnt -Ufnro TARGET -T /boot) == '/' ]]; then + + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/dietpiEnv.txt" /boot/dietpiEnv.txt + G_EXEC mkdir -p /etc/kernel/preinst.d /etc/initramfs/post-update.d + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/dietpi-initramfs_cleanup" /etc/kernel/preinst.d/dietpi-initramfs_cleanup + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot + elif [[ $G_HW_MODEL == 15 && -f '/boot/boot.ini' && $(findmnt -t vfat -M /boot) ]]; then G_EXEC mv "DietPi-$G_GITBRANCH/boot_n2.ini" /boot/boot.ini @@ -805,7 +813,7 @@ _EOF_ # - G_HW_MODEL specific required firmware/kernel/bootloader packages # Odroid N2: Modern single partition image - elif [[ $G_HW_MODEL == 15 && $(findmnt -Ufnro TARGET -T /boot) == '/' ]] + elif [[ $G_HW_MODEL == 15 && -f '/boot/dietpiEnv.txt' ]] then # Bootstrap Armbian repository G_EXEC eval "curl -sSfL 'https://apt.armbian.com/armbian.key' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes" @@ -820,19 +828,16 @@ _EOF_ G_EXEC eval "echo 'deb http://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/dietpi-armbian.list" # Update APT lists G_AGUP - # Install kernel, device tree, U-Boot and firmware packages - G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware + # Install kernel, device tree, U-Boot, firmware and initramfs packages + G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware initramfs-tools + # Cleanup + [[ -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage + [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next + # Compile U-Boot config + G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr # Flash U-Boot . /usr/lib/u-boot/platform_install.sh write_uboot_platform "$DIR" "$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -M /)")" - # Install kernel, initramfs and boot config files - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/boot.cmd" -o /boot/boot.cmd - G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/dietpiEnv.txt" -o /boot/dietpiEnv.txt - G_EXEC mkdir -p /etc/kernel/preinst.d /etc/initramfs/post-update.d - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/dietpi-initramfs_cleanup" -o /etc/kernel/preinst.d/dietpi-initramfs_cleanup - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" -o /etc/initramfs/post-update.d/99-dietpi-uboot - G_EXEC chmod +x /etc/kernel/preinst.d/dietpi-initramfs_cleanup /etc/initramfs/post-update.d/99-dietpi-uboot # Armbian grab currently installed packages elif [[ $(dpkg-query -Wf '${Package} ') == *'armbian'* ]]; then @@ -867,8 +872,8 @@ _EOF_ G_EXEC mkdir -p /etc/initramfs/post-update.d cat << _EOF_ > /etc/initramfs/post-update.d/99-dietpi-uboot #!/bin/dash -echo 'update-initramfs: Converting to U-Boot format' >&2 -mkimage -A $arch -O linux -T ramdisk -C gzip -n uInitrd -d "\$2" "/boot/uInitrd-\$1" > /dev/null +echo 'update-initramfs: Converting to U-Boot format' +mkimage -A $arch -O linux -T ramdisk -C gzip -n uInitrd -d "\$2" "/boot/uInitrd-\$1" ln -sf "uInitrd-\$1" /boot/uInitrd > /dev/null 2>&1 || mv "/boot/uInitrd-\$1" /boot/uInitrd exit 0 _EOF_ @@ -877,22 +882,22 @@ _EOF_ cat << '_EOF_' > /etc/kernel/preinst.d/dietpi-initramfs_cleanup #!/bin/dash -# skip if initramfs-tools is not installed -[ -x /usr/sbin/update-initramfs ] || exit 0 +# Skip if initramfs-tools is not installed +[ -x '/usr/sbin/update-initramfs' ] || exit 0 -# passing the kernel version is required +# Passing the kernel version is required version="$1" -if [ -z "$version" ]; then +if [ -z "$version" ] +then echo "W: initramfs-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number" >&2 exit 0 fi -# avoid running multiple times -if [ -n "$DEB_MAINT_PARAMS" ]; then +# Avoid running multiple times +if [ "$DEB_MAINT_PARAMS" ] +then eval set -- "$DEB_MAINT_PARAMS" - if [ "$1" != 'upgrade' ]; then - exit 0 - fi + [ "$1" = 'upgrade' ] || exit 0 fi _EOF_ @@ -900,21 +905,21 @@ _EOF_ if (( $DISTRO_TARGET > 5 )) then cat << '_EOF_' >> /etc/kernel/preinst.d/dietpi-initramfs_cleanup -# delete unused initrd images +# Delete unused initrd images find /boot -name 'initrd.img-*' -o -name 'uInitrd-*' ! -name "*-$version" -printf 'Removing obsolete file %f\n' -delete exit 0 _EOF_ else cat << '_EOF_' >> /etc/kernel/preinst.d/dietpi-initramfs_cleanup -# loop through existing initramfs images +# Loop through existing initramfs images for v in $(ls -1 /var/lib/initramfs-tools | linux-version sort --reverse); do if ! linux-version compare $v eq $version; then - # try to delete delete old initrd images via update-initramfs + # Try to delete delete old initrd images via update-initramfs INITRAMFS_TOOLS_KERNEL_HOOK=y update-initramfs -d -k $v 2>/dev/null - # delete unused state files + # Delete unused state files find /var/lib/initramfs-tools -type f ! -name "$version" -printf 'Removing obsolete file %f\n' -delete - # delete unused initrd images + # Delete unused initrd images find /boot -name 'initrd.img-*' -o -name 'uInitrd-*' ! -name "*-$version" -printf 'Removing obsolete file %f\n' -delete fi done @@ -1637,8 +1642,8 @@ _EOF_" # - Odroid N2: Modern single partition image if [[ $G_HW_MODEL == 15 && -f '/boot/dietpiEnv.txt' ]] then - G_CONFIG_INJECT 'rootdev=' 'rootdev=UUID=$(findmnt -Ufnro UUID -M /)' /boot/dietpiEnv.txt - G_CONFIG_INJECT 'rootfstype=' 'rootfstype=$(findmnt -Ufnro FSTYPE -M /)' /boot/dietpiEnv.txt + G_CONFIG_INJECT 'rootdev=' "rootdev=UUID=$(findmnt -Ufnro UUID -M /)" /boot/dietpiEnv.txt + G_CONFIG_INJECT 'rootfstype=' "rootfstype=$(findmnt -Ufnro FSTYPE -M /)" /boot/dietpiEnv.txt # - Sparky SBC elif (( $G_HW_MODEL == 70 )) From 6171f56f42cb0723b8842bff4b1f7a5d73e2e01d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 19:09:15 +0100 Subject: [PATCH 57/67] v8.1 - DietPi-PREP | Move obsolete kernel image cleanup step to initramfs post-updates --- .build/images/U-Boot/99-dietpi-uboot | 2 ++ PREP_SYSTEM_FOR_DIETPI.sh | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot index 78dc0c3406..626078bd1b 100755 --- a/.build/images/U-Boot/99-dietpi-uboot +++ b/.build/images/U-Boot/99-dietpi-uboot @@ -2,4 +2,6 @@ echo 'update-initramfs: Converting to U-Boot format' mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d "$2" "/boot/uInitrd-$1" ln -sf "uInitrd-$1" /boot/uInitrd +# Cleanup +rm -f /boot/uImage /boot/.next exit 0 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 76c2c26c53..878ab971f8 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -830,9 +830,6 @@ _EOF_ G_AGUP # Install kernel, device tree, U-Boot, firmware and initramfs packages G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware initramfs-tools - # Cleanup - [[ -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage - [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next # Compile U-Boot config G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr # Flash U-Boot From f0dbdc82e0ca9772763acffb90e6eaebb9933c6b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 19:24:03 +0100 Subject: [PATCH 58/67] v8.1 - DietPi-PREP | Revert: Move obsolete kernel image cleanup step to initramfs post-updates. The kernel postinst script creates both files after initramfs post-update scripts run, hence it has no effect there. Remove now in PREP only to reduce initial image size a bit. uImage => Image migration topic is up on Armbian. --- .build/images/U-Boot/99-dietpi-uboot | 2 -- PREP_SYSTEM_FOR_DIETPI.sh | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.build/images/U-Boot/99-dietpi-uboot b/.build/images/U-Boot/99-dietpi-uboot index 626078bd1b..78dc0c3406 100755 --- a/.build/images/U-Boot/99-dietpi-uboot +++ b/.build/images/U-Boot/99-dietpi-uboot @@ -2,6 +2,4 @@ echo 'update-initramfs: Converting to U-Boot format' mkimage -A arm64 -O linux -T ramdisk -C gzip -n uInitrd -d "$2" "/boot/uInitrd-$1" ln -sf "uInitrd-$1" /boot/uInitrd -# Cleanup -rm -f /boot/uImage /boot/.next exit 0 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 878ab971f8..76c2c26c53 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -830,6 +830,9 @@ _EOF_ G_AGUP # Install kernel, device tree, U-Boot, firmware and initramfs packages G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware initramfs-tools + # Cleanup + [[ -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage + [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next # Compile U-Boot config G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr # Flash U-Boot From 831d7f9a59201e7993bde2a8a58c0740945336eb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 19:49:04 +0100 Subject: [PATCH 59/67] v8.1 - DietPi-PREP | Install initramfs-tools alone first, else no initramfs may be generated when kernel is installed in the same turn --- PREP_SYSTEM_FOR_DIETPI.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 76c2c26c53..3d74558e45 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -828,8 +828,9 @@ _EOF_ G_EXEC eval "echo 'deb http://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/dietpi-armbian.list" # Update APT lists G_AGUP - # Install kernel, device tree, U-Boot, firmware and initramfs packages - G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware initramfs-tools + # Install kernel, device tree, U-Boot, firmware and initramfs packages, initramfs-tools first to have an initramfs generated on kernel install + G_AGO initramfs-tools + G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware # Cleanup [[ -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next From 57fc8ff504f2c1c52cf20aabd7b1441371d9742e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 19:55:07 +0100 Subject: [PATCH 60/67] v8.1 - DietPi-PREP | Typo --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3d74558e45..0286a33e4a 100755 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -829,7 +829,7 @@ _EOF_ # Update APT lists G_AGUP # Install kernel, device tree, U-Boot, firmware and initramfs packages, initramfs-tools first to have an initramfs generated on kernel install - G_AGO initramfs-tools + G_AGI initramfs-tools G_AGI linux-{image,dtb}-current-meson64 linux-u-boot-odroidn2-current u-boot-tools armbian-firmware # Cleanup [[ -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage From 7c58bf121ced0ed2dcd3923f1528c726efb5390e Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Sat, 29 Jan 2022 20:10:19 +0100 Subject: [PATCH 61/67] v8.1 (#5205) - DietPi-Software | Ampache: Resolved an issue on Bullseye systems where Ampache v5 installs/reinstalls did not work --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 73 ++++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7dbe85c61d..e9ddf01aeb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Fixes: - DietPi-Software | MineOS: Resolved an issue where the install failed on Bullseye: https://github.com/MichaIng/DietPi/issues/5181 - DietPi-Software | Cuberite: Resolved an issue where the server failed to start on ARMv8 systems: https://github.com/MichaIng/DietPi/issues/5180 - DietPi-Software | MATE: Resolved an issue where the install failed when LXDE is installed already. Many thanks to @n0valis for reporting this issue: https://github.com/MichaIng/DietPi/issues/5214 +- DietPi-Software | Ampache: Resolved an issue on Bullseye systems where Ampache v5 installs/reinstalls did not work because of a changed webroot directory: https://github.com/MichaIng/DietPi/pull/5205 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/dietpi/dietpi-software b/dietpi/dietpi-software index fd36a8a7c8..eb54fef33f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8028,22 +8028,30 @@ _EOF_ then local fallback_url='https://github.com/ampache/ampache/releases/download/5.2.0/ampache-5.2.0_all.zip' Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" '/"browser_download_url": ".*\/ampache-[0-9\.]*_all.zip"/{print $4}')" ampache + # Ampache is installed to /mnt/dietpi_userdata/ampache and the "public" directory linked to /var/www/ampache: https://github.com/MichaIng/DietPi/pull/5205 + local fp_install='/mnt/dietpi_userdata' fp_public='ampache/public' # Ampache v5 requires PHP7.4, hence pull latest Ampache v4 on Buster: https://github.com/ampache/ampache/wiki/Ampache-Next-Changes else local fallback_url='https://github.com/ampache/ampache/releases/download/4.4.3/ampache-4.4.3_all.zip' Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases' | mawk -F\" '/"browser_download_url": ".*\/ampache-4[0-9\.]*_all.zip"/{print $4}' | head -1)" ampache + # Ampache is installed to /var/www/ampache. + local fp_install='/var/www' fp_public='ampache' fi - # Reinstall: Preserve existing config files + # Reinstall: Preserve configs from old and new paths [[ -f '/var/www/ampache/config/ampache.cfg.php' ]] && G_EXEC mv /var/www/ampache/config/ampache.cfg.php ampache/config/ [[ -f '/var/www/ampache/config/registration_agreement.php' ]] && G_EXEC mv /var/www/ampache/config/registration_agreement.php ampache/config/ - [[ -f '/var/www/ampache/channel/.htaccess' ]] && G_EXEC mv /var/www/ampache/channel/.htaccess ampache/channel/ - [[ -f '/var/www/ampache/rest/.htaccess' ]] && G_EXEC mv /var/www/ampache/rest/.htaccess ampache/rest/ - [[ -f '/var/www/ampache/play/.htaccess' ]] && G_EXEC mv /var/www/ampache/play/.htaccess ampache/play/ - [[ -d '/var/www/ampache' ]] && G_EXEC rm -R /var/www/ampache + [[ -f '/mnt/dietpi_userdata/ampache/config/ampache.cfg.php' ]] && G_EXEC mv /mnt/dietpi_userdata/ampache/config/ampache.cfg.php ampache/config/ + [[ -f '/mnt/dietpi_userdata/ampache/config/registration_agreement.php' ]] && G_EXEC mv /mnt/dietpi_userdata/ampache/config/registration_agreement.php ampache/config/ + [[ -f '/var/www/ampache/channel/.htaccess' ]] && G_EXEC mv /var/www/ampache/channel/.htaccess "$fp_public/channel/" + [[ -f '/var/www/ampache/rest/.htaccess' ]] && G_EXEC mv /var/www/ampache/rest/.htaccess "$fp_public/rest/" + [[ -f '/var/www/ampache/play/.htaccess' ]] && G_EXEC mv /var/www/ampache/play/.htaccess "$fp_public/play/" + [[ -d '/var/www/ampache' || -L '/var/www/ampache' ]] && G_EXEC rm -R /var/www/ampache + [[ -d '/mnt/dietpi_userdata/ampache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/ampache - G_EXEC mv {,/var/www/}ampache + G_EXEC mv {,"$fp_install/"}ampache + [[ -d '/mnt/dietpi_userdata/ampache/public' ]] && G_EXEC ln -s /mnt/dietpi_userdata/ampache/public /var/www/ampache Download_Test_Media @@ -8058,39 +8066,39 @@ _EOF_ G_EXEC mysql ampache < ampache.sql G_EXEC_NOHALT=1 G_EXEC rm ampache.sql # Also update password here for rare but possible case that database was lost but config file still exists - [[ -f '/var/www/ampache/config/ampache.cfg.php' ]] && G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$GLOBAL_PW\"" /var/www/ampache/config/ampache.cfg.php + [[ -f $fp_install/ampache/config/ampache.cfg.php ]] && G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$GLOBAL_PW\"" "$fp_install/ampache/config/ampache.cfg.php" fi # Create new config, if not existent already - if [[ ! -f '/var/www/ampache/config/ampache.cfg.php' ]]; then - - G_EXEC mv /var/www/ampache/config/ampache.cfg.php{.dist,} - G_CONFIG_INJECT 'web_path[[:blank:]]+=' 'web_path = "/ampache"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'database_hostname[[:blank:]]+=' 'database_hostname = /run/mysqld/mysqld.sock' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'database_name[[:blank:]]+=' 'database_name = ampache' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'database_username[[:blank:]]+=' 'database_username = ampache' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$GLOBAL_PW\"" /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'waveform[[:blank:]]+=' 'waveform = "true"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'tmp_dir_path[[:blank:]]+=' 'tmp_dir_path = "/tmp"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'generate_video_preview[[:blank:]]+=' 'generate_video_preview = "true"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'channel[[:blank:]]+=' 'channel = "true"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_m4a[[:blank:]]+=' 'transcode_m4a = "required"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_flac[[:blank:]]+=' 'transcode_flac = "required"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_mpc[[:blank:]]+=' 'transcode_mpc = "required"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_ogg[[:blank:]]+=' 'transcode_ogg = "allowed"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_wav[[:blank:]]+=' 'transcode_wav = "required"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_avi[[:blank:]]+=' 'transcode_avi = "allowed"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_mkv[[:blank:]]+=' 'transcode_mkv = "allowed"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_mpg[[:blank:]]+=' 'transcode_mpg = "allowed"' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'encode_target[[:blank:]]+=' 'encode_target = mp3' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'encode_video_target[[:blank:]]+=' 'encode_video_target = webm' /var/www/ampache/config/ampache.cfg.php - G_CONFIG_INJECT 'transcode_cmd[[:blank:]]+=' 'transcode_cmd = "ffmpeg"' /var/www/ampache/config/ampache.cfg.php + if [[ ! -f $fp_install/ampache/config/ampache.cfg.php ]]; then + + G_EXEC mv "$fp_install/ampache/config/ampache.cfg.php"{.dist,} + G_CONFIG_INJECT 'web_path[[:blank:]]+=' 'web_path = "/ampache"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'database_hostname[[:blank:]]+=' 'database_hostname = /run/mysqld/mysqld.sock' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'database_name[[:blank:]]+=' 'database_name = ampache' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'database_username[[:blank:]]+=' 'database_username = ampache' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$GLOBAL_PW\"" "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'waveform[[:blank:]]+=' 'waveform = "true"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'tmp_dir_path[[:blank:]]+=' 'tmp_dir_path = "/tmp"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'generate_video_preview[[:blank:]]+=' 'generate_video_preview = "true"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'channel[[:blank:]]+=' 'channel = "true"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_m4a[[:blank:]]+=' 'transcode_m4a = "required"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_flac[[:blank:]]+=' 'transcode_flac = "required"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_mpc[[:blank:]]+=' 'transcode_mpc = "required"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_ogg[[:blank:]]+=' 'transcode_ogg = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_wav[[:blank:]]+=' 'transcode_wav = "required"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_avi[[:blank:]]+=' 'transcode_avi = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_mkv[[:blank:]]+=' 'transcode_mkv = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_mpg[[:blank:]]+=' 'transcode_mpg = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'encode_target[[:blank:]]+=' 'encode_target = mp3' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'encode_video_target[[:blank:]]+=' 'encode_video_target = webm' "$fp_install/ampache/config/ampache.cfg.php" + G_CONFIG_INJECT 'transcode_cmd[[:blank:]]+=' 'transcode_cmd = "ffmpeg"' "$fp_install/ampache/config/ampache.cfg.php" fi # Permissions: Ampache can automatically migrate old configs to the new config file - G_EXEC chown www-data /var/www/ampache/config/ampache.cfg.php + G_EXEC chown www-data "$fp_install/ampache/config/ampache.cfg.php" fi @@ -14155,7 +14163,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - [[ -d '/var/www/ampache' ]] && G_EXEC rm -R /var/www/ampache + [[ -d '/var/www/ampache' || -L '/var/www/ampache' ]] && G_EXEC rm -R /var/www/ampache + [[ -d '/mnt/dietpi_userdata/ampache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/ampache # Drop database systemctl start mariadb From 27bdfb6cd966bd0c73068fee7273df795c917896 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 20:12:11 +0100 Subject: [PATCH 62/67] v8.1 - RC up --- .update/version | 2 +- dietpi/func/dietpi-globals | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/version b/.update/version index a39a5e5b12..f7dcfc24d1 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=8 G_REMOTE_VERSION_SUB=1 -G_REMOTE_VERSION_RC=-1 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d839746fc8..509d97fea3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -57,7 +57,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=1 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From 9788bb1f030e34f3010b9bc28c0ab4edcf365c19 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 20:19:12 +0100 Subject: [PATCH 63/67] v8.1 - CHANGELOG | DietPi-Backup: A notification is not printed when rsync dry-run to obtain required disk space is starting, since this can take a while. Many thanks to @whisdol for reporting the the impression of a hanging script: https://github.com/MichaIng/DietPi/issues/5209 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e9ddf01aeb..aa7aaa59c7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ SBC support: Changes: - DietPi-Benchmark | During RAM I/O benchmarks, the CPU governor is now changed to "performance" so that the result is not affected by possible CPU frequency scaling but the raw/max RAM I/O performance is measured. A significant effect of this has been recognised on Odroid N2 images with modern mainline kernel. Since the CPU benchmark is done first, this has no effect on its score and CPU temperature results. - DietPi-Drive_Manager | Btrfs subvolume mounts are now preserved in /etc/fstab. Many thanks to @laddde for implementing this feature: https://github.com/MichaIng/DietPi/pull/5176 +- DietPi-Backup | A notification is not printed when rsync dry-run to obtain required disk space is starting, since this can take a while. Many thanks to @whisdol for reporting the the impression of a hanging script: https://github.com/MichaIng/DietPi/issues/5209 Fixes: - DietPi-Services | Resolved an issue where service edits and process tool settings were not effective as they were stored to the wrong file path. Many thanks to @TopFord and @MicDG for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=41509#p41509 From daa027eee243fdde5f32adcb9468b7907df5fe28 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 21:17:58 +0100 Subject: [PATCH 64/67] v8.1 - CHANGELOG | Add note about new testing image for Odroid N2 --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aa7aaa59c7..e83880ed60 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,7 @@ v8.1 (2022-02-05) SBC support: -- Odroid N2 | Support for Odroid N2 with modern mainline Linux images has been added, including proper boot configuration, serial console selection, HDMI and 3.5mm audio selection and more. +- Odroid N2 | Support for Odroid N2 with modern mainline Linux images has been added, including proper boot configuration, serial console selection, HDMI and 3.5mm audio selection and more. Sadly existing images cannot be migrated, a new image is available for testing: https://github.com/MichaIng/DietPi/issues/5039 Changes: - DietPi-Benchmark | During RAM I/O benchmarks, the CPU governor is now changed to "performance" so that the result is not affected by possible CPU frequency scaling but the raw/max RAM I/O performance is measured. A significant effect of this has been recognised on Odroid N2 images with modern mainline kernel. Since the CPU benchmark is done first, this has no effect on its score and CPU temperature results. From 75a49bc45062e38c0f8dc71630b31d424c6a61a0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 23:12:47 +0100 Subject: [PATCH 65/67] v8.1 - DietPi-Set_hardware | Add dietpiEnv.txt support for adding/removing serial console entries to kerne command-line as well --- dietpi/func/dietpi-set_hardware | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 018b372034..ae5b219e29 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -56,20 +56,24 @@ $FP_SCRIPT rpi-eeprom G_INIT # Import DietPi-Globals -------------------------------------------------------------- - # ARMbian uses armbianEnv.txt instead which requires different syntax - if [[ -f '/boot/armbianEnv.txt' ]]; then - + ARMBIAN=0 + DIETPIENV=0 + # New mainline kernel U-Boot images with dietpiEnv.txt + if [[ -f '/boot/dietpiEnv.txt' ]] + then + DIETPIENV=1 + FP_UENV='/boot/dietpiEnv.txt' + + # Armbian uses armbianEnv.txt instead which requires different syntax + elif [[ -f '/boot/armbianEnv.txt' ]] + then ARMBIAN=1 FP_UENV='/boot/armbianEnv.txt' # Sparky SBC uEnv.txt has been renamed to uenv.txt, lets support both variants else - - ARMBIAN=0 - FP_UENV='/tmp/uEnv.txt' - for i in /boot/u{e,E}nv.txt; do [[ -f $i ]] && FP_UENV=$i && break; done - unset -v i - + FP_UENV='/boot/uEnv.txt' + [[ -f '/boot/uenv.txt' ]] && FP_UENV='/boot/uenv.txt' fi EXIT_CODE=0 @@ -1538,6 +1542,11 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 old=$(cut -d \" -f 2 <<< "$old") G_CONFIG_INJECT 'setenv[[:blank:]]+bootrootfs[[:blank:]]' "setenv bootrootfs \"$old console=$INPUT_ADDITIONAL,115200n8\"" /boot/boot.ini 'ODROIDXU-UBOOT-CONFIG' + # - dietpiEnv.txt + elif (( $DIETPIENV )); then + + grep -q "^consoleargs=.*console=$INPUT_ADDITIONAL" $FP_UENV || sed -i "/^consoleargs=/s/[[:blank:]]*$/ console=$INPUT_ADDITIONAL,115200/" $FP_UENV + # - Armbian: armbianEnv.txt only allows to toggle a fixed serial console depending on device elif (( $ARMBIAN )); then @@ -1599,13 +1608,18 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # - RPi if (( $G_HW_MODEL < 10 )); then - sed -Ei "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" /boot/cmdline.txt + sed -Ei "/root=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" /boot/cmdline.txt # - Odroid C1/C2/XU4 legacy elif [[ $G_HW_MODEL -le 12 && -f '/boot/boot.ini' ]]; then sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" /boot/boot.ini + # - dietpiEnv.txt + elif (( $DIETPIENV )); then + + grep -q "^consoleargs=.*console=$INPUT_ADDITIONAL" $FP_UENV && sed -Ei "/^consoleargs=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" $FP_UENV + # - Armbian: armbianEnv.txt only allows to toggle a fixed serial console depending on device elif (( $ARMBIAN )); then From ef98f8a133df9d9df9714572e44ff1108a7d5412 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 23:20:17 +0100 Subject: [PATCH 66/67] v8.1 - CHANGELOG | DietPi-Drive_Manager: The Samba mount dialogues do now indicate that a hostname can be entered instead of a server IP and a shared folder path instead of a share name only. --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e83880ed60..9aa1a775f1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ SBC support: Changes: - DietPi-Benchmark | During RAM I/O benchmarks, the CPU governor is now changed to "performance" so that the result is not affected by possible CPU frequency scaling but the raw/max RAM I/O performance is measured. A significant effect of this has been recognised on Odroid N2 images with modern mainline kernel. Since the CPU benchmark is done first, this has no effect on its score and CPU temperature results. - DietPi-Drive_Manager | Btrfs subvolume mounts are now preserved in /etc/fstab. Many thanks to @laddde for implementing this feature: https://github.com/MichaIng/DietPi/pull/5176 +- DietPi-Drive_Manager | The Samba mount dialogues do now indicate that a hostname can be entered instead of a server IP and a shared folder path instead of a share name only. - DietPi-Backup | A notification is not printed when rsync dry-run to obtain required disk space is starting, since this can take a while. Many thanks to @whisdol for reporting the the impression of a hanging script: https://github.com/MichaIng/DietPi/issues/5209 Fixes: From 69cad97182a3a7ce3dca9d7a7216638106655827 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jan 2022 23:47:13 +0100 Subject: [PATCH 67/67] v8.1 - DietPi-Config | Fine tune serial console handling --- dietpi/dietpi-config | 2 +- dietpi/func/dietpi-set_hardware | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 08d28fea2e..a6cc633095 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1058,7 +1058,7 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the [[ -e $i ]] || continue i=${i#/dev/} aSTATE[$i]='Off' - systemctl -q is-active "serial-getty@$i" && aSTATE[$i]='On' + systemctl -q is-enabled "serial-getty@$i" || systemctl -q is-active "serial-getty@$i" && aSTATE[$i]='On' G_WHIP_MENU_ARRAY+=("$i console" ": [${aSTATE[$i]}]") done diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ae5b219e29..2f76020120 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1608,17 +1608,17 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # - RPi if (( $G_HW_MODEL < 10 )); then - sed -Ei "/root=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" /boot/cmdline.txt + sed -Ei "/root=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//g" /boot/cmdline.txt # - Odroid C1/C2/XU4 legacy elif [[ $G_HW_MODEL -le 12 && -f '/boot/boot.ini' ]]; then - sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" /boot/boot.ini + sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//g" /boot/boot.ini # - dietpiEnv.txt elif (( $DIETPIENV )); then - grep -q "^consoleargs=.*console=$INPUT_ADDITIONAL" $FP_UENV && sed -Ei "/^consoleargs=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//" $FP_UENV + grep -q "^consoleargs=.*console=$INPUT_ADDITIONAL" $FP_UENV && sed -Ei -e "/^consoleargs=/s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^[:blank:]]*([[:blank:]]*$)?//g" -e 's/^consoleargs=[[:blank:]]+/consoleargs=/' $FP_UENV # - Armbian: armbianEnv.txt only allows to toggle a fixed serial console depending on device elif (( $ARMBIAN )); then @@ -1638,7 +1638,7 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 elif [[ $G_HW_MODEL == 40 && -f $FP_UENV ]]; then sed -i "/^[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*[[:blank:]]*$/d" $FP_UENV # New style: One variable each line - sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line + sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//g" $FP_UENV # Old style: Multiple variables possible each line fi