diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index fb08611d90..53ace2c6d5 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -92,8 +92,8 @@ case $HW_MODEL in 0) iname='RPi' HW_ARCH=${HW_ARCH:-1} boot_size=128 root_size=895;; 1) iname='RPi1' HW_ARCH=1 boot_size=128 root_size=895;; 2) iname='RPi2' HW_ARCH=2 boot_size=128 root_size=895;; - 4) iname='RPi234' HW_ARCH=3 boot_size=128 root_size=895;; - 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;; + 4) iname='RPi234' HW_ARCH=3 boot_size=128 root_size=1000;; + 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=1000;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=800;; 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1148;; @@ -139,24 +139,26 @@ case $HW_MODEL in 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1100;; 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1148;; 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=575;; - '76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; - '76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; - 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; + '76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + '76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; - 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; + 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;; 84) iname='Star64' HW_ARCH=11 root_size=639;; 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1100;; - 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; + 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 88) iname='OrangePiZero2W' HW_ARCH=3 partition_start=4 root_size=1148;; 89) iname='OrangePi3LTS' HW_ARCH=3 partition_start=4 root_size=1000;; - 90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; + 90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + 91) iname='OrangePi5Max' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + 92) iname='NanoPiM6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; esac @@ -614,7 +616,7 @@ _EOF_ # Force ARMv6 arch on Raspbian # shellcheck disable=SC2015 - (( $HW_ARCH > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /usr/bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' + (( $HW_ARCH > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' # Skip filesystem expansion G_EXEC rm rootfs/etc/systemd/system/local-fs.target.wants/dietpi-fs_partition_resize.service diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 7c5f21817e..28704f039a 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -761,11 +761,8 @@ _EOF_ (( $SKIP_ARCHIVE )) && exit 0 # Generate xz archive - # NB: LZMA2 ultra compression requires much memory per thread. 1 GiB is not sufficient for >2 threads, hence use "-T2" to limit used CPU threads to "2" on 1 GiB devices with more than two cores. - local threads=0 - (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && threads=2 [[ -f $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz ]] && G_EXEC rm "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" - G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -k "-T$threads" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" + G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -T0 -M75% -k "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz' > '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256'" local signature=() sig_text='' [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" || exit 1; signature=("$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.asc") sig_text="\nSignature: $PWD/${signature[*]}"; } diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index f60c82ddf2..5216874c02 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -416,6 +416,7 @@ _EOF_ '79.1' ': NanoPi R6S' '79.2' ': NanoPi R6C' '79.3' ': NanoPC T6' + '92' ': NanoPi M6' '72.1' ': ROCK 4 (all other variants)' '72.2' ': ROCK 4 SE' '72.3' ': ROCK 4C Plus' @@ -429,6 +430,7 @@ _EOF_ '89' ': Orange Pi 3 LTS' '80' ': Orange Pi 5' '82' ': Orange Pi 5 Plus' + '91' ': Orange Pi 5 Max' '83' ': Orange Pi Zero 3' '88' ': Orange Pi Zero 2W' '86' ': ASUS Tinker Board 2' @@ -628,7 +630,7 @@ _EOF_ G_EXEC mv "$dir/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot - elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87|88|89|90)$ ]] + elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87|88|89|90|91|92)$ ]] then armbian_packages=1 G_EXEC mv "$dir/.build/images/U-Boot/boot.cmd" /boot/boot.cmd @@ -669,7 +671,7 @@ setenv rootuuid "true"' /boot/boot.cmd (( $G_HW_MODEL == 15 )) && G_EXEC eval 'echo '\''meson_rng'\'' > /etc/modules-load.d/dietpi-hwrng.conf' # Rockchip 64-bit (configs work with Amlogic OOTB) - elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87|90)$ ]] + elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87|90|91|92)$ ]] then G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x9000000"' /boot/boot.cmd @@ -697,20 +699,19 @@ setenv rootuuid "true"' /boot/boot.cmd esac ;; 85) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-rock-5a.dtb' /boot/dietpiEnv.txt;; - 87) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-orangepi-3b.dtb' /boot/dietpiEnv.txt;; *) :;; esac # Overlay prefix case $G_HW_MODEL in 73) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3308' /boot/dietpiEnv.txt;; - 78|79|80|82|85) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. + 78|79|80|82|85|91|92) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. *) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip' /boot/dietpiEnv.txt;; esac # Console args case $G_HW_MODEL in 73) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,1500000' /boot/dietpiEnv.txt;; # headless 47|55|56) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS2,1500000' /boot/dietpiEnv.txt;; # headless - 78|79|80|82|85) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;; # RK3588 + 78|79|80|82|85|91|92) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;; # RK3588 *) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyS2,1500000/' /boot/dietpiEnv.txt;; esac @@ -791,6 +792,11 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC mv "$dir/.build/images/NanoPiM3/boot.cmd" /boot/boot.cmd G_EXEC sed --follow-symlinks -i '/overlay/d' /boot/dietpiEnv.txt G_EXEC sed --follow-symlinks -i 's/ttyAML0/ttySAC0/' /boot/dietpiEnv.txt + # Device tree + case $HW_VARIANT in + 2) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=s5p6818-nanopi-fire3.dtb' /boot/dietpiEnv.txt;; + *) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=s5p6818-nanopi-m3.dtb' /boot/dietpiEnv.txt;; + esac fi fi @@ -1136,6 +1142,8 @@ _EOF_ 88) model='orangepizero2w' kernel='sunxi64';; 89) model='orangepi3-lts' kernel='sunxi64';; 90) model='radxa-zero3' kernel='rk35xx' branch='legacy';; + 91) model='orangepi5-max' kernel='rk35xx' branch='vendor';; + 92) model='nanopi-m6' kernel='rk35xx' branch='vendor';; *) :;; esac @@ -1272,7 +1280,7 @@ _EOF_ # tiny-initramfs to satisfy dependency: https://github.com/RPi-Distro/repo/issues/358 G_AGI raspi-firmware G_CONFIG_INJECT 'SKIP_INITRAMFS_GEN=' 'SKIP_INITRAMFS_GEN=yes' /etc/default/raspi-firmware - G_AGI "${kernel[@]}" raspi-utils raspberrypi-sys-mods raspberrypi-archive-keyring "${a32bit[@]}" tiny-initramfs + G_AGI "${kernel[@]}" raspi-utils-core raspberrypi-sys-mods raspberrypi-archive-keyring "${a32bit[@]}" tiny-initramfs G_EXEC apt-mark auto tiny-initramfs G_EXEC rm -f /boot/initrd.img-* /boot/firmware/initramfs* else @@ -1957,8 +1965,8 @@ _EOF_' then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS1 - # Rockchip vendor: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A, Radxa ZERO 3 - elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85|90)$ ]] + # Rockchip vendor/legacy: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A, Radxa ZERO 3 + elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85|90|91|92)$ ]] then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0 diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index 92d7f0e222..5acd92de48 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -115,7 +115,7 @@ G_EXEC mount "${FP_LOOP}p1" rootfs # Enforce ARMv6 arch on Raspbian # shellcheck disable=SC2015 -(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /usr/bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' +(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index 906e79a3da..09a060267b 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -119,7 +119,7 @@ G_EXEC mount "${FP_LOOP}p1" rootfs # Enforce ARMv6 arch on Raspbian # shellcheck disable=SC2015 -(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /usr/bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' +(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt diff --git a/.build/software/sprd-bluetooth/build.bash b/.build/software/sprd-bluetooth/build.bash new file mode 100644 index 0000000000..9fe2242af4 --- /dev/null +++ b/.build/software/sprd-bluetooth/build.bash @@ -0,0 +1,94 @@ +#!/bin/bash +{ +if [[ -f '/boot/dietpi/func/dietpi-globals' ]] +then + . /boot/dietpi/func/dietpi-globals || exit 1 +else + curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:-MichaIng}/DietPi/${G_GITBRANCH:-master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 + # shellcheck disable=SC1091 + . /tmp/dietpi-globals || exit 1 + G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals +fi + +G_EXEC mkdir -p sprd-bluetooth/{DEBIAN,usr/bin,lib/systemd/system} + +G_EXEC curl -fo sprd-bluetooth/usr/bin/hciattach_opi 'https://raw.githubusercontent.com/orangepi-xunlong/orangepi-build/next/external/packages/blobs/bt/hciattach/hciattach_opi_arm64' +G_EXEC chmod +x sprd-bluetooth/usr/bin/hciattach_opi +cat << '_EOF_' > sprd-bluetooth/lib/systemd/system/sprd-bluetooth.service +[Unit] +Description=Spreadtrum (sprd) Bluetooth support +After=bluetooth.service + +[Service] +RemainAfterExit=yes +ExecStart=/usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd + +[Install] +WantedBy=multi-user.target +_EOF_ + +# Control files +# - postinst +cat << '_EOF_' > sprd-bluetooth/DEBIAN/postinst +#!/bin/sh +if [ -d '/run/systemd/system' ] +then + echo 'Configuring sprd-bluetooth systemd service ...' + systemctl unmask sprd-bluetooth + systemctl enable --now sprd-bluetooth +fi +_EOF_ + +# - prerm +cat << '_EOF_' > sprd-bluetooth/DEBIAN/prerm +#!/bin/sh +if [ "$1" = 'remove' ] && [ -d '/run/systemd/system' ] +then + if [ -f '/lib/systemd/system/sprd-bluetooth.service' ] + then + echo 'Deconfiguring sprd-bluetooth systemd service ...' + systemctl unmask sprd-bluetooth + systemctl disable --now sprd-bluetooth + fi +fi +_EOF_ + +# - postrm +cat << '_EOF_' > sprd-bluetooth/DEBIAN/postrm +#!/bin/sh +if [ "$1" = 'purge' ] +then + if [ -d '/etc/systemd/system/sprd-bluetooth.service.d' ] + then + echo 'Removing sprd-bluetooth systemd service overrides ...' + rm -Rv /etc/systemd/system/sprd-bluetooth.service.d + fi +fi +_EOF_ + +G_EXEC chmod +x sprd-bluetooth/DEBIAN/{postinst,prerm,postrm} + +# - md5sums +find sprd-bluetooth ! \( -path sprd-bluetooth/DEBIAN -prune \) -type f -exec md5sum {} + | sed 's|sprd-bluetooth/||' > sprd-bluetooth/DEBIAN/md5sums + +# - control +cat << _EOF_ > sprd-bluetooth/DEBIAN/control +Package: sprd-bluetooth +Version: 0.0.1 +Architecture: arm64 +Maintainer: MichaIng +Date: $(date -uR) +Installed-Size: $(du -sk sprd-bluetooth | mawk '{print $1}') +Section: admin +Priority: optional +Homepage: https://github.com/orangepi-xunlong/orangepi-build/tree/next/external/packages/blobs/bt/hciattach +Description: Spreadtrum (sprd) Bluetooth support +_EOF_ +G_CONFIG_INJECT 'Installed-Size: ' "Installed-Size: $(du -sk sprd-bluetooth | mawk '{print $1}')" sprd-bluetooth/DEBIAN/control + +# Build DEB package +G_EXEC_OUTPUT=1 G_EXEC dpkg-deb -b -Zxz -z9 sprd-bluetooth + +# Cleanup +G_EXEC rm -R sprd-bluetooth +} diff --git a/.conf/dps_39/minidlna.conf b/.conf/dps_39/minidlna.conf index 448ac8b5d2..801748f0de 100644 --- a/.conf/dps_39/minidlna.conf +++ b/.conf/dps_39/minidlna.conf @@ -1,5 +1,5 @@ -# WARNING: After changing this option, you need to restart the service -# via: "systemctl restart minidlna" +# Note: After changing this option, you need to restart the service +# via: "systemctl restart minidlna" # Media paths media_dir=A,/mnt/dietpi_userdata/Music @@ -11,7 +11,7 @@ db_dir=/mnt/dietpi_userdata/.MiniDLNA_Cache # Must be one of "off", "fatal", "error", "warn", "info" or "debug". # "off" turns of logging entirely, "fatal" is the highest level of importance. -# Access logs via: "journalctl -u minidlna", on Bullseye in /var/log/minidlna. +# Access logs via: "journalctl -u minidlna" and /var/log/minidlna. log_level=warn # Use a different container as the root of the directory tree presented to diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 96d5b46c79..1005e15c2a 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -201,7 +201,7 @@ Process_Software() 164) aSERVICES[i]='nukkit' aUDP[i]='19132'; (( $arch == 10 )) || aDELAY[i]=60;; 165) aSERVICES[i]='gitea' aTCP[i]='3000'; (( $arch < 10 )) && aDELAY[i]=30;; #166) aSERVICES[i]='pi-spc';; Service cannot reasonably start in container as WirinPi's gpio command fails reading /proc/cpuinfo - 167) aSERVICES[i]='raspotify';; + 167) (( $arch < 3 )) || aSERVICES[i]='raspotify';; # 32-bit ARM fails with: "arm-binfmt-P: /usr/bin/librespot: Unable to find a guest_base to satisfy all guest address mapping requirements" #169) aSERVICES[i]='voice-recognizer';; "RuntimeError: This module can only be run on a Raspberry Pi!" 170) aCOMMANDS[i]='unrar -V';; #171) aSERVICES[i]='frps frpc' aTCP[i]='7000 7400 7500';; Interactive install with service and ports depending on server/client/both choice @@ -320,7 +320,7 @@ G_EXEC mount "${FP_LOOP}p1" rootfs # Force ARMv6 arch on Raspbian # shellcheck disable=SC2015 -(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /usr/bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' +(( $arch > 1 )) || { echo -e '#/bin/dash\n[ "$*" = -m ] && echo armv6l || /bin/uname "$@"' > rootfs/usr/local/bin/uname && G_EXEC chmod +x rootfs/usr/local/bin/uname; } || Error_Exit 'Failed to generate /usr/local/bin/uname for ARMv6' # Force RPi on ARM systems if requested if [[ $RPI == 'true' ]] && (( $arch < 10 )) diff --git a/.github/workflows/sprd-bluetooth.yml b/.github/workflows/sprd-bluetooth.yml new file mode 100644 index 0000000000..7c6a06f295 --- /dev/null +++ b/.github/workflows/sprd-bluetooth.yml @@ -0,0 +1,25 @@ +name: sprd-bluetooth +on: workflow_dispatch +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true +permissions: {} +jobs: + build: + # https://github.com/actions/runner-images + runs-on: ubuntu-24.04 + steps: + - name: Build + run: sudo bash -c "$(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/sprd-bluetooth/build.bash")" + - name: Upload + run: | + # SSH server and client keys + mkdir ~/.ssh + umask 377 + echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts + echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 + + # Upload + curl -T sprd-bluetooth.deb --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}all/' + curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ + --data '{"files":["https://dietpi.com/downloads/binaries/testing/","https://dietpi.com/downloads/binaries/testing/sprd-bluetooth.deb"]}' diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 0c4e7c5a02..139bbd161a 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -95,6 +95,8 @@ shopt -s extglob [88]='Orange Pi Zero 2W' [89]='Orange Pi 3 LTS' [90]='Radxa ZERO 3' + [91]='Orange Pi 5 Max' + [92]='NanoPi M6' ) ## Benchmark data arrays: aBENCH_XX[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}] @@ -729,13 +731,15 @@ shopt -s extglob aSOFTWARE_NAME9_6[213]='soju' aSOFTWARE_NAME9_7=() + aSOFTWARE_NAME9_8=() for i in "${!aSOFTWARE_NAME9_6[@]}" do aSOFTWARE_NAME9_7[i]=${aSOFTWARE_NAME9_6[i]} + aSOFTWARE_NAME9_8[i]=${aSOFTWARE_NAME9_7[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_7[@]}" + for i in "${aSOFTWARE_NAME9_8[@]}" do aSOFTWARE[$i]=0 done @@ -791,7 +795,7 @@ shopt -s extglob eval "software=\${aSOFTWARE_NAME${version/./_}[$software]}" if [[ ! $software ]] then - echo "Invalid software ID for DietPi version $version" + echo "Invalid software ID \"$software\" for DietPi version $version" mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/ return 1 fi @@ -1005,9 +1009,13 @@ shopt -s extglob # Work out averages # - Divide CPU times by 100 and scale to revert decimal point removal - aBENCH_RESULT_CPU_MIN[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MIN[i]}e-2") - aBENCH_RESULT_CPU_MAX[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MAX[i]}e-2") - aBENCH_RESULT_CPU_AVG[i]=$(printf '%.2f' "$((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3") + #aBENCH_RESULT_CPU_MIN[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MIN[i]}e-2") + #aBENCH_RESULT_CPU_MAX[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MAX[i]}e-2") + #aBENCH_RESULT_CPU_AVG[i]=$(printf '%.2f' "$((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3") + # - Workaround for current bash printf bug: https://bugs.debian.org/1078556 + aBENCH_RESULT_CPU_MIN[i]=$(mawk "{printf \"%.2f\", ${aBENCH_RESULT_CPU_MIN[i]}e-2}" <<< '') + aBENCH_RESULT_CPU_MAX[i]=$(mawk "{printf \"%.2f\", ${aBENCH_RESULT_CPU_MAX[i]}e-2}" <<< '') + aBENCH_RESULT_CPU_AVG[i]=$(mawk "{printf \"%.2f\", $((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3}" <<< '') # CPU temps if available aBENCH_RESULT_CPU_TEMP_START_MIN[i]='N/A' diff --git a/.update/patches b/.update/patches index 5cc61dc3ab..d33f4e80ac 100755 --- a/.update/patches +++ b/.update/patches @@ -1151,7 +1151,7 @@ _EOF_ [[ $( /dev/null && model='R5C' G_DIETPI-NOTIFY 2 "Updating udev rule for NanoPi $model Ethernet LEDs" G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' - if [[ $model == 'R6S' ]] + if [[ $model == 'R5S' ]] then cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" @@ -1748,9 +1748,7 @@ Patch_9_7() G_AGI linux-{image,dtb}-edge-meson linux-u-boot-odroidc1-edge dpkg-query -s 'linux-headers-edge-meson' &> /dev/null && G_AGI linux-headers-edge-meson dpkg-query -s 'linux-libc-dev-edge-meson' &> /dev/null && G_AGI linux-libc-dev-edge-meson - G_AGP linux-{image,dtb,headers,libc-dev}-edge-meson - # The /boot/dtb symlink has been found to be missing after kernel removed, despite a newer kernel being installed already. Assure it is present and correct. - [[ $(realpath '/boot/dtb') == '/boot/dtb-6.'* ]] || G_EXEC ln -sf /boot/dtb-6.* /boot/dtb + G_AGP linux-{image,dtb,headers,libc-dev}-current-meson # RK3588 migration to vendor kernel elif (( $G_HW_CPUID == 11 )) && dpkg-query -s 'linux-image-legacy-rk35xx' &> /dev/null && ! dpkg-query -s 'linux-image-vendor-rk35xx' &> /dev/null @@ -1790,7 +1788,7 @@ Patch_9_7() esac fi - # NanoPi R5S/R6S migration from legacy image with 8 partitions to Armbian-based kernel and bootloader + # NanoPi R5S/R5C migration from legacy image with 8 partitions to Armbian-based kernel and bootloader elif [[ $G_HW_MODEL == 76 ]] && dpkg-query -s 'firmware-nanopi5' &> /dev/null then local rmodel @@ -1868,6 +1866,7 @@ Patch_9_7() done fi + # NanoPi 6 series migration from legacy image with 8 partitions to Armbian-based kernel and bootloader elif [[ $G_HW_MODEL == 79 ]] && dpkg-query -s 'firmware-nanopi6' &> /dev/null then local rmodel @@ -1962,6 +1961,75 @@ Patch_9_7() fi } +Patch_9_8() +{ + # NanoPi R5S/R5C + if (( $G_HW_MODEL == 76 )) && ! dpkg-query -s 'firmware-nanopi5' &> /dev/null + then + local model='R5S' + [[ $( /dev/null && model='R5C' + G_DIETPI-NOTIFY 2 "Updating udev rule for NanoPi $model Ethernet LEDs" + G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' + if [[ $model == 'R5S' ]] + then + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="green:lan-1", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:lan-2", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth2", RUN+="/bin/ip l s down dev eth2" +_EOF_ + else + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +SUBSYSTEM=="leds", KERNEL=="green:wlan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="wlan0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev wlan0", RUN+="/bin/ip l s down dev wlan0" +_EOF_ + fi + + # NanoPi R6S/R6C + elif (( $G_HW_MODEL == 79 )) && ! dpkg-query -s 'firmware-nanopi6' &> /dev/null + then + read -r model < /proc/device-tree/model + if [[ $model == *'R6S'* ]] + then + G_DIETPI-NOTIFY 2 'Updating udev rule for NanoPi R6S Ethernet LEDs' + G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="lan2_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1" +SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1" +_EOF_ + elif [[ $model == *'R6C'* ]] + then + G_DIETPI-NOTIFY 2 'Updating udev rule for NanoPi R6C Ethernet LEDs' + G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +SUBSYSTEM=="leds", KERNEL=="user_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="wlan0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev wlan0", RUN+="/bin/ip l s down dev wlan0" +_EOF_ + fi + + # Orange Pi 3B: Migrate to mainline kernel device tree names + elif (( $G_HW_MODEL == 87 )) + then + G_DIETPI-NOTIFY 2 'Flashing new Orange Pi 3B bootloader to support v2.1 board revision and automatic device tree selection' + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc + if [[ $G_ROOTFS_DEV != '/dev/mmcblk'* ]] + then + # shellcheck disable=SC1091 + . /usr/lib/u-boot/platform_install.sh + if declare -f write_uboot_platform_mtd | grep -q 'flashcp' + then + G_AG_CHECK_INSTALL_PREREQ mtd-utils + write_uboot_platform_mtd "$DIR" /dev/mtd0 + else + write_uboot_platform_mtd "$DIR" /dev/mtdblock0 + fi + fi + G_EXEC sed -i '/^fdtfile=/d' /boot/dietpiEnv.txt + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/pre-patches b/.update/pre-patches index a7715faad7..f6abfb0761 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -429,5 +429,29 @@ then fi fi +# v9.8 +if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 8 ) )) +then + # https://dietpi.com/forum/t/20771 + if [[ $G_HW_MODEL == 72 && -f '/etc/apt/sources.list.d/dietpi.list' ]] + then + G_DIETPI-NOTIFY 2 'Fix ROCK 4 APT component' + if dpkg-query -s 'linux-u-boot-rockpi-4b-current' &> /dev/null + then + all_components='rock4' + + elif dpkg-query -s 'linux-u-boot-rock-4se-current' &> /dev/null + then + all_components='rock4se' + + elif dpkg-query -s 'linux-u-boot-rockpi-4cplus-current' &> /dev/null + then + all_components='rock4cplus' + fi + G_EXEC sed -i '\|^deb https://dietpi.com/apt all |d' /etc/apt/sources.list.d/dietpi.list + G_EXEC eval "echo 'deb https://dietpi.com/apt all $all_components' >> /etc/apt/sources.list.d/dietpi.list" + fi +fi + exit 0 } diff --git a/.update/version b/.update/version index a8977da8a1..2cb5377cf2 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=7 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_SUB=8 +G_REMOTE_VERSION_RC=0 # 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 18d6657709..9a857dd45e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,33 @@ +v9.8 +(2024-10-17) + +Enhancements: +- Orange Pi 3B | Added support for board revision v2.1, where Ethernet did not work with our previous kernel. Many thanks to @raphamotta and others for making us aware of this: https://dietpi.com/forum/t/20689 +- DietPi-FirstBoot | The network time sync mirror configured in dietpi.txt is now applied before the first time sync is done, instead of after login and initial DietPi update. Many thanks to @bigops for making us aware of this: https://dietpi.com/forum/t/21600 +- DietPi-Software | NoMachine: Our install option will now always download the latest NoMachine version, instead of a hardcoded one depending on the DietPi version. Many thanks to @tzvi208 for for figuring it out to version-agnostic download URLs: https://github.com/MichaIng/DietPi/issues/7198 +- DietPi-Software | Portainer: It has been enabled to accept private/custom CA certificates by using the trusted CA certificates of the host, instead of the ones shipped with the container image. Many thanks to @oldboys92 for implementing this enhancement: https://github.com/MichaIng/DietPi/pull/7217 + +Bug fixes: +- NanoPi M3/T3 | Resolved an issue where our recent image did not boot because the bootloader did not define a default device tree path anymore. Many thanks to @rozcietrzewiacz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2630#issuecomment-2322085507 +- NanoPi R5S/R5C | Resolved an issue where the Ethernet LEDs did not work on systems upgraded from the legacy Linux 5.10 kernel. Many thanks to @innovodev for reporting this issue: https://dietpi.com/forum/t/21026 +- ROCK 4 | Resolved an issue where a false APT component was applied for your APT server, leading to errors and missing kernel/firmware upgrades. Many thanks to @cdlenfert for reporting this issue: https://dietpi.com/forum/t/20771 +- ROCK 4 SE | Resolved an issue where WiFi did not work if Bluetooth was disabled. Many thanks to @MidG971 and @c00ldchan for reporting this issue: https://github.com/MichaIng/DietPi/issues/6943 +- Orange Pi 3B/Zero 3/Zero 2W | Resolved an issue where enabling Bluetooth via dietpi-config did not work. Many thanks to @ridhoperdana for reporting this issue: https://dietpi.com/forum/t/18808 +- Bullseye | Solved an issue with our Bullseye images, where the FAT setup partition was not detected, preventing import of config files from it, as well as proper root filesystem expansion. Many thanks to @rozcietrzewiacz for reporting this issue and detecting the actual underlying reason for it: https://github.com/MichaIng/DietPi/issues/2630 +- DietPi-Drive_Manager | Resolved an issue where formatting the internal eMMC in drive mode on some SBCs, like Odroid N2, failed. Many thanks to @ankagar for reporting this issue: https://dietpi.com/forum/t/20689/33 +- DietPi-Services | Resolved an issue where the nfs-kernel-server service did show mode "alias". "nfs-kernel-server" is indeed an alias for the actual service name "nfs-server", which is now used. +- DietPi-Config | Resolved an issue where username and password in proxy settings could not be cleared, since the inputbox kept asking for an non-empty input. Many thanks to @dipisoft for reporting this issue: https://github.com/MichaIng/DietPi/issues/7211 +- DietPi-Software | NoMachine: Resolved an issue where the installation failed due to an outdated download URL. Many thanks to @tzvi208 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7198 +- DietPi-Software | Raspotify: Resolved an issue where the service failed to start with the latest Raspotify release, since it contains a config, incompatible with the bundles librespot: https://github.com/dtcooper/raspotify/pull/674 +- DietPi-Software | Home Assistant: Resolved an issue where the latest Home Assistant version did not start. Many thanks to @whyisthisbroken and others for reporting this issue: https://github.com/MichaIng/DietPi/issues/7231 +- DietPi-Software | Folding@Home: Resolved an issue where the installation failed. Due to larger changes in Folding@Home v8, v7 will be installed for now, before we find time to implement the needed changes for v8. Many thanks to @cruzadernl for reporting this issue: https://github.com/MichaIng/DietPi/issues/7187 + +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.7 -(2024-08-23) +(2024-08-25) Enhancements: - Odroid N2 | Added an option to update (flash) the SPI bootloader to the dietpi-config "Advanced Options" menu. diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 4cd93f9d2e..020460a39d 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -933,15 +933,13 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the fi # Odroid N2, ROCK 4, ROCK 5B, Orange Pi 5 (Plus) and Orange Pi 3B: https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 - elif [[ $G_HW_MODEL =~ ^(15|72|78|80|82|87)$ ]] + elif [[ $G_HW_MODEL =~ ^(15|72|78|80|82|87)$ && -f '/usr/lib/u-boot/platform_install.sh' ]] then # Odroid N2/ROCK 4: Device tree overlay required local spidev='/dev/mtdblock0' (( $G_HW_MODEL == 15 || $G_HW_MODEL == 72 )) || { - [[ -f '/usr/lib/u-boot/platform_install.sh' ]] && { - { [[ -e '/dev/mtd0' ]] && grep -q '/dev/mtd0' /usr/lib/u-boot/platform_install.sh && spidev='/dev/mtd0'; } || - { [[ -b '/dev/mtdblock0' ]] && grep -q '/dev/mtdblock0' /usr/lib/u-boot/platform_install.sh; } - } + { [[ -e '/dev/mtd0' ]] && grep -q 'flashcp' /usr/lib/u-boot/platform_install.sh && spidev='/dev/mtd0'; } || + { [[ -b '/dev/mtdblock0' ]] && ! grep -q 'flashcp' /usr/lib/u-boot/platform_install.sh; } } && G_WHIP_MENU_ARRAY+=('Update SPI bootloader' ": Flash current U-Boot to $spidev") # VisionFive 2/Star64: https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_QSG.pdf @@ -1143,7 +1141,7 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr . /usr/lib/u-boot/platform_install.sh eval "$(declare -f write_uboot_platform_mtd | sed -e 's| > /dev/null 2>&1||g' -e 's|status=none|status=progress|g' -e 's/^[[:blank:]]*dd /dd oflag=direct conv=notrunc status=progress /')" # shellcheck disable=SC2154 - write_uboot_platform_mtd "$DIR" + write_uboot_platform_mtd "$DIR" "$spidev" elif [[ $G_WHIP_RETURNED_VALUE == 'Update bootloader' ]]; then @@ -1559,8 +1557,8 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will MIN_VALUE=1 MAX_VALUE=60 G_WHIP_DEFAULT_ITEM=$initial_turbo - if G_WHIP_INPUTBOX "Amount of seconds on boot, where the CPU runs at highest clock, before it starts to respect the CPU governor. This reduces boot time quite much since RPi boots with powersave governor until the chosen one is applied at later boot stage. -- Recommended value: 20\n - Valid range: $MIN_VALUE - $MAX_VALUE\n - Setting a value outside of range will disable this feature."; then + if G_WHIP_INPUTBOX "Amount of seconds on boot, where the CPU runs at the highest clock speed, before it starts to respect the CPU governor. This reduces boot time quite significantly since the RPi boots using the powersave governor until the chosen one is applied at a later boot stage. +- Recommended value: 20\n - Valid range: $MIN_VALUE - $MAX_VALUE\n - Setting a value outside of this range will disable this feature."; then if disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" "$MIN_VALUE" "$MAX_VALUE"; then @@ -3790,8 +3788,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s fi G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt - local mode=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - /boot/dietpi/func/dietpi-set_software ntpd-mode "${mode:=2}" + /boot/dietpi/func/dietpi-set_software timesync-mirror # Run time sync only if not currently running, to avoid concurrent execution if dietpi-config was called from DietPi-Run_NTPD error handler # - Run non-interactively to avoid its internal error handler allowing to open a concurrent dietpi-config instance @@ -3800,7 +3797,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s G_WHIP_MSG "Time sync failed with mirror: $G_WHIP_RETURNED_VALUE\n\nReverting to previous mirror: $ntp_mirror_current" G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$ntp_mirror_current" /boot/dietpi.txt - /boot/dietpi/func/dietpi-set_software ntpd-mode "$mode" + /boot/dietpi/func/dietpi-set_software timesync-mirror ;; 'Dynamic DNS') /boot/dietpi/dietpi-ddns;; @@ -3867,7 +3864,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s 'Password' ": [$PROXY_PASSWORD]" ) - G_WHIP_MENU 'Please select an option to adjust. Logout and login for changes to take effect.' || { Back_or_Exit 8; return 0; } # Network Options: Adapters + G_WHIP_BUTTON_OK_TEXT='Select' G_WHIP_MENU 'Please select an option to adjust. Logout and login for changes to take effect.' || { Back_or_Exit 8; return 0; } # Network Options: Adapters case "$G_WHIP_RETURNED_VALUE" in @@ -3890,14 +3887,14 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s 'Username') G_WHIP_DEFAULT_ITEM=$PROXY_USERNAME - G_WHIP_INPUTBOX 'Please enter the proxy username\n - eg: JoeBloggs\n - Leave blank if not required' && PROXY_USERNAME=$G_WHIP_RETURNED_VALUE || return 0 + G_WHIP_INPUTBOX_REGEX='.*' G_WHIP_INPUTBOX 'Please enter the proxy username\n - eg: JoeBloggs\n - Leave blank if not required' && PROXY_USERNAME=$G_WHIP_RETURNED_VALUE || return 0 G_CONFIG_INJECT 'CONFIG_PROXY_USERNAME=' "CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /boot/dietpi.txt ;; 'Password') G_WHIP_DEFAULT_ITEM=$PROXY_PASSWORD - G_WHIP_INPUTBOX 'Please enter the proxy password\n - eg: LetMeIn\n - Leave blank if not required' && PROXY_PASSWORD=$G_WHIP_RETURNED_VALUE || return 0 + G_WHIP_INPUTBOX_REGEX='.*' G_WHIP_INPUTBOX 'Please enter the proxy password\n - eg: LetMeIn\n - Leave blank if not required' && PROXY_PASSWORD=$G_WHIP_RETURNED_VALUE || return 0 G_CONFIG_INJECT 'CONFIG_PROXY_PASSWORD=' "CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /boot/dietpi.txt ;; diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 00e10d6ab5..aea801fba4 100755 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -574,6 +574,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return # - Partition wipe must be done 1st, else UUIDs are still reported. for i in "/dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}"?* do + [[ $i == '/dev/mmcblk'[0-9]'boot'[0-9] ]] && continue # Skip /dev/mmcblk0boot0 special boot sector eMMC partitions on e.g. Odroid N2 [[ -b $i ]] || continue local target=$(findmnt -Ufnro TARGET -S "$i") [[ $target ]] && { Unmount_Drive "$target" || return 1; } diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 2c267a3045..646992a4d5 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -125,7 +125,7 @@ _EOF_ 'proftpd' 'vsftpd' 'nmbd' 'smbd' - 'nfs-kernel-server' + 'nfs-server' # Backends ----------------------------------------------------------- # - Databases diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 099d46dd4b..abc50bc214 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3258,14 +3258,13 @@ _EOF_ if To_Install 30 # NoMachine then - local version='8.11.3_3' # https://downloads.nomachine.com/ case $G_HW_ARCH in - 1) local url="Raspberry/nomachine_${version}_armv6hf";; - 2) local url="Arm/nomachine_${version}_armhf";; - 3) local url="Arm/nomachine_${version}_arm64";; - *) version='8.11.3_4'; local url="Linux/nomachine_${version}_amd64";; + 1) local url='raspberry/v6/deb/nomachine_latest_armv6hf';; + 2) local url='arm/v7/deb/nomachine_latest_armhf';; + 3) local url='arm/v8/deb/nomachine_latest_arm64';; + *) local url='linux/64/deb/nomachine_latest_amd64';; esac - Download_Install "https://download.nomachine.com/download/${version%.*}/$url.deb" + Download_Install "https://www.nomachine.com/free/$url.deb" aSTART_SERVICES+=('nxserver') fi @@ -3467,10 +3466,10 @@ _EOF_ G_EXEC sed --follow-symlinks -i 's/^[[:blank:]]*root/#root/' /etc/ftpusers fi - if To_Install 109 nfs-kernel-server # NFS Server + if To_Install 109 nfs-server # NFS Server then G_AGI nfs-kernel-server - G_EXEC systemctl stop nfs-kernel-server + G_EXEC systemctl stop nfs-server G_EXEC mkdir -p /etc/exports.d [[ -f '/etc/exports.d/dietpi.exports' ]] || G_EXEC eval 'echo '\''/mnt/dietpi_userdata *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)'\'' > /etc/exports.d/dietpi.exports' @@ -4339,8 +4338,9 @@ _EOF_ debconf-set-selections <<< 'fahclient fahclient/passkey string 06c869246e88c00cb05cc4d1758a97f9' # Passkey for user "DietPi" local arch=$(dpkg --print-architecture) - local fallback_url="https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-${arch/amd64/64bit}/v7.6/latest.deb" - Download_Install "$(curl -sSfL 'https://download.foldingathome.org/' | mawk -F\" "/^ *\"url\": \".*\/fahclient_.*_$arch\.deb\"$/{print \$4}")" + local url="https://download.foldingathome.org/releases/v7/public/fahclient/debian-stable-${arch/amd64/64bit}/release" + local fallback_url="$url/fahclient_7.6.21_$arch.deb" + Download_Install "$(curl -sSfL "$url/" | mawk -F\" "/\"fahclient_.*_$arch\.deb\"/{print \"$url/\" \$2}" | sort -Vr | head -1)" # Remove obsolete config + data directories and SysV service + config [[ -d '/var/lib/fahclient' ]] && G_EXEC rm -R /var/lib/fahclient @@ -5150,19 +5150,20 @@ _EOF_ if To_Install 39 minidlna # ReadyMedia then + # Config + [[ -f '/etc/minidlna.conf' ]] || dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf + G_AGI minidlna G_EXEC systemctl stop minidlna - # Remove obsolete service files + # Remove obsolete service file Remove_SysV minidlna 1 - [[ -f '/lib/systemd/system/minidlna.service' ]] && G_EXEC rm /lib/systemd/system/minidlna.service - [[ -d '/var/log/minidlna' ]] && G_EXEC rm -R /var/log/minidlna # User: Make "dietpi" the primary group to enable cross-access to media files Create_User -g dietpi -G minidlna -d /var/lib/minidlna minidlna - # Service - cat << _EOF_ > /etc/systemd/system/minidlna.service + # Service: Debian patch enforces file logging, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745 + cat << '_EOF_' > /etc/systemd/system/minidlna.service [Unit] Description=ReadyMedia (DietPi) Documentation=man:minidlnad(1) man:minidlna.conf(5) @@ -5171,18 +5172,12 @@ After=network-online.target remote-fs.target [Service] User=minidlna -ExecStart=$(command -v minidlnad) -S -R -f /etc/minidlna.conf -P /dev/null +LogsDirectory=minidlna +ExecStart=/usr/sbin/minidlnad -S -R -f /etc/minidlna.conf -P /dev/null [Install] WantedBy=multi-user.target _EOF_ - # Debian patched forced file logging inside, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745 - G_CONFIG_INJECT 'LogsDirectory=' 'LogsDirectory=minidlna' /etc/systemd/system/minidlna.service 'User=' - - # Config - G_BACKUP_FP /etc/minidlna.conf - dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf - # Cache G_EXEC mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache G_EXEC chown -R minidlna:root /mnt/dietpi_userdata/.MiniDLNA_Cache @@ -6146,7 +6141,7 @@ Wants=network-online.target nss-lookup.target After=network-online.target Before=nss-lookup.target StartLimitIntervalSec=60 -StartLimitBurst=5 +StartLimitBurst=3 [Service] User=adguardhome @@ -6219,7 +6214,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.52.5/navidrome_0.52.5_linux_$arch.tar.gz" + local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.53.3/navidrome_0.53.3_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/navidrome/navidrome/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/navidrome_[0-9.]*_linux_$arch\.tar\.gz\"$/{print \$4}")" /opt/navidrome # Data dir @@ -6252,6 +6247,8 @@ Description=navidrome (DietPi) Wants=network-online.target After=network-online.target remote-fs.target AssertPathExists=/mnt/dietpi_userdata/navidrome +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] User=navidrome @@ -6314,7 +6311,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.2/kavita-linux-$arch.tar.gz" + local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.3.2/kavita-linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC chmod +x Kavita/Kavita @@ -6349,7 +6346,7 @@ Description=Kavita Server (DietPi) Wants=network-online.target After=network-online.target remote-fs.target StartLimitIntervalSec=60 -StartLimitBurst=5 +StartLimitBurst=3 [Service] SyslogIdentifier=Kavita @@ -6522,7 +6519,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.60.0/frp_0.60.0_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.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_* @@ -6554,7 +6551,7 @@ Description=frp server (DietPi) Wants=network-online.target After=network-online.target StartLimitIntervalSec=60 -StartLimitBurst=5 +StartLimitBurst=3 [Service] User=frp @@ -6593,7 +6590,7 @@ Description=frp client (DietPi) Wants=network-online.target After=network-online.target frps.service StartLimitIntervalSec=60 -StartLimitBurst=5 +StartLimitBurst=3 [Service] User=frp @@ -6914,13 +6911,13 @@ _EOF_ if To_Install 98 haproxy # HAProxy then - local version='3.0.2' # https://www.haproxy.org/download/ - aDEPS=('make' 'gcc' 'libpcre3-dev' 'libssl-dev' 'zlib1g-dev' 'libsystemd-dev') + local version='3.0.5' # https://www.haproxy.org/download/ + aDEPS=('make' 'gcc' 'libpcre2-dev' 'libssl-dev' 'zlib1g-dev' 'libsystemd-dev') Download_Install "https://www.haproxy.org/download/${version%.*}/src/haproxy-$version.tar.gz" # Compile G_EXEC cd "haproxy-$version" - G_EXEC_OUTPUT=1 G_EXEC make -j "$G_HW_CPU_CORES" TARGET=linux-glibc USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_SYSTEMD=1 USE_PROMEX=1 DEBUG_CFLAGS='-g0 -O3' LDFLAGS='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' + G_EXEC_OUTPUT=1 G_EXEC make -j "$G_HW_CPU_CORES" TARGET=linux-glibc USE_PCRE2=1 USE_OPENSSL=1 USE_ZLIB=1 USE_SYSTEMD=1 USE_PROMEX=1 DEBUG_CFLAGS='-g0 -O3' LDFLAGS='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' # Strip binary size G_EXEC strip --remove-section=.comment --remove-section=.note haproxy # Install @@ -7057,7 +7054,7 @@ _EOF_ aDEPS=() else local version=$(curl -sSfL 'https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='1.24.2'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='1.24.3'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/FreshRSS/FreshRSS/archive/$version.tar.gz" G_EXEC mv "FreshRSS-$version" /opt/FreshRSS fi @@ -7472,7 +7469,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.11.2/komga-1.11.2.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.14.1/komga-1.14.1.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 @@ -7568,7 +7565,7 @@ _EOF_ local json=() [[ $PHP_VERSION == 8* ]] || aDEPS+=("php$PHP_VERSION-json") json=('json') - local fallback_url="https://github.com/ampache/ampache/releases/download/6.6.0/ampache-6.6.0_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.6.3/ampache-6.6.3_all_php$PHP_VERSION.zip" Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # Reinstall: Preserve configs from old and new paths @@ -8561,7 +8558,8 @@ _EOF_ # Install ruTorrent: Web UI for rTorrent # - Grab current version local version=$(curl -sSfL 'https://api.github.com/repos/Novik/ruTorrent/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='v4.3.6'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='v5.0.0'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version == 'v5.'* ]] || version='v5.0.0' Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall freshly with preserved configs and 3rd party plugins @@ -8952,7 +8950,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.10/syncthing-linux-$arch-v1.27.10.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.28.0/syncthing-linux-$arch-v1.28.0.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/syncthing-linux-$arch-[^\"\/]*\.tar\.gz\"/{print \$4}")" G_EXEC mv syncthing-* /opt/syncthing fi @@ -8986,7 +8984,7 @@ Description=Syncthing (DietPi) Wants=network-online.target After=network-online.target StartLimitIntervalSec=60 -StartLimitBurst=4 +StartLimitBurst=3 [Service] User=dietpi @@ -9257,6 +9255,8 @@ Description=SABnzbd (DietPi) Documentation=https://sabnzbd.org/wiki/ Wants=network-online.target After=network-online.target remote-fs.target +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=SABnzbd @@ -9364,7 +9364,7 @@ _EOF_ if (( ${PHP_VERSION::1} > 7 )) then aDEPS+=("php$PHP_VERSION-curl") - local fallback_url='https://github.com/koel/koel/releases/download/v7.0.10/koel-v7.0.10.tar.gz' aphp_deps=('curl' 'dom') + local fallback_url='https://github.com/koel/koel/releases/download/v7.1.0/koel-v7.1.0.tar.gz' aphp_deps=('curl' 'dom') Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/koel-[^"\/]*\.tar\.gz"$/{print $4}')" else aDEPS+=("php$PHP_VERSION-json") @@ -9479,6 +9479,8 @@ _EOF_ Description=Sonarr (DietPi) Wants=network-online.target After=network-online.target remote-fs.target transmission-daemon.service qbittorrent.service rtorrent.service nzbget.service deluged.service aria2.service sabnzbd.service +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=Sonarr @@ -9546,7 +9548,7 @@ _EOF_ esac url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") - local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.9.1.9070/Radarr.master.5.9.1.9070.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.12.2.9335/Radarr.master.5.12.2.9335.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -9569,6 +9571,8 @@ _EOF_ Description=Radarr (DietPi) Wants=network-online.target After=network-online.target remote-fs.target transmission-daemon.service qbittorrent.service rtorrent.service nzbget.service deluged.service aria2.service sabnzbd.service +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=Radarr @@ -9642,7 +9646,7 @@ _EOF_ esac url=$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") - local fallback_url="https://github.com/Lidarr/Lidarr/releases/download/v2.4.3.4248/Lidarr.master.2.4.3.4248.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Lidarr/Lidarr/releases/download/v2.6.4.4402/Lidarr.master.2.6.4.4402.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -9661,6 +9665,8 @@ _EOF_ Description=Lidarr (DietPi) Wants=network-online.target After=network-online.target remote-fs.target transmission-daemon.service qbittorrent.service rtorrent.service nzbget.service deluged.service aria2.service sabnzbd.service +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=Lidarr @@ -9875,7 +9881,7 @@ Description=Jackett (DietPi) Wants=network-online.target After=network-online.target StartLimitIntervalSec=60 -StartLimitBurst=5 +StartLimitBurst=3 [Service] SyslogIdentifier=Jackett @@ -9909,7 +9915,7 @@ _EOF_ local reinstall=0 [[ -f '/mnt/dietpi_userdata/nzbget/nzbget.conf' ]] && reinstall=1 - local fallback_url='https://github.com/nzbgetcom/nzbget/releases/download/v24.1/nzbget-24.1-bin-linux.run' + local fallback_url='https://github.com/nzbgetcom/nzbget/releases/download/v24.3/nzbget-24.3-bin-linux.run' Download_Install "$(curl -sSfL 'https://api.github.com/repos/nzbgetcom/nzbget/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/nzbget-[^"/]*-bin-linux.run"$/{print $4}')" nzbget.run G_EXEC mkdir -p /mnt/dietpi_userdata/nzbget G_EXEC_OUTPUT=1 G_EXEC dash nzbget.run --destdir /mnt/dietpi_userdata/nzbget @@ -9988,7 +9994,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.22.0.4670/Prowlarr.master.1.22.0.4670.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.24.3.4754/Prowlarr.master.1.24.3.4754.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Prowlarr/Prowlarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC mv Prowlarr /opt/prowlarr fi @@ -10005,6 +10011,8 @@ _EOF_ Description=Prowlarr (DietPi) Wants=network-online.target After=network-online.target remote-fs.target transmission-daemon.service qbittorrent.service rtorrent.service nzbget.service deluged.service aria2.service sabnzbd.service +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=Prowlarr @@ -10062,7 +10070,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.32.2587/Readarr.develop.0.3.32.2587.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.4.0.2634/Readarr.develop.0.4.0.2634.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 @@ -10079,6 +10087,8 @@ _EOF_ Description=Readarr (DietPi) Wants=network-online.target After=network-online.target remote-fs.target transmission-daemon.service qbittorrent.service rtorrent.service nzbget.service deluged.service aria2.service sabnzbd.service +StartLimitIntervalSec=60 +StartLimitBurst=3 [Service] SyslogIdentifier=Readarr @@ -10630,7 +10640,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.22.1/gitea-1.22.1-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.22.3/gitea-1.22.3-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 @@ -11214,7 +11224,7 @@ _EOF_ # v3 drops PHP 7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v3.0.0 if (( $G_DISTRO > 6 )) then - local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v4.1.2/tasmoadmin_v4.1.2.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v4.1.3/tasmoadmin_v4.1.3.tar.gz' Download_Install "$(curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}')" else Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz' @@ -11311,7 +11321,7 @@ _EOF_ local ha_user='homeassistant' local ha_home="/home/$ha_user" local ha_pyenv_activation=". $ha_home/pyenv-activate.sh" - local ha_python_version='3.12.3' # https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build + local ha_python_version='3.12.7' # https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user" G_DIETPI-NOTIFY 2 "Home Assistant home: $ha_home" @@ -11368,7 +11378,7 @@ _EOF_ # Reset and merge pyenv and HA Python environment to avoid version mismatches on Python upgrades: https://github.com/MichaIng/DietPi/issues/6117 [[ -d '/mnt/dietpi_userdata/homeassistant/deps' ]] && G_EXEC rm -R /mnt/dietpi_userdata/homeassistant/deps - G_EXEC ln -sf "$ha_home/.pyenv/versions/$ha_python_version" /mnt/dietpi_userdata/homeassistant/deps + G_EXEC ln -sf "$ha_home/.pyenv/versions/$ha_python_version/lib/python${ha_python_version%.*}/site-packages" /mnt/dietpi_userdata/homeassistant/deps # Disable pip cache G_EXEC mkdir -p "$ha_home/.pip" @@ -11381,9 +11391,8 @@ if [ \$(whoami) != '$ha_user' ]; then kill -INT \$\$ fi cd $ha_home -export PYENV_ROOT='$ha_home/.pyenv' -export PATH=\"\$PYENV_ROOT/bin:\$PATH\" -eval \"\$(pyenv init --path)\" +# Permit uv to install into system Python: https://github.com/astral-sh/uv/issues/7907 +export PATH=\"$ha_home/.pyenv/bin:\$PATH\" UV_SYSTEM_PYTHON=1 eval \"\$(pyenv init -)\" [ -f '.cargo/env' ] && . .cargo/env" > "$ha_home/pyenv-activate.sh" @@ -11672,7 +11681,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.67.0/rclone-v1.67.0-linux-$arch.deb" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.68.1/rclone-v1.68.1-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 @@ -11686,7 +11695,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/restic/restic/releases/download/v0.17.0/restic_0.17.0_linux_$arch.bz2" + local fallback_url="https://github.com/restic/restic/releases/download/v0.17.1/restic_0.17.1_linux_$arch.bz2" Download_Install "$(curl -sSfL 'https://api.github.com/repos/restic/restic/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/restic_[^\"\/]*_linux_$arch\.bz2\"$/{print \$4}")" /usr/local/bin/restic G_EXEC chmod +x /usr/local/bin/restic fi @@ -11803,7 +11812,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.30.0/linux-$arch-filebrowser.tar.gz" + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.31.2/linux-$arch-filebrowser.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/linux-$arch-filebrowser\.tar\.gz\"$/{print \$4}")" ./filebrowser/ # Reinstall @@ -11914,7 +11923,7 @@ _EOF_ # Deploy the Portainer container G_DIETPI-NOTIFY 2 'Portainer will be deployed now. This could take a while...' - G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v 'portainer_data:/data' 'portainer/portainer-ce' + G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v '/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro' -v 'portainer_data:/data' 'portainer/portainer-ce' fi if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder @@ -14499,7 +14508,6 @@ _EOF_ local AUTOINSTALL_FILESERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_FILE_SERVER_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) # pre-v7.9 local AUTOINSTALL_LOGGINGINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOGGING_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTOINSTALL_CUSTOMSCRIPTURL=$(sed -n '/^[[:blank:]]*AUTO_SETUP_CUSTOM_SCRIPT_EXEC=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - local AUTOINSTALL_TIMESYNCMODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_RESTORE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_BACKUP_RESTORE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_RAMLOG_SIZE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTO_SETUP_DHCP_TO_STATIC=$(grep -cm1 '^[[:blank:]]*AUTO_SETUP_DHCP_TO_STATIC=1' /boot/dietpi.txt) @@ -14510,7 +14518,6 @@ _EOF_ [[ $AUTOINSTALL_FILESERVERINDEX ]] || AUTOINSTALL_FILESERVERINDEX=0 # pre-v7.9 [[ $AUTOINSTALL_LOGGINGINDEX ]] || AUTOINSTALL_LOGGINGINDEX=-1 [[ $AUTOINSTALL_CUSTOMSCRIPTURL ]] || AUTOINSTALL_CUSTOMSCRIPTURL=0 - [[ $AUTOINSTALL_TIMESYNCMODE ]] || AUTOINSTALL_TIMESYNCMODE=2 [[ $AUTOINSTALL_RESTORE ]] || AUTOINSTALL_RESTORE=0 [[ $AUTOINSTALL_RAMLOG_SIZE ]] || AUTOINSTALL_RAMLOG_SIZE=50 @@ -14665,7 +14672,7 @@ _EOF_ findmnt /var/log > /dev/null && G_EXEC mount -o remount /var/log # Set time sync mode if no container system - (( $G_HW_MODEL == 75 )) || /boot/dietpi/func/dietpi-set_software ntpd-mode "$AUTOINSTALL_TIMESYNCMODE" + (( $G_HW_MODEL == 75 )) || /boot/dietpi/func/dietpi-set_software ntpd-mode # Apply choice and preference system settings Apply_SSHServer_Choices "$AUTOINSTALL_SSHINDEX" diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 6e88809437..8a6d02944d 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=7 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=8 + [[ $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 @@ -444,7 +444,7 @@ $grey───────────────────────── # - G_WHIP_RETURNED_VALUE | Returned value from inputbox/menu/checklist based whiptail items # G_WHIP_DESTROY | Clear vars after run of whiptail - G_WHIP_DESTROY(){ unset -v G_WHIP_DEFAULT_ITEM G_WHIP_SIZE_X_MAX G_WHIP_BUTTON_OK_TEXT G_WHIP_BUTTON_CANCEL_TEXT G_WHIP_NOCANCEL G_WHIP_MENU_ARRAY G_WHIP_CHECKLIST_ARRAY; } + G_WHIP_DESTROY(){ unset -v G_WHIP_DEFAULT_ITEM G_WHIP_SIZE_X_MAX G_WHIP_BUTTON_OK_TEXT G_WHIP_BUTTON_CANCEL_TEXT G_WHIP_NOCANCEL G_WHIP_MENU_ARRAY G_WHIP_CHECKLIST_ARRAY G_WHIP_INPUTBOX_REGEX G_WHIP_INPUTBOX_REGEX_TEXT; } # Run once, to be failsafe in case any exported/environment variables are left from originating shell G_WHIP_DESTROY @@ -700,6 +700,7 @@ $grey───────────────────────── # G_WHIP_INPUTBOX "message" # - Prompt user to input text and save it to G_WHIP_RETURNED_VALUE + # - G_WHIP_INPUTBOX_REGEX/G_WHIP_INPUTBOX_REGEX_TEXT: Regular expression and description about allowed input. Defaults to the requirement that the input is not empty. # - Exit code: 0=input done, else=user cancelled or noninteractive G_WHIP_INPUTBOX() { @@ -713,10 +714,12 @@ $grey───────────────────────── while : do G_WHIP_INIT + G_WHIP_INPUTBOX_REGEX=${G_WHIP_INPUTBOX_REGEX:-'.'} + G_WHIP_INPUTBOX_REGEX_TEXT=${G_WHIP_INPUTBOX_REGEX_TEXT:-'not be empty'} # shellcheck disable=SC2086 G_WHIP_RETURNED_VALUE=$(whiptail ${G_PROGRAM_NAME:+--title "$G_PROGRAM_NAME"} --backtitle "$WHIP_BACKTITLE" --inputbox "$WHIP_ERROR$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" "${NOCANCEL[@]}" $WHIP_SCROLLTEXT "$WHIP_SIZE_Y" "$WHIP_SIZE_X" "$G_WHIP_DEFAULT_ITEM" 3>&1 1>&2 2>&3-; echo $? > /tmp/.G_WHIP_INPUTBOX_RESULT) read -r result < /tmp/.G_WHIP_INPUTBOX_RESULT; rm -f /tmp/.G_WHIP_INPUTBOX_RESULT - [[ $result == 0 && -z $G_WHIP_RETURNED_VALUE ]] && { WHIP_ERROR='[FAILED] An input value was not entered, please try again...\n\n'; continue; } + [[ $result == 0 && ! $G_WHIP_RETURNED_VALUE =~ $G_WHIP_INPUTBOX_REGEX ]] && { WHIP_ERROR="[FAILED] Input must $G_WHIP_INPUTBOX_REGEX_TEXT, please try again ...\n\n"; continue; } break done diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 030bf3cceb..b7876fd05e 100755 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -12,6 +12,8 @@ # - Generates /boot/dietpi/.hw_model # - Called from /boot/dietpi/preboot, called by /etc/systemd/system/dietpi-preboot.service # + # G_HW_MODEL 92 NanoPi M6 + # G_HW_MODEL 91 Orange Pi 5 Max # G_HW_MODEL 90 Radxa ZERO 3 # G_HW_MODEL 89 Orange Pi 3 LTS # G_HW_MODEL 88 Orange Pi Zero 2W @@ -366,7 +368,17 @@ G_HW_MODEL=$(mawk 'NR==1' "$FP_G_HW_MODEL_IDENTIFIER") - if (( $G_HW_MODEL == 90 )); then + if (( $G_HW_MODEL == 92 )); then + + G_HW_MODEL_NAME='NanoPi M6' + G_HW_CPUID=11 + + elif (( $G_HW_MODEL == 91 )); then + + G_HW_MODEL_NAME='Orange Pi 5 Max' + G_HW_CPUID=11 + + elif (( $G_HW_MODEL == 90 )); then G_HW_MODEL_NAME='Radxa ZERO 3' G_HW_CPUID=9 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 28f77b0d91..5f48bc73c5 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -547,18 +547,18 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # Ethernet force link speed + # eth-forcespeed: Ethernet force link speed #///////////////////////////////////////////////////////////////////////////////////// - Eth_Force_Speed_Main(){ - - if disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 1; then - + Eth_Force_Speed_Main() + { + if disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 1 + then local speed_mbit=$INPUT_DEVICE_VALUE local iface=$(G_GET_NET -t eth iface) cat << _EOF_ > /etc/systemd/system/ethtool_force_speed.service [Unit] -Description=ethtool force speed (DietPi) +Description=Enforce $speed_mbit Mbit on $iface via ethtool (DietPi) Wants=network-online.target After=network-online.target @@ -572,21 +572,17 @@ _EOF_ G_EXEC systemctl daemon-reload G_EXEC systemctl enable --now ethtool_force_speed - elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to "disable" - + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]] # 0 is converted to "disable" + then if [[ -f '/etc/systemd/system/ethtool_force_speed.service' ]] then G_EXEC systemctl disable --now ethtool_force_speed G_EXEC rm /etc/systemd/system/ethtool_force_speed.service fi [[ -d '/etc/systemd/system/ethtool_force_speed.service.d' ]] && G_EXEC rm -R /etc/systemd/system/ethtool_force_speed.service.d - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// @@ -1152,40 +1148,36 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Bluetooth #///////////////////////////////////////////////////////////////////////////////////// - Bluetooth_Main(){ - + Bluetooth_Main() + { local aBLUETOOTH_MODULES=( - 'bluetooth' 'bnep' 'btbcm' # RPi3 Broadcom onboard 'rfcomm' # BPi Pro/M2+ and others 'hidp' # BPi Pro/M2+ and others - 'hci_uart' ) - [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] && aBLUETOOTH_MODULES+=('sprdbt_tty') # Orange Pi 3B/Zero 3/Zero 2W - - if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + case $G_HW_MODEL in + [0-9]) (( $G_HW_ONBOARD_WIFI )) && aBLUETOOTH_MODULES+=('hci_uart');; # RPi. This kernel module is used by other SBCs, but e.g. on ROCK 4 SE it is needed as well for WiFi: https://github.com/MichaIng/DietPi/issues/6943 + 83|87|88) aBLUETOOTH_MODULES+=('sprdbt_tty');; # Orange Pi 3B/Zero 3/Zero 2W + *) :;; + esac + if [[ $INPUT_DEVICE_VALUE == 'disable' ]] + then # RPi - if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then - + if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )) + then # Do not stop the service, otherwise it cannot be started anymore until reboot. Also for this reason the service is not stopped on pi-bluetooth package removal, hence disabling it on "is-active" via "disable --now" fails due to missing service file: https://github.com/RPi-Distro/pi-bluetooth/issues/34, https://github.com/MichaIng/DietPi/issues/5435 systemctl -q is-enabled hciuart 2> /dev/null && G_EXEC systemctl disable hciuart # Disable onboard Bluetooth via device tree overlay G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /boot/config.txt - # ASUS TB - elif (( $G_HW_MODEL == 52 )) && systemctl list-unit-files 'hciuart.service' > /dev/null; then - - systemctl -q is-enabled hciuart 2> /dev/null || systemctl -q is-active hciuart && G_EXEC systemctl disable --now hciuart - # Broadcom-based models that need brcm_patchram_plus - elif [[ $G_HW_MODEL == 6[12] ]] && systemctl list-unit-files 'brcm_patchram_plus.service' > /dev/null; then - + elif [[ $G_HW_MODEL == 6[12] ]] && systemctl list-unit-files 'brcm_patchram_plus.service' > /dev/null + then systemctl -q is-enabled brcm_patchram_plus 2> /dev/null || systemctl -q is-active brcm_patchram_plus && G_EXEC systemctl disable --now brcm_patchram_plus - fi systemctl -q is-enabled bluetooth 2> /dev/null || systemctl -q is-active bluetooth && G_EXEC systemctl disable --now bluetooth @@ -1194,7 +1186,7 @@ _EOF_ [[ -f '/etc/modules-load.d/dietpi-enable_bluetooth.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-enable_bluetooth.conf # Unload and blacklist kernel modules, bluetooth last - [[ -d '/etc/modprobe.d' ]] || G_EXEC mkdir /etc/modprobe.d + G_EXEC mkdir -p /etc/modprobe.d > /etc/modprobe.d/dietpi-disable_bluetooth.conf for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) do @@ -1205,12 +1197,12 @@ _EOF_ # Purge packages if (( $G_DIETPI_INSTALL_STAGE >= 0 )) then - G_AGP bluez bluez-firmware pi-bluetooth rtl8723ds-firmware + G_AGP bluez bluez-firmware pi-bluetooth rtl8723ds-firmware sprd-bluetooth G_AGA fi - elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - + elif [[ $INPUT_DEVICE_VALUE == 'enable' ]] + then # Remove kernel module blacklist [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_bluetooth.conf @@ -1263,15 +1255,12 @@ Do you want to continue and disable the serial login console?' || return 1 # Orange Pi 3B/Zero 3/Zero 2W: Module does not load automatically elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then - modprobe -n sprdbt_tty 2> /dev/null && G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' + G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' + G_AG_CHECK_INSTALL_PREREQ sprd-bluetooth fi - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// @@ -1406,7 +1395,7 @@ Do you want to continue and disable the serial login console?' || return 1 # - Orange Pi 3B/Zero 3/Zero 2W: Module does not load automatically elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then - modprobe -n sprdwl_ng 2> /dev/null && G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' + G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi # Remove blacklists @@ -1535,7 +1524,7 @@ Do you want to continue and disable the serial login console?' || return 1 elif (( $DIETPIENV || $G_HW_MODEL == 49 || $G_HW_MODEL == 76 || $G_HW_MODEL == 79 )) then local baudrate='115200' - if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|78|79|80|82|85|87|90)$ && $INPUT_ADDITIONAL =~ ^('ttyS2'|'ttyFIQ0')$ ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]] + if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|78|79|80|82|85|87|90|91|92)$ && $INPUT_ADDITIONAL =~ ^('ttyS2'|'ttyFIQ0')$ ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]] then baudrate='1500000' [[ -d /etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d ]] || G_EXEC mkdir "/etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d" diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index ca4952bf64..0a812b7b8e 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -19,6 +19,7 @@ $FP_SCRIPT useradd X=create user with name X and default permissions, using g $FP_SCRIPT apt-mirror |default $FP_SCRIPT apt clean|reset|cache|lists|archives|compress [enable|disable|ram|disk] $FP_SCRIPT ntpd-mode [0-4] Time sync modes: 0=custom|1=boot|2=boot+daily|3=boot+hourly|4=daemon+drift +$FP_SCRIPT timesync-mirror Apply network time sync mirror from dietpi.txt $FP_SCRIPT verify_dietpi.txt Verifies dietpi.txt entries, adds missing entries if required $FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=optional set X as global password for future dietpi-software installations and \"root\" + \"dietpi\" login passwords. $FP_SCRIPT boot_wait_for_network [01] Enable or disable waiting for network interface configuration before DietPi-PostBoot is started, including postboot.d custom scripts and service startups @@ -228,12 +229,18 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 3) all_components='rock4cplus';; *) [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) - [[ $all_components ]] || for i in rock{pi-4b,-4se,pi-4cplus} - do - dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue - all_components=${i/-//} - break - done + [[ $all_components ]] || if dpkg-query -s 'linux-u-boot-rockpi-4b-current' &> /dev/null + then + all_components='rock4' + + elif dpkg-query -s 'linux-u-boot-rock-4se-current' &> /dev/null + then + all_components='rock4se' + + elif dpkg-query -s 'linux-u-boot-rockpi-4cplus-current' &> /dev/null + then + all_components='rock4cplus' + fi ;; esac ;; @@ -287,6 +294,8 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 88) all_components='orangepizero2w';; 89) all_components='orangepi3lts';; 90) all_components='radxazero3';; + 91) all_components='orangepi5max';; + 92) all_components='nanopim6';; *) :;; esac G_EXEC eval "echo 'deb https://dietpi.com/apt $G_DISTRO_NAME $components' > /etc/apt/sources.list.d/dietpi.list" @@ -425,52 +434,58 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt #///////////////////////////////////////////////////////////////////////////////////// # ntpd-mode: Also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR #///////////////////////////////////////////////////////////////////////////////////// - TimeSync_Main() + TimeSync_Mirror() { - if [[ ! $INPUT_MODE_VALUE || $INPUT_MODE_VALUE == [0-4] ]] - then - # If no input given, re-apply current dietpi.txt setting, else revert to default mode 2 - [[ $INPUT_MODE_VALUE ]] || INPUT_MODE_VALUE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - [[ $INPUT_MODE_VALUE ]] || INPUT_MODE_VALUE=2 - - local ntp_mirror=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MIRROR=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - [[ $ntp_mirror ]] || ntp_mirror='default' + local ntp_mirror=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MIRROR=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + [[ $ntp_mirror ]] || ntp_mirror='default' - # Gateway, auto detect local gateway(s)/router(s) to use as NTP server(s). - if [[ ${ntp_mirror,,} == 'gateway' ]] + # Gateway, auto detect local gateway(s)/router(s) to use as NTP server(s). + if [[ ${ntp_mirror,,} == 'gateway' ]] + then + # Convert mawk output to single line via ORS, remove trailing space afterwards + local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' '); gateway=${gateway% } + if [[ $gateway ]] then - # Convert mawk output to single line via ORS, remove trailing space afterwards - local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' '); gateway=${gateway% } - if [[ $gateway ]] + G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)." + ntp_mirror=$gateway + else + G_DIETPI-NOTIFY 1 'No local gateway detected. Reverting NTP mirror back to system defaults.' + EXIT_CODE=1 + ntp_mirror='default' + fi + fi + + # Default, lets timesyncd use DHCP server or fallback to debian.pool.ntp.org. + if [[ ${ntp_mirror,,} == 'default' ]] + then + [[ -f '/etc/systemd/timesyncd.conf' ]] && G_EXEC rm /etc/systemd/timesyncd.conf + else + local i ntp_mirror_entry + for i in $ntp_mirror + do + if [[ $i == *'pool.ntp.org' ]] then - G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)." - ntp_mirror=$gateway + ntp_mirror_entry+="0.$i 1.$i 2.$i 3.$i " else - G_DIETPI-NOTIFY 1 'No local gateway detected. Reverting NTP mirror back to system defaults.' - EXIT_CODE=1 - ntp_mirror='default' + ntp_mirror_entry+="$i " fi - fi + done - # Default, lets timesyncd use DHCP server or fallback to debian.pool.ntp.org. - if [[ ${ntp_mirror,,} == 'default' ]] - then - [[ -f '/etc/systemd/timesyncd.conf' ]] && G_EXEC rm /etc/systemd/timesyncd.conf - else - local i ntp_mirror_entry - for i in $ntp_mirror - do - if [[ $i == *'pool.ntp.org' ]] - then - ntp_mirror_entry+="0.$i 1.$i 2.$i 3.$i " - else - ntp_mirror_entry+="$i " - fi - done + # Set mirror + echo -e "[Time]\nNTP=${ntp_mirror_entry% }" > /etc/systemd/timesyncd.conf + fi + } - # Set mirror - echo -e "[Time]\nNTP=${ntp_mirror_entry% }" > /etc/systemd/timesyncd.conf - fi + TimeSync_Main() + { + if [[ ! $INPUT_MODE_VALUE || $INPUT_MODE_VALUE == [0-4] ]] + then + # Apply mirror as well + TimeSync_Mirror + + # If no input given, re-apply current dietpi.txt setting, else revert to default mode 2 + [[ $INPUT_MODE_VALUE ]] || INPUT_MODE_VALUE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + [[ $INPUT_MODE_VALUE == [0-4] ]] || INPUT_MODE_VALUE=2 # Daemon mode: dbus required for timedatectl which users may expect if [[ $INPUT_MODE_VALUE == 4 ]] @@ -876,7 +891,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt \n- $optional for ${models[$optional]}" && to_install=("$optional") || to_remove=("$optional") fi - G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils tiny-initramfs + G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils-core tiny-initramfs G_AGP "${to_remove[@]}" raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 } @@ -891,6 +906,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt 'apt'|'apt-cache') Apt_Main;; # Pre-v8.4: Backwards compatibility for "apt-cache" => "apt cache" 'useradd') Useradd_Main;; 'ntpd-mode') TimeSync_Main;; + 'timesync-mirror') TimeSync_Mirror;; 'allo') Allo_Main;; 'verify_dietpi.txt') Verify_DietPi_Txt;; 'locale') Locale_Main;; diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 154914524b..c0016c2ba9 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -235,6 +235,9 @@ _EOF_ fi + # Disable serial console if set in dietpi.txt + grep -q '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=0' /boot/dietpi.txt && /boot/dietpi/func/dietpi-set_hardware serialconsole disable + # Regenerate unique Dropbear host keys local i type for i in /etc/dropbear/dropbear_*_host_key @@ -251,9 +254,6 @@ _EOF_ # Apply SSH password login setting /boot/dietpi/func/dietpi-set_software disable_ssh_password_logins - # Disable serial console if set in dietpi.txt - grep -q '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=0' /boot/dietpi.txt && /boot/dietpi/func/dietpi-set_hardware serialconsole disable - # Apply forced Ethernet link speed if set in dietpi.txt /boot/dietpi/func/dietpi-set_hardware eth-forcespeed "$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_ETH_FORCE_SPEED=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)" @@ -347,6 +347,10 @@ _EOF_ # - Boot wait for network /boot/dietpi/func/dietpi-set_software boot_wait_for_network "$(( ! $(grep -cm1 '^[[:blank:]]*AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=0' /boot/dietpi.txt) ))" + # Apply network time sync mirror and force sync now to speed up first run setup + /boot/dietpi/func/dietpi-set_software timesync-mirror + systemctl restart systemd-timesyncd + # x86_64 BIOS: Set GRUB install device: https://github.com/MichaIng/DietPi/issues/4542 if (( $G_HW_MODEL == 10 )) && dpkg-query -s grub-pc &> /dev/null then diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index cf74b97788..f806c7f808 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -44,8 +44,7 @@ # Check if the last partition contains a FAT filesystem with DIETPISETUP label REBOOT=0 - LAST_PART=$(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) - if [[ $LAST_PART == 'vfat DIETPISETUP' ]] + if [[ $(lsblk -no LABEL "$ROOT_DRIVE" | tail -1) == 'DIETPISETUP' ]] then SETUP_PART=$(sfdisk -lqo DEVICE "$ROOT_DRIVE" | tail -1) echo "[ INFO ] Detected trailing DietPi setup partition $SETUP_PART" @@ -86,7 +85,7 @@ umount -v "$BOOT_PART" rmdir -v "$TMP_MOUNT" else - echo "[ INFO ] No DietPi setup partition found, last partition is: \"$LAST_PART\"" + echo '[ INFO ] No DietPi setup partition found:' lsblk -po NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINT "$ROOT_DRIVE" fi