From c3b13df37392bd116f80c1760eaf055922ecff97 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Mon, 22 Jan 2024 21:18:31 +0100 Subject: [PATCH 01/23] Init v9.1 (#6876) --- .meta/dietpi-survey_report | 4 +++- .update/version | 4 ++-- CHANGELOG.txt | 13 +++++++++++++ dietpi/func/dietpi-globals | 4 ++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 2a97ee0e89..6a27a30d67 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -701,16 +701,18 @@ shopt -s extglob aSOFTWARE_NAME8_24=() aSOFTWARE_NAME8_25=() aSOFTWARE_NAME9_0=() + aSOFTWARE_NAME9_1=() for i in "${!aSOFTWARE_NAME8_22[@]}" do aSOFTWARE_NAME8_23[i]=${aSOFTWARE_NAME8_22[i]} aSOFTWARE_NAME8_24[i]=${aSOFTWARE_NAME8_23[i]} aSOFTWARE_NAME8_25[i]=${aSOFTWARE_NAME8_24[i]} aSOFTWARE_NAME9_0[i]=${aSOFTWARE_NAME8_25[i]} + aSOFTWARE_NAME9_1[i]=${aSOFTWARE_NAME9_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_NAME9_0[@]}" + for i in "${aSOFTWARE_NAME9_1[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/version b/.update/version index ecd150c4be..64bd3428b0 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=9 -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=7 G_MIN_VERSION_SUB=0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 735f25c9fe..07261d7058 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,16 @@ +v9.1 +(2024-02-17) + +New images: + +Enhancements: + +Bug fixes: + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/ADDME + +----------------------------------------------------------------------------------------------------------- + v9.0 (2024-01-20) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 2f0fe36df9..551a36c087 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -54,8 +54,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 - [[ $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 f51e6ce4cfeb783df0cd6f5ab3965fc4ce988443 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Jan 2024 22:29:12 +0100 Subject: [PATCH 02/23] v9.1 - DietPi-Software | Readarr: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1caa05f941..d1361fbf0b 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10070,7 +10070,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.15.2376/Readarr.develop.0.3.15.2376.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.16.2387/Readarr.develop.0.3.16.2387.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Readarr/Readarr/releases' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}" | head -1)" G_EXEC mv Readarr /opt/readarr fi From 3483574920249abb93c87af391c8b0e9d89d11c7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Jan 2024 22:30:06 +0100 Subject: [PATCH 03/23] v9.1 - DietPi-Software | Komga: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d1361fbf0b..cf55398731 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7408,7 +7408,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.10.1/komga-1.10.1.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.10.2/komga-1.10.2.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi From 1bf981df032da49682a8290283fe60b54674c8db Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 22 Jan 2024 23:55:27 +0100 Subject: [PATCH 04/23] v9.1 (#6882) - DietPi-Software | Domoticz: Enabled for x86_64 Bookworm and Trixie systems, since the latest x86_64 builds were compiled against libssl3 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 07261d7058..46849948a8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v9.1 New images: Enhancements: +- DietPi-Software | Domoticz: Enabled for x86_64 Bookworm and Trixie systems, since the latest x86_64 builds were compiled against libssl3. Bug fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cf55398731..86bd3ee9a1 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1507,8 +1507,10 @@ Available commands: aSOFTWARE_DESC[$software_id]='Open source home automation platform' aSOFTWARE_CATX[$software_id]=17 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/home_automation/#domoticz' - # - Bookworm: No libssl3 support: https://github.com/domoticz/domoticz/issues/5233, https://github.com/MichaIng/DietPi/issues/6404 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 + # - RISC-V: Missing archive: https://github.com/domoticz/domoticz/releases, https://www.domoticz.com/downloads/ + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 + # - Bookworm/Trixie ARM: https://github.com/domoticz/domoticz/issues/5233#issuecomment-1904906172 + (( $G_HW_ARCH < 10 && $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=27 aSOFTWARE_NAME[$software_id]='TasmoAdmin' @@ -11422,7 +11424,15 @@ _EOF_ # APT deps aDEPS=('libusb-0.1-4' 'libcurl3-gnutls') # https://github.com/MichaIng/DietPi/issues/6404 - Download_Install "https://releases.domoticz.com/releases/release/domoticz_linux_${G_HW_ARCH_NAME/armv6l/armv7l}.tgz" ./domoticz + # x86_64 builds provided via GitHub differ from those provided via domoticz.com and were compiled against libssl3. Hence download those for Bookworm/Trixie systems, else the ones from domoticz.com, compiled against libssl1.1. Currently, there are not builds for ARM and libssl3. + if (( $G_HW_ARCH == 10 && $G_DISTRO > 6 )) + then + local fallback_url="https://github.com/domoticz/domoticz/releases/download/2024.1/domoticz_linux_2024.1_${G_HW_ARCH_NAME/armv6l/armv7l}.tgz" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/domoticz/domoticz/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/domoticz_linux_[^\"\/]*_${G_HW_ARCH_NAME/armv6l/armv7l}.tgz\"$/{print \$4}")" ./domoticz + else + Download_Install "https://releases.domoticz.com/releases/release/domoticz_linux_${G_HW_ARCH_NAME/armv6l/armv7l}.tgz" ./domoticz + fi + # Reinstall: Clean old install dir [[ -d '/opt/domoticz' ]] && G_EXEC rm -R /opt/domoticz G_EXEC mv domoticz /opt/ From 9757e455d20f1920bbc9f8dd5b815558d7586658 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Jan 2024 13:34:54 +0100 Subject: [PATCH 05/23] v9.1 - DietPi-Software | Komga: Update fallback URL --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 86bd3ee9a1..26f2c8969f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7406,11 +7406,12 @@ _EOF_ if To_Install 179 komga # Komga then + # Komga v1 requires Java >=17: https://komga.org/blog/prepare-v1/ if (( $G_HW_ARCH == 1 )) then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.10.2/komga-1.10.2.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.10.3/komga-1.10.3.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi From da0a22a69a62c4ec59cb194475b3f8dddd2b4a94 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Jan 2024 21:49:20 +0100 Subject: [PATCH 06/23] v9.1 - DietPi-Software | Pydio: Disable for Bookworm/Trixie, since it does not support PHP 8 well - DietPi-Software | Assure that all software titles which ar e disabled for Bookworm, are disabled for Trixie as well (given that the underlying reason applies to everything newer than Bullseye) --- .conf/dps_48/apache.pydio.conf | 3 --- dietpi/dietpi-software | 14 ++++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.conf/dps_48/apache.pydio.conf b/.conf/dps_48/apache.pydio.conf index 5d94c776b4..63a29aefa8 100644 --- a/.conf/dps_48/apache.pydio.conf +++ b/.conf/dps_48/apache.pydio.conf @@ -5,7 +5,4 @@ # Parse .htaccess (e.g. pydio/data access denial) AllowOverride All - # Disable PHP output buffering, recommended by Pydio - php_admin_value output_buffering Off - diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 26f2c8969f..fb45ab470c 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -518,8 +518,8 @@ Available commands: aSOFTWARE_DEPS[$software_id]='5' # - RISC-V: No package: https://github.com/dtcooper/raspotify/releases aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 - # - Bookworm on ARMv6 (older package): "/usr/bin/librespot: error while loading shared libraries: ld-linux.so.3: cannot open shared object file: No such file or directory" - (( $G_HW_ARCH == 1 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 + # - Bookworm/Trixie on ARMv6 (older package): "/usr/bin/librespot: error while loading shared libraries: ld-linux.so.3: cannot open shared object file: No such file or directory" + (( $G_HW_ARCH == 1 && $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=80 aSOFTWARE_NAME[$software_id]='Ubooquity' @@ -586,8 +586,8 @@ Available commands: # - ARMv8/RISC-V: No archive: https://github.com/Spotifyd/spotifyd/releases aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 - # - Bookworm on x86_64 since "full" binary depends on libssl1.1 while "default" and "slim" support PulseAudio backend only - (( $G_HW_ARCH == 10 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 + # - Bookworm/Trixie on x86_64 since "full" binary depends on libssl1.1 while "default" and "slim" support PulseAudio backend only + (( $G_HW_ARCH == 10 && $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=204 aSOFTWARE_NAME[$software_id]='Navidrome' @@ -759,8 +759,8 @@ Available commands: aSOFTWARE_CATX[$software_id]=4 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#owncloud' aSOFTWARE_DEPS[$software_id]='88 89 91 webserver' - # - Bookworm: No PHP 8.x support yet - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 + # - Bookworm/Trixie: No PHP 8.x support yet + (( $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=114 aSOFTWARE_NAME[$software_id]='Nextcloud' @@ -785,6 +785,8 @@ Available commands: aSOFTWARE_CATX[$software_id]=4 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#pydio' aSOFTWARE_DEPS[$software_id]='88 89 webserver' + # - Bookworm/Trixie: No support for PHP 8: https://github.com/MichaIng/DietPi/issues/3469 + (( $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=111 aSOFTWARE_NAME[$software_id]='UrBackup Server' From ed90bfe12d831154446e5aaa9f97f701440af65a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jan 2024 23:22:56 +0100 Subject: [PATCH 07/23] v9.1 - Orange Pi Zero 3 | Use Armbian kernel and only on 1.5G RAM model the Orange Pi bootloader --- .build/images/dietpi-installer | 99 +++++++++++++--------------------- .github/workflows/quartz64.yml | 2 +- 2 files changed, 37 insertions(+), 64 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index bc202dc0a1..16aa3eb974 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -675,7 +675,10 @@ setenv rootuuid "true"' /boot/boot.cmd 40|44) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-a64' /boot/dietpiEnv.txt;; 45) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h6' /boot/dietpiEnv.txt;; 57|65|67) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h5' /boot/dietpiEnv.txt;; - 83) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h616' /boot/dietpiEnv.txt; armbian_repo=0;; + 83) + G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h616' /boot/dietpiEnv.txt + (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=allwinner/sun50i-h618-orangepi-zero3.dtb' /boot/dietpiEnv.txt + ;; *) :;; esac case $G_HW_MODEL in @@ -904,16 +907,9 @@ _EOF_ 'usbutils' # "lsusb", used by DietPi-Software + DietPi-BugReport ) - # Skip entropy daemon on all devices but those with old kernel - if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] # NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC + # Install entropy daemon on SBCs with ancient kernel: NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC + if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] # then - : - - # Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, else haveged: https://github.com/MichaIng/DietPi/issues/2806 - elif [[ $G_HW_MODEL -lt 10 || $G_HW_MODEL =~ ^(14|15|16|24|29|42|46|58|68|72|74|76|78|79|80|81|82|83|84|85|86)$ ]] # RPi, S922X, Odroid C4, RK3399 - 47 NanoPi R4S, Radxa Zero, NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5, VisionFive 2, Orange Pi 5 Plus - then - aPACKAGES_REQUIRED_INSTALL+=('rng-tools5') - else aPACKAGES_REQUIRED_INSTALL+=('haveged') # https://github.com/MichaIng/DietPi/issues/4710 if (( $G_HW_ARCH == 2 )) @@ -1055,6 +1051,7 @@ _EOF_ 78) model='rock-5b' kernel='rk35xx' branch='legacy';; 80) model='orangepi5' kernel='rk35xx' branch='legacy';; 82) model='orangepi5-plus' kernel='rk35xx' branch='legacy';; + 83) model='orangepizero3' kernel='sunxi64';; 85) model='rock-5a' kernel='rk35xx' branch='legacy';; 86) model='tinkerboard-2' kernel='rockchip64';; 87) model='orangepi3b' kernel='rockchip64'; branch='edge';; @@ -1108,11 +1105,21 @@ _EOF_ # G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb # G_EXEC rm package1.deb package2.deb #fi - G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" + # Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader + if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) + then + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next_1.5G.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + G_AGI linux-{image,dtb}-"$branch-$kernel" ./package.deb + G_EXEC rm package.deb + else + G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" + fi # Cleanup [[ $G_HW_MODEL != 10 && -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next [[ -f '/boot/armbianEnv.txt' ]] && G_EXEC rm /boot/armbianEnv.txt + [[ -f '/boot/orangepiEnv.txt' ]] && G_EXEC rm /boot/orangepiEnv.txt [[ -f '/boot/uEnv.txt' ]] && G_EXEC rm /boot/uEnv.txt # Compile U-Boot script [[ -f '/boot/boot.cmd' ]] && G_EXEC mkimage -C none -A "$arch" -T script -d /boot/boot.cmd /boot/boot.scr @@ -1166,6 +1173,24 @@ _EOF_ G_EXEC dd if=/dev/zero "of=$BOOT_DEVICE" bs=1K count=1023 seek=1 conv=notrunc,fdatasync G_EXEC dd if=u-boot "of=$BOOT_DEVICE" bs=1K seek=8 conv=notrunc,fdatasync G_EXEC rm u-boot + + # Orange Pi Zero 3: Apply device tree adjustment for Ethernet adapter + elif (( $G_HW_MODEL == 83 )) + then + # shellcheck disable=SC2016 + sed --follow-symlinks -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\ +if test "${ethernet_phy}" = "rtl8211f"; then\ + echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ + fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<3100>"\ + fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<700>"\ +elif test "${ethernet_phy}" = "yt8531c"; then\ + echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ + fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<0>"\ + fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<600>"\ +else\ + echo "Ethernet adapter: \\"${ethernet_phy}\\""\ +fi\ +' /boot/boot.cmd fi # Skip creating kernel symlinks and remove existing ones @@ -1261,58 +1286,6 @@ _EOF_ G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf aPACKAGES_REQUIRED_INSTALL+=('linux-image-star64' 'libubootenv-tool') - # Orange Pi Zero 3 - elif (( $G_HW_MODEL == 83 )) - then - # Install firmware and initramfs - G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/orangepi-firmware.deb' - G_AGI initramfs-tools u-boot-tools ./package1.deb zstd - [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf - - # Install kernel and U-Boot packages - G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/linux-image-next-sun50iw9.deb' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb 'https://dietpi.com/downloads/binaries/linux-dtb-next-sun50iw9.deb' - local variant= - (( $HW_VARIANT == 2 )) && variant='_1.5G' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb "https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next$variant.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb - G_EXEC rm package1.deb package2.deb package3.deb - aPACKAGES_REQUIRED_INSTALL+=('linux-image-next-sun50iw9' 'linux-dtb-next-sun50iw9' 'linux-u-boot-orangepizero3-next') - - # Flash U-Boot - # shellcheck disable=SC1091 - . /usr/lib/u-boot/platform_install.sh - # shellcheck disable=SC2154 - write_uboot_platform "$DIR" "$BOOT_DEVICE" - - # Apply device tree adjustment for Ethernet adapter - # shellcheck disable=SC2016 - sed --follow-symlinks -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\ -if test "${ethernet_phy}" = "rtl8211f"; then\ - echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ - fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<3100>"\ - fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<700>"\ -elif test "${ethernet_phy}" = "yt8531c"; then\ - echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ - fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<0>"\ - fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<600>"\ -else\ - echo "Ethernet adapter: \\"${ethernet_phy}\\""\ -fi\ -' /boot/boot.cmd - # Compile U-Boot script - G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr - - # 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 rm -Rf /etc/apt/sources.list.d/{,.??,.[^.]}* - - # Cleanup - [[ -f '/boot/orangepiEnv.txt' ]] && G_EXEC rm /boot/orangepiEnv.txt - # Sparky SBC elif (( $G_HW_MODEL == 70 )) then diff --git a/.github/workflows/quartz64.yml b/.github/workflows/quartz64.yml index c508f04166..bc397ce3d7 100644 --- a/.github/workflows/quartz64.yml +++ b/.github/workflows/quartz64.yml @@ -110,7 +110,7 @@ jobs: BOOT_DRIVE=$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -T /boot)") if [ $BOOT_DRIVE ] then - echo "Flashing to detected boot drive: $BOOT_DRIVE" + echo "Flashing to detected boot drive: $BOOT_DRIVE" else echo 'ERROR: Unable to detect boot drive, aborting U-Boot flashing' exit 1 From 13b0f3eb4d91e3be398e7eb454ff977a84eb2da6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jan 2024 23:38:45 +0100 Subject: [PATCH 08/23] v9.1 - Orange Pi Zero 3 | Install newer kernel from our server --- .build/images/dietpi-installer | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 16aa3eb974..c598619cab 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1098,13 +1098,13 @@ _EOF_ G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version - #if [[ $G_HW_MODEL =~ ^(78|80|82)$ || ( $kernel == 'rockchip64' && $branch == 'current' ) ]] - #then - # G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" - # G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" - # G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb - # G_EXEC rm package1.deb package2.deb - #fi + if (( $G_HW_MODEL == 83 )) + then + G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" + G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb + G_EXEC rm package1.deb package2.deb + fi # Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) then From eb071d8ccffb458c5ca230926bc91adac8ab0245 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 25 Jan 2024 23:55:04 +0100 Subject: [PATCH 09/23] v9.1 - Orange Pi Zero 3 | Install as well Armbian bootloader from our server --- .build/images/dietpi-installer | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index c598619cab..975a89c2b4 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1102,8 +1102,10 @@ _EOF_ then G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb - G_EXEC rm package1.deb package2.deb + local uboot=() + (( $HW_VARIANT == 1 )) && { G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"; uboot=('package3.deb'); } + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb "${uboot[@]}" + G_EXEC rm package1.deb package2.deb "${uboot[@]}" fi # Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) From f843301911bbbf58138bda9ee2f2a032a50645f7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 00:17:32 +0100 Subject: [PATCH 10/23] v9.1 - dietpi-rpi-firmware-migration | Stop services and unmount /boot before editing fstab, to keep the changes minimal if this unmounting fails --- .meta/dietpi-rpi-firmware-migration | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 18ee47996d..665e4ac2ae 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -12,7 +12,9 @@ G_CHECK_FREESPACE / 200 G_INIT # Import DietPi-Globals --------------------------------------------------------------- +export DISABLE_SERVICES_START=1 /boot/dietpi/dietpi-update 1 +/boot/dietpi/dietpi-services stop # Temporary rootfs mount G_EXEC mkdir -p rootfs @@ -23,12 +25,12 @@ G_EXEC cp -an /boot/dietpi* rootfs/boot/ G_EXEC chmod -x rootfs/boot/dietpi{.txt,/.??*,/func/dietpi-globals} # Remount bootfs to /boot/firmware -G_EXEC mkdir -p rootfs/boot/firmware +findmnt -M /boot &> /dev/null && G_EXEC umount /boot +G_EXEC umount rootfs +G_EXEC mkdir -p /boot/firmware G_EXEC sed -i 's|[[:blank:]]/boot[[:blank:]]| /boot/firmware |' /etc/fstab G_EXEC systemctl daemon-reload -findmnt -M /boot &> /dev/null && G_EXEC umount /boot findmnt -M /boot/firmware &> /dev/null || G_EXEC mount /boot/firmware -G_EXEC umount rootfs # Generate config symlinks G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt From 42f20a85126d0b76074713870415547714608402 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 16:37:39 +0100 Subject: [PATCH 11/23] v9.1 - DietPi-Software | Nextcloud: Update Nginx config --- .conf/dps_114/nginx.nextcloud.conf | 7 ++- .update/patches | 28 ++++++++--- dietpi/dietpi-software | 77 +++++++++++------------------- 3 files changed, 54 insertions(+), 58 deletions(-) diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index d537626e4b..c49fe0cf3d 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -77,9 +77,14 @@ location ^~ /nextcloud { fastcgi_max_temp_file_size 0; # Allow downloads > 1 GiB: https://github.com/nextcloud/documentation/pull/7979 } + types { + text/javascript js mjs; + application/wasm wasm; + } + location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri /nextcloud/index.php$request_uri; - expires 6M; # Cache-Control policy borrowed from `.htaccess` + add_header Cache-Control "public, max-age=15778463$asset_immutable"; access_log off; # Optional: Don't log access to assets } diff --git a/.update/patches b/.update/patches index 3c3968ce67..39e3acb830 100755 --- a/.update/patches +++ b/.update/patches @@ -1547,13 +1547,6 @@ Patch_9_0() G_EXEC curl -sSfo /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/lighttpd.nextcloud.conf" [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf.dietpi-new fi - # - Nginx - if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] - then - G_EXEC mv /etc/nginx/sites-dietpi/dietpi-nextcloud.conf /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-old - G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" - [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new - fi # Kodi [[ -f '/usr/share/applications/kodi.desktop' ]] && G_CONFIG_INJECT 'Exec=' 'Exec=kodi --standalone' /usr/share/applications/kodi.desktop @@ -1575,6 +1568,27 @@ Patch_9_0() fi } +Patch_9_0() +{ + # Software updates and migrations + if [[ -f '/boot/dietpi/.installed' ]] + then + # Nextcloud + # - Nginx + if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] + then + echo '# Set the `immutable` cache control option for assets with a cache busting `v` argument +map $arg_v $asset_immutable { + "" ""; + default ", immutable"; +}' > /etc/nginx/conf.d/dietpi-nextcloud.conf + G_EXEC mv /etc/nginx/sites-dietpi/dietpi-nextcloud.conf /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-old + G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" + [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new + fi + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fb45ab470c..6df9ca07c8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4379,8 +4379,8 @@ _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 - if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )) + then 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' @@ -4388,17 +4388,13 @@ _EOF_ dps_index=$software_id Download_Install 'apache.owncloud.conf' "$owncloud_conf" a2ensite dietpi-owncloud 1> /dev/null # Cal/CardDAV redirects to ownCloud DAV endpoint - if [[ ! -f '/etc/apache2/conf-available/dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: + echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: Redirect 301 /.well-known/carddav /owncloud/remote.php/dav Redirect 301 /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/conf-available/dietpi-dav_redirect.conf - a2enconf dietpi-dav_redirect - - fi - - elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then + a2enconf dietpi-dav_redirect + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) + then G_DIETPI-NOTIFY 2 'Lighttpd webserver found, enabling ownCloud specific configuration.' # Enable required modules @@ -4413,34 +4409,24 @@ Redirect 301 /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/conf- G_EXEC lighty-enable-mod rewrite dietpi-owncloud # Cal/CardDAV redirects to ownCloud DAV endpoint - if [[ ! -f '/etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: + echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: url.redirect += ( "^/.well-known/caldav" => "/owncloud/remote.php/dav", "^/.well-known/carddav" => "/owncloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf - G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already - G_EXEC lighty-enable-mod dietpi-dav_redirect - - fi - - elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then + [[ -f '/etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf' ]] || G_EXEC lighty-enable-mod dietpi-dav_redirect + elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) + then 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' [[ -f $owncloud_conf ]] && G_EXEC mv "$owncloud_conf" "$owncloud_conf.dietpi-old" dps_index=$software_id Download_Install 'nginx.owncloud.conf' "$owncloud_conf" # Cal/CardDAV redirects to ownCloud DAV endpoint - if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: + 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 - - fi - fi # Start MariaDB and Redis (for reinstalls) for database creation and occ command @@ -4618,8 +4604,8 @@ The install script will now exit. After applying one of the the above, rerun die 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 - + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )) + then G_DIETPI-NOTIFY 2 'Apache webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration a2enmod rewrite headers env dir mime 1> /dev/null local nextcloud_conf='/etc/apache2/sites-available/dietpi-nextcloud.conf' @@ -4627,17 +4613,13 @@ The install script will now exit. After applying one of the the above, rerun die dps_index=$software_id Download_Install 'apache.nextcloud.conf' "$nextcloud_conf" a2ensite dietpi-nextcloud 1> /dev/null # Cal/CardDAV redirects to Nextcloud DAV endpoint - if [[ ! -f '/etc/apache2/conf-available/dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: + echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2/conf-available/dietpi-dav_redirect.conf - a2enconf dietpi-dav_redirect - - fi - - elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then + a2enconf dietpi-dav_redirect + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) + then G_DIETPI-NOTIFY 2 'Lighttpd webserver found, enabling Nextcloud specific configuration.' # Enable required modules @@ -4652,34 +4634,29 @@ Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2/conf G_EXEC lighty-enable-mod rewrite dietpi-nextcloud # Cal/CardDAV redirects to Nextcloud DAV endpoint - if [[ ! -f '/etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: + echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: url.redirect += ( "^/.well-known/caldav" => "/nextcloud/remote.php/dav", "^/.well-known/carddav" => "/nextcloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf - G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already - G_EXEC lighty-enable-mod dietpi-dav_redirect - - fi - - elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then + [[ -f '/etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf' ]] || G_EXEC lighty-enable-mod dietpi-dav_redirect + elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) + then G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html + echo '# Set the `immutable` cache control option for assets with a cache busting `v` argument +map $arg_v $asset_immutable { + "" ""; + default ", immutable"; +}' > /etc/nginx/conf.d/dietpi-nextcloud.conf local nextcloud_conf='/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' [[ -f $nextcloud_conf ]] && G_EXEC mv "$nextcloud_conf" "$nextcloud_conf.dietpi-old" dps_index=$software_id Download_Install 'nginx.nextcloud.conf' "$nextcloud_conf" # Cal/CardDAV redirects to Nextcloud DAV endpoint - if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then - - echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: + 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 - - fi - fi # Start MariaDB and Redis (for reinstalls) for database creation and ncc command From 023b15fa76af2921e7a09ff0569bf52f6a74784b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 17:15:10 +0100 Subject: [PATCH 12/23] v9.1 - DietPi-Software | Nextcloud: Re-add Nginx security headers for assets - META | Satisfy shellcheck --- .build/images/dietpi-installer | 4 ++-- .conf/dps_114/nginx.nextcloud.conf | 9 +++++++++ .update/patches | 2 +- dietpi/dietpi-software | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 975a89c2b4..b2ae757292 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -908,7 +908,7 @@ _EOF_ ) # Install entropy daemon on SBCs with ancient kernel: NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC - if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] # + if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] then aPACKAGES_REQUIRED_INSTALL+=('haveged') # https://github.com/MichaIng/DietPi/issues/4710 @@ -1178,7 +1178,7 @@ _EOF_ # Orange Pi Zero 3: Apply device tree adjustment for Ethernet adapter elif (( $G_HW_MODEL == 83 )) - then + then # shellcheck disable=SC2016 sed --follow-symlinks -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\ if test "${ethernet_phy}" = "rtl8211f"; then\ diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index c49fe0cf3d..8e38802989 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -84,7 +84,16 @@ location ^~ /nextcloud { location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri /nextcloud/index.php$request_uri; + # HTTP response headers borrowed from Nextcloud `.htaccess` add_header Cache-Control "public, max-age=15778463$asset_immutable"; + #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always; + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "noindex, nofollow" always; + add_header X-XSS-Protection "1; mode=block" always; access_log off; # Optional: Don't log access to assets } diff --git a/.update/patches b/.update/patches index 39e3acb830..4bc0ea4b29 100755 --- a/.update/patches +++ b/.update/patches @@ -1577,7 +1577,7 @@ Patch_9_0() # - Nginx if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] then - echo '# Set the `immutable` cache control option for assets with a cache busting `v` argument + echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument map $arg_v $asset_immutable { "" ""; default ", immutable"; diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6df9ca07c8..2a2b8a3a62 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4644,7 +4644,7 @@ url.redirect += ( elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) then G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html - echo '# Set the `immutable` cache control option for assets with a cache busting `v` argument + echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument map $arg_v $asset_immutable { "" ""; default ", immutable"; From fb14aac7d227e05936439844f0c77e28200ca10b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 17:21:56 +0100 Subject: [PATCH 13/23] v9.1 - META | Now really satisfy shellcheck --- .update/patches | 1 + dietpi/dietpi-software | 1 + 2 files changed, 2 insertions(+) diff --git a/.update/patches b/.update/patches index 4bc0ea4b29..809c86ca80 100755 --- a/.update/patches +++ b/.update/patches @@ -1577,6 +1577,7 @@ Patch_9_0() # - Nginx if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] then + # shellcheck disable=SC2016 echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument map $arg_v $asset_immutable { "" ""; diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2a2b8a3a62..a102449340 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4644,6 +4644,7 @@ url.redirect += ( elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) then G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html + # shellcheck disable=SC2016 echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument map $arg_v $asset_immutable { "" ""; From db3f6bf03c55893f5ebf44e6b46e56887f021f0b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 19:07:35 +0100 Subject: [PATCH 14/23] v9.1 - DietPi-Software | Mosquitto: Resolved an issue where the global software password was accidentally applied as username instead of as password: https://github.com/MichaIng/DietPi/issues/6886 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 46849948a8..d8bd9ea8d3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ Enhancements: - DietPi-Software | Domoticz: Enabled for x86_64 Bookworm and Trixie systems, since the latest x86_64 builds were compiled against libssl3. Bug fixes: +- DietPi-Software | Mosquitto: Resolved an issue where the global software password was accidentally applied as username instead of as password: https://github.com/MichaIng/DietPi/issues/6886 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/ADDME diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a102449340..f00faf5136 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6676,7 +6676,7 @@ _EOF_ if [[ ! -f '/etc/mosquitto/passwd' ]] then G_EXEC umask 0037 # relevant for passwd mode until v2.0.18 - G_EXEC_PRE_FUNC(){ acommand[4]=$GLOBAL_PW; } + G_EXEC_PRE_FUNC(){ acommand[5]=$GLOBAL_PW; } G_EXEC mosquitto_passwd -c -b /etc/mosquitto/passwd mosquitto "${GLOBAL_PW//?/X}" G_EXEC chown root:mosquitto /etc/mosquitto/passwd G_EXEC chmod 0640 /etc/mosquitto/passwd # from v2.0.18 on, 0600 is the default mode, hence the "mosquitto" user has no read access From 593dd864b011a99d627651388ffb37d5d5c663ed Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 19:11:00 +0100 Subject: [PATCH 15/23] v9.1 - DietPi-Software | Rclone: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f00faf5136..bfe47a1a3e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11546,7 +11546,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.65.1/rclone-v1.65.1-linux-$arch.deb" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.65.2/rclone-v1.65.2-linux-$arch.deb" Download_Install "$(curl -sSfL 'https://api.github.com/repos/rclone/rclone/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/rclone-v[^\"\/]*-linux-$arch.deb\"$/{print \$4}")" fi fi From 54ae72e7b6c75a7b469fda45f6e1aa12e4fb27d9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 26 Jan 2024 21:58:05 +0100 Subject: [PATCH 16/23] v9.1 - Orange Pi Zero 3 | Remove obsolete Ethernet adapter device tree adjustments --- .build/images/dietpi-installer | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index b2ae757292..3e6b2ffbd8 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1175,24 +1175,6 @@ _EOF_ G_EXEC dd if=/dev/zero "of=$BOOT_DEVICE" bs=1K count=1023 seek=1 conv=notrunc,fdatasync G_EXEC dd if=u-boot "of=$BOOT_DEVICE" bs=1K seek=8 conv=notrunc,fdatasync G_EXEC rm u-boot - - # Orange Pi Zero 3: Apply device tree adjustment for Ethernet adapter - elif (( $G_HW_MODEL == 83 )) - then - # shellcheck disable=SC2016 - sed --follow-symlinks -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\ -if test "${ethernet_phy}" = "rtl8211f"; then\ - echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ - fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<3100>"\ - fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<700>"\ -elif test "${ethernet_phy}" = "yt8531c"; then\ - echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\ - fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<0>"\ - fdt set "/soc/ethernet@5020000" "allwinner,tx-delay-ps" "<600>"\ -else\ - echo "Ethernet adapter: \\"${ethernet_phy}\\""\ -fi\ -' /boot/boot.cmd fi # Skip creating kernel symlinks and remove existing ones From 7270e1488eb2015b79a6de0ef19446f807f1887c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 27 Jan 2024 19:13:01 +0100 Subject: [PATCH 17/23] v9.1 - DietPi-Installer | Orange Pi Zero 3: Have WiFi kernel modules loaded on first boot --- .build/images/dietpi-installer | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 3e6b2ffbd8..d85629de4e 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -2112,6 +2112,10 @@ SUBSYSTEM=="leds", KERNEL=="lan2_led", ACTION=="add", ATTR{trigger}="netdev", AT SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1" SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1" _EOF_ + # Orange Pi 3B/Zero 3: Module does not load automatically, but we want it loaded on first boot in case firstrun setup is done via WiFi + elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] + then + G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi # Armbian From 2d81b5e0a13ee6aaf18bf1df6c4b36b495e55797 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 28 Jan 2024 23:17:13 +0100 Subject: [PATCH 18/23] v9.1 - DietPi-Software | Readarr: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bfe47a1a3e..9a8a2c91bb 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10053,7 +10053,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.16.2387/Readarr.develop.0.3.16.2387.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.17.2409/Readarr.develop.0.3.17.2409.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Readarr/Readarr/releases' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}" | head -1)" G_EXEC mv Readarr /opt/readarr fi From 15ff5a365b33f29cb9cbf0a5677a80a4ba0f2b70 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 1 Feb 2024 12:21:09 +0100 Subject: [PATCH 19/23] v9.1 - DietPi-Software | Amiberry: Resolved an issue where the installation failed on 64-bit RPi systems. Many thanks to @JerichoCross for reporting this issue: https://github.com/MichaIng/DietPi/issues/6893 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d8bd9ea8d3..130ce9678a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Enhancements: Bug fixes: - DietPi-Software | Mosquitto: Resolved an issue where the global software password was accidentally applied as username instead of as password: https://github.com/MichaIng/DietPi/issues/6886 +- DietPi-Software | Amiberry: Resolved an issue where the installation failed on 64-bit RPi systems. Many thanks to @JerichoCross for reporting this issue: https://github.com/MichaIng/DietPi/issues/6893 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/ADDME diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9a8a2c91bb..3f57102d7d 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5171,7 +5171,7 @@ _EOF_ then (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL-sdl2" # ID 0 is rpi1 # 64-bit: For RPi 2 v1.2 use RPi 3 64-bit build - (( $G_HW_ARCH == 3 )) && platform="${platform/[12]/3}-64-sdl2" + (( $G_HW_ARCH == 3 )) && platform="rpi${G_HW_MODEL/2/3}-64-sdl2" /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d elif (( $G_HW_MODEL == 10 )) # Odroid C1 From 9acca8f4364190d1cec0ce1dccbb5c3dee28bac8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 1 Feb 2024 19:48:27 +0100 Subject: [PATCH 20/23] v9.1 - Raspberry Pi Trixie | Align and apply workaround for FFmpeg installs on RPi Trixie systems: The package from the RPi (Bookworm) repo has a higher epoch version, but of course its dependencies cannot be satisfied with Trixie library versions. Hence assure that all packages from the "ffmpeg" source are always pulled from Debian/Raspbian instead. --- .build/images/dietpi-installer | 6 +----- .github/workflows/dietpi-software.bash | 6 +----- .update/pre-patches | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index d85629de4e..6babd391e5 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -795,11 +795,7 @@ setenv rootuuid "true"' /boot/boot.cmd if (( $DISTRO_TARGET > 7 )) then G_DIETPI-NOTIFY 2 'Enforcing Debian Trixie FFmpeg packages over RPi repo ones' - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-ffmpeg -Package: src:ffmpeg -Pin: origin archive.raspberrypi.org -Pin-Priority: -1 -_EOF_ + G_EXEC eval 'echo -e '\''Package: src:ffmpeg\nPin: origin archive.raspberrypi.com\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-ffmpeg' fi fi diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 5898340966..69225e7e84 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -303,11 +303,7 @@ then G_EXEC dpkg --root=rootfs -i keyring.deb G_EXEC rm keyring.deb # Enforce Debian Trixie FFmpeg packages over RPi repo ones - [[ $DISTRO != 'trixie' ]] || cat << '_EOF_' > rootfs/etc/apt/preferences.d/dietpi-ffmpeg || exit 1 -Package: src:ffmpeg -Pin: origin archive.raspberrypi.com -Pin-Priority: -1 -_EOF_ + [[ $DISTRO == 'trixie' ]] && G_EXEC eval 'echo -e '\''Package: src:ffmpeg\nPin: origin archive.raspberrypi.com\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-ffmpeg' fi # Install test builds from dietpi.com if requested diff --git a/.update/pre-patches b/.update/pre-patches index e60a2b2835..0aa326106d 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -289,9 +289,8 @@ then # RPi/ARMv6 container Bookworm elif [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/raspi.list' ]] then - G_DIETPI-NOTIFY 2 'Migrating RPi APT repository to Bookworm and removing obsolete FFmpeg workaround' + G_DIETPI-NOTIFY 2 'Migrating RPi APT repository to Bookworm' G_EXEC eval 'echo '\''deb https://archive.raspberrypi.com/debian/ bookworm main'\'' > /etc/apt/sources.list.d/raspi.list' - [[ -f '/etc/apt/preferences.d/dietpi-ffmpeg' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-ffmpeg G_DIETPI-NOTIFY 2 'Removing faulty non-free-firmware component if present' (( $G_RASPBIAN )) && G_EXEC sed --follow-symlinks -i 's/ non-free-firmware$//' /etc/apt/sources.list @@ -382,5 +381,16 @@ then grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/server_version-6" > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/pre-patch_file" > /boot/dietpi/patch_file fi +# v9.1 +if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 1 ) )) +then + # RPi/ARMv6 container Trixie + elif [[ $G_DISTRO -ge 8 && -f '/etc/apt/sources.list.d/raspi.list' ]] + then + G_DIETPI-NOTIFY 2 'Adding FFmpeg workaround for RPi Trixie systems' + G_EXEC eval 'echo -e '\''Package: src:ffmpeg\nPin: origin archive.raspberrypi.com\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-ffmpeg' + fi +fi + exit 0 } From 611f346b41e02bd74cf7aaffdfb9251a09bf56e6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 1 Feb 2024 20:08:37 +0100 Subject: [PATCH 21/23] v9.1 - DietPi-Installer | Do NOT install haveged on any other system than those 3 with ancient kernels --- .build/images/dietpi-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 6babd391e5..ad503a6ae5 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -904,7 +904,7 @@ setenv rootuuid "true"' /boot/boot.cmd ) # Install entropy daemon on SBCs with ancient kernel: NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC - if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] + if [[ $G_HW_MODEL =~ ^(61|62|70)$ ]] then aPACKAGES_REQUIRED_INSTALL+=('haveged') # https://github.com/MichaIng/DietPi/issues/4710 From 9de58e6a919505b1b02b87ec6664b44e052c12d7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 1 Feb 2024 20:18:37 +0100 Subject: [PATCH 22/23] v9.1 - DiePi-Pre-patches | Syntax --- .update/pre-patches | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/pre-patches b/.update/pre-patches index 0aa326106d..baf5c0d323 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -385,11 +385,11 @@ fi if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 1 ) )) then # RPi/ARMv6 container Trixie - elif [[ $G_DISTRO -ge 8 && -f '/etc/apt/sources.list.d/raspi.list' ]] + if [[ $G_DISTRO -ge 8 && -f '/etc/apt/sources.list.d/raspi.list' ]] then G_DIETPI-NOTIFY 2 'Adding FFmpeg workaround for RPi Trixie systems' G_EXEC eval 'echo -e '\''Package: src:ffmpeg\nPin: origin archive.raspberrypi.com\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-ffmpeg' - fi + fi fi exit 0 From ad74fa67f8ade25372d093bcd9c7459b384513d0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 1 Feb 2024 21:34:58 +0100 Subject: [PATCH 23/23] v9.1 - DietPi-Software | Update fallback URL --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3f57102d7d..3e63517419 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6477,7 +6477,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.54.0/frp_0.54.0_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/fatedier/frp/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/frp_[0-9.]*_linux_$arch\.tar\.gz\"/{print \$4}")" G_EXEC cd frp_* @@ -10553,7 +10553,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.4/gitea-1.21.4-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.5/gitea-1.21.5-linux-$arch.xz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | mawk -F\" "/\"browser_download_url\": \".*\/gitea-[^\"\/]*-linux-$arch\.xz\"/{print \$4}")" /mnt/dietpi_userdata/gitea/gitea # User